@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tactics/toddle-styleguide",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "main": "index.tsx",
5
5
  "types": "index.d.ts",
6
6
  "prepublish": "tsc",
@@ -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, TinyText} from '../../atoms/paragraph-components';
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 ? context.colors.ui.white : context.colors.ui.black;
70
- }, [isSelected]);
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
- isSelected ? context.colors.ui.white : context.colors.ui.black
109
+ textColor
106
110
  }
107
111
  >
108
112
  {name}
109
113
  </Heading2>
110
114
  <SmallText
111
115
  textColor={
112
- isSelected ? context.colors.ui.white : context.colors.ui.black
116
+ textColor
113
117
  }
114
118
  >
115
119
  {department}
@@ -71,6 +71,7 @@ export const ChildListItemPreview = ({}: {}) => {
71
71
  // sourceAvatar={require('./../../../../assets/components/avatar/baby.png')}
72
72
  sourceAvatar={Initials.for('Zeno', 'Driesen')}
73
73
  tags={item.tags}
74
+ error={true}
74
75
  />
75
76
  );
76
77
  };
@@ -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
  };
@@ -39,6 +39,7 @@ export const Stylesheet = (isSelectedItem, context) =>
39
39
  justifyContent: 'center',
40
40
  paddingRight: Scale.xs,
41
41
  width: Scale.m * 3,
42
+ height: Scale.m * 3,
42
43
  borderTopRightRadius: Scale.l,
43
44
  borderBottomRightRadius: Scale.l,
44
45
  },
@@ -30,7 +30,7 @@ export const Modal = ({
30
30
  return () => subscription?.remove();
31
31
  });
32
32
 
33
- const maxHeight = Math.round(windowHeight / 100) * 80;
33
+ const maxHeight = Math.round(windowHeight / 100) * 90;
34
34
 
35
35
  const styles = Stylesheet();
36
36
 
@@ -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) * 80;
38
+ const maxHeight = Math.round(windowHeight / 100) * 90;
39
39
  const translateYStartingPoint = windowHeight;
40
40
 
41
41
  const saveHeight = elementHeight > maxHeight ? maxHeight : elementHeight;