@widergy/mobile-ui 1.13.1 → 1.13.3

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.13.3](https://github.com/widergy/mobile-ui/compare/v1.13.2...v1.13.3) (2024-07-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * some fixes in icon ([#311](https://github.com/widergy/mobile-ui/issues/311)) ([9d57432](https://github.com/widergy/mobile-ui/commit/9d57432197c15b3200a6b1dafe982dc37c54cb5c))
7
+
8
+ ## [1.13.2](https://github.com/widergy/mobile-ui/compare/v1.13.1...v1.13.2) (2024-07-15)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * utworkflow spacing and utroundview shadows ([#310](https://github.com/widergy/mobile-ui/issues/310)) ([73fdfc2](https://github.com/widergy/mobile-ui/commit/73fdfc25f02f8caeb7ea04c5fe80d6b073d22a66))
14
+
1
15
  ## [1.13.1](https://github.com/widergy/mobile-ui/compare/v1.13.0...v1.13.1) (2024-07-12)
2
16
 
3
17
 
@@ -1,5 +1,5 @@
1
1
  <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
2
  <g id="eye-off">
3
- <path id="Vector (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M1.91078 1.91058C2.23622 1.58514 2.76386 1.58514 3.0893 1.91058L14.9861 13.8074C15.0321 13.8444 15.0748 13.8867 15.113 13.9343L18.0893 16.9106C18.4147 17.236 18.4147 17.7637 18.0893 18.0891C17.7639 18.4145 17.2362 18.4145 16.9108 18.0891L14.3384 15.5167C13.0039 16.2804 11.5544 16.6665 10 16.6665C6.2667 16.6665 3.25604 14.4606 0.943181 10.4133C0.796755 10.1571 0.796773 9.8425 0.943227 9.58629C1.92481 7.86906 3.03083 6.48078 4.27262 5.45092L1.91078 3.08909C1.58535 2.76366 1.58535 2.23602 1.91078 1.91058ZM5.45722 6.63553C4.45474 7.43811 3.5102 8.55088 2.63331 9.99993C4.71491 13.442 7.17738 14.9998 10 14.9998C11.1045 14.9998 12.1366 14.763 13.1068 14.2851L11.0783 12.2566C10.744 12.4166 10.3751 12.502 9.99748 12.5018C9.33435 12.5016 8.69848 12.2379 8.22974 11.7689C7.761 11.2998 7.4978 10.6637 7.49803 10.0006C7.49816 9.62354 7.58346 9.25529 7.74327 8.92157L5.45722 6.63553ZM9.3635 10.5418C9.37784 10.5587 9.39291 10.575 9.40867 10.5908C9.42457 10.6067 9.44104 10.6219 9.45805 10.6364L9.3635 10.5418ZM9.99709 4.99983C9.33243 4.99748 8.67077 5.08906 8.03173 5.27186C7.58925 5.39845 7.12792 5.14235 7.00134 4.69986C6.87476 4.25738 7.13086 3.79605 7.57335 3.66947C8.36287 3.44362 9.18033 3.3304 10.0015 3.33317C13.7342 3.33375 16.7443 5.53961 19.0569 9.58637C19.2033 9.84261 19.2033 10.1572 19.0568 10.4134C18.3832 11.5918 17.6523 12.6144 16.8595 13.4721C16.5471 13.8101 16.0199 13.8309 15.6819 13.5185C15.3439 13.2061 15.3232 12.6789 15.6356 12.3409C16.2384 11.6886 16.8161 10.9099 17.3668 9.99975C15.2852 6.55771 12.8227 4.99984 10 4.99984L9.99709 4.99983Z" fill="#677489"/>
3
+ <path id="Vector (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M1.91078 1.91058C2.23622 1.58514 2.76386 1.58514 3.0893 1.91058L14.9861 13.8074C15.0321 13.8444 15.0748 13.8867 15.113 13.9343L18.0893 16.9106C18.4147 17.236 18.4147 17.7637 18.0893 18.0891C17.7639 18.4145 17.2362 18.4145 16.9108 18.0891L14.3384 15.5167C13.0039 16.2804 11.5544 16.6665 10 16.6665C6.2667 16.6665 3.25604 14.4606 0.943181 10.4133C0.796755 10.1571 0.796773 9.8425 0.943227 9.58629C1.92481 7.86906 3.03083 6.48078 4.27262 5.45092L1.91078 3.08909C1.58535 2.76366 1.58535 2.23602 1.91078 1.91058ZM5.45722 6.63553C4.45474 7.43811 3.5102 8.55088 2.63331 9.99993C4.71491 13.442 7.17738 14.9998 10 14.9998C11.1045 14.9998 12.1366 14.763 13.1068 14.2851L11.0783 12.2566C10.744 12.4166 10.3751 12.502 9.99748 12.5018C9.33435 12.5016 8.69848 12.2379 8.22974 11.7689C7.761 11.2998 7.4978 10.6637 7.49803 10.0006C7.49816 9.62354 7.58346 9.25529 7.74327 8.92157L5.45722 6.63553ZM9.3635 10.5418C9.37784 10.5587 9.39291 10.575 9.40867 10.5908C9.42457 10.6067 9.44104 10.6219 9.45805 10.6364L9.3635 10.5418ZM9.99709 4.99983C9.33243 4.99748 8.67077 5.08906 8.03173 5.27186C7.58925 5.39845 7.12792 5.14235 7.00134 4.69986C6.87476 4.25738 7.13086 3.79605 7.57335 3.66947C8.36287 3.44362 9.18033 3.3304 10.0015 3.33317C13.7342 3.33375 16.7443 5.53961 19.0569 9.58637C19.2033 9.84261 19.2033 10.1572 19.0568 10.4134C18.3832 11.5918 17.6523 12.6144 16.8595 13.4721C16.5471 13.8101 16.0199 13.8309 15.6819 13.5185C15.3439 13.2061 15.3232 12.6789 15.6356 12.3409C16.2384 11.6886 16.8161 10.9099 17.3668 9.99975C15.2852 6.55771 12.8227 4.99984 10 4.99984L9.99709 4.99983Z" />
4
4
  </g>
5
5
  </svg>
@@ -1,3 +1,3 @@
1
1
  <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M3.15986 12C5.65779 16.1305 8.61278 18 12 18C15.3872 18 18.3422 16.1305 20.8401 12C18.3422 7.86948 15.3872 6 12 6C8.61278 6 5.65779 7.86948 3.15986 12ZM1.13177 11.5038C3.9072 6.64709 7.51999 4 12 4C16.48 4 20.0928 6.64709 22.8682 11.5038C23.0439 11.8113 23.0439 12.1887 22.8682 12.4962C20.0928 17.3529 16.48 20 12 20C7.51999 20 3.9072 17.3529 1.13177 12.4962C0.956077 12.1887 0.956077 11.8113 1.13177 11.5038ZM12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11ZM9 12C9 10.3431 10.3431 9 12 9C13.6569 9 15 10.3431 15 12C15 13.6569 13.6569 15 12 15C10.3431 15 9 13.6569 9 12Z" fill="#677489"/>
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3.15986 12C5.65779 16.1305 8.61278 18 12 18C15.3872 18 18.3422 16.1305 20.8401 12C18.3422 7.86948 15.3872 6 12 6C8.61278 6 5.65779 7.86948 3.15986 12ZM1.13177 11.5038C3.9072 6.64709 7.51999 4 12 4C16.48 4 20.0928 6.64709 22.8682 11.5038C23.0439 11.8113 23.0439 12.1887 22.8682 12.4962C20.0928 17.3529 16.48 20 12 20C7.51999 20 3.9072 17.3529 1.13177 12.4962C0.956077 12.1887 0.956077 11.8113 1.13177 11.5038ZM12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11ZM9 12C9 10.3431 10.3431 9 12 9C13.6569 9 15 10.3431 15 12C15 13.6569 13.6569 15 12 15C10.3431 15 9 13.6569 9 12Z" />
3
3
  </svg>
@@ -0,0 +1,9 @@
1
+ import VisibilityOff from './assets/eye-off.svg';
2
+ import Visibility from './assets/eye.svg';
3
+
4
+ export const DEFAULT_ICON_SIZE = 20;
5
+
6
+ export const CUSTOM_ICONS = {
7
+ visibility: Visibility,
8
+ 'visibility-off': VisibilityOff
9
+ };
@@ -0,0 +1,25 @@
1
+ import { string, number } from 'prop-types';
2
+ import React from 'react';
3
+
4
+ import { CUSTOM_ICONS, DEFAULT_ICON_SIZE } from './constants';
5
+
6
+ const CustomIcon = ({ height, name, size, width, fill = '#677489' }) => {
7
+ const CustomIconComponent = CUSTOM_ICONS[name];
8
+ return (
9
+ <CustomIconComponent
10
+ height={size || height || DEFAULT_ICON_SIZE}
11
+ width={size || width || DEFAULT_ICON_SIZE}
12
+ fill={fill}
13
+ />
14
+ );
15
+ };
16
+
17
+ CustomIcon.propTypes = {
18
+ height: number,
19
+ name: string,
20
+ size: number,
21
+ width: number,
22
+ fill: string
23
+ };
24
+
25
+ export default CustomIcon;
@@ -11,8 +11,7 @@ import SimpleLineIcon from 'react-native-vector-icons/SimpleLineIcons';
11
11
  import FeatherIcon from 'react-native-vector-icons/Feather';
12
12
  import AntIcon from 'react-native-vector-icons/AntDesign';
13
13
 
14
- import VisibilityOff from './assets/eye-off.svg';
15
- import Visibility from './assets/eye.svg';
14
+ import CustomIcon from './components/CustomIcon';
16
15
 
17
16
  const DEFAULT_ICON_COMPONENT = MaterialIcon;
18
17
  export const DEFAULT_ICON_TYPE = 'material';
@@ -29,9 +28,8 @@ const ICON_TYPES = {
29
28
  'material-community': MaterialCommunityIcon,
30
29
  octicon: OcticonIcon,
31
30
  'simple-line-icon': SimpleLineIcon,
32
- visibility: Visibility,
33
- 'visibility-off': VisibilityOff,
34
- zocial: ZocialIcon
31
+ zocial: ZocialIcon,
32
+ custom: CustomIcon
35
33
  };
36
34
 
37
35
  export const getIconComponent = type => ICON_TYPES[type] || DEFAULT_ICON_COMPONENT;
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import propTypes from './propTypes';
4
4
  import { getIconComponent, DEFAULT_ICON_TYPE, DEFAULT_ICON_SIZE } from './constants';
5
5
 
6
- const Icon = ({ color, height, name, size, style, type, width }) => {
6
+ const Icon = ({ color, height, name, size, style, type, width, fill }) => {
7
7
  const IconComponent = getIconComponent(type);
8
8
  return (
9
9
  <IconComponent
@@ -14,6 +14,7 @@ const Icon = ({ color, height, name, size, style, type, width }) => {
14
14
  style={style}
15
15
  type={type}
16
16
  width={size || width || DEFAULT_ICON_SIZE}
17
+ fill={fill}
17
18
  />
18
19
  );
19
20
  };
@@ -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
- <View style={[ownStyles.innerContainer, themedStyles?.innerContainer]}>{children}</View>
19
+ <ChildrenContainer position="top" style={[ownStyles.innerContainer, themedStyles?.innerContainer]}>
20
+ {children}
21
+ </ChildrenContainer>
17
22
  </Animated.View>
18
23
  );
19
24
  };
@@ -9,7 +9,7 @@ import Icon from '../../../../../Icon';
9
9
  import Touchable from '../../../../../Touchable';
10
10
 
11
11
  import { DEBOUNCE_DELAY, DEBOUNCE_CONFIG, VISIBILITY, VISIBILITY_OFF } from './constants';
12
- import styles from './styles';
12
+ import styles, { ICON_SIZE } from './styles';
13
13
 
14
14
  const BaseInput = forwardRef(
15
15
  (
@@ -62,7 +62,9 @@ const BaseInput = forwardRef(
62
62
 
63
63
  const hiddenInputProps = hiddenInput
64
64
  ? {
65
- type: showInput ? VISIBILITY : VISIBILITY_OFF,
65
+ name: showInput ? VISIBILITY : VISIBILITY_OFF,
66
+ size: ICON_SIZE,
67
+ color: theme.UTTextInput?.passwordEyeColor || theme.colors.primary,
66
68
  ...(RightIcon || {})
67
69
  }
68
70
  : {};
@@ -85,8 +87,9 @@ const BaseInput = forwardRef(
85
87
  select && { color: theme.fonts?.fontColor },
86
88
  select && disabled && { color: theme.fonts?.fontDisabledColor }
87
89
  ]}
90
+ id={props?.id ? `${props.id}` : undefined}
88
91
  />
89
- {RightIcon && (
92
+ {(RightIcon || hiddenInput) && (
90
93
  <Touchable
91
94
  borderless
92
95
  onPress={hiddenInput ? toggleShowInput : onRightIconPress}
@@ -118,6 +121,7 @@ BaseInput.propTypes = {
118
121
  onChange: func.isRequired,
119
122
  disabled: bool,
120
123
  value: string,
124
+ id: string,
121
125
  RightIcon: oneOf([shape({ name: string, type: string, color: string }), elementType]),
122
126
  hiddenInput: bool,
123
127
  onRightIconPress: func,
@@ -28,6 +28,7 @@ const TextInputField = forwardRef(
28
28
  alwaysShowPlaceholder,
29
29
  disabled,
30
30
  error,
31
+ id,
31
32
  inputSize,
32
33
  LeftIcon,
33
34
  maxCount,
@@ -145,6 +146,7 @@ const TextInputField = forwardRef(
145
146
  autoCapitalize={autoCapitalize}
146
147
  autoCorrect={false}
147
148
  editable={!disabled && !readOnly}
149
+ id={id ? `${id}` : undefined}
148
150
  keyboardType={keyboardType}
149
151
  maxLength={maxCount}
150
152
  multiline={multiline}
@@ -206,6 +208,7 @@ TextInputField.propTypes = {
206
208
  alwaysShowPlaceholder: bool,
207
209
  disabled: bool,
208
210
  error: string,
211
+ id: string,
209
212
  inputSize: string,
210
213
  LeftIcon: elementType,
211
214
  maxCount: number,
@@ -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 IconButton from '../IconButton';
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', icon } = {}
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
- <IconButton
46
- color={ownTheme?.icon || 'black'}
47
- name={icon?.name || 'arrow-left'}
48
- size={24}
49
- style={ownStyles.child}
50
- type={icon?.type || 'material-community'}
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}>
@@ -12,5 +12,10 @@ export default StyleSheet.create({
12
12
  flexDirection: 'row',
13
13
  justifyContent: 'flex-start',
14
14
  padding: 16
15
+ },
16
+ goBack: {
17
+ paddingHorizontal: 4,
18
+ paddingVertical: 4,
19
+ marginRight: 16
15
20
  }
16
21
  });
@@ -1,6 +1,7 @@
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';
@@ -14,7 +15,7 @@ import ActionButtonPropTypes from './components/ActionButton/types';
14
15
  import ownStyles from './styles';
15
16
  import { NEXT, RETURN } from './constants';
16
17
 
17
- const BottomActions = ({ nextButton, returnButton, summary, message, style }) => {
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 ? (
@@ -114,6 +115,7 @@ const BottomActions = ({ nextButton, returnButton, summary, message, style }) =>
114
115
  };
115
116
 
116
117
  BottomActions.propTypes = {
118
+ bottomSafeArea: number,
117
119
  message: MessagePropTypes,
118
120
  nextButton: ActionButtonPropTypes,
119
121
  returnButton: ActionButtonPropTypes,
@@ -12,6 +12,9 @@ export default StyleSheet.create({
12
12
  padding: 16,
13
13
  width: '100%'
14
14
  },
15
+ bottomSafeArea: safeArea => ({
16
+ paddingBottom: safeArea + 16
17
+ }),
15
18
  bottomNav: {
16
19
  backgroundColor: 'white'
17
20
  },
@@ -1,7 +1,8 @@
1
1
  import React, { useEffect } from 'react';
2
- import { SafeAreaView, ScrollView } from 'react-native';
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
- <SafeAreaView style={themedStyles.container}>
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
- </SafeAreaView>
82
+ </View>
79
83
  );
80
84
  };
81
85
  UTWorkflowContainer.propTypes = {
@@ -10,5 +10,8 @@ export default StyleSheet.create({
10
10
  content: {
11
11
  paddingBottom: 16,
12
12
  paddingHorizontal: 16
13
- }
13
+ },
14
+ topSafeArea: safeArea => ({
15
+ paddingTop: safeArea
16
+ })
14
17
  });
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.1",
5
+ "version": "1.13.3",
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": {