@widergy/mobile-ui 1.13.0 → 1.13.2
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 +14 -0
- package/lib/components/UTLoading/index.js +1 -1
- package/lib/components/UTRoundView/index.js +7 -2
- package/lib/components/UTTopbar/index.js +8 -8
- package/lib/components/UTTopbar/styles.js +5 -0
- package/lib/components/UTWorkflowContainer/versions/V1/components/BottomActions/components/ActionButton/index.js +10 -11
- package/lib/components/UTWorkflowContainer/versions/V1/components/BottomActions/components/ActionButton/styles.js +1 -1
- package/lib/components/UTWorkflowContainer/versions/V1/components/BottomActions/index.js +24 -28
- package/lib/components/UTWorkflowContainer/versions/V1/components/BottomActions/styles.js +4 -6
- package/lib/components/UTWorkflowContainer/versions/V1/index.js +7 -3
- package/lib/components/UTWorkflowContainer/versions/V1/styles.js +4 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.13.2](https://github.com/widergy/mobile-ui/compare/v1.13.1...v1.13.2) (2024-07-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* utworkflow spacing and utroundview shadows ([#310](https://github.com/widergy/mobile-ui/issues/310)) ([73fdfc2](https://github.com/widergy/mobile-ui/commit/73fdfc25f02f8caeb7ea04c5fe80d6b073d22a66))
|
|
7
|
+
|
|
8
|
+
## [1.13.1](https://github.com/widergy/mobile-ui/compare/v1.13.0...v1.13.1) (2024-07-12)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* 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))
|
|
14
|
+
|
|
1
15
|
# [1.13.0](https://github.com/widergy/mobile-ui/compare/v1.12.7...v1.13.0) (2024-07-11)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -3,17 +3,22 @@ import { View, Animated } from 'react-native';
|
|
|
3
3
|
import _ from 'lodash';
|
|
4
4
|
|
|
5
5
|
import { useTheme } from '../../theming';
|
|
6
|
+
import Surface from '../Surface';
|
|
6
7
|
|
|
7
8
|
import propTypes from './propTypes';
|
|
8
9
|
import ownStyles from './styles';
|
|
9
10
|
|
|
10
|
-
const UTRoundView = ({ children, styles }) => {
|
|
11
|
+
const UTRoundView = ({ children, styles, withShadow = false }) => {
|
|
11
12
|
const theme = useTheme();
|
|
12
13
|
const themedStyles = _.merge({}, theme?.roundView, styles);
|
|
13
14
|
|
|
15
|
+
const ChildrenContainer = withShadow ? Surface : View;
|
|
16
|
+
|
|
14
17
|
return (
|
|
15
18
|
<Animated.View style={[ownStyles.container, themedStyles?.outerContainer]}>
|
|
16
|
-
<
|
|
19
|
+
<ChildrenContainer position="top" style={[ownStyles.innerContainer, themedStyles?.innerContainer]}>
|
|
20
|
+
{children}
|
|
21
|
+
</ChildrenContainer>
|
|
17
22
|
</Animated.View>
|
|
18
23
|
);
|
|
19
24
|
};
|
|
@@ -3,7 +3,7 @@ import { BackHandler, View } from 'react-native';
|
|
|
3
3
|
import { number } from 'prop-types';
|
|
4
4
|
import { useFocusEffect } from '@react-navigation/native';
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import UTButton from '../UTButton';
|
|
7
7
|
import Label from '../Label';
|
|
8
8
|
import UTStepper from '../UTStepper';
|
|
9
9
|
import UTProgressBar from '../UTProgressBar';
|
|
@@ -18,7 +18,7 @@ const UTTopbar = ({
|
|
|
18
18
|
stages,
|
|
19
19
|
stepsCount,
|
|
20
20
|
theme,
|
|
21
|
-
topbar: { colorTheme = 'light', goBack, title, variant = 'secondary',
|
|
21
|
+
topbar: { colorTheme = 'light', goBack, title, variant = 'secondary', Icon } = {}
|
|
22
22
|
}) => {
|
|
23
23
|
const size = { big: variant === 'primary' };
|
|
24
24
|
|
|
@@ -42,12 +42,12 @@ const UTTopbar = ({
|
|
|
42
42
|
return (
|
|
43
43
|
<View>
|
|
44
44
|
<View style={[ownStyles.container, ownTheme?.container]}>
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
<UTButton
|
|
46
|
+
Icon={Icon || 'IconArrowLeft'}
|
|
47
|
+
variant="text"
|
|
48
|
+
style={{
|
|
49
|
+
root: ownStyles.goBack
|
|
50
|
+
}}
|
|
51
51
|
onPress={goBack}
|
|
52
52
|
/>
|
|
53
53
|
<Label color={ownTheme?.text || 'black'} {...size} bold style={ownStyles.child}>
|
|
@@ -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
|
|
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,
|
|
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
|
-
<
|
|
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
|
-
|
|
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
|
-
|
|
34
|
+
variant: string,
|
|
36
35
|
onPress: func
|
|
37
36
|
};
|
|
38
37
|
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import merge from 'lodash/merge';
|
|
4
|
+
import { number } from 'prop-types';
|
|
4
5
|
|
|
5
6
|
import Label from '../../../../../Label';
|
|
6
7
|
import Surface from '../../../../../Surface';
|
|
7
|
-
import Button from '../../../../../Button';
|
|
8
8
|
import Icon from '../../../../../Icon';
|
|
9
9
|
import Checkbox from '../../../../../Checkbox';
|
|
10
10
|
import { MessagePropTypes, SummaryPropTypes } from '../../types';
|
|
11
|
+
import UTButton from '../../../../../UTButton';
|
|
11
12
|
|
|
12
13
|
import ActionButton from './components/ActionButton';
|
|
13
14
|
import ActionButtonPropTypes from './components/ActionButton/types';
|
|
14
|
-
import ownStyles
|
|
15
|
+
import ownStyles from './styles';
|
|
15
16
|
import { NEXT, RETURN } from './constants';
|
|
16
17
|
|
|
17
|
-
const BottomActions = ({ nextButton, returnButton, summary,
|
|
18
|
+
const BottomActions = ({ bottomSafeArea, message, nextButton, returnButton, summary, style }) => {
|
|
18
19
|
const messageIcon = message?.icon;
|
|
19
20
|
const MESSAGE_ICON_SIZE = 16;
|
|
20
21
|
const checkboxProps = summary?.checkbox;
|
|
@@ -24,7 +25,7 @@ const BottomActions = ({ nextButton, returnButton, summary, message, style }) =>
|
|
|
24
25
|
const returnButtonEnabled = returnButton && !returnButton.hidden;
|
|
25
26
|
|
|
26
27
|
return (
|
|
27
|
-
<Surface position="top" style={themedStyles.bottomNav}>
|
|
28
|
+
<Surface position="top" style={[themedStyles.bottomNav, themedStyles.bottomSafeArea(bottomSafeArea)]}>
|
|
28
29
|
{summary && (
|
|
29
30
|
<View style={[themedStyles.summary, checkboxProps && themedStyles.summaryCheckbox]}>
|
|
30
31
|
{checkboxProps ? (
|
|
@@ -39,29 +40,23 @@ const BottomActions = ({ nextButton, returnButton, summary, message, style }) =>
|
|
|
39
40
|
)}
|
|
40
41
|
{summary.actions && !checkboxProps && (
|
|
41
42
|
<View style={themedStyles.summaryActions}>
|
|
42
|
-
{summary.actions.map((
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
outerContainerStyles={
|
|
60
|
-
index !== summary.actions.length - 1 && themedStyles.summaryActionsChild
|
|
61
|
-
}
|
|
62
|
-
secondary
|
|
63
|
-
title={action.title}
|
|
64
|
-
/>
|
|
43
|
+
{summary.actions.map(({ Icon: actionIcon, title, onPress }, index) => (
|
|
44
|
+
<UTButton
|
|
45
|
+
Icon={actionIcon}
|
|
46
|
+
key={actionIcon}
|
|
47
|
+
onPress={onPress}
|
|
48
|
+
size="small"
|
|
49
|
+
style={{
|
|
50
|
+
root: {
|
|
51
|
+
...themedStyles.summaryActionContainer,
|
|
52
|
+
...(index !== summary.actions.length - 1 && themedStyles.summaryActionsChild)
|
|
53
|
+
},
|
|
54
|
+
childrenContainer: themedStyles.summaryActionButton
|
|
55
|
+
}}
|
|
56
|
+
variant="semitransparent"
|
|
57
|
+
>
|
|
58
|
+
{title}
|
|
59
|
+
</UTButton>
|
|
65
60
|
))}
|
|
66
61
|
</View>
|
|
67
62
|
)}
|
|
@@ -93,7 +88,7 @@ const BottomActions = ({ nextButton, returnButton, summary, message, style }) =>
|
|
|
93
88
|
{returnButtonEnabled && (
|
|
94
89
|
<ActionButton
|
|
95
90
|
label={returnButton.label || RETURN}
|
|
96
|
-
|
|
91
|
+
variant="text"
|
|
97
92
|
style={{
|
|
98
93
|
actionButton: {
|
|
99
94
|
...themedStyles.returnActionButton,
|
|
@@ -120,6 +115,7 @@ const BottomActions = ({ nextButton, returnButton, summary, message, style }) =>
|
|
|
120
115
|
};
|
|
121
116
|
|
|
122
117
|
BottomActions.propTypes = {
|
|
118
|
+
bottomSafeArea: number,
|
|
123
119
|
message: MessagePropTypes,
|
|
124
120
|
nextButton: ActionButtonPropTypes,
|
|
125
121
|
returnButton: ActionButtonPropTypes,
|
|
@@ -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
|
|
@@ -14,6 +12,9 @@ export default StyleSheet.create({
|
|
|
14
12
|
padding: 16,
|
|
15
13
|
width: '100%'
|
|
16
14
|
},
|
|
15
|
+
bottomSafeArea: safeArea => ({
|
|
16
|
+
paddingBottom: safeArea + 16
|
|
17
|
+
}),
|
|
17
18
|
bottomNav: {
|
|
18
19
|
backgroundColor: 'white'
|
|
19
20
|
},
|
|
@@ -47,11 +48,8 @@ export default StyleSheet.create({
|
|
|
47
48
|
justifyContent: 'space-between',
|
|
48
49
|
padding: 16
|
|
49
50
|
},
|
|
50
|
-
summaryActionButton: {
|
|
51
|
-
marginHorizontal: 8
|
|
52
|
-
},
|
|
53
51
|
summaryActionContainer: {
|
|
54
|
-
|
|
52
|
+
paddingVertical: 8
|
|
55
53
|
},
|
|
56
54
|
summaryActions: {
|
|
57
55
|
alignItems: 'center',
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ScrollView, View } from 'react-native';
|
|
3
3
|
import { number, func, shape, bool, string, element } from 'prop-types';
|
|
4
4
|
import { merge } from 'lodash';
|
|
5
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
5
6
|
|
|
6
7
|
import { useTheme } from '../../../../theming';
|
|
7
8
|
import UTHeader from '../../../UTHeader';
|
|
@@ -36,12 +37,14 @@ const UTWorkflowContainer = ({
|
|
|
36
37
|
topbar,
|
|
37
38
|
useMarkdown
|
|
38
39
|
}) => {
|
|
40
|
+
const { bottom: bottomSafeArea, top: topSafeArea } = useSafeAreaInsets();
|
|
41
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
39
42
|
useEffect(() => () => onExit?.(), []);
|
|
40
43
|
const theme = useTheme();
|
|
41
44
|
const themedStyles = merge({}, ownStyles, theme?.UTWorkflowContainer, style);
|
|
42
45
|
|
|
43
46
|
return (
|
|
44
|
-
<
|
|
47
|
+
<View style={[themedStyles.container, themedStyles.topSafeArea(topSafeArea)]}>
|
|
45
48
|
{topbar && <UTTopbar {...{ currentStage, currentStep, stages, stepsCount, theme, topbar }} />}
|
|
46
49
|
<ScrollView
|
|
47
50
|
contentContainerStyle={themedStyles.content}
|
|
@@ -71,11 +74,12 @@ const UTWorkflowContainer = ({
|
|
|
71
74
|
nextButton,
|
|
72
75
|
returnButton,
|
|
73
76
|
style: themedStyles,
|
|
77
|
+
bottomSafeArea,
|
|
74
78
|
summary
|
|
75
79
|
}}
|
|
76
80
|
/>
|
|
77
81
|
)}
|
|
78
|
-
</
|
|
82
|
+
</View>
|
|
79
83
|
);
|
|
80
84
|
};
|
|
81
85
|
UTWorkflowContainer.propTypes = {
|
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.
|
|
5
|
+
"version": "1.13.2",
|
|
6
6
|
"repository": "https://github.com/widergy/mobile-ui.git",
|
|
7
7
|
"main": "lib/index.js",
|
|
8
8
|
"files": [
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"react-native-collapsible": "^1.6.1",
|
|
46
46
|
"react-native-markdown-display": "^7.0.0-alpha.2",
|
|
47
47
|
"react-native-modal": "^13.0.1",
|
|
48
|
+
"react-native-safe-area-context": "^4.5.0",
|
|
48
49
|
"react-native-pager-view": "^6.2.1"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|