@tactics/toddle-styleguide 1.2.3 → 1.2.5

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 (77) hide show
  1. package/App.tsx +202 -191
  2. package/index.d.ts +2 -1
  3. package/index.tsx +2 -0
  4. package/package.json +2 -2
  5. package/src/components/atoms/backdrop/backdrop.component.d.ts +2 -1
  6. package/src/components/atoms/backdrop/backdrop.component.tsx +8 -2
  7. package/src/components/atoms/calendar/__snapshots__/calendar.test.js.snap +1821 -641
  8. package/src/components/atoms/text-input/text-input.component.d.ts +4 -5
  9. package/src/components/atoms/text-input/text-input.component.tsx +9 -13
  10. package/src/components/atoms/text-input/text-input.preview.tsx +5 -5
  11. package/src/components/atoms/text-input/text-input.test.js +4 -4
  12. package/src/components/molecules/avatar/__snapshots__/avatar.test.js.snap +70 -62
  13. package/src/components/molecules/avatar/avatar.component.d.ts +2 -1
  14. package/src/components/molecules/avatar/avatar.component.tsx +22 -11
  15. package/src/components/molecules/avatar/avatar.preview.tsx +58 -44
  16. package/src/components/molecules/avatar/avatar.styles.d.ts +54 -15
  17. package/src/components/molecules/avatar/avatar.styles.js +33 -5
  18. package/src/components/molecules/button/__snapshots__/button.test.js.snap +144 -0
  19. package/src/components/molecules/button/button.component.d.ts +6 -4
  20. package/src/components/molecules/button/button.component.tsx +30 -9
  21. package/src/components/molecules/button/button.preview.tsx +16 -1
  22. package/src/components/molecules/button/button.styles.d.ts +13 -16
  23. package/src/components/molecules/button/button.styles.js +2 -4
  24. package/src/components/molecules/button/button.test.js +12 -0
  25. package/src/components/molecules/date-input/date-input.preview.tsx +25 -23
  26. package/src/components/molecules/message-input/__snapshots__/message-input.test.js.snap +4 -0
  27. package/src/components/molecules/message-input/message-input.component.d.ts +4 -6
  28. package/src/components/molecules/message-input/message-input.component.tsx +10 -12
  29. package/src/components/molecules/message-input/message-input.preview.tsx +28 -15
  30. package/src/components/molecules/password-input/password-input.component.d.ts +4 -6
  31. package/src/components/molecules/password-input/password-input.component.tsx +11 -15
  32. package/src/components/molecules/swipe/__snapshots__/swipe.test.js.snap +263 -420
  33. package/src/components/molecules/swipe/swipe.component.d.ts +4 -4
  34. package/src/components/molecules/swipe/swipe.component.tsx +47 -20
  35. package/src/components/molecules/swipe/swipe.preview.tsx +111 -51
  36. package/src/components/molecules/swipe/swipe.styles.d.ts +28 -0
  37. package/src/components/molecules/swipe/swipe.styles.js +32 -0
  38. package/src/components/molecules/swipe/swipe.test.js +1 -1
  39. package/src/components/molecules/tag/__snapshots__/tag.test.js.snap +10 -10
  40. package/src/components/molecules/tag/tag.component.d.ts +3 -8
  41. package/src/components/molecules/tag/tag.component.tsx +7 -13
  42. package/src/components/molecules/tag/tag.preview.tsx +22 -19
  43. package/src/components/molecules/tag/tag.styles.js +4 -2
  44. package/src/components/molecules/tag/tag.test.js +10 -2
  45. package/src/components/molecules/time-picker/__snapshots__/time-picker.test.js.snap +1868 -1776
  46. package/src/components/molecules/time-picker/time-picker.component.tsx +49 -23
  47. package/src/components/molecules/time-picker/time-picker.preview.tsx +5 -4
  48. package/src/components/molecules/time-picker/time-picker.styles.d.ts +16 -4
  49. package/src/components/molecules/time-picker/time-picker.styles.js +18 -6
  50. package/src/components/molecules/timestamp/__snapshots__/timestamp.test.js.snap +1 -1
  51. package/src/components/molecules/timestamp/timestamp.component.tsx +0 -2
  52. package/src/components/organisms/child-list-item/__snapshots__/child-list-item.test.js.snap +174 -162
  53. package/src/components/organisms/contact-item/__snapshots__/contact-item.test.js.snap +70 -127
  54. package/src/components/organisms/contact-item/contact-item.component.tsx +10 -9
  55. package/src/components/organisms/my-child-list-item/__snapshots__/my-child-list-item.test.js.snap +97 -89
  56. package/src/components/organisms/person-info-card/__snapshots__/person-info-card.test.js.snap +233 -209
  57. package/src/components/organisms/text-bubble/__snapshots__/text-bubble.test.js.snap +7 -7
  58. package/src/components/templates/modal/modal.component.tsx +0 -1
  59. package/src/components/templates/popover/components/modal/modal.component.tsx +0 -1
  60. package/src/components/templates/popover/components/modal/modal.styles.d.ts +2 -1
  61. package/src/components/templates/popover/components/modal/modal.styles.js +2 -2
  62. package/src/components/templates/popover/popover.component.tsx +27 -14
  63. package/src/components/templates/popover/popover.preview.tsx +63 -97
  64. package/src/components/templates/popover/popover.styles.d.ts +1 -1
  65. package/src/components/templates/popover/popover.styles.js +3 -1
  66. package/src/components/templates/popover-action/popover-action.component.d.ts +8 -0
  67. package/src/components/templates/popover-action/popover-action.component.tsx +119 -0
  68. package/src/components/templates/popover-action/popover-action.preview.d.ts +1 -0
  69. package/src/components/templates/popover-action/popover-action.preview.tsx +142 -0
  70. package/src/components/templates/popover-action/popover-action.styles.d.ts +26 -0
  71. package/src/components/templates/popover-action/popover-action.styles.js +31 -0
  72. package/src/utilities/toddle-datetime/toddle-datetime.class.d.ts +5 -0
  73. package/src/utilities/toddle-datetime/toddle-datetime.class.tsx +23 -0
  74. package/src/utilities/toddle-datetime/toddle-datetime.preview.tsx +15 -1
  75. package/src/utilities/toddle-datetime/toddle-datetime.test.js +10 -0
  76. package/src/components/molecules/swipe/Swipe.styles.d.ts +0 -7
  77. package/src/components/molecules/swipe/Swipe.styles.js +0 -10
@@ -1,6 +1,6 @@
1
1
  import {View} from 'react-native';
2
2
  import WheelPickerExpo from 'react-native-wheel-picker-expo';
3
- import {Heading3} from '../../atoms/heading-components';
3
+ import {Heading1, Heading3} from '../../atoms/heading-components';
4
4
  import {Stylesheet} from './time-picker.styles';
5
5
  import {Scale} from '../../../theme/scale/index';
6
6
  import {useContext} from 'react';
@@ -36,30 +36,56 @@ export const TimePicker = ({
36
36
  };
37
37
 
38
38
  return (
39
- <View style={styles.container}>
40
- <WheelPickerExpo
41
- items={HOURS.map((value) => ({label: value, value: value}))}
42
- onChange={({item}) => onChangeHours(item.label)}
43
- width={Scale.m * 4.5}
44
- selectedStyle={styles.selected}
45
- renderItem={({label, textAlign}) => (
46
- <Heading3 textAlign={textAlign}>{label}</Heading3>
47
- )}
48
- initialSelectedIndex={initialIndexHandler(HOURS, initialHours)}
49
- />
39
+ <View style={styles.rootContainer}>
40
+ <View style={styles.container}>
41
+ <WheelPickerExpo
42
+ items={HOURS.map((value) => ({label: value, value: value}))}
43
+ onChange={({item}) => onChangeHours(item.label)}
44
+ width={Scale.m * 4.5}
45
+ height={320}
46
+ backgroundColor={context.colors.ui.xlightgrey}
47
+ renderItem={({label, textAlign}) => (
48
+ <Heading1
49
+ textAlign={textAlign}
50
+ textColor={context.colors.ui.grey}
51
+ bold={false}
52
+ addStyle={styles.text}
53
+ >
54
+ {label}
55
+ </Heading1>
56
+ )}
57
+ initialSelectedIndex={initialIndexHandler(HOURS, initialHours)}
58
+ />
59
+ </View>
50
60
  <View>
51
- <Heading3>:</Heading3>
61
+ <Heading1
62
+ textColor={context.colors.ui.grey}
63
+ addStyle={styles.colon}
64
+ textAlign={'center'}
65
+ >
66
+ :
67
+ </Heading1>
68
+ </View>
69
+ <View style={styles.container}>
70
+ <WheelPickerExpo
71
+ items={MINUTES.map((value) => ({label: value, value: value}))}
72
+ onChange={({item}) => onChangeMinutes(item.label)}
73
+ width={Scale.m * 4.5}
74
+ height={320}
75
+ backgroundColor={context.colors.ui.xlightgrey}
76
+ renderItem={({label, textAlign}) => (
77
+ <Heading1
78
+ textAlign={textAlign}
79
+ textColor={context.colors.ui.grey}
80
+ bold={false}
81
+ addStyle={styles.text}
82
+ >
83
+ {label}
84
+ </Heading1>
85
+ )}
86
+ initialSelectedIndex={initialIndexHandler(MINUTES, initialMinutes)}
87
+ />
52
88
  </View>
53
- <WheelPickerExpo
54
- items={MINUTES.map((value) => ({label: value, value: value}))}
55
- onChange={({item}) => onChangeMinutes(item.label)}
56
- width={Scale.m * 4.5}
57
- selectedStyle={styles.selected}
58
- renderItem={({label, textAlign}) => (
59
- <Heading3 textAlign={textAlign}>{label}</Heading3>
60
- )}
61
- initialSelectedIndex={initialIndexHandler(MINUTES, initialMinutes)}
62
- />
63
89
  </View>
64
90
  );
65
91
  };
@@ -61,11 +61,11 @@ export const TimePickerPreview = ({}: {}) => {
61
61
  </View>
62
62
  <View
63
63
  style={{
64
- flexDirection: 'row',
65
- justifyContent: 'space-between',
64
+ flexDirection: 'column',
65
+ gap: 26,
66
66
  }}
67
67
  >
68
- <View>
68
+ <View style={{alignItems: 'center'}}>
69
69
  <Heading3
70
70
  bold={true}
71
71
  textAlign={'center'}
@@ -80,7 +80,8 @@ export const TimePickerPreview = ({}: {}) => {
80
80
  onChangeMinutes={setCheckInMinutes}
81
81
  />
82
82
  </View>
83
- <View>
83
+
84
+ <View style={{alignItems: 'center'}}>
84
85
  <Heading3
85
86
  bold={true}
86
87
  textAlign={'center'}
@@ -1,15 +1,27 @@
1
1
  export function Stylesheet(context: any): {
2
+ rootContainer: {
3
+ flexDirection: 'row';
4
+ alignItems: 'center';
5
+ gap: number;
6
+ };
2
7
  container: {
3
8
  borderColor: any;
4
9
  borderWidth: number;
5
10
  borderStyle: 'solid';
6
11
  borderRadius: number;
7
12
  overflow: 'hidden';
8
- flexDirection: 'row';
13
+ justifyContent: 'center';
9
14
  alignItems: 'center';
15
+ maxHeight: number;
16
+ maxWidth: number;
10
17
  };
11
- selected: {
12
- borderColor: any;
13
- borderWidth: number;
18
+ text: {
19
+ fontWeight: '200';
20
+ fontSize: number;
21
+ };
22
+ colon: {
23
+ fontWeight: '200';
24
+ lineHeight: number;
25
+ fontSize: number;
14
26
  };
15
27
  };
@@ -3,17 +3,29 @@ import {Scale} from '../../../theme/scale/index';
3
3
 
4
4
  export const Stylesheet = (context) =>
5
5
  StyleSheet.create({
6
+ rootContainer: {
7
+ flexDirection: 'row',
8
+ alignItems: 'center',
9
+ gap: Scale.s,
10
+ },
6
11
  container: {
7
- borderColor: context.colors.ui.xlightgrey,
12
+ borderColor: context.colors.ui.lightgrey,
8
13
  borderWidth: 1,
9
14
  borderStyle: 'solid',
10
- borderRadius: Scale.m,
15
+ borderRadius: Scale.m * 1.25,
11
16
  overflow: 'hidden',
12
- flexDirection: 'row',
17
+ justifyContent: 'center',
13
18
  alignItems: 'center',
19
+ maxHeight: Scale.m * 4.5,
20
+ maxWidth: Scale.m * 4.5,
14
21
  },
15
- selected: {
16
- borderColor: context.colors.ui.lightgrey,
17
- borderWidth: 1,
22
+ text: {
23
+ fontWeight: '200',
24
+ fontSize: 42,
25
+ },
26
+ colon: {
27
+ fontWeight: '200',
28
+ lineHeight: 42,
29
+ fontSize: 42,
18
30
  },
19
31
  });
@@ -22,6 +22,6 @@ exports[`Timestamp component test Renders a timestamp component, this will be ad
22
22
  ]
23
23
  }
24
24
  >
25
- 25 May, 9:08
25
+ 9:08
26
26
  </Text>
27
27
  `;
@@ -15,8 +15,6 @@ export const Timestamp = ({sent}: TimestampProps) => {
15
15
 
16
16
  const timestampToStringHandler = (timestamp: ToddleDateTime) => {
17
17
  return timestamp.toLocaleString({
18
- day: 'numeric',
19
- month: 'short',
20
18
  hourCycle: 'h24',
21
19
  hour: 'numeric',
22
20
  minute: '2-digit',
@@ -59,69 +59,73 @@ exports[`test child list item component arrow appears when selectable is false 1
59
59
  }
60
60
  >
61
61
  <View
62
- style={
63
- [
64
- {
65
- "alignItems": "center",
66
- "backgroundColor": "#647ACB",
67
- "justifyContent": "center",
68
- "overflow": "hidden",
69
- },
70
- false,
71
- {
72
- "borderRadius": 36,
73
- "height": 72,
74
- "width": 72,
75
- },
76
- false,
77
- ]
78
- }
62
+ style={null}
79
63
  >
80
- <ViewManagerAdapter_ExpoLinearGradient
81
- proxiedProperties={
82
- {
83
- "colors": [
84
- 4281681564,
85
- 4284775115,
86
- 4292481661,
87
- ],
88
- "endPoint": [
89
- 0.9,
90
- 0.9,
91
- ],
92
- "locations": [
93
- 0,
94
- 0.55,
95
- 1,
96
- ],
97
- "startPoint": [
98
- 0.1,
99
- 0.1,
100
- ],
101
- }
102
- }
64
+ <View
103
65
  style={
104
66
  [
105
67
  {
106
- "height": "100%",
107
- "width": "100%",
68
+ "alignItems": "center",
69
+ "backgroundColor": "#647ACB",
70
+ "justifyContent": "center",
71
+ "overflow": "hidden",
108
72
  },
109
- ]
110
- }
111
- />
112
- <Image
113
- source={1}
114
- style={
115
- [
73
+ false,
116
74
  {
117
- "borderRadius": 50,
118
- "height": "90%",
119
- "position": "absolute",
120
- "width": "90%",
75
+ "borderRadius": 36,
76
+ "height": 72,
77
+ "width": 72,
121
78
  },
79
+ false,
122
80
  ]
123
81
  }
124
- />
82
+ >
83
+ <ViewManagerAdapter_ExpoLinearGradient
84
+ proxiedProperties={
85
+ {
86
+ "colors": [
87
+ 4281681564,
88
+ 4284775115,
89
+ 4292481661,
90
+ ],
91
+ "endPoint": [
92
+ 0.9,
93
+ 0.9,
94
+ ],
95
+ "locations": [
96
+ 0,
97
+ 0.55,
98
+ 1,
99
+ ],
100
+ "startPoint": [
101
+ 0.1,
102
+ 0.1,
103
+ ],
104
+ }
105
+ }
106
+ style={
107
+ [
108
+ {
109
+ "height": "100%",
110
+ "width": "100%",
111
+ },
112
+ ]
113
+ }
114
+ />
115
+ <Image
116
+ source={1}
117
+ style={
118
+ [
119
+ {
120
+ "borderRadius": 50,
121
+ "height": "90%",
122
+ "position": "absolute",
123
+ "width": "90%",
124
+ },
125
+ ]
126
+ }
127
+ />
128
+ </View>
125
129
  </View>
126
130
  <View
127
131
  style={
@@ -400,69 +404,73 @@ exports[`test child list item component background is blue and text is white whe
400
404
  }
401
405
  >
402
406
  <View
403
- style={
404
- [
405
- {
406
- "alignItems": "center",
407
- "backgroundColor": "#647ACB",
408
- "justifyContent": "center",
409
- "overflow": "hidden",
410
- },
411
- false,
412
- {
413
- "borderRadius": 36,
414
- "height": 72,
415
- "width": 72,
416
- },
417
- false,
418
- ]
419
- }
407
+ style={null}
420
408
  >
421
- <ViewManagerAdapter_ExpoLinearGradient
422
- proxiedProperties={
423
- {
424
- "colors": [
425
- 4281681564,
426
- 4284775115,
427
- 4292481661,
428
- ],
429
- "endPoint": [
430
- 0.9,
431
- 0.9,
432
- ],
433
- "locations": [
434
- 0,
435
- 0.55,
436
- 1,
437
- ],
438
- "startPoint": [
439
- 0.1,
440
- 0.1,
441
- ],
442
- }
443
- }
409
+ <View
444
410
  style={
445
411
  [
446
412
  {
447
- "height": "100%",
448
- "width": "100%",
413
+ "alignItems": "center",
414
+ "backgroundColor": "#647ACB",
415
+ "justifyContent": "center",
416
+ "overflow": "hidden",
449
417
  },
450
- ]
451
- }
452
- />
453
- <Image
454
- source={1}
455
- style={
456
- [
418
+ false,
457
419
  {
458
- "borderRadius": 50,
459
- "height": "90%",
460
- "position": "absolute",
461
- "width": "90%",
420
+ "borderRadius": 36,
421
+ "height": 72,
422
+ "width": 72,
462
423
  },
424
+ false,
463
425
  ]
464
426
  }
465
- />
427
+ >
428
+ <ViewManagerAdapter_ExpoLinearGradient
429
+ proxiedProperties={
430
+ {
431
+ "colors": [
432
+ 4281681564,
433
+ 4284775115,
434
+ 4292481661,
435
+ ],
436
+ "endPoint": [
437
+ 0.9,
438
+ 0.9,
439
+ ],
440
+ "locations": [
441
+ 0,
442
+ 0.55,
443
+ 1,
444
+ ],
445
+ "startPoint": [
446
+ 0.1,
447
+ 0.1,
448
+ ],
449
+ }
450
+ }
451
+ style={
452
+ [
453
+ {
454
+ "height": "100%",
455
+ "width": "100%",
456
+ },
457
+ ]
458
+ }
459
+ />
460
+ <Image
461
+ source={1}
462
+ style={
463
+ [
464
+ {
465
+ "borderRadius": 50,
466
+ "height": "90%",
467
+ "position": "absolute",
468
+ "width": "90%",
469
+ },
470
+ ]
471
+ }
472
+ />
473
+ </View>
466
474
  </View>
467
475
  <View
468
476
  style={
@@ -641,69 +649,73 @@ exports[`test child list item component make text that is too long end in ... 1`
641
649
  }
642
650
  >
643
651
  <View
644
- style={
645
- [
646
- {
647
- "alignItems": "center",
648
- "backgroundColor": "#647ACB",
649
- "justifyContent": "center",
650
- "overflow": "hidden",
651
- },
652
- false,
653
- {
654
- "borderRadius": 36,
655
- "height": 72,
656
- "width": 72,
657
- },
658
- false,
659
- ]
660
- }
652
+ style={null}
661
653
  >
662
- <ViewManagerAdapter_ExpoLinearGradient
663
- proxiedProperties={
664
- {
665
- "colors": [
666
- 4281681564,
667
- 4284775115,
668
- 4292481661,
669
- ],
670
- "endPoint": [
671
- 0.9,
672
- 0.9,
673
- ],
674
- "locations": [
675
- 0,
676
- 0.55,
677
- 1,
678
- ],
679
- "startPoint": [
680
- 0.1,
681
- 0.1,
682
- ],
683
- }
684
- }
654
+ <View
685
655
  style={
686
656
  [
687
657
  {
688
- "height": "100%",
689
- "width": "100%",
658
+ "alignItems": "center",
659
+ "backgroundColor": "#647ACB",
660
+ "justifyContent": "center",
661
+ "overflow": "hidden",
690
662
  },
691
- ]
692
- }
693
- />
694
- <Image
695
- source={1}
696
- style={
697
- [
663
+ false,
698
664
  {
699
- "borderRadius": 50,
700
- "height": "90%",
701
- "position": "absolute",
702
- "width": "90%",
665
+ "borderRadius": 36,
666
+ "height": 72,
667
+ "width": 72,
703
668
  },
669
+ false,
704
670
  ]
705
671
  }
706
- />
672
+ >
673
+ <ViewManagerAdapter_ExpoLinearGradient
674
+ proxiedProperties={
675
+ {
676
+ "colors": [
677
+ 4281681564,
678
+ 4284775115,
679
+ 4292481661,
680
+ ],
681
+ "endPoint": [
682
+ 0.9,
683
+ 0.9,
684
+ ],
685
+ "locations": [
686
+ 0,
687
+ 0.55,
688
+ 1,
689
+ ],
690
+ "startPoint": [
691
+ 0.1,
692
+ 0.1,
693
+ ],
694
+ }
695
+ }
696
+ style={
697
+ [
698
+ {
699
+ "height": "100%",
700
+ "width": "100%",
701
+ },
702
+ ]
703
+ }
704
+ />
705
+ <Image
706
+ source={1}
707
+ style={
708
+ [
709
+ {
710
+ "borderRadius": 50,
711
+ "height": "90%",
712
+ "position": "absolute",
713
+ "width": "90%",
714
+ },
715
+ ]
716
+ }
717
+ />
718
+ </View>
707
719
  </View>
708
720
  <View
709
721
  style={