@widergy/mobile-ui 1.4.1 → 1.4.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.4.3](https://github.com/widergy/mobile-ui/compare/v1.4.2...v1.4.3) (2024-04-15)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * utselectablecard width with long titles ([#274](https://github.com/widergy/mobile-ui/issues/274)) ([32def84](https://github.com/widergy/mobile-ui/commit/32def847aeaca0d10598aad28c2b9625aa42826a))
7
+
8
+ ## [1.4.2](https://github.com/widergy/mobile-ui/compare/v1.4.1...v1.4.2) (2024-04-15)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * native back button handler for UTTopbar ([#272](https://github.com/widergy/mobile-ui/issues/272)) ([36f8fd7](https://github.com/widergy/mobile-ui/commit/36f8fd7f467a7c0f342fc9d844452eec385e99a8))
14
+
1
15
  ## [1.4.1](https://github.com/widergy/mobile-ui/compare/v1.4.0...v1.4.1) (2024-04-04)
2
16
 
3
17
 
@@ -70,8 +70,8 @@ const Checkbox = ({
70
70
  disabled
71
71
  ? disabledCheckedColor || theme.colors.disabled
72
72
  : checked
73
- ? checkedColor || theme.colors.primary
74
- : uncheckedColor || theme.colors.checkbox.unchecked
73
+ ? checkedColor || theme.colors.primary
74
+ : uncheckedColor || theme.colors.checkbox.unchecked
75
75
  }
76
76
  name={checked ? CHECKED_ICON : UNCHECKED_ICON}
77
77
  size={iconSize}
@@ -22,8 +22,8 @@ class ListView extends PureComponent {
22
22
  return isMultiple
23
23
  ? !!selectedOption?.find?.(elem => elem === item.value)
24
24
  : !query
25
- ? item.id === selectedOption
26
- : item.id === filteredOptions[0].id;
25
+ ? item.id === selectedOption
26
+ : item.id === filteredOptions[0].id;
27
27
  };
28
28
 
29
29
  handleOnPress = item => {
@@ -62,10 +62,10 @@ const UTSelectableCard = ({
62
62
  )}
63
63
  <View style={themedStyles.textContainer}>
64
64
  <View style={themedStyles.column}>
65
- <View style={themedStyles.titleAndTooltip}>
65
+ <View style={[themedStyles.titleAndTooltip, selected && themedStyles.selectedTitleAndTooltip]}>
66
66
  <Label
67
67
  color={selected ? selectedColor : disabled ? disabledColor : baseColor}
68
- style={themedStyles.title}
68
+ style={tooltip && themedStyles.titleMargin}
69
69
  >
70
70
  {titleText}
71
71
  </Label>
@@ -30,7 +30,7 @@ export const getUTSelectableCardStyles = (theme = {}) =>
30
30
  flexGrow: 1,
31
31
  justifyContent: 'space-between'
32
32
  },
33
- title: {
33
+ titleMargin: {
34
34
  marginRight: 8
35
35
  },
36
36
  titleAndTooltip: {
@@ -38,6 +38,9 @@ export const getUTSelectableCardStyles = (theme = {}) =>
38
38
  display: 'flex',
39
39
  flexDirection: 'row'
40
40
  },
41
+ selectedTitleAndTooltip: {
42
+ maxWidth: 300
43
+ },
41
44
 
42
45
  // Sizes
43
46
  mediumSize: {
@@ -91,8 +91,8 @@ const UTSwitch = ({
91
91
  thumbTrackDiference <= 0
92
92
  ? trackLength - thumbSize
93
93
  : thumbTrackDiference > thumbSize / 2
94
- ? trackLength - thumbSize * 1.5
95
- : trackLength - thumbSize * 1.2;
94
+ ? trackLength - thumbSize * 1.5
95
+ : trackLength - thumbSize * 1.2;
96
96
 
97
97
  return (
98
98
  <TouchableWithoutFeedback
@@ -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, { ICON_SIZE } from './styles';
12
+ import styles from './styles';
13
13
 
14
14
  const BaseInput = forwardRef(
15
15
  (
@@ -79,10 +79,10 @@ const OutlinedInput = ({
79
79
  borderWidth: borderless
80
80
  ? 0
81
81
  : focused
82
- ? 2
83
- : disabled
84
- ? themeStyles?.inactive?.disabledBorderWidth ?? 1
85
- : 1,
82
+ ? 2
83
+ : disabled
84
+ ? themeStyles?.inactive?.disabledBorderWidth ?? 1
85
+ : 1,
86
86
  borderColor: active ? activeColor : inactiveColor
87
87
  },
88
88
  styles?.inputContainer
@@ -1,6 +1,8 @@
1
- import React from 'react';
2
- import { View } from 'react-native';
1
+ import React, { useCallback } from 'react';
2
+ import { BackHandler, View } from 'react-native';
3
3
  import { number } from 'prop-types';
4
+ // eslint-disable-next-line import/no-extraneous-dependencies
5
+ import { useFocusEffect } from '@react-navigation/native';
4
6
 
5
7
  import IconButton from '../IconButton';
6
8
  import Label from '../Label';
@@ -23,6 +25,19 @@ const UTTopbar = ({
23
25
 
24
26
  const ownTheme = theme.UTWorkflowContainer?.topbar?.[colorTheme];
25
27
 
28
+ useFocusEffect(
29
+ useCallback(() => {
30
+ const onBackPress = () => {
31
+ goBack();
32
+ return true;
33
+ };
34
+
35
+ const subscription = BackHandler.addEventListener('hardwareBackPress', onBackPress);
36
+
37
+ return () => subscription.remove();
38
+ }, [goBack])
39
+ );
40
+
26
41
  return (
27
42
  <View>
28
43
  <View style={[ownStyles.container, ownTheme?.container]}>
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.4.1",
5
+ "version": "1.4.3",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [
@@ -23,17 +23,18 @@
23
23
  "prepare": "husky install"
24
24
  },
25
25
  "peerDependencies": {
26
+ "@bam.tech/react-native-image-resizer": "^3.0.7",
26
27
  "prop-types": "*",
27
28
  "react": "*",
28
29
  "react-native": "*",
29
30
  "react-native-document-picker": "^9.0.1",
30
31
  "react-native-image-picker": "^5.0.0",
31
32
  "react-native-pager-view": "^6.2.0",
32
- "@bam.tech/react-native-image-resizer": "^3.0.7",
33
33
  "react-native-svg": "^13.0.0",
34
34
  "react-native-vector-icons": "^10.0.0"
35
35
  },
36
36
  "dependencies": {
37
+ "@react-navigation/native": "^6.1.9",
37
38
  "@widergy/web-utils": "^2.0.0",
38
39
  "core-js": "3",
39
40
  "deprecated-react-native-prop-types": "^4.2.1",