@widergy/mobile-ui 1.32.11 → 1.32.13

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.13](https://github.com/widergy/mobile-ui/compare/v1.32.12...v1.32.13) (2024-12-20)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * [DS-368] implement argos events ([#399](https://github.com/widergy/mobile-ui/issues/399)) ([eda2408](https://github.com/widergy/mobile-ui/commit/eda2408afe760aafcfc3f2f8718a3929302ab92e))
7
+
8
+ ## [1.32.12](https://github.com/widergy/mobile-ui/compare/v1.32.11...v1.32.12) (2024-12-11)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * [UGC-1038] text scaling adjustments ([#398](https://github.com/widergy/mobile-ui/issues/398)) ([368fb41](https://github.com/widergy/mobile-ui/commit/368fb4158f03c9f1cf5c7a105aa7074bceb1eac5))
14
+
1
15
  ## [1.32.11](https://github.com/widergy/mobile-ui/compare/v1.32.10...v1.32.11) (2024-12-06)
2
16
 
3
17
 
@@ -1,7 +1,7 @@
1
1
  import { COLOR_SHADES } from '../../constants/Palette';
2
2
  import { getDefaultColorShade } from '../../utils/styleUtils';
3
3
  import { IS_IOS } from '../../utils/platformUtils/constants';
4
- import { scale } from '../../utils/scaleUtils';
4
+ import { factorScale } from '../../utils/scaleUtils';
5
5
 
6
6
  import { LINE_HEIGHTS, VARIANTS_SIZES, WEIGHTS } from './constants';
7
7
  import { DEFAULT_PROPS } from './proptypes';
@@ -17,7 +17,8 @@ export const getFontFamily = (theme, weight) =>
17
17
  ? theme.fonts.fontFamily
18
18
  : theme.fonts?.customVariants?.[weight]?.fontFamily;
19
19
 
20
- export const getFontSize = variant => scale(VARIANTS_SIZES[variant] || VARIANTS_SIZES[DEFAULT_PROPS.variant]);
20
+ export const getFontSize = variant =>
21
+ factorScale(VARIANTS_SIZES[variant] || VARIANTS_SIZES[DEFAULT_PROPS.variant]);
21
22
 
22
23
  export const getFontWeight = weight => (IS_IOS ? WEIGHTS[weight] || WEIGHTS[DEFAULT_PROPS.weight] : null);
23
24
 
@@ -44,5 +45,5 @@ export const retrieveStyle = ({ colorTheme, field, shade, theme, variant, weight
44
45
  margin: 0,
45
46
  paddingVertical: 0,
46
47
  textAlignVertical: 'center',
47
- ...(LINE_HEIGHTS?.[variant] ? { lineHeight: scale(LINE_HEIGHTS[variant]) } : {})
48
+ ...(LINE_HEIGHTS?.[variant] ? { lineHeight: factorScale(LINE_HEIGHTS[variant]) } : {})
48
49
  });
@@ -2,14 +2,13 @@ import React, { PureComponent, createRef } from 'react';
2
2
  import { View } from 'react-native';
3
3
  import { bool, elementType, func, number, shape, string } from 'prop-types';
4
4
 
5
+ import { COMPONENT_KEYS } from '../UTBaseInputField/constants';
6
+ import { formatErrorToValidation } from '../UTValidation/utils';
7
+ import { TITLE_VARIANTS } from '../../constants/inputs';
5
8
  import UTBaseInputField from '../UTBaseInputField';
6
9
  import UTFieldLabel from '../UTFieldLabel';
7
10
  import UTLabel from '../UTLabel';
8
- import UTValidation from '../UTValidation';
9
- import { formatErrorToValidation } from '../UTValidation/utils';
10
- import { TITLE_VARIANTS } from '../../constants/inputs';
11
- import { COMPONENT_KEYS } from '../UTBaseInputField/constants';
12
- import { validationDataProptypes } from '../UTValidation/constants';
11
+ import UTValidation, { validationDataProptypes } from '../UTValidation';
13
12
 
14
13
  import { AREA_CODES } from './constants';
15
14
  import styles from './styles';
@@ -121,6 +121,10 @@ export const singleInhouseEvent = sendInhouseAnalytics => eventData => {
121
121
  sendInhouseAnalytics(null, eventData);
122
122
  };
123
123
 
124
+ export const singleArgosEvent = sendArgosAnalytics => eventData => {
125
+ sendArgosAnalytics(eventData);
126
+ };
127
+
124
128
  export const singleEventMultitracking = (trackers, eventDefinitions) => (name, eventData) => {
125
129
  const mergedData = merge(eventDefinitions[name] || {}, eventData || {});
126
130
  const { sharedProps, ...trackerProps } = mergedData;
@@ -154,11 +158,12 @@ export default {
154
158
  mixpanelUserReset,
155
159
  multiTracking,
156
160
  setUserTracking,
161
+ singleArgosEvent,
157
162
  singleEventMultitracking,
158
163
  singleFirebaseEvent,
159
164
  singleInhouseEvent,
160
165
  singleMixpanelEvent,
166
+ tracker,
161
167
  trackEvent,
162
- trackScreen,
163
- tracker
168
+ trackScreen
164
169
  };
@@ -1,3 +1,5 @@
1
1
  // Base Device Guidelines (~5in)
2
2
  export const GUIDELINES_BASE_WIDTH = 350;
3
3
  export const GUIDELINES_BASE_HEIGHT = 680;
4
+
5
+ export const SCALING_FACTOR = 0.7; // This value was determined by the UX team, please do not change it without prior consultation
@@ -1,6 +1,6 @@
1
1
  import { Dimensions } from 'react-native';
2
2
 
3
- import { GUIDELINES_BASE_HEIGHT, GUIDELINES_BASE_WIDTH } from '../constants';
3
+ import { GUIDELINES_BASE_HEIGHT, GUIDELINES_BASE_WIDTH, SCALING_FACTOR } from '../constants';
4
4
 
5
5
  export const { height: WINDOW_HEIGHT, width: WINDOW_WIDTH } = Dimensions.get('window');
6
6
 
@@ -32,7 +32,11 @@ export const verticalScale = size => (WINDOW_HEIGHT / GUIDELINES_BASE_HEIGHT) *
32
32
  */
33
33
  export const moderateVerticalScale = (size, factor = 0.5) => size + (verticalScale(size) - size) * factor;
34
34
 
35
- export const scale = size => Math.round((verticalScale(size) + horizontalScale(size)) / 2);
35
+ const factorVerticalScale = size => (WINDOW_HEIGHT / GUIDELINES_BASE_HEIGHT) ** SCALING_FACTOR * size;
36
+
37
+ const factorHorizontalScale = size => (WINDOW_WIDTH / GUIDELINES_BASE_WIDTH) ** SCALING_FACTOR * size;
38
+
39
+ export const factorScale = size => (factorVerticalScale(size) + factorHorizontalScale(size)) / 2;
36
40
 
37
41
  export default {
38
42
  horizontalScale,
@@ -41,5 +45,5 @@ export default {
41
45
  verticalScale,
42
46
  WINDOW_HEIGHT,
43
47
  WINDOW_WIDTH,
44
- scale
48
+ factorScale
45
49
  };
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.11",
5
+ "version": "1.32.13",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [