@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.
Files changed (158) hide show
  1. package/README.md +165 -27
  2. package/dist/umbrella-components.css +1 -1
  3. package/dist/umbrella-components.es.js +33627 -28792
  4. package/dist/umbrella-components.umd.js +1169 -1908
  5. package/package.json +136 -106
  6. package/src/assets.d.ts +19 -19
  7. package/src/components/atoms/Badge/Badge.styles.ts +88 -86
  8. package/src/components/atoms/Badge/Badge.tsx +42 -44
  9. package/src/components/atoms/Badge/Badge.types.ts +15 -15
  10. package/src/components/atoms/Breadcrumb/Breadcrumb.styles.ts +43 -43
  11. package/src/components/atoms/Breadcrumb/Breadcrumb.tsx +46 -48
  12. package/src/components/atoms/Breadcrumb/Breadcrumb.types.ts +12 -12
  13. package/src/components/atoms/Button/Button.styles.ts +279 -280
  14. package/src/components/atoms/Button/Button.tsx +76 -76
  15. package/src/components/atoms/Button/Button.types.ts +28 -28
  16. package/src/components/atoms/Button/index.ts +1 -1
  17. package/src/components/atoms/Checkbox/Checkbox.styles.ts +72 -72
  18. package/src/components/atoms/Checkbox/Checkbox.tsx +36 -36
  19. package/src/components/atoms/Checkbox/Checkbox.types.ts +14 -14
  20. package/src/components/atoms/Checkbox/CheckboxGroup.tsx +30 -30
  21. package/src/components/atoms/Checkbox/CheckboxSelectAll.tsx +32 -32
  22. package/src/components/atoms/CodeInput/CodeInput.styles.tsx +38 -39
  23. package/src/components/atoms/CodeInput/CodeInput.tsx +13 -19
  24. package/src/components/atoms/CodeInput/CodeInput.types.ts +3 -3
  25. package/src/components/atoms/CodeInput/index.tsx +1 -1
  26. package/src/components/atoms/DropDownMenu/DropdownMenu.tsx +48 -48
  27. package/src/components/atoms/DropDownMenu/DropdownMenu.types.ts +15 -15
  28. package/src/components/atoms/DropDownMenu/index.tsx +5 -2
  29. package/src/components/atoms/ErrorMessage/ErrorMessage.styles.tsx +28 -28
  30. package/src/components/atoms/ErrorMessage/ErrorMessage.tsx +12 -12
  31. package/src/components/atoms/ErrorMessage/ErrorMessage.types.ts +6 -6
  32. package/src/components/atoms/ErrorMessage/index.tsx +1 -1
  33. package/src/components/atoms/Footer/Footer.styles.tsx +22 -22
  34. package/src/components/atoms/Footer/Footer.tsx +9 -9
  35. package/src/components/atoms/Footer/Footer.types.tsx +5 -5
  36. package/src/components/atoms/Footer/index.tsx +1 -1
  37. package/src/components/atoms/GenericContainer/GenericContainer.styles.tsx +21 -21
  38. package/src/components/atoms/GenericContainer/GenericContainer.tsx +9 -9
  39. package/src/components/atoms/GenericContainer/GenericContainer.types.ts +5 -5
  40. package/src/components/atoms/GenericContainer/index.tsx +1 -1
  41. package/src/components/atoms/Icon/Icon.styles.ts +11 -11
  42. package/src/components/atoms/Icon/Icon.tsx +22 -22
  43. package/src/components/atoms/Icon/Icon.types.ts +6 -6
  44. package/src/components/atoms/Icon/index.ts +1 -1
  45. package/src/components/atoms/Input/Input.styles.ts +106 -101
  46. package/src/components/atoms/Input/index.ts +1 -1
  47. package/src/components/atoms/Label/Label.tsx +16 -16
  48. package/src/components/atoms/Loading/Loading.styles.tsx +25 -25
  49. package/src/components/atoms/Loading/Loading.tsx +8 -8
  50. package/src/components/atoms/LogoContainer/LogoContainer.Types.tsx +5 -5
  51. package/src/components/atoms/LogoContainer/LogoContainer.styles.tsx +11 -11
  52. package/src/components/atoms/LogoContainer/LogoContainer.tsx +11 -11
  53. package/src/components/atoms/LogoContainer/index.tsx +1 -1
  54. package/src/components/atoms/ModalAviso/ModalAviso.styles.tsx +56 -56
  55. package/src/components/atoms/ModalAviso/ModalAviso.tsx +43 -37
  56. package/src/components/atoms/ModalAviso/ModalAviso.types.ts +5 -5
  57. package/src/components/atoms/ModalAviso/index.tsx +1 -1
  58. package/src/components/atoms/MultiSelect/MultiSelect.styles.tsx +100 -92
  59. package/src/components/atoms/MultiSelect/MultiSelect.tsx +346 -346
  60. package/src/components/atoms/MultiSelect/MultiSelect.types.ts +38 -38
  61. package/src/components/atoms/Pill/Pill.styles.ts +46 -46
  62. package/src/components/atoms/Pill/Pill.tsx +35 -36
  63. package/src/components/atoms/Pill/Pill.types.ts +14 -18
  64. package/src/components/atoms/RadioButton/RadioButton.styles.ts +44 -43
  65. package/src/components/atoms/RadioButton/RadioButton.tsx +31 -31
  66. package/src/components/atoms/ResendLink/ResendLink.styles.tsx +19 -20
  67. package/src/components/atoms/ResendLink/ResendLink.tsx +21 -21
  68. package/src/components/atoms/ResendLink/ResendLink.types.ts +8 -9
  69. package/src/components/atoms/ResendLink/index.tsx +1 -2
  70. package/src/components/atoms/Select/Select.styles.ts +153 -149
  71. package/src/components/atoms/Select/Select.tsx +52 -43
  72. package/src/components/atoms/Select/index.tsx +1 -1
  73. package/src/components/atoms/Subtitle/Subtitle.tsx +7 -7
  74. package/src/components/atoms/Subtitle/Subtitle.types.ts +5 -5
  75. package/src/components/atoms/Subtitle/index.tsx +1 -1
  76. package/src/components/atoms/Switch/Switch.tsx +25 -25
  77. package/src/components/atoms/TabBar/TabBar.styles.tsx +64 -57
  78. package/src/components/atoms/TabBar/index.tsx +2 -2
  79. package/src/components/atoms/Text/Text.styles.tsx +35 -35
  80. package/src/components/atoms/Text/Text.tsx +32 -31
  81. package/src/components/atoms/Text/Text.types.ts +8 -8
  82. package/src/components/atoms/Text/index.ts +1 -1
  83. package/src/components/atoms/Textarea/Textarea.styles.ts +52 -52
  84. package/src/components/atoms/Textarea/Textarea.tsx +31 -31
  85. package/src/components/atoms/Title/Title.tsx +7 -7
  86. package/src/components/atoms/Title/Title.types.ts +5 -5
  87. package/src/components/atoms/Title/index.tsx +1 -1
  88. package/src/components/molecules/BannerAjuda/BannerAjuda.styles.tsx +9 -9
  89. package/src/components/molecules/BannerAjuda/BannerAjuda.tsx +18 -19
  90. package/src/components/molecules/BannerAjuda/index.tsx +1 -1
  91. package/src/components/molecules/ButtonGroup/ButtonGroup.styles.ts +10 -10
  92. package/src/components/molecules/ButtonGroup/ButtonGroup.types.ts +22 -22
  93. package/src/components/molecules/Calendar/Calendar.styles.ts +143 -143
  94. package/src/components/molecules/Calendar/Calendar.tsx +31 -31
  95. package/src/components/molecules/CodeInputContainer/CodeInputContainer.styles.tsx +7 -7
  96. package/src/components/molecules/CodeInputContainer/CodeInputContainer.types.ts +13 -13
  97. package/src/components/molecules/CodeInputContainer/index.tsx +1 -3
  98. package/src/components/molecules/ExcludeModal/ExcludeModal.styles.tsx +123 -118
  99. package/src/components/molecules/ExcludeModal/ExcludeModal.tsx +48 -48
  100. package/src/components/molecules/ExcludeModal/ExcludeModal.types.ts +10 -10
  101. package/src/components/molecules/ExcludeModal/index.tsx +1 -1
  102. package/src/components/molecules/FieldSelector/FieldSelector.styles.ts +59 -0
  103. package/src/components/molecules/FieldSelector/FieldSelector.tsx +167 -0
  104. package/src/components/molecules/HighlightsCard/HighlightsCard.styles.tsx +67 -68
  105. package/src/components/molecules/HighlightsCard/HighlightsCard.tsx +35 -26
  106. package/src/components/molecules/HighlightsCard/HighlightsCard.types.ts +10 -10
  107. package/src/components/molecules/HighlightsCard/index.tsx +1 -1
  108. package/src/components/molecules/InsuranceCard/InsuranceCard.styles.tsx +237 -237
  109. package/src/components/molecules/InsuranceCard/index.tsx +1 -1
  110. package/src/components/molecules/PieChartComponent/PieChartComponent.styles.tsx +7 -8
  111. package/src/components/molecules/PieChartComponent/PieChartComponent.tsx +70 -73
  112. package/src/components/molecules/PieChartComponent/PieChartComponent.types.ts +11 -11
  113. package/src/components/molecules/PieChartComponent/index.tsx +1 -1
  114. package/src/components/molecules/Popover/Popover.styles.ts +66 -65
  115. package/src/components/molecules/Popover/Popover.tsx +23 -23
  116. package/src/components/molecules/RadioBoxGroup/RadioBoxGroup.styles.ts +11 -11
  117. package/src/components/molecules/RadioBoxGroup/RadioBoxGroup.tsx +43 -43
  118. package/src/components/molecules/RadioGroupField/RadioGroupField.styles.tsx +65 -64
  119. package/src/components/molecules/RadioGroupField/RadioGroupField.tsx +69 -69
  120. package/src/components/molecules/RadioGroupField/RadioGroupField.types.ts +17 -17
  121. package/src/components/molecules/RadioGroupField/index.tsx +1 -1
  122. package/src/components/molecules/RefuseModal/RefuseModal.styles.tsx +139 -139
  123. package/src/components/molecules/RefuseModal/RefuseModal.tsx +92 -76
  124. package/src/components/molecules/RefuseModal/RefuseModal.types.ts +15 -15
  125. package/src/components/molecules/RefuseModal/index.tsx +2 -2
  126. package/src/components/molecules/ResultsChart/ResultsChart.tsx +23 -19
  127. package/src/components/molecules/ResultsChart/ResultsChart.types.ts +3 -3
  128. package/src/components/molecules/ResultsChart/index.tsx +2 -2
  129. package/src/components/molecules/TabToggle/TabToggle.styles.ts +54 -54
  130. package/src/components/molecules/TabToggle/TabToggle.tsx +35 -35
  131. package/src/components/organisms/AlertDialog/AlertDialog.styles.tsx +61 -61
  132. package/src/components/organisms/AlertDialog/AlertDialog.tsx +70 -70
  133. package/src/components/organisms/Dialog/Dialog.styles.ts +107 -106
  134. package/src/components/organisms/Dialog/Dialog.tsx +69 -69
  135. package/src/components/organisms/DonutEmissionsChart/DonutEmissionsChart.styles.tsx +113 -113
  136. package/src/components/organisms/DonutEmissionsChart/DonutEmissionsChart.tsx +75 -71
  137. package/src/components/organisms/DonutEmissionsChart/DonutEmissionsChart.types.ts +9 -9
  138. package/src/components/organisms/DonutEmissionsChart/index.tsx +5 -2
  139. package/src/components/organisms/ExportExcelModal/ExportExcelModal.styles.ts +59 -0
  140. package/src/components/organisms/ExportExcelModal/ExportExcelModal.tsx +80 -0
  141. package/src/components/organisms/Form/Form.styles.ts +35 -35
  142. package/src/components/organisms/Form/Form.tsx +160 -160
  143. package/src/components/organisms/ListagemUltimasEmissoes/ListagemUltimasEmissoes.styles.tsx +115 -114
  144. package/src/components/organisms/ListagemUltimasEmissoes/ListagemUltimasEmissoes.tsx +89 -89
  145. package/src/components/organisms/ListagemUltimasEmissoes/ListagemUltimasEmissoes.types.ts +16 -16
  146. package/src/components/organisms/ListagemUltimasEmissoes/index.tsx +1 -1
  147. package/src/components/organisms/Navbar/Navbar.styles.tsx +243 -243
  148. package/src/global.d.ts +9 -9
  149. package/src/index.ts +4 -0
  150. package/src/lib/utils.ts +6 -6
  151. package/src/styles/tokens/borders.ts +17 -17
  152. package/src/styles/tokens/index.tsx +6 -6
  153. package/src/styles/tokens/radius.ts +22 -22
  154. package/src/styles/tokens/shadows.ts +22 -22
  155. package/src/styles/tokens/sizes.ts +60 -64
  156. package/src/types/radius.types.ts +1 -1
  157. package/src/types/shadows.types.ts +1 -1
  158. package/src/utils/renderHighlightsCard.tsx +21 -0
@@ -1,69 +1,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
+ // 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 "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
+ 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 "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> = ({ totalEmissions, companiesWithEmissions }) => {
20
- const colors = [
21
- primitiveColors.blue[400],
22
- primitiveColors.orange[400],
23
- primitiveColors.green[400],
24
- primitiveColors.gray[400],
25
- ]
26
-
27
- const chartData: PieChartComponentProps = {
28
- data: companiesWithEmissions.map((company, index) => ({
29
- name: company.companyName,
30
- value: company.totalEmissions,
31
- fill: colors[index % colors.length],
32
- })),
33
- }
34
-
35
- const currentMonth = new Date().toLocaleDateString("pt-BR", {
36
- month: "long",
37
- })
38
- const currentMonthCapitalized = currentMonth.charAt(0).toUpperCase() + currentMonth.slice(1)
39
-
40
- return (
41
- <Card>
42
- <CardHeader>
43
- <CardTitle>Emissões realizadas</CardTitle>
44
- <CardLink href="#">
45
- Acessar dashboard <ArrowUpRight size={16} />
46
- </CardLink>
47
- </CardHeader>
48
- <CardContent>
49
- <PieChartComponent data={chartData.data} />
50
- <CardChartDescription>
51
- <div className="subtitle">Emissões realizadas em</div>
52
- <div className="description">{currentMonthCapitalized}</div>
53
- <ResultsChart value={totalEmissions} />
54
- </CardChartDescription>
55
- </CardContent>
56
- <CardFooter>
57
- <div className="subtitle">Empresas que realizaram emissões</div>
58
- <div className="description">
59
- {chartData.data?.map((item, index) => (
60
- <div key={index} className="items">
61
- <Circle color={item.fill} />
62
- {item.name}
63
- </div>
64
- ))}
65
- </div>
66
- </CardFooter>
67
- </Card>
68
- )
69
- }
70
-
71
- export default DonutEmissionsChart
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 "./DonutEmissionsChart"
2
- export type { DonutEmissionsChartProps, CompanyEmission } from "./DonutEmissionsChart.types"
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
+ `;