@widergy/mobile-ui 1.3.3 → 1.3.4
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 +7 -0
- package/lib/components/UTHeader/index.js +16 -9
- package/lib/components/UTWorkflowContainer/versions/V1/components/BottomActions/components/ActionButton/index.js +2 -2
- package/lib/components/UTWorkflowContainer/versions/V1/components/BottomActions/index.js +32 -15
- package/lib/components/UTWorkflowContainer/versions/V1/index.js +8 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.3.4](https://github.com/widergy/mobile-ui/compare/v1.3.3...v1.3.4) (2024-03-19)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* themed styles and tagline fix ([#270](https://github.com/widergy/mobile-ui/issues/270)) ([6b5b325](https://github.com/widergy/mobile-ui/commit/6b5b32599b39dc1ee07f5af3dc2020fbab9219cf))
|
|
7
|
+
|
|
1
8
|
## [1.3.3](https://github.com/widergy/mobile-ui/compare/v1.3.2...v1.3.3) (2024-03-15)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -1,53 +1,58 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import { string, bool, shape } from 'prop-types';
|
|
4
|
+
import merge from 'lodash/merge';
|
|
4
5
|
|
|
5
6
|
import Label from '../Label';
|
|
6
7
|
import UTBanner from '../UTBanner';
|
|
8
|
+
import { useTheme } from '../../theming';
|
|
7
9
|
|
|
8
10
|
import ownStyles from './styles';
|
|
9
11
|
|
|
10
|
-
const UTHeader = ({ tagline, title, subtitle, requiredFieldInfo, helpText, useMarkdown, banner }) => {
|
|
12
|
+
const UTHeader = ({ tagline, title, subtitle, requiredFieldInfo, helpText, useMarkdown, banner, style }) => {
|
|
13
|
+
const theme = useTheme();
|
|
14
|
+
const themedStyles = merge({}, ownStyles, theme?.UTHeader, style);
|
|
15
|
+
|
|
11
16
|
const renderComponent = (prop, standardComponent) =>
|
|
12
17
|
React.isValidElement(prop) ? prop : standardComponent;
|
|
13
18
|
|
|
14
19
|
const Tagline = renderComponent(
|
|
15
20
|
tagline,
|
|
16
|
-
<Label disabled bold useMarkdown={useMarkdown} style={
|
|
17
|
-
{tagline
|
|
21
|
+
<Label disabled bold useMarkdown={useMarkdown} style={themedStyles.child}>
|
|
22
|
+
{tagline?.toUpperCase?.()}
|
|
18
23
|
</Label>
|
|
19
24
|
);
|
|
20
25
|
|
|
21
26
|
const Title = renderComponent(
|
|
22
27
|
title,
|
|
23
|
-
<Label big bold style={
|
|
28
|
+
<Label big bold style={themedStyles.title} useMarkdown={useMarkdown}>
|
|
24
29
|
{title}
|
|
25
30
|
</Label>
|
|
26
31
|
);
|
|
27
32
|
|
|
28
33
|
const Subtitle = renderComponent(
|
|
29
34
|
subtitle,
|
|
30
|
-
<Label disabled useMarkdown={useMarkdown} style={
|
|
35
|
+
<Label disabled useMarkdown={useMarkdown} style={themedStyles.child}>
|
|
31
36
|
{subtitle}
|
|
32
37
|
</Label>
|
|
33
38
|
);
|
|
34
39
|
|
|
35
40
|
const RequiredFieldInfo = renderComponent(
|
|
36
41
|
requiredFieldInfo,
|
|
37
|
-
<Label disabled useMarkdown={useMarkdown} style={
|
|
42
|
+
<Label disabled useMarkdown={useMarkdown} style={themedStyles.child}>
|
|
38
43
|
{requiredFieldInfo}
|
|
39
44
|
</Label>
|
|
40
45
|
);
|
|
41
46
|
|
|
42
47
|
const HelpText = renderComponent(
|
|
43
48
|
helpText,
|
|
44
|
-
<Label disabled useMarkdown={useMarkdown} style={
|
|
49
|
+
<Label disabled useMarkdown={useMarkdown} style={themedStyles.child}>
|
|
45
50
|
{helpText}
|
|
46
51
|
</Label>
|
|
47
52
|
);
|
|
48
53
|
|
|
49
54
|
return (
|
|
50
|
-
<View style={
|
|
55
|
+
<View style={themedStyles.header}>
|
|
51
56
|
{!!tagline && Tagline}
|
|
52
57
|
<View>
|
|
53
58
|
{Title}
|
|
@@ -55,7 +60,9 @@ const UTHeader = ({ tagline, title, subtitle, requiredFieldInfo, helpText, useMa
|
|
|
55
60
|
</View>
|
|
56
61
|
{!!requiredFieldInfo && RequiredFieldInfo}
|
|
57
62
|
{!!helpText && HelpText}
|
|
58
|
-
{banner?.text &&
|
|
63
|
+
{banner?.text && (
|
|
64
|
+
<UTBanner text={banner.text} icon={banner.icon} style={{ banner: themedStyles.child }} />
|
|
65
|
+
)}
|
|
59
66
|
</View>
|
|
60
67
|
);
|
|
61
68
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { string, func, bool } from 'prop-types';
|
|
3
3
|
import { View } from 'react-native';
|
|
4
|
-
import
|
|
4
|
+
import merge from 'lodash/merge';
|
|
5
5
|
|
|
6
6
|
import Button from '../../../../../../../Button';
|
|
7
7
|
import { useTheme } from '../../../../../../../../theming';
|
|
@@ -10,7 +10,7 @@ import ownStyles from './styles';
|
|
|
10
10
|
|
|
11
11
|
const ActionButton = ({ hidden, disabled, onPress, label, mode, style }) => {
|
|
12
12
|
const theme = useTheme();
|
|
13
|
-
const themedStyles =
|
|
13
|
+
const themedStyles = merge({}, ownStyles, theme?.UTWorkflowContainer?.actionButton, style);
|
|
14
14
|
|
|
15
15
|
return (
|
|
16
16
|
<View style={themedStyles.actionButton}>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import merge from 'lodash/merge';
|
|
4
4
|
|
|
5
5
|
import Label from '../../../../../Label';
|
|
6
6
|
import Button from '../../../../../Button';
|
|
@@ -13,31 +13,31 @@ import ActionButtonPropTypes from './components/ActionButton/types';
|
|
|
13
13
|
import ownStyles, { ICON_SIZE } from './styles';
|
|
14
14
|
import { NEXT, RETURN } from './constants';
|
|
15
15
|
|
|
16
|
-
const BottomActions = ({ nextButton, returnButton, summary, message,
|
|
16
|
+
const BottomActions = ({ nextButton, returnButton, summary, message, style }) => {
|
|
17
17
|
const messageIcon = message?.icon;
|
|
18
18
|
const MESSAGE_ICON_SIZE = 16;
|
|
19
19
|
const checkboxProps = summary?.checkbox;
|
|
20
20
|
|
|
21
|
-
const themedStyles =
|
|
21
|
+
const themedStyles = merge({}, ownStyles, style);
|
|
22
22
|
const nextButtonEnabled = nextButton && !nextButton.hidden;
|
|
23
23
|
const returnButtonEnabled = returnButton && !returnButton.hidden;
|
|
24
24
|
|
|
25
25
|
return (
|
|
26
|
-
<View style={
|
|
26
|
+
<View style={themedStyles.bottomNav}>
|
|
27
27
|
{summary && (
|
|
28
|
-
<View style={[
|
|
28
|
+
<View style={[themedStyles.summary, checkboxProps && themedStyles.summaryCheckbox]}>
|
|
29
29
|
{checkboxProps ? (
|
|
30
30
|
<Checkbox {...checkboxProps} />
|
|
31
31
|
) : (
|
|
32
|
-
<View style={
|
|
33
|
-
<Label disabled medium style={
|
|
32
|
+
<View style={themedStyles.summaryTitles}>
|
|
33
|
+
<Label disabled medium style={themedStyles.summaryTitlesChild}>
|
|
34
34
|
{summary.title}
|
|
35
35
|
</Label>
|
|
36
36
|
<Label>{summary.mainInfo}</Label>
|
|
37
37
|
</View>
|
|
38
38
|
)}
|
|
39
39
|
{summary.actions && !checkboxProps && (
|
|
40
|
-
<View style={
|
|
40
|
+
<View style={themedStyles.summaryActions}>
|
|
41
41
|
{summary.actions.map((action, index) => (
|
|
42
42
|
<Button
|
|
43
43
|
key={action.name}
|
|
@@ -53,10 +53,12 @@ const BottomActions = ({ nextButton, returnButton, summary, message, theme }) =>
|
|
|
53
53
|
}
|
|
54
54
|
title={action.title}
|
|
55
55
|
labelColor={themedStyles.summaryActions?.labelColor || 'blue'}
|
|
56
|
-
containerStyle={
|
|
57
|
-
contentStyle={!action.title &&
|
|
56
|
+
containerStyle={themedStyles.summaryActionContainer}
|
|
57
|
+
contentStyle={!action.title && themedStyles.summaryActionButton}
|
|
58
58
|
onPress={action.onPress}
|
|
59
|
-
outerContainerStyles={
|
|
59
|
+
outerContainerStyles={
|
|
60
|
+
index !== summary.actions.length - 1 && themedStyles.summaryActionsChild
|
|
61
|
+
}
|
|
60
62
|
/>
|
|
61
63
|
))}
|
|
62
64
|
</View>
|
|
@@ -70,7 +72,7 @@ const BottomActions = ({ nextButton, returnButton, summary, message, theme }) =>
|
|
|
70
72
|
themedStyles[`message${message.variant?.charAt(0).toUpperCase()}${message.variant?.slice(1)}`]
|
|
71
73
|
]}
|
|
72
74
|
>
|
|
73
|
-
<Label white style={
|
|
75
|
+
<Label white style={themedStyles.messageChild}>
|
|
74
76
|
{message.title}
|
|
75
77
|
</Label>
|
|
76
78
|
{messageIcon && (
|
|
@@ -85,16 +87,31 @@ const BottomActions = ({ nextButton, returnButton, summary, message, theme }) =>
|
|
|
85
87
|
)}
|
|
86
88
|
</View>
|
|
87
89
|
)}
|
|
88
|
-
<View style={
|
|
90
|
+
<View style={themedStyles.actionsContainer}>
|
|
89
91
|
{returnButtonEnabled && (
|
|
90
92
|
<ActionButton
|
|
91
93
|
mode="text"
|
|
92
94
|
label={returnButton.label || RETURN}
|
|
93
|
-
style={
|
|
95
|
+
style={{
|
|
96
|
+
actionButton: {
|
|
97
|
+
...themedStyles.returnActionButton,
|
|
98
|
+
...(nextButtonEnabled ? themedStyles.actionsChild : {})
|
|
99
|
+
},
|
|
100
|
+
buttonContainer: themedStyles.returnButtonContainer
|
|
101
|
+
}}
|
|
94
102
|
{...returnButton}
|
|
95
103
|
/>
|
|
96
104
|
)}
|
|
97
|
-
{nextButtonEnabled &&
|
|
105
|
+
{nextButtonEnabled && (
|
|
106
|
+
<ActionButton
|
|
107
|
+
label={nextButton.label || NEXT}
|
|
108
|
+
style={{
|
|
109
|
+
actionButton: themedStyles.nextActionButton,
|
|
110
|
+
buttonContainer: themedStyles.nextButtonContainer
|
|
111
|
+
}}
|
|
112
|
+
{...nextButton}
|
|
113
|
+
/>
|
|
114
|
+
)}
|
|
98
115
|
</View>
|
|
99
116
|
</View>
|
|
100
117
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
2
|
import { View, ScrollView } from 'react-native';
|
|
3
3
|
import { number, func, shape, bool, string, element } from 'prop-types';
|
|
4
|
+
import { merge } from 'lodash';
|
|
4
5
|
|
|
5
6
|
import { useTheme } from '../../../../theming';
|
|
6
7
|
import UTHeader from '../../../UTHeader';
|
|
@@ -26,6 +27,7 @@ const UTWorkflowContainer = ({
|
|
|
26
27
|
returnButton,
|
|
27
28
|
stages,
|
|
28
29
|
stepsCount,
|
|
30
|
+
style,
|
|
29
31
|
subtitle,
|
|
30
32
|
summary,
|
|
31
33
|
tagline,
|
|
@@ -35,17 +37,19 @@ const UTWorkflowContainer = ({
|
|
|
35
37
|
}) => {
|
|
36
38
|
useEffect(() => () => onExit?.(), []);
|
|
37
39
|
const theme = useTheme();
|
|
40
|
+
const themedStyles = merge({}, ownStyles, theme?.UTWorkflowContainer, style);
|
|
38
41
|
|
|
39
42
|
return (
|
|
40
|
-
<View style={
|
|
43
|
+
<View style={themedStyles.container}>
|
|
41
44
|
{topbar && <UTTopbar {...{ currentStage, currentStep, stages, stepsCount, theme, topbar }} />}
|
|
42
|
-
<ScrollView contentContainerStyle={
|
|
45
|
+
<ScrollView contentContainerStyle={themedStyles.content}>
|
|
43
46
|
{title && (
|
|
44
47
|
<UTHeader
|
|
45
48
|
{...{
|
|
46
49
|
banner,
|
|
47
50
|
helpText,
|
|
48
51
|
requiredFieldInfo,
|
|
52
|
+
style: themedStyles,
|
|
49
53
|
subtitle,
|
|
50
54
|
tagline,
|
|
51
55
|
title,
|
|
@@ -61,8 +65,8 @@ const UTWorkflowContainer = ({
|
|
|
61
65
|
message,
|
|
62
66
|
nextButton,
|
|
63
67
|
returnButton,
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
style: themedStyles,
|
|
69
|
+
summary
|
|
66
70
|
}}
|
|
67
71
|
/>
|
|
68
72
|
)}
|
package/package.json
CHANGED