@granto-umbrella/umbrella-components 3.0.34 → 3.0.36

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 (156) hide show
  1. package/README.md +165 -27
  2. package/dist/umbrella-components.css +1 -1
  3. package/dist/umbrella-components.es.js +28129 -29249
  4. package/dist/umbrella-components.umd.js +1234 -2181
  5. package/package.json +135 -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/Form/Form.styles.ts +35 -35
  140. package/src/components/organisms/Form/Form.tsx +160 -160
  141. package/src/components/organisms/ListagemUltimasEmissoes/ListagemUltimasEmissoes.styles.tsx +115 -114
  142. package/src/components/organisms/ListagemUltimasEmissoes/ListagemUltimasEmissoes.tsx +89 -89
  143. package/src/components/organisms/ListagemUltimasEmissoes/ListagemUltimasEmissoes.types.ts +16 -16
  144. package/src/components/organisms/ListagemUltimasEmissoes/index.tsx +1 -1
  145. package/src/components/organisms/Navbar/Navbar.styles.tsx +243 -243
  146. package/src/global.d.ts +9 -9
  147. package/src/index.ts +2 -0
  148. package/src/lib/utils.ts +6 -6
  149. package/src/styles/tokens/borders.ts +17 -17
  150. package/src/styles/tokens/index.tsx +6 -6
  151. package/src/styles/tokens/radius.ts +22 -22
  152. package/src/styles/tokens/shadows.ts +22 -22
  153. package/src/styles/tokens/sizes.ts +60 -64
  154. package/src/types/radius.types.ts +1 -1
  155. package/src/types/shadows.types.ts +1 -1
  156. package/src/utils/renderHighlightsCard.tsx +21 -0
@@ -1,35 +1,35 @@
1
- import React, { useState } from "react";
2
- import { ToggleContainer, Slider, TabButton } from "./TabToggle.styles";
3
-
4
- export type TabItem = {
5
- title: string;
6
- quantity: number;
7
- };
8
-
9
- export type TabToggleProps = {
10
- items: TabItem[];
11
- };
12
-
13
- export const TabToggle: React.FC<TabToggleProps> = ({ items }) => {
14
- const [activeIndex, setActiveIndex] = useState(0);
15
- const count = items.length;
16
-
17
- return (
18
- <ToggleContainer>
19
- {/* Slider agora sabe quantas abas existem */}
20
- <Slider activeIndex={activeIndex} count={count} />
21
-
22
- {items.map(({ title, quantity }, i) => (
23
- <TabButton
24
- key={title}
25
- active={i === activeIndex}
26
- onClick={() => setActiveIndex(i)}
27
- >
28
- {title} ({quantity})
29
- </TabButton>
30
- ))}
31
- </ToggleContainer>
32
- );
33
- };
34
-
35
- export default TabToggle;
1
+ import React, { useState } from 'react';
2
+ import { ToggleContainer, Slider, TabButton } from './TabToggle.styles';
3
+
4
+ export type TabItem = {
5
+ title: string;
6
+ quantity: number;
7
+ };
8
+
9
+ export type TabToggleProps = {
10
+ items: TabItem[];
11
+ };
12
+
13
+ export const TabToggle: React.FC<TabToggleProps> = ({ items }) => {
14
+ const [activeIndex, setActiveIndex] = useState(0);
15
+ const count = items.length;
16
+
17
+ return (
18
+ <ToggleContainer>
19
+ {/* Slider agora sabe quantas abas existem */}
20
+ <Slider activeIndex={activeIndex} count={count} />
21
+
22
+ {items.map(({ title, quantity }, i) => (
23
+ <TabButton
24
+ key={title}
25
+ active={i === activeIndex}
26
+ onClick={() => setActiveIndex(i)}
27
+ >
28
+ {title} ({quantity})
29
+ </TabButton>
30
+ ))}
31
+ </ToggleContainer>
32
+ );
33
+ };
34
+
35
+ export default TabToggle;
@@ -1,61 +1,61 @@
1
- import {
2
- semanticColors,
3
- semanticRadius,
4
- semanticShadows,
5
- semanticSizes,
6
- } from "../../../styles/tokens";
7
- import styled from "styled-components";
8
-
9
- export const DialogContainer = styled.div`
10
- background: ${semanticColors.base.background};
11
- padding: ${semanticSizes.global.padding["2xl"]};
12
- border-radius: ${semanticRadius.global.radius.md};
13
- box-shadow: ${semanticShadows.shadow};
14
- border-top: 4px solid ${semanticColors.danger.border.enabled};
15
- display: flex;
16
- flex-direction: column;
17
- align-items: center;
18
- gap: ${semanticSizes.global.gap.lg};
19
- max-width: 440px;
20
- text-align: left;
21
- position: relative;
22
- `;
23
-
24
- export const ButtonContainer = styled.div`
25
- display: flex;
26
- width: 100%;
27
- gap: ${semanticSizes.global.gap.lg};
28
- margin-top: ${semanticSizes.global.spacings.lg};
29
- justify-content: flex-end;
30
- `;
31
-
32
- export const Overlay = styled.div`
33
- position: fixed;
34
- inset: 0;
35
- background: rgba(0, 0, 0, 0.5);
36
- display: flex;
37
- justify-content: center;
38
- align-items: center;
39
- z-index: 9999;
40
- `;
41
-
42
- export const CloseButton = styled.button`
43
- background: none;
44
- border: none;
45
- cursor: pointer;
46
- color: ${semanticColors.base.text};
47
- font-size: ${semanticSizes.global.spacings.lg};
48
-
49
- &:hover {
50
- color: ${semanticColors.danger.border.enabled};
51
- }
52
- `;
53
-
54
- export const TitleContainer = styled.div`
55
- display: flex;
56
- width: 100%;
57
- flex-direction: row;
58
- justify-content: space-between;
59
- align-items: flex-start;
60
- gap: ${semanticSizes.global.gap.sm};
61
- `;
1
+ import {
2
+ semanticColors,
3
+ semanticRadius,
4
+ semanticShadows,
5
+ semanticSizes,
6
+ } from '../../../styles/tokens';
7
+ import styled from 'styled-components';
8
+
9
+ export const DialogContainer = styled.div`
10
+ background: ${semanticColors.base.background};
11
+ padding: ${semanticSizes.global.padding['2xl']};
12
+ border-radius: ${semanticRadius.global.radius.md};
13
+ box-shadow: ${semanticShadows.shadow};
14
+ border-top: 4px solid ${semanticColors.danger.border.enabled};
15
+ display: flex;
16
+ flex-direction: column;
17
+ align-items: center;
18
+ gap: ${semanticSizes.global.gap.lg};
19
+ max-width: 440px;
20
+ text-align: left;
21
+ position: relative;
22
+ `;
23
+
24
+ export const ButtonContainer = styled.div`
25
+ display: flex;
26
+ width: 100%;
27
+ gap: ${semanticSizes.global.gap.lg};
28
+ margin-top: ${semanticSizes.global.spacings.lg};
29
+ justify-content: flex-end;
30
+ `;
31
+
32
+ export const Overlay = styled.div`
33
+ position: fixed;
34
+ inset: 0;
35
+ background: rgba(0, 0, 0, 0.5);
36
+ display: flex;
37
+ justify-content: center;
38
+ align-items: center;
39
+ z-index: 9999;
40
+ `;
41
+
42
+ export const CloseButton = styled.button`
43
+ background: none;
44
+ border: none;
45
+ cursor: pointer;
46
+ color: ${semanticColors.base.text};
47
+ font-size: ${semanticSizes.global.spacings.lg};
48
+
49
+ &:hover {
50
+ color: ${semanticColors.danger.border.enabled};
51
+ }
52
+ `;
53
+
54
+ export const TitleContainer = styled.div`
55
+ display: flex;
56
+ width: 100%;
57
+ flex-direction: row;
58
+ justify-content: space-between;
59
+ align-items: flex-start;
60
+ gap: ${semanticSizes.global.gap.sm};
61
+ `;
@@ -1,70 +1,70 @@
1
- import React from "react";
2
- import Text from "../../atoms/Text/Text";
3
- import Button from "../../atoms/Button/Button";
4
- import {
5
- ButtonContainer,
6
- DialogContainer,
7
- Overlay,
8
- CloseButton,
9
- TitleContainer,
10
- } from "./AlertDialog.styles";
11
- import { X } from "@phosphor-icons/react";
12
- import { AlertDialogProps } from "./AlertDialog.types";
13
- import { semanticColors } from "../../../styles/tokens";
14
-
15
- const AlertDialog: React.FC<AlertDialogProps> = ({
16
- text,
17
- isOpen,
18
- buttons: { confirm, cancel, onClose, onConfirm },
19
- testId,
20
- }) => {
21
- if (!isOpen) return null;
22
-
23
- return (
24
- <Overlay>
25
- <DialogContainer>
26
- <TitleContainer>
27
- <Text
28
- size="lg"
29
- weight="bold"
30
- color={`${semanticColors.danger.border.enabled}`}
31
- >
32
- {text.title}
33
- </Text>
34
- <CloseButton onClick={onClose} aria-label="Fechar">
35
- <X
36
- size={20}
37
- color={`${semanticColors.neutral[300]}`}
38
- weight="bold"
39
- />
40
- </CloseButton>
41
- </TitleContainer>
42
- <Text size="md" color={`${semanticColors.neutral[500]}`}>
43
- {text.description}
44
- </Text>
45
- <ButtonContainer>
46
- {cancel && (
47
- <Button
48
- testId={`${testId}_cancelar`}
49
- variant="alert"
50
- onClick={onClose}
51
- >
52
- {cancel}
53
- </Button>
54
- )}
55
- {confirm && (
56
- <Button
57
- testId={`${testId}_confirmar`}
58
- variant="danger"
59
- onClick={onConfirm}
60
- >
61
- {confirm}
62
- </Button>
63
- )}
64
- </ButtonContainer>
65
- </DialogContainer>
66
- </Overlay>
67
- );
68
- };
69
-
70
- export default AlertDialog;
1
+ import React from 'react';
2
+ import Text from '../../atoms/Text/Text';
3
+ import Button from '../../atoms/Button/Button';
4
+ import {
5
+ ButtonContainer,
6
+ DialogContainer,
7
+ Overlay,
8
+ CloseButton,
9
+ TitleContainer,
10
+ } from './AlertDialog.styles';
11
+ import { X } from '@phosphor-icons/react';
12
+ import { AlertDialogProps } from './AlertDialog.types';
13
+ import { semanticColors } from '../../../styles/tokens';
14
+
15
+ const AlertDialog: React.FC<AlertDialogProps> = ({
16
+ text,
17
+ isOpen,
18
+ buttons: { confirm, cancel, onClose, onConfirm },
19
+ testId,
20
+ }) => {
21
+ if (!isOpen) return null;
22
+
23
+ return (
24
+ <Overlay>
25
+ <DialogContainer>
26
+ <TitleContainer>
27
+ <Text
28
+ size="lg"
29
+ weight="bold"
30
+ color={`${semanticColors.danger.border.enabled}`}
31
+ >
32
+ {text.title}
33
+ </Text>
34
+ <CloseButton onClick={onClose} aria-label="Fechar">
35
+ <X
36
+ size={20}
37
+ color={`${semanticColors.neutral[300]}`}
38
+ weight="bold"
39
+ />
40
+ </CloseButton>
41
+ </TitleContainer>
42
+ <Text size="md" color={`${semanticColors.neutral[500]}`}>
43
+ {text.description}
44
+ </Text>
45
+ <ButtonContainer>
46
+ {cancel && (
47
+ <Button
48
+ testId={`${testId}_cancelar`}
49
+ variant="alert"
50
+ onClick={onClose}
51
+ >
52
+ {cancel}
53
+ </Button>
54
+ )}
55
+ {confirm && (
56
+ <Button
57
+ testId={`${testId}_confirmar`}
58
+ variant="danger"
59
+ onClick={onConfirm}
60
+ >
61
+ {confirm}
62
+ </Button>
63
+ )}
64
+ </ButtonContainer>
65
+ </DialogContainer>
66
+ </Overlay>
67
+ );
68
+ };
69
+
70
+ export default AlertDialog;
@@ -1,106 +1,107 @@
1
- // Dialog.styled.tsx
2
- import styled from "styled-components";
3
- import * as DialogPrimitive from "@radix-ui/react-dialog";
4
-
5
- /* ========================= */
6
- /* === Overlay Component === */
7
- /* ========================= */
8
- export const StyledDialogOverlay = styled(DialogPrimitive.Overlay)`
9
- position: fixed;
10
- inset: 0;
11
- z-index: 50;
12
- background-color: rgba(0, 0, 0, 0.8);
13
- /* Você pode definir animações adicionais aqui, caso deseje */
14
- `;
15
-
16
- /* ========================== */
17
- /* === Content Component === */
18
- /* ========================== */
19
- export const StyledDialogContent = styled(DialogPrimitive.Content)`
20
- position: fixed;
21
- left: 50%;
22
- top: 50%;
23
- z-index: 50;
24
- display: grid;
25
- width: 100%;
26
- max-width: 32rem; /* Equivalente a max-w-lg */
27
- transform: translate(-50%, -50%);
28
- gap: 1rem; /* gap-4 */
29
- border: 1px solid #e5e7eb;
30
- background-color: #fff; /* bg-background */
31
- padding: 1.5rem; /* p-6 */
32
- box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
33
- 0 4px 6px -2px rgba(0, 0, 0, 0.05);
34
- border-radius: 0.5rem; /* sm:rounded-lg */
35
- transition: all 0.2s ease;
36
- `;
37
-
38
- /* ============================ */
39
- /* === Close Button Component === */
40
- /* ============================ */
41
- export const StyledDialogClose = styled(DialogPrimitive.Close)`
42
- position: absolute;
43
- top: 1rem; /* top-4 */
44
- right: 1rem; /* right-4 */
45
- background: none;
46
- border: none;
47
- border-radius: 0.125rem; /* rounded-sm */
48
- opacity: 0.7;
49
- cursor: pointer;
50
- transition: opacity 0.2s ease;
51
-
52
- &:hover {
53
- opacity: 1;
54
- }
55
-
56
- &:focus {
57
- outline: none;
58
- box-shadow: 0 0 0 2px #3b82f6; /* focus:ring-2 focus:ring-ring */
59
- }
60
- `;
61
-
62
- /* ========================== */
63
- /* === Header Component === */
64
- /* ========================== */
65
- export const StyledDialogHeader = styled.div`
66
- display: flex;
67
- flex-direction: column;
68
- gap: 0.375rem; /* Aproximadamente space-y-1.5 */
69
- text-align: center;
70
-
71
- @media (min-width: 640px) {
72
- text-align: left;
73
- }
74
- `;
75
-
76
- /* ========================== */
77
- /* === Footer Component === */
78
- /* ========================== */
79
- export const StyledDialogFooter = styled.div`
80
- display: flex;
81
- flex-direction: column-reverse;
82
- justify-content: flex-end;
83
- gap: 0.5rem; /* Aproximadamente sm:space-x-2 */
84
-
85
- @media (min-width: 640px) {
86
- flex-direction: row;
87
- }
88
- `;
89
-
90
- /* =========================== */
91
- /* === Title Component === */
92
- /* =========================== */
93
- export const StyledDialogTitle = styled(DialogPrimitive.Title)`
94
- font-size: 1.125rem; /* text-lg */
95
- font-weight: 600; /* font-semibold */
96
- line-height: 1; /* leading-none */
97
- letter-spacing: -0.025em; /* tracking-tight */
98
- `;
99
-
100
- /* =============================== */
101
- /* === Description Component === */
102
- /* =============================== */
103
- export const StyledDialogDescription = styled(DialogPrimitive.Description)`
104
- font-size: 0.875rem; /* text-sm */
105
- color: #6b7280; /* text-muted-foreground */
106
- `;
1
+ // Dialog.styled.tsx
2
+ import styled from 'styled-components';
3
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
4
+
5
+ /* ========================= */
6
+ /* === Overlay Component === */
7
+ /* ========================= */
8
+ export const StyledDialogOverlay = styled(DialogPrimitive.Overlay)`
9
+ position: fixed;
10
+ inset: 0;
11
+ z-index: 50;
12
+ background-color: rgba(0, 0, 0, 0.8);
13
+ /* Você pode definir animações adicionais aqui, caso deseje */
14
+ `;
15
+
16
+ /* ========================== */
17
+ /* === Content Component === */
18
+ /* ========================== */
19
+ export const StyledDialogContent = styled(DialogPrimitive.Content)`
20
+ position: fixed;
21
+ left: 50%;
22
+ top: 50%;
23
+ z-index: 50;
24
+ display: grid;
25
+ width: 100%;
26
+ max-width: 32rem; /* Equivalente a max-w-lg */
27
+ transform: translate(-50%, -50%);
28
+ gap: 1rem; /* gap-4 */
29
+ border: 1px solid #e5e7eb;
30
+ background-color: #fff; /* bg-background */
31
+ padding: 1.5rem; /* p-6 */
32
+ box-shadow:
33
+ 0 10px 15px -3px rgba(0, 0, 0, 0.1),
34
+ 0 4px 6px -2px rgba(0, 0, 0, 0.05);
35
+ border-radius: 0.5rem; /* sm:rounded-lg */
36
+ transition: all 0.2s ease;
37
+ `;
38
+
39
+ /* ============================ */
40
+ /* === Close Button Component === */
41
+ /* ============================ */
42
+ export const StyledDialogClose = styled(DialogPrimitive.Close)`
43
+ position: absolute;
44
+ top: 1rem; /* top-4 */
45
+ right: 1rem; /* right-4 */
46
+ background: none;
47
+ border: none;
48
+ border-radius: 0.125rem; /* rounded-sm */
49
+ opacity: 0.7;
50
+ cursor: pointer;
51
+ transition: opacity 0.2s ease;
52
+
53
+ &:hover {
54
+ opacity: 1;
55
+ }
56
+
57
+ &:focus {
58
+ outline: none;
59
+ box-shadow: 0 0 0 2px #3b82f6; /* focus:ring-2 focus:ring-ring */
60
+ }
61
+ `;
62
+
63
+ /* ========================== */
64
+ /* === Header Component === */
65
+ /* ========================== */
66
+ export const StyledDialogHeader = styled.div`
67
+ display: flex;
68
+ flex-direction: column;
69
+ gap: 0.375rem; /* Aproximadamente space-y-1.5 */
70
+ text-align: center;
71
+
72
+ @media (min-width: 640px) {
73
+ text-align: left;
74
+ }
75
+ `;
76
+
77
+ /* ========================== */
78
+ /* === Footer Component === */
79
+ /* ========================== */
80
+ export const StyledDialogFooter = styled.div`
81
+ display: flex;
82
+ flex-direction: column-reverse;
83
+ justify-content: flex-end;
84
+ gap: 0.5rem; /* Aproximadamente sm:space-x-2 */
85
+
86
+ @media (min-width: 640px) {
87
+ flex-direction: row;
88
+ }
89
+ `;
90
+
91
+ /* =========================== */
92
+ /* === Title Component === */
93
+ /* =========================== */
94
+ export const StyledDialogTitle = styled(DialogPrimitive.Title)`
95
+ font-size: 1.125rem; /* text-lg */
96
+ font-weight: 600; /* font-semibold */
97
+ line-height: 1; /* leading-none */
98
+ letter-spacing: -0.025em; /* tracking-tight */
99
+ `;
100
+
101
+ /* =============================== */
102
+ /* === Description Component === */
103
+ /* =============================== */
104
+ export const StyledDialogDescription = styled(DialogPrimitive.Description)`
105
+ font-size: 0.875rem; /* text-sm */
106
+ color: #6b7280; /* text-muted-foreground */
107
+ `;