etendo-ui-library 1.0.83 → 1.0.85
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/.ondevice/main.js +1 -0
- package/.ondevice/storybook.requires.js +5 -1
- package/.storybook/main.js +1 -0
- package/.storybook/preview-head.html +30 -0
- package/.storybook/preview.js +2 -0
- package/.storybook/webpack.config.js +22 -0
- package/components/button/Button.stories.tsx +6 -21
- package/components/button/Button.styles.tsx +17 -3
- package/components/button/Button.tsx +48 -24
- package/components/button/Button.types.tsx +2 -2
- package/components/button/ButtonDefault.stories.tsx +30 -0
- package/components/button/__snapshots__/Button.test.tsx.snap +105 -76
- package/components/cards/cardDropdown/CardDropdown.stories.tsx +151 -148
- package/components/cards/cardDropdown/CardDropdown.tsx +7 -6
- package/components/cards/cardDropdown/component/CardDropdownOptions.tsx +20 -9
- package/components/docs/screens/changelog/ChangeLogScreen.style.ts +4 -5
- package/components/docs/screens/changelog/ChangeLogScreen.tsx +35 -12
- package/components/docs/screens/getStarted/GetStartedScreen.style.ts +3 -3
- package/components/docs/screens/getStarted/GetStartedScreen.tsx +38 -16
- package/components/input/Input.style.tsx +37 -2
- package/components/input/Input.tsx +3 -1
- package/components/input/Input.types.ts +4 -2
- package/components/input/components/InputField.tsx +12 -6
- package/components/input/components/InputHelperText.tsx +5 -3
- package/components/input/components/InputOptions.tsx +6 -5
- package/components/input/components/InputTitle.tsx +9 -3
- package/components/navbar/components/DrawerLateral/DrawerLateral.tsx +30 -25
- package/components/navbar/components/DrawerLateral/DrawerLateralSubMenu.tsx +13 -7
- package/components/navbar/components/DrawerLateral/DrawerSectionsContainer.tsx +8 -5
- package/components/navbar/components/Notification/NotificationsOptions.tsx +21 -9
- package/components/navbar/components/Profile/ProfileImage.tsx +10 -4
- package/components/navbar/components/Profile/ProfileOptions.tsx +18 -9
- package/components/navbar/components/Welcome/Welcome.tsx +12 -4
- package/components/pagination/Pagination.tsx +7 -3
- package/components/pagination/__snapshots__/Pagination.test.tsx.snap +14 -5
- package/components/states/componentsStates/ComponentsStatesScreen.tsx +9 -6
- package/components/statusbar/StepActive.tsx +8 -4
- package/components/statusbar/StepDisabled.tsx +6 -3
- package/components/statusbar/__snapshots__/StatusBar.test.tsx.snap +90 -45
- package/components/tab/Tab.stories.tsx +7 -2
- package/components/tab/Tab.tsx +19 -7
- package/components/tab/__snapshots__/Tab.test.tsx.snap +3 -3
- package/components/table/__snapshots__/Table.test.tsx.snap +736 -300
- package/components/table/components/TableCell.tsx +7 -3
- package/components/table/components/TableHeaders.tsx +19 -5
- package/components/typography/Typography.stories.tsx +33 -0
- package/components/typography/Typography.styles.tsx +439 -0
- package/components/typography/Typography.test.tsx +65 -0
- package/components/typography/Typography.tsx +22 -0
- package/components/typography/Typography.types.ts +78 -0
- package/components/typography/TypographyVariant.stories.tsx +104 -0
- package/helpers/globals.css +27 -0
- package/index.js +1 -0
- package/package.json +3 -2
- package/storybook-static/0.2e5bf5dd.iframe.bundle.js +1 -0
- package/storybook-static/0.8b91f8364fc4309f6c66.manager.bundle.js +1 -0
- package/storybook-static/4.333ac5fd.iframe.bundle.js +3 -0
- package/storybook-static/4.333ac5fd.iframe.bundle.js.LICENSE.txt +8 -0
- package/storybook-static/4.333ac5fd.iframe.bundle.js.map +1 -0
- package/storybook-static/4.341c47dac7ba0854b476.manager.bundle.js +2 -0
- package/storybook-static/4.341c47dac7ba0854b476.manager.bundle.js.LICENSE.txt +8 -0
- package/storybook-static/5.2e8aea9e.iframe.bundle.js +1 -0
- package/storybook-static/5.cd9d481bfc9ded5d716e.manager.bundle.js +1 -0
- package/storybook-static/6.612e691b.iframe.bundle.js +3 -0
- package/storybook-static/6.612e691b.iframe.bundle.js.LICENSE.txt +12 -0
- package/storybook-static/6.612e691b.iframe.bundle.js.map +1 -0
- package/storybook-static/6.9feef05185d609e31f22.manager.bundle.js +2 -0
- package/storybook-static/6.9feef05185d609e31f22.manager.bundle.js.LICENSE.txt +12 -0
- package/storybook-static/7.5b853c0800cba324e4c6.manager.bundle.js +1 -0
- package/storybook-static/7.b4738ab2.iframe.bundle.js +1 -0
- package/storybook-static/8.ccb4f60f9966af7ce524.manager.bundle.js +1 -0
- package/storybook-static/favicon.ico +0 -0
- package/storybook-static/iframe.html +164 -0
- package/storybook-static/index.html +55 -0
- package/storybook-static/main.15eb3e9c.iframe.bundle.js +1 -0
- package/storybook-static/main.8c7e28bb1ab2a511d658.manager.bundle.js +1 -0
- package/storybook-static/runtime~main.3ed789116ea640a11610.manager.bundle.js +1 -0
- package/storybook-static/runtime~main.f3a67409.iframe.bundle.js +1 -0
- package/storybook-static/vendors~main.41de9ae1a5663f7c9587.manager.bundle.js +2 -0
- package/storybook-static/vendors~main.41de9ae1a5663f7c9587.manager.bundle.js.LICENSE.txt +82 -0
- package/storybook-static/vendors~main.4b28d355.iframe.bundle.js +3 -0
- package/storybook-static/vendors~main.4b28d355.iframe.bundle.js.LICENSE.txt +100 -0
- package/storybook-static/vendors~main.4b28d355.iframe.bundle.js.map +1 -0
- package/webpack.config.js +33 -0
- package/components/states/States.stories.tsx +0 -13
package/.ondevice/main.js
CHANGED
|
@@ -29,17 +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/
|
|
42
|
+
require('../components/statusbar/StatusBar.stories.tsx'),
|
|
41
43
|
require('../components/tab/Tab.stories.tsx'),
|
|
42
44
|
require('../components/table/Table.stories.tsx'),
|
|
45
|
+
require('../components/typography/Typography.stories.tsx'),
|
|
46
|
+
require('../components/typography/TypographyVariant.stories.tsx'),
|
|
43
47
|
];
|
|
44
48
|
};
|
|
45
49
|
|
package/.storybook/main.js
CHANGED
|
@@ -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>
|
package/.storybook/preview.js
CHANGED
|
@@ -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 {
|
|
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}>
|
|
@@ -39,7 +33,7 @@ const Template1: Story<ButtonProps> = args => (
|
|
|
39
33
|
}
|
|
40
34
|
text={'Primary'}
|
|
41
35
|
typeStyle={'primary'}
|
|
42
|
-
width={
|
|
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={
|
|
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={
|
|
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={
|
|
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={
|
|
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 {
|
|
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 = {
|
|
@@ -23,6 +31,8 @@ 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
38
|
color: NEUTRAL_0,
|
|
@@ -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,
|
|
@@ -105,6 +117,7 @@ export const ButtonStyleVariant: buttonStyleVariant = {
|
|
|
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,
|
|
@@ -131,6 +144,7 @@ export const ButtonStyleVariant: buttonStyleVariant = {
|
|
|
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:
|
|
163
|
+
width: 100,
|
|
150
164
|
|
|
151
165
|
justifyContent: 'space-between',
|
|
152
166
|
},
|
|
153
167
|
storiesButtonContainer: {
|
|
154
168
|
height: 100,
|
|
155
|
-
width:
|
|
169
|
+
width: 150,
|
|
156
170
|
},
|
|
157
171
|
});
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import React, {useState} from 'react';
|
|
2
|
-
import {Pressable,
|
|
3
|
-
import {
|
|
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
|
|
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
|
|
45
|
+
return NEUTRAL_0;
|
|
36
46
|
case 'primary':
|
|
37
|
-
return
|
|
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 === '
|
|
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
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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.
|
|
25
|
+
image?: React.ReactElement;
|
|
26
26
|
disabled?: boolean;
|
|
27
|
-
width?: number | string
|
|
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={
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
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
|
-
<
|
|
75
|
-
|
|
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
|
-
|
|
89
|
-
|
|
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
|
`;
|