@tactics/toddle-styleguide 0.0.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 (220) hide show
  1. package/.expo-shared/assets.json +4 -0
  2. package/.github/workflows/run-tests.yml +16 -0
  3. package/.prettierrc.js +9 -0
  4. package/.yarnrc.yml +1 -0
  5. package/App.tsx +221 -0
  6. package/app.json +33 -0
  7. package/assets/adaptive-icon.png +0 -0
  8. package/assets/components/avatar/baby.png +0 -0
  9. package/assets/favicon.png +0 -0
  10. package/assets/fonts/montserrat/bold.ttf +0 -0
  11. package/assets/fonts/montserrat/regular.ttf +0 -0
  12. package/assets/fonts/source-sans-pro/bold.ttf +0 -0
  13. package/assets/fonts/source-sans-pro/regular.ttf +0 -0
  14. package/assets/icon.png +0 -0
  15. package/assets/splash.png +0 -0
  16. package/babel.config.js +6 -0
  17. package/jest.config.js +22 -0
  18. package/package.json +53 -0
  19. package/src/components/atoms/avatar/__snapshots__/avatar.test.js.snap +85 -0
  20. package/src/components/atoms/avatar/avatar.component.tsx +35 -0
  21. package/src/components/atoms/avatar/avatar.preview.tsx +38 -0
  22. package/src/components/atoms/avatar/avatar.styles.js +55 -0
  23. package/src/components/atoms/avatar/avatar.test.js +22 -0
  24. package/src/components/atoms/button/__snapshots__/button.test.js.snap +307 -0
  25. package/src/components/atoms/button/button.component.tsx +27 -0
  26. package/src/components/atoms/button/button.preview.tsx +34 -0
  27. package/src/components/atoms/button/button.styles.js +25 -0
  28. package/src/components/atoms/button/button.test.js +35 -0
  29. package/src/components/atoms/cancel-link/__snapshots__/cancel-link.test.js.snap +89 -0
  30. package/src/components/atoms/cancel-link/cancel-link.component.tsx +24 -0
  31. package/src/components/atoms/cancel-link/cancel-link.preview.tsx +20 -0
  32. package/src/components/atoms/cancel-link/cancel-link.styles.js +20 -0
  33. package/src/components/atoms/cancel-link/cancel-link.test.js +28 -0
  34. package/src/components/atoms/check-switch/__snapshots__/check-switch.test.js.snap +67 -0
  35. package/src/components/atoms/check-switch/check-switch.component.tsx +46 -0
  36. package/src/components/atoms/check-switch/check-switch.preview.tsx +31 -0
  37. package/src/components/atoms/check-switch/check-switch.styles.js +36 -0
  38. package/src/components/atoms/check-switch/check-switch.test.js +13 -0
  39. package/src/components/atoms/checkbox/__snapshots__/checkbox.test.js.snap +120 -0
  40. package/src/components/atoms/checkbox/checkbox.component.tsx +26 -0
  41. package/src/components/atoms/checkbox/checkbox.preview.tsx +46 -0
  42. package/src/components/atoms/checkbox/checkbox.styles.js +35 -0
  43. package/src/components/atoms/checkbox/checkbox.test.js +30 -0
  44. package/src/components/atoms/child-list-item/__snapshots__/child-list-item.test.js.snap +635 -0
  45. package/src/components/atoms/child-list-item/child-list-item.component.tsx +81 -0
  46. package/src/components/atoms/child-list-item/child-list-item.preview.tsx +65 -0
  47. package/src/components/atoms/child-list-item/child-list-item.styles.js +82 -0
  48. package/src/components/atoms/child-list-item/child-list-item.test.js +73 -0
  49. package/src/components/atoms/contact-item/__snapshots__/contact-item.test.js.snap +321 -0
  50. package/src/components/atoms/contact-item/contact-item.component.tsx +61 -0
  51. package/src/components/atoms/contact-item/contact-item.preview.tsx +30 -0
  52. package/src/components/atoms/contact-item/contact-item.styles.js +26 -0
  53. package/src/components/atoms/contact-item/contact-item.test.js +20 -0
  54. package/src/components/atoms/filter-tab/__snapshots__/filter-tab.test.js.snap +415 -0
  55. package/src/components/atoms/filter-tab/filter-tab.component.tsx +93 -0
  56. package/src/components/atoms/filter-tab/filter-tab.preview.tsx +37 -0
  57. package/src/components/atoms/filter-tab/filter-tab.styles.js +64 -0
  58. package/src/components/atoms/filter-tab/filter-tab.test.js +38 -0
  59. package/src/components/atoms/form-actions/__snapshots__/form-action.test.js.snap +176 -0
  60. package/src/components/atoms/form-actions/form-action.component.tsx +25 -0
  61. package/src/components/atoms/form-actions/form-action.preview.tsx +29 -0
  62. package/src/components/atoms/form-actions/form-action.styles.js +19 -0
  63. package/src/components/atoms/form-actions/form-action.test.js +32 -0
  64. package/src/components/atoms/image-bubble/__snapshots__/image-bubble.test.js.snap +67 -0
  65. package/src/components/atoms/image-bubble/image-bubble.component.tsx +25 -0
  66. package/src/components/atoms/image-bubble/image-bubble.preview.tsx +19 -0
  67. package/src/components/atoms/image-bubble/image-bubble.styles.js +31 -0
  68. package/src/components/atoms/image-bubble/image-bubble.test.js +20 -0
  69. package/src/components/atoms/info/__snapshots__/info.test.js.snap +43 -0
  70. package/src/components/atoms/info/info.component.tsx +22 -0
  71. package/src/components/atoms/info/info.preview.tsx +20 -0
  72. package/src/components/atoms/info/info.styles.js +25 -0
  73. package/src/components/atoms/info/info.test.js +18 -0
  74. package/src/components/atoms/pill/__snapshots__/pill.test.js.snap +141 -0
  75. package/src/components/atoms/pill/pill.component.tsx +23 -0
  76. package/src/components/atoms/pill/pill.preview.tsx +21 -0
  77. package/src/components/atoms/pill/pill.styles.js +32 -0
  78. package/src/components/atoms/pill/pill.test.js +34 -0
  79. package/src/components/atoms/popover/components/backdrop/backdrop.component.tsx +40 -0
  80. package/src/components/atoms/popover/components/backdrop/backdrop.styles.js +15 -0
  81. package/src/components/atoms/popover/components/foreground/foreground.component.tsx +17 -0
  82. package/src/components/atoms/popover/components/foreground/foreground.styles.js +17 -0
  83. package/src/components/atoms/popover/components/index.js +5 -0
  84. package/src/components/atoms/popover/components/modal/close/close.component.tsx +21 -0
  85. package/src/components/atoms/popover/components/modal/close/close.styles.js +13 -0
  86. package/src/components/atoms/popover/components/modal/heading/heading.component.tsx +22 -0
  87. package/src/components/atoms/popover/components/modal/heading/heading.styles.js +24 -0
  88. package/src/components/atoms/popover/components/modal/modal.component.tsx +87 -0
  89. package/src/components/atoms/popover/components/modal/modal.styles.js +23 -0
  90. package/src/components/atoms/popover/components/modal/scroll-content/scroll-content.component.tsx +18 -0
  91. package/src/components/atoms/popover/components/modal/scroll-content/scroll-content.styles.js +10 -0
  92. package/src/components/atoms/popover/popover.component.tsx +60 -0
  93. package/src/components/atoms/popover/popover.preview.tsx +135 -0
  94. package/src/components/atoms/popover/popover.styles.js +12 -0
  95. package/src/components/atoms/popover-heading/__snapshots__/popover_heading.test.js.snap +35 -0
  96. package/src/components/atoms/popover-heading/popover-heading.component.tsx +22 -0
  97. package/src/components/atoms/popover-heading/popover-heading.preview.tsx +18 -0
  98. package/src/components/atoms/popover-heading/popover-heading.styles.js +19 -0
  99. package/src/components/atoms/popover-heading/popover_heading.test.js +11 -0
  100. package/src/components/atoms/pressable-icon/__snapshots__/pressable-icon.test.js.snap +364 -0
  101. package/src/components/atoms/pressable-icon/pressable-icon.component.tsx +48 -0
  102. package/src/components/atoms/pressable-icon/pressable-icon.preview.tsx +37 -0
  103. package/src/components/atoms/pressable-icon/pressable-icon.styles.js +25 -0
  104. package/src/components/atoms/pressable-icon/pressable-icon.test.js +47 -0
  105. package/src/components/atoms/quick-filter/__snapshots__/quick-filter.test.js.snap +465 -0
  106. package/src/components/atoms/quick-filter/quick-filter.component.tsx +32 -0
  107. package/src/components/atoms/quick-filter/quick-filter.prevriew.tsx +46 -0
  108. package/src/components/atoms/quick-filter/quick-filter.styles.js +68 -0
  109. package/src/components/atoms/quick-filter/quick-filter.test.js +127 -0
  110. package/src/components/atoms/select-list-item/__snapshots__/select-list-item.test.js.snap +391 -0
  111. package/src/components/atoms/select-list-item/select-list-item-preview.tsx +31 -0
  112. package/src/components/atoms/select-list-item/select-list-item.test.js +38 -0
  113. package/src/components/atoms/select-list-item/select-list.component-item.tsx +52 -0
  114. package/src/components/atoms/select-list-item/select-list.styles-item.js +40 -0
  115. package/src/components/atoms/snackbar/__snapshots__/snackbar.test.js.snap +493 -0
  116. package/src/components/atoms/snackbar/snackbar.component.tsx +28 -0
  117. package/src/components/atoms/snackbar/snackbar.preview.tsx +33 -0
  118. package/src/components/atoms/snackbar/snackbar.styles.js +82 -0
  119. package/src/components/atoms/snackbar/snackbar.test.js +35 -0
  120. package/src/components/atoms/tag/__snapshots__/tag.test.js.snap +87 -0
  121. package/src/components/atoms/tag/tag.component.tsx +37 -0
  122. package/src/components/atoms/tag/tag.preview.tsx +27 -0
  123. package/src/components/atoms/tag/tag.styles.js +22 -0
  124. package/src/components/atoms/tag/tag.test.js +24 -0
  125. package/src/components/atoms/text-bubble/__snapshots__/text-bubble.test.js.snap +337 -0
  126. package/src/components/atoms/text-bubble/text-bubble.component.tsx +32 -0
  127. package/src/components/atoms/text-bubble/text-bubble.preview.tsx +27 -0
  128. package/src/components/atoms/text-bubble/text-bubble.styles.js +64 -0
  129. package/src/components/atoms/text-bubble/text-bubble.test.js +84 -0
  130. package/src/components/atoms/text-input/__snapshots__/text-input.test.js.snap +68 -0
  131. package/src/components/atoms/text-input/text-input.component.tsx +32 -0
  132. package/src/components/atoms/text-input/text-input.preview.tsx +24 -0
  133. package/src/components/atoms/text-input/text-input.styles.js +26 -0
  134. package/src/components/atoms/text-input/text-input.test.js +32 -0
  135. package/src/components/atoms/time-tracker/__snapshots__/time-tracker.test.js.snap +206 -0
  136. package/src/components/atoms/time-tracker/time-tracker.component.tsx +24 -0
  137. package/src/components/atoms/time-tracker/time-tracker.preview.tsx +15 -0
  138. package/src/components/atoms/time-tracker/time-tracker.styles.js +36 -0
  139. package/src/components/atoms/time-tracker/time-tracker.test.js +37 -0
  140. package/src/components/atoms/wide-button/__snapshots__/wide-button.test.js.snap +92 -0
  141. package/src/components/atoms/wide-button/wide-button.component.tsx +23 -0
  142. package/src/components/atoms/wide-button/wide-button.preview.tsx +18 -0
  143. package/src/components/atoms/wide-button/wide-button.styles.js +22 -0
  144. package/src/components/atoms/wide-button/wide-button.test.js +16 -0
  145. package/src/context/theme.context.ts +49 -0
  146. package/src/gradients/main/main.gradient.tsx +20 -0
  147. package/src/gradients/main/main.styles.js +11 -0
  148. package/src/icons/__snapshots__/icons.test.js.snap +2588 -0
  149. package/src/icons/icons.test.js +245 -0
  150. package/src/icons/index.tsx +7 -0
  151. package/src/icons/outline/calendar/calendar.icon.tsx +20 -0
  152. package/src/icons/outline/chat/chat.icon.tsx +20 -0
  153. package/src/icons/outline/chat-alt/chat-alt.icon.tsx +20 -0
  154. package/src/icons/outline/check-circle/check-circle.icon.tsx +20 -0
  155. package/src/icons/outline/chevron-left/chevron-left.icon.tsx +20 -0
  156. package/src/icons/outline/chevron-right/chevron-right.icon.tsx +20 -0
  157. package/src/icons/outline/clock/clock.icon.tsx +20 -0
  158. package/src/icons/outline/cloud-download/cloud-download.icon.tsx +20 -0
  159. package/src/icons/outline/cross/cross.icon.tsx +20 -0
  160. package/src/icons/outline/currency-euro/currency-euro.icon.tsx +20 -0
  161. package/src/icons/outline/document-text/document-text.icon.tsx +20 -0
  162. package/src/icons/outline/exclamation/exclamation.icon.tsx +20 -0
  163. package/src/icons/outline/exclamation-circle/exclamation-circle.icon.tsx +20 -0
  164. package/src/icons/outline/eye/eye.icon.tsx +27 -0
  165. package/src/icons/outline/filter/filter.icon.tsx +59 -0
  166. package/src/icons/outline/information-circle/information-circle.icon.tsx +20 -0
  167. package/src/icons/outline/logout/logout.icon.tsx +20 -0
  168. package/src/icons/outline/mail/mail.icon.tsx +20 -0
  169. package/src/icons/outline/mail-open/mail-open.icon.tsx +20 -0
  170. package/src/icons/outline/menu/menu.icon.tsx +20 -0
  171. package/src/icons/outline/minus-sm/minus-sm.icon.tsx +20 -0
  172. package/src/icons/outline/office-building/office-building.icon.tsx +20 -0
  173. package/src/icons/outline/outline-default.preview.tsx +99 -0
  174. package/src/icons/outline/outline-grey.preview.tsx +100 -0
  175. package/src/icons/outline/outline-white.preview.tsx +100 -0
  176. package/src/icons/outline/outline.tsx +81 -0
  177. package/src/icons/outline/paper-airplane/paper-airplane.icon.tsx +20 -0
  178. package/src/icons/outline/paperclip/paperclip.icon.tsx +20 -0
  179. package/src/icons/outline/pencil/pencil.icon.tsx +20 -0
  180. package/src/icons/outline/phone/phone.icon.tsx +20 -0
  181. package/src/icons/outline/plus/plus.icon.tsx +20 -0
  182. package/src/icons/outline/plus-sm/plus-sm.icon.tsx +20 -0
  183. package/src/icons/outline/qrcode/qrcode.icon.tsx +17 -0
  184. package/src/icons/outline/refresh/refresh.icon.tsx +20 -0
  185. package/src/icons/outline/search/search.icon.tsx +20 -0
  186. package/src/icons/outline/selector/selector.icon.tsx +20 -0
  187. package/src/icons/outline/sm-view-grid-add/sm-view-grid-add.icon.tsx +20 -0
  188. package/src/icons/outline/status-online/status-online.icon.tsx +20 -0
  189. package/src/icons/outline/thumb-up/thumb-up.icon.tsx +20 -0
  190. package/src/icons/outline/trash/trash.icon.tsx +20 -0
  191. package/src/icons/outline/user/user.icon.tsx +27 -0
  192. package/src/icons/outline/user-group/user-group.icon.tsx +20 -0
  193. package/src/icons/outline/users/users.icon.tsx +20 -0
  194. package/src/icons/solid/chat-alt/chat-alt-solid.icon.tsx +20 -0
  195. package/src/icons/solid/clock/clock-solid.icon.tsx +20 -0
  196. package/src/icons/solid/information-circle/information-circle-solid.icon.tsx +20 -0
  197. package/src/icons/solid/pencil/pencil-solid.icon.tsx +22 -0
  198. package/src/icons/solid/phone/phone-solid.icon.tsx +18 -0
  199. package/src/icons/solid/refresh/refresh-solid.icon.tsx +20 -0
  200. package/src/icons/solid/solid.preview.tsx +73 -0
  201. package/src/icons/solid/solid.tsx +19 -0
  202. package/src/icons/solid/status-online/status-online-solid.icon.tsx +24 -0
  203. package/src/icons/solid/trash/trash-solid.icon.tsx +20 -0
  204. package/src/models/hex-color.model.ts +25 -0
  205. package/src/models/hex-color.test.js +20 -0
  206. package/src/models/initials.model.ts +32 -0
  207. package/src/models/initials.test.js +23 -0
  208. package/src/theme/font/font.ts +72 -0
  209. package/src/theme/font/index.ts +4 -0
  210. package/src/theme/font/load-fonts.ts +10 -0
  211. package/src/theme/provider/index.ts +4 -0
  212. package/src/theme/provider/parent.theme.ts +45 -0
  213. package/src/theme/provider/staff-member.theme.ts +45 -0
  214. package/src/theme/scale/index.ts +14 -0
  215. package/src/types/bubble-alignment.enum.ts +4 -0
  216. package/src/types/icontype.type.ts +3 -0
  217. package/src/types/keyboard-types.enum.ts +9 -0
  218. package/src/types/size.enum.ts +5 -0
  219. package/src/types/visual-state.enum.ts +6 -0
  220. package/tsconfig.json +7 -0
@@ -0,0 +1,176 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`test form-actions renders correctly when ONLY a button is provided 1`] = `
4
+ <View
5
+ style={
6
+ {
7
+ "paddingLeft": 8,
8
+ "paddingRight": 8,
9
+ "width": "100%",
10
+ }
11
+ }
12
+ >
13
+ <View
14
+ style={
15
+ [
16
+ {
17
+ "flexDirection": "row",
18
+ "justifyContent": "center",
19
+ },
20
+ {},
21
+ ]
22
+ }
23
+ >
24
+ <View
25
+ accessible={true}
26
+ collapsable={false}
27
+ focusable={true}
28
+ onBlur={[Function]}
29
+ onClick={[Function]}
30
+ onFocus={[Function]}
31
+ onResponderGrant={[Function]}
32
+ onResponderMove={[Function]}
33
+ onResponderRelease={[Function]}
34
+ onResponderTerminate={[Function]}
35
+ onResponderTerminationRequest={[Function]}
36
+ onStartShouldSetResponder={[Function]}
37
+ >
38
+ <View
39
+ style={
40
+ {
41
+ "alignItems": "center",
42
+ "backgroundColor": "#19216C",
43
+ "borderRadius": 50,
44
+ "flexDirection": "row",
45
+ "justifyContent": "center",
46
+ "paddingHorizontal": 24,
47
+ "paddingVertical": 12,
48
+ }
49
+ }
50
+ >
51
+ <Text
52
+ style={
53
+ {
54
+ "color": "#E0E8F9",
55
+ "fontFamily": "SourceSansPro",
56
+ "fontSize": 16,
57
+ "lineHeight": 22.4,
58
+ }
59
+ }
60
+ >
61
+ Toepassen
62
+ </Text>
63
+ </View>
64
+ </View>
65
+ </View>
66
+ </View>
67
+ `;
68
+
69
+ exports[`test form-actions renders correctly when providing button AND cancel-link 1`] = `
70
+ <View
71
+ style={
72
+ {
73
+ "paddingLeft": 8,
74
+ "paddingRight": 8,
75
+ "width": "100%",
76
+ }
77
+ }
78
+ >
79
+ <View
80
+ style={
81
+ [
82
+ {
83
+ "flexDirection": "row",
84
+ "justifyContent": "center",
85
+ },
86
+ {
87
+ "justifyContent": "space-between",
88
+ },
89
+ ]
90
+ }
91
+ >
92
+ <View
93
+ accessible={true}
94
+ collapsable={false}
95
+ focusable={true}
96
+ onBlur={[Function]}
97
+ onClick={[Function]}
98
+ onFocus={[Function]}
99
+ onResponderGrant={[Function]}
100
+ onResponderMove={[Function]}
101
+ onResponderRelease={[Function]}
102
+ onResponderTerminate={[Function]}
103
+ onResponderTerminationRequest={[Function]}
104
+ onStartShouldSetResponder={[Function]}
105
+ >
106
+ <View
107
+ style={
108
+ {
109
+ "alignItems": "center",
110
+ "backgroundColor": "transparent",
111
+ "borderRadius": 50,
112
+ "flexDirection": "row",
113
+ "justifyContent": "center",
114
+ "paddingHorizontal": 24,
115
+ "paddingVertical": 12,
116
+ }
117
+ }
118
+ >
119
+ <Text
120
+ style={
121
+ {
122
+ "color": "#F16868",
123
+ "fontFamily": "SourceSansPro",
124
+ "fontSize": 16,
125
+ "lineHeight": 22.4,
126
+ }
127
+ }
128
+ >
129
+ Filter Wissen
130
+ </Text>
131
+ </View>
132
+ </View>
133
+ <View
134
+ accessible={true}
135
+ collapsable={false}
136
+ focusable={true}
137
+ onBlur={[Function]}
138
+ onClick={[Function]}
139
+ onFocus={[Function]}
140
+ onResponderGrant={[Function]}
141
+ onResponderMove={[Function]}
142
+ onResponderRelease={[Function]}
143
+ onResponderTerminate={[Function]}
144
+ onResponderTerminationRequest={[Function]}
145
+ onStartShouldSetResponder={[Function]}
146
+ >
147
+ <View
148
+ style={
149
+ {
150
+ "alignItems": "center",
151
+ "backgroundColor": "#19216C",
152
+ "borderRadius": 50,
153
+ "flexDirection": "row",
154
+ "justifyContent": "center",
155
+ "paddingHorizontal": 24,
156
+ "paddingVertical": 12,
157
+ }
158
+ }
159
+ >
160
+ <Text
161
+ style={
162
+ {
163
+ "color": "#E0E8F9",
164
+ "fontFamily": "SourceSansPro",
165
+ "fontSize": 16,
166
+ "lineHeight": 22.4,
167
+ }
168
+ }
169
+ >
170
+ Toepassen
171
+ </Text>
172
+ </View>
173
+ </View>
174
+ </View>
175
+ </View>
176
+ `;
@@ -0,0 +1,25 @@
1
+ import React, {useContext} from 'react';
2
+ import {ThemeCtx} from '../../../context/theme.context';
3
+ import {View} from 'react-native';
4
+ import {Stylesheet} from './form-action.styles';
5
+
6
+ type formActionProps = {
7
+ button: React.ReactNode;
8
+ cancel?: React.ReactNode;
9
+ };
10
+
11
+ const FormAction = ({button, cancel}: formActionProps) => {
12
+ const context = useContext(ThemeCtx);
13
+ const styles = Stylesheet(context);
14
+
15
+ return (
16
+ <View style={styles.element}>
17
+ <View style={[styles.inner, cancel ? styles.cancel : {}]}>
18
+ {cancel ? cancel : null}
19
+ {button}
20
+ </View>
21
+ </View>
22
+ );
23
+ };
24
+
25
+ export {FormAction as FormAction};
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import {Button} from '../button/button.component';
3
+ import {CancelLink} from '../cancel-link/cancel-link.component';
4
+ import {View} from 'react-native';
5
+ import {FormAction} from './form-action.component';
6
+
7
+ export const FormActionPreview = ({}: {}) => {
8
+ return (
9
+ <View
10
+ style={{
11
+ flex: 1,
12
+ alignItems: 'center',
13
+ justifyContent: 'center',
14
+ }}
15
+ >
16
+ <FormAction button={<Button label="test enkel button" />} />
17
+
18
+ <FormAction
19
+ button={<Button label="test button" />}
20
+ cancel={
21
+ <CancelLink
22
+ label="test cancel"
23
+ onPress={() => console.log('cancel')}
24
+ />
25
+ }
26
+ />
27
+ </View>
28
+ );
29
+ };
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import {StyleSheet} from 'react-native';
3
+ import {Scale} from '../../../theme/scale';
4
+
5
+ export const Stylesheet = (context) =>
6
+ StyleSheet.create({
7
+ element: {
8
+ width: '100%',
9
+ paddingRight: Scale.xs,
10
+ paddingLeft: Scale.xs,
11
+ },
12
+ inner: {
13
+ flexDirection: 'row',
14
+ justifyContent: 'center',
15
+ },
16
+ cancel: {
17
+ justifyContent: 'space-between',
18
+ },
19
+ });
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import renderer from 'react-test-renderer';
3
+ import {FormAction} from './form-action.component';
4
+ import {Button} from '../button/button.component';
5
+ import {CancelLink} from '../cancel-link/cancel-link.component';
6
+
7
+ describe('test form-actions', () => {
8
+ it('renders correctly when providing button AND cancel-link', () => {
9
+ const tree = renderer
10
+ .create(
11
+ <FormAction
12
+ button={<Button label={'Toepassen'} />}
13
+ cancel={
14
+ <CancelLink
15
+ label={'Filter Wissen'}
16
+ onPress={() => console.log('canceled')}
17
+ />
18
+ }
19
+ />
20
+ )
21
+ .toJSON();
22
+
23
+ expect(tree).toMatchSnapshot();
24
+ });
25
+ it('renders correctly when ONLY a button is provided ', () => {
26
+ const tree = renderer
27
+ .create(<FormAction button={<Button label={'Toepassen'} />} />)
28
+ .toJSON();
29
+
30
+ expect(tree).toMatchSnapshot();
31
+ });
32
+ });
@@ -0,0 +1,67 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`test image-bubble given the bubbleAlignment is SENT return a text-bubble with right-bottom tip 1`] = `
4
+ <View>
5
+ <View
6
+ style={
7
+ [
8
+ {
9
+ "alignItems": "center",
10
+ "borderRadius": 24,
11
+ "justifyContent": "center",
12
+ "maxWidth": "80%",
13
+ "overflow": "hidden",
14
+ },
15
+ false,
16
+ {
17
+ "borderBottomLeftRadius": 32,
18
+ "borderBottomRightRadius": 8,
19
+ "marginLeft": 48,
20
+ "marginRight": 16,
21
+ },
22
+ ]
23
+ }
24
+ >
25
+ <Image
26
+ style={
27
+ {
28
+ "resizeMode": "cover",
29
+ }
30
+ }
31
+ />
32
+ </View>
33
+ </View>
34
+ `;
35
+
36
+ exports[`test image-bubble given the visualState is RECEIVE return a text-bubble with left-bottom tip 1`] = `
37
+ <View>
38
+ <View
39
+ style={
40
+ [
41
+ {
42
+ "alignItems": "center",
43
+ "borderRadius": 24,
44
+ "justifyContent": "center",
45
+ "maxWidth": "80%",
46
+ "overflow": "hidden",
47
+ },
48
+ {
49
+ "borderBottomLeftRadius": 8,
50
+ "borderBottomRightRadius": 32,
51
+ "marginLeft": 16,
52
+ "marginRight": 48,
53
+ },
54
+ false,
55
+ ]
56
+ }
57
+ >
58
+ <Image
59
+ style={
60
+ {
61
+ "resizeMode": "cover",
62
+ }
63
+ }
64
+ />
65
+ </View>
66
+ </View>
67
+ `;
@@ -0,0 +1,25 @@
1
+ import React, {useContext} from 'react';
2
+ import {View, Image, ImageSourcePropType, ImageStyle} from 'react-native';
3
+ import {Stylesheet} from './image-bubble.styles';
4
+ import {ThemeCtx} from '../../../context/theme.context';
5
+ import {BubbleAlignment} from '../../../types/bubble-alignment.enum';
6
+
7
+ type ImageBubbleProps = {
8
+ source: ImageSourcePropType;
9
+ bubbleAlignment: BubbleAlignment;
10
+ };
11
+
12
+ const ImageBubble = ({source, bubbleAlignment}: ImageBubbleProps) => {
13
+ const Context = useContext(ThemeCtx);
14
+ const styles = Stylesheet(Context, bubbleAlignment);
15
+
16
+ return (
17
+ <View>
18
+ <View style={styles.container}>
19
+ <Image style={styles.image as ImageStyle} source={source} />
20
+ </View>
21
+ </View>
22
+ );
23
+ };
24
+
25
+ export {ImageBubble as ImageBubble};
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import {ImageBubble} from './image-bubble.component';
3
+ import {BubbleAlignment} from '../../../types/bubble-alignment.enum';
4
+ const {View} = require('react-native');
5
+
6
+ export const ImageBubblePreview = ({}: {}) => {
7
+ return (
8
+ <View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
9
+ <ImageBubble
10
+ source={require('./../../../../assets/components/avatar/baby.png')}
11
+ bubbleAlignment={BubbleAlignment.SENT}
12
+ />
13
+ <ImageBubble
14
+ source={require('./../../../../assets/components/avatar/baby.png')}
15
+ bubbleAlignment={BubbleAlignment.RECEIVE}
16
+ />
17
+ </View>
18
+ );
19
+ };
@@ -0,0 +1,31 @@
1
+ import {StyleSheet} from 'react-native';
2
+ import {BubbleAlignment} from '../../../types/bubble-alignment.enum';
3
+ import {Scale} from '../../../theme/scale';
4
+
5
+ export const Stylesheet = (context, bubbleAlignment) =>
6
+ StyleSheet.create({
7
+ container: [
8
+ {
9
+ maxWidth: '80%',
10
+ borderRadius: Scale.l,
11
+ overflow: 'hidden',
12
+ justifyContent: 'center',
13
+ alignItems: 'center',
14
+ },
15
+ bubbleAlignment === BubbleAlignment.RECEIVE && {
16
+ borderBottomLeftRadius: Scale.xs,
17
+ borderBottomRightRadius: Scale.xl,
18
+ marginRight: Scale.xxl,
19
+ marginLeft: Scale.m,
20
+ },
21
+ bubbleAlignment === BubbleAlignment.SENT && {
22
+ borderBottomRightRadius: Scale.xs,
23
+ borderBottomLeftRadius: Scale.xl,
24
+ marginLeft: Scale.xxl,
25
+ marginRight: Scale.m,
26
+ },
27
+ ],
28
+ image: {
29
+ resizeMode: 'cover',
30
+ },
31
+ });
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import renderer from 'react-test-renderer';
3
+ import {ImageBubble} from './image-bubble.component';
4
+
5
+ describe('test image-bubble', () => {
6
+ it('given the bubbleAlignment is SENT return a text-bubble with right-bottom tip', () => {
7
+ const tree = renderer
8
+ .create(<ImageBubble bubbleAlignment="SENT" />)
9
+ .toJSON();
10
+
11
+ expect(tree).toMatchSnapshot();
12
+ });
13
+ it('given the visualState is RECEIVE return a text-bubble with left-bottom tip', () => {
14
+ const tree = renderer
15
+ .create(<ImageBubble bubbleAlignment="RECEIVE" />)
16
+ .toJSON();
17
+
18
+ expect(tree).toMatchSnapshot();
19
+ });
20
+ });
@@ -0,0 +1,43 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Test info component should render an info component with a label and description 1`] = `
4
+ <View
5
+ style={
6
+ {
7
+ "alignItems": "flex-start",
8
+ "backgroundColor": "#F5F7FA",
9
+ "borderRadius": 16,
10
+ "justifyContent": "flex-start",
11
+ "paddingHorizontal": 24,
12
+ "paddingVertical": 12,
13
+ "width": "100%",
14
+ }
15
+ }
16
+ >
17
+ <Text
18
+ style={
19
+ {
20
+ "color": "#1F2933",
21
+ "fontFamily": "SourceSansProBold",
22
+ "fontSize": 18,
23
+ "lineHeight": 22.6,
24
+ "marginBottom": 4,
25
+ }
26
+ }
27
+ >
28
+ Mijn Gezin
29
+ </Text>
30
+ <Text
31
+ style={
32
+ {
33
+ "color": "#515F6C",
34
+ "fontFamily": "Montserrat",
35
+ "fontSize": 13,
36
+ "lineHeight": 20.4,
37
+ }
38
+ }
39
+ >
40
+ Volg hier de dag van uw kinderen
41
+ </Text>
42
+ </View>
43
+ `;
@@ -0,0 +1,22 @@
1
+ import React, {useContext} from 'react';
2
+ import {ThemeCtx} from '../../../context/theme.context';
3
+ import {Text, View} from 'react-native';
4
+ import {Stylesheet} from './info.styles';
5
+
6
+ type InfoProps = {
7
+ label: string;
8
+ description: string;
9
+ };
10
+
11
+ const Info = ({label, description}: InfoProps) => {
12
+ const context = useContext(ThemeCtx);
13
+ const styles = Stylesheet(context);
14
+
15
+ return (
16
+ <View style={styles.container}>
17
+ <Text style={styles.label}>{label}</Text>
18
+ <Text style={styles.description}>{description}</Text>
19
+ </View>
20
+ );
21
+ };
22
+ export {Info as Info};
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import {Info} from './info.component';
3
+ const {View} = require('react-native');
4
+
5
+ export const InfoPreview = ({}: {}) => {
6
+ return (
7
+ <View
8
+ style={{
9
+ flex: 1,
10
+ alignItems: 'center',
11
+ justifyContent: 'center',
12
+ }}
13
+ >
14
+ <Info
15
+ label={'Mijn Gezin'}
16
+ description={'Volg hier de dag van uw kinderen'}
17
+ />
18
+ </View>
19
+ );
20
+ };
@@ -0,0 +1,25 @@
1
+ import {StyleSheet} from 'react-native';
2
+ import {Font} from '../../../theme/font';
3
+ import {Scale} from '../../../theme/scale';
4
+
5
+ export const Stylesheet = (context) =>
6
+ StyleSheet.create({
7
+ container: {
8
+ width: '100%',
9
+ backgroundColor: context.colors.ui.xlightgrey,
10
+ borderRadius: Scale.m,
11
+ alignItems: 'flex-start',
12
+ justifyContent: 'flex-start',
13
+ paddingVertical: Scale.s,
14
+ paddingHorizontal: Scale.l,
15
+ },
16
+ label: {
17
+ ...Font.largeBold,
18
+ color: context.colors.ui.black,
19
+ marginBottom: Scale.xxs,
20
+ },
21
+ description: {
22
+ ...Font.small,
23
+ color: context.colors.ui.darkgrey,
24
+ },
25
+ });
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import renderer from 'react-test-renderer';
3
+ import {Info} from './info.component';
4
+
5
+ describe('Test info component', () => {
6
+ it('should render an info component with a label and description', () => {
7
+ const tree = renderer
8
+ .create(
9
+ <Info
10
+ label={'Mijn Gezin'}
11
+ description={'Volg hier de dag van uw kinderen'}
12
+ />
13
+ )
14
+ .toJSON();
15
+
16
+ expect(tree).toMatchSnapshot();
17
+ });
18
+ });