@tactics/toddle-styleguide 1.2.8 → 1.3.0
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 +11 -0
- package/index.d.ts +2 -1
- package/index.tsx +2 -0
- package/package.json +1 -1
- package/src/components/atoms/calendar/__snapshots__/calendar.test.js.snap +18 -18
- package/src/components/atoms/line/line.component.d.ts +12 -0
- package/src/components/atoms/line/line.component.tsx +23 -0
- package/src/components/atoms/line/line.preview.d.ts +1 -0
- package/src/components/atoms/line/line.preview.tsx +54 -0
- package/src/components/atoms/line/line.styles.d.ts +12 -0
- package/src/components/atoms/line/line.styles.js +10 -0
- package/src/components/atoms/quick-message/__snapshots__/quick-message.test.js.snap +72 -1
- package/src/components/atoms/quick-message/quick-message.component.d.ts +2 -0
- package/src/components/atoms/quick-message/quick-message.component.tsx +3 -1
- package/src/components/atoms/quick-message/quick-message.preview.tsx +10 -1
- package/src/components/atoms/quick-message/quick-message.styles.d.ts +4 -1
- package/src/components/atoms/quick-message/quick-message.styles.js +4 -2
- package/src/components/atoms/quick-message/quick-message.test.js +38 -6
- package/src/components/atoms/text-input/__snapshots__/text-input.test.js.snap +38 -78
- package/src/components/atoms/text-input/text-input.component.tsx +6 -9
- package/src/components/atoms/text-input/text-input.preview.tsx +3 -3
- package/src/components/atoms/text-input/text-input.styles.d.ts +9 -25
- package/src/components/atoms/text-input/text-input.styles.js +7 -13
- package/src/components/molecules/day/__snapshots__/day.test.js.snap +24 -24
- package/src/components/molecules/day/day.component.tsx +17 -4
- package/src/components/molecules/day/day.styles.d.ts +33 -42
- package/src/components/molecules/day/day.styles.js +14 -17
- package/src/components/molecules/failed-to-send/failed-bubble.component.d.ts +2 -2
- package/src/components/molecules/failed-to-send/failed-bubble.component.tsx +39 -22
- package/src/components/molecules/password-input/__snapshots__/password-input.test.js.snap +53 -68
- package/src/components/molecules/password-input/password-input.component.tsx +7 -9
- package/src/components/molecules/password-input/password-input.styles.d.ts +8 -7
- package/src/components/molecules/password-input/password-input.styles.js +6 -6
- package/src/components/molecules/search-input/__snapshots__/search.test.js.snap +30 -31
- package/src/components/molecules/search-input/search.component.d.ts +9 -11
- package/src/components/molecules/search-input/search.component.tsx +19 -30
- package/src/components/molecules/search-input/search.preview.tsx +8 -6
- package/src/components/molecules/search-input/search.styles.d.ts +12 -11
- package/src/components/molecules/search-input/search.styles.js +14 -8
- package/src/components/molecules/search-input/search.test.js +3 -1
- package/src/components/molecules/send-bubble/__snapshots__/send-text-bubble.test.js.snap +12 -32
- package/src/components/molecules/send-bubble/send-text-bubble.component.d.ts +4 -4
- package/src/components/molecules/send-bubble/send-text-bubble.component.tsx +36 -25
- package/src/components/molecules/send-bubble/send-text-bubble.styles.d.ts +4 -7
- package/src/components/molecules/send-bubble/send-text-bubble.styles.js +2 -8
- package/src/components/molecules/timeline/__snapshots__/timeline.test.js.snap +4 -4
- package/src/components/molecules/timeline/timeline.styles.d.ts +1 -1
- package/src/components/molecules/timeline/timeline.styles.js +2 -2
- package/src/components/molecules/timestamp/__snapshots__/timestamp.test.js.snap +2 -1
- package/src/components/molecules/timestamp/timestamp.component.d.ts +2 -1
- package/src/components/molecules/timestamp/timestamp.component.tsx +4 -7
- package/src/components/organisms/child-list-item/__snapshots__/child-list-item.test.js.snap +165 -10
- package/src/components/organisms/child-list-item/child-list-item.component.d.ts +2 -0
- package/src/components/organisms/child-list-item/child-list-item.component.tsx +24 -1
- package/src/components/organisms/child-list-item/child-list-item.preview.tsx +11 -0
- package/src/components/organisms/child-list-item/child-list-item.styles.d.ts +0 -3
- package/src/components/organisms/child-list-item/child-list-item.styles.js +2 -3
- package/src/components/organisms/child-list-item/child-list-item.test.js +9 -4
- package/src/components/organisms/child-list-item/components/child-list-tag.component.d.ts +9 -0
- package/src/components/organisms/child-list-item/components/child-list-tag.component.tsx +28 -0
- package/src/components/organisms/child-list-item/components/child-list-tag.styles.d.ts +13 -0
- package/src/components/organisms/child-list-item/components/child-list-tag.styles.js +16 -0
- package/src/components/organisms/day-select/day-select.preview.tsx +9 -5
- package/src/components/organisms/journal-entry/components/entry-type-indicator/entry-type-indicator.d.ts +9 -0
- package/src/components/organisms/journal-entry/components/entry-type-indicator/entry-type-indicator.styles.d.ts +13 -0
- package/src/components/organisms/journal-entry/components/entry-type-indicator/entry-type-indicator.styles.js +17 -0
- package/src/components/organisms/journal-entry/components/entry-type-indicator/entry-type-indicator.test.js +21 -0
- package/src/components/organisms/journal-entry/components/entry-type-indicator/entry-type-indicator.tsx +97 -0
- package/src/components/organisms/journal-entry/components/index.d.ts +2 -0
- package/src/components/organisms/journal-entry/components/index.ts +2 -0
- package/src/components/organisms/journal-entry/components/journal-entry-type/__snapshots__/journal-entry-type.test.js.snap +304 -0
- package/src/components/organisms/journal-entry/components/journal-entry-type/journal-entry-type.component.d.ts +16 -0
- package/src/components/organisms/journal-entry/components/journal-entry-type/journal-entry-type.component.tsx +60 -0
- package/src/components/organisms/journal-entry/components/journal-entry-type/journal-entry-type.styles.d.ts +13 -0
- package/src/components/organisms/journal-entry/components/journal-entry-type/journal-entry-type.styles.js +16 -0
- package/src/components/organisms/journal-entry/components/journal-entry-type/journal-entry-type.test.js +48 -0
- package/src/components/organisms/journal-entry/journal-entry.component.d.ts +38 -0
- package/src/components/organisms/journal-entry/journal-entry.component.tsx +139 -0
- package/src/components/organisms/journal-entry/journal-entry.preview.d.ts +1 -0
- package/src/components/organisms/journal-entry/journal-entry.preview.tsx +212 -0
- package/src/components/organisms/journal-entry/journal-entry.styles.d.ts +42 -0
- package/src/components/organisms/journal-entry/journal-entry.styles.js +35 -0
- package/src/components/organisms/my-child-list-item/__snapshots__/my-child-list-item.test.js.snap +143 -399
- package/src/components/organisms/my-child-list-item/my-child-list-item.component.d.ts +5 -7
- package/src/components/organisms/my-child-list-item/my-child-list-item.component.tsx +32 -59
- package/src/components/organisms/my-child-list-item/my-child-list-item.preview.tsx +36 -24
- package/src/components/organisms/my-child-list-item/my-child-list-item.styles.d.ts +15 -11
- package/src/components/organisms/my-child-list-item/my-child-list-item.styles.js +16 -11
- package/src/components/organisms/my-child-list-item/my-child-list-item.test.js +5 -22
- package/src/components/organisms/text-bubble/__snapshots__/text-bubble.test.js.snap +45 -29
- package/src/components/organisms/text-bubble/text-bubble.component.d.ts +8 -6
- package/src/components/organisms/text-bubble/text-bubble.component.tsx +14 -12
- package/src/components/organisms/text-bubble/text-bubble.preview.tsx +14 -19
- package/src/components/organisms/text-bubble/text-bubble.styles.d.ts +14 -3
- package/src/components/organisms/text-bubble/text-bubble.styles.js +6 -0
- package/src/components/organisms/text-bubble/text-bubble.test.js +7 -7
- package/src/components/templates/modal/components/fade-panel.component.tsx +1 -1
- package/src/utilities/toddle-datetime/interfaces/toddle-datetime.interface.d.ts +4 -0
- package/src/utilities/toddle-datetime/interfaces/toddle-datetime.interface.tsx +6 -0
- package/src/utilities/toddle-datetime/toddle-datetime.class.d.ts +14 -1
- package/src/utilities/toddle-datetime/toddle-datetime.class.tsx +31 -2
- package/src/utilities/toddle-datetime/toddle-datetime.preview.tsx +114 -84
- package/src/utilities/toddle-datetime/types/{duration-like.type.d.ts → duration.type.d.ts} +2 -0
- package/src/utilities/toddle-datetime/types/{duration-like.type.tsx → duration.type.tsx} +3 -0
- package/src/utilities/toddle-datetime/types/toddle-datetime.type.d.ts +1 -0
- package/src/utilities/toddle-datetime/types/toddle-datetime.type.tsx +8 -1
|
@@ -5,9 +5,9 @@ exports[`test child list item component arrow appears when selectable is false 1
|
|
|
5
5
|
style={
|
|
6
6
|
{
|
|
7
7
|
"backgroundColor": "#FFFFFF",
|
|
8
|
-
"borderBottomLeftRadius":
|
|
8
|
+
"borderBottomLeftRadius": 32,
|
|
9
9
|
"borderBottomRightRadius": 24,
|
|
10
|
-
"borderTopLeftRadius":
|
|
10
|
+
"borderTopLeftRadius": 32,
|
|
11
11
|
"borderTopRightRadius": 24,
|
|
12
12
|
"flexDirection": "row",
|
|
13
13
|
"width": "100%",
|
|
@@ -46,7 +46,6 @@ exports[`test child list item component arrow appears when selectable is false 1
|
|
|
46
46
|
onStartShouldSetResponder={[Function]}
|
|
47
47
|
style={
|
|
48
48
|
{
|
|
49
|
-
"alignItems": "center",
|
|
50
49
|
"borderBottomLeftRadius": 48,
|
|
51
50
|
"borderBottomRightRadius": 24,
|
|
52
51
|
"borderTopLeftRadius": 48,
|
|
@@ -239,6 +238,85 @@ exports[`test child list item component arrow appears when selectable is false 1
|
|
|
239
238
|
De Teddybeertjes
|
|
240
239
|
</Text>
|
|
241
240
|
</View>
|
|
241
|
+
<View
|
|
242
|
+
style={
|
|
243
|
+
{
|
|
244
|
+
"flexDirection": "row",
|
|
245
|
+
"flexWrap": "wrap",
|
|
246
|
+
"gap": 6,
|
|
247
|
+
"marginTop": 10,
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
>
|
|
251
|
+
<View
|
|
252
|
+
style={
|
|
253
|
+
{
|
|
254
|
+
"backgroundColor": "#E5E8EB",
|
|
255
|
+
"borderRadius": 50,
|
|
256
|
+
"paddingBottom": 4,
|
|
257
|
+
"paddingLeft": 12,
|
|
258
|
+
"paddingRight": 12,
|
|
259
|
+
"paddingTop": 4,
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
>
|
|
263
|
+
<Text
|
|
264
|
+
style={
|
|
265
|
+
[
|
|
266
|
+
[
|
|
267
|
+
{
|
|
268
|
+
"fontFamily": "Montserrat",
|
|
269
|
+
"fontSize": 11,
|
|
270
|
+
"lineHeight": 17.9,
|
|
271
|
+
},
|
|
272
|
+
],
|
|
273
|
+
{
|
|
274
|
+
"color": "#515F6C",
|
|
275
|
+
"textAlign": "center",
|
|
276
|
+
"width": "100%",
|
|
277
|
+
},
|
|
278
|
+
undefined,
|
|
279
|
+
]
|
|
280
|
+
}
|
|
281
|
+
>
|
|
282
|
+
tag1
|
|
283
|
+
</Text>
|
|
284
|
+
</View>
|
|
285
|
+
<View
|
|
286
|
+
style={
|
|
287
|
+
{
|
|
288
|
+
"backgroundColor": "#E5E8EB",
|
|
289
|
+
"borderRadius": 50,
|
|
290
|
+
"paddingBottom": 4,
|
|
291
|
+
"paddingLeft": 12,
|
|
292
|
+
"paddingRight": 12,
|
|
293
|
+
"paddingTop": 4,
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
>
|
|
297
|
+
<Text
|
|
298
|
+
style={
|
|
299
|
+
[
|
|
300
|
+
[
|
|
301
|
+
{
|
|
302
|
+
"fontFamily": "Montserrat",
|
|
303
|
+
"fontSize": 11,
|
|
304
|
+
"lineHeight": 17.9,
|
|
305
|
+
},
|
|
306
|
+
],
|
|
307
|
+
{
|
|
308
|
+
"color": "#515F6C",
|
|
309
|
+
"textAlign": "center",
|
|
310
|
+
"width": "100%",
|
|
311
|
+
},
|
|
312
|
+
undefined,
|
|
313
|
+
]
|
|
314
|
+
}
|
|
315
|
+
>
|
|
316
|
+
tag2
|
|
317
|
+
</Text>
|
|
318
|
+
</View>
|
|
319
|
+
</View>
|
|
242
320
|
</View>
|
|
243
321
|
</View>
|
|
244
322
|
<View
|
|
@@ -348,9 +426,9 @@ exports[`test child list item component background is blue and text is white whe
|
|
|
348
426
|
style={
|
|
349
427
|
{
|
|
350
428
|
"backgroundColor": "#7B93DB",
|
|
351
|
-
"borderBottomLeftRadius":
|
|
429
|
+
"borderBottomLeftRadius": 32,
|
|
352
430
|
"borderBottomRightRadius": 24,
|
|
353
|
-
"borderTopLeftRadius":
|
|
431
|
+
"borderTopLeftRadius": 32,
|
|
354
432
|
"borderTopRightRadius": 24,
|
|
355
433
|
"flexDirection": "row",
|
|
356
434
|
"width": "100%",
|
|
@@ -389,7 +467,6 @@ exports[`test child list item component background is blue and text is white whe
|
|
|
389
467
|
onStartShouldSetResponder={[Function]}
|
|
390
468
|
style={
|
|
391
469
|
{
|
|
392
|
-
"alignItems": "center",
|
|
393
470
|
"borderBottomLeftRadius": 48,
|
|
394
471
|
"borderBottomRightRadius": 24,
|
|
395
472
|
"borderTopLeftRadius": 48,
|
|
@@ -587,14 +664,14 @@ exports[`test child list item component background is blue and text is white whe
|
|
|
587
664
|
</View>
|
|
588
665
|
`;
|
|
589
666
|
|
|
590
|
-
exports[`test child list item component make text that is too long end in ... 1`] = `
|
|
667
|
+
exports[`test child list item component make text that is too long end in ... and has tags 1`] = `
|
|
591
668
|
<View
|
|
592
669
|
style={
|
|
593
670
|
{
|
|
594
671
|
"backgroundColor": "#FFFFFF",
|
|
595
|
-
"borderBottomLeftRadius":
|
|
672
|
+
"borderBottomLeftRadius": 32,
|
|
596
673
|
"borderBottomRightRadius": 24,
|
|
597
|
-
"borderTopLeftRadius":
|
|
674
|
+
"borderTopLeftRadius": 32,
|
|
598
675
|
"borderTopRightRadius": 24,
|
|
599
676
|
"flexDirection": "row",
|
|
600
677
|
"width": "100%",
|
|
@@ -633,7 +710,6 @@ exports[`test child list item component make text that is too long end in ... 1`
|
|
|
633
710
|
onStartShouldSetResponder={[Function]}
|
|
634
711
|
style={
|
|
635
712
|
{
|
|
636
|
-
"alignItems": "center",
|
|
637
713
|
"borderBottomLeftRadius": 48,
|
|
638
714
|
"borderBottomRightRadius": 24,
|
|
639
715
|
"borderTopLeftRadius": 48,
|
|
@@ -826,6 +902,85 @@ exports[`test child list item component make text that is too long end in ... 1`
|
|
|
826
902
|
De Teddybeertjes
|
|
827
903
|
</Text>
|
|
828
904
|
</View>
|
|
905
|
+
<View
|
|
906
|
+
style={
|
|
907
|
+
{
|
|
908
|
+
"flexDirection": "row",
|
|
909
|
+
"flexWrap": "wrap",
|
|
910
|
+
"gap": 6,
|
|
911
|
+
"marginTop": 10,
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
>
|
|
915
|
+
<View
|
|
916
|
+
style={
|
|
917
|
+
{
|
|
918
|
+
"backgroundColor": "#E5E8EB",
|
|
919
|
+
"borderRadius": 50,
|
|
920
|
+
"paddingBottom": 4,
|
|
921
|
+
"paddingLeft": 12,
|
|
922
|
+
"paddingRight": 12,
|
|
923
|
+
"paddingTop": 4,
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
>
|
|
927
|
+
<Text
|
|
928
|
+
style={
|
|
929
|
+
[
|
|
930
|
+
[
|
|
931
|
+
{
|
|
932
|
+
"fontFamily": "Montserrat",
|
|
933
|
+
"fontSize": 11,
|
|
934
|
+
"lineHeight": 17.9,
|
|
935
|
+
},
|
|
936
|
+
],
|
|
937
|
+
{
|
|
938
|
+
"color": "#515F6C",
|
|
939
|
+
"textAlign": "center",
|
|
940
|
+
"width": "100%",
|
|
941
|
+
},
|
|
942
|
+
undefined,
|
|
943
|
+
]
|
|
944
|
+
}
|
|
945
|
+
>
|
|
946
|
+
tag1
|
|
947
|
+
</Text>
|
|
948
|
+
</View>
|
|
949
|
+
<View
|
|
950
|
+
style={
|
|
951
|
+
{
|
|
952
|
+
"backgroundColor": "#E5E8EB",
|
|
953
|
+
"borderRadius": 50,
|
|
954
|
+
"paddingBottom": 4,
|
|
955
|
+
"paddingLeft": 12,
|
|
956
|
+
"paddingRight": 12,
|
|
957
|
+
"paddingTop": 4,
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
>
|
|
961
|
+
<Text
|
|
962
|
+
style={
|
|
963
|
+
[
|
|
964
|
+
[
|
|
965
|
+
{
|
|
966
|
+
"fontFamily": "Montserrat",
|
|
967
|
+
"fontSize": 11,
|
|
968
|
+
"lineHeight": 17.9,
|
|
969
|
+
},
|
|
970
|
+
],
|
|
971
|
+
{
|
|
972
|
+
"color": "#515F6C",
|
|
973
|
+
"textAlign": "center",
|
|
974
|
+
"width": "100%",
|
|
975
|
+
},
|
|
976
|
+
undefined,
|
|
977
|
+
]
|
|
978
|
+
}
|
|
979
|
+
>
|
|
980
|
+
tag2
|
|
981
|
+
</Text>
|
|
982
|
+
</View>
|
|
983
|
+
</View>
|
|
829
984
|
</View>
|
|
830
985
|
</View>
|
|
831
986
|
</View>
|
|
@@ -15,6 +15,7 @@ type ChildListItemProps = {
|
|
|
15
15
|
sourceAvatar: ImageSourcePropType | Initials;
|
|
16
16
|
textTimeTracker: string;
|
|
17
17
|
visualStateTimeTracker: VisualState;
|
|
18
|
+
tags?: string[];
|
|
18
19
|
};
|
|
19
20
|
declare const ChildListItem: React.MemoExoticComponent<
|
|
20
21
|
({
|
|
@@ -30,6 +31,7 @@ declare const ChildListItem: React.MemoExoticComponent<
|
|
|
30
31
|
sourceAvatar,
|
|
31
32
|
textTimeTracker,
|
|
32
33
|
visualStateTimeTracker,
|
|
34
|
+
tags,
|
|
33
35
|
}: ChildListItemProps) => JSX.Element
|
|
34
36
|
>;
|
|
35
37
|
export {ChildListItem as ChildListItem};
|
|
@@ -8,10 +8,11 @@ import {Size} from '../../../types/size.enum';
|
|
|
8
8
|
import {VisualState} from '../../../types/visual-state.enum';
|
|
9
9
|
import {Avatar} from '../../molecules/avatar/avatar.component';
|
|
10
10
|
import {Stylesheet} from './child-list-item.styles';
|
|
11
|
-
import {SmallText} from '../../atoms/paragraph-components';
|
|
11
|
+
import {SmallText, TinyText} from '../../atoms/paragraph-components';
|
|
12
12
|
import {Heading2} from '../../atoms/heading-components';
|
|
13
13
|
import {TimeTracker} from '../../molecules/time-tracker/time-tracker.component';
|
|
14
14
|
import {Icon} from '../../../icons/index';
|
|
15
|
+
import {ChildListTag} from './components/child-list-tag.component';
|
|
15
16
|
|
|
16
17
|
type ChildListItemProps = {
|
|
17
18
|
id: string;
|
|
@@ -26,6 +27,7 @@ type ChildListItemProps = {
|
|
|
26
27
|
sourceAvatar: ImageSourcePropType | Initials;
|
|
27
28
|
textTimeTracker: string;
|
|
28
29
|
visualStateTimeTracker: VisualState;
|
|
30
|
+
tags?: string[];
|
|
29
31
|
};
|
|
30
32
|
|
|
31
33
|
const ChildListItem = React.memo(
|
|
@@ -42,6 +44,7 @@ const ChildListItem = React.memo(
|
|
|
42
44
|
sourceAvatar,
|
|
43
45
|
textTimeTracker,
|
|
44
46
|
visualStateTimeTracker,
|
|
47
|
+
tags,
|
|
45
48
|
}: ChildListItemProps) => {
|
|
46
49
|
const context = useContext(ThemeCtx);
|
|
47
50
|
const styles = Stylesheet(isSelected, context);
|
|
@@ -105,6 +108,26 @@ const ChildListItem = React.memo(
|
|
|
105
108
|
{department}
|
|
106
109
|
</SmallText>
|
|
107
110
|
</View>
|
|
111
|
+
{tags && (
|
|
112
|
+
<View
|
|
113
|
+
style={{
|
|
114
|
+
flexDirection: 'row',
|
|
115
|
+
gap: 6,
|
|
116
|
+
flexWrap: 'wrap',
|
|
117
|
+
marginTop: 10,
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
{tags.map((tag) => {
|
|
121
|
+
return (
|
|
122
|
+
<ChildListTag
|
|
123
|
+
key={`${id}--${tag}`}
|
|
124
|
+
label={tag}
|
|
125
|
+
isSelected={isSelected}
|
|
126
|
+
/>
|
|
127
|
+
);
|
|
128
|
+
})}
|
|
129
|
+
</View>
|
|
130
|
+
)}
|
|
108
131
|
</View>
|
|
109
132
|
</Pressable>
|
|
110
133
|
{!selectable && (
|
|
@@ -10,14 +10,23 @@ interface IData {
|
|
|
10
10
|
id: string;
|
|
11
11
|
name: string;
|
|
12
12
|
department: string;
|
|
13
|
+
tags?: string[];
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
const data: IData[] = [];
|
|
16
17
|
for (let i = 0; i < 6; i++) {
|
|
18
|
+
const tagsChance = Math.random(); // Generate a random number between 0 and 1
|
|
19
|
+
let tagsArray: string[] | undefined;
|
|
20
|
+
|
|
21
|
+
if (tagsChance > 0.5) {
|
|
22
|
+
tagsArray = ['Gezondheid', 'Allergie', 'Voedsel', 'Slaap'];
|
|
23
|
+
}
|
|
24
|
+
|
|
17
25
|
data.push({
|
|
18
26
|
id: 'child' + i,
|
|
19
27
|
name: 'Children with very long names because in 2023 we give our kids special name',
|
|
20
28
|
department: 'De Teddybeertjes',
|
|
29
|
+
tags: tagsArray,
|
|
21
30
|
});
|
|
22
31
|
}
|
|
23
32
|
|
|
@@ -63,6 +72,7 @@ export const ChildListItemPreview = ({}: {}) => {
|
|
|
63
72
|
sourceAvatar={Initials.for('Zeno', 'Driesen')}
|
|
64
73
|
textTimeTracker={'3u45m'}
|
|
65
74
|
visualStateTimeTracker={VisualState.SUCCESS}
|
|
75
|
+
tags={item.tags}
|
|
66
76
|
/>
|
|
67
77
|
);
|
|
68
78
|
};
|
|
@@ -92,6 +102,7 @@ export const ChildListItemPreview = ({}: {}) => {
|
|
|
92
102
|
style={{
|
|
93
103
|
flex: 1,
|
|
94
104
|
}}
|
|
105
|
+
contentContainerStyle={{gap: 16}}
|
|
95
106
|
data={data}
|
|
96
107
|
renderItem={renderChildList}
|
|
97
108
|
keyExtractor={(item) => item.id}
|
|
@@ -8,7 +8,6 @@ export function Stylesheet(
|
|
|
8
8
|
borderBottomRightRadius: number;
|
|
9
9
|
borderTopLeftRadius: number;
|
|
10
10
|
borderBottomLeftRadius: number;
|
|
11
|
-
overflow: 'hidden';
|
|
12
11
|
flexDirection: 'row';
|
|
13
12
|
backgroundColor: any;
|
|
14
13
|
};
|
|
@@ -16,7 +15,6 @@ export function Stylesheet(
|
|
|
16
15
|
flex: number;
|
|
17
16
|
padding: number;
|
|
18
17
|
flexDirection: 'row';
|
|
19
|
-
alignItems: 'center';
|
|
20
18
|
borderTopRightRadius: number;
|
|
21
19
|
borderBottomRightRadius: number;
|
|
22
20
|
borderTopLeftRadius: number;
|
|
@@ -33,7 +31,6 @@ export function Stylesheet(
|
|
|
33
31
|
width: number;
|
|
34
32
|
borderTopRightRadius: number;
|
|
35
33
|
borderBottomRightRadius: number;
|
|
36
|
-
overflow: 'hidden';
|
|
37
34
|
};
|
|
38
35
|
trackerContainer: {
|
|
39
36
|
flexDirection: 'row';
|
|
@@ -8,8 +8,8 @@ export const Stylesheet = (isSelectedItem, context) =>
|
|
|
8
8
|
width: '100%',
|
|
9
9
|
borderTopRightRadius: Scale.l,
|
|
10
10
|
borderBottomRightRadius: Scale.l,
|
|
11
|
-
borderTopLeftRadius: Scale.
|
|
12
|
-
borderBottomLeftRadius: Scale.
|
|
11
|
+
borderTopLeftRadius: Scale.xl,
|
|
12
|
+
borderBottomLeftRadius: Scale.xl,
|
|
13
13
|
flexDirection: 'row',
|
|
14
14
|
backgroundColor: isSelectedItem
|
|
15
15
|
? context.colors.main[6]
|
|
@@ -19,7 +19,6 @@ export const Stylesheet = (isSelectedItem, context) =>
|
|
|
19
19
|
flex: 1,
|
|
20
20
|
padding: Scale.xs,
|
|
21
21
|
flexDirection: 'row',
|
|
22
|
-
alignItems: 'center',
|
|
23
22
|
borderTopRightRadius: Scale.l,
|
|
24
23
|
borderBottomRightRadius: Scale.l,
|
|
25
24
|
borderTopLeftRadius: Scale.xxl,
|
|
@@ -4,11 +4,11 @@ import {ChildListItem} from './child-list-item.component';
|
|
|
4
4
|
import {VisualState} from '../../../types/visual-state.enum';
|
|
5
5
|
|
|
6
6
|
describe('test child list item component', () => {
|
|
7
|
-
it('make text that is too long end in ...', () => {
|
|
7
|
+
it('make text that is too long end in ... and has tags', () => {
|
|
8
8
|
const tree = render
|
|
9
9
|
.create(
|
|
10
10
|
<ChildListItem
|
|
11
|
-
id={1}
|
|
11
|
+
id={'1'}
|
|
12
12
|
name={'Jean-Paul Janssens-Peeters'}
|
|
13
13
|
department={'De Teddybeertjes'}
|
|
14
14
|
selectable={true}
|
|
@@ -16,9 +16,11 @@ describe('test child list item component', () => {
|
|
|
16
16
|
onPressArrow={() => console.log('pressedArrow')}
|
|
17
17
|
onPressText={() => console.log('pressedText')}
|
|
18
18
|
onSelect={() => console.log('selected')}
|
|
19
|
+
onLongPress={() => console.log('long press')}
|
|
19
20
|
sourceAvatar={require('./../../../../assets/components/avatar/baby.png')}
|
|
20
21
|
textTimeTracker={'time tracker'}
|
|
21
22
|
visualStateTimeTracker={VisualState.SUCCESS}
|
|
23
|
+
tags={['tag1', 'tag2']}
|
|
22
24
|
/>
|
|
23
25
|
)
|
|
24
26
|
.toJSON();
|
|
@@ -29,7 +31,7 @@ describe('test child list item component', () => {
|
|
|
29
31
|
const tree = render
|
|
30
32
|
.create(
|
|
31
33
|
<ChildListItem
|
|
32
|
-
id={1}
|
|
34
|
+
id={'1'}
|
|
33
35
|
name={'Jean-Paul Janssens-Peeters'}
|
|
34
36
|
department={'De Teddybeertjes'}
|
|
35
37
|
selectable={true}
|
|
@@ -37,6 +39,7 @@ describe('test child list item component', () => {
|
|
|
37
39
|
onPressArrow={() => console.log('pressedArrow')}
|
|
38
40
|
onPressText={() => console.log('pressedText')}
|
|
39
41
|
onSelect={() => console.log('selected')}
|
|
42
|
+
onLongPress={() => console.log('long press')}
|
|
40
43
|
sourceAvatar={require('./../../../../assets/components/avatar/baby.png')}
|
|
41
44
|
textTimeTracker={'time tracker'}
|
|
42
45
|
visualStateTimeTracker={VisualState.SUCCESS}
|
|
@@ -50,7 +53,7 @@ describe('test child list item component', () => {
|
|
|
50
53
|
const tree = render
|
|
51
54
|
.create(
|
|
52
55
|
<ChildListItem
|
|
53
|
-
id={1}
|
|
56
|
+
id={'1'}
|
|
54
57
|
name={'Jean-Paul Janssens-Peeters'}
|
|
55
58
|
department={'De Teddybeertjes'}
|
|
56
59
|
selectable={false}
|
|
@@ -58,9 +61,11 @@ describe('test child list item component', () => {
|
|
|
58
61
|
onPressArrow={() => console.log('pressedArrow')}
|
|
59
62
|
onPressText={() => console.log('pressedText')}
|
|
60
63
|
onSelect={() => console.log('selected')}
|
|
64
|
+
onLongPress={() => console.log('long press')}
|
|
61
65
|
sourceAvatar={require('./../../../../assets/components/avatar/baby.png')}
|
|
62
66
|
textTimeTracker={'time tracker'}
|
|
63
67
|
visualStateTimeTracker={VisualState.SUCCESS}
|
|
68
|
+
tags={['tag1', 'tag2']}
|
|
64
69
|
/>
|
|
65
70
|
)
|
|
66
71
|
.toJSON();
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React, {useContext} from 'react';
|
|
2
|
+
import {View} from 'react-native';
|
|
3
|
+
import {TinyText} from '../../../atoms/paragraph-components';
|
|
4
|
+
import {ThemeCtx} from '../../../../context/theme.context';
|
|
5
|
+
import {Stylesheet} from './child-list-tag.styles';
|
|
6
|
+
|
|
7
|
+
type ChildListTagProps = {
|
|
8
|
+
label: string;
|
|
9
|
+
isSelected: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const ChildListTag = ({label, isSelected}: ChildListTagProps) => {
|
|
13
|
+
const context = useContext(ThemeCtx);
|
|
14
|
+
const styles = Stylesheet(context, isSelected);
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<View style={styles.rootContainer}>
|
|
18
|
+
<TinyText
|
|
19
|
+
textAlign={'center'}
|
|
20
|
+
textColor={
|
|
21
|
+
!isSelected ? context.colors.ui.darkgrey : context.colors.ui.white
|
|
22
|
+
}
|
|
23
|
+
>
|
|
24
|
+
{label}
|
|
25
|
+
</TinyText>
|
|
26
|
+
</View>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {StyleSheet} from 'react-native';
|
|
2
|
+
import {Scale} from '../../../../theme/scale/index';
|
|
3
|
+
|
|
4
|
+
export const Stylesheet = (context, isSelected) =>
|
|
5
|
+
StyleSheet.create({
|
|
6
|
+
rootContainer: {
|
|
7
|
+
backgroundColor: !isSelected
|
|
8
|
+
? context.colors.ui.lightgrey
|
|
9
|
+
: context.colors.main[5],
|
|
10
|
+
borderRadius: 50,
|
|
11
|
+
paddingLeft: Scale.s,
|
|
12
|
+
paddingTop: Scale.xxs,
|
|
13
|
+
paddingRight: Scale.s,
|
|
14
|
+
paddingBottom: Scale.xxs,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
@@ -5,14 +5,18 @@ import {View} from 'react-native';
|
|
|
5
5
|
import {ToddleDateTime} from '../../../utilities/toddle-datetime/toddle-datetime.class';
|
|
6
6
|
|
|
7
7
|
export const DaySelectPreview = ({}: {}) => {
|
|
8
|
-
const [
|
|
8
|
+
const [startOfWeek, setStartOfWeek] = useState(ToddleDateTime.local());
|
|
9
|
+
|
|
10
|
+
const [selectedDate, setSelectedDate] = useState<ToddleDateTime>(
|
|
11
|
+
ToddleDateTime.local()
|
|
12
|
+
);
|
|
9
13
|
|
|
10
14
|
return (
|
|
11
|
-
<View>
|
|
15
|
+
<View style={{paddingHorizontal: 48}}>
|
|
12
16
|
<DaySelect
|
|
13
|
-
startDate={
|
|
14
|
-
onSelectDate={
|
|
15
|
-
selectedDate={
|
|
17
|
+
startDate={startOfWeek}
|
|
18
|
+
onSelectDate={setSelectedDate}
|
|
19
|
+
selectedDate={selectedDate}
|
|
16
20
|
/>
|
|
17
21
|
</View>
|
|
18
22
|
);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {StyleSheet} from 'react-native';
|
|
2
|
+
import {Scale} from '../../../../../theme/scale/index';
|
|
3
|
+
|
|
4
|
+
export const Stylesheet = () =>
|
|
5
|
+
StyleSheet.create({
|
|
6
|
+
rootContainer: {
|
|
7
|
+
width: Scale.l + 8,
|
|
8
|
+
height: Scale.l + 8,
|
|
9
|
+
justifyContent: 'center',
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
},
|
|
12
|
+
indicator: {
|
|
13
|
+
width: Scale.m,
|
|
14
|
+
height: Scale.m,
|
|
15
|
+
borderRadius: Scale.m / 2,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {render} from '@testing-library/react-native';
|
|
3
|
+
import {EntryTypeIndicator} from './entry-type-indicator';
|
|
4
|
+
|
|
5
|
+
describe('EntryTypeIndicator', () => {
|
|
6
|
+
it('should render without errors', () => {
|
|
7
|
+
render(<EntryTypeIndicator />);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('should apply loading animation when loading is true', () => {
|
|
11
|
+
const {getByTestId} = render(<EntryTypeIndicator loading={true} />);
|
|
12
|
+
const indicator = getByTestId('indicator');
|
|
13
|
+
expect(indicator).toBeDefined();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('should not apply loading animation when loading is false', () => {
|
|
17
|
+
const {getByTestId} = render(<EntryTypeIndicator loading={false} />);
|
|
18
|
+
const indicator = getByTestId('indicator');
|
|
19
|
+
expect(indicator).toBeDefined();
|
|
20
|
+
});
|
|
21
|
+
});
|