@widergy/mobile-ui 1.32.4 → 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 +14 -0
- package/lib/components/UTLabel/README.md +6 -6
- package/lib/components/UTLabel/theme.js +3 -2
- package/lib/components/UTProductItem/components/Discount/index.js +7 -5
- package/lib/components/UTProductItem/utils.js +2 -2
- package/lib/utils/scaleUtils/index.js +4 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
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
|
+
|
|
8
|
+
## [1.32.5](https://github.com/widergy/mobile-ui/compare/v1.32.4...v1.32.5) (2024-12-02)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* [UGC-1026] utproductitem independent discount and previous amount ([#392](https://github.com/widergy/mobile-ui/issues/392)) ([8a75f5b](https://github.com/widergy/mobile-ui/commit/8a75f5b23579ef75cc18faa34abc4eb9d94c34cf))
|
|
14
|
+
|
|
1
15
|
## [1.32.4](https://github.com/widergy/mobile-ui/compare/v1.32.3...v1.32.4) (2024-12-02)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -57,14 +57,14 @@ For all others: `shade05`
|
|
|
57
57
|
|
|
58
58
|
| Variant | Component | Default font size |
|
|
59
59
|
| --------- | --------- | ----------------- |
|
|
60
|
-
| title1 | h1 |
|
|
61
|
-
| title2 | h2 |
|
|
62
|
-
| title3 | h3 |
|
|
63
|
-
| subtitle1 | h4 |
|
|
64
|
-
| subtitle2 | h5 |
|
|
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 |
|
|
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
|
});
|
|
@@ -7,11 +7,13 @@ import UTLabel from '../../../UTLabel';
|
|
|
7
7
|
|
|
8
8
|
const Discount = ({ previousAmount, shouldUseGap, discount, themedStyles }) => (
|
|
9
9
|
<View style={[themedStyles.amountContainer, shouldUseGap ? themedStyles.gap : '']}>
|
|
10
|
-
|
|
11
|
-
<
|
|
12
|
-
{discount}
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
{discount && (
|
|
11
|
+
<View style={themedStyles.discountChip}>
|
|
12
|
+
<UTLabel colorTheme="negative" variant="xsmall" style={themedStyles.discount}>
|
|
13
|
+
{discount}
|
|
14
|
+
</UTLabel>
|
|
15
|
+
</View>
|
|
16
|
+
)}
|
|
15
17
|
{previousAmount && (
|
|
16
18
|
<UTLabel colorTheme="gray" style={themedStyles.previousAmount}>{`$ ${previousAmount}`}</UTLabel>
|
|
17
19
|
)}
|
|
@@ -17,13 +17,13 @@ export const leftSectionComponents = ({
|
|
|
17
17
|
Component: AdditionalInfo,
|
|
18
18
|
key: 'additionalInfo',
|
|
19
19
|
props: { additionalInfo, themedStyles },
|
|
20
|
-
show:
|
|
20
|
+
show: additionalInfo
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
Component: Discount,
|
|
24
24
|
key: 'discount',
|
|
25
25
|
props: { discount, previousAmount, themedStyles },
|
|
26
|
-
show:
|
|
26
|
+
show: discount || previousAmount
|
|
27
27
|
},
|
|
28
28
|
{ Component: Amount, key: 'amount', props: { amount, themedStyles }, show: !!amount }
|
|
29
29
|
].filter(elem => elem.show);
|
|
@@ -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