@granto-umbrella/umbrella-components 3.0.34 → 3.0.37
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/README.md +165 -27
- package/dist/umbrella-components.css +1 -1
- package/dist/umbrella-components.es.js +33627 -28792
- package/dist/umbrella-components.umd.js +1169 -1908
- package/package.json +136 -106
- package/src/assets.d.ts +19 -19
- package/src/components/atoms/Badge/Badge.styles.ts +88 -86
- package/src/components/atoms/Badge/Badge.tsx +42 -44
- package/src/components/atoms/Badge/Badge.types.ts +15 -15
- package/src/components/atoms/Breadcrumb/Breadcrumb.styles.ts +43 -43
- package/src/components/atoms/Breadcrumb/Breadcrumb.tsx +46 -48
- package/src/components/atoms/Breadcrumb/Breadcrumb.types.ts +12 -12
- package/src/components/atoms/Button/Button.styles.ts +279 -280
- package/src/components/atoms/Button/Button.tsx +76 -76
- package/src/components/atoms/Button/Button.types.ts +28 -28
- package/src/components/atoms/Button/index.ts +1 -1
- package/src/components/atoms/Checkbox/Checkbox.styles.ts +72 -72
- package/src/components/atoms/Checkbox/Checkbox.tsx +36 -36
- package/src/components/atoms/Checkbox/Checkbox.types.ts +14 -14
- package/src/components/atoms/Checkbox/CheckboxGroup.tsx +30 -30
- package/src/components/atoms/Checkbox/CheckboxSelectAll.tsx +32 -32
- package/src/components/atoms/CodeInput/CodeInput.styles.tsx +38 -39
- package/src/components/atoms/CodeInput/CodeInput.tsx +13 -19
- package/src/components/atoms/CodeInput/CodeInput.types.ts +3 -3
- package/src/components/atoms/CodeInput/index.tsx +1 -1
- package/src/components/atoms/DropDownMenu/DropdownMenu.tsx +48 -48
- package/src/components/atoms/DropDownMenu/DropdownMenu.types.ts +15 -15
- package/src/components/atoms/DropDownMenu/index.tsx +5 -2
- package/src/components/atoms/ErrorMessage/ErrorMessage.styles.tsx +28 -28
- package/src/components/atoms/ErrorMessage/ErrorMessage.tsx +12 -12
- package/src/components/atoms/ErrorMessage/ErrorMessage.types.ts +6 -6
- package/src/components/atoms/ErrorMessage/index.tsx +1 -1
- package/src/components/atoms/Footer/Footer.styles.tsx +22 -22
- package/src/components/atoms/Footer/Footer.tsx +9 -9
- package/src/components/atoms/Footer/Footer.types.tsx +5 -5
- package/src/components/atoms/Footer/index.tsx +1 -1
- package/src/components/atoms/GenericContainer/GenericContainer.styles.tsx +21 -21
- package/src/components/atoms/GenericContainer/GenericContainer.tsx +9 -9
- package/src/components/atoms/GenericContainer/GenericContainer.types.ts +5 -5
- package/src/components/atoms/GenericContainer/index.tsx +1 -1
- package/src/components/atoms/Icon/Icon.styles.ts +11 -11
- package/src/components/atoms/Icon/Icon.tsx +22 -22
- package/src/components/atoms/Icon/Icon.types.ts +6 -6
- package/src/components/atoms/Icon/index.ts +1 -1
- package/src/components/atoms/Input/Input.styles.ts +106 -101
- package/src/components/atoms/Input/index.ts +1 -1
- package/src/components/atoms/Label/Label.tsx +16 -16
- package/src/components/atoms/Loading/Loading.styles.tsx +25 -25
- package/src/components/atoms/Loading/Loading.tsx +8 -8
- package/src/components/atoms/LogoContainer/LogoContainer.Types.tsx +5 -5
- package/src/components/atoms/LogoContainer/LogoContainer.styles.tsx +11 -11
- package/src/components/atoms/LogoContainer/LogoContainer.tsx +11 -11
- package/src/components/atoms/LogoContainer/index.tsx +1 -1
- package/src/components/atoms/ModalAviso/ModalAviso.styles.tsx +56 -56
- package/src/components/atoms/ModalAviso/ModalAviso.tsx +43 -37
- package/src/components/atoms/ModalAviso/ModalAviso.types.ts +5 -5
- package/src/components/atoms/ModalAviso/index.tsx +1 -1
- package/src/components/atoms/MultiSelect/MultiSelect.styles.tsx +100 -92
- package/src/components/atoms/MultiSelect/MultiSelect.tsx +346 -346
- package/src/components/atoms/MultiSelect/MultiSelect.types.ts +38 -38
- package/src/components/atoms/Pill/Pill.styles.ts +46 -46
- package/src/components/atoms/Pill/Pill.tsx +35 -36
- package/src/components/atoms/Pill/Pill.types.ts +14 -18
- package/src/components/atoms/RadioButton/RadioButton.styles.ts +44 -43
- package/src/components/atoms/RadioButton/RadioButton.tsx +31 -31
- package/src/components/atoms/ResendLink/ResendLink.styles.tsx +19 -20
- package/src/components/atoms/ResendLink/ResendLink.tsx +21 -21
- package/src/components/atoms/ResendLink/ResendLink.types.ts +8 -9
- package/src/components/atoms/ResendLink/index.tsx +1 -2
- package/src/components/atoms/Select/Select.styles.ts +153 -149
- package/src/components/atoms/Select/Select.tsx +52 -43
- package/src/components/atoms/Select/index.tsx +1 -1
- package/src/components/atoms/Subtitle/Subtitle.tsx +7 -7
- package/src/components/atoms/Subtitle/Subtitle.types.ts +5 -5
- package/src/components/atoms/Subtitle/index.tsx +1 -1
- package/src/components/atoms/Switch/Switch.tsx +25 -25
- package/src/components/atoms/TabBar/TabBar.styles.tsx +64 -57
- package/src/components/atoms/TabBar/index.tsx +2 -2
- package/src/components/atoms/Text/Text.styles.tsx +35 -35
- package/src/components/atoms/Text/Text.tsx +32 -31
- package/src/components/atoms/Text/Text.types.ts +8 -8
- package/src/components/atoms/Text/index.ts +1 -1
- package/src/components/atoms/Textarea/Textarea.styles.ts +52 -52
- package/src/components/atoms/Textarea/Textarea.tsx +31 -31
- package/src/components/atoms/Title/Title.tsx +7 -7
- package/src/components/atoms/Title/Title.types.ts +5 -5
- package/src/components/atoms/Title/index.tsx +1 -1
- package/src/components/molecules/BannerAjuda/BannerAjuda.styles.tsx +9 -9
- package/src/components/molecules/BannerAjuda/BannerAjuda.tsx +18 -19
- package/src/components/molecules/BannerAjuda/index.tsx +1 -1
- package/src/components/molecules/ButtonGroup/ButtonGroup.styles.ts +10 -10
- package/src/components/molecules/ButtonGroup/ButtonGroup.types.ts +22 -22
- package/src/components/molecules/Calendar/Calendar.styles.ts +143 -143
- package/src/components/molecules/Calendar/Calendar.tsx +31 -31
- package/src/components/molecules/CodeInputContainer/CodeInputContainer.styles.tsx +7 -7
- package/src/components/molecules/CodeInputContainer/CodeInputContainer.types.ts +13 -13
- package/src/components/molecules/CodeInputContainer/index.tsx +1 -3
- package/src/components/molecules/ExcludeModal/ExcludeModal.styles.tsx +123 -118
- package/src/components/molecules/ExcludeModal/ExcludeModal.tsx +48 -48
- package/src/components/molecules/ExcludeModal/ExcludeModal.types.ts +10 -10
- package/src/components/molecules/ExcludeModal/index.tsx +1 -1
- package/src/components/molecules/FieldSelector/FieldSelector.styles.ts +59 -0
- package/src/components/molecules/FieldSelector/FieldSelector.tsx +167 -0
- package/src/components/molecules/HighlightsCard/HighlightsCard.styles.tsx +67 -68
- package/src/components/molecules/HighlightsCard/HighlightsCard.tsx +35 -26
- package/src/components/molecules/HighlightsCard/HighlightsCard.types.ts +10 -10
- package/src/components/molecules/HighlightsCard/index.tsx +1 -1
- package/src/components/molecules/InsuranceCard/InsuranceCard.styles.tsx +237 -237
- package/src/components/molecules/InsuranceCard/index.tsx +1 -1
- package/src/components/molecules/PieChartComponent/PieChartComponent.styles.tsx +7 -8
- package/src/components/molecules/PieChartComponent/PieChartComponent.tsx +70 -73
- package/src/components/molecules/PieChartComponent/PieChartComponent.types.ts +11 -11
- package/src/components/molecules/PieChartComponent/index.tsx +1 -1
- package/src/components/molecules/Popover/Popover.styles.ts +66 -65
- package/src/components/molecules/Popover/Popover.tsx +23 -23
- package/src/components/molecules/RadioBoxGroup/RadioBoxGroup.styles.ts +11 -11
- package/src/components/molecules/RadioBoxGroup/RadioBoxGroup.tsx +43 -43
- package/src/components/molecules/RadioGroupField/RadioGroupField.styles.tsx +65 -64
- package/src/components/molecules/RadioGroupField/RadioGroupField.tsx +69 -69
- package/src/components/molecules/RadioGroupField/RadioGroupField.types.ts +17 -17
- package/src/components/molecules/RadioGroupField/index.tsx +1 -1
- package/src/components/molecules/RefuseModal/RefuseModal.styles.tsx +139 -139
- package/src/components/molecules/RefuseModal/RefuseModal.tsx +92 -76
- package/src/components/molecules/RefuseModal/RefuseModal.types.ts +15 -15
- package/src/components/molecules/RefuseModal/index.tsx +2 -2
- package/src/components/molecules/ResultsChart/ResultsChart.tsx +23 -19
- package/src/components/molecules/ResultsChart/ResultsChart.types.ts +3 -3
- package/src/components/molecules/ResultsChart/index.tsx +2 -2
- package/src/components/molecules/TabToggle/TabToggle.styles.ts +54 -54
- package/src/components/molecules/TabToggle/TabToggle.tsx +35 -35
- package/src/components/organisms/AlertDialog/AlertDialog.styles.tsx +61 -61
- package/src/components/organisms/AlertDialog/AlertDialog.tsx +70 -70
- package/src/components/organisms/Dialog/Dialog.styles.ts +107 -106
- package/src/components/organisms/Dialog/Dialog.tsx +69 -69
- package/src/components/organisms/DonutEmissionsChart/DonutEmissionsChart.styles.tsx +113 -113
- package/src/components/organisms/DonutEmissionsChart/DonutEmissionsChart.tsx +75 -71
- package/src/components/organisms/DonutEmissionsChart/DonutEmissionsChart.types.ts +9 -9
- package/src/components/organisms/DonutEmissionsChart/index.tsx +5 -2
- package/src/components/organisms/ExportExcelModal/ExportExcelModal.styles.ts +59 -0
- package/src/components/organisms/ExportExcelModal/ExportExcelModal.tsx +80 -0
- package/src/components/organisms/Form/Form.styles.ts +35 -35
- package/src/components/organisms/Form/Form.tsx +160 -160
- package/src/components/organisms/ListagemUltimasEmissoes/ListagemUltimasEmissoes.styles.tsx +115 -114
- package/src/components/organisms/ListagemUltimasEmissoes/ListagemUltimasEmissoes.tsx +89 -89
- package/src/components/organisms/ListagemUltimasEmissoes/ListagemUltimasEmissoes.types.ts +16 -16
- package/src/components/organisms/ListagemUltimasEmissoes/index.tsx +1 -1
- package/src/components/organisms/Navbar/Navbar.styles.tsx +243 -243
- package/src/global.d.ts +9 -9
- package/src/index.ts +4 -0
- package/src/lib/utils.ts +6 -6
- package/src/styles/tokens/borders.ts +17 -17
- package/src/styles/tokens/index.tsx +6 -6
- package/src/styles/tokens/radius.ts +22 -22
- package/src/styles/tokens/shadows.ts +22 -22
- package/src/styles/tokens/sizes.ts +60 -64
- package/src/types/radius.types.ts +1 -1
- package/src/types/shadows.types.ts +1 -1
- package/src/utils/renderHighlightsCard.tsx +21 -0
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
// Dialog.tsx
|
|
2
|
-
import * as React from
|
|
3
|
-
import * as DialogPrimitive from
|
|
4
|
-
import { X } from
|
|
5
|
-
import {
|
|
6
|
-
StyledDialogOverlay,
|
|
7
|
-
StyledDialogContent,
|
|
8
|
-
StyledDialogClose,
|
|
9
|
-
StyledDialogHeader,
|
|
10
|
-
StyledDialogFooter,
|
|
11
|
-
StyledDialogTitle,
|
|
12
|
-
StyledDialogDescription,
|
|
13
|
-
} from
|
|
14
|
-
|
|
15
|
-
const Dialog = DialogPrimitive.Root;
|
|
16
|
-
const DialogTrigger = DialogPrimitive.Trigger;
|
|
17
|
-
const DialogPortal = DialogPrimitive.Portal;
|
|
18
|
-
|
|
19
|
-
const DialogContent = React.forwardRef<
|
|
20
|
-
React.ElementRef<typeof DialogPrimitive.Content>,
|
|
21
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
|
|
22
|
-
>(({ children, ...props }, ref) => (
|
|
23
|
-
<DialogPortal>
|
|
24
|
-
<StyledDialogOverlay />
|
|
25
|
-
<StyledDialogContent ref={ref} {...props}>
|
|
26
|
-
{children}
|
|
27
|
-
<StyledDialogClose>
|
|
28
|
-
<X style={{ height:
|
|
29
|
-
<span className="sr-only">Close</span>
|
|
30
|
-
</StyledDialogClose>
|
|
31
|
-
</StyledDialogContent>
|
|
32
|
-
</DialogPortal>
|
|
33
|
-
));
|
|
34
|
-
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
35
|
-
|
|
36
|
-
const DialogHeader: React.FC<React.HTMLAttributes<HTMLDivElement>> = (
|
|
37
|
-
props
|
|
38
|
-
) => <StyledDialogHeader {...props} />;
|
|
39
|
-
DialogHeader.displayName =
|
|
40
|
-
|
|
41
|
-
const DialogFooter: React.FC<React.HTMLAttributes<HTMLDivElement>> = (
|
|
42
|
-
props
|
|
43
|
-
) => <StyledDialogFooter {...props} />;
|
|
44
|
-
DialogFooter.displayName =
|
|
45
|
-
|
|
46
|
-
const DialogTitle = React.forwardRef<
|
|
47
|
-
React.ElementRef<typeof DialogPrimitive.Title>,
|
|
48
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
|
|
49
|
-
>((props, ref) => <StyledDialogTitle ref={ref} {...props} />);
|
|
50
|
-
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
51
|
-
|
|
52
|
-
const DialogDescription = React.forwardRef<
|
|
53
|
-
React.ElementRef<typeof DialogPrimitive.Description>,
|
|
54
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
|
|
55
|
-
>((props, ref) => <StyledDialogDescription ref={ref} {...props} />);
|
|
56
|
-
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
57
|
-
|
|
58
|
-
export {
|
|
59
|
-
Dialog,
|
|
60
|
-
DialogTrigger,
|
|
61
|
-
DialogPortal,
|
|
62
|
-
DialogContent,
|
|
63
|
-
StyledDialogOverlay as DialogOverlay,
|
|
64
|
-
StyledDialogClose as DialogClose,
|
|
65
|
-
DialogHeader,
|
|
66
|
-
DialogFooter,
|
|
67
|
-
DialogTitle,
|
|
68
|
-
DialogDescription,
|
|
69
|
-
};
|
|
1
|
+
// Dialog.tsx
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
4
|
+
import { X } from 'lucide-react';
|
|
5
|
+
import {
|
|
6
|
+
StyledDialogOverlay,
|
|
7
|
+
StyledDialogContent,
|
|
8
|
+
StyledDialogClose,
|
|
9
|
+
StyledDialogHeader,
|
|
10
|
+
StyledDialogFooter,
|
|
11
|
+
StyledDialogTitle,
|
|
12
|
+
StyledDialogDescription,
|
|
13
|
+
} from './Dialog.styles';
|
|
14
|
+
|
|
15
|
+
const Dialog = DialogPrimitive.Root;
|
|
16
|
+
const DialogTrigger = DialogPrimitive.Trigger;
|
|
17
|
+
const DialogPortal = DialogPrimitive.Portal;
|
|
18
|
+
|
|
19
|
+
const DialogContent = React.forwardRef<
|
|
20
|
+
React.ElementRef<typeof DialogPrimitive.Content>,
|
|
21
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
|
|
22
|
+
>(({ children, ...props }, ref) => (
|
|
23
|
+
<DialogPortal>
|
|
24
|
+
<StyledDialogOverlay />
|
|
25
|
+
<StyledDialogContent ref={ref} {...props}>
|
|
26
|
+
{children}
|
|
27
|
+
<StyledDialogClose>
|
|
28
|
+
<X style={{ height: '1rem', width: '1rem' }} />
|
|
29
|
+
<span className="sr-only">Close</span>
|
|
30
|
+
</StyledDialogClose>
|
|
31
|
+
</StyledDialogContent>
|
|
32
|
+
</DialogPortal>
|
|
33
|
+
));
|
|
34
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
35
|
+
|
|
36
|
+
const DialogHeader: React.FC<React.HTMLAttributes<HTMLDivElement>> = (
|
|
37
|
+
props
|
|
38
|
+
) => <StyledDialogHeader {...props} />;
|
|
39
|
+
DialogHeader.displayName = 'DialogHeader';
|
|
40
|
+
|
|
41
|
+
const DialogFooter: React.FC<React.HTMLAttributes<HTMLDivElement>> = (
|
|
42
|
+
props
|
|
43
|
+
) => <StyledDialogFooter {...props} />;
|
|
44
|
+
DialogFooter.displayName = 'DialogFooter';
|
|
45
|
+
|
|
46
|
+
const DialogTitle = React.forwardRef<
|
|
47
|
+
React.ElementRef<typeof DialogPrimitive.Title>,
|
|
48
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
|
|
49
|
+
>((props, ref) => <StyledDialogTitle ref={ref} {...props} />);
|
|
50
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
51
|
+
|
|
52
|
+
const DialogDescription = React.forwardRef<
|
|
53
|
+
React.ElementRef<typeof DialogPrimitive.Description>,
|
|
54
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
|
|
55
|
+
>((props, ref) => <StyledDialogDescription ref={ref} {...props} />);
|
|
56
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
57
|
+
|
|
58
|
+
export {
|
|
59
|
+
Dialog,
|
|
60
|
+
DialogTrigger,
|
|
61
|
+
DialogPortal,
|
|
62
|
+
DialogContent,
|
|
63
|
+
StyledDialogOverlay as DialogOverlay,
|
|
64
|
+
StyledDialogClose as DialogClose,
|
|
65
|
+
DialogHeader,
|
|
66
|
+
DialogFooter,
|
|
67
|
+
DialogTitle,
|
|
68
|
+
DialogDescription,
|
|
69
|
+
};
|
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import {
|
|
3
|
-
primitiveColors,
|
|
4
|
-
semanticBorders,
|
|
5
|
-
semanticColors,
|
|
6
|
-
semanticRadius,
|
|
7
|
-
semanticSizes,
|
|
8
|
-
typographyTokens,
|
|
9
|
-
} from
|
|
10
|
-
|
|
11
|
-
export const Card = styled.div`
|
|
12
|
-
background-color: ${semanticColors.base.background};
|
|
13
|
-
border: ${semanticBorders.global.sm} solid ${semanticColors.neutral[400]};
|
|
14
|
-
border-radius: 8px;
|
|
15
|
-
padding: ${semanticSizes.global.padding.lg};
|
|
16
|
-
width: 100%;
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export const CardHeader = styled.div`
|
|
22
|
-
display: flex;
|
|
23
|
-
flex-direction: row;
|
|
24
|
-
justify-content: space-between;
|
|
25
|
-
text-align: center;
|
|
26
|
-
gap: ${semanticSizes.global.gap.sm};
|
|
27
|
-
align-items: center;
|
|
28
|
-
margin-bottom: 24px;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
export const CardTitle = styled.h2`
|
|
32
|
-
font-size: ${typographyTokens.fontSizes.headingS};
|
|
33
|
-
font-weight: ${typographyTokens.fontWeights.semibold};
|
|
34
|
-
margin: 0;
|
|
35
|
-
color: ${semanticColors.base.text};
|
|
36
|
-
text-align: center;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
export const CardLink = styled.a`
|
|
40
|
-
display: flex;
|
|
41
|
-
flex-direction: row;
|
|
42
|
-
font-size: ${typographyTokens.fontSizes.labelS};
|
|
43
|
-
margin: 0;
|
|
44
|
-
color: ${semanticColors.branding.text.accent.enabled};
|
|
45
|
-
text-align: center;
|
|
46
|
-
gap: ${semanticSizes.global.gap.sm};
|
|
47
|
-
align-items: center;
|
|
48
|
-
cursor: pointer;
|
|
49
|
-
text-decoration: none;
|
|
50
|
-
|
|
51
|
-
&:hover {
|
|
52
|
-
color: ${semanticColors.branding.text.accent.hover};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
export const CardContent = styled.div`
|
|
57
|
-
display: flex;
|
|
58
|
-
justify-content: flex-start;
|
|
59
|
-
align-items: center;
|
|
60
|
-
gap: ${semanticSizes.global.gap.xl};
|
|
61
|
-
margin-bottom: 18px;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
export const CardChartDescription = styled.div`
|
|
65
|
-
justify-content: flex-start;
|
|
66
|
-
align-items: center;
|
|
67
|
-
text-align: left;
|
|
68
|
-
|
|
69
|
-
.subtitle {
|
|
70
|
-
font-size: ${typographyTokens.fontSizes.labelS};
|
|
71
|
-
color: ${semanticColors.global.text.subtitle.enabled};
|
|
72
|
-
}
|
|
73
|
-
.description {
|
|
74
|
-
font-size: ${typographyTokens.fontSizes.headingM};
|
|
75
|
-
color: ${semanticColors.base.text};
|
|
76
|
-
margin-bottom: ${semanticSizes.global.spacings.sm};
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
export const CardFooter = styled.div`
|
|
81
|
-
text-align: left;
|
|
82
|
-
display: flex;
|
|
83
|
-
flex-direction: column;
|
|
84
|
-
gap: ${semanticSizes.global.gap.xs};
|
|
85
|
-
|
|
86
|
-
.subtitle {
|
|
87
|
-
font-size: ${typographyTokens.fontSizes.labelS};
|
|
88
|
-
color: ${semanticColors.global.text.subtitle.enabled};
|
|
89
|
-
}
|
|
90
|
-
.description {
|
|
91
|
-
display: flex;
|
|
92
|
-
justify-content: flex-start;
|
|
93
|
-
align-items: center;
|
|
94
|
-
flex-direction: row;
|
|
95
|
-
gap: ${semanticSizes.global.gap.lg};
|
|
96
|
-
font-size: ${typographyTokens.fontSizes.captionM};
|
|
97
|
-
color: ${semanticColors.base.text};
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.items {
|
|
101
|
-
display: flex;
|
|
102
|
-
align-items: center;
|
|
103
|
-
gap: ${semanticSizes.global.gap.sm};
|
|
104
|
-
margin-bottom: ${semanticSizes.global.spacings.sm};
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
export const Circle = styled.div<{ color?: string }>`
|
|
109
|
-
width: ${semanticSizes.global.gap.md};
|
|
110
|
-
height: ${semanticSizes.global.gap.md};
|
|
111
|
-
border-radius: ${semanticRadius.global.radius.full};
|
|
112
|
-
background-color: ${({ color }) => color || primitiveColors.orange[400]};
|
|
113
|
-
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import {
|
|
3
|
+
primitiveColors,
|
|
4
|
+
semanticBorders,
|
|
5
|
+
semanticColors,
|
|
6
|
+
semanticRadius,
|
|
7
|
+
semanticSizes,
|
|
8
|
+
typographyTokens,
|
|
9
|
+
} from '../../../styles/tokens';
|
|
10
|
+
|
|
11
|
+
export const Card = styled.div`
|
|
12
|
+
background-color: ${semanticColors.base.background};
|
|
13
|
+
border: ${semanticBorders.global.sm} solid ${semanticColors.neutral[400]};
|
|
14
|
+
border-radius: 8px;
|
|
15
|
+
padding: ${semanticSizes.global.padding.lg};
|
|
16
|
+
width: 100%;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
export const CardHeader = styled.div`
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: row;
|
|
24
|
+
justify-content: space-between;
|
|
25
|
+
text-align: center;
|
|
26
|
+
gap: ${semanticSizes.global.gap.sm};
|
|
27
|
+
align-items: center;
|
|
28
|
+
margin-bottom: 24px;
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
export const CardTitle = styled.h2`
|
|
32
|
+
font-size: ${typographyTokens.fontSizes.headingS};
|
|
33
|
+
font-weight: ${typographyTokens.fontWeights.semibold};
|
|
34
|
+
margin: 0;
|
|
35
|
+
color: ${semanticColors.base.text};
|
|
36
|
+
text-align: center;
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
export const CardLink = styled.a`
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: row;
|
|
42
|
+
font-size: ${typographyTokens.fontSizes.labelS};
|
|
43
|
+
margin: 0;
|
|
44
|
+
color: ${semanticColors.branding.text.accent.enabled};
|
|
45
|
+
text-align: center;
|
|
46
|
+
gap: ${semanticSizes.global.gap.sm};
|
|
47
|
+
align-items: center;
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
text-decoration: none;
|
|
50
|
+
|
|
51
|
+
&:hover {
|
|
52
|
+
color: ${semanticColors.branding.text.accent.hover};
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
export const CardContent = styled.div`
|
|
57
|
+
display: flex;
|
|
58
|
+
justify-content: flex-start;
|
|
59
|
+
align-items: center;
|
|
60
|
+
gap: ${semanticSizes.global.gap.xl};
|
|
61
|
+
margin-bottom: 18px;
|
|
62
|
+
`;
|
|
63
|
+
|
|
64
|
+
export const CardChartDescription = styled.div`
|
|
65
|
+
justify-content: flex-start;
|
|
66
|
+
align-items: center;
|
|
67
|
+
text-align: left;
|
|
68
|
+
|
|
69
|
+
.subtitle {
|
|
70
|
+
font-size: ${typographyTokens.fontSizes.labelS};
|
|
71
|
+
color: ${semanticColors.global.text.subtitle.enabled};
|
|
72
|
+
}
|
|
73
|
+
.description {
|
|
74
|
+
font-size: ${typographyTokens.fontSizes.headingM};
|
|
75
|
+
color: ${semanticColors.base.text};
|
|
76
|
+
margin-bottom: ${semanticSizes.global.spacings.sm};
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
79
|
+
|
|
80
|
+
export const CardFooter = styled.div`
|
|
81
|
+
text-align: left;
|
|
82
|
+
display: flex;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
gap: ${semanticSizes.global.gap.xs};
|
|
85
|
+
|
|
86
|
+
.subtitle {
|
|
87
|
+
font-size: ${typographyTokens.fontSizes.labelS};
|
|
88
|
+
color: ${semanticColors.global.text.subtitle.enabled};
|
|
89
|
+
}
|
|
90
|
+
.description {
|
|
91
|
+
display: flex;
|
|
92
|
+
justify-content: flex-start;
|
|
93
|
+
align-items: center;
|
|
94
|
+
flex-direction: row;
|
|
95
|
+
gap: ${semanticSizes.global.gap.lg};
|
|
96
|
+
font-size: ${typographyTokens.fontSizes.captionM};
|
|
97
|
+
color: ${semanticColors.base.text};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.items {
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
gap: ${semanticSizes.global.gap.sm};
|
|
104
|
+
margin-bottom: ${semanticSizes.global.spacings.sm};
|
|
105
|
+
}
|
|
106
|
+
`;
|
|
107
|
+
|
|
108
|
+
export const Circle = styled.div<{ color?: string }>`
|
|
109
|
+
width: ${semanticSizes.global.gap.md};
|
|
110
|
+
height: ${semanticSizes.global.gap.md};
|
|
111
|
+
border-radius: ${semanticRadius.global.radius.full};
|
|
112
|
+
background-color: ${({ color }) => color || primitiveColors.orange[400]};
|
|
113
|
+
`;
|
|
@@ -1,71 +1,75 @@
|
|
|
1
|
-
import type React from
|
|
2
|
-
import { ArrowUpRight } from 'lucide-react'
|
|
3
|
-
import type { DonutEmissionsChartProps } from
|
|
4
|
-
import type { PieChartComponentProps } from
|
|
5
|
-
import {
|
|
6
|
-
Card,
|
|
7
|
-
CardHeader,
|
|
8
|
-
CardTitle,
|
|
9
|
-
CardContent,
|
|
10
|
-
CardFooter,
|
|
11
|
-
CardLink,
|
|
12
|
-
CardChartDescription,
|
|
13
|
-
Circle,
|
|
14
|
-
} from
|
|
15
|
-
import { PieChartComponent } from
|
|
16
|
-
import { primitiveColors } from
|
|
17
|
-
import ResultsChart from
|
|
18
|
-
|
|
19
|
-
const DonutEmissionsChart: React.FC<DonutEmissionsChartProps> = ({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
primitiveColors.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { ArrowUpRight } from 'lucide-react';
|
|
3
|
+
import type { DonutEmissionsChartProps } from './DonutEmissionsChart.types';
|
|
4
|
+
import type { PieChartComponentProps } from '../../molecules/PieChartComponent/PieChartComponent.types';
|
|
5
|
+
import {
|
|
6
|
+
Card,
|
|
7
|
+
CardHeader,
|
|
8
|
+
CardTitle,
|
|
9
|
+
CardContent,
|
|
10
|
+
CardFooter,
|
|
11
|
+
CardLink,
|
|
12
|
+
CardChartDescription,
|
|
13
|
+
Circle,
|
|
14
|
+
} from './DonutEmissionsChart.styles';
|
|
15
|
+
import { PieChartComponent } from '../../molecules/PieChartComponent';
|
|
16
|
+
import { primitiveColors } from '../../../styles/tokens';
|
|
17
|
+
import ResultsChart from '../../molecules/ResultsChart';
|
|
18
|
+
|
|
19
|
+
const DonutEmissionsChart: React.FC<DonutEmissionsChartProps> = ({
|
|
20
|
+
totalEmissions,
|
|
21
|
+
companiesWithEmissions,
|
|
22
|
+
}) => {
|
|
23
|
+
const colors = [
|
|
24
|
+
primitiveColors.blue[400],
|
|
25
|
+
primitiveColors.orange[400],
|
|
26
|
+
primitiveColors.green[400],
|
|
27
|
+
primitiveColors.gray[400],
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
const chartData: PieChartComponentProps = {
|
|
31
|
+
data: companiesWithEmissions.map((company, index) => ({
|
|
32
|
+
name: company.companyName,
|
|
33
|
+
value: company.totalEmissions,
|
|
34
|
+
fill: colors[index % colors.length],
|
|
35
|
+
})),
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const currentMonth = new Date().toLocaleDateString('pt-BR', {
|
|
39
|
+
month: 'long',
|
|
40
|
+
});
|
|
41
|
+
const currentMonthCapitalized =
|
|
42
|
+
currentMonth.charAt(0).toUpperCase() + currentMonth.slice(1);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<Card>
|
|
46
|
+
<CardHeader>
|
|
47
|
+
<CardTitle>Emissões realizadas</CardTitle>
|
|
48
|
+
<CardLink href="#">
|
|
49
|
+
Acessar dashboard <ArrowUpRight size={16} />
|
|
50
|
+
</CardLink>
|
|
51
|
+
</CardHeader>
|
|
52
|
+
<CardContent>
|
|
53
|
+
<PieChartComponent data={chartData.data} />
|
|
54
|
+
<CardChartDescription>
|
|
55
|
+
<div className="subtitle">Emissões realizadas em</div>
|
|
56
|
+
<div className="description">{currentMonthCapitalized}</div>
|
|
57
|
+
<ResultsChart value={totalEmissions} />
|
|
58
|
+
</CardChartDescription>
|
|
59
|
+
</CardContent>
|
|
60
|
+
<CardFooter>
|
|
61
|
+
<div className="subtitle">Empresas que realizaram emissões</div>
|
|
62
|
+
<div className="description">
|
|
63
|
+
{chartData.data?.map((item, index) => (
|
|
64
|
+
<div key={index} className="items">
|
|
65
|
+
<Circle color={item.fill} />
|
|
66
|
+
{item.name}
|
|
67
|
+
</div>
|
|
68
|
+
))}
|
|
69
|
+
</div>
|
|
70
|
+
</CardFooter>
|
|
71
|
+
</Card>
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export default DonutEmissionsChart;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export interface CompanyEmission {
|
|
2
|
-
companyName: string
|
|
3
|
-
totalEmissions: number
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export interface DonutEmissionsChartProps {
|
|
7
|
-
totalEmissions: number
|
|
8
|
-
companiesWithEmissions: CompanyEmission[]
|
|
9
|
-
}
|
|
1
|
+
export interface CompanyEmission {
|
|
2
|
+
companyName: string;
|
|
3
|
+
totalEmissions: number;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface DonutEmissionsChartProps {
|
|
7
|
+
totalEmissions: number;
|
|
8
|
+
companiesWithEmissions: CompanyEmission[];
|
|
9
|
+
}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
export { default } from
|
|
2
|
-
export type {
|
|
1
|
+
export { default } from './DonutEmissionsChart';
|
|
2
|
+
export type {
|
|
3
|
+
DonutEmissionsChartProps,
|
|
4
|
+
CompanyEmission,
|
|
5
|
+
} from './DonutEmissionsChart.types';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import * as Dialog from '@radix-ui/react-dialog';
|
|
3
|
+
import { semanticColors } 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
|
+
inset: 0;
|
|
15
|
+
display: grid;
|
|
16
|
+
place-items: center;
|
|
17
|
+
z-index: 1000;
|
|
18
|
+
background: transparent;
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
export const Panel = styled.div`
|
|
22
|
+
background: white;
|
|
23
|
+
border-radius: 12px;
|
|
24
|
+
padding: 32px;
|
|
25
|
+
width: min(850px, calc(100% - 32px));
|
|
26
|
+
border-top: 6px solid ${semanticColors.branding.surface.enabled};
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
export const Title = styled.h2`
|
|
30
|
+
font-size: 28px;
|
|
31
|
+
font-weight: 600;
|
|
32
|
+
color: ${semanticColors.base.text};
|
|
33
|
+
margin-bottom: 16px;
|
|
34
|
+
padding-right: 12px;
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: row;
|
|
37
|
+
gap: 8px;
|
|
38
|
+
align-items: center;
|
|
39
|
+
margin-top: -2px;
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
export const CloseIcon = styled(Dialog.Close)`
|
|
43
|
+
background: transparent;
|
|
44
|
+
border: none;
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
padding: 4px;
|
|
47
|
+
|
|
48
|
+
svg {
|
|
49
|
+
color: #888;
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
52
|
+
|
|
53
|
+
export const Header = styled.div`
|
|
54
|
+
display: flex;
|
|
55
|
+
justify-content: space-between;
|
|
56
|
+
align-items: flex-start;
|
|
57
|
+
width: 100%;
|
|
58
|
+
margin-bottom: 24px;
|
|
59
|
+
`;
|