@granto-umbrella/umbrella-components 2.3.23 → 3.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/dist/umbrella-components.css +1 -1
- package/dist/umbrella-components.es.js +42753 -63037
- package/dist/umbrella-components.umd.js +2038 -581
- package/package.json +9 -4
- package/src/assets/_banner_contato.png +0 -0
- package/src/assets/_logoUmbrella.svg +34 -0
- package/src/assets.d.ts +19 -0
- package/src/components/atoms/DropDownMenu/DropdownMenu.styles.tsx +106 -0
- package/src/components/atoms/DropDownMenu/DropdownMenu.tsx +48 -0
- package/src/components/atoms/DropDownMenu/DropdownMenu.types.ts +15 -0
- package/src/components/atoms/DropDownMenu/index.tsx +2 -0
- package/src/components/atoms/ErrorMessage/ErrorMessage.styles.tsx +28 -0
- package/src/components/atoms/ErrorMessage/ErrorMessage.tsx +12 -0
- package/src/components/atoms/ErrorMessage/ErrorMessage.types.ts +6 -0
- package/src/components/atoms/ErrorMessage/index.tsx +1 -0
- package/src/components/atoms/Footer/Footer.styles.tsx +22 -0
- package/src/components/atoms/Footer/Footer.tsx +9 -0
- package/src/components/atoms/Footer/Footer.types.tsx +5 -0
- package/src/components/atoms/Footer/index.tsx +1 -0
- package/src/components/atoms/GenericContainer/GenericContainer.styles.tsx +21 -0
- package/src/components/atoms/GenericContainer/GenericContainer.tsx +9 -0
- package/src/components/atoms/GenericContainer/GenericContainer.types.ts +5 -0
- package/src/components/atoms/GenericContainer/index.tsx +1 -0
- package/src/components/atoms/Loading/Loading.styles.tsx +23 -0
- package/src/components/atoms/Loading/Loading.tsx +8 -0
- package/src/components/atoms/Loading/index.tsx +1 -0
- package/src/components/atoms/LogoContainer/LogoContainer.Types.tsx +5 -0
- package/src/components/atoms/LogoContainer/LogoContainer.styles.tsx +11 -0
- package/src/components/atoms/LogoContainer/LogoContainer.tsx +11 -0
- package/src/components/atoms/LogoContainer/index.tsx +1 -0
- package/src/components/atoms/ModalAviso/ModalAviso.styles.tsx +54 -0
- package/src/components/atoms/ModalAviso/ModalAviso.tsx +37 -0
- package/src/components/atoms/ModalAviso/ModalAviso.types.ts +5 -0
- package/src/components/atoms/ModalAviso/index.tsx +1 -0
- package/src/components/atoms/MultiSelect/MultiSelect.styles.tsx +92 -0
- package/src/components/atoms/MultiSelect/MultiSelect.tsx +346 -0
- package/src/components/atoms/MultiSelect/MultiSelect.types.ts +38 -0
- package/src/components/atoms/MultiSelect/index.tsx +1 -0
- package/src/components/atoms/ResendLink/ResendLink.styles.tsx +20 -0
- package/src/components/atoms/ResendLink/ResendLink.tsx +16 -0
- package/src/components/atoms/ResendLink/ResendLink.types.ts +9 -0
- package/src/components/atoms/ResendLink/index.tsx +1 -0
- package/src/components/atoms/Subtitle/Subtitle.styles.tsx +21 -0
- package/src/components/atoms/Subtitle/Subtitle.tsx +7 -0
- package/src/components/atoms/Subtitle/Subtitle.types.ts +5 -0
- package/src/components/atoms/Subtitle/index.tsx +1 -0
- package/src/components/atoms/Tapbar/Tapbar.styles.tsx +57 -0
- package/src/components/atoms/Tapbar/Tapbar.tsx +24 -0
- package/src/components/atoms/Tapbar/Tapbar.types.ts +11 -0
- package/src/components/atoms/Tapbar/index.tsx +2 -0
- package/src/components/atoms/Text/Text.styles.tsx +8 -5
- package/src/components/atoms/Text/Text.tsx +1 -0
- package/src/components/atoms/Title/Title.styles.tsx +17 -0
- package/src/components/atoms/Title/Title.tsx +7 -0
- package/src/components/atoms/Title/Title.types.ts +5 -0
- package/src/components/atoms/Title/index.tsx +1 -0
- package/src/components/molecules/BannerAjuda/BannerAjuda.styles.tsx +9 -0
- package/src/components/molecules/BannerAjuda/BannerAjuda.tsx +19 -0
- package/src/components/molecules/BannerAjuda/BannerAjuda.types.ts +5 -0
- package/src/components/molecules/BannerAjuda/index.tsx +1 -0
- package/src/components/molecules/CodeInputContainer/CodeInputContainer.styles.tsx +7 -0
- package/src/components/molecules/CodeInputContainer/CodeInputContainer.tsx +32 -0
- package/src/components/molecules/CodeInputContainer/CodeInputContainer.types.ts +13 -0
- package/src/components/molecules/CodeInputContainer/index.tsx +3 -0
- package/src/components/molecules/ExcludeModal/ExcludeModal.styles.tsx +118 -0
- package/src/components/molecules/ExcludeModal/ExcludeModal.tsx +48 -0
- package/src/components/molecules/ExcludeModal/ExcludeModal.types.ts +10 -0
- package/src/components/molecules/ExcludeModal/index.tsx +1 -0
- package/src/components/molecules/HighlightsCard/HighlightsCard.styles.tsx +68 -0
- package/src/components/molecules/HighlightsCard/HighlightsCard.tsx +26 -0
- package/src/components/molecules/HighlightsCard/HighlightsCard.types.ts +10 -0
- package/src/components/molecules/HighlightsCard/index.tsx +1 -0
- package/src/components/molecules/InsuranceCard/InsuranceCard.styles.tsx +174 -0
- package/src/components/molecules/InsuranceCard/InsuranceCard.tsx +418 -0
- package/src/components/molecules/InsuranceCard/InsuranceCard.types.ts +32 -0
- package/src/components/molecules/InsuranceCard/index.tsx +1 -0
- package/src/components/molecules/PieChartComponent/PieChartComponent.styles.tsx +8 -0
- package/src/components/molecules/PieChartComponent/PieChartComponent.tsx +73 -0
- package/src/components/molecules/PieChartComponent/PieChartComponent.types.ts +11 -0
- package/src/components/molecules/PieChartComponent/index.tsx +1 -0
- package/src/components/molecules/RadioGroupField/RadioGroupField.styles.tsx +64 -0
- package/src/components/molecules/RadioGroupField/RadioGroupField.tsx +69 -0
- package/src/components/molecules/RadioGroupField/RadioGroupField.types.ts +17 -0
- package/src/components/molecules/RadioGroupField/index.tsx +1 -0
- package/src/components/molecules/RefuseModal/RefuseModal.styles.tsx +139 -0
- package/src/components/molecules/RefuseModal/RefuseModal.tsx +76 -0
- package/src/components/molecules/RefuseModal/RefuseModal.types.ts +15 -0
- package/src/components/molecules/RefuseModal/index.tsx +2 -0
- package/src/components/molecules/ResultsChart/ResultsChart.styles.tsx +22 -0
- package/src/components/molecules/ResultsChart/ResultsChart.tsx +19 -0
- package/src/components/molecules/ResultsChart/ResultsChart.types.ts +3 -0
- package/src/components/molecules/ResultsChart/index.tsx +2 -0
- package/src/components/molecules/TimeLine/TimeLine.styles.ts +118 -0
- package/src/components/molecules/TimeLine/TimeLine.tsx +38 -0
- package/src/components/molecules/TimeLine/TimeLine.types.ts +35 -0
- package/src/components/organisms/DonutEmissionsChart/DonutEmissionsChart.styles.tsx +113 -0
- package/src/components/organisms/DonutEmissionsChart/DonutEmissionsChart.tsx +71 -0
- package/src/components/organisms/DonutEmissionsChart/DonutEmissionsChart.types.ts +9 -0
- package/src/components/organisms/DonutEmissionsChart/index.tsx +2 -0
- package/src/components/organisms/ListagemUltimasEmissoes/ListagemUltimasEmissoes.styles.tsx +114 -0
- package/src/components/organisms/ListagemUltimasEmissoes/ListagemUltimasEmissoes.tsx +89 -0
- package/src/components/organisms/ListagemUltimasEmissoes/ListagemUltimasEmissoes.types.ts +16 -0
- package/src/components/organisms/ListagemUltimasEmissoes/index.tsx +1 -0
- package/src/components/organisms/TimelineModal/TimelineModal.styles.ts +49 -0
- package/src/components/organisms/TimelineModal/TimelineModal.tsx +37 -0
- package/src/global.d.ts +6 -0
- package/src/index.ts +68 -37
- package/src/lib/helpers.ts +17 -0
- package/src/styles/tokens/sizes.ts +12 -1
- package/src/styles/tokens/typography.ts +1 -1
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
semanticColors,
|
|
3
|
+
typographyTokens
|
|
4
|
+
} from '../../../styles/tokens';
|
|
5
|
+
import styled from 'styled-components';
|
|
3
6
|
|
|
4
7
|
export const StyledText = styled.p<{
|
|
5
8
|
$size: string;
|
|
@@ -9,12 +12,12 @@ export const StyledText = styled.p<{
|
|
|
9
12
|
display: flex;
|
|
10
13
|
width: 100%;
|
|
11
14
|
font-size: ${({ $size }) =>
|
|
12
|
-
$size ===
|
|
15
|
+
$size === 'lg'
|
|
13
16
|
? typographyTokens.fontSizes.bodyL
|
|
14
|
-
: $size ===
|
|
17
|
+
: $size === 'md'
|
|
15
18
|
? typographyTokens.fontSizes.bodyM
|
|
16
19
|
: typographyTokens.fontSizes.bodyS};
|
|
17
20
|
|
|
18
|
-
font-weight: ${({ $weight }) => ($weight ===
|
|
21
|
+
font-weight: ${({ $weight }) => ($weight === 'bold' ? 'bold' : 'normal')};
|
|
19
22
|
color: ${({ $color }) => $color || semanticColors.base.text};
|
|
20
23
|
`;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import styled from "styled-components"
|
|
2
|
+
import { typographyTokens, semanticColors } from "../../../styles/tokens"
|
|
3
|
+
|
|
4
|
+
export const Container = styled.div`
|
|
5
|
+
width: 505px;
|
|
6
|
+
font-size: ${typographyTokens.fontSizes.displayM};
|
|
7
|
+
color: ${semanticColors.base.text};
|
|
8
|
+
font-weight: 600;
|
|
9
|
+
line-height: 120%;
|
|
10
|
+
letter-spacing: -0.64px;
|
|
11
|
+
text-align: center;
|
|
12
|
+
|
|
13
|
+
/* Media Query (padrão) */
|
|
14
|
+
@media (max-width: 768px) {
|
|
15
|
+
font-size: ${typographyTokens.fontSizes.displayL};
|
|
16
|
+
}
|
|
17
|
+
`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Title } from "./Title"
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { semanticRadius, semanticColors } from "../../../styles/tokens";
|
|
3
|
+
|
|
4
|
+
export const BannerWrapper = styled.div`
|
|
5
|
+
border-radius: ${semanticRadius.global.radius.md2};
|
|
6
|
+
text-align: center;
|
|
7
|
+
color: ${semanticColors.base.background};
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
`;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BannerWrapper } from "./BannerAjuda.styles";
|
|
3
|
+
import { BannerAjudaProps } from "./BannerAjuda.types";
|
|
4
|
+
import banner_contato from "../../../assets/_banner_contato.png";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
const BannerAjuda: React.FC<BannerAjudaProps> = ({
|
|
8
|
+
onClick,
|
|
9
|
+
imageSrc = banner_contato,
|
|
10
|
+
alt = "Banner de ajuda e contato"
|
|
11
|
+
}) => {
|
|
12
|
+
return (
|
|
13
|
+
<BannerWrapper onClick={onClick}>
|
|
14
|
+
<img src={imageSrc} alt={alt} />
|
|
15
|
+
</BannerWrapper>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { BannerAjuda };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BannerAjuda } from "./BannerAjuda";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyledCodeInputContainer } from './CodeInputContainer.styles';
|
|
3
|
+
import { CodeInputContainerProps } from './CodeInputContainer.types';
|
|
4
|
+
import CodeInput from '../../atoms/CodeInput';
|
|
5
|
+
|
|
6
|
+
const CodeInputContainer: React.FC<CodeInputContainerProps> = ({
|
|
7
|
+
code,
|
|
8
|
+
inputRefs,
|
|
9
|
+
handleChange,
|
|
10
|
+
handleKeyDown,
|
|
11
|
+
handlePaste,
|
|
12
|
+
testId,
|
|
13
|
+
}) => {
|
|
14
|
+
return (
|
|
15
|
+
<StyledCodeInputContainer data-testid={testId} id={testId}>
|
|
16
|
+
{code.map((value, index) => (
|
|
17
|
+
<CodeInput
|
|
18
|
+
key={index}
|
|
19
|
+
ref={(el) => (inputRefs.current[index] = el)}
|
|
20
|
+
type="text"
|
|
21
|
+
maxLength={1}
|
|
22
|
+
value={value}
|
|
23
|
+
onChange={(e) => handleChange(e.target.value, index)}
|
|
24
|
+
onKeyDown={(e) => handleKeyDown(e, index)}
|
|
25
|
+
onPaste={handlePaste}
|
|
26
|
+
/>
|
|
27
|
+
))}
|
|
28
|
+
</StyledCodeInputContainer>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { CodeInputContainer };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export interface CodeInputContainerProps {
|
|
4
|
+
code: string[];
|
|
5
|
+
inputRefs: React.MutableRefObject<(HTMLInputElement | null)[]>;
|
|
6
|
+
handleChange: (value: string, index: number) => void;
|
|
7
|
+
handleKeyDown: (
|
|
8
|
+
event: React.KeyboardEvent<HTMLInputElement>,
|
|
9
|
+
index: number
|
|
10
|
+
) => void;
|
|
11
|
+
handlePaste: (event: React.ClipboardEvent<HTMLInputElement>) => void;
|
|
12
|
+
testId?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import * as Dialog from "@radix-ui/react-dialog";
|
|
3
|
+
import { semanticRadius, semanticColors, typographyTokens, semanticSizes, semanticShadows } from "../../../styles/tokens"
|
|
4
|
+
|
|
5
|
+
export const Overlay = styled(Dialog.Overlay)`
|
|
6
|
+
position: fixed;
|
|
7
|
+
inset: 0;
|
|
8
|
+
background-color: rgba(0, 0, 0, 0.6);
|
|
9
|
+
z-index: 50;
|
|
10
|
+
`;
|
|
11
|
+
|
|
12
|
+
export const Content = styled(Dialog.Content)`
|
|
13
|
+
position: fixed;
|
|
14
|
+
top: 50%;
|
|
15
|
+
left: 50%;
|
|
16
|
+
transform: translate(-50%, -50%);
|
|
17
|
+
font-family: ${typographyTokens.fontFamily.base};
|
|
18
|
+
background: ${semanticColors.base.background};
|
|
19
|
+
border-radius: 12px;
|
|
20
|
+
padding: ${semanticSizes.global.padding["3xl"]};
|
|
21
|
+
width: 100%;
|
|
22
|
+
max-width: 520px;
|
|
23
|
+
z-index: 1000;
|
|
24
|
+
box-shadow: ${semanticShadows.shadow.lg};
|
|
25
|
+
border-top: 6px solid #c53030;
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
export const Title = styled.h2`
|
|
29
|
+
font-size: 28px;
|
|
30
|
+
font-weight: ${typographyTokens.fontWeights.semibold};
|
|
31
|
+
line-height: ${typographyTokens.lineHeights.displayM};
|
|
32
|
+
color: ${semanticColors.global.text.default.enabled};
|
|
33
|
+
margin-bottom: ${semanticSizes.global.gap.sm};
|
|
34
|
+
padding-right: ${semanticSizes.global.padding.md};
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
export const Description = styled.p`
|
|
38
|
+
font-size: 1.1rem;
|
|
39
|
+
line-height: 1.5;
|
|
40
|
+
color: ${semanticColors.global.text.onSurface.subtitle};
|
|
41
|
+
margin-bottom: ${semanticSizes.global.gap.lg};
|
|
42
|
+
|
|
43
|
+
span {
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
color: ${semanticColors.global.text.default.enabled};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
strong {
|
|
49
|
+
font-weight: ${typographyTokens.fontWeights.semibold};
|
|
50
|
+
color: ${semanticColors.global.text.default.enabled};
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
|
|
54
|
+
export const Footer = styled.div`
|
|
55
|
+
display: flex;
|
|
56
|
+
justify-content: flex-end;
|
|
57
|
+
gap: ${semanticSizes.global.gap.md};
|
|
58
|
+
margin-top: ${semanticSizes.global.gap.xl};
|
|
59
|
+
`;
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
export const CancelButton = styled(Dialog.Close)`
|
|
63
|
+
background: ${semanticColors.base.background};
|
|
64
|
+
border: 2px solid ${semanticColors.global.border.strong};
|
|
65
|
+
border-radius: ${semanticRadius.global.radius.md2};
|
|
66
|
+
padding: ${semanticSizes.global.padding.sm} ${semanticSizes.global.padding.lg};
|
|
67
|
+
font-weight: ${typographyTokens.fontWeights.semibold};
|
|
68
|
+
font-size: ${typographyTokens.fontSizes.labelM};
|
|
69
|
+
color: ${semanticColors.global.border.strong};
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
transition: all 0.2s;
|
|
72
|
+
|
|
73
|
+
&:hover {
|
|
74
|
+
background: ${semanticColors.neutral[100]};
|
|
75
|
+
}
|
|
76
|
+
`;
|
|
77
|
+
|
|
78
|
+
export const ConfirmButton = styled.button`
|
|
79
|
+
background: #c53030;
|
|
80
|
+
color: ${semanticColors.danger.text.onSurface};
|
|
81
|
+
border: none;
|
|
82
|
+
border-radius: ${semanticRadius.global.radius.md2};
|
|
83
|
+
padding: ${semanticSizes.global.padding.sm} ${semanticSizes.global.padding.lg};
|
|
84
|
+
font-weight: ${typographyTokens.fontWeights.semibold};
|
|
85
|
+
font-size: ${typographyTokens.fontSizes.labelM};
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
transition: all 0.2s;
|
|
88
|
+
|
|
89
|
+
&:hover {
|
|
90
|
+
background: #b02828;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&:active {
|
|
94
|
+
background: #952020;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&:disabled {
|
|
98
|
+
background: #e2e2e2;
|
|
99
|
+
cursor: not-allowed;
|
|
100
|
+
}
|
|
101
|
+
`;
|
|
102
|
+
|
|
103
|
+
export const CloseIcon = styled(Dialog.Close)`
|
|
104
|
+
position: absolute;
|
|
105
|
+
top: ${semanticSizes.global.padding["3xl"]};
|
|
106
|
+
right: ${semanticSizes.global.padding["3xl"]};
|
|
107
|
+
background: transparent;
|
|
108
|
+
border: none;
|
|
109
|
+
cursor: pointer;
|
|
110
|
+
|
|
111
|
+
svg {
|
|
112
|
+
color: ${semanticColors.global.text.onSurface.subtitle};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&:hover svg {
|
|
116
|
+
color: ${semanticColors.global.text.default.enabled};
|
|
117
|
+
}
|
|
118
|
+
`;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as Dialog from "@radix-ui/react-dialog";
|
|
3
|
+
import { X } from "lucide-react";
|
|
4
|
+
import {
|
|
5
|
+
Overlay,
|
|
6
|
+
Content,
|
|
7
|
+
Title,
|
|
8
|
+
Description,
|
|
9
|
+
Footer,
|
|
10
|
+
CancelButton,
|
|
11
|
+
ConfirmButton,
|
|
12
|
+
CloseIcon,
|
|
13
|
+
} from "./ExcludeModal.styles";
|
|
14
|
+
import { ExcludeModalProps } from "./ExcludeModal.types";
|
|
15
|
+
|
|
16
|
+
const ExcludeModal: React.FC<ExcludeModalProps> = ({
|
|
17
|
+
open,
|
|
18
|
+
onOpenChange,
|
|
19
|
+
onClose,
|
|
20
|
+
onConfirm,
|
|
21
|
+
isLoading = false,
|
|
22
|
+
title = "Você tem certeza que deseja excluir essa cotação?",
|
|
23
|
+
description = "Essa cotação será excluída mas ainda será mantida no nosso sistema, caso queira restaurar, precisa entrar em contato conosco.",
|
|
24
|
+
}) => {
|
|
25
|
+
return (
|
|
26
|
+
<Dialog.Root open={open} onOpenChange={onOpenChange}>
|
|
27
|
+
<Overlay />
|
|
28
|
+
<Content>
|
|
29
|
+
<CloseIcon aria-label="Fechar" onClick={onClose}>
|
|
30
|
+
<X size={28} />
|
|
31
|
+
</CloseIcon>
|
|
32
|
+
|
|
33
|
+
<Title>{title}</Title>
|
|
34
|
+
|
|
35
|
+
<Description>{description}</Description>
|
|
36
|
+
|
|
37
|
+
<Footer>
|
|
38
|
+
<CancelButton onClick={onClose}>Cancelar</CancelButton>
|
|
39
|
+
<ConfirmButton onClick={onConfirm} disabled={isLoading}>
|
|
40
|
+
{isLoading ? "Excluindo..." : "Sim, excluir"}
|
|
41
|
+
</ConfirmButton>
|
|
42
|
+
</Footer>
|
|
43
|
+
</Content>
|
|
44
|
+
</Dialog.Root>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export { ExcludeModal };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ExcludeModal } from "./ExcludeModal";
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import {
|
|
3
|
+
primitiveColors,
|
|
4
|
+
semanticColors,
|
|
5
|
+
semanticSizes,
|
|
6
|
+
typographyTokens,
|
|
7
|
+
} from "../../../styles/tokens";
|
|
8
|
+
import { HighlightProps } from "./HighlightsCard.types";
|
|
9
|
+
|
|
10
|
+
export const CardWrapper = styled.div`
|
|
11
|
+
display: grid;
|
|
12
|
+
grid-template-columns: repeat(2, 225px);
|
|
13
|
+
gap: ${semanticSizes.global.gap["lg"]};
|
|
14
|
+
|
|
15
|
+
width: 100%;
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
const backgroundColors: Record<HighlightProps["color"], string> = {
|
|
20
|
+
red: primitiveColors.red[600], // #CB2C2D
|
|
21
|
+
orange: primitiveColors.orange[600], // #CB712C
|
|
22
|
+
blue: primitiveColors.blue[400], // #5F73E0
|
|
23
|
+
gray: primitiveColors.gray[400], // #CFCFCF
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const Card = styled.div<{ color: HighlightProps["color"] }>`
|
|
27
|
+
width: 225px;
|
|
28
|
+
background-color: ${({ color }) => backgroundColors[color]};
|
|
29
|
+
padding: ${semanticSizes.global.padding.xl};
|
|
30
|
+
border-radius: 8px;
|
|
31
|
+
position: relative;
|
|
32
|
+
min-height: 120px;
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
export const IconWrapper = styled.div`
|
|
37
|
+
position: absolute;
|
|
38
|
+
top: ${semanticSizes.global.padding.xl};
|
|
39
|
+
right: ${semanticSizes.global.padding.xl};
|
|
40
|
+
background-color: ${semanticColors.base.background};
|
|
41
|
+
border-radius: 50%;
|
|
42
|
+
width: 40px;
|
|
43
|
+
height: 40px;
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
export const CardContent = styled.div`
|
|
50
|
+
width: 100%;
|
|
51
|
+
margin-top: 60px;
|
|
52
|
+
text-align: left;
|
|
53
|
+
|
|
54
|
+
p {
|
|
55
|
+
font-size: ${typographyTokens.fontSizes.bodyXS};
|
|
56
|
+
font-weight: ${typographyTokens.fontWeights.medium};
|
|
57
|
+
margin: 0;
|
|
58
|
+
margin-bottom: ${semanticSizes.global.padding.sm};
|
|
59
|
+
color: ${semanticColors.base.background};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
h3 {
|
|
63
|
+
font-size: ${typographyTokens.fontSizes.displayXL};
|
|
64
|
+
font-weight: ${typographyTokens.fontWeights.bold};
|
|
65
|
+
margin: 0;
|
|
66
|
+
color: ${semanticColors.base.background};
|
|
67
|
+
}
|
|
68
|
+
`;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Card, CardWrapper, IconWrapper, CardContent } from "./HighlightsCard.styles";
|
|
3
|
+
import { HighlightsCardProps } from "./HighlightsCard.types";
|
|
4
|
+
import { Icon } from "@granto-umbrella/umbrella-components";
|
|
5
|
+
|
|
6
|
+
const HighlightsCard: React.FC<HighlightsCardProps> = ({ items }) => {
|
|
7
|
+
return (
|
|
8
|
+
<CardWrapper>
|
|
9
|
+
{items.map((item, index) => (
|
|
10
|
+
<Card key={index} color={item.color}>
|
|
11
|
+
{item.icon && (
|
|
12
|
+
<IconWrapper>
|
|
13
|
+
<Icon name={item.icon} size="xs" />
|
|
14
|
+
</IconWrapper>
|
|
15
|
+
)}
|
|
16
|
+
<CardContent>
|
|
17
|
+
<p>{item.label}</p>
|
|
18
|
+
<h3>{item.value}</h3>
|
|
19
|
+
</CardContent>
|
|
20
|
+
</Card>
|
|
21
|
+
))}
|
|
22
|
+
</CardWrapper>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { HighlightsCard };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HighlightsCard } from "./HighlightsCard";
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/* eslint-disable react-refresh/only-export-components */
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { StatusVariant } from "./InsuranceCard.types";
|
|
4
|
+
import {
|
|
5
|
+
semanticColors,
|
|
6
|
+
primitiveColors,
|
|
7
|
+
semanticSizes,
|
|
8
|
+
semanticRadius,
|
|
9
|
+
} from "../../../styles/tokens";
|
|
10
|
+
|
|
11
|
+
// Movendo os Records para o topo antes dos componentes
|
|
12
|
+
export const variantColors: Record<StatusVariant, string> = {
|
|
13
|
+
primary: semanticColors.info.border.feedback,
|
|
14
|
+
success: semanticColors.global.border.feedback.success,
|
|
15
|
+
warning: semanticColors.border.feedback,
|
|
16
|
+
danger: semanticColors.global.border.feedback.error,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const variantColorsText: Record<StatusVariant, string> = {
|
|
20
|
+
primary: semanticColors.global.text.onSurface.enabled,
|
|
21
|
+
success: semanticColors.global.text.feedback.success,
|
|
22
|
+
warning: semanticColors.global.text.feedback.warning,
|
|
23
|
+
danger: semanticColors.global.text.feedback.error,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const CardContainer = styled.div<{ $variant: StatusVariant }>`
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
justify-content: space-between;
|
|
30
|
+
width: 100%;
|
|
31
|
+
gap: ${semanticSizes.global.gap.sm};
|
|
32
|
+
padding: ${semanticSizes.global.padding.lg};
|
|
33
|
+
border-top: 4px solid ${(props) => variantColors[props.$variant]};
|
|
34
|
+
border-radius: ${semanticRadius.global.radius.md2};
|
|
35
|
+
background-color: ${semanticColors.global.surface.default};
|
|
36
|
+
`;
|
|
37
|
+
|
|
38
|
+
export const HeaderRow = styled.div`
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
gap: ${semanticSizes.global.gap.xl};
|
|
42
|
+
`;
|
|
43
|
+
|
|
44
|
+
export const BodyRow = styled.div`
|
|
45
|
+
display: flex;
|
|
46
|
+
gap: ${semanticSizes.global.gap.xl};
|
|
47
|
+
justify-content: space-between;
|
|
48
|
+
|
|
49
|
+
@media (max-width: 768px) {
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
gap: ${semanticSizes.global.gap.lg};
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
|
|
55
|
+
export const Text = styled.span<{ $variant?: StatusVariant }>`
|
|
56
|
+
font-size: 10px;
|
|
57
|
+
color: ${(props) =>
|
|
58
|
+
props.$variant ? variantColors[props.$variant] : variantColorsText.primary};
|
|
59
|
+
`;
|
|
60
|
+
|
|
61
|
+
export const InfoRow = styled.div`
|
|
62
|
+
display: flex;
|
|
63
|
+
width: 100%;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
justify-content: flex-start;
|
|
66
|
+
align-items: flex-start;
|
|
67
|
+
min-width: 0;
|
|
68
|
+
`;
|
|
69
|
+
|
|
70
|
+
export const InfoLabel = styled.span`
|
|
71
|
+
font-size: 12px;
|
|
72
|
+
color: ${primitiveColors.gray[600]};
|
|
73
|
+
margin-bottom: ${semanticSizes.global.gap.md};
|
|
74
|
+
`;
|
|
75
|
+
|
|
76
|
+
export const InfoValue = styled.span`
|
|
77
|
+
font-size: 14px;
|
|
78
|
+
font-weight: 900;
|
|
79
|
+
color: ${primitiveColors.gray[900]};
|
|
80
|
+
`;
|
|
81
|
+
|
|
82
|
+
export const TruncatedValue = styled(InfoValue)`
|
|
83
|
+
display: inline-block;
|
|
84
|
+
max-width: 100%;
|
|
85
|
+
overflow: hidden;
|
|
86
|
+
white-space: nowrap;
|
|
87
|
+
text-overflow: ellipsis;
|
|
88
|
+
`;
|
|
89
|
+
|
|
90
|
+
export const ProdValue = styled(InfoValue)`
|
|
91
|
+
display: inline-block;
|
|
92
|
+
max-width: 100%;
|
|
93
|
+
overflow: hidden;
|
|
94
|
+
white-space: nowrap;
|
|
95
|
+
text-overflow: ellipsis;
|
|
96
|
+
`;
|
|
97
|
+
|
|
98
|
+
export const ProcessValue = styled(InfoValue)`
|
|
99
|
+
display: inline-block;
|
|
100
|
+
max-width: 100%;
|
|
101
|
+
`;
|
|
102
|
+
|
|
103
|
+
export const InfoSubValue = styled.span`
|
|
104
|
+
font-size: 12px;
|
|
105
|
+
color: ${primitiveColors.gray[900]};
|
|
106
|
+
line-height: 1.4;
|
|
107
|
+
`;
|
|
108
|
+
|
|
109
|
+
export const Actions = styled.div`
|
|
110
|
+
display: flex;
|
|
111
|
+
justify-content: flex-end;
|
|
112
|
+
`;
|
|
113
|
+
|
|
114
|
+
export const DropdownWrapper = styled.div`
|
|
115
|
+
position: relative;
|
|
116
|
+
`;
|
|
117
|
+
|
|
118
|
+
export const ActionButton = styled.button`
|
|
119
|
+
display: inline-flex;
|
|
120
|
+
justify-content: space-between;
|
|
121
|
+
min-width: 170px;
|
|
122
|
+
max-width: 100%;
|
|
123
|
+
align-items: center;
|
|
124
|
+
gap: ${semanticSizes.global.gap.sm};
|
|
125
|
+
padding: ${semanticSizes.global.padding.sm} ${semanticSizes.global.padding.md};
|
|
126
|
+
font-size: 0.875rem;
|
|
127
|
+
font-weight: 600;
|
|
128
|
+
border: none;
|
|
129
|
+
border-radius: ${semanticRadius.global.radius.md};
|
|
130
|
+
background-color: ${semanticColors.branding.border.enabled};
|
|
131
|
+
color: ${primitiveColors.base.white};
|
|
132
|
+
cursor: pointer;
|
|
133
|
+
transition: opacity 0.2s;
|
|
134
|
+
|
|
135
|
+
@media (max-width: 768px) {
|
|
136
|
+
width: 100%;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&:hover {
|
|
140
|
+
opacity: 0.9;
|
|
141
|
+
}
|
|
142
|
+
`;
|
|
143
|
+
|
|
144
|
+
export const DropdownMenu = styled.div`
|
|
145
|
+
position: absolute;
|
|
146
|
+
right: 0;
|
|
147
|
+
background-color: ${semanticColors.global.surface.default};
|
|
148
|
+
border-radius: ${semanticRadius.global.radius.md};
|
|
149
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
|
150
|
+
display: grid;
|
|
151
|
+
gap: ${semanticSizes.global.gap.xs};
|
|
152
|
+
padding: ${semanticSizes.global.padding.sm} 0;
|
|
153
|
+
width: 100%;
|
|
154
|
+
z-index: 10;
|
|
155
|
+
`;
|
|
156
|
+
|
|
157
|
+
export const StyledMenuItem = styled.div<{ $danger?: boolean }>`
|
|
158
|
+
color: ${(props) =>
|
|
159
|
+
props.$danger
|
|
160
|
+
? semanticColors.danger.text.enabled
|
|
161
|
+
: primitiveColors.gray[900]};
|
|
162
|
+
display: inline-grid;
|
|
163
|
+
grid-auto-flow: column;
|
|
164
|
+
align-items: center;
|
|
165
|
+
justify-content: flex-start;
|
|
166
|
+
gap: ${semanticSizes.global.gap.sm};
|
|
167
|
+
padding: ${semanticSizes.global.padding.sm} ${semanticSizes.global.padding.md};
|
|
168
|
+
font-size: 0.875rem;
|
|
169
|
+
cursor: pointer;
|
|
170
|
+
|
|
171
|
+
&:hover {
|
|
172
|
+
background-color: ${primitiveColors.gray[100]};
|
|
173
|
+
}
|
|
174
|
+
`;
|