@widergy/mobile-ui 1.32.5 → 1.32.6

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,10 @@
1
+ ## [1.32.6](https://github.com/widergy/mobile-ui/compare/v1.32.5...v1.32.6) (2024-12-02)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * [UGC-1029] proportional utlabel ([#394](https://github.com/widergy/mobile-ui/issues/394)) ([278ab68](https://github.com/widergy/mobile-ui/commit/278ab6822364221be91622aa81bedb5a01fb1db5))
7
+
1
8
  ## [1.32.5](https://github.com/widergy/mobile-ui/compare/v1.32.4...v1.32.5) (2024-12-02)
2
9
 
3
10
 
@@ -57,14 +57,14 @@ For all others: `shade05`
57
57
 
58
58
  | Variant | Component | Default font size |
59
59
  | --------- | --------- | ----------------- |
60
- | title1 | h1 | 30px |
61
- | title2 | h2 | 24px |
62
- | title3 | h3 | 22px |
63
- | subtitle1 | h4 | 18px |
64
- | subtitle2 | h5 | 16px |
60
+ | title1 | h1 | 24px |
61
+ | title2 | h2 | 22px |
62
+ | title3 | h3 | 18px |
63
+ | subtitle1 | h4 | 16px |
64
+ | subtitle2 | h5 | 14px |
65
65
  | body | span | 16px |
66
66
  | small | span | 14px |
67
- | xsmall | span | 13px |
67
+ | xsmall | span | 11px |
68
68
  | th | th | 16px |
69
69
  | td | td | 16px |
70
70
 
@@ -1,6 +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
5
 
5
6
  import { LINE_HEIGHTS, VARIANTS_SIZES, WEIGHTS } from './constants';
6
7
  import { DEFAULT_PROPS } from './proptypes';
@@ -16,7 +17,7 @@ export const getFontFamily = (theme, weight) =>
16
17
  ? theme.fonts.fontFamily
17
18
  : theme.fonts?.customVariants?.[weight]?.fontFamily;
18
19
 
19
- export const getFontSize = variant => VARIANTS_SIZES[variant] || VARIANTS_SIZES[DEFAULT_PROPS.variant];
20
+ export const getFontSize = variant => scale(VARIANTS_SIZES[variant] || VARIANTS_SIZES[DEFAULT_PROPS.variant]);
20
21
 
21
22
  export const getFontWeight = weight => (IS_IOS ? WEIGHTS[weight] || WEIGHTS[DEFAULT_PROPS.weight] : null);
22
23
 
@@ -43,5 +44,5 @@ export const retrieveStyle = ({ colorTheme, field, shade, theme, variant, weight
43
44
  margin: 0,
44
45
  paddingVertical: 0,
45
46
  textAlignVertical: 'center',
46
- ...(LINE_HEIGHTS?.[variant] ? { lineHeight: LINE_HEIGHTS[variant] } : {})
47
+ ...(LINE_HEIGHTS?.[variant] ? { lineHeight: scale(LINE_HEIGHTS[variant]) } : {})
47
48
  });
@@ -32,11 +32,14 @@ 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);
36
+
35
37
  export default {
36
38
  horizontalScale,
37
39
  moderateHorizontalScale,
38
40
  moderateVerticalScale,
39
41
  verticalScale,
40
42
  WINDOW_HEIGHT,
41
- WINDOW_WIDTH
43
+ WINDOW_WIDTH,
44
+ scale
42
45
  };
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.5",
5
+ "version": "1.32.6",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [