@widergy/mobile-ui 1.32.5 → 1.32.7

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.7](https://github.com/widergy/mobile-ui/compare/v1.32.6...v1.32.7) (2024-12-02)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * [UGC-1012] utselect no options text ([#391](https://github.com/widergy/mobile-ui/issues/391)) ([be869ed](https://github.com/widergy/mobile-ui/commit/be869ed0f96d0866b49c0ee2f91cbdfd161702fe))
7
+
8
+ ## [1.32.6](https://github.com/widergy/mobile-ui/compare/v1.32.5...v1.32.6) (2024-12-02)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * [UGC-1029] proportional utlabel ([#394](https://github.com/widergy/mobile-ui/issues/394)) ([278ab68](https://github.com/widergy/mobile-ui/commit/278ab6822364221be91622aa81bedb5a01fb1db5))
14
+
1
15
  ## [1.32.5](https://github.com/widergy/mobile-ui/compare/v1.32.4...v1.32.5) (2024-12-02)
2
16
 
3
17
 
@@ -2,23 +2,24 @@
2
2
 
3
3
  ## Description
4
4
 
5
- `UTCheckBox` is a customizable checkbox component used within the `UTCheckList` component. It supports various states such as checked, indeterminate, and disabled.
5
+ `UTCheckBox` is a flexible checkbox component that supports multiple states (checked, indeterminate, disabled).
6
6
 
7
7
  ## Props
8
8
 
9
- | Name | Type | Default | Description |
10
- | ------------- | ------ | ------- | --------------------------------------------------------------------------- |
11
- | checked | bool | false | Indicates if the checkbox is checked. |
12
- | disabled | bool | false | Disables the checkbox, making it unclickable. |
13
- | indeterminate | bool | false | Indicates if the checkbox is in an indeterminate state. |
14
- | isSimple | bool | false | **Deprecated**: Use standard checkboxes instead. |
15
- | onPress | func | | Function to call when the checkbox is pressed. |
16
- | required | bool | false | Indicates if the checkbox is required. |
17
- | reversed | bool | false | If true, reverses the order of title and checkbox. |
18
- | spacing | string | medium | If "small", reduces the column gap from 16 to 8. |
19
- | style | shape | {} | Custom styles to apply to the checkbox container. Can contain root or title |
20
- | title | string | | Title to display next to the checkbox. |
21
- | variant | string | | The variant to use for styling the checkbox. |
9
+ | Name | Type | Default | Description |
10
+ | ------------- | ------ | ------- | ------------------------------------------------------------------------------ |
11
+ | value | bool | false | Indicates whether the checkbox is selected. |
12
+ | onChange | func | | Function to call when the checkbox value changes. |
13
+ | disabled | bool | false | Disables the checkbox, making it unclickable. |
14
+ | indeterminate | bool | false | Indicates if the checkbox is in an indeterminate state. |
15
+ | isSimple | bool | false | **Deprecated**: Avoid using simple checkboxes in favor of standard checkboxes. |
16
+ | required | bool | false | Indicates if the checkbox is required. |
17
+ | reversed | bool | false | If true, reverses the order of the title and checkbox. |
18
+ | spacing | string | medium | If "small", reduces the column gap from 16 to 8. |
19
+ | style | shape | {} | Custom styles to apply to the checkbox container or title. |
20
+ | title | string | | Text displayed next to the checkbox. |
21
+ | withMarkdown | bool | false | Enables Markdown rendering for the `title`. |
22
+ | variant | string | | The variant to use for styling the checkbox. |
22
23
 
23
24
  ## Usage
24
25
 
@@ -31,7 +32,7 @@ import UTCheckBox from './UTCheckBox';
31
32
  const Example = () => {
32
33
  const [checked, setChecked] = React.useState(false);
33
34
 
34
- return <UTCheckBox checked={checked} title="Check me" onPress={() => setChecked(!checked)} />;
35
+ return <UTCheckBox value={checked} title="Check me" onChange={setChecked} />;
35
36
  };
36
37
 
37
38
  export default Example;
@@ -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
  });
@@ -13,6 +13,7 @@
13
13
  | title | string | | Title for the select field. |
14
14
  | multiple | bool | false | Allows multiple selection if true. |
15
15
  | noMatchesText | string | | Text to display when no matches are found in the search. |
16
+ | noOptionsText | string | | Text to display when no options are initially available (before a search term is provided). |
16
17
  | onChange | func | | Function to call when the input field value changes. |
17
18
  | options | array | | Array of options to be displayed in the dropdown. Each option is an object with `label` and `value`. |
18
19
  | placeholder | string | | Placeholder text for the select field. |
@@ -26,6 +26,7 @@ const UTSelect = ({
26
26
  helpText,
27
27
  multiple,
28
28
  noMatchesText,
29
+ noOptionsText,
29
30
  onChange,
30
31
  options,
31
32
  placeholder,
@@ -186,7 +187,7 @@ const UTSelect = ({
186
187
  />
187
188
  {isEmpty(filteredOptions) ? (
188
189
  <UTLabel colorTheme="gray" style={styles.noMatchesText}>
189
- {noMatchesText}
190
+ {!searchTerm ? noOptionsText : noMatchesText}
190
191
  </UTLabel>
191
192
  ) : (
192
193
  <ScrollView keyboardShouldPersistTaps="handled">
@@ -25,6 +25,7 @@ export const propTypes = {
25
25
  helpText: string,
26
26
  multiple: bool,
27
27
  noMatchesText: string,
28
+ noOptionsText: string,
28
29
  onChange: func,
29
30
  options: arrayOf(
30
31
  shape({
@@ -14,7 +14,8 @@ const styles = StyleSheet.create({
14
14
  noMatchesText: {
15
15
  alignSelf: 'center',
16
16
  paddingHorizontal: 16,
17
- paddingVertical: 24
17
+ paddingVertical: 24,
18
+ textAlign: 'center'
18
19
  }
19
20
  });
20
21
 
@@ -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.7",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [