@widergy/mobile-ui 1.32.3 → 1.32.5
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/UTBaseInputField/theme.js +1 -1
- package/lib/components/UTCheckBox/README.md +1 -1
- package/lib/components/UTCheckBox/constants.js +1 -1
- package/lib/components/UTCheckBox/proptypes.js +1 -1
- package/lib/components/UTCheckBox/theme.js +2 -2
- package/lib/components/UTCheckList/README.MD +1 -1
- package/lib/components/UTCheckList/constants.js +1 -1
- package/lib/components/UTCheckList/proptypes.js +2 -2
- package/lib/components/UTCheckList/styles.js +3 -3
- package/lib/components/UTProductItem/components/Discount/index.js +7 -5
- package/lib/components/UTProductItem/utils.js +2 -2
- package/lib/components/UTSearchField/index.js +6 -2
- package/lib/components/UTSearchField/theme.js +3 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.32.5](https://github.com/widergy/mobile-ui/compare/v1.32.4...v1.32.5) (2024-12-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* [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))
|
|
7
|
+
|
|
8
|
+
## [1.32.4](https://github.com/widergy/mobile-ui/compare/v1.32.3...v1.32.4) (2024-12-02)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* add theme in UTSearch, change value L to M ([#385](https://github.com/widergy/mobile-ui/issues/385)) ([fa0e514](https://github.com/widergy/mobile-ui/commit/fa0e51448147caaab3b92de669bf04a581292692))
|
|
14
|
+
|
|
1
15
|
## [1.32.3](https://github.com/widergy/mobile-ui/compare/v1.32.2...v1.32.3) (2024-11-29)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -162,7 +162,7 @@ export const retrieveStyle = ({
|
|
|
162
162
|
...style.input
|
|
163
163
|
},
|
|
164
164
|
cursorColor: baseTheme.input.cursorColor,
|
|
165
|
-
placeholderTextColor: baseTheme.input.placeholderTextColor,
|
|
165
|
+
placeholderTextColor: style.input?.placeholderTextColor || baseTheme.input.placeholderTextColor,
|
|
166
166
|
selectionColor: baseTheme.input.selectionColor
|
|
167
167
|
};
|
|
168
168
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
| onPress | func | | Function to call when the checkbox is pressed. |
|
|
16
16
|
| required | bool | false | Indicates if the checkbox is required. |
|
|
17
17
|
| reversed | bool | false | If true, reverses the order of title and checkbox. |
|
|
18
|
-
| spacing | string |
|
|
18
|
+
| spacing | string | medium | If "small", reduces the column gap from 16 to 8. |
|
|
19
19
|
| style | shape | {} | Custom styles to apply to the checkbox container. Can contain root or title |
|
|
20
20
|
| title | string | | Title to display next to the checkbox. |
|
|
21
21
|
| variant | string | | The variant to use for styling the checkbox. |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BUTTON_VARIANT, SPACING } from './constants';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const MEDIUM_SPACING = 16;
|
|
4
4
|
const SMALL_SPACING = 8;
|
|
5
5
|
|
|
6
6
|
const baseCheckBoxTheme = theme => ({
|
|
@@ -35,7 +35,7 @@ const conditionalStyles = ({
|
|
|
35
35
|
pressed,
|
|
36
36
|
theme
|
|
37
37
|
}) => {
|
|
38
|
-
const spacingValue = spacing === SPACING.SMALL ? SMALL_SPACING :
|
|
38
|
+
const spacingValue = spacing === SPACING.SMALL ? SMALL_SPACING : MEDIUM_SPACING;
|
|
39
39
|
|
|
40
40
|
const pressable =
|
|
41
41
|
variant === BUTTON_VARIANT
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
| style | shape | {} | Custom styles to apply to the checklist. Can contain `root`, `header`, `checkboxesContainer`, `item`, and `selectAll`. |
|
|
21
21
|
| value | arrayOf(string) | [] | Array of selected values. |
|
|
22
22
|
| variant | string | | Variant style for the checklist. |
|
|
23
|
-
| verticalSpacing | string |
|
|
23
|
+
| verticalSpacing | string | medium | Spacing between the checkbox items vertically. |
|
|
24
24
|
|
|
25
25
|
### Option Object
|
|
26
26
|
|
|
@@ -3,13 +3,13 @@ import { arrayOf, bool, func, object, shape, string } from 'prop-types';
|
|
|
3
3
|
import { SPACING } from './constants';
|
|
4
4
|
|
|
5
5
|
export const defaultProps = {
|
|
6
|
-
horizontalSpacing: SPACING.
|
|
6
|
+
horizontalSpacing: SPACING.MEDIUM,
|
|
7
7
|
isSimple: false,
|
|
8
8
|
onChange: () => {},
|
|
9
9
|
showSelectAll: true,
|
|
10
10
|
style: {},
|
|
11
11
|
value: null,
|
|
12
|
-
verticalSpacing: SPACING.
|
|
12
|
+
verticalSpacing: SPACING.MEDIUM
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
export const propTypes = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
2
|
|
|
3
3
|
const SPACING = {
|
|
4
|
-
|
|
4
|
+
MEDIUM: 16,
|
|
5
5
|
SMALL: 8
|
|
6
6
|
};
|
|
7
7
|
|
|
@@ -11,11 +11,11 @@ export default StyleSheet.create({
|
|
|
11
11
|
},
|
|
12
12
|
checkboxesContainer: {
|
|
13
13
|
alignSelf: 'flex-start',
|
|
14
|
-
rowGap: SPACING.
|
|
14
|
+
rowGap: SPACING.MEDIUM,
|
|
15
15
|
width: '100%'
|
|
16
16
|
},
|
|
17
17
|
container: {
|
|
18
|
-
rowGap: SPACING.
|
|
18
|
+
rowGap: SPACING.MEDIUM
|
|
19
19
|
},
|
|
20
20
|
headerContainer: {
|
|
21
21
|
rowGap: 8
|
|
@@ -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);
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
|
|
3
3
|
import { COMPONENT_KEYS } from '../UTBaseInputField/constants';
|
|
4
4
|
import UTBaseInputField from '../UTBaseInputField';
|
|
5
|
+
import { useTheme } from '../../theming';
|
|
5
6
|
|
|
6
7
|
import { defaultProps, propTypes } from './proptypes';
|
|
8
|
+
import { retrieveStyle } from './theme';
|
|
7
9
|
|
|
8
10
|
const UTSearchField = ({
|
|
9
11
|
disabled,
|
|
@@ -20,6 +22,8 @@ const UTSearchField = ({
|
|
|
20
22
|
value,
|
|
21
23
|
variant
|
|
22
24
|
}) => {
|
|
25
|
+
const theme = useTheme();
|
|
26
|
+
const { input } = useMemo(() => retrieveStyle({ theme }), [theme]);
|
|
23
27
|
const clearText = () => {
|
|
24
28
|
onChange('');
|
|
25
29
|
};
|
|
@@ -46,7 +50,7 @@ const UTSearchField = ({
|
|
|
46
50
|
ref={inputRef}
|
|
47
51
|
returnKeyType={returnKeyType}
|
|
48
52
|
rightAdornments={rightAdornments}
|
|
49
|
-
style={{ container: style }}
|
|
53
|
+
style={{ container: style, input }}
|
|
50
54
|
type={type}
|
|
51
55
|
value={value}
|
|
52
56
|
variant={variant}
|
package/package.json
CHANGED