@granto-umbrella/umbrella-components 3.0.28 → 3.0.29

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@granto-umbrella/umbrella-components",
3
- "version": "3.0.28",
3
+ "version": "3.0.29",
4
4
  "description": "Umbrella Components for React",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -1,6 +1,6 @@
1
- import React from "react";
2
- import { Count, Tab, Wrapper } from "./Tapbar.styles";
3
- import { TapbarProps } from "./Tapbar.types";
1
+ import React from 'react';
2
+ import { Count, Tab, Wrapper } from './TabBar.styles';
3
+ import { TapbarProps } from './TabBar.types';
4
4
 
5
5
  export const Tapbar: React.FC<TapbarProps> = ({
6
6
  items,
@@ -17,8 +17,8 @@ export const Tapbar: React.FC<TapbarProps> = ({
17
17
  id={item.testId}
18
18
  >
19
19
  <span>{item.title}</span>
20
- {typeof item.quantity === "number" && <Count>({item.quantity})</Count>}
20
+ {typeof item.quantity === 'number' && <Count>({item.quantity})</Count>}
21
21
  </Tab>
22
22
  ))}
23
23
  </Wrapper>
24
- );
24
+ );
@@ -0,0 +1,2 @@
1
+ export { Tapbar } from './TabBar';
2
+ export type { TapbarProps, TabItem } from './TabBar.types';
@@ -1,63 +1,121 @@
1
1
  /* eslint-disable react-refresh/only-export-components */
2
- import styled from "styled-components";
3
- import { StatusVariant } from "./InsuranceCard.types";
4
- import {
5
- semanticColors,
6
- primitiveColors,
7
- semanticSizes,
8
- semanticRadius,
9
- } from "../../../styles/tokens";
10
-
11
- // Movendo os Records para o topo antes dos componentes
12
- export const variantColors: Record<StatusVariant, string> = {
13
- primary: semanticColors.info.border.feedback,
14
- success: semanticColors.global.border.feedback.success,
15
- warning: semanticColors.border.feedback,
16
- danger: semanticColors.global.border.feedback.error,
17
- };
2
+ import styled from 'styled-components';
3
+ import { semanticColors } from '@granto-umbrella/umbrella-components';
4
+ import { StatusVariant } from './InsuranceCard.types';
18
5
 
19
- export const variantColorsText: Record<StatusVariant, string> = {
20
- primary: semanticColors.global.text.onSurface.enabled,
21
- success: semanticColors.global.text.feedback.success,
22
- warning: semanticColors.global.text.feedback.warning,
23
- danger: semanticColors.global.text.feedback.error,
24
- };
6
+ export const PageContainer = styled.div`
7
+ display: flex;
8
+ flex-direction: column;
9
+ gap: 16px;
10
+ max-width: 600px;
11
+ margin: 0 auto;
12
+ padding: 24px;
13
+ `;
14
+
15
+ export const Title = styled.h2`
16
+ font-size: 1.25rem;
17
+ font-weight: 600;
18
+ color: #2d3748;
19
+ `;
20
+
21
+ export const TabBar = styled.div`
22
+ display: flex;
23
+ gap: 12px;
24
+ `;
25
+
26
+ export const Tab = styled.button<{ active?: boolean }>`
27
+ padding: 8px 16px;
28
+ font-size: 0.875rem;
29
+ font-weight: 600;
30
+ border: none;
31
+ border-bottom: 2px solid transparent;
32
+ background: none;
33
+ cursor: pointer;
34
+ color: ${(props) =>
35
+ props.active ? semanticColors.branding.surface.enabled : '#718096'};
36
+ border-color: ${(props) =>
37
+ props.active ? semanticColors.branding.border.enabled : 'transparent'};
38
+ `;
39
+
40
+ export const ListContainer = styled.div`
41
+ display: flex;
42
+ flex-direction: column;
43
+ gap: 12px;
44
+ `;
25
45
 
26
46
  export const CardContainer = styled.div<{ $variant: StatusVariant }>`
27
47
  display: flex;
28
48
  flex-direction: column;
29
49
  justify-content: space-between;
30
50
  width: 100%;
31
- gap: ${semanticSizes.global.gap.sm};
32
- padding: ${semanticSizes.global.padding.lg};
51
+ gap: 8px;
52
+ padding: 16px;
33
53
  border-top: 4px solid ${(props) => variantColors[props.$variant]};
34
- border-radius: ${semanticRadius.global.radius.md2};
35
- background-color: ${semanticColors.global.surface.default};
54
+ border-radius: 8px;
55
+ background-color: #fff;
36
56
  `;
37
57
 
38
58
  export const HeaderRow = styled.div`
39
59
  display: flex;
40
60
  align-items: center;
41
- gap: ${semanticSizes.global.gap.xl};
61
+ gap: 24px;
42
62
  `;
43
63
 
44
64
  export const BodyRow = styled.div`
45
65
  display: flex;
46
- gap: ${semanticSizes.global.gap.xl};
66
+ gap: 24px;
47
67
  justify-content: space-between;
48
68
 
49
69
  @media (max-width: 768px) {
50
70
  flex-direction: column;
51
- gap: ${semanticSizes.global.gap.lg};
71
+ gap: 16px;
52
72
  }
53
73
  `;
54
74
 
75
+ export const variantColors: Record<StatusVariant, string> = {
76
+ primary: semanticColors.global.border.feedback.info,
77
+ success: semanticColors.global.border.feedback.success,
78
+ warning: semanticColors.global.border.feedback.warning,
79
+ danger: semanticColors.global.border.feedback.error,
80
+ };
81
+
82
+ export const variantColorsText: Record<StatusVariant, string> = {
83
+ primary: semanticColors.global.text.onSurface.enabled,
84
+ success: semanticColors.global.text.feedback.success,
85
+ warning: semanticColors.global.text.feedback.warning,
86
+ danger: semanticColors.global.text.feedback.error,
87
+ };
88
+
55
89
  export const Text = styled.span<{ $variant?: StatusVariant }>`
56
90
  font-size: 10px;
57
91
  color: ${(props) =>
58
92
  props.$variant ? variantColors[props.$variant] : variantColorsText.primary};
59
93
  `;
60
94
 
95
+ export const StatusBadge = styled.span<{ $variant: StatusVariant }>`
96
+ padding: 4px 8px;
97
+ font-size: 0.75rem;
98
+ font-weight: 600;
99
+ border-radius: 4px;
100
+ color: #fff;
101
+ background-color: ${(props) => variantColors[props.$variant]};
102
+ `;
103
+ export const InfoGroup = styled.div`
104
+ display: grid;
105
+ grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
106
+ gap: 32px;
107
+ align-items: start;
108
+ width: 100%;
109
+ @media (max-width: 1200px) {
110
+ gap: 24px;
111
+ }
112
+
113
+ @media (max-width: 768px) {
114
+ grid-template-columns: 1fr;
115
+ gap: 16px;
116
+ }
117
+ `;
118
+
61
119
  export const InfoRow = styled.div`
62
120
  display: flex;
63
121
  width: 100%;
@@ -69,14 +127,14 @@ export const InfoRow = styled.div`
69
127
 
70
128
  export const InfoLabel = styled.span`
71
129
  font-size: 12px;
72
- color: ${primitiveColors.gray[600]};
73
- margin-bottom: ${semanticSizes.global.gap.md};
130
+ color: #4a5568;
131
+ margin-bottom: 12px;
74
132
  `;
75
133
 
76
134
  export const InfoValue = styled.span`
77
135
  font-size: 14px;
78
136
  font-weight: 900;
79
- color: ${primitiveColors.gray[900]};
137
+ color: #2d3748;
80
138
  `;
81
139
 
82
140
  export const TruncatedValue = styled(InfoValue)`
@@ -102,7 +160,7 @@ export const ProcessValue = styled(InfoValue)`
102
160
 
103
161
  export const InfoSubValue = styled.span`
104
162
  font-size: 12px;
105
- color: ${primitiveColors.gray[900]};
163
+ color: #2d3748;
106
164
  line-height: 1.4;
107
165
  `;
108
166
 
@@ -121,14 +179,14 @@ export const ActionButton = styled.button`
121
179
  min-width: 170px;
122
180
  max-width: 100%;
123
181
  align-items: center;
124
- gap: ${semanticSizes.global.gap.sm};
125
- padding: ${semanticSizes.global.padding.sm} ${semanticSizes.global.padding.md};
182
+ gap: 0.5rem;
183
+ padding: 8px 12px;
126
184
  font-size: 0.875rem;
127
185
  font-weight: 600;
128
186
  border: none;
129
- border-radius: ${semanticRadius.global.radius.md};
187
+ border-radius: 4px;
130
188
  background-color: ${semanticColors.branding.border.enabled};
131
- color: ${primitiveColors.base.white};
189
+ color: #fff;
132
190
  cursor: pointer;
133
191
  transition: opacity 0.2s;
134
192
 
@@ -144,31 +202,36 @@ export const ActionButton = styled.button`
144
202
  export const DropdownMenu = styled.div`
145
203
  position: absolute;
146
204
  right: 0;
147
- background-color: ${semanticColors.global.surface.default};
148
- border-radius: ${semanticRadius.global.radius.md};
205
+ background-color: #fff;
206
+ border-radius: 4px;
149
207
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
150
208
  display: grid;
151
- gap: ${semanticSizes.global.gap.xs};
152
- padding: ${semanticSizes.global.padding.sm} 0;
209
+ gap: 4px;
210
+ padding: 8px 0;
153
211
  width: 100%;
154
212
  z-index: 10;
155
213
  `;
156
214
 
215
+ export interface MenuItemProps {
216
+ icon: React.ReactNode;
217
+ danger?: boolean;
218
+ children: React.ReactNode;
219
+ onClick?: () => void;
220
+ id?: string;
221
+ }
222
+
157
223
  export const StyledMenuItem = styled.div<{ $danger?: boolean }>`
158
224
  color: ${(props) =>
159
- props.$danger
160
- ? semanticColors.danger.text.enabled
161
- : primitiveColors.gray[900]};
225
+ props.$danger ? semanticColors.danger.text.enabled : '#2d3748'};
162
226
  display: inline-grid;
163
227
  grid-auto-flow: column;
164
228
  align-items: center;
165
229
  justify-content: flex-start;
166
- gap: ${semanticSizes.global.gap.sm};
167
- padding: ${semanticSizes.global.padding.sm} ${semanticSizes.global.padding.md};
230
+ gap: 8px;
231
+ padding: 8px 12px;
168
232
  font-size: 0.875rem;
169
233
  cursor: pointer;
170
-
171
234
  &:hover {
172
- background-color: ${primitiveColors.gray[100]};
235
+ background-color: rgba(0, 0, 0, 0.05);
173
236
  }
174
- `;
237
+ `;