@tactics/toddle-styleguide 1.2.1 → 1.2.3
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.d.ts +0 -1
- package/App.tsx +15 -7
- package/index.d.ts +3 -2
- package/index.tsx +4 -2
- package/package.json +30 -26
- package/src/components/atoms/animated-wave/animated-wave.component.d.ts +0 -1
- package/src/components/atoms/backdrop/backdrop.component.d.ts +0 -1
- package/src/components/atoms/background-gradient/background-gradient.component.d.ts +0 -1
- package/src/components/atoms/background-gradient/background-gradient.preview.d.ts +0 -1
- package/src/components/atoms/calendar/__snapshots__/calendar.test.js.snap +234 -234
- package/src/components/atoms/calendar/calendar.component.d.ts +0 -1
- package/src/components/atoms/calendar/calendar.component.tsx +8 -6
- package/src/components/atoms/calendar/calendar.preview.d.ts +0 -1
- package/src/components/atoms/check-switch/check-switch.component.d.ts +0 -1
- package/src/components/atoms/check-switch/check-switch.preview.d.ts +0 -1
- package/src/components/atoms/footer/footer.preview.d.ts +0 -1
- package/src/components/atoms/footer/footer.preview.tsx +0 -3
- package/src/components/atoms/heading-components/all-caps-heading/all-caps-heading.component.d.ts +0 -1
- package/src/components/atoms/heading-components/heading1/heading1.component.d.ts +0 -1
- package/src/components/atoms/heading-components/heading2/heading2.component.d.ts +0 -1
- package/src/components/atoms/heading-components/heading3/heading3.component.d.ts +0 -1
- package/src/components/atoms/heading-components/heading4/heading4.component.d.ts +0 -1
- package/src/components/atoms/heading-components/headings.preview.d.ts +0 -1
- package/src/components/atoms/image-bubble/image-bubble.component.d.ts +0 -1
- package/src/components/atoms/image-bubble/image-bubble.preview.d.ts +0 -1
- package/src/components/atoms/increment-input/increment-input.component.d.ts +0 -1
- package/src/components/atoms/increment-input/increment-input.preview.d.ts +0 -1
- package/src/components/atoms/logo/logo.component.d.ts +0 -1
- package/src/components/atoms/logo/logo.preview.d.ts +0 -1
- package/src/components/atoms/paragraph-components/paragraph/paragraph.component.d.ts +0 -1
- package/src/components/atoms/paragraph-components/paragraph-components.preview.d.ts +0 -1
- package/src/components/atoms/paragraph-components/small-text/small-text.component.d.ts +0 -1
- package/src/components/atoms/paragraph-components/tiny-text/tiny-text.component.d.ts +0 -1
- package/src/components/atoms/split-container/split-container.preview.d.ts +0 -1
- package/src/components/atoms/static-wave/static-wave.component.d.ts +0 -1
- package/src/components/atoms/text-input/text-input.component.d.ts +0 -1
- package/src/components/atoms/text-input/text-input.preview.d.ts +0 -1
- package/src/components/molecules/avatar/avatar.component.d.ts +0 -1
- package/src/components/molecules/avatar/avatar.preview.d.ts +0 -1
- package/src/components/molecules/blocked-message/blocked-message.component.d.ts +0 -1
- package/src/components/molecules/blocked-message/blocked-message.preview.d.ts +0 -1
- package/src/components/molecules/button/button.component.d.ts +0 -1
- package/src/components/molecules/button/button.preview.d.ts +0 -1
- package/src/components/molecules/calendar-select/calendar-select.component.d.ts +2 -3
- package/src/components/molecules/calendar-select/calendar-select.component.tsx +4 -14
- package/src/components/molecules/calendar-select/calendar-select.preview.d.ts +0 -1
- package/src/components/molecules/calendar-select/calendar-select.preview.tsx +9 -22
- package/src/components/molecules/cancel-link/cancel-link.component.d.ts +0 -1
- package/src/components/molecules/cancel-link/cancel-link.preview.d.ts +0 -1
- package/src/components/molecules/checkbox/checkbox.component.d.ts +0 -1
- package/src/components/molecules/checkbox/checkbox.preview.d.ts +0 -1
- package/src/components/molecules/contact-role/contact-role.component.d.ts +0 -1
- package/src/components/molecules/contact-role/contact-role.preview.d.ts +0 -1
- package/src/components/molecules/date-input/date-input.component.d.ts +0 -1
- package/src/components/molecules/date-input/date-input.preview.d.ts +0 -1
- package/src/components/molecules/day/day.component.d.ts +0 -1
- package/src/components/molecules/default-select/default-select.component.d.ts +0 -1
- package/src/components/molecules/default-select/default-select.preview.d.ts +0 -1
- package/src/components/molecules/department_logo/department-logo.component.d.ts +0 -1
- package/src/components/molecules/department_logo/department-logo.preview.d.ts +0 -1
- package/src/components/molecules/failed-to-send/failed-bubble.component.d.ts +0 -1
- package/src/components/molecules/filter-range/filter-range.component.d.ts +0 -1
- package/src/components/molecules/filter-range/filter-range.preview.d.ts +0 -1
- package/src/components/molecules/filter-tab/filter-tab.component.d.ts +0 -1
- package/src/components/molecules/filter-tab/filter-tab.preview.d.ts +0 -1
- package/src/components/molecules/info/info.component.d.ts +0 -1
- package/src/components/molecules/info/info.preview.d.ts +0 -1
- package/src/components/molecules/language-button/language-button.component.d.ts +0 -1
- package/src/components/molecules/language-button/language-button.preview.d.ts +0 -1
- package/src/components/molecules/message-input/message-input.component.d.ts +0 -1
- package/src/components/molecules/message-input/message-input.preview.d.ts +0 -1
- package/src/components/molecules/more-info-button/more-info-button.component.d.ts +0 -1
- package/src/components/molecules/more-info-button/more-info-button.preview.d.ts +0 -1
- package/src/components/molecules/password-input/password-input.component.d.ts +0 -1
- package/src/components/molecules/password-input/password-input.preview.d.ts +0 -1
- package/src/components/molecules/pill/pill.component.d.ts +0 -1
- package/src/components/molecules/pill/pill.preview.d.ts +0 -1
- package/src/components/molecules/pressable-icon/pressable-icon.preview.d.ts +0 -1
- package/src/components/molecules/quick-filter/quick-filter.component.d.ts +0 -1
- package/src/components/molecules/quick-filter/quick-filter.preview.d.ts +0 -1
- package/src/components/molecules/search-input/search.component.d.ts +0 -1
- package/src/components/molecules/search-input/search.preview.d.ts +0 -1
- package/src/components/molecules/select-link/select-link.component.d.ts +0 -1
- package/src/components/molecules/select-link/select-link.preview.d.ts +0 -1
- package/src/components/molecules/select-list-item/select-list-item-preview.d.ts +0 -1
- package/src/components/molecules/select-picker/select-picker.component.d.ts +0 -1
- package/src/components/molecules/select-picker/select-picker.preview.d.ts +0 -1
- package/src/components/molecules/send-bubble/send-text-bubble.component.d.ts +0 -1
- package/src/components/molecules/snackbar/snackbar.component.d.ts +0 -1
- package/src/components/molecules/snackbar/snackbar.preview.d.ts +0 -1
- package/src/components/molecules/swipe/swipe.preview.d.ts +0 -1
- package/src/components/molecules/tag/tag.component.d.ts +0 -1
- package/src/components/molecules/tag/tag.preview.d.ts +0 -1
- package/src/components/molecules/time-picker/__snapshots__/time-picker.test.js.snap +2149 -0
- package/src/components/molecules/time-picker/time-picker.component.d.ts +8 -0
- package/src/components/molecules/time-picker/time-picker.component.tsx +65 -0
- package/src/components/molecules/time-picker/time-picker.preview.d.ts +1 -0
- package/src/components/molecules/time-picker/time-picker.preview.tsx +109 -0
- package/src/components/molecules/time-picker/time-picker.styles.d.ts +15 -0
- package/src/components/molecules/time-picker/time-picker.styles.js +19 -0
- package/src/components/molecules/time-picker/time-picker.test.js +18 -0
- package/src/components/molecules/time-tracker/time-tracker.component.d.ts +0 -1
- package/src/components/molecules/time-tracker/time-tracker.preview.d.ts +0 -1
- package/src/components/molecules/time-tracker/time-tracker.test.js +0 -1
- package/src/components/molecules/timeline/__snapshots__/timeline.test.js.snap +47 -39
- package/src/components/molecules/timeline/timeline.component.d.ts +2 -3
- package/src/components/molecules/timeline/timeline.component.tsx +27 -120
- package/src/components/molecules/timeline/timeline.preview.d.ts +0 -1
- package/src/components/molecules/timeline/timeline.preview.tsx +9 -20
- package/src/components/molecules/timeline/timeline.styles.d.ts +58 -40
- package/src/components/molecules/timeline/timeline.styles.js +24 -17
- package/src/components/molecules/timeline/timeline.test.js +3 -3
- package/src/components/molecules/timestamp/timestamp.component.d.ts +0 -1
- package/src/components/molecules/wave-background/wave.component.d.ts +0 -1
- package/src/components/molecules/wave-background/wave.preview.d.ts +0 -1
- package/src/components/molecules/wide-button/wide-button.component.d.ts +0 -1
- package/src/components/molecules/wide-button/wide-button.preview.d.ts +0 -1
- package/src/components/organisms/child-list-item/child-list-item.preview.d.ts +0 -1
- package/src/components/organisms/contact-item/contact-item.component.d.ts +0 -1
- package/src/components/organisms/contact-item/contact-item.preview.d.ts +0 -1
- package/src/components/organisms/day-select/day-select.component.d.ts +0 -1
- package/src/components/organisms/day-select/day-select.preview.d.ts +0 -1
- package/src/components/organisms/loading-indicator/container.component.d.ts +0 -1
- package/src/components/organisms/loading-indicator/dot.component.d.ts +0 -1
- package/src/components/organisms/loading-indicator/loading-indicator.component.d.ts +0 -1
- package/src/components/organisms/loading-indicator/loading-indicator.preview.d.ts +0 -1
- package/src/components/organisms/my-child-list-item/my-child-list-item.component.d.ts +0 -1
- package/src/components/organisms/my-child-list-item/my-child-list-item.preview.d.ts +0 -1
- package/src/components/organisms/person-info-card/person-info-card.component.d.ts +0 -1
- package/src/components/organisms/person-info-card/person-info-card.preview.d.ts +0 -1
- package/src/components/organisms/text-bubble/text-bubble.component.d.ts +0 -1
- package/src/components/organisms/text-bubble/text-bubble.preview.d.ts +0 -1
- package/src/components/templates/modal/components/fade-panel.component.d.ts +2 -1
- package/src/components/templates/modal/components/fade-panel.component.tsx +8 -2
- package/src/components/templates/modal/modal.component.d.ts +2 -1
- package/src/components/templates/modal/modal.component.tsx +4 -3
- package/src/components/templates/modal/modal.preview.d.ts +0 -1
- package/src/components/templates/modal/modal.styles.d.ts +3 -6
- package/src/components/templates/modal/modal.styles.js +3 -3
- package/src/components/templates/popover/components/modal/close/close.component.d.ts +0 -1
- package/src/components/templates/popover/components/modal/heading/heading.component.d.ts +0 -1
- package/src/components/templates/popover/components/modal/modal.component.tsx +0 -2
- package/src/components/templates/popover/popover.preview.d.ts +0 -1
- package/src/gradients/main/main.gradient.d.ts +0 -1
- package/src/icons/index.d.ts +0 -1
- package/src/icons/outline/calendar/calendar.icon.d.ts +0 -1
- package/src/icons/outline/chat/chat.icon.d.ts +0 -1
- package/src/icons/outline/chat-alt/chat-alt.icon.d.ts +0 -1
- package/src/icons/outline/check-circle/check-circle.icon.d.ts +0 -1
- package/src/icons/outline/chevron-left/chevron-left.icon.d.ts +0 -1
- package/src/icons/outline/chevron-right/chevron-right.icon.d.ts +0 -1
- package/src/icons/outline/clock/clock.icon.d.ts +0 -1
- package/src/icons/outline/cloud-download/cloud-download.icon.d.ts +0 -1
- package/src/icons/outline/currency-euro/currency-euro.icon.d.ts +0 -1
- package/src/icons/outline/document-text/document-text.icon.d.ts +0 -1
- package/src/icons/outline/exclamation/exclamation.icon.d.ts +0 -1
- package/src/icons/outline/exclamation-circle/exclamation-circle.icon.d.ts +0 -1
- package/src/icons/outline/eye/eye.icon.d.ts +0 -1
- package/src/icons/outline/eye-off/eye-off.icon.d.ts +0 -1
- package/src/icons/outline/filter/filter.icon.d.ts +0 -1
- package/src/icons/outline/information-circle/information-circle.icon.d.ts +0 -1
- package/src/icons/outline/logout/logout.icon.d.ts +0 -1
- package/src/icons/outline/mail/mail.icon.d.ts +0 -1
- package/src/icons/outline/mail-open/mail-open.icon.d.ts +0 -1
- package/src/icons/outline/menu/menu.icon.d.ts +0 -1
- package/src/icons/outline/minus-sm/minus-sm.icon.d.ts +0 -1
- package/src/icons/outline/office-building/office-building.icon.d.ts +0 -1
- package/src/icons/outline/outline-default.preview.d.ts +0 -1
- package/src/icons/outline/outline-grey.preview.d.ts +0 -1
- package/src/icons/outline/outline-white.preview.d.ts +0 -1
- package/src/icons/outline/outline.d.ts +0 -1
- package/src/icons/outline/paper-airplane/paper-airplane.icon.d.ts +0 -1
- package/src/icons/outline/paperclip/paperclip.icon.d.ts +0 -1
- package/src/icons/outline/pencil/pencil.icon.d.ts +0 -1
- package/src/icons/outline/phone/phone.icon.d.ts +0 -1
- package/src/icons/outline/plus/plus.icon.d.ts +0 -1
- package/src/icons/outline/plus-sm/plus-sm.icon.d.ts +0 -1
- package/src/icons/outline/qrcode/qrcode.icon.d.ts +0 -1
- package/src/icons/outline/refresh/refresh.icon.d.ts +0 -1
- package/src/icons/outline/search/search.icon.d.ts +0 -1
- package/src/icons/outline/selector/selector.icon.d.ts +0 -1
- package/src/icons/outline/sm-view-grid-add/sm-view-grid-add.icon.d.ts +0 -1
- package/src/icons/outline/status-online/status-online.icon.d.ts +0 -1
- package/src/icons/outline/thumb-up/thumb-up.icon.d.ts +0 -1
- package/src/icons/outline/trash/trash.icon.d.ts +0 -1
- package/src/icons/outline/user/user.icon.d.ts +0 -1
- package/src/icons/outline/user-group/user-group.icon.d.ts +0 -1
- package/src/icons/outline/users/users.icon.d.ts +0 -1
- package/src/icons/outline/xmark/xmark.icon.d.ts +0 -1
- package/src/icons/solid/calendar/calendar.icon.d.ts +0 -1
- package/src/icons/solid/chat/chat.icon.d.ts +0 -1
- package/src/icons/solid/chat-alt/chat-alt-solid.icon.d.ts +0 -1
- package/src/icons/solid/check-circle/check-circle.icon.d.ts +0 -1
- package/src/icons/solid/chevron-left/chevron-left.icon.d.ts +0 -1
- package/src/icons/solid/chevron-right/chevron-right.icon.d.ts +0 -1
- package/src/icons/solid/clock/clock-solid.icon.d.ts +0 -1
- package/src/icons/solid/cloud-download/cloud-download.icon.d.ts +0 -1
- package/src/icons/solid/currency-euro/currency-euro.icon.d.ts +0 -1
- package/src/icons/solid/document-text/document-text-solid.icon.d.ts +0 -1
- package/src/icons/solid/exclamation/exclamation.icon.d.ts +0 -1
- package/src/icons/solid/exclamation-circle/exclamation-circle.icon.d.ts +0 -1
- package/src/icons/solid/eye/eye.icon.d.ts +0 -1
- package/src/icons/solid/eye-off/eye-off.icon.d.ts +0 -1
- package/src/icons/solid/filter/filter.icon.d.ts +0 -1
- package/src/icons/solid/information-circle/information-circle-solid.icon.d.ts +0 -1
- package/src/icons/solid/logout/logout.icon.d.ts +0 -1
- package/src/icons/solid/mail/mail.icon.d.ts +0 -1
- package/src/icons/solid/mail-open/mail-open.icon.d.ts +0 -1
- package/src/icons/solid/menu/menu.icon.d.ts +0 -1
- package/src/icons/solid/minus-sm/minus-sm.icon.d.ts +0 -1
- package/src/icons/solid/office-building/office-building.icon.d.ts +0 -1
- package/src/icons/solid/paper-airplane/paper-airplane.icon.d.ts +0 -1
- package/src/icons/solid/paperclip/paperclip.icon.d.ts +0 -1
- package/src/icons/solid/pencil/pencil-solid.icon.d.ts +0 -1
- package/src/icons/solid/phone/phone-solid.icon.d.ts +0 -1
- package/src/icons/solid/plus/plus.icon.d.ts +0 -1
- package/src/icons/solid/plus-sm/plus-sm.icon.d.ts +0 -1
- package/src/icons/solid/qrcode/qrcode.icon.d.ts +0 -1
- package/src/icons/solid/refresh/refresh-solid.icon.d.ts +0 -1
- package/src/icons/solid/search/search.icon.d.ts +0 -1
- package/src/icons/solid/selector/selector.icon.d.ts +0 -1
- package/src/icons/solid/sm-view-grid-add/sm-view-grid-add.icon.d.ts +0 -1
- package/src/icons/solid/solid.d.ts +0 -1
- package/src/icons/solid/solid.preview.d.ts +0 -1
- package/src/icons/solid/status-online/status-online-solid.icon.d.ts +0 -1
- package/src/icons/solid/thumb-up/thumb-up.icon.d.ts +0 -1
- package/src/icons/solid/trash/trash-solid.icon.d.ts +0 -1
- package/src/icons/solid/user/user.icon.d.ts +0 -1
- package/src/icons/solid/user-group/user-group.icon.d.ts +0 -1
- package/src/icons/solid/users/users-solid.icon.d.ts +0 -1
- package/src/icons/solid/xmark/xmark.icon.d.ts +0 -1
- package/src/theme/provider/parent.theme.d.ts +4 -1
- package/src/theme/provider/parent.theme.ts +4 -1
- package/src/utilities/toddle-datetime/toddle-datetime.class.d.ts +2 -2
- package/src/utilities/toddle-datetime/toddle-datetime.class.tsx +2 -2
- package/src/utilities/toddle-datetime/toddle-datetime.preview.d.ts +0 -1
|
@@ -1,43 +1,61 @@
|
|
|
1
1
|
export function Stylesheet(
|
|
2
2
|
context: any,
|
|
3
3
|
startingPosition: any,
|
|
4
|
-
width: any
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
4
|
+
width: any
|
|
5
|
+
):
|
|
6
|
+
| StyleSheet.NamedStyles<any>
|
|
7
|
+
| StyleSheet.NamedStyles<{
|
|
8
|
+
container: {
|
|
9
|
+
width: string;
|
|
10
|
+
marginTop: number;
|
|
11
|
+
marginBottom: number;
|
|
12
|
+
};
|
|
13
|
+
lineContainer: {
|
|
14
|
+
height: number;
|
|
15
|
+
borderRadius: number;
|
|
16
|
+
backgroundColor: any;
|
|
17
|
+
overflow: 'hidden';
|
|
18
|
+
};
|
|
19
|
+
checkInLine: {
|
|
20
|
+
height: number;
|
|
21
|
+
width: string;
|
|
22
|
+
borderRadius: number;
|
|
23
|
+
left: string;
|
|
24
|
+
};
|
|
25
|
+
checkInOutTextContainer: (
|
|
26
|
+
| {
|
|
27
|
+
width: string;
|
|
28
|
+
flexDirection: string;
|
|
29
|
+
height: number;
|
|
30
|
+
marginTop: number;
|
|
31
|
+
marginLeft?: undefined;
|
|
32
|
+
justifyContent?: undefined;
|
|
33
|
+
alignSelf?: undefined;
|
|
34
|
+
}
|
|
35
|
+
| {
|
|
36
|
+
marginLeft: string;
|
|
37
|
+
justifyContent: string;
|
|
38
|
+
width?: undefined;
|
|
39
|
+
flexDirection?: undefined;
|
|
40
|
+
height?: undefined;
|
|
41
|
+
marginTop?: undefined;
|
|
42
|
+
alignSelf?: undefined;
|
|
43
|
+
}
|
|
44
|
+
| {
|
|
45
|
+
alignSelf: string;
|
|
46
|
+
justifyContent: string;
|
|
47
|
+
width: string;
|
|
48
|
+
flexDirection?: undefined;
|
|
49
|
+
height?: undefined;
|
|
50
|
+
marginTop?: undefined;
|
|
51
|
+
marginLeft?: undefined;
|
|
52
|
+
}
|
|
53
|
+
)[];
|
|
54
|
+
checkInTime: {
|
|
55
|
+
right: number;
|
|
56
|
+
};
|
|
57
|
+
checkOutTime: {
|
|
58
|
+
left: number;
|
|
59
|
+
};
|
|
60
|
+
}>;
|
|
61
|
+
import {StyleSheet} from 'react-native/Libraries/StyleSheet/StyleSheet';
|
|
@@ -1,39 +1,46 @@
|
|
|
1
1
|
import {StyleSheet} from 'react-native';
|
|
2
2
|
import {Scale} from '../../../theme/scale';
|
|
3
3
|
|
|
4
|
-
export const Stylesheet = (context, startingPosition, width
|
|
4
|
+
export const Stylesheet = (context, startingPosition, width) =>
|
|
5
5
|
StyleSheet.create({
|
|
6
6
|
container: {
|
|
7
7
|
width: '100%',
|
|
8
|
+
marginTop: Scale.xs,
|
|
9
|
+
marginBottom: Scale.xs,
|
|
8
10
|
},
|
|
9
11
|
lineContainer: {
|
|
10
12
|
height: Scale.xs,
|
|
11
13
|
borderRadius: 50,
|
|
12
14
|
backgroundColor: context.colors.ui.lightgrey,
|
|
15
|
+
overflow: 'hidden',
|
|
13
16
|
},
|
|
14
17
|
checkInLine: {
|
|
15
18
|
height: Scale.xs,
|
|
19
|
+
width: width.toString() + '%',
|
|
16
20
|
borderRadius: 50,
|
|
17
21
|
left: startingPosition.toString() + '%',
|
|
18
22
|
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
checkInOutTextContainer: [
|
|
24
|
+
{
|
|
25
|
+
width: width.toString() + '%',
|
|
26
|
+
flexDirection: 'row',
|
|
27
|
+
height: Scale.l,
|
|
28
|
+
marginTop: Scale.xs,
|
|
29
|
+
},
|
|
30
|
+
startingPosition < 80 && {
|
|
31
|
+
marginLeft: startingPosition.toString() + '%',
|
|
32
|
+
justifyContent: 'space-between',
|
|
33
|
+
},
|
|
34
|
+
startingPosition >= 80 && {
|
|
35
|
+
alignSelf: 'flex-end',
|
|
36
|
+
justifyContent: 'space-between',
|
|
37
|
+
width: 'auto',
|
|
38
|
+
},
|
|
39
|
+
],
|
|
33
40
|
checkInTime: {
|
|
34
|
-
right:
|
|
41
|
+
right: Scale.m,
|
|
35
42
|
},
|
|
36
43
|
checkOutTime: {
|
|
37
|
-
left:
|
|
44
|
+
left: width === 25 ? Scale.s : Scale.m,
|
|
38
45
|
},
|
|
39
46
|
});
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import renderer from 'react-test-renderer';
|
|
3
|
-
import {
|
|
3
|
+
import {TimeLine} from './timeline.component';
|
|
4
4
|
|
|
5
5
|
describe('Timeline visual test', () => {
|
|
6
6
|
it('renders a check-in time with no known check-out time', () => {
|
|
7
|
-
const tree = renderer.create(<
|
|
7
|
+
const tree = renderer.create(<TimeLine checkIn={'07:30'} />).toJSON();
|
|
8
8
|
|
|
9
9
|
expect(tree).toMatchSnapshot();
|
|
10
10
|
});
|
|
11
11
|
it('renders a check-in time and check-out time', () => {
|
|
12
12
|
const tree = renderer
|
|
13
|
-
.create(<
|
|
13
|
+
.create(<TimeLine checkIn={'07:30'} checkOut={'12:30'} />)
|
|
14
14
|
.toJSON();
|
|
15
15
|
|
|
16
16
|
expect(tree).toMatchSnapshot();
|
|
@@ -6,6 +6,7 @@ type FadePanelProps = {
|
|
|
6
6
|
onClose: () => void;
|
|
7
7
|
maxHeight: number;
|
|
8
8
|
children: React.ReactNode;
|
|
9
|
+
scrollable: boolean | undefined;
|
|
9
10
|
};
|
|
10
|
-
export declare const FadePanel: ({ title, subtitle, isVisible, onClose, maxHeight, children, }: FadePanelProps) => JSX.Element;
|
|
11
|
+
export declare const FadePanel: ({ title, subtitle, isVisible, onClose, maxHeight, children, scrollable, }: FadePanelProps) => JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, {useContext, useEffect, useRef} from 'react';
|
|
2
|
-
import {Animated, ScrollView} from 'react-native';
|
|
2
|
+
import {Animated, ScrollView, View} from 'react-native';
|
|
3
3
|
import {ThemeCtx} from '../../../../context/theme.context';
|
|
4
4
|
import {Stylesheet} from './fade-panel.styles';
|
|
5
5
|
import {Heading} from '../../popover/components/modal/heading/heading.component';
|
|
@@ -12,6 +12,7 @@ type FadePanelProps = {
|
|
|
12
12
|
onClose: () => void;
|
|
13
13
|
maxHeight: number;
|
|
14
14
|
children: React.ReactNode;
|
|
15
|
+
scrollable: boolean | undefined;
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
export const FadePanel = ({
|
|
@@ -21,6 +22,7 @@ export const FadePanel = ({
|
|
|
21
22
|
onClose,
|
|
22
23
|
maxHeight,
|
|
23
24
|
children,
|
|
25
|
+
scrollable = true,
|
|
24
26
|
}: FadePanelProps) => {
|
|
25
27
|
const fadeAnimation = useRef(new Animated.Value(0)).current;
|
|
26
28
|
|
|
@@ -47,7 +49,11 @@ export const FadePanel = ({
|
|
|
47
49
|
<Animated.View style={styles.rootContainer}>
|
|
48
50
|
<Close onPress={onClose} />
|
|
49
51
|
<Heading title={title} subtitle={subtitle} />
|
|
50
|
-
|
|
52
|
+
{scrollable ? (
|
|
53
|
+
<ScrollView>{children}</ScrollView>
|
|
54
|
+
) : (
|
|
55
|
+
<View>{children}</View>
|
|
56
|
+
)}
|
|
51
57
|
</Animated.View>
|
|
52
58
|
);
|
|
53
59
|
};
|
|
@@ -5,6 +5,7 @@ type ModalProps = {
|
|
|
5
5
|
isVisible: boolean;
|
|
6
6
|
onClose: () => void;
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
+
scrollable?: boolean;
|
|
8
9
|
};
|
|
9
|
-
export declare const Modal: ({ title, subtitle, isVisible, onClose, children, }: ModalProps) => JSX.Element;
|
|
10
|
+
export declare const Modal: ({ title, subtitle, isVisible, onClose, children, scrollable, }: ModalProps) => JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -11,6 +11,7 @@ type ModalProps = {
|
|
|
11
11
|
isVisible: boolean;
|
|
12
12
|
onClose: () => void;
|
|
13
13
|
children?: React.ReactNode;
|
|
14
|
+
scrollable?: boolean;
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
const window = Dimensions.get('window');
|
|
@@ -21,21 +22,20 @@ export const Modal = ({
|
|
|
21
22
|
isVisible,
|
|
22
23
|
onClose,
|
|
23
24
|
children,
|
|
25
|
+
scrollable,
|
|
24
26
|
}: ModalProps) => {
|
|
25
27
|
const [windowHeight, setWindowHeight] = useState(window.height);
|
|
26
|
-
const [windowWidth, setWindowWidth] = useState(window.width);
|
|
27
28
|
|
|
28
29
|
useEffect(() => {
|
|
29
30
|
const subscription = Dimensions.addEventListener('change', ({window}) => {
|
|
30
31
|
setWindowHeight(window.height);
|
|
31
|
-
setWindowWidth(window.width);
|
|
32
32
|
});
|
|
33
33
|
return () => subscription?.remove();
|
|
34
34
|
});
|
|
35
35
|
|
|
36
36
|
const maxHeight = Math.round(windowHeight / 100) * 80;
|
|
37
37
|
|
|
38
|
-
const styles = Stylesheet(
|
|
38
|
+
const styles = Stylesheet();
|
|
39
39
|
|
|
40
40
|
return (
|
|
41
41
|
<View style={styles.element} pointerEvents={isVisible ? 'auto' : 'none'}>
|
|
@@ -47,6 +47,7 @@ export const Modal = ({
|
|
|
47
47
|
onClose={onClose}
|
|
48
48
|
title={title}
|
|
49
49
|
subtitle={subtitle}
|
|
50
|
+
scrollable={scrollable}
|
|
50
51
|
>
|
|
51
52
|
{children}
|
|
52
53
|
</FadePanel>
|
|
@@ -2,11 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import {StyleSheet} from 'react-native';
|
|
3
3
|
import {Scale} from '../../../theme/scale/index';
|
|
4
4
|
|
|
5
|
-
export const Stylesheet = (
|
|
5
|
+
export const Stylesheet = () =>
|
|
6
6
|
StyleSheet.create({
|
|
7
7
|
element: {
|
|
8
|
-
width:
|
|
9
|
-
height:
|
|
8
|
+
width: '100%',
|
|
9
|
+
height: '100%',
|
|
10
10
|
position: 'absolute',
|
|
11
11
|
left: 0,
|
|
12
12
|
top: 0,
|
package/src/icons/index.d.ts
CHANGED