etendo-ui-library 1.0.82 → 1.0.84

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 (108) hide show
  1. package/.ondevice/main.js +1 -0
  2. package/.ondevice/storybook.requires.js +5 -2
  3. package/.storybook/main.js +1 -0
  4. package/.storybook/preview-head.html +30 -0
  5. package/.storybook/preview.js +2 -0
  6. package/.storybook/webpack.config.js +22 -0
  7. package/components/button/Button.stories.tsx +7 -22
  8. package/components/button/Button.styles.tsx +24 -10
  9. package/components/button/Button.tsx +48 -24
  10. package/components/button/Button.types.tsx +2 -2
  11. package/components/button/ButtonDefault.stories.tsx +30 -0
  12. package/components/button/__snapshots__/Button.test.tsx.snap +105 -76
  13. package/components/cards/cardDropdown/CardDropdown.stories.tsx +151 -148
  14. package/components/cards/cardDropdown/CardDropdown.styles.ts +24 -24
  15. package/components/cards/cardDropdown/CardDropdown.tsx +14 -8
  16. package/components/cards/cardDropdown/component/CardDropdownOptions.tsx +20 -9
  17. package/components/docs/screens/changelog/ChangeLogScreen.style.ts +8 -9
  18. package/components/docs/screens/changelog/ChangeLogScreen.tsx +35 -12
  19. package/components/docs/screens/getStarted/GetStartedScreen.style.ts +15 -15
  20. package/components/docs/screens/getStarted/GetStartedScreen.tsx +38 -16
  21. package/components/input/Input.style.tsx +46 -11
  22. package/components/input/Input.tsx +3 -1
  23. package/components/input/Input.types.ts +4 -2
  24. package/components/input/components/InputField.tsx +12 -6
  25. package/components/input/components/InputHelperText.tsx +5 -3
  26. package/components/input/components/InputOptions.tsx +9 -6
  27. package/components/input/components/InputTitle.tsx +9 -3
  28. package/components/navbar/components/DrawerLateral/DrawerLateral.styles.ts +8 -8
  29. package/components/navbar/components/DrawerLateral/DrawerLateral.tsx +30 -25
  30. package/components/navbar/components/DrawerLateral/DrawerLateralHelper.tsx +3 -3
  31. package/components/navbar/components/DrawerLateral/DrawerLateralSubMenu.tsx +13 -7
  32. package/components/navbar/components/DrawerLateral/DrawerSectionsContainer.tsx +8 -5
  33. package/components/navbar/components/EtendoLogo/EtendoLogo.tsx +2 -2
  34. package/components/navbar/components/MenuBurger/MenuBurger.tsx +2 -2
  35. package/components/navbar/components/Notification/Notification.styles.ts +11 -11
  36. package/components/navbar/components/Notification/Notification.tsx +3 -3
  37. package/components/navbar/components/Notification/NotificationsOptions.tsx +21 -9
  38. package/components/navbar/components/Profile/Profile.styles.ts +12 -12
  39. package/components/navbar/components/Profile/ProfileImage.tsx +10 -4
  40. package/components/navbar/components/Profile/ProfileOptions.tsx +18 -9
  41. package/components/navbar/components/Welcome/Welcome.styles.ts +3 -3
  42. package/components/navbar/components/Welcome/Welcome.tsx +12 -4
  43. package/components/pagination/Pagination.tsx +7 -3
  44. package/components/pagination/__snapshots__/Pagination.test.tsx.snap +14 -5
  45. package/components/states/componentsStates/ComponentsStatesScreen.style.ts +4 -4
  46. package/components/states/componentsStates/ComponentsStatesScreen.tsx +9 -6
  47. package/components/statusbar/StatusBar.styles.tsx +2 -2
  48. package/components/statusbar/StepActive.tsx +8 -4
  49. package/components/statusbar/StepDisabled.tsx +6 -3
  50. package/components/statusbar/__snapshots__/StatusBar.test.tsx.snap +90 -45
  51. package/components/tab/Tab.stories.tsx +52 -0
  52. package/components/tab/Tab.styles.ts +20 -0
  53. package/components/tab/Tab.test.tsx +1 -2
  54. package/components/tab/Tab.tsx +33 -36
  55. package/components/tab/Tab.types.ts +8 -7
  56. package/components/tab/__snapshots__/Tab.test.tsx.snap +32 -26
  57. package/components/table/Table.stories.tsx +2 -0
  58. package/components/table/Table.styles.ts +9 -10
  59. package/components/table/Table.tsx +3 -3
  60. package/components/table/Table.types.ts +2 -2
  61. package/components/table/__snapshots__/Table.test.tsx.snap +820 -314
  62. package/components/table/components/TableCell.tsx +7 -3
  63. package/components/table/components/TableCellEdit.tsx +6 -4
  64. package/components/table/components/TableHeaders.tsx +19 -5
  65. package/components/typography/Typography.stories.tsx +33 -0
  66. package/components/typography/Typography.styles.tsx +439 -0
  67. package/components/typography/Typography.test.tsx +65 -0
  68. package/components/typography/Typography.tsx +22 -0
  69. package/components/typography/Typography.types.ts +78 -0
  70. package/components/typography/TypographyVariant.stories.tsx +104 -0
  71. package/helpers/globals.css +27 -0
  72. package/helpers/table_utils.ts +3 -3
  73. package/index.js +1 -0
  74. package/package.json +3 -2
  75. package/storybook-static/0.2e5bf5dd.iframe.bundle.js +1 -0
  76. package/storybook-static/0.8b91f8364fc4309f6c66.manager.bundle.js +1 -0
  77. package/storybook-static/4.333ac5fd.iframe.bundle.js +3 -0
  78. package/storybook-static/4.333ac5fd.iframe.bundle.js.LICENSE.txt +8 -0
  79. package/storybook-static/4.333ac5fd.iframe.bundle.js.map +1 -0
  80. package/storybook-static/4.341c47dac7ba0854b476.manager.bundle.js +2 -0
  81. package/storybook-static/4.341c47dac7ba0854b476.manager.bundle.js.LICENSE.txt +8 -0
  82. package/storybook-static/5.2e8aea9e.iframe.bundle.js +1 -0
  83. package/storybook-static/5.cd9d481bfc9ded5d716e.manager.bundle.js +1 -0
  84. package/storybook-static/6.612e691b.iframe.bundle.js +3 -0
  85. package/storybook-static/6.612e691b.iframe.bundle.js.LICENSE.txt +12 -0
  86. package/storybook-static/6.612e691b.iframe.bundle.js.map +1 -0
  87. package/storybook-static/6.9feef05185d609e31f22.manager.bundle.js +2 -0
  88. package/storybook-static/6.9feef05185d609e31f22.manager.bundle.js.LICENSE.txt +12 -0
  89. package/storybook-static/7.5b853c0800cba324e4c6.manager.bundle.js +1 -0
  90. package/storybook-static/7.b4738ab2.iframe.bundle.js +1 -0
  91. package/storybook-static/8.ccb4f60f9966af7ce524.manager.bundle.js +1 -0
  92. package/storybook-static/favicon.ico +0 -0
  93. package/storybook-static/iframe.html +164 -0
  94. package/storybook-static/index.html +55 -0
  95. package/storybook-static/main.15eb3e9c.iframe.bundle.js +1 -0
  96. package/storybook-static/main.8c7e28bb1ab2a511d658.manager.bundle.js +1 -0
  97. package/storybook-static/runtime~main.3ed789116ea640a11610.manager.bundle.js +1 -0
  98. package/storybook-static/runtime~main.f3a67409.iframe.bundle.js +1 -0
  99. package/storybook-static/vendors~main.41de9ae1a5663f7c9587.manager.bundle.js +2 -0
  100. package/storybook-static/vendors~main.41de9ae1a5663f7c9587.manager.bundle.js.LICENSE.txt +82 -0
  101. package/storybook-static/vendors~main.4b28d355.iframe.bundle.js +3 -0
  102. package/storybook-static/vendors~main.4b28d355.iframe.bundle.js.LICENSE.txt +100 -0
  103. package/storybook-static/vendors~main.4b28d355.iframe.bundle.js.map +1 -0
  104. package/styles/colors.ts +6 -6
  105. package/webpack.config.js +33 -0
  106. package/components/states/States.stories.tsx +0 -13
  107. package/components/statusbar/StatusBar.stories.tsx +0 -84
  108. package/components/tab/Tabs.stories.tsx +0 -41
package/.ondevice/main.js CHANGED
@@ -5,5 +5,6 @@ module.exports = {
5
5
  '@storybook/addon-ondevice-controls',
6
6
  '@storybook/addon-ondevice-backgrounds',
7
7
  '@storybook/addon-ondevice-actions',
8
+ '@storybook/addon-react-native-web',
8
9
  ],
9
10
  };
@@ -29,18 +29,21 @@ try {
29
29
  argsEnhancers.forEach(enhancer => addArgsEnhancer(enhancer));
30
30
  } catch {}
31
31
 
32
+ // TODO: add the status component in the return section.
32
33
  const getStories = () => {
33
34
  return [
35
+ require('../components/button/ButtonDefault.stories.tsx'),
34
36
  require('../components/button/Button.stories.tsx'),
35
37
  require('../components/cards/cardDropdown/CardDropdown.stories.tsx'),
36
38
  require('../components/docs/Docs.stories.tsx'),
37
39
  require('../components/input/Input.stories.tsx'),
38
40
  require('../components/navbar/Navbar.stories.tsx'),
39
41
  require('../components/pagination/Pagination.stories.tsx'),
40
- require('../components/states/States.stories.tsx'),
41
42
  require('../components/statusbar/StatusBar.stories.tsx'),
42
- require('../components/tab/Tabs.stories.tsx'),
43
+ require('../components/tab/Tab.stories.tsx'),
43
44
  require('../components/table/Table.stories.tsx'),
45
+ require('../components/typography/Typography.stories.tsx'),
46
+ require('../components/typography/TypographyVariant.stories.tsx'),
44
47
  ];
45
48
  };
46
49
 
@@ -8,6 +8,7 @@ module.exports = {
8
8
  '@storybook/addon-actions',
9
9
  ],
10
10
  framework: '@storybook/react',
11
+ staticDirs: ['../assets'],
11
12
  webpackFinal: async (config, {configType}) => {
12
13
  // Exclude react-native-linear-gradient from being bundled in Storybook
13
14
  config.resolve.alias = {
@@ -0,0 +1,30 @@
1
+ <style type="text/css">
2
+ @font-face {
3
+ font-family: 'Inter';
4
+ src: url('/assets/fonts/Inter-Regular.ttf');
5
+ font-weight: 400;
6
+ font-style: normal;
7
+ }
8
+
9
+ @font-face {
10
+ font-family: 'Inter';
11
+ src: url('/assets/fonts/Inter-Medium.ttf');
12
+ font-weight: 500;
13
+ font-style: normal;
14
+ }
15
+
16
+ @font-face {
17
+ font-family: 'Inter';
18
+ src: url('/assets/fonts/Inter-SemiBold.ttf');
19
+ font-weight: 600;
20
+ font-style: normal;
21
+ }
22
+
23
+ @font-face {
24
+ font-family: 'Inter';
25
+ src: url('/assets/fonts/Inter-Bold.ttf');
26
+ font-weight: 700;
27
+ font-style: normal;
28
+ }
29
+
30
+ </style>
@@ -1,3 +1,5 @@
1
+ import '../helpers/globals.css';
2
+
1
3
  export const parameters = {
2
4
  actions: {argTypesRegex: '^on[A-Z].*'},
3
5
  controls: {
@@ -0,0 +1,22 @@
1
+ const path = require('path');
2
+
3
+ module.exports = async ({config}) => {
4
+ config.module.rules.push({
5
+ test: /\.(sass|scss|css)$/,
6
+ use: ['resolve-url-loader'],
7
+ include: path.resolve(__dirname, '../'),
8
+ });
9
+ config.module.rules.push({
10
+ test: /\.(png|woff|woff2|eot|ttf|svg)$/,
11
+ use: [
12
+ {
13
+ loader: 'file-loader',
14
+ query: {
15
+ name: '[name].[ext]',
16
+ },
17
+ },
18
+ ],
19
+ include: path.resolve(__dirname, '../'),
20
+ });
21
+ return config;
22
+ };
@@ -6,7 +6,7 @@ import {View} from 'react-native';
6
6
  import {styles} from './Button.styles';
7
7
  import addMarginContainer from '../../helpers/addMargin';
8
8
  import {CheckIcon} from '../../assets/images/icons/CheckIcon';
9
- import { NEUTRALS_0 } from '../../styles/colors';
9
+ import {NEUTRAL_0} from '../../styles/colors';
10
10
 
11
11
  const meta: Meta = {
12
12
  title: 'Etendo/Button',
@@ -16,12 +16,6 @@ const meta: Meta = {
16
16
 
17
17
  export default meta;
18
18
 
19
- const Template0: Story<ButtonProps> = args => (
20
- <View style={[styles.storiesContainer, addMarginContainer()]}>
21
- <Button {...args} />
22
- </View>
23
- );
24
-
25
19
  const Template1: Story<ButtonProps> = args => (
26
20
  <View style={[styles.storiesContainer, addMarginContainer()]}>
27
21
  <View style={styles.storiesButtonContainer}>
@@ -29,7 +23,7 @@ const Template1: Story<ButtonProps> = args => (
29
23
  onPress={() => {}}
30
24
  image={
31
25
  <CheckIcon
32
- fill={NEUTRALS_0}
26
+ fill={NEUTRAL_0}
33
27
  style={{
34
28
  marginRight: 10,
35
29
  width: 12,
@@ -39,7 +33,7 @@ const Template1: Story<ButtonProps> = args => (
39
33
  }
40
34
  text={'Primary'}
41
35
  typeStyle={'primary'}
42
- width={'full'}
36
+ width={200}
43
37
  />
44
38
  </View>
45
39
  <View style={styles.storiesButtonContainer}>
@@ -56,7 +50,7 @@ const Template1: Story<ButtonProps> = args => (
56
50
  }
57
51
  text={'Secondary'}
58
52
  typeStyle={'secondary'}
59
- width={'full'}
53
+ width={200}
60
54
  />
61
55
  </View>
62
56
  <View style={styles.storiesButtonContainer}>
@@ -73,7 +67,7 @@ const Template1: Story<ButtonProps> = args => (
73
67
  }
74
68
  text={'Terciary'}
75
69
  typeStyle={'terciary'}
76
- width={'full'}
70
+ width={200}
77
71
  />
78
72
  </View>
79
73
  <View style={styles.storiesButtonContainer}>
@@ -90,7 +84,7 @@ const Template1: Story<ButtonProps> = args => (
90
84
  }
91
85
  text={'White'}
92
86
  typeStyle={'white'}
93
- width={'full'}
87
+ width={200}
94
88
  />
95
89
  </View>
96
90
  <View style={styles.storiesButtonContainer}>
@@ -107,19 +101,10 @@ const Template1: Story<ButtonProps> = args => (
107
101
  }
108
102
  text={'WhiteBorder'}
109
103
  typeStyle={'whiteBorder'}
110
- width={'full'}
104
+ width={200}
111
105
  />
112
106
  </View>
113
107
  </View>
114
108
  );
115
109
 
116
- export const ButtonDefault = Template0.bind({});
117
110
  export const ButtonVariants = Template1.bind({});
118
-
119
- ButtonDefault.args = {
120
- text: 'Button',
121
- typeStyle: 'primary',
122
- disabled: false,
123
- width: 150,
124
- height: 50,
125
- };
@@ -1,5 +1,13 @@
1
1
  import {StyleSheet} from 'react-native';
2
- import { NEUTRALS_0, PRIMARY_100, QUATERNARY_10, QUATERNARY_50, SECONDARY_100, SECONDARY_30, TERTIARY_50 } from '../../styles/colors';
2
+ import {
3
+ NEUTRAL_0,
4
+ PRIMARY_100,
5
+ QUATERNARY_10,
6
+ QUATERNARY_50,
7
+ SECONDARY_100,
8
+ SECONDARY_30,
9
+ TERTIARY_50,
10
+ } from '../../styles/colors';
3
11
  import {buttonStyleVariant} from './Button.types';
4
12
 
5
13
  export const ButtonStyleVariant: buttonStyleVariant = {
@@ -14,7 +22,7 @@ export const ButtonStyleVariant: buttonStyleVariant = {
14
22
  padding: 24,
15
23
  },
16
24
  text: {
17
- color: NEUTRALS_0,
25
+ color: NEUTRAL_0,
18
26
  fontWeight: '600',
19
27
  },
20
28
  containerDisabled: {
@@ -23,12 +31,14 @@ export const ButtonStyleVariant: buttonStyleVariant = {
23
31
  flexDirection: 'row',
24
32
  justifyContent: 'center',
25
33
  alignItems: 'center',
34
+ height: '100%',
35
+ padding: 24,
26
36
  },
27
37
  textDisabled: {
28
- color: NEUTRALS_0,
38
+ color: NEUTRAL_0,
29
39
  fontWeight: 'bold',
30
40
  },
31
- imageColor: NEUTRALS_0,
41
+ imageColor: NEUTRAL_0,
32
42
  },
33
43
  secondary: {
34
44
  container: {
@@ -49,6 +59,7 @@ export const ButtonStyleVariant: buttonStyleVariant = {
49
59
  flexDirection: 'row',
50
60
  justifyContent: 'center',
51
61
  alignItems: 'center',
62
+ padding: 24,
52
63
  },
53
64
  textDisabled: {
54
65
  color: QUATERNARY_50,
@@ -75,6 +86,7 @@ export const ButtonStyleVariant: buttonStyleVariant = {
75
86
  flexDirection: 'row',
76
87
  justifyContent: 'center',
77
88
  alignItems: 'center',
89
+ padding: 24,
78
90
  },
79
91
  textDisabled: {
80
92
  color: TERTIARY_50,
@@ -84,7 +96,7 @@ export const ButtonStyleVariant: buttonStyleVariant = {
84
96
  },
85
97
  whiteBorder: {
86
98
  container: {
87
- backgroundColor: NEUTRALS_0,
99
+ backgroundColor: NEUTRAL_0,
88
100
  borderRadius: 5,
89
101
  flexDirection: 'row',
90
102
  borderWidth: 2,
@@ -98,13 +110,14 @@ export const ButtonStyleVariant: buttonStyleVariant = {
98
110
  fontWeight: 'bold',
99
111
  },
100
112
  containerDisabled: {
101
- backgroundColor: NEUTRALS_0,
113
+ backgroundColor: NEUTRAL_0,
102
114
  borderRadius: 5,
103
115
  flexDirection: 'row',
104
116
  borderWidth: 2,
105
117
  borderColor: TERTIARY_50,
106
118
  justifyContent: 'center',
107
119
  alignItems: 'center',
120
+ padding: 24,
108
121
  },
109
122
  textDisabled: {
110
123
  color: TERTIARY_50,
@@ -114,7 +127,7 @@ export const ButtonStyleVariant: buttonStyleVariant = {
114
127
  },
115
128
  white: {
116
129
  container: {
117
- backgroundColor: NEUTRALS_0,
130
+ backgroundColor: NEUTRAL_0,
118
131
  borderRadius: 5,
119
132
  flexDirection: 'row',
120
133
  justifyContent: 'center',
@@ -126,11 +139,12 @@ export const ButtonStyleVariant: buttonStyleVariant = {
126
139
  fontWeight: 'bold',
127
140
  },
128
141
  containerDisabled: {
129
- backgroundColor: NEUTRALS_0,
142
+ backgroundColor: NEUTRAL_0,
130
143
  borderRadius: 5,
131
144
  flexDirection: 'row',
132
145
  justifyContent: 'center',
133
146
  alignItems: 'center',
147
+ padding: 24,
134
148
  },
135
149
  textDisabled: {
136
150
  color: TERTIARY_50,
@@ -146,12 +160,12 @@ export const styles = StyleSheet.create({
146
160
  flexDirection: 'row',
147
161
  alignItems: 'flex-start',
148
162
  flex: 1,
149
- width: '100%',
163
+ width: 100,
150
164
 
151
165
  justifyContent: 'space-between',
152
166
  },
153
167
  storiesButtonContainer: {
154
168
  height: 100,
155
- width: '30%',
169
+ width: 150,
156
170
  },
157
171
  });
@@ -1,8 +1,18 @@
1
1
  import React, {useState} from 'react';
2
- import {Pressable, Text, View} from 'react-native';
3
- import { NEUTRALS_100, PRIMARY_100, PRIMARY_80, QUATERNARY_100, QUATERNARY_50, SECONDARY_50 } from '../../styles/colors';
2
+ import {Pressable, TouchableOpacity, View} from 'react-native';
3
+ import {
4
+ NEUTRAL_0,
5
+ NEUTRAL_100,
6
+ PRIMARY_100,
7
+ PRIMARY_80,
8
+ QUATERNARY_10,
9
+ QUATERNARY_100,
10
+ QUATERNARY_50,
11
+ SECONDARY_50,
12
+ } from '../../styles/colors';
4
13
  import {ButtonStyleVariant} from './Button.styles';
5
14
  import {ButtonProps, ButtonStyleType} from './Button.types';
15
+ import {Typography} from '../typography/Typography';
6
16
 
7
17
  const Button = ({
8
18
  text,
@@ -22,7 +32,7 @@ const Button = ({
22
32
  case 'secondary':
23
33
  return SECONDARY_50;
24
34
  case 'terciary':
25
- return QUATERNARY_50;
35
+ return QUATERNARY_10;
26
36
  case 'whiteBorder':
27
37
  return PRIMARY_100;
28
38
  }
@@ -32,24 +42,32 @@ const Button = ({
32
42
  case 'white':
33
43
  return QUATERNARY_100;
34
44
  case 'whiteBorder':
35
- return NEUTRALS_100;
45
+ return NEUTRAL_0;
36
46
  case 'primary':
37
- return NEUTRALS_100;
47
+ return NEUTRAL_0;
38
48
  default:
39
49
  return PRIMARY_100;
40
50
  }
41
51
  };
42
52
 
43
- const stateStyleContainer = () => {
53
+ const stateStyleContainer = (pressed: boolean) => {
44
54
  if (disabled) {
45
55
  return ButtonStyleVariant[typeStyle].containerDisabled;
46
56
  }
57
+ if (pressed) {
58
+ return {
59
+ ...ButtonStyleVariant[typeStyle].container,
60
+
61
+ opacity: 0.7,
62
+ width: width === '100%' ? '100%' : width,
63
+ };
64
+ }
47
65
  if (isHovered) {
48
66
  const hoveredBackgroundColor = getHoveredBackgroundColor(typeStyle);
49
67
  return {
50
68
  ...ButtonStyleVariant[typeStyle].container,
51
69
  backgroundColor: hoveredBackgroundColor,
52
- width: width === 'full' ? '100%' : width,
70
+ width: width === '100%' ? '100%' : width,
53
71
  };
54
72
  }
55
73
  return ButtonStyleVariant[typeStyle].container;
@@ -78,24 +96,30 @@ const Button = ({
78
96
  return ButtonStyleVariant[typeStyle].text;
79
97
  };
80
98
 
81
- const newImage =
82
- image &&
83
- React.cloneElement(image, {
84
- fill: isHovered
85
- ? getHoveredTextColorAndViewColor(typeStyle)
86
- : ButtonStyleVariant[typeStyle].imageColor,
87
- });
88
-
89
99
  return (
90
- <Pressable
91
- onHoverIn={handleHoverIn}
92
- onHoverOut={handleHoverOut}
93
- style={[stateStyleContainer(), {height: height, width: width}]}
94
- onPress={onPress}
95
- >
96
- <View>{image && newImage}</View>
97
- <Text style={[stateStyleText()]}>{text}</Text>
98
- </Pressable>
100
+ <TouchableOpacity>
101
+ <Pressable
102
+ onHoverIn={handleHoverIn}
103
+ onHoverOut={handleHoverOut}
104
+ style={({pressed}) => [
105
+ stateStyleContainer(pressed),
106
+ {height: height, width: width},
107
+ ]}
108
+ onPress={onPress}
109
+ >
110
+ <View>
111
+ {image &&
112
+ React.cloneElement(image, {
113
+ fill: isHovered
114
+ ? getHoveredTextColorAndViewColor(typeStyle)
115
+ : ButtonStyleVariant[typeStyle].imageColor,
116
+ })}
117
+ </View>
118
+ <Typography variant="p_m" style={[stateStyleText()]}>
119
+ {text}
120
+ </Typography>
121
+ </Pressable>
122
+ </TouchableOpacity>
99
123
  );
100
124
  };
101
125
 
@@ -22,8 +22,8 @@ export interface ButtonProps {
22
22
  onPress: () => void;
23
23
  text: string;
24
24
  typeStyle: ButtonStyleType;
25
- image?: React.ReactNode;
25
+ image?: React.ReactElement;
26
26
  disabled?: boolean;
27
- width?: number | string | 'full';
27
+ width?: number | string;
28
28
  height?: number | string;
29
29
  }
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import Button from '../button/Button';
3
+ import {Story, Meta} from '@storybook/react';
4
+ import {ButtonProps} from './Button.types';
5
+ import {View} from 'react-native';
6
+ import {styles} from './Button.styles';
7
+ import addMarginContainer from '../../helpers/addMargin';
8
+ import {CheckIcon} from '../../assets/images/icons/CheckIcon';
9
+
10
+ const meta: Meta = {
11
+ title: 'Etendo/Button',
12
+ component: Button,
13
+ argTypes: {},
14
+ };
15
+ export default meta;
16
+
17
+ const Template0: Story<ButtonProps> = args => (
18
+ <View style={[styles.storiesContainer, addMarginContainer()]}>
19
+ <Button {...args} />
20
+ </View>
21
+ );
22
+
23
+ export const ButtonDefault = Template0.bind({});
24
+
25
+ ButtonDefault.args = {
26
+ text: 'Button',
27
+ typeStyle: 'secondary',
28
+ disabled: false,
29
+ width: 150,
30
+ };
@@ -4,10 +4,8 @@ exports[`Running Test for Input Check Button disabled 1`] = `
4
4
  <View
5
5
  accessible={true}
6
6
  collapsable={false}
7
- focusable={true}
8
- onBlur={[Function]}
7
+ focusable={false}
9
8
  onClick={[Function]}
10
- onFocus={[Function]}
11
9
  onResponderGrant={[Function]}
12
10
  onResponderMove={[Function]}
13
11
  onResponderRelease={[Function]}
@@ -15,90 +13,121 @@ exports[`Running Test for Input Check Button disabled 1`] = `
15
13
  onResponderTerminationRequest={[Function]}
16
14
  onStartShouldSetResponder={[Function]}
17
15
  style={
18
- Array [
19
- Object {
20
- "alignItems": "center",
21
- "backgroundColor": "#DDDFF6",
22
- "borderRadius": 5,
23
- "flexDirection": "row",
24
- "justifyContent": "center",
25
- },
26
- Object {
27
- "height": undefined,
28
- "width": "auto",
29
- },
30
- ]
16
+ Object {
17
+ "opacity": 1,
18
+ }
31
19
  }
32
20
  >
33
- <View>
34
- <RNSVGSvgView
35
- align="xMidYMid"
36
- bbHeight="10"
37
- bbWidth="12"
38
- fill="none"
39
- focusable={false}
40
- height={10}
41
- meetOrSlice={0}
42
- minX={0}
43
- minY={0}
44
- style={
45
- Array [
46
- Object {
47
- "backgroundColor": "transparent",
48
- "borderWidth": 0,
49
- },
50
- Object {
51
- "height": 10,
52
- "marginRight": 10,
53
- "width": 12,
54
- },
55
- Object {
56
- "flex": 0,
57
- "height": 10,
58
- "width": 12,
59
- },
60
- ]
61
- }
62
- vbHeight={32}
63
- vbWidth={43}
64
- width={12}
65
- >
66
- <RNSVGGroup
67
- fill={null}
68
- propList={
21
+ <View
22
+ accessible={true}
23
+ collapsable={false}
24
+ focusable={true}
25
+ onBlur={[Function]}
26
+ onClick={[Function]}
27
+ onFocus={[Function]}
28
+ onResponderGrant={[Function]}
29
+ onResponderMove={[Function]}
30
+ onResponderRelease={[Function]}
31
+ onResponderTerminate={[Function]}
32
+ onResponderTerminationRequest={[Function]}
33
+ onStartShouldSetResponder={[Function]}
34
+ style={
35
+ Array [
36
+ Object {
37
+ "alignItems": "center",
38
+ "backgroundColor": "#DDDFF6",
39
+ "borderRadius": 5,
40
+ "flexDirection": "row",
41
+ "height": "100%",
42
+ "justifyContent": "center",
43
+ "padding": 24,
44
+ },
45
+ Object {
46
+ "height": undefined,
47
+ "width": "auto",
48
+ },
49
+ ]
50
+ }
51
+ >
52
+ <View>
53
+ <RNSVGSvgView
54
+ align="xMidYMid"
55
+ bbHeight="10"
56
+ bbWidth="12"
57
+ fill="none"
58
+ focusable={false}
59
+ height={10}
60
+ meetOrSlice={0}
61
+ minX={0}
62
+ minY={0}
63
+ style={
69
64
  Array [
70
- "fill",
65
+ Object {
66
+ "backgroundColor": "transparent",
67
+ "borderWidth": 0,
68
+ },
69
+ Object {
70
+ "height": 10,
71
+ "marginRight": 10,
72
+ "width": 12,
73
+ },
74
+ Object {
75
+ "flex": 0,
76
+ "height": 10,
77
+ "width": 12,
78
+ },
71
79
  ]
72
80
  }
81
+ vbHeight={32}
82
+ vbWidth={43}
83
+ width={12}
73
84
  >
74
- <RNSVGPath
75
- d="M41.0309 1.12469C39.3624 -0.37562 36.6578 -0.374175 34.9899 1.12469L15.4917 21.2185L6.88504 12.2221C5.21785 10.4783 2.51325 10.4783 0.92578 12.2224C-0.277994 13.9669 -0.277994 16.7949 0.92578 18.5386L12.4693 30.6925C14.1382 32.4358 16.8428 32.4358 18.5114 30.6925L41.0309 7.15158C42.6985 5.40676 42.6985 2.57913 41.0309 1.12469Z"
76
- fill={
77
- Object {
78
- "payload": 4294967295,
79
- "type": 0,
80
- }
81
- }
85
+ <RNSVGGroup
86
+ fill={null}
82
87
  propList={
83
88
  Array [
84
89
  "fill",
85
90
  ]
86
91
  }
87
- />
88
- </RNSVGGroup>
89
- </RNSVGSvgView>
92
+ >
93
+ <RNSVGPath
94
+ d="M41.0309 1.12469C39.3624 -0.37562 36.6578 -0.374175 34.9899 1.12469L15.4917 21.2185L6.88504 12.2221C5.21785 10.4783 2.51325 10.4783 0.92578 12.2224C-0.277994 13.9669 -0.277994 16.7949 0.92578 18.5386L12.4693 30.6925C14.1382 32.4358 16.8428 32.4358 18.5114 30.6925L41.0309 7.15158C42.6985 5.40676 42.6985 2.57913 41.0309 1.12469Z"
95
+ fill={
96
+ Object {
97
+ "payload": 4294967295,
98
+ "type": 0,
99
+ }
100
+ }
101
+ propList={
102
+ Array [
103
+ "fill",
104
+ ]
105
+ }
106
+ />
107
+ </RNSVGGroup>
108
+ </RNSVGSvgView>
109
+ </View>
110
+ <Text
111
+ style={
112
+ Array [
113
+ Object {
114
+ "fontFamily": "Inter",
115
+ "fontSize": 16,
116
+ "fontWeight": "500",
117
+ "letterSpacing": -1,
118
+ "lineHeight": 22,
119
+ },
120
+ Array [
121
+ Object {
122
+ "color": "#FFFFFF",
123
+ "fontWeight": "bold",
124
+ },
125
+ ],
126
+ ]
127
+ }
128
+ >
129
+ Button CTA
130
+ </Text>
90
131
  </View>
91
- <Text
92
- style={
93
- Array [
94
- Object {
95
- "color": "#FFFFFF",
96
- "fontWeight": "bold",
97
- },
98
- ]
99
- }
100
- >
101
- Button CTA
102
- </Text>
103
132
  </View>
104
133
  `;