@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,307 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`test button component should render a button component 1`] = `
|
|
4
|
+
<View
|
|
5
|
+
accessible={true}
|
|
6
|
+
collapsable={false}
|
|
7
|
+
focusable={true}
|
|
8
|
+
onBlur={[Function]}
|
|
9
|
+
onClick={[Function]}
|
|
10
|
+
onFocus={[Function]}
|
|
11
|
+
onResponderGrant={[Function]}
|
|
12
|
+
onResponderMove={[Function]}
|
|
13
|
+
onResponderRelease={[Function]}
|
|
14
|
+
onResponderTerminate={[Function]}
|
|
15
|
+
onResponderTerminationRequest={[Function]}
|
|
16
|
+
onStartShouldSetResponder={[Function]}
|
|
17
|
+
>
|
|
18
|
+
<View
|
|
19
|
+
style={
|
|
20
|
+
{
|
|
21
|
+
"alignItems": "center",
|
|
22
|
+
"backgroundColor": "#19216C",
|
|
23
|
+
"borderRadius": 50,
|
|
24
|
+
"flexDirection": "row",
|
|
25
|
+
"justifyContent": "center",
|
|
26
|
+
"paddingHorizontal": 24,
|
|
27
|
+
"paddingVertical": 12,
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
>
|
|
31
|
+
<Text
|
|
32
|
+
style={
|
|
33
|
+
{
|
|
34
|
+
"color": "#E0E8F9",
|
|
35
|
+
"fontFamily": "SourceSansPro",
|
|
36
|
+
"fontSize": 16,
|
|
37
|
+
"lineHeight": 22.4,
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
>
|
|
41
|
+
Test button
|
|
42
|
+
</Text>
|
|
43
|
+
</View>
|
|
44
|
+
</View>
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
exports[`test button component should render a button component that is disabled 1`] = `
|
|
48
|
+
<View
|
|
49
|
+
accessibilityState={
|
|
50
|
+
{
|
|
51
|
+
"disabled": true,
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
accessible={true}
|
|
55
|
+
collapsable={false}
|
|
56
|
+
focusable={true}
|
|
57
|
+
onBlur={[Function]}
|
|
58
|
+
onClick={[Function]}
|
|
59
|
+
onFocus={[Function]}
|
|
60
|
+
onResponderGrant={[Function]}
|
|
61
|
+
onResponderMove={[Function]}
|
|
62
|
+
onResponderRelease={[Function]}
|
|
63
|
+
onResponderTerminate={[Function]}
|
|
64
|
+
onResponderTerminationRequest={[Function]}
|
|
65
|
+
onStartShouldSetResponder={[Function]}
|
|
66
|
+
>
|
|
67
|
+
<View
|
|
68
|
+
style={
|
|
69
|
+
{
|
|
70
|
+
"alignItems": "center",
|
|
71
|
+
"backgroundColor": "#E5E8EB",
|
|
72
|
+
"borderRadius": 50,
|
|
73
|
+
"flexDirection": "row",
|
|
74
|
+
"justifyContent": "center",
|
|
75
|
+
"paddingHorizontal": 24,
|
|
76
|
+
"paddingVertical": 12,
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
>
|
|
80
|
+
<Text
|
|
81
|
+
style={
|
|
82
|
+
{
|
|
83
|
+
"color": "#515F6C",
|
|
84
|
+
"fontFamily": "SourceSansPro",
|
|
85
|
+
"fontSize": 16,
|
|
86
|
+
"lineHeight": 22.4,
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
>
|
|
90
|
+
Button with icon
|
|
91
|
+
</Text>
|
|
92
|
+
</View>
|
|
93
|
+
</View>
|
|
94
|
+
`;
|
|
95
|
+
|
|
96
|
+
exports[`test button component should render a button component with an icon 1`] = `
|
|
97
|
+
<View
|
|
98
|
+
accessible={true}
|
|
99
|
+
collapsable={false}
|
|
100
|
+
focusable={true}
|
|
101
|
+
onBlur={[Function]}
|
|
102
|
+
onClick={[Function]}
|
|
103
|
+
onFocus={[Function]}
|
|
104
|
+
onResponderGrant={[Function]}
|
|
105
|
+
onResponderMove={[Function]}
|
|
106
|
+
onResponderRelease={[Function]}
|
|
107
|
+
onResponderTerminate={[Function]}
|
|
108
|
+
onResponderTerminationRequest={[Function]}
|
|
109
|
+
onStartShouldSetResponder={[Function]}
|
|
110
|
+
>
|
|
111
|
+
<View
|
|
112
|
+
style={
|
|
113
|
+
{
|
|
114
|
+
"alignItems": "center",
|
|
115
|
+
"backgroundColor": "#19216C",
|
|
116
|
+
"borderRadius": 50,
|
|
117
|
+
"flexDirection": "row",
|
|
118
|
+
"justifyContent": "center",
|
|
119
|
+
"paddingHorizontal": 24,
|
|
120
|
+
"paddingVertical": 12,
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
>
|
|
124
|
+
<View
|
|
125
|
+
style={
|
|
126
|
+
{
|
|
127
|
+
"marginRight": 12,
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
>
|
|
131
|
+
<RNSVGSvgView
|
|
132
|
+
align="xMidYMid"
|
|
133
|
+
bbHeight="28"
|
|
134
|
+
bbWidth="28"
|
|
135
|
+
fill="none"
|
|
136
|
+
focusable={false}
|
|
137
|
+
height="28"
|
|
138
|
+
meetOrSlice={0}
|
|
139
|
+
minX={0}
|
|
140
|
+
minY={0}
|
|
141
|
+
style={
|
|
142
|
+
[
|
|
143
|
+
{
|
|
144
|
+
"backgroundColor": "transparent",
|
|
145
|
+
"borderWidth": 0,
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"flex": 0,
|
|
149
|
+
"height": 28,
|
|
150
|
+
"width": 28,
|
|
151
|
+
},
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
vbHeight={28}
|
|
155
|
+
vbWidth={28}
|
|
156
|
+
width="28"
|
|
157
|
+
>
|
|
158
|
+
<RNSVGGroup
|
|
159
|
+
fill={null}
|
|
160
|
+
propList={
|
|
161
|
+
[
|
|
162
|
+
"fill",
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
>
|
|
166
|
+
<RNSVGPath
|
|
167
|
+
d="M3.875 9.5L12.7519 15.4179C13.5077 15.9218 14.4923 15.9218 15.2481 15.4179L24.125 9.5M6.125 21.875H21.875C23.1176 21.875 24.125 20.8676 24.125 19.625V8.375C24.125 7.13236 23.1176 6.125 21.875 6.125H6.125C4.88236 6.125 3.875 7.13236 3.875 8.375V19.625C3.875 20.8676 4.88236 21.875 6.125 21.875Z"
|
|
168
|
+
propList={
|
|
169
|
+
[
|
|
170
|
+
"stroke",
|
|
171
|
+
"strokeWidth",
|
|
172
|
+
"strokeLinecap",
|
|
173
|
+
"strokeLinejoin",
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
stroke={4279837036}
|
|
177
|
+
strokeLinecap={1}
|
|
178
|
+
strokeLinejoin={1}
|
|
179
|
+
strokeWidth="2"
|
|
180
|
+
/>
|
|
181
|
+
</RNSVGGroup>
|
|
182
|
+
</RNSVGSvgView>
|
|
183
|
+
</View>
|
|
184
|
+
<Text
|
|
185
|
+
style={
|
|
186
|
+
{
|
|
187
|
+
"color": "#E0E8F9",
|
|
188
|
+
"fontFamily": "SourceSansPro",
|
|
189
|
+
"fontSize": 16,
|
|
190
|
+
"lineHeight": 22.4,
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
>
|
|
194
|
+
Button with icon
|
|
195
|
+
</Text>
|
|
196
|
+
</View>
|
|
197
|
+
</View>
|
|
198
|
+
`;
|
|
199
|
+
|
|
200
|
+
exports[`test button component should render a button component with an icon but is also disabled 1`] = `
|
|
201
|
+
<View
|
|
202
|
+
accessibilityState={
|
|
203
|
+
{
|
|
204
|
+
"disabled": true,
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
accessible={true}
|
|
208
|
+
collapsable={false}
|
|
209
|
+
focusable={true}
|
|
210
|
+
onBlur={[Function]}
|
|
211
|
+
onClick={[Function]}
|
|
212
|
+
onFocus={[Function]}
|
|
213
|
+
onResponderGrant={[Function]}
|
|
214
|
+
onResponderMove={[Function]}
|
|
215
|
+
onResponderRelease={[Function]}
|
|
216
|
+
onResponderTerminate={[Function]}
|
|
217
|
+
onResponderTerminationRequest={[Function]}
|
|
218
|
+
onStartShouldSetResponder={[Function]}
|
|
219
|
+
>
|
|
220
|
+
<View
|
|
221
|
+
style={
|
|
222
|
+
{
|
|
223
|
+
"alignItems": "center",
|
|
224
|
+
"backgroundColor": "#E5E8EB",
|
|
225
|
+
"borderRadius": 50,
|
|
226
|
+
"flexDirection": "row",
|
|
227
|
+
"justifyContent": "center",
|
|
228
|
+
"paddingHorizontal": 24,
|
|
229
|
+
"paddingVertical": 12,
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
>
|
|
233
|
+
<View
|
|
234
|
+
style={
|
|
235
|
+
{
|
|
236
|
+
"marginRight": 12,
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
>
|
|
240
|
+
<RNSVGSvgView
|
|
241
|
+
align="xMidYMid"
|
|
242
|
+
bbHeight="28"
|
|
243
|
+
bbWidth="28"
|
|
244
|
+
fill="none"
|
|
245
|
+
focusable={false}
|
|
246
|
+
height="28"
|
|
247
|
+
meetOrSlice={0}
|
|
248
|
+
minX={0}
|
|
249
|
+
minY={0}
|
|
250
|
+
style={
|
|
251
|
+
[
|
|
252
|
+
{
|
|
253
|
+
"backgroundColor": "transparent",
|
|
254
|
+
"borderWidth": 0,
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"flex": 0,
|
|
258
|
+
"height": 28,
|
|
259
|
+
"width": 28,
|
|
260
|
+
},
|
|
261
|
+
]
|
|
262
|
+
}
|
|
263
|
+
vbHeight={28}
|
|
264
|
+
vbWidth={28}
|
|
265
|
+
width="28"
|
|
266
|
+
>
|
|
267
|
+
<RNSVGGroup
|
|
268
|
+
fill={null}
|
|
269
|
+
propList={
|
|
270
|
+
[
|
|
271
|
+
"fill",
|
|
272
|
+
]
|
|
273
|
+
}
|
|
274
|
+
>
|
|
275
|
+
<RNSVGPath
|
|
276
|
+
d="M3.875 9.5L12.7519 15.4179C13.5077 15.9218 14.4923 15.9218 15.2481 15.4179L24.125 9.5M6.125 21.875H21.875C23.1176 21.875 24.125 20.8676 24.125 19.625V8.375C24.125 7.13236 23.1176 6.125 21.875 6.125H6.125C4.88236 6.125 3.875 7.13236 3.875 8.375V19.625C3.875 20.8676 4.88236 21.875 6.125 21.875Z"
|
|
277
|
+
propList={
|
|
278
|
+
[
|
|
279
|
+
"stroke",
|
|
280
|
+
"strokeWidth",
|
|
281
|
+
"strokeLinecap",
|
|
282
|
+
"strokeLinejoin",
|
|
283
|
+
]
|
|
284
|
+
}
|
|
285
|
+
stroke={4279837036}
|
|
286
|
+
strokeLinecap={1}
|
|
287
|
+
strokeLinejoin={1}
|
|
288
|
+
strokeWidth="2"
|
|
289
|
+
/>
|
|
290
|
+
</RNSVGGroup>
|
|
291
|
+
</RNSVGSvgView>
|
|
292
|
+
</View>
|
|
293
|
+
<Text
|
|
294
|
+
style={
|
|
295
|
+
{
|
|
296
|
+
"color": "#515F6C",
|
|
297
|
+
"fontFamily": "SourceSansPro",
|
|
298
|
+
"fontSize": 16,
|
|
299
|
+
"lineHeight": 22.4,
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
>
|
|
303
|
+
Button with icon
|
|
304
|
+
</Text>
|
|
305
|
+
</View>
|
|
306
|
+
</View>
|
|
307
|
+
`;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, {useContext} from 'react';
|
|
2
|
+
import {Pressable, Text, View} from 'react-native';
|
|
3
|
+
import {ThemeCtx} from '../../../context/theme.context';
|
|
4
|
+
import {Stylesheet} from './button.styles';
|
|
5
|
+
|
|
6
|
+
type ButtonProps = {
|
|
7
|
+
label: string;
|
|
8
|
+
icon?: any; // can be an icon type?
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
onPress?: () => void;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const Button = ({label, icon, disabled, onPress}: ButtonProps) => {
|
|
14
|
+
const context = useContext(ThemeCtx);
|
|
15
|
+
const styles = Stylesheet(context, disabled);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Pressable disabled={disabled} onPress={onPress}>
|
|
19
|
+
<View style={styles.container}>
|
|
20
|
+
{icon ? <View style={styles.iconGap}>{icon}</View> : null}
|
|
21
|
+
<Text style={styles.label}>{label}</Text>
|
|
22
|
+
</View>
|
|
23
|
+
</Pressable>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export {Button as Button};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Button} from './button.component';
|
|
3
|
+
import {FilterIcon} from '../../../icons/outline/filter/filter.icon';
|
|
4
|
+
const {View} = require('react-native');
|
|
5
|
+
|
|
6
|
+
export const ButtonPreview = ({}: {}) => {
|
|
7
|
+
return (
|
|
8
|
+
<View
|
|
9
|
+
style={{
|
|
10
|
+
flex: 1,
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
justifyContent: 'center',
|
|
13
|
+
}}
|
|
14
|
+
>
|
|
15
|
+
<Button label="Default button" onPress={() => console.log('clicked')} />
|
|
16
|
+
<Button
|
|
17
|
+
label="Icon button"
|
|
18
|
+
icon={<FilterIcon color="red" />}
|
|
19
|
+
onPress={() => console.log('clicked')}
|
|
20
|
+
/>
|
|
21
|
+
<Button
|
|
22
|
+
label="Disabled"
|
|
23
|
+
disabled={true}
|
|
24
|
+
onPress={() => console.log('clicked')}
|
|
25
|
+
/>
|
|
26
|
+
<Button
|
|
27
|
+
label="Disabled Icon button"
|
|
28
|
+
icon={<FilterIcon color="red" />}
|
|
29
|
+
disabled={true}
|
|
30
|
+
onPress={() => console.log('clicked')}
|
|
31
|
+
/>
|
|
32
|
+
</View>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {StyleSheet} from 'react-native';
|
|
2
|
+
import {Font} from '../../../theme/font';
|
|
3
|
+
import {Scale} from '../../../theme/scale';
|
|
4
|
+
|
|
5
|
+
export const Stylesheet = (context, disabled) =>
|
|
6
|
+
StyleSheet.create({
|
|
7
|
+
container: {
|
|
8
|
+
backgroundColor: disabled
|
|
9
|
+
? context.colors.ui.lightgrey
|
|
10
|
+
: context.colors.main['0'],
|
|
11
|
+
paddingVertical: Scale.s,
|
|
12
|
+
paddingHorizontal: Scale.l,
|
|
13
|
+
flexDirection: 'row',
|
|
14
|
+
justifyContent: 'center',
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
borderRadius: 50,
|
|
17
|
+
},
|
|
18
|
+
label: {
|
|
19
|
+
...Font.medium,
|
|
20
|
+
color: disabled ? context.colors.ui.darkgrey : context.colors.main['9'],
|
|
21
|
+
},
|
|
22
|
+
iconGap: {
|
|
23
|
+
marginRight: Scale.s,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import render from 'react-test-renderer';
|
|
3
|
+
import {Button} from './button.component';
|
|
4
|
+
import {Icon} from '../../../icons';
|
|
5
|
+
|
|
6
|
+
describe('test button component', () => {
|
|
7
|
+
it('should render a button component', function () {
|
|
8
|
+
const tree = render.create(<Button label="Test button" />).toJSON();
|
|
9
|
+
expect(tree).toMatchSnapshot();
|
|
10
|
+
});
|
|
11
|
+
it('should render a button component that is disabled', () => {
|
|
12
|
+
const tree = render
|
|
13
|
+
.create(<Button label="Button with icon" disabled={true} />)
|
|
14
|
+
.toJSON();
|
|
15
|
+
expect(tree).toMatchSnapshot();
|
|
16
|
+
});
|
|
17
|
+
it('should render a button component with an icon', () => {
|
|
18
|
+
const tree = render
|
|
19
|
+
.create(<Button label="Button with icon" icon={<Icon.Outline.Mail />} />)
|
|
20
|
+
.toJSON();
|
|
21
|
+
expect(tree).toMatchSnapshot();
|
|
22
|
+
});
|
|
23
|
+
it('should render a button component with an icon but is also disabled', () => {
|
|
24
|
+
const tree = render
|
|
25
|
+
.create(
|
|
26
|
+
<Button
|
|
27
|
+
label="Button with icon"
|
|
28
|
+
icon={<Icon.Outline.Mail />}
|
|
29
|
+
disabled={true}
|
|
30
|
+
/>
|
|
31
|
+
)
|
|
32
|
+
.toJSON();
|
|
33
|
+
expect(tree).toMatchSnapshot();
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Cancel link component test renders a cancel link with label "annuleer" that is pressable 1`] = `
|
|
4
|
+
<View
|
|
5
|
+
accessible={true}
|
|
6
|
+
collapsable={false}
|
|
7
|
+
focusable={true}
|
|
8
|
+
onBlur={[Function]}
|
|
9
|
+
onClick={[Function]}
|
|
10
|
+
onFocus={[Function]}
|
|
11
|
+
onResponderGrant={[Function]}
|
|
12
|
+
onResponderMove={[Function]}
|
|
13
|
+
onResponderRelease={[Function]}
|
|
14
|
+
onResponderTerminate={[Function]}
|
|
15
|
+
onResponderTerminationRequest={[Function]}
|
|
16
|
+
onStartShouldSetResponder={[Function]}
|
|
17
|
+
>
|
|
18
|
+
<View
|
|
19
|
+
style={
|
|
20
|
+
{
|
|
21
|
+
"alignItems": "center",
|
|
22
|
+
"backgroundColor": "transparent",
|
|
23
|
+
"borderRadius": 50,
|
|
24
|
+
"flexDirection": "row",
|
|
25
|
+
"justifyContent": "center",
|
|
26
|
+
"paddingHorizontal": 24,
|
|
27
|
+
"paddingVertical": 12,
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
>
|
|
31
|
+
<Text
|
|
32
|
+
style={
|
|
33
|
+
{
|
|
34
|
+
"color": "#F16868",
|
|
35
|
+
"fontFamily": "SourceSansPro",
|
|
36
|
+
"fontSize": 16,
|
|
37
|
+
"lineHeight": 22.4,
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
>
|
|
41
|
+
Annuleer
|
|
42
|
+
</Text>
|
|
43
|
+
</View>
|
|
44
|
+
</View>
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
exports[`Cancel link component test renders a cancel link with label "cancel" that is pressable 1`] = `
|
|
48
|
+
<View
|
|
49
|
+
accessible={true}
|
|
50
|
+
collapsable={false}
|
|
51
|
+
focusable={true}
|
|
52
|
+
onBlur={[Function]}
|
|
53
|
+
onClick={[Function]}
|
|
54
|
+
onFocus={[Function]}
|
|
55
|
+
onResponderGrant={[Function]}
|
|
56
|
+
onResponderMove={[Function]}
|
|
57
|
+
onResponderRelease={[Function]}
|
|
58
|
+
onResponderTerminate={[Function]}
|
|
59
|
+
onResponderTerminationRequest={[Function]}
|
|
60
|
+
onStartShouldSetResponder={[Function]}
|
|
61
|
+
>
|
|
62
|
+
<View
|
|
63
|
+
style={
|
|
64
|
+
{
|
|
65
|
+
"alignItems": "center",
|
|
66
|
+
"backgroundColor": "transparent",
|
|
67
|
+
"borderRadius": 50,
|
|
68
|
+
"flexDirection": "row",
|
|
69
|
+
"justifyContent": "center",
|
|
70
|
+
"paddingHorizontal": 24,
|
|
71
|
+
"paddingVertical": 12,
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
>
|
|
75
|
+
<Text
|
|
76
|
+
style={
|
|
77
|
+
{
|
|
78
|
+
"color": "#F16868",
|
|
79
|
+
"fontFamily": "SourceSansPro",
|
|
80
|
+
"fontSize": 16,
|
|
81
|
+
"lineHeight": 22.4,
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
>
|
|
85
|
+
Cancel
|
|
86
|
+
</Text>
|
|
87
|
+
</View>
|
|
88
|
+
</View>
|
|
89
|
+
`;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, {useContext} from 'react';
|
|
2
|
+
import {Pressable, Text, View} from 'react-native';
|
|
3
|
+
import {ThemeCtx} from '../../../context/theme.context';
|
|
4
|
+
import {Stylesheet} from './cancel-link.styles';
|
|
5
|
+
|
|
6
|
+
type CancelLinkProps = {
|
|
7
|
+
label: string;
|
|
8
|
+
onPress: () => void;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const CancelLink = ({label, onPress}: CancelLinkProps) => {
|
|
12
|
+
const context = useContext(ThemeCtx);
|
|
13
|
+
const styles = Stylesheet(context);
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<Pressable onPress={onPress}>
|
|
17
|
+
<View style={styles.container}>
|
|
18
|
+
<Text style={styles.label}>{label}</Text>
|
|
19
|
+
</View>
|
|
20
|
+
</Pressable>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export {CancelLink as CancelLink};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {CancelLink} from './cancel-link.component';
|
|
3
|
+
const {View} = require('react-native');
|
|
4
|
+
|
|
5
|
+
export const CancelLinkPreview = ({}: {}) => {
|
|
6
|
+
return (
|
|
7
|
+
<View
|
|
8
|
+
style={{
|
|
9
|
+
flex: 1,
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
justifyContent: 'center',
|
|
12
|
+
}}
|
|
13
|
+
>
|
|
14
|
+
<CancelLink
|
|
15
|
+
label={'Annuleer'}
|
|
16
|
+
onPress={() => console.log('cancel clicked')}
|
|
17
|
+
/>
|
|
18
|
+
</View>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {StyleSheet} from 'react-native';
|
|
2
|
+
import {Font} from '../../../theme/font';
|
|
3
|
+
import {Scale} from '../../../theme/scale';
|
|
4
|
+
|
|
5
|
+
export const Stylesheet = (context) =>
|
|
6
|
+
StyleSheet.create({
|
|
7
|
+
container: {
|
|
8
|
+
backgroundColor: 'transparent',
|
|
9
|
+
paddingVertical: Scale.s,
|
|
10
|
+
paddingHorizontal: Scale.l,
|
|
11
|
+
flexDirection: 'row',
|
|
12
|
+
justifyContent: 'center',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
borderRadius: 50,
|
|
15
|
+
},
|
|
16
|
+
label: {
|
|
17
|
+
...Font.medium,
|
|
18
|
+
color: context.colors.ui.error.default,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import render from 'react-test-renderer';
|
|
3
|
+
import {CancelLink} from './cancel-link.component';
|
|
4
|
+
|
|
5
|
+
describe('Cancel link component test', () => {
|
|
6
|
+
it('renders a cancel link with label "cancel" that is pressable', function () {
|
|
7
|
+
const tree = render
|
|
8
|
+
.create(
|
|
9
|
+
<CancelLink
|
|
10
|
+
label="Cancel"
|
|
11
|
+
onPress={() => console.log('You cancelled something')}
|
|
12
|
+
/>
|
|
13
|
+
)
|
|
14
|
+
.toJSON();
|
|
15
|
+
expect(tree).toMatchSnapshot();
|
|
16
|
+
});
|
|
17
|
+
it('renders a cancel link with label "annuleer" that is pressable', function () {
|
|
18
|
+
const tree = render
|
|
19
|
+
.create(
|
|
20
|
+
<CancelLink
|
|
21
|
+
label="Annuleer"
|
|
22
|
+
onPress={() => console.log('You cancelled something')}
|
|
23
|
+
/>
|
|
24
|
+
)
|
|
25
|
+
.toJSON();
|
|
26
|
+
expect(tree).toMatchSnapshot();
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`test check switch should render a check switch component 1`] = `
|
|
4
|
+
<View
|
|
5
|
+
style={
|
|
6
|
+
{
|
|
7
|
+
"alignItems": "center",
|
|
8
|
+
"flexDirection": "row",
|
|
9
|
+
"justifyContent": "center",
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
>
|
|
13
|
+
<View
|
|
14
|
+
accessible={true}
|
|
15
|
+
collapsable={false}
|
|
16
|
+
focusable={true}
|
|
17
|
+
onBlur={[Function]}
|
|
18
|
+
onClick={[Function]}
|
|
19
|
+
onFocus={[Function]}
|
|
20
|
+
onResponderGrant={[Function]}
|
|
21
|
+
onResponderMove={[Function]}
|
|
22
|
+
onResponderRelease={[Function]}
|
|
23
|
+
onResponderTerminate={[Function]}
|
|
24
|
+
onResponderTerminationRequest={[Function]}
|
|
25
|
+
onStartShouldSetResponder={[Function]}
|
|
26
|
+
>
|
|
27
|
+
<View
|
|
28
|
+
style={
|
|
29
|
+
{
|
|
30
|
+
"backgroundColor": "#647ACB",
|
|
31
|
+
"borderRadius": 18,
|
|
32
|
+
"height": 36,
|
|
33
|
+
"justifyContent": "center",
|
|
34
|
+
"paddingLeft": 4,
|
|
35
|
+
"paddingRight": 4,
|
|
36
|
+
"width": 65,
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
>
|
|
40
|
+
<View
|
|
41
|
+
collapsable={false}
|
|
42
|
+
style={
|
|
43
|
+
{
|
|
44
|
+
"backgroundColor": "#FFFFFF",
|
|
45
|
+
"borderRadius": 50,
|
|
46
|
+
"elevation": 4,
|
|
47
|
+
"height": 30,
|
|
48
|
+
"shadowColor": "#1F2933",
|
|
49
|
+
"shadowOffset": {
|
|
50
|
+
"height": 2,
|
|
51
|
+
"width": 0,
|
|
52
|
+
},
|
|
53
|
+
"shadowOpacity": 0.8,
|
|
54
|
+
"shadowRadius": 2,
|
|
55
|
+
"transform": [
|
|
56
|
+
{
|
|
57
|
+
"translateX": 0,
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
"width": 30,
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/>
|
|
64
|
+
</View>
|
|
65
|
+
</View>
|
|
66
|
+
</View>
|
|
67
|
+
`;
|