@quintype/native-components 2.20.23 → 2.20.25

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/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [2.20.25](https://github.com/quintype/native-components/compare/v2.20.24...v2.20.25) (2024-03-14)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **text-clip:** Bump lineheight for HTML story-content ([91f6279](https://github.com/quintype/native-components/commit/91f6279ca2815bf48bddcf0eb03020351bde8666))
11
+
12
+ ### [2.20.24](https://github.com/quintype/native-components/compare/v2.20.23...v2.20.24) (2024-03-13)
13
+
5
14
  ### [2.20.23](https://github.com/quintype/native-components/compare/v2.20.22...v2.20.23) (2024-03-11)
6
15
 
7
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/native-components",
3
- "version": "2.20.23",
3
+ "version": "2.20.25",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -6,24 +6,31 @@ import { TouchableOpacity } from 'react-native-gesture-handler';
6
6
  import { AppTheme } from '../../utils';
7
7
  import { Text } from '../Text';
8
8
  import { styles } from './styles';
9
+ import Icon from "react-native-vector-icons/FontAwesome5";
9
10
 
10
11
  export const References = ({
11
12
  card, referenceNameTestId, referenceDescTestID, referenceContainerTestID,
12
13
  }) => {
13
14
  const reference = get(card, ['story-elements', 0, 'metadata'], {});
14
15
  const { theme } = useContext(AppTheme);
15
- const { COLORS, FONT_SIZE } = theme;
16
- const referenceStyles = styles(COLORS, FONT_SIZE);
16
+ const { COLORS, FONT_SIZE, FONT_FAMILY } = theme;
17
+ const referenceStyles = styles(COLORS, FONT_SIZE, FONT_FAMILY);
17
18
 
18
19
  const onPressHandler = () => Linking.openURL(reference?.url);
19
20
 
20
21
  return (
21
22
  <TouchableOpacity onPress={onPressHandler}>
22
23
  <View style={referenceStyles.container} testID={referenceContainerTestID}>
24
+ <View>
25
+ <View style={referenceStyles.topSubContainer}>
26
+ <Icon name={'external-link-alt'} size={FONT_SIZE.h2} style={referenceStyles.iconStyle} testID="referenceStoryIcon" />
27
+ <Text style={referenceStyles.referenceText}>{'REFERENCE'}</Text>
28
+ </View>
23
29
  <Text style={referenceStyles.name} testID={referenceNameTestId}>
24
30
  {reference?.name}
25
31
  </Text>
26
32
  {reference.description && <Text style={referenceStyles.description} testID={referenceDescTestID}>{reference.description}</Text>}
33
+ </View>
27
34
  </View>
28
35
  </TouchableOpacity>
29
36
 
@@ -1,22 +1,45 @@
1
1
  import { StyleSheet } from 'react-native';
2
+ import { hexToRgb } from '../../utils/colorUtils';
2
3
 
3
- export const styles = (COLORS, FONT_SIZE) => StyleSheet.create({
4
+ export const styles = (COLORS, FONT_SIZE, FONT_FAMILY) => StyleSheet.create({
4
5
  container: {
5
- paddingHorizontal: 30,
6
+ paddingHorizontal: 20,
6
7
  marginHorizontal: 30,
7
8
  marginVertical: 5,
8
- backgroundColor: COLORS.MONO5,
9
+ backgroundColor: hexToRgb(COLORS.BRAND_1,0.1),
9
10
  borderRadius: 5,
10
11
  paddingVertical: 15,
11
12
  display: 'flex',
12
- justifyContent: 'center',
13
- alignItems: 'center',
13
+ minHeight: 200,
14
+ borderColor: COLORS.BRAND_1,
15
+ borderWidth:0.2
14
16
  },
15
17
  name: {
16
- fontSize: FONT_SIZE.h3,
18
+ fontSize: FONT_SIZE.h1,
17
19
  fontWeight: 'bold',
20
+ marginTop:15,
21
+ textDecorationLine:'underline',
22
+ lineHeight:24,
23
+ color:COLORS.BRAND_1,
24
+ fontFamily:FONT_FAMILY.primaryBold
18
25
  },
19
26
  description: {
20
- fontSize: FONT_SIZE.h4,
27
+ fontSize: FONT_SIZE.h2,
28
+ color:COLORS.BRAND_1,
29
+ marginTop:10,
30
+ fontFamily: FONT_FAMILY.secondary
21
31
  },
32
+ referenceText: {
33
+ marginLeft:5,
34
+ fontWeight:'700',
35
+ fontSize: FONT_SIZE.h3
36
+ },
37
+ topSubContainer:{
38
+ display: 'flex',
39
+ flex:1,
40
+ flexDirection:'row'
41
+ },
42
+ iconStyle:{
43
+ color: COLORS.BRAND_1
44
+ }
22
45
  });
@@ -21,13 +21,13 @@ export const customHTMLStyles = () => {
21
21
  marginTop: 7,
22
22
  marginBottom: 7,
23
23
  fontSize: FONT_SIZE.p1,
24
- lineHeight: FONT_SIZE.p1 * 1.5,
24
+ lineHeight: FONT_SIZE.p1 * 1.7,
25
25
  color: COLORS.BRAND_BLACK,
26
26
  opacity: 0.85,
27
27
  },
28
28
  li: {
29
29
  fontSize: FONT_SIZE.h3,
30
- lineHeight: FONT_SIZE.h3 * 1.3,
30
+ lineHeight: FONT_SIZE.h3 * 1.5,
31
31
  marginTop: 8,
32
32
  color: COLORS.BRAND_BLACK,
33
33
  opacity: 0.85,
@@ -50,25 +50,26 @@ export const customHTMLStyles = () => {
50
50
  marginTop: 7,
51
51
  marginBottom: 7,
52
52
  fontSize: FONT_SIZE.p1,
53
- lineHeight: FONT_SIZE.p1 * 1.5,
53
+ lineHeight: FONT_SIZE.p1 * 1.7,
54
54
  color: COLORS.HYPERLINK_COLOR || COLORS.BRAND_BLACK,
55
55
  },
56
56
  h: {
57
57
  fontFamily: FONT_FAMILY.secondaryBold,
58
58
  fontWeight: 'normal',
59
- marginTop: 16,
59
+ marginTop: 12,
60
60
  marginRight: 4,
61
+ lineHeight: FONT_SIZE.h1 * 2,
61
62
  color: COLORS.BRAND_BLACK,
62
63
  opacity: 0.85,
63
64
  },
64
65
  sup: {
65
66
  marginBottom: 16,
66
- lineHeight: FONT_SIZE.p1 * 0.3,
67
+ lineHeight: FONT_SIZE.p1 * 0.5,
67
68
  fontSize: FONT_SIZE.p1 * 0.5,
68
69
  },
69
70
  sub: {
70
71
  marginBottom: 16,
71
- lineHeight: FONT_SIZE.p1 * 0.3,
72
+ lineHeight: FONT_SIZE.p1 * 0.5,
72
73
  fontSize: FONT_SIZE.p1 * 0.5,
73
74
  },
74
75
  };
@@ -0,0 +1,8 @@
1
+ export const hexToRgb = (hex, alpha=1) => {
2
+ let rgbCode = hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(m, r, g, b) => '#' + r + r + g + g + b + b)
3
+ .substring(1).match(/.{2}/g)
4
+ .map(x => parseInt(x, 16));
5
+ console.log('risi - color', `rgb(${rgbCode[0]}, ${rgbCode[1]}, ${rgbCode[2]}, ${alpha})`)
6
+ return `rgba(${rgbCode[0]}, ${rgbCode[1]}, ${rgbCode[2]}, ${alpha})`;
7
+ }
8
+