@metamask-previews/design-system-react-native 0.11.0-preview.3aca0bd → 0.11.0-preview.96aaa54
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/dist/components/AvatarAccount/AvatarAccount.cjs +4 -3
- package/dist/components/AvatarAccount/AvatarAccount.cjs.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.constants.cjs +9 -1
- package/dist/components/AvatarAccount/AvatarAccount.constants.cjs.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.constants.d.cts +2 -0
- package/dist/components/AvatarAccount/AvatarAccount.constants.d.cts.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.constants.d.mts +2 -0
- package/dist/components/AvatarAccount/AvatarAccount.constants.d.mts.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.constants.mjs +8 -0
- package/dist/components/AvatarAccount/AvatarAccount.constants.mjs.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.d.cts.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.d.mts.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.mjs +4 -3
- package/dist/components/AvatarAccount/AvatarAccount.mjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.cjs +3 -3
- package/dist/components/AvatarBase/AvatarBase.cjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.cjs +21 -21
- package/dist/components/AvatarBase/AvatarBase.constants.cjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.d.cts +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.d.cts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.d.mts +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.d.mts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.mjs +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.mjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.d.cts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.d.mts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.mjs +1 -1
- package/dist/components/AvatarBase/AvatarBase.mjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.types.cjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.types.d.cts +3 -39
- package/dist/components/AvatarBase/AvatarBase.types.d.cts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.types.d.mts +3 -39
- package/dist/components/AvatarBase/AvatarBase.types.d.mts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.types.mjs.map +1 -1
- package/dist/components/AvatarBase/index.cjs +3 -3
- package/dist/components/AvatarBase/index.cjs.map +1 -1
- package/dist/components/AvatarBase/index.d.cts +1 -1
- package/dist/components/AvatarBase/index.d.cts.map +1 -1
- package/dist/components/AvatarBase/index.d.mts +1 -1
- package/dist/components/AvatarBase/index.d.mts.map +1 -1
- package/dist/components/AvatarBase/index.mjs +1 -1
- package/dist/components/AvatarBase/index.mjs.map +1 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.types.cjs.map +1 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.types.d.cts +7 -9
- package/dist/components/AvatarNetwork/AvatarNetwork.types.d.cts.map +1 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.types.d.mts +7 -9
- package/dist/components/AvatarNetwork/AvatarNetwork.types.d.mts.map +1 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.types.mjs.map +1 -1
- package/dist/components/Icon/assets/candlestick.svg +1 -1
- package/dist/components/Input/Input.cjs +4 -3
- package/dist/components/Input/Input.cjs.map +1 -1
- package/dist/components/Input/Input.constants.cjs +69 -0
- package/dist/components/Input/Input.constants.cjs.map +1 -0
- package/dist/components/Input/Input.constants.d.cts +11 -0
- package/dist/components/Input/Input.constants.d.cts.map +1 -0
- package/dist/components/Input/Input.constants.d.mts +11 -0
- package/dist/components/Input/Input.constants.d.mts.map +1 -0
- package/dist/components/Input/Input.constants.mjs +66 -0
- package/dist/components/Input/Input.constants.mjs.map +1 -0
- package/dist/components/Input/Input.d.cts.map +1 -1
- package/dist/components/Input/Input.d.mts.map +1 -1
- package/dist/components/Input/Input.mjs +4 -3
- package/dist/components/Input/Input.mjs.map +1 -1
- package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.cjs +33 -0
- package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.cjs.map +1 -0
- package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.cts +14 -0
- package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.cts.map +1 -0
- package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.mts +14 -0
- package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.mts.map +1 -0
- package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.mjs +35 -0
- package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.mjs.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.cjs +39 -0
- package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.cjs.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.cts +25 -0
- package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.cts.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.mts +25 -0
- package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.mts.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.mjs +41 -0
- package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.mjs.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.cjs +76 -0
- package/dist/components/KeyValueRow/KeyValueRow.cjs.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.d.cts +25 -0
- package/dist/components/KeyValueRow/KeyValueRow.d.cts.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.d.mts +25 -0
- package/dist/components/KeyValueRow/KeyValueRow.d.mts.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.mjs +77 -0
- package/dist/components/KeyValueRow/KeyValueRow.mjs.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.types.cjs +29 -0
- package/dist/components/KeyValueRow/KeyValueRow.types.cjs.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.types.d.cts +177 -0
- package/dist/components/KeyValueRow/KeyValueRow.types.d.cts.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.types.d.mts +177 -0
- package/dist/components/KeyValueRow/KeyValueRow.types.d.mts.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.types.mjs +26 -0
- package/dist/components/KeyValueRow/KeyValueRow.types.mjs.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.utils.cjs +6 -0
- package/dist/components/KeyValueRow/KeyValueRow.utils.cjs.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.utils.d.cts +3 -0
- package/dist/components/KeyValueRow/KeyValueRow.utils.d.cts.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.utils.d.mts +3 -0
- package/dist/components/KeyValueRow/KeyValueRow.utils.d.mts.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.utils.mjs +2 -0
- package/dist/components/KeyValueRow/KeyValueRow.utils.mjs.map +1 -0
- package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.cjs +29 -0
- package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.cjs.map +1 -0
- package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.cts +17 -0
- package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.cts.map +1 -0
- package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.mts +17 -0
- package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.mts.map +1 -0
- package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.mjs +31 -0
- package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.mjs.map +1 -0
- package/dist/components/KeyValueRow/index.cjs +15 -0
- package/dist/components/KeyValueRow/index.cjs.map +1 -0
- package/dist/components/KeyValueRow/index.d.cts +3 -0
- package/dist/components/KeyValueRow/index.d.cts.map +1 -0
- package/dist/components/KeyValueRow/index.d.mts +3 -0
- package/dist/components/KeyValueRow/index.d.mts.map +1 -0
- package/dist/components/KeyValueRow/index.mjs +3 -0
- package/dist/components/KeyValueRow/index.mjs.map +1 -0
- package/dist/components/TextButton/TextButton.cjs +12 -36
- 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 +14 -38
- package/dist/components/TextButton/TextButton.mjs.map +1 -1
- package/dist/components/TextButton/TextButton.types.cjs.map +1 -1
- package/dist/components/TextButton/TextButton.types.d.cts +8 -60
- package/dist/components/TextButton/TextButton.types.d.cts.map +1 -1
- package/dist/components/TextButton/TextButton.types.d.mts +8 -60
- package/dist/components/TextButton/TextButton.types.d.mts.map +1 -1
- package/dist/components/TextButton/TextButton.types.mjs.map +1 -1
- package/dist/components/TextButton/index.cjs +1 -3
- package/dist/components/TextButton/index.cjs.map +1 -1
- package/dist/components/TextButton/index.d.cts +0 -1
- package/dist/components/TextButton/index.d.cts.map +1 -1
- package/dist/components/TextButton/index.d.mts +0 -1
- package/dist/components/TextButton/index.d.mts.map +1 -1
- package/dist/components/TextButton/index.mjs +0 -1
- package/dist/components/TextButton/index.mjs.map +1 -1
- package/dist/components/TextField/TextField.cjs +22 -8
- package/dist/components/TextField/TextField.cjs.map +1 -1
- package/dist/components/TextField/TextField.d.cts +0 -2
- package/dist/components/TextField/TextField.d.cts.map +1 -1
- package/dist/components/TextField/TextField.d.mts +0 -2
- package/dist/components/TextField/TextField.d.mts.map +1 -1
- package/dist/components/TextField/TextField.mjs +22 -8
- package/dist/components/TextField/TextField.mjs.map +1 -1
- package/dist/components/TextField/TextField.types.cjs +0 -10
- package/dist/components/TextField/TextField.types.cjs.map +1 -1
- package/dist/components/TextField/TextField.types.d.cts +0 -14
- package/dist/components/TextField/TextField.types.d.cts.map +1 -1
- package/dist/components/TextField/TextField.types.d.mts +0 -14
- package/dist/components/TextField/TextField.types.d.mts.map +1 -1
- package/dist/components/TextField/TextField.types.mjs +1 -9
- package/dist/components/TextField/TextField.types.mjs.map +1 -1
- package/dist/components/TextField/index.cjs +1 -3
- package/dist/components/TextField/index.cjs.map +1 -1
- package/dist/components/TextField/index.d.cts +0 -1
- package/dist/components/TextField/index.d.cts.map +1 -1
- package/dist/components/TextField/index.d.mts +0 -1
- package/dist/components/TextField/index.d.mts.map +1 -1
- package/dist/components/TextField/index.mjs +0 -1
- package/dist/components/TextField/index.mjs.map +1 -1
- package/dist/components/index.cjs +1 -3
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +2 -2
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +2 -2
- package/dist/components/index.d.mts.map +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/components/index.mjs.map +1 -1
- package/dist/types/index.cjs +18 -51
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +8 -55
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.mts +8 -55
- package/dist/types/index.d.mts.map +1 -1
- package/dist/types/index.mjs +8 -58
- package/dist/types/index.mjs.map +1 -1
- package/package.json +4 -5
- package/dist/components/TextButton/TextButton.constants.cjs +0 -12
- package/dist/components/TextButton/TextButton.constants.cjs.map +0 -1
- package/dist/components/TextButton/TextButton.constants.d.cts +0 -4
- package/dist/components/TextButton/TextButton.constants.d.cts.map +0 -1
- package/dist/components/TextButton/TextButton.constants.d.mts +0 -4
- package/dist/components/TextButton/TextButton.constants.d.mts.map +0 -1
- package/dist/components/TextButton/TextButton.constants.mjs +0 -9
- package/dist/components/TextButton/TextButton.constants.mjs.map +0 -1
- package/dist/components/TextField/TextField.constants.cjs +0 -13
- package/dist/components/TextField/TextField.constants.cjs.map +0 -1
- package/dist/components/TextField/TextField.constants.d.cts +0 -6
- package/dist/components/TextField/TextField.constants.d.cts.map +0 -1
- package/dist/components/TextField/TextField.constants.d.mts +0 -6
- package/dist/components/TextField/TextField.constants.d.mts.map +0 -1
- package/dist/components/TextField/TextField.constants.mjs +0 -10
- package/dist/components/TextField/TextField.constants.mjs.map +0 -1
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const react_native_1 = require("react-native/index.js");
|
|
9
|
+
/**
|
|
10
|
+
* The main container for the KeyValueRow component.
|
|
11
|
+
* When creating custom KeyValueRow components, this must be the outermost component
|
|
12
|
+
* wrapping the two <KeyValueSection/> components.
|
|
13
|
+
*
|
|
14
|
+
* e.g.
|
|
15
|
+
* ```
|
|
16
|
+
* <KeyValueRowRoot>
|
|
17
|
+
* <KeyValueSection></KeyValueSection>
|
|
18
|
+
* <KeyValueSection></KeyValueSection>
|
|
19
|
+
* </KeyValueRowRoot>
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @param props - Component props.
|
|
23
|
+
* @param props.children - The two <KeyValueSection> children.
|
|
24
|
+
* @param props.twClassName - Optional Tailwind class names to override root styles.
|
|
25
|
+
* @param props.style - Optional additional styles for the root element.
|
|
26
|
+
*
|
|
27
|
+
* @returns The rendered Root component.
|
|
28
|
+
*/
|
|
29
|
+
const KeyValueRowRoot = ({ children, twClassName, style, ...props }) => {
|
|
30
|
+
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
31
|
+
return (<react_native_1.View style={[
|
|
32
|
+
tw.style('flex-row justify-between items-center overflow-hidden', twClassName),
|
|
33
|
+
style,
|
|
34
|
+
]} {...props}>
|
|
35
|
+
{children}
|
|
36
|
+
</react_native_1.View>);
|
|
37
|
+
};
|
|
38
|
+
exports.default = KeyValueRowRoot;
|
|
39
|
+
//# sourceMappingURL=KeyValueRoot.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueRoot.cjs","sourceRoot":"","sources":["../../../../src/components/KeyValueRow/KeyValueRoot/KeyValueRoot.tsx"],"names":[],"mappings":";;;;;AAAA,8FAA4E;AAC5E,kDAA0B;AAC1B,wDAAoC;AAIpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,eAAe,GAAmC,CAAC,EACvD,QAAQ,EACR,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,OAAO,CACL,CAAC,mBAAI,CACH,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,uDAAuD,EACvD,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CACF,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,eAAe,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport type { KeyValueRowRootProps } from '../KeyValueRow.types';\n\n/**\n * The main container for the KeyValueRow component.\n * When creating custom KeyValueRow components, this must be the outermost component\n * wrapping the two <KeyValueSection/> components.\n *\n * e.g.\n * ```\n * <KeyValueRowRoot>\n * <KeyValueSection></KeyValueSection>\n * <KeyValueSection></KeyValueSection>\n * </KeyValueRowRoot>\n * ```\n *\n * @param props - Component props.\n * @param props.children - The two <KeyValueSection> children.\n * @param props.twClassName - Optional Tailwind class names to override root styles.\n * @param props.style - Optional additional styles for the root element.\n *\n * @returns The rendered Root component.\n */\nconst KeyValueRowRoot: React.FC<KeyValueRowRootProps> = ({\n children,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n\n return (\n <View\n style={[\n tw.style(\n 'flex-row justify-between items-center overflow-hidden',\n twClassName,\n ),\n style,\n ]}\n {...props}\n >\n {children}\n </View>\n );\n};\n\nexport default KeyValueRowRoot;\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { KeyValueRowRootProps } from "../KeyValueRow.types.cjs";
|
|
3
|
+
/**
|
|
4
|
+
* The main container for the KeyValueRow component.
|
|
5
|
+
* When creating custom KeyValueRow components, this must be the outermost component
|
|
6
|
+
* wrapping the two <KeyValueSection/> components.
|
|
7
|
+
*
|
|
8
|
+
* e.g.
|
|
9
|
+
* ```
|
|
10
|
+
* <KeyValueRowRoot>
|
|
11
|
+
* <KeyValueSection></KeyValueSection>
|
|
12
|
+
* <KeyValueSection></KeyValueSection>
|
|
13
|
+
* </KeyValueRowRoot>
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @param props - Component props.
|
|
17
|
+
* @param props.children - The two <KeyValueSection> children.
|
|
18
|
+
* @param props.twClassName - Optional Tailwind class names to override root styles.
|
|
19
|
+
* @param props.style - Optional additional styles for the root element.
|
|
20
|
+
*
|
|
21
|
+
* @returns The rendered Root component.
|
|
22
|
+
*/
|
|
23
|
+
declare const KeyValueRowRoot: React.FC<KeyValueRowRootProps>;
|
|
24
|
+
export default KeyValueRowRoot;
|
|
25
|
+
//# sourceMappingURL=KeyValueRoot.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueRoot.d.cts","sourceRoot":"","sources":["../../../../src/components/KeyValueRow/KeyValueRoot/KeyValueRoot.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAG1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,iCAA6B;AAEjE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAsBnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { KeyValueRowRootProps } from "../KeyValueRow.types.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* The main container for the KeyValueRow component.
|
|
5
|
+
* When creating custom KeyValueRow components, this must be the outermost component
|
|
6
|
+
* wrapping the two <KeyValueSection/> components.
|
|
7
|
+
*
|
|
8
|
+
* e.g.
|
|
9
|
+
* ```
|
|
10
|
+
* <KeyValueRowRoot>
|
|
11
|
+
* <KeyValueSection></KeyValueSection>
|
|
12
|
+
* <KeyValueSection></KeyValueSection>
|
|
13
|
+
* </KeyValueRowRoot>
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @param props - Component props.
|
|
17
|
+
* @param props.children - The two <KeyValueSection> children.
|
|
18
|
+
* @param props.twClassName - Optional Tailwind class names to override root styles.
|
|
19
|
+
* @param props.style - Optional additional styles for the root element.
|
|
20
|
+
*
|
|
21
|
+
* @returns The rendered Root component.
|
|
22
|
+
*/
|
|
23
|
+
declare const KeyValueRowRoot: React.FC<KeyValueRowRootProps>;
|
|
24
|
+
export default KeyValueRowRoot;
|
|
25
|
+
//# sourceMappingURL=KeyValueRoot.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueRoot.d.mts","sourceRoot":"","sources":["../../../../src/components/KeyValueRow/KeyValueRoot/KeyValueRoot.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAG1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,iCAA6B;AAEjE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAsBnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
|
|
8
|
+
import $React from "react";
|
|
9
|
+
const React = $importDefault($React);
|
|
10
|
+
import { View } from "react-native/index.js";
|
|
11
|
+
/**
|
|
12
|
+
* The main container for the KeyValueRow component.
|
|
13
|
+
* When creating custom KeyValueRow components, this must be the outermost component
|
|
14
|
+
* wrapping the two <KeyValueSection/> components.
|
|
15
|
+
*
|
|
16
|
+
* e.g.
|
|
17
|
+
* ```
|
|
18
|
+
* <KeyValueRowRoot>
|
|
19
|
+
* <KeyValueSection></KeyValueSection>
|
|
20
|
+
* <KeyValueSection></KeyValueSection>
|
|
21
|
+
* </KeyValueRowRoot>
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @param props - Component props.
|
|
25
|
+
* @param props.children - The two <KeyValueSection> children.
|
|
26
|
+
* @param props.twClassName - Optional Tailwind class names to override root styles.
|
|
27
|
+
* @param props.style - Optional additional styles for the root element.
|
|
28
|
+
*
|
|
29
|
+
* @returns The rendered Root component.
|
|
30
|
+
*/
|
|
31
|
+
const KeyValueRowRoot = ({ children, twClassName, style, ...props }) => {
|
|
32
|
+
const tw = useTailwind();
|
|
33
|
+
return (<View style={[
|
|
34
|
+
tw.style('flex-row justify-between items-center overflow-hidden', twClassName),
|
|
35
|
+
style,
|
|
36
|
+
]} {...props}>
|
|
37
|
+
{children}
|
|
38
|
+
</View>);
|
|
39
|
+
};
|
|
40
|
+
export default KeyValueRowRoot;
|
|
41
|
+
//# sourceMappingURL=KeyValueRoot.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueRoot.mjs","sourceRoot":"","sources":["../../../../src/components/KeyValueRow/KeyValueRoot/KeyValueRoot.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,IAAI,EAAE,8BAAqB;AAIpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,eAAe,GAAmC,CAAC,EACvD,QAAQ,EACR,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,OAAO,CACL,CAAC,IAAI,CACH,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,uDAAuD,EACvD,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CACF,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport type { KeyValueRowRootProps } from '../KeyValueRow.types';\n\n/**\n * The main container for the KeyValueRow component.\n * When creating custom KeyValueRow components, this must be the outermost component\n * wrapping the two <KeyValueSection/> components.\n *\n * e.g.\n * ```\n * <KeyValueRowRoot>\n * <KeyValueSection></KeyValueSection>\n * <KeyValueSection></KeyValueSection>\n * </KeyValueRowRoot>\n * ```\n *\n * @param props - Component props.\n * @param props.children - The two <KeyValueSection> children.\n * @param props.twClassName - Optional Tailwind class names to override root styles.\n * @param props.style - Optional additional styles for the root element.\n *\n * @returns The rendered Root component.\n */\nconst KeyValueRowRoot: React.FC<KeyValueRowRootProps> = ({\n children,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n\n return (\n <View\n style={[\n tw.style(\n 'flex-row justify-between items-center overflow-hidden',\n twClassName,\n ),\n style,\n ]}\n {...props}\n >\n {children}\n </View>\n );\n};\n\nexport default KeyValueRowRoot;\n"]}
|
|
@@ -0,0 +1,76 @@
|
|
|
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.KeyValueRowStubs = void 0;
|
|
7
|
+
const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const react_native_1 = require("react-native/index.js");
|
|
10
|
+
const Icon_1 = require("../Icon/index.cjs");
|
|
11
|
+
const KeyValueLabel_1 = __importDefault(require("./KeyValueLabel/KeyValueLabel.cjs"));
|
|
12
|
+
const KeyValueRoot_1 = __importDefault(require("./KeyValueRoot/KeyValueRoot.cjs"));
|
|
13
|
+
const KeyValueRow_types_1 = require("./KeyValueRow.types.cjs");
|
|
14
|
+
const KeyValueSection_1 = __importDefault(require("./KeyValueSection/KeyValueSection.cjs"));
|
|
15
|
+
const renderIcon = (icon) => {
|
|
16
|
+
const { side: _side, ...iconProps } = icon;
|
|
17
|
+
return <Icon_1.Icon {...iconProps}/>;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Prebuilt convenience component to format and render a key/value label pair.
|
|
21
|
+
* The KeyValueRowLabel component has props to display a tooltip and icon.
|
|
22
|
+
*
|
|
23
|
+
* @param props - Component props
|
|
24
|
+
* @param props.field - Represents the left side of the key value row pair
|
|
25
|
+
* @param props.value - Represents the right side of the key value row pair
|
|
26
|
+
* @param props.twClassName - Optional Tailwind class names for the root element
|
|
27
|
+
* @param props.style - Optional additional styles for the root element
|
|
28
|
+
*
|
|
29
|
+
* @returns The rendered KeyValueRow component.
|
|
30
|
+
*/
|
|
31
|
+
const KeyValueRow = ({ field, value, twClassName, style, ...props }) => {
|
|
32
|
+
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
33
|
+
const fieldIcon = field?.icon;
|
|
34
|
+
const valueIcon = value?.icon;
|
|
35
|
+
return (<KeyValueRoot_1.default twClassName={twClassName} style={style} {...props}>
|
|
36
|
+
<KeyValueSection_1.default>
|
|
37
|
+
<react_native_1.View style={tw.style('flex-row items-center gap-2')}>
|
|
38
|
+
{fieldIcon?.name &&
|
|
39
|
+
(fieldIcon.side === KeyValueRow_types_1.KeyValueRowFieldIconSides.Left ||
|
|
40
|
+
fieldIcon.side === KeyValueRow_types_1.KeyValueRowFieldIconSides.Both ||
|
|
41
|
+
!fieldIcon.side) &&
|
|
42
|
+
renderIcon(fieldIcon)}
|
|
43
|
+
<KeyValueLabel_1.default label={field.label} tooltip={field.tooltip}/>
|
|
44
|
+
{fieldIcon?.name &&
|
|
45
|
+
(fieldIcon.side === KeyValueRow_types_1.KeyValueRowFieldIconSides.Right ||
|
|
46
|
+
fieldIcon.side === KeyValueRow_types_1.KeyValueRowFieldIconSides.Both) &&
|
|
47
|
+
renderIcon(fieldIcon)}
|
|
48
|
+
</react_native_1.View>
|
|
49
|
+
</KeyValueSection_1.default>
|
|
50
|
+
<KeyValueSection_1.default align={KeyValueRow_types_1.KeyValueRowSectionAlignments.Right}>
|
|
51
|
+
<react_native_1.View style={tw.style('flex-row items-center gap-2')}>
|
|
52
|
+
{valueIcon?.name &&
|
|
53
|
+
(valueIcon.side === KeyValueRow_types_1.KeyValueRowFieldIconSides.Left ||
|
|
54
|
+
valueIcon.side === KeyValueRow_types_1.KeyValueRowFieldIconSides.Both ||
|
|
55
|
+
!valueIcon.side) &&
|
|
56
|
+
renderIcon(valueIcon)}
|
|
57
|
+
<KeyValueLabel_1.default label={value.label} tooltip={value.tooltip}/>
|
|
58
|
+
{valueIcon?.name &&
|
|
59
|
+
(valueIcon.side === KeyValueRow_types_1.KeyValueRowFieldIconSides.Right ||
|
|
60
|
+
valueIcon.side === KeyValueRow_types_1.KeyValueRowFieldIconSides.Both) &&
|
|
61
|
+
renderIcon(valueIcon)}
|
|
62
|
+
</react_native_1.View>
|
|
63
|
+
</KeyValueSection_1.default>
|
|
64
|
+
</KeyValueRoot_1.default>);
|
|
65
|
+
};
|
|
66
|
+
KeyValueRow.displayName = 'KeyValueRow';
|
|
67
|
+
/**
|
|
68
|
+
* Exported sub-components to provide a base for new KeyValueRow variants.
|
|
69
|
+
*/
|
|
70
|
+
exports.KeyValueRowStubs = {
|
|
71
|
+
Root: KeyValueRoot_1.default,
|
|
72
|
+
Section: KeyValueSection_1.default,
|
|
73
|
+
Label: KeyValueLabel_1.default,
|
|
74
|
+
};
|
|
75
|
+
exports.default = KeyValueRow;
|
|
76
|
+
//# sourceMappingURL=KeyValueRow.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueRow.cjs","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.tsx"],"names":[],"mappings":";;;;;;AAAA,8FAA4E;AAC5E,kDAA0B;AAC1B,wDAAoC;AAEpC,4CAA+B;AAG/B,sFAA6D;AAC7D,mFAA0D;AAE1D,+DAG6B;AAC7B,4FAAgE;AAIhE,MAAM,UAAU,GAAG,CAAC,IAAkB,EAAE,EAAE;IACxC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,SAAS,EAAE,GAAG,IAAI,CAAC;IAC3C,OAAO,CAAC,WAAI,CAAC,IAAI,SAAS,CAAC,EAAG,CAAC;AACjC,CAAC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,GAA+B,CAAC,EAC/C,KAAK,EACL,KAAK,EACL,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,MAAM,SAAS,GAAG,KAAK,EAAE,IAAI,CAAC;IAC9B,MAAM,SAAS,GAAG,KAAK,EAAE,IAAI,CAAC;IAE9B,OAAO,CACL,CAAC,sBAAe,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK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C,SAAS,EAAE,IAAI;YACd,CAAC,SAAS,CAAC,IAAI,KAAK,6CAAyB,CAAC,KAAK;gBACjD,SAAS,CAAC,IAAI,KAAK,6CAAyB,CAAC,IAAI,CAAC;YACpD,UAAU,CAAC,SAAS,CAAC,CACzB;QAAA,EAAE,mBAAI,CACR;MAAA,EAAE,yBAAe,CACnB;IAAA,EAAE,sBAAe,CAAC,CACnB,CAAC;AACJ,CAAC,CAAC;AAEF,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC;AAExC;;GAEG;AACU,QAAA,gBAAgB,GAAG;IAC9B,IAAI,EAAE,sBAAe;IACrB,OAAO,EAAE,yBAAe;IACxB,KAAK,EAAE,uBAAgB;CACxB,CAAC;AAEF,kBAAe,WAAW,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport { Icon } from '../Icon';\nimport type { IconProps } from '../Icon';\n\nimport KeyValueRowLabel from './KeyValueLabel/KeyValueLabel';\nimport KeyValueRowRoot from './KeyValueRoot/KeyValueRoot';\nimport type { KeyValueRowProps } from './KeyValueRow.types';\nimport {\n KeyValueRowFieldIconSides,\n KeyValueRowSectionAlignments,\n} from './KeyValueRow.types';\nimport KeyValueSection from './KeyValueSection/KeyValueSection';\n\ntype IconWithSide = IconProps & { side?: KeyValueRowFieldIconSides };\n\nconst renderIcon = (icon: IconWithSide) => {\n const { side: _side, ...iconProps } = icon;\n return <Icon {...iconProps} />;\n};\n\n/**\n * Prebuilt convenience component to format and render a key/value label pair.\n * The KeyValueRowLabel component has props to display a tooltip and icon.\n *\n * @param props - Component props\n * @param props.field - Represents the left side of the key value row pair\n * @param props.value - Represents the right side of the key value row pair\n * @param props.twClassName - Optional Tailwind class names for the root element\n * @param props.style - Optional additional styles for the root element\n *\n * @returns The rendered KeyValueRow component.\n */\nconst KeyValueRow: React.FC<KeyValueRowProps> = ({\n field,\n value,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n\n const fieldIcon = field?.icon;\n const valueIcon = value?.icon;\n\n return (\n <KeyValueRowRoot twClassName={twClassName} style={style} {...props}>\n <KeyValueSection>\n <View style={tw.style('flex-row items-center gap-2')}>\n {fieldIcon?.name &&\n (fieldIcon.side === KeyValueRowFieldIconSides.Left ||\n fieldIcon.side === KeyValueRowFieldIconSides.Both ||\n !fieldIcon.side) &&\n renderIcon(fieldIcon)}\n <KeyValueRowLabel label={field.label} tooltip={field.tooltip} />\n {fieldIcon?.name &&\n (fieldIcon.side === KeyValueRowFieldIconSides.Right ||\n fieldIcon.side === KeyValueRowFieldIconSides.Both) &&\n renderIcon(fieldIcon)}\n </View>\n </KeyValueSection>\n <KeyValueSection align={KeyValueRowSectionAlignments.Right}>\n <View style={tw.style('flex-row items-center gap-2')}>\n {valueIcon?.name &&\n (valueIcon.side === KeyValueRowFieldIconSides.Left ||\n valueIcon.side === KeyValueRowFieldIconSides.Both ||\n !valueIcon.side) &&\n renderIcon(valueIcon)}\n <KeyValueRowLabel label={value.label} tooltip={value.tooltip} />\n {valueIcon?.name &&\n (valueIcon.side === KeyValueRowFieldIconSides.Right ||\n valueIcon.side === KeyValueRowFieldIconSides.Both) &&\n renderIcon(valueIcon)}\n </View>\n </KeyValueSection>\n </KeyValueRowRoot>\n );\n};\n\nKeyValueRow.displayName = 'KeyValueRow';\n\n/**\n * Exported sub-components to provide a base for new KeyValueRow variants.\n */\nexport const KeyValueRowStubs = {\n Root: KeyValueRowRoot,\n Section: KeyValueSection,\n Label: KeyValueRowLabel,\n};\n\nexport default KeyValueRow;\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { KeyValueRowProps } from "./KeyValueRow.types.cjs";
|
|
3
|
+
/**
|
|
4
|
+
* Prebuilt convenience component to format and render a key/value label pair.
|
|
5
|
+
* The KeyValueRowLabel component has props to display a tooltip and icon.
|
|
6
|
+
*
|
|
7
|
+
* @param props - Component props
|
|
8
|
+
* @param props.field - Represents the left side of the key value row pair
|
|
9
|
+
* @param props.value - Represents the right side of the key value row pair
|
|
10
|
+
* @param props.twClassName - Optional Tailwind class names for the root element
|
|
11
|
+
* @param props.style - Optional additional styles for the root element
|
|
12
|
+
*
|
|
13
|
+
* @returns The rendered KeyValueRow component.
|
|
14
|
+
*/
|
|
15
|
+
declare const KeyValueRow: React.FC<KeyValueRowProps>;
|
|
16
|
+
/**
|
|
17
|
+
* Exported sub-components to provide a base for new KeyValueRow variants.
|
|
18
|
+
*/
|
|
19
|
+
export declare const KeyValueRowStubs: {
|
|
20
|
+
Root: React.FC<import("./KeyValueRow.types.cjs").KeyValueRowRootProps>;
|
|
21
|
+
Section: React.FC<import("./KeyValueRow.types.cjs").KeyValueSectionProps>;
|
|
22
|
+
Label: React.FC<import("./KeyValueRow.types.cjs").KeyValueRowLabelProps>;
|
|
23
|
+
};
|
|
24
|
+
export default KeyValueRow;
|
|
25
|
+
//# sourceMappingURL=KeyValueRow.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueRow.d.cts","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAQ1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAc5D;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA4C3C,CAAC;AAIF;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { KeyValueRowProps } from "./KeyValueRow.types.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Prebuilt convenience component to format and render a key/value label pair.
|
|
5
|
+
* The KeyValueRowLabel component has props to display a tooltip and icon.
|
|
6
|
+
*
|
|
7
|
+
* @param props - Component props
|
|
8
|
+
* @param props.field - Represents the left side of the key value row pair
|
|
9
|
+
* @param props.value - Represents the right side of the key value row pair
|
|
10
|
+
* @param props.twClassName - Optional Tailwind class names for the root element
|
|
11
|
+
* @param props.style - Optional additional styles for the root element
|
|
12
|
+
*
|
|
13
|
+
* @returns The rendered KeyValueRow component.
|
|
14
|
+
*/
|
|
15
|
+
declare const KeyValueRow: React.FC<KeyValueRowProps>;
|
|
16
|
+
/**
|
|
17
|
+
* Exported sub-components to provide a base for new KeyValueRow variants.
|
|
18
|
+
*/
|
|
19
|
+
export declare const KeyValueRowStubs: {
|
|
20
|
+
Root: React.FC<import("./KeyValueRow.types.mjs").KeyValueRowRootProps>;
|
|
21
|
+
Section: React.FC<import("./KeyValueRow.types.mjs").KeyValueSectionProps>;
|
|
22
|
+
Label: React.FC<import("./KeyValueRow.types.mjs").KeyValueRowLabelProps>;
|
|
23
|
+
};
|
|
24
|
+
export default KeyValueRow;
|
|
25
|
+
//# sourceMappingURL=KeyValueRow.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueRow.d.mts","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAQ1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAc5D;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA4C3C,CAAC;AAIF;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
|
|
8
|
+
import $React from "react";
|
|
9
|
+
const React = $importDefault($React);
|
|
10
|
+
import { View } from "react-native/index.js";
|
|
11
|
+
import { Icon } from "../Icon/index.mjs";
|
|
12
|
+
import KeyValueRowLabel from "./KeyValueLabel/KeyValueLabel.mjs";
|
|
13
|
+
import KeyValueRowRoot from "./KeyValueRoot/KeyValueRoot.mjs";
|
|
14
|
+
import { KeyValueRowFieldIconSides, KeyValueRowSectionAlignments } from "./KeyValueRow.types.mjs";
|
|
15
|
+
import KeyValueSection from "./KeyValueSection/KeyValueSection.mjs";
|
|
16
|
+
const renderIcon = (icon) => {
|
|
17
|
+
const { side: _side, ...iconProps } = icon;
|
|
18
|
+
return <Icon {...iconProps}/>;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Prebuilt convenience component to format and render a key/value label pair.
|
|
22
|
+
* The KeyValueRowLabel component has props to display a tooltip and icon.
|
|
23
|
+
*
|
|
24
|
+
* @param props - Component props
|
|
25
|
+
* @param props.field - Represents the left side of the key value row pair
|
|
26
|
+
* @param props.value - Represents the right side of the key value row pair
|
|
27
|
+
* @param props.twClassName - Optional Tailwind class names for the root element
|
|
28
|
+
* @param props.style - Optional additional styles for the root element
|
|
29
|
+
*
|
|
30
|
+
* @returns The rendered KeyValueRow component.
|
|
31
|
+
*/
|
|
32
|
+
const KeyValueRow = ({ field, value, twClassName, style, ...props }) => {
|
|
33
|
+
const tw = useTailwind();
|
|
34
|
+
const fieldIcon = field?.icon;
|
|
35
|
+
const valueIcon = value?.icon;
|
|
36
|
+
return (<KeyValueRowRoot twClassName={twClassName} style={style} {...props}>
|
|
37
|
+
<KeyValueSection>
|
|
38
|
+
<View style={tw.style('flex-row items-center gap-2')}>
|
|
39
|
+
{fieldIcon?.name &&
|
|
40
|
+
(fieldIcon.side === KeyValueRowFieldIconSides.Left ||
|
|
41
|
+
fieldIcon.side === KeyValueRowFieldIconSides.Both ||
|
|
42
|
+
!fieldIcon.side) &&
|
|
43
|
+
renderIcon(fieldIcon)}
|
|
44
|
+
<KeyValueRowLabel label={field.label} tooltip={field.tooltip}/>
|
|
45
|
+
{fieldIcon?.name &&
|
|
46
|
+
(fieldIcon.side === KeyValueRowFieldIconSides.Right ||
|
|
47
|
+
fieldIcon.side === KeyValueRowFieldIconSides.Both) &&
|
|
48
|
+
renderIcon(fieldIcon)}
|
|
49
|
+
</View>
|
|
50
|
+
</KeyValueSection>
|
|
51
|
+
<KeyValueSection align={KeyValueRowSectionAlignments.Right}>
|
|
52
|
+
<View style={tw.style('flex-row items-center gap-2')}>
|
|
53
|
+
{valueIcon?.name &&
|
|
54
|
+
(valueIcon.side === KeyValueRowFieldIconSides.Left ||
|
|
55
|
+
valueIcon.side === KeyValueRowFieldIconSides.Both ||
|
|
56
|
+
!valueIcon.side) &&
|
|
57
|
+
renderIcon(valueIcon)}
|
|
58
|
+
<KeyValueRowLabel label={value.label} tooltip={value.tooltip}/>
|
|
59
|
+
{valueIcon?.name &&
|
|
60
|
+
(valueIcon.side === KeyValueRowFieldIconSides.Right ||
|
|
61
|
+
valueIcon.side === KeyValueRowFieldIconSides.Both) &&
|
|
62
|
+
renderIcon(valueIcon)}
|
|
63
|
+
</View>
|
|
64
|
+
</KeyValueSection>
|
|
65
|
+
</KeyValueRowRoot>);
|
|
66
|
+
};
|
|
67
|
+
KeyValueRow.displayName = 'KeyValueRow';
|
|
68
|
+
/**
|
|
69
|
+
* Exported sub-components to provide a base for new KeyValueRow variants.
|
|
70
|
+
*/
|
|
71
|
+
export const KeyValueRowStubs = {
|
|
72
|
+
Root: KeyValueRowRoot,
|
|
73
|
+
Section: KeyValueSection,
|
|
74
|
+
Label: KeyValueRowLabel,
|
|
75
|
+
};
|
|
76
|
+
export default KeyValueRow;
|
|
77
|
+
//# sourceMappingURL=KeyValueRow.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueRow.mjs","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EA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rB,OAAO,EAAE,eAAe;IACxB,KAAK,EAAE,gBAAgB;CACxB,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport { Icon } from '../Icon';\nimport type { IconProps } from '../Icon';\n\nimport KeyValueRowLabel from './KeyValueLabel/KeyValueLabel';\nimport KeyValueRowRoot from './KeyValueRoot/KeyValueRoot';\nimport type { KeyValueRowProps } from './KeyValueRow.types';\nimport {\n KeyValueRowFieldIconSides,\n KeyValueRowSectionAlignments,\n} from './KeyValueRow.types';\nimport KeyValueSection from './KeyValueSection/KeyValueSection';\n\ntype IconWithSide = IconProps & { side?: KeyValueRowFieldIconSides };\n\nconst renderIcon = (icon: IconWithSide) => {\n const { side: _side, ...iconProps } = icon;\n return <Icon {...iconProps} />;\n};\n\n/**\n * Prebuilt convenience component to format and render a key/value label pair.\n * The KeyValueRowLabel component has props to display a tooltip and icon.\n *\n * @param props - Component props\n * @param props.field - Represents the left side of the key value row pair\n * @param props.value - Represents the right side of the key value row pair\n * @param props.twClassName - Optional Tailwind class names for the root element\n * @param props.style - Optional additional styles for the root element\n *\n * @returns The rendered KeyValueRow component.\n */\nconst KeyValueRow: React.FC<KeyValueRowProps> = ({\n field,\n value,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n\n const fieldIcon = field?.icon;\n const valueIcon = value?.icon;\n\n return (\n <KeyValueRowRoot twClassName={twClassName} style={style} {...props}>\n <KeyValueSection>\n <View style={tw.style('flex-row items-center gap-2')}>\n {fieldIcon?.name &&\n (fieldIcon.side === KeyValueRowFieldIconSides.Left ||\n fieldIcon.side === KeyValueRowFieldIconSides.Both ||\n !fieldIcon.side) &&\n renderIcon(fieldIcon)}\n <KeyValueRowLabel label={field.label} tooltip={field.tooltip} />\n {fieldIcon?.name &&\n (fieldIcon.side === KeyValueRowFieldIconSides.Right ||\n fieldIcon.side === KeyValueRowFieldIconSides.Both) &&\n renderIcon(fieldIcon)}\n </View>\n </KeyValueSection>\n <KeyValueSection align={KeyValueRowSectionAlignments.Right}>\n <View style={tw.style('flex-row items-center gap-2')}>\n {valueIcon?.name &&\n (valueIcon.side === KeyValueRowFieldIconSides.Left ||\n valueIcon.side === KeyValueRowFieldIconSides.Both ||\n !valueIcon.side) &&\n renderIcon(valueIcon)}\n <KeyValueRowLabel label={value.label} tooltip={value.tooltip} />\n {valueIcon?.name &&\n (valueIcon.side === KeyValueRowFieldIconSides.Right ||\n valueIcon.side === KeyValueRowFieldIconSides.Both) &&\n renderIcon(valueIcon)}\n </View>\n </KeyValueSection>\n </KeyValueRowRoot>\n );\n};\n\nKeyValueRow.displayName = 'KeyValueRow';\n\n/**\n * Exported sub-components to provide a base for new KeyValueRow variants.\n */\nexport const KeyValueRowStubs = {\n Root: KeyValueRowRoot,\n Section: KeyValueSection,\n Label: KeyValueRowLabel,\n};\n\nexport default KeyValueRow;\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KeyValueRowSectionAlignments = exports.TooltipSizes = exports.IconSizes = exports.KeyValueRowFieldIconSides = void 0;
|
|
4
|
+
const ButtonIcon_1 = require("../ButtonIcon/index.cjs");
|
|
5
|
+
const Icon_1 = require("../Icon/index.cjs");
|
|
6
|
+
/**
|
|
7
|
+
* Used to position an icon in a KeyValueRowField.
|
|
8
|
+
*/
|
|
9
|
+
exports.KeyValueRowFieldIconSides = {
|
|
10
|
+
Left: 'left',
|
|
11
|
+
Right: 'right',
|
|
12
|
+
Both: 'both',
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Re-exported for backwards compatibility.
|
|
16
|
+
*/
|
|
17
|
+
exports.IconSizes = Icon_1.IconSize;
|
|
18
|
+
/**
|
|
19
|
+
* Re-exported for backwards compatibility.
|
|
20
|
+
*/
|
|
21
|
+
exports.TooltipSizes = ButtonIcon_1.ButtonIconSize;
|
|
22
|
+
/**
|
|
23
|
+
* Represents the valid KeyValueSection alignments.
|
|
24
|
+
*/
|
|
25
|
+
exports.KeyValueRowSectionAlignments = {
|
|
26
|
+
Left: 'items-start',
|
|
27
|
+
Right: 'items-end',
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=KeyValueRow.types.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueRow.types.cjs","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.types.ts"],"names":[],"mappings":";;;AAGA,wDAA+C;AAC/C,4CAA6C;AAsC7C;;GAEG;AACU,QAAA,yBAAyB,GAAG;IACvC,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;CACJ,CAAC;AAuBX;;GAEG;AACU,QAAA,SAAS,GAAG,eAAQ,CAAC;AAElC;;GAEG;AACU,QAAA,YAAY,GAAG,2BAAc,CAAC;AAsC3C;;GAEG;AACU,QAAA,4BAA4B,GAAG;IAC1C,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,WAAW;CACV,CAAC","sourcesContent":["import type { ReactNode } from 'react';\nimport type { ViewProps } from 'react-native';\n\nimport { ButtonIconSize } from '../ButtonIcon';\nimport { IconName, IconSize } from '../Icon';\nimport type { IconProps } from '../Icon';\nimport type { TextProps } from '../Text';\n\n/**\n * The optional tooltip that can be displayed within a KeyValueRowField.\n */\nexport type KeyValueRowTooltip = {\n /**\n * The title displayed at the top of the tooltip.\n */\n title: string;\n /**\n * The content displayed within the tooltip body.\n */\n content: string | ReactNode;\n /**\n * Optional size of the tooltip icon button.\n *\n * @default ButtonIconSize.Md\n */\n size?: ButtonIconSize;\n /**\n * Optional icon name for the tooltip icon.\n *\n * @default IconName.Question\n */\n iconName?: IconName;\n /**\n * Optional onPress handler called when the tooltip icon is pressed.\n */\n onPress?: (...args: unknown[]) => unknown;\n /**\n * Optional bottom padding for the tooltip modal.\n */\n bottomPadding?: number;\n};\n\n/**\n * Used to position an icon in a KeyValueRowField.\n */\nexport const KeyValueRowFieldIconSides = {\n Left: 'left',\n Right: 'right',\n Both: 'both',\n} as const;\n\nexport type KeyValueRowFieldIconSides =\n (typeof KeyValueRowFieldIconSides)[keyof typeof KeyValueRowFieldIconSides];\n\n/**\n * Represents a field displayed within KeyValueRowProps.\n */\nexport type KeyValueRowField = {\n /**\n * The label content displayed.\n */\n label: PreDefinedKeyValueRowLabel | ReactNode;\n /**\n * Optional icon to display. If undefined, no icon is displayed.\n */\n icon?: IconProps & { side?: KeyValueRowFieldIconSides };\n /**\n * Optional tooltip to display. If undefined, no tooltip is displayed.\n */\n tooltip?: KeyValueRowTooltip;\n};\n\n/**\n * Re-exported for backwards compatibility.\n */\nexport const IconSizes = IconSize;\n\n/**\n * Re-exported for backwards compatibility.\n */\nexport const TooltipSizes = ButtonIconSize;\n\n/**\n * A predefined label object with text, variant, and color.\n */\nexport type PreDefinedKeyValueRowLabel = {\n /**\n * Text to display.\n */\n text: string;\n /**\n * Optional text variant.\n *\n * @default TextVariant.BodyMd\n */\n variant?: TextProps['variant'];\n /**\n * Optional text color.\n *\n * @default TextColor.TextDefault\n */\n color?: TextProps['color'];\n};\n\n/**\n * The KeyValueRowLabel component props.\n */\nexport type KeyValueRowLabelProps = {\n /**\n * The label content displayed.\n */\n label: PreDefinedKeyValueRowLabel | ReactNode;\n /**\n * Optional tooltip. If undefined, the tooltip won't be displayed.\n */\n tooltip?: KeyValueRowTooltip;\n};\n\n/**\n * Represents the valid KeyValueSection alignments.\n */\nexport const KeyValueRowSectionAlignments = {\n Left: 'items-start',\n Right: 'items-end',\n} as const;\n\nexport type KeyValueRowSectionAlignments =\n (typeof KeyValueRowSectionAlignments)[keyof typeof KeyValueRowSectionAlignments];\n\n/**\n * Represents the main container for the KeyValueRow component.\n *\n * Extends `ViewProps` so the root View inherits standard React Native\n * props such as `testID` and `accessibilityLabel`.\n */\nexport type KeyValueRowRootProps = {\n /**\n * Must have exactly two children. Adding more will lead to an undesired outcome.\n */\n children: [ReactNode, ReactNode];\n /**\n * Optional Tailwind class names to override default styles on the root element.\n */\n twClassName?: string;\n} & ViewProps;\n\n/**\n * The KeyValueSection component props.\n *\n * Extends `ViewProps` so the root View inherits standard React Native\n * props such as `testID` and `accessibilityLabel`.\n */\nexport type KeyValueSectionProps = {\n /**\n * Child components.\n */\n children: ReactNode;\n /**\n * Optional content alignment.\n *\n * @default KeyValueRowSectionAlignments.Left\n */\n align?: KeyValueRowSectionAlignments;\n /**\n * Optional Tailwind class names to override default styles on the root element.\n */\n twClassName?: string;\n} & ViewProps;\n\n/**\n * The KeyValueRow component props.\n *\n * Extends `ViewProps` so the root View inherits standard React Native\n * props such as `testID` and `accessibilityLabel`.\n */\nexport type KeyValueRowProps = {\n /**\n * The \"key\" portion of the KeyValueRow (left side).\n * Using the variable name field because key is reserved.\n */\n field: KeyValueRowField;\n /**\n * The \"value\" portion of the KeyValueRow (right side).\n */\n value: KeyValueRowField;\n /**\n * Optional Tailwind class names to override default styles on the root element.\n */\n twClassName?: string;\n} & ViewProps;\n"]}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { ViewProps } from "react-native/index.js";
|
|
3
|
+
import { ButtonIconSize } from "../ButtonIcon/index.cjs";
|
|
4
|
+
import { IconName, IconSize } from "../Icon/index.cjs";
|
|
5
|
+
import type { IconProps } from "../Icon/index.cjs";
|
|
6
|
+
import type { TextProps } from "../Text/index.cjs";
|
|
7
|
+
/**
|
|
8
|
+
* The optional tooltip that can be displayed within a KeyValueRowField.
|
|
9
|
+
*/
|
|
10
|
+
export type KeyValueRowTooltip = {
|
|
11
|
+
/**
|
|
12
|
+
* The title displayed at the top of the tooltip.
|
|
13
|
+
*/
|
|
14
|
+
title: string;
|
|
15
|
+
/**
|
|
16
|
+
* The content displayed within the tooltip body.
|
|
17
|
+
*/
|
|
18
|
+
content: string | ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Optional size of the tooltip icon button.
|
|
21
|
+
*
|
|
22
|
+
* @default ButtonIconSize.Md
|
|
23
|
+
*/
|
|
24
|
+
size?: ButtonIconSize;
|
|
25
|
+
/**
|
|
26
|
+
* Optional icon name for the tooltip icon.
|
|
27
|
+
*
|
|
28
|
+
* @default IconName.Question
|
|
29
|
+
*/
|
|
30
|
+
iconName?: IconName;
|
|
31
|
+
/**
|
|
32
|
+
* Optional onPress handler called when the tooltip icon is pressed.
|
|
33
|
+
*/
|
|
34
|
+
onPress?: (...args: unknown[]) => unknown;
|
|
35
|
+
/**
|
|
36
|
+
* Optional bottom padding for the tooltip modal.
|
|
37
|
+
*/
|
|
38
|
+
bottomPadding?: number;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Used to position an icon in a KeyValueRowField.
|
|
42
|
+
*/
|
|
43
|
+
export declare const KeyValueRowFieldIconSides: {
|
|
44
|
+
readonly Left: "left";
|
|
45
|
+
readonly Right: "right";
|
|
46
|
+
readonly Both: "both";
|
|
47
|
+
};
|
|
48
|
+
export type KeyValueRowFieldIconSides = (typeof KeyValueRowFieldIconSides)[keyof typeof KeyValueRowFieldIconSides];
|
|
49
|
+
/**
|
|
50
|
+
* Represents a field displayed within KeyValueRowProps.
|
|
51
|
+
*/
|
|
52
|
+
export type KeyValueRowField = {
|
|
53
|
+
/**
|
|
54
|
+
* The label content displayed.
|
|
55
|
+
*/
|
|
56
|
+
label: PreDefinedKeyValueRowLabel | ReactNode;
|
|
57
|
+
/**
|
|
58
|
+
* Optional icon to display. If undefined, no icon is displayed.
|
|
59
|
+
*/
|
|
60
|
+
icon?: IconProps & {
|
|
61
|
+
side?: KeyValueRowFieldIconSides;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Optional tooltip to display. If undefined, no tooltip is displayed.
|
|
65
|
+
*/
|
|
66
|
+
tooltip?: KeyValueRowTooltip;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Re-exported for backwards compatibility.
|
|
70
|
+
*/
|
|
71
|
+
export declare const IconSizes: typeof IconSize;
|
|
72
|
+
/**
|
|
73
|
+
* Re-exported for backwards compatibility.
|
|
74
|
+
*/
|
|
75
|
+
export declare const TooltipSizes: typeof ButtonIconSize;
|
|
76
|
+
/**
|
|
77
|
+
* A predefined label object with text, variant, and color.
|
|
78
|
+
*/
|
|
79
|
+
export type PreDefinedKeyValueRowLabel = {
|
|
80
|
+
/**
|
|
81
|
+
* Text to display.
|
|
82
|
+
*/
|
|
83
|
+
text: string;
|
|
84
|
+
/**
|
|
85
|
+
* Optional text variant.
|
|
86
|
+
*
|
|
87
|
+
* @default TextVariant.BodyMd
|
|
88
|
+
*/
|
|
89
|
+
variant?: TextProps['variant'];
|
|
90
|
+
/**
|
|
91
|
+
* Optional text color.
|
|
92
|
+
*
|
|
93
|
+
* @default TextColor.TextDefault
|
|
94
|
+
*/
|
|
95
|
+
color?: TextProps['color'];
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* The KeyValueRowLabel component props.
|
|
99
|
+
*/
|
|
100
|
+
export type KeyValueRowLabelProps = {
|
|
101
|
+
/**
|
|
102
|
+
* The label content displayed.
|
|
103
|
+
*/
|
|
104
|
+
label: PreDefinedKeyValueRowLabel | ReactNode;
|
|
105
|
+
/**
|
|
106
|
+
* Optional tooltip. If undefined, the tooltip won't be displayed.
|
|
107
|
+
*/
|
|
108
|
+
tooltip?: KeyValueRowTooltip;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Represents the valid KeyValueSection alignments.
|
|
112
|
+
*/
|
|
113
|
+
export declare const KeyValueRowSectionAlignments: {
|
|
114
|
+
readonly Left: "items-start";
|
|
115
|
+
readonly Right: "items-end";
|
|
116
|
+
};
|
|
117
|
+
export type KeyValueRowSectionAlignments = (typeof KeyValueRowSectionAlignments)[keyof typeof KeyValueRowSectionAlignments];
|
|
118
|
+
/**
|
|
119
|
+
* Represents the main container for the KeyValueRow component.
|
|
120
|
+
*
|
|
121
|
+
* Extends `ViewProps` so the root View inherits standard React Native
|
|
122
|
+
* props such as `testID` and `accessibilityLabel`.
|
|
123
|
+
*/
|
|
124
|
+
export type KeyValueRowRootProps = {
|
|
125
|
+
/**
|
|
126
|
+
* Must have exactly two children. Adding more will lead to an undesired outcome.
|
|
127
|
+
*/
|
|
128
|
+
children: [ReactNode, ReactNode];
|
|
129
|
+
/**
|
|
130
|
+
* Optional Tailwind class names to override default styles on the root element.
|
|
131
|
+
*/
|
|
132
|
+
twClassName?: string;
|
|
133
|
+
} & ViewProps;
|
|
134
|
+
/**
|
|
135
|
+
* The KeyValueSection component props.
|
|
136
|
+
*
|
|
137
|
+
* Extends `ViewProps` so the root View inherits standard React Native
|
|
138
|
+
* props such as `testID` and `accessibilityLabel`.
|
|
139
|
+
*/
|
|
140
|
+
export type KeyValueSectionProps = {
|
|
141
|
+
/**
|
|
142
|
+
* Child components.
|
|
143
|
+
*/
|
|
144
|
+
children: ReactNode;
|
|
145
|
+
/**
|
|
146
|
+
* Optional content alignment.
|
|
147
|
+
*
|
|
148
|
+
* @default KeyValueRowSectionAlignments.Left
|
|
149
|
+
*/
|
|
150
|
+
align?: KeyValueRowSectionAlignments;
|
|
151
|
+
/**
|
|
152
|
+
* Optional Tailwind class names to override default styles on the root element.
|
|
153
|
+
*/
|
|
154
|
+
twClassName?: string;
|
|
155
|
+
} & ViewProps;
|
|
156
|
+
/**
|
|
157
|
+
* The KeyValueRow component props.
|
|
158
|
+
*
|
|
159
|
+
* Extends `ViewProps` so the root View inherits standard React Native
|
|
160
|
+
* props such as `testID` and `accessibilityLabel`.
|
|
161
|
+
*/
|
|
162
|
+
export type KeyValueRowProps = {
|
|
163
|
+
/**
|
|
164
|
+
* The "key" portion of the KeyValueRow (left side).
|
|
165
|
+
* Using the variable name field because key is reserved.
|
|
166
|
+
*/
|
|
167
|
+
field: KeyValueRowField;
|
|
168
|
+
/**
|
|
169
|
+
* The "value" portion of the KeyValueRow (right side).
|
|
170
|
+
*/
|
|
171
|
+
value: KeyValueRowField;
|
|
172
|
+
/**
|
|
173
|
+
* Optional Tailwind class names to override default styles on the root element.
|
|
174
|
+
*/
|
|
175
|
+
twClassName?: string;
|
|
176
|
+
} & ViewProps;
|
|
177
|
+
//# sourceMappingURL=KeyValueRow.types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueRow.types.d.cts","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C,OAAO,EAAE,cAAc,EAAE,gCAAsB;AAC/C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,0BAAgB;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B;;;;OAIG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;IAC1C;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;CAI5B,CAAC;AAEX,MAAM,MAAM,yBAAyB,GACnC,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,OAAO,yBAAyB,CAAC,CAAC;AAE7E;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,KAA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