@metamask-previews/design-system-react-native 0.11.0-preview.645f8b0 → 0.11.0-preview.9c677c4
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/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/package.json +4 -4
|
@@ -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":"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"}
|
|
@@ -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.mjs";
|
|
4
|
+
import { IconName, IconSize } from "../Icon/index.mjs";
|
|
5
|
+
import type { IconProps } from "../Icon/index.mjs";
|
|
6
|
+
import type { TextProps } from "../Text/index.mjs";
|
|
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.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueRow.types.d.mts","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ButtonIconSize } from "../ButtonIcon/index.mjs";
|
|
2
|
+
import { IconName, IconSize } from "../Icon/index.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Used to position an icon in a KeyValueRowField.
|
|
5
|
+
*/
|
|
6
|
+
export const KeyValueRowFieldIconSides = {
|
|
7
|
+
Left: 'left',
|
|
8
|
+
Right: 'right',
|
|
9
|
+
Both: 'both',
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Re-exported for backwards compatibility.
|
|
13
|
+
*/
|
|
14
|
+
export const IconSizes = IconSize;
|
|
15
|
+
/**
|
|
16
|
+
* Re-exported for backwards compatibility.
|
|
17
|
+
*/
|
|
18
|
+
export const TooltipSizes = ButtonIconSize;
|
|
19
|
+
/**
|
|
20
|
+
* Represents the valid KeyValueSection alignments.
|
|
21
|
+
*/
|
|
22
|
+
export const KeyValueRowSectionAlignments = {
|
|
23
|
+
Left: 'items-start',
|
|
24
|
+
Right: 'items-end',
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=KeyValueRow.types.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueRow.types.mjs","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.types.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,gCAAsB;AAC/C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,0BAAgB;AAsC7C;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;CACJ,CAAC;AAuBX;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC;AAsC3C;;GAEG;AACH,MAAM,CAAC,MAAM,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,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isPreDefinedKeyValueRowLabel = void 0;
|
|
4
|
+
const isPreDefinedKeyValueRowLabel = (label) => label !== null && typeof label === 'object' && 'text' in label;
|
|
5
|
+
exports.isPreDefinedKeyValueRowLabel = isPreDefinedKeyValueRowLabel;
|
|
6
|
+
//# sourceMappingURL=KeyValueRow.utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueRow.utils.cjs","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.utils.ts"],"names":[],"mappings":";;;AAKO,MAAM,4BAA4B,GAAG,CAC1C,KAAqC,EACA,EAAE,CACvC,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,IAAI,KAAK,CAAC;AAHpD,QAAA,4BAA4B,gCAGwB","sourcesContent":["import {\n KeyValueRowLabelProps,\n PreDefinedKeyValueRowLabel,\n} from './KeyValueRow.types';\n\nexport const isPreDefinedKeyValueRowLabel = (\n label: KeyValueRowLabelProps['label'],\n): label is PreDefinedKeyValueRowLabel =>\n label !== null && typeof label === 'object' && 'text' in label;\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { KeyValueRowLabelProps, PreDefinedKeyValueRowLabel } from "./KeyValueRow.types.cjs";
|
|
2
|
+
export declare const isPreDefinedKeyValueRowLabel: (label: KeyValueRowLabelProps['label']) => label is PreDefinedKeyValueRowLabel;
|
|
3
|
+
//# sourceMappingURL=KeyValueRow.utils.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueRow.utils.d.cts","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC3B,gCAA4B;AAE7B,eAAO,MAAM,4BAA4B,UAChC,qBAAqB,CAAC,OAAO,CAAC,wCAEyB,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { KeyValueRowLabelProps, PreDefinedKeyValueRowLabel } from "./KeyValueRow.types.mjs";
|
|
2
|
+
export declare const isPreDefinedKeyValueRowLabel: (label: KeyValueRowLabelProps['label']) => label is PreDefinedKeyValueRowLabel;
|
|
3
|
+
//# sourceMappingURL=KeyValueRow.utils.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueRow.utils.d.mts","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC3B,gCAA4B;AAE7B,eAAO,MAAM,4BAA4B,UAChC,qBAAqB,CAAC,OAAO,CAAC,wCAEyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueRow.utils.mjs","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.utils.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAC1C,KAAqC,EACA,EAAE,CACvC,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,IAAI,KAAK,CAAC","sourcesContent":["import {\n KeyValueRowLabelProps,\n PreDefinedKeyValueRowLabel,\n} from './KeyValueRow.types';\n\nexport const isPreDefinedKeyValueRowLabel = (\n label: KeyValueRowLabelProps['label'],\n): label is PreDefinedKeyValueRowLabel =>\n label !== null && typeof label === 'object' && 'text' in label;\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
const KeyValueRow_types_1 = require("../KeyValueRow.types.cjs");
|
|
10
|
+
/**
|
|
11
|
+
* A container representing either the left or right side of the KeyValueRow.
|
|
12
|
+
* For desired results, use only two <KeyValueSection> components within the <KeyValueRowRoot>.
|
|
13
|
+
*
|
|
14
|
+
* @param props - Component props.
|
|
15
|
+
* @param props.children - The child components.
|
|
16
|
+
* @param props.align - The alignment of the section.
|
|
17
|
+
* @param props.twClassName - Optional Tailwind class names to override root styles.
|
|
18
|
+
* @param props.style - Optional additional styles for the root element.
|
|
19
|
+
*
|
|
20
|
+
* @returns The rendered KeyValueSection component.
|
|
21
|
+
*/
|
|
22
|
+
const KeyValueSection = ({ children, align = KeyValueRow_types_1.KeyValueRowSectionAlignments.Left, twClassName, style, ...props }) => {
|
|
23
|
+
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
24
|
+
return (<react_native_1.View style={[tw.style('flex-1', align, twClassName), style]} {...props}>
|
|
25
|
+
{children}
|
|
26
|
+
</react_native_1.View>);
|
|
27
|
+
};
|
|
28
|
+
exports.default = KeyValueSection;
|
|
29
|
+
//# sourceMappingURL=KeyValueSection.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueSection.cjs","sourceRoot":"","sources":["../../../../src/components/KeyValueRow/KeyValueSection/KeyValueSection.tsx"],"names":[],"mappings":";;;;;AAAA,8FAA4E;AAC5E,kDAA0B;AAC1B,wDAAoC;AAEpC,gEAAoE;AAGpE;;;;;;;;;;;GAWG;AACH,MAAM,eAAe,GAAmC,CAAC,EACvD,QAAQ,EACR,KAAK,GAAG,gDAA4B,CAAC,IAAI,EACzC,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,OAAO,CACL,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,WAAW,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CACtE;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 { KeyValueRowSectionAlignments } from '../KeyValueRow.types';\nimport type { KeyValueSectionProps } from '../KeyValueRow.types';\n\n/**\n * A container representing either the left or right side of the KeyValueRow.\n * For desired results, use only two <KeyValueSection> components within the <KeyValueRowRoot>.\n *\n * @param props - Component props.\n * @param props.children - The child components.\n * @param props.align - The alignment of the section.\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 KeyValueSection component.\n */\nconst KeyValueSection: React.FC<KeyValueSectionProps> = ({\n children,\n align = KeyValueRowSectionAlignments.Left,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n\n return (\n <View style={[tw.style('flex-1', align, twClassName), style]} {...props}>\n {children}\n </View>\n );\n};\n\nexport default KeyValueSection;\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { KeyValueSectionProps } from "../KeyValueRow.types.cjs";
|
|
3
|
+
/**
|
|
4
|
+
* A container representing either the left or right side of the KeyValueRow.
|
|
5
|
+
* For desired results, use only two <KeyValueSection> components within the <KeyValueRowRoot>.
|
|
6
|
+
*
|
|
7
|
+
* @param props - Component props.
|
|
8
|
+
* @param props.children - The child components.
|
|
9
|
+
* @param props.align - The alignment of the section.
|
|
10
|
+
* @param props.twClassName - Optional Tailwind class names to override root styles.
|
|
11
|
+
* @param props.style - Optional additional styles for the root element.
|
|
12
|
+
*
|
|
13
|
+
* @returns The rendered KeyValueSection component.
|
|
14
|
+
*/
|
|
15
|
+
declare const KeyValueSection: React.FC<KeyValueSectionProps>;
|
|
16
|
+
export default KeyValueSection;
|
|
17
|
+
//# sourceMappingURL=KeyValueSection.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueSection.d.cts","sourceRoot":"","sources":["../../../../src/components/KeyValueRow/KeyValueSection/KeyValueSection.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAI1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,iCAA6B;AAEjE;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAcnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { KeyValueSectionProps } from "../KeyValueRow.types.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* A container representing either the left or right side of the KeyValueRow.
|
|
5
|
+
* For desired results, use only two <KeyValueSection> components within the <KeyValueRowRoot>.
|
|
6
|
+
*
|
|
7
|
+
* @param props - Component props.
|
|
8
|
+
* @param props.children - The child components.
|
|
9
|
+
* @param props.align - The alignment of the section.
|
|
10
|
+
* @param props.twClassName - Optional Tailwind class names to override root styles.
|
|
11
|
+
* @param props.style - Optional additional styles for the root element.
|
|
12
|
+
*
|
|
13
|
+
* @returns The rendered KeyValueSection component.
|
|
14
|
+
*/
|
|
15
|
+
declare const KeyValueSection: React.FC<KeyValueSectionProps>;
|
|
16
|
+
export default KeyValueSection;
|
|
17
|
+
//# sourceMappingURL=KeyValueSection.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueSection.d.mts","sourceRoot":"","sources":["../../../../src/components/KeyValueRow/KeyValueSection/KeyValueSection.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAI1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,iCAA6B;AAEjE;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAcnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 { KeyValueRowSectionAlignments } from "../KeyValueRow.types.mjs";
|
|
12
|
+
/**
|
|
13
|
+
* A container representing either the left or right side of the KeyValueRow.
|
|
14
|
+
* For desired results, use only two <KeyValueSection> components within the <KeyValueRowRoot>.
|
|
15
|
+
*
|
|
16
|
+
* @param props - Component props.
|
|
17
|
+
* @param props.children - The child components.
|
|
18
|
+
* @param props.align - The alignment of the section.
|
|
19
|
+
* @param props.twClassName - Optional Tailwind class names to override root styles.
|
|
20
|
+
* @param props.style - Optional additional styles for the root element.
|
|
21
|
+
*
|
|
22
|
+
* @returns The rendered KeyValueSection component.
|
|
23
|
+
*/
|
|
24
|
+
const KeyValueSection = ({ children, align = KeyValueRowSectionAlignments.Left, twClassName, style, ...props }) => {
|
|
25
|
+
const tw = useTailwind();
|
|
26
|
+
return (<View style={[tw.style('flex-1', align, twClassName), style]} {...props}>
|
|
27
|
+
{children}
|
|
28
|
+
</View>);
|
|
29
|
+
};
|
|
30
|
+
export default KeyValueSection;
|
|
31
|
+
//# sourceMappingURL=KeyValueSection.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueSection.mjs","sourceRoot":"","sources":["../../../../src/components/KeyValueRow/KeyValueSection/KeyValueSection.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,IAAI,EAAE,8BAAqB;AAEpC,OAAO,EAAE,4BAA4B,EAAE,iCAA6B;AAGpE;;;;;;;;;;;GAWG;AACH,MAAM,eAAe,GAAmC,CAAC,EACvD,QAAQ,EACR,KAAK,GAAG,4BAA4B,CAAC,IAAI,EACzC,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,WAAW,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CACtE;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 { KeyValueRowSectionAlignments } from '../KeyValueRow.types';\nimport type { KeyValueSectionProps } from '../KeyValueRow.types';\n\n/**\n * A container representing either the left or right side of the KeyValueRow.\n * For desired results, use only two <KeyValueSection> components within the <KeyValueRowRoot>.\n *\n * @param props - Component props.\n * @param props.children - The child components.\n * @param props.align - The alignment of the section.\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 KeyValueSection component.\n */\nconst KeyValueSection: React.FC<KeyValueSectionProps> = ({\n children,\n align = KeyValueRowSectionAlignments.Left,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n\n return (\n <View style={[tw.style('flex-1', align, twClassName), style]} {...props}>\n {children}\n </View>\n );\n};\n\nexport default KeyValueSection;\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
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.IconSizes = exports.TooltipSizes = exports.KeyValueRowFieldIconSides = exports.KeyValueRowSectionAlignments = exports.default = exports.KeyValueRowStubs = void 0;
|
|
7
|
+
var KeyValueRow_1 = require("./KeyValueRow.cjs");
|
|
8
|
+
Object.defineProperty(exports, "KeyValueRowStubs", { enumerable: true, get: function () { return KeyValueRow_1.KeyValueRowStubs; } });
|
|
9
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(KeyValueRow_1).default; } });
|
|
10
|
+
var KeyValueRow_types_1 = require("./KeyValueRow.types.cjs");
|
|
11
|
+
Object.defineProperty(exports, "KeyValueRowSectionAlignments", { enumerable: true, get: function () { return KeyValueRow_types_1.KeyValueRowSectionAlignments; } });
|
|
12
|
+
Object.defineProperty(exports, "KeyValueRowFieldIconSides", { enumerable: true, get: function () { return KeyValueRow_types_1.KeyValueRowFieldIconSides; } });
|
|
13
|
+
Object.defineProperty(exports, "TooltipSizes", { enumerable: true, get: function () { return KeyValueRow_types_1.TooltipSizes; } });
|
|
14
|
+
Object.defineProperty(exports, "IconSizes", { enumerable: true, get: function () { return KeyValueRow_types_1.IconSizes; } });
|
|
15
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/KeyValueRow/index.tsx"],"names":[],"mappings":";;;;;;AAAA,iDAA0D;AAAjD,+GAAA,gBAAgB,OAAA;AAAE,uHAAA,OAAO,OAAA;AAClC,6DAY6B;AAX3B,iIAAA,4BAA4B,OAAA;AAC5B,8HAAA,yBAAyB,OAAA;AACzB,iHAAA,YAAY,OAAA;AACZ,8GAAA,SAAS,OAAA","sourcesContent":["export { KeyValueRowStubs, default } from './KeyValueRow';\nexport {\n KeyValueRowSectionAlignments,\n KeyValueRowFieldIconSides,\n TooltipSizes,\n IconSizes,\n type KeyValueRowTooltip,\n type KeyValueRowField,\n type PreDefinedKeyValueRowLabel,\n type KeyValueRowLabelProps,\n type KeyValueRowRootProps,\n type KeyValueSectionProps,\n type KeyValueRowProps,\n} from './KeyValueRow.types';\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { KeyValueRowStubs, default } from "./KeyValueRow.cjs";
|
|
2
|
+
export { KeyValueRowSectionAlignments, KeyValueRowFieldIconSides, TooltipSizes, IconSizes, type KeyValueRowTooltip, type KeyValueRowField, type PreDefinedKeyValueRowLabel, type KeyValueRowLabelProps, type KeyValueRowRootProps, type KeyValueSectionProps, type KeyValueRowProps, } from "./KeyValueRow.types.cjs";
|
|
3
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/KeyValueRow/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,0BAAsB;AAC1D,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EACzB,YAAY,EACZ,SAAS,EACT,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,GACtB,gCAA4B"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { KeyValueRowStubs, default } from "./KeyValueRow.mjs";
|
|
2
|
+
export { KeyValueRowSectionAlignments, KeyValueRowFieldIconSides, TooltipSizes, IconSizes, type KeyValueRowTooltip, type KeyValueRowField, type PreDefinedKeyValueRowLabel, type KeyValueRowLabelProps, type KeyValueRowRootProps, type KeyValueSectionProps, type KeyValueRowProps, } from "./KeyValueRow.types.mjs";
|
|
3
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/KeyValueRow/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,0BAAsB;AAC1D,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EACzB,YAAY,EACZ,SAAS,EACT,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,GACtB,gCAA4B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/KeyValueRow/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,0BAAsB;AAC1D,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EACzB,YAAY,EACZ,SAAS,EAQV,gCAA4B","sourcesContent":["export { KeyValueRowStubs, default } from './KeyValueRow';\nexport {\n KeyValueRowSectionAlignments,\n KeyValueRowFieldIconSides,\n TooltipSizes,\n IconSizes,\n type KeyValueRowTooltip,\n type KeyValueRowField,\n type PreDefinedKeyValueRowLabel,\n type KeyValueRowLabelProps,\n type KeyValueRowRootProps,\n type KeyValueSectionProps,\n type KeyValueRowProps,\n} from './KeyValueRow.types';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/design-system-react-native",
|
|
3
|
-
"version": "0.11.0-preview.
|
|
3
|
+
"version": "0.11.0-preview.9c677c4",
|
|
4
4
|
"description": "Design System React Native",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MetaMask",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@metamask-previews/design-system-shared": "0.4.0-preview.
|
|
51
|
+
"@metamask-previews/design-system-shared": "0.4.0-preview.9c677c4",
|
|
52
52
|
"fast-text-encoding": "^1.0.6",
|
|
53
53
|
"react-native-jazzicon": "^0.1.2"
|
|
54
54
|
},
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"@babel/preset-react": "^7.25.9",
|
|
59
59
|
"@babel/preset-typescript": "^7.23.3",
|
|
60
60
|
"@figma/code-connect": "^1.0.0",
|
|
61
|
-
"@metamask-previews/design-system-twrnc-preset": "0.3.0-preview.
|
|
62
|
-
"@metamask-previews/design-tokens": "8.2.2-preview.
|
|
61
|
+
"@metamask-previews/design-system-twrnc-preset": "0.3.0-preview.9c677c4",
|
|
62
|
+
"@metamask-previews/design-tokens": "8.2.2-preview.9c677c4",
|
|
63
63
|
"@metamask/auto-changelog": "^5.3.2",
|
|
64
64
|
"@metamask/utils": "^11.10.0",
|
|
65
65
|
"@storybook/react-native": "6.5",
|