vpt-sebraeds 0.0.1 → 0.0.2
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/assets/Propertychart.png +0 -0
- package/assets/Propertygoal.png +0 -0
- package/assets/Propertypencil.png +0 -0
- package/components/Accordion/Accordion.stories.jsx +92 -0
- package/components/Accordion/index.jsx +145 -0
- package/components/AccordionAvatar/AccordionAvatar.stories.jsx +27 -0
- package/components/AccordionAvatar/index.jsx +93 -0
- package/components/AdBanner/AdBanner.stories.jsx +63 -0
- package/components/AdBanner/index.jsx +90 -0
- package/components/Avatar/Avatar.stories.jsx +60 -0
- package/components/Avatar/index.jsx +89 -0
- package/components/BottomSheet/BottomSheet.stories.jsx +378 -0
- package/components/BottomSheet/BottomSheetNomeEmpresa.jsx +110 -0
- package/components/BottomSheet/Components/ActionButtons.jsx +91 -0
- package/components/BottomSheet/Components/ListaDeEstados.jsx +336 -0
- package/components/BottomSheet/index.jsx +282 -0
- package/components/Breadcrumb/Breadcrumb.stories.jsx +62 -0
- package/components/Breadcrumb/index.jsx +89 -0
- package/components/Button/ButtonPrimary.stories.jsx +311 -0
- package/components/Button/index.jsx +479 -0
- package/components/CardNumber/CardNumber.stories.jsx +60 -0
- package/components/CardNumber/index.jsx +133 -0
- package/components/Checkbox/Checkbox.stories.jsx +70 -0
- package/components/Checkbox/index.jsx +120 -0
- package/components/CommitmentCard/CommitmentCard.stories.jsx +283 -0
- package/components/CommitmentCard/index.jsx +227 -0
- package/components/ContentBlock/ContentBlock.stories.tsx +48 -0
- package/components/ContentBlock/ContentBlock.tsx +50 -0
- package/components/ContentCard/ContentCard.stories.jsx +99 -0
- package/components/ContentCard/index.jsx +289 -0
- package/components/ContentRelatedCard/ContentRelatedCard.stories.jsx +80 -0
- package/components/ContentRelatedCard/index.jsx +80 -0
- package/components/ContentSlot/ContentSlot.stories.jsx +276 -0
- package/components/ContentSlot/index.jsx +195 -0
- package/components/CopyButton/CopyButton.stories.jsx +111 -0
- package/components/CopyButton/index.jsx +192 -0
- package/components/Datepicker/Datepicker.stories.jsx +239 -0
- package/components/Datepicker/MonthSelector.jsx +323 -0
- package/components/Datepicker/TimeSelector.jsx +261 -0
- package/components/Datepicker/index.jsx +450 -0
- package/components/DonutChart/DonutChart.stories.jsx +220 -0
- package/components/DonutChart/index.jsx +191 -0
- package/components/Dropdown/Dropdown.stories.jsx +332 -0
- package/components/Dropdown/DropdownCommitments.jsx +0 -0
- package/components/Dropdown/index.jsx +372 -0
- package/components/DropdownCommitments/index.js +148 -0
- package/components/EmptySlot/EmptySlot.stories.jsx +114 -0
- package/components/EmptySlot/index.jsx +151 -0
- package/components/FilterTag/FilterTag.stories.jsx +55 -0
- package/components/FilterTag/index.jsx +73 -0
- package/components/FilterableMultiSelect/FilterableMultiSelect.stories.jsx +63 -0
- package/components/FilterableMultiSelect/index.jsx +198 -0
- package/components/GettingStarted.jsx +38 -0
- package/components/Header/Header.stories.jsx +839 -0
- package/components/Header/components/Context.jsx +42 -0
- package/components/Header/components/Information.jsx +81 -0
- package/components/Header/components/Shortcut.jsx +49 -0
- package/components/Header/components/SwitchAccount.jsx +277 -0
- package/components/Header/components/Variants.jsx +182 -0
- package/components/Header/components/index.jsx +12 -0
- package/components/Header/index.jsx +207 -0
- package/components/Icon/iconEnums.ts +30 -0
- package/components/Icon/index.jsx +13 -0
- package/components/Image/Image.stories.jsx +251 -0
- package/components/Image/index.jsx +176 -0
- package/components/Input/Input.stories.jsx +304 -0
- package/components/Input/index.jsx +292 -0
- package/components/Legend/Legend.stories.jsx +110 -0
- package/components/Legend/index.jsx +86 -0
- package/components/Link/Link.stories.jsx +79 -0
- package/components/Link/index.jsx +62 -0
- package/components/List/List.stories.jsx +57 -0
- package/components/List/index.jsx +63 -0
- package/components/MenuAccordion/MenuAccordion.stories.jsx +27 -0
- package/components/MenuAccordion/assets/Vector.png +0 -0
- package/components/MenuAccordion/index.jsx +97 -0
- package/components/Modal/Modal.stories.jsx +152 -0
- package/components/Modal/index.jsx +248 -0
- package/components/Navbar/Navbar.stories.jsx +244 -0
- package/components/Navbar/index.jsx +129 -0
- package/components/NavigationItem/NavigationItem.stories.tsx +454 -0
- package/components/NavigationItem/index.tsx +501 -0
- package/components/NotificationBanner/NotificationBanner.stories.jsx +57 -0
- package/components/NotificationBanner/index.jsx +153 -0
- package/components/NotificationCard/NotificationCard.stories.jsx +94 -0
- package/components/NotificationCard/index.jsx +337 -0
- package/components/NumberDisplay/NumberDisplay.stories.jsx +111 -0
- package/components/NumberDisplay/index.jsx +246 -0
- package/components/Pagination/Pagination.stories.jsx +171 -0
- package/components/Pagination/index.jsx +229 -0
- package/components/ProgressBar/ProgressBar.stories.jsx +354 -0
- package/components/ProgressBar/ProgressBarSimple.jsx +0 -0
- package/components/ProgressBar/index.jsx +90 -0
- package/components/ProgressChart/ProgressChart.stories.jsx +312 -0
- package/components/ProgressChart/index.jsx +189 -0
- package/components/Quote/Quote.stories.tsx +32 -0
- package/components/Quote/Quote.tsx +60 -0
- package/components/RadioButton/RadioButton.stories.jsx +113 -0
- package/components/RadioButton/index.jsx +114 -0
- package/components/Rating/Rating.stories.jsx +157 -0
- package/components/Rating/index.jsx +145 -0
- package/components/ScrollBar/ScrollBar.stories.tsx +66 -0
- package/components/ScrollBar/index.tsx +119 -0
- package/components/Search/Search.jsx +329 -0
- package/components/Search/Search.stories.jsx +93 -0
- package/components/SegmentedButton/SegmentedButton.stories.jsx +275 -0
- package/components/SegmentedButton/index.jsx +195 -0
- package/components/Select/Select.stories.jsx +416 -0
- package/components/Select/index.jsx +308 -0
- package/components/SelectItem/SelectItem.stories.jsx +609 -0
- package/components/SelectItem/index.jsx +173 -0
- package/components/Shortcut/Shortcut.stories.jsx +146 -0
- package/components/Shortcut/index.jsx +183 -0
- package/components/ShowMore/ShowMore.stories.jsx +71 -0
- package/components/ShowMore/index.jsx +68 -0
- package/components/ShuffleItem/ShuffleItem.stories.jsx +279 -0
- package/components/ShuffleItem/ShuffleItemExample.jsx +0 -0
- package/components/ShuffleItem/ShuffleItemExample.stories.jsx +0 -0
- package/components/ShuffleItem/SimpleShuffleExample.jsx +0 -0
- package/components/ShuffleItem/index.jsx +706 -0
- package/components/Slider/Slider.stories.jsx +248 -0
- package/components/Slider/index.jsx +210 -0
- package/components/Tab/Tab.stories.jsx +324 -0
- package/components/Tab/index.jsx +483 -0
- package/components/Table/Table.stories.jsx +254 -0
- package/components/Table/index.jsx +292 -0
- package/components/Tag/Tag.stories.jsx +79 -0
- package/components/Tag/index.d.ts +10 -0
- package/components/Tag/index.jsx +129 -0
- package/components/TaskCard/TaskCard.stories.jsx +467 -0
- package/components/TaskCard/assets/README.md +22 -0
- package/components/TaskCard/assets/edit-icon.png +0 -0
- package/components/TaskCard/assets/example.js +10 -0
- package/components/TaskCard/components/EditIcon.jsx +81 -0
- package/components/TaskCard/components/SuccessContent.jsx +52 -0
- package/components/TaskCard/components/SuccessIcon.jsx +52 -0
- package/components/TaskCard/components/SuccessTitle.jsx +48 -0
- package/components/TaskCard/components/Tag.jsx +79 -0
- package/components/TaskCard/components/TagGroup.jsx +60 -0
- package/components/TaskCard/components/TaskDescription.jsx +50 -0
- package/components/TaskCard/components/index.js +7 -0
- package/components/TaskCard/index.jsx +295 -0
- package/components/Toast/Toast.stories.jsx +239 -0
- package/components/Toast/index.jsx +308 -0
- package/components/Toggle/Toggle.stories.jsx +161 -0
- package/components/Toggle/index.jsx +143 -0
- package/components/TooltipCard/TooltipCard.stories.jsx +88 -0
- package/components/TooltipCard/index.jsx +315 -0
- package/components/Typography/Typography.stories.jsx +261 -0
- package/components/Typography/index.jsx +136 -0
- package/components/styles.ts +79 -0
- package/package.json +5 -2
- package/src/index.ts +86 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Text, View } from "react-native";
|
|
2
|
+
import Accordion from ".";
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Atom/Accordion",
|
|
6
|
+
component: Accordion,
|
|
7
|
+
render: (props) => (
|
|
8
|
+
<Accordion
|
|
9
|
+
{...props}
|
|
10
|
+
content={
|
|
11
|
+
<View style={{ flexDirection: 'column' }}>
|
|
12
|
+
<Text>{props.content}</Text>
|
|
13
|
+
<Accordion
|
|
14
|
+
nested
|
|
15
|
+
title="Item 01"
|
|
16
|
+
content={
|
|
17
|
+
<Text>
|
|
18
|
+
Sed nulla quam, fermentum tincidunt lacus at, viverra vehicula eros. Etiam neque libero, vulputate sed consectetur nec, imperdiet sed turpis.
|
|
19
|
+
</Text>
|
|
20
|
+
}
|
|
21
|
+
/>
|
|
22
|
+
</View>
|
|
23
|
+
}
|
|
24
|
+
/>
|
|
25
|
+
),
|
|
26
|
+
tags: ["autodocs"],
|
|
27
|
+
parameters: {
|
|
28
|
+
layout: "centered",
|
|
29
|
+
backgrounds: {
|
|
30
|
+
default: "light",
|
|
31
|
+
values: [
|
|
32
|
+
{
|
|
33
|
+
name: "light",
|
|
34
|
+
value: "#f4f4f4"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
argTypes: {
|
|
40
|
+
title: {
|
|
41
|
+
description: "Título do acordeon",
|
|
42
|
+
control: "text",
|
|
43
|
+
},
|
|
44
|
+
content: {
|
|
45
|
+
description: "Conteúdo que será exibido quando o acordeon estiver aberto",
|
|
46
|
+
control: "text",
|
|
47
|
+
},
|
|
48
|
+
initiallyOpen: {
|
|
49
|
+
description: "Define se o acordeon deve iniciar aberto",
|
|
50
|
+
control: "boolean",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default meta;
|
|
56
|
+
|
|
57
|
+
// Estado Padrão
|
|
58
|
+
export const Default = {
|
|
59
|
+
args: {
|
|
60
|
+
title: "Item",
|
|
61
|
+
content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut finibus malesuada magna vitae dapibus. Etiam bibendum, tortor a mattis mattis, arcu quam imperdiet quam, at aliquam ex risus nec turpis. Suspendisse semper turpis ante, quis iaculis metus varius sed. Donec iaculis tortor nec auctor egestas.",
|
|
62
|
+
initiallyOpen: false,
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// Estado Hover
|
|
67
|
+
// export const Hover = {
|
|
68
|
+
// args: {
|
|
69
|
+
// ...Padrao.args,
|
|
70
|
+
// },
|
|
71
|
+
// parameters: {
|
|
72
|
+
// pseudo: { hover: true },
|
|
73
|
+
// },
|
|
74
|
+
// };
|
|
75
|
+
|
|
76
|
+
// Estado com Foco
|
|
77
|
+
// export const Foco = {
|
|
78
|
+
// args: {
|
|
79
|
+
// ...Padrao.args,
|
|
80
|
+
// },
|
|
81
|
+
// parameters: {
|
|
82
|
+
// pseudo: { focus: true },
|
|
83
|
+
// },
|
|
84
|
+
// };
|
|
85
|
+
|
|
86
|
+
// Estado Ativo (Aberto)
|
|
87
|
+
export const Open = {
|
|
88
|
+
args: {
|
|
89
|
+
...Default.args,
|
|
90
|
+
initiallyOpen: true,
|
|
91
|
+
},
|
|
92
|
+
};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
2
|
+
import { View, Text, TouchableOpacity, StyleSheet, Animated, LayoutAnimation, Platform, UIManager } from 'react-native';
|
|
3
|
+
import Icon from '../Icon';
|
|
4
|
+
|
|
5
|
+
if (Platform.OS === 'android' && UIManager.setLayoutAnimationEnabledExperimental) {
|
|
6
|
+
UIManager.setLayoutAnimationEnabledExperimental(true);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const Accordion = ({ title, content, nested = false, initiallyOpen = false }) => {
|
|
10
|
+
const [isOpen, setIsOpen] = useState(initiallyOpen);
|
|
11
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
12
|
+
const animation = useRef(new Animated.Value(initiallyOpen ? 1 : 0)).current;
|
|
13
|
+
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
Animated.timing(animation, {
|
|
16
|
+
toValue: isOpen ? 1 : 0,
|
|
17
|
+
duration: 300,
|
|
18
|
+
useNativeDriver: false,
|
|
19
|
+
}).start();
|
|
20
|
+
}, [isOpen]);
|
|
21
|
+
|
|
22
|
+
const toggleAccordion = () => {
|
|
23
|
+
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
|
24
|
+
setIsOpen(prev => !prev);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const contentHeight = animation.interpolate({
|
|
28
|
+
inputRange: [0, 1],
|
|
29
|
+
outputRange: [0, 500],
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const contentOpacity = animation.interpolate({
|
|
33
|
+
inputRange: [0, 1],
|
|
34
|
+
outputRange: [0, 1],
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const iconRotation = animation.interpolate({
|
|
38
|
+
inputRange: [0, 1],
|
|
39
|
+
outputRange: ['0deg', '180deg'],
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<View style={[
|
|
44
|
+
styles.container,
|
|
45
|
+
nested && styles.containerNested,
|
|
46
|
+
]}>
|
|
47
|
+
<TouchableOpacity
|
|
48
|
+
activeOpacity={0.8}
|
|
49
|
+
style={[
|
|
50
|
+
styles.header,
|
|
51
|
+
isFocused && !isOpen && styles.headerFocused,
|
|
52
|
+
isOpen && !nested && styles.headerActive,
|
|
53
|
+
]}
|
|
54
|
+
onPress={toggleAccordion}
|
|
55
|
+
onPressIn={() => setIsFocused(true)}
|
|
56
|
+
onPressOut={() => setIsFocused(false)}
|
|
57
|
+
>
|
|
58
|
+
<Text style={[styles.headerText, isOpen && !nested && styles.headerTextActive]}>
|
|
59
|
+
{title}
|
|
60
|
+
</Text>
|
|
61
|
+
<Animated.View style={{ transform: [{ rotate: iconRotation }] }}>
|
|
62
|
+
<Icon
|
|
63
|
+
name="arrow-up-s-line"
|
|
64
|
+
size={20}
|
|
65
|
+
color={isOpen &&!nested? '#FFFFFF' : '#4F7CFE'}
|
|
66
|
+
/>
|
|
67
|
+
</Animated.View>
|
|
68
|
+
</TouchableOpacity>
|
|
69
|
+
|
|
70
|
+
<Animated.View style={[
|
|
71
|
+
styles.animatedContent,
|
|
72
|
+
{ maxHeight: contentHeight, opacity: contentOpacity }
|
|
73
|
+
]}>
|
|
74
|
+
<View style={[
|
|
75
|
+
styles.content,
|
|
76
|
+
!nested && {
|
|
77
|
+
borderTopColor: '#96ACFF',
|
|
78
|
+
borderTopWidth: 2,
|
|
79
|
+
},
|
|
80
|
+
]}>
|
|
81
|
+
{content}
|
|
82
|
+
{/* <Text style={styles.contentText}>{content}</Text> */}
|
|
83
|
+
</View>
|
|
84
|
+
</Animated.View>
|
|
85
|
+
</View>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const styles = StyleSheet.create({
|
|
90
|
+
container: {
|
|
91
|
+
borderRadius: 8,
|
|
92
|
+
overflow: 'hidden',
|
|
93
|
+
marginVertical: 8,
|
|
94
|
+
borderWidth: 2,
|
|
95
|
+
borderColor: '#96ACFF',
|
|
96
|
+
backgroundColor: '#FFF'
|
|
97
|
+
},
|
|
98
|
+
containerNested: {
|
|
99
|
+
borderColor: '#E2E9FC',
|
|
100
|
+
borderWidth: 1,
|
|
101
|
+
},
|
|
102
|
+
header: {
|
|
103
|
+
borderRadius: 8,
|
|
104
|
+
borderTop: 8,
|
|
105
|
+
flexDirection: 'row',
|
|
106
|
+
justifyContent: 'space-between',
|
|
107
|
+
alignItems: 'center',
|
|
108
|
+
padding: 16,
|
|
109
|
+
borderWidth: 2,
|
|
110
|
+
borderColor: 'transparent',
|
|
111
|
+
margin: -1,
|
|
112
|
+
},
|
|
113
|
+
headerFocused: {
|
|
114
|
+
borderColor: '#4F7CFE',
|
|
115
|
+
},
|
|
116
|
+
headerActive: {
|
|
117
|
+
borderBottomStartRadius: 0,
|
|
118
|
+
borderBottomEndRadius: 0,
|
|
119
|
+
backgroundColor: '#4F7CFE',
|
|
120
|
+
borderColor: '#4F7CFE',
|
|
121
|
+
},
|
|
122
|
+
headerText: {
|
|
123
|
+
fontSize: 16,
|
|
124
|
+
fontWeight: '500',
|
|
125
|
+
color: '#1B244B',
|
|
126
|
+
},
|
|
127
|
+
headerTextActive: {
|
|
128
|
+
color: '#FFFFFF',
|
|
129
|
+
},
|
|
130
|
+
animatedContent: {
|
|
131
|
+
overflow: 'hidden',
|
|
132
|
+
},
|
|
133
|
+
content: {
|
|
134
|
+
backgroundColor: '#FFFFFF',
|
|
135
|
+
padding: 16,
|
|
136
|
+
width: '100%',
|
|
137
|
+
},
|
|
138
|
+
contentText: {
|
|
139
|
+
fontSize: 14,
|
|
140
|
+
lineHeight: 20,
|
|
141
|
+
color: '#1B244B',
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
export default Accordion;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import AccordionAvatar from './index';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Molecule/AccordionAvatar',
|
|
6
|
+
component: AccordionAvatar,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const Default = {
|
|
10
|
+
render: () => (
|
|
11
|
+
<AccordionAvatar
|
|
12
|
+
label="Label"
|
|
13
|
+
items={[
|
|
14
|
+
'Label',
|
|
15
|
+
'Label',
|
|
16
|
+
'Label',
|
|
17
|
+
'Label',
|
|
18
|
+
'Label',
|
|
19
|
+
'Label',
|
|
20
|
+
'Label',
|
|
21
|
+
'Label',
|
|
22
|
+
'Label',
|
|
23
|
+
'Label',
|
|
24
|
+
]}
|
|
25
|
+
/>
|
|
26
|
+
),
|
|
27
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { View, Text, TouchableOpacity } from 'react-native';
|
|
3
|
+
import Icon from '../Icon';
|
|
4
|
+
|
|
5
|
+
const AccordionAvatar = ({
|
|
6
|
+
avatarIcon = 'user-3-fill',
|
|
7
|
+
label = 'Label',
|
|
8
|
+
items = [],
|
|
9
|
+
}) => {
|
|
10
|
+
const [open, setOpen] = useState(false);
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<View style={{ width: 362 }}>
|
|
14
|
+
{/* Header */}
|
|
15
|
+
<TouchableOpacity
|
|
16
|
+
style={{
|
|
17
|
+
flexDirection: 'row',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
height: 88,
|
|
20
|
+
backgroundColor: '#fff',
|
|
21
|
+
borderRadius: 8,
|
|
22
|
+
paddingHorizontal: 16,
|
|
23
|
+
}}
|
|
24
|
+
onPress={() => setOpen(!open)}
|
|
25
|
+
activeOpacity={0.8}
|
|
26
|
+
>
|
|
27
|
+
{/* Avatar */}
|
|
28
|
+
<View style={{
|
|
29
|
+
width: 32,
|
|
30
|
+
height: 32,
|
|
31
|
+
borderRadius: 16,
|
|
32
|
+
backgroundColor: '#485274',
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
justifyContent: 'center',
|
|
35
|
+
marginRight: 12,
|
|
36
|
+
}}>
|
|
37
|
+
<Icon name={avatarIcon} size={20} color="#fff" />
|
|
38
|
+
</View>
|
|
39
|
+
{/* Label */}
|
|
40
|
+
<Text style={{
|
|
41
|
+
fontFamily: 'Nunito Sans',
|
|
42
|
+
fontWeight: '700',
|
|
43
|
+
fontSize: 24, // h5
|
|
44
|
+
lineHeight: 32, // h5
|
|
45
|
+
color: '#1B244B',
|
|
46
|
+
flex: 1,
|
|
47
|
+
}}>{label}</Text>
|
|
48
|
+
{/* Seta */}
|
|
49
|
+
<Icon
|
|
50
|
+
name="arrow-right-line"
|
|
51
|
+
size={11}
|
|
52
|
+
color="#1B244B"
|
|
53
|
+
style={{ marginLeft: 8 }}
|
|
54
|
+
/>
|
|
55
|
+
</TouchableOpacity>
|
|
56
|
+
{/* Lista */}
|
|
57
|
+
{open && (
|
|
58
|
+
<View style={{ backgroundColor: '#fff', borderRadius: 8, marginTop: 4 }}>
|
|
59
|
+
{items.map((item, idx) => (
|
|
60
|
+
<View
|
|
61
|
+
key={idx}
|
|
62
|
+
style={{
|
|
63
|
+
flexDirection: 'row',
|
|
64
|
+
alignItems: 'center',
|
|
65
|
+
height: 40,
|
|
66
|
+
width: 362,
|
|
67
|
+
paddingHorizontal: 16,
|
|
68
|
+
}}
|
|
69
|
+
>
|
|
70
|
+
<Text style={{
|
|
71
|
+
fontFamily: 'Nunito Sans',
|
|
72
|
+
fontWeight: '700',
|
|
73
|
+
fontSize: 16, // body-2
|
|
74
|
+
lineHeight: 24, // body-2
|
|
75
|
+
color: '#687499',
|
|
76
|
+
flex: 1,
|
|
77
|
+
textAlign: 'center',
|
|
78
|
+
}}>{item}</Text>
|
|
79
|
+
<Icon
|
|
80
|
+
name="arrow-right-line"
|
|
81
|
+
size={11}
|
|
82
|
+
color="#687499"
|
|
83
|
+
style={{ marginLeft: 8 }}
|
|
84
|
+
/>
|
|
85
|
+
</View>
|
|
86
|
+
))}
|
|
87
|
+
</View>
|
|
88
|
+
)}
|
|
89
|
+
</View>
|
|
90
|
+
);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export default AccordionAvatar;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ScrollView, View } from 'react-native';
|
|
3
|
+
import AdBanner from '.';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Molecules/AdBanner',
|
|
7
|
+
component: AdBanner,
|
|
8
|
+
render: props => (
|
|
9
|
+
<ScrollView>
|
|
10
|
+
<AdBanner {...props} />
|
|
11
|
+
</ScrollView>
|
|
12
|
+
),
|
|
13
|
+
tags: ['autodocs'],
|
|
14
|
+
parameters: {
|
|
15
|
+
layout: 'fullscreen',
|
|
16
|
+
backgrounds: {
|
|
17
|
+
default: 'light',
|
|
18
|
+
values: [
|
|
19
|
+
{ name: 'light', value: '#f4f4f4' }
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
argTypes: {
|
|
24
|
+
imageSource: {
|
|
25
|
+
description: 'Fonte da imagem (objeto com propriedade uri)',
|
|
26
|
+
control: 'object',
|
|
27
|
+
},
|
|
28
|
+
title: {
|
|
29
|
+
description: 'Título principal do banner',
|
|
30
|
+
control: 'text',
|
|
31
|
+
},
|
|
32
|
+
description: {
|
|
33
|
+
description: 'Texto descritivo do evento',
|
|
34
|
+
control: 'text',
|
|
35
|
+
},
|
|
36
|
+
highlight: {
|
|
37
|
+
description: 'Trecho do texto a ser destacado em negrito',
|
|
38
|
+
control: 'text',
|
|
39
|
+
},
|
|
40
|
+
buttonLabel: {
|
|
41
|
+
description: 'Texto do botão',
|
|
42
|
+
control: 'text',
|
|
43
|
+
},
|
|
44
|
+
onButtonPress: {
|
|
45
|
+
description: 'Função chamada ao pressionar o botão',
|
|
46
|
+
action: 'onButtonPress',
|
|
47
|
+
},
|
|
48
|
+
style: {
|
|
49
|
+
description: 'Estilos adicionais para o card',
|
|
50
|
+
control: 'object',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const Default = {
|
|
56
|
+
args: {
|
|
57
|
+
imageSource: { uri: 'https://images.unsplash.com/photo-1519125323398-675f0ddb6308?auto=format&fit=crop&w=600&q=80' },
|
|
58
|
+
title: 'Semana do MEI',
|
|
59
|
+
description: 'Evento 100% gratuito! De 20 a 24 de Maio de forma online e presencial!',
|
|
60
|
+
highlight: 'De 20 a 24 de Maio',
|
|
61
|
+
buttonLabel: 'Inscreva-se',
|
|
62
|
+
},
|
|
63
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, Text, StyleSheet } from 'react-native';
|
|
3
|
+
import Image from '../Image';
|
|
4
|
+
import Button from '../Button';
|
|
5
|
+
|
|
6
|
+
const AdBanner = ({
|
|
7
|
+
imageSource,
|
|
8
|
+
title,
|
|
9
|
+
description,
|
|
10
|
+
highlight,
|
|
11
|
+
buttonLabel,
|
|
12
|
+
onButtonPress,
|
|
13
|
+
style
|
|
14
|
+
}) => {
|
|
15
|
+
return (
|
|
16
|
+
<View>
|
|
17
|
+
<Text style={styles.featuredText}>CONTINUA DEPOIS DA PUBLICIDADE</Text>
|
|
18
|
+
<View style={[styles.card, style]}>
|
|
19
|
+
<Image
|
|
20
|
+
source={imageSource}
|
|
21
|
+
ratio="16-9"
|
|
22
|
+
borderRadius={5}
|
|
23
|
+
style={styles.image}
|
|
24
|
+
/>
|
|
25
|
+
<Text style={styles.title}>{title}</Text>
|
|
26
|
+
<Text style={styles.description}>
|
|
27
|
+
{description.split(highlight)[0]}
|
|
28
|
+
<Text style={styles.highlight}>{highlight}</Text>
|
|
29
|
+
{description.split(highlight)[1]}
|
|
30
|
+
</Text>
|
|
31
|
+
<Button
|
|
32
|
+
label={buttonLabel}
|
|
33
|
+
onPress={onButtonPress}
|
|
34
|
+
size="large"
|
|
35
|
+
variant="filled"
|
|
36
|
+
inverseStyle={true}
|
|
37
|
+
style={styles.button}
|
|
38
|
+
/>
|
|
39
|
+
</View>
|
|
40
|
+
</View>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const styles = StyleSheet.create({
|
|
45
|
+
featuredText: {
|
|
46
|
+
color: '#687499',
|
|
47
|
+
fontSize: 16,
|
|
48
|
+
fontWeight: 'thin',
|
|
49
|
+
marginBottom: 16,
|
|
50
|
+
textAlign: 'center',
|
|
51
|
+
},
|
|
52
|
+
card: {
|
|
53
|
+
backgroundColor: '#3F67FC',
|
|
54
|
+
borderRadius: 10,
|
|
55
|
+
padding: 16,
|
|
56
|
+
alignItems: 'flex-start',
|
|
57
|
+
},
|
|
58
|
+
image: {
|
|
59
|
+
borderWidth: 0,
|
|
60
|
+
width: '95%',
|
|
61
|
+
},
|
|
62
|
+
title: {
|
|
63
|
+
color: '#fff',
|
|
64
|
+
fontSize: 28,
|
|
65
|
+
fontWeight: 'bold',
|
|
66
|
+
marginBottom: 16,
|
|
67
|
+
textAlign: 'left',
|
|
68
|
+
width: '100%',
|
|
69
|
+
},
|
|
70
|
+
description: {
|
|
71
|
+
color: '#fff',
|
|
72
|
+
fontSize: 20,
|
|
73
|
+
marginBottom: 32,
|
|
74
|
+
textAlign: 'left',
|
|
75
|
+
width: '100%',
|
|
76
|
+
},
|
|
77
|
+
highlight: {
|
|
78
|
+
fontWeight: 'bold',
|
|
79
|
+
color: '#fff',
|
|
80
|
+
},
|
|
81
|
+
button: {
|
|
82
|
+
backgroundColor: '#E7F79E',
|
|
83
|
+
borderRadius: 18,
|
|
84
|
+
width: '100%',
|
|
85
|
+
textAlign: 'left',
|
|
86
|
+
paddingVertical: 16,
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
export default AdBanner;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { View } from "react-native";
|
|
2
|
+
import Avatar from "./index.jsx";
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Atom/Avatar",
|
|
6
|
+
component: Avatar,
|
|
7
|
+
render: (props) => (
|
|
8
|
+
<View style={{ marginHorizontal: 'auto', marginTop: 12 }}>
|
|
9
|
+
<Avatar {...props} />
|
|
10
|
+
</View>
|
|
11
|
+
),
|
|
12
|
+
tags: ["autodocs"],
|
|
13
|
+
parameters: {
|
|
14
|
+
layout: "centered",
|
|
15
|
+
backgrounds: {
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
argTypes: {
|
|
19
|
+
size: {
|
|
20
|
+
description: "Tamanho do Avatar",
|
|
21
|
+
control: "select",
|
|
22
|
+
options: ["large", "medium", "small"],
|
|
23
|
+
},
|
|
24
|
+
imageUrl: {
|
|
25
|
+
description: "URL da imagem do avatar",
|
|
26
|
+
control: "text",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default meta;
|
|
32
|
+
|
|
33
|
+
export const WithImage = {
|
|
34
|
+
args: {
|
|
35
|
+
size: "large",
|
|
36
|
+
imageUrl: "https://randomuser.me/api/portraits/men/32.jpg",
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const Medium = {
|
|
41
|
+
args: {
|
|
42
|
+
size: "medium",
|
|
43
|
+
imageUrl: "https://randomuser.me/api/portraits/women/44.jpg",
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const Small = {
|
|
48
|
+
args: {
|
|
49
|
+
size: "small",
|
|
50
|
+
imageUrl: "https://randomuser.me/api/portraits/men/65.jpg",
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const NoImage = {
|
|
55
|
+
args: {
|
|
56
|
+
size: "large",
|
|
57
|
+
imageUrl: "",
|
|
58
|
+
name: "Lucas Manerich",
|
|
59
|
+
},
|
|
60
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TouchableOpacity, Image, StyleSheet, Text, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
const Avatar = ({
|
|
5
|
+
size = 'medium',
|
|
6
|
+
onPress,
|
|
7
|
+
imageUrl,
|
|
8
|
+
name = '',
|
|
9
|
+
}) => {
|
|
10
|
+
const sizeOptions = {
|
|
11
|
+
large: {
|
|
12
|
+
container: styles.containerLarge,
|
|
13
|
+
image: { width: 64, height: 64, borderRadius: 32 },
|
|
14
|
+
initials: { width: 64, height: 64, borderRadius: 32, alignItems: 'center', justifyContent: 'center', backgroundColor: '#E3E9FF' },
|
|
15
|
+
text: { fontSize: 20, color: '#2A4FDA', fontWeight: '700' },
|
|
16
|
+
},
|
|
17
|
+
medium: {
|
|
18
|
+
container: styles.containerMedium,
|
|
19
|
+
image: { width: 40, height: 40, borderRadius: 20 },
|
|
20
|
+
initials: { width: 40, height: 40, borderRadius: 20, alignItems: 'center', justifyContent: 'center', backgroundColor: '#E3E9FF' },
|
|
21
|
+
text: { fontSize: 18, color: '#2A4FDA', fontWeight: '700' },
|
|
22
|
+
},
|
|
23
|
+
small: {
|
|
24
|
+
container: styles.containerSmall,
|
|
25
|
+
image: { width: 24, height: 24, borderRadius: 12 },
|
|
26
|
+
initials: { width: 24, height: 24, borderRadius: 12, alignItems: 'center', justifyContent: 'center', backgroundColor: '#E3E9FF' },
|
|
27
|
+
text: { fontSize: 12, color: '#2A4FDA', fontWeight: '700' },
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const getInitials = (name) => {
|
|
32
|
+
if (!name) {
|
|
33
|
+
return '';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const names = name.split(' ');
|
|
37
|
+
if (names.length === 0) {
|
|
38
|
+
return '';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const nameList = names.map(n => n.charAt(0).toUpperCase()).join('');
|
|
42
|
+
return nameList.length > 2 ? nameList.slice(0, 2) : nameList;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const getContentStyle = () => {
|
|
46
|
+
return sizeOptions[size] ? sizeOptions[size].container : sizeOptions.medium.container;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const getImageStyle = () => {
|
|
50
|
+
return sizeOptions[size] ? sizeOptions[size].image : sizeOptions.medium.image;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<TouchableOpacity onPress={onPress} style={getContentStyle()}>
|
|
55
|
+
{imageUrl ? (
|
|
56
|
+
<Image source={{ uri: imageUrl }} style={getImageStyle()} />
|
|
57
|
+
) : (
|
|
58
|
+
<View style={sizeOptions[size].initials}>
|
|
59
|
+
<Text style={sizeOptions[size].text}>
|
|
60
|
+
{getInitials(name)}
|
|
61
|
+
</Text>
|
|
62
|
+
</View>
|
|
63
|
+
)}
|
|
64
|
+
</TouchableOpacity>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const styles = StyleSheet.create({
|
|
69
|
+
containerLarge: {
|
|
70
|
+
height: 64,
|
|
71
|
+
width: 64,
|
|
72
|
+
alignItems: 'center',
|
|
73
|
+
justifyContent: 'center',
|
|
74
|
+
},
|
|
75
|
+
containerMedium: {
|
|
76
|
+
height: 40,
|
|
77
|
+
width: 40,
|
|
78
|
+
alignItems: 'center',
|
|
79
|
+
justifyContent: 'center',
|
|
80
|
+
},
|
|
81
|
+
containerSmall: {
|
|
82
|
+
height: 24,
|
|
83
|
+
width: 24,
|
|
84
|
+
alignItems: 'center',
|
|
85
|
+
justifyContent: 'center',
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
export default Avatar;
|