@widergy/mobile-ui 0.40.1 → 0.41.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.
Files changed (46) hide show
  1. package/lib/components/Button/constants.js +5 -0
  2. package/lib/components/Button/index.js +24 -8
  3. package/lib/components/Button/styles.js +9 -6
  4. package/lib/components/Checkbox/styles.js +3 -3
  5. package/lib/components/Icon/constants.js +1 -0
  6. package/lib/components/Icon/index.js +11 -1
  7. package/lib/components/UTBanner/index.js +42 -0
  8. package/lib/components/UTBanner/styles.js +14 -0
  9. package/lib/components/UTHeader/index.js +56 -0
  10. package/lib/components/UTHeader/styles.js +16 -0
  11. package/lib/components/UTStepper/components/Connectors/index.js +33 -0
  12. package/lib/components/UTStepper/components/Connectors/styles.js +26 -0
  13. package/lib/components/UTStepper/components/Step/index.js +50 -0
  14. package/lib/components/UTStepper/components/Step/styles.js +47 -0
  15. package/lib/components/UTStepper/index.js +34 -0
  16. package/lib/components/UTStepper/styles.js +12 -0
  17. package/lib/components/UTStepper/types.js +3 -0
  18. package/lib/components/UTTopbar/index.js +64 -0
  19. package/lib/components/UTTopbar/styles.js +16 -0
  20. package/lib/components/UTTopbar/types.js +8 -0
  21. package/lib/components/UTWorkflowContainer/index.js +10 -102
  22. package/lib/components/UTWorkflowContainer/{components → versions/V0/components}/BottomStepHandler/index.js +4 -4
  23. package/lib/components/UTWorkflowContainer/{components → versions/V0/components}/BottomStepHandler/styles.js +3 -3
  24. package/lib/components/UTWorkflowContainer/{components → versions/V0/components}/Header/index.js +9 -9
  25. package/lib/components/UTWorkflowContainer/{components → versions/V0/components}/Header/styles.js +3 -3
  26. package/lib/components/UTWorkflowContainer/{components → versions/V0/components}/StepsHandler/components/ActionButton/index.js +2 -2
  27. package/lib/components/UTWorkflowContainer/{components → versions/V0/components}/StepsHandler/components/ActionButton/styles.js +12 -12
  28. package/lib/components/UTWorkflowContainer/{components → versions/V0/components}/StepsHandler/components/ActionButton/types.js +9 -9
  29. package/lib/components/UTWorkflowContainer/{components → versions/V0/components}/StepsHandler/index.js +6 -6
  30. package/lib/components/UTWorkflowContainer/{components → versions/V0/components}/StepsHandler/styles.js +3 -3
  31. package/lib/components/UTWorkflowContainer/versions/V0/index.js +108 -0
  32. package/lib/components/UTWorkflowContainer/{styles.js → versions/V0/styles.js} +4 -4
  33. package/lib/components/UTWorkflowContainer/versions/V1/components/BottomActions/components/ActionButton/index.js +35 -0
  34. package/lib/components/UTWorkflowContainer/versions/V1/components/BottomActions/components/ActionButton/styles.js +13 -0
  35. package/lib/components/UTWorkflowContainer/versions/V1/components/BottomActions/components/ActionButton/types.js +9 -0
  36. package/lib/components/UTWorkflowContainer/versions/V1/components/BottomActions/constants.js +2 -0
  37. package/lib/components/UTWorkflowContainer/versions/V1/components/BottomActions/index.js +110 -0
  38. package/lib/components/UTWorkflowContainer/versions/V1/components/BottomActions/styles.js +75 -0
  39. package/lib/components/UTWorkflowContainer/versions/V1/index.js +94 -0
  40. package/lib/components/UTWorkflowContainer/versions/V1/styles.js +14 -0
  41. package/lib/components/UTWorkflowContainer/versions/V1/types.js +24 -0
  42. package/package.json +1 -1
  43. /package/lib/components/UTWorkflowContainer/{README.md → versions/V0/README.md} +0 -0
  44. /package/lib/components/UTWorkflowContainer/{components → versions/V0/components}/Header/utils.js +0 -0
  45. /package/lib/components/UTWorkflowContainer/{components → versions/V0/components}/StepsHandler/constants.js +0 -0
  46. /package/lib/components/UTWorkflowContainer/{components → versions/V0/components}/StepsHandler/utils.js +0 -0
@@ -0,0 +1,75 @@
1
+ import { StyleSheet } from 'react-native';
2
+
3
+ export const ICON_SIZE = 24;
4
+
5
+ export default StyleSheet.create({
6
+ actionsChild: {
7
+ marginRight: 16
8
+ },
9
+ actionsContainer: {
10
+ alignItems: 'center',
11
+ flexDirection: 'row',
12
+ flexWrap: 'nowrap',
13
+ justifyContent: 'space-between',
14
+ padding: 16,
15
+ width: '100%'
16
+ },
17
+ bottomNav: {
18
+ backgroundColor: 'white',
19
+ elevation: 10
20
+ },
21
+ message: {
22
+ alignItems: 'center',
23
+ backgroundColor: 'blue',
24
+ display: 'flex',
25
+ flexDirection: 'row',
26
+ justifyContent: 'center',
27
+ paddingHorizontal: 16,
28
+ paddingVertical: 4
29
+ },
30
+ messageChild: {
31
+ marginRight: 8
32
+ },
33
+ messageError: {
34
+ backgroundColor: 'red'
35
+ },
36
+ messageSuccess: {
37
+ backgroundColor: 'green'
38
+ },
39
+ messageWarning: {
40
+ backgroundColor: 'darkorange'
41
+ },
42
+ summary: {
43
+ alignItems: 'center',
44
+ borderTopLeftRadius: 20,
45
+ borderTopRightRadius: 20,
46
+ display: 'flex',
47
+ elevation: 1,
48
+ flexDirection: 'row',
49
+ justifyContent: 'space-between',
50
+ padding: 16
51
+ },
52
+ summaryActionButton: {
53
+ marginHorizontal: 8
54
+ },
55
+ summaryActionContainer: {
56
+ minWidth: 0
57
+ },
58
+ summaryActions: {
59
+ alignItems: 'center',
60
+ display: 'flex',
61
+ flexDirection: 'row'
62
+ },
63
+ summaryActionsChild: {
64
+ marginRight: 16
65
+ },
66
+ summaryCheckbox: {
67
+ flexDirection: 'column'
68
+ },
69
+ summaryTitles: {
70
+ display: 'flex'
71
+ },
72
+ summaryTitlesChild: {
73
+ marginBottom: 8
74
+ }
75
+ });
@@ -0,0 +1,94 @@
1
+ import React, { useEffect } from 'react';
2
+ import { View, ScrollView } from 'react-native';
3
+ import { number, func, shape, bool, string, element } from 'prop-types';
4
+
5
+ import { useTheme } from '../../../../theming';
6
+ import UTHeader from '../../../UTHeader';
7
+ import UTTopbar from '../../../UTTopbar';
8
+ import { StagesPropTypes } from '../../../UTStepper/types';
9
+ import { TopbarPropTypes } from '../../../UTTopbar/types';
10
+
11
+ import ownStyles from './styles';
12
+ import BottomActions from './components/BottomActions';
13
+ import ActionButtonPropTypes from './components/BottomActions/components/ActionButton/types';
14
+ import { MessagePropTypes, SummaryPropTypes } from './types';
15
+
16
+ const UTWorkflowContainer = ({
17
+ banner,
18
+ children,
19
+ currentStage,
20
+ currentStep,
21
+ helpText,
22
+ message,
23
+ nextButton,
24
+ onExit,
25
+ requiredFieldInfo,
26
+ returnButton,
27
+ stages,
28
+ stepsCount,
29
+ subtitle,
30
+ summary,
31
+ tagline,
32
+ title,
33
+ topbar,
34
+ useMarkdown
35
+ }) => {
36
+ useEffect(() => () => onExit?.(), []);
37
+ const theme = useTheme();
38
+
39
+ return (
40
+ <View style={ownStyles.container}>
41
+ {topbar && <UTTopbar {...{ currentStage, currentStep, stages, stepsCount, theme, topbar }} />}
42
+ <ScrollView contentContainerStyle={ownStyles.content}>
43
+ {title && (
44
+ <UTHeader
45
+ {...{
46
+ banner,
47
+ helpText,
48
+ requiredFieldInfo,
49
+ subtitle,
50
+ tagline,
51
+ title,
52
+ useMarkdown
53
+ }}
54
+ />
55
+ )}
56
+ {children}
57
+ </ScrollView>
58
+ {((nextButton && !nextButton?.hidden) || (returnButton && !returnButton?.hidden)) && (
59
+ <BottomActions
60
+ {...{
61
+ message,
62
+ nextButton,
63
+ returnButton,
64
+ summary,
65
+ theme
66
+ }}
67
+ />
68
+ )}
69
+ </View>
70
+ );
71
+ };
72
+ UTWorkflowContainer.propTypes = {
73
+ banner: shape({
74
+ Icon: element,
75
+ text: string
76
+ }),
77
+ currentStage: number,
78
+ currentStep: number.isRequired,
79
+ helpText: string,
80
+ message: MessagePropTypes,
81
+ nextButton: ActionButtonPropTypes,
82
+ onExit: func,
83
+ requiredFieldInfo: string,
84
+ returnButton: ActionButtonPropTypes,
85
+ stages: StagesPropTypes,
86
+ stepsCount: number.isRequired,
87
+ subtitle: string,
88
+ summary: SummaryPropTypes,
89
+ tagline: string,
90
+ title: string,
91
+ topbar: TopbarPropTypes,
92
+ useMarkdown: bool
93
+ };
94
+ export default UTWorkflowContainer;
@@ -0,0 +1,14 @@
1
+ import { StyleSheet } from 'react-native';
2
+
3
+ export default StyleSheet.create({
4
+ container: {
5
+ backgroundColor: 'white',
6
+ flex: 1,
7
+ flexDirection: 'column',
8
+ width: '100%'
9
+ },
10
+ content: {
11
+ paddingBottom: 16,
12
+ paddingHorizontal: 16
13
+ }
14
+ });
@@ -0,0 +1,24 @@
1
+ import { arrayOf, func, shape, string } from 'prop-types';
2
+
3
+ export const SummaryPropTypes = shape({
4
+ actions: arrayOf(
5
+ shape({
6
+ icon: shape({
7
+ name: string,
8
+ type: string
9
+ }),
10
+ onPress: func,
11
+ title: string
12
+ })
13
+ ),
14
+ mainInfo: string,
15
+ title: string
16
+ });
17
+
18
+ export const MessagePropTypes = shape({
19
+ icon: shape({
20
+ name: string,
21
+ type: string
22
+ }),
23
+ title: string
24
+ });
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": "0.40.1",
5
+ "version": "0.41.1",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [