@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,139 +1,139 @@
1
- import styled from "styled-components"
2
- import * as Dialog from "@radix-ui/react-dialog"
3
-
4
- export const Overlay = styled(Dialog.Overlay)`
5
- position: fixed;
6
- inset: 0;
7
- background-color: rgba(0, 0, 0, 0.6);
8
- z-index: 50;
9
- `
10
-
11
- export const Content = styled(Dialog.Content)`
12
- position: fixed;
13
- top: 50%;
14
- left: 50%;
15
- transform: translate(-50%, -50%);
16
- font-family: "Mulish", sans-serif;
17
- background: white;
18
- border-radius: 12px;
19
- padding: 32px;
20
- width: 100%;
21
- max-width: 520px;
22
- z-index: 1000;
23
- box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
24
- border-top: 6px solid #c53030;
25
- `
26
-
27
- export const Title = styled.h2`
28
- font-size: 28px;
29
- font-weight: 600;
30
- color: #1a1a1a;
31
- margin-bottom: 8px;
32
- font-family: "Mulish", sans-serif;
33
- padding-right: 12px;
34
- `
35
-
36
- export const Description = styled.p`
37
- font-size: 1rem;
38
- line-height: 1.5;
39
- color: #888;
40
- margin-bottom: 16px;
41
- font-family: "Mulish", sans-serif;
42
-
43
- span {
44
- cursor: pointer;
45
- color: #1a1a1a;
46
- }
47
-
48
- strong {
49
- font-weight: 600;
50
- color: #1a1a1a;
51
- }
52
- `
53
-
54
- export const Label = styled.label`
55
- font-size: 1rem;
56
- margin-top: 16px;
57
- margin-bottom: 4px;
58
- display: block;
59
- color: #888;
60
- font-family: "Mulish", sans-serif;
61
- `
62
-
63
- export const Select = styled.select`
64
- width: 100%;
65
- color: #777;
66
- padding: 12px;
67
- font-size: 1rem;
68
- border: 1px solid #d9d9d9;
69
- border-radius: 8px;
70
- background-color: white;
71
- appearance: none;
72
- background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 20 20' fill='none' stroke='gray' strokeWidth='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
73
- background-repeat: no-repeat;
74
- background-position: right 12px center;
75
- background-size: 16px;
76
- cursor: pointer;
77
- `
78
-
79
- export const TextArea = styled.textarea`
80
- width: 100%;
81
- min-height: 80px;
82
- padding: 12px;
83
- font-size: 14px;
84
- border: 1px solid #d9d9d9;
85
- border-radius: 8px;
86
- resize: none;
87
- margin-top: 8px;
88
- `
89
-
90
- export const HelpText = styled.p`
91
- font-size: 0.9rem;
92
- color: #888;
93
- margin-top: 4px;
94
- `
95
-
96
- export const CancelButton = styled(Dialog.Close)`
97
- background: #fff;
98
- border: 2px solid #7f7f7f;
99
- border-radius: 8px;
100
- padding: 10px 16px;
101
- font-weight: 600;
102
- color: #7f7f7f;
103
- cursor: pointer;
104
- `
105
-
106
- export const ConfirmButton = styled.button`
107
- background: #c53030;
108
- color: white;
109
- border: none;
110
- border-radius: 8px;
111
- padding: 10px 16px;
112
- font-weight: 600;
113
- cursor: pointer;
114
-
115
- &:disabled {
116
- background: #e2e2e2;
117
- cursor: not-allowed;
118
- }
119
- `
120
-
121
- export const CloseIcon = styled(Dialog.Close)`
122
- position: absolute;
123
- top: 32px;
124
- right: 32px;
125
- background: transparent;
126
- border: none;
127
- cursor: pointer;
128
-
129
- svg {
130
- color: #888;
131
- }
132
- `
133
-
134
- export const Footer = styled.div`
135
- display: flex;
136
- justify-content: flex-end;
137
- gap: 12px;
138
- margin-top: 24px;
139
- `
1
+ import styled from 'styled-components';
2
+ import * as Dialog from '@radix-ui/react-dialog';
3
+
4
+ export const Overlay = styled(Dialog.Overlay)`
5
+ position: fixed;
6
+ inset: 0;
7
+ background-color: rgba(0, 0, 0, 0.6);
8
+ z-index: 50;
9
+ `;
10
+
11
+ export const Content = styled(Dialog.Content)`
12
+ position: fixed;
13
+ top: 50%;
14
+ left: 50%;
15
+ transform: translate(-50%, -50%);
16
+ font-family: 'Mulish', sans-serif;
17
+ background: white;
18
+ border-radius: 12px;
19
+ padding: 32px;
20
+ width: 100%;
21
+ max-width: 520px;
22
+ z-index: 1000;
23
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
24
+ border-top: 6px solid #c53030;
25
+ `;
26
+
27
+ export const Title = styled.h2`
28
+ font-size: 28px;
29
+ font-weight: 600;
30
+ color: #1a1a1a;
31
+ margin-bottom: 8px;
32
+ font-family: 'Mulish', sans-serif;
33
+ padding-right: 12px;
34
+ `;
35
+
36
+ export const Description = styled.p`
37
+ font-size: 1rem;
38
+ line-height: 1.5;
39
+ color: #888;
40
+ margin-bottom: 16px;
41
+ font-family: 'Mulish', sans-serif;
42
+
43
+ span {
44
+ cursor: pointer;
45
+ color: #1a1a1a;
46
+ }
47
+
48
+ strong {
49
+ font-weight: 600;
50
+ color: #1a1a1a;
51
+ }
52
+ `;
53
+
54
+ export const Label = styled.label`
55
+ font-size: 1rem;
56
+ margin-top: 16px;
57
+ margin-bottom: 4px;
58
+ display: block;
59
+ color: #888;
60
+ font-family: 'Mulish', sans-serif;
61
+ `;
62
+
63
+ export const Select = styled.select`
64
+ width: 100%;
65
+ color: #777;
66
+ padding: 12px;
67
+ font-size: 1rem;
68
+ border: 1px solid #d9d9d9;
69
+ border-radius: 8px;
70
+ background-color: white;
71
+ appearance: none;
72
+ background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 20 20' fill='none' stroke='gray' strokeWidth='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
73
+ background-repeat: no-repeat;
74
+ background-position: right 12px center;
75
+ background-size: 16px;
76
+ cursor: pointer;
77
+ `;
78
+
79
+ export const TextArea = styled.textarea`
80
+ width: 100%;
81
+ min-height: 80px;
82
+ padding: 12px;
83
+ font-size: 14px;
84
+ border: 1px solid #d9d9d9;
85
+ border-radius: 8px;
86
+ resize: none;
87
+ margin-top: 8px;
88
+ `;
89
+
90
+ export const HelpText = styled.p`
91
+ font-size: 0.9rem;
92
+ color: #888;
93
+ margin-top: 4px;
94
+ `;
95
+
96
+ export const CancelButton = styled(Dialog.Close)`
97
+ background: #fff;
98
+ border: 2px solid #7f7f7f;
99
+ border-radius: 8px;
100
+ padding: 10px 16px;
101
+ font-weight: 600;
102
+ color: #7f7f7f;
103
+ cursor: pointer;
104
+ `;
105
+
106
+ export const ConfirmButton = styled.button`
107
+ background: #c53030;
108
+ color: white;
109
+ border: none;
110
+ border-radius: 8px;
111
+ padding: 10px 16px;
112
+ font-weight: 600;
113
+ cursor: pointer;
114
+
115
+ &:disabled {
116
+ background: #e2e2e2;
117
+ cursor: not-allowed;
118
+ }
119
+ `;
120
+
121
+ export const CloseIcon = styled(Dialog.Close)`
122
+ position: absolute;
123
+ top: 32px;
124
+ right: 32px;
125
+ background: transparent;
126
+ border: none;
127
+ cursor: pointer;
128
+
129
+ svg {
130
+ color: #888;
131
+ }
132
+ `;
133
+
134
+ export const Footer = styled.div`
135
+ display: flex;
136
+ justify-content: flex-end;
137
+ gap: 12px;
138
+ margin-top: 24px;
139
+ `;
@@ -1,76 +1,92 @@
1
- "use client"
2
-
3
- import * as Dialog from "@radix-ui/react-dialog"
4
- import { X } from "lucide-react"
5
- import { useState } from "react"
6
- import {
7
- CancelButton,
8
- CloseIcon,
9
- ConfirmButton,
10
- Content,
11
- Description,
12
- Footer,
13
- HelpText,
14
- Label,
15
- Overlay,
16
- Select,
17
- TextArea,
18
- Title,
19
- } from "./RefuseModal.styles"
20
- import { type RefuseModalProps, motivos } from "./RefuseModal.types"
21
-
22
- export const RefuseModal = ({ open, onOpenChange, onConfirm, onClose, orderId }: RefuseModalProps) => {
23
- const [motivo, setMotivo] = useState("")
24
- const [detalhes, setDetalhes] = useState("")
25
-
26
- const handleConfirm = () => {
27
- console.log("Proposta recusada:", { orderId, motivo, detalhes })
28
- onConfirm()
29
- onClose()
30
- setMotivo("")
31
- setDetalhes("")
32
- }
33
-
34
- return (
35
- <Dialog.Root open={open} onOpenChange={onOpenChange}>
36
- <Dialog.Portal>
37
- <Overlay />
38
- <Content>
39
- <CloseIcon aria-label="Fechar" onClick={onClose}>
40
- <X size={28} color="#BDBDBD" />
41
- </CloseIcon>
42
-
43
- <Title>Tem certeza de que deseja recusar esta proposta?</Title>
44
-
45
- <Description>
46
- Após recusar, você pode voltar e continuar de onde parou acessando{" "}
47
- <span onClick={() => onClose()}>Minhas apólices</span>.<br />
48
- <strong>Nota:</strong> pode ser que as condições oferecidas sejam diferentes das atuais.
49
- </Description>
50
-
51
- <Label>Nos ajude a entender o motivo da recusa:</Label>
52
- <Select value={motivo} onChange={(e) => setMotivo(e.target.value)}>
53
- <option value="">Selecione o motivo</option>
54
- {motivos.map((item) => (
55
- <option key={item} value={item}>
56
- {item}
57
- </option>
58
- ))}
59
- </Select>
60
- <HelpText>Sua resposta ajuda a melhorar nosso processo para você e outros usuários.</HelpText>
61
-
62
- <Label>Se quiser, conte mais detalhes</Label>
63
- <TextArea placeholder="Escreva aqui..." value={detalhes} onChange={(e) => setDetalhes(e.target.value)} />
64
- <HelpText>Essas informações nos ajudam a melhorar sua experiência.</HelpText>
65
-
66
- <Footer>
67
- <CancelButton onClick={onClose}>Cancelar</CancelButton>
68
- <ConfirmButton onClick={handleConfirm} disabled={!motivo}>
69
- Sim, recusar
70
- </ConfirmButton>
71
- </Footer>
72
- </Content>
73
- </Dialog.Portal>
74
- </Dialog.Root>
75
- )
76
- }
1
+ 'use client';
2
+
3
+ import * as Dialog from '@radix-ui/react-dialog';
4
+ import { X } from 'lucide-react';
5
+ import { useState } from 'react';
6
+ import {
7
+ CancelButton,
8
+ CloseIcon,
9
+ ConfirmButton,
10
+ Content,
11
+ Description,
12
+ Footer,
13
+ HelpText,
14
+ Label,
15
+ Overlay,
16
+ Select,
17
+ TextArea,
18
+ Title,
19
+ } from './RefuseModal.styles';
20
+ import { type RefuseModalProps, motivos } from './RefuseModal.types';
21
+
22
+ export const RefuseModal = ({
23
+ open,
24
+ onOpenChange,
25
+ onConfirm,
26
+ onClose,
27
+ orderId,
28
+ }: RefuseModalProps) => {
29
+ const [motivo, setMotivo] = useState('');
30
+ const [detalhes, setDetalhes] = useState('');
31
+
32
+ const handleConfirm = () => {
33
+ console.log('Proposta recusada:', { orderId, motivo, detalhes });
34
+ onConfirm();
35
+ onClose();
36
+ setMotivo('');
37
+ setDetalhes('');
38
+ };
39
+
40
+ return (
41
+ <Dialog.Root open={open} onOpenChange={onOpenChange}>
42
+ <Dialog.Portal>
43
+ <Overlay />
44
+ <Content>
45
+ <CloseIcon aria-label="Fechar" onClick={onClose}>
46
+ <X size={28} color="#BDBDBD" />
47
+ </CloseIcon>
48
+
49
+ <Title>Tem certeza de que deseja recusar esta proposta?</Title>
50
+
51
+ <Description>
52
+ Após recusar, você pode voltar e continuar de onde parou acessando{' '}
53
+ <span onClick={() => onClose()}>Minhas apólices</span>.<br />
54
+ <strong>Nota:</strong> pode ser que as condições oferecidas sejam
55
+ diferentes das atuais.
56
+ </Description>
57
+
58
+ <Label>Nos ajude a entender o motivo da recusa:</Label>
59
+ <Select value={motivo} onChange={(e) => setMotivo(e.target.value)}>
60
+ <option value="">Selecione o motivo</option>
61
+ {motivos.map((item) => (
62
+ <option key={item} value={item}>
63
+ {item}
64
+ </option>
65
+ ))}
66
+ </Select>
67
+ <HelpText>
68
+ Sua resposta ajuda a melhorar nosso processo para você e outros
69
+ usuários.
70
+ </HelpText>
71
+
72
+ <Label>Se quiser, conte mais detalhes</Label>
73
+ <TextArea
74
+ placeholder="Escreva aqui..."
75
+ value={detalhes}
76
+ onChange={(e) => setDetalhes(e.target.value)}
77
+ />
78
+ <HelpText>
79
+ Essas informações nos ajudam a melhorar sua experiência.
80
+ </HelpText>
81
+
82
+ <Footer>
83
+ <CancelButton onClick={onClose}>Cancelar</CancelButton>
84
+ <ConfirmButton onClick={handleConfirm} disabled={!motivo}>
85
+ Sim, recusar
86
+ </ConfirmButton>
87
+ </Footer>
88
+ </Content>
89
+ </Dialog.Portal>
90
+ </Dialog.Root>
91
+ );
92
+ };
@@ -1,15 +1,15 @@
1
- export interface RefuseModalProps {
2
- open: boolean
3
- onOpenChange: (open: boolean) => void
4
- onClose: () => void
5
- onConfirm: () => void
6
- orderId: string
7
- }
8
-
9
- export const motivos = [
10
- "Preço muito alto",
11
- "Encontrei uma opção melhor",
12
- "Não preciso mais do serviço",
13
- "Condições não atendem minhas necessidades",
14
- "Outro motivo",
15
- ]
1
+ export interface RefuseModalProps {
2
+ open: boolean;
3
+ onOpenChange: (open: boolean) => void;
4
+ onClose: () => void;
5
+ onConfirm: () => void;
6
+ orderId: string;
7
+ }
8
+
9
+ export const motivos = [
10
+ 'Preço muito alto',
11
+ 'Encontrei uma opção melhor',
12
+ 'Não preciso mais do serviço',
13
+ 'Condições não atendem minhas necessidades',
14
+ 'Outro motivo',
15
+ ];
@@ -1,2 +1,2 @@
1
- export { RefuseModal } from "./RefuseModal"
2
- export type { RefuseModalProps } from "./RefuseModal.types"
1
+ export { RefuseModal } from './RefuseModal';
2
+ export type { RefuseModalProps } from './RefuseModal.types';
@@ -1,19 +1,23 @@
1
- import { TrendingDown, TrendingUp } from 'lucide-react'
2
- import { Results } from "./ResultsChart.styles"
3
- import type { ResultsChartProps } from "./ResultsChart.types"
4
-
5
- const ResultsChart = ({ value }: ResultsChartProps) => {
6
- const isPositive = value >= 0
7
- const trendIcon = isPositive ? <TrendingUp size={16} /> : <TrendingDown size={16} />
8
- const trendText = isPositive
9
- ? `${value}% a mais do que o mês anterior`
10
- : `${Math.abs(value)}% a menos do que o mês anterior`
11
-
12
- return (
13
- <Results $isPositive={isPositive}>
14
- {trendIcon} {trendText}
15
- </Results>
16
- )
17
- }
18
-
19
- export default ResultsChart
1
+ import { TrendingDown, TrendingUp } from 'lucide-react';
2
+ import { Results } from './ResultsChart.styles';
3
+ import type { ResultsChartProps } from './ResultsChart.types';
4
+
5
+ const ResultsChart = ({ value }: ResultsChartProps) => {
6
+ const isPositive = value >= 0;
7
+ const trendIcon = isPositive ? (
8
+ <TrendingUp size={16} />
9
+ ) : (
10
+ <TrendingDown size={16} />
11
+ );
12
+ const trendText = isPositive
13
+ ? `${value}% a mais do que o mês anterior`
14
+ : `${Math.abs(value)}% a menos do que o mês anterior`;
15
+
16
+ return (
17
+ <Results $isPositive={isPositive}>
18
+ {trendIcon} {trendText}
19
+ </Results>
20
+ );
21
+ };
22
+
23
+ export default ResultsChart;
@@ -1,3 +1,3 @@
1
- export interface ResultsChartProps {
2
- value: number
3
- }
1
+ export interface ResultsChartProps {
2
+ value: number;
3
+ }
@@ -1,2 +1,2 @@
1
- export { default } from "./ResultsChart"
2
- export type { ResultsChartProps } from "./ResultsChart.types"
1
+ export { default } from './ResultsChart';
2
+ export type { ResultsChartProps } from './ResultsChart.types';
@@ -1,54 +1,54 @@
1
- import {
2
- semanticColors,
3
- semanticRadius,
4
- semanticSizes,
5
- typographyTokens,
6
- } from "../../../styles/tokens";
7
- import styled from "styled-components";
8
-
9
- export const ToggleContainer = styled.div`
10
- position: relative;
11
- display: inline-flex;
12
- background: transparent;
13
- border-radius: ${semanticRadius.global.radius.md2};
14
- padding: ${semanticSizes.global.padding.xs};
15
- white-space: nowrap;
16
- `;
17
-
18
- export const Slider = styled.div<{
19
- activeIndex: number;
20
- count: number;
21
- }>`
22
- position: absolute;
23
- top: ${semanticSizes.global.padding.xs};
24
- left: ${({ activeIndex, count }) => (activeIndex * 100) / count}%;
25
- width: ${({ count }) => 100 / count}%;
26
- height: calc(100% - ${semanticSizes.global.padding.xs} * 2);
27
- background: ${semanticColors.base.background};
28
- border-radius: ${semanticRadius.global.radius.md2};
29
- transition: left 200ms ease-in-out;
30
- z-index: 0;
31
- `;
32
-
33
- export const TabButton = styled.button<{ active: boolean }>`
34
- position: relative;
35
- z-index: 1;
36
- display: flex;
37
- width: 230px;
38
- justify-content: center;
39
- align-items: center;
40
- padding: ${semanticSizes.global.padding.sm} ${semanticSizes.global.gap["3xl"]};
41
- font-size: ${typographyTokens.fontSizes.bodyS};
42
- color: ${({ active }) =>
43
- active ? semanticColors.base.text : semanticColors.neutral[400]};
44
- background: none;
45
- border: none;
46
- cursor: pointer;
47
- transition: color 200ms;
48
-
49
- white-space: nowrap;
50
-
51
- &:focus {
52
- outline: none;
53
- }
54
- `;
1
+ import {
2
+ semanticColors,
3
+ semanticRadius,
4
+ semanticSizes,
5
+ typographyTokens,
6
+ } from '../../../styles/tokens';
7
+ import styled from 'styled-components';
8
+
9
+ export const ToggleContainer = styled.div`
10
+ position: relative;
11
+ display: inline-flex;
12
+ background: transparent;
13
+ border-radius: ${semanticRadius.global.radius.md2};
14
+ padding: ${semanticSizes.global.padding.xs};
15
+ white-space: nowrap;
16
+ `;
17
+
18
+ export const Slider = styled.div<{
19
+ activeIndex: number;
20
+ count: number;
21
+ }>`
22
+ position: absolute;
23
+ top: ${semanticSizes.global.padding.xs};
24
+ left: ${({ activeIndex, count }) => (activeIndex * 100) / count}%;
25
+ width: ${({ count }) => 100 / count}%;
26
+ height: calc(100% - ${semanticSizes.global.padding.xs} * 2);
27
+ background: ${semanticColors.base.background};
28
+ border-radius: ${semanticRadius.global.radius.md2};
29
+ transition: left 200ms ease-in-out;
30
+ z-index: 0;
31
+ `;
32
+
33
+ export const TabButton = styled.button<{ active: boolean }>`
34
+ position: relative;
35
+ z-index: 1;
36
+ display: flex;
37
+ width: 230px;
38
+ justify-content: center;
39
+ align-items: center;
40
+ padding: ${semanticSizes.global.padding.sm} ${semanticSizes.global.gap['3xl']};
41
+ font-size: ${typographyTokens.fontSizes.bodyS};
42
+ color: ${({ active }) =>
43
+ active ? semanticColors.base.text : semanticColors.neutral[400]};
44
+ background: none;
45
+ border: none;
46
+ cursor: pointer;
47
+ transition: color 200ms;
48
+
49
+ white-space: nowrap;
50
+
51
+ &:focus {
52
+ outline: none;
53
+ }
54
+ `;