@widergy/mobile-ui 1.11.5 → 1.11.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/lib/components/UTButton/index.js +12 -3
  3. package/lib/components/UTIcon/README.md +22 -8
  4. package/lib/components/UTIcon/constants.js +24 -0
  5. package/lib/components/UTIcon/index.js +15 -5
  6. package/lib/components/UTIcon/theme.js +18 -0
  7. package/lib/components/UTLabel/README.md +74 -0
  8. package/lib/components/UTTextArea/constants.js +1 -0
  9. package/lib/components/UTTextArea/index.js +14 -0
  10. package/lib/components/UTTextInput/index.js +9 -60
  11. package/lib/components/UTTextInput/{components → versions/V0/components}/BaseInput/index.js +3 -3
  12. package/lib/components/UTTextInput/{components → versions/V0/components}/InputAnimatedBorder/index.js +1 -1
  13. package/lib/components/UTTextInput/{components → versions/V0/components}/InputLabel/index.js +1 -1
  14. package/lib/components/UTTextInput/{flavors → versions/V0/flavors}/FilledInput/index.js +6 -6
  15. package/lib/components/UTTextInput/{flavors → versions/V0/flavors}/OutlinedInput/index.js +6 -6
  16. package/lib/components/UTTextInput/{flavors → versions/V0/flavors}/StandardInput/index.js +6 -6
  17. package/lib/components/UTTextInput/versions/V0/index.js +67 -0
  18. package/lib/components/UTTextInput/versions/V1/components/TextInputField/constants.js +12 -0
  19. package/lib/components/UTTextInput/versions/V1/components/TextInputField/index.js +202 -0
  20. package/lib/components/UTTextInput/versions/V1/components/TextInputField/theme.js +124 -0
  21. package/lib/components/UTTextInput/versions/V1/components/TextInputField/utils.js +11 -0
  22. package/lib/components/UTTextInput/versions/V1/constants.js +8 -0
  23. package/lib/components/UTTextInput/versions/V1/index.js +94 -0
  24. package/lib/components/UTTextInput/versions/V1/proptypes.js +36 -0
  25. package/lib/components/UTTextInput/versions/V1/styles.js +10 -0
  26. package/lib/components/UTTextInput/versions/V1/utils.js +1 -0
  27. package/lib/components/UTValidation/README.md +56 -0
  28. package/lib/components/UTValidation/constants.js +39 -0
  29. package/lib/components/UTValidation/index.js +69 -0
  30. package/lib/components/UTValidation/styles.js +25 -0
  31. package/lib/components/UTValidation/theme.js +17 -0
  32. package/lib/components/UTValidation/utils.js +8 -0
  33. package/lib/index.js +5 -2
  34. package/lib/theming/README.md +10 -18
  35. package/package.json +1 -1
  36. package/lib/components/UTTextInput/flavors/FilledInput/constants.js +0 -1
  37. package/lib/components/UTTextInput/flavors/FilledInput/utils.js +0 -35
  38. package/lib/components/UTTextInput/flavors/OutlinedInput/constants.js +0 -1
  39. package/lib/components/UTTextInput/flavors/OutlinedInput/utils.js +0 -37
  40. package/lib/components/UTTextInput/flavors/StandardInput/constants.js +0 -1
  41. /package/lib/components/UTTextInput/{components → versions/V0/components}/BaseInput/constants.js +0 -0
  42. /package/lib/components/UTTextInput/{components → versions/V0/components}/BaseInput/styles.js +0 -0
  43. /package/lib/components/UTTextInput/{components → versions/V0/components}/InputAnimatedBorder/styles.js +0 -0
  44. /package/lib/components/UTTextInput/{components → versions/V0/components}/InputAnimatedBorder/utils.js +0 -0
  45. /package/lib/components/UTTextInput/{components → versions/V0/components}/InputLabel/styles.js +0 -0
  46. /package/lib/components/UTTextInput/{flavors → versions/V0/flavors}/FilledInput/styles.js +0 -0
  47. /package/lib/components/UTTextInput/{flavors → versions/V0/flavors}/OutlinedInput/styles.js +0 -0
  48. /package/lib/components/UTTextInput/{flavors → versions/V0/flavors}/StandardInput/styles.js +0 -0
  49. /package/lib/components/UTTextInput/{proptypes.js → versions/V0/proptypes.js} +0 -0
@@ -0,0 +1,8 @@
1
+ export const generateKey = (data, index) => {
2
+ const titleKey = data.title || '';
3
+ const statusKey = data.status || '';
4
+ const itemsKey = data.items.map(item => item.text).join('-');
5
+ return `${index}-${titleKey}-${statusKey}-${itemsKey}`;
6
+ };
7
+
8
+ export const generateItemKey = (item, index) => `${index}-${item.status}-${item.text}`;
package/lib/index.js CHANGED
@@ -53,6 +53,7 @@ export { default as UTOnBoarding } from './components/UTOnBoarding';
53
53
  export { default as UTRoundView } from './components/UTRoundView';
54
54
  export { default as UTMenu } from './components/UTMenu';
55
55
  export { default as UTTooltip } from './components/UTTooltip';
56
+ export { default as UTTextArea } from './components/UTTextArea';
56
57
  export { default as UTTextInput } from './components/UTTextInput';
57
58
  export { default as UTSelect } from './components/UTSelect';
58
59
  export { default as UTStepFeedback } from './components/UTStepFeedback';
@@ -64,9 +65,11 @@ export { default as Loading } from './components/Loading';
64
65
  export { default as UTLoading } from './components/UTLoading';
65
66
  // Text
66
67
  export { default as Label } from './components/Label';
67
- export { default as UTLabel } from './components/UTLabel';
68
- export { default as UTBadge } from './components/UTBadge';
69
68
  export { default as TransitionText } from './components/TransitionText';
69
+ export { default as UTBadge } from './components/UTBadge';
70
+ export { default as UTLabel } from './components/UTLabel';
71
+ export { default as UTValidation } from './components/UTValidation';
72
+
70
73
  // Theming
71
74
  export * from './theming';
72
75
  // Utils
@@ -7,41 +7,33 @@ This is the context provider, use it high in your components tree to make your t
7
7
  ### Props
8
8
 
9
9
  | NAME | TYPE | REQUIRED | DESCRIPTION |
10
- |-------|-----------|----------|-------------------------------------------------------|
10
+ | ----- | --------- | -------- | ----------------------------------------------------- |
11
11
  | theme | themeType | No | An object with the theme values you want to override. |
12
12
 
13
- #### Example
13
+ #### Example
14
14
 
15
15
  ```js
16
16
  import { ThemeProvider } from '@widergy/mobile-ui';
17
17
 
18
18
  const theme = {
19
- colors: {
20
- effect: 'red'
21
- }
19
+ colors: {
20
+ effect: 'red'
21
+ }
22
22
  };
23
23
 
24
- const App = () => (
25
- <ThemeProvider theme={theme}>
26
- {/** your code here **/}
27
- </ThemeProvider>
28
- )
29
-
24
+ const App = () => <ThemeProvider theme={theme}>{/** your code here **/}</ThemeProvider>;
30
25
  ```
31
26
 
32
- ## withTheme
27
+ ## withTheme
33
28
 
34
29
  This HOC lets you access to the `theme` object as a prop.
35
30
 
36
31
  #### Example
37
32
 
38
33
  ```js
39
- const MyComponent = ({ size, theme }) => (
40
- <Label color={theme.colors.primary}>Hello World!</Label>
41
- )
34
+ const MyComponent = ({ size, theme }) => <Label color={theme.colors.primary}>Hello World!</Label>;
42
35
 
43
36
  export default withTheme(MyComponent);
44
-
45
37
  ```
46
38
 
47
39
  ## Theme Values
@@ -49,7 +41,7 @@ export default withTheme(MyComponent);
49
41
  The keys in the theme object are:
50
42
 
51
43
  | NAME | TYPE | DESCRIPTION |
52
- |------------------|--------|---------------------------|
44
+ | ---------------- | ------ | ------------------------- |
53
45
  | colors.primary | string | Default text color. |
54
46
  | colors.secondary | string | Default background color. |
55
- | colors.effect | string | Default ripple color. |
47
+ | colors.effect | string | Default ripple color. |
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.11.5",
5
+ "version": "1.11.6",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [
@@ -1 +0,0 @@
1
- export const LABEL_SCALE = 0.7;
@@ -1,35 +0,0 @@
1
- import { Animated } from 'react-native';
2
-
3
- import { LABEL_SCALE } from './constants';
4
- import { CONTAINER_PADDINGS } from './styles';
5
-
6
- export const createLabelAnimations = anims => {
7
- const [top, scale] = anims;
8
-
9
- return [
10
- [
11
- Animated.timing(top, {
12
- toValue: CONTAINER_PADDINGS.top - 4,
13
- useNativeDriver: true,
14
- duration: 100
15
- }),
16
- Animated.timing(scale, {
17
- toValue: 1,
18
- useNativeDriver: true,
19
- duration: 100
20
- })
21
- ],
22
- [
23
- Animated.timing(top, {
24
- toValue: 4,
25
- useNativeDriver: true,
26
- duration: 100
27
- }),
28
- Animated.timing(scale, {
29
- toValue: LABEL_SCALE,
30
- useNativeDriver: true,
31
- duration: 100
32
- })
33
- ]
34
- ];
35
- };
@@ -1 +0,0 @@
1
- export const LABEL_SCALE = 0.7;
@@ -1,37 +0,0 @@
1
- import { Animated } from 'react-native';
2
-
3
- import { LABEL_SCALE } from './constants';
4
- import { CONTAINER_PADDINGS } from './styles';
5
-
6
- const ANIM_DURATION = 100;
7
-
8
- export const createLabelAnimations = anims => {
9
- const [top, scale] = anims;
10
-
11
- return [
12
- [
13
- Animated.timing(top, {
14
- toValue: CONTAINER_PADDINGS.top - 4,
15
- useNativeDriver: true,
16
- duration: ANIM_DURATION
17
- }),
18
- Animated.timing(scale, {
19
- toValue: 1,
20
- useNativeDriver: true,
21
- duration: ANIM_DURATION
22
- })
23
- ],
24
- [
25
- Animated.timing(top, {
26
- toValue: 4,
27
- useNativeDriver: true,
28
- duration: ANIM_DURATION
29
- }),
30
- Animated.timing(scale, {
31
- toValue: LABEL_SCALE,
32
- useNativeDriver: true,
33
- duration: ANIM_DURATION
34
- })
35
- ]
36
- ];
37
- };
@@ -1 +0,0 @@
1
- export const LABEL_SCALE = 0.7;