@tactics/toddle-styleguide 1.2.2 → 1.2.4
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/App.tsx +196 -183
- package/index.d.ts +3 -2
- package/index.tsx +4 -2
- package/package.json +5 -1
- package/src/components/atoms/calendar/__snapshots__/calendar.test.js.snap +1776 -596
- package/src/components/atoms/calendar/calendar.component.tsx +8 -6
- package/src/components/molecules/avatar/__snapshots__/avatar.test.js.snap +70 -62
- package/src/components/molecules/avatar/avatar.component.d.ts +2 -1
- package/src/components/molecules/avatar/avatar.component.tsx +22 -11
- package/src/components/molecules/avatar/avatar.preview.tsx +58 -44
- package/src/components/molecules/avatar/avatar.styles.d.ts +54 -15
- package/src/components/molecules/avatar/avatar.styles.js +33 -5
- package/src/components/molecules/calendar-select/calendar-select.component.d.ts +2 -2
- package/src/components/molecules/calendar-select/calendar-select.component.tsx +4 -14
- package/src/components/molecules/calendar-select/calendar-select.preview.tsx +9 -22
- package/src/components/molecules/date-input/date-input.preview.tsx +25 -23
- package/src/components/molecules/time-picker/__snapshots__/time-picker.test.js.snap +2241 -0
- package/src/components/molecules/time-picker/time-picker.component.d.ts +8 -0
- package/src/components/molecules/time-picker/time-picker.component.tsx +91 -0
- package/src/components/molecules/time-picker/time-picker.preview.d.ts +1 -0
- package/src/components/molecules/time-picker/time-picker.preview.tsx +110 -0
- package/src/components/molecules/time-picker/time-picker.styles.d.ts +27 -0
- package/src/components/molecules/time-picker/time-picker.styles.js +31 -0
- package/src/components/molecules/time-picker/time-picker.test.js +18 -0
- package/src/components/molecules/time-tracker/time-tracker.test.js +0 -1
- package/src/components/molecules/timeline/__snapshots__/timeline.test.js.snap +47 -39
- package/src/components/molecules/timeline/timeline.component.d.ts +2 -2
- package/src/components/molecules/timeline/timeline.component.tsx +27 -120
- package/src/components/molecules/timeline/timeline.preview.tsx +9 -20
- package/src/components/molecules/timeline/timeline.styles.d.ts +58 -40
- package/src/components/molecules/timeline/timeline.styles.js +24 -17
- package/src/components/molecules/timeline/timeline.test.js +3 -3
- package/src/components/organisms/child-list-item/__snapshots__/child-list-item.test.js.snap +174 -162
- package/src/components/organisms/contact-item/__snapshots__/contact-item.test.js.snap +70 -127
- package/src/components/organisms/contact-item/contact-item.component.tsx +10 -9
- package/src/components/organisms/my-child-list-item/__snapshots__/my-child-list-item.test.js.snap +97 -89
- package/src/components/organisms/person-info-card/__snapshots__/person-info-card.test.js.snap +233 -209
- package/src/components/templates/modal/components/fade-panel.component.d.ts +2 -1
- package/src/components/templates/modal/components/fade-panel.component.tsx +8 -2
- package/src/components/templates/modal/modal.component.d.ts +2 -1
- package/src/components/templates/modal/modal.component.tsx +4 -3
- package/src/components/templates/modal/modal.styles.d.ts +3 -6
- package/src/components/templates/modal/modal.styles.js +3 -3
- package/src/components/templates/popover/components/modal/modal.component.tsx +0 -3
- package/src/components/templates/popover/components/modal/modal.styles.d.ts +2 -1
- package/src/components/templates/popover/components/modal/modal.styles.js +2 -2
- package/src/components/templates/popover/popover.component.tsx +27 -14
- package/src/components/templates/popover/popover.preview.tsx +63 -97
- package/src/components/templates/popover/popover.styles.d.ts +1 -1
- package/src/components/templates/popover/popover.styles.js +3 -1
- package/src/theme/provider/parent.theme.d.ts +4 -1
- package/src/theme/provider/parent.theme.ts +4 -1
- package/src/utilities/toddle-datetime/toddle-datetime.class.d.ts +3 -2
- package/src/utilities/toddle-datetime/toddle-datetime.class.tsx +9 -2
- package/src/utilities/toddle-datetime/toddle-datetime.preview.tsx +15 -1
- package/src/utilities/toddle-datetime/toddle-datetime.test.js +10 -0
package/src/components/organisms/person-info-card/__snapshots__/person-info-card.test.js.snap
CHANGED
|
@@ -11,47 +11,51 @@ exports[`Person info card tests renders a person info card with initials and lab
|
|
|
11
11
|
}
|
|
12
12
|
>
|
|
13
13
|
<View
|
|
14
|
-
style={
|
|
15
|
-
[
|
|
16
|
-
{
|
|
17
|
-
"alignItems": "center",
|
|
18
|
-
"backgroundColor": "#647ACB",
|
|
19
|
-
"justifyContent": "center",
|
|
20
|
-
"overflow": "hidden",
|
|
21
|
-
},
|
|
22
|
-
false,
|
|
23
|
-
false,
|
|
24
|
-
{
|
|
25
|
-
"borderRadius": 60,
|
|
26
|
-
"height": 120,
|
|
27
|
-
"width": 120,
|
|
28
|
-
},
|
|
29
|
-
]
|
|
30
|
-
}
|
|
14
|
+
style={null}
|
|
31
15
|
>
|
|
32
|
-
<
|
|
16
|
+
<View
|
|
33
17
|
style={
|
|
34
18
|
[
|
|
35
|
-
[
|
|
36
|
-
{
|
|
37
|
-
"fontFamily": "SourceSansProBold",
|
|
38
|
-
"fontSize": 38,
|
|
39
|
-
"lineHeight": 47.8,
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
19
|
{
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
20
|
+
"alignItems": "center",
|
|
21
|
+
"backgroundColor": "#647ACB",
|
|
22
|
+
"justifyContent": "center",
|
|
23
|
+
"overflow": "hidden",
|
|
46
24
|
},
|
|
25
|
+
false,
|
|
26
|
+
false,
|
|
47
27
|
{
|
|
48
|
-
"
|
|
28
|
+
"borderRadius": 60,
|
|
29
|
+
"height": 120,
|
|
30
|
+
"width": 120,
|
|
49
31
|
},
|
|
50
32
|
]
|
|
51
33
|
}
|
|
52
34
|
>
|
|
53
|
-
|
|
54
|
-
|
|
35
|
+
<Text
|
|
36
|
+
style={
|
|
37
|
+
[
|
|
38
|
+
[
|
|
39
|
+
{
|
|
40
|
+
"fontFamily": "SourceSansProBold",
|
|
41
|
+
"fontSize": 38,
|
|
42
|
+
"lineHeight": 47.8,
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
{
|
|
46
|
+
"color": "#FFFFFF",
|
|
47
|
+
"textAlign": "center",
|
|
48
|
+
"width": "100%",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"textTransform": "uppercase",
|
|
52
|
+
},
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
>
|
|
56
|
+
ZD
|
|
57
|
+
</Text>
|
|
58
|
+
</View>
|
|
55
59
|
</View>
|
|
56
60
|
</View>
|
|
57
61
|
<View
|
|
@@ -121,47 +125,51 @@ exports[`Person info card tests renders a person info card with initials and lab
|
|
|
121
125
|
}
|
|
122
126
|
>
|
|
123
127
|
<View
|
|
124
|
-
style={
|
|
125
|
-
[
|
|
126
|
-
{
|
|
127
|
-
"alignItems": "center",
|
|
128
|
-
"backgroundColor": "#647ACB",
|
|
129
|
-
"justifyContent": "center",
|
|
130
|
-
"overflow": "hidden",
|
|
131
|
-
},
|
|
132
|
-
false,
|
|
133
|
-
false,
|
|
134
|
-
{
|
|
135
|
-
"borderRadius": 60,
|
|
136
|
-
"height": 120,
|
|
137
|
-
"width": 120,
|
|
138
|
-
},
|
|
139
|
-
]
|
|
140
|
-
}
|
|
128
|
+
style={null}
|
|
141
129
|
>
|
|
142
|
-
<
|
|
130
|
+
<View
|
|
143
131
|
style={
|
|
144
132
|
[
|
|
145
|
-
[
|
|
146
|
-
{
|
|
147
|
-
"fontFamily": "SourceSansProBold",
|
|
148
|
-
"fontSize": 38,
|
|
149
|
-
"lineHeight": 47.8,
|
|
150
|
-
},
|
|
151
|
-
],
|
|
152
133
|
{
|
|
153
|
-
"
|
|
154
|
-
"
|
|
155
|
-
"
|
|
134
|
+
"alignItems": "center",
|
|
135
|
+
"backgroundColor": "#647ACB",
|
|
136
|
+
"justifyContent": "center",
|
|
137
|
+
"overflow": "hidden",
|
|
156
138
|
},
|
|
139
|
+
false,
|
|
140
|
+
false,
|
|
157
141
|
{
|
|
158
|
-
"
|
|
142
|
+
"borderRadius": 60,
|
|
143
|
+
"height": 120,
|
|
144
|
+
"width": 120,
|
|
159
145
|
},
|
|
160
146
|
]
|
|
161
147
|
}
|
|
162
148
|
>
|
|
163
|
-
|
|
164
|
-
|
|
149
|
+
<Text
|
|
150
|
+
style={
|
|
151
|
+
[
|
|
152
|
+
[
|
|
153
|
+
{
|
|
154
|
+
"fontFamily": "SourceSansProBold",
|
|
155
|
+
"fontSize": 38,
|
|
156
|
+
"lineHeight": 47.8,
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
{
|
|
160
|
+
"color": "#FFFFFF",
|
|
161
|
+
"textAlign": "center",
|
|
162
|
+
"width": "100%",
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"textTransform": "uppercase",
|
|
166
|
+
},
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
>
|
|
170
|
+
ZD
|
|
171
|
+
</Text>
|
|
172
|
+
</View>
|
|
165
173
|
</View>
|
|
166
174
|
</View>
|
|
167
175
|
<View
|
|
@@ -231,47 +239,51 @@ exports[`Person info card tests renders a person info card with initials and no
|
|
|
231
239
|
}
|
|
232
240
|
>
|
|
233
241
|
<View
|
|
234
|
-
style={
|
|
235
|
-
[
|
|
236
|
-
{
|
|
237
|
-
"alignItems": "center",
|
|
238
|
-
"backgroundColor": "#647ACB",
|
|
239
|
-
"justifyContent": "center",
|
|
240
|
-
"overflow": "hidden",
|
|
241
|
-
},
|
|
242
|
-
false,
|
|
243
|
-
false,
|
|
244
|
-
{
|
|
245
|
-
"borderRadius": 60,
|
|
246
|
-
"height": 120,
|
|
247
|
-
"width": 120,
|
|
248
|
-
},
|
|
249
|
-
]
|
|
250
|
-
}
|
|
242
|
+
style={null}
|
|
251
243
|
>
|
|
252
|
-
<
|
|
244
|
+
<View
|
|
253
245
|
style={
|
|
254
246
|
[
|
|
255
|
-
[
|
|
256
|
-
{
|
|
257
|
-
"fontFamily": "SourceSansProBold",
|
|
258
|
-
"fontSize": 38,
|
|
259
|
-
"lineHeight": 47.8,
|
|
260
|
-
},
|
|
261
|
-
],
|
|
262
247
|
{
|
|
263
|
-
"
|
|
264
|
-
"
|
|
265
|
-
"
|
|
248
|
+
"alignItems": "center",
|
|
249
|
+
"backgroundColor": "#647ACB",
|
|
250
|
+
"justifyContent": "center",
|
|
251
|
+
"overflow": "hidden",
|
|
266
252
|
},
|
|
253
|
+
false,
|
|
254
|
+
false,
|
|
267
255
|
{
|
|
268
|
-
"
|
|
256
|
+
"borderRadius": 60,
|
|
257
|
+
"height": 120,
|
|
258
|
+
"width": 120,
|
|
269
259
|
},
|
|
270
260
|
]
|
|
271
261
|
}
|
|
272
262
|
>
|
|
273
|
-
|
|
274
|
-
|
|
263
|
+
<Text
|
|
264
|
+
style={
|
|
265
|
+
[
|
|
266
|
+
[
|
|
267
|
+
{
|
|
268
|
+
"fontFamily": "SourceSansProBold",
|
|
269
|
+
"fontSize": 38,
|
|
270
|
+
"lineHeight": 47.8,
|
|
271
|
+
},
|
|
272
|
+
],
|
|
273
|
+
{
|
|
274
|
+
"color": "#FFFFFF",
|
|
275
|
+
"textAlign": "center",
|
|
276
|
+
"width": "100%",
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"textTransform": "uppercase",
|
|
280
|
+
},
|
|
281
|
+
]
|
|
282
|
+
}
|
|
283
|
+
>
|
|
284
|
+
ZD
|
|
285
|
+
</Text>
|
|
286
|
+
</View>
|
|
275
287
|
</View>
|
|
276
288
|
</View>
|
|
277
289
|
<View
|
|
@@ -339,47 +351,51 @@ exports[`Person info card tests renders a person info card with initials, label
|
|
|
339
351
|
}
|
|
340
352
|
>
|
|
341
353
|
<View
|
|
342
|
-
style={
|
|
343
|
-
[
|
|
344
|
-
{
|
|
345
|
-
"alignItems": "center",
|
|
346
|
-
"backgroundColor": "#F16868",
|
|
347
|
-
"justifyContent": "center",
|
|
348
|
-
"overflow": "hidden",
|
|
349
|
-
},
|
|
350
|
-
false,
|
|
351
|
-
false,
|
|
352
|
-
{
|
|
353
|
-
"borderRadius": 60,
|
|
354
|
-
"height": 120,
|
|
355
|
-
"width": 120,
|
|
356
|
-
},
|
|
357
|
-
]
|
|
358
|
-
}
|
|
354
|
+
style={null}
|
|
359
355
|
>
|
|
360
|
-
<
|
|
356
|
+
<View
|
|
361
357
|
style={
|
|
362
358
|
[
|
|
363
|
-
[
|
|
364
|
-
{
|
|
365
|
-
"fontFamily": "SourceSansProBold",
|
|
366
|
-
"fontSize": 38,
|
|
367
|
-
"lineHeight": 47.8,
|
|
368
|
-
},
|
|
369
|
-
],
|
|
370
359
|
{
|
|
371
|
-
"
|
|
372
|
-
"
|
|
373
|
-
"
|
|
360
|
+
"alignItems": "center",
|
|
361
|
+
"backgroundColor": "#F16868",
|
|
362
|
+
"justifyContent": "center",
|
|
363
|
+
"overflow": "hidden",
|
|
374
364
|
},
|
|
365
|
+
false,
|
|
366
|
+
false,
|
|
375
367
|
{
|
|
376
|
-
"
|
|
368
|
+
"borderRadius": 60,
|
|
369
|
+
"height": 120,
|
|
370
|
+
"width": 120,
|
|
377
371
|
},
|
|
378
372
|
]
|
|
379
373
|
}
|
|
380
374
|
>
|
|
381
|
-
|
|
382
|
-
|
|
375
|
+
<Text
|
|
376
|
+
style={
|
|
377
|
+
[
|
|
378
|
+
[
|
|
379
|
+
{
|
|
380
|
+
"fontFamily": "SourceSansProBold",
|
|
381
|
+
"fontSize": 38,
|
|
382
|
+
"lineHeight": 47.8,
|
|
383
|
+
},
|
|
384
|
+
],
|
|
385
|
+
{
|
|
386
|
+
"color": "#FFFFFF",
|
|
387
|
+
"textAlign": "center",
|
|
388
|
+
"width": "100%",
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
"textTransform": "uppercase",
|
|
392
|
+
},
|
|
393
|
+
]
|
|
394
|
+
}
|
|
395
|
+
>
|
|
396
|
+
ZD
|
|
397
|
+
</Text>
|
|
398
|
+
</View>
|
|
383
399
|
</View>
|
|
384
400
|
</View>
|
|
385
401
|
<View
|
|
@@ -449,47 +465,51 @@ exports[`Person info card tests renders a person info card with initials, label
|
|
|
449
465
|
}
|
|
450
466
|
>
|
|
451
467
|
<View
|
|
452
|
-
style={
|
|
453
|
-
[
|
|
454
|
-
{
|
|
455
|
-
"alignItems": "center",
|
|
456
|
-
"backgroundColor": "#E5E8EB",
|
|
457
|
-
"justifyContent": "center",
|
|
458
|
-
"overflow": "hidden",
|
|
459
|
-
},
|
|
460
|
-
false,
|
|
461
|
-
false,
|
|
462
|
-
{
|
|
463
|
-
"borderRadius": 60,
|
|
464
|
-
"height": 120,
|
|
465
|
-
"width": 120,
|
|
466
|
-
},
|
|
467
|
-
]
|
|
468
|
-
}
|
|
468
|
+
style={null}
|
|
469
469
|
>
|
|
470
|
-
<
|
|
470
|
+
<View
|
|
471
471
|
style={
|
|
472
472
|
[
|
|
473
|
-
[
|
|
474
|
-
{
|
|
475
|
-
"fontFamily": "SourceSansProBold",
|
|
476
|
-
"fontSize": 38,
|
|
477
|
-
"lineHeight": 47.8,
|
|
478
|
-
},
|
|
479
|
-
],
|
|
480
473
|
{
|
|
481
|
-
"
|
|
482
|
-
"
|
|
483
|
-
"
|
|
474
|
+
"alignItems": "center",
|
|
475
|
+
"backgroundColor": "#E5E8EB",
|
|
476
|
+
"justifyContent": "center",
|
|
477
|
+
"overflow": "hidden",
|
|
484
478
|
},
|
|
479
|
+
false,
|
|
480
|
+
false,
|
|
485
481
|
{
|
|
486
|
-
"
|
|
482
|
+
"borderRadius": 60,
|
|
483
|
+
"height": 120,
|
|
484
|
+
"width": 120,
|
|
487
485
|
},
|
|
488
486
|
]
|
|
489
487
|
}
|
|
490
488
|
>
|
|
491
|
-
|
|
492
|
-
|
|
489
|
+
<Text
|
|
490
|
+
style={
|
|
491
|
+
[
|
|
492
|
+
[
|
|
493
|
+
{
|
|
494
|
+
"fontFamily": "SourceSansProBold",
|
|
495
|
+
"fontSize": 38,
|
|
496
|
+
"lineHeight": 47.8,
|
|
497
|
+
},
|
|
498
|
+
],
|
|
499
|
+
{
|
|
500
|
+
"color": "#FFFFFF",
|
|
501
|
+
"textAlign": "center",
|
|
502
|
+
"width": "100%",
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
"textTransform": "uppercase",
|
|
506
|
+
},
|
|
507
|
+
]
|
|
508
|
+
}
|
|
509
|
+
>
|
|
510
|
+
ZD
|
|
511
|
+
</Text>
|
|
512
|
+
</View>
|
|
493
513
|
</View>
|
|
494
514
|
</View>
|
|
495
515
|
<View
|
|
@@ -559,69 +579,73 @@ exports[`Person info card tests renders a person info card with picture and labe
|
|
|
559
579
|
}
|
|
560
580
|
>
|
|
561
581
|
<View
|
|
562
|
-
style={
|
|
563
|
-
[
|
|
564
|
-
{
|
|
565
|
-
"alignItems": "center",
|
|
566
|
-
"backgroundColor": "#647ACB",
|
|
567
|
-
"justifyContent": "center",
|
|
568
|
-
"overflow": "hidden",
|
|
569
|
-
},
|
|
570
|
-
false,
|
|
571
|
-
false,
|
|
572
|
-
{
|
|
573
|
-
"borderRadius": 60,
|
|
574
|
-
"height": 120,
|
|
575
|
-
"width": 120,
|
|
576
|
-
},
|
|
577
|
-
]
|
|
578
|
-
}
|
|
582
|
+
style={null}
|
|
579
583
|
>
|
|
580
|
-
<
|
|
581
|
-
proxiedProperties={
|
|
582
|
-
{
|
|
583
|
-
"colors": [
|
|
584
|
-
4281681564,
|
|
585
|
-
4284775115,
|
|
586
|
-
4292481661,
|
|
587
|
-
],
|
|
588
|
-
"endPoint": [
|
|
589
|
-
0.9,
|
|
590
|
-
0.9,
|
|
591
|
-
],
|
|
592
|
-
"locations": [
|
|
593
|
-
0,
|
|
594
|
-
0.55,
|
|
595
|
-
1,
|
|
596
|
-
],
|
|
597
|
-
"startPoint": [
|
|
598
|
-
0.1,
|
|
599
|
-
0.1,
|
|
600
|
-
],
|
|
601
|
-
}
|
|
602
|
-
}
|
|
584
|
+
<View
|
|
603
585
|
style={
|
|
604
586
|
[
|
|
605
587
|
{
|
|
606
|
-
"
|
|
607
|
-
"
|
|
588
|
+
"alignItems": "center",
|
|
589
|
+
"backgroundColor": "#647ACB",
|
|
590
|
+
"justifyContent": "center",
|
|
591
|
+
"overflow": "hidden",
|
|
608
592
|
},
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
/>
|
|
612
|
-
<Image
|
|
613
|
-
source={1}
|
|
614
|
-
style={
|
|
615
|
-
[
|
|
593
|
+
false,
|
|
594
|
+
false,
|
|
616
595
|
{
|
|
617
|
-
"borderRadius":
|
|
618
|
-
"height":
|
|
619
|
-
"
|
|
620
|
-
"width": "90%",
|
|
596
|
+
"borderRadius": 60,
|
|
597
|
+
"height": 120,
|
|
598
|
+
"width": 120,
|
|
621
599
|
},
|
|
622
600
|
]
|
|
623
601
|
}
|
|
624
|
-
|
|
602
|
+
>
|
|
603
|
+
<ViewManagerAdapter_ExpoLinearGradient
|
|
604
|
+
proxiedProperties={
|
|
605
|
+
{
|
|
606
|
+
"colors": [
|
|
607
|
+
4281681564,
|
|
608
|
+
4284775115,
|
|
609
|
+
4292481661,
|
|
610
|
+
],
|
|
611
|
+
"endPoint": [
|
|
612
|
+
0.9,
|
|
613
|
+
0.9,
|
|
614
|
+
],
|
|
615
|
+
"locations": [
|
|
616
|
+
0,
|
|
617
|
+
0.55,
|
|
618
|
+
1,
|
|
619
|
+
],
|
|
620
|
+
"startPoint": [
|
|
621
|
+
0.1,
|
|
622
|
+
0.1,
|
|
623
|
+
],
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
style={
|
|
627
|
+
[
|
|
628
|
+
{
|
|
629
|
+
"height": "100%",
|
|
630
|
+
"width": "100%",
|
|
631
|
+
},
|
|
632
|
+
]
|
|
633
|
+
}
|
|
634
|
+
/>
|
|
635
|
+
<Image
|
|
636
|
+
source={1}
|
|
637
|
+
style={
|
|
638
|
+
[
|
|
639
|
+
{
|
|
640
|
+
"borderRadius": 50,
|
|
641
|
+
"height": "90%",
|
|
642
|
+
"position": "absolute",
|
|
643
|
+
"width": "90%",
|
|
644
|
+
},
|
|
645
|
+
]
|
|
646
|
+
}
|
|
647
|
+
/>
|
|
648
|
+
</View>
|
|
625
649
|
</View>
|
|
626
650
|
</View>
|
|
627
651
|
<View
|
|
@@ -6,6 +6,7 @@ type FadePanelProps = {
|
|
|
6
6
|
onClose: () => void;
|
|
7
7
|
maxHeight: number;
|
|
8
8
|
children: React.ReactNode;
|
|
9
|
+
scrollable: boolean | undefined;
|
|
9
10
|
};
|
|
10
|
-
export declare const FadePanel: ({ title, subtitle, isVisible, onClose, maxHeight, children, }: FadePanelProps) => JSX.Element;
|
|
11
|
+
export declare const FadePanel: ({ title, subtitle, isVisible, onClose, maxHeight, children, scrollable, }: FadePanelProps) => JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, {useContext, useEffect, useRef} from 'react';
|
|
2
|
-
import {Animated, ScrollView} from 'react-native';
|
|
2
|
+
import {Animated, ScrollView, View} from 'react-native';
|
|
3
3
|
import {ThemeCtx} from '../../../../context/theme.context';
|
|
4
4
|
import {Stylesheet} from './fade-panel.styles';
|
|
5
5
|
import {Heading} from '../../popover/components/modal/heading/heading.component';
|
|
@@ -12,6 +12,7 @@ type FadePanelProps = {
|
|
|
12
12
|
onClose: () => void;
|
|
13
13
|
maxHeight: number;
|
|
14
14
|
children: React.ReactNode;
|
|
15
|
+
scrollable: boolean | undefined;
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
export const FadePanel = ({
|
|
@@ -21,6 +22,7 @@ export const FadePanel = ({
|
|
|
21
22
|
onClose,
|
|
22
23
|
maxHeight,
|
|
23
24
|
children,
|
|
25
|
+
scrollable = true,
|
|
24
26
|
}: FadePanelProps) => {
|
|
25
27
|
const fadeAnimation = useRef(new Animated.Value(0)).current;
|
|
26
28
|
|
|
@@ -47,7 +49,11 @@ export const FadePanel = ({
|
|
|
47
49
|
<Animated.View style={styles.rootContainer}>
|
|
48
50
|
<Close onPress={onClose} />
|
|
49
51
|
<Heading title={title} subtitle={subtitle} />
|
|
50
|
-
|
|
52
|
+
{scrollable ? (
|
|
53
|
+
<ScrollView>{children}</ScrollView>
|
|
54
|
+
) : (
|
|
55
|
+
<View>{children}</View>
|
|
56
|
+
)}
|
|
51
57
|
</Animated.View>
|
|
52
58
|
);
|
|
53
59
|
};
|
|
@@ -5,6 +5,7 @@ type ModalProps = {
|
|
|
5
5
|
isVisible: boolean;
|
|
6
6
|
onClose: () => void;
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
+
scrollable?: boolean;
|
|
8
9
|
};
|
|
9
|
-
export declare const Modal: ({ title, subtitle, isVisible, onClose, children, }: ModalProps) => JSX.Element;
|
|
10
|
+
export declare const Modal: ({ title, subtitle, isVisible, onClose, children, scrollable, }: ModalProps) => JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -11,6 +11,7 @@ type ModalProps = {
|
|
|
11
11
|
isVisible: boolean;
|
|
12
12
|
onClose: () => void;
|
|
13
13
|
children?: React.ReactNode;
|
|
14
|
+
scrollable?: boolean;
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
const window = Dimensions.get('window');
|
|
@@ -21,21 +22,20 @@ export const Modal = ({
|
|
|
21
22
|
isVisible,
|
|
22
23
|
onClose,
|
|
23
24
|
children,
|
|
25
|
+
scrollable,
|
|
24
26
|
}: ModalProps) => {
|
|
25
27
|
const [windowHeight, setWindowHeight] = useState(window.height);
|
|
26
|
-
const [windowWidth, setWindowWidth] = useState(window.width);
|
|
27
28
|
|
|
28
29
|
useEffect(() => {
|
|
29
30
|
const subscription = Dimensions.addEventListener('change', ({window}) => {
|
|
30
31
|
setWindowHeight(window.height);
|
|
31
|
-
setWindowWidth(window.width);
|
|
32
32
|
});
|
|
33
33
|
return () => subscription?.remove();
|
|
34
34
|
});
|
|
35
35
|
|
|
36
36
|
const maxHeight = Math.round(windowHeight / 100) * 80;
|
|
37
37
|
|
|
38
|
-
const styles = Stylesheet(
|
|
38
|
+
const styles = Stylesheet();
|
|
39
39
|
|
|
40
40
|
return (
|
|
41
41
|
<View style={styles.element} pointerEvents={isVisible ? 'auto' : 'none'}>
|
|
@@ -47,6 +47,7 @@ export const Modal = ({
|
|
|
47
47
|
onClose={onClose}
|
|
48
48
|
title={title}
|
|
49
49
|
subtitle={subtitle}
|
|
50
|
+
scrollable={scrollable}
|
|
50
51
|
>
|
|
51
52
|
{children}
|
|
52
53
|
</FadePanel>
|
|
@@ -2,11 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import {StyleSheet} from 'react-native';
|
|
3
3
|
import {Scale} from '../../../theme/scale/index';
|
|
4
4
|
|
|
5
|
-
export const Stylesheet = (
|
|
5
|
+
export const Stylesheet = () =>
|
|
6
6
|
StyleSheet.create({
|
|
7
7
|
element: {
|
|
8
|
-
width:
|
|
9
|
-
height:
|
|
8
|
+
width: '100%',
|
|
9
|
+
height: '100%',
|
|
10
10
|
position: 'absolute',
|
|
11
11
|
left: 0,
|
|
12
12
|
top: 0,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import {useContext, useMemo, useState} from 'react';
|
|
3
|
-
|
|
4
3
|
import {Animated} from 'react-native';
|
|
5
4
|
import {Stylesheet} from './modal.styles';
|
|
6
5
|
import {Close} from './close/close.component';
|
|
@@ -68,8 +67,6 @@ const Modal = ({
|
|
|
68
67
|
|
|
69
68
|
const transform = [{translateY: translateY}];
|
|
70
69
|
|
|
71
|
-
console.log(maxHeight);
|
|
72
|
-
|
|
73
70
|
return (
|
|
74
71
|
<Animated.View
|
|
75
72
|
style={[styles.element, {maxHeight: maxHeight}, {transform: transform}]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function Stylesheet(
|
|
1
|
+
export function Stylesheet(context: any): {
|
|
2
2
|
element: {
|
|
3
3
|
position: 'relative';
|
|
4
4
|
display: 'flex';
|
|
@@ -10,6 +10,7 @@ export function Stylesheet(Context: any): {
|
|
|
10
10
|
borderTopLeftRadius: number;
|
|
11
11
|
borderTopRightRadius: number;
|
|
12
12
|
backgroundColor: any;
|
|
13
|
+
minHeight: string;
|
|
13
14
|
};
|
|
14
15
|
inner: {
|
|
15
16
|
display: 'flex';
|