@widergy/mobile-ui 1.32.0 → 1.32.2

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.32.2](https://github.com/widergy/mobile-ui/compare/v1.32.1...v1.32.2) (2024-11-15)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * [UG-2034] configurable selected header action ([#387](https://github.com/widergy/mobile-ui/issues/387)) ([1028860](https://github.com/widergy/mobile-ui/commit/102886072ffb42cfe8d3705355dcfd81ebfaab91))
7
+
8
+ ## [1.32.1](https://github.com/widergy/mobile-ui/compare/v1.32.0...v1.32.1) (2024-11-15)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * [UG-2249] disabled prop added in UTSwitch ([#388](https://github.com/widergy/mobile-ui/issues/388)) ([49181f4](https://github.com/widergy/mobile-ui/commit/49181f45b61662dbedc31c377f9b013ec4a5efa5))
14
+
1
15
  # [1.32.0](https://github.com/widergy/mobile-ui/compare/v1.31.3...v1.32.0) (2024-11-06)
2
16
 
3
17
 
@@ -83,7 +83,8 @@ Header.propTypes = {
83
83
  isPrimary: bool,
84
84
  label: string,
85
85
  loading: bool,
86
- onPress: func
86
+ onPress: func,
87
+ selectedDefault: bool
87
88
  })
88
89
  ),
89
90
  headerActionsProps: shape({
@@ -13,7 +13,9 @@ import { processActions } from './utils';
13
13
  import styles from './styles';
14
14
 
15
15
  const HeaderActions = ({ headerActions, headerActionsProps }) => {
16
- const [selectedAction, setSelectedAction] = useState(null);
16
+ const [selectedAction, setSelectedAction] = useState(
17
+ headerActions.find(({ selectedDefault }) => selectedDefault)?.id
18
+ );
17
19
  const showButtonGroup = headerActionsProps.variant === HEADER_ACTIONS_VARIANTS.BUTTON_GROUP;
18
20
  const { colorTheme: buttonGroupColorTheme = 'secondary', shape: buttonGroupShape } =
19
21
  headerActionsProps?.buttonGroupProps || {};
@@ -71,7 +73,8 @@ HeaderActions.propTypes = {
71
73
  isPrimary: bool,
72
74
  label: string,
73
75
  loading: bool,
74
- onPress: func
76
+ onPress: func,
77
+ selectedDefault: bool
75
78
  })
76
79
  ),
77
80
  headerActionsProps: shape({
@@ -137,7 +137,8 @@ UTActionCard.propTypes = {
137
137
  isPrimary: bool,
138
138
  label: string,
139
139
  loading: bool,
140
- onPress: func
140
+ onPress: func,
141
+ selectedDefault: bool
141
142
  })
142
143
  ),
143
144
  headerActionsProps: shape({
@@ -9,6 +9,7 @@ import ownStyles from './styles';
9
9
  import switchProptypes from './proptypes';
10
10
 
11
11
  const UTSwitch = ({
12
+ disabled,
12
13
  style,
13
14
  onColor,
14
15
  offColor,
@@ -96,7 +97,7 @@ const UTSwitch = ({
96
97
 
97
98
  return (
98
99
  <TouchableWithoutFeedback
99
- disabled={disablePress}
100
+ disabled={disablePress || disabled}
100
101
  onPressIn={onClick}
101
102
  onPressOut={onClickEnd}
102
103
  hitSlop={hitSlop}
@@ -116,6 +117,7 @@ const UTSwitch = ({
116
117
  ]
117
118
  })
118
119
  },
120
+ disabled && ownStyles.disabled,
119
121
  style
120
122
  ]}
121
123
  >
@@ -1,7 +1,8 @@
1
- import { string, func, any, shape, number } from 'prop-types';
1
+ import { string, func, any, shape, number, bool } from 'prop-types';
2
2
  import { ViewPropTypes } from 'deprecated-react-native-prop-types';
3
3
 
4
4
  export default {
5
+ disabled: bool,
5
6
  style: ViewPropTypes.style,
6
7
  onColor: string,
7
8
  offColor: string,
@@ -12,5 +12,8 @@ export default StyleSheet.create({
12
12
  backgroundColor: 'red',
13
13
  position: 'absolute',
14
14
  zIndex: -1
15
+ },
16
+ disabled: {
17
+ opacity: 0.5
15
18
  }
16
19
  });
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.32.0",
5
+ "version": "1.32.2",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [