@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.
- package/.expo-shared/assets.json +4 -0
- package/.github/workflows/run-tests.yml +16 -0
- package/.prettierrc.js +9 -0
- package/.yarnrc.yml +1 -0
- package/App.tsx +221 -0
- package/app.json +33 -0
- package/assets/adaptive-icon.png +0 -0
- package/assets/components/avatar/baby.png +0 -0
- package/assets/favicon.png +0 -0
- package/assets/fonts/montserrat/bold.ttf +0 -0
- package/assets/fonts/montserrat/regular.ttf +0 -0
- package/assets/fonts/source-sans-pro/bold.ttf +0 -0
- package/assets/fonts/source-sans-pro/regular.ttf +0 -0
- package/assets/icon.png +0 -0
- package/assets/splash.png +0 -0
- package/babel.config.js +6 -0
- package/jest.config.js +22 -0
- package/package.json +53 -0
- package/src/components/atoms/avatar/__snapshots__/avatar.test.js.snap +85 -0
- package/src/components/atoms/avatar/avatar.component.tsx +35 -0
- package/src/components/atoms/avatar/avatar.preview.tsx +38 -0
- package/src/components/atoms/avatar/avatar.styles.js +55 -0
- package/src/components/atoms/avatar/avatar.test.js +22 -0
- package/src/components/atoms/button/__snapshots__/button.test.js.snap +307 -0
- package/src/components/atoms/button/button.component.tsx +27 -0
- package/src/components/atoms/button/button.preview.tsx +34 -0
- package/src/components/atoms/button/button.styles.js +25 -0
- package/src/components/atoms/button/button.test.js +35 -0
- package/src/components/atoms/cancel-link/__snapshots__/cancel-link.test.js.snap +89 -0
- package/src/components/atoms/cancel-link/cancel-link.component.tsx +24 -0
- package/src/components/atoms/cancel-link/cancel-link.preview.tsx +20 -0
- package/src/components/atoms/cancel-link/cancel-link.styles.js +20 -0
- package/src/components/atoms/cancel-link/cancel-link.test.js +28 -0
- package/src/components/atoms/check-switch/__snapshots__/check-switch.test.js.snap +67 -0
- package/src/components/atoms/check-switch/check-switch.component.tsx +46 -0
- package/src/components/atoms/check-switch/check-switch.preview.tsx +31 -0
- package/src/components/atoms/check-switch/check-switch.styles.js +36 -0
- package/src/components/atoms/check-switch/check-switch.test.js +13 -0
- package/src/components/atoms/checkbox/__snapshots__/checkbox.test.js.snap +120 -0
- package/src/components/atoms/checkbox/checkbox.component.tsx +26 -0
- package/src/components/atoms/checkbox/checkbox.preview.tsx +46 -0
- package/src/components/atoms/checkbox/checkbox.styles.js +35 -0
- package/src/components/atoms/checkbox/checkbox.test.js +30 -0
- package/src/components/atoms/child-list-item/__snapshots__/child-list-item.test.js.snap +635 -0
- package/src/components/atoms/child-list-item/child-list-item.component.tsx +81 -0
- package/src/components/atoms/child-list-item/child-list-item.preview.tsx +65 -0
- package/src/components/atoms/child-list-item/child-list-item.styles.js +82 -0
- package/src/components/atoms/child-list-item/child-list-item.test.js +73 -0
- package/src/components/atoms/contact-item/__snapshots__/contact-item.test.js.snap +321 -0
- package/src/components/atoms/contact-item/contact-item.component.tsx +61 -0
- package/src/components/atoms/contact-item/contact-item.preview.tsx +30 -0
- package/src/components/atoms/contact-item/contact-item.styles.js +26 -0
- package/src/components/atoms/contact-item/contact-item.test.js +20 -0
- package/src/components/atoms/filter-tab/__snapshots__/filter-tab.test.js.snap +415 -0
- package/src/components/atoms/filter-tab/filter-tab.component.tsx +93 -0
- package/src/components/atoms/filter-tab/filter-tab.preview.tsx +37 -0
- package/src/components/atoms/filter-tab/filter-tab.styles.js +64 -0
- package/src/components/atoms/filter-tab/filter-tab.test.js +38 -0
- package/src/components/atoms/form-actions/__snapshots__/form-action.test.js.snap +176 -0
- package/src/components/atoms/form-actions/form-action.component.tsx +25 -0
- package/src/components/atoms/form-actions/form-action.preview.tsx +29 -0
- package/src/components/atoms/form-actions/form-action.styles.js +19 -0
- package/src/components/atoms/form-actions/form-action.test.js +32 -0
- package/src/components/atoms/image-bubble/__snapshots__/image-bubble.test.js.snap +67 -0
- package/src/components/atoms/image-bubble/image-bubble.component.tsx +25 -0
- package/src/components/atoms/image-bubble/image-bubble.preview.tsx +19 -0
- package/src/components/atoms/image-bubble/image-bubble.styles.js +31 -0
- package/src/components/atoms/image-bubble/image-bubble.test.js +20 -0
- package/src/components/atoms/info/__snapshots__/info.test.js.snap +43 -0
- package/src/components/atoms/info/info.component.tsx +22 -0
- package/src/components/atoms/info/info.preview.tsx +20 -0
- package/src/components/atoms/info/info.styles.js +25 -0
- package/src/components/atoms/info/info.test.js +18 -0
- package/src/components/atoms/pill/__snapshots__/pill.test.js.snap +141 -0
- package/src/components/atoms/pill/pill.component.tsx +23 -0
- package/src/components/atoms/pill/pill.preview.tsx +21 -0
- package/src/components/atoms/pill/pill.styles.js +32 -0
- package/src/components/atoms/pill/pill.test.js +34 -0
- package/src/components/atoms/popover/components/backdrop/backdrop.component.tsx +40 -0
- package/src/components/atoms/popover/components/backdrop/backdrop.styles.js +15 -0
- package/src/components/atoms/popover/components/foreground/foreground.component.tsx +17 -0
- package/src/components/atoms/popover/components/foreground/foreground.styles.js +17 -0
- package/src/components/atoms/popover/components/index.js +5 -0
- package/src/components/atoms/popover/components/modal/close/close.component.tsx +21 -0
- package/src/components/atoms/popover/components/modal/close/close.styles.js +13 -0
- package/src/components/atoms/popover/components/modal/heading/heading.component.tsx +22 -0
- package/src/components/atoms/popover/components/modal/heading/heading.styles.js +24 -0
- package/src/components/atoms/popover/components/modal/modal.component.tsx +87 -0
- package/src/components/atoms/popover/components/modal/modal.styles.js +23 -0
- package/src/components/atoms/popover/components/modal/scroll-content/scroll-content.component.tsx +18 -0
- package/src/components/atoms/popover/components/modal/scroll-content/scroll-content.styles.js +10 -0
- package/src/components/atoms/popover/popover.component.tsx +60 -0
- package/src/components/atoms/popover/popover.preview.tsx +135 -0
- package/src/components/atoms/popover/popover.styles.js +12 -0
- package/src/components/atoms/popover-heading/__snapshots__/popover_heading.test.js.snap +35 -0
- package/src/components/atoms/popover-heading/popover-heading.component.tsx +22 -0
- package/src/components/atoms/popover-heading/popover-heading.preview.tsx +18 -0
- package/src/components/atoms/popover-heading/popover-heading.styles.js +19 -0
- package/src/components/atoms/popover-heading/popover_heading.test.js +11 -0
- package/src/components/atoms/pressable-icon/__snapshots__/pressable-icon.test.js.snap +364 -0
- package/src/components/atoms/pressable-icon/pressable-icon.component.tsx +48 -0
- package/src/components/atoms/pressable-icon/pressable-icon.preview.tsx +37 -0
- package/src/components/atoms/pressable-icon/pressable-icon.styles.js +25 -0
- package/src/components/atoms/pressable-icon/pressable-icon.test.js +47 -0
- package/src/components/atoms/quick-filter/__snapshots__/quick-filter.test.js.snap +465 -0
- package/src/components/atoms/quick-filter/quick-filter.component.tsx +32 -0
- package/src/components/atoms/quick-filter/quick-filter.prevriew.tsx +46 -0
- package/src/components/atoms/quick-filter/quick-filter.styles.js +68 -0
- package/src/components/atoms/quick-filter/quick-filter.test.js +127 -0
- package/src/components/atoms/select-list-item/__snapshots__/select-list-item.test.js.snap +391 -0
- package/src/components/atoms/select-list-item/select-list-item-preview.tsx +31 -0
- package/src/components/atoms/select-list-item/select-list-item.test.js +38 -0
- package/src/components/atoms/select-list-item/select-list.component-item.tsx +52 -0
- package/src/components/atoms/select-list-item/select-list.styles-item.js +40 -0
- package/src/components/atoms/snackbar/__snapshots__/snackbar.test.js.snap +493 -0
- package/src/components/atoms/snackbar/snackbar.component.tsx +28 -0
- package/src/components/atoms/snackbar/snackbar.preview.tsx +33 -0
- package/src/components/atoms/snackbar/snackbar.styles.js +82 -0
- package/src/components/atoms/snackbar/snackbar.test.js +35 -0
- package/src/components/atoms/tag/__snapshots__/tag.test.js.snap +87 -0
- package/src/components/atoms/tag/tag.component.tsx +37 -0
- package/src/components/atoms/tag/tag.preview.tsx +27 -0
- package/src/components/atoms/tag/tag.styles.js +22 -0
- package/src/components/atoms/tag/tag.test.js +24 -0
- package/src/components/atoms/text-bubble/__snapshots__/text-bubble.test.js.snap +337 -0
- package/src/components/atoms/text-bubble/text-bubble.component.tsx +32 -0
- package/src/components/atoms/text-bubble/text-bubble.preview.tsx +27 -0
- package/src/components/atoms/text-bubble/text-bubble.styles.js +64 -0
- package/src/components/atoms/text-bubble/text-bubble.test.js +84 -0
- package/src/components/atoms/text-input/__snapshots__/text-input.test.js.snap +68 -0
- package/src/components/atoms/text-input/text-input.component.tsx +32 -0
- package/src/components/atoms/text-input/text-input.preview.tsx +24 -0
- package/src/components/atoms/text-input/text-input.styles.js +26 -0
- package/src/components/atoms/text-input/text-input.test.js +32 -0
- package/src/components/atoms/time-tracker/__snapshots__/time-tracker.test.js.snap +206 -0
- package/src/components/atoms/time-tracker/time-tracker.component.tsx +24 -0
- package/src/components/atoms/time-tracker/time-tracker.preview.tsx +15 -0
- package/src/components/atoms/time-tracker/time-tracker.styles.js +36 -0
- package/src/components/atoms/time-tracker/time-tracker.test.js +37 -0
- package/src/components/atoms/wide-button/__snapshots__/wide-button.test.js.snap +92 -0
- package/src/components/atoms/wide-button/wide-button.component.tsx +23 -0
- package/src/components/atoms/wide-button/wide-button.preview.tsx +18 -0
- package/src/components/atoms/wide-button/wide-button.styles.js +22 -0
- package/src/components/atoms/wide-button/wide-button.test.js +16 -0
- package/src/context/theme.context.ts +49 -0
- package/src/gradients/main/main.gradient.tsx +20 -0
- package/src/gradients/main/main.styles.js +11 -0
- package/src/icons/__snapshots__/icons.test.js.snap +2588 -0
- package/src/icons/icons.test.js +245 -0
- package/src/icons/index.tsx +7 -0
- package/src/icons/outline/calendar/calendar.icon.tsx +20 -0
- package/src/icons/outline/chat/chat.icon.tsx +20 -0
- package/src/icons/outline/chat-alt/chat-alt.icon.tsx +20 -0
- package/src/icons/outline/check-circle/check-circle.icon.tsx +20 -0
- package/src/icons/outline/chevron-left/chevron-left.icon.tsx +20 -0
- package/src/icons/outline/chevron-right/chevron-right.icon.tsx +20 -0
- package/src/icons/outline/clock/clock.icon.tsx +20 -0
- package/src/icons/outline/cloud-download/cloud-download.icon.tsx +20 -0
- package/src/icons/outline/cross/cross.icon.tsx +20 -0
- package/src/icons/outline/currency-euro/currency-euro.icon.tsx +20 -0
- package/src/icons/outline/document-text/document-text.icon.tsx +20 -0
- package/src/icons/outline/exclamation/exclamation.icon.tsx +20 -0
- package/src/icons/outline/exclamation-circle/exclamation-circle.icon.tsx +20 -0
- package/src/icons/outline/eye/eye.icon.tsx +27 -0
- package/src/icons/outline/filter/filter.icon.tsx +59 -0
- package/src/icons/outline/information-circle/information-circle.icon.tsx +20 -0
- package/src/icons/outline/logout/logout.icon.tsx +20 -0
- package/src/icons/outline/mail/mail.icon.tsx +20 -0
- package/src/icons/outline/mail-open/mail-open.icon.tsx +20 -0
- package/src/icons/outline/menu/menu.icon.tsx +20 -0
- package/src/icons/outline/minus-sm/minus-sm.icon.tsx +20 -0
- package/src/icons/outline/office-building/office-building.icon.tsx +20 -0
- package/src/icons/outline/outline-default.preview.tsx +99 -0
- package/src/icons/outline/outline-grey.preview.tsx +100 -0
- package/src/icons/outline/outline-white.preview.tsx +100 -0
- package/src/icons/outline/outline.tsx +81 -0
- package/src/icons/outline/paper-airplane/paper-airplane.icon.tsx +20 -0
- package/src/icons/outline/paperclip/paperclip.icon.tsx +20 -0
- package/src/icons/outline/pencil/pencil.icon.tsx +20 -0
- package/src/icons/outline/phone/phone.icon.tsx +20 -0
- package/src/icons/outline/plus/plus.icon.tsx +20 -0
- package/src/icons/outline/plus-sm/plus-sm.icon.tsx +20 -0
- package/src/icons/outline/qrcode/qrcode.icon.tsx +17 -0
- package/src/icons/outline/refresh/refresh.icon.tsx +20 -0
- package/src/icons/outline/search/search.icon.tsx +20 -0
- package/src/icons/outline/selector/selector.icon.tsx +20 -0
- package/src/icons/outline/sm-view-grid-add/sm-view-grid-add.icon.tsx +20 -0
- package/src/icons/outline/status-online/status-online.icon.tsx +20 -0
- package/src/icons/outline/thumb-up/thumb-up.icon.tsx +20 -0
- package/src/icons/outline/trash/trash.icon.tsx +20 -0
- package/src/icons/outline/user/user.icon.tsx +27 -0
- package/src/icons/outline/user-group/user-group.icon.tsx +20 -0
- package/src/icons/outline/users/users.icon.tsx +20 -0
- package/src/icons/solid/chat-alt/chat-alt-solid.icon.tsx +20 -0
- package/src/icons/solid/clock/clock-solid.icon.tsx +20 -0
- package/src/icons/solid/information-circle/information-circle-solid.icon.tsx +20 -0
- package/src/icons/solid/pencil/pencil-solid.icon.tsx +22 -0
- package/src/icons/solid/phone/phone-solid.icon.tsx +18 -0
- package/src/icons/solid/refresh/refresh-solid.icon.tsx +20 -0
- package/src/icons/solid/solid.preview.tsx +73 -0
- package/src/icons/solid/solid.tsx +19 -0
- package/src/icons/solid/status-online/status-online-solid.icon.tsx +24 -0
- package/src/icons/solid/trash/trash-solid.icon.tsx +20 -0
- package/src/models/hex-color.model.ts +25 -0
- package/src/models/hex-color.test.js +20 -0
- package/src/models/initials.model.ts +32 -0
- package/src/models/initials.test.js +23 -0
- package/src/theme/font/font.ts +72 -0
- package/src/theme/font/index.ts +4 -0
- package/src/theme/font/load-fonts.ts +10 -0
- package/src/theme/provider/index.ts +4 -0
- package/src/theme/provider/parent.theme.ts +45 -0
- package/src/theme/provider/staff-member.theme.ts +45 -0
- package/src/theme/scale/index.ts +14 -0
- package/src/types/bubble-alignment.enum.ts +4 -0
- package/src/types/icontype.type.ts +3 -0
- package/src/types/keyboard-types.enum.ts +9 -0
- package/src/types/size.enum.ts +5 -0
- package/src/types/visual-state.enum.ts +6 -0
- package/tsconfig.json +7 -0
|
@@ -0,0 +1,493 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`test snackbar given the visual state is DEFAULT return a light blue background and black text 1`] = `
|
|
4
|
+
<View
|
|
5
|
+
style={
|
|
6
|
+
[
|
|
7
|
+
{
|
|
8
|
+
"alignItems": "center",
|
|
9
|
+
"borderColor": "rgba (39, 51, 68, 0.1)",
|
|
10
|
+
"borderRadius": 16,
|
|
11
|
+
"elevation": 4,
|
|
12
|
+
"flexDirection": "row",
|
|
13
|
+
"overflow": "hidden",
|
|
14
|
+
"paddingBottom": 8,
|
|
15
|
+
"paddingLeft": 32,
|
|
16
|
+
"paddingRight": 32,
|
|
17
|
+
"paddingTop": 8,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"backgroundColor": "#E0E8F9",
|
|
21
|
+
},
|
|
22
|
+
false,
|
|
23
|
+
false,
|
|
24
|
+
false,
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
>
|
|
28
|
+
<View
|
|
29
|
+
style={
|
|
30
|
+
{
|
|
31
|
+
"alignItems": "center",
|
|
32
|
+
"height": 32,
|
|
33
|
+
"justifyContent": "center",
|
|
34
|
+
"marginRight": 8,
|
|
35
|
+
"width": 32,
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
>
|
|
39
|
+
<RNSVGSvgView
|
|
40
|
+
align="xMidYMid"
|
|
41
|
+
bbHeight="28"
|
|
42
|
+
bbWidth="28"
|
|
43
|
+
fill="none"
|
|
44
|
+
focusable={false}
|
|
45
|
+
height="28"
|
|
46
|
+
meetOrSlice={0}
|
|
47
|
+
minX={0}
|
|
48
|
+
minY={0}
|
|
49
|
+
style={
|
|
50
|
+
[
|
|
51
|
+
{
|
|
52
|
+
"backgroundColor": "transparent",
|
|
53
|
+
"borderWidth": 0,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"flex": 0,
|
|
57
|
+
"height": 28,
|
|
58
|
+
"width": 28,
|
|
59
|
+
},
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
vbHeight={26}
|
|
63
|
+
vbWidth={26}
|
|
64
|
+
width="28"
|
|
65
|
+
>
|
|
66
|
+
<RNSVGGroup
|
|
67
|
+
fill={null}
|
|
68
|
+
propList={
|
|
69
|
+
[
|
|
70
|
+
"fill",
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
>
|
|
74
|
+
<RNSVGPath
|
|
75
|
+
d="M3.25 4.25C3.25 3.69772 3.69772 3.25 4.25 3.25H21.75C22.3023 3.25 22.75 3.69772 22.75 4.25V7.16912C22.75 7.43434 22.6446 7.68869 22.4571 7.87623L15.4596 14.8738C15.272 15.0613 15.1667 15.3157 15.1667 15.5809V18.4167L10.8333 22.75V15.5809C10.8333 15.3157 10.728 15.0613 10.5404 14.8738L3.54289 7.87623C3.35536 7.68869 3.25 7.43434 3.25 7.16912V4.25Z"
|
|
76
|
+
propList={
|
|
77
|
+
[
|
|
78
|
+
"stroke",
|
|
79
|
+
"strokeWidth",
|
|
80
|
+
"strokeLinecap",
|
|
81
|
+
"strokeLinejoin",
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
stroke={4279837036}
|
|
85
|
+
strokeLinecap={1}
|
|
86
|
+
strokeLinejoin={1}
|
|
87
|
+
strokeWidth="2"
|
|
88
|
+
/>
|
|
89
|
+
</RNSVGGroup>
|
|
90
|
+
</RNSVGSvgView>
|
|
91
|
+
</View>
|
|
92
|
+
<View
|
|
93
|
+
style={
|
|
94
|
+
{
|
|
95
|
+
"alignContent": "center",
|
|
96
|
+
"flex": 1,
|
|
97
|
+
"justifyContent": "center",
|
|
98
|
+
"paddingLeft": 32,
|
|
99
|
+
"paddingRight": 32,
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
>
|
|
103
|
+
<Text
|
|
104
|
+
style={
|
|
105
|
+
[
|
|
106
|
+
{
|
|
107
|
+
"fontFamily": "Montserrat",
|
|
108
|
+
"fontSize": 14,
|
|
109
|
+
"lineHeight": 22.4,
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"color": "#19216C",
|
|
113
|
+
},
|
|
114
|
+
false,
|
|
115
|
+
false,
|
|
116
|
+
false,
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
>
|
|
120
|
+
test
|
|
121
|
+
</Text>
|
|
122
|
+
</View>
|
|
123
|
+
</View>
|
|
124
|
+
`;
|
|
125
|
+
|
|
126
|
+
exports[`test snackbar given the visual state is ERROR return a red background and white text 1`] = `
|
|
127
|
+
<View
|
|
128
|
+
style={
|
|
129
|
+
[
|
|
130
|
+
{
|
|
131
|
+
"alignItems": "center",
|
|
132
|
+
"borderColor": "rgba (39, 51, 68, 0.1)",
|
|
133
|
+
"borderRadius": 16,
|
|
134
|
+
"elevation": 4,
|
|
135
|
+
"flexDirection": "row",
|
|
136
|
+
"overflow": "hidden",
|
|
137
|
+
"paddingBottom": 8,
|
|
138
|
+
"paddingLeft": 32,
|
|
139
|
+
"paddingRight": 32,
|
|
140
|
+
"paddingTop": 8,
|
|
141
|
+
},
|
|
142
|
+
false,
|
|
143
|
+
false,
|
|
144
|
+
{
|
|
145
|
+
"backgroundColor": "#F16868",
|
|
146
|
+
},
|
|
147
|
+
false,
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
>
|
|
151
|
+
<View
|
|
152
|
+
style={
|
|
153
|
+
{
|
|
154
|
+
"alignItems": "center",
|
|
155
|
+
"height": 32,
|
|
156
|
+
"justifyContent": "center",
|
|
157
|
+
"marginRight": 8,
|
|
158
|
+
"width": 32,
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
>
|
|
162
|
+
<RNSVGSvgView
|
|
163
|
+
align="xMidYMid"
|
|
164
|
+
bbHeight="28"
|
|
165
|
+
bbWidth="28"
|
|
166
|
+
fill="none"
|
|
167
|
+
focusable={false}
|
|
168
|
+
height="28"
|
|
169
|
+
meetOrSlice={0}
|
|
170
|
+
minX={0}
|
|
171
|
+
minY={0}
|
|
172
|
+
style={
|
|
173
|
+
[
|
|
174
|
+
{
|
|
175
|
+
"backgroundColor": "transparent",
|
|
176
|
+
"borderWidth": 0,
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"flex": 0,
|
|
180
|
+
"height": 28,
|
|
181
|
+
"width": 28,
|
|
182
|
+
},
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
vbHeight={26}
|
|
186
|
+
vbWidth={26}
|
|
187
|
+
width="28"
|
|
188
|
+
>
|
|
189
|
+
<RNSVGGroup
|
|
190
|
+
fill={null}
|
|
191
|
+
propList={
|
|
192
|
+
[
|
|
193
|
+
"fill",
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
>
|
|
197
|
+
<RNSVGPath
|
|
198
|
+
d="M3.25 4.25C3.25 3.69772 3.69772 3.25 4.25 3.25H21.75C22.3023 3.25 22.75 3.69772 22.75 4.25V7.16912C22.75 7.43434 22.6446 7.68869 22.4571 7.87623L15.4596 14.8738C15.272 15.0613 15.1667 15.3157 15.1667 15.5809V18.4167L10.8333 22.75V15.5809C10.8333 15.3157 10.728 15.0613 10.5404 14.8738L3.54289 7.87623C3.35536 7.68869 3.25 7.43434 3.25 7.16912V4.25Z"
|
|
199
|
+
propList={
|
|
200
|
+
[
|
|
201
|
+
"stroke",
|
|
202
|
+
"strokeWidth",
|
|
203
|
+
"strokeLinecap",
|
|
204
|
+
"strokeLinejoin",
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
stroke={4279837036}
|
|
208
|
+
strokeLinecap={1}
|
|
209
|
+
strokeLinejoin={1}
|
|
210
|
+
strokeWidth="2"
|
|
211
|
+
/>
|
|
212
|
+
</RNSVGGroup>
|
|
213
|
+
</RNSVGSvgView>
|
|
214
|
+
</View>
|
|
215
|
+
<View
|
|
216
|
+
style={
|
|
217
|
+
{
|
|
218
|
+
"alignContent": "center",
|
|
219
|
+
"flex": 1,
|
|
220
|
+
"justifyContent": "center",
|
|
221
|
+
"paddingLeft": 32,
|
|
222
|
+
"paddingRight": 32,
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
>
|
|
226
|
+
<Text
|
|
227
|
+
style={
|
|
228
|
+
[
|
|
229
|
+
{
|
|
230
|
+
"fontFamily": "Montserrat",
|
|
231
|
+
"fontSize": 14,
|
|
232
|
+
"lineHeight": 22.4,
|
|
233
|
+
},
|
|
234
|
+
false,
|
|
235
|
+
false,
|
|
236
|
+
{
|
|
237
|
+
"color": "#FFFFFF",
|
|
238
|
+
},
|
|
239
|
+
false,
|
|
240
|
+
]
|
|
241
|
+
}
|
|
242
|
+
>
|
|
243
|
+
test
|
|
244
|
+
</Text>
|
|
245
|
+
</View>
|
|
246
|
+
</View>
|
|
247
|
+
`;
|
|
248
|
+
|
|
249
|
+
exports[`test snackbar given the visual state is SUCCESS return a light green background and black text 1`] = `
|
|
250
|
+
<View
|
|
251
|
+
style={
|
|
252
|
+
[
|
|
253
|
+
{
|
|
254
|
+
"alignItems": "center",
|
|
255
|
+
"borderColor": "rgba (39, 51, 68, 0.1)",
|
|
256
|
+
"borderRadius": 16,
|
|
257
|
+
"elevation": 4,
|
|
258
|
+
"flexDirection": "row",
|
|
259
|
+
"overflow": "hidden",
|
|
260
|
+
"paddingBottom": 8,
|
|
261
|
+
"paddingLeft": 32,
|
|
262
|
+
"paddingRight": 32,
|
|
263
|
+
"paddingTop": 8,
|
|
264
|
+
},
|
|
265
|
+
false,
|
|
266
|
+
{
|
|
267
|
+
"backgroundColor": "#E0F4DA",
|
|
268
|
+
},
|
|
269
|
+
false,
|
|
270
|
+
false,
|
|
271
|
+
]
|
|
272
|
+
}
|
|
273
|
+
>
|
|
274
|
+
<View
|
|
275
|
+
style={
|
|
276
|
+
{
|
|
277
|
+
"alignItems": "center",
|
|
278
|
+
"height": 32,
|
|
279
|
+
"justifyContent": "center",
|
|
280
|
+
"marginRight": 8,
|
|
281
|
+
"width": 32,
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
>
|
|
285
|
+
<RNSVGSvgView
|
|
286
|
+
align="xMidYMid"
|
|
287
|
+
bbHeight="28"
|
|
288
|
+
bbWidth="28"
|
|
289
|
+
fill="none"
|
|
290
|
+
focusable={false}
|
|
291
|
+
height="28"
|
|
292
|
+
meetOrSlice={0}
|
|
293
|
+
minX={0}
|
|
294
|
+
minY={0}
|
|
295
|
+
style={
|
|
296
|
+
[
|
|
297
|
+
{
|
|
298
|
+
"backgroundColor": "transparent",
|
|
299
|
+
"borderWidth": 0,
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"flex": 0,
|
|
303
|
+
"height": 28,
|
|
304
|
+
"width": 28,
|
|
305
|
+
},
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
vbHeight={26}
|
|
309
|
+
vbWidth={26}
|
|
310
|
+
width="28"
|
|
311
|
+
>
|
|
312
|
+
<RNSVGGroup
|
|
313
|
+
fill={null}
|
|
314
|
+
propList={
|
|
315
|
+
[
|
|
316
|
+
"fill",
|
|
317
|
+
]
|
|
318
|
+
}
|
|
319
|
+
>
|
|
320
|
+
<RNSVGPath
|
|
321
|
+
d="M3.25 4.25C3.25 3.69772 3.69772 3.25 4.25 3.25H21.75C22.3023 3.25 22.75 3.69772 22.75 4.25V7.16912C22.75 7.43434 22.6446 7.68869 22.4571 7.87623L15.4596 14.8738C15.272 15.0613 15.1667 15.3157 15.1667 15.5809V18.4167L10.8333 22.75V15.5809C10.8333 15.3157 10.728 15.0613 10.5404 14.8738L3.54289 7.87623C3.35536 7.68869 3.25 7.43434 3.25 7.16912V4.25Z"
|
|
322
|
+
propList={
|
|
323
|
+
[
|
|
324
|
+
"stroke",
|
|
325
|
+
"strokeWidth",
|
|
326
|
+
"strokeLinecap",
|
|
327
|
+
"strokeLinejoin",
|
|
328
|
+
]
|
|
329
|
+
}
|
|
330
|
+
stroke={4279837036}
|
|
331
|
+
strokeLinecap={1}
|
|
332
|
+
strokeLinejoin={1}
|
|
333
|
+
strokeWidth="2"
|
|
334
|
+
/>
|
|
335
|
+
</RNSVGGroup>
|
|
336
|
+
</RNSVGSvgView>
|
|
337
|
+
</View>
|
|
338
|
+
<View
|
|
339
|
+
style={
|
|
340
|
+
{
|
|
341
|
+
"alignContent": "center",
|
|
342
|
+
"flex": 1,
|
|
343
|
+
"justifyContent": "center",
|
|
344
|
+
"paddingLeft": 32,
|
|
345
|
+
"paddingRight": 32,
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
>
|
|
349
|
+
<Text
|
|
350
|
+
style={
|
|
351
|
+
[
|
|
352
|
+
{
|
|
353
|
+
"fontFamily": "Montserrat",
|
|
354
|
+
"fontSize": 14,
|
|
355
|
+
"lineHeight": 22.4,
|
|
356
|
+
},
|
|
357
|
+
false,
|
|
358
|
+
{
|
|
359
|
+
"color": "#1F2933",
|
|
360
|
+
},
|
|
361
|
+
false,
|
|
362
|
+
false,
|
|
363
|
+
]
|
|
364
|
+
}
|
|
365
|
+
>
|
|
366
|
+
test
|
|
367
|
+
</Text>
|
|
368
|
+
</View>
|
|
369
|
+
</View>
|
|
370
|
+
`;
|
|
371
|
+
|
|
372
|
+
exports[`test snackbar given the visual state is WARNING return a light orange background and black text 1`] = `
|
|
373
|
+
<View
|
|
374
|
+
style={
|
|
375
|
+
[
|
|
376
|
+
{
|
|
377
|
+
"alignItems": "center",
|
|
378
|
+
"borderColor": "rgba (39, 51, 68, 0.1)",
|
|
379
|
+
"borderRadius": 16,
|
|
380
|
+
"elevation": 4,
|
|
381
|
+
"flexDirection": "row",
|
|
382
|
+
"overflow": "hidden",
|
|
383
|
+
"paddingBottom": 8,
|
|
384
|
+
"paddingLeft": 32,
|
|
385
|
+
"paddingRight": 32,
|
|
386
|
+
"paddingTop": 8,
|
|
387
|
+
},
|
|
388
|
+
false,
|
|
389
|
+
false,
|
|
390
|
+
false,
|
|
391
|
+
{
|
|
392
|
+
"backgroundColor": "#FEEFDB",
|
|
393
|
+
},
|
|
394
|
+
]
|
|
395
|
+
}
|
|
396
|
+
>
|
|
397
|
+
<View
|
|
398
|
+
style={
|
|
399
|
+
{
|
|
400
|
+
"alignItems": "center",
|
|
401
|
+
"height": 32,
|
|
402
|
+
"justifyContent": "center",
|
|
403
|
+
"marginRight": 8,
|
|
404
|
+
"width": 32,
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
>
|
|
408
|
+
<RNSVGSvgView
|
|
409
|
+
align="xMidYMid"
|
|
410
|
+
bbHeight="28"
|
|
411
|
+
bbWidth="28"
|
|
412
|
+
fill="none"
|
|
413
|
+
focusable={false}
|
|
414
|
+
height="28"
|
|
415
|
+
meetOrSlice={0}
|
|
416
|
+
minX={0}
|
|
417
|
+
minY={0}
|
|
418
|
+
style={
|
|
419
|
+
[
|
|
420
|
+
{
|
|
421
|
+
"backgroundColor": "transparent",
|
|
422
|
+
"borderWidth": 0,
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
"flex": 0,
|
|
426
|
+
"height": 28,
|
|
427
|
+
"width": 28,
|
|
428
|
+
},
|
|
429
|
+
]
|
|
430
|
+
}
|
|
431
|
+
vbHeight={26}
|
|
432
|
+
vbWidth={26}
|
|
433
|
+
width="28"
|
|
434
|
+
>
|
|
435
|
+
<RNSVGGroup
|
|
436
|
+
fill={null}
|
|
437
|
+
propList={
|
|
438
|
+
[
|
|
439
|
+
"fill",
|
|
440
|
+
]
|
|
441
|
+
}
|
|
442
|
+
>
|
|
443
|
+
<RNSVGPath
|
|
444
|
+
d="M3.25 4.25C3.25 3.69772 3.69772 3.25 4.25 3.25H21.75C22.3023 3.25 22.75 3.69772 22.75 4.25V7.16912C22.75 7.43434 22.6446 7.68869 22.4571 7.87623L15.4596 14.8738C15.272 15.0613 15.1667 15.3157 15.1667 15.5809V18.4167L10.8333 22.75V15.5809C10.8333 15.3157 10.728 15.0613 10.5404 14.8738L3.54289 7.87623C3.35536 7.68869 3.25 7.43434 3.25 7.16912V4.25Z"
|
|
445
|
+
propList={
|
|
446
|
+
[
|
|
447
|
+
"stroke",
|
|
448
|
+
"strokeWidth",
|
|
449
|
+
"strokeLinecap",
|
|
450
|
+
"strokeLinejoin",
|
|
451
|
+
]
|
|
452
|
+
}
|
|
453
|
+
stroke={4279837036}
|
|
454
|
+
strokeLinecap={1}
|
|
455
|
+
strokeLinejoin={1}
|
|
456
|
+
strokeWidth="2"
|
|
457
|
+
/>
|
|
458
|
+
</RNSVGGroup>
|
|
459
|
+
</RNSVGSvgView>
|
|
460
|
+
</View>
|
|
461
|
+
<View
|
|
462
|
+
style={
|
|
463
|
+
{
|
|
464
|
+
"alignContent": "center",
|
|
465
|
+
"flex": 1,
|
|
466
|
+
"justifyContent": "center",
|
|
467
|
+
"paddingLeft": 32,
|
|
468
|
+
"paddingRight": 32,
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
>
|
|
472
|
+
<Text
|
|
473
|
+
style={
|
|
474
|
+
[
|
|
475
|
+
{
|
|
476
|
+
"fontFamily": "Montserrat",
|
|
477
|
+
"fontSize": 14,
|
|
478
|
+
"lineHeight": 22.4,
|
|
479
|
+
},
|
|
480
|
+
false,
|
|
481
|
+
false,
|
|
482
|
+
false,
|
|
483
|
+
{
|
|
484
|
+
"color": "#1F2933",
|
|
485
|
+
},
|
|
486
|
+
]
|
|
487
|
+
}
|
|
488
|
+
>
|
|
489
|
+
test
|
|
490
|
+
</Text>
|
|
491
|
+
</View>
|
|
492
|
+
</View>
|
|
493
|
+
`;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React, {useContext} from 'react';
|
|
2
|
+
import {ThemeCtx} from '../../../context/theme.context';
|
|
3
|
+
import {Text, View} from 'react-native';
|
|
4
|
+
import {Stylesheet} from './snackbar.styles';
|
|
5
|
+
import {VisualState} from '../../../types/visual-state.enum';
|
|
6
|
+
import {FilterIcon} from '../../../icons/outline/filter/filter.icon';
|
|
7
|
+
|
|
8
|
+
type SnackbarProps = {
|
|
9
|
+
text: string;
|
|
10
|
+
variant: VisualState;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const Snackbar = ({text, variant}: SnackbarProps) => {
|
|
14
|
+
const context = useContext(ThemeCtx);
|
|
15
|
+
const styles = Stylesheet(context, variant);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<View style={styles.container}>
|
|
19
|
+
<View style={styles.iconContainer}>
|
|
20
|
+
<FilterIcon color={context.colors.main['0']} />
|
|
21
|
+
</View>
|
|
22
|
+
<View style={styles.textContainer}>
|
|
23
|
+
<Text style={styles.text}>{text}</Text>
|
|
24
|
+
</View>
|
|
25
|
+
</View>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
export {Snackbar as Snackbar};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {VisualState} from '../../../types/visual-state.enum';
|
|
3
|
+
import {Snackbar} from './snackbar.component';
|
|
4
|
+
const {View} = require('react-native');
|
|
5
|
+
|
|
6
|
+
export const SnackbarPreview = ({}: {}) => {
|
|
7
|
+
return (
|
|
8
|
+
<View
|
|
9
|
+
style={{
|
|
10
|
+
flex: 1,
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
justifyContent: 'center',
|
|
13
|
+
}}
|
|
14
|
+
>
|
|
15
|
+
<Snackbar
|
|
16
|
+
text={'Geen internetverbinding, maak verbinding en probeer opnieuw'}
|
|
17
|
+
variant={VisualState.DEFAULT}
|
|
18
|
+
/>
|
|
19
|
+
<Snackbar
|
|
20
|
+
text={'Geen internetverbinding, maak verbinding en probeer opnieuw'}
|
|
21
|
+
variant={VisualState.SUCCESS}
|
|
22
|
+
/>
|
|
23
|
+
<Snackbar
|
|
24
|
+
text={'Geen internetverbinding, maak verbinding en probeer opnieuw'}
|
|
25
|
+
variant={VisualState.WARNING}
|
|
26
|
+
/>
|
|
27
|
+
<Snackbar
|
|
28
|
+
text={'Geen internetverbinding, maak verbinding en probeer opnieuw'}
|
|
29
|
+
variant={VisualState.ERROR}
|
|
30
|
+
/>
|
|
31
|
+
</View>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import {StyleSheet} from 'react-native';
|
|
2
|
+
import {VisualState} from '../../../types/visual-state.enum';
|
|
3
|
+
import {Font} from '../../../theme/font';
|
|
4
|
+
import {Scale} from '../../../theme/scale';
|
|
5
|
+
|
|
6
|
+
export const Stylesheet = (Context, variant) =>
|
|
7
|
+
StyleSheet.create({
|
|
8
|
+
container: [
|
|
9
|
+
{
|
|
10
|
+
flexDirection: 'row',
|
|
11
|
+
paddingRight: Scale.xl,
|
|
12
|
+
paddingLeft: Scale.xl,
|
|
13
|
+
paddingTop: Scale.xs,
|
|
14
|
+
paddingBottom: Scale.xs,
|
|
15
|
+
overflow: 'hidden',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
borderColor: 'rgba (39, 51, 68, 0.1)',
|
|
18
|
+
borderRadius: Scale.m,
|
|
19
|
+
elevation: Scale.xxs,
|
|
20
|
+
},
|
|
21
|
+
variant === VisualState.DEFAULT && {
|
|
22
|
+
backgroundColor: Context.colors.main['9'],
|
|
23
|
+
},
|
|
24
|
+
variant === VisualState.SUCCESS && {
|
|
25
|
+
backgroundColor: Context.colors.ui.success.xlight,
|
|
26
|
+
},
|
|
27
|
+
variant === VisualState.ERROR && {
|
|
28
|
+
backgroundColor: Context.colors.ui.error.default,
|
|
29
|
+
},
|
|
30
|
+
variant === VisualState.WARNING && {
|
|
31
|
+
backgroundColor: Context.colors.ui.warning.xlight,
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
|
|
35
|
+
textContainer: {
|
|
36
|
+
flex: 1,
|
|
37
|
+
justifyContent: 'center',
|
|
38
|
+
alignContent: 'center',
|
|
39
|
+
paddingLeft: Scale.xl,
|
|
40
|
+
paddingRight: Scale.xl,
|
|
41
|
+
},
|
|
42
|
+
text: [
|
|
43
|
+
{
|
|
44
|
+
...Font.regular,
|
|
45
|
+
},
|
|
46
|
+
variant === VisualState.DEFAULT && {
|
|
47
|
+
color: Context.colors.main['0'],
|
|
48
|
+
},
|
|
49
|
+
variant === VisualState.SUCCESS && {
|
|
50
|
+
color: Context.colors.ui.black,
|
|
51
|
+
},
|
|
52
|
+
variant === VisualState.ERROR && {
|
|
53
|
+
color: Context.colors.ui.white,
|
|
54
|
+
},
|
|
55
|
+
variant === VisualState.WARNING && {
|
|
56
|
+
color: Context.colors.ui.black,
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
iconContainer: {
|
|
60
|
+
height: Scale.xl,
|
|
61
|
+
width: Scale.xl,
|
|
62
|
+
marginRight: Scale.xs,
|
|
63
|
+
// marginVertical: Scale.m,
|
|
64
|
+
alignItems: 'center',
|
|
65
|
+
justifyContent: 'center',
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
// icon: [
|
|
69
|
+
// variant === VisualState.DEFAULT && {
|
|
70
|
+
// color: Context.colors.main['0']
|
|
71
|
+
// },
|
|
72
|
+
// variant === VisualState.SUCCESS && {
|
|
73
|
+
// color: Context.colors.ui.black
|
|
74
|
+
// },
|
|
75
|
+
// variant === VisualState.ERROR && {
|
|
76
|
+
// color: Context.colors.ui.white
|
|
77
|
+
// },
|
|
78
|
+
// variant === VisualState.WARNING && {
|
|
79
|
+
// color: Context.colors.ui.black
|
|
80
|
+
// }
|
|
81
|
+
// ]
|
|
82
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import renderer from 'react-test-renderer';
|
|
3
|
+
import {Snackbar} from './snackbar.component';
|
|
4
|
+
import {VisualState} from '../../../types/visual-state.enum';
|
|
5
|
+
|
|
6
|
+
describe('test snackbar', () => {
|
|
7
|
+
it(' given the visual state is DEFAULT return a light blue background and black text ', () => {
|
|
8
|
+
const tree = renderer
|
|
9
|
+
.create(<Snackbar text="test" variant={VisualState.DEFAULT} />)
|
|
10
|
+
.toJSON();
|
|
11
|
+
|
|
12
|
+
expect(tree).toMatchSnapshot();
|
|
13
|
+
});
|
|
14
|
+
it(' given the visual state is SUCCESS return a light green background and black text ', () => {
|
|
15
|
+
const tree = renderer
|
|
16
|
+
.create(<Snackbar text="test" variant={VisualState.SUCCESS} />)
|
|
17
|
+
.toJSON();
|
|
18
|
+
|
|
19
|
+
expect(tree).toMatchSnapshot();
|
|
20
|
+
});
|
|
21
|
+
it(' given the visual state is WARNING return a light orange background and black text ', () => {
|
|
22
|
+
const tree = renderer
|
|
23
|
+
.create(<Snackbar text="test" variant={VisualState.WARNING} />)
|
|
24
|
+
.toJSON();
|
|
25
|
+
|
|
26
|
+
expect(tree).toMatchSnapshot();
|
|
27
|
+
});
|
|
28
|
+
it(' given the visual state is ERROR return a red background and white text ', () => {
|
|
29
|
+
const tree = renderer
|
|
30
|
+
.create(<Snackbar text="test" variant={VisualState.ERROR} />)
|
|
31
|
+
.toJSON();
|
|
32
|
+
|
|
33
|
+
expect(tree).toMatchSnapshot();
|
|
34
|
+
});
|
|
35
|
+
});
|