@granto-umbrella/umbrella-components 3.0.8 → 3.0.9
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 +1997 -1991
- package/dist/umbrella-components.umd.js +4 -0
- package/package.json +1 -1
- package/src/components/molecules/TimeLine/TimeLine.mapper.ts +27 -13
- package/src/components/molecules/TimeLine/TimeLine.styles.ts +6 -0
- package/src/components/molecules/TimeLine/TimeLine.types.ts +11 -1
|
@@ -2501,6 +2501,8 @@ gap: ${D.global.gap.lg};
|
|
|
2501
2501
|
background: ${v.branding.surface.disabled};
|
|
2502
2502
|
`,issue:B`
|
|
2503
2503
|
background: ${v.global.surface.status.online};
|
|
2504
|
+
`,order:B`
|
|
2505
|
+
background: ${v.global.surface.status.online};
|
|
2504
2506
|
`};return t[a]??t.continued}}
|
|
2505
2507
|
|
|
2506
2508
|
${({$variant:a="continued"})=>{const t={continued:B`
|
|
@@ -2513,6 +2515,8 @@ gap: ${D.global.gap.lg};
|
|
|
2513
2515
|
border-color: ${v.branding.surface.enabled};
|
|
2514
2516
|
`,issue:B`
|
|
2515
2517
|
border-color: ${v.global.border.feedback.success};
|
|
2518
|
+
`,order:B`
|
|
2519
|
+
border-color: ${v.global.border.feedback.success};
|
|
2516
2520
|
`};return t[a]??t.continued}}
|
|
2517
2521
|
`,jL0=S.div`
|
|
2518
2522
|
background: #fff;
|
package/package.json
CHANGED
|
@@ -1,23 +1,37 @@
|
|
|
1
1
|
// TimeLine.mapper.ts
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
TimelineItem,
|
|
4
|
+
TimelineVariant,
|
|
5
|
+
RemoteEvent,
|
|
6
|
+
EventType,
|
|
7
|
+
} from './TimeLine.types';
|
|
8
|
+
|
|
9
|
+
const eventTypeToVariant: Record<string, TimelineVariant> = {
|
|
10
|
+
[EventType.PartnerSubscribe]: 'accepted',
|
|
11
|
+
[EventType.PartnerQuote]: 'continued',
|
|
12
|
+
[EventType.ProposalRefused]: 'rejected',
|
|
13
|
+
[EventType.PartnerIssue]: 'issue',
|
|
14
|
+
[EventType.PartnerOrder]: 'order',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const eventTypeToTitle: Record<string, string> = {
|
|
18
|
+
[EventType.PartnerSubscribe]: 'Subscrição realizada',
|
|
19
|
+
[EventType.PartnerQuote]: 'Cotação processada',
|
|
20
|
+
[EventType.ProposalRefused]: 'Proposta recusada',
|
|
21
|
+
[EventType.PartnerIssue]: 'Emissão realizada',
|
|
22
|
+
[EventType.PartnerOrder]: 'Proposta realizada',
|
|
23
|
+
};
|
|
3
24
|
|
|
4
25
|
function toVariant(eventType: string): TimelineVariant {
|
|
5
|
-
|
|
6
|
-
if (eventType === 'subscription:partner_quote') return 'continued';
|
|
7
|
-
if (eventType === 'order:proposal_refused') return 'rejected';
|
|
8
|
-
if (eventType === 'issue:partner_issue') return 'issue';
|
|
9
|
-
return 'continued';
|
|
26
|
+
return eventTypeToVariant[eventType] || 'continued';
|
|
10
27
|
}
|
|
11
28
|
|
|
12
29
|
function buildTitle(ev: RemoteEvent): string {
|
|
13
30
|
const { eventType, data } = ev;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (eventType === 'order:proposal_refused') return 'Proposta recusada';
|
|
19
|
-
if (eventType === 'issue:partner_issue') return 'Emissão realizada';
|
|
20
|
-
return data?.title ? String(data.title) : eventType;
|
|
31
|
+
return (
|
|
32
|
+
eventTypeToTitle[eventType] ||
|
|
33
|
+
(data?.title ? String(data.title) : eventType)
|
|
34
|
+
);
|
|
21
35
|
}
|
|
22
36
|
|
|
23
37
|
export function mapRemoteToTimeline(items: RemoteEvent[]): TimelineItem[] {
|
|
@@ -58,6 +58,9 @@ export const Dot = styled.span<{
|
|
|
58
58
|
issue: css`
|
|
59
59
|
background: ${semanticColors.global.surface.status.online};
|
|
60
60
|
`,
|
|
61
|
+
order: css`
|
|
62
|
+
background: ${semanticColors.global.surface.status.online};
|
|
63
|
+
`,
|
|
61
64
|
};
|
|
62
65
|
return map[$variant as TimelineVariant] ?? map['continued'];
|
|
63
66
|
}}
|
|
@@ -79,6 +82,9 @@ export const Dot = styled.span<{
|
|
|
79
82
|
issue: css`
|
|
80
83
|
border-color: ${semanticColors.global.border.feedback.success};
|
|
81
84
|
`,
|
|
85
|
+
order: css`
|
|
86
|
+
border-color: ${semanticColors.global.border.feedback.success};
|
|
87
|
+
`,
|
|
82
88
|
};
|
|
83
89
|
return map[$variant as TimelineVariant] ?? map['continued'];
|
|
84
90
|
}}
|
|
@@ -4,7 +4,16 @@ export type TimelineVariant =
|
|
|
4
4
|
| 'continued'
|
|
5
5
|
| 'rejected'
|
|
6
6
|
| 'download'
|
|
7
|
-
| 'issue'
|
|
7
|
+
| 'issue'
|
|
8
|
+
| 'order';
|
|
9
|
+
|
|
10
|
+
export enum EventType {
|
|
11
|
+
PartnerSubscribe = 'subscription:partner_subscribe',
|
|
12
|
+
PartnerQuote = 'subscription:partner_quote',
|
|
13
|
+
ProposalRefused = 'order:proposal_refused',
|
|
14
|
+
PartnerIssue = 'issue:partner_issue',
|
|
15
|
+
PartnerOrder = 'order:partner_order',
|
|
16
|
+
}
|
|
8
17
|
|
|
9
18
|
export interface TimelineItem {
|
|
10
19
|
id: string;
|
|
@@ -43,6 +52,7 @@ export type RemoteEventType =
|
|
|
43
52
|
| 'subscription:partner_subscribe'
|
|
44
53
|
| 'order:proposal_refused'
|
|
45
54
|
| 'issue:partner_issue'
|
|
55
|
+
| 'order:partner_order'
|
|
46
56
|
| string;
|
|
47
57
|
|
|
48
58
|
export interface RemoteEventActor {
|