react-native-exp-fig 2.0.0 → 2.0.1
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/lib/commonjs/components/notification-card/index.js +12 -7
- package/lib/commonjs/components/notification-card/index.js.map +1 -1
- package/lib/commonjs/stories/notification-card/notification-card.stories.js +200 -0
- package/lib/commonjs/stories/notification-card/notification-card.stories.js.map +1 -0
- package/lib/commonjs/stories/notification-loading/notification-loading.stories.js.map +1 -1
- package/lib/module/components/notification-card/index.js +12 -7
- package/lib/module/components/notification-card/index.js.map +1 -1
- package/lib/module/stories/notification-card/notification-card.stories.js +194 -0
- package/lib/module/stories/notification-card/notification-card.stories.js.map +1 -0
- package/lib/module/stories/notification-loading/notification-loading.stories.js.map +1 -1
- package/lib/typescript/src/components/notification-card/index.d.ts.map +1 -1
- package/lib/typescript/src/components/notification-card/interface.d.ts +2 -1
- package/lib/typescript/src/components/notification-card/interface.d.ts.map +1 -1
- package/lib/typescript/src/stories/notification-card/notification-card.stories.d.ts +14 -0
- package/lib/typescript/src/stories/notification-card/notification-card.stories.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/notification-card/index.tsx +127 -123
- package/src/components/notification-card/interface.ts +19 -18
- package/src/stories/notification-card/notification-card.stories.tsx +202 -0
- package/src/stories/notification-loading/notification-loading.stories.tsx +88 -88
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-card.stories.d.ts","sourceRoot":"","sources":["../../../../../src/stories/notification-card/notification-card.stories.tsx"],"names":[],"mappings":"AACA;;GAEG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,gBAAgB,MAAM,oCAAoC,CAAC;AAOlE,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,gBAAgB,CA2CvC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,aAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAUpB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAcxB,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,KAwCtC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAoDlC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,123 +1,127 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IMPORTS
|
|
3
|
-
*/
|
|
4
|
-
import React, { forwardRef } from "react";
|
|
5
|
-
import { TouchableOpacity, View } from "react-native";
|
|
6
|
-
|
|
7
|
-
// commons / icons
|
|
8
|
-
import { Icons } from "../../common/icons-svg";
|
|
9
|
-
|
|
10
|
-
// components
|
|
11
|
-
import { Box } from "../box";
|
|
12
|
-
import { Typography } from "../typography";
|
|
13
|
-
import { Button } from "../button";
|
|
14
|
-
|
|
15
|
-
// styles / theme
|
|
16
|
-
import { theme } from "../../styles/theme/theme";
|
|
17
|
-
|
|
18
|
-
// typings
|
|
19
|
-
import { asBaseComponent } from "../../@types/as-base-component";
|
|
20
|
-
import type { INotificationCardProps } from "./interface";
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Componente NotificationCard
|
|
24
|
-
*/
|
|
25
|
-
const NotificationCard: React.FC<INotificationCardProps> = forwardRef<View, INotificationCardProps>(
|
|
26
|
-
({ variant = "read", title, description, actionLabel, onPress, onPressAction, testID }, ref) => {
|
|
27
|
-
const isWarning = variant === "unread";
|
|
28
|
-
|
|
29
|
-
// cor da borda lateral
|
|
30
|
-
const borderColor = isWarning ? theme.colors.orange[150] : theme.colors.blue[525];
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<TouchableOpacity onPress={onPress} activeOpacity={0.7}>
|
|
34
|
-
<Box
|
|
35
|
-
ref={ref as React.RefObject<View>}
|
|
36
|
-
testID={testID ?? "notification-card"}
|
|
37
|
-
flexStyle={{ flexDirection: "row" }}
|
|
38
|
-
borderStyled={{
|
|
39
|
-
borderWidth: 1,
|
|
40
|
-
borderColor: isWarning ? theme.colors.orange[150] : theme.colors.neutral[200],
|
|
41
|
-
borderRadius: theme.borderWidths.thick_medium,
|
|
42
|
-
}}
|
|
43
|
-
marginStyle={{ marginBottom: 12 }}
|
|
44
|
-
backgroundColor={isWarning ? theme.colors.neutral[500] : theme.colors.neutral[25]}
|
|
45
|
-
>
|
|
46
|
-
{/* borda fixa lateral esquerda */}
|
|
47
|
-
<Box
|
|
48
|
-
width={8}
|
|
49
|
-
backgroundColor={borderColor}
|
|
50
|
-
borderStyled={{
|
|
51
|
-
borderTopLeftRadius: theme.borderWidths.thick_medium,
|
|
52
|
-
borderBottomLeftRadius: theme.borderWidths.thick_medium,
|
|
53
|
-
}}
|
|
54
|
-
/>
|
|
55
|
-
|
|
56
|
-
{/* Conteúdo do card */}
|
|
57
|
-
<Box flexStyle={{ flex: 1 }} paddingStyle={{ padding: theme.paddings.sm }}>
|
|
58
|
-
{/* Header */}
|
|
59
|
-
<Box
|
|
60
|
-
flexStyle={{ flexDirection: "row", alignItems: "center" }}
|
|
61
|
-
marginStyle={{ marginBottom: 6 }}
|
|
62
|
-
>
|
|
63
|
-
<Icons icon="BELL" color={borderColor} size={20} />
|
|
64
|
-
<Typography
|
|
65
|
-
text={title}
|
|
66
|
-
fontFamily={theme.fonts.inter_bold}
|
|
67
|
-
fontWeight="700"
|
|
68
|
-
size={theme.fontSizes.md}
|
|
69
|
-
color={theme.colors.black[100]}
|
|
70
|
-
marginLeft={8}
|
|
71
|
-
/>
|
|
72
|
-
</Box>
|
|
73
|
-
|
|
74
|
-
{/* Texto */}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React, { forwardRef } from "react";
|
|
5
|
+
import { TouchableOpacity, View } from "react-native";
|
|
6
|
+
|
|
7
|
+
// commons / icons
|
|
8
|
+
import { Icons } from "../../common/icons-svg";
|
|
9
|
+
|
|
10
|
+
// components
|
|
11
|
+
import { Box } from "../box";
|
|
12
|
+
import { Typography } from "../typography";
|
|
13
|
+
import { Button } from "../button";
|
|
14
|
+
|
|
15
|
+
// styles / theme
|
|
16
|
+
import { theme } from "../../styles/theme/theme";
|
|
17
|
+
|
|
18
|
+
// typings
|
|
19
|
+
import { asBaseComponent } from "../../@types/as-base-component";
|
|
20
|
+
import type { INotificationCardProps } from "./interface";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Componente NotificationCard
|
|
24
|
+
*/
|
|
25
|
+
const NotificationCard: React.FC<INotificationCardProps> = forwardRef<View, INotificationCardProps>(
|
|
26
|
+
({ variant = "read", title, description, actionLabel, onPress, onPressAction, testID }, ref) => {
|
|
27
|
+
const isWarning = variant === "unread";
|
|
28
|
+
|
|
29
|
+
// cor da borda lateral
|
|
30
|
+
const borderColor = isWarning ? theme.colors.orange[150] : theme.colors.blue[525];
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<TouchableOpacity onPress={onPress} activeOpacity={0.7}>
|
|
34
|
+
<Box
|
|
35
|
+
ref={ref as React.RefObject<View>}
|
|
36
|
+
testID={testID ?? "notification-card"}
|
|
37
|
+
flexStyle={{ flexDirection: "row" }}
|
|
38
|
+
borderStyled={{
|
|
39
|
+
borderWidth: 1,
|
|
40
|
+
borderColor: isWarning ? theme.colors.orange[150] : theme.colors.neutral[200],
|
|
41
|
+
borderRadius: theme.borderWidths.thick_medium,
|
|
42
|
+
}}
|
|
43
|
+
marginStyle={{ marginBottom: 12 }}
|
|
44
|
+
backgroundColor={isWarning ? theme.colors.neutral[500] : theme.colors.neutral[25]}
|
|
45
|
+
>
|
|
46
|
+
{/* borda fixa lateral esquerda */}
|
|
47
|
+
<Box
|
|
48
|
+
width={8}
|
|
49
|
+
backgroundColor={borderColor}
|
|
50
|
+
borderStyled={{
|
|
51
|
+
borderTopLeftRadius: theme.borderWidths.thick_medium,
|
|
52
|
+
borderBottomLeftRadius: theme.borderWidths.thick_medium,
|
|
53
|
+
}}
|
|
54
|
+
/>
|
|
55
|
+
|
|
56
|
+
{/* Conteúdo do card */}
|
|
57
|
+
<Box flexStyle={{ flex: 1 }} paddingStyle={{ padding: theme.paddings.sm }}>
|
|
58
|
+
{/* Header */}
|
|
59
|
+
<Box
|
|
60
|
+
flexStyle={{ flexDirection: "row", alignItems: "center" }}
|
|
61
|
+
marginStyle={{ marginBottom: 6 }}
|
|
62
|
+
>
|
|
63
|
+
<Icons icon="BELL" color={borderColor} size={20} />
|
|
64
|
+
<Typography
|
|
65
|
+
text={title}
|
|
66
|
+
fontFamily={theme.fonts.inter_bold}
|
|
67
|
+
fontWeight="700"
|
|
68
|
+
size={theme.fontSizes.md}
|
|
69
|
+
color={theme.colors.black[100]}
|
|
70
|
+
marginLeft={8}
|
|
71
|
+
/>
|
|
72
|
+
</Box>
|
|
73
|
+
|
|
74
|
+
{/* Texto */}
|
|
75
|
+
{typeof description === "string" ? (
|
|
76
|
+
<Typography
|
|
77
|
+
text={description}
|
|
78
|
+
numberOfLines={isWarning ? 2 : 4}
|
|
79
|
+
ellipsizeMode="tail"
|
|
80
|
+
size={theme.fontSizes.sm}
|
|
81
|
+
lineHeight={theme.lineHeight.md}
|
|
82
|
+
fontFamily={theme.fonts.inter_regular_400}
|
|
83
|
+
color={theme.colors.gray[700]}
|
|
84
|
+
marginBottom={theme.margins.xs}
|
|
85
|
+
/>
|
|
86
|
+
) : (
|
|
87
|
+
<Box marginStyle={{ marginBottom: theme.margins.xs }}>{description}</Box>
|
|
88
|
+
)}
|
|
89
|
+
|
|
90
|
+
{/* Ação opcional */}
|
|
91
|
+
{actionLabel && onPressAction && (
|
|
92
|
+
<Button
|
|
93
|
+
isLoading={false}
|
|
94
|
+
title={actionLabel}
|
|
95
|
+
onPress={onPressAction}
|
|
96
|
+
backgroundColor={theme.colors.neutral[25]}
|
|
97
|
+
borderStyled={{
|
|
98
|
+
borderWidth: 1,
|
|
99
|
+
borderColor: theme.colors.red[500],
|
|
100
|
+
borderRadius: 12,
|
|
101
|
+
}}
|
|
102
|
+
buttonTextStyle={{
|
|
103
|
+
color: theme.colors.red[500],
|
|
104
|
+
fontSize: theme.fontSizes.sm,
|
|
105
|
+
fontFamily: theme.fonts.inter_medium_500,
|
|
106
|
+
}}
|
|
107
|
+
flexStyle={{
|
|
108
|
+
flexDirection: "row",
|
|
109
|
+
alignItems: "center",
|
|
110
|
+
justifyContent: "center",
|
|
111
|
+
}}
|
|
112
|
+
style={{ alignSelf: "flex-start", paddingHorizontal: 12 }}
|
|
113
|
+
/>
|
|
114
|
+
)}
|
|
115
|
+
</Box>
|
|
116
|
+
</Box>
|
|
117
|
+
</TouchableOpacity>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
NotificationCard.displayName = "NotificationCard";
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* EXPORTS
|
|
126
|
+
*/
|
|
127
|
+
export default asBaseComponent(NotificationCard);
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IMPORTS
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import type { ReactNode } from "react";
|
|
5
|
+
|
|
6
|
+
interface INotificationCardProps {
|
|
7
|
+
variant?: "read" | "unread";
|
|
8
|
+
title: string;
|
|
9
|
+
description: string | ReactNode;
|
|
10
|
+
actionLabel?: string;
|
|
11
|
+
onPress?: () => void;
|
|
12
|
+
onPressAction?: () => void;
|
|
13
|
+
testID?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* EXPORTS
|
|
18
|
+
*/
|
|
19
|
+
export { type INotificationCardProps };
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/* eslint-disable no-undef */
|
|
2
|
+
/**
|
|
3
|
+
* IMPORTS
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { View } from "react-native";
|
|
8
|
+
|
|
9
|
+
import type { StoryObj, Meta } from "@storybook/react";
|
|
10
|
+
|
|
11
|
+
// components
|
|
12
|
+
import NotificationCard from "../../components/notification-card";
|
|
13
|
+
import { Box } from "../../components/box";
|
|
14
|
+
import { Typography } from "../../components/typography";
|
|
15
|
+
|
|
16
|
+
// styles
|
|
17
|
+
import { theme } from "../../styles/theme/theme";
|
|
18
|
+
|
|
19
|
+
const meta: Meta<typeof NotificationCard> = {
|
|
20
|
+
title: "componente/NotificationCard",
|
|
21
|
+
component: NotificationCard as React.FC,
|
|
22
|
+
args: {
|
|
23
|
+
variant: "read",
|
|
24
|
+
title: "Notificação",
|
|
25
|
+
description: "Descrição da notificação",
|
|
26
|
+
actionLabel: undefined,
|
|
27
|
+
onPress: () => {
|
|
28
|
+
console.log("Notificação clicada-1");
|
|
29
|
+
},
|
|
30
|
+
onPressAction: () => {
|
|
31
|
+
console.log("Notificação clicada-2");
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
parameters: {
|
|
35
|
+
notes: `
|
|
36
|
+
# NotificationCard
|
|
37
|
+
|
|
38
|
+
Este é um componente de Card de notificação.
|
|
39
|
+
Você usa assim:
|
|
40
|
+
\`\`\`tsx
|
|
41
|
+
<NotificationCard
|
|
42
|
+
variant="read" | "unread"
|
|
43
|
+
title="Título"
|
|
44
|
+
description="String ou ReactNode"
|
|
45
|
+
actionLabel="Label da ação"
|
|
46
|
+
onPress={() => {}}
|
|
47
|
+
onPressAction={() => {}}
|
|
48
|
+
/>
|
|
49
|
+
\`\`\`
|
|
50
|
+
|
|
51
|
+
## Props
|
|
52
|
+
|
|
53
|
+
- **variant**: Define o estilo de variante da notificação ('read' ou 'unread')
|
|
54
|
+
- **title**: Título da notificação (string obrigatória)
|
|
55
|
+
- **description**: Descrição (string ou ReactNode)
|
|
56
|
+
- **actionLabel**: Label do botão de ação (opcional)
|
|
57
|
+
- **onPress**: Função chamada ao clicar na notificação
|
|
58
|
+
- **onPressAction**: Função chamada ao clicar no botão de ação
|
|
59
|
+
- **testID**: ID para testes (opcional)
|
|
60
|
+
`,
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export default meta;
|
|
65
|
+
|
|
66
|
+
type Story = StoryObj<typeof meta>;
|
|
67
|
+
|
|
68
|
+
export const Default: Story = {
|
|
69
|
+
name: "Notificação Lida",
|
|
70
|
+
args: {
|
|
71
|
+
variant: "read",
|
|
72
|
+
title: "Formulário Enviado",
|
|
73
|
+
description: "Seu formulário foi enviado com sucesso e está em análise.",
|
|
74
|
+
onPress: () => {
|
|
75
|
+
console.log("Notificação clicada-1");
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const Unread: Story = {
|
|
81
|
+
name: "Notificação Não Lida",
|
|
82
|
+
args: {
|
|
83
|
+
variant: "unread",
|
|
84
|
+
title: "Nova Mensagem",
|
|
85
|
+
description: "Você tem uma nova mensagem aguardando sua resposta.",
|
|
86
|
+
onPress: () => {
|
|
87
|
+
console.log("Notificação clicada-2");
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const WithAction: Story = {
|
|
93
|
+
name: "Com Botão de Ação",
|
|
94
|
+
args: {
|
|
95
|
+
variant: "read",
|
|
96
|
+
title: "Documento Expirado",
|
|
97
|
+
description: "Seu documento está expirado e precisa ser renovado urgentemente.",
|
|
98
|
+
actionLabel: "Renovar Agora",
|
|
99
|
+
onPress: () => {
|
|
100
|
+
console.log("Notificação clicada-3");
|
|
101
|
+
},
|
|
102
|
+
onPressAction: () => {
|
|
103
|
+
console.log("Notificação clicada-4");
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export const WithReactNodeDescription: Story = {
|
|
109
|
+
name: "Com React Node na Descrição",
|
|
110
|
+
args: {
|
|
111
|
+
variant: "read",
|
|
112
|
+
title: "Status da Entrega",
|
|
113
|
+
description: (
|
|
114
|
+
<Box>
|
|
115
|
+
<Typography
|
|
116
|
+
text="Sua entrega está a caminho!"
|
|
117
|
+
size={theme.fontSizes.sm}
|
|
118
|
+
fontFamily={theme.fonts.inter_regular_400}
|
|
119
|
+
color={theme.colors.gray[700]}
|
|
120
|
+
marginBottom={8}
|
|
121
|
+
/>
|
|
122
|
+
<Box
|
|
123
|
+
flexStyle={{ flexDirection: "row", alignItems: "center" }}
|
|
124
|
+
marginStyle={{ marginTop: 8 }}
|
|
125
|
+
>
|
|
126
|
+
<View
|
|
127
|
+
style={{
|
|
128
|
+
width: 12,
|
|
129
|
+
height: 12,
|
|
130
|
+
borderRadius: 6,
|
|
131
|
+
backgroundColor: theme.colors.green[500],
|
|
132
|
+
marginRight: 8,
|
|
133
|
+
}}
|
|
134
|
+
/>
|
|
135
|
+
<Typography
|
|
136
|
+
text="Previsão: Hoje às 14:00"
|
|
137
|
+
size={theme.fontSizes.xs}
|
|
138
|
+
fontFamily={theme.fonts.inter_regular_400}
|
|
139
|
+
color={theme.colors.green[500]}
|
|
140
|
+
/>
|
|
141
|
+
</Box>
|
|
142
|
+
</Box>
|
|
143
|
+
),
|
|
144
|
+
onPress: () => {
|
|
145
|
+
console.log("Notificação clicada-5");
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export const WithComplexReactNode: Story = {
|
|
151
|
+
name: "Com React Node Complexo",
|
|
152
|
+
args: {
|
|
153
|
+
variant: "unread",
|
|
154
|
+
title: "Alerta de Segurança",
|
|
155
|
+
description: (
|
|
156
|
+
<Box>
|
|
157
|
+
<Typography
|
|
158
|
+
text="Uma atividade suspeita foi detectada"
|
|
159
|
+
size={theme.fontSizes.sm}
|
|
160
|
+
fontFamily={theme.fonts.inter_bold}
|
|
161
|
+
fontWeight="700"
|
|
162
|
+
color={theme.colors.red[500]}
|
|
163
|
+
marginBottom={12}
|
|
164
|
+
/>
|
|
165
|
+
<Box
|
|
166
|
+
backgroundColor={theme.colors.yellow[120]}
|
|
167
|
+
borderStyled={{ borderRadius: 8 }}
|
|
168
|
+
paddingStyle={{ padding: 8 }}
|
|
169
|
+
marginStyle={{ marginBottom: 8 }}
|
|
170
|
+
>
|
|
171
|
+
<Typography
|
|
172
|
+
text="• Login de local desconhecido"
|
|
173
|
+
size={theme.fontSizes["2xs"]}
|
|
174
|
+
fontFamily={theme.fonts.inter_regular_400}
|
|
175
|
+
color={theme.colors.gray[700]}
|
|
176
|
+
marginBottom={4}
|
|
177
|
+
/>
|
|
178
|
+
<Typography
|
|
179
|
+
text="• Alteração de dados da conta"
|
|
180
|
+
size={theme.fontSizes["2xs"]}
|
|
181
|
+
fontFamily={theme.fonts.inter_regular_400}
|
|
182
|
+
color={theme.colors.gray[700]}
|
|
183
|
+
/>
|
|
184
|
+
</Box>
|
|
185
|
+
<Typography
|
|
186
|
+
text="Revise sua conta agora para garantir sua segurança."
|
|
187
|
+
size={theme.fontSizes["2xs"]}
|
|
188
|
+
fontFamily={theme.fonts.inter_regular_400}
|
|
189
|
+
color={theme.colors.gray[600]}
|
|
190
|
+
marginTop={8}
|
|
191
|
+
/>
|
|
192
|
+
</Box>
|
|
193
|
+
),
|
|
194
|
+
actionLabel: "Revisar Conta",
|
|
195
|
+
onPress: () => {
|
|
196
|
+
console.log("Notificação clicada-6");
|
|
197
|
+
},
|
|
198
|
+
onPressAction: () => {
|
|
199
|
+
console.log("Notificação clicada-7");
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
};
|
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
import type { StoryObj, Meta } from "@storybook/react";
|
|
4
|
-
import { NotificationLoading } from "../../components/notification-loading";
|
|
5
|
-
|
|
6
|
-
const meta: Meta<typeof NotificationLoading> = {
|
|
7
|
-
title: "componente/NotificationLoading",
|
|
8
|
-
component: NotificationLoading as React.FC,
|
|
9
|
-
args: {
|
|
10
|
-
title: "Carregamento - #013200400456",
|
|
11
|
-
date: "12:30 07/05/2025",
|
|
12
|
-
handleNavigation: () => {},
|
|
13
|
-
notification: "Hoje você tem um carregamento agendamento",
|
|
14
|
-
statusNotify: "pending",
|
|
15
|
-
dataStart: "Hoje",
|
|
16
|
-
readonly: false,
|
|
17
|
-
},
|
|
18
|
-
parameters: {
|
|
19
|
-
notes: `
|
|
20
|
-
# NotificationLoading
|
|
21
|
-
|
|
22
|
-
Este é um componente de Card de notificação.
|
|
23
|
-
Você usa assim:
|
|
24
|
-
\`\`\`tsx
|
|
25
|
-
<NotificationLoading
|
|
26
|
-
title=""
|
|
27
|
-
date=""
|
|
28
|
-
handleNavigation={() => {}}
|
|
29
|
-
notification=""
|
|
30
|
-
statusNotify=""
|
|
31
|
-
dataStart: "Hoje",
|
|
32
|
-
readonly: false,
|
|
33
|
-
/>
|
|
34
|
-
\`\`\`
|
|
35
|
-
`,
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export default meta;
|
|
40
|
-
|
|
41
|
-
type Story = StoryObj<typeof meta>;
|
|
42
|
-
|
|
43
|
-
export const NotificationLoadingPending: Story = {
|
|
44
|
-
name: "Notification-pending",
|
|
45
|
-
args: {
|
|
46
|
-
title: "#013200400456",
|
|
47
|
-
date: "12:30 07/05/2025",
|
|
48
|
-
handleNavigation: () => {},
|
|
49
|
-
notification: "Hoje você tem um carregamento agendamento",
|
|
50
|
-
statusNotify: "Pendente",
|
|
51
|
-
dataStart: "Ontem",
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
export const NotificationLoadingApproved: Story = {
|
|
55
|
-
name: "Notification-Approved",
|
|
56
|
-
args: {
|
|
57
|
-
title: "#013200400456",
|
|
58
|
-
date: "12:30 07/05/2025",
|
|
59
|
-
handleNavigation: () => {},
|
|
60
|
-
notification: "Hoje você tem um carregamento agendamento",
|
|
61
|
-
statusNotify: "Aprovado",
|
|
62
|
-
dataStart: "Hoje",
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
export const NotificationLoadingRecused: Story = {
|
|
66
|
-
name: "Notification-recused",
|
|
67
|
-
args: {
|
|
68
|
-
title: "#013200400456",
|
|
69
|
-
date: "12:30 07/05/2025",
|
|
70
|
-
handleNavigation: () => {},
|
|
71
|
-
notification: "Hoje você tem um carregamento agendamento",
|
|
72
|
-
statusNotify: "Reprovado",
|
|
73
|
-
dataStart: "25 abril 2025",
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export const NotificationLoadingReadonly: Story = {
|
|
78
|
-
name: "Notification-readonly",
|
|
79
|
-
args: {
|
|
80
|
-
title: "#013200400456",
|
|
81
|
-
date: "12:30 07/05/2025",
|
|
82
|
-
handleNavigation: () => {},
|
|
83
|
-
notification: "Hoje você tem um carregamento agendamento",
|
|
84
|
-
statusNotify: "Reprovado",
|
|
85
|
-
dataStart: "25 abril 2025",
|
|
86
|
-
readonly: true,
|
|
87
|
-
},
|
|
88
|
-
};
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import type { StoryObj, Meta } from "@storybook/react";
|
|
4
|
+
import { NotificationLoading } from "../../components/notification-loading";
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof NotificationLoading> = {
|
|
7
|
+
title: "componente/NotificationLoading",
|
|
8
|
+
component: NotificationLoading as React.FC,
|
|
9
|
+
args: {
|
|
10
|
+
title: "Carregamento - #013200400456",
|
|
11
|
+
date: "12:30 07/05/2025",
|
|
12
|
+
handleNavigation: () => { },
|
|
13
|
+
notification: "Hoje você tem um carregamento agendamento",
|
|
14
|
+
statusNotify: "pending",
|
|
15
|
+
dataStart: "Hoje",
|
|
16
|
+
readonly: false,
|
|
17
|
+
},
|
|
18
|
+
parameters: {
|
|
19
|
+
notes: `
|
|
20
|
+
# NotificationLoading
|
|
21
|
+
|
|
22
|
+
Este é um componente de Card de notificação.
|
|
23
|
+
Você usa assim:
|
|
24
|
+
\`\`\`tsx
|
|
25
|
+
<NotificationLoading
|
|
26
|
+
title=""
|
|
27
|
+
date=""
|
|
28
|
+
handleNavigation={() => {}}
|
|
29
|
+
notification=""
|
|
30
|
+
statusNotify=""
|
|
31
|
+
dataStart: "Hoje",
|
|
32
|
+
readonly: false,
|
|
33
|
+
/>
|
|
34
|
+
\`\`\`
|
|
35
|
+
`,
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default meta;
|
|
40
|
+
|
|
41
|
+
type Story = StoryObj<typeof meta>;
|
|
42
|
+
|
|
43
|
+
export const NotificationLoadingPending: Story = {
|
|
44
|
+
name: "Notification-pending",
|
|
45
|
+
args: {
|
|
46
|
+
title: "#013200400456",
|
|
47
|
+
date: "12:30 07/05/2025",
|
|
48
|
+
handleNavigation: () => { },
|
|
49
|
+
notification: "Hoje você tem um carregamento agendamento",
|
|
50
|
+
statusNotify: "Pendente",
|
|
51
|
+
dataStart: "Ontem",
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
export const NotificationLoadingApproved: Story = {
|
|
55
|
+
name: "Notification-Approved",
|
|
56
|
+
args: {
|
|
57
|
+
title: "#013200400456",
|
|
58
|
+
date: "12:30 07/05/2025",
|
|
59
|
+
handleNavigation: () => { },
|
|
60
|
+
notification: "Hoje você tem um carregamento agendamento",
|
|
61
|
+
statusNotify: "Aprovado",
|
|
62
|
+
dataStart: "Hoje",
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
export const NotificationLoadingRecused: Story = {
|
|
66
|
+
name: "Notification-recused",
|
|
67
|
+
args: {
|
|
68
|
+
title: "#013200400456",
|
|
69
|
+
date: "12:30 07/05/2025",
|
|
70
|
+
handleNavigation: () => { },
|
|
71
|
+
notification: "Hoje você tem um carregamento agendamento",
|
|
72
|
+
statusNotify: "Reprovado",
|
|
73
|
+
dataStart: "25 abril 2025",
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const NotificationLoadingReadonly: Story = {
|
|
78
|
+
name: "Notification-readonly",
|
|
79
|
+
args: {
|
|
80
|
+
title: "#013200400456",
|
|
81
|
+
date: "12:30 07/05/2025",
|
|
82
|
+
handleNavigation: () => { },
|
|
83
|
+
notification: "Hoje você tem um carregamento agendamento",
|
|
84
|
+
statusNotify: "Reprovado",
|
|
85
|
+
dataStart: "25 abril 2025",
|
|
86
|
+
readonly: true,
|
|
87
|
+
},
|
|
88
|
+
};
|