@tactics/toddle-styleguide 1.7.12 → 1.7.14

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.7.12",
3
+ "version": "1.7.14",
4
4
  "main": "index.tsx",
5
5
  "types": "index.d.ts",
6
6
  "prepublish": "tsc",
@@ -1,7 +1,8 @@
1
1
  import * as React from 'react';
2
2
  type InfoProps = {
3
- label: string;
3
+ label?: string;
4
4
  description: string;
5
+ active?: boolean;
5
6
  };
6
- declare const Info: ({ label, description }: InfoProps) => React.JSX.Element;
7
+ declare const Info: ({ label, description, active }: InfoProps) => React.JSX.Element;
7
8
  export { Info as Info };
@@ -8,20 +8,21 @@ import {Heading3} from '../../atoms/heading-components';
8
8
  import {SmallText} from '../../atoms/paragraph-components';
9
9
 
10
10
  type InfoProps = {
11
- label: string;
11
+ label?: string;
12
12
  description: string;
13
+ active?: boolean
13
14
  };
14
15
 
15
- const Info = ({label, description}: InfoProps) => {
16
+ const Info = ({label, description, active}: InfoProps) => {
16
17
  const context = useContext(ThemeCtx);
17
18
  const styles = Stylesheet(context);
18
19
 
19
20
  return (
20
21
  <View style={styles.container}>
21
- <Heading3 bold={true} addStyle={styles.label}>
22
+ {label && <Heading3 bold={true} addStyle={styles.label}>
22
23
  {label}
23
- </Heading3>
24
- <SmallText textColor={context.colors.ui.darkgrey}>
24
+ </Heading3>}
25
+ <SmallText textColor={active !== undefined && active === false ? context.colors.ui.grey : context.colors.ui.darkgrey}>
25
26
  {description}
26
27
  </SmallText>
27
28
  </View>
@@ -10,12 +10,20 @@ export const InfoPreview = ({}: {}) => {
10
10
  alignItems: 'center',
11
11
  justifyContent: 'center',
12
12
  backgroundColor: 'white',
13
+ gap: 16,
13
14
  }}
14
15
  >
15
16
  <Info
16
17
  label={'Mijn Gezin'}
17
18
  description={'Volg hier de dag van uw kinderen'}
18
19
  />
20
+ <Info
21
+ description={'Luca was heel de dag wat flauw en voelde zich niet lekker. Mama is haar vroeger komen halen.'}
22
+ />
23
+ <Info
24
+ active={false}
25
+ description={'Geen opmerking voor deze dag.'}
26
+ />
19
27
  </View>
20
28
  );
21
29
  };
@@ -1,10 +1,12 @@
1
- import React from 'react';
1
+ import React, { useState } from 'react';
2
2
  import {SelectableListItem} from './selectable-list-item.component';
3
3
  import {Icon} from '../../../icons/index';
4
4
 
5
5
  const {View} = require('react-native');
6
6
 
7
7
  export const SelectableListItemPreview = ({}: {}) => {
8
+ const [selected, setSelected] = useState(false);
9
+
8
10
  return (
9
11
  <View
10
12
  style={{
@@ -18,31 +20,31 @@ export const SelectableListItemPreview = ({}: {}) => {
18
20
  title="Vlindertjes VlindertjesVlindertjesVlindertjesVlindertjes"
19
21
  subtitle={'Leeftijd 2 tot 4 jaar'}
20
22
  icon={<Icon style={'regular'} name={'user-group'} size={27} />}
21
- onPress={() => console.log('clicked')}
22
- selected={false}
23
+ onPress={() => setSelected(!selected)}
24
+ selected={selected}
23
25
  />
24
26
  <SelectableListItem
25
27
  title="Vlindertjes"
26
28
  subtitle={'Leeftijd 2 tot 4 jaar'}
27
29
  icon={<Icon style={'regular'} name={'office-building'} size={27} />}
28
30
  inverse={true}
29
- onPress={() => console.log('clicked')}
30
- selected={false}
31
+ onPress={() => setSelected(!selected)}
32
+ selected={selected}
31
33
  />
32
34
  <SelectableListItem
33
35
  title="Vlindertjes VlindertjesVlindertjesVlindertjesVlindertjes"
34
36
  subtitle={'Leeftijd 2 tot 4 jaar'}
35
37
  icon={<Icon style={'regular'} name={'user-group'} size={27} />}
36
- onPress={() => console.log('clicked')}
37
- selected={true}
38
+ onPress={() => setSelected(!selected)}
39
+ selected={selected}
38
40
  />
39
41
  <SelectableListItem
40
42
  title="Vlindertjes"
41
43
  subtitle={'Leeftijd 2 tot 4 jaar'}
42
44
  icon={<Icon style={'regular'} name={'office-building'} size={27} />}
43
45
  inverse={true}
44
- onPress={() => console.log('clicked')}
45
- selected={true}
46
+ onPress={() => setSelected(!selected)}
47
+ selected={selected}
46
48
  />
47
49
  </View>
48
50
  );
@@ -34,7 +34,7 @@ const SelectableListItem = ({
34
34
  );
35
35
 
36
36
  return (
37
- <Pressable onPress={onPress} style={styles.container}>
37
+ <Pressable onPress={onPress} style={[styles.container, {backgroundColor: selected ? context.colors.main['9'] : undefined}]}>
38
38
  <View style={styles.iconCircle}>
39
39
  <View>{inverse ? invertedIcon : icon}</View>
40
40
  </View>
@@ -1,13 +1,12 @@
1
- export function Stylesheet(context: any, selected: any, inverse: any): StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
1
+ export function Stylesheet(context: any, selected: any, inverse: any): {
2
2
  container: {
3
3
  width: "100%";
4
4
  flexDirection: "row";
5
5
  alignItems: "center";
6
- backgroundColor: any;
7
6
  padding: number;
8
- borderBottomLeftRadius: string;
7
+ borderBottomLeftRadius: number;
9
8
  borderBottomRightRadius: number;
10
- borderTopLeftRadius: string;
9
+ borderTopLeftRadius: number;
11
10
  borderTopRightRadius: number;
12
11
  };
13
12
  iconCircle: {
@@ -26,5 +25,4 @@ export function Stylesheet(context: any, selected: any, inverse: any): StyleShee
26
25
  paddingTop: number;
27
26
  paddingBottom: number;
28
27
  };
29
- }>;
30
- import { StyleSheet } from 'react-native';
28
+ };
@@ -7,11 +7,10 @@ export const Stylesheet = (context, selected, inverse) =>
7
7
  width: '100%',
8
8
  flexDirection: 'row',
9
9
  alignItems: 'center',
10
- backgroundColor: selected ? context.colors.main['9'] : 'none',
11
10
  padding: Scale.xxs,
12
- borderBottomLeftRadius: '50%',
11
+ borderBottomLeftRadius: 65 / 2,
13
12
  borderBottomRightRadius: Scale.m,
14
- borderTopLeftRadius: '50%',
13
+ borderTopLeftRadius: 65 / 2,
15
14
  borderTopRightRadius: Scale.m,
16
15
  },
17
16
  iconCircle: {