react-native-persona 2.1.3 → 2.2.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/CHANGELOG.md +31 -0
- package/README.md +156 -2
- package/{RNPersonaInquiry.podspec → RNPersonaInquiry2.podspec} +2 -2
- package/android/README.md +14 -0
- package/android/build.gradle +22 -99
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/withpersona/{sdk/reactnative/PersonaInquiryModule.java → sdk2/reactnative/PersonaInquiryModule2.java} +24 -14
- package/android/src/main/java/com/withpersona/{sdk/reactnative/PersonaInquiryPackage.java → sdk2/reactnative/PersonaInquiryPackage2.java} +3 -3
- package/android/src/main/java/com/withpersona/{sdk → sdk2}/reactnative/exceptions/InvalidConfiguration.java +1 -1
- package/android/src/main/res/values/theme.xml +2 -3
- package/ios/{PersonaInquiry.swift → PersonaInquiry2.swift} +17 -13
- package/ios/PersonaInquiryBridge.m +1 -1
- package/lib/commonjs/fields.js +141 -0
- package/lib/commonjs/fields.js.map +1 -0
- package/lib/commonjs/index.js +475 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/util.js +36 -0
- package/lib/commonjs/util.js.map +1 -0
- package/lib/commonjs/versions.js +25 -0
- package/lib/commonjs/versions.js.map +1 -0
- package/lib/module/fields.js +132 -0
- package/lib/module/fields.js.map +1 -0
- package/lib/module/index.js +435 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/util.js +29 -0
- package/lib/module/util.js.map +1 -0
- package/lib/module/versions.js +14 -0
- package/lib/module/versions.js.map +1 -0
- package/{generatedTypes/persona-tools/config.d.ts → lib/typescript/persona-tools/Config.d.ts} +0 -0
- package/{generatedTypes → lib/typescript}/persona-tools/Theme.d.ts +0 -0
- package/{generatedTypes → lib/typescript}/persona-tools/index.d.ts +0 -0
- package/{generatedTypes → lib/typescript}/persona-tools/lib/AndroidResourcePrinter.d.ts +2 -2
- package/{generatedTypes → lib/typescript}/persona-tools/lib/prompts.d.ts +0 -0
- package/{generatedTypes → lib/typescript}/persona-tools/tools/AndroidThemeGenerator.d.ts +0 -0
- package/{generatedTypes → lib/typescript}/persona-tools/tools/IosThemeInstructions.d.ts +0 -0
- package/{generatedTypes → lib/typescript}/src/fields.d.ts +0 -0
- package/{generatedTypes → lib/typescript}/src/index.d.ts +56 -5
- package/{generatedTypes → lib/typescript}/src/util.d.ts +0 -0
- package/lib/typescript/src/versions.d.ts +6 -0
- package/package.json +74 -18
- package/persona-tools/{config.ts → Config.ts} +7 -7
- package/persona-tools/Theme.ts +107 -107
- package/persona-tools/index.ts +9 -9
- package/persona-tools/lib/AndroidResourcePrinter.ts +4 -4
- package/persona-tools/tools/AndroidThemeGenerator.ts +18 -18
- package/persona-tools/tools/IosThemeInstructions.ts +8 -8
- package/src/fields.ts +7 -7
- package/src/index.ts +89 -26
- package/src/util.ts +2 -2
- package/src/versions.ts +12 -0
- package/generatedTypes/persona-tools/lib/AndroidResourcePrinter.spec.d.ts +0 -1
- package/generatedTypes/src/fields.spec.d.ts +0 -1
- package/generatedTypes/src/util.spec.d.ts +0 -1
- package/jest.config.js +0 -10
- package/persona-tools/Theme.js +0 -186
- package/persona-tools/config.js +0 -72
- package/persona-tools/index.js +0 -30
- package/persona-tools/lib/AndroidResourcePrinter.js +0 -573
- package/persona-tools/lib/AndroidResourcePrinter.spec.js +0 -914
- package/persona-tools/lib/AndroidResourcePrinter.spec.ts +0 -952
- package/persona-tools/lib/prompts.js +0 -39
- package/persona-tools/tools/AndroidThemeGenerator.js +0 -55
- package/persona-tools/tools/IosThemeInstructions.js +0 -34
- package/src/fields.js +0 -88
- package/src/fields.spec.js +0 -18
- package/src/fields.spec.ts +0 -17
- package/src/index.js +0 -271
- package/src/util.js +0 -29
- package/src/util.spec.js +0 -17
- package/src/util.spec.ts +0 -22
- package/tsconfig.json +0 -29
|
@@ -1,914 +0,0 @@
|
|
|
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 AndroidResourcePrinter_1 = __importDefault(require("./AndroidResourcePrinter"));
|
|
7
|
-
const EMPTY_THEME = {
|
|
8
|
-
backgroundColor: null,
|
|
9
|
-
primaryColor: null,
|
|
10
|
-
darkPrimaryColor: null,
|
|
11
|
-
accentColor: null,
|
|
12
|
-
titleTextColor: null,
|
|
13
|
-
titleTextFont: null,
|
|
14
|
-
bodyTextColor: null,
|
|
15
|
-
bodyTextFont: null,
|
|
16
|
-
footnoteTextColor: null,
|
|
17
|
-
footnoteTextFont: null,
|
|
18
|
-
// formLabelTextColor: null,
|
|
19
|
-
// formLabelTextFont: null,
|
|
20
|
-
textFieldTextColor: null,
|
|
21
|
-
textFieldTextFont: null,
|
|
22
|
-
pickerTextColor: null,
|
|
23
|
-
pickerTextFont: null,
|
|
24
|
-
buttonBackgroundColor: null,
|
|
25
|
-
buttonDisabledBackgroundColor: null,
|
|
26
|
-
buttonTouchedBackgroundColor: null,
|
|
27
|
-
buttonTextColor: null,
|
|
28
|
-
buttonDisabledTextColor: null,
|
|
29
|
-
// buttonTextAlignment: null,
|
|
30
|
-
buttonCornerRadius: null,
|
|
31
|
-
buttonFont: null,
|
|
32
|
-
progressColor: null,
|
|
33
|
-
successAsset: null,
|
|
34
|
-
failAsset: null,
|
|
35
|
-
loadingAnimationAsset: null,
|
|
36
|
-
loadingAnimationWidthPercent: null,
|
|
37
|
-
selfieAnimationAsset: null,
|
|
38
|
-
selfieAnimationWidthPercent: null,
|
|
39
|
-
};
|
|
40
|
-
function printTheme(theme) {
|
|
41
|
-
const { style, buttonDrawable, buttonColor } = new AndroidResourcePrinter_1.default(theme).process();
|
|
42
|
-
return [
|
|
43
|
-
"res/values/styles_persona.xml",
|
|
44
|
-
"-----------------------------",
|
|
45
|
-
style.end({ prettyPrint: true }),
|
|
46
|
-
"\n",
|
|
47
|
-
"res/drawable/rn_persona_button.xml",
|
|
48
|
-
"----------------------------------",
|
|
49
|
-
buttonDrawable.end({
|
|
50
|
-
prettyPrint: true,
|
|
51
|
-
}),
|
|
52
|
-
"\n",
|
|
53
|
-
"res/color/rn_persona_button.xml",
|
|
54
|
-
"-------------------------------",
|
|
55
|
-
buttonColor.end({ prettyPrint: true }),
|
|
56
|
-
].join("\n");
|
|
57
|
-
}
|
|
58
|
-
it("works when empty", () => {
|
|
59
|
-
const theme = EMPTY_THEME;
|
|
60
|
-
expect(printTheme(theme)).toMatchInlineSnapshot(`
|
|
61
|
-
"res/values/styles_persona.xml
|
|
62
|
-
-----------------------------
|
|
63
|
-
<?xml version=\\"1.0\\"?>
|
|
64
|
-
<resources/>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
res/drawable/rn_persona_button.xml
|
|
68
|
-
----------------------------------
|
|
69
|
-
<?xml version=\\"1.0\\"?>
|
|
70
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
res/color/rn_persona_button.xml
|
|
74
|
-
-------------------------------
|
|
75
|
-
<?xml version=\\"1.0\\"?>
|
|
76
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>"
|
|
77
|
-
`);
|
|
78
|
-
});
|
|
79
|
-
it("primaryColor", () => {
|
|
80
|
-
const theme = { ...EMPTY_THEME, primaryColor: "#FFFFFF" };
|
|
81
|
-
expect(printTheme(theme)).toMatchInlineSnapshot(`
|
|
82
|
-
"res/values/styles_persona.xml
|
|
83
|
-
-----------------------------
|
|
84
|
-
<?xml version=\\"1.0\\"?>
|
|
85
|
-
<resources>
|
|
86
|
-
<style name=\\"RN\\"/>
|
|
87
|
-
<style name=\\"RN.Persona\\"/>
|
|
88
|
-
<style name=\\"RN.Persona.Text\\"/>
|
|
89
|
-
<style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
|
|
90
|
-
<item name=\\"colorPrimary\\">#FFFFFF</item>
|
|
91
|
-
|
|
92
|
-
<item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
|
|
93
|
-
<item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
|
|
94
|
-
</style>
|
|
95
|
-
</resources>
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
res/drawable/rn_persona_button.xml
|
|
99
|
-
----------------------------------
|
|
100
|
-
<?xml version=\\"1.0\\"?>
|
|
101
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
res/color/rn_persona_button.xml
|
|
105
|
-
-------------------------------
|
|
106
|
-
<?xml version=\\"1.0\\"?>
|
|
107
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>"
|
|
108
|
-
`);
|
|
109
|
-
});
|
|
110
|
-
it("accentColor", () => {
|
|
111
|
-
const theme = { ...EMPTY_THEME, accentColor: "#FFFFFF" };
|
|
112
|
-
expect(printTheme(theme)).toMatchInlineSnapshot(`
|
|
113
|
-
"res/values/styles_persona.xml
|
|
114
|
-
-----------------------------
|
|
115
|
-
<?xml version=\\"1.0\\"?>
|
|
116
|
-
<resources>
|
|
117
|
-
<style name=\\"RN\\"/>
|
|
118
|
-
<style name=\\"RN.Persona\\"/>
|
|
119
|
-
<style name=\\"RN.Persona.Text\\"/>
|
|
120
|
-
<style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
|
|
121
|
-
<item name=\\"colorAccent\\">#FFFFFF</item>
|
|
122
|
-
|
|
123
|
-
<item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
|
|
124
|
-
<item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
|
|
125
|
-
</style>
|
|
126
|
-
</resources>
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
res/drawable/rn_persona_button.xml
|
|
130
|
-
----------------------------------
|
|
131
|
-
<?xml version=\\"1.0\\"?>
|
|
132
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
res/color/rn_persona_button.xml
|
|
136
|
-
-------------------------------
|
|
137
|
-
<?xml version=\\"1.0\\"?>
|
|
138
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>"
|
|
139
|
-
`);
|
|
140
|
-
});
|
|
141
|
-
it("darkPrimaryColor", () => {
|
|
142
|
-
const theme = { ...EMPTY_THEME, darkPrimaryColor: "#FFFFFF" };
|
|
143
|
-
expect(printTheme(theme)).toMatchInlineSnapshot(`
|
|
144
|
-
"res/values/styles_persona.xml
|
|
145
|
-
-----------------------------
|
|
146
|
-
<?xml version=\\"1.0\\"?>
|
|
147
|
-
<resources>
|
|
148
|
-
<style name=\\"RN\\"/>
|
|
149
|
-
<style name=\\"RN.Persona\\"/>
|
|
150
|
-
<style name=\\"RN.Persona.Text\\"/>
|
|
151
|
-
<style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
|
|
152
|
-
<item name=\\"colorPrimaryDark\\">#FFFFFF</item>
|
|
153
|
-
|
|
154
|
-
<item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
|
|
155
|
-
<item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
|
|
156
|
-
</style>
|
|
157
|
-
</resources>
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
res/drawable/rn_persona_button.xml
|
|
161
|
-
----------------------------------
|
|
162
|
-
<?xml version=\\"1.0\\"?>
|
|
163
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
res/color/rn_persona_button.xml
|
|
167
|
-
-------------------------------
|
|
168
|
-
<?xml version=\\"1.0\\"?>
|
|
169
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>"
|
|
170
|
-
`);
|
|
171
|
-
});
|
|
172
|
-
it("backgroundColor", () => {
|
|
173
|
-
const theme = { ...EMPTY_THEME, backgroundColor: "#FFFFFF" };
|
|
174
|
-
expect(printTheme(theme)).toMatchInlineSnapshot(`
|
|
175
|
-
"res/values/styles_persona.xml
|
|
176
|
-
-----------------------------
|
|
177
|
-
<?xml version=\\"1.0\\"?>
|
|
178
|
-
<resources>
|
|
179
|
-
<color name=\\"customPersonaBackgroundColor\\">#FFFFFF</color>
|
|
180
|
-
|
|
181
|
-
<style name=\\"RN\\"/>
|
|
182
|
-
<style name=\\"RN.Persona\\"/>
|
|
183
|
-
<style name=\\"RN.Persona.Text\\"/>
|
|
184
|
-
<style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
|
|
185
|
-
<item name=\\"android:colorBackground\\">@color/customPersonaBackgroundColor</item>
|
|
186
|
-
|
|
187
|
-
<item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
|
|
188
|
-
<item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
|
|
189
|
-
</style>
|
|
190
|
-
</resources>
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
res/drawable/rn_persona_button.xml
|
|
194
|
-
----------------------------------
|
|
195
|
-
<?xml version=\\"1.0\\"?>
|
|
196
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
res/color/rn_persona_button.xml
|
|
200
|
-
-------------------------------
|
|
201
|
-
<?xml version=\\"1.0\\"?>
|
|
202
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>"
|
|
203
|
-
`);
|
|
204
|
-
});
|
|
205
|
-
it("titleTextColor", () => {
|
|
206
|
-
const theme = { ...EMPTY_THEME, titleTextColor: "#FFFFFF" };
|
|
207
|
-
expect(printTheme(theme)).toMatchInlineSnapshot(`
|
|
208
|
-
"res/values/styles_persona.xml
|
|
209
|
-
-----------------------------
|
|
210
|
-
<?xml version=\\"1.0\\"?>
|
|
211
|
-
<resources>
|
|
212
|
-
<style name=\\"RN\\"/>
|
|
213
|
-
<style name=\\"RN.Persona\\"/>
|
|
214
|
-
<style name=\\"RN.Persona.Text\\"/>
|
|
215
|
-
<style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
|
|
216
|
-
<item name=\\"personaTitleTextAppearance\\">@style/RN.Persona.Text.Title</item>
|
|
217
|
-
<item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
|
|
218
|
-
</style>
|
|
219
|
-
<style name=\\"RN.Persona.Text.Title\\" parent=\\"Persona.Text.Body\\">
|
|
220
|
-
<item name=\\"android:textColor\\">#FFFFFF</item>
|
|
221
|
-
<item name=\\"android:textSize\\">26sp</item>
|
|
222
|
-
<item name=\\"android:textStyle\\">bold</item>
|
|
223
|
-
</style>
|
|
224
|
-
</resources>
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
res/drawable/rn_persona_button.xml
|
|
228
|
-
----------------------------------
|
|
229
|
-
<?xml version=\\"1.0\\"?>
|
|
230
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
res/color/rn_persona_button.xml
|
|
234
|
-
-------------------------------
|
|
235
|
-
<?xml version=\\"1.0\\"?>
|
|
236
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>"
|
|
237
|
-
`);
|
|
238
|
-
});
|
|
239
|
-
it("titleTextFont", () => {
|
|
240
|
-
const theme = { ...EMPTY_THEME, titleTextFont: "Arial" };
|
|
241
|
-
expect(printTheme(theme)).toMatchInlineSnapshot(`
|
|
242
|
-
"res/values/styles_persona.xml
|
|
243
|
-
-----------------------------
|
|
244
|
-
<?xml version=\\"1.0\\"?>
|
|
245
|
-
<resources>
|
|
246
|
-
<style name=\\"RN\\"/>
|
|
247
|
-
<style name=\\"RN.Persona\\"/>
|
|
248
|
-
<style name=\\"RN.Persona.Text\\"/>
|
|
249
|
-
<style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
|
|
250
|
-
<item name=\\"personaTitleTextAppearance\\">@style/RN.Persona.Text.Title</item>
|
|
251
|
-
<item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
|
|
252
|
-
</style>
|
|
253
|
-
<style name=\\"RN.Persona.Text.Title\\" parent=\\"Persona.Text.Body\\">
|
|
254
|
-
<item name=\\"android:fontFamily\\">Arial</item>
|
|
255
|
-
<item name=\\"android:textSize\\">26sp</item>
|
|
256
|
-
<item name=\\"android:textStyle\\">bold</item>
|
|
257
|
-
</style>
|
|
258
|
-
</resources>
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
res/drawable/rn_persona_button.xml
|
|
262
|
-
----------------------------------
|
|
263
|
-
<?xml version=\\"1.0\\"?>
|
|
264
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
res/color/rn_persona_button.xml
|
|
268
|
-
-------------------------------
|
|
269
|
-
<?xml version=\\"1.0\\"?>
|
|
270
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>"
|
|
271
|
-
`);
|
|
272
|
-
});
|
|
273
|
-
it("titleTextFont and titleTextColor", () => {
|
|
274
|
-
const theme = {
|
|
275
|
-
...EMPTY_THEME,
|
|
276
|
-
titleTextColor: "#000000",
|
|
277
|
-
titleTextFont: "Arial",
|
|
278
|
-
};
|
|
279
|
-
expect(printTheme(theme)).toMatchInlineSnapshot(`
|
|
280
|
-
"res/values/styles_persona.xml
|
|
281
|
-
-----------------------------
|
|
282
|
-
<?xml version=\\"1.0\\"?>
|
|
283
|
-
<resources>
|
|
284
|
-
<style name=\\"RN\\"/>
|
|
285
|
-
<style name=\\"RN.Persona\\"/>
|
|
286
|
-
<style name=\\"RN.Persona.Text\\"/>
|
|
287
|
-
<style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
|
|
288
|
-
<item name=\\"personaTitleTextAppearance\\">@style/RN.Persona.Text.Title</item>
|
|
289
|
-
<item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
|
|
290
|
-
</style>
|
|
291
|
-
<style name=\\"RN.Persona.Text.Title\\" parent=\\"Persona.Text.Body\\">
|
|
292
|
-
<item name=\\"android:textColor\\">#000000</item>
|
|
293
|
-
<item name=\\"android:fontFamily\\">Arial</item>
|
|
294
|
-
<item name=\\"android:textSize\\">26sp</item>
|
|
295
|
-
<item name=\\"android:textStyle\\">bold</item>
|
|
296
|
-
</style>
|
|
297
|
-
</resources>
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
res/drawable/rn_persona_button.xml
|
|
301
|
-
----------------------------------
|
|
302
|
-
<?xml version=\\"1.0\\"?>
|
|
303
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
res/color/rn_persona_button.xml
|
|
307
|
-
-------------------------------
|
|
308
|
-
<?xml version=\\"1.0\\"?>
|
|
309
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>"
|
|
310
|
-
`);
|
|
311
|
-
});
|
|
312
|
-
it("bodyTextColor", () => {
|
|
313
|
-
const theme = { ...EMPTY_THEME, bodyTextColor: "#FFFFFF" };
|
|
314
|
-
expect(printTheme(theme)).toMatchInlineSnapshot(`
|
|
315
|
-
"res/values/styles_persona.xml
|
|
316
|
-
-----------------------------
|
|
317
|
-
<?xml version=\\"1.0\\"?>
|
|
318
|
-
<resources>
|
|
319
|
-
<style name=\\"RN\\"/>
|
|
320
|
-
<style name=\\"RN.Persona\\"/>
|
|
321
|
-
<style name=\\"RN.Persona.Text\\"/>
|
|
322
|
-
<style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
|
|
323
|
-
<item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
|
|
324
|
-
<item name=\\"personaBodyTextAppearance\\">@style/RN.Persona.Text.Body</item>
|
|
325
|
-
</style>
|
|
326
|
-
<style name=\\"RN.Persona.Text.Body\\" parent=\\"Persona.Text.Body\\">
|
|
327
|
-
<item name=\\"android:textColor\\">#FFFFFF</item>
|
|
328
|
-
<item name=\\"android:textSize\\">18sp</item>
|
|
329
|
-
</style>
|
|
330
|
-
</resources>
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
res/drawable/rn_persona_button.xml
|
|
334
|
-
----------------------------------
|
|
335
|
-
<?xml version=\\"1.0\\"?>
|
|
336
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
res/color/rn_persona_button.xml
|
|
340
|
-
-------------------------------
|
|
341
|
-
<?xml version=\\"1.0\\"?>
|
|
342
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>"
|
|
343
|
-
`);
|
|
344
|
-
});
|
|
345
|
-
it("bodyTextFont", () => {
|
|
346
|
-
const theme = { ...EMPTY_THEME, bodyTextFont: "Arial" };
|
|
347
|
-
expect(printTheme(theme)).toMatchInlineSnapshot(`
|
|
348
|
-
"res/values/styles_persona.xml
|
|
349
|
-
-----------------------------
|
|
350
|
-
<?xml version=\\"1.0\\"?>
|
|
351
|
-
<resources>
|
|
352
|
-
<style name=\\"RN\\"/>
|
|
353
|
-
<style name=\\"RN.Persona\\"/>
|
|
354
|
-
<style name=\\"RN.Persona.Text\\"/>
|
|
355
|
-
<style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
|
|
356
|
-
<item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
|
|
357
|
-
<item name=\\"personaBodyTextAppearance\\">@style/RN.Persona.Text.Body</item>
|
|
358
|
-
</style>
|
|
359
|
-
<style name=\\"RN.Persona.Text.Body\\" parent=\\"Persona.Text.Body\\">
|
|
360
|
-
<item name=\\"android:fontFamily\\">Arial</item>
|
|
361
|
-
<item name=\\"android:textSize\\">18sp</item>
|
|
362
|
-
</style>
|
|
363
|
-
</resources>
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
res/drawable/rn_persona_button.xml
|
|
367
|
-
----------------------------------
|
|
368
|
-
<?xml version=\\"1.0\\"?>
|
|
369
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
res/color/rn_persona_button.xml
|
|
373
|
-
-------------------------------
|
|
374
|
-
<?xml version=\\"1.0\\"?>
|
|
375
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>"
|
|
376
|
-
`);
|
|
377
|
-
});
|
|
378
|
-
it("bodyTextFont and bodyTextColor", () => {
|
|
379
|
-
const theme = {
|
|
380
|
-
...EMPTY_THEME,
|
|
381
|
-
bodyTextFont: "Arial",
|
|
382
|
-
bodyTextColor: "#000000",
|
|
383
|
-
};
|
|
384
|
-
expect(printTheme(theme)).toMatchInlineSnapshot(`
|
|
385
|
-
"res/values/styles_persona.xml
|
|
386
|
-
-----------------------------
|
|
387
|
-
<?xml version=\\"1.0\\"?>
|
|
388
|
-
<resources>
|
|
389
|
-
<style name=\\"RN\\"/>
|
|
390
|
-
<style name=\\"RN.Persona\\"/>
|
|
391
|
-
<style name=\\"RN.Persona.Text\\"/>
|
|
392
|
-
<style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
|
|
393
|
-
<item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
|
|
394
|
-
<item name=\\"personaBodyTextAppearance\\">@style/RN.Persona.Text.Body</item>
|
|
395
|
-
</style>
|
|
396
|
-
<style name=\\"RN.Persona.Text.Body\\" parent=\\"Persona.Text.Body\\">
|
|
397
|
-
<item name=\\"android:textColor\\">#000000</item>
|
|
398
|
-
<item name=\\"android:fontFamily\\">Arial</item>
|
|
399
|
-
<item name=\\"android:textSize\\">18sp</item>
|
|
400
|
-
</style>
|
|
401
|
-
</resources>
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
res/drawable/rn_persona_button.xml
|
|
405
|
-
----------------------------------
|
|
406
|
-
<?xml version=\\"1.0\\"?>
|
|
407
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
res/color/rn_persona_button.xml
|
|
411
|
-
-------------------------------
|
|
412
|
-
<?xml version=\\"1.0\\"?>
|
|
413
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>"
|
|
414
|
-
`);
|
|
415
|
-
});
|
|
416
|
-
it("footnoteTextColor", () => {
|
|
417
|
-
const theme = { ...EMPTY_THEME, footnoteTextColor: "#FFFFFF" };
|
|
418
|
-
expect(printTheme(theme)).toMatchInlineSnapshot(`
|
|
419
|
-
"res/values/styles_persona.xml
|
|
420
|
-
-----------------------------
|
|
421
|
-
<?xml version=\\"1.0\\"?>
|
|
422
|
-
<resources>
|
|
423
|
-
<style name=\\"RN\\"/>
|
|
424
|
-
<style name=\\"RN.Persona\\"/>
|
|
425
|
-
<style name=\\"RN.Persona.Text\\"/>
|
|
426
|
-
<style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
|
|
427
|
-
<item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
|
|
428
|
-
<item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
|
|
429
|
-
</style>
|
|
430
|
-
<style name=\\"TextAppearance.AppCompat.Small\\">
|
|
431
|
-
<item name=\\"android:textSize\\">@dimen/abc_text_size_small_material</item>
|
|
432
|
-
<item name=\\"android:textColor\\">#FFFFFF</item>
|
|
433
|
-
</style>
|
|
434
|
-
</resources>
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
res/drawable/rn_persona_button.xml
|
|
438
|
-
----------------------------------
|
|
439
|
-
<?xml version=\\"1.0\\"?>
|
|
440
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
res/color/rn_persona_button.xml
|
|
444
|
-
-------------------------------
|
|
445
|
-
<?xml version=\\"1.0\\"?>
|
|
446
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>"
|
|
447
|
-
`);
|
|
448
|
-
});
|
|
449
|
-
it("footnoteTextFont", () => {
|
|
450
|
-
const theme = { ...EMPTY_THEME, footnoteTextFont: "Arial" };
|
|
451
|
-
expect(printTheme(theme)).toMatchInlineSnapshot(`
|
|
452
|
-
"res/values/styles_persona.xml
|
|
453
|
-
-----------------------------
|
|
454
|
-
<?xml version=\\"1.0\\"?>
|
|
455
|
-
<resources>
|
|
456
|
-
<style name=\\"RN\\"/>
|
|
457
|
-
<style name=\\"RN.Persona\\"/>
|
|
458
|
-
<style name=\\"RN.Persona.Text\\"/>
|
|
459
|
-
<style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
|
|
460
|
-
<item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
|
|
461
|
-
<item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
|
|
462
|
-
</style>
|
|
463
|
-
<style name=\\"TextAppearance.AppCompat.Small\\">
|
|
464
|
-
<item name=\\"android:textSize\\">@dimen/abc_text_size_small_material</item>
|
|
465
|
-
<item name=\\"android:textColor\\">?android:attr/textColorTertiary</item>
|
|
466
|
-
<item name=\\"android:fontFamily\\">Arial</item>
|
|
467
|
-
</style>
|
|
468
|
-
</resources>
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
res/drawable/rn_persona_button.xml
|
|
472
|
-
----------------------------------
|
|
473
|
-
<?xml version=\\"1.0\\"?>
|
|
474
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
res/color/rn_persona_button.xml
|
|
478
|
-
-------------------------------
|
|
479
|
-
<?xml version=\\"1.0\\"?>
|
|
480
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>"
|
|
481
|
-
`);
|
|
482
|
-
});
|
|
483
|
-
it("footnoteTextFont and footnoteTextColor", () => {
|
|
484
|
-
const theme = {
|
|
485
|
-
...EMPTY_THEME,
|
|
486
|
-
footnoteTextFont: "Arial",
|
|
487
|
-
footnoteTextColor: "#000000",
|
|
488
|
-
};
|
|
489
|
-
expect(printTheme(theme)).toMatchInlineSnapshot(`
|
|
490
|
-
"res/values/styles_persona.xml
|
|
491
|
-
-----------------------------
|
|
492
|
-
<?xml version=\\"1.0\\"?>
|
|
493
|
-
<resources>
|
|
494
|
-
<style name=\\"RN\\"/>
|
|
495
|
-
<style name=\\"RN.Persona\\"/>
|
|
496
|
-
<style name=\\"RN.Persona.Text\\"/>
|
|
497
|
-
<style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
|
|
498
|
-
<item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
|
|
499
|
-
<item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
|
|
500
|
-
</style>
|
|
501
|
-
<style name=\\"TextAppearance.AppCompat.Small\\">
|
|
502
|
-
<item name=\\"android:textSize\\">@dimen/abc_text_size_small_material</item>
|
|
503
|
-
<item name=\\"android:textColor\\">#000000</item>
|
|
504
|
-
<item name=\\"android:fontFamily\\">Arial</item>
|
|
505
|
-
</style>
|
|
506
|
-
</resources>
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
res/drawable/rn_persona_button.xml
|
|
510
|
-
----------------------------------
|
|
511
|
-
<?xml version=\\"1.0\\"?>
|
|
512
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
res/color/rn_persona_button.xml
|
|
516
|
-
-------------------------------
|
|
517
|
-
<?xml version=\\"1.0\\"?>
|
|
518
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>"
|
|
519
|
-
`);
|
|
520
|
-
});
|
|
521
|
-
it("pickerTextColor", () => {
|
|
522
|
-
const theme = { ...EMPTY_THEME, pickerTextColor: "#FFFFFF" };
|
|
523
|
-
expect(printTheme(theme)).toMatchInlineSnapshot(`
|
|
524
|
-
"res/values/styles_persona.xml
|
|
525
|
-
-----------------------------
|
|
526
|
-
<?xml version=\\"1.0\\"?>
|
|
527
|
-
<resources>
|
|
528
|
-
<style name=\\"RN\\"/>
|
|
529
|
-
<style name=\\"RN.Persona\\"/>
|
|
530
|
-
<style name=\\"RN.Persona.Text\\"/>
|
|
531
|
-
<style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
|
|
532
|
-
<item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
|
|
533
|
-
<item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
|
|
534
|
-
<item name=\\"spinnerStyle\\">@style/RN.Persona.Spinner</item>
|
|
535
|
-
<item name=\\"spinnerDropDownItemStyle\\">@style/RN.Persona.DropDownItem.Spinner</item>
|
|
536
|
-
</style>
|
|
537
|
-
<style name=\\"RN.Persona.Spinner\\" parent=\\"Widget.AppCompat.Spinner\\">
|
|
538
|
-
<item name=\\"android:textColor\\">#FFFFFF</item>
|
|
539
|
-
<item name=\\"android:textAppearance\\">@style/Persona.Text.Body</item>
|
|
540
|
-
</style>
|
|
541
|
-
<style name=\\"RN.Persona.DropDownItem.Spinner\\" parent=\\"Widget.AppCompat.DropDownItem.Spinner\\">
|
|
542
|
-
<item name=\\"android:textColor\\">#FFFFFF</item>
|
|
543
|
-
<item name=\\"android:textAppearance\\">@style/Persona.Text.Body</item>
|
|
544
|
-
</style>
|
|
545
|
-
<style name=\\"RN.Persona.Text.Spinner\\">
|
|
546
|
-
<item name=\\"android:textColor\\">#FFFFFF</item>
|
|
547
|
-
</style>
|
|
548
|
-
</resources>
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
res/drawable/rn_persona_button.xml
|
|
552
|
-
----------------------------------
|
|
553
|
-
<?xml version=\\"1.0\\"?>
|
|
554
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
res/color/rn_persona_button.xml
|
|
558
|
-
-------------------------------
|
|
559
|
-
<?xml version=\\"1.0\\"?>
|
|
560
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>"
|
|
561
|
-
`);
|
|
562
|
-
});
|
|
563
|
-
it("pickerTextFont", () => {
|
|
564
|
-
const theme = { ...EMPTY_THEME, pickerTextFont: "Arial" };
|
|
565
|
-
expect(printTheme(theme)).toMatchInlineSnapshot(`
|
|
566
|
-
"res/values/styles_persona.xml
|
|
567
|
-
-----------------------------
|
|
568
|
-
<?xml version=\\"1.0\\"?>
|
|
569
|
-
<resources>
|
|
570
|
-
<style name=\\"RN\\"/>
|
|
571
|
-
<style name=\\"RN.Persona\\"/>
|
|
572
|
-
<style name=\\"RN.Persona.Text\\"/>
|
|
573
|
-
<style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
|
|
574
|
-
<item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
|
|
575
|
-
<item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
|
|
576
|
-
<item name=\\"spinnerStyle\\">@style/RN.Persona.Spinner</item>
|
|
577
|
-
<item name=\\"spinnerDropDownItemStyle\\">@style/RN.Persona.DropDownItem.Spinner</item>
|
|
578
|
-
</style>
|
|
579
|
-
<style name=\\"RN.Persona.Spinner\\" parent=\\"Widget.AppCompat.Spinner\\">
|
|
580
|
-
<item name=\\"android:textColor\\">?android:attr/textColorPrimary</item>
|
|
581
|
-
<item name=\\"android:textAppearance\\">@style/RN.Persona.Text.Spinner</item>
|
|
582
|
-
</style>
|
|
583
|
-
<style name=\\"RN.Persona.DropDownItem.Spinner\\" parent=\\"Widget.AppCompat.DropDownItem.Spinner\\">
|
|
584
|
-
<item name=\\"android:textColor\\">?android:attr/textColorPrimary</item>
|
|
585
|
-
<item name=\\"android:textAppearance\\">@style/RN.Persona.Text.Spinner</item>
|
|
586
|
-
</style>
|
|
587
|
-
<style name=\\"RN.Persona.Text.Spinner\\">
|
|
588
|
-
<item name=\\"android:fontFamily\\">Arial</item>
|
|
589
|
-
</style>
|
|
590
|
-
</resources>
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
res/drawable/rn_persona_button.xml
|
|
594
|
-
----------------------------------
|
|
595
|
-
<?xml version=\\"1.0\\"?>
|
|
596
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
res/color/rn_persona_button.xml
|
|
600
|
-
-------------------------------
|
|
601
|
-
<?xml version=\\"1.0\\"?>
|
|
602
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>"
|
|
603
|
-
`);
|
|
604
|
-
});
|
|
605
|
-
it("pickerTextFont and pickerTextColor", () => {
|
|
606
|
-
const theme = {
|
|
607
|
-
...EMPTY_THEME,
|
|
608
|
-
pickerTextFont: "Arial",
|
|
609
|
-
pickerTextColor: "#000000",
|
|
610
|
-
};
|
|
611
|
-
expect(printTheme(theme)).toMatchInlineSnapshot(`
|
|
612
|
-
"res/values/styles_persona.xml
|
|
613
|
-
-----------------------------
|
|
614
|
-
<?xml version=\\"1.0\\"?>
|
|
615
|
-
<resources>
|
|
616
|
-
<style name=\\"RN\\"/>
|
|
617
|
-
<style name=\\"RN.Persona\\"/>
|
|
618
|
-
<style name=\\"RN.Persona.Text\\"/>
|
|
619
|
-
<style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
|
|
620
|
-
<item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
|
|
621
|
-
<item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
|
|
622
|
-
<item name=\\"spinnerStyle\\">@style/RN.Persona.Spinner</item>
|
|
623
|
-
<item name=\\"spinnerDropDownItemStyle\\">@style/RN.Persona.DropDownItem.Spinner</item>
|
|
624
|
-
</style>
|
|
625
|
-
<style name=\\"RN.Persona.Spinner\\" parent=\\"Widget.AppCompat.Spinner\\">
|
|
626
|
-
<item name=\\"android:textColor\\">#000000</item>
|
|
627
|
-
<item name=\\"android:textAppearance\\">@style/RN.Persona.Text.Spinner</item>
|
|
628
|
-
</style>
|
|
629
|
-
<style name=\\"RN.Persona.DropDownItem.Spinner\\" parent=\\"Widget.AppCompat.DropDownItem.Spinner\\">
|
|
630
|
-
<item name=\\"android:textColor\\">#000000</item>
|
|
631
|
-
<item name=\\"android:textAppearance\\">@style/RN.Persona.Text.Spinner</item>
|
|
632
|
-
</style>
|
|
633
|
-
<style name=\\"RN.Persona.Text.Spinner\\">
|
|
634
|
-
<item name=\\"android:textColor\\">#000000</item>
|
|
635
|
-
<item name=\\"android:fontFamily\\">Arial</item>
|
|
636
|
-
</style>
|
|
637
|
-
</resources>
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
res/drawable/rn_persona_button.xml
|
|
641
|
-
----------------------------------
|
|
642
|
-
<?xml version=\\"1.0\\"?>
|
|
643
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
res/color/rn_persona_button.xml
|
|
647
|
-
-------------------------------
|
|
648
|
-
<?xml version=\\"1.0\\"?>
|
|
649
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>"
|
|
650
|
-
`);
|
|
651
|
-
});
|
|
652
|
-
it("button", () => {
|
|
653
|
-
const theme = {
|
|
654
|
-
...EMPTY_THEME,
|
|
655
|
-
buttonBackgroundColor: "#FF0000",
|
|
656
|
-
buttonDisabledBackgroundColor: null,
|
|
657
|
-
buttonTouchedBackgroundColor: null,
|
|
658
|
-
buttonTextColor: null,
|
|
659
|
-
buttonDisabledTextColor: null,
|
|
660
|
-
buttonTextAlignment: null,
|
|
661
|
-
buttonCornerRadius: null,
|
|
662
|
-
buttonFont: null,
|
|
663
|
-
};
|
|
664
|
-
expect(printTheme(theme)).toMatchInlineSnapshot(`
|
|
665
|
-
"res/values/styles_persona.xml
|
|
666
|
-
-----------------------------
|
|
667
|
-
<?xml version=\\"1.0\\"?>
|
|
668
|
-
<resources>
|
|
669
|
-
<style name=\\"RN\\"/>
|
|
670
|
-
<style name=\\"RN.Persona\\"/>
|
|
671
|
-
<style name=\\"RN.Persona.Text\\"/>
|
|
672
|
-
<style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
|
|
673
|
-
<item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
|
|
674
|
-
<item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
|
|
675
|
-
<item name=\\"buttonStyle\\">@style/RN.Persona.Button</item>
|
|
676
|
-
</style>
|
|
677
|
-
<style name=\\"RN.Persona.Button\\" parent=\\"android:style/Widget.Button\\">
|
|
678
|
-
<item name=\\"android:minHeight\\">48dip</item>
|
|
679
|
-
<item name=\\"android:minWidth\\">88dip</item>
|
|
680
|
-
<item name=\\"android:textSize\\">18sp</item>
|
|
681
|
-
<item name=\\"android:background\\">@drawable/rn_persona_button</item>
|
|
682
|
-
<item name=\\"android:textColor\\">@color/rn_persona_button</item>
|
|
683
|
-
</style>
|
|
684
|
-
</resources>
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
res/drawable/rn_persona_button.xml
|
|
688
|
-
----------------------------------
|
|
689
|
-
<?xml version=\\"1.0\\"?>
|
|
690
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\">
|
|
691
|
-
<item android:state_enabled=\\"false\\">
|
|
692
|
-
<shape android:shape=\\"rectangle\\">
|
|
693
|
-
<corners android:radius=\\"@dimen/abc_control_corner_material\\"/>
|
|
694
|
-
<padding android:left=\\"@dimen/abc_button_padding_horizontal_material\\" android:top=\\"@dimen/abc_button_padding_vertical_material\\" android:right=\\"@dimen/abc_button_padding_horizontal_material\\" android:bottom=\\"@dimen/abc_button_padding_vertical_material\\"/>
|
|
695
|
-
<solid android:color=\\"?attr/colorPrimaryDark\\"/>
|
|
696
|
-
</shape>
|
|
697
|
-
</item>
|
|
698
|
-
<item android:state_pressed=\\"true\\">
|
|
699
|
-
<shape android:shape=\\"rectangle\\">
|
|
700
|
-
<corners android:radius=\\"@dimen/abc_control_corner_material\\"/>
|
|
701
|
-
<solid android:color=\\"?attr/colorPrimaryDark\\"/>
|
|
702
|
-
<padding android:left=\\"@dimen/abc_button_padding_horizontal_material\\" android:top=\\"@dimen/abc_button_padding_vertical_material\\" android:right=\\"@dimen/abc_button_padding_horizontal_material\\" android:bottom=\\"@dimen/abc_button_padding_vertical_material\\"/>
|
|
703
|
-
</shape>
|
|
704
|
-
</item>
|
|
705
|
-
<item>
|
|
706
|
-
<shape android:shape=\\"rectangle\\">
|
|
707
|
-
<corners android:radius=\\"@dimen/abc_control_corner_material\\"/>
|
|
708
|
-
<solid android:color=\\"#FF0000\\"/>
|
|
709
|
-
<padding android:left=\\"@dimen/abc_button_padding_horizontal_material\\" android:top=\\"@dimen/abc_button_padding_vertical_material\\" android:right=\\"@dimen/abc_button_padding_horizontal_material\\" android:bottom=\\"@dimen/abc_button_padding_vertical_material\\"/>
|
|
710
|
-
</shape>
|
|
711
|
-
</item>
|
|
712
|
-
</selector>
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
res/color/rn_persona_button.xml
|
|
716
|
-
-------------------------------
|
|
717
|
-
<?xml version=\\"1.0\\"?>
|
|
718
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\">
|
|
719
|
-
<item android:state_enabled=\\"false\\" android:color=\\"@android:color/darker_gray\\"/>
|
|
720
|
-
<item android:state_pressed=\\"true\\" android:color=\\"@android:color/white\\"/>
|
|
721
|
-
<item android:color=\\"@android:color/white\\"/>
|
|
722
|
-
</selector>"
|
|
723
|
-
`);
|
|
724
|
-
});
|
|
725
|
-
it("progressColor", () => {
|
|
726
|
-
const theme = {
|
|
727
|
-
...EMPTY_THEME,
|
|
728
|
-
progressColor: "#FF0000",
|
|
729
|
-
};
|
|
730
|
-
expect(printTheme(theme)).toMatchInlineSnapshot(`
|
|
731
|
-
"res/values/styles_persona.xml
|
|
732
|
-
-----------------------------
|
|
733
|
-
<?xml version=\\"1.0\\"?>
|
|
734
|
-
<resources>
|
|
735
|
-
<style name=\\"RN\\"/>
|
|
736
|
-
<style name=\\"RN.Persona\\"/>
|
|
737
|
-
<style name=\\"RN.Persona.Text\\"/>
|
|
738
|
-
<style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
|
|
739
|
-
<item name=\\"personaTitleTextAppearance\\">@style/Persona.Text.Title</item>
|
|
740
|
-
<item name=\\"personaBodyTextAppearance\\">@style/Persona.Text.Body</item>
|
|
741
|
-
<item name=\\"colorControlActivated\\">#FF0000</item>
|
|
742
|
-
</style>
|
|
743
|
-
</resources>
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
res/drawable/rn_persona_button.xml
|
|
747
|
-
----------------------------------
|
|
748
|
-
<?xml version=\\"1.0\\"?>
|
|
749
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
res/color/rn_persona_button.xml
|
|
753
|
-
-------------------------------
|
|
754
|
-
<?xml version=\\"1.0\\"?>
|
|
755
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\"/>"
|
|
756
|
-
`);
|
|
757
|
-
});
|
|
758
|
-
it("fullTheme", () => {
|
|
759
|
-
const theme = {
|
|
760
|
-
backgroundColor: "#FF0000",
|
|
761
|
-
primaryColor: "#FF0000",
|
|
762
|
-
darkPrimaryColor: "#FF0000",
|
|
763
|
-
accentColor: "#FF0000",
|
|
764
|
-
titleTextColor: "#FF0000",
|
|
765
|
-
titleTextFont: "Arial",
|
|
766
|
-
bodyTextColor: "#FF0000",
|
|
767
|
-
bodyTextFont: "Arial",
|
|
768
|
-
footnoteTextColor: "#FF0000",
|
|
769
|
-
footnoteTextFont: "Arial",
|
|
770
|
-
// formLabelTextColor: "#FF0000",
|
|
771
|
-
// formLabelTextFont: "Arial",
|
|
772
|
-
textFieldTextColor: "#FF0000",
|
|
773
|
-
textFieldTextFont: "Arial",
|
|
774
|
-
pickerTextColor: "#FF0000",
|
|
775
|
-
pickerTextFont: "Arial",
|
|
776
|
-
buttonBackgroundColor: "#FF0000",
|
|
777
|
-
buttonDisabledBackgroundColor: "#FF0000",
|
|
778
|
-
buttonTouchedBackgroundColor: "#FF0000",
|
|
779
|
-
buttonTextColor: "#FF0000",
|
|
780
|
-
buttonDisabledTextColor: "#FF0000",
|
|
781
|
-
buttonTextAlignment: "left",
|
|
782
|
-
buttonCornerRadius: "4",
|
|
783
|
-
buttonFont: "Arial",
|
|
784
|
-
progressColor: "#FF0000",
|
|
785
|
-
successAsset: "@drawable/success",
|
|
786
|
-
failAsset: "@drawable/fail",
|
|
787
|
-
loadingAnimationAsset: "@raw/loading",
|
|
788
|
-
loadingAnimationWidthPercent: "0.2",
|
|
789
|
-
selfieAnimationAsset: "@raw/selfie",
|
|
790
|
-
selfieAnimationWidthPercent: "0.6",
|
|
791
|
-
};
|
|
792
|
-
expect(printTheme(theme)).toMatchInlineSnapshot(`
|
|
793
|
-
"res/values/styles_persona.xml
|
|
794
|
-
-----------------------------
|
|
795
|
-
<?xml version=\\"1.0\\"?>
|
|
796
|
-
<resources>
|
|
797
|
-
<color name=\\"customPersonaBackgroundColor\\">#FF0000</color>
|
|
798
|
-
|
|
799
|
-
<style name=\\"RN\\"/>
|
|
800
|
-
<style name=\\"RN.Persona\\"/>
|
|
801
|
-
<style name=\\"RN.Persona.Text\\"/>
|
|
802
|
-
<style name=\\"Persona.Inquiry.Theme\\" parent=\\"Base.Persona.Inquiry.Theme.Light\\">
|
|
803
|
-
<item name=\\"colorPrimary\\">#FF0000</item>
|
|
804
|
-
|
|
805
|
-
<item name=\\"colorAccent\\">#FF0000</item>
|
|
806
|
-
|
|
807
|
-
<item name=\\"colorPrimaryDark\\">#FF0000</item>
|
|
808
|
-
|
|
809
|
-
<item name=\\"android:colorBackground\\">@color/customPersonaBackgroundColor</item>
|
|
810
|
-
|
|
811
|
-
<item name=\\"personaTitleTextAppearance\\">@style/RN.Persona.Text.Title</item>
|
|
812
|
-
<item name=\\"personaBodyTextAppearance\\">@style/RN.Persona.Text.Body</item>
|
|
813
|
-
<item name=\\"editTextStyle\\">@style/RN.Persona.EditText</item>
|
|
814
|
-
<item name=\\"spinnerStyle\\">@style/RN.Persona.Spinner</item>
|
|
815
|
-
<item name=\\"spinnerDropDownItemStyle\\">@style/RN.Persona.DropDownItem.Spinner</item>
|
|
816
|
-
<item name=\\"buttonStyle\\">@style/RN.Persona.Button</item>
|
|
817
|
-
<item name=\\"colorControlActivated\\">#FF0000</item>
|
|
818
|
-
<item name=\\"personaInquiryCompleteImage\\">@drawable/success</item>
|
|
819
|
-
|
|
820
|
-
<item name=\\"personaInquiryFailImage\\">@drawable/fail</item>
|
|
821
|
-
|
|
822
|
-
<item name=\\"personaInquiryLoadingLottieRaw\\">@raw/loading</item>
|
|
823
|
-
|
|
824
|
-
<item name=\\"personaInquiryLoadingLottieWidthPercent\\">0.2</item>
|
|
825
|
-
|
|
826
|
-
<item name=\\"personaInquirySelfieLottieRaw\\">@raw/selfie</item>
|
|
827
|
-
|
|
828
|
-
<item name=\\"personaInquirySelfieLottieWidthPercent\\">0.6</item>
|
|
829
|
-
|
|
830
|
-
</style>
|
|
831
|
-
<style name=\\"RN.Persona.Text.Title\\" parent=\\"Persona.Text.Body\\">
|
|
832
|
-
<item name=\\"android:textColor\\">#FF0000</item>
|
|
833
|
-
<item name=\\"android:fontFamily\\">Arial</item>
|
|
834
|
-
<item name=\\"android:textSize\\">26sp</item>
|
|
835
|
-
<item name=\\"android:textStyle\\">bold</item>
|
|
836
|
-
</style>
|
|
837
|
-
<style name=\\"RN.Persona.Text.Body\\" parent=\\"Persona.Text.Body\\">
|
|
838
|
-
<item name=\\"android:textColor\\">#FF0000</item>
|
|
839
|
-
<item name=\\"android:fontFamily\\">Arial</item>
|
|
840
|
-
<item name=\\"android:textSize\\">18sp</item>
|
|
841
|
-
</style>
|
|
842
|
-
<style name=\\"TextAppearance.AppCompat.Small\\">
|
|
843
|
-
<item name=\\"android:textSize\\">@dimen/abc_text_size_small_material</item>
|
|
844
|
-
<item name=\\"android:textColor\\">#FF0000</item>
|
|
845
|
-
<item name=\\"android:fontFamily\\">Arial</item>
|
|
846
|
-
</style>
|
|
847
|
-
<style name=\\"RN.Persona.EditText\\" parent=\\"Widget.AppCompat.EditText\\">
|
|
848
|
-
<item name=\\"android:textAppearance\\">@style/RN.Persona.EditText.TextAppearance</item>
|
|
849
|
-
<item name=\\"android:textColor\\">#FF0000</item>
|
|
850
|
-
</style>
|
|
851
|
-
<style name=\\"RN.Persona.EditText.TextAppearance\\" parent=\\"Base.TextAppearance.AppCompat.Medium\\">
|
|
852
|
-
<item name=\\"android:textSize\\">18sp</item>
|
|
853
|
-
<item name=\\"android:fontFamily\\">Arial</item>
|
|
854
|
-
</style>
|
|
855
|
-
<style name=\\"RN.Persona.Spinner\\" parent=\\"Widget.AppCompat.Spinner\\">
|
|
856
|
-
<item name=\\"android:textColor\\">#FF0000</item>
|
|
857
|
-
<item name=\\"android:textAppearance\\">@style/RN.Persona.Text.Spinner</item>
|
|
858
|
-
</style>
|
|
859
|
-
<style name=\\"RN.Persona.DropDownItem.Spinner\\" parent=\\"Widget.AppCompat.DropDownItem.Spinner\\">
|
|
860
|
-
<item name=\\"android:textColor\\">#FF0000</item>
|
|
861
|
-
<item name=\\"android:textAppearance\\">@style/RN.Persona.Text.Spinner</item>
|
|
862
|
-
</style>
|
|
863
|
-
<style name=\\"RN.Persona.Text.Spinner\\">
|
|
864
|
-
<item name=\\"android:textColor\\">#FF0000</item>
|
|
865
|
-
<item name=\\"android:fontFamily\\">Arial</item>
|
|
866
|
-
</style>
|
|
867
|
-
<style name=\\"RN.Persona.Button\\" parent=\\"android:style/Widget.Button\\">
|
|
868
|
-
<item name=\\"android:minHeight\\">48dip</item>
|
|
869
|
-
<item name=\\"android:minWidth\\">88dip</item>
|
|
870
|
-
<item name=\\"android:textSize\\">18sp</item>
|
|
871
|
-
<item name=\\"android:background\\">@drawable/rn_persona_button</item>
|
|
872
|
-
<item name=\\"android:textColor\\">@color/rn_persona_button</item>
|
|
873
|
-
</style>
|
|
874
|
-
</resources>
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
res/drawable/rn_persona_button.xml
|
|
878
|
-
----------------------------------
|
|
879
|
-
<?xml version=\\"1.0\\"?>
|
|
880
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\">
|
|
881
|
-
<item android:state_enabled=\\"false\\">
|
|
882
|
-
<shape android:shape=\\"rectangle\\">
|
|
883
|
-
<corners android:radius=\\"4dp\\"/>
|
|
884
|
-
<padding android:left=\\"@dimen/abc_button_padding_horizontal_material\\" android:top=\\"@dimen/abc_button_padding_vertical_material\\" android:right=\\"@dimen/abc_button_padding_horizontal_material\\" android:bottom=\\"@dimen/abc_button_padding_vertical_material\\"/>
|
|
885
|
-
<solid android:color=\\"#FF0000\\"/>
|
|
886
|
-
</shape>
|
|
887
|
-
</item>
|
|
888
|
-
<item android:state_pressed=\\"true\\">
|
|
889
|
-
<shape android:shape=\\"rectangle\\">
|
|
890
|
-
<corners android:radius=\\"4dp\\"/>
|
|
891
|
-
<solid android:color=\\"#FF0000\\"/>
|
|
892
|
-
<padding android:left=\\"@dimen/abc_button_padding_horizontal_material\\" android:top=\\"@dimen/abc_button_padding_vertical_material\\" android:right=\\"@dimen/abc_button_padding_horizontal_material\\" android:bottom=\\"@dimen/abc_button_padding_vertical_material\\"/>
|
|
893
|
-
</shape>
|
|
894
|
-
</item>
|
|
895
|
-
<item>
|
|
896
|
-
<shape android:shape=\\"rectangle\\">
|
|
897
|
-
<corners android:radius=\\"4dp\\"/>
|
|
898
|
-
<solid android:color=\\"#FF0000\\"/>
|
|
899
|
-
<padding android:left=\\"@dimen/abc_button_padding_horizontal_material\\" android:top=\\"@dimen/abc_button_padding_vertical_material\\" android:right=\\"@dimen/abc_button_padding_horizontal_material\\" android:bottom=\\"@dimen/abc_button_padding_vertical_material\\"/>
|
|
900
|
-
</shape>
|
|
901
|
-
</item>
|
|
902
|
-
</selector>
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
res/color/rn_persona_button.xml
|
|
906
|
-
-------------------------------
|
|
907
|
-
<?xml version=\\"1.0\\"?>
|
|
908
|
-
<selector xmlns:android=\\"http://schemas.android.com/apk/res/android\\">
|
|
909
|
-
<item android:state_enabled=\\"false\\" android:color=\\"#FF0000\\"/>
|
|
910
|
-
<item android:state_pressed=\\"true\\" android:color=\\"#FF0000\\"/>
|
|
911
|
-
<item android:color=\\"#FF0000\\"/>
|
|
912
|
-
</selector>"
|
|
913
|
-
`);
|
|
914
|
-
});
|