@tactics/toddle-styleguide 1.6.0 → 1.7.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/package.json +1 -1
- package/src/components/organisms/child-list-item/child-list-item.component.d.ts +2 -1
- package/src/components/organisms/child-list-item/child-list-item.component.tsx +10 -6
- package/src/components/organisms/child-list-item/child-list-item.preview.tsx +1 -0
- package/src/components/organisms/child-list-item/child-list-item.styles.d.ts +2 -0
- package/src/components/organisms/child-list-item/child-list-item.styles.js +1 -0
- package/src/components/templates/modal/modal.component.tsx +1 -1
- package/src/components/templates/popover/components/modal/modal.component.tsx +1 -1
package/package.json
CHANGED
|
@@ -16,6 +16,7 @@ type ChildListItemProps = {
|
|
|
16
16
|
textTimeTracker?: string;
|
|
17
17
|
visualStateTimeTracker?: VisualState;
|
|
18
18
|
tags?: string[];
|
|
19
|
+
error: boolean;
|
|
19
20
|
};
|
|
20
|
-
declare const ChildListItem: React.MemoExoticComponent<({ id, name, department, selectable, isSelected, onPressArrow, onPressText, onLongPress, onSelect, sourceAvatar, textTimeTracker, visualStateTimeTracker, tags, }: ChildListItemProps) => React.JSX.Element>;
|
|
21
|
+
declare const ChildListItem: React.MemoExoticComponent<({ id, name, department, selectable, isSelected, onPressArrow, onPressText, onLongPress, onSelect, sourceAvatar, textTimeTracker, visualStateTimeTracker, tags, error }: ChildListItemProps) => React.JSX.Element>;
|
|
21
22
|
export { ChildListItem as ChildListItem };
|
|
@@ -8,7 +8,7 @@ import {Size} from '../../../types/size.enum';
|
|
|
8
8
|
import {VisualState} from '../../../types/visual-state.enum';
|
|
9
9
|
import {Avatar} from '../../molecules/avatar/avatar.component';
|
|
10
10
|
import {Stylesheet} from './child-list-item.styles';
|
|
11
|
-
import {SmallText
|
|
11
|
+
import {SmallText} from '../../atoms/paragraph-components';
|
|
12
12
|
import {Heading2} from '../../atoms/heading-components';
|
|
13
13
|
import {TimeTracker} from '../../molecules/time-tracker/time-tracker.component';
|
|
14
14
|
import {Icon} from '../../../icons/index';
|
|
@@ -28,6 +28,7 @@ type ChildListItemProps = {
|
|
|
28
28
|
textTimeTracker?: string;
|
|
29
29
|
visualStateTimeTracker?: VisualState;
|
|
30
30
|
tags?: string[];
|
|
31
|
+
error: boolean;
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
const ChildListItem = React.memo(
|
|
@@ -45,6 +46,7 @@ const ChildListItem = React.memo(
|
|
|
45
46
|
textTimeTracker,
|
|
46
47
|
visualStateTimeTracker,
|
|
47
48
|
tags,
|
|
49
|
+
error
|
|
48
50
|
}: ChildListItemProps) => {
|
|
49
51
|
const context = useContext(ThemeCtx);
|
|
50
52
|
const styles = Stylesheet(isSelected, context);
|
|
@@ -66,8 +68,10 @@ const ChildListItem = React.memo(
|
|
|
66
68
|
}, [id, onLongPress]);
|
|
67
69
|
|
|
68
70
|
const textColor = useMemo(() => {
|
|
69
|
-
return isSelected
|
|
70
|
-
|
|
71
|
+
return isSelected
|
|
72
|
+
? context.colors.ui.white
|
|
73
|
+
: error ? context.colors.ui.error.default : context.colors.ui.black;
|
|
74
|
+
}, [isSelected, error]);
|
|
71
75
|
|
|
72
76
|
const renderTimeTracker = (textTimeTracker?: string, visualStateTimeTracker?: VisualState) => {
|
|
73
77
|
if (textTimeTracker && visualStateTimeTracker) {
|
|
@@ -83,7 +87,7 @@ const ChildListItem = React.memo(
|
|
|
83
87
|
<View style={styles.container}>
|
|
84
88
|
<View style={styles.pressableContainer}>
|
|
85
89
|
<Pressable
|
|
86
|
-
onPress={onPressSelectable}
|
|
90
|
+
onPress={!error ? onPressSelectable : null}
|
|
87
91
|
style={styles.innerContainer}
|
|
88
92
|
onLongPress={onLongPressCallback}
|
|
89
93
|
>
|
|
@@ -102,14 +106,14 @@ const ChildListItem = React.memo(
|
|
|
102
106
|
numberOfLines={1}
|
|
103
107
|
ellipsizeMode={'tail'}
|
|
104
108
|
textColor={
|
|
105
|
-
|
|
109
|
+
textColor
|
|
106
110
|
}
|
|
107
111
|
>
|
|
108
112
|
{name}
|
|
109
113
|
</Heading2>
|
|
110
114
|
<SmallText
|
|
111
115
|
textColor={
|
|
112
|
-
|
|
116
|
+
textColor
|
|
113
117
|
}
|
|
114
118
|
>
|
|
115
119
|
{department}
|
|
@@ -32,6 +32,7 @@ export function Stylesheet(isSelectedItem: any, context: any): {
|
|
|
32
32
|
justifyContent: "center";
|
|
33
33
|
paddingRight: number;
|
|
34
34
|
width: number;
|
|
35
|
+
height: number;
|
|
35
36
|
borderTopRightRadius: number;
|
|
36
37
|
borderBottomRightRadius: number;
|
|
37
38
|
};
|
|
@@ -48,5 +49,6 @@ export function Stylesheet(isSelectedItem: any, context: any): {
|
|
|
48
49
|
gap: number;
|
|
49
50
|
flexWrap: "wrap";
|
|
50
51
|
marginLeft: number;
|
|
52
|
+
marginBottom: number;
|
|
51
53
|
};
|
|
52
54
|
};
|
|
@@ -35,7 +35,7 @@ const Modal = ({
|
|
|
35
35
|
|
|
36
36
|
const elementHeight = Math.round(elementSize.height);
|
|
37
37
|
|
|
38
|
-
const maxHeight = Math.round(windowHeight / 100) *
|
|
38
|
+
const maxHeight = Math.round(windowHeight / 100) * 90;
|
|
39
39
|
const translateYStartingPoint = windowHeight;
|
|
40
40
|
|
|
41
41
|
const saveHeight = elementHeight > maxHeight ? maxHeight : elementHeight;
|