@tactics/toddle-styleguide 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/App.tsx +42 -9
- package/index.d.ts +16 -7
- package/index.tsx +59 -40
- package/jest.config.js +2 -0
- package/package.json +4 -4
- package/src/components/atoms/avatar/avatar.component.d.ts +7 -7
- package/src/components/atoms/blocked-message/__snapshots__/blocked-message.test.js.snap +87 -0
- package/src/components/atoms/blocked-message/blocked-message.component.d.ts +7 -0
- package/src/components/atoms/blocked-message/blocked-message.component.tsx +23 -0
- package/src/components/atoms/blocked-message/blocked-message.preview.d.ts +1 -0
- package/src/components/atoms/blocked-message/blocked-message.preview.tsx +23 -0
- package/src/components/atoms/blocked-message/blocked-message.styles.d.ts +22 -0
- package/src/components/atoms/blocked-message/blocked-message.styles.js +25 -0
- package/src/components/atoms/blocked-message/blocked-message.test.js +12 -0
- package/src/components/atoms/button/button.component.d.ts +11 -6
- package/src/components/atoms/calendar/__snapshots__/calendar.test.js.snap +1691 -613
- package/src/components/atoms/calendar/calendar.component.d.ts +11 -6
- package/src/components/atoms/calendar/calendar.test.js +4 -2
- package/src/components/atoms/calendar-select/__snapshots__/calendar-select.test.js.snap +247 -0
- package/src/components/atoms/calendar-select/calendar-select.component.d.ts +10 -0
- package/src/components/atoms/calendar-select/calendar-select.component.tsx +56 -0
- package/src/components/atoms/calendar-select/calendar-select.preview.d.ts +1 -0
- package/src/components/atoms/calendar-select/calendar-select.preview.tsx +17 -0
- package/src/components/atoms/calendar-select/calendar-select.styles.d.ts +24 -0
- package/src/components/atoms/calendar-select/calendar-select.styles.js +30 -0
- package/src/components/atoms/calendar-select/calendar-select.test.js +20 -0
- package/src/components/atoms/cancel-link/cancel-link.component.d.ts +4 -4
- package/src/components/atoms/check-switch/check-switch.component.d.ts +3 -3
- package/src/components/atoms/checkbox/checkbox.component.d.ts +9 -5
- package/src/components/atoms/child-list-item/child-list-item.component.d.ts +28 -16
- package/src/components/atoms/contact-item/contact-item.component.d.ts +13 -7
- package/src/components/atoms/contact-role/__snapshots__/contact-role.test.js.snap +75 -0
- package/src/components/atoms/contact-role/contact-role.component.d.ts +9 -0
- package/src/components/atoms/contact-role/contact-role.component.tsx +22 -0
- package/src/components/atoms/contact-role/contact-role.preview.d.ts +1 -0
- package/src/components/atoms/contact-role/contact-role.preview.tsx +17 -0
- package/src/components/atoms/contact-role/contact-role.styles.d.ts +19 -0
- package/src/components/atoms/contact-role/contact-role.styles.js +20 -0
- package/src/components/atoms/contact-role/contact-role.test.js +18 -0
- package/src/components/atoms/date-input/__snapshots__/date-input.test.js.snap +1 -1
- package/src/components/atoms/date-input/date-input.component.d.ts +7 -4
- package/src/components/atoms/date-input/date-input.test.js +3 -1
- package/src/components/atoms/day-select/components/day/day.component.d.ts +6 -6
- package/src/components/atoms/day-select/components/day/day.component.tsx +1 -1
- package/src/components/atoms/day-select/components/day/day.styles.d.ts +43 -36
- package/src/components/atoms/day-select/components/day/day.styles.js +3 -0
- package/src/components/atoms/day-select/day-select.component.d.ts +10 -6
- package/src/components/atoms/day-select/day-select.component.tsx +17 -14
- package/src/components/atoms/day-select/day-select.styles.d.ts +8 -8
- package/src/components/atoms/department_logo/__snapshots__/department-logo.test.js.snap +16 -0
- package/src/components/atoms/department_logo/department-logo.component.d.ts +7 -0
- package/src/components/atoms/department_logo/department-logo.component.tsx +17 -0
- package/src/components/atoms/department_logo/department-logo.preview.d.ts +1 -0
- package/src/components/atoms/department_logo/department-logo.preview.tsx +11 -0
- package/src/components/atoms/department_logo/department-logo.styles.d.ts +8 -0
- package/src/components/atoms/department_logo/department-logo.styles.js +11 -0
- package/src/components/atoms/department_logo/department-logo.test.js +12 -0
- package/src/components/atoms/filter-range/filter-range.component.d.ts +14 -7
- package/src/components/atoms/filter-tab/__snapshots__/filter-tab.test.js.snap +8 -2
- package/src/components/atoms/filter-tab/filter-tab.component.d.ts +9 -5
- package/src/components/atoms/filter-tab/filter-tab.component.tsx +3 -1
- package/src/components/atoms/filter-tab/filter-tab.preview.tsx +48 -5
- package/src/components/atoms/filter-tab/filter-tab.styles.js +6 -3
- package/src/components/atoms/filter-tab/filter-tab.test.js +6 -2
- package/src/components/atoms/form-actions/form-action.component.d.ts +4 -4
- package/src/components/atoms/image-bubble/image-bubble.component.d.ts +9 -6
- package/src/components/atoms/increment-input/__snapshots__/increment-input.test.js.snap +0 -1
- package/src/components/atoms/increment-input/increment-input.component.d.ts +6 -3
- package/src/components/atoms/increment-input/increment-input.styles.js +0 -1
- package/src/components/atoms/info/info.component.d.ts +4 -4
- package/src/components/atoms/logo/logo.component.d.ts +4 -4
- package/src/components/atoms/pill/pill.component.d.ts +5 -5
- package/src/components/atoms/popover/components/backdrop/backdrop.component.d.ts +3 -3
- package/src/components/atoms/popover/components/foreground/foreground.component.d.ts +4 -4
- package/src/components/atoms/popover/components/modal/close/close.component.d.ts +4 -4
- package/src/components/atoms/popover/components/modal/heading/heading.component.d.ts +4 -4
- package/src/components/atoms/popover/components/modal/modal.component.d.ts +15 -8
- package/src/components/atoms/popover/components/modal/scroll-content/scroll-content.component.d.ts +5 -3
- package/src/components/atoms/popover/popover.component.d.ts +13 -7
- package/src/components/atoms/pressable-icon/pressable-icon.component.d.ts +10 -5
- package/src/components/atoms/quick-filter/quick-filter.component.d.ts +14 -8
- package/src/components/atoms/search/__snapshots__/search.test.js.snap +87 -0
- package/src/components/atoms/search/search.component.d.ts +12 -0
- package/src/components/atoms/search/search.component.tsx +32 -0
- package/src/components/atoms/search/search.preview.d.ts +1 -0
- package/src/components/atoms/search/search.preview.tsx +18 -0
- package/src/components/atoms/search/search.styles.d.ts +21 -0
- package/src/components/atoms/search/search.styles.js +26 -0
- package/src/components/atoms/search/search.test.js +20 -0
- package/src/components/atoms/select-list-item/__snapshots__/select-list-item.test.js.snap +2 -0
- package/src/components/atoms/select-list-item/select-list-item.component.d.ts +13 -7
- package/src/components/atoms/select-list-item/select-list-item.styles.js +1 -0
- package/src/components/atoms/select-picker/select-picker.component.d.ts +13 -8
- package/src/components/atoms/snackbar/snackbar.component.d.ts +5 -5
- package/src/components/atoms/swipe/swipe.component.d.ts +3 -3
- package/src/components/atoms/tag/tag.component.d.ts +13 -8
- package/src/components/atoms/text-bubble/text-bubble.component.d.ts +6 -6
- package/src/components/atoms/text-input/text-input.component.d.ts +10 -6
- package/src/components/atoms/text-input/text-input.preview.d.ts +1 -1
- package/src/components/atoms/time-tracker/time-tracker.component.d.ts +8 -5
- package/src/components/atoms/timeline/timeline.component.d.ts +6 -3
- package/src/components/atoms/wide-button/__snapshots__/wide-button.test.js.snap +93 -2
- package/src/components/atoms/wide-button/wide-button.component.d.ts +11 -5
- package/src/components/atoms/wide-button/wide-button.component.tsx +8 -2
- package/src/components/atoms/wide-button/wide-button.preview.tsx +10 -0
- package/src/components/atoms/wide-button/wide-button.styles.d.ts +3 -7
- package/src/components/atoms/wide-button/wide-button.styles.js +4 -2
- package/src/components/atoms/wide-button/wide-button.test.js +14 -0
- package/src/context/theme.context.d.ts +42 -42
- package/src/icons/index.d.ts +103 -51
- package/src/icons/outline/calendar/calendar.icon.d.ts +2 -2
- package/src/icons/outline/chat/chat.icon.d.ts +2 -2
- package/src/icons/outline/chat-alt/chat-alt.icon.d.ts +2 -2
- package/src/icons/outline/check-circle/check-circle.icon.d.ts +2 -2
- package/src/icons/outline/chevron-left/chevron-left.icon.d.ts +2 -2
- package/src/icons/outline/chevron-right/chevron-right.icon.d.ts +2 -2
- package/src/icons/outline/clock/clock.icon.d.ts +2 -2
- package/src/icons/outline/cloud-download/cloud-download.icon.d.ts +2 -2
- package/src/icons/outline/cross/cross.icon.d.ts +2 -2
- package/src/icons/outline/currency-euro/currency-euro.icon.d.ts +2 -2
- package/src/icons/outline/document-text/document-text.icon.d.ts +2 -2
- package/src/icons/outline/exclamation/exclamation.icon.d.ts +2 -2
- package/src/icons/outline/exclamation-circle/exclamation-circle.icon.d.ts +2 -2
- package/src/icons/outline/eye/eye.icon.d.ts +2 -2
- package/src/icons/outline/filter/filter.icon.d.ts +2 -2
- package/src/icons/outline/information-circle/information-circle.icon.d.ts +2 -2
- package/src/icons/outline/logout/logout.icon.d.ts +2 -2
- package/src/icons/outline/mail/mail.icon.d.ts +2 -2
- package/src/icons/outline/mail-open/mail-open.icon.d.ts +2 -2
- package/src/icons/outline/menu/menu.icon.d.ts +2 -2
- package/src/icons/outline/minus-sm/minus-sm.icon.d.ts +2 -2
- package/src/icons/outline/office-building/office-building.icon.d.ts +2 -2
- package/src/icons/outline/outline.d.ts +95 -39
- package/src/icons/outline/paper-airplane/paper-airplane.icon.d.ts +2 -2
- package/src/icons/outline/paperclip/paperclip.icon.d.ts +2 -2
- package/src/icons/outline/pencil/pencil.icon.d.ts +2 -2
- package/src/icons/outline/phone/phone.icon.d.ts +2 -2
- package/src/icons/outline/plus/plus.icon.d.ts +2 -2
- package/src/icons/outline/plus-sm/plus-sm.icon.d.ts +2 -2
- package/src/icons/outline/qrcode/qrcode.icon.d.ts +2 -2
- package/src/icons/outline/refresh/refresh.icon.d.ts +2 -2
- package/src/icons/outline/search/search.icon.d.ts +2 -2
- package/src/icons/outline/selector/selector.icon.d.ts +2 -2
- package/src/icons/outline/sm-view-grid-add/sm-view-grid-add.icon.d.ts +2 -2
- package/src/icons/outline/status-online/status-online.icon.d.ts +2 -2
- package/src/icons/outline/thumb-up/thumb-up.icon.d.ts +2 -2
- package/src/icons/outline/trash/trash.icon.d.ts +2 -2
- package/src/icons/outline/user/user.icon.d.ts +2 -2
- package/src/icons/outline/user-group/user-group.icon.d.ts +2 -2
- package/src/icons/outline/users/users.icon.d.ts +2 -2
- package/src/icons/solid/chat-alt/chat-alt-solid.icon.d.ts +2 -2
- package/src/icons/solid/clock/clock-solid.icon.d.ts +2 -2
- package/src/icons/solid/information-circle/information-circle-solid.icon.d.ts +2 -2
- package/src/icons/solid/pencil/pencil-solid.icon.d.ts +2 -2
- package/src/icons/solid/phone/phone-solid.icon.d.ts +2 -2
- package/src/icons/solid/refresh/refresh-solid.icon.d.ts +2 -2
- package/src/icons/solid/solid.d.ts +18 -8
- package/src/icons/solid/status-online/status-online-solid.icon.d.ts +2 -2
- package/src/icons/solid/trash/trash-solid.icon.d.ts +2 -2
- package/src/models/initials.model.d.ts +5 -5
- package/src/theme/font/font.d.ts +70 -70
- package/src/theme/font/index.d.ts +3 -3
- package/src/theme/provider/index.d.ts +3 -3
- package/src/theme/provider/parent.theme.d.ts +40 -40
- package/src/theme/provider/staff-member.theme.d.ts +40 -40
- package/src/theme/scale/index.d.ts +10 -10
- package/src/types/bubble-alignment.enum.d.ts +2 -2
- package/src/types/icontype.type.d.ts +1 -1
- package/src/types/keyboard-types.enum.d.ts +7 -7
- package/src/types/size.enum.d.ts +3 -3
- package/src/types/visual-state.enum.d.ts +4 -4
- package/src/util/date.d.ts +1 -1
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {DateTime} from 'luxon';
|
|
2
2
|
declare type CalendarProps = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
onDayPress: (day: DateTime) => void;
|
|
4
|
+
selected: DateTime;
|
|
5
|
+
minDate?: string;
|
|
6
|
+
maxDate?: string;
|
|
7
7
|
};
|
|
8
|
-
export declare const Calendar: ({
|
|
8
|
+
export declare const Calendar: ({
|
|
9
|
+
onDayPress,
|
|
10
|
+
selected,
|
|
11
|
+
minDate,
|
|
12
|
+
maxDate,
|
|
13
|
+
}: CalendarProps) => JSX.Element;
|
|
9
14
|
export {};
|
|
@@ -3,12 +3,14 @@ import render from 'react-test-renderer';
|
|
|
3
3
|
import {Calendar} from './calendar.component';
|
|
4
4
|
import {DateTime} from 'luxon';
|
|
5
5
|
|
|
6
|
+
const testDate = DateTime.fromISO('2022-12-01');
|
|
7
|
+
|
|
6
8
|
describe('Test for the calendar component', () => {
|
|
7
9
|
it('renders a calendar where you can select a day', function () {
|
|
8
10
|
const tree = render
|
|
9
11
|
.create(
|
|
10
12
|
<Calendar
|
|
11
|
-
selected={
|
|
13
|
+
selected={testDate}
|
|
12
14
|
onDayPress={() => console.log('pressed day')}
|
|
13
15
|
/>
|
|
14
16
|
)
|
|
@@ -19,7 +21,7 @@ describe('Test for the calendar component', () => {
|
|
|
19
21
|
const tree = render
|
|
20
22
|
.create(
|
|
21
23
|
<Calendar
|
|
22
|
-
selected={
|
|
24
|
+
selected={testDate}
|
|
23
25
|
onDayPress={() => console.log('pressed day')}
|
|
24
26
|
minDate={'2022-01-01'}
|
|
25
27
|
maxDate={'2022-12-31'}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`test Calendar Select renders Calendar Select 1`] = `
|
|
4
|
+
<View
|
|
5
|
+
style={
|
|
6
|
+
{
|
|
7
|
+
"alignItems": "center",
|
|
8
|
+
"color": "#FFFFFF",
|
|
9
|
+
"flexDirection": "row",
|
|
10
|
+
"justifyContent": "space-between",
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
>
|
|
14
|
+
<View
|
|
15
|
+
accessible={true}
|
|
16
|
+
collapsable={false}
|
|
17
|
+
focusable={true}
|
|
18
|
+
onBlur={[Function]}
|
|
19
|
+
onClick={[Function]}
|
|
20
|
+
onFocus={[Function]}
|
|
21
|
+
onResponderGrant={[Function]}
|
|
22
|
+
onResponderMove={[Function]}
|
|
23
|
+
onResponderRelease={[Function]}
|
|
24
|
+
onResponderTerminate={[Function]}
|
|
25
|
+
onResponderTerminationRequest={[Function]}
|
|
26
|
+
onStartShouldSetResponder={[Function]}
|
|
27
|
+
>
|
|
28
|
+
<RNSVGSvgView
|
|
29
|
+
align="xMidYMid"
|
|
30
|
+
bbHeight="28"
|
|
31
|
+
bbWidth="28"
|
|
32
|
+
fill="none"
|
|
33
|
+
focusable={false}
|
|
34
|
+
height="28"
|
|
35
|
+
meetOrSlice={0}
|
|
36
|
+
minX={0}
|
|
37
|
+
minY={0}
|
|
38
|
+
style={
|
|
39
|
+
[
|
|
40
|
+
{
|
|
41
|
+
"backgroundColor": "transparent",
|
|
42
|
+
"borderWidth": 0,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"flex": 0,
|
|
46
|
+
"height": 28,
|
|
47
|
+
"width": 28,
|
|
48
|
+
},
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
vbHeight={27}
|
|
52
|
+
vbWidth={27}
|
|
53
|
+
width="28"
|
|
54
|
+
>
|
|
55
|
+
<RNSVGGroup
|
|
56
|
+
fill={null}
|
|
57
|
+
propList={
|
|
58
|
+
[
|
|
59
|
+
"fill",
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
>
|
|
63
|
+
<RNSVGPath
|
|
64
|
+
d="M16.875 21.375L9 13.5L16.875 5.625"
|
|
65
|
+
propList={
|
|
66
|
+
[
|
|
67
|
+
"stroke",
|
|
68
|
+
"strokeWidth",
|
|
69
|
+
"strokeLinecap",
|
|
70
|
+
"strokeLinejoin",
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
stroke={4279837036}
|
|
74
|
+
strokeLinecap={1}
|
|
75
|
+
strokeLinejoin={1}
|
|
76
|
+
strokeWidth="2"
|
|
77
|
+
/>
|
|
78
|
+
</RNSVGGroup>
|
|
79
|
+
</RNSVGSvgView>
|
|
80
|
+
</View>
|
|
81
|
+
<View
|
|
82
|
+
accessible={true}
|
|
83
|
+
collapsable={false}
|
|
84
|
+
focusable={true}
|
|
85
|
+
onBlur={[Function]}
|
|
86
|
+
onClick={[Function]}
|
|
87
|
+
onFocus={[Function]}
|
|
88
|
+
onResponderGrant={[Function]}
|
|
89
|
+
onResponderMove={[Function]}
|
|
90
|
+
onResponderRelease={[Function]}
|
|
91
|
+
onResponderTerminate={[Function]}
|
|
92
|
+
onResponderTerminationRequest={[Function]}
|
|
93
|
+
onStartShouldSetResponder={[Function]}
|
|
94
|
+
style={
|
|
95
|
+
{
|
|
96
|
+
"alignItems": "center",
|
|
97
|
+
"backgroundColor": "#19216C",
|
|
98
|
+
"borderRadius": 32,
|
|
99
|
+
"flexDirection": "row",
|
|
100
|
+
"paddingBottom": 8,
|
|
101
|
+
"paddingLeft": 24,
|
|
102
|
+
"paddingRight": 24,
|
|
103
|
+
"paddingTop": 8,
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
>
|
|
107
|
+
<View
|
|
108
|
+
style={
|
|
109
|
+
{
|
|
110
|
+
"marginRight": 16,
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
>
|
|
114
|
+
<RNSVGSvgView
|
|
115
|
+
align="xMidYMid"
|
|
116
|
+
bbHeight="28"
|
|
117
|
+
bbWidth="28"
|
|
118
|
+
fill="none"
|
|
119
|
+
focusable={false}
|
|
120
|
+
height="28"
|
|
121
|
+
meetOrSlice={0}
|
|
122
|
+
minX={0}
|
|
123
|
+
minY={0}
|
|
124
|
+
style={
|
|
125
|
+
[
|
|
126
|
+
{
|
|
127
|
+
"backgroundColor": "transparent",
|
|
128
|
+
"borderWidth": 0,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"flex": 0,
|
|
132
|
+
"height": 28,
|
|
133
|
+
"width": 28,
|
|
134
|
+
},
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
vbHeight={27}
|
|
138
|
+
vbWidth={27}
|
|
139
|
+
width="28"
|
|
140
|
+
>
|
|
141
|
+
<RNSVGGroup
|
|
142
|
+
fill={null}
|
|
143
|
+
propList={
|
|
144
|
+
[
|
|
145
|
+
"fill",
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
>
|
|
149
|
+
<RNSVGPath
|
|
150
|
+
d="M9.16667 7.875V3.375M17.8333 7.875V3.375M8.08333 12.375H18.9167M5.91667 23.625H21.0833C22.28 23.625 23.25 22.6176 23.25 21.375V7.875C23.25 6.63236 22.28 5.625 21.0833 5.625H5.91667C4.72005 5.625 3.75 6.63236 3.75 7.875V21.375C3.75 22.6176 4.72005 23.625 5.91667 23.625Z"
|
|
151
|
+
propList={
|
|
152
|
+
[
|
|
153
|
+
"stroke",
|
|
154
|
+
"strokeWidth",
|
|
155
|
+
"strokeLinecap",
|
|
156
|
+
"strokeLinejoin",
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
stroke={4292929785}
|
|
160
|
+
strokeLinecap={1}
|
|
161
|
+
strokeLinejoin={1}
|
|
162
|
+
strokeWidth="2"
|
|
163
|
+
/>
|
|
164
|
+
</RNSVGGroup>
|
|
165
|
+
</RNSVGSvgView>
|
|
166
|
+
</View>
|
|
167
|
+
<View>
|
|
168
|
+
<Text
|
|
169
|
+
style={
|
|
170
|
+
{
|
|
171
|
+
"color": "#E0E8F9",
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
>
|
|
175
|
+
1 Dec 2022
|
|
176
|
+
</Text>
|
|
177
|
+
</View>
|
|
178
|
+
</View>
|
|
179
|
+
<View
|
|
180
|
+
accessible={true}
|
|
181
|
+
collapsable={false}
|
|
182
|
+
focusable={true}
|
|
183
|
+
onBlur={[Function]}
|
|
184
|
+
onClick={[Function]}
|
|
185
|
+
onFocus={[Function]}
|
|
186
|
+
onResponderGrant={[Function]}
|
|
187
|
+
onResponderMove={[Function]}
|
|
188
|
+
onResponderRelease={[Function]}
|
|
189
|
+
onResponderTerminate={[Function]}
|
|
190
|
+
onResponderTerminationRequest={[Function]}
|
|
191
|
+
onStartShouldSetResponder={[Function]}
|
|
192
|
+
>
|
|
193
|
+
<RNSVGSvgView
|
|
194
|
+
align="xMidYMid"
|
|
195
|
+
bbHeight="28"
|
|
196
|
+
bbWidth="28"
|
|
197
|
+
fill="none"
|
|
198
|
+
focusable={false}
|
|
199
|
+
height="28"
|
|
200
|
+
meetOrSlice={0}
|
|
201
|
+
minX={0}
|
|
202
|
+
minY={0}
|
|
203
|
+
style={
|
|
204
|
+
[
|
|
205
|
+
{
|
|
206
|
+
"backgroundColor": "transparent",
|
|
207
|
+
"borderWidth": 0,
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"flex": 0,
|
|
211
|
+
"height": 28,
|
|
212
|
+
"width": 28,
|
|
213
|
+
},
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
vbHeight={27}
|
|
217
|
+
vbWidth={26}
|
|
218
|
+
width="28"
|
|
219
|
+
>
|
|
220
|
+
<RNSVGGroup
|
|
221
|
+
fill={null}
|
|
222
|
+
propList={
|
|
223
|
+
[
|
|
224
|
+
"fill",
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
>
|
|
228
|
+
<RNSVGPath
|
|
229
|
+
d="M9.75 5.625L17.3333 13.5L9.75 21.375"
|
|
230
|
+
propList={
|
|
231
|
+
[
|
|
232
|
+
"stroke",
|
|
233
|
+
"strokeWidth",
|
|
234
|
+
"strokeLinecap",
|
|
235
|
+
"strokeLinejoin",
|
|
236
|
+
]
|
|
237
|
+
}
|
|
238
|
+
stroke={4279837036}
|
|
239
|
+
strokeLinecap={1}
|
|
240
|
+
strokeLinejoin={1}
|
|
241
|
+
strokeWidth="2"
|
|
242
|
+
/>
|
|
243
|
+
</RNSVGGroup>
|
|
244
|
+
</RNSVGSvgView>
|
|
245
|
+
</View>
|
|
246
|
+
</View>
|
|
247
|
+
`;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {DateTime} from 'luxon';
|
|
2
|
+
declare type CalendarSelectProps = {
|
|
3
|
+
onPressDate: (date: DateTime) => void;
|
|
4
|
+
startDate: DateTime;
|
|
5
|
+
};
|
|
6
|
+
declare const CalendarSelect: ({
|
|
7
|
+
onPressDate,
|
|
8
|
+
startDate,
|
|
9
|
+
}: CalendarSelectProps) => JSX.Element;
|
|
10
|
+
export {CalendarSelect as CalendarSelect};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {useContext, useState} from 'react';
|
|
3
|
+
import {DateTime} from 'luxon';
|
|
4
|
+
import {ThemeCtx} from '../../../context/theme.context';
|
|
5
|
+
import {Stylesheet} from './calendar-select.styles';
|
|
6
|
+
import {Pressable, Text, View} from 'react-native';
|
|
7
|
+
import {ChevronLeftIcon} from '../../../icons/outline/chevron-left/chevron-left.icon';
|
|
8
|
+
import {ChevronRightIcon} from '../../../icons/outline/chevron-right/chevron-right.icon';
|
|
9
|
+
import {CalendarIcon} from '../../../icons/outline/calendar/calendar.icon';
|
|
10
|
+
|
|
11
|
+
type CalendarSelectProps = {
|
|
12
|
+
onPressDate: (date: DateTime) => void;
|
|
13
|
+
startDate: DateTime;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const CalendarSelect = ({onPressDate, startDate}: CalendarSelectProps) => {
|
|
17
|
+
const context = useContext(ThemeCtx);
|
|
18
|
+
const styles = Stylesheet(context);
|
|
19
|
+
|
|
20
|
+
const [visibleDate, setVisibleDate] = useState(startDate);
|
|
21
|
+
|
|
22
|
+
const onPressRight = () => {
|
|
23
|
+
setVisibleDate(visibleDate.plus({days: 1}));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const onPressLeft = () => {
|
|
27
|
+
setVisibleDate(visibleDate.minus({days: 1}));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<View style={styles.container}>
|
|
32
|
+
<Pressable onPress={onPressLeft}>
|
|
33
|
+
<ChevronLeftIcon />
|
|
34
|
+
</Pressable>
|
|
35
|
+
|
|
36
|
+
<Pressable
|
|
37
|
+
onPress={() => onPressDate(visibleDate)}
|
|
38
|
+
style={styles.dateContainer}
|
|
39
|
+
>
|
|
40
|
+
<View style={styles.icon}>
|
|
41
|
+
<CalendarIcon color={context.colors.main[9]} />
|
|
42
|
+
</View>
|
|
43
|
+
<View>
|
|
44
|
+
<Text style={styles.text}>
|
|
45
|
+
{visibleDate.toLocaleString(DateTime.DATE_MED)}
|
|
46
|
+
</Text>
|
|
47
|
+
</View>
|
|
48
|
+
</Pressable>
|
|
49
|
+
|
|
50
|
+
<Pressable onPress={onPressRight}>
|
|
51
|
+
<ChevronRightIcon />
|
|
52
|
+
</Pressable>
|
|
53
|
+
</View>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
export {CalendarSelect as CalendarSelect};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CalendarSelectPreview: ({}: {}) => JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, {useState} from 'react';
|
|
2
|
+
import {View} from 'react-native';
|
|
3
|
+
import {CalendarSelect} from './calendar-select.component';
|
|
4
|
+
import {DateTime} from 'luxon';
|
|
5
|
+
|
|
6
|
+
export const CalendarSelectPreview = ({}: {}) => {
|
|
7
|
+
return (
|
|
8
|
+
<View>
|
|
9
|
+
<CalendarSelect
|
|
10
|
+
onPressDate={(date) =>
|
|
11
|
+
console.log('show calendar', ',', 'date is:', date.toLocaleString())
|
|
12
|
+
}
|
|
13
|
+
startDate={DateTime.now()}
|
|
14
|
+
/>
|
|
15
|
+
</View>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export function Stylesheet(context: any): {
|
|
2
|
+
container: {
|
|
3
|
+
color: any;
|
|
4
|
+
flexDirection: 'row';
|
|
5
|
+
alignItems: 'center';
|
|
6
|
+
justifyContent: 'space-between';
|
|
7
|
+
};
|
|
8
|
+
dateContainer: {
|
|
9
|
+
flexDirection: 'row';
|
|
10
|
+
backgroundColor: any;
|
|
11
|
+
borderRadius: number;
|
|
12
|
+
paddingTop: number;
|
|
13
|
+
paddingBottom: number;
|
|
14
|
+
paddingLeft: number;
|
|
15
|
+
paddingRight: number;
|
|
16
|
+
alignItems: 'center';
|
|
17
|
+
};
|
|
18
|
+
text: {
|
|
19
|
+
color: any;
|
|
20
|
+
};
|
|
21
|
+
icon: {
|
|
22
|
+
marginRight: number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {StyleSheet} from 'react-native';
|
|
2
|
+
import {Size} from '../../../types/size.enum';
|
|
3
|
+
import {ThemeCtx} from '../../../context/theme.context';
|
|
4
|
+
import {Scale} from '../../../theme/scale/index';
|
|
5
|
+
|
|
6
|
+
export const Stylesheet = (context) =>
|
|
7
|
+
StyleSheet.create({
|
|
8
|
+
container: {
|
|
9
|
+
color: context.colors.ui.white,
|
|
10
|
+
flexDirection: 'row',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
justifyContent: 'space-between',
|
|
13
|
+
},
|
|
14
|
+
dateContainer: {
|
|
15
|
+
flexDirection: 'row',
|
|
16
|
+
backgroundColor: context.colors.main[0],
|
|
17
|
+
borderRadius: Scale.xl,
|
|
18
|
+
paddingTop: Scale.xs,
|
|
19
|
+
paddingBottom: Scale.xs,
|
|
20
|
+
paddingLeft: Scale.l,
|
|
21
|
+
paddingRight: Scale.l,
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
},
|
|
24
|
+
text: {
|
|
25
|
+
color: context.colors.main[9],
|
|
26
|
+
},
|
|
27
|
+
icon: {
|
|
28
|
+
marginRight: Scale.m,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import render from 'react-test-renderer';
|
|
3
|
+
import {CalendarSelect} from './calendar-select.component';
|
|
4
|
+
import {DateTime} from 'luxon';
|
|
5
|
+
|
|
6
|
+
const testDate = DateTime.fromISO('2022-12-01', {locale: 'en-GB'});
|
|
7
|
+
|
|
8
|
+
describe('test Calendar Select', () => {
|
|
9
|
+
it('renders Calendar Select', function () {
|
|
10
|
+
const tree = render
|
|
11
|
+
.create(
|
|
12
|
+
<CalendarSelect
|
|
13
|
+
onPressDate={(date) => console.log(date)}
|
|
14
|
+
startDate={testDate}
|
|
15
|
+
/>
|
|
16
|
+
)
|
|
17
|
+
.toJSON();
|
|
18
|
+
expect(tree).toMatchSnapshot();
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare type CancelLinkProps = {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
label: string;
|
|
3
|
+
onPress: () => void;
|
|
4
4
|
};
|
|
5
|
-
declare const CancelLink: ({
|
|
6
|
-
export {
|
|
5
|
+
declare const CancelLink: ({label, onPress}: CancelLinkProps) => JSX.Element;
|
|
6
|
+
export {CancelLink as CancelLink};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare type CheckProps = {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
value: boolean;
|
|
3
|
+
onToggle: () => void;
|
|
4
4
|
};
|
|
5
|
-
export declare const Check: ({
|
|
5
|
+
export declare const Check: ({value, onToggle}: CheckProps) => JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
declare type CheckboxProps = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
value: boolean;
|
|
3
|
+
onValueChange: () => void;
|
|
4
|
+
label: string;
|
|
5
5
|
};
|
|
6
|
-
declare const Checkbox: ({
|
|
7
|
-
|
|
6
|
+
declare const Checkbox: ({
|
|
7
|
+
value,
|
|
8
|
+
onValueChange,
|
|
9
|
+
label,
|
|
10
|
+
}: CheckboxProps) => JSX.Element;
|
|
11
|
+
export {Checkbox as Checkbox};
|
|
@@ -1,18 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import {ImageSourcePropType} from 'react-native';
|
|
2
|
+
import {Initials} from '../../../models/initials.model';
|
|
3
|
+
import {VisualState} from '../../../types/visual-state.enum';
|
|
4
4
|
declare type ChildListItemProps = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
label: string;
|
|
8
|
+
selectable: boolean;
|
|
9
|
+
isSelected: boolean;
|
|
10
|
+
onPressArrow: () => void;
|
|
11
|
+
onPressText: () => void;
|
|
12
|
+
onSelect: (id: string) => void;
|
|
13
|
+
sourceAvatar: ImageSourcePropType | Initials;
|
|
14
|
+
textTimeTracker: string;
|
|
15
|
+
visualStateTimeTracker: VisualState;
|
|
16
16
|
};
|
|
17
|
-
declare const ChildListItem: ({
|
|
18
|
-
|
|
17
|
+
declare const ChildListItem: ({
|
|
18
|
+
id,
|
|
19
|
+
name,
|
|
20
|
+
label,
|
|
21
|
+
selectable,
|
|
22
|
+
isSelected,
|
|
23
|
+
onPressArrow,
|
|
24
|
+
onPressText,
|
|
25
|
+
onSelect,
|
|
26
|
+
sourceAvatar,
|
|
27
|
+
textTimeTracker,
|
|
28
|
+
visualStateTimeTracker,
|
|
29
|
+
}: ChildListItemProps) => JSX.Element;
|
|
30
|
+
export {ChildListItem as ChildListItem};
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
declare type ContactItemProps = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
name: string;
|
|
3
|
+
firstname: string;
|
|
4
|
+
label: string;
|
|
5
|
+
onPress?: () => void;
|
|
6
|
+
isBlocked?: boolean;
|
|
7
7
|
};
|
|
8
|
-
declare const ContactItem: ({
|
|
9
|
-
|
|
8
|
+
declare const ContactItem: ({
|
|
9
|
+
name,
|
|
10
|
+
firstname,
|
|
11
|
+
label,
|
|
12
|
+
onPress,
|
|
13
|
+
isBlocked,
|
|
14
|
+
}: ContactItemProps) => JSX.Element;
|
|
15
|
+
export {ContactItem as ContactItem};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Contact role component test renders a contact who is the father 1`] = `
|
|
4
|
+
<View
|
|
5
|
+
style={
|
|
6
|
+
{
|
|
7
|
+
"alignItems": "center",
|
|
8
|
+
"display": "flex",
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
>
|
|
12
|
+
<Text
|
|
13
|
+
style={
|
|
14
|
+
{
|
|
15
|
+
"color": "#1F2933",
|
|
16
|
+
"fontFamily": "SourceSansProBold",
|
|
17
|
+
"fontSize": 24,
|
|
18
|
+
"lineHeight": 30.2,
|
|
19
|
+
"marginBottom": 4,
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
>
|
|
23
|
+
Darth Vader
|
|
24
|
+
</Text>
|
|
25
|
+
<Text
|
|
26
|
+
style={
|
|
27
|
+
{
|
|
28
|
+
"color": "#1F2933",
|
|
29
|
+
"fontFamily": "Montserrat",
|
|
30
|
+
"fontSize": 13,
|
|
31
|
+
"lineHeight": 20.4,
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
>
|
|
35
|
+
I'm your Father
|
|
36
|
+
</Text>
|
|
37
|
+
</View>
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
exports[`Contact role component test renders a contact who is the sister 1`] = `
|
|
41
|
+
<View
|
|
42
|
+
style={
|
|
43
|
+
{
|
|
44
|
+
"alignItems": "center",
|
|
45
|
+
"display": "flex",
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
>
|
|
49
|
+
<Text
|
|
50
|
+
style={
|
|
51
|
+
{
|
|
52
|
+
"color": "#1F2933",
|
|
53
|
+
"fontFamily": "SourceSansProBold",
|
|
54
|
+
"fontSize": 24,
|
|
55
|
+
"lineHeight": 30.2,
|
|
56
|
+
"marginBottom": 4,
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
>
|
|
60
|
+
Princess Leia
|
|
61
|
+
</Text>
|
|
62
|
+
<Text
|
|
63
|
+
style={
|
|
64
|
+
{
|
|
65
|
+
"color": "#1F2933",
|
|
66
|
+
"fontFamily": "Montserrat",
|
|
67
|
+
"fontSize": 13,
|
|
68
|
+
"lineHeight": 20.4,
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
>
|
|
72
|
+
Sister
|
|
73
|
+
</Text>
|
|
74
|
+
</View>
|
|
75
|
+
`;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {useContext} from 'react';
|
|
3
|
+
import {ThemeCtx} from '../../../context/theme.context';
|
|
4
|
+
import {Text, View} from 'react-native';
|
|
5
|
+
import {Stylesheet} from './contact-role.styles';
|
|
6
|
+
|
|
7
|
+
type ContactRoleProps = {
|
|
8
|
+
name: string;
|
|
9
|
+
role?: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const ContactRole = ({name, role}: ContactRoleProps) => {
|
|
13
|
+
const context = useContext(ThemeCtx);
|
|
14
|
+
const styles = Stylesheet(context);
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<View style={styles.container}>
|
|
18
|
+
<Text style={styles.name}>{name}</Text>
|
|
19
|
+
<Text style={styles.role}>{role}</Text>
|
|
20
|
+
</View>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ContactRolePreview: ({}: {}) => JSX.Element;
|