vpt-sebraeds 0.0.79 → 0.0.81

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.
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { View, Text } from 'react-native';
3
3
  import TaskCard from './index';
4
4
  import Icon from '../Icon';
5
+ import SEText from '../SEText';
5
6
  import Button from '../Button';
6
7
  import { SuccessContent, TaskDescription, EditIcon, Tag, TagGroup } from './components';
7
8
  import { fontFamily } from '../utils/fontFamily';
@@ -466,3 +467,99 @@ DefineGoalWithChangeButton.args = {
466
467
  footerTextColor: '#687499',
467
468
  onFooterPress: () => console.log('Footer pressed'),
468
469
  };
470
+
471
+ // Helper para exemplificar mini-cards de evento nos stories
472
+ const MiniEventCard = ({ title: cardTitle, date, subtitle: cardSubtitle, meta, location, flatTop = false }) => (
473
+ <View style={{ flexDirection: 'row', alignItems: 'center', borderWidth: 1, borderColor: '#E2E9FC', borderRadius: 12, padding: 12, backgroundColor: '#FAFBFF', ...(flatTop && { borderTopLeftRadius: 0, borderTopRightRadius: 0 }) }}>
474
+ <View style={{ width: 64, height: 64, alignItems: 'center', justifyContent: 'center', backgroundColor: '#EEF1FF', borderRadius: 8 }}>
475
+ <Icon name="calendar-event-line" size={32} color="#4F7CFE" />
476
+ </View>
477
+ <View style={{ flex: 1, marginLeft: 12 }}>
478
+ <SEText type="ns-sm-body-bold">{cardTitle}</SEText>
479
+ {date ? (
480
+ <View style={{ flexDirection: 'row', alignItems: 'center', marginTop: 4 }}>
481
+ <Icon name="calendar-line" size={16} color="#C167E6" />
482
+ <SEText type="ns-sm-body-bold" style={{ marginLeft: 4 }}>{date}</SEText>
483
+ </View>
484
+ ) : null}
485
+ {cardSubtitle ? <SEText style={{ color: '#687499', fontSize: 12, marginTop: 4 }}>{cardSubtitle}</SEText> : null}
486
+ {meta ? <SEText style={{ color: '#687499', fontSize: 12, marginTop: 2 }}>{meta}</SEText> : null}
487
+ {location ? <SEText style={{ color: '#687499', fontSize: 12, marginTop: 4 }}>{location}</SEText> : null}
488
+ </View>
489
+ </View>
490
+ );
491
+
492
+ // Banner com imagem + children sobrepondo
493
+ export const WithBannerImage = () => (
494
+ <TaskCard
495
+ title="Está chegando a Semana do MEI"
496
+ subtitle="Alô DF! Confira a programação da Semana do MEI e faça a sua inscrição!"
497
+ titleIcon={<Icon name="sparkling-2-fill" size={24} color="#FFFFFF" />}
498
+ backgroundColorIcon="#FF80C8"
499
+ showMoreMenu
500
+ onMoreMenuPress={() => {}}
501
+ bannerImage={{
502
+ source: { uri: 'https://picsum.photos/600/300' },
503
+ height: 160,
504
+ }}
505
+ buttons={[
506
+ { label: 'Abrir programação', variant: 'filled', iconName: 'arrow-right-line', iconPosition: 'right', onPress: () => {} },
507
+ { label: 'Adicionar ao calendário', variant: 'transparent', iconName: 'calendar-line', iconPosition: 'left', onPress: () => {} },
508
+ ]}
509
+ footerText="Lembrar mais tarde"
510
+ onFooterPress={() => {}}
511
+ >
512
+ <MiniEventCard
513
+ title="Semana do MEI - DF"
514
+ date="25 a 29 de Maio"
515
+ location="Presencial e Online - Gratuito"
516
+ flatTop
517
+ />
518
+ </TaskCard>
519
+ );
520
+
521
+ // Banner em placeholder mode (sem imagem)
522
+ export const WithBannerPlaceholder = () => (
523
+ <TaskCard
524
+ title="Seu evento começou"
525
+ subtitle="Você salvou 3 agendas do Feira do Empreendedor 2026, que já está começando. Confira e prepare-se!"
526
+ titleIcon={<Icon name="sparkling-2-fill" size={24} color="#FFFFFF" />}
527
+ backgroundColorIcon="#FF80C8"
528
+ showMoreMenu
529
+ onMoreMenuPress={() => {}}
530
+ bannerImage={{ height: 160 }}
531
+ buttons={[
532
+ { label: 'Abrir minha agenda', variant: 'filled', iconName: 'arrow-right-line', iconPosition: 'right', onPress: () => {} },
533
+ ]}
534
+ footerText={null}
535
+ >
536
+ <MiniEventCard
537
+ title="Feira do Empreendedor 2026"
538
+ date="19 a 22 de Outubro"
539
+ location="São Paulo, SP"
540
+ flatTop
541
+ />
542
+ </TaskCard>
543
+ );
544
+
545
+ // Sem banner (retrocompat)
546
+ export const WithoutBanner = () => (
547
+ <TaskCard
548
+ title="Queremos saber de você"
549
+ subtitle="O que você está achando do evento? Faça a primeira publicação!"
550
+ titleIcon={<Icon name="sparkling-2-fill" size={24} color="#FFFFFF" />}
551
+ backgroundColorIcon="#FF80C8"
552
+ showMoreMenu
553
+ onMoreMenuPress={() => {}}
554
+ buttons={[
555
+ { label: 'Fazer publicação', variant: 'filled', iconName: 'arrow-right-line', iconPosition: 'right', onPress: () => {} },
556
+ ]}
557
+ footerText={null}
558
+ >
559
+ <MiniEventCard
560
+ title="Feira do Empreendedor 2026"
561
+ subtitle="Comunidade"
562
+ meta="0 Publicações · 4 Perguntas"
563
+ />
564
+ </TaskCard>
565
+ );
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { View, StyleSheet, TouchableOpacity } from 'react-native';
1
+ import React, { useState } from 'react';
2
+ import { View, Image, StyleSheet, TouchableOpacity } from 'react-native';
3
3
  import PropTypes from 'prop-types';
4
4
  import Button from '../Button';
5
5
  import Icon from '../Icon';
@@ -28,7 +28,56 @@ const TaskCard = ({
28
28
  alignContentWithTitle = true,
29
29
  style,
30
30
  testID,
31
+ bannerImage,
31
32
  }) => {
33
+ const [bannerError, setBannerError] = useState(false);
34
+
35
+ const bRadius = bannerImage ? (bannerImage.borderRadius ?? 8) : 0;
36
+ const flatBottom = bannerImage ? (bannerImage.flatBottom ?? !!children) : false;
37
+ const bannerBorderRadius = flatBottom
38
+ ? { borderTopLeftRadius: bRadius, borderTopRightRadius: bRadius, borderBottomLeftRadius: 0, borderBottomRightRadius: 0 }
39
+ : { borderRadius: bRadius };
40
+
41
+ const renderBannerPlaceholder = () => (
42
+ <View
43
+ style={[
44
+ styles.bannerBase,
45
+ {
46
+ height: bannerImage.height || 160,
47
+ backgroundColor: bannerImage.placeholderBackground || '#EEF1FF',
48
+ },
49
+ bannerBorderRadius,
50
+ bannerImage.style,
51
+ ]}
52
+ >
53
+ <Icon
54
+ name={bannerImage.placeholderIconName || 'image-line'}
55
+ size={bannerImage.placeholderIconSize || 32}
56
+ color={bannerImage.placeholderIconColor || '#96A1C1'}
57
+ />
58
+ </View>
59
+ );
60
+
61
+ const renderBanner = () => {
62
+ if (!bannerImage.source || bannerError) return renderBannerPlaceholder();
63
+
64
+ return (
65
+ <Image
66
+ source={bannerImage.source}
67
+ style={[
68
+ styles.bannerBase,
69
+ {
70
+ height: bannerImage.height || 160,
71
+ },
72
+ bannerBorderRadius,
73
+ bannerImage.style,
74
+ ]}
75
+ resizeMode={bannerImage.resizeMode || 'cover'}
76
+ onError={() => setBannerError(true)}
77
+ />
78
+ );
79
+ };
80
+
32
81
  const renderButtons = () => {
33
82
  if (!buttons || buttons.length === 0) return null;
34
83
 
@@ -142,12 +191,15 @@ const TaskCard = ({
142
191
  </View>
143
192
  )}
144
193
 
194
+ {/* Banner Image / Placeholder */}
195
+ {bannerImage && renderBanner()}
196
+
145
197
  {/* Conteúdo principal (children) */}
146
198
  {children && (
147
199
  <View style={[
148
200
  styles.contentContainer,
149
- // Aplica margem esquerda apenas se há ícone no título e alignContentWithTitle é true
150
- titleIcon && alignContentWithTitle && styles.contentAlignedWithTitle
201
+ titleIcon && alignContentWithTitle && !bannerImage && styles.contentAlignedWithTitle,
202
+ bannerImage && flatBottom && { borderTopLeftRadius: 0, borderTopRightRadius: 0, overflow: 'hidden' },
151
203
  ]}>
152
204
  {children}
153
205
  </View>
@@ -211,6 +263,18 @@ TaskCard.propTypes = {
211
263
  alignContentWithTitle: PropTypes.bool,
212
264
  style: PropTypes.object,
213
265
  testID: PropTypes.string,
266
+ bannerImage: PropTypes.shape({
267
+ source: PropTypes.any,
268
+ height: PropTypes.number,
269
+ resizeMode: PropTypes.oneOf(['cover', 'contain']),
270
+ borderRadius: PropTypes.number,
271
+ placeholderBackground: PropTypes.string,
272
+ placeholderIconName: PropTypes.string,
273
+ placeholderIconColor: PropTypes.string,
274
+ placeholderIconSize: PropTypes.number,
275
+ flatBottom: PropTypes.bool,
276
+ style: PropTypes.object,
277
+ }),
214
278
  };
215
279
 
216
280
  TaskCard.defaultProps = {
@@ -319,6 +383,12 @@ const styles = StyleSheet.create({
319
383
  footerIcon: {
320
384
  marginLeft: 4,
321
385
  },
386
+ bannerBase: {
387
+ width: '100%',
388
+ alignItems: 'center',
389
+ justifyContent: 'center',
390
+ overflow: 'hidden',
391
+ },
322
392
  });
323
393
 
324
394
  export default TaskCard;
@@ -1,5 +1,5 @@
1
1
  export default TaskCard;
2
- declare function TaskCard({ title, titleIcon, titleColor, subtitle, subtitleColor, children, middleContent, buttons, bottomContent, footerText, footerTextColor, onFooterPress, showMoreMenu, onMoreMenuPress, backgroundColor, backgroundColorIcon, borderRadius, padding, shadow, alignContentWithTitle, style, testID, }: {
2
+ declare function TaskCard({ title, titleIcon, titleColor, subtitle, subtitleColor, children, middleContent, buttons, bottomContent, footerText, footerTextColor, onFooterPress, showMoreMenu, onMoreMenuPress, backgroundColor, backgroundColorIcon, borderRadius, padding, shadow, alignContentWithTitle, style, testID, bannerImage, }: {
3
3
  title: any;
4
4
  titleIcon: any;
5
5
  titleColor?: string | undefined;
@@ -22,6 +22,7 @@ declare function TaskCard({ title, titleIcon, titleColor, subtitle, subtitleColo
22
22
  alignContentWithTitle?: boolean | undefined;
23
23
  style: any;
24
24
  testID: any;
25
+ bannerImage: any;
25
26
  }): React.JSX.Element;
26
27
  declare namespace TaskCard {
27
28
  namespace propTypes {
@@ -46,6 +47,7 @@ declare namespace TaskCard {
46
47
  let alignContentWithTitle: any;
47
48
  let style: any;
48
49
  let testID: any;
50
+ let bannerImage: any;
49
51
  }
50
52
  namespace defaultProps {
51
53
  let titleColor_1: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/TaskCard/index.jsx"],"names":[],"mappings":";AAOA;;;;;;;;;;;;;;;;;;;;;;;sBA4KC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAnLiB,OAAO"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/TaskCard/index.jsx"],"names":[],"mappings":";AAOA;;;;;;;;;;;;;;;;;;;;;;;;sBAgOC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAvO+B,OAAO"}
@@ -1,10 +1,39 @@
1
- import React from 'react';
2
- import { View, StyleSheet, TouchableOpacity } from 'react-native';
1
+ import React, { useState } from 'react';
2
+ import { View, Image, StyleSheet, TouchableOpacity } from 'react-native';
3
3
  import PropTypes from 'prop-types';
4
4
  import Button from '../Button';
5
5
  import Icon from '../Icon';
6
6
  import SEText from '../SEText';
7
- const TaskCard = ({ title, titleIcon, titleColor = '#1F1F1F', subtitle, subtitleColor = '#485274', children, middleContent, buttons = [], bottomContent, footerText = 'Lembrar mais tarde', footerTextColor = '#485274', onFooterPress, showMoreMenu = false, onMoreMenuPress, backgroundColor = '#FFFFFF', backgroundColorIcon = '#FFFFFF', borderRadius = 12, padding = 20, shadow = true, alignContentWithTitle = true, style, testID, }) => {
7
+ const TaskCard = ({ title, titleIcon, titleColor = '#1F1F1F', subtitle, subtitleColor = '#485274', children, middleContent, buttons = [], bottomContent, footerText = 'Lembrar mais tarde', footerTextColor = '#485274', onFooterPress, showMoreMenu = false, onMoreMenuPress, backgroundColor = '#FFFFFF', backgroundColorIcon = '#FFFFFF', borderRadius = 12, padding = 20, shadow = true, alignContentWithTitle = true, style, testID, bannerImage, }) => {
8
+ const [bannerError, setBannerError] = useState(false);
9
+ const bRadius = bannerImage ? (bannerImage.borderRadius ?? 8) : 0;
10
+ const flatBottom = bannerImage ? (bannerImage.flatBottom ?? !!children) : false;
11
+ const bannerBorderRadius = flatBottom
12
+ ? { borderTopLeftRadius: bRadius, borderTopRightRadius: bRadius, borderBottomLeftRadius: 0, borderBottomRightRadius: 0 }
13
+ : { borderRadius: bRadius };
14
+ const renderBannerPlaceholder = () => (<View style={[
15
+ styles.bannerBase,
16
+ {
17
+ height: bannerImage.height || 160,
18
+ backgroundColor: bannerImage.placeholderBackground || '#EEF1FF',
19
+ },
20
+ bannerBorderRadius,
21
+ bannerImage.style,
22
+ ]}>
23
+ <Icon name={bannerImage.placeholderIconName || 'image-line'} size={bannerImage.placeholderIconSize || 32} color={bannerImage.placeholderIconColor || '#96A1C1'}/>
24
+ </View>);
25
+ const renderBanner = () => {
26
+ if (!bannerImage.source || bannerError)
27
+ return renderBannerPlaceholder();
28
+ return (<Image source={bannerImage.source} style={[
29
+ styles.bannerBase,
30
+ {
31
+ height: bannerImage.height || 160,
32
+ },
33
+ bannerBorderRadius,
34
+ bannerImage.style,
35
+ ]} resizeMode={bannerImage.resizeMode || 'cover'} onError={() => setBannerError(true)}/>);
36
+ };
8
37
  const renderButtons = () => {
9
38
  if (!buttons || buttons.length === 0)
10
39
  return null;
@@ -62,11 +91,14 @@ const TaskCard = ({ title, titleIcon, titleColor = '#1F1F1F', subtitle, subtitle
62
91
  </TouchableOpacity>)}
63
92
  </View>)}
64
93
 
94
+ {/* Banner Image / Placeholder */}
95
+ {bannerImage && renderBanner()}
96
+
65
97
  {/* Conteúdo principal (children) */}
66
98
  {children && (<View style={[
67
99
  styles.contentContainer,
68
- // Aplica margem esquerda apenas se há ícone no título e alignContentWithTitle é true
69
- titleIcon && alignContentWithTitle && styles.contentAlignedWithTitle
100
+ titleIcon && alignContentWithTitle && !bannerImage && styles.contentAlignedWithTitle,
101
+ bannerImage && flatBottom && { borderTopLeftRadius: 0, borderTopRightRadius: 0, overflow: 'hidden' },
70
102
  ]}>
71
103
  {children}
72
104
  </View>)}
@@ -119,6 +151,18 @@ TaskCard.propTypes = {
119
151
  alignContentWithTitle: PropTypes.bool,
120
152
  style: PropTypes.object,
121
153
  testID: PropTypes.string,
154
+ bannerImage: PropTypes.shape({
155
+ source: PropTypes.any,
156
+ height: PropTypes.number,
157
+ resizeMode: PropTypes.oneOf(['cover', 'contain']),
158
+ borderRadius: PropTypes.number,
159
+ placeholderBackground: PropTypes.string,
160
+ placeholderIconName: PropTypes.string,
161
+ placeholderIconColor: PropTypes.string,
162
+ placeholderIconSize: PropTypes.number,
163
+ flatBottom: PropTypes.bool,
164
+ style: PropTypes.object,
165
+ }),
122
166
  };
123
167
  TaskCard.defaultProps = {
124
168
  titleColor: '#1F1F1F',
@@ -225,5 +269,11 @@ const styles = StyleSheet.create({
225
269
  footerIcon: {
226
270
  marginLeft: 4,
227
271
  },
272
+ bannerBase: {
273
+ width: '100%',
274
+ alignItems: 'center',
275
+ justifyContent: 'center',
276
+ overflow: 'hidden',
277
+ },
228
278
  });
229
279
  export default TaskCard;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vpt-sebraeds",
3
- "version": "0.0.79",
3
+ "version": "0.0.81",
4
4
  "description": "Biblioteca de componentes React Native do Sebrae",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",