@widergy/mobile-ui 1.14.3 → 1.14.5

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
@@ -1,3 +1,17 @@
1
+ ## [1.14.5](https://github.com/widergy/mobile-ui/compare/v1.14.4...v1.14.5) (2024-07-26)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * utbanner with markdown ([#323](https://github.com/widergy/mobile-ui/issues/323)) ([b2139da](https://github.com/widergy/mobile-ui/commit/b2139da64fb3121fa0a898d9310e01d375248302))
7
+
8
+ ## [1.14.4](https://github.com/widergy/mobile-ui/compare/v1.14.3...v1.14.4) (2024-07-26)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * utlabel in header and utmodal visual fixes ([#318](https://github.com/widergy/mobile-ui/issues/318)) ([38c70a9](https://github.com/widergy/mobile-ui/commit/38c70a955814d49ae7ef2e303d4cf351ca3be1fe))
14
+
1
15
  ## [1.14.3](https://github.com/widergy/mobile-ui/compare/v1.14.2...v1.14.3) (2024-07-23)
2
16
 
3
17
 
@@ -1,42 +1,33 @@
1
1
  import React from 'react';
2
2
  import { View } from 'react-native';
3
- import { shape, string } from 'prop-types';
3
+ import { bool, shape, string } from 'prop-types';
4
4
  import _ from 'lodash';
5
5
 
6
- import Icon from '../Icon';
7
- import Label from '../Label';
6
+ import UTIcon from '../UTIcon';
7
+ import UTLabel from '../UTLabel';
8
8
  import { useTheme } from '../../theming';
9
9
 
10
10
  import ownStyles from './styles';
11
11
 
12
- const UTBanner = ({ text, icon, style }) => {
12
+ const UTBanner = ({ text, icon, style, withMarkdown }) => {
13
13
  const theme = useTheme();
14
14
 
15
- const ICON_SIZE = 24;
16
-
17
15
  const themedStyles = _.merge({}, ownStyles, theme?.UTBanner, style);
18
16
 
19
17
  return (
20
18
  <View style={themedStyles.banner}>
21
- {icon && (
22
- <Icon
23
- name={icon.name}
24
- type={icon.type}
25
- size={ICON_SIZE}
26
- height={ICON_SIZE}
27
- width={ICON_SIZE}
28
- color={theme.UTBanner?.iconColor}
29
- style={ownStyles.icon}
30
- />
31
- )}
32
- <Label>{text}</Label>
19
+ {icon && <UTIcon name={icon.name} colorTheme={icon.colorTheme} style={ownStyles.icon} />}
20
+ <UTLabel withMarkdown={withMarkdown} style={ownStyles.text}>
21
+ {text}
22
+ </UTLabel>
33
23
  </View>
34
24
  );
35
25
  };
36
26
 
37
27
  UTBanner.propTypes = {
38
- icon: shape({ name: string, type: string }),
39
- text: string
28
+ icon: shape({ name: string, colorTheme: string }),
29
+ text: string,
30
+ withMarkdown: bool
40
31
  };
41
32
 
42
33
  export default UTBanner;
@@ -4,11 +4,13 @@ export default StyleSheet.create({
4
4
  banner: {
5
5
  backgroundColor: '#F4F5F7',
6
6
  borderRadius: 8,
7
- display: 'flex',
8
7
  flexDirection: 'row',
9
8
  padding: 16
10
9
  },
11
10
  icon: {
12
11
  marginRight: 16
12
+ },
13
+ text: {
14
+ flex: 1
13
15
  }
14
16
  });
@@ -3,7 +3,7 @@ import { View } from 'react-native';
3
3
  import { string, bool, shape } from 'prop-types';
4
4
  import merge from 'lodash/merge';
5
5
 
6
- import Label from '../Label';
6
+ import UTLabel from '../UTLabel';
7
7
  import UTBanner from '../UTBanner';
8
8
  import { useTheme } from '../../theming';
9
9
 
@@ -18,54 +18,63 @@ const UTHeader = ({ tagline, title, subtitle, requiredFieldInfo, helpText, useMa
18
18
 
19
19
  const Tagline = renderComponent(
20
20
  tagline,
21
- <Label
22
- color={themedStyles.taglineColor || theme.colors.disabled}
23
- bold
24
- useMarkdown={useMarkdown}
21
+ <UTLabel
22
+ variant="small"
23
+ weight="medium"
24
+ colorTheme={themedStyles.taglineColor || 'gray'}
25
+ withMarkdown={useMarkdown}
25
26
  style={[themedStyles.child, themedStyles.tagline]}
26
27
  >
27
28
  {tagline?.toUpperCase?.()}
28
- </Label>
29
+ </UTLabel>
29
30
  );
30
31
 
31
32
  const Title = renderComponent(
32
33
  title,
33
- <Label color={themedStyles.titleColor} big bold style={themedStyles.title} useMarkdown={useMarkdown}>
34
+ <UTLabel
35
+ variant="title3"
36
+ weight="medium"
37
+ colorTheme={themedStyles.titleColor}
38
+ style={themedStyles.title}
39
+ withMarkdown={useMarkdown}
40
+ >
34
41
  {title}
35
- </Label>
42
+ </UTLabel>
36
43
  );
37
44
 
38
45
  const Subtitle = renderComponent(
39
46
  subtitle,
40
- <Label
41
- color={themedStyles.subtitleColor || theme.colors.disabled}
42
- useMarkdown={useMarkdown}
47
+ <UTLabel
48
+ colorTheme={themedStyles.subtitleColor || 'gray'}
49
+ withMarkdown={useMarkdown}
43
50
  style={[themedStyles.child, themedStyles.subtitle]}
44
51
  >
45
52
  {subtitle}
46
- </Label>
53
+ </UTLabel>
47
54
  );
48
55
 
49
56
  const RequiredFieldInfo = renderComponent(
50
57
  requiredFieldInfo,
51
- <Label
52
- color={themedStyles.requiredFieldInfoColor || theme.colors.disabled}
53
- useMarkdown={useMarkdown}
58
+ <UTLabel
59
+ variant="small"
60
+ colorTheme={themedStyles.requiredFieldInfoColor || 'gray'}
61
+ withMarkdown={useMarkdown}
54
62
  style={[themedStyles.child, themedStyles.requiredFieldInfo]}
55
63
  >
56
64
  {requiredFieldInfo}
57
- </Label>
65
+ </UTLabel>
58
66
  );
59
67
 
60
68
  const HelpText = renderComponent(
61
69
  helpText,
62
- <Label
63
- color={themedStyles.helpTextColor || theme.colors.disabled}
64
- useMarkdown={useMarkdown}
70
+ <UTLabel
71
+ variant="small"
72
+ colorTheme={themedStyles.helpTextColor || theme.colors.disabled}
73
+ withMarkdown={useMarkdown}
65
74
  style={[themedStyles.child, themedStyles.helpText]}
66
75
  >
67
76
  {helpText}
68
- </Label>
77
+ </UTLabel>
69
78
  );
70
79
 
71
80
  return (
@@ -78,7 +87,12 @@ const UTHeader = ({ tagline, title, subtitle, requiredFieldInfo, helpText, useMa
78
87
  {!!requiredFieldInfo && RequiredFieldInfo}
79
88
  {!!helpText && HelpText}
80
89
  {banner?.text && (
81
- <UTBanner text={banner.text} icon={banner.icon} style={{ banner: themedStyles.child }} />
90
+ <UTBanner
91
+ text={banner.text}
92
+ icon={banner.icon}
93
+ style={{ banner: themedStyles.child }}
94
+ withMarkdown={banner.withMarkdown}
95
+ />
82
96
  )}
83
97
  </View>
84
98
  );
@@ -37,7 +37,7 @@ const UTLabel = ({
37
37
  <LabelRenderer
38
38
  {...additionalProps}
39
39
  rules={markdownRenderers}
40
- style={withMarkdown ? { body: labelStyles } : labelStyles}
40
+ style={withMarkdown ? { body: labelStyles, paragraph: { marginTop: 0, marginBottom: 0 } } : labelStyles}
41
41
  >
42
42
  {withMarkdown ? markdownFormat(children) : children}
43
43
  </LabelRenderer>
@@ -1,6 +1,6 @@
1
1
  import { StyleSheet } from 'react-native';
2
2
 
3
- import { verticalScale, moderateHorizontalScale, WINDOW_WIDTH, WINDOW_HEIGHT } from '../../utils/scaleUtils';
3
+ import { verticalScale, moderateHorizontalScale, WINDOW_HEIGHT } from '../../utils/scaleUtils';
4
4
  import { DEFAULT_ICON_SIZE } from '../Icon/constants';
5
5
  import { ICON_MARGIN } from '../IconButton/styles';
6
6
 
@@ -9,13 +9,13 @@ export default StyleSheet.create({
9
9
  flexDirection: 'row',
10
10
  alignItems: 'center',
11
11
  marginVertical: verticalScale(4),
12
- width: '95%'
12
+ width: '100%'
13
13
  },
14
14
  modalBackground: {
15
15
  backgroundColor: 'rgba(0, 0, 0, 0.1)',
16
16
  flex: 1,
17
17
  justifyContent: 'center',
18
- padding: 15
18
+ padding: 16
19
19
  },
20
20
  childView: {
21
21
  flex: 1
@@ -25,14 +25,13 @@ export default StyleSheet.create({
25
25
  borderRadius: 15,
26
26
  alignItems: 'stretch',
27
27
  alignSelf: 'center',
28
- width: WINDOW_WIDTH * 0.78
28
+ width: '100%'
29
29
  },
30
30
  buttonsContainer: {
31
31
  flexDirection: 'row',
32
32
  justifyContent: 'flex-end',
33
33
  alignItems: 'center',
34
- paddingVertical: 20,
35
- paddingHorizontal: 15
34
+ padding: 16
36
35
  },
37
36
  viewContainer: {
38
37
  flex: 1
@@ -55,7 +54,7 @@ export default StyleSheet.create({
55
54
  margin: 0
56
55
  },
57
56
  content: {
58
- padding: 15,
57
+ padding: 16,
59
58
  paddingBottom: 5
60
59
  },
61
60
  closeIcon: {
@@ -44,7 +44,7 @@ const UTWorkflowContainer = ({
44
44
  const themedStyles = merge({}, ownStyles, theme?.UTWorkflowContainer, style);
45
45
 
46
46
  return (
47
- <View style={[themedStyles.container, themedStyles.topSafeArea(topSafeArea)]}>
47
+ <View style={[themedStyles.container, topbar && themedStyles.topSafeArea(topSafeArea)]}>
48
48
  {topbar && <UTTopbar {...{ currentStage, currentStep, stages, stepsCount, theme, topbar }} />}
49
49
  <ScrollView
50
50
  contentContainerStyle={themedStyles.content}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@widergy/mobile-ui",
3
3
  "description": "Widergy Mobile Components",
4
4
  "author": "widergy",
5
- "version": "1.14.3",
5
+ "version": "1.14.5",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [