@widergy/mobile-ui 1.16.3 → 1.17.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,17 @@
1
+ ## [1.17.1](https://github.com/widergy/mobile-ui/compare/v1.17.0...v1.17.1) (2024-08-12)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * new icons ([#332](https://github.com/widergy/mobile-ui/issues/332)) ([d53fbbb](https://github.com/widergy/mobile-ui/commit/d53fbbb913752bc2f8c8c045e64070685f1bc469))
7
+
8
+ # [1.17.0](https://github.com/widergy/mobile-ui/compare/v1.16.3...v1.17.0) (2024-08-09)
9
+
10
+
11
+ ### Features
12
+
13
+ * badge for utworkflow summary ([#328](https://github.com/widergy/mobile-ui/issues/328)) ([3ba4b6f](https://github.com/widergy/mobile-ui/commit/3ba4b6fe85872f20d55de2a315c1632c185fe687))
14
+
1
15
  ## [1.16.3](https://github.com/widergy/mobile-ui/compare/v1.16.2...v1.16.3) (2024-08-08)
2
16
 
3
17
 
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { Fragment } from 'react';
2
2
 
3
3
  import Label from '../Label';
4
4
  import PhotoAlbum from '../PhotoAlbum';
@@ -27,7 +27,7 @@ const Capture = ({
27
27
  const isItPossibleToAddAnotherPhoto = isOnlyOnePicture ? false : images.length <= maxImages;
28
28
 
29
29
  return (
30
- <>
30
+ <Fragment>
31
31
  {!!label && (
32
32
  <Label semiBold big style={styles.paddingText}>
33
33
  {label}
@@ -51,7 +51,7 @@ const Capture = ({
51
51
  onError={onError}
52
52
  />
53
53
  {!!helpText && <Label style={styles.paddingText}>{helpText}</Label>}
54
- </>
54
+ </Fragment>
55
55
  );
56
56
  };
57
57
  Capture.propTypes = propTypes;
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable react/sort-comp */
2
2
  /* eslint-disable class-methods-use-this */
3
3
  // TODO implement horizontal repositioning.
4
- import React, { Component, createRef } from 'react';
4
+ import React, { Component, createRef, Fragment } from 'react';
5
5
  import { Animated, ScrollView, View } from 'react-native';
6
6
 
7
7
  import Overlay from '../Overlay';
@@ -246,7 +246,7 @@ class Dropdown extends Component {
246
246
  });
247
247
 
248
248
  return (
249
- <>
249
+ <Fragment>
250
250
  <View collapsable={false} ref={this.anchor}>
251
251
  {anchor}
252
252
  </View>
@@ -295,7 +295,7 @@ class Dropdown extends Component {
295
295
  </TransformView>
296
296
  </View>
297
297
  </Overlay>
298
- </>
298
+ </Fragment>
299
299
  );
300
300
  }
301
301
  }
@@ -26,7 +26,7 @@ const Picker = ({
26
26
  disabled = false,
27
27
  UploadIcon
28
28
  }) => (
29
- <>
29
+ <Fragment>
30
30
  {!!title && (
31
31
  <Label
32
32
  useMarkdown={withMarkdownTitle}
@@ -67,7 +67,7 @@ const Picker = ({
67
67
  <Text style={styles.pickerText}>{pickerText}</Text>
68
68
  </View>
69
69
  <Text style={styles.helpText}>{helpText}</Text>
70
- </>
70
+ </Fragment>
71
71
  );
72
72
 
73
73
  Picker.propTypes = {
@@ -27,7 +27,7 @@ const UploadedFiles = ({
27
27
  uploadedFiles,
28
28
  withMarkdownTitle
29
29
  }) => (
30
- <>
30
+ <Fragment>
31
31
  {!!title && (
32
32
  <Label
33
33
  useMarkdown={withMarkdownTitle}
@@ -113,7 +113,7 @@ const UploadedFiles = ({
113
113
  <Text style={styles.pickerText}>{pickerText}</Text>
114
114
  </View>
115
115
  <Text style={styles.helpText}>{helpText}</Text>
116
- </>
116
+ </Fragment>
117
117
  );
118
118
 
119
119
  UploadedFiles.propTypes = {
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useState } from 'react';
1
+ import React, { Fragment, useEffect, useState } from 'react';
2
2
  // eslint-disable-next-line react-native/split-platform-components
3
3
  import { View, TouchableOpacity, PermissionsAndroid } from 'react-native';
4
4
  // eslint-disable-next-line import/no-unresolved
@@ -108,7 +108,7 @@ const PhotoAlbum = ({
108
108
  }, [selectedImages]);
109
109
 
110
110
  return (
111
- <>
111
+ <Fragment>
112
112
  {title && (
113
113
  <Label big semiBold color="#666666" style={styles.title}>
114
114
  {title}
@@ -163,7 +163,7 @@ const PhotoAlbum = ({
163
163
  </Portal>
164
164
  )}
165
165
  </View>
166
- </>
166
+ </Fragment>
167
167
  );
168
168
  };
169
169
 
@@ -24,7 +24,7 @@ const Picker = ({
24
24
  markdownStyles,
25
25
  disabled = false
26
26
  }) => (
27
- <>
27
+ <Fragment>
28
28
  {!!title && (
29
29
  <Label
30
30
  useMarkdown={withMarkdownTitle}
@@ -55,7 +55,7 @@ const Picker = ({
55
55
  />
56
56
  </Touchable>
57
57
  </View>
58
- </>
58
+ </Fragment>
59
59
  );
60
60
 
61
61
  Picker.propTypes = {
@@ -1,4 +1,4 @@
1
- import React, { Component } from 'react';
1
+ import React, { Component, Fragment } from 'react';
2
2
  import { ViewPropTypes } from 'deprecated-react-native-prop-types';
3
3
  import { View } from 'react-native';
4
4
  import PropTypes from 'prop-types';
@@ -33,7 +33,7 @@ class RadioButton extends Component {
33
33
  disabled
34
34
  } = this.props;
35
35
  return (
36
- <>
36
+ <Fragment>
37
37
  <Touchable onPress={this.handlePress} disabled={disabled}>
38
38
  <View style={[styles.container, style]}>
39
39
  {descriptionComponent ? (
@@ -47,7 +47,7 @@ class RadioButton extends Component {
47
47
  />
48
48
  </View>
49
49
  ) : (
50
- <>
50
+ <Fragment>
51
51
  <Icon
52
52
  name={status ? RADIO_CHECKED_ICON : RADIO_UNCHECKED_ICON}
53
53
  color={status ? theme.colors.primary : theme.colors.disabled}
@@ -73,12 +73,12 @@ class RadioButton extends Component {
73
73
  {labelValue}
74
74
  </Label>
75
75
  )}
76
- </>
76
+ </Fragment>
77
77
  )}
78
78
  </View>
79
79
  </Touchable>
80
80
  {showSeparatorBar && <SeparatorBar />}
81
- </>
81
+ </Fragment>
82
82
  );
83
83
  }
84
84
  }
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import React, { Fragment, useState } from 'react';
2
2
  import { number, string, arrayOf, shape, any } from 'prop-types';
3
3
  import { View } from 'react-native';
4
4
 
@@ -80,7 +80,7 @@ const Indicator = ({
80
80
  </View>
81
81
 
82
82
  {consumptionLimit && (
83
- <>
83
+ <Fragment>
84
84
  <View
85
85
  style={[styles.limitLabel, { left: limitTextPosition, top: -limitDimensions.height - 33 - 15 }]}
86
86
  onLayout={handleLimitDimensions}
@@ -98,7 +98,7 @@ const Indicator = ({
98
98
  </Label>
99
99
  </View>
100
100
  <IndicatorIcon position={limitIndicatorPosition} inverted />
101
- </>
101
+ </Fragment>
102
102
  )}
103
103
  </View>
104
104
  );
@@ -7,7 +7,7 @@ import { withTheme, themeType } from '../../theming';
7
7
  import IconButton from '../IconButton';
8
8
  import Label from '../Label';
9
9
  import { IS_ANDROID } from '../../utils/platformUtils/constants';
10
- import { SHADOW_COLOR, SHADOW_OPACITY } from '../../utils/styleUtils';
10
+ import { SHADOW_OPACITY } from '../../utils/styleUtils';
11
11
 
12
12
  import styles, { alertStyleMapper } from './styles';
13
13
  import { INFO, DURATION } from './constants';
@@ -139,7 +139,7 @@ class Snackbar extends Component {
139
139
  }
140
140
  : {
141
141
  opacity,
142
- shadowColor: SHADOW_COLOR,
142
+ shadowColor: 'black',
143
143
  shadowOpacity: SHADOW_OPACITY,
144
144
  shadowRadius: 3,
145
145
  shadowOffset: {
@@ -0,0 +1,11 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_1513_1276)">
3
+ <path fill="none" d="M8.9571 3.47452C7.59289 3.96492 6.65875 4.65852 5.83287 5.44331C4.66883 6.54945 3.82194 7.94688 3.38002 9.49066C2.93811 11.0344 2.91728 12.6683 3.31968 14.2229C3.72209 15.7774 4.53308 17.196 5.66854 18.3314C6.804 19.4669 8.22257 20.2779 9.77711 20.6803C11.3316 21.0827 12.9655 21.0619 14.5093 20.6199C16.0531 20.178 17.4505 19.3311 18.5567 18.1671C19.1683 17.5234 19.6786 16.7957 20.0739 16.0092" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
4
+ <path d="M21.0526 11.5526C21.0526 7.13302 17.0872 3 12.5 3V11.5526H21.0526Z" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5
+ </g>
6
+ <defs>
7
+ <clipPath id="clip0_1513_1276">
8
+ <rect width="24" height="24" fill="white"/>
9
+ </clipPath>
10
+ </defs>
11
+ </svg>
@@ -0,0 +1,13 @@
1
+ <svg width="25" height="24" viewBox="0 0 25 24" fill="none" stroke="currentColor" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_1513_1290)">
3
+ <path fill="none" d="M6.9506 20.036C4.84979 18.3884 3.5 15.8269 3.5 12.95C3.5 7.97945 7.52944 3.95001 12.5 3.95001C17.4706 3.95001 21.5 7.97945 21.5 12.95C21.5 15.8269 20.1502 18.3884 18.0494 20.036" stroke-width="2" stroke-linecap="round"/>
4
+ <path d="M10.5 13C10.5 13.5304 10.7107 14.0391 11.0858 14.4142C11.4609 14.7893 11.9696 15 12.5 15C13.0304 15 13.5391 14.7893 13.9142 14.4142C14.2893 14.0391 14.5 13.5304 14.5 13C14.5 12.4696 14.2893 11.9609 13.9142 11.5858C13.5391 11.2107 13.0304 11 12.5 11C11.9696 11 11.4609 11.2107 11.0858 11.5858C10.7107 11.9609 10.5 12.4696 10.5 13Z" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5
+ <path d="M13.95 11.55L16 9.5Z" />
6
+ <path d="M13.95 11.55L16 9.5" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
7
+ </g>
8
+ <defs>
9
+ <clipPath id="clip0_1513_1290">
10
+ <rect width="24" height="24" fill="white" transform="translate(0.5)"/>
11
+ </clipPath>
12
+ </defs>
13
+ </svg>
@@ -0,0 +1,12 @@
1
+ <svg width="25" height="24" viewBox="0 0 25 24" fill="none" stroke="currentColor" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_1513_1313)">
3
+ <path d="M12.0325 3L4.00485 12V20.994H20.0934V12L12.0325 3Z" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
4
+ <path d="M9.0325 21C9.0325 21 9.0325 15.5304 9.0325 15C9.0325 14.4696 9.03251 13 9.03251 13L11.0325 13H13.0325H15.0325V15V21"/>
5
+ <path d="M9.0325 21C9.0325 21 9.0325 15.5304 9.0325 15C9.0325 14.4696 9.03251 13 9.03251 13L11.0325 13H13.0325H15.0325V15V21" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
6
+ </g>
7
+ <defs>
8
+ <clipPath id="clip0_1513_1313">
9
+ <rect width="24" height="24" fill="white" transform="translate(0.0325012)"/>
10
+ </clipPath>
11
+ </defs>
12
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="25" height="25" fill="none" stroke="currentColor" viewBox="0 0 25 25" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M8.91017 20.1798C8.91017 22.4293 3.34671 22.4918 3.34671 20.1798V12.0575C3.34671 10.7441 3.34671 9.49547 4.9089 8.40194C6.47109 7.3084 9.06433 5.34004 9.6892 4.87138C10.3141 4.40272 10.939 3.91899 11.8138 3.90282C12.6886 3.88665 13.126 4.21526 13.9071 4.87138C14.6882 5.5275 16.7191 7.05845 18.4062 8.40194C20.0934 9.74542 20.0934 10.7444 20.0934 12.0575V20.1798C20.0934 22.4293 14.892 22.523 14.892 20.1798V16.8571C14.892 14.1398 13.3378 13.2184 11.8138 13.2713C10.348 13.3221 8.91017 14.2436 8.91017 16.8571V20.1798Z" stroke-width="2"/>
3
+ </svg>
@@ -1,6 +1,10 @@
1
1
  import EnergyIconCar from './components/EnergyIcons/EnergyIconCar.svg';
2
2
  import EnergyIconCart from './components/EnergyIcons/EnergyIconCart.svg';
3
+ import EnergyIconChartPie from './components/EnergyIcons/EnergyIconChartPie.svg';
4
+ import EnergyIconGraphicCircle from './components/EnergyIcons/EnergyIconGraphicCircle.svg';
3
5
  import EnergyIconHome from './components/EnergyIcons/EnergyIconHome.svg';
6
+ import EnergyIconHome2 from './components/EnergyIcons/EnergyIconHome2.svg';
7
+ import EnergyIconHome3 from './components/EnergyIcons/EnergyIconHome3.svg';
4
8
  import EnergyIconTruck from './components/EnergyIcons/EnergyIconTruck.svg';
5
9
 
6
10
  export const SHADES = {
@@ -33,6 +37,10 @@ export const DEFAULT_INTERNAL_SHADE = SHADES.shade02;
33
37
  export const ENERGY_ICONS = {
34
38
  EnergyIconCar,
35
39
  EnergyIconCart,
40
+ EnergyIconChartPie,
41
+ EnergyIconGraphicCircle,
36
42
  EnergyIconHome,
43
+ EnergyIconHome2,
44
+ EnergyIconHome3,
37
45
  EnergyIconTruck
38
46
  };
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable react-native/no-inline-styles */
2
- import React from 'react';
2
+ import React, { Fragment } from 'react';
3
3
  import { Animated } from 'react-native';
4
4
 
5
5
  import Label from '../../../Label';
@@ -9,7 +9,7 @@ import propTypes from './propTypes';
9
9
  import ownStyles from './styles';
10
10
 
11
11
  const CardContent = ({ onPress, currentPage, opacity, styles, buttonTitle = '', disabled }) => (
12
- <>
12
+ <Fragment>
13
13
  <Animated.View style={[styles?.textContainer, { opacity }]}>
14
14
  <Label big bold style={styles?.title}>
15
15
  {currentPage?.title || ''}
@@ -26,7 +26,7 @@ const CardContent = ({ onPress, currentPage, opacity, styles, buttonTitle = '',
26
26
  {...styles?.buttonProps}
27
27
  disabled={disabled}
28
28
  />
29
- </>
29
+ </Fragment>
30
30
  );
31
31
 
32
32
  CardContent.propTypes = propTypes;
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable react/prop-types */
2
- import React, { useEffect, useRef, useState } from 'react';
2
+ import React, { Fragment, useEffect, useRef, useState } from 'react';
3
3
  import { Animated, TouchableOpacity, View } from 'react-native';
4
4
  import _ from 'lodash';
5
5
 
@@ -115,7 +115,7 @@ const StepFeedback = ({
115
115
  };
116
116
 
117
117
  return (
118
- <>
118
+ <Fragment>
119
119
  <View style={styles.stepContainer}>
120
120
  <Wrapper onStepPress={onStepPress} status={status} step={step}>
121
121
  <View style={styles.centerStepContainer}>
@@ -133,7 +133,7 @@ const StepFeedback = ({
133
133
  {index < steps.length - 1 && (
134
134
  <View style={[styles.stepSeparator, status.isComplete && styles.stepSeparatorComplete]} />
135
135
  )}
136
- </>
136
+ </Fragment>
137
137
  );
138
138
  };
139
139
 
@@ -81,7 +81,7 @@ const OutlinedInput = ({
81
81
  : focused
82
82
  ? 2
83
83
  : disabled
84
- ? themeStyles?.inactive?.disabledBorderWidth ?? 1
84
+ ? (themeStyles?.inactive?.disabledBorderWidth ?? 1)
85
85
  : 1,
86
86
  borderColor: active ? activeColor : inactiveColor
87
87
  },
@@ -9,6 +9,7 @@ import Icon from '../../../../../Icon';
9
9
  import Checkbox from '../../../../../Checkbox';
10
10
  import { MessagePropTypes, SummaryPropTypes } from '../../types';
11
11
  import UTButton from '../../../../../UTButton';
12
+ import UTBadge from '../../../../../UTBadge';
12
13
 
13
14
  import ActionButton from './components/ActionButton';
14
15
  import ActionButtonPropTypes from './components/ActionButton/types';
@@ -40,24 +41,26 @@ const BottomActions = ({ bottomSafeArea, message, nextButton, returnButton, summ
40
41
  )}
41
42
  {summary.actions && !checkboxProps && (
42
43
  <View style={themedStyles.summaryActions}>
43
- {summary.actions.map(({ Icon: actionIcon, title, onPress, disabled }, index) => (
44
- <UTButton
45
- disabled={disabled}
46
- Icon={actionIcon}
44
+ {summary.actions.map(({ Icon: actionIcon, title, onPress, badge, disabled }, index) => (
45
+ <View
47
46
  key={actionIcon}
48
- onPress={onPress}
49
- size="small"
50
- style={{
51
- root: {
52
- ...themedStyles.summaryActionContainer,
53
- ...(index !== summary.actions.length - 1 && themedStyles.summaryActionsChild)
54
- },
55
- childrenContainer: themedStyles.summaryActionButton
56
- }}
57
- variant="semitransparent"
47
+ style={index !== summary.actions.length - 1 && themedStyles.summaryActionsChild}
58
48
  >
59
- {title}
60
- </UTButton>
49
+ {badge && <UTBadge style={themedStyles.summaryActionBadge}>{badge}</UTBadge>}
50
+ <UTButton
51
+ disabled={disabled}
52
+ Icon={actionIcon}
53
+ onPress={onPress}
54
+ size="small"
55
+ style={{
56
+ root: themedStyles.summaryActionContainer,
57
+ childrenContainer: themedStyles.summaryActionButton
58
+ }}
59
+ variant="semitransparent"
60
+ >
61
+ {title}
62
+ </UTButton>
63
+ </View>
61
64
  ))}
62
65
  </View>
63
66
  )}
@@ -48,6 +48,12 @@ export default StyleSheet.create({
48
48
  justifyContent: 'space-between',
49
49
  padding: 16
50
50
  },
51
+ summaryActionBadge: {
52
+ position: 'absolute',
53
+ right: -6,
54
+ top: -6,
55
+ zIndex: 10
56
+ },
51
57
  summaryActionContainer: {
52
58
  paddingVertical: 8
53
59
  },
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect } from 'react';
2
2
  import { ScrollView, View } from 'react-native';
3
- import { number, func, shape, bool, string, element } from 'prop-types';
3
+ import { number, func, shape, bool, string, element, oneOfType } from 'prop-types';
4
4
  import { merge } from 'lodash';
5
5
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
6
6
 
@@ -98,10 +98,10 @@ UTWorkflowContainer.propTypes = {
98
98
  scrollable: bool,
99
99
  stages: StagesPropTypes,
100
100
  stepsCount: number.isRequired,
101
- subtitle: string,
101
+ subtitle: oneOfType([string, element]),
102
102
  summary: SummaryPropTypes,
103
103
  tagline: string,
104
- title: string,
104
+ title: oneOfType([string, element]),
105
105
  topbar: TopbarPropTypes,
106
106
  useMarkdown: bool
107
107
  };
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.16.3",
5
+ "version": "1.17.1",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [