react-native-persona 2.2.0 → 2.2.3

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.
Files changed (64) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +149 -2
  3. package/RNPersonaInquiry2.podspec +1 -1
  4. package/android/build.gradle +1 -2
  5. package/android/src/main/java/com/withpersona/sdk2/reactnative/PersonaInquiryModule2.java +8 -2
  6. package/bin/persona-tool +1 -2
  7. package/ios/PersonaInquiry2.swift +4 -0
  8. package/lib/commonjs/index.js +66 -4
  9. package/lib/commonjs/index.js.map +1 -1
  10. package/lib/commonjs/persona-tool/AndroidResourcePrinter.js +497 -0
  11. package/lib/commonjs/persona-tool/AndroidResourcePrinter.js.map +1 -0
  12. package/lib/commonjs/persona-tool/Config.js +95 -0
  13. package/lib/commonjs/persona-tool/Config.js.map +1 -0
  14. package/lib/commonjs/persona-tool/Theme.js +199 -0
  15. package/lib/commonjs/persona-tool/Theme.js.map +1 -0
  16. package/lib/commonjs/persona-tool/index.js +41 -0
  17. package/lib/commonjs/persona-tool/index.js.map +1 -0
  18. package/lib/commonjs/persona-tool/prompts.js +48 -0
  19. package/lib/commonjs/persona-tool/prompts.js.map +1 -0
  20. package/lib/commonjs/persona-tool/tools/AndroidThemeGenerator.js +99 -0
  21. package/lib/commonjs/persona-tool/tools/AndroidThemeGenerator.js.map +1 -0
  22. package/lib/commonjs/persona-tool/tools/IosThemeInstructions.js +50 -0
  23. package/lib/commonjs/persona-tool/tools/IosThemeInstructions.js.map +1 -0
  24. package/lib/commonjs/versions.js +25 -0
  25. package/lib/commonjs/versions.js.map +1 -0
  26. package/lib/module/index.js +58 -3
  27. package/lib/module/index.js.map +1 -1
  28. package/lib/module/persona-tool/AndroidResourcePrinter.js +489 -0
  29. package/lib/module/persona-tool/AndroidResourcePrinter.js.map +1 -0
  30. package/lib/module/persona-tool/Config.js +82 -0
  31. package/lib/module/persona-tool/Config.js.map +1 -0
  32. package/lib/module/persona-tool/Theme.js +183 -0
  33. package/lib/module/persona-tool/Theme.js.map +1 -0
  34. package/lib/module/persona-tool/index.js +33 -0
  35. package/lib/module/persona-tool/index.js.map +1 -0
  36. package/lib/module/persona-tool/prompts.js +31 -0
  37. package/lib/module/persona-tool/prompts.js.map +1 -0
  38. package/lib/module/persona-tool/tools/AndroidThemeGenerator.js +72 -0
  39. package/lib/module/persona-tool/tools/AndroidThemeGenerator.js.map +1 -0
  40. package/lib/module/persona-tool/tools/IosThemeInstructions.js +37 -0
  41. package/lib/module/persona-tool/tools/IosThemeInstructions.js.map +1 -0
  42. package/lib/module/versions.js +14 -0
  43. package/lib/module/versions.js.map +1 -0
  44. package/lib/typescript/{src/fields.d.ts → fields.d.ts} +0 -0
  45. package/lib/typescript/{src/index.d.ts → index.d.ts} +50 -0
  46. package/lib/typescript/{persona-tools/lib → persona-tool}/AndroidResourcePrinter.d.ts +2 -2
  47. package/lib/typescript/{persona-tools → persona-tool}/Config.d.ts +0 -0
  48. package/lib/typescript/{persona-tools → persona-tool}/Theme.d.ts +0 -0
  49. package/lib/typescript/{persona-tools → persona-tool}/index.d.ts +0 -0
  50. package/lib/typescript/{persona-tools/lib → persona-tool}/prompts.d.ts +1 -1
  51. package/lib/typescript/{persona-tools → persona-tool}/tools/AndroidThemeGenerator.d.ts +0 -0
  52. package/lib/typescript/{persona-tools → persona-tool}/tools/IosThemeInstructions.d.ts +0 -0
  53. package/lib/typescript/{src/util.d.ts → util.d.ts} +0 -0
  54. package/lib/typescript/versions.d.ts +6 -0
  55. package/package.json +4 -5
  56. package/src/index.ts +65 -3
  57. package/{persona-tools/lib → src/persona-tool}/AndroidResourcePrinter.ts +182 -182
  58. package/{persona-tools → src/persona-tool}/Config.ts +0 -0
  59. package/{persona-tools → src/persona-tool}/Theme.ts +0 -0
  60. package/{persona-tools → src/persona-tool}/index.ts +1 -1
  61. package/{persona-tools/lib → src/persona-tool}/prompts.ts +11 -11
  62. package/{persona-tools → src/persona-tool}/tools/AndroidThemeGenerator.ts +2 -2
  63. package/{persona-tools → src/persona-tool}/tools/IosThemeInstructions.ts +1 -1
  64. package/src/versions.ts +12 -0
@@ -1,6 +1,6 @@
1
- import { create as createXml } from "xmlbuilder2";
2
- import type { AndroidThemeObject } from "../Theme";
3
- import type { XMLBuilder } from "xmlbuilder2/lib/interfaces";
1
+ import { create as createXml } from 'xmlbuilder2';
2
+ import type { AndroidThemeObject } from './Theme';
3
+ import type { XMLBuilder } from 'xmlbuilder2/lib/interfaces';
4
4
 
5
5
  class AndroidResourcePrinter {
6
6
  theme: AndroidThemeObject;
@@ -13,12 +13,12 @@ class AndroidResourcePrinter {
13
13
 
14
14
  constructor(theme: AndroidThemeObject) {
15
15
  this.theme = theme;
16
- this.root = createXml({ version: "1.0" }).ele("resources");
17
- this.buttonDrawable = createXml({ version: "1.0" }).ele("selector", {
18
- "xmlns:android": "http://schemas.android.com/apk/res/android",
16
+ this.root = createXml({ version: '1.0' }).ele('resources');
17
+ this.buttonDrawable = createXml({ version: '1.0' }).ele('selector', {
18
+ 'xmlns:android': 'http://schemas.android.com/apk/res/android',
19
19
  });
20
- this.buttonColor = createXml({ version: "1.0" }).ele("selector", {
21
- "xmlns:android": "http://schemas.android.com/apk/res/android",
20
+ this.buttonColor = createXml({ version: '1.0' }).ele('selector', {
21
+ 'xmlns:android': 'http://schemas.android.com/apk/res/android',
22
22
  });
23
23
  }
24
24
 
@@ -58,23 +58,23 @@ class AndroidResourcePrinter {
58
58
 
59
59
  // Precreate some style namespaces
60
60
  this.root = this.root
61
- .ele("style", {
62
- name: "RN",
61
+ .ele('style', {
62
+ name: 'RN',
63
63
  })
64
64
  .up();
65
65
  this.root = this.root
66
- .ele("style", {
67
- name: "RN.Persona",
66
+ .ele('style', {
67
+ name: 'RN.Persona',
68
68
  })
69
69
  .up();
70
70
  this.root = this.root
71
- .ele("style", {
72
- name: "RN.Persona.Text",
71
+ .ele('style', {
72
+ name: 'RN.Persona.Text',
73
73
  })
74
74
  .up();
75
- this.root = this.root.ele("style", {
76
- name: "Persona.Inquiry2.Theme",
77
- parent: "Base.Persona.Inquiry2.Theme",
75
+ this.root = this.root.ele('style', {
76
+ name: 'Persona.Inquiry2.Theme',
77
+ parent: 'Base.Persona.Inquiry2.Theme',
78
78
  });
79
79
  this.printQueue.forEach((fn) => fn());
80
80
  this.root = this.root.up();
@@ -93,10 +93,10 @@ class AndroidResourcePrinter {
93
93
 
94
94
  this.printQueue.push(() => {
95
95
  this.root = this.root
96
- .ele("item", { name: "colorPrimary" })
96
+ .ele('item', { name: 'colorPrimary' })
97
97
  .txt(this.theme.primaryColor as string)
98
98
  .up()
99
- .txt(" ");
99
+ .txt(' ');
100
100
  });
101
101
  }
102
102
 
@@ -105,10 +105,10 @@ class AndroidResourcePrinter {
105
105
 
106
106
  this.printQueue.push(() => {
107
107
  this.root = this.root
108
- .ele("item", { name: "colorAccent" })
108
+ .ele('item', { name: 'colorSecondary' })
109
109
  .txt(this.theme.accentColor as string)
110
110
  .up()
111
- .txt(" ");
111
+ .txt(' ');
112
112
  });
113
113
  }
114
114
 
@@ -117,10 +117,10 @@ class AndroidResourcePrinter {
117
117
 
118
118
  this.printQueue.push(() => {
119
119
  this.root = this.root
120
- .ele("item", { name: "colorPrimaryDark" })
120
+ .ele('item', { name: 'colorPrimaryVariant' })
121
121
  .txt(this.theme.darkPrimaryColor as string)
122
122
  .up()
123
- .txt(" ");
123
+ .txt(' ');
124
124
  });
125
125
  }
126
126
 
@@ -129,18 +129,18 @@ class AndroidResourcePrinter {
129
129
 
130
130
  this.preprintQueue.push(() => {
131
131
  this.root = this.root
132
- .ele("color", { name: "customPersonaBackgroundColor" })
132
+ .ele('color', { name: 'customPersonaBackgroundColor' })
133
133
  .txt(this.theme.backgroundColor as string)
134
134
  .up()
135
- .txt(" ");
135
+ .txt(' ');
136
136
  });
137
137
 
138
138
  this.printQueue.push(() => {
139
139
  this.root = this.root
140
- .ele("item", { name: "android:colorBackground" })
141
- .txt("@color/customPersonaBackgroundColor")
140
+ .ele('item', { name: 'android:colorBackground' })
141
+ .txt('@color/customPersonaBackgroundColor')
142
142
  .up()
143
- .txt(" ");
143
+ .txt(' ');
144
144
  });
145
145
  }
146
146
 
@@ -148,21 +148,21 @@ class AndroidResourcePrinter {
148
148
  if (this.theme.titleTextColor || this.theme.titleTextFont) {
149
149
  this.printQueue.push(() => {
150
150
  this.root = this.root
151
- .ele("item", { name: "personaTitleTextAppearance" })
152
- .txt("@style/RN.Persona.Text.Title")
151
+ .ele('item', { name: 'textAppearanceHeadline6' })
152
+ .txt('@style/RN.Persona.Text.Title')
153
153
  .up();
154
154
  });
155
155
 
156
156
  // Create a text appearance
157
157
  this.postPrintQueue.push(() => {
158
- this.root = this.root.ele("style", {
159
- name: "RN.Persona.Text.Title",
160
- parent: "Persona.Text.Body",
158
+ this.root = this.root.ele('style', {
159
+ name: 'RN.Persona.Text.Title',
160
+ parent: 'Persona.Inquiry2.Text.Body',
161
161
  });
162
162
 
163
163
  if (this.theme.titleTextColor) {
164
164
  this.root = this.root
165
- .ele("item", { name: "android:textColor" })
165
+ .ele('item', { name: 'android:textColor' })
166
166
  .txt(this.theme.titleTextColor as string)
167
167
  .up();
168
168
  }
@@ -171,7 +171,7 @@ class AndroidResourcePrinter {
171
171
  // TODO: Add notice about how to add a custom font that can be
172
172
  // referenced here on Android
173
173
  this.root = this.root
174
- .ele("item", { name: "android:fontFamily" })
174
+ .ele('item', { name: 'android:fontFamily' })
175
175
  .txt(this.theme.titleTextFont as string)
176
176
  .up();
177
177
  }
@@ -179,11 +179,11 @@ class AndroidResourcePrinter {
179
179
  // Default values taken from `Persona.Text.Title`
180
180
  // in shared/src/main/res/values/styles.xml
181
181
  this.root = this.root
182
- .ele("item", { name: "android:textSize" })
183
- .txt("26sp")
182
+ .ele('item', { name: 'android:textSize' })
183
+ .txt('26sp')
184
184
  .up()
185
- .ele("item", { name: "android:textStyle" })
186
- .txt("bold")
185
+ .ele('item', { name: 'android:textStyle' })
186
+ .txt('bold')
187
187
  .up();
188
188
 
189
189
  this.root = this.root.up();
@@ -191,8 +191,8 @@ class AndroidResourcePrinter {
191
191
  } else {
192
192
  this.printQueue.push(() => {
193
193
  this.root = this.root
194
- .ele("item", { name: "personaTitleTextAppearance" })
195
- .txt("@style/Persona.Text.Title")
194
+ .ele('item', { name: 'textAppearanceHeadline6' })
195
+ .txt('@style/Persona.Text.Title')
196
196
  .up();
197
197
  });
198
198
  }
@@ -202,21 +202,21 @@ class AndroidResourcePrinter {
202
202
  if (this.theme.bodyTextColor || this.theme.bodyTextFont) {
203
203
  this.printQueue.push(() => {
204
204
  this.root = this.root
205
- .ele("item", { name: "personaBodyTextAppearance" })
206
- .txt("@style/RN.Persona.Text.Body")
205
+ .ele('item', { name: 'textAppearanceSubtitle1' })
206
+ .txt('@style/RN.Persona.Text.Body')
207
207
  .up();
208
208
  });
209
209
 
210
210
  // Create a text appearance
211
211
  this.postPrintQueue.push(() => {
212
- this.root = this.root.ele("style", {
213
- name: "RN.Persona.Text.Body",
214
- parent: "Persona.Text.Body",
212
+ this.root = this.root.ele('style', {
213
+ name: 'RN.Persona.Text.Body',
214
+ parent: 'Persona.Inquiry2.Text.Body',
215
215
  });
216
216
 
217
217
  if (this.theme.bodyTextColor) {
218
218
  this.root = this.root
219
- .ele("item", { name: "android:textColor" })
219
+ .ele('item', { name: 'android:textColor' })
220
220
  .txt(this.theme.bodyTextColor as string)
221
221
  .up();
222
222
  }
@@ -225,7 +225,7 @@ class AndroidResourcePrinter {
225
225
  // TODO: Add notice about how to add a custom font that can be
226
226
  // referenced here on Android
227
227
  this.root = this.root
228
- .ele("item", { name: "android:fontFamily" })
228
+ .ele('item', { name: 'android:fontFamily' })
229
229
  .txt(this.theme.bodyTextFont as string)
230
230
  .up();
231
231
  }
@@ -233,8 +233,8 @@ class AndroidResourcePrinter {
233
233
  // Default values taken from `Persona.Text.Body`
234
234
  // in shared/src/main/res/values/styles.xml
235
235
  this.root = this.root
236
- .ele("item", { name: "android:textSize" })
237
- .txt("18sp")
236
+ .ele('item', { name: 'android:textSize' })
237
+ .txt('18sp')
238
238
  .up();
239
239
 
240
240
  this.root = this.root.up();
@@ -242,8 +242,8 @@ class AndroidResourcePrinter {
242
242
  } else {
243
243
  this.printQueue.push(() => {
244
244
  this.root = this.root
245
- .ele("item", { name: "personaBodyTextAppearance" })
246
- .txt("@style/Persona.Text.Body")
245
+ .ele('item', { name: 'textAppearanceSubtitle1' })
246
+ .txt('@style/Persona.Inquiry2.Text.Body')
247
247
  .up();
248
248
  });
249
249
  }
@@ -253,24 +253,24 @@ class AndroidResourcePrinter {
253
253
  if (this.theme.footnoteTextColor || this.theme.footnoteTextFont) {
254
254
  this.postPrintQueue.push(() => {
255
255
  this.root = this.root
256
- .ele("style", { name: "TextAppearance.AppCompat.Small" })
257
- .ele("item", { name: "android:textSize" })
256
+ .ele('style', { name: 'TextAppearance.AppCompat.Small' })
257
+ .ele('item', { name: 'android:textSize' })
258
258
  // Used default value found in the Android SDK
259
- .txt("@dimen/abc_text_size_small_material")
259
+ .txt('@dimen/abc_text_size_small_material')
260
260
  .up()
261
- .ele("item", { name: "android:textColor" })
261
+ .ele('item', { name: 'android:textColor' })
262
262
  .txt(
263
263
  // Used default value found in the Android SDK
264
- this.theme.footnoteTextColor ?? "?android:attr/textColorTertiary"
264
+ this.theme.footnoteTextColor ?? '?android:attr/textColorTertiary'
265
265
  )
266
266
  .up();
267
267
 
268
268
  if (this.theme.footnoteTextFont) {
269
269
  this.root = this.root
270
- .ele("item", { name: "android:fontFamily" })
270
+ .ele('item', { name: 'android:fontFamily' })
271
271
  .txt(
272
272
  // Used default value found in the Android SDK
273
- this.theme.footnoteTextFont ?? "?android:attr/textColorTertiary"
273
+ this.theme.footnoteTextFont ?? '?android:attr/textColorTertiary'
274
274
  )
275
275
  .up();
276
276
  }
@@ -283,40 +283,40 @@ class AndroidResourcePrinter {
283
283
  if (this.theme.textFieldTextColor || this.theme.textFieldTextFont) {
284
284
  this.printQueue.push(() => {
285
285
  this.root = this.root
286
- .ele("item", { name: "editTextStyle" })
287
- .txt("@style/RN.Persona.EditText")
286
+ .ele('item', { name: 'editTextStyle' })
287
+ .txt('@style/RN.Persona.EditText')
288
288
  .up();
289
289
  });
290
290
 
291
291
  this.postPrintQueue.push(() => {
292
292
  this.root = this.root
293
- .ele("style", {
294
- name: "RN.Persona.EditText",
295
- parent: "Widget.AppCompat.EditText",
293
+ .ele('style', {
294
+ name: 'RN.Persona.EditText',
295
+ parent: 'Persona.Inquiry2.EditText',
296
296
  })
297
- .ele("item", { name: "android:textAppearance" })
298
- .txt("@style/RN.Persona.EditText.TextAppearance")
297
+ .ele('item', { name: 'android:textAppearance' })
298
+ .txt('@style/RN.Persona.EditText.TextAppearance')
299
299
  .up()
300
- .ele("item", { name: "android:textColor" })
300
+ .ele('item', { name: 'android:textColor' })
301
301
  .txt(this.theme.textFieldTextColor as string)
302
302
  .up()
303
303
  .up();
304
304
 
305
- this.root = this.root.ele("style", {
306
- name: "RN.Persona.EditText.TextAppearance",
307
- parent: "Base.TextAppearance.AppCompat.Medium",
305
+ this.root = this.root.ele('style', {
306
+ name: 'RN.Persona.EditText.TextAppearance',
307
+ parent: 'Base.TextAppearance.TextAppearance.MaterialComponents.Body1',
308
308
  });
309
309
 
310
310
  if (this.theme.textFieldTextColor) {
311
311
  this.root = this.root
312
- .ele("item", { name: "android:textSize" })
313
- .txt("18sp")
312
+ .ele('item', { name: 'android:textSize' })
313
+ .txt('18sp')
314
314
  .up();
315
315
  }
316
316
 
317
317
  if (this.theme.textFieldTextFont) {
318
318
  this.root = this.root
319
- .ele("item", { name: "android:fontFamily" })
319
+ .ele('item', { name: 'android:fontFamily' })
320
320
  .txt(this.theme.textFieldTextFont as string)
321
321
  .up();
322
322
  }
@@ -330,61 +330,61 @@ class AndroidResourcePrinter {
330
330
  if (this.theme.pickerTextColor || this.theme.pickerTextFont) {
331
331
  this.printQueue.push(() => {
332
332
  this.root = this.root
333
- .ele("item", { name: "spinnerStyle" })
334
- .txt("@style/RN.Persona.Spinner")
333
+ .ele('item', { name: 'spinnerStyle' })
334
+ .txt('@style/RN.Persona.Spinner')
335
335
  .up();
336
336
 
337
337
  this.root = this.root
338
- .ele("item", { name: "spinnerDropDownItemStyle" })
339
- .txt("@style/RN.Persona.DropDownItem.Spinner")
338
+ .ele('item', { name: 'spinnerDropDownItemStyle' })
339
+ .txt('@style/RN.Persona.DropDownItem.Spinner')
340
340
  .up();
341
341
  });
342
342
 
343
343
  this.postPrintQueue.push(() => {
344
344
  // Build Rn.Persona.Spinner
345
345
  this.root = this.root
346
- .ele("style", {
347
- name: "RN.Persona.Spinner",
348
- parent: "Widget.AppCompat.Spinner",
346
+ .ele('style', {
347
+ name: 'RN.Persona.Spinner',
348
+ parent: 'Persona.Inquiry2.Spinner',
349
349
  })
350
- .ele("item", { name: "android:textColor" })
351
- .txt(this.theme.pickerTextColor ?? "?android:attr/textColorPrimary")
350
+ .ele('item', { name: 'android:textColor' })
351
+ .txt(this.theme.pickerTextColor ?? '?android:attr/textColorPrimary')
352
352
  .up()
353
- .ele("item", { name: "android:textAppearance" })
353
+ .ele('item', { name: 'android:textAppearance' })
354
354
  .txt(
355
355
  this.theme.pickerTextFont
356
- ? "@style/RN.Persona.Text.Spinner"
357
- : "@style/Persona.Text.Body"
356
+ ? '@style/RN.Persona.Text.Spinner'
357
+ : '@style/Persona.Inquiry2.Text.Body'
358
358
  )
359
359
  .up()
360
360
  .up();
361
361
 
362
362
  // Build RN.Persona.DropDownItem.Spinner
363
363
  this.root = this.root
364
- .ele("style", {
365
- name: "RN.Persona.DropDownItem.Spinner",
366
- parent: "Widget.AppCompat.DropDownItem.Spinner",
364
+ .ele('style', {
365
+ name: 'RN.Persona.DropDownItem.Spinner',
366
+ parent: 'Persona.Inquiry2.Spinner',
367
367
  })
368
- .ele("item", { name: "android:textColor" })
369
- .txt(this.theme.pickerTextColor ?? "?android:attr/textColorPrimary")
368
+ .ele('item', { name: 'android:textColor' })
369
+ .txt(this.theme.pickerTextColor ?? '?android:attr/textColorPrimary')
370
370
  .up()
371
- .ele("item", { name: "android:textAppearance" })
371
+ .ele('item', { name: 'android:textAppearance' })
372
372
  .txt(
373
373
  this.theme.pickerTextFont
374
- ? "@style/RN.Persona.Text.Spinner"
375
- : "@style/Persona.Text.Body"
374
+ ? '@style/RN.Persona.Text.Spinner'
375
+ : '@style/Persona.Inquiry2.Text.Body'
376
376
  )
377
377
  .up()
378
378
  .up();
379
379
 
380
380
  // Build RN.Persona.Text.Spinner
381
- this.root = this.root.ele("style", {
382
- name: "RN.Persona.Text.Spinner",
381
+ this.root = this.root.ele('style', {
382
+ name: 'RN.Persona.Text.Spinner',
383
383
  });
384
384
 
385
385
  if (this.theme.pickerTextColor) {
386
386
  this.root = this.root
387
- .ele("item", { name: "android:textColor" })
387
+ .ele('item', { name: 'android:textColor' })
388
388
  .txt(this.theme.pickerTextColor as string)
389
389
  .up();
390
390
  }
@@ -393,7 +393,7 @@ class AndroidResourcePrinter {
393
393
  // TODO: Add notice about how to add a custom font that can be
394
394
  // referenced here on Android
395
395
  this.root = this.root
396
- .ele("item", { name: "android:fontFamily" })
396
+ .ele('item', { name: 'android:fontFamily' })
397
397
  .txt(this.theme.pickerTextFont as string)
398
398
  .up();
399
399
  }
@@ -415,73 +415,73 @@ class AndroidResourcePrinter {
415
415
  ) {
416
416
  this.printQueue.push(() => {
417
417
  this.root = this.root
418
- .ele("item", { name: "buttonStyle" })
419
- .txt("@style/RN.Persona.Button")
418
+ .ele('item', { name: 'buttonStyle' })
419
+ .txt('@style/RN.Persona.Button')
420
420
  .up();
421
421
  });
422
422
 
423
423
  this.postPrintQueue.push(() => {
424
424
  this.root = this.root
425
- .ele("style", {
426
- name: "RN.Persona.Button",
427
- parent: "android:style/Widget.Button",
425
+ .ele('style', {
426
+ name: 'RN.Persona.Button',
427
+ parent: 'Persona.Inquiry2.Button',
428
428
  })
429
429
  // Taken from
430
430
  // appcompat's res/values/values.xml
431
- .ele("item", {
432
- name: "android:minHeight",
431
+ .ele('item', {
432
+ name: 'android:minHeight',
433
433
  })
434
- .txt("48dip")
434
+ .txt('48dip')
435
435
  .up()
436
436
  // Taken from
437
437
  // appcompat's res/values/values.xml
438
- .ele("item", {
439
- name: "android:minWidth",
438
+ .ele('item', {
439
+ name: 'android:minWidth',
440
440
  })
441
- .txt("88dip")
441
+ .txt('88dip')
442
442
  .up()
443
443
  // Taken from
444
444
  // persona-android's shared/src/main/res/values/styles.xml
445
- .ele("item", {
446
- name: "android:textSize",
445
+ .ele('item', {
446
+ name: 'android:textSize',
447
447
  })
448
- .txt("18sp")
448
+ .txt('18sp')
449
449
  .up()
450
- .ele("item", {
451
- name: "android:background",
450
+ .ele('item', {
451
+ name: 'android:background',
452
452
  })
453
- .txt("@drawable/rn_persona_button")
453
+ .txt('@drawable/rn_persona_button')
454
454
  .up()
455
- .ele("item", {
456
- name: "android:textColor",
455
+ .ele('item', {
456
+ name: 'android:textColor',
457
457
  })
458
- .txt("@color/rn_persona_button")
458
+ .txt('@color/rn_persona_button')
459
459
  .up()
460
460
  .up();
461
461
 
462
462
  // Disabled
463
463
  this.buttonDrawable = this.buttonDrawable
464
- .ele("item", {
465
- "android:state_enabled": "false",
464
+ .ele('item', {
465
+ 'android:state_enabled': 'false',
466
466
  })
467
- .ele("shape", { "android:shape": "rectangle" })
468
- .ele("corners", {
469
- "android:radius": this.theme.buttonCornerRadius
467
+ .ele('shape', { 'android:shape': 'rectangle' })
468
+ .ele('corners', {
469
+ 'android:radius': this.theme.buttonCornerRadius
470
470
  ? `${this.theme.buttonCornerRadius}dp`
471
- : "@dimen/abc_control_corner_material",
471
+ : '@dimen/abc_control_corner_material',
472
472
  })
473
473
  .up()
474
- .ele("padding", {
475
- "android:left": "@dimen/abc_button_padding_horizontal_material",
476
- "android:top": "@dimen/abc_button_padding_vertical_material",
477
- "android:right": "@dimen/abc_button_padding_horizontal_material",
478
- "android:bottom": "@dimen/abc_button_padding_vertical_material",
474
+ .ele('padding', {
475
+ 'android:left': '@dimen/abc_button_padding_horizontal_material',
476
+ 'android:top': '@dimen/abc_button_padding_vertical_material',
477
+ 'android:right': '@dimen/abc_button_padding_horizontal_material',
478
+ 'android:bottom': '@dimen/abc_button_padding_vertical_material',
479
479
  })
480
480
  .up()
481
- .ele("solid", {
482
- "android:color": this.theme.buttonDisabledBackgroundColor
481
+ .ele('solid', {
482
+ 'android:color': this.theme.buttonDisabledBackgroundColor
483
483
  ? this.theme.buttonDisabledBackgroundColor
484
- : "?attr/colorPrimaryDark",
484
+ : '?attr/colorPrimaryVariant',
485
485
  })
486
486
  .up()
487
487
  .up()
@@ -489,51 +489,51 @@ class AndroidResourcePrinter {
489
489
 
490
490
  // touched
491
491
  this.buttonDrawable = this.buttonDrawable
492
- .ele("item", {
493
- "android:state_pressed": "true",
492
+ .ele('item', {
493
+ 'android:state_pressed': 'true',
494
494
  })
495
- .ele("shape", { "android:shape": "rectangle" })
496
- .ele("corners", {
497
- "android:radius": this.theme.buttonCornerRadius
495
+ .ele('shape', { 'android:shape': 'rectangle' })
496
+ .ele('corners', {
497
+ 'android:radius': this.theme.buttonCornerRadius
498
498
  ? `${this.theme.buttonCornerRadius}dp`
499
- : "@dimen/abc_control_corner_material",
499
+ : '@dimen/abc_control_corner_material',
500
500
  })
501
501
  .up()
502
- .ele("solid", {
503
- "android:color":
502
+ .ele('solid', {
503
+ 'android:color':
504
504
  this.theme.buttonTouchedBackgroundColor ??
505
- "?attr/colorPrimaryDark",
505
+ '?attr/colorPrimaryVariant',
506
506
  })
507
507
  .up()
508
- .ele("padding", {
509
- "android:left": "@dimen/abc_button_padding_horizontal_material",
510
- "android:top": "@dimen/abc_button_padding_vertical_material",
511
- "android:right": "@dimen/abc_button_padding_horizontal_material",
512
- "android:bottom": "@dimen/abc_button_padding_vertical_material",
508
+ .ele('padding', {
509
+ 'android:left': '@dimen/abc_button_padding_horizontal_material',
510
+ 'android:top': '@dimen/abc_button_padding_vertical_material',
511
+ 'android:right': '@dimen/abc_button_padding_horizontal_material',
512
+ 'android:bottom': '@dimen/abc_button_padding_vertical_material',
513
513
  })
514
514
  .up()
515
515
  .up()
516
516
  .up();
517
517
 
518
518
  this.buttonDrawable = this.buttonDrawable
519
- .ele("item")
520
- .ele("shape", { "android:shape": "rectangle" })
521
- .ele("corners", {
522
- "android:radius": this.theme.buttonCornerRadius
519
+ .ele('item')
520
+ .ele('shape', { 'android:shape': 'rectangle' })
521
+ .ele('corners', {
522
+ 'android:radius': this.theme.buttonCornerRadius
523
523
  ? `${this.theme.buttonCornerRadius}dp`
524
- : "@dimen/abc_control_corner_material",
524
+ : '@dimen/abc_control_corner_material',
525
525
  })
526
526
  .up()
527
- .ele("solid", {
528
- "android:color":
529
- this.theme.buttonBackgroundColor ?? "?attr/colorPrimary",
527
+ .ele('solid', {
528
+ 'android:color':
529
+ this.theme.buttonBackgroundColor ?? '?attr/colorPrimary',
530
530
  })
531
531
  .up()
532
- .ele("padding", {
533
- "android:left": "@dimen/abc_button_padding_horizontal_material",
534
- "android:top": "@dimen/abc_button_padding_vertical_material",
535
- "android:right": "@dimen/abc_button_padding_horizontal_material",
536
- "android:bottom": "@dimen/abc_button_padding_vertical_material",
532
+ .ele('padding', {
533
+ 'android:left': '@dimen/abc_button_padding_horizontal_material',
534
+ 'android:top': '@dimen/abc_button_padding_vertical_material',
535
+ 'android:right': '@dimen/abc_button_padding_horizontal_material',
536
+ 'android:bottom': '@dimen/abc_button_padding_vertical_material',
537
537
  })
538
538
  .up()
539
539
  .up()
@@ -543,22 +543,22 @@ class AndroidResourcePrinter {
543
543
  this.buttonDrawable = this.buttonDrawable.up();
544
544
 
545
545
  this.buttonColor = this.buttonColor
546
- .ele("item", {
547
- "android:state_enabled": "false",
548
- "android:color":
546
+ .ele('item', {
547
+ 'android:state_enabled': 'false',
548
+ 'android:color':
549
549
  this.theme.buttonDisabledTextColor ??
550
- "@android:color/darker_gray",
550
+ '@android:color/darker_gray',
551
551
  })
552
552
  .up()
553
- .ele("item", {
554
- "android:state_pressed": "true",
555
- "android:color":
556
- this.theme.buttonTextColor ?? "@android:color/white",
553
+ .ele('item', {
554
+ 'android:state_pressed': 'true',
555
+ 'android:color':
556
+ this.theme.buttonTextColor ?? '@android:color/white',
557
557
  })
558
558
  .up()
559
- .ele("item", {
560
- "android:color":
561
- this.theme.buttonTextColor ?? "@android:color/white",
559
+ .ele('item', {
560
+ 'android:color':
561
+ this.theme.buttonTextColor ?? '@android:color/white',
562
562
  })
563
563
  .up();
564
564
 
@@ -573,7 +573,7 @@ class AndroidResourcePrinter {
573
573
  if (this.theme.progressColor) {
574
574
  this.printQueue.push(() => {
575
575
  this.root = this.root
576
- .ele("item", { name: "colorControlActivated" })
576
+ .ele('item', { name: 'colorControlActivated' })
577
577
  .txt(this.theme.progressColor as string)
578
578
  .up();
579
579
  });
@@ -585,10 +585,10 @@ class AndroidResourcePrinter {
585
585
 
586
586
  this.printQueue.push(() => {
587
587
  this.root = this.root
588
- .ele("item", { name: "personaInquiryCompleteImage" })
588
+ .ele('item', { name: 'personaInquiryCompleteImage' })
589
589
  .txt(this.theme.successAsset as string)
590
590
  .up()
591
- .txt(" ");
591
+ .txt(' ');
592
592
  });
593
593
  }
594
594
 
@@ -597,10 +597,10 @@ class AndroidResourcePrinter {
597
597
 
598
598
  this.printQueue.push(() => {
599
599
  this.root = this.root
600
- .ele("item", { name: "personaInquiryFailImage" })
600
+ .ele('item', { name: 'personaInquiryFailImage' })
601
601
  .txt(this.theme.failAsset as string)
602
602
  .up()
603
- .txt(" ");
603
+ .txt(' ');
604
604
  });
605
605
  }
606
606
 
@@ -613,16 +613,16 @@ class AndroidResourcePrinter {
613
613
 
614
614
  this.printQueue.push(() => {
615
615
  this.root = this.root
616
- .ele("item", { name: "personaInquiryLoadingLottieRaw" })
616
+ .ele('item', { name: 'personaInquiryLoadingLottieRaw' })
617
617
  .txt(this.theme.loadingAnimationAsset as string)
618
618
  .up()
619
- .txt(" ");
619
+ .txt(' ');
620
620
 
621
621
  this.root = this.root
622
- .ele("item", { name: "personaInquiryLoadingLottieWidthPercent" })
622
+ .ele('item', { name: 'personaInquiryLoadingLottieWidthPercent' })
623
623
  .txt(this.theme.loadingAnimationWidthPercent as string)
624
624
  .up()
625
- .txt(" ");
625
+ .txt(' ');
626
626
  });
627
627
  }
628
628
 
@@ -635,16 +635,16 @@ class AndroidResourcePrinter {
635
635
 
636
636
  this.printQueue.push(() => {
637
637
  this.root = this.root
638
- .ele("item", { name: "personaInquirySelfieLottieRaw" })
638
+ .ele('item', { name: 'personaInquirySelfieLottieRaw' })
639
639
  .txt(this.theme.selfieAnimationAsset as string)
640
640
  .up()
641
- .txt(" ");
641
+ .txt(' ');
642
642
 
643
643
  this.root = this.root
644
- .ele("item", { name: "personaInquirySelfieLottieWidthPercent" })
644
+ .ele('item', { name: 'personaInquirySelfieLottieWidthPercent' })
645
645
  .txt(this.theme.selfieAnimationWidthPercent as string)
646
646
  .up()
647
- .txt(" ");
647
+ .txt(' ');
648
648
  });
649
649
  }
650
650
  }