@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,635 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`test child list item component arrow appears when selectable is false 1`] = `
4
+ <View
5
+ style={
6
+ {
7
+ "backgroundColor": "#FFFFFF",
8
+ "borderBottomLeftRadius": 48,
9
+ "borderBottomRightRadius": 24,
10
+ "borderTopLeftRadius": 48,
11
+ "borderTopRightRadius": 24,
12
+ "flexDirection": "row",
13
+ "overflow": "hidden",
14
+ "width": "100%",
15
+ }
16
+ }
17
+ >
18
+ <View
19
+ accessible={true}
20
+ collapsable={false}
21
+ focusable={true}
22
+ onBlur={[Function]}
23
+ onClick={[Function]}
24
+ onFocus={[Function]}
25
+ onResponderGrant={[Function]}
26
+ onResponderMove={[Function]}
27
+ onResponderRelease={[Function]}
28
+ onResponderTerminate={[Function]}
29
+ onResponderTerminationRequest={[Function]}
30
+ onStartShouldSetResponder={[Function]}
31
+ style={
32
+ {
33
+ "alignItems": "center",
34
+ "borderBottomLeftRadius": 48,
35
+ "borderBottomRightRadius": 24,
36
+ "borderTopLeftRadius": 48,
37
+ "borderTopRightRadius": 24,
38
+ "flex": 1,
39
+ "flexDirection": "row",
40
+ "padding": 8,
41
+ }
42
+ }
43
+ >
44
+ <View
45
+ style={
46
+ [
47
+ {
48
+ "alignItems": "center",
49
+ "backgroundColor": "#647ACB",
50
+ "justifyContent": "center",
51
+ "overflow": "hidden",
52
+ },
53
+ false,
54
+ {
55
+ "borderRadius": 36,
56
+ "height": 72,
57
+ "width": 72,
58
+ },
59
+ false,
60
+ ]
61
+ }
62
+ >
63
+ <ViewManagerAdapter_ExpoLinearGradient
64
+ proxiedProperties={
65
+ {
66
+ "colors": [
67
+ 4281681564,
68
+ 4284775115,
69
+ 4292481661,
70
+ ],
71
+ "endPoint": [
72
+ 0.9,
73
+ 0.9,
74
+ ],
75
+ "locations": [
76
+ 0,
77
+ 0.55,
78
+ 1,
79
+ ],
80
+ "startPoint": [
81
+ 0.1,
82
+ 0.1,
83
+ ],
84
+ }
85
+ }
86
+ style={
87
+ [
88
+ {
89
+ "height": "100%",
90
+ "width": "100%",
91
+ },
92
+ ]
93
+ }
94
+ />
95
+ <Image
96
+ source={1}
97
+ style={
98
+ [
99
+ {
100
+ "borderRadius": 50,
101
+ "height": "90%",
102
+ "position": "absolute",
103
+ "width": "90%",
104
+ },
105
+ ]
106
+ }
107
+ />
108
+ </View>
109
+ <View
110
+ style={
111
+ {
112
+ "flex": 1,
113
+ "marginLeft": 16,
114
+ "marginRight": 32,
115
+ }
116
+ }
117
+ >
118
+ <View
119
+ style={
120
+ {
121
+ "alignItems": "center",
122
+ "flexDirection": "row",
123
+ }
124
+ }
125
+ >
126
+ <View
127
+ style={
128
+ [
129
+ {
130
+ "borderRadius": 6,
131
+ "height": 12,
132
+ "marginRight": 4,
133
+ "width": 12,
134
+ },
135
+ false,
136
+ {
137
+ "backgroundColor": "#83D56C",
138
+ },
139
+ false,
140
+ false,
141
+ ]
142
+ }
143
+ />
144
+ <Text
145
+ style={
146
+ {
147
+ "color": "#1F2933",
148
+ "fontFamily": "Montserrat",
149
+ "fontSize": 11,
150
+ "lineHeight": 17.9,
151
+ }
152
+ }
153
+ >
154
+ time tracker
155
+ </Text>
156
+ </View>
157
+ <View>
158
+ <Text
159
+ ellipsizeMode="tail"
160
+ numberOfLines={1}
161
+ style={
162
+ {
163
+ "color": "#1F2933",
164
+ "fontFamily": "SourceSansProBold",
165
+ "fontSize": 24,
166
+ "lineHeight": 30.2,
167
+ }
168
+ }
169
+ >
170
+ Jean-Paul Janssens-Peeters
171
+ </Text>
172
+ <Text
173
+ style={
174
+ {
175
+ "color": "#1F2933",
176
+ "fontFamily": "Montserrat",
177
+ "fontSize": 13,
178
+ "lineHeight": 20.4,
179
+ }
180
+ }
181
+ >
182
+ De Teddybeertjes
183
+ </Text>
184
+ </View>
185
+ </View>
186
+ </View>
187
+ <View
188
+ accessible={true}
189
+ collapsable={false}
190
+ focusable={true}
191
+ onBlur={[Function]}
192
+ onClick={[Function]}
193
+ onFocus={[Function]}
194
+ onResponderGrant={[Function]}
195
+ onResponderMove={[Function]}
196
+ onResponderRelease={[Function]}
197
+ onResponderTerminate={[Function]}
198
+ onResponderTerminationRequest={[Function]}
199
+ onStartShouldSetResponder={[Function]}
200
+ style={
201
+ {
202
+ "alignItems": "center",
203
+ "justifyContent": "center",
204
+ }
205
+ }
206
+ >
207
+ <RNSVGSvgView
208
+ align="xMidYMid"
209
+ bbHeight="28"
210
+ bbWidth="28"
211
+ fill="none"
212
+ focusable={false}
213
+ height="28"
214
+ meetOrSlice={0}
215
+ minX={0}
216
+ minY={0}
217
+ style={
218
+ [
219
+ {
220
+ "backgroundColor": "transparent",
221
+ "borderWidth": 0,
222
+ },
223
+ {
224
+ "flex": 0,
225
+ "height": 28,
226
+ "width": 28,
227
+ },
228
+ ]
229
+ }
230
+ vbHeight={27}
231
+ vbWidth={26}
232
+ width="28"
233
+ >
234
+ <RNSVGGroup
235
+ fill={null}
236
+ propList={
237
+ [
238
+ "fill",
239
+ ]
240
+ }
241
+ >
242
+ <RNSVGPath
243
+ d="M9.75 5.625L17.3333 13.5L9.75 21.375"
244
+ propList={
245
+ [
246
+ "stroke",
247
+ "strokeWidth",
248
+ "strokeLinecap",
249
+ "strokeLinejoin",
250
+ ]
251
+ }
252
+ stroke={4279837036}
253
+ strokeLinecap={1}
254
+ strokeLinejoin={1}
255
+ strokeWidth="2"
256
+ />
257
+ </RNSVGGroup>
258
+ </RNSVGSvgView>
259
+ </View>
260
+ </View>
261
+ `;
262
+
263
+ exports[`test child list item component background is blue and text is white when isSelected is true 1`] = `
264
+ <View
265
+ style={
266
+ {
267
+ "backgroundColor": "#7B93DB",
268
+ "borderBottomLeftRadius": 48,
269
+ "borderBottomRightRadius": 24,
270
+ "borderTopLeftRadius": 48,
271
+ "borderTopRightRadius": 24,
272
+ "flexDirection": "row",
273
+ "overflow": "hidden",
274
+ "width": "100%",
275
+ }
276
+ }
277
+ >
278
+ <View
279
+ accessible={true}
280
+ collapsable={false}
281
+ focusable={true}
282
+ onBlur={[Function]}
283
+ onClick={[Function]}
284
+ onFocus={[Function]}
285
+ onResponderGrant={[Function]}
286
+ onResponderMove={[Function]}
287
+ onResponderRelease={[Function]}
288
+ onResponderTerminate={[Function]}
289
+ onResponderTerminationRequest={[Function]}
290
+ onStartShouldSetResponder={[Function]}
291
+ style={
292
+ {
293
+ "alignItems": "center",
294
+ "borderBottomLeftRadius": 48,
295
+ "borderBottomRightRadius": 24,
296
+ "borderTopLeftRadius": 48,
297
+ "borderTopRightRadius": 24,
298
+ "flex": 1,
299
+ "flexDirection": "row",
300
+ "padding": 8,
301
+ }
302
+ }
303
+ >
304
+ <View
305
+ style={
306
+ [
307
+ {
308
+ "alignItems": "center",
309
+ "backgroundColor": "#647ACB",
310
+ "justifyContent": "center",
311
+ "overflow": "hidden",
312
+ },
313
+ false,
314
+ {
315
+ "borderRadius": 36,
316
+ "height": 72,
317
+ "width": 72,
318
+ },
319
+ false,
320
+ ]
321
+ }
322
+ >
323
+ <ViewManagerAdapter_ExpoLinearGradient
324
+ proxiedProperties={
325
+ {
326
+ "colors": [
327
+ 4281681564,
328
+ 4284775115,
329
+ 4292481661,
330
+ ],
331
+ "endPoint": [
332
+ 0.9,
333
+ 0.9,
334
+ ],
335
+ "locations": [
336
+ 0,
337
+ 0.55,
338
+ 1,
339
+ ],
340
+ "startPoint": [
341
+ 0.1,
342
+ 0.1,
343
+ ],
344
+ }
345
+ }
346
+ style={
347
+ [
348
+ {
349
+ "height": "100%",
350
+ "width": "100%",
351
+ },
352
+ ]
353
+ }
354
+ />
355
+ <Image
356
+ source={1}
357
+ style={
358
+ [
359
+ {
360
+ "borderRadius": 50,
361
+ "height": "90%",
362
+ "position": "absolute",
363
+ "width": "90%",
364
+ },
365
+ ]
366
+ }
367
+ />
368
+ </View>
369
+ <View
370
+ style={
371
+ {
372
+ "flex": 1,
373
+ "marginLeft": 16,
374
+ "marginRight": 64,
375
+ }
376
+ }
377
+ >
378
+ <View
379
+ style={
380
+ {
381
+ "alignItems": "center",
382
+ "flexDirection": "row",
383
+ }
384
+ }
385
+ >
386
+ <View
387
+ style={
388
+ [
389
+ {
390
+ "borderRadius": 6,
391
+ "height": 12,
392
+ "marginRight": 4,
393
+ "width": 12,
394
+ },
395
+ false,
396
+ {
397
+ "backgroundColor": "#83D56C",
398
+ },
399
+ false,
400
+ false,
401
+ ]
402
+ }
403
+ />
404
+ <Text
405
+ style={
406
+ {
407
+ "color": "#FFFFFF",
408
+ "fontFamily": "Montserrat",
409
+ "fontSize": 11,
410
+ "lineHeight": 17.9,
411
+ }
412
+ }
413
+ >
414
+ time tracker
415
+ </Text>
416
+ </View>
417
+ <View>
418
+ <Text
419
+ ellipsizeMode="tail"
420
+ numberOfLines={1}
421
+ style={
422
+ {
423
+ "color": "#FFFFFF",
424
+ "fontFamily": "SourceSansProBold",
425
+ "fontSize": 24,
426
+ "lineHeight": 30.2,
427
+ }
428
+ }
429
+ >
430
+ Jean-Paul Janssens-Peeters
431
+ </Text>
432
+ <Text
433
+ style={
434
+ {
435
+ "color": "#FFFFFF",
436
+ "fontFamily": "Montserrat",
437
+ "fontSize": 13,
438
+ "lineHeight": 20.4,
439
+ }
440
+ }
441
+ >
442
+ De Teddybeertjes
443
+ </Text>
444
+ </View>
445
+ </View>
446
+ </View>
447
+ </View>
448
+ `;
449
+
450
+ exports[`test child list item component make text that is too long end in ... 1`] = `
451
+ <View
452
+ style={
453
+ {
454
+ "backgroundColor": "#FFFFFF",
455
+ "borderBottomLeftRadius": 48,
456
+ "borderBottomRightRadius": 24,
457
+ "borderTopLeftRadius": 48,
458
+ "borderTopRightRadius": 24,
459
+ "flexDirection": "row",
460
+ "overflow": "hidden",
461
+ "width": "100%",
462
+ }
463
+ }
464
+ >
465
+ <View
466
+ accessible={true}
467
+ collapsable={false}
468
+ focusable={true}
469
+ onBlur={[Function]}
470
+ onClick={[Function]}
471
+ onFocus={[Function]}
472
+ onResponderGrant={[Function]}
473
+ onResponderMove={[Function]}
474
+ onResponderRelease={[Function]}
475
+ onResponderTerminate={[Function]}
476
+ onResponderTerminationRequest={[Function]}
477
+ onStartShouldSetResponder={[Function]}
478
+ style={
479
+ {
480
+ "alignItems": "center",
481
+ "borderBottomLeftRadius": 48,
482
+ "borderBottomRightRadius": 24,
483
+ "borderTopLeftRadius": 48,
484
+ "borderTopRightRadius": 24,
485
+ "flex": 1,
486
+ "flexDirection": "row",
487
+ "padding": 8,
488
+ }
489
+ }
490
+ >
491
+ <View
492
+ style={
493
+ [
494
+ {
495
+ "alignItems": "center",
496
+ "backgroundColor": "#647ACB",
497
+ "justifyContent": "center",
498
+ "overflow": "hidden",
499
+ },
500
+ false,
501
+ {
502
+ "borderRadius": 36,
503
+ "height": 72,
504
+ "width": 72,
505
+ },
506
+ false,
507
+ ]
508
+ }
509
+ >
510
+ <ViewManagerAdapter_ExpoLinearGradient
511
+ proxiedProperties={
512
+ {
513
+ "colors": [
514
+ 4281681564,
515
+ 4284775115,
516
+ 4292481661,
517
+ ],
518
+ "endPoint": [
519
+ 0.9,
520
+ 0.9,
521
+ ],
522
+ "locations": [
523
+ 0,
524
+ 0.55,
525
+ 1,
526
+ ],
527
+ "startPoint": [
528
+ 0.1,
529
+ 0.1,
530
+ ],
531
+ }
532
+ }
533
+ style={
534
+ [
535
+ {
536
+ "height": "100%",
537
+ "width": "100%",
538
+ },
539
+ ]
540
+ }
541
+ />
542
+ <Image
543
+ source={1}
544
+ style={
545
+ [
546
+ {
547
+ "borderRadius": 50,
548
+ "height": "90%",
549
+ "position": "absolute",
550
+ "width": "90%",
551
+ },
552
+ ]
553
+ }
554
+ />
555
+ </View>
556
+ <View
557
+ style={
558
+ {
559
+ "flex": 1,
560
+ "marginLeft": 16,
561
+ "marginRight": 64,
562
+ }
563
+ }
564
+ >
565
+ <View
566
+ style={
567
+ {
568
+ "alignItems": "center",
569
+ "flexDirection": "row",
570
+ }
571
+ }
572
+ >
573
+ <View
574
+ style={
575
+ [
576
+ {
577
+ "borderRadius": 6,
578
+ "height": 12,
579
+ "marginRight": 4,
580
+ "width": 12,
581
+ },
582
+ false,
583
+ {
584
+ "backgroundColor": "#83D56C",
585
+ },
586
+ false,
587
+ false,
588
+ ]
589
+ }
590
+ />
591
+ <Text
592
+ style={
593
+ {
594
+ "color": "#1F2933",
595
+ "fontFamily": "Montserrat",
596
+ "fontSize": 11,
597
+ "lineHeight": 17.9,
598
+ }
599
+ }
600
+ >
601
+ time tracker
602
+ </Text>
603
+ </View>
604
+ <View>
605
+ <Text
606
+ ellipsizeMode="tail"
607
+ numberOfLines={1}
608
+ style={
609
+ {
610
+ "color": "#1F2933",
611
+ "fontFamily": "SourceSansProBold",
612
+ "fontSize": 24,
613
+ "lineHeight": 30.2,
614
+ }
615
+ }
616
+ >
617
+ Jean-Paul Janssens-Peeters
618
+ </Text>
619
+ <Text
620
+ style={
621
+ {
622
+ "color": "#1F2933",
623
+ "fontFamily": "Montserrat",
624
+ "fontSize": 13,
625
+ "lineHeight": 20.4,
626
+ }
627
+ }
628
+ >
629
+ De Teddybeertjes
630
+ </Text>
631
+ </View>
632
+ </View>
633
+ </View>
634
+ </View>
635
+ `;
@@ -0,0 +1,81 @@
1
+ import React, {useContext} from 'react';
2
+ import {ThemeCtx} from '../../../context/theme.context';
3
+ import {ImageSourcePropType, Pressable, View, Text} from 'react-native';
4
+ import {Initials} from '../../../models/initials.model';
5
+ import {Size} from '../../../types/size.enum';
6
+ import {VisualState} from '../../../types/visual-state.enum';
7
+ import {Avatar} from '../avatar/avatar.component';
8
+ import {ChevronRightIcon} from '../../../icons/outline/chevron-right/chevron-right.icon';
9
+ import {Stylesheet} from './child-list-item.styles';
10
+
11
+ type ChildListItemProps = {
12
+ id: string;
13
+ name: string;
14
+ label: string;
15
+ selectable: boolean;
16
+ isSelected: boolean;
17
+ onPressArrow: () => void;
18
+ onPressText: () => void;
19
+ onSelect: (id: string) => void;
20
+ sourceAvatar: ImageSourcePropType | Initials;
21
+ textTimeTracker: string;
22
+ visualStateTimeTracker: VisualState;
23
+ };
24
+
25
+ const ChildListItem = ({
26
+ id,
27
+ name,
28
+ label,
29
+ selectable,
30
+ isSelected,
31
+ onPressArrow,
32
+ onPressText,
33
+ onSelect,
34
+ sourceAvatar,
35
+ textTimeTracker,
36
+ visualStateTimeTracker,
37
+ }: ChildListItemProps) => {
38
+ const context = useContext(ThemeCtx);
39
+ const styles = Stylesheet(
40
+ isSelected,
41
+ context,
42
+ selectable,
43
+ visualStateTimeTracker
44
+ );
45
+
46
+ const onPressSelectable = () => {
47
+ selectable ? onSelect(id) : onPressText();
48
+ };
49
+
50
+ return (
51
+ <View style={styles.container}>
52
+ <Pressable onPress={onPressSelectable} style={styles.innerContainer}>
53
+ <Avatar source={sourceAvatar} size={Size.MEDIUM} />
54
+ <View style={styles.pressableText}>
55
+ <View style={styles.trackerContainer}>
56
+ <View style={styles.bal} />
57
+ <Text style={styles.textTracker}>{textTimeTracker}</Text>
58
+ </View>
59
+ <View>
60
+ <Text
61
+ numberOfLines={1}
62
+ ellipsizeMode={'tail'}
63
+ style={styles.textName}
64
+ >
65
+ {name}
66
+ </Text>
67
+ <Text style={styles.textLabel}>{label}</Text>
68
+ </View>
69
+ </View>
70
+ </Pressable>
71
+ <>
72
+ {!selectable ? (
73
+ <Pressable onPress={onPressArrow} style={styles.iconContainer}>
74
+ <ChevronRightIcon />
75
+ </Pressable>
76
+ ) : null}
77
+ </>
78
+ </View>
79
+ );
80
+ };
81
+ export {ChildListItem as ChildListItem};