@metamask/design-system-react-native 0.37.0 → 0.38.1
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 +31 -1
- package/dist/components/BannerBase/BannerBase.cjs +4 -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 +4 -3
- package/dist/components/BannerBase/BannerBase.mjs.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs.map +1 -1
- package/dist/components/BoxRow/BoxRow.types.cjs.map +1 -1
- package/dist/components/BoxRow/BoxRow.types.d.cts +4 -3
- package/dist/components/BoxRow/BoxRow.types.d.cts.map +1 -1
- package/dist/components/BoxRow/BoxRow.types.d.mts +4 -3
- package/dist/components/BoxRow/BoxRow.types.d.mts.map +1 -1
- package/dist/components/BoxRow/BoxRow.types.mjs.map +1 -1
- package/dist/components/Content/Content.cjs +1 -1
- package/dist/components/Content/Content.cjs.map +1 -1
- package/dist/components/Content/Content.mjs +1 -1
- package/dist/components/Content/Content.mjs.map +1 -1
- package/dist/components/Content/Content.types.cjs.map +1 -1
- package/dist/components/Content/Content.types.d.cts +10 -6
- package/dist/components/Content/Content.types.d.cts.map +1 -1
- package/dist/components/Content/Content.types.d.mts +10 -6
- package/dist/components/Content/Content.types.d.mts.map +1 -1
- package/dist/components/Content/Content.types.mjs.map +1 -1
- package/dist/components/HelpText/HelpText.cjs +28 -0
- package/dist/components/HelpText/HelpText.cjs.map +1 -0
- package/dist/components/HelpText/HelpText.constants.cjs +11 -0
- package/dist/components/HelpText/HelpText.constants.cjs.map +1 -0
- package/dist/components/HelpText/HelpText.constants.d.cts +3 -0
- package/dist/components/HelpText/HelpText.constants.d.cts.map +1 -0
- package/dist/components/HelpText/HelpText.constants.d.mts +3 -0
- package/dist/components/HelpText/HelpText.constants.d.mts.map +1 -0
- package/dist/components/HelpText/HelpText.constants.mjs +8 -0
- package/dist/components/HelpText/HelpText.constants.mjs.map +1 -0
- package/dist/components/HelpText/HelpText.d.cts +4 -0
- package/dist/components/HelpText/HelpText.d.cts.map +1 -0
- package/dist/components/HelpText/HelpText.d.mts +4 -0
- package/dist/components/HelpText/HelpText.d.mts.map +1 -0
- package/dist/components/HelpText/HelpText.mjs +28 -0
- package/dist/components/HelpText/HelpText.mjs.map +1 -0
- package/dist/components/HelpText/HelpText.types.cjs +3 -0
- package/dist/components/HelpText/HelpText.types.cjs.map +1 -0
- package/dist/components/HelpText/HelpText.types.d.cts +4 -0
- package/dist/components/HelpText/HelpText.types.d.cts.map +1 -0
- package/dist/components/HelpText/HelpText.types.d.mts +4 -0
- package/dist/components/HelpText/HelpText.types.d.mts.map +1 -0
- package/dist/components/HelpText/HelpText.types.mjs +2 -0
- package/dist/components/HelpText/HelpText.types.mjs.map +1 -0
- package/dist/components/HelpText/index.cjs +8 -0
- package/dist/components/HelpText/index.cjs.map +1 -0
- package/dist/components/HelpText/index.d.cts +4 -0
- package/dist/components/HelpText/index.d.cts.map +1 -0
- package/dist/components/HelpText/index.d.mts +4 -0
- package/dist/components/HelpText/index.d.mts.map +1 -0
- package/dist/components/HelpText/index.mjs +3 -0
- package/dist/components/HelpText/index.mjs.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.cjs +1 -1
- 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 +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.mjs.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.types.cjs.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.types.d.cts +6 -2
- package/dist/components/KeyValueRow/KeyValueRow.types.d.cts.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.types.d.mts +6 -2
- package/dist/components/KeyValueRow/KeyValueRow.types.d.mts.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.types.mjs.map +1 -1
- package/dist/components/KeyValueSelect/KeyValueSelect.cjs +55 -0
- package/dist/components/KeyValueSelect/KeyValueSelect.cjs.map +1 -0
- package/dist/components/KeyValueSelect/KeyValueSelect.d.cts +11 -0
- package/dist/components/KeyValueSelect/KeyValueSelect.d.cts.map +1 -0
- package/dist/components/KeyValueSelect/KeyValueSelect.d.mts +11 -0
- package/dist/components/KeyValueSelect/KeyValueSelect.d.mts.map +1 -0
- package/dist/components/KeyValueSelect/KeyValueSelect.mjs +36 -0
- package/dist/components/KeyValueSelect/KeyValueSelect.mjs.map +1 -0
- package/dist/components/KeyValueSelect/KeyValueSelect.types.cjs +3 -0
- package/dist/components/KeyValueSelect/KeyValueSelect.types.cjs.map +1 -0
- package/dist/components/KeyValueSelect/KeyValueSelect.types.d.cts +47 -0
- package/dist/components/KeyValueSelect/KeyValueSelect.types.d.cts.map +1 -0
- package/dist/components/KeyValueSelect/KeyValueSelect.types.d.mts +47 -0
- package/dist/components/KeyValueSelect/KeyValueSelect.types.d.mts.map +1 -0
- package/dist/components/KeyValueSelect/KeyValueSelect.types.mjs +2 -0
- package/dist/components/KeyValueSelect/KeyValueSelect.types.mjs.map +1 -0
- package/dist/components/KeyValueSelect/index.cjs +8 -0
- package/dist/components/KeyValueSelect/index.cjs.map +1 -0
- package/dist/components/KeyValueSelect/index.d.cts +4 -0
- package/dist/components/KeyValueSelect/index.d.cts.map +1 -0
- package/dist/components/KeyValueSelect/index.d.mts +4 -0
- package/dist/components/KeyValueSelect/index.d.mts.map +1 -0
- package/dist/components/KeyValueSelect/index.mjs +3 -0
- package/dist/components/KeyValueSelect/index.mjs.map +1 -0
- package/dist/components/Slider/useSliderGesture.cjs +126 -10
- package/dist/components/Slider/useSliderGesture.cjs.map +1 -1
- package/dist/components/Slider/useSliderGesture.d.cts +11 -1
- package/dist/components/Slider/useSliderGesture.d.cts.map +1 -1
- package/dist/components/Slider/useSliderGesture.d.mts +11 -1
- package/dist/components/Slider/useSliderGesture.d.mts.map +1 -1
- package/dist/components/Slider/useSliderGesture.mjs +126 -10
- package/dist/components/Slider/useSliderGesture.mjs.map +1 -1
- package/dist/components/TitleHub/TitleHub.types.cjs.map +1 -1
- package/dist/components/TitleHub/TitleHub.types.d.cts +5 -2
- package/dist/components/TitleHub/TitleHub.types.d.cts.map +1 -1
- package/dist/components/TitleHub/TitleHub.types.d.mts +5 -2
- package/dist/components/TitleHub/TitleHub.types.d.mts.map +1 -1
- package/dist/components/TitleHub/TitleHub.types.mjs.map +1 -1
- package/dist/components/index.cjs +8 -2
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +4 -0
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +4 -0
- package/dist/components/index.d.mts.map +1 -1
- package/dist/components/index.mjs +2 -0
- package/dist/components/index.mjs.map +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.cjs +2 -2
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.cjs.map +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.mjs +2 -2
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.mjs.map +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.cjs.map +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.cts +4 -3
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.cts.map +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.mts +4 -3
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.mts.map +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ContentPropsShared } from "@metamask/design-system-shared";
|
|
2
2
|
import type { BoxProps } from "../Box/Box.types.cjs";
|
|
3
|
+
import type { SensitiveTextProps } from "../SensitiveText/index.cjs";
|
|
3
4
|
import type { TextProps } from "../Text/Text.types.cjs";
|
|
4
5
|
/**
|
|
5
6
|
* Content component props.
|
|
@@ -13,19 +14,22 @@ export type ContentProps = Omit<BoxProps, 'children'> & ContentPropsShared & {
|
|
|
13
14
|
*/
|
|
14
15
|
titleProps?: Partial<Omit<TextProps, 'children'>>;
|
|
15
16
|
/**
|
|
16
|
-
* Optional props for the description
|
|
17
|
+
* Optional props for the description SensitiveText when `description` is a string.
|
|
18
|
+
* Supports Text props plus `isHidden` / `length`.
|
|
17
19
|
* Default: TextVariant.BodySm, FontWeight.Medium, TextColor.TextAlternative.
|
|
18
20
|
*/
|
|
19
|
-
descriptionProps?: Partial<Omit<
|
|
21
|
+
descriptionProps?: Partial<Omit<SensitiveTextProps, 'children'>>;
|
|
20
22
|
/**
|
|
21
|
-
* Optional props for the value
|
|
23
|
+
* Optional props for the value SensitiveText when `value` is a string.
|
|
24
|
+
* Supports Text props plus `isHidden` / `length`.
|
|
22
25
|
* Default: TextVariant.BodyMd, FontWeight.Medium, TextColor.TextDefault.
|
|
23
26
|
*/
|
|
24
|
-
valueProps?: Partial<Omit<
|
|
27
|
+
valueProps?: Partial<Omit<SensitiveTextProps, 'children'>>;
|
|
25
28
|
/**
|
|
26
|
-
* Optional props for the subvalue
|
|
29
|
+
* Optional props for the subvalue SensitiveText when `subvalue` is a string.
|
|
30
|
+
* Supports Text props plus `isHidden` / `length`.
|
|
27
31
|
* Default: TextVariant.BodySm, FontWeight.Medium, TextColor.TextAlternative.
|
|
28
32
|
*/
|
|
29
|
-
subvalueProps?: Partial<Omit<
|
|
33
|
+
subvalueProps?: Partial<Omit<SensitiveTextProps, 'children'>>;
|
|
30
34
|
};
|
|
31
35
|
//# sourceMappingURL=Content.types.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.types.d.cts","sourceRoot":"","sources":["../../../src/components/Content/Content.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,uCAAuC;AAEzE,OAAO,KAAK,EAAE,QAAQ,EAAE,6BAAyB;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,GACnD,kBAAkB,GAAG;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IAClD
|
|
1
|
+
{"version":3,"file":"Content.types.d.cts","sourceRoot":"","sources":["../../../src/components/Content/Content.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,uCAAuC;AAEzE,OAAO,KAAK,EAAE,QAAQ,EAAE,6BAAyB;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,mCAAyB;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,GACnD,kBAAkB,GAAG;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IAClD;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC,CAAC;IACjE;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC,CAAC;IAC3D;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC,CAAC;CAC/D,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ContentPropsShared } from "@metamask/design-system-shared";
|
|
2
2
|
import type { BoxProps } from "../Box/Box.types.mjs";
|
|
3
|
+
import type { SensitiveTextProps } from "../SensitiveText/index.mjs";
|
|
3
4
|
import type { TextProps } from "../Text/Text.types.mjs";
|
|
4
5
|
/**
|
|
5
6
|
* Content component props.
|
|
@@ -13,19 +14,22 @@ export type ContentProps = Omit<BoxProps, 'children'> & ContentPropsShared & {
|
|
|
13
14
|
*/
|
|
14
15
|
titleProps?: Partial<Omit<TextProps, 'children'>>;
|
|
15
16
|
/**
|
|
16
|
-
* Optional props for the description
|
|
17
|
+
* Optional props for the description SensitiveText when `description` is a string.
|
|
18
|
+
* Supports Text props plus `isHidden` / `length`.
|
|
17
19
|
* Default: TextVariant.BodySm, FontWeight.Medium, TextColor.TextAlternative.
|
|
18
20
|
*/
|
|
19
|
-
descriptionProps?: Partial<Omit<
|
|
21
|
+
descriptionProps?: Partial<Omit<SensitiveTextProps, 'children'>>;
|
|
20
22
|
/**
|
|
21
|
-
* Optional props for the value
|
|
23
|
+
* Optional props for the value SensitiveText when `value` is a string.
|
|
24
|
+
* Supports Text props plus `isHidden` / `length`.
|
|
22
25
|
* Default: TextVariant.BodyMd, FontWeight.Medium, TextColor.TextDefault.
|
|
23
26
|
*/
|
|
24
|
-
valueProps?: Partial<Omit<
|
|
27
|
+
valueProps?: Partial<Omit<SensitiveTextProps, 'children'>>;
|
|
25
28
|
/**
|
|
26
|
-
* Optional props for the subvalue
|
|
29
|
+
* Optional props for the subvalue SensitiveText when `subvalue` is a string.
|
|
30
|
+
* Supports Text props plus `isHidden` / `length`.
|
|
27
31
|
* Default: TextVariant.BodySm, FontWeight.Medium, TextColor.TextAlternative.
|
|
28
32
|
*/
|
|
29
|
-
subvalueProps?: Partial<Omit<
|
|
33
|
+
subvalueProps?: Partial<Omit<SensitiveTextProps, 'children'>>;
|
|
30
34
|
};
|
|
31
35
|
//# sourceMappingURL=Content.types.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.types.d.mts","sourceRoot":"","sources":["../../../src/components/Content/Content.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,uCAAuC;AAEzE,OAAO,KAAK,EAAE,QAAQ,EAAE,6BAAyB;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,GACnD,kBAAkB,GAAG;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IAClD
|
|
1
|
+
{"version":3,"file":"Content.types.d.mts","sourceRoot":"","sources":["../../../src/components/Content/Content.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,uCAAuC;AAEzE,OAAO,KAAK,EAAE,QAAQ,EAAE,6BAAyB;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,mCAAyB;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,GACnD,kBAAkB,GAAG;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IAClD;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC,CAAC;IACjE;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC,CAAC;IAC3D;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC,CAAC;CAC/D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.types.mjs","sourceRoot":"","sources":["../../../src/components/Content/Content.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ContentPropsShared } from '@metamask/design-system-shared';\n\nimport type { BoxProps } from '../Box/Box.types';\nimport type { TextProps } from '../Text/Text.types';\n\n/**\n * Content component props.\n *\n * Props-only layout for the inner list row (`title`, `avatar`, inline row accessories, etc.).\n */\nexport type ContentProps = Omit<BoxProps, 'children'> &\n ContentPropsShared & {\n /**\n * Optional props for the title Text when `title` is a string.\n * Default: TextVariant.BodyMd, FontWeight.Medium, TextColor.TextDefault.\n */\n titleProps?: Partial<Omit<TextProps, 'children'>>;\n /**\n * Optional props for the description
|
|
1
|
+
{"version":3,"file":"Content.types.mjs","sourceRoot":"","sources":["../../../src/components/Content/Content.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ContentPropsShared } from '@metamask/design-system-shared';\n\nimport type { BoxProps } from '../Box/Box.types';\nimport type { SensitiveTextProps } from '../SensitiveText';\nimport type { TextProps } from '../Text/Text.types';\n\n/**\n * Content component props.\n *\n * Props-only layout for the inner list row (`title`, `avatar`, inline row accessories, etc.).\n */\nexport type ContentProps = Omit<BoxProps, 'children'> &\n ContentPropsShared & {\n /**\n * Optional props for the title Text when `title` is a string.\n * Default: TextVariant.BodyMd, FontWeight.Medium, TextColor.TextDefault.\n */\n titleProps?: Partial<Omit<TextProps, 'children'>>;\n /**\n * Optional props for the description SensitiveText when `description` is a string.\n * Supports Text props plus `isHidden` / `length`.\n * Default: TextVariant.BodySm, FontWeight.Medium, TextColor.TextAlternative.\n */\n descriptionProps?: Partial<Omit<SensitiveTextProps, 'children'>>;\n /**\n * Optional props for the value SensitiveText when `value` is a string.\n * Supports Text props plus `isHidden` / `length`.\n * Default: TextVariant.BodyMd, FontWeight.Medium, TextColor.TextDefault.\n */\n valueProps?: Partial<Omit<SensitiveTextProps, 'children'>>;\n /**\n * Optional props for the subvalue SensitiveText when `subvalue` is a string.\n * Supports Text props plus `isHidden` / `length`.\n * Default: TextVariant.BodySm, FontWeight.Medium, TextColor.TextAlternative.\n */\n subvalueProps?: Partial<Omit<SensitiveTextProps, 'children'>>;\n };\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
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.HelpText = void 0;
|
|
7
|
+
const design_system_shared_1 = require("@metamask/design-system-shared");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const Box_1 = require("../Box/index.cjs");
|
|
10
|
+
const IconAlert_1 = require("../IconAlert/index.cjs");
|
|
11
|
+
const Text_1 = require("../Text/index.cjs");
|
|
12
|
+
const HelpText_constants_1 = require("./HelpText.constants.cjs");
|
|
13
|
+
const HelpText = ({ severity, showIcon = false, color = design_system_shared_1.TextColor.TextDefault, twClassName, style, testID, children, ...props }) => {
|
|
14
|
+
const textColor = severity ? HelpText_constants_1.MAP_HELPTEXT_SEVERITY_COLOR[severity] : color;
|
|
15
|
+
if (!(showIcon && severity)) {
|
|
16
|
+
return (<Text_1.Text variant={design_system_shared_1.TextVariant.BodySm} color={textColor} twClassName={twClassName} style={style} testID={testID} {...props}>
|
|
17
|
+
{children}
|
|
18
|
+
</Text_1.Text>);
|
|
19
|
+
}
|
|
20
|
+
return (<Box_1.Box flexDirection={design_system_shared_1.BoxFlexDirection.Row} alignItems={design_system_shared_1.BoxAlignItems.Center} gap={1} twClassName={twClassName} style={style} testID={testID}>
|
|
21
|
+
<IconAlert_1.IconAlert severity={severity} size={design_system_shared_1.IconSize.Sm} testID="help-text-icon"/>
|
|
22
|
+
<Text_1.Text variant={design_system_shared_1.TextVariant.BodySm} color={textColor} {...props}>
|
|
23
|
+
{children}
|
|
24
|
+
</Text_1.Text>
|
|
25
|
+
</Box_1.Box>);
|
|
26
|
+
};
|
|
27
|
+
exports.HelpText = HelpText;
|
|
28
|
+
//# sourceMappingURL=HelpText.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpText.cjs","sourceRoot":"","sources":["../../../src/components/HelpText/HelpText.tsx"],"names":[],"mappings":";;;;;;AAAA,yEAMwC;AACxC,kDAA0B;AAE1B,0CAA6B;AAC7B,sDAAyC;AACzC,4CAA+B;AAE/B,iEAAmE;AAG5D,MAAM,QAAQ,GAA4B,CAAC,EAChD,QAAQ,EACR,QAAQ,GAAG,KAAK,EAChB,KAAK,GAAG,gCAAS,CAAC,WAAW,EAC7B,WAAW,EACX,KAAK,EACL,MAAM,EACN,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,gDAA2B,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAE3E,IAAI,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,EAAE;QAC3B,OAAO,CACL,CAAC,WAAI,CACH,OAAO,CAAC,CAAC,kCAAW,CAAC,MAAM,CAAC,CAC5B,KAAK,CAAC,CAAC,SAAS,CAAC,CACjB,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,IAAI,KAAK,CAAC,CAEV;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,WAAI,CAAC,CACR,CAAC;KACH;IAED,OAAO,CACL,CAAC,SAAG,CACF,aAAa,CAAC,CAAC,uCAAgB,CAAC,GAAG,CAAC,CACpC,UAAU,CAAC,CAAC,oCAAa,CAAC,MAAM,CAAC,CACjC,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,MAAM,CAAC,CAAC,MAAM,CAAC,CAEf;MAAA,CAAC,qBAAS,CACR,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,IAAI,CAAC,CAAC,+BAAQ,CAAC,EAAE,CAAC,CAClB,MAAM,CAAC,gBAAgB,EAEzB;MAAA,CAAC,WAAI,CAAC,OAAO,CAAC,CAAC,kCAAW,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,KAAK,CAAC,CAC7D;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,WAAI,CACR;IAAA,EAAE,SAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AA9CW,QAAA,QAAQ,YA8CnB","sourcesContent":["import {\n BoxAlignItems,\n BoxFlexDirection,\n IconSize,\n TextColor,\n TextVariant,\n} from '@metamask/design-system-shared';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { IconAlert } from '../IconAlert';\nimport { Text } from '../Text';\n\nimport { MAP_HELPTEXT_SEVERITY_COLOR } from './HelpText.constants';\nimport type { HelpTextProps } from './HelpText.types';\n\nexport const HelpText: React.FC<HelpTextProps> = ({\n severity,\n showIcon = false,\n color = TextColor.TextDefault,\n twClassName,\n style,\n testID,\n children,\n ...props\n}) => {\n const textColor = severity ? MAP_HELPTEXT_SEVERITY_COLOR[severity] : color;\n\n if (!(showIcon && severity)) {\n return (\n <Text\n variant={TextVariant.BodySm}\n color={textColor}\n twClassName={twClassName}\n style={style}\n testID={testID}\n {...props}\n >\n {children}\n </Text>\n );\n }\n\n return (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n gap={1}\n twClassName={twClassName}\n style={style}\n testID={testID}\n >\n <IconAlert\n severity={severity}\n size={IconSize.Sm}\n testID=\"help-text-icon\"\n />\n <Text variant={TextVariant.BodySm} color={textColor} {...props}>\n {children}\n </Text>\n </Box>\n );\n};\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MAP_HELPTEXT_SEVERITY_COLOR = void 0;
|
|
4
|
+
const design_system_shared_1 = require("@metamask/design-system-shared");
|
|
5
|
+
exports.MAP_HELPTEXT_SEVERITY_COLOR = {
|
|
6
|
+
[design_system_shared_1.HelpTextSeverity.Danger]: design_system_shared_1.TextColor.ErrorDefault,
|
|
7
|
+
[design_system_shared_1.HelpTextSeverity.Warning]: design_system_shared_1.TextColor.WarningDefault,
|
|
8
|
+
[design_system_shared_1.HelpTextSeverity.Success]: design_system_shared_1.TextColor.SuccessDefault,
|
|
9
|
+
[design_system_shared_1.HelpTextSeverity.Info]: design_system_shared_1.TextColor.InfoDefault,
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=HelpText.constants.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpText.constants.cjs","sourceRoot":"","sources":["../../../src/components/HelpText/HelpText.constants.ts"],"names":[],"mappings":";;;AAAA,yEAA6E;AAEhE,QAAA,2BAA2B,GACtC;IACE,CAAC,uCAAgB,CAAC,MAAM,CAAC,EAAE,gCAAS,CAAC,YAAY;IACjD,CAAC,uCAAgB,CAAC,OAAO,CAAC,EAAE,gCAAS,CAAC,cAAc;IACpD,CAAC,uCAAgB,CAAC,OAAO,CAAC,EAAE,gCAAS,CAAC,cAAc;IACpD,CAAC,uCAAgB,CAAC,IAAI,CAAC,EAAE,gCAAS,CAAC,WAAW;CAC/C,CAAC","sourcesContent":["import { HelpTextSeverity, TextColor } from '@metamask/design-system-shared';\n\nexport const MAP_HELPTEXT_SEVERITY_COLOR: Record<HelpTextSeverity, TextColor> =\n {\n [HelpTextSeverity.Danger]: TextColor.ErrorDefault,\n [HelpTextSeverity.Warning]: TextColor.WarningDefault,\n [HelpTextSeverity.Success]: TextColor.SuccessDefault,\n [HelpTextSeverity.Info]: TextColor.InfoDefault,\n };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpText.constants.d.cts","sourceRoot":"","sources":["../../../src/components/HelpText/HelpText.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,uCAAuC;AAE7E,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,gBAAgB,EAAE,SAAS,CAMzE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpText.constants.d.mts","sourceRoot":"","sources":["../../../src/components/HelpText/HelpText.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,uCAAuC;AAE7E,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,gBAAgB,EAAE,SAAS,CAMzE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HelpTextSeverity, TextColor } from "@metamask/design-system-shared";
|
|
2
|
+
export const MAP_HELPTEXT_SEVERITY_COLOR = {
|
|
3
|
+
[HelpTextSeverity.Danger]: TextColor.ErrorDefault,
|
|
4
|
+
[HelpTextSeverity.Warning]: TextColor.WarningDefault,
|
|
5
|
+
[HelpTextSeverity.Success]: TextColor.SuccessDefault,
|
|
6
|
+
[HelpTextSeverity.Info]: TextColor.InfoDefault,
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=HelpText.constants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpText.constants.mjs","sourceRoot":"","sources":["../../../src/components/HelpText/HelpText.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,uCAAuC;AAE7E,MAAM,CAAC,MAAM,2BAA2B,GACtC;IACE,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,YAAY;IACjD,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,cAAc;IACpD,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,cAAc;IACpD,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,WAAW;CAC/C,CAAC","sourcesContent":["import { HelpTextSeverity, TextColor } from '@metamask/design-system-shared';\n\nexport const MAP_HELPTEXT_SEVERITY_COLOR: Record<HelpTextSeverity, TextColor> =\n {\n [HelpTextSeverity.Danger]: TextColor.ErrorDefault,\n [HelpTextSeverity.Warning]: TextColor.WarningDefault,\n [HelpTextSeverity.Success]: TextColor.SuccessDefault,\n [HelpTextSeverity.Info]: TextColor.InfoDefault,\n };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpText.d.cts","sourceRoot":"","sources":["../../../src/components/HelpText/HelpText.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,aAAa,EAAE,6BAAyB;AAEtD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA8C5C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpText.d.mts","sourceRoot":"","sources":["../../../src/components/HelpText/HelpText.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,aAAa,EAAE,6BAAyB;AAEtD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA8C5C,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
import { BoxAlignItems, BoxFlexDirection, IconSize, TextColor, TextVariant } from "@metamask/design-system-shared";
|
|
8
|
+
import $React from "react";
|
|
9
|
+
const React = $importDefault($React);
|
|
10
|
+
import { Box } from "../Box/index.mjs";
|
|
11
|
+
import { IconAlert } from "../IconAlert/index.mjs";
|
|
12
|
+
import { Text } from "../Text/index.mjs";
|
|
13
|
+
import { MAP_HELPTEXT_SEVERITY_COLOR } from "./HelpText.constants.mjs";
|
|
14
|
+
export const HelpText = ({ severity, showIcon = false, color = TextColor.TextDefault, twClassName, style, testID, children, ...props }) => {
|
|
15
|
+
const textColor = severity ? MAP_HELPTEXT_SEVERITY_COLOR[severity] : color;
|
|
16
|
+
if (!(showIcon && severity)) {
|
|
17
|
+
return (<Text variant={TextVariant.BodySm} color={textColor} twClassName={twClassName} style={style} testID={testID} {...props}>
|
|
18
|
+
{children}
|
|
19
|
+
</Text>);
|
|
20
|
+
}
|
|
21
|
+
return (<Box flexDirection={BoxFlexDirection.Row} alignItems={BoxAlignItems.Center} gap={1} twClassName={twClassName} style={style} testID={testID}>
|
|
22
|
+
<IconAlert severity={severity} size={IconSize.Sm} testID="help-text-icon"/>
|
|
23
|
+
<Text variant={TextVariant.BodySm} color={textColor} {...props}>
|
|
24
|
+
{children}
|
|
25
|
+
</Text>
|
|
26
|
+
</Box>);
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=HelpText.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpText.mjs","sourceRoot":"","sources":["../../../src/components/HelpText/HelpText.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,WAAW,EACZ,uCAAuC;AACxC,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,SAAS,EAAE,+BAAqB;AACzC,OAAO,EAAE,IAAI,EAAE,0BAAgB;AAE/B,OAAO,EAAE,2BAA2B,EAAE,iCAA6B;AAGnE,MAAM,CAAC,MAAM,QAAQ,GAA4B,CAAC,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AE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n BoxAlignItems,\n BoxFlexDirection,\n IconSize,\n TextColor,\n TextVariant,\n} from '@metamask/design-system-shared';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { IconAlert } from '../IconAlert';\nimport { Text } from '../Text';\n\nimport { MAP_HELPTEXT_SEVERITY_COLOR } from './HelpText.constants';\nimport type { HelpTextProps } from './HelpText.types';\n\nexport const HelpText: React.FC<HelpTextProps> = ({\n severity,\n showIcon = false,\n color = TextColor.TextDefault,\n twClassName,\n style,\n testID,\n children,\n ...props\n}) => {\n const textColor = severity ? MAP_HELPTEXT_SEVERITY_COLOR[severity] : color;\n\n if (!(showIcon && severity)) {\n return (\n <Text\n variant={TextVariant.BodySm}\n color={textColor}\n twClassName={twClassName}\n style={style}\n testID={testID}\n {...props}\n >\n {children}\n </Text>\n );\n }\n\n return (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n gap={1}\n twClassName={twClassName}\n style={style}\n testID={testID}\n >\n <IconAlert\n severity={severity}\n size={IconSize.Sm}\n testID=\"help-text-icon\"\n />\n <Text variant={TextVariant.BodySm} color={textColor} {...props}>\n {children}\n </Text>\n </Box>\n );\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpText.types.cjs","sourceRoot":"","sources":["../../../src/components/HelpText/HelpText.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { HelpTextPropsShared } from '@metamask/design-system-shared';\n\nimport type { TextProps } from '../Text';\n\nexport type HelpTextProps = HelpTextPropsShared & Omit<TextProps, 'variant'>;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpText.types.d.cts","sourceRoot":"","sources":["../../../src/components/HelpText/HelpText.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,uCAAuC;AAE1E,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpText.types.d.mts","sourceRoot":"","sources":["../../../src/components/HelpText/HelpText.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,uCAAuC;AAE1E,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpText.types.mjs","sourceRoot":"","sources":["../../../src/components/HelpText/HelpText.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { HelpTextPropsShared } from '@metamask/design-system-shared';\n\nimport type { TextProps } from '../Text';\n\nexport type HelpTextProps = HelpTextPropsShared & Omit<TextProps, 'variant'>;\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HelpText = exports.HelpTextSeverity = void 0;
|
|
4
|
+
var design_system_shared_1 = require("@metamask/design-system-shared");
|
|
5
|
+
Object.defineProperty(exports, "HelpTextSeverity", { enumerable: true, get: function () { return design_system_shared_1.HelpTextSeverity; } });
|
|
6
|
+
var HelpText_1 = require("./HelpText.cjs");
|
|
7
|
+
Object.defineProperty(exports, "HelpText", { enumerable: true, get: function () { return HelpText_1.HelpText; } });
|
|
8
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/HelpText/index.ts"],"names":[],"mappings":";;;AAAA,uEAAkE;AAAzD,wHAAA,gBAAgB,OAAA;AACzB,2CAAsC;AAA7B,oGAAA,QAAQ,OAAA","sourcesContent":["export { HelpTextSeverity } from '@metamask/design-system-shared';\nexport { HelpText } from './HelpText';\nexport type { HelpTextProps } from './HelpText.types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/HelpText/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,uCAAuC;AAClE,OAAO,EAAE,QAAQ,EAAE,uBAAmB;AACtC,YAAY,EAAE,aAAa,EAAE,6BAAyB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/HelpText/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,uCAAuC;AAClE,OAAO,EAAE,QAAQ,EAAE,uBAAmB;AACtC,YAAY,EAAE,aAAa,EAAE,6BAAyB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/HelpText/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,uCAAuC;AAClE,OAAO,EAAE,QAAQ,EAAE,uBAAmB","sourcesContent":["export { HelpTextSeverity } from '@metamask/design-system-shared';\nexport { HelpText } from './HelpText';\nexport type { HelpTextProps } from './HelpText.types';\n"]}
|
|
@@ -43,7 +43,7 @@ const KeyValueRow = ({ keyStartAccessory, keyEndAccessory, keyEndButtonIconProps
|
|
|
43
43
|
{valueContent}
|
|
44
44
|
</BoxRow_1.BoxRow>);
|
|
45
45
|
return (<BoxRow_1.BoxRow endAccessory={valueBox} gap={4} style={[
|
|
46
|
-
tw.style(variant === design_system_shared_1.KeyValueRowVariant.Input ? 'h-12' : 'h-10', twClassName),
|
|
46
|
+
tw.style('px-4', variant === design_system_shared_1.KeyValueRowVariant.Input ? 'h-12' : 'h-10', twClassName),
|
|
47
47
|
style,
|
|
48
48
|
]} {...viewProps}>
|
|
49
49
|
<Box_1.Box twClassName="shrink-0">{keyBox}</Box_1.Box>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyValueRow.cjs","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.tsx"],"names":[],"mappings":";;;;;;AAAA,yEAOwC;AACxC,qFAAmE;AACnE,kDAA0B;AAE1B,0CAA6B;AAC7B,gDAAmC;AACnC,wDAA2C;AAIpC,MAAM,WAAW,GAAG,CAAC,EAC1B,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,QAAQ,EAAE,UAAU,EACpB,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,EAAE,YAAY,EACnB,cAAc,EACd,OAAO,GAAG,yCAAkB,CAAC,OAAO,EACpC,WAAW,EACX,KAAK,EACL,GAAG,SAAS,EACK,EAAE,EAAE;IACrB,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,MAAM,mBAAmB,GACvB,qBAAqB,EAAE,QAAQ,KAAK,SAAS;QAC7C,qBAAqB,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,CACxC,CAAC,uBAAU,CACT,IAAI,CAAC,CAAC,qCAAc,CAAC,EAAE,CAAC,CACxB,IAAI,qBAAqB,CAAC,CAC1B,QAAQ,CAAC,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CACzC,SAAS,CAAC,CAAC;YACT,KAAK,EAAE,gCAAS,CAAC,eAAe;YAChC,GAAG,qBAAqB,CAAC,SAAS;SACnC,CAAC,EACF,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,qCAAc,CAAC,EAAE,CAAC,CACxB,IAAI,uBAAuB,CAA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CAAC,eAAM,CACL,YAAY,CAAC,CAAC,QAAQ,CAAC,CACvB,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,MAAM,EACN,OAAO,KAAK,yCAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EACtD,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CACF,IAAI,SAAS,CAAC,CAEd;MAAA,CAAC,SAAG,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,EAAE,SAAG,CAC3C;IAAA,EAAE,eAAM,CAAC,CACV,CAAC;AACJ,CAAC,CAAC;AAtGW,QAAA,WAAW,eAsGtB;AAEF,mBAAW,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import {\n ButtonIconSize,\n FontWeight,\n IconColor,\n KeyValueRowVariant,\n TextColor,\n TextVariant,\n} from '@metamask/design-system-shared';\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { BoxRow } from '../BoxRow';\nimport { ButtonIcon } from '../ButtonIcon';\n\nimport type { KeyValueRowProps } from './KeyValueRow.types';\n\nexport const KeyValueRow = ({\n keyStartAccessory,\n keyEndAccessory,\n keyEndButtonIconProps,\n keyLabel: keyContent,\n keyTextProps,\n valueStartAccessory,\n valueEndAccessory,\n valueEndButtonIconProps,\n value: valueContent,\n valueTextProps,\n variant = KeyValueRowVariant.Summary,\n twClassName,\n style,\n ...viewProps\n}: KeyValueRowProps) => {\n const tw = useTailwind();\n\n const keyEndAccessoryNode =\n keyEndButtonIconProps?.iconName !== undefined &&\n keyEndButtonIconProps.iconName !== null ? (\n <ButtonIcon\n size={ButtonIconSize.Sm}\n {...keyEndButtonIconProps}\n iconName={keyEndButtonIconProps.iconName}\n iconProps={{\n color: IconColor.IconAlternative,\n ...keyEndButtonIconProps.iconProps,\n }}\n />\n ) : (\n keyEndAccessory\n );\n\n const valueEndAccessoryNode =\n valueEndButtonIconProps?.iconName !== undefined &&\n valueEndButtonIconProps.iconName !== null ? (\n <ButtonIcon\n size={ButtonIconSize.Sm}\n {...valueEndButtonIconProps}\n iconName={valueEndButtonIconProps.iconName}\n iconProps={{\n color: IconColor.IconDefault,\n ...valueEndButtonIconProps.iconProps,\n }}\n />\n ) : (\n valueEndAccessory\n );\n\n const keyBox = (\n <BoxRow\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 >\n {keyContent}\n </BoxRow>\n );\n\n const valueBox = (\n <BoxRow\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=\"flex-1 min-w-0 justify-end\"\n >\n {valueContent}\n </BoxRow>\n );\n\n return (\n <BoxRow\n endAccessory={valueBox}\n gap={4}\n style={[\n tw.style(\n 'px-4',\n variant === KeyValueRowVariant.Input ? 'h-12' : 'h-10',\n twClassName,\n ),\n style,\n ]}\n {...viewProps}\n >\n <Box twClassName=\"shrink-0\">{keyBox}</Box>\n </BoxRow>\n );\n};\n\nKeyValueRow.displayName = 'KeyValueRow';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyValueRow.d.cts","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,cAAc;AAM1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAE5D,eAAO,MAAM,WAAW;yPAerB,gBAAgB;;
|
|
1
|
+
{"version":3,"file":"KeyValueRow.d.cts","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,cAAc;AAM1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAE5D,eAAO,MAAM,WAAW;yPAerB,gBAAgB;;CAuFlB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyValueRow.d.mts","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,cAAc;AAM1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAE5D,eAAO,MAAM,WAAW;yPAerB,gBAAgB;;
|
|
1
|
+
{"version":3,"file":"KeyValueRow.d.mts","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,cAAc;AAM1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAE5D,eAAO,MAAM,WAAW;yPAerB,gBAAgB;;CAuFlB,CAAC"}
|
|
@@ -44,7 +44,7 @@ export const KeyValueRow = ({ keyStartAccessory, keyEndAccessory, keyEndButtonIc
|
|
|
44
44
|
{valueContent}
|
|
45
45
|
</BoxRow>);
|
|
46
46
|
return (<BoxRow endAccessory={valueBox} gap={4} style={[
|
|
47
|
-
tw.style(variant === KeyValueRowVariant.Input ? 'h-12' : 'h-10', twClassName),
|
|
47
|
+
tw.style('px-4', variant === KeyValueRowVariant.Input ? 'h-12' : 'h-10', twClassName),
|
|
48
48
|
style,
|
|
49
49
|
]} {...viewProps}>
|
|
50
50
|
<Box twClassName="shrink-0">{keyBox}</Box>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyValueRow.mjs","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,cAAc,EACd,UAAU,EACV,SAAS,EACT,kBAAkB,EAClB,SAAS,EACT,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AAC,CACF,IAAI,SAAS,CAAC,CAEd;MAAA,CAAC,GAAG,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,CAC3C;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import {\n ButtonIconSize,\n FontWeight,\n IconColor,\n KeyValueRowVariant,\n TextColor,\n TextVariant,\n} from '@metamask/design-system-shared';\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { BoxRow } from '../BoxRow';\nimport { ButtonIcon } from '../ButtonIcon';\n\nimport type { KeyValueRowProps } from './KeyValueRow.types';\n\nexport const KeyValueRow = ({\n keyStartAccessory,\n keyEndAccessory,\n keyEndButtonIconProps,\n keyLabel: keyContent,\n keyTextProps,\n valueStartAccessory,\n valueEndAccessory,\n valueEndButtonIconProps,\n value: valueContent,\n valueTextProps,\n variant = KeyValueRowVariant.Summary,\n twClassName,\n style,\n ...viewProps\n}: KeyValueRowProps) => {\n const tw = useTailwind();\n\n const keyEndAccessoryNode =\n keyEndButtonIconProps?.iconName !== undefined &&\n keyEndButtonIconProps.iconName !== null ? (\n <ButtonIcon\n size={ButtonIconSize.Sm}\n {...keyEndButtonIconProps}\n iconName={keyEndButtonIconProps.iconName}\n iconProps={{\n color: IconColor.IconAlternative,\n ...keyEndButtonIconProps.iconProps,\n }}\n />\n ) : (\n keyEndAccessory\n );\n\n const valueEndAccessoryNode =\n valueEndButtonIconProps?.iconName !== undefined &&\n valueEndButtonIconProps.iconName !== null ? (\n <ButtonIcon\n size={ButtonIconSize.Sm}\n {...valueEndButtonIconProps}\n iconName={valueEndButtonIconProps.iconName}\n iconProps={{\n color: IconColor.IconDefault,\n ...valueEndButtonIconProps.iconProps,\n }}\n />\n ) : (\n valueEndAccessory\n );\n\n const keyBox = (\n <BoxRow\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 >\n {keyContent}\n </BoxRow>\n );\n\n const valueBox = (\n <BoxRow\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=\"flex-1 min-w-0 justify-end\"\n >\n {valueContent}\n </BoxRow>\n );\n\n return (\n <BoxRow\n endAccessory={valueBox}\n gap={4}\n style={[\n tw.style(\n variant === KeyValueRowVariant.Input ? 'h-12' : 'h-10',\n twClassName,\n ),\n style,\n ]}\n {...viewProps}\n >\n <Box twClassName=\"shrink-0\">{keyBox}</Box>\n </BoxRow>\n );\n};\n\nKeyValueRow.displayName = 'KeyValueRow';\n"]}
|
|
1
|
+
{"version":3,"file":"KeyValueRow.mjs","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,cAAc,EACd,UAAU,EACV,SAAS,EACT,kBAAkB,EAClB,SAAS,EACT,WAAW,EACZ,uCAAuC;AACxC,OAAO,EAAE,WAAW,EAAE,6CAA6C;AACnE,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,MAAM,EAAE,4BAAkB;AACnC,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAI3C,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC1B,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,QAAQ,EAAE,UAAU,EACpB,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,EAAE,YAAY,EACnB,cAAc,EACd,O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,aAAa,EAAE,CAAC;YAChB,aAAa,EAAE,MAAM;YACrB,GAAG,YAAY;SAChB,CAAC,CAEF;MAAA,CAAC,UAAU,CACb;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;IAEF,MAAM,QAAQ,GAAG,CACf,CAAC,MAAM,CACL,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,4BAA4B,CAExC;MAAA,CAAC,YAAY,CACf;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;IAEF,OAAO,CACL,CAAC,MAAM,CACL,YAAY,CAAC,CAAC,QAAQ,CAAC,CACvB,GAAG,CAAC,CAAC,CAAC,CAAC,CACP,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,MAAM,EACN,OAAO,KAAK,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EACtD,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CACF,IAAI,SAAS,CAAC,CAEd;MAAA,CAAC,GAAG,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,CAC3C;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import {\n ButtonIconSize,\n FontWeight,\n IconColor,\n KeyValueRowVariant,\n TextColor,\n TextVariant,\n} from '@metamask/design-system-shared';\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { BoxRow } from '../BoxRow';\nimport { ButtonIcon } from '../ButtonIcon';\n\nimport type { KeyValueRowProps } from './KeyValueRow.types';\n\nexport const KeyValueRow = ({\n keyStartAccessory,\n keyEndAccessory,\n keyEndButtonIconProps,\n keyLabel: keyContent,\n keyTextProps,\n valueStartAccessory,\n valueEndAccessory,\n valueEndButtonIconProps,\n value: valueContent,\n valueTextProps,\n variant = KeyValueRowVariant.Summary,\n twClassName,\n style,\n ...viewProps\n}: KeyValueRowProps) => {\n const tw = useTailwind();\n\n const keyEndAccessoryNode =\n keyEndButtonIconProps?.iconName !== undefined &&\n keyEndButtonIconProps.iconName !== null ? (\n <ButtonIcon\n size={ButtonIconSize.Sm}\n {...keyEndButtonIconProps}\n iconName={keyEndButtonIconProps.iconName}\n iconProps={{\n color: IconColor.IconAlternative,\n ...keyEndButtonIconProps.iconProps,\n }}\n />\n ) : (\n keyEndAccessory\n );\n\n const valueEndAccessoryNode =\n valueEndButtonIconProps?.iconName !== undefined &&\n valueEndButtonIconProps.iconName !== null ? (\n <ButtonIcon\n size={ButtonIconSize.Sm}\n {...valueEndButtonIconProps}\n iconName={valueEndButtonIconProps.iconName}\n iconProps={{\n color: IconColor.IconDefault,\n ...valueEndButtonIconProps.iconProps,\n }}\n />\n ) : (\n valueEndAccessory\n );\n\n const keyBox = (\n <BoxRow\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 >\n {keyContent}\n </BoxRow>\n );\n\n const valueBox = (\n <BoxRow\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=\"flex-1 min-w-0 justify-end\"\n >\n {valueContent}\n </BoxRow>\n );\n\n return (\n <BoxRow\n endAccessory={valueBox}\n gap={4}\n style={[\n tw.style(\n 'px-4',\n variant === KeyValueRowVariant.Input ? 'h-12' : 'h-10',\n twClassName,\n ),\n style,\n ]}\n {...viewProps}\n >\n <Box twClassName=\"shrink-0\">{keyBox}</Box>\n </BoxRow>\n );\n};\n\nKeyValueRow.displayName = 'KeyValueRow';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyValueRow.types.cjs","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { KeyValueRowPropsShared } from '@metamask/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 KeyValueRowProps = KeyValueRowPropsShared &\n Omit<ViewProps, 'children'> & {\n /** Optional props for the key Text when key is a string. */\n keyTextProps?: Partial<Omit<TextProps, 'children'>>;\n
|
|
1
|
+
{"version":3,"file":"KeyValueRow.types.cjs","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { KeyValueRowPropsShared } from '@metamask/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\nimport type { ButtonIconProps } from '../ButtonIcon/ButtonIcon.types';\nimport type { SensitiveTextProps } from '../SensitiveText';\nimport type { TextProps } from '../Text/Text.types';\n\nexport type KeyValueRowProps = KeyValueRowPropsShared &\n Omit<ViewProps, 'children'> & {\n /** Optional props for the key Text when key is a string. */\n keyTextProps?: Partial<Omit<TextProps, 'children'>>;\n /**\n * Optional props for the value SensitiveText when value is a string.\n * Supports Text props plus `isHidden` / `length`.\n */\n valueTextProps?: Partial<Omit<SensitiveTextProps, 'children'>>;\n /** Optional Tailwind class names applied to the outer BoxHorizontal. 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"]}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import type { KeyValueRowPropsShared } from "@metamask/design-system-shared";
|
|
2
2
|
import type { ViewProps } from "react-native";
|
|
3
3
|
import type { ButtonIconProps } from "../ButtonIcon/ButtonIcon.types.cjs";
|
|
4
|
+
import type { SensitiveTextProps } from "../SensitiveText/index.cjs";
|
|
4
5
|
import type { TextProps } from "../Text/Text.types.cjs";
|
|
5
6
|
export type KeyValueRowProps = KeyValueRowPropsShared & Omit<ViewProps, 'children'> & {
|
|
6
7
|
/** Optional props for the key Text when key is a string. */
|
|
7
8
|
keyTextProps?: Partial<Omit<TextProps, 'children'>>;
|
|
8
|
-
/**
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Optional props for the value SensitiveText when value is a string.
|
|
11
|
+
* Supports Text props plus `isHidden` / `length`.
|
|
12
|
+
*/
|
|
13
|
+
valueTextProps?: Partial<Omit<SensitiveTextProps, 'children'>>;
|
|
10
14
|
/** Optional Tailwind class names applied to the outer BoxHorizontal. Merged with base styles. */
|
|
11
15
|
twClassName?: string;
|
|
12
16
|
/** When set, renders a ButtonIcon as the key endAccessory (takes precedence over keyEndAccessory). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyValueRow.types.d.cts","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,uCAAuC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,2CAAuC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GACnD,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IAC5B,4DAA4D;IAC5D,YAAY,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IACpD
|
|
1
|
+
{"version":3,"file":"KeyValueRow.types.d.cts","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,uCAAuC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,2CAAuC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,mCAAyB;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GACnD,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IAC5B,4DAA4D;IAC5D,YAAY,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IACpD;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC,CAAC;IAC/D,iGAAiG;IACjG,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"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import type { KeyValueRowPropsShared } from "@metamask/design-system-shared";
|
|
2
2
|
import type { ViewProps } from "react-native";
|
|
3
3
|
import type { ButtonIconProps } from "../ButtonIcon/ButtonIcon.types.mjs";
|
|
4
|
+
import type { SensitiveTextProps } from "../SensitiveText/index.mjs";
|
|
4
5
|
import type { TextProps } from "../Text/Text.types.mjs";
|
|
5
6
|
export type KeyValueRowProps = KeyValueRowPropsShared & Omit<ViewProps, 'children'> & {
|
|
6
7
|
/** Optional props for the key Text when key is a string. */
|
|
7
8
|
keyTextProps?: Partial<Omit<TextProps, 'children'>>;
|
|
8
|
-
/**
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Optional props for the value SensitiveText when value is a string.
|
|
11
|
+
* Supports Text props plus `isHidden` / `length`.
|
|
12
|
+
*/
|
|
13
|
+
valueTextProps?: Partial<Omit<SensitiveTextProps, 'children'>>;
|
|
10
14
|
/** Optional Tailwind class names applied to the outer BoxHorizontal. Merged with base styles. */
|
|
11
15
|
twClassName?: string;
|
|
12
16
|
/** When set, renders a ButtonIcon as the key endAccessory (takes precedence over keyEndAccessory). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyValueRow.types.d.mts","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,uCAAuC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,2CAAuC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GACnD,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IAC5B,4DAA4D;IAC5D,YAAY,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IACpD
|
|
1
|
+
{"version":3,"file":"KeyValueRow.types.d.mts","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,uCAAuC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,2CAAuC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,mCAAyB;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GACnD,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IAC5B,4DAA4D;IAC5D,YAAY,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IACpD;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC,CAAC;IAC/D,iGAAiG;IACjG,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyValueRow.types.mjs","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { KeyValueRowPropsShared } from '@metamask/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 KeyValueRowProps = KeyValueRowPropsShared &\n Omit<ViewProps, 'children'> & {\n /** Optional props for the key Text when key is a string. */\n keyTextProps?: Partial<Omit<TextProps, 'children'>>;\n
|
|
1
|
+
{"version":3,"file":"KeyValueRow.types.mjs","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { KeyValueRowPropsShared } from '@metamask/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\nimport type { ButtonIconProps } from '../ButtonIcon/ButtonIcon.types';\nimport type { SensitiveTextProps } from '../SensitiveText';\nimport type { TextProps } from '../Text/Text.types';\n\nexport type KeyValueRowProps = KeyValueRowPropsShared &\n Omit<ViewProps, 'children'> & {\n /** Optional props for the key Text when key is a string. */\n keyTextProps?: Partial<Omit<TextProps, 'children'>>;\n /**\n * Optional props for the value SensitiveText when value is a string.\n * Supports Text props plus `isHidden` / `length`.\n */\n valueTextProps?: Partial<Omit<SensitiveTextProps, 'children'>>;\n /** Optional Tailwind class names applied to the outer BoxHorizontal. 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,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.KeyValueSelect = void 0;
|
|
27
|
+
const design_system_shared_1 = require("@metamask/design-system-shared");
|
|
28
|
+
const design_system_twrnc_preset_1 = require("@metamask/design-system-twrnc-preset");
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const react_native_1 = require("react-native");
|
|
31
|
+
const KeyValueRow_1 = require("../KeyValueRow/index.cjs");
|
|
32
|
+
const SelectButton_1 = require("../SelectButton/index.cjs");
|
|
33
|
+
const ROOT_TW_CLASS_NAME = 'w-full';
|
|
34
|
+
/** Overrides KeyValueRow `pr-4` so SelectButton's `px-3` keeps a 16px trailing inset. */
|
|
35
|
+
const KEY_VALUE_ROW_TW_CLASS_NAME = 'pr-1';
|
|
36
|
+
exports.KeyValueSelect = (0, react_1.forwardRef)(({ keyLabel, keyStartAccessory, keyEndAccessory, keyTextProps, keyEndButtonIconProps, variant, value, valueStartAccessory, valueEndAccessory, valueTextProps, selectButtonProps, keyValueRowProps, isDisabled = false, twClassName, style, accessibilityRole, ...pressableProps }, ref) => {
|
|
37
|
+
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
38
|
+
const rootTwClassName = (0, design_system_shared_1.mergeTwClassName)(ROOT_TW_CLASS_NAME, twClassName);
|
|
39
|
+
const { twClassName: keyValueRowTwClassName, ...restKeyValueRowProps } = keyValueRowProps ?? {};
|
|
40
|
+
const resolvedKeyValueRowTwClassName = (0, design_system_shared_1.mergeTwClassName)(KEY_VALUE_ROW_TW_CLASS_NAME, keyValueRowTwClassName);
|
|
41
|
+
const getPressableStyle = ({ pressed, }) => {
|
|
42
|
+
const baseStyle = tw.style(rootTwClassName, pressed && 'bg-pressed');
|
|
43
|
+
if (!style) {
|
|
44
|
+
return baseStyle;
|
|
45
|
+
}
|
|
46
|
+
const userStyle = typeof style === 'function' ? style({ pressed }) : style;
|
|
47
|
+
return [baseStyle, userStyle];
|
|
48
|
+
};
|
|
49
|
+
const renderSelectValue = () => (<SelectButton_1.SelectButton {...selectButtonProps} value={value} startAccessory={valueStartAccessory} endAccessory={valueEndAccessory} textProps={valueTextProps} variant={design_system_shared_1.SelectButtonVariant.Secondary} isDisabled={isDisabled} size={design_system_shared_1.SelectButtonSize.Md} pointerEvents="none" accessible={false}/>);
|
|
50
|
+
return (<react_native_1.Pressable ref={ref} accessibilityRole={accessibilityRole ?? 'button'} disabled={isDisabled} style={getPressableStyle} {...pressableProps}>
|
|
51
|
+
<KeyValueRow_1.KeyValueRow {...restKeyValueRowProps} twClassName={resolvedKeyValueRowTwClassName} keyLabel={keyLabel} keyStartAccessory={keyStartAccessory} keyEndAccessory={keyEndAccessory} keyTextProps={keyTextProps} keyEndButtonIconProps={keyEndButtonIconProps} variant={variant} value={renderSelectValue()}/>
|
|
52
|
+
</react_native_1.Pressable>);
|
|
53
|
+
});
|
|
54
|
+
exports.KeyValueSelect.displayName = 'KeyValueSelect';
|
|
55
|
+
//# sourceMappingURL=KeyValueSelect.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueSelect.cjs","sourceRoot":"","sources":["../../../src/components/KeyValueSelect/KeyValueSelect.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yEAIwC;AACxC,qFAAmE;AACnE,+CAA0C;AAC1C,+CAAyC;AAQzC,0DAA6C;AAC7C,4DAA+C;AAI/C,MAAM,kBAAkB,GAAG,QAAQ,CAAC;AAEpC,yFAAyF;AACzF,MAAM,2BAA2B,GAAG,MAAM,CAAC;AAE9B,QAAA,cAAc,GAAG,IAAA,kBAAU,EACtC,CACE,EACE,QAAQ,EACR,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,qBAAqB,EACrB,OAAO,EACP,KAAK,EACL,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AC,uCAAgB,CAAC,EAAE,CAAC,CAC1B,aAAa,CAAC,MAAM,CACpB,UAAU,CAAC,CAAC,KAAK,CAAC,EAClB,CACH,CAAC;IAEF,OAAO,CACL,CAAC,wBAAS,CACR,GAAG,CAAC,CAAC,GAAG,CAAC,CACT,iBAAiB,CAAC,CAAC,iBAAiB,IAAI,QAAQ,CAAC,CACjD,QAAQ,CAAC,CAAC,UAAU,CAAC,CACrB,KAAK,CAAC,CAAC,iBAAiB,CAAC,CACzB,IAAI,cAAc,CAAC,CAEnB;QAAA,CAAC,yBAAW,CACV,IAAI,oBAAoB,CAAC,CACzB,WAAW,CAAC,CAAC,8BAA8B,CAAC,CAC5C,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,eAAe,CAAC,CAAC,eAAe,CAAC,CACjC,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,qBAAqB,CAAC,CAAC,qBAAqB,CAAC,CAC7C,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,KAAK,CAAC,CAAC,iBAAiB,EAAE,CAAC,EAE/B;MAAA,EAAE,wBAAS,CAAC,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,sBAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC","sourcesContent":["import {\n mergeTwClassName,\n SelectButtonSize,\n SelectButtonVariant,\n} from '@metamask/design-system-shared';\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React, { forwardRef } from 'react';\nimport { Pressable } from 'react-native';\nimport type {\n PressableStateCallbackType,\n StyleProp,\n View,\n ViewStyle,\n} from 'react-native';\n\nimport { KeyValueRow } from '../KeyValueRow';\nimport { SelectButton } from '../SelectButton';\n\nimport type { KeyValueSelectProps } from './KeyValueSelect.types';\n\nconst ROOT_TW_CLASS_NAME = 'w-full';\n\n/** Overrides KeyValueRow `pr-4` so SelectButton's `px-3` keeps a 16px trailing inset. */\nconst KEY_VALUE_ROW_TW_CLASS_NAME = 'pr-1';\n\nexport const KeyValueSelect = forwardRef<View, KeyValueSelectProps>(\n (\n {\n keyLabel,\n keyStartAccessory,\n keyEndAccessory,\n keyTextProps,\n keyEndButtonIconProps,\n variant,\n value,\n valueStartAccessory,\n valueEndAccessory,\n valueTextProps,\n selectButtonProps,\n keyValueRowProps,\n isDisabled = false,\n twClassName,\n style,\n accessibilityRole,\n ...pressableProps\n },\n ref,\n ) => {\n const tw = useTailwind();\n const rootTwClassName = mergeTwClassName(ROOT_TW_CLASS_NAME, twClassName);\n const { twClassName: keyValueRowTwClassName, ...restKeyValueRowProps } =\n keyValueRowProps ?? {};\n const resolvedKeyValueRowTwClassName = mergeTwClassName(\n KEY_VALUE_ROW_TW_CLASS_NAME,\n keyValueRowTwClassName,\n );\n\n const getPressableStyle = ({\n pressed,\n }: PressableStateCallbackType): StyleProp<ViewStyle> => {\n const baseStyle = tw.style(rootTwClassName, pressed && 'bg-pressed');\n\n if (!style) {\n return baseStyle;\n }\n\n const userStyle =\n typeof style === 'function' ? style({ pressed }) : style;\n\n return [baseStyle, userStyle];\n };\n\n const renderSelectValue = () => (\n <SelectButton\n {...selectButtonProps}\n value={value}\n startAccessory={valueStartAccessory}\n endAccessory={valueEndAccessory}\n textProps={valueTextProps}\n variant={SelectButtonVariant.Secondary}\n isDisabled={isDisabled}\n size={SelectButtonSize.Md}\n pointerEvents=\"none\"\n accessible={false}\n />\n );\n\n return (\n <Pressable\n ref={ref}\n accessibilityRole={accessibilityRole ?? 'button'}\n disabled={isDisabled}\n style={getPressableStyle}\n {...pressableProps}\n >\n <KeyValueRow\n {...restKeyValueRowProps}\n twClassName={resolvedKeyValueRowTwClassName}\n keyLabel={keyLabel}\n keyStartAccessory={keyStartAccessory}\n keyEndAccessory={keyEndAccessory}\n keyTextProps={keyTextProps}\n keyEndButtonIconProps={keyEndButtonIconProps}\n variant={variant}\n value={renderSelectValue()}\n />\n </Pressable>\n );\n },\n);\n\nKeyValueSelect.displayName = 'KeyValueSelect';\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { View } from "react-native";
|
|
3
|
+
export declare const KeyValueSelect: React.ForwardRefExoticComponent<Omit<import("@metamask/design-system-shared").KeyValueSelectPropsShared, "selectButtonProps"> & Omit<import("react-native").PressableProps, "children" | "disabled"> & {
|
|
4
|
+
keyTextProps?: Partial<Omit<import("../index.cjs").TextProps, "children">> | undefined;
|
|
5
|
+
keyEndButtonIconProps?: Partial<import("../index.cjs").ButtonIconProps> | undefined;
|
|
6
|
+
valueTextProps?: Partial<Omit<import("../index.cjs").TextProps, "children">> | undefined;
|
|
7
|
+
selectButtonProps: import("./KeyValueSelect.types.cjs").KeyValueSelectSelectButtonProps;
|
|
8
|
+
keyValueRowProps?: import("./KeyValueSelect.types.cjs").KeyValueSelectKeyValueRowProps | undefined;
|
|
9
|
+
twClassName?: string | undefined;
|
|
10
|
+
} & React.RefAttributes<View>>;
|
|
11
|
+
//# sourceMappingURL=KeyValueSelect.d.cts.map
|