@terreno/ui 0.7.2 → 0.8.1

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 (82) hide show
  1. package/dist/BooleanField.js +23 -23
  2. package/dist/BooleanField.js.map +1 -1
  3. package/dist/ConsentFormScreen.d.ts +14 -0
  4. package/dist/ConsentFormScreen.js +93 -0
  5. package/dist/ConsentFormScreen.js.map +1 -0
  6. package/dist/ConsentHistory.d.ts +8 -0
  7. package/dist/ConsentHistory.js +70 -0
  8. package/dist/ConsentHistory.js.map +1 -0
  9. package/dist/ConsentNavigator.d.ts +9 -0
  10. package/dist/ConsentNavigator.js +72 -0
  11. package/dist/ConsentNavigator.js.map +1 -0
  12. package/dist/DataTable.js +1 -1
  13. package/dist/DataTable.js.map +1 -1
  14. package/dist/DateTimeActionSheet.js +22 -6
  15. package/dist/DateTimeActionSheet.js.map +1 -1
  16. package/dist/DateTimeField.d.ts +22 -0
  17. package/dist/DateTimeField.js +187 -67
  18. package/dist/DateTimeField.js.map +1 -1
  19. package/dist/DraggableList.d.ts +66 -0
  20. package/dist/DraggableList.js +241 -0
  21. package/dist/DraggableList.js.map +1 -0
  22. package/dist/Link.js +1 -1
  23. package/dist/Link.js.map +1 -1
  24. package/dist/MarkdownEditor.d.ts +12 -0
  25. package/dist/MarkdownEditor.js +12 -0
  26. package/dist/MarkdownEditor.js.map +1 -0
  27. package/dist/MarkdownEditorField.d.ts +1 -0
  28. package/dist/MarkdownEditorField.js +16 -16
  29. package/dist/MarkdownEditorField.js.map +1 -1
  30. package/dist/Modal.js +11 -1
  31. package/dist/Modal.js.map +1 -1
  32. package/dist/PickerSelect.js +10 -0
  33. package/dist/PickerSelect.js.map +1 -1
  34. package/dist/TerrenoProvider.js +10 -1
  35. package/dist/TerrenoProvider.js.map +1 -1
  36. package/dist/UpgradeRequiredScreen.d.ts +8 -0
  37. package/dist/UpgradeRequiredScreen.js +10 -0
  38. package/dist/UpgradeRequiredScreen.js.map +1 -0
  39. package/dist/generateConsentHistoryPdf.d.ts +2 -0
  40. package/dist/generateConsentHistoryPdf.js +185 -0
  41. package/dist/generateConsentHistoryPdf.js.map +1 -0
  42. package/dist/index.d.ts +9 -0
  43. package/dist/index.js +9 -0
  44. package/dist/index.js.map +1 -1
  45. package/dist/useConsentForms.d.ts +29 -0
  46. package/dist/useConsentForms.js +50 -0
  47. package/dist/useConsentForms.js.map +1 -0
  48. package/dist/useConsentHistory.d.ts +31 -0
  49. package/dist/useConsentHistory.js +17 -0
  50. package/dist/useConsentHistory.js.map +1 -0
  51. package/dist/useSubmitConsent.d.ts +12 -0
  52. package/dist/useSubmitConsent.js +23 -0
  53. package/dist/useSubmitConsent.js.map +1 -0
  54. package/package.json +4 -2
  55. package/src/BooleanField.test.tsx +3 -5
  56. package/src/BooleanField.tsx +33 -31
  57. package/src/ConsentFormScreen.tsx +216 -0
  58. package/src/ConsentHistory.tsx +249 -0
  59. package/src/ConsentNavigator.test.tsx +111 -0
  60. package/src/ConsentNavigator.tsx +128 -0
  61. package/src/DataTable.tsx +1 -1
  62. package/src/DateTimeActionSheet.tsx +19 -6
  63. package/src/DateTimeField.tsx +416 -133
  64. package/src/DraggableList.tsx +424 -0
  65. package/src/Link.tsx +1 -1
  66. package/src/MarkdownEditor.tsx +66 -0
  67. package/src/MarkdownEditorField.tsx +32 -28
  68. package/src/Modal.tsx +19 -1
  69. package/src/PickerSelect.tsx +11 -0
  70. package/src/TerrenoProvider.tsx +10 -1
  71. package/src/TimezonePicker.test.tsx +9 -1
  72. package/src/UpgradeRequiredScreen.tsx +52 -0
  73. package/src/__snapshots__/BooleanField.test.tsx.snap +167 -203
  74. package/src/__snapshots__/DataTable.test.tsx.snap +0 -114
  75. package/src/__snapshots__/Field.test.tsx.snap +53 -69
  76. package/src/__snapshots__/Link.test.tsx.snap +14 -21
  77. package/src/__snapshots__/TimezonePicker.test.tsx.snap +0 -4710
  78. package/src/generateConsentHistoryPdf.ts +211 -0
  79. package/src/index.tsx +9 -1
  80. package/src/useConsentForms.ts +70 -0
  81. package/src/useConsentHistory.ts +40 -0
  82. package/src/useSubmitConsent.ts +35 -0
@@ -0,0 +1,52 @@
1
+ import React from "react";
2
+
3
+ import {Box} from "./Box";
4
+ import {Button} from "./Button";
5
+ import {Heading} from "./Heading";
6
+ import {Icon} from "./Icon";
7
+ import {Text} from "./Text";
8
+
9
+ interface UpgradeRequiredScreenProps {
10
+ canUpdate?: boolean;
11
+ message: string;
12
+ onUpdate: () => void;
13
+ }
14
+
15
+ export const UpgradeRequiredScreen: React.FC<UpgradeRequiredScreenProps> = ({
16
+ canUpdate = true,
17
+ message,
18
+ onUpdate,
19
+ }) => {
20
+ return (
21
+ <Box
22
+ alignItems="center"
23
+ color="base"
24
+ direction="column"
25
+ display="flex"
26
+ flex="grow"
27
+ height="100%"
28
+ justifyContent="center"
29
+ padding={6}
30
+ width="100%"
31
+ >
32
+ <Box alignItems="center" direction="column" display="flex" gap={4} maxWidth={400}>
33
+ <Icon color="warning" iconName="triangle-exclamation" size="2xl" />
34
+ <Heading align="center" size="lg">
35
+ Update Required
36
+ </Heading>
37
+ <Text align="center" color="secondaryDark" size="lg">
38
+ {message}
39
+ </Text>
40
+ {canUpdate ? (
41
+ <Box marginTop={2} width="100%">
42
+ <Button fullWidth onClick={onUpdate} text="Update" variant="primary" />
43
+ </Box>
44
+ ) : (
45
+ <Text align="center" color="secondaryDark" size="md">
46
+ Please contact support or check your app store for an update.
47
+ </Text>
48
+ )}
49
+ </Box>
50
+ </Box>
51
+ );
52
+ };
@@ -18,49 +18,17 @@ exports[`BooleanField renders correctly with default props 1`] = `
18
18
  "children": [
19
19
  {
20
20
  "$$typeof": Symbol(react.test.json),
21
- "children": [
22
- {
23
- "$$typeof": Symbol(react.test.json),
24
- "children": null,
25
- "props": {
26
- "style": {
27
- "alignItems": "center",
28
- "backgroundColor": "#FFFFFF",
29
- "borderColor": "#2B6072",
30
- "borderRadius": 10,
31
- "borderWidth": 1,
32
- "height": 20,
33
- "justifyContent": "center",
34
- "width": 20,
35
- },
36
- "testID": undefined,
37
- },
38
- "type": "View",
39
- },
40
- ],
21
+ "children": null,
41
22
  "props": {
42
23
  "style": {
43
24
  "alignItems": "center",
44
- "flex": 1,
45
- "flexDirection": "row",
25
+ "backgroundColor": "#FFFFFF",
26
+ "borderColor": "#2B6072",
27
+ "borderRadius": 10,
28
+ "borderWidth": 1,
29
+ "height": 20,
46
30
  "justifyContent": "center",
47
- "left": Value {
48
- "_value": -10,
49
- "addListener": [class Function],
50
- "animate": [class Function],
51
- "extractOffset": [class Function],
52
- "flattenOffset": [class Function],
53
- "interpolate": [class Function],
54
- "removeAllListeners": [class Function],
55
- "removeListener": [class Function],
56
- "resetAnimation": [class Function],
57
- "setOffset": [class Function],
58
- "setValue": [class Function],
59
- "stopAnimation": [class Function],
60
- "stopTracking": [class Function],
61
- "track": [class Function],
62
- },
63
- "width": 36,
31
+ "width": 20,
64
32
  },
65
33
  "testID": undefined,
66
34
  },
@@ -69,8 +37,12 @@ exports[`BooleanField renders correctly with default props 1`] = `
69
37
  ],
70
38
  "props": {
71
39
  "style": {
72
- "backgroundColor": Value {
73
- "_value": 0,
40
+ "alignItems": "center",
41
+ "flex": 1,
42
+ "flexDirection": "row",
43
+ "justifyContent": "center",
44
+ "left": Value {
45
+ "_value": -10,
74
46
  "addListener": [class Function],
75
47
  "animate": [class Function],
76
48
  "extractOffset": [class Function],
@@ -85,12 +57,6 @@ exports[`BooleanField renders correctly with default props 1`] = `
85
57
  "stopTracking": [class Function],
86
58
  "track": [class Function],
87
59
  },
88
- "borderColor": "#2B6072",
89
- "borderRadius": 20,
90
- "borderWidth": 1,
91
- "height": 20,
92
- "marginHorizontal": 10,
93
- "marginRight": undefined,
94
60
  "width": 36,
95
61
  },
96
62
  "testID": undefined,
@@ -100,9 +66,29 @@ exports[`BooleanField renders correctly with default props 1`] = `
100
66
  ],
101
67
  "props": {
102
68
  "style": {
103
- "alignItems": "center",
104
- "flexDirection": "row",
105
- "justifyContent": "center",
69
+ "backgroundColor": Value {
70
+ "_value": 0,
71
+ "addListener": [class Function],
72
+ "animate": [class Function],
73
+ "extractOffset": [class Function],
74
+ "flattenOffset": [class Function],
75
+ "interpolate": [class Function],
76
+ "removeAllListeners": [class Function],
77
+ "removeListener": [class Function],
78
+ "resetAnimation": [class Function],
79
+ "setOffset": [class Function],
80
+ "setValue": [class Function],
81
+ "stopAnimation": [class Function],
82
+ "stopTracking": [class Function],
83
+ "track": [class Function],
84
+ },
85
+ "borderColor": "#2B6072",
86
+ "borderRadius": 20,
87
+ "borderWidth": 1,
88
+ "height": 20,
89
+ "marginHorizontal": 10,
90
+ "marginRight": undefined,
91
+ "width": 36,
106
92
  },
107
93
  "testID": undefined,
108
94
  },
@@ -112,8 +98,13 @@ exports[`BooleanField renders correctly with default props 1`] = `
112
98
  "props": {
113
99
  "aria-role": "button",
114
100
  "onPress": [Function],
101
+ "style": {
102
+ "alignItems": "center",
103
+ "flexDirection": "row",
104
+ "justifyContent": "center",
105
+ },
115
106
  },
116
- "type": "TouchableWithoutFeedback",
107
+ "type": "Pressable",
117
108
  },
118
109
  ],
119
110
  "props": {
@@ -171,49 +162,17 @@ exports[`BooleanField renders with title 1`] = `
171
162
  "children": [
172
163
  {
173
164
  "$$typeof": Symbol(react.test.json),
174
- "children": [
175
- {
176
- "$$typeof": Symbol(react.test.json),
177
- "children": null,
178
- "props": {
179
- "style": {
180
- "alignItems": "center",
181
- "backgroundColor": "#FFFFFF",
182
- "borderColor": "#2B6072",
183
- "borderRadius": 10,
184
- "borderWidth": 1,
185
- "height": 20,
186
- "justifyContent": "center",
187
- "width": 20,
188
- },
189
- "testID": undefined,
190
- },
191
- "type": "View",
192
- },
193
- ],
165
+ "children": null,
194
166
  "props": {
195
167
  "style": {
196
168
  "alignItems": "center",
197
- "flex": 1,
198
- "flexDirection": "row",
169
+ "backgroundColor": "#FFFFFF",
170
+ "borderColor": "#2B6072",
171
+ "borderRadius": 10,
172
+ "borderWidth": 1,
173
+ "height": 20,
199
174
  "justifyContent": "center",
200
- "left": Value {
201
- "_value": -10,
202
- "addListener": [class Function],
203
- "animate": [class Function],
204
- "extractOffset": [class Function],
205
- "flattenOffset": [class Function],
206
- "interpolate": [class Function],
207
- "removeAllListeners": [class Function],
208
- "removeListener": [class Function],
209
- "resetAnimation": [class Function],
210
- "setOffset": [class Function],
211
- "setValue": [class Function],
212
- "stopAnimation": [class Function],
213
- "stopTracking": [class Function],
214
- "track": [class Function],
215
- },
216
- "width": 36,
175
+ "width": 20,
217
176
  },
218
177
  "testID": undefined,
219
178
  },
@@ -222,8 +181,12 @@ exports[`BooleanField renders with title 1`] = `
222
181
  ],
223
182
  "props": {
224
183
  "style": {
225
- "backgroundColor": Value {
226
- "_value": 0,
184
+ "alignItems": "center",
185
+ "flex": 1,
186
+ "flexDirection": "row",
187
+ "justifyContent": "center",
188
+ "left": Value {
189
+ "_value": -10,
227
190
  "addListener": [class Function],
228
191
  "animate": [class Function],
229
192
  "extractOffset": [class Function],
@@ -238,12 +201,6 @@ exports[`BooleanField renders with title 1`] = `
238
201
  "stopTracking": [class Function],
239
202
  "track": [class Function],
240
203
  },
241
- "borderColor": "#2B6072",
242
- "borderRadius": 20,
243
- "borderWidth": 1,
244
- "height": 20,
245
- "marginHorizontal": 10,
246
- "marginRight": undefined,
247
204
  "width": 36,
248
205
  },
249
206
  "testID": undefined,
@@ -253,9 +210,29 @@ exports[`BooleanField renders with title 1`] = `
253
210
  ],
254
211
  "props": {
255
212
  "style": {
256
- "alignItems": "center",
257
- "flexDirection": "row",
258
- "justifyContent": "center",
213
+ "backgroundColor": Value {
214
+ "_value": 0,
215
+ "addListener": [class Function],
216
+ "animate": [class Function],
217
+ "extractOffset": [class Function],
218
+ "flattenOffset": [class Function],
219
+ "interpolate": [class Function],
220
+ "removeAllListeners": [class Function],
221
+ "removeListener": [class Function],
222
+ "resetAnimation": [class Function],
223
+ "setOffset": [class Function],
224
+ "setValue": [class Function],
225
+ "stopAnimation": [class Function],
226
+ "stopTracking": [class Function],
227
+ "track": [class Function],
228
+ },
229
+ "borderColor": "#2B6072",
230
+ "borderRadius": 20,
231
+ "borderWidth": 1,
232
+ "height": 20,
233
+ "marginHorizontal": 10,
234
+ "marginRight": undefined,
235
+ "width": 36,
259
236
  },
260
237
  "testID": undefined,
261
238
  },
@@ -265,8 +242,13 @@ exports[`BooleanField renders with title 1`] = `
265
242
  "props": {
266
243
  "aria-role": "button",
267
244
  "onPress": [Function],
245
+ "style": {
246
+ "alignItems": "center",
247
+ "flexDirection": "row",
248
+ "justifyContent": "center",
249
+ },
268
250
  },
269
- "type": "TouchableWithoutFeedback",
251
+ "type": "Pressable",
270
252
  },
271
253
  ],
272
254
  "props": {
@@ -309,49 +291,17 @@ exports[`BooleanField renders with value true 1`] = `
309
291
  "children": [
310
292
  {
311
293
  "$$typeof": Symbol(react.test.json),
312
- "children": [
313
- {
314
- "$$typeof": Symbol(react.test.json),
315
- "children": null,
316
- "props": {
317
- "style": {
318
- "alignItems": "center",
319
- "backgroundColor": "#FFFFFF",
320
- "borderColor": "#2B6072",
321
- "borderRadius": 10,
322
- "borderWidth": 1,
323
- "height": 20,
324
- "justifyContent": "center",
325
- "width": 20,
326
- },
327
- "testID": undefined,
328
- },
329
- "type": "View",
330
- },
331
- ],
294
+ "children": null,
332
295
  "props": {
333
296
  "style": {
334
297
  "alignItems": "center",
335
- "flex": 1,
336
- "flexDirection": "row",
298
+ "backgroundColor": "#FFFFFF",
299
+ "borderColor": "#2B6072",
300
+ "borderRadius": 10,
301
+ "borderWidth": 1,
302
+ "height": 20,
337
303
  "justifyContent": "center",
338
- "left": Value {
339
- "_value": 10,
340
- "addListener": [class Function],
341
- "animate": [class Function],
342
- "extractOffset": [class Function],
343
- "flattenOffset": [class Function],
344
- "interpolate": [class Function],
345
- "removeAllListeners": [class Function],
346
- "removeListener": [class Function],
347
- "resetAnimation": [class Function],
348
- "setOffset": [class Function],
349
- "setValue": [class Function],
350
- "stopAnimation": [class Function],
351
- "stopTracking": [class Function],
352
- "track": [class Function],
353
- },
354
- "width": 36,
304
+ "width": 20,
355
305
  },
356
306
  "testID": undefined,
357
307
  },
@@ -360,8 +310,12 @@ exports[`BooleanField renders with value true 1`] = `
360
310
  ],
361
311
  "props": {
362
312
  "style": {
363
- "backgroundColor": Value {
364
- "_value": 0,
313
+ "alignItems": "center",
314
+ "flex": 1,
315
+ "flexDirection": "row",
316
+ "justifyContent": "center",
317
+ "left": Value {
318
+ "_value": 10,
365
319
  "addListener": [class Function],
366
320
  "animate": [class Function],
367
321
  "extractOffset": [class Function],
@@ -376,12 +330,6 @@ exports[`BooleanField renders with value true 1`] = `
376
330
  "stopTracking": [class Function],
377
331
  "track": [class Function],
378
332
  },
379
- "borderColor": "#2B6072",
380
- "borderRadius": 20,
381
- "borderWidth": 1,
382
- "height": 20,
383
- "marginHorizontal": 10,
384
- "marginRight": undefined,
385
333
  "width": 36,
386
334
  },
387
335
  "testID": undefined,
@@ -391,9 +339,29 @@ exports[`BooleanField renders with value true 1`] = `
391
339
  ],
392
340
  "props": {
393
341
  "style": {
394
- "alignItems": "center",
395
- "flexDirection": "row",
396
- "justifyContent": "center",
342
+ "backgroundColor": Value {
343
+ "_value": 0,
344
+ "addListener": [class Function],
345
+ "animate": [class Function],
346
+ "extractOffset": [class Function],
347
+ "flattenOffset": [class Function],
348
+ "interpolate": [class Function],
349
+ "removeAllListeners": [class Function],
350
+ "removeListener": [class Function],
351
+ "resetAnimation": [class Function],
352
+ "setOffset": [class Function],
353
+ "setValue": [class Function],
354
+ "stopAnimation": [class Function],
355
+ "stopTracking": [class Function],
356
+ "track": [class Function],
357
+ },
358
+ "borderColor": "#2B6072",
359
+ "borderRadius": 20,
360
+ "borderWidth": 1,
361
+ "height": 20,
362
+ "marginHorizontal": 10,
363
+ "marginRight": undefined,
364
+ "width": 36,
397
365
  },
398
366
  "testID": undefined,
399
367
  },
@@ -403,8 +371,13 @@ exports[`BooleanField renders with value true 1`] = `
403
371
  "props": {
404
372
  "aria-role": "button",
405
373
  "onPress": [Function],
374
+ "style": {
375
+ "alignItems": "center",
376
+ "flexDirection": "row",
377
+ "justifyContent": "center",
378
+ },
406
379
  },
407
- "type": "TouchableWithoutFeedback",
380
+ "type": "Pressable",
408
381
  },
409
382
  ],
410
383
  "props": {
@@ -447,49 +420,17 @@ exports[`BooleanField renders disabled state 1`] = `
447
420
  "children": [
448
421
  {
449
422
  "$$typeof": Symbol(react.test.json),
450
- "children": [
451
- {
452
- "$$typeof": Symbol(react.test.json),
453
- "children": null,
454
- "props": {
455
- "style": {
456
- "alignItems": "center",
457
- "backgroundColor": "#FFFFFF",
458
- "borderColor": "#9A9A9A",
459
- "borderRadius": 10,
460
- "borderWidth": 1,
461
- "height": 20,
462
- "justifyContent": "center",
463
- "width": 20,
464
- },
465
- "testID": undefined,
466
- },
467
- "type": "View",
468
- },
469
- ],
423
+ "children": null,
470
424
  "props": {
471
425
  "style": {
472
426
  "alignItems": "center",
473
- "flex": 1,
474
- "flexDirection": "row",
427
+ "backgroundColor": "#FFFFFF",
428
+ "borderColor": "#9A9A9A",
429
+ "borderRadius": 10,
430
+ "borderWidth": 1,
431
+ "height": 20,
475
432
  "justifyContent": "center",
476
- "left": Value {
477
- "_value": -10,
478
- "addListener": [class Function],
479
- "animate": [class Function],
480
- "extractOffset": [class Function],
481
- "flattenOffset": [class Function],
482
- "interpolate": [class Function],
483
- "removeAllListeners": [class Function],
484
- "removeListener": [class Function],
485
- "resetAnimation": [class Function],
486
- "setOffset": [class Function],
487
- "setValue": [class Function],
488
- "stopAnimation": [class Function],
489
- "stopTracking": [class Function],
490
- "track": [class Function],
491
- },
492
- "width": 36,
433
+ "width": 20,
493
434
  },
494
435
  "testID": undefined,
495
436
  },
@@ -498,13 +439,26 @@ exports[`BooleanField renders disabled state 1`] = `
498
439
  ],
499
440
  "props": {
500
441
  "style": {
501
- "backgroundColor": "#9A9A9A",
502
- "borderColor": "#9A9A9A",
503
- "borderRadius": 20,
504
- "borderWidth": 1,
505
- "height": 20,
506
- "marginHorizontal": 10,
507
- "marginRight": undefined,
442
+ "alignItems": "center",
443
+ "flex": 1,
444
+ "flexDirection": "row",
445
+ "justifyContent": "center",
446
+ "left": Value {
447
+ "_value": -10,
448
+ "addListener": [class Function],
449
+ "animate": [class Function],
450
+ "extractOffset": [class Function],
451
+ "flattenOffset": [class Function],
452
+ "interpolate": [class Function],
453
+ "removeAllListeners": [class Function],
454
+ "removeListener": [class Function],
455
+ "resetAnimation": [class Function],
456
+ "setOffset": [class Function],
457
+ "setValue": [class Function],
458
+ "stopAnimation": [class Function],
459
+ "stopTracking": [class Function],
460
+ "track": [class Function],
461
+ },
508
462
  "width": 36,
509
463
  },
510
464
  "testID": undefined,
@@ -514,9 +468,14 @@ exports[`BooleanField renders disabled state 1`] = `
514
468
  ],
515
469
  "props": {
516
470
  "style": {
517
- "alignItems": "center",
518
- "flexDirection": "row",
519
- "justifyContent": "center",
471
+ "backgroundColor": "#9A9A9A",
472
+ "borderColor": "#9A9A9A",
473
+ "borderRadius": 20,
474
+ "borderWidth": 1,
475
+ "height": 20,
476
+ "marginHorizontal": 10,
477
+ "marginRight": undefined,
478
+ "width": 36,
520
479
  },
521
480
  "testID": undefined,
522
481
  },
@@ -526,8 +485,13 @@ exports[`BooleanField renders disabled state 1`] = `
526
485
  "props": {
527
486
  "aria-role": "button",
528
487
  "onPress": [Function],
488
+ "style": {
489
+ "alignItems": "center",
490
+ "flexDirection": "row",
491
+ "justifyContent": "center",
492
+ },
529
493
  },
530
- "type": "TouchableWithoutFeedback",
494
+ "type": "Pressable",
531
495
  },
532
496
  ],
533
497
  "props": {