@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 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 | large | If "small", reduces the column gap from 16 to 8. |
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. |
@@ -3,7 +3,7 @@ export const INDETERMINATE_ICON = 'IconMinus';
3
3
 
4
4
  export const SPACING = {
5
5
  SMALL: 'small',
6
- LARGE: 'large'
6
+ MEDIUM: 'medium'
7
7
  };
8
8
 
9
9
  export const BUTTON_VARIANT = 'button';
@@ -7,7 +7,7 @@ export const defaultProps = {
7
7
  * @deprecated The "isSimple" prop is deprecated and will be removed in a future release. Please do not use it.
8
8
  */
9
9
  isSimple: false,
10
- spacing: SPACING.LARGE,
10
+ spacing: SPACING.MEDIUM,
11
11
  style: {}
12
12
  };
13
13
 
@@ -1,6 +1,6 @@
1
1
  import { BUTTON_VARIANT, SPACING } from './constants';
2
2
 
3
- const NORMAL_SPACING = 16;
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 : NORMAL_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 | large | Spacing between the checkbox items vertically. |
23
+ | verticalSpacing | string | medium | Spacing between the checkbox items vertically. |
24
24
 
25
25
  ### Option Object
26
26
 
@@ -1,4 +1,4 @@
1
1
  export const SPACING = {
2
2
  SMALL: 'small',
3
- LARGE: 'large'
3
+ MEDIUM: 'medium'
4
4
  };
@@ -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.LARGE,
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.LARGE
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
- LARGE: 16,
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.LARGE,
14
+ rowGap: SPACING.MEDIUM,
15
15
  width: '100%'
16
16
  },
17
17
  container: {
18
- rowGap: SPACING.LARGE
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
- <View style={themedStyles.discountChip}>
11
- <UTLabel colorTheme="negative" variant="xsmall" style={themedStyles.discount}>
12
- {discount}
13
- </UTLabel>
14
- </View>
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: !!additionalInfo
20
+ show: additionalInfo
21
21
  },
22
22
  {
23
23
  Component: Discount,
24
24
  key: 'discount',
25
25
  props: { discount, previousAmount, themedStyles },
26
- show: !!discount
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}
@@ -0,0 +1,3 @@
1
+ export const retrieveStyle = ({ theme }) => ({
2
+ input: { placeholderTextColor: theme.Pallete.gray['04'] }
3
+ });
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.3",
5
+ "version": "1.32.5",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [