@tactics/toddle-styleguide 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/.github/workflows/publish_styleguide.yaml +30 -0
  2. package/App.tsx +30 -10
  3. package/index.tsx +39 -22
  4. package/package.json +5 -2
  5. package/src/components/atoms/avatar/avatar.component.tsx +1 -1
  6. package/src/components/atoms/button/button.component.tsx +1 -1
  7. package/src/components/atoms/calendar/__snapshots__/calendar.test.js.snap +5813 -0
  8. package/src/components/atoms/calendar/calendar.component.tsx +94 -0
  9. package/src/components/atoms/calendar/calendar.preview.tsx +44 -0
  10. package/src/components/atoms/calendar/calendar.styles.js +88 -0
  11. package/src/components/atoms/calendar/calendar.test.js +30 -0
  12. package/src/components/atoms/cancel-link/cancel-link.component.tsx +1 -1
  13. package/src/components/atoms/check-switch/check-switch.component.tsx +1 -1
  14. package/src/components/atoms/checkbox/checkbox.component.tsx +1 -1
  15. package/src/components/atoms/child-list-item/child-list-item.component.tsx +1 -1
  16. package/src/components/atoms/child-list-item/child-list-item.styles.js +5 -5
  17. package/src/components/atoms/contact-item/contact-item.component.tsx +1 -1
  18. package/src/components/atoms/filter-tab/filter-tab.component.tsx +1 -1
  19. package/src/components/atoms/form-actions/form-action.component.tsx +1 -1
  20. package/src/components/atoms/image-bubble/image-bubble.component.tsx +1 -1
  21. package/src/components/atoms/increment-input/__snapshots__/increment-input.test.js.snap +210 -0
  22. package/src/components/atoms/increment-input/increment-input.component.tsx +41 -0
  23. package/src/components/atoms/increment-input/increment-input.preview.tsx +28 -0
  24. package/src/components/atoms/increment-input/increment-input.styles.js +49 -0
  25. package/src/components/atoms/increment-input/increment-input.test.js +14 -0
  26. package/src/components/atoms/info/info.component.tsx +1 -1
  27. package/src/components/atoms/logo/__snapshots__/logo.test.js.snap +103 -0
  28. package/src/components/atoms/logo/logo.component.tsx +39 -0
  29. package/src/components/atoms/logo/logo.preview.tsx +15 -0
  30. package/src/components/atoms/logo/logo.test.js +16 -0
  31. package/src/components/atoms/pill/pill.component.tsx +1 -1
  32. package/src/components/atoms/popover/components/backdrop/backdrop.component.tsx +1 -1
  33. package/src/components/atoms/popover/components/foreground/foreground.component.tsx +1 -1
  34. package/src/components/atoms/popover/components/modal/close/close.component.tsx +1 -1
  35. package/src/components/atoms/popover/components/modal/heading/heading.component.tsx +1 -1
  36. package/src/components/atoms/popover/components/modal/modal.component.tsx +1 -1
  37. package/src/components/atoms/popover/components/modal/scroll-content/scroll-content.component.tsx +1 -1
  38. package/src/components/atoms/popover/popover.component.tsx +1 -1
  39. package/src/components/atoms/pressable-icon/pressable-icon.component.tsx +1 -1
  40. package/src/components/atoms/quick-filter/quick-filter.component.tsx +1 -1
  41. package/src/components/atoms/select-list-item/select-list-item.component.tsx +1 -1
  42. package/src/components/atoms/snackbar/snackbar.component.tsx +1 -1
  43. package/src/components/atoms/swipe/Swipe.styles.js +12 -0
  44. package/src/components/atoms/swipe/__snapshots__/swipe.test.js.snap +589 -0
  45. package/src/components/atoms/swipe/swipe.component.tsx +39 -0
  46. package/src/components/atoms/swipe/swipe.preview.tsx +64 -0
  47. package/src/components/atoms/swipe/swipe.test.js +46 -0
  48. package/src/components/atoms/tag/tag.component.tsx +1 -1
  49. package/src/components/atoms/text-bubble/text-bubble.component.tsx +1 -1
  50. package/src/components/atoms/text-input/text-input.component.tsx +1 -1
  51. package/src/components/atoms/text-input/text-input.preview.tsx +10 -4
  52. package/src/components/atoms/text-input/text-input.styles.js +1 -1
  53. package/src/components/atoms/time-tracker/time-tracker.component.tsx +1 -1
  54. package/src/components/atoms/timeline/__snapshots__/timeline.test.js.snap +181 -0
  55. package/src/components/atoms/timeline/timeline.component.tsx +161 -0
  56. package/src/components/atoms/timeline/timeline.preview.tsx +43 -0
  57. package/src/components/atoms/timeline/timeline.styles.js +41 -0
  58. package/src/components/atoms/timeline/timeline.test.js +18 -0
  59. package/src/components/atoms/wide-button/wide-button.component.tsx +1 -1
@@ -0,0 +1,589 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Test Swipe component should render an swipe component with dots and navigation arrows 1`] = `
4
+ <View
5
+ style={
6
+ {
7
+ "alignItems": "center",
8
+ "height": 85,
9
+ "justifyContent": "center",
10
+ }
11
+ }
12
+ >
13
+ <View
14
+ onLayout={[Function]}
15
+ style={
16
+ [
17
+ {
18
+ "backgroundColor": "transparent",
19
+ "flex": 1,
20
+ "position": "relative",
21
+ },
22
+ undefined,
23
+ ]
24
+ }
25
+ >
26
+ <RCTScrollView
27
+ activeDotColor="#98AEEB"
28
+ automaticallyAdjustContentInsets={false}
29
+ autoplay={false}
30
+ autoplayDirection={true}
31
+ autoplayTimeout={2.5}
32
+ bounces={false}
33
+ contentContainerStyle={
34
+ [
35
+ {
36
+ "backgroundColor": "transparent",
37
+ },
38
+ undefined,
39
+ ]
40
+ }
41
+ contentOffset={
42
+ {
43
+ "x": 0,
44
+ }
45
+ }
46
+ disableNextButton={false}
47
+ disablePrevButton={false}
48
+ dotColor="#E5E8EB"
49
+ horizontal={true}
50
+ index={0}
51
+ loadMinimal={false}
52
+ loadMinimalSize={1}
53
+ loop={true}
54
+ nextButton={
55
+ <ChevronRightIcon
56
+ color="#19216C"
57
+ />
58
+ }
59
+ onIndexChanged={[Function]}
60
+ onMomentumScrollEnd={[Function]}
61
+ onScrollBeginDrag={[Function]}
62
+ onScrollEndDrag={[Function]}
63
+ paginationStyle={
64
+ {
65
+ "bottom": 0,
66
+ }
67
+ }
68
+ pagingEnabled={true}
69
+ prevButton={
70
+ <ChevronLeftIcon
71
+ color="#19216C"
72
+ />
73
+ }
74
+ removeClippedSubviews={true}
75
+ scrollsToTop={false}
76
+ showsButtons={true}
77
+ showsHorizontalScrollIndicator={false}
78
+ showsPagination={true}
79
+ showsVerticalScrollIndicator={false}
80
+ >
81
+ <View>
82
+ <View
83
+ style={
84
+ [
85
+ {
86
+ "height": 1334,
87
+ "width": 750,
88
+ },
89
+ {
90
+ "backgroundColor": "transparent",
91
+ },
92
+ ]
93
+ }
94
+ >
95
+ <View
96
+ style={
97
+ {
98
+ "alignSelf": "center",
99
+ "marginLeft": 15,
100
+ "marginRight": 15,
101
+ "marginTop": 20,
102
+ "width": "60%",
103
+ }
104
+ }
105
+ >
106
+ <View
107
+ accessible={true}
108
+ collapsable={false}
109
+ focusable={true}
110
+ onBlur={[Function]}
111
+ onClick={[Function]}
112
+ onFocus={[Function]}
113
+ onResponderGrant={[Function]}
114
+ onResponderMove={[Function]}
115
+ onResponderRelease={[Function]}
116
+ onResponderTerminate={[Function]}
117
+ onResponderTerminationRequest={[Function]}
118
+ onStartShouldSetResponder={[Function]}
119
+ >
120
+ <View
121
+ style={
122
+ {
123
+ "alignItems": "center",
124
+ "backgroundColor": "#19216C",
125
+ "borderRadius": 50,
126
+ "flexDirection": "row",
127
+ "justifyContent": "center",
128
+ "paddingHorizontal": 24,
129
+ "paddingVertical": 12,
130
+ }
131
+ }
132
+ >
133
+ <Text
134
+ style={
135
+ {
136
+ "color": "#E0E8F9",
137
+ "fontFamily": "SourceSansPro",
138
+ "fontSize": 16,
139
+ "lineHeight": 22.4,
140
+ }
141
+ }
142
+ >
143
+ button 2
144
+ </Text>
145
+ </View>
146
+ </View>
147
+ </View>
148
+ </View>
149
+ <View
150
+ style={
151
+ [
152
+ {
153
+ "height": 1334,
154
+ "width": 750,
155
+ },
156
+ {
157
+ "backgroundColor": "transparent",
158
+ },
159
+ ]
160
+ }
161
+ >
162
+ <View
163
+ style={
164
+ {
165
+ "alignSelf": "center",
166
+ "marginLeft": 15,
167
+ "marginRight": 15,
168
+ "marginTop": 20,
169
+ "width": "60%",
170
+ }
171
+ }
172
+ >
173
+ <View
174
+ accessible={true}
175
+ collapsable={false}
176
+ focusable={true}
177
+ onBlur={[Function]}
178
+ onClick={[Function]}
179
+ onFocus={[Function]}
180
+ onResponderGrant={[Function]}
181
+ onResponderMove={[Function]}
182
+ onResponderRelease={[Function]}
183
+ onResponderTerminate={[Function]}
184
+ onResponderTerminationRequest={[Function]}
185
+ onStartShouldSetResponder={[Function]}
186
+ >
187
+ <View
188
+ style={
189
+ {
190
+ "alignItems": "center",
191
+ "backgroundColor": "#19216C",
192
+ "borderRadius": 50,
193
+ "flexDirection": "row",
194
+ "justifyContent": "center",
195
+ "paddingHorizontal": 24,
196
+ "paddingVertical": 12,
197
+ }
198
+ }
199
+ >
200
+ <Text
201
+ style={
202
+ {
203
+ "color": "#E0E8F9",
204
+ "fontFamily": "SourceSansPro",
205
+ "fontSize": 16,
206
+ "lineHeight": 22.4,
207
+ }
208
+ }
209
+ >
210
+ button 1
211
+ </Text>
212
+ </View>
213
+ </View>
214
+ </View>
215
+ </View>
216
+ <View
217
+ style={
218
+ [
219
+ {
220
+ "height": 1334,
221
+ "width": 750,
222
+ },
223
+ {
224
+ "backgroundColor": "transparent",
225
+ },
226
+ ]
227
+ }
228
+ >
229
+ <View
230
+ style={
231
+ {
232
+ "alignSelf": "center",
233
+ "marginLeft": 15,
234
+ "marginRight": 15,
235
+ "marginTop": 20,
236
+ "width": "60%",
237
+ }
238
+ }
239
+ >
240
+ <View
241
+ accessible={true}
242
+ collapsable={false}
243
+ focusable={true}
244
+ onBlur={[Function]}
245
+ onClick={[Function]}
246
+ onFocus={[Function]}
247
+ onResponderGrant={[Function]}
248
+ onResponderMove={[Function]}
249
+ onResponderRelease={[Function]}
250
+ onResponderTerminate={[Function]}
251
+ onResponderTerminationRequest={[Function]}
252
+ onStartShouldSetResponder={[Function]}
253
+ >
254
+ <View
255
+ style={
256
+ {
257
+ "alignItems": "center",
258
+ "backgroundColor": "#19216C",
259
+ "borderRadius": 50,
260
+ "flexDirection": "row",
261
+ "justifyContent": "center",
262
+ "paddingHorizontal": 24,
263
+ "paddingVertical": 12,
264
+ }
265
+ }
266
+ >
267
+ <Text
268
+ style={
269
+ {
270
+ "color": "#E0E8F9",
271
+ "fontFamily": "SourceSansPro",
272
+ "fontSize": 16,
273
+ "lineHeight": 22.4,
274
+ }
275
+ }
276
+ >
277
+ button 2
278
+ </Text>
279
+ </View>
280
+ </View>
281
+ </View>
282
+ </View>
283
+ <View
284
+ style={
285
+ [
286
+ {
287
+ "height": 1334,
288
+ "width": 750,
289
+ },
290
+ {
291
+ "backgroundColor": "transparent",
292
+ },
293
+ ]
294
+ }
295
+ >
296
+ <View
297
+ style={
298
+ {
299
+ "alignSelf": "center",
300
+ "marginLeft": 15,
301
+ "marginRight": 15,
302
+ "marginTop": 20,
303
+ "width": "60%",
304
+ }
305
+ }
306
+ >
307
+ <View
308
+ accessible={true}
309
+ collapsable={false}
310
+ focusable={true}
311
+ onBlur={[Function]}
312
+ onClick={[Function]}
313
+ onFocus={[Function]}
314
+ onResponderGrant={[Function]}
315
+ onResponderMove={[Function]}
316
+ onResponderRelease={[Function]}
317
+ onResponderTerminate={[Function]}
318
+ onResponderTerminationRequest={[Function]}
319
+ onStartShouldSetResponder={[Function]}
320
+ >
321
+ <View
322
+ style={
323
+ {
324
+ "alignItems": "center",
325
+ "backgroundColor": "#19216C",
326
+ "borderRadius": 50,
327
+ "flexDirection": "row",
328
+ "justifyContent": "center",
329
+ "paddingHorizontal": 24,
330
+ "paddingVertical": 12,
331
+ }
332
+ }
333
+ >
334
+ <Text
335
+ style={
336
+ {
337
+ "color": "#E0E8F9",
338
+ "fontFamily": "SourceSansPro",
339
+ "fontSize": 16,
340
+ "lineHeight": 22.4,
341
+ }
342
+ }
343
+ >
344
+ button 1
345
+ </Text>
346
+ </View>
347
+ </View>
348
+ </View>
349
+ </View>
350
+ </View>
351
+ </RCTScrollView>
352
+ <View
353
+ pointerEvents="none"
354
+ style={
355
+ [
356
+ {
357
+ "alignItems": "center",
358
+ "backgroundColor": "transparent",
359
+ "bottom": 25,
360
+ "flex": 1,
361
+ "flexDirection": "row",
362
+ "justifyContent": "center",
363
+ "left": 0,
364
+ "position": "absolute",
365
+ "right": 0,
366
+ },
367
+ {
368
+ "bottom": 0,
369
+ },
370
+ ]
371
+ }
372
+ >
373
+ <View
374
+ style={
375
+ [
376
+ {
377
+ "backgroundColor": "#98AEEB",
378
+ "borderRadius": 4,
379
+ "height": 8,
380
+ "marginBottom": 3,
381
+ "marginLeft": 3,
382
+ "marginRight": 3,
383
+ "marginTop": 3,
384
+ "width": 8,
385
+ },
386
+ undefined,
387
+ ]
388
+ }
389
+ />
390
+ <View
391
+ style={
392
+ [
393
+ {
394
+ "backgroundColor": "#E5E8EB",
395
+ "borderRadius": 4,
396
+ "height": 8,
397
+ "marginBottom": 3,
398
+ "marginLeft": 3,
399
+ "marginRight": 3,
400
+ "marginTop": 3,
401
+ "width": 8,
402
+ },
403
+ undefined,
404
+ ]
405
+ }
406
+ />
407
+ </View>
408
+ <View
409
+ pointerEvents="box-none"
410
+ style={
411
+ [
412
+ {
413
+ "alignItems": "center",
414
+ "backgroundColor": "transparent",
415
+ "flex": 1,
416
+ "flexDirection": "row",
417
+ "justifyContent": "space-between",
418
+ "left": 0,
419
+ "paddingHorizontal": 10,
420
+ "paddingVertical": 10,
421
+ "position": "absolute",
422
+ "top": 0,
423
+ },
424
+ {
425
+ "height": 1334,
426
+ "width": 750,
427
+ },
428
+ undefined,
429
+ ]
430
+ }
431
+ >
432
+ <View
433
+ accessibilityState={
434
+ {
435
+ "disabled": false,
436
+ }
437
+ }
438
+ accessible={true}
439
+ collapsable={false}
440
+ focusable={true}
441
+ onClick={[Function]}
442
+ onResponderGrant={[Function]}
443
+ onResponderMove={[Function]}
444
+ onResponderRelease={[Function]}
445
+ onResponderTerminate={[Function]}
446
+ onResponderTerminationRequest={[Function]}
447
+ onStartShouldSetResponder={[Function]}
448
+ style={
449
+ {
450
+ "opacity": 1,
451
+ }
452
+ }
453
+ >
454
+ <View>
455
+ <RNSVGSvgView
456
+ align="xMidYMid"
457
+ bbHeight="28"
458
+ bbWidth="28"
459
+ fill="none"
460
+ focusable={false}
461
+ height="28"
462
+ meetOrSlice={0}
463
+ minX={0}
464
+ minY={0}
465
+ style={
466
+ [
467
+ {
468
+ "backgroundColor": "transparent",
469
+ "borderWidth": 0,
470
+ },
471
+ {
472
+ "flex": 0,
473
+ "height": 28,
474
+ "width": 28,
475
+ },
476
+ ]
477
+ }
478
+ vbHeight={27}
479
+ vbWidth={27}
480
+ width="28"
481
+ >
482
+ <RNSVGGroup
483
+ fill={null}
484
+ propList={
485
+ [
486
+ "fill",
487
+ ]
488
+ }
489
+ >
490
+ <RNSVGPath
491
+ d="M16.875 21.375L9 13.5L16.875 5.625"
492
+ propList={
493
+ [
494
+ "stroke",
495
+ "strokeWidth",
496
+ "strokeLinecap",
497
+ "strokeLinejoin",
498
+ ]
499
+ }
500
+ stroke={4279837036}
501
+ strokeLinecap={1}
502
+ strokeLinejoin={1}
503
+ strokeWidth="2"
504
+ />
505
+ </RNSVGGroup>
506
+ </RNSVGSvgView>
507
+ </View>
508
+ </View>
509
+ <View
510
+ accessibilityState={
511
+ {
512
+ "disabled": false,
513
+ }
514
+ }
515
+ accessible={true}
516
+ collapsable={false}
517
+ focusable={true}
518
+ onClick={[Function]}
519
+ onResponderGrant={[Function]}
520
+ onResponderMove={[Function]}
521
+ onResponderRelease={[Function]}
522
+ onResponderTerminate={[Function]}
523
+ onResponderTerminationRequest={[Function]}
524
+ onStartShouldSetResponder={[Function]}
525
+ style={
526
+ {
527
+ "opacity": 1,
528
+ }
529
+ }
530
+ >
531
+ <View>
532
+ <RNSVGSvgView
533
+ align="xMidYMid"
534
+ bbHeight="28"
535
+ bbWidth="28"
536
+ fill="none"
537
+ focusable={false}
538
+ height="28"
539
+ meetOrSlice={0}
540
+ minX={0}
541
+ minY={0}
542
+ style={
543
+ [
544
+ {
545
+ "backgroundColor": "transparent",
546
+ "borderWidth": 0,
547
+ },
548
+ {
549
+ "flex": 0,
550
+ "height": 28,
551
+ "width": 28,
552
+ },
553
+ ]
554
+ }
555
+ vbHeight={27}
556
+ vbWidth={26}
557
+ width="28"
558
+ >
559
+ <RNSVGGroup
560
+ fill={null}
561
+ propList={
562
+ [
563
+ "fill",
564
+ ]
565
+ }
566
+ >
567
+ <RNSVGPath
568
+ d="M9.75 5.625L17.3333 13.5L9.75 21.375"
569
+ propList={
570
+ [
571
+ "stroke",
572
+ "strokeWidth",
573
+ "strokeLinecap",
574
+ "strokeLinejoin",
575
+ ]
576
+ }
577
+ stroke={4279837036}
578
+ strokeLinecap={1}
579
+ strokeLinejoin={1}
580
+ strokeWidth="2"
581
+ />
582
+ </RNSVGGroup>
583
+ </RNSVGSvgView>
584
+ </View>
585
+ </View>
586
+ </View>
587
+ </View>
588
+ </View>
589
+ `;
@@ -0,0 +1,39 @@
1
+ import React, {Children, useContext} from 'react';
2
+ import {ThemeCtx} from '../../../context/theme.context';
3
+ import Swiper from 'react-native-swiper';
4
+ import {View} from 'react-native';
5
+ import {Button} from '../button/button.component';
6
+ import {Stylesheet} from './Swipe.styles';
7
+ import {ChevronLeftIcon} from '../../../icons/outline/chevron-left/chevron-left.icon';
8
+ import {ChevronRightIcon} from '../../../icons/outline/chevron-right/chevron-right.icon';
9
+ import {Pill} from '../pill/pill.component';
10
+
11
+ type SwipeProps = {
12
+ children: React.ReactNode;
13
+ };
14
+
15
+ const Swipe = ({children}: SwipeProps) => {
16
+ const context = useContext(ThemeCtx);
17
+ const styles = Stylesheet(context);
18
+ const count = Children.count(children);
19
+
20
+ if (count > 5) {
21
+ console.warn(' for more then 5 children, use another way to show');
22
+ }
23
+
24
+ return (
25
+ <View style={styles.container}>
26
+ <Swiper
27
+ paginationStyle={{bottom: 0}}
28
+ showsButtons={true}
29
+ dotColor={context.colors.ui.lightgrey}
30
+ activeDotColor={context.colors.main['7']}
31
+ prevButton={<ChevronLeftIcon color={context.colors.main['0']} />}
32
+ nextButton={<ChevronRightIcon color={context.colors.main['0']} />}
33
+ >
34
+ {children}
35
+ </Swiper>
36
+ </View>
37
+ );
38
+ };
39
+ export {Swipe as Swipe};
@@ -0,0 +1,64 @@
1
+ import React from 'react';
2
+ import {Swipe} from './swipe.component';
3
+ import {View} from 'react-native';
4
+ import {Button} from '../button/button.component';
5
+ import {Pill} from '../pill/pill.component';
6
+ import {VisualState} from '../../../types/visual-state.enum';
7
+
8
+ export const SwipePreview = ({}: {}) => {
9
+ return (
10
+ <View>
11
+ <Swipe>
12
+ <View
13
+ style={{
14
+ marginRight: 15,
15
+ marginLeft: 15,
16
+ marginTop: 20,
17
+ width: '60%',
18
+ alignSelf: 'center',
19
+ }}
20
+ >
21
+ <Button
22
+ label={'button 1'}
23
+ onPress={() => console.log('button 1 pressed')}
24
+ />
25
+ </View>
26
+ <View style={{marginTop: 32, width: '70%', alignSelf: 'center'}}>
27
+ <Pill label={'Pill'} variant={VisualState.DEFAULT} />
28
+ </View>
29
+ <View
30
+ style={{
31
+ marginRight: 15,
32
+ marginLeft: 15,
33
+ marginTop: 20,
34
+ width: '60%',
35
+ alignSelf: 'center',
36
+ }}
37
+ >
38
+ <Button
39
+ label={'button 2'}
40
+ onPress={() => console.log('button 2 pressed')}
41
+ />
42
+ </View>
43
+ <View style={{marginTop: 32, width: '70%', alignSelf: 'center'}}>
44
+ <Pill label={'Pill'} variant={VisualState.DEFAULT} />
45
+ </View>
46
+
47
+ <View
48
+ style={{
49
+ marginRight: 15,
50
+ marginLeft: 15,
51
+ marginTop: 20,
52
+ width: '60%',
53
+ alignSelf: 'center',
54
+ }}
55
+ >
56
+ <Button
57
+ label={'button 3'}
58
+ onPress={() => console.log('button 3 pressed')}
59
+ />
60
+ </View>
61
+ </Swipe>
62
+ </View>
63
+ );
64
+ };