@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,135 @@
|
|
|
1
|
+
import React, {useState} from 'react';
|
|
2
|
+
import {VisualState} from '../../../types/visual-state.enum';
|
|
3
|
+
import {Snackbar} from '../snackbar/snackbar.component';
|
|
4
|
+
import {Button} from '../button/button.component';
|
|
5
|
+
|
|
6
|
+
const {Popover} = require('./popover.component');
|
|
7
|
+
const {View} = require('react-native');
|
|
8
|
+
|
|
9
|
+
export const PopoverPreview = ({}: {}) => {
|
|
10
|
+
const [popoverIsVisible, setPopoverIsVisible] = useState(false);
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<View
|
|
14
|
+
style={{
|
|
15
|
+
borderColor: 'red',
|
|
16
|
+
borderStyle: 'solid',
|
|
17
|
+
borderWidth: 1,
|
|
18
|
+
width: '100%',
|
|
19
|
+
height: '100%',
|
|
20
|
+
zIndex: 10000,
|
|
21
|
+
}}
|
|
22
|
+
>
|
|
23
|
+
<View
|
|
24
|
+
style={{
|
|
25
|
+
marginTop: 150,
|
|
26
|
+
}}
|
|
27
|
+
>
|
|
28
|
+
<Button
|
|
29
|
+
onPress={() => setPopoverIsVisible(true)}
|
|
30
|
+
label="Open popover"
|
|
31
|
+
/>
|
|
32
|
+
</View>
|
|
33
|
+
<Popover
|
|
34
|
+
isVisible={popoverIsVisible}
|
|
35
|
+
onClose={() => setPopoverIsVisible(false)}
|
|
36
|
+
title={'Taal'}
|
|
37
|
+
subtitle={'Welke taal wilt u gebruiken?'}
|
|
38
|
+
>
|
|
39
|
+
<View>
|
|
40
|
+
<Button label={'test'} />
|
|
41
|
+
</View>
|
|
42
|
+
<View>
|
|
43
|
+
<Button label={'test'} />
|
|
44
|
+
</View>
|
|
45
|
+
<View>
|
|
46
|
+
<Button label={'test'} />
|
|
47
|
+
</View>
|
|
48
|
+
<View>
|
|
49
|
+
<Button label={'test'} />
|
|
50
|
+
</View>
|
|
51
|
+
<View>
|
|
52
|
+
<Button label={'test'} />
|
|
53
|
+
</View>
|
|
54
|
+
<View>
|
|
55
|
+
<Button label={'test'} />
|
|
56
|
+
</View>
|
|
57
|
+
<View>
|
|
58
|
+
<Button label={'test'} />
|
|
59
|
+
</View>
|
|
60
|
+
<View>
|
|
61
|
+
<Button label={'test'} />
|
|
62
|
+
</View>
|
|
63
|
+
<View>
|
|
64
|
+
<Button label={'test'} />
|
|
65
|
+
</View>
|
|
66
|
+
<View>
|
|
67
|
+
<Button label={'test'} />
|
|
68
|
+
</View>
|
|
69
|
+
<View>
|
|
70
|
+
<Button label={'test'} />
|
|
71
|
+
</View>
|
|
72
|
+
<View>
|
|
73
|
+
<Button label={'test'} />
|
|
74
|
+
</View>
|
|
75
|
+
<View>
|
|
76
|
+
<Button label={'test'} />
|
|
77
|
+
</View>
|
|
78
|
+
<View>
|
|
79
|
+
<Button label={'test'} />
|
|
80
|
+
</View>
|
|
81
|
+
<View>
|
|
82
|
+
<Button label={'test'} />
|
|
83
|
+
</View>
|
|
84
|
+
<View>
|
|
85
|
+
<Button label={'test'} />
|
|
86
|
+
</View>
|
|
87
|
+
<View>
|
|
88
|
+
<Button label={'test'} />
|
|
89
|
+
</View>
|
|
90
|
+
<View>
|
|
91
|
+
<Button label={'test'} />
|
|
92
|
+
</View>
|
|
93
|
+
<View>
|
|
94
|
+
<Button label={'test'} />
|
|
95
|
+
</View>
|
|
96
|
+
<View>
|
|
97
|
+
<Button label={'test'} />
|
|
98
|
+
</View>
|
|
99
|
+
<View>
|
|
100
|
+
<Button label={'test'} />
|
|
101
|
+
</View>
|
|
102
|
+
<View>
|
|
103
|
+
<Button label={'test'} />
|
|
104
|
+
</View>
|
|
105
|
+
<View>
|
|
106
|
+
<Button label={'test'} />
|
|
107
|
+
</View>
|
|
108
|
+
<View>
|
|
109
|
+
<Button label={'test'} />
|
|
110
|
+
</View>
|
|
111
|
+
<View>
|
|
112
|
+
<Button label={'test'} />
|
|
113
|
+
</View>
|
|
114
|
+
<View>
|
|
115
|
+
<Button label={'test'} />
|
|
116
|
+
</View>
|
|
117
|
+
<View>
|
|
118
|
+
<Button label={'test'} />
|
|
119
|
+
</View>
|
|
120
|
+
<View>
|
|
121
|
+
<Button label={'test'} />
|
|
122
|
+
</View>
|
|
123
|
+
<View>
|
|
124
|
+
<Button label={'test'} />
|
|
125
|
+
</View>
|
|
126
|
+
<View>
|
|
127
|
+
<Button label={'test'} />
|
|
128
|
+
</View>
|
|
129
|
+
<View>
|
|
130
|
+
<Button label={'test'} />
|
|
131
|
+
</View>
|
|
132
|
+
</Popover>
|
|
133
|
+
</View>
|
|
134
|
+
);
|
|
135
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`test popover-heading component should render a popover-heading component 1`] = `
|
|
4
|
+
<View
|
|
5
|
+
style={
|
|
6
|
+
{
|
|
7
|
+
"alignItems": "center",
|
|
8
|
+
"justifyContent": "center",
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
>
|
|
12
|
+
<Text
|
|
13
|
+
style={
|
|
14
|
+
{
|
|
15
|
+
"color": "#1F2933",
|
|
16
|
+
"fontFamily": "SourceSansProBold",
|
|
17
|
+
"fontSize": 24,
|
|
18
|
+
"lineHeight": 30.2,
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
>
|
|
22
|
+
Label
|
|
23
|
+
</Text>
|
|
24
|
+
<Text
|
|
25
|
+
style={
|
|
26
|
+
{
|
|
27
|
+
"color": "#1F2933",
|
|
28
|
+
"fontFamily": "SourceSansPro",
|
|
29
|
+
"fontSize": 18,
|
|
30
|
+
"lineHeight": 22.6,
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/>
|
|
34
|
+
</View>
|
|
35
|
+
`;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, {useContext} from 'react';
|
|
2
|
+
import {ThemeCtx} from '../../../context/theme.context';
|
|
3
|
+
import {Stylesheet} from './popover-heading.styles';
|
|
4
|
+
import {Text, View} from 'react-native';
|
|
5
|
+
|
|
6
|
+
type PopoverHeadingProps = {
|
|
7
|
+
label: string;
|
|
8
|
+
subLine?: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const PopoverHeading = ({label, subLine}: PopoverHeadingProps) => {
|
|
12
|
+
const context = useContext(ThemeCtx);
|
|
13
|
+
const styles = Stylesheet(context);
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<View style={styles.container}>
|
|
17
|
+
<Text style={styles.textLabel}>{label}</Text>
|
|
18
|
+
<Text style={styles.textSubLine}>{subLine}</Text>
|
|
19
|
+
</View>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
export {PopoverHeading as PopoverHeading};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {PopoverHeading} from './popover-heading.component';
|
|
3
|
+
|
|
4
|
+
const {View} = require('react-native');
|
|
5
|
+
|
|
6
|
+
export const PopoverHeadingPreview = ({}: {}) => {
|
|
7
|
+
return (
|
|
8
|
+
<View
|
|
9
|
+
style={{
|
|
10
|
+
flex: 1,
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
justifyContent: 'center',
|
|
13
|
+
}}
|
|
14
|
+
>
|
|
15
|
+
<PopoverHeading label={'Label'} subLine={'subline'} />
|
|
16
|
+
</View>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {StyleSheet} from 'react-native';
|
|
3
|
+
import {Font} from '../../../theme/font';
|
|
4
|
+
|
|
5
|
+
export const Stylesheet = (context) =>
|
|
6
|
+
StyleSheet.create({
|
|
7
|
+
container: {
|
|
8
|
+
alignItems: 'center',
|
|
9
|
+
justifyContent: 'center',
|
|
10
|
+
},
|
|
11
|
+
textLabel: {
|
|
12
|
+
color: context.colors.ui.black,
|
|
13
|
+
...Font.bigBold,
|
|
14
|
+
},
|
|
15
|
+
textSubLine: {
|
|
16
|
+
color: context.colors.ui.black,
|
|
17
|
+
...Font.large,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import renderer from 'react-test-renderer';
|
|
3
|
+
import {PopoverHeading} from './popover-heading.component';
|
|
4
|
+
|
|
5
|
+
describe('test popover-heading component', () => {
|
|
6
|
+
it('should render a popover-heading component', () => {
|
|
7
|
+
const tree = renderer.create(<PopoverHeading label={'Label'} />).toJSON();
|
|
8
|
+
|
|
9
|
+
expect(tree).toMatchSnapshot();
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`pressable-icon test render a default disabled pressable icon 1`] = `
|
|
4
|
+
<View
|
|
5
|
+
accessibilityState={
|
|
6
|
+
{
|
|
7
|
+
"disabled": true,
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
accessible={true}
|
|
11
|
+
collapsable={false}
|
|
12
|
+
focusable={true}
|
|
13
|
+
onBlur={[Function]}
|
|
14
|
+
onClick={[Function]}
|
|
15
|
+
onFocus={[Function]}
|
|
16
|
+
onResponderGrant={[Function]}
|
|
17
|
+
onResponderMove={[Function]}
|
|
18
|
+
onResponderRelease={[Function]}
|
|
19
|
+
onResponderTerminate={[Function]}
|
|
20
|
+
onResponderTerminationRequest={[Function]}
|
|
21
|
+
onStartShouldSetResponder={[Function]}
|
|
22
|
+
>
|
|
23
|
+
<View
|
|
24
|
+
style={
|
|
25
|
+
[
|
|
26
|
+
{
|
|
27
|
+
"backgroundColor": "#E5E8EB",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"alignItems": "center",
|
|
31
|
+
"borderRadius": 50,
|
|
32
|
+
"flexDirection": "row",
|
|
33
|
+
"height": 50,
|
|
34
|
+
"justifyContent": "center",
|
|
35
|
+
"padding": 12,
|
|
36
|
+
"width": 50,
|
|
37
|
+
},
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
>
|
|
41
|
+
<RNSVGSvgView
|
|
42
|
+
align="xMidYMid"
|
|
43
|
+
bbHeight="28"
|
|
44
|
+
bbWidth="28"
|
|
45
|
+
fill="none"
|
|
46
|
+
focusable={false}
|
|
47
|
+
height="28"
|
|
48
|
+
meetOrSlice={0}
|
|
49
|
+
minX={0}
|
|
50
|
+
minY={0}
|
|
51
|
+
style={
|
|
52
|
+
[
|
|
53
|
+
{
|
|
54
|
+
"backgroundColor": "transparent",
|
|
55
|
+
"borderWidth": 0,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"flex": 0,
|
|
59
|
+
"height": 28,
|
|
60
|
+
"width": 28,
|
|
61
|
+
},
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
vbHeight={28}
|
|
65
|
+
vbWidth={28}
|
|
66
|
+
width="28"
|
|
67
|
+
>
|
|
68
|
+
<RNSVGGroup
|
|
69
|
+
fill={null}
|
|
70
|
+
propList={
|
|
71
|
+
[
|
|
72
|
+
"fill",
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
>
|
|
76
|
+
<RNSVGPath
|
|
77
|
+
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"
|
|
78
|
+
propList={
|
|
79
|
+
[
|
|
80
|
+
"stroke",
|
|
81
|
+
"strokeWidth",
|
|
82
|
+
"strokeLinecap",
|
|
83
|
+
"strokeLinejoin",
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
stroke={4283522924}
|
|
87
|
+
strokeLinecap={1}
|
|
88
|
+
strokeLinejoin={1}
|
|
89
|
+
strokeWidth="2"
|
|
90
|
+
/>
|
|
91
|
+
</RNSVGGroup>
|
|
92
|
+
</RNSVGSvgView>
|
|
93
|
+
</View>
|
|
94
|
+
</View>
|
|
95
|
+
`;
|
|
96
|
+
|
|
97
|
+
exports[`pressable-icon test render a default pressable icon 1`] = `
|
|
98
|
+
<View
|
|
99
|
+
accessible={true}
|
|
100
|
+
collapsable={false}
|
|
101
|
+
focusable={true}
|
|
102
|
+
onBlur={[Function]}
|
|
103
|
+
onClick={[Function]}
|
|
104
|
+
onFocus={[Function]}
|
|
105
|
+
onResponderGrant={[Function]}
|
|
106
|
+
onResponderMove={[Function]}
|
|
107
|
+
onResponderRelease={[Function]}
|
|
108
|
+
onResponderTerminate={[Function]}
|
|
109
|
+
onResponderTerminationRequest={[Function]}
|
|
110
|
+
onStartShouldSetResponder={[Function]}
|
|
111
|
+
>
|
|
112
|
+
<View
|
|
113
|
+
style={
|
|
114
|
+
[
|
|
115
|
+
{
|
|
116
|
+
"backgroundColor": "#E0E8F9",
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"alignItems": "center",
|
|
120
|
+
"borderRadius": 50,
|
|
121
|
+
"flexDirection": "row",
|
|
122
|
+
"height": 50,
|
|
123
|
+
"justifyContent": "center",
|
|
124
|
+
"padding": 12,
|
|
125
|
+
"width": 50,
|
|
126
|
+
},
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
>
|
|
130
|
+
<RNSVGSvgView
|
|
131
|
+
align="xMidYMid"
|
|
132
|
+
bbHeight="28"
|
|
133
|
+
bbWidth="28"
|
|
134
|
+
fill="none"
|
|
135
|
+
focusable={false}
|
|
136
|
+
height="28"
|
|
137
|
+
meetOrSlice={0}
|
|
138
|
+
minX={0}
|
|
139
|
+
minY={0}
|
|
140
|
+
style={
|
|
141
|
+
[
|
|
142
|
+
{
|
|
143
|
+
"backgroundColor": "transparent",
|
|
144
|
+
"borderWidth": 0,
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"flex": 0,
|
|
148
|
+
"height": 28,
|
|
149
|
+
"width": 28,
|
|
150
|
+
},
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
vbHeight={27}
|
|
154
|
+
vbWidth={27}
|
|
155
|
+
width="28"
|
|
156
|
+
>
|
|
157
|
+
<RNSVGGroup
|
|
158
|
+
fill={null}
|
|
159
|
+
propList={
|
|
160
|
+
[
|
|
161
|
+
"fill",
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
>
|
|
165
|
+
<RNSVGPath
|
|
166
|
+
d="M11.25 11.25H5.8906C4.21799 11.25 3.13012 13.0102 3.87814 14.5062L7.81564 22.3812C8.19677 23.1435 8.97586 23.625 9.8281 23.625H14.348C14.532 23.625 14.7153 23.6024 14.8937 23.5578L19.125 22.5M11.25 11.25V5.625C11.25 4.38236 12.2574 3.375 13.5 3.375H13.6074C14.1694 3.375 14.625 3.83059 14.625 4.39259C14.625 5.19618 14.8629 5.9818 15.3086 6.65043L19.125 12.375V22.5M11.25 11.25H13.5M19.125 22.5H21.375C22.6177 22.5 23.625 21.4926 23.625 20.25V13.5C23.625 12.2574 22.6177 11.25 21.375 11.25H18.5625"
|
|
167
|
+
propList={
|
|
168
|
+
[
|
|
169
|
+
"stroke",
|
|
170
|
+
"strokeWidth",
|
|
171
|
+
"strokeLinecap",
|
|
172
|
+
"strokeLinejoin",
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
stroke={4279837036}
|
|
176
|
+
strokeLinecap={1}
|
|
177
|
+
strokeLinejoin={1}
|
|
178
|
+
strokeWidth="2"
|
|
179
|
+
/>
|
|
180
|
+
</RNSVGGroup>
|
|
181
|
+
</RNSVGSvgView>
|
|
182
|
+
</View>
|
|
183
|
+
</View>
|
|
184
|
+
`;
|
|
185
|
+
|
|
186
|
+
exports[`pressable-icon test render an inverted pressable icon 1`] = `
|
|
187
|
+
<View
|
|
188
|
+
accessible={true}
|
|
189
|
+
collapsable={false}
|
|
190
|
+
focusable={true}
|
|
191
|
+
onBlur={[Function]}
|
|
192
|
+
onClick={[Function]}
|
|
193
|
+
onFocus={[Function]}
|
|
194
|
+
onResponderGrant={[Function]}
|
|
195
|
+
onResponderMove={[Function]}
|
|
196
|
+
onResponderRelease={[Function]}
|
|
197
|
+
onResponderTerminate={[Function]}
|
|
198
|
+
onResponderTerminationRequest={[Function]}
|
|
199
|
+
onStartShouldSetResponder={[Function]}
|
|
200
|
+
>
|
|
201
|
+
<View
|
|
202
|
+
style={
|
|
203
|
+
[
|
|
204
|
+
{
|
|
205
|
+
"backgroundColor": "#19216C",
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"alignItems": "center",
|
|
209
|
+
"borderRadius": 50,
|
|
210
|
+
"flexDirection": "row",
|
|
211
|
+
"height": 50,
|
|
212
|
+
"justifyContent": "center",
|
|
213
|
+
"padding": 12,
|
|
214
|
+
"width": 50,
|
|
215
|
+
},
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
>
|
|
219
|
+
<RNSVGSvgView
|
|
220
|
+
align="xMidYMid"
|
|
221
|
+
bbHeight="28"
|
|
222
|
+
bbWidth="28"
|
|
223
|
+
fill="none"
|
|
224
|
+
focusable={false}
|
|
225
|
+
height="28"
|
|
226
|
+
meetOrSlice={0}
|
|
227
|
+
minX={0}
|
|
228
|
+
minY={0}
|
|
229
|
+
style={
|
|
230
|
+
[
|
|
231
|
+
{
|
|
232
|
+
"backgroundColor": "transparent",
|
|
233
|
+
"borderWidth": 0,
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"flex": 0,
|
|
237
|
+
"height": 28,
|
|
238
|
+
"width": 28,
|
|
239
|
+
},
|
|
240
|
+
]
|
|
241
|
+
}
|
|
242
|
+
vbHeight={26}
|
|
243
|
+
vbWidth={26}
|
|
244
|
+
width="28"
|
|
245
|
+
>
|
|
246
|
+
<RNSVGGroup
|
|
247
|
+
fill={null}
|
|
248
|
+
propList={
|
|
249
|
+
[
|
|
250
|
+
"fill",
|
|
251
|
+
]
|
|
252
|
+
}
|
|
253
|
+
>
|
|
254
|
+
<RNSVGPath
|
|
255
|
+
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"
|
|
256
|
+
propList={
|
|
257
|
+
[
|
|
258
|
+
"stroke",
|
|
259
|
+
"strokeWidth",
|
|
260
|
+
"strokeLinecap",
|
|
261
|
+
"strokeLinejoin",
|
|
262
|
+
]
|
|
263
|
+
}
|
|
264
|
+
stroke={4292929785}
|
|
265
|
+
strokeLinecap={1}
|
|
266
|
+
strokeLinejoin={1}
|
|
267
|
+
strokeWidth="2"
|
|
268
|
+
/>
|
|
269
|
+
</RNSVGGroup>
|
|
270
|
+
</RNSVGSvgView>
|
|
271
|
+
</View>
|
|
272
|
+
</View>
|
|
273
|
+
`;
|
|
274
|
+
|
|
275
|
+
exports[`pressable-icon test render an inverted pressable icon that is disabled 1`] = `
|
|
276
|
+
<View
|
|
277
|
+
accessibilityState={
|
|
278
|
+
{
|
|
279
|
+
"disabled": true,
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
accessible={true}
|
|
283
|
+
collapsable={false}
|
|
284
|
+
focusable={true}
|
|
285
|
+
onBlur={[Function]}
|
|
286
|
+
onClick={[Function]}
|
|
287
|
+
onFocus={[Function]}
|
|
288
|
+
onResponderGrant={[Function]}
|
|
289
|
+
onResponderMove={[Function]}
|
|
290
|
+
onResponderRelease={[Function]}
|
|
291
|
+
onResponderTerminate={[Function]}
|
|
292
|
+
onResponderTerminationRequest={[Function]}
|
|
293
|
+
onStartShouldSetResponder={[Function]}
|
|
294
|
+
>
|
|
295
|
+
<View
|
|
296
|
+
style={
|
|
297
|
+
[
|
|
298
|
+
{
|
|
299
|
+
"backgroundColor": "#E5E8EB",
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"alignItems": "center",
|
|
303
|
+
"borderRadius": 50,
|
|
304
|
+
"flexDirection": "row",
|
|
305
|
+
"height": 50,
|
|
306
|
+
"justifyContent": "center",
|
|
307
|
+
"padding": 12,
|
|
308
|
+
"width": 50,
|
|
309
|
+
},
|
|
310
|
+
]
|
|
311
|
+
}
|
|
312
|
+
>
|
|
313
|
+
<RNSVGSvgView
|
|
314
|
+
align="xMidYMid"
|
|
315
|
+
bbHeight="28"
|
|
316
|
+
bbWidth="28"
|
|
317
|
+
fill="none"
|
|
318
|
+
focusable={false}
|
|
319
|
+
height="28"
|
|
320
|
+
meetOrSlice={0}
|
|
321
|
+
minX={0}
|
|
322
|
+
minY={0}
|
|
323
|
+
style={
|
|
324
|
+
[
|
|
325
|
+
{
|
|
326
|
+
"backgroundColor": "transparent",
|
|
327
|
+
"borderWidth": 0,
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"flex": 0,
|
|
331
|
+
"height": 28,
|
|
332
|
+
"width": 28,
|
|
333
|
+
},
|
|
334
|
+
]
|
|
335
|
+
}
|
|
336
|
+
vbHeight={22}
|
|
337
|
+
vbWidth={24}
|
|
338
|
+
width="28"
|
|
339
|
+
>
|
|
340
|
+
<RNSVGGroup
|
|
341
|
+
fill={null}
|
|
342
|
+
propList={
|
|
343
|
+
[
|
|
344
|
+
"fill",
|
|
345
|
+
]
|
|
346
|
+
}
|
|
347
|
+
>
|
|
348
|
+
<RNSVGPath
|
|
349
|
+
clipRule={0}
|
|
350
|
+
d="M10.8502 2.2002C10.4146 2.2002 10.0164 2.4356 9.8216 2.80826L8.98946 4.4002H5.1002C4.46507 4.4002 3.9502 4.89268 3.9502 5.5002C3.9502 6.10771 4.46507 6.6002 5.1002 6.6002L5.1002 17.6002C5.1002 18.8152 6.12994 19.8002 7.4002 19.8002H16.6002C17.8705 19.8002 18.9002 18.8152 18.9002 17.6002V6.6002C19.5353 6.6002 20.0502 6.10771 20.0502 5.5002C20.0502 4.89268 19.5353 4.4002 18.9002 4.4002H15.0109L14.1788 2.80826C13.984 2.4356 13.5858 2.2002 13.1502 2.2002H10.8502ZM8.5502 8.8002C8.5502 8.19268 9.06507 7.7002 9.7002 7.7002C10.3353 7.7002 10.8502 8.19268 10.8502 8.8002V15.4002C10.8502 16.0077 10.3353 16.5002 9.7002 16.5002C9.06507 16.5002 8.5502 16.0077 8.5502 15.4002V8.8002ZM14.3002 7.7002C13.6651 7.7002 13.1502 8.19268 13.1502 8.8002V15.4002C13.1502 16.0077 13.6651 16.5002 14.3002 16.5002C14.9353 16.5002 15.4502 16.0077 15.4502 15.4002V8.8002C15.4502 8.19268 14.9353 7.7002 14.3002 7.7002Z"
|
|
351
|
+
fill={4283522924}
|
|
352
|
+
fillRule={0}
|
|
353
|
+
propList={
|
|
354
|
+
[
|
|
355
|
+
"fill",
|
|
356
|
+
"fillRule",
|
|
357
|
+
]
|
|
358
|
+
}
|
|
359
|
+
/>
|
|
360
|
+
</RNSVGGroup>
|
|
361
|
+
</RNSVGSvgView>
|
|
362
|
+
</View>
|
|
363
|
+
</View>
|
|
364
|
+
`;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React, {useContext} from 'react';
|
|
2
|
+
import {Pressable, View} from 'react-native';
|
|
3
|
+
import {ThemeCtx} from '../../../context/theme.context';
|
|
4
|
+
import {Stylesheet} from './pressable-icon.styles';
|
|
5
|
+
|
|
6
|
+
type PressableIconProps = {
|
|
7
|
+
icon: React.ReactElement;
|
|
8
|
+
inverted?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
onPress?: () => void;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const PressableIcon = ({
|
|
14
|
+
icon,
|
|
15
|
+
inverted,
|
|
16
|
+
disabled,
|
|
17
|
+
onPress,
|
|
18
|
+
}: PressableIconProps) => {
|
|
19
|
+
const context = useContext(ThemeCtx);
|
|
20
|
+
const styles = Stylesheet(context, disabled);
|
|
21
|
+
|
|
22
|
+
const disabledIcon = React.Children.map(icon, (child) =>
|
|
23
|
+
React.cloneElement(child, {
|
|
24
|
+
...icon.props,
|
|
25
|
+
color: context.colors.ui.darkgrey,
|
|
26
|
+
})
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const invertedIcon = React.Children.map(icon, (child) =>
|
|
30
|
+
React.cloneElement(child, {
|
|
31
|
+
...icon.props,
|
|
32
|
+
color: context.colors.main['9'],
|
|
33
|
+
})
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Pressable onPress={onPress} disabled={disabled}>
|
|
38
|
+
<View
|
|
39
|
+
style={[
|
|
40
|
+
inverted ? styles.backgroundInverted : styles.backgroundDefault,
|
|
41
|
+
styles.container,
|
|
42
|
+
]}
|
|
43
|
+
>
|
|
44
|
+
{[disabled ? disabledIcon : icon && inverted ? invertedIcon : icon]}
|
|
45
|
+
</View>
|
|
46
|
+
</Pressable>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {PressableIcon} from './pressable-icon.component';
|
|
3
|
+
import {Icon} from '../../../icons';
|
|
4
|
+
const {View} = require('react-native');
|
|
5
|
+
|
|
6
|
+
export const PressableIconPreview = ({}: {}) => {
|
|
7
|
+
return (
|
|
8
|
+
<View
|
|
9
|
+
style={{
|
|
10
|
+
flex: 1,
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
justifyContent: 'center',
|
|
13
|
+
}}
|
|
14
|
+
>
|
|
15
|
+
<PressableIcon
|
|
16
|
+
icon={<Icon.Outline.Mail key={'random'} />}
|
|
17
|
+
onPress={() => console.log('Pressed')}
|
|
18
|
+
/>
|
|
19
|
+
<PressableIcon
|
|
20
|
+
icon={<Icon.Solid.Phone key={'test'} />}
|
|
21
|
+
inverted={true}
|
|
22
|
+
disabled={true}
|
|
23
|
+
onPress={() => console.log('Pressed')}
|
|
24
|
+
/>
|
|
25
|
+
<PressableIcon
|
|
26
|
+
icon={<Icon.Solid.ChatAlt key={'testen'} />}
|
|
27
|
+
inverted={true}
|
|
28
|
+
onPress={() => console.log('Pressed')}
|
|
29
|
+
/>
|
|
30
|
+
<PressableIcon
|
|
31
|
+
icon={<Icon.Outline.Plus key={'hello'} />}
|
|
32
|
+
disabled={true}
|
|
33
|
+
onPress={() => console.log('Pressed')}
|
|
34
|
+
/>
|
|
35
|
+
</View>
|
|
36
|
+
);
|
|
37
|
+
};
|