@widergy/mobile-ui 1.13.0 → 1.13.1

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.13.1](https://github.com/widergy/mobile-ui/compare/v1.13.0...v1.13.1) (2024-07-12)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * utbutton for workflow summary and bottom actions ([#313](https://github.com/widergy/mobile-ui/issues/313)) ([54cf399](https://github.com/widergy/mobile-ui/commit/54cf399163784402c6545f15921ac7d30cbda89d))
7
+
1
8
  # [1.13.0](https://github.com/widergy/mobile-ui/compare/v1.12.7...v1.13.0) (2024-07-11)
2
9
 
3
10
 
@@ -12,7 +12,7 @@ const UTLoading = props => {
12
12
  UTLoading.displayName = 'UTLoading';
13
13
 
14
14
  UTLoading.propTypes = {
15
- useUtilityLoader: bool
15
+ useUtilityLoading: bool
16
16
  };
17
17
 
18
18
  export default UTLoading;
@@ -3,27 +3,26 @@ import { string, func, bool } from 'prop-types';
3
3
  import { View } from 'react-native';
4
4
  import merge from 'lodash/merge';
5
5
 
6
- import Button from '../../../../../../../Button';
6
+ import UTButton from '../../../../../../../UTButton';
7
7
  import { useTheme } from '../../../../../../../../theming';
8
8
 
9
9
  import ownStyles from './styles';
10
10
 
11
- const ActionButton = ({ hidden, disabled, onPress, label, mode, style }) => {
11
+ const ActionButton = ({ hidden, disabled, onPress, label, variant, style }) => {
12
12
  const theme = useTheme();
13
13
  const themedStyles = merge({}, ownStyles, theme?.UTWorkflowContainer?.actionButton, style);
14
14
 
15
15
  return (
16
16
  <View style={themedStyles.actionButton}>
17
- <Button
18
- containerStyle={themedStyles.buttonContainer}
19
- contentStyle={themedStyles.buttonContent}
17
+ <UTButton
20
18
  disabled={disabled || hidden}
21
- elevation={themedStyles.elevation}
22
- lowerCase
23
- mode={mode}
24
19
  onPress={onPress}
25
- title={label}
26
- />
20
+ size="large"
21
+ style={{ root: themedStyles.buttonContainer, childrenContainer: themedStyles.buttonContent }}
22
+ variant={variant}
23
+ >
24
+ {label}
25
+ </UTButton>
27
26
  </View>
28
27
  );
29
28
  };
@@ -32,7 +31,7 @@ ActionButton.propTypes = {
32
31
  disabled: bool,
33
32
  hidden: bool,
34
33
  label: string,
35
- mode: string,
34
+ variant: string,
36
35
  onPress: func
37
36
  };
38
37
 
@@ -5,6 +5,6 @@ export default StyleSheet.create({
5
5
  flexGrow: 1
6
6
  },
7
7
  buttonContainer: {
8
- width: '100%'
8
+ alignItems: 'center'
9
9
  }
10
10
  });
@@ -4,14 +4,14 @@ import merge from 'lodash/merge';
4
4
 
5
5
  import Label from '../../../../../Label';
6
6
  import Surface from '../../../../../Surface';
7
- import Button from '../../../../../Button';
8
7
  import Icon from '../../../../../Icon';
9
8
  import Checkbox from '../../../../../Checkbox';
10
9
  import { MessagePropTypes, SummaryPropTypes } from '../../types';
10
+ import UTButton from '../../../../../UTButton';
11
11
 
12
12
  import ActionButton from './components/ActionButton';
13
13
  import ActionButtonPropTypes from './components/ActionButton/types';
14
- import ownStyles, { ICON_SIZE } from './styles';
14
+ import ownStyles from './styles';
15
15
  import { NEXT, RETURN } from './constants';
16
16
 
17
17
  const BottomActions = ({ nextButton, returnButton, summary, message, style }) => {
@@ -39,29 +39,23 @@ const BottomActions = ({ nextButton, returnButton, summary, message, style }) =>
39
39
  )}
40
40
  {summary.actions && !checkboxProps && (
41
41
  <View style={themedStyles.summaryActions}>
42
- {summary.actions.map((action, index) => (
43
- <Button
44
- containerStyle={themedStyles.summaryActionContainer}
45
- contentStyle={!action.title && themedStyles.summaryActionButton}
46
- elevation={action.elevation}
47
- icon={
48
- action.icon && {
49
- height: action.icon.height || ICON_SIZE,
50
- name: action.icon.name,
51
- size: action.icon.size || ICON_SIZE,
52
- type: action.icon.type,
53
- width: action.icon.width || ICON_SIZE
54
- }
55
- }
56
- key={action.name}
57
- labelColor={themedStyles.summaryActions?.labelColor || 'blue'}
58
- onPress={action.onPress}
59
- outerContainerStyles={
60
- index !== summary.actions.length - 1 && themedStyles.summaryActionsChild
61
- }
62
- secondary
63
- title={action.title}
64
- />
42
+ {summary.actions.map(({ Icon: actionIcon, title, onPress }, index) => (
43
+ <UTButton
44
+ Icon={actionIcon}
45
+ key={actionIcon}
46
+ onPress={onPress}
47
+ size="small"
48
+ style={{
49
+ root: {
50
+ ...themedStyles.summaryActionContainer,
51
+ ...(index !== summary.actions.length - 1 && themedStyles.summaryActionsChild)
52
+ },
53
+ childrenContainer: themedStyles.summaryActionButton
54
+ }}
55
+ variant="semitransparent"
56
+ >
57
+ {title}
58
+ </UTButton>
65
59
  ))}
66
60
  </View>
67
61
  )}
@@ -93,7 +87,7 @@ const BottomActions = ({ nextButton, returnButton, summary, message, style }) =>
93
87
  {returnButtonEnabled && (
94
88
  <ActionButton
95
89
  label={returnButton.label || RETURN}
96
- mode="text"
90
+ variant="text"
97
91
  style={{
98
92
  actionButton: {
99
93
  ...themedStyles.returnActionButton,
@@ -1,7 +1,5 @@
1
1
  import { StyleSheet } from 'react-native';
2
2
 
3
- export const ICON_SIZE = 24;
4
-
5
3
  export default StyleSheet.create({
6
4
  actionsChild: {
7
5
  marginRight: 16
@@ -47,11 +45,8 @@ export default StyleSheet.create({
47
45
  justifyContent: 'space-between',
48
46
  padding: 16
49
47
  },
50
- summaryActionButton: {
51
- marginHorizontal: 8
52
- },
53
48
  summaryActionContainer: {
54
- minWidth: 0
49
+ paddingVertical: 8
55
50
  },
56
51
  summaryActions: {
57
52
  alignItems: 'center',
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.13.0",
5
+ "version": "1.13.1",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [