@granto-umbrella/umbrella-components 3.0.28 → 3.0.30
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/dist/umbrella-components.es.js +35845 -34808
- package/dist/umbrella-components.umd.js +1234 -971
- package/package.json +3 -2
- package/src/components/atoms/{Tapbar/Tapbar.tsx → TabBar/TabBar.tsx} +5 -5
- package/src/components/atoms/TabBar/index.tsx +2 -0
- package/src/components/molecules/InsuranceCard/InsuranceCard.styles.tsx +112 -49
- package/src/components/molecules/InsuranceCard/InsuranceCard.tsx +199 -161
- package/src/components/molecules/InsuranceCard/InsuranceCard.types.ts +12 -4
- package/src/index.ts +1 -1
- package/src/components/atoms/Tapbar/index.tsx +0 -2
- /package/src/components/atoms/{Tapbar/Tapbar.styles.tsx → TabBar/TabBar.styles.tsx} +0 -0
- /package/src/components/atoms/{Tapbar/Tapbar.types.ts → TabBar/TabBar.types.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@granto-umbrella/umbrella-components",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.30",
|
|
4
4
|
"description": "Umbrella Components for React",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -36,8 +36,10 @@
|
|
|
36
36
|
"@radix-ui/react-label": "^2.1.3",
|
|
37
37
|
"@radix-ui/react-popover": "^1.1.11",
|
|
38
38
|
"@radix-ui/react-radio-group": "^1.2.4",
|
|
39
|
+
"cpf-cnpj-validator": "^1.0.3",
|
|
39
40
|
"date-fns": "^4.1.0",
|
|
40
41
|
"lucide-react": "^0.488.0",
|
|
42
|
+
"make-mask": "^1.0.3",
|
|
41
43
|
"phosphor-react": "^1.4.1",
|
|
42
44
|
"radix": "^0.0.0",
|
|
43
45
|
"react": "^18.3.1",
|
|
@@ -76,7 +78,6 @@
|
|
|
76
78
|
"jest": "^29.7.0",
|
|
77
79
|
"jest-environment-jsdom": "^29.7.0",
|
|
78
80
|
"react-icons": "^5.4.0",
|
|
79
|
-
"storybook": "8.4.7",
|
|
80
81
|
"styled-components": "^6.1.19",
|
|
81
82
|
"ts-jest": "^29.2.5",
|
|
82
83
|
"typescript": "~5.6.2",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Count, Tab, Wrapper } from
|
|
3
|
-
import { TapbarProps } from
|
|
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 ===
|
|
20
|
+
{typeof item.quantity === 'number' && <Count>({item.quantity})</Count>}
|
|
21
21
|
</Tab>
|
|
22
22
|
))}
|
|
23
23
|
</Wrapper>
|
|
24
|
-
);
|
|
24
|
+
);
|
|
@@ -1,63 +1,121 @@
|
|
|
1
1
|
/* eslint-disable react-refresh/only-export-components */
|
|
2
|
-
import styled from
|
|
3
|
-
import {
|
|
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
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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:
|
|
32
|
-
padding:
|
|
51
|
+
gap: 8px;
|
|
52
|
+
padding: 16px;
|
|
33
53
|
border-top: 4px solid ${(props) => variantColors[props.$variant]};
|
|
34
|
-
border-radius:
|
|
35
|
-
background-color:
|
|
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:
|
|
61
|
+
gap: 24px;
|
|
42
62
|
`;
|
|
43
63
|
|
|
44
64
|
export const BodyRow = styled.div`
|
|
45
65
|
display: flex;
|
|
46
|
-
gap:
|
|
66
|
+
gap: 24px;
|
|
47
67
|
justify-content: space-between;
|
|
48
68
|
|
|
49
69
|
@media (max-width: 768px) {
|
|
50
70
|
flex-direction: column;
|
|
51
|
-
gap:
|
|
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:
|
|
73
|
-
margin-bottom:
|
|
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:
|
|
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:
|
|
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:
|
|
125
|
-
padding:
|
|
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:
|
|
187
|
+
border-radius: 4px;
|
|
130
188
|
background-color: ${semanticColors.branding.border.enabled};
|
|
131
|
-
color:
|
|
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:
|
|
148
|
-
border-radius:
|
|
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:
|
|
152
|
-
padding:
|
|
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:
|
|
167
|
-
padding:
|
|
230
|
+
gap: 8px;
|
|
231
|
+
padding: 8px 12px;
|
|
168
232
|
font-size: 0.875rem;
|
|
169
233
|
cursor: pointer;
|
|
170
|
-
|
|
171
234
|
&:hover {
|
|
172
|
-
background-color:
|
|
235
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
173
236
|
}
|
|
174
|
-
`;
|
|
237
|
+
`;
|