@draftbit/core 46.10.3-0bad1e.2 → 46.10.3-93b2ea.2
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/lib/commonjs/components/FAB.js +4 -18
- package/lib/commonjs/components/Row.js +73 -0
- package/lib/commonjs/components/RowBodyIcon.js +45 -0
- package/lib/commonjs/components/RowHeadlineImageCaption.js +45 -0
- package/lib/commonjs/components/RowHeadlineImageIcon.js +51 -0
- package/lib/commonjs/components/Table/Table.js +123 -0
- package/lib/commonjs/components/Table/TableCell.js +49 -0
- package/lib/commonjs/components/Table/TableCommon.js +30 -0
- package/lib/commonjs/components/Table/TableRow.js +61 -0
- package/lib/commonjs/components/Table/index.js +27 -0
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/index.js +40 -0
- package/lib/commonjs/mappings/Table.js +140 -0
- package/lib/module/components/Row.js +63 -0
- package/lib/module/components/RowBodyIcon.js +35 -0
- package/lib/module/components/RowHeadlineImageCaption.js +35 -0
- package/lib/module/components/RowHeadlineImageIcon.js +41 -0
- package/lib/module/components/Table/Table.js +114 -0
- package/lib/module/components/Table/TableCell.js +41 -0
- package/lib/module/components/Table/TableCommon.js +21 -0
- package/lib/module/components/Table/TableRow.js +53 -0
- package/lib/module/components/Table/index.js +3 -0
- package/lib/module/index.js +4 -0
- package/lib/module/mappings/Table.js +133 -0
- package/lib/typescript/src/components/Row.d.ts +21 -0
- package/lib/typescript/src/components/Row.d.ts.map +1 -0
- package/lib/typescript/src/components/RowBodyIcon.d.ts +16 -0
- package/lib/typescript/src/components/RowBodyIcon.d.ts.map +1 -0
- package/lib/typescript/src/components/RowHeadlineImageCaption.d.ts +16 -0
- package/lib/typescript/src/components/RowHeadlineImageCaption.d.ts.map +1 -0
- package/lib/typescript/src/components/RowHeadlineImageIcon.d.ts +18 -0
- package/lib/typescript/src/components/RowHeadlineImageIcon.d.ts.map +1 -0
- package/lib/typescript/src/components/Table/Table.d.ts +19 -0
- package/lib/typescript/src/components/Table/Table.d.ts.map +1 -0
- package/lib/typescript/src/components/Table/TableCell.d.ts +9 -0
- package/lib/typescript/src/components/Table/TableCell.d.ts.map +1 -0
- package/lib/typescript/src/components/Table/TableCommon.d.ts +20 -0
- package/lib/typescript/src/components/Table/TableCommon.d.ts.map +1 -0
- package/lib/typescript/src/components/Table/TableRow.d.ts +14 -0
- package/lib/typescript/src/components/Table/TableRow.d.ts.map +1 -0
- package/lib/typescript/src/components/Table/index.d.ts +4 -0
- package/lib/typescript/src/components/Table/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Table.d.ts +337 -0
- package/lib/typescript/src/mappings/Table.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/components/Row.js +48 -0
- package/src/components/Row.tsx +108 -0
- package/src/components/RowBodyIcon.js +8 -0
- package/src/components/RowBodyIcon.tsx +47 -0
- package/src/components/RowHeadlineImageCaption.js +12 -0
- package/src/components/RowHeadlineImageCaption.tsx +49 -0
- package/src/components/RowHeadlineImageIcon.js +14 -0
- package/src/components/RowHeadlineImageIcon.tsx +61 -0
- package/src/components/Table/Table.js +93 -0
- package/src/components/Table/Table.tsx +176 -0
- package/src/components/Table/TableCell.js +31 -0
- package/src/components/Table/TableCell.tsx +63 -0
- package/src/components/Table/TableCommon.js +12 -0
- package/src/components/Table/TableCommon.ts +40 -0
- package/src/components/Table/TableRow.js +37 -0
- package/src/components/Table/TableRow.tsx +77 -0
- package/src/components/Table/index.js +3 -0
- package/src/components/Table/index.tsx +3 -0
- package/src/index.js +4 -0
- package/src/index.tsx +5 -0
- package/src/mappings/Table.js +150 -0
- package/src/mappings/Table.ts +170 -0
- package/lib/commonjs/mappings/NativeBase/Layout.js +0 -97
- package/lib/module/mappings/NativeBase/Layout.js +0 -90
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts +0 -107
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts.map +0 -1
- package/src/mappings/NativeBase/Layout.js +0 -101
- package/src/mappings/NativeBase/Layout.ts +0 -116
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
export declare const SEED_DATA: ({
|
|
2
|
+
name: string;
|
|
3
|
+
tag: string;
|
|
4
|
+
description: string;
|
|
5
|
+
category: string;
|
|
6
|
+
stylesPanelSections: string[];
|
|
7
|
+
layout: {
|
|
8
|
+
flex: number;
|
|
9
|
+
flexDirection?: undefined;
|
|
10
|
+
};
|
|
11
|
+
props: {
|
|
12
|
+
borderWidth: {
|
|
13
|
+
defaultValue: number;
|
|
14
|
+
label: string;
|
|
15
|
+
description: string;
|
|
16
|
+
formType: string;
|
|
17
|
+
propType: string;
|
|
18
|
+
group: string;
|
|
19
|
+
editable: boolean;
|
|
20
|
+
required: boolean;
|
|
21
|
+
step: number;
|
|
22
|
+
};
|
|
23
|
+
borderColor: {
|
|
24
|
+
defaultValue: string;
|
|
25
|
+
group: string;
|
|
26
|
+
label: string;
|
|
27
|
+
description: string;
|
|
28
|
+
editable: boolean;
|
|
29
|
+
required: boolean;
|
|
30
|
+
formType: string;
|
|
31
|
+
propType: string;
|
|
32
|
+
};
|
|
33
|
+
borderStyle: {
|
|
34
|
+
defaultValue: string;
|
|
35
|
+
group: string;
|
|
36
|
+
label: string;
|
|
37
|
+
description: string;
|
|
38
|
+
editable: boolean;
|
|
39
|
+
required: boolean;
|
|
40
|
+
formType: string;
|
|
41
|
+
propType: string;
|
|
42
|
+
options: never[];
|
|
43
|
+
};
|
|
44
|
+
drawTopBorder: {
|
|
45
|
+
defaultValue: boolean;
|
|
46
|
+
label: string;
|
|
47
|
+
description: string;
|
|
48
|
+
formType: string;
|
|
49
|
+
propType: string;
|
|
50
|
+
editable: boolean;
|
|
51
|
+
required: boolean;
|
|
52
|
+
group: string;
|
|
53
|
+
};
|
|
54
|
+
cellVerticalPadding: {
|
|
55
|
+
defaultValue: number;
|
|
56
|
+
label: string;
|
|
57
|
+
description: string;
|
|
58
|
+
formType: string;
|
|
59
|
+
propType: string;
|
|
60
|
+
group: string;
|
|
61
|
+
editable: boolean;
|
|
62
|
+
required: boolean;
|
|
63
|
+
step: number;
|
|
64
|
+
};
|
|
65
|
+
cellHorizontalPadding: {
|
|
66
|
+
defaultValue: number;
|
|
67
|
+
label: string;
|
|
68
|
+
description: string;
|
|
69
|
+
formType: string;
|
|
70
|
+
propType: string;
|
|
71
|
+
group: string;
|
|
72
|
+
editable: boolean;
|
|
73
|
+
required: boolean;
|
|
74
|
+
step: number;
|
|
75
|
+
};
|
|
76
|
+
showsVerticalScrollIndicator: {
|
|
77
|
+
label: string;
|
|
78
|
+
description: string;
|
|
79
|
+
formType: string;
|
|
80
|
+
propType: string;
|
|
81
|
+
defaultValue: boolean;
|
|
82
|
+
editable: boolean;
|
|
83
|
+
required: boolean;
|
|
84
|
+
group: string;
|
|
85
|
+
};
|
|
86
|
+
drawBottomBorder: {
|
|
87
|
+
label: string;
|
|
88
|
+
description: string;
|
|
89
|
+
formType: string;
|
|
90
|
+
propType: string;
|
|
91
|
+
defaultValue: boolean;
|
|
92
|
+
editable: boolean;
|
|
93
|
+
required: boolean;
|
|
94
|
+
group: string;
|
|
95
|
+
};
|
|
96
|
+
drawStartBorder: {
|
|
97
|
+
label: string;
|
|
98
|
+
description: string;
|
|
99
|
+
formType: string;
|
|
100
|
+
propType: string;
|
|
101
|
+
defaultValue: boolean;
|
|
102
|
+
editable: boolean;
|
|
103
|
+
required: boolean;
|
|
104
|
+
group: string;
|
|
105
|
+
};
|
|
106
|
+
drawEndBorder: {
|
|
107
|
+
label: string;
|
|
108
|
+
description: string;
|
|
109
|
+
formType: string;
|
|
110
|
+
propType: string;
|
|
111
|
+
defaultValue: boolean;
|
|
112
|
+
editable: boolean;
|
|
113
|
+
required: boolean;
|
|
114
|
+
group: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
} | {
|
|
118
|
+
name: string;
|
|
119
|
+
tag: string;
|
|
120
|
+
description: string;
|
|
121
|
+
category: string;
|
|
122
|
+
stylesPanelSections: string[];
|
|
123
|
+
props: {
|
|
124
|
+
drawStartBorder: {
|
|
125
|
+
defaultValue: boolean;
|
|
126
|
+
label: string;
|
|
127
|
+
description: string;
|
|
128
|
+
formType: string;
|
|
129
|
+
propType: string;
|
|
130
|
+
editable: boolean;
|
|
131
|
+
required: boolean;
|
|
132
|
+
group: string;
|
|
133
|
+
};
|
|
134
|
+
drawBottomBorder: {
|
|
135
|
+
defaultValue: boolean;
|
|
136
|
+
label: string;
|
|
137
|
+
description: string;
|
|
138
|
+
formType: string;
|
|
139
|
+
propType: string;
|
|
140
|
+
editable: boolean;
|
|
141
|
+
required: boolean;
|
|
142
|
+
group: string;
|
|
143
|
+
};
|
|
144
|
+
isTableHeader: {
|
|
145
|
+
label: string;
|
|
146
|
+
description: string;
|
|
147
|
+
formType: string;
|
|
148
|
+
propType: string;
|
|
149
|
+
defaultValue: boolean;
|
|
150
|
+
editable: boolean;
|
|
151
|
+
required: boolean;
|
|
152
|
+
group: string;
|
|
153
|
+
};
|
|
154
|
+
borderWidth: {
|
|
155
|
+
label: string;
|
|
156
|
+
description: string;
|
|
157
|
+
formType: string;
|
|
158
|
+
propType: string;
|
|
159
|
+
group: string;
|
|
160
|
+
defaultValue: null;
|
|
161
|
+
editable: boolean;
|
|
162
|
+
required: boolean;
|
|
163
|
+
step: number;
|
|
164
|
+
};
|
|
165
|
+
borderColor: {
|
|
166
|
+
group: string;
|
|
167
|
+
label: string;
|
|
168
|
+
description: string;
|
|
169
|
+
editable: boolean;
|
|
170
|
+
required: boolean;
|
|
171
|
+
defaultValue: null;
|
|
172
|
+
formType: string;
|
|
173
|
+
propType: string;
|
|
174
|
+
};
|
|
175
|
+
borderStyle: {
|
|
176
|
+
group: string;
|
|
177
|
+
label: string;
|
|
178
|
+
description: string;
|
|
179
|
+
editable: boolean;
|
|
180
|
+
required: boolean;
|
|
181
|
+
formType: string;
|
|
182
|
+
propType: string;
|
|
183
|
+
defaultValue: null;
|
|
184
|
+
options: never[];
|
|
185
|
+
};
|
|
186
|
+
drawTopBorder: {
|
|
187
|
+
label: string;
|
|
188
|
+
description: string;
|
|
189
|
+
formType: string;
|
|
190
|
+
propType: string;
|
|
191
|
+
defaultValue: boolean;
|
|
192
|
+
editable: boolean;
|
|
193
|
+
required: boolean;
|
|
194
|
+
group: string;
|
|
195
|
+
};
|
|
196
|
+
drawEndBorder: {
|
|
197
|
+
label: string;
|
|
198
|
+
description: string;
|
|
199
|
+
formType: string;
|
|
200
|
+
propType: string;
|
|
201
|
+
defaultValue: boolean;
|
|
202
|
+
editable: boolean;
|
|
203
|
+
required: boolean;
|
|
204
|
+
group: string;
|
|
205
|
+
};
|
|
206
|
+
cellVerticalPadding: {
|
|
207
|
+
label: string;
|
|
208
|
+
description: string;
|
|
209
|
+
formType: string;
|
|
210
|
+
propType: string;
|
|
211
|
+
group: string;
|
|
212
|
+
defaultValue: null;
|
|
213
|
+
editable: boolean;
|
|
214
|
+
required: boolean;
|
|
215
|
+
step: number;
|
|
216
|
+
};
|
|
217
|
+
cellHorizontalPadding: {
|
|
218
|
+
label: string;
|
|
219
|
+
description: string;
|
|
220
|
+
formType: string;
|
|
221
|
+
propType: string;
|
|
222
|
+
group: string;
|
|
223
|
+
defaultValue: null;
|
|
224
|
+
editable: boolean;
|
|
225
|
+
required: boolean;
|
|
226
|
+
step: number;
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
layout?: undefined;
|
|
230
|
+
} | {
|
|
231
|
+
name: string;
|
|
232
|
+
tag: string;
|
|
233
|
+
description: string;
|
|
234
|
+
category: string;
|
|
235
|
+
stylesPanelSections: string[];
|
|
236
|
+
layout: {
|
|
237
|
+
flex: number;
|
|
238
|
+
flexDirection: string;
|
|
239
|
+
};
|
|
240
|
+
props: {
|
|
241
|
+
drawEndBorder: {
|
|
242
|
+
defaultValue: boolean;
|
|
243
|
+
label: string;
|
|
244
|
+
description: string;
|
|
245
|
+
formType: string;
|
|
246
|
+
propType: string;
|
|
247
|
+
editable: boolean;
|
|
248
|
+
required: boolean;
|
|
249
|
+
group: string;
|
|
250
|
+
};
|
|
251
|
+
borderWidth: {
|
|
252
|
+
label: string;
|
|
253
|
+
description: string;
|
|
254
|
+
formType: string;
|
|
255
|
+
propType: string;
|
|
256
|
+
group: string;
|
|
257
|
+
defaultValue: null;
|
|
258
|
+
editable: boolean;
|
|
259
|
+
required: boolean;
|
|
260
|
+
step: number;
|
|
261
|
+
};
|
|
262
|
+
borderColor: {
|
|
263
|
+
group: string;
|
|
264
|
+
label: string;
|
|
265
|
+
description: string;
|
|
266
|
+
editable: boolean;
|
|
267
|
+
required: boolean;
|
|
268
|
+
defaultValue: null;
|
|
269
|
+
formType: string;
|
|
270
|
+
propType: string;
|
|
271
|
+
};
|
|
272
|
+
borderStyle: {
|
|
273
|
+
group: string;
|
|
274
|
+
label: string;
|
|
275
|
+
description: string;
|
|
276
|
+
editable: boolean;
|
|
277
|
+
required: boolean;
|
|
278
|
+
formType: string;
|
|
279
|
+
propType: string;
|
|
280
|
+
defaultValue: null;
|
|
281
|
+
options: never[];
|
|
282
|
+
};
|
|
283
|
+
drawTopBorder: {
|
|
284
|
+
label: string;
|
|
285
|
+
description: string;
|
|
286
|
+
formType: string;
|
|
287
|
+
propType: string;
|
|
288
|
+
defaultValue: boolean;
|
|
289
|
+
editable: boolean;
|
|
290
|
+
required: boolean;
|
|
291
|
+
group: string;
|
|
292
|
+
};
|
|
293
|
+
drawBottomBorder: {
|
|
294
|
+
label: string;
|
|
295
|
+
description: string;
|
|
296
|
+
formType: string;
|
|
297
|
+
propType: string;
|
|
298
|
+
defaultValue: boolean;
|
|
299
|
+
editable: boolean;
|
|
300
|
+
required: boolean;
|
|
301
|
+
group: string;
|
|
302
|
+
};
|
|
303
|
+
drawStartBorder: {
|
|
304
|
+
label: string;
|
|
305
|
+
description: string;
|
|
306
|
+
formType: string;
|
|
307
|
+
propType: string;
|
|
308
|
+
defaultValue: boolean;
|
|
309
|
+
editable: boolean;
|
|
310
|
+
required: boolean;
|
|
311
|
+
group: string;
|
|
312
|
+
};
|
|
313
|
+
cellVerticalPadding: {
|
|
314
|
+
label: string;
|
|
315
|
+
description: string;
|
|
316
|
+
formType: string;
|
|
317
|
+
propType: string;
|
|
318
|
+
group: string;
|
|
319
|
+
defaultValue: null;
|
|
320
|
+
editable: boolean;
|
|
321
|
+
required: boolean;
|
|
322
|
+
step: number;
|
|
323
|
+
};
|
|
324
|
+
cellHorizontalPadding: {
|
|
325
|
+
label: string;
|
|
326
|
+
description: string;
|
|
327
|
+
formType: string;
|
|
328
|
+
propType: string;
|
|
329
|
+
group: string;
|
|
330
|
+
defaultValue: null;
|
|
331
|
+
editable: boolean;
|
|
332
|
+
required: boolean;
|
|
333
|
+
step: number;
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
})[];
|
|
337
|
+
//# sourceMappingURL=Table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../src/mappings/Table.ts"],"names":[],"mappings":"AAsEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAmGrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.10.3-
|
|
3
|
+
"version": "46.10.3-93b2ea.2+93b2ea1",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/types": "^46.10.3-
|
|
44
|
+
"@draftbit/types": "^46.10.3-93b2ea.2+93b2ea1",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.2.3",
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
]
|
|
101
101
|
]
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "93b2ea1ae9f511ff9dd5469bd62f0757fb01c789"
|
|
104
104
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View, Text, Image, StyleSheet, } from "react-native";
|
|
3
|
+
import { withTheme } from "../theming";
|
|
4
|
+
import Config from "./Config";
|
|
5
|
+
const Row = ({ titleTypeStyle, titleColor, subtitleTypeStyle, subtitleColor, title, subtitle, multilineSubtitle, image, right, style, }) => {
|
|
6
|
+
return (React.createElement(View, { style: [styles.container, { padding: 16 }, style] },
|
|
7
|
+
React.createElement(View, { style: styles.leftContainer },
|
|
8
|
+
image && (React.createElement(Image, { source: typeof image === "string" ? { uri: image } : image, style: {
|
|
9
|
+
marginRight: 12,
|
|
10
|
+
width: subtitle
|
|
11
|
+
? Config.rowMultiLineImageSize
|
|
12
|
+
: Config.rowSingleLineImageSize,
|
|
13
|
+
height: subtitle
|
|
14
|
+
? Config.rowMultiLineImageSize
|
|
15
|
+
: Config.rowSingleLineImageSize,
|
|
16
|
+
} })),
|
|
17
|
+
React.createElement(View, { style: styles.textContainer },
|
|
18
|
+
React.createElement(Text, { style: [
|
|
19
|
+
titleTypeStyle,
|
|
20
|
+
{
|
|
21
|
+
color: titleColor,
|
|
22
|
+
},
|
|
23
|
+
], numberOfLines: 1 }, title),
|
|
24
|
+
subtitle ? (React.createElement(Text, { style: [
|
|
25
|
+
subtitleTypeStyle,
|
|
26
|
+
{
|
|
27
|
+
color: subtitleColor,
|
|
28
|
+
marginTop: 4,
|
|
29
|
+
},
|
|
30
|
+
], numberOfLines: multilineSubtitle ? undefined : 1 }, subtitle)) : null)),
|
|
31
|
+
right && right()));
|
|
32
|
+
};
|
|
33
|
+
const styles = StyleSheet.create({
|
|
34
|
+
leftContainer: {
|
|
35
|
+
flexDirection: "row",
|
|
36
|
+
flex: 1,
|
|
37
|
+
},
|
|
38
|
+
container: {
|
|
39
|
+
flexDirection: "row",
|
|
40
|
+
justifyContent: "space-between",
|
|
41
|
+
alignItems: "center",
|
|
42
|
+
},
|
|
43
|
+
textContainer: {
|
|
44
|
+
flex: 1,
|
|
45
|
+
justifyContent: "center",
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
export default withTheme(Row);
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
Text,
|
|
5
|
+
Image,
|
|
6
|
+
ImageSourcePropType,
|
|
7
|
+
StyleSheet,
|
|
8
|
+
StyleProp,
|
|
9
|
+
TextStyle,
|
|
10
|
+
ViewStyle,
|
|
11
|
+
} from "react-native";
|
|
12
|
+
import { withTheme } from "../theming";
|
|
13
|
+
import Config from "./Config";
|
|
14
|
+
import theme from "../styles/DefaultTheme";
|
|
15
|
+
|
|
16
|
+
type Props = {
|
|
17
|
+
titleTypeStyle?: StyleProp<TextStyle>;
|
|
18
|
+
titleColor?: string;
|
|
19
|
+
subtitleTypeStyle?: StyleProp<TextStyle>;
|
|
20
|
+
subtitleColor?: string;
|
|
21
|
+
title?: string;
|
|
22
|
+
subtitle?: string;
|
|
23
|
+
multilineSubtitle?: boolean;
|
|
24
|
+
image?: string | ImageSourcePropType;
|
|
25
|
+
right?: () => React.ReactNode;
|
|
26
|
+
style?: StyleProp<ViewStyle>;
|
|
27
|
+
theme: typeof theme;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const Row: React.FC<React.PropsWithChildren<Props>> = ({
|
|
31
|
+
titleTypeStyle,
|
|
32
|
+
titleColor,
|
|
33
|
+
subtitleTypeStyle,
|
|
34
|
+
subtitleColor,
|
|
35
|
+
title,
|
|
36
|
+
subtitle,
|
|
37
|
+
multilineSubtitle,
|
|
38
|
+
image,
|
|
39
|
+
right,
|
|
40
|
+
style,
|
|
41
|
+
}) => {
|
|
42
|
+
return (
|
|
43
|
+
<View style={[styles.container, { padding: 16 }, style]}>
|
|
44
|
+
<View style={styles.leftContainer}>
|
|
45
|
+
{image && (
|
|
46
|
+
<Image
|
|
47
|
+
source={typeof image === "string" ? { uri: image } : image}
|
|
48
|
+
style={{
|
|
49
|
+
marginRight: 12,
|
|
50
|
+
width: subtitle
|
|
51
|
+
? Config.rowMultiLineImageSize
|
|
52
|
+
: Config.rowSingleLineImageSize,
|
|
53
|
+
height: subtitle
|
|
54
|
+
? Config.rowMultiLineImageSize
|
|
55
|
+
: Config.rowSingleLineImageSize,
|
|
56
|
+
}}
|
|
57
|
+
/>
|
|
58
|
+
)}
|
|
59
|
+
<View style={styles.textContainer}>
|
|
60
|
+
<Text
|
|
61
|
+
style={[
|
|
62
|
+
titleTypeStyle,
|
|
63
|
+
{
|
|
64
|
+
color: titleColor,
|
|
65
|
+
},
|
|
66
|
+
]}
|
|
67
|
+
numberOfLines={1}
|
|
68
|
+
>
|
|
69
|
+
{title}
|
|
70
|
+
</Text>
|
|
71
|
+
{subtitle ? (
|
|
72
|
+
<Text
|
|
73
|
+
style={[
|
|
74
|
+
subtitleTypeStyle,
|
|
75
|
+
{
|
|
76
|
+
color: subtitleColor,
|
|
77
|
+
marginTop: 4,
|
|
78
|
+
},
|
|
79
|
+
]}
|
|
80
|
+
numberOfLines={multilineSubtitle ? undefined : 1}
|
|
81
|
+
>
|
|
82
|
+
{subtitle}
|
|
83
|
+
</Text>
|
|
84
|
+
) : null}
|
|
85
|
+
</View>
|
|
86
|
+
</View>
|
|
87
|
+
{right && right()}
|
|
88
|
+
</View>
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const styles = StyleSheet.create({
|
|
93
|
+
leftContainer: {
|
|
94
|
+
flexDirection: "row",
|
|
95
|
+
flex: 1,
|
|
96
|
+
},
|
|
97
|
+
container: {
|
|
98
|
+
flexDirection: "row",
|
|
99
|
+
justifyContent: "space-between",
|
|
100
|
+
alignItems: "center",
|
|
101
|
+
},
|
|
102
|
+
textContainer: {
|
|
103
|
+
flex: 1,
|
|
104
|
+
justifyContent: "center",
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
export default withTheme(Row);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { withTheme } from "../theming";
|
|
3
|
+
import Row from "./Row";
|
|
4
|
+
import Config from "./Config";
|
|
5
|
+
const RowBodyIcon = ({ Icon, title, subtitle, icon, style, theme: { colors, typography }, }) => {
|
|
6
|
+
return (React.createElement(Row, { titleTypeStyle: typography.body1, titleColor: colors.medium, subtitleTypeStyle: typography.subtitle2, subtitleColor: colors.light, title: title, subtitle: subtitle, right: () => (React.createElement(Icon, { name: icon, size: Config.rowSingleLineIconSize, color: colors.light, style: { marginLeft: 16 } })), style: style }));
|
|
7
|
+
};
|
|
8
|
+
export default withTheme(RowBodyIcon);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { withTheme } from "../theming";
|
|
3
|
+
import type { Theme } from "../styles/DefaultTheme";
|
|
4
|
+
import type { IconSlot } from "../interfaces/Icon";
|
|
5
|
+
|
|
6
|
+
import Row from "./Row";
|
|
7
|
+
import Config from "./Config";
|
|
8
|
+
import { StyleProp, ViewStyle } from "react-native";
|
|
9
|
+
|
|
10
|
+
type Props = {
|
|
11
|
+
title?: string;
|
|
12
|
+
subtitle?: string;
|
|
13
|
+
icon: string;
|
|
14
|
+
style?: StyleProp<ViewStyle>;
|
|
15
|
+
theme: Theme;
|
|
16
|
+
} & IconSlot;
|
|
17
|
+
|
|
18
|
+
const RowBodyIcon: React.FC<React.PropsWithChildren<Props>> = ({
|
|
19
|
+
Icon,
|
|
20
|
+
title,
|
|
21
|
+
subtitle,
|
|
22
|
+
icon,
|
|
23
|
+
style,
|
|
24
|
+
theme: { colors, typography },
|
|
25
|
+
}) => {
|
|
26
|
+
return (
|
|
27
|
+
<Row
|
|
28
|
+
titleTypeStyle={typography.body1}
|
|
29
|
+
titleColor={colors.medium}
|
|
30
|
+
subtitleTypeStyle={typography.subtitle2}
|
|
31
|
+
subtitleColor={colors.light}
|
|
32
|
+
title={title}
|
|
33
|
+
subtitle={subtitle}
|
|
34
|
+
right={() => (
|
|
35
|
+
<Icon
|
|
36
|
+
name={icon}
|
|
37
|
+
size={Config.rowSingleLineIconSize}
|
|
38
|
+
color={colors.light}
|
|
39
|
+
style={{ marginLeft: 16 }}
|
|
40
|
+
/>
|
|
41
|
+
)}
|
|
42
|
+
style={style}
|
|
43
|
+
/>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default withTheme(RowBodyIcon);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Text } from "react-native";
|
|
3
|
+
import { withTheme } from "../theming";
|
|
4
|
+
import Row from "./Row";
|
|
5
|
+
const RowHeadlineImageCaption = ({ title, subtitle, caption, image, style, theme: { colors, typography }, }) => {
|
|
6
|
+
return (React.createElement(Row, { titleTypeStyle: typography.headline6, titleColor: colors.strong, subtitleTypeStyle: typography.body2, subtitleColor: colors.medium, title: title, subtitle: subtitle, image: image, right: () => (React.createElement(Text, { style: {
|
|
7
|
+
...typography.caption,
|
|
8
|
+
color: colors.strong,
|
|
9
|
+
marginLeft: 16,
|
|
10
|
+
} }, caption)), style: style }));
|
|
11
|
+
};
|
|
12
|
+
export default withTheme(RowHeadlineImageCaption);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Text, ImageSourcePropType, StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
import { withTheme } from "../theming";
|
|
4
|
+
import Row from "./Row";
|
|
5
|
+
import theme from "../styles/DefaultTheme";
|
|
6
|
+
|
|
7
|
+
type Props = {
|
|
8
|
+
title?: string;
|
|
9
|
+
subtitle?: string;
|
|
10
|
+
caption?: string;
|
|
11
|
+
image: string | ImageSourcePropType;
|
|
12
|
+
style?: StyleProp<ViewStyle>;
|
|
13
|
+
theme: typeof theme;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const RowHeadlineImageCaption: React.FC<React.PropsWithChildren<Props>> = ({
|
|
17
|
+
title,
|
|
18
|
+
subtitle,
|
|
19
|
+
caption,
|
|
20
|
+
image,
|
|
21
|
+
style,
|
|
22
|
+
theme: { colors, typography },
|
|
23
|
+
}) => {
|
|
24
|
+
return (
|
|
25
|
+
<Row
|
|
26
|
+
titleTypeStyle={typography.headline6}
|
|
27
|
+
titleColor={colors.strong}
|
|
28
|
+
subtitleTypeStyle={typography.body2}
|
|
29
|
+
subtitleColor={colors.medium}
|
|
30
|
+
title={title}
|
|
31
|
+
subtitle={subtitle}
|
|
32
|
+
image={image}
|
|
33
|
+
right={() => (
|
|
34
|
+
<Text
|
|
35
|
+
style={{
|
|
36
|
+
...typography.caption,
|
|
37
|
+
color: colors.strong,
|
|
38
|
+
marginLeft: 16,
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
{caption}
|
|
42
|
+
</Text>
|
|
43
|
+
)}
|
|
44
|
+
style={style}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default withTheme(RowHeadlineImageCaption);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { withTheme } from "../theming";
|
|
3
|
+
import Row from "./Row";
|
|
4
|
+
import Config from "./Config";
|
|
5
|
+
const RowHeadlineImageIcon = ({ Icon, icon, title, image, subtitle, multilineSubtitle = false, style, theme: { colors, typography }, }) => {
|
|
6
|
+
return (React.createElement(Row, { titleTypeStyle: typography.headline6, titleColor: colors.strong, subtitleTypeStyle: typography.body2, subtitleColor: colors.medium, title: title, subtitle: subtitle, multilineSubtitle: multilineSubtitle, image: image, right: () => (React.createElement(Icon, { name: icon, size: multilineSubtitle
|
|
7
|
+
? Config.rowMultiLineIconSize
|
|
8
|
+
: Config.rowSingleLineIconSize, color: colors.light, style: {
|
|
9
|
+
marginLeft: 16,
|
|
10
|
+
alignSelf: multilineSubtitle ? "flex-start" : "center",
|
|
11
|
+
marginTop: multilineSubtitle ? 4 : 0,
|
|
12
|
+
} })), style: style }));
|
|
13
|
+
};
|
|
14
|
+
export default withTheme(RowHeadlineImageIcon);
|