@widergy/mobile-ui 1.8.3 → 1.10.0

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.10.0](https://github.com/widergy/mobile-ui/compare/v1.9.0...v1.10.0) (2024-05-20)
2
+
3
+
4
+ ### Features
5
+
6
+ * autocomplete empty list component ([#287](https://github.com/widergy/mobile-ui/issues/287)) ([a90a0b2](https://github.com/widergy/mobile-ui/commit/a90a0b2fd85e4171d08fc012447b18b522bae6f8))
7
+
8
+ # [1.9.0](https://github.com/widergy/mobile-ui/compare/v1.8.3...v1.9.0) (2024-05-17)
9
+
10
+
11
+ ### Features
12
+
13
+ * uticon ([#284](https://github.com/widergy/mobile-ui/issues/284)) ([b71c18f](https://github.com/widergy/mobile-ui/commit/b71c18f09f8e5e5937674da4587dd5b7cd5d6de7))
14
+
1
15
  ## [1.8.3](https://github.com/widergy/mobile-ui/compare/v1.8.2...v1.8.3) (2024-05-15)
2
16
 
3
17
 
@@ -18,6 +18,7 @@ const UTAutocomplete = ({
18
18
  variant,
19
19
  autoCompletePlaceholder,
20
20
  MenuOptionComponent,
21
+ ListEmptyComponent,
21
22
  filterOptions,
22
23
  persistSelectedOption = false
23
24
  }) => {
@@ -49,6 +50,7 @@ const UTAutocomplete = ({
49
50
  autoCompletePlaceholder={autoCompletePlaceholder}
50
51
  maxHeight={WINDOW_HEIGHT * 0.25}
51
52
  MenuOptionComponent={MenuOptionComponent}
53
+ ListEmptyComponent={ListEmptyComponent}
52
54
  filterOptions={filterOptions}
53
55
  >
54
56
  <UTTextInput
@@ -87,6 +89,7 @@ UTAutocomplete.propTypes = {
87
89
  variant: string,
88
90
  autoCompletePlaceholder: string,
89
91
  MenuOptionComponent: element,
92
+ ListEmptyComponent: element,
90
93
  filterOptions: bool,
91
94
  persistSelectedOption: bool
92
95
  };
@@ -0,0 +1,63 @@
1
+ # UTIcon
2
+
3
+ ### Description
4
+
5
+ Icon component using Tabler Icons library.
6
+
7
+ ### UX/UI Icon Lists
8
+ - [Figma](https://www.figma.com/file/upiqGm1l10mBTbV9gn35Fh/Icons---Stylesheet?type=design&node-id=3-5&mode=design)
9
+ - [Zeroheight](https://zeroheight.com/6d447f9f5/p/87aa21-resources)
10
+
11
+ ### Name
12
+
13
+ Icon names must be PascalCase.
14
+
15
+ Usually, icon names are a convertion from figma's or zeroheight's snake_case to PascalCase, adding `Icon` as a prefix.
16
+
17
+ ```
18
+ Figma: truck-delivery
19
+ UTIcon: IconTruckDelivery
20
+ ```
21
+
22
+ Sometimes icons will be called {icon-name}-old. In these cases, usually, the icon name is made in the same way already explained, but subtracting the
23
+ `-old` suffix.
24
+
25
+ ```
26
+ Figma: chevron-right-old
27
+ UTIcon: IconChevronRight
28
+ ```
29
+
30
+ Exceptions may exists to these rules.
31
+
32
+ ### Color
33
+
34
+ Android always requires a color value, so the prop defaults to black.
35
+
36
+ ### Props
37
+
38
+ | Name | Description |Default |
39
+ | --------- | ----------------------------------- | ------- |
40
+ | color | The icon color | 'black' |
41
+ | name | The name of the icon in TablerIcons | ------- |
42
+ | size | The icon size | ------- |
43
+ | style | The style to be aplied to the Icon | ------- |
44
+
45
+ ### Usage
46
+
47
+ ```javascript
48
+ import { UTIcon } from '@widergy/mobile-ui';
49
+ import { View } from 'react-native';
50
+ import React from 'react';
51
+
52
+ import styles from './styles';
53
+
54
+ const MyComponent = () => {
55
+ return (
56
+ <View>
57
+ <UTIcon color="skyBlue" name="IconTruckDelivery" size={48} style={styles.iconStyle} />
58
+ </View>
59
+ );
60
+ };
61
+
62
+ export default MyComponent;
63
+ ```
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import * as TablerIcons from '@tabler/icons-react-native';
3
+ import { number, string } from 'prop-types';
4
+ import { ViewPropTypes } from 'deprecated-react-native-prop-types';
5
+
6
+ const UTIcon = ({ color = 'black', name, size, style }) => {
7
+ const IconComponent = TablerIcons[name];
8
+
9
+ if (!IconComponent) return null;
10
+
11
+ return <IconComponent color={color} size={size} style={style} />;
12
+ };
13
+
14
+ UTIcon.propTypes = {
15
+ color: string,
16
+ name: string,
17
+ size: number,
18
+ style: ViewPropTypes.style
19
+ };
20
+
21
+ export default UTIcon;
@@ -46,7 +46,7 @@ class ListView extends PureComponent {
46
46
  };
47
47
 
48
48
  render() {
49
- const { filteredOptions, ItemSeparatorComponent } = this.props;
49
+ const { filteredOptions, ItemSeparatorComponent, ListEmptyComponent } = this.props;
50
50
  const { style } = this.state;
51
51
 
52
52
  return (
@@ -57,6 +57,7 @@ class ListView extends PureComponent {
57
57
  keyboardShouldPersistTaps="always"
58
58
  renderItem={this.renderItem}
59
59
  ItemSeparatorComponent={ItemSeparatorComponent}
60
+ ListEmptyComponent={ListEmptyComponent}
60
61
  />
61
62
  );
62
63
  }
@@ -1,4 +1,4 @@
1
- import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';
1
+ import React, { Fragment, useLayoutEffect, useMemo, useRef, useState } from 'react';
2
2
  import { Dimensions, Keyboard, KeyboardAvoidingView, Modal, TouchableOpacity, View } from 'react-native';
3
3
 
4
4
  import useKeyboardHeight from '../../hooks/useKeyboardHeight';
@@ -24,6 +24,7 @@ const UTMenu = ({
24
24
  styles: propStyles,
25
25
  MenuOptionComponent = MenuOption,
26
26
  ItemSeparatorComponent,
27
+ ListEmptyComponent,
27
28
  maxHeight,
28
29
  isMultiple,
29
30
  autoCompletePlaceholder,
@@ -102,11 +103,11 @@ const UTMenu = ({
102
103
 
103
104
  const handleQueryChange = value => {
104
105
  setQuery(value);
105
- onQueryChange(value);
106
+ onQueryChange?.(value);
106
107
  };
107
108
 
108
109
  return (
109
- <>
110
+ <Fragment>
110
111
  <TouchableOpacity
111
112
  disabled={disabled}
112
113
  onPress={isOpen ? closeMenu : openMenu}
@@ -153,6 +154,7 @@ const UTMenu = ({
153
154
  usableWindowHeight={usableWindowHeight}
154
155
  filteredOptions={filteredOptions}
155
156
  ItemSeparatorComponent={ItemSeparatorComponent}
157
+ ListEmptyComponent={ListEmptyComponent}
156
158
  MenuOptionComponent={MenuOptionComponent}
157
159
  handleOptionPress={handleOptionPress}
158
160
  onPress={onPress}
@@ -164,7 +166,7 @@ const UTMenu = ({
164
166
  </KeyboardAvoidingView>
165
167
  </View>
166
168
  </Modal>
167
- </>
169
+ </Fragment>
168
170
  );
169
171
  };
170
172
 
package/lib/index.js CHANGED
@@ -27,6 +27,7 @@ export { default as UTPasswordField } from './components/UTPasswordField';
27
27
  export { default as Icon } from './components/Icon';
28
28
  export { default as ImageIcon } from './components/ImageIcon';
29
29
  export { default as SeparatorBar } from './components/SeparatorBar';
30
+ export { default as UTIcon } from './components/UTIcon';
30
31
  // Library Components
31
32
  export { default as AvatarImage } from './components/AvatarImage';
32
33
  export { default as Carousel } from './components/Carousel';
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.8.3",
5
+ "version": "1.10.0",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [
@@ -35,16 +35,17 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@react-navigation/native": "^6.1.9",
38
+ "@tabler/icons-react-native": "^3.3.0",
38
39
  "@widergy/web-utils": "^2.0.0",
39
40
  "core-js": "3",
40
41
  "deprecated-react-native-prop-types": "^4.2.1",
41
42
  "lodash": "^4.17.21",
42
43
  "numeral": "^2.0.6",
43
44
  "pdf-lib": "^1.17.1",
45
+ "react-native-collapsible": "^1.6.1",
44
46
  "react-native-markdown-display": "^7.0.0-alpha.2",
45
47
  "react-native-modal": "^13.0.1",
46
- "react-native-pager-view": "^6.2.1",
47
- "react-native-collapsible": "^1.6.1"
48
+ "react-native-pager-view": "^6.2.1"
48
49
  },
49
50
  "devDependencies": {
50
51
  "@babel/cli": "^7.22.10",