@widergy/mobile-ui 1.14.4 → 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,10 @@
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
+
1
8
  ## [1.14.4](https://github.com/widergy/mobile-ui/compare/v1.14.3...v1.14.4) (2024-07-26)
2
9
 
3
10
 
@@ -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
  });
@@ -87,7 +87,12 @@ const UTHeader = ({ tagline, title, subtitle, requiredFieldInfo, helpText, useMa
87
87
  {!!requiredFieldInfo && RequiredFieldInfo}
88
88
  {!!helpText && HelpText}
89
89
  {banner?.text && (
90
- <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
+ />
91
96
  )}
92
97
  </View>
93
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>
@@ -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.4",
5
+ "version": "1.14.5",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [