@granto-umbrella/umbrella-components 3.0.5 → 3.0.7
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 +477 -477
- package/dist/umbrella-components.umd.js +272 -272
- package/package.json +1 -1
- package/src/components/molecules/TimeLine/TimeLine.mapper.ts +7 -6
- package/src/components/molecules/TimeLine/TimeLine.styles.ts +20 -20
- package/src/components/molecules/TimeLine/TimeLine.types.ts +3 -2
- package/src/lib/helpers.ts +0 -17
package/package.json
CHANGED
|
@@ -4,7 +4,9 @@ import { TimelineItem, TimelineVariant, RemoteEvent } from './TimeLine.types';
|
|
|
4
4
|
function toVariant(eventType: string): TimelineVariant {
|
|
5
5
|
if (eventType === 'subscription:partner_subscribe') return 'accepted';
|
|
6
6
|
if (eventType === 'subscription:partner_quote') return 'continued';
|
|
7
|
-
return '
|
|
7
|
+
if (eventType === 'order:proposal_refused') return 'rejected';
|
|
8
|
+
if (eventType === 'issue:partner_issue') return 'issue';
|
|
9
|
+
return 'continued';
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
function buildTitle(ev: RemoteEvent): string {
|
|
@@ -14,8 +16,7 @@ function buildTitle(ev: RemoteEvent): string {
|
|
|
14
16
|
return 'Subscrição realizada';
|
|
15
17
|
if (eventType === 'subscription:partner_quote') return 'Cotação processada';
|
|
16
18
|
if (eventType === 'order:proposal_refused') return 'Proposta recusada';
|
|
17
|
-
|
|
18
|
-
// Fallback genérico
|
|
19
|
+
if (eventType === 'issue:partner_issue') return 'Emissão realizada';
|
|
19
20
|
return data?.title ? String(data.title) : eventType;
|
|
20
21
|
}
|
|
21
22
|
|
|
@@ -27,9 +28,9 @@ export function mapRemoteToTimeline(items: RemoteEvent[]): TimelineItem[] {
|
|
|
27
28
|
return {
|
|
28
29
|
id,
|
|
29
30
|
timestamp: ev.startAt,
|
|
30
|
-
type: toVariant(ev.eventType),
|
|
31
|
-
title: buildTitle(ev),
|
|
32
|
-
description: undefined,
|
|
31
|
+
type: toVariant(ev.eventType),
|
|
32
|
+
title: buildTitle(ev),
|
|
33
|
+
description: undefined,
|
|
33
34
|
actor: {
|
|
34
35
|
id: String(ev.actor?.id ?? ''),
|
|
35
36
|
displayName: actorName,
|
|
@@ -24,11 +24,11 @@ export const ItemWrap = styled.li`
|
|
|
24
24
|
content: '';
|
|
25
25
|
position: absolute;
|
|
26
26
|
left: 11px;
|
|
27
|
-
top:
|
|
27
|
+
top: 34px;
|
|
28
28
|
bottom: 0;
|
|
29
29
|
width: 2px;
|
|
30
30
|
height: 100%;
|
|
31
|
-
background-color: ${primitiveColors.gray[
|
|
31
|
+
background-color: ${primitiveColors.gray[200]};
|
|
32
32
|
}
|
|
33
33
|
`;
|
|
34
34
|
|
|
@@ -41,46 +41,46 @@ export const Dot = styled.span<{
|
|
|
41
41
|
border: 1px solid;
|
|
42
42
|
display: inline-block;
|
|
43
43
|
margin-top: 0.2rem;
|
|
44
|
-
${({ $variant = '
|
|
44
|
+
${({ $variant = 'continued' }) => {
|
|
45
45
|
const map: Record<TimelineVariant, ReturnType<typeof css>> = {
|
|
46
|
-
|
|
46
|
+
continued: css`
|
|
47
47
|
background: ${semanticColors.branding.surface.disabled};
|
|
48
48
|
`,
|
|
49
49
|
accepted: css`
|
|
50
|
-
background:
|
|
51
|
-
`,
|
|
52
|
-
continued: css`
|
|
53
|
-
background: #f59e0b;
|
|
50
|
+
background: ${semanticColors.global.surface.status.online};
|
|
54
51
|
`,
|
|
55
52
|
rejected: css`
|
|
56
|
-
background:
|
|
53
|
+
background: ${semanticColors.global.surface.status.notification};
|
|
57
54
|
`,
|
|
58
55
|
download: css`
|
|
59
|
-
background:
|
|
56
|
+
background: ${semanticColors.branding.surface.disabled};
|
|
57
|
+
`,
|
|
58
|
+
issue: css`
|
|
59
|
+
background: ${semanticColors.global.surface.status.online};
|
|
60
60
|
`,
|
|
61
61
|
};
|
|
62
|
-
return map[$variant as TimelineVariant] ?? map['
|
|
62
|
+
return map[$variant as TimelineVariant] ?? map['continued'];
|
|
63
63
|
}}
|
|
64
64
|
|
|
65
|
-
${({ $variant = '
|
|
65
|
+
${({ $variant = 'continued' }) => {
|
|
66
66
|
const map: Record<TimelineVariant, ReturnType<typeof css>> = {
|
|
67
|
-
|
|
67
|
+
continued: css`
|
|
68
68
|
border-color: ${semanticColors.branding.surface.enabled};
|
|
69
69
|
`,
|
|
70
70
|
accepted: css`
|
|
71
|
-
border-color:
|
|
72
|
-
`,
|
|
73
|
-
continued: css`
|
|
74
|
-
border-color: #f59e0b;
|
|
71
|
+
border-color: ${semanticColors.global.border.feedback.success};
|
|
75
72
|
`,
|
|
76
73
|
rejected: css`
|
|
77
|
-
border-color:
|
|
74
|
+
border-color: ${semanticColors.global.border.feedback.error};
|
|
78
75
|
`,
|
|
79
76
|
download: css`
|
|
80
|
-
border-color:
|
|
77
|
+
border-color: ${semanticColors.branding.surface.enabled};
|
|
78
|
+
`,
|
|
79
|
+
issue: css`
|
|
80
|
+
border-color: ${semanticColors.global.border.feedback.success};
|
|
81
81
|
`,
|
|
82
82
|
};
|
|
83
|
-
return map[$variant as TimelineVariant] ?? map['
|
|
83
|
+
return map[$variant as TimelineVariant] ?? map['continued'];
|
|
84
84
|
}}
|
|
85
85
|
`;
|
|
86
86
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
export type TimelineVariant =
|
|
3
|
-
| 'StatusChanged'
|
|
4
3
|
| 'accepted'
|
|
5
4
|
| 'continued'
|
|
6
5
|
| 'rejected'
|
|
7
|
-
| 'download'
|
|
6
|
+
| 'download'
|
|
7
|
+
| 'issue';
|
|
8
8
|
|
|
9
9
|
export interface TimelineItem {
|
|
10
10
|
id: string;
|
|
@@ -37,6 +37,7 @@ export interface TimelineMetadata {
|
|
|
37
37
|
export type RemoteEventType =
|
|
38
38
|
| 'subscription:partner_quote'
|
|
39
39
|
| 'subscription:partner_subscribe'
|
|
40
|
+
| 'order:proposal_refused'
|
|
40
41
|
| string;
|
|
41
42
|
|
|
42
43
|
export interface RemoteEventActor {
|
package/src/lib/helpers.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { TimelineVariant } from '@/components/molecules/TimeLine/TimeLine.types';
|
|
2
|
-
|
|
3
|
-
export function labelFromVariant(v?: TimelineVariant) {
|
|
4
|
-
switch (v) {
|
|
5
|
-
case 'accepted':
|
|
6
|
-
return 'Proposta aceita';
|
|
7
|
-
case 'continued':
|
|
8
|
-
return 'Continuação';
|
|
9
|
-
case 'rejected':
|
|
10
|
-
return 'Recusada';
|
|
11
|
-
case 'download':
|
|
12
|
-
return 'Download';
|
|
13
|
-
case 'StatusChanged':
|
|
14
|
-
default:
|
|
15
|
-
return 'Status Alterado';
|
|
16
|
-
}
|
|
17
|
-
}
|