@tactics/toddle-styleguide 2.0.3 → 3.0.0
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 +0 -12
- package/app.json +1 -0
- package/babel.config.js +14 -1
- package/index.d.ts +2 -5
- package/index.tsx +0 -8
- package/metro.config.js +11 -0
- package/package.json +1 -1
- package/src/components/atoms/animated-wave/animated-wave.styles.d.ts +19 -19
- package/src/components/atoms/backdrop/backdrop.styles.d.ts +9 -9
- package/src/components/atoms/background-gradient/background-gradient.styles.d.ts +6 -6
- package/src/components/atoms/count/count.component.d.ts +1 -1
- package/src/components/atoms/count/count.component.tsx +12 -13
- package/src/components/atoms/count/count.preview.tsx +5 -5
- package/src/components/atoms/count/count.styles.d.ts +23 -20
- package/src/components/atoms/count/count.styles.js +25 -17
- package/src/components/atoms/footer/footer.component.d.ts +1 -4
- package/src/components/atoms/footer/footer.component.tsx +9 -13
- package/src/components/atoms/footer/footer.preview.tsx +0 -17
- package/src/components/atoms/footer/footer.styles.d.ts +16 -13
- package/src/components/atoms/footer/footer.styles.js +1 -1
- package/src/components/atoms/increment-input/increment-input.styles.d.ts +33 -33
- package/src/components/atoms/quick-message/quick-message.styles.d.ts +16 -13
- package/src/components/atoms/split-container/split-container.styles.d.ts +12 -12
- package/src/components/molecules/amount/amount.component.d.ts +3 -3
- package/src/components/molecules/amount/amount.component.tsx +125 -100
- package/src/components/molecules/amount/amount.preview.tsx +59 -11
- package/src/components/molecules/amount/amount.styles.d.ts +34 -34
- package/src/components/molecules/amount/amount.styles.js +7 -7
- package/src/components/molecules/avatar/avatar.component.d.ts +1 -1
- package/src/components/molecules/avatar/avatar.component.tsx +8 -6
- package/src/components/molecules/avatar/avatar.styles.d.ts +96 -78
- package/src/components/molecules/avatar/avatar.styles.js +18 -16
- package/src/components/molecules/bare-time-picker/bare-time-picker.component.d.ts +1 -1
- package/src/components/molecules/bare-time-picker/bare-time-picker.component.native.tsx +78 -0
- package/src/components/molecules/bare-time-picker/bare-time-picker.component.tsx +39 -67
- package/src/components/molecules/bare-time-picker/bare-time-picker.preview.tsx +1 -1
- package/src/components/molecules/bare-time-picker/bare-time-picker.styles.d.ts +6 -0
- package/src/components/molecules/bare-time-picker/bare-time-picker.styles.js +14 -8
- package/src/components/molecules/calendar-select/calendar-select.component.d.ts +2 -1
- package/src/components/molecules/calendar-select/calendar-select.component.tsx +76 -73
- package/src/components/molecules/calendar-select/calendar-select.styles.d.ts +31 -31
- package/src/components/molecules/calendar-select/calendar-select.styles.js +33 -33
- package/src/components/molecules/context-label/context-label.component.tsx +21 -23
- package/src/components/molecules/context-label/context-label.preview.tsx +45 -30
- package/src/components/molecules/context-label/context-label.styles.d.ts +7 -5
- package/src/components/molecules/date-input/date-input.styles.d.ts +16 -16
- package/src/components/molecules/day/day.component.d.ts +10 -6
- package/src/components/molecules/default-select/default-select.styles.d.ts +11 -11
- package/src/components/molecules/filter-range/filter-range.styles.d.ts +20 -20
- package/src/components/molecules/filter-tab/filter-tab.styles.d.ts +58 -53
- package/src/components/molecules/info/info.component.tsx +13 -5
- package/src/components/molecules/info/info.preview.tsx +4 -5
- package/src/components/molecules/info/info.styles.d.ts +14 -14
- package/src/components/molecules/inline-error/inline-error.component.tsx +10 -3
- package/src/components/molecules/inline-error/inline-error.preview.tsx +4 -2
- package/src/components/molecules/inline-error/inline-error.styles.d.ts +16 -16
- package/src/components/molecules/inline-error/inline-error.styles.js +2 -2
- package/src/components/molecules/inline-notice/inline-notice.component.tsx +16 -12
- package/src/components/molecules/inline-notice/inline-notice.preview.tsx +4 -2
- package/src/components/molecules/inline-notice/inline-notice.styles.d.ts +16 -16
- package/src/components/molecules/inline-notice/inline-notice.styles.js +18 -18
- package/src/components/molecules/message-input/message-input.styles.d.ts +31 -31
- package/src/components/molecules/password-input/password-input.component.tsx +1 -1
- package/src/components/molecules/password-input/password-input.styles.d.ts +27 -27
- package/src/components/molecules/quick-filter/quick-filter.component.tsx +1 -1
- package/src/components/molecules/quick-filter/quick-filter.preview.tsx +1 -1
- package/src/components/molecules/quick-filter/quick-filter.styles.js +1 -1
- package/src/components/molecules/search-input/search.styles.d.ts +31 -31
- package/src/components/molecules/select-list-item/select-list-item.component.d.ts +1 -1
- package/src/components/molecules/select-list-item/select-list-item.component.tsx +13 -9
- package/src/components/molecules/select-list-item/select-list-item.styles.d.ts +27 -22
- package/src/components/molecules/select-picker/select-picker.styles.d.ts +30 -30
- package/src/components/molecules/selectable-list-item/selectable-list-item-preview.tsx +1 -1
- package/src/components/molecules/selectable-list-item/selectable-list-item.component.d.ts +1 -1
- package/src/components/molecules/selectable-list-item/selectable-list-item.component.tsx +17 -5
- package/src/components/molecules/selectable-list-item/selectable-list-item.styles.d.ts +31 -27
- package/src/components/molecules/swipe/swipe.component.native.tsx +78 -0
- package/src/components/molecules/swipe/swipe.component.tsx +5 -63
- package/src/components/molecules/time-picker/time-picker.component.tsx +8 -2
- package/src/components/molecules/time-picker/time-picker.styles.d.ts +25 -25
- package/src/components/molecules/wide-button/wide-button.styles.d.ts +14 -10
- package/src/components/organisms/child-list-item/child-list-item.component.d.ts +1 -1
- package/src/components/organisms/child-list-item/child-list-item.component.tsx +29 -26
- package/src/components/organisms/child-list-item/child-list-item.styles.d.ts +56 -53
- package/src/components/organisms/child-list-item/child-list-item.styles.js +5 -5
- package/src/components/organisms/contact-item/contact-item.styles.d.ts +13 -13
- package/src/components/organisms/journal-entry/components/journal-entry-type/journal-entry-type.component.d.ts +1 -1
- package/src/components/organisms/journal-entry/components/journal-entry-type/journal-entry-type.component.tsx +5 -4
- package/src/components/organisms/journal-entry/journal-entry.component.d.ts +1 -1
- package/src/components/organisms/journal-entry/journal-entry.styles.d.ts +25 -22
- package/src/components/organisms/my-child-list-item/my-child-list-item.styles.d.ts +31 -31
- package/src/components/organisms/text-bubble/text-bubble.styles.d.ts +14 -14
- package/src/components/organisms/timetable-edit/timetable-edit.component.d.ts +1 -1
- package/src/components/organisms/timetable-edit/timetable-edit.component.tsx +58 -56
- package/src/components/organisms/timetable-edit/timetable-edit.preview.tsx +20 -18
- package/src/components/organisms/timetable-edit/timetable-edit.styles.d.ts +19 -19
- package/src/components/organisms/timetable-edit/timetable-edit.styles.js +21 -21
- package/src/components/organisms/timetable-editor/components/timetable-edit-wrapper.d.ts +4 -4
- package/src/components/organisms/timetable-editor/components/timetable-edit-wrapper.tsx +65 -58
- package/src/components/organisms/timetable-editor/timetable-editor-staff.component.d.ts +8 -0
- package/src/components/organisms/timetable-editor/timetable-editor-staff.component.tsx +66 -47
- package/src/components/organisms/timetable-editor/timetable-editor.component.d.ts +2 -2
- package/src/components/organisms/timetable-editor/timetable-editor.component.tsx +76 -53
- package/src/components/organisms/timetable-editor/timetable-editor.preview.tsx +7 -7
- package/src/components/organisms/timetable-editor/timetable-editor.styles.d.ts +6 -6
- package/src/components/organisms/timetable-editor/timetable-editor.styles.js +8 -8
- package/src/components/templates/modal/components/fade-panel.styles.d.ts +17 -13
- package/src/components/templates/modal/modal.styles.d.ts +21 -21
- package/src/components/templates/popover/components/foreground/foreground.styles.d.ts +10 -10
- package/src/components/templates/popover/components/modal/heading/heading.styles.d.ts +12 -12
- package/src/components/templates/popover/components/modal/modal.styles.d.ts +17 -17
- package/src/components/templates/popover/popover.styles.d.ts +9 -9
- package/src/components/templates/popover-action/popover-action.component.d.ts +8 -4
- package/src/components/templates/popover-action/popover-action.component.tsx +7 -4
- package/src/components/templates/popover-action/popover-action.styles.d.ts +26 -26
- package/src/context/theme.context.ts +4 -4
- package/src/hooks/use-debounce.ts +8 -8
- package/src/icons/crown.icon.tsx +18 -5
- package/src/icons/outline/outline-default.preview.tsx +2 -2
- package/src/icons/outline/outline.tsx +4 -4
- package/src/icons/outline/photograph/photograph.icon.tsx +3 -6
- package/src/icons/solid/photograph/photograph-solid.icon.tsx +4 -4
- package/src/icons/solid/share/share.icon.tsx +1 -3
- package/src/icons/solid/solid.tsx +4 -4
- package/src/models/time-slot-sequence.ts +13 -9
- package/src/theme/provider/parent.theme.ts +4 -4
- package/src/theme/provider/staff-member.theme.ts +4 -4
- package/src/types/state.enum.ts +5 -5
- package/src/utilities/color-handler/color-handler.ts +2 -3
- package/tsconfig.json +2 -1
- package/src/components/organisms/day-select/day-select.component.d.ts +0 -9
- package/src/components/organisms/day-select/day-select.component.tsx +0 -108
- package/src/components/organisms/day-select/day-select.preview.d.ts +0 -2
- package/src/components/organisms/day-select/day-select.preview.tsx +0 -23
- package/src/components/organisms/day-select/day-select.styles.d.ts +0 -18
- package/src/components/organisms/day-select/day-select.styles.js +0 -22
- package/src/components/organisms/tab-view/__snapshots__/tab-view.test.js.snap +0 -421
- package/src/components/organisms/tab-view/tab-view.component.d.ts +0 -12
- package/src/components/organisms/tab-view/tab-view.component.tsx +0 -49
- package/src/components/organisms/tab-view/tab-view.preview.d.ts +0 -2
- package/src/components/organisms/tab-view/tab-view.preview.tsx +0 -37
- package/src/components/organisms/tab-view/tab-view.styles.d.ts +0 -10
- package/src/components/organisms/tab-view/tab-view.styles.js +0 -14
- package/src/components/organisms/tab-view/tab-view.test.js +0 -37
|
@@ -7,5 +7,5 @@ type SelectableListProps = {
|
|
|
7
7
|
inverse?: boolean;
|
|
8
8
|
selected: boolean;
|
|
9
9
|
};
|
|
10
|
-
declare const SelectableListItem: ({ title, subtitle, icon, onPress, inverse, selected }: SelectableListProps) => React.JSX.Element;
|
|
10
|
+
declare const SelectableListItem: ({ title, subtitle, icon, onPress, inverse, selected, }: SelectableListProps) => React.JSX.Element;
|
|
11
11
|
export { SelectableListItem as SelectableListItem };
|
|
@@ -13,7 +13,7 @@ type SelectableListProps = {
|
|
|
13
13
|
icon: React.ReactElement;
|
|
14
14
|
onPress?: () => void;
|
|
15
15
|
inverse?: boolean;
|
|
16
|
-
selected: boolean
|
|
16
|
+
selected: boolean;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
const SelectableListItem = ({
|
|
@@ -22,7 +22,7 @@ const SelectableListItem = ({
|
|
|
22
22
|
icon,
|
|
23
23
|
onPress,
|
|
24
24
|
inverse,
|
|
25
|
-
selected
|
|
25
|
+
selected,
|
|
26
26
|
}: SelectableListProps) => {
|
|
27
27
|
const context = useContext(ThemeCtx);
|
|
28
28
|
const styles = Stylesheet(context, selected, inverse);
|
|
@@ -34,7 +34,13 @@ const SelectableListItem = ({
|
|
|
34
34
|
);
|
|
35
35
|
|
|
36
36
|
return (
|
|
37
|
-
<Pressable
|
|
37
|
+
<Pressable
|
|
38
|
+
onPress={onPress}
|
|
39
|
+
style={[
|
|
40
|
+
styles.container,
|
|
41
|
+
{backgroundColor: selected ? context.colors.main['9'] : undefined},
|
|
42
|
+
]}
|
|
43
|
+
>
|
|
38
44
|
<View style={styles.iconCircle}>
|
|
39
45
|
<View>{inverse ? invertedIcon : icon}</View>
|
|
40
46
|
</View>
|
|
@@ -42,7 +48,9 @@ const SelectableListItem = ({
|
|
|
42
48
|
<View>
|
|
43
49
|
<Heading2
|
|
44
50
|
bold={true}
|
|
45
|
-
textColor={
|
|
51
|
+
textColor={
|
|
52
|
+
selected ? context.colors.main['0'] : context.colors.ui.white
|
|
53
|
+
}
|
|
46
54
|
numberOfLines={2}
|
|
47
55
|
ellipsizeMode={'tail'}
|
|
48
56
|
>
|
|
@@ -50,7 +58,11 @@ const SelectableListItem = ({
|
|
|
50
58
|
</Heading2>
|
|
51
59
|
</View>
|
|
52
60
|
<View>
|
|
53
|
-
<Paragraph
|
|
61
|
+
<Paragraph
|
|
62
|
+
textColor={
|
|
63
|
+
selected ? context.colors.main['1'] : context.colors.ui.lightgrey
|
|
64
|
+
}
|
|
65
|
+
>
|
|
54
66
|
{subtitle}
|
|
55
67
|
</Paragraph>
|
|
56
68
|
</View>
|
|
@@ -1,28 +1,32 @@
|
|
|
1
|
-
export function Stylesheet(
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
export function Stylesheet(
|
|
2
|
+
context: any,
|
|
3
|
+
selected: any,
|
|
4
|
+
inverse: any
|
|
5
|
+
): {
|
|
6
|
+
container: {
|
|
7
|
+
width: '100%';
|
|
8
|
+
flexDirection: 'row';
|
|
9
|
+
alignItems: 'center';
|
|
10
|
+
padding: number;
|
|
11
|
+
borderBottomLeftRadius: number;
|
|
12
|
+
borderBottomRightRadius: number;
|
|
13
|
+
borderTopLeftRadius: number;
|
|
14
|
+
borderTopRightRadius: number;
|
|
15
|
+
};
|
|
16
|
+
iconCircle: {
|
|
17
|
+
justifyContent: 'center';
|
|
18
|
+
alignItems: 'center';
|
|
19
|
+
backgroundColor: any;
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
borderRadius: number;
|
|
23
|
+
marginRight: number;
|
|
24
|
+
};
|
|
25
|
+
textContainer: {
|
|
26
|
+
flex: number;
|
|
27
|
+
flexDirection: 'column';
|
|
28
|
+
justifyContent: 'center';
|
|
29
|
+
paddingTop: number;
|
|
30
|
+
paddingBottom: number;
|
|
31
|
+
};
|
|
28
32
|
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React, {Children, ReactNode, useContext, useRef, useState} from 'react';
|
|
2
|
+
import {ThemeCtx} from '../../../context/theme.context';
|
|
3
|
+
import {Stylesheet} from './swipe.styles';
|
|
4
|
+
import {Icon} from '../../../icons/index';
|
|
5
|
+
import PagerView, {PagerViewOnPageSelectedEvent} from 'react-native-pager-view';
|
|
6
|
+
import {Pressable, View} from 'react-native';
|
|
7
|
+
|
|
8
|
+
type SwipeProps = {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
onIndexChange?: (index: number) => void;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const Swipe = ({children, onIndexChange}: SwipeProps) => {
|
|
14
|
+
const context = useContext(ThemeCtx);
|
|
15
|
+
const styles = Stylesheet();
|
|
16
|
+
const viewPagerRef = useRef<PagerView>(null);
|
|
17
|
+
const [currentPage, setCurrentPage] = useState(0);
|
|
18
|
+
|
|
19
|
+
const count = Children.count(children);
|
|
20
|
+
|
|
21
|
+
if (count > 5) {
|
|
22
|
+
console.warn(' for more then 5 child-components, use another way to show');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const handlePageSelected = (event: PagerViewOnPageSelectedEvent) => {
|
|
26
|
+
const currentIndex = event.nativeEvent.position;
|
|
27
|
+
setCurrentPage(currentIndex);
|
|
28
|
+
|
|
29
|
+
if (onIndexChange) {
|
|
30
|
+
onIndexChange(currentIndex);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<View style={styles.rootContainer}>
|
|
36
|
+
{currentPage !== 0 && (
|
|
37
|
+
<Pressable
|
|
38
|
+
style={styles.leftArrowContainer}
|
|
39
|
+
onPress={() =>
|
|
40
|
+
viewPagerRef.current?.setPage(
|
|
41
|
+
currentPage != 1 ? currentPage - 1 : 0
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
>
|
|
45
|
+
<Icon
|
|
46
|
+
style={'regular'}
|
|
47
|
+
name={'chevron-left'}
|
|
48
|
+
color={context.colors.main['0']}
|
|
49
|
+
/>
|
|
50
|
+
</Pressable>
|
|
51
|
+
)}
|
|
52
|
+
|
|
53
|
+
{currentPage !== count - 1 && (
|
|
54
|
+
<Pressable
|
|
55
|
+
style={styles.rightArrowContainer}
|
|
56
|
+
onPress={() => viewPagerRef.current?.setPage(currentPage + 1)}
|
|
57
|
+
>
|
|
58
|
+
<Icon
|
|
59
|
+
style={'regular'}
|
|
60
|
+
name={'chevron-right'}
|
|
61
|
+
color={context.colors.main['0']}
|
|
62
|
+
/>
|
|
63
|
+
</Pressable>
|
|
64
|
+
)}
|
|
65
|
+
|
|
66
|
+
<PagerView
|
|
67
|
+
ref={viewPagerRef}
|
|
68
|
+
style={styles.swipeContainer}
|
|
69
|
+
initialPage={0}
|
|
70
|
+
collapsable={false}
|
|
71
|
+
onPageSelected={handlePageSelected}
|
|
72
|
+
>
|
|
73
|
+
{children}
|
|
74
|
+
</PagerView>
|
|
75
|
+
</View>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
export {Swipe as Swipe};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, {Children, ReactNode, useContext, useRef, useState} from 'react';
|
|
2
|
+
import { Platform } from 'react-native';
|
|
2
3
|
import {ThemeCtx} from '../../../context/theme.context';
|
|
3
4
|
import {Stylesheet} from './swipe.styles';
|
|
4
5
|
import {Icon} from '../../../icons/index';
|
|
5
|
-
import PagerView, {PagerViewOnPageSelectedEvent} from 'react-native-pager-view';
|
|
6
6
|
import {Pressable, View} from 'react-native';
|
|
7
7
|
|
|
8
8
|
type SwipeProps = {
|
|
@@ -11,68 +11,10 @@ type SwipeProps = {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
const Swipe = ({children, onIndexChange}: SwipeProps) => {
|
|
14
|
-
const context = useContext(ThemeCtx);
|
|
15
|
-
const styles = Stylesheet();
|
|
16
|
-
const viewPagerRef = useRef<PagerView>(null);
|
|
17
|
-
const [currentPage, setCurrentPage] = useState(0);
|
|
18
14
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const handlePageSelected = (event: PagerViewOnPageSelectedEvent) => {
|
|
26
|
-
const currentIndex = event.nativeEvent.position;
|
|
27
|
-
setCurrentPage(currentIndex);
|
|
28
|
-
|
|
29
|
-
if (onIndexChange) {
|
|
30
|
-
onIndexChange(currentIndex);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<View style={styles.rootContainer}>
|
|
36
|
-
{currentPage !== 0 && (
|
|
37
|
-
<Pressable
|
|
38
|
-
style={styles.leftArrowContainer}
|
|
39
|
-
onPress={() =>
|
|
40
|
-
viewPagerRef.current?.setPage(
|
|
41
|
-
currentPage != 1 ? currentPage - 1 : 0
|
|
42
|
-
)
|
|
43
|
-
}
|
|
44
|
-
>
|
|
45
|
-
<Icon
|
|
46
|
-
style={'regular'}
|
|
47
|
-
name={'chevron-left'}
|
|
48
|
-
color={context.colors.main['0']}
|
|
49
|
-
/>
|
|
50
|
-
</Pressable>
|
|
51
|
-
)}
|
|
52
|
-
|
|
53
|
-
{currentPage !== count - 1 && (
|
|
54
|
-
<Pressable
|
|
55
|
-
style={styles.rightArrowContainer}
|
|
56
|
-
onPress={() => viewPagerRef.current?.setPage(currentPage + 1)}
|
|
57
|
-
>
|
|
58
|
-
<Icon
|
|
59
|
-
style={'regular'}
|
|
60
|
-
name={'chevron-right'}
|
|
61
|
-
color={context.colors.main['0']}
|
|
62
|
-
/>
|
|
63
|
-
</Pressable>
|
|
64
|
-
)}
|
|
65
|
-
|
|
66
|
-
<PagerView
|
|
67
|
-
ref={viewPagerRef}
|
|
68
|
-
style={styles.swipeContainer}
|
|
69
|
-
initialPage={0}
|
|
70
|
-
collapsable={false}
|
|
71
|
-
onPageSelected={handlePageSelected}
|
|
72
|
-
>
|
|
73
|
-
{children}
|
|
74
|
-
</PagerView>
|
|
75
|
-
</View>
|
|
76
|
-
);
|
|
15
|
+
const renderChildren = Children.map(children, (child, index) => {
|
|
16
|
+
return child
|
|
17
|
+
});
|
|
18
|
+
return <>{renderChildren ? renderChildren[0] : null}</>;
|
|
77
19
|
};
|
|
78
20
|
export {Swipe as Swipe};
|
|
@@ -40,7 +40,10 @@ export const TimePicker = ({
|
|
|
40
40
|
<View style={styles.rootContainer}>
|
|
41
41
|
<View style={styles.container}>
|
|
42
42
|
<WheelPickerExpo
|
|
43
|
-
items={HOURS.map((value) => ({
|
|
43
|
+
items={HOURS.map((value) => ({
|
|
44
|
+
label: value == '' ? '--' : value,
|
|
45
|
+
value: value,
|
|
46
|
+
}))}
|
|
44
47
|
onChange={({item}) => onChangeHours(item.value)}
|
|
45
48
|
width={Scale.m * 4.5}
|
|
46
49
|
height={320}
|
|
@@ -69,7 +72,10 @@ export const TimePicker = ({
|
|
|
69
72
|
</View>
|
|
70
73
|
<View style={styles.container}>
|
|
71
74
|
<WheelPickerExpo
|
|
72
|
-
items={MINUTES.map((value) => ({
|
|
75
|
+
items={MINUTES.map((value) => ({
|
|
76
|
+
label: value == '' ? '--' : value,
|
|
77
|
+
value: value,
|
|
78
|
+
}))}
|
|
73
79
|
onChange={({item}) => onChangeMinutes(item.value)}
|
|
74
80
|
width={Scale.m * 4.5}
|
|
75
81
|
height={320}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
export function Stylesheet(context: any): {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
2
|
+
rootContainer: {
|
|
3
|
+
flexDirection: 'row';
|
|
4
|
+
alignItems: 'center';
|
|
5
|
+
gap: number;
|
|
6
|
+
};
|
|
7
|
+
container: {
|
|
8
|
+
borderColor: any;
|
|
9
|
+
borderWidth: number;
|
|
10
|
+
borderStyle: 'solid';
|
|
11
|
+
borderRadius: number;
|
|
12
|
+
overflow: 'hidden';
|
|
13
|
+
justifyContent: 'center';
|
|
14
|
+
alignItems: 'center';
|
|
15
|
+
maxHeight: number;
|
|
16
|
+
maxWidth: number;
|
|
17
|
+
};
|
|
18
|
+
text: {
|
|
19
|
+
fontWeight: '200';
|
|
20
|
+
fontSize: number;
|
|
21
|
+
};
|
|
22
|
+
colon: {
|
|
23
|
+
fontWeight: '200';
|
|
24
|
+
lineHeight: number;
|
|
25
|
+
fontSize: number;
|
|
26
|
+
};
|
|
27
27
|
};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
export function Stylesheet(
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
export function Stylesheet(
|
|
2
|
+
context: any,
|
|
3
|
+
disabled: any,
|
|
4
|
+
backgroundColor: any
|
|
5
|
+
): {
|
|
6
|
+
container: {
|
|
7
|
+
width: '100%';
|
|
8
|
+
backgroundColor: any;
|
|
9
|
+
paddingVertical: number;
|
|
10
|
+
paddingHorizontal: number;
|
|
11
|
+
justifyContent: 'center';
|
|
12
|
+
alignItems: 'center';
|
|
13
|
+
borderRadius: number;
|
|
14
|
+
};
|
|
11
15
|
};
|
|
@@ -19,5 +19,5 @@ type ChildListItemProps = {
|
|
|
19
19
|
error: boolean;
|
|
20
20
|
isBirthday?: boolean;
|
|
21
21
|
};
|
|
22
|
-
declare const ChildListItem: React.MemoExoticComponent<({ id, name, department, selectable, isSelected, onPressArrow, onPressText, onLongPress, onSelect, sourceAvatar, textTimeTracker, visualStateTimeTracker, tags, error, isBirthday }: ChildListItemProps) => React.JSX.Element>;
|
|
22
|
+
declare const ChildListItem: React.MemoExoticComponent<({ id, name, department, selectable, isSelected, onPressArrow, onPressText, onLongPress, onSelect, sourceAvatar, textTimeTracker, visualStateTimeTracker, tags, error, isBirthday, }: ChildListItemProps) => React.JSX.Element>;
|
|
23
23
|
export { ChildListItem as ChildListItem };
|
|
@@ -48,7 +48,7 @@ const ChildListItem = React.memo(
|
|
|
48
48
|
visualStateTimeTracker,
|
|
49
49
|
tags,
|
|
50
50
|
error,
|
|
51
|
-
isBirthday
|
|
51
|
+
isBirthday,
|
|
52
52
|
}: ChildListItemProps) => {
|
|
53
53
|
const context = useContext(ThemeCtx);
|
|
54
54
|
const styles = Stylesheet(isSelected, context);
|
|
@@ -72,18 +72,25 @@ const ChildListItem = React.memo(
|
|
|
72
72
|
const textColor = useMemo(() => {
|
|
73
73
|
return isSelected
|
|
74
74
|
? context.colors.ui.white
|
|
75
|
-
: error
|
|
75
|
+
: error
|
|
76
|
+
? context.colors.ui.error.default
|
|
77
|
+
: context.colors.ui.black;
|
|
76
78
|
}, [isSelected, error]);
|
|
77
79
|
|
|
78
|
-
const renderTimeTracker = (
|
|
80
|
+
const renderTimeTracker = (
|
|
81
|
+
textTimeTracker?: string,
|
|
82
|
+
visualStateTimeTracker?: VisualState
|
|
83
|
+
) => {
|
|
79
84
|
if (textTimeTracker && visualStateTimeTracker) {
|
|
80
|
-
return
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
return (
|
|
86
|
+
<TimeTracker
|
|
87
|
+
text={textTimeTracker}
|
|
88
|
+
visualState={visualStateTimeTracker}
|
|
89
|
+
textColor={textColor}
|
|
90
|
+
/>
|
|
91
|
+
);
|
|
85
92
|
}
|
|
86
|
-
}
|
|
93
|
+
};
|
|
87
94
|
|
|
88
95
|
return (
|
|
89
96
|
<View style={styles.container}>
|
|
@@ -108,22 +115,20 @@ const ChildListItem = React.memo(
|
|
|
108
115
|
bold={true}
|
|
109
116
|
numberOfLines={1}
|
|
110
117
|
ellipsizeMode={'tail'}
|
|
111
|
-
textColor={
|
|
112
|
-
textColor
|
|
113
|
-
}
|
|
118
|
+
textColor={textColor}
|
|
114
119
|
>
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
120
|
+
{error ? (
|
|
121
|
+
<Icon
|
|
122
|
+
name="exclamation-circle"
|
|
123
|
+
style="regular"
|
|
124
|
+
color={context.colors.ui.error.default}
|
|
125
|
+
/>
|
|
126
|
+
) : (
|
|
127
|
+
''
|
|
128
|
+
)}
|
|
129
|
+
{error ? ' ' + name : name}
|
|
119
130
|
</Heading2>
|
|
120
|
-
<SmallText
|
|
121
|
-
textColor={
|
|
122
|
-
textColor
|
|
123
|
-
}
|
|
124
|
-
>
|
|
125
|
-
{department}
|
|
126
|
-
</SmallText>
|
|
131
|
+
<SmallText textColor={textColor}>{department}</SmallText>
|
|
127
132
|
</View>
|
|
128
133
|
</View>
|
|
129
134
|
</Pressable>
|
|
@@ -142,9 +147,7 @@ const ChildListItem = React.memo(
|
|
|
142
147
|
)}
|
|
143
148
|
</View>
|
|
144
149
|
{tags && (
|
|
145
|
-
<View
|
|
146
|
-
style={styles.tagContainer}
|
|
147
|
-
>
|
|
150
|
+
<View style={styles.tagContainer}>
|
|
148
151
|
{tags.map((tag) => {
|
|
149
152
|
return (
|
|
150
153
|
<ChildListTag
|
|
@@ -1,54 +1,57 @@
|
|
|
1
|
-
export function Stylesheet(
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
export function Stylesheet(
|
|
2
|
+
isSelectedItem: any,
|
|
3
|
+
context: any
|
|
4
|
+
): {
|
|
5
|
+
container: {
|
|
6
|
+
width: '100%';
|
|
7
|
+
borderTopRightRadius: number;
|
|
8
|
+
borderBottomRightRadius: number;
|
|
9
|
+
borderTopLeftRadius: number;
|
|
10
|
+
borderBottomLeftRadius: number;
|
|
11
|
+
flexDirection: 'column';
|
|
12
|
+
backgroundColor: any;
|
|
13
|
+
};
|
|
14
|
+
innerContainer: {
|
|
15
|
+
flex: number;
|
|
16
|
+
padding: number;
|
|
17
|
+
flexDirection: 'row';
|
|
18
|
+
borderTopRightRadius: number;
|
|
19
|
+
borderBottomRightRadius: number;
|
|
20
|
+
borderTopLeftRadius: number;
|
|
21
|
+
borderBottomLeftRadius: number;
|
|
22
|
+
alignItems: 'center';
|
|
23
|
+
};
|
|
24
|
+
pressableContainer: {
|
|
25
|
+
flex: number;
|
|
26
|
+
flexDirection: 'row';
|
|
27
|
+
alignItems: 'center';
|
|
28
|
+
};
|
|
29
|
+
pressableText: {
|
|
30
|
+
marginLeft: number;
|
|
31
|
+
flex: number;
|
|
32
|
+
};
|
|
33
|
+
iconContainer: {
|
|
34
|
+
alignItems: 'flex-end';
|
|
35
|
+
justifyContent: 'center';
|
|
36
|
+
paddingRight: number;
|
|
37
|
+
width: number;
|
|
38
|
+
height: number;
|
|
39
|
+
borderTopRightRadius: number;
|
|
40
|
+
borderBottomRightRadius: number;
|
|
41
|
+
};
|
|
42
|
+
trackerContainer: {
|
|
43
|
+
flexDirection: 'row';
|
|
44
|
+
alignItems: 'center';
|
|
45
|
+
};
|
|
46
|
+
timeTrackerSpacer: {
|
|
47
|
+
height: number;
|
|
48
|
+
marginBottom: number;
|
|
49
|
+
};
|
|
50
|
+
tagContainer: {
|
|
51
|
+
flexDirection: 'row';
|
|
52
|
+
gap: number;
|
|
53
|
+
flexWrap: 'wrap';
|
|
54
|
+
marginLeft: number;
|
|
55
|
+
marginBottom: number;
|
|
56
|
+
};
|
|
54
57
|
};
|
|
@@ -23,7 +23,7 @@ export const Stylesheet = (isSelectedItem, context) =>
|
|
|
23
23
|
borderBottomRightRadius: Scale.l,
|
|
24
24
|
borderTopLeftRadius: Scale.xxl,
|
|
25
25
|
borderBottomLeftRadius: Scale.xxl,
|
|
26
|
-
alignItems: 'center'
|
|
26
|
+
alignItems: 'center',
|
|
27
27
|
},
|
|
28
28
|
pressableContainer: {
|
|
29
29
|
flex: 1,
|
|
@@ -32,7 +32,7 @@ export const Stylesheet = (isSelectedItem, context) =>
|
|
|
32
32
|
},
|
|
33
33
|
pressableText: {
|
|
34
34
|
marginLeft: Scale.l,
|
|
35
|
-
flex: 1
|
|
35
|
+
flex: 1,
|
|
36
36
|
},
|
|
37
37
|
iconContainer: {
|
|
38
38
|
alignItems: 'flex-end',
|
|
@@ -49,13 +49,13 @@ export const Stylesheet = (isSelectedItem, context) =>
|
|
|
49
49
|
},
|
|
50
50
|
timeTrackerSpacer: {
|
|
51
51
|
height: Scale.s,
|
|
52
|
-
marginBottom: Scale.xxs
|
|
52
|
+
marginBottom: Scale.xxs,
|
|
53
53
|
},
|
|
54
54
|
tagContainer: {
|
|
55
55
|
flexDirection: 'row',
|
|
56
56
|
gap: Scale.s,
|
|
57
57
|
flexWrap: 'wrap',
|
|
58
58
|
marginLeft: Scale.xxxxl,
|
|
59
|
-
marginBottom: Scale.xs
|
|
60
|
-
}
|
|
59
|
+
marginBottom: Scale.xs,
|
|
60
|
+
},
|
|
61
61
|
});
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export function Stylesheet(isBlocked: any): {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
container: {
|
|
3
|
+
width: '100%';
|
|
4
|
+
flexDirection: 'row';
|
|
5
|
+
alignItems: 'center';
|
|
6
|
+
};
|
|
7
|
+
textContainer: {
|
|
8
|
+
flex: number;
|
|
9
|
+
marginLeft: number;
|
|
10
|
+
marginRight: number;
|
|
11
|
+
};
|
|
12
|
+
iconSquare: {
|
|
13
|
+
marginLeft: number;
|
|
14
|
+
};
|
|
15
15
|
};
|