@granto-umbrella/umbrella-components 3.0.32 → 3.0.34
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 +4 -5
- package/src/components/atoms/DatePickerInput/DatePicker.styles.ts +75 -75
- package/src/components/atoms/DatePickerInput/DatePickerInput.tsx +154 -154
- package/src/components/atoms/DropDownMenu/DropdownMenu.styles.tsx +106 -106
- package/src/components/atoms/ErrorMessage/ErrorMessage.styles.tsx +6 -6
- package/src/components/atoms/Footer/Footer.styles.tsx +1 -1
- package/src/components/atoms/GenericContainer/GenericContainer.styles.tsx +6 -6
- package/src/components/atoms/Input/Input.tsx +80 -80
- package/src/components/atoms/Input/Input.types.ts +21 -21
- package/src/components/atoms/Label/Label.styles.ts +16 -16
- package/src/components/atoms/Loading/Loading.styles.tsx +7 -5
- package/src/components/atoms/Loading/index.tsx +1 -1
- package/src/components/atoms/LogoContainer/LogoContainer.styles.tsx +4 -4
- package/src/components/atoms/ModalAviso/ModalAviso.styles.tsx +10 -9
- package/src/components/atoms/MultiSelect/index.tsx +1 -1
- package/src/components/atoms/RadioButton/RadioButton.types.ts +9 -9
- package/src/components/atoms/ResendLink/index.tsx +2 -1
- package/src/components/atoms/Select/Select.types.ts +19 -19
- package/src/components/atoms/Skeleton/Skeleton.styles.ts +32 -32
- package/src/components/atoms/Skeleton/Skeleton.tsx +43 -43
- package/src/components/atoms/Skeleton/Skeleton.types.ts +13 -13
- package/src/components/atoms/Subtitle/Subtitle.styles.tsx +21 -21
- package/src/components/atoms/Switch/Switch.styles.ts +59 -59
- package/src/components/atoms/Switch/Switch.types.ts +7 -7
- package/src/components/atoms/TabBar/TabBar.tsx +24 -24
- package/src/components/atoms/TabBar/TabBar.types.ts +11 -11
- package/src/components/atoms/Text/Text.styles.tsx +18 -6
- package/src/components/atoms/Text/Text.tsx +9 -4
- package/src/components/atoms/Text/Text.types.ts +2 -1
- package/src/components/atoms/Textarea/Textarea.types.ts +7 -7
- package/src/components/atoms/Title/Title.styles.tsx +17 -17
- package/src/components/molecules/BannerAjuda/BannerAjuda.types.ts +5 -5
- package/src/components/molecules/ButtonGroup/ButtonGroup.tsx +27 -27
- package/src/components/molecules/CodeInputContainer/CodeInputContainer.tsx +32 -32
- package/src/components/molecules/HighlightsCard/HighlightsCard.tsx +1 -1
- package/src/components/molecules/InsuranceCard/InsuranceCard.styles.tsx +1 -1
- package/src/components/molecules/InsuranceCard/InsuranceCard.tsx +455 -455
- package/src/components/molecules/InsuranceCard/InsuranceCard.types.ts +41 -41
- package/src/components/molecules/ResultsChart/ResultsChart.styles.tsx +26 -26
- package/src/components/molecules/TimeLine/TimeLine.mapper.ts +69 -69
- package/src/components/molecules/TimeLine/TimeLine.styles.ts +154 -154
- package/src/components/molecules/TimeLine/TimeLine.tsx +96 -96
- package/src/components/molecules/TimeLine/TimeLine.types.ts +124 -124
- package/src/components/organisms/AlertDialog/AlertDialog.types.ts +14 -14
- package/src/components/organisms/Navbar/Navbar.styles.tsx +1 -1
- package/src/components/organisms/Navbar/Navbar.tsx +118 -118
- package/src/components/organisms/Navbar/Navbar.types.ts +34 -34
- package/src/components/organisms/TimelineModal/TimelineModal.styles.ts +49 -49
- package/src/components/organisms/TimelineModal/TimelineModal.tsx +49 -49
- package/src/index.ts +157 -157
- package/src/styles/tokens/colors.ts +296 -296
- package/src/styles/tokens/typography.ts +161 -161
- package/src/types/colors.types.ts +21 -21
- package/src/types/sizes.types.ts +4 -4
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
export type StatusVariant = 'primary' | 'success' | 'warning' | 'danger';
|
|
3
|
-
|
|
4
|
-
export interface InsuranceCardProps {
|
|
5
|
-
idGranto: string;
|
|
6
|
-
idOrder: string;
|
|
7
|
-
idInsurance?: string;
|
|
8
|
-
idInterno: string;
|
|
9
|
-
isSupply: boolean;
|
|
10
|
-
hasMinute: boolean;
|
|
11
|
-
statusLabel: string;
|
|
12
|
-
statusVariant: StatusVariant;
|
|
13
|
-
seguradoName: string;
|
|
14
|
-
seguradoCnpj: string;
|
|
15
|
-
product: any;
|
|
16
|
-
issuedDate: string;
|
|
17
|
-
totalValue: string;
|
|
18
|
-
processId?: string;
|
|
19
|
-
activeIndex: number;
|
|
20
|
-
testId?: string;
|
|
21
|
-
openCardId: string | null;
|
|
22
|
-
setOpenCardId: (id: string | null) => void;
|
|
23
|
-
runQuery: () => void;
|
|
24
|
-
useDownloadAndSupport: any;
|
|
25
|
-
useDownloadFile: any;
|
|
26
|
-
useChangeOrderStageAsync: any;
|
|
27
|
-
useMyStore: any;
|
|
28
|
-
useQueryClient: any;
|
|
29
|
-
useGetTimeline: any;
|
|
30
|
-
useAuthStoreV2: any;
|
|
31
|
-
navigate: any;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface MenuItemProps {
|
|
35
|
-
icon: React.ReactNode;
|
|
36
|
-
danger?: boolean;
|
|
37
|
-
children: React.ReactNode;
|
|
38
|
-
onClick?: () => void;
|
|
39
|
-
id?: string;
|
|
40
|
-
'data-testid'?: string;
|
|
41
|
-
}
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
export type StatusVariant = 'primary' | 'success' | 'warning' | 'danger';
|
|
3
|
+
|
|
4
|
+
export interface InsuranceCardProps {
|
|
5
|
+
idGranto: string;
|
|
6
|
+
idOrder: string;
|
|
7
|
+
idInsurance?: string;
|
|
8
|
+
idInterno: string;
|
|
9
|
+
isSupply: boolean;
|
|
10
|
+
hasMinute: boolean;
|
|
11
|
+
statusLabel: string;
|
|
12
|
+
statusVariant: StatusVariant;
|
|
13
|
+
seguradoName: string;
|
|
14
|
+
seguradoCnpj: string;
|
|
15
|
+
product: any;
|
|
16
|
+
issuedDate: string;
|
|
17
|
+
totalValue: string;
|
|
18
|
+
processId?: string;
|
|
19
|
+
activeIndex: number;
|
|
20
|
+
testId?: string;
|
|
21
|
+
openCardId: string | null;
|
|
22
|
+
setOpenCardId: (id: string | null) => void;
|
|
23
|
+
runQuery: () => void;
|
|
24
|
+
useDownloadAndSupport: any;
|
|
25
|
+
useDownloadFile: any;
|
|
26
|
+
useChangeOrderStageAsync: any;
|
|
27
|
+
useMyStore: any;
|
|
28
|
+
useQueryClient: any;
|
|
29
|
+
useGetTimeline: any;
|
|
30
|
+
useAuthStoreV2: any;
|
|
31
|
+
navigate: any;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface MenuItemProps {
|
|
35
|
+
icon: React.ReactNode;
|
|
36
|
+
danger?: boolean;
|
|
37
|
+
children: React.ReactNode;
|
|
38
|
+
onClick?: () => void;
|
|
39
|
+
id?: string;
|
|
40
|
+
'data-testid'?: string;
|
|
41
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import { semanticColors, primitiveColors } from '../../../styles/tokens/colors';
|
|
3
|
-
|
|
4
|
-
export const Results = styled.div<{ $isPositive: boolean }>`
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-direction: row;
|
|
7
|
-
font-size: 12px;
|
|
8
|
-
align-items: center;
|
|
9
|
-
gap: 8px;
|
|
10
|
-
background-color: ${({ $isPositive }) =>
|
|
11
|
-
$isPositive
|
|
12
|
-
? semanticColors.success.surface.feedback
|
|
13
|
-
: primitiveColors.red[100]};
|
|
14
|
-
border: ${({ $isPositive }) =>
|
|
15
|
-
$isPositive
|
|
16
|
-
? `1px solid ${semanticColors.success.text.feedback.accent}`
|
|
17
|
-
: `1px solid ${semanticColors.danger.border.enabled}`};
|
|
18
|
-
border-radius: 9999px;
|
|
19
|
-
padding: 8px 16px;
|
|
20
|
-
color: ${({ $isPositive }) =>
|
|
21
|
-
$isPositive
|
|
22
|
-
? semanticColors.success.text.feedback.accent
|
|
23
|
-
: semanticColors.danger.text.feedback.accent};
|
|
24
|
-
font-weight: 500;
|
|
25
|
-
width: fit-content;
|
|
26
|
-
`;
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { semanticColors, primitiveColors } from '../../../styles/tokens/colors';
|
|
3
|
+
|
|
4
|
+
export const Results = styled.div<{ $isPositive: boolean }>`
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: row;
|
|
7
|
+
font-size: 12px;
|
|
8
|
+
align-items: center;
|
|
9
|
+
gap: 8px;
|
|
10
|
+
background-color: ${({ $isPositive }) =>
|
|
11
|
+
$isPositive
|
|
12
|
+
? semanticColors.success.surface.feedback
|
|
13
|
+
: primitiveColors.red[100]};
|
|
14
|
+
border: ${({ $isPositive }) =>
|
|
15
|
+
$isPositive
|
|
16
|
+
? `1px solid ${semanticColors.success.text.feedback.accent}`
|
|
17
|
+
: `1px solid ${semanticColors.danger.border.enabled}`};
|
|
18
|
+
border-radius: 9999px;
|
|
19
|
+
padding: 8px 16px;
|
|
20
|
+
color: ${({ $isPositive }) =>
|
|
21
|
+
$isPositive
|
|
22
|
+
? semanticColors.success.text.feedback.accent
|
|
23
|
+
: semanticColors.danger.text.feedback.accent};
|
|
24
|
+
font-weight: 500;
|
|
25
|
+
width: fit-content;
|
|
26
|
+
`;
|
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
// TimeLine.mapper.ts
|
|
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]: 'Ordem realizada',
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
function toVariant(eventType: string): TimelineVariant {
|
|
26
|
-
return eventTypeToVariant[eventType] || 'continued';
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function buildTitle(ev: RemoteEvent): string {
|
|
30
|
-
const { eventType, data } = ev;
|
|
31
|
-
return (
|
|
32
|
-
eventTypeToTitle[eventType] ||
|
|
33
|
-
(data?.title ? String(data.title) : eventType)
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function mapRemoteToTimeline(items: RemoteEvent[]): TimelineItem[] {
|
|
38
|
-
return items.map((ev, idx) => {
|
|
39
|
-
const id = ev.correlationId || String(idx);
|
|
40
|
-
const actorName = ev.actor?.name || 'Sistema';
|
|
41
|
-
|
|
42
|
-
return {
|
|
43
|
-
id,
|
|
44
|
-
timestamp: ev.startAt,
|
|
45
|
-
type: toVariant(ev.eventType),
|
|
46
|
-
title: buildTitle(ev),
|
|
47
|
-
description: undefined,
|
|
48
|
-
actor: {
|
|
49
|
-
id: String(ev.actor?.id ?? ''),
|
|
50
|
-
displayName: actorName,
|
|
51
|
-
type: ev.actor?.type ?? 'app',
|
|
52
|
-
},
|
|
53
|
-
origin: ev.parentEventType || ev.eventType,
|
|
54
|
-
correlationId: ev.correlationId,
|
|
55
|
-
metadata: {
|
|
56
|
-
eventType: ev.eventType,
|
|
57
|
-
orderId: ev.data?.orderId,
|
|
58
|
-
insuranceId: ev.data?.insuranceId,
|
|
59
|
-
startAt: ev.startAt,
|
|
60
|
-
endAt: ev.endAt,
|
|
61
|
-
duration: ev.duration,
|
|
62
|
-
parentCorrelationId: ev.parentCorrelationId,
|
|
63
|
-
offers: ev.data?.offers,
|
|
64
|
-
subscriptionPeriod: ev.data?.subscription?.period,
|
|
65
|
-
insuredName: ev.data?.subscription?.insured?.name,
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
});
|
|
69
|
-
}
|
|
1
|
+
// TimeLine.mapper.ts
|
|
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]: 'Ordem realizada',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
function toVariant(eventType: string): TimelineVariant {
|
|
26
|
+
return eventTypeToVariant[eventType] || 'continued';
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function buildTitle(ev: RemoteEvent): string {
|
|
30
|
+
const { eventType, data } = ev;
|
|
31
|
+
return (
|
|
32
|
+
eventTypeToTitle[eventType] ||
|
|
33
|
+
(data?.title ? String(data.title) : eventType)
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function mapRemoteToTimeline(items: RemoteEvent[]): TimelineItem[] {
|
|
38
|
+
return items.map((ev, idx) => {
|
|
39
|
+
const id = ev.correlationId || String(idx);
|
|
40
|
+
const actorName = ev.actor?.name || 'Sistema';
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
id,
|
|
44
|
+
timestamp: ev.startAt,
|
|
45
|
+
type: toVariant(ev.eventType),
|
|
46
|
+
title: buildTitle(ev),
|
|
47
|
+
description: undefined,
|
|
48
|
+
actor: {
|
|
49
|
+
id: String(ev.actor?.id ?? ''),
|
|
50
|
+
displayName: actorName,
|
|
51
|
+
type: ev.actor?.type ?? 'app',
|
|
52
|
+
},
|
|
53
|
+
origin: ev.parentEventType || ev.eventType,
|
|
54
|
+
correlationId: ev.correlationId,
|
|
55
|
+
metadata: {
|
|
56
|
+
eventType: ev.eventType,
|
|
57
|
+
orderId: ev.data?.orderId,
|
|
58
|
+
insuranceId: ev.data?.insuranceId,
|
|
59
|
+
startAt: ev.startAt,
|
|
60
|
+
endAt: ev.endAt,
|
|
61
|
+
duration: ev.duration,
|
|
62
|
+
parentCorrelationId: ev.parentCorrelationId,
|
|
63
|
+
offers: ev.data?.offers,
|
|
64
|
+
subscriptionPeriod: ev.data?.subscription?.period,
|
|
65
|
+
insuredName: ev.data?.subscription?.insured?.name,
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
}
|
|
@@ -1,154 +1,154 @@
|
|
|
1
|
-
import {
|
|
2
|
-
primitiveColors,
|
|
3
|
-
semanticColors,
|
|
4
|
-
typographyTokens,
|
|
5
|
-
} from '../../../styles/tokens';
|
|
6
|
-
import styled, { css } from 'styled-components';
|
|
7
|
-
import { TimelineVariant } from './TimeLine.types';
|
|
8
|
-
|
|
9
|
-
export const Time = styled.time`
|
|
10
|
-
color: #6b7280;
|
|
11
|
-
font-size: 0.78rem;
|
|
12
|
-
`;
|
|
13
|
-
|
|
14
|
-
export const ItemWrap = styled.li`
|
|
15
|
-
display: grid;
|
|
16
|
-
grid-template-columns: 24px 1fr;
|
|
17
|
-
gap: 12px;
|
|
18
|
-
position: relative;
|
|
19
|
-
padding-bottom: 16px;
|
|
20
|
-
&:last-child {
|
|
21
|
-
padding-bottom: 0;
|
|
22
|
-
}
|
|
23
|
-
&:not(:last-child)::before {
|
|
24
|
-
content: '';
|
|
25
|
-
position: absolute;
|
|
26
|
-
left: 11px;
|
|
27
|
-
top: 34px;
|
|
28
|
-
bottom: 0;
|
|
29
|
-
width: 3px;
|
|
30
|
-
height: 100%;
|
|
31
|
-
background-color: ${primitiveColors.gray[200]};
|
|
32
|
-
}
|
|
33
|
-
`;
|
|
34
|
-
|
|
35
|
-
export const Dot = styled.span<{
|
|
36
|
-
$variant?: TimelineVariant | string;
|
|
37
|
-
}>`
|
|
38
|
-
width: 24px;
|
|
39
|
-
height: 24px;
|
|
40
|
-
border-radius: 50%;
|
|
41
|
-
border: 1px solid;
|
|
42
|
-
display: inline-block;
|
|
43
|
-
margin-top: 0.2rem;
|
|
44
|
-
${({ $variant = 'continued' }) => {
|
|
45
|
-
const map: Record<TimelineVariant, ReturnType<typeof css>> = {
|
|
46
|
-
continued: css`
|
|
47
|
-
background: ${semanticColors.branding.surface.disabled};
|
|
48
|
-
`,
|
|
49
|
-
accepted: css`
|
|
50
|
-
background: ${semanticColors.global.surface.status.online};
|
|
51
|
-
`,
|
|
52
|
-
rejected: css`
|
|
53
|
-
background: ${semanticColors.global.surface.status.notification};
|
|
54
|
-
`,
|
|
55
|
-
download: css`
|
|
56
|
-
background: ${semanticColors.branding.surface.disabled};
|
|
57
|
-
`,
|
|
58
|
-
issue: css`
|
|
59
|
-
background: ${semanticColors.global.surface.status.online};
|
|
60
|
-
`,
|
|
61
|
-
order: css`
|
|
62
|
-
background: ${semanticColors.global.surface.status.online};
|
|
63
|
-
`,
|
|
64
|
-
};
|
|
65
|
-
return map[$variant as TimelineVariant] ?? map['continued'];
|
|
66
|
-
}}
|
|
67
|
-
|
|
68
|
-
${({ $variant = 'continued' }) => {
|
|
69
|
-
const map: Record<TimelineVariant, ReturnType<typeof css>> = {
|
|
70
|
-
continued: css`
|
|
71
|
-
border-color: ${semanticColors.branding.surface.enabled};
|
|
72
|
-
`,
|
|
73
|
-
accepted: css`
|
|
74
|
-
border-color: ${semanticColors.global.border.feedback.success};
|
|
75
|
-
`,
|
|
76
|
-
rejected: css`
|
|
77
|
-
border-color: ${semanticColors.global.border.feedback.error};
|
|
78
|
-
`,
|
|
79
|
-
download: css`
|
|
80
|
-
border-color: ${semanticColors.branding.surface.enabled};
|
|
81
|
-
`,
|
|
82
|
-
issue: css`
|
|
83
|
-
border-color: ${semanticColors.global.border.feedback.success};
|
|
84
|
-
`,
|
|
85
|
-
order: css`
|
|
86
|
-
border-color: ${semanticColors.global.border.feedback.success};
|
|
87
|
-
`,
|
|
88
|
-
};
|
|
89
|
-
return map[$variant as TimelineVariant] ?? map['continued'];
|
|
90
|
-
}}
|
|
91
|
-
`;
|
|
92
|
-
|
|
93
|
-
export const Card = styled.div`
|
|
94
|
-
background: #fff;
|
|
95
|
-
padding: 0px 8px;
|
|
96
|
-
margin-top: -4px;
|
|
97
|
-
`;
|
|
98
|
-
|
|
99
|
-
export const Title = styled.h4`
|
|
100
|
-
margin: 0 0 4px 0;
|
|
101
|
-
font-size: ${typographyTokens.fontSizes.headingL};
|
|
102
|
-
color: ${semanticColors.global.text.default.enabled};
|
|
103
|
-
font-weight: ${typographyTokens.fontWeights.semibold};
|
|
104
|
-
`;
|
|
105
|
-
|
|
106
|
-
export const Sub = styled.div`
|
|
107
|
-
color: ${semanticColors.global.text.subtitle.enabled};
|
|
108
|
-
font-size: 14px;
|
|
109
|
-
`;
|
|
110
|
-
|
|
111
|
-
export const Row = styled.div`
|
|
112
|
-
display: flex;
|
|
113
|
-
flex-wrap: wrap;
|
|
114
|
-
gap: 8px;
|
|
115
|
-
align-items: center;
|
|
116
|
-
`;
|
|
117
|
-
|
|
118
|
-
export const List = styled.ol`
|
|
119
|
-
list-style: none;
|
|
120
|
-
margin: 0;
|
|
121
|
-
padding: 0;
|
|
122
|
-
gap: 8px;
|
|
123
|
-
display: flex;
|
|
124
|
-
flex-direction: column;
|
|
125
|
-
`;
|
|
126
|
-
|
|
127
|
-
export const Empty = styled.div`
|
|
128
|
-
display: grid;
|
|
129
|
-
gap: 12px;
|
|
130
|
-
justify-items: start;
|
|
131
|
-
background: #fff;
|
|
132
|
-
border: 1px dashed ${primitiveColors.gray[300]};
|
|
133
|
-
border-radius: 12px;
|
|
134
|
-
padding: 16px;
|
|
135
|
-
color: ${semanticColors.global.text.subtitle.enabled};
|
|
136
|
-
`;
|
|
137
|
-
|
|
138
|
-
export const RetryButton = styled.button`
|
|
139
|
-
appearance: none;
|
|
140
|
-
border: 1px solid ${semanticColors.branding.surface.enabled};
|
|
141
|
-
background: ${semanticColors.branding.surface.enabled};
|
|
142
|
-
color: ${primitiveColors.base.white};
|
|
143
|
-
border-radius: 10px;
|
|
144
|
-
padding: 8px 12px;
|
|
145
|
-
font-size: ${typographyTokens.fontSizes.bodyM};
|
|
146
|
-
cursor: pointer;
|
|
147
|
-
|
|
148
|
-
&:hover {
|
|
149
|
-
filter: brightness(0.95);
|
|
150
|
-
}
|
|
151
|
-
&:active {
|
|
152
|
-
filter: brightness(0.9);
|
|
153
|
-
}
|
|
154
|
-
`;
|
|
1
|
+
import {
|
|
2
|
+
primitiveColors,
|
|
3
|
+
semanticColors,
|
|
4
|
+
typographyTokens,
|
|
5
|
+
} from '../../../styles/tokens';
|
|
6
|
+
import styled, { css } from 'styled-components';
|
|
7
|
+
import { TimelineVariant } from './TimeLine.types';
|
|
8
|
+
|
|
9
|
+
export const Time = styled.time`
|
|
10
|
+
color: #6b7280;
|
|
11
|
+
font-size: 0.78rem;
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
export const ItemWrap = styled.li`
|
|
15
|
+
display: grid;
|
|
16
|
+
grid-template-columns: 24px 1fr;
|
|
17
|
+
gap: 12px;
|
|
18
|
+
position: relative;
|
|
19
|
+
padding-bottom: 16px;
|
|
20
|
+
&:last-child {
|
|
21
|
+
padding-bottom: 0;
|
|
22
|
+
}
|
|
23
|
+
&:not(:last-child)::before {
|
|
24
|
+
content: '';
|
|
25
|
+
position: absolute;
|
|
26
|
+
left: 11px;
|
|
27
|
+
top: 34px;
|
|
28
|
+
bottom: 0;
|
|
29
|
+
width: 3px;
|
|
30
|
+
height: 100%;
|
|
31
|
+
background-color: ${primitiveColors.gray[200]};
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
export const Dot = styled.span<{
|
|
36
|
+
$variant?: TimelineVariant | string;
|
|
37
|
+
}>`
|
|
38
|
+
width: 24px;
|
|
39
|
+
height: 24px;
|
|
40
|
+
border-radius: 50%;
|
|
41
|
+
border: 1px solid;
|
|
42
|
+
display: inline-block;
|
|
43
|
+
margin-top: 0.2rem;
|
|
44
|
+
${({ $variant = 'continued' }) => {
|
|
45
|
+
const map: Record<TimelineVariant, ReturnType<typeof css>> = {
|
|
46
|
+
continued: css`
|
|
47
|
+
background: ${semanticColors.branding.surface.disabled};
|
|
48
|
+
`,
|
|
49
|
+
accepted: css`
|
|
50
|
+
background: ${semanticColors.global.surface.status.online};
|
|
51
|
+
`,
|
|
52
|
+
rejected: css`
|
|
53
|
+
background: ${semanticColors.global.surface.status.notification};
|
|
54
|
+
`,
|
|
55
|
+
download: css`
|
|
56
|
+
background: ${semanticColors.branding.surface.disabled};
|
|
57
|
+
`,
|
|
58
|
+
issue: css`
|
|
59
|
+
background: ${semanticColors.global.surface.status.online};
|
|
60
|
+
`,
|
|
61
|
+
order: css`
|
|
62
|
+
background: ${semanticColors.global.surface.status.online};
|
|
63
|
+
`,
|
|
64
|
+
};
|
|
65
|
+
return map[$variant as TimelineVariant] ?? map['continued'];
|
|
66
|
+
}}
|
|
67
|
+
|
|
68
|
+
${({ $variant = 'continued' }) => {
|
|
69
|
+
const map: Record<TimelineVariant, ReturnType<typeof css>> = {
|
|
70
|
+
continued: css`
|
|
71
|
+
border-color: ${semanticColors.branding.surface.enabled};
|
|
72
|
+
`,
|
|
73
|
+
accepted: css`
|
|
74
|
+
border-color: ${semanticColors.global.border.feedback.success};
|
|
75
|
+
`,
|
|
76
|
+
rejected: css`
|
|
77
|
+
border-color: ${semanticColors.global.border.feedback.error};
|
|
78
|
+
`,
|
|
79
|
+
download: css`
|
|
80
|
+
border-color: ${semanticColors.branding.surface.enabled};
|
|
81
|
+
`,
|
|
82
|
+
issue: css`
|
|
83
|
+
border-color: ${semanticColors.global.border.feedback.success};
|
|
84
|
+
`,
|
|
85
|
+
order: css`
|
|
86
|
+
border-color: ${semanticColors.global.border.feedback.success};
|
|
87
|
+
`,
|
|
88
|
+
};
|
|
89
|
+
return map[$variant as TimelineVariant] ?? map['continued'];
|
|
90
|
+
}}
|
|
91
|
+
`;
|
|
92
|
+
|
|
93
|
+
export const Card = styled.div`
|
|
94
|
+
background: #fff;
|
|
95
|
+
padding: 0px 8px;
|
|
96
|
+
margin-top: -4px;
|
|
97
|
+
`;
|
|
98
|
+
|
|
99
|
+
export const Title = styled.h4`
|
|
100
|
+
margin: 0 0 4px 0;
|
|
101
|
+
font-size: ${typographyTokens.fontSizes.headingL};
|
|
102
|
+
color: ${semanticColors.global.text.default.enabled};
|
|
103
|
+
font-weight: ${typographyTokens.fontWeights.semibold};
|
|
104
|
+
`;
|
|
105
|
+
|
|
106
|
+
export const Sub = styled.div`
|
|
107
|
+
color: ${semanticColors.global.text.subtitle.enabled};
|
|
108
|
+
font-size: 14px;
|
|
109
|
+
`;
|
|
110
|
+
|
|
111
|
+
export const Row = styled.div`
|
|
112
|
+
display: flex;
|
|
113
|
+
flex-wrap: wrap;
|
|
114
|
+
gap: 8px;
|
|
115
|
+
align-items: center;
|
|
116
|
+
`;
|
|
117
|
+
|
|
118
|
+
export const List = styled.ol`
|
|
119
|
+
list-style: none;
|
|
120
|
+
margin: 0;
|
|
121
|
+
padding: 0;
|
|
122
|
+
gap: 8px;
|
|
123
|
+
display: flex;
|
|
124
|
+
flex-direction: column;
|
|
125
|
+
`;
|
|
126
|
+
|
|
127
|
+
export const Empty = styled.div`
|
|
128
|
+
display: grid;
|
|
129
|
+
gap: 12px;
|
|
130
|
+
justify-items: start;
|
|
131
|
+
background: #fff;
|
|
132
|
+
border: 1px dashed ${primitiveColors.gray[300]};
|
|
133
|
+
border-radius: 12px;
|
|
134
|
+
padding: 16px;
|
|
135
|
+
color: ${semanticColors.global.text.subtitle.enabled};
|
|
136
|
+
`;
|
|
137
|
+
|
|
138
|
+
export const RetryButton = styled.button`
|
|
139
|
+
appearance: none;
|
|
140
|
+
border: 1px solid ${semanticColors.branding.surface.enabled};
|
|
141
|
+
background: ${semanticColors.branding.surface.enabled};
|
|
142
|
+
color: ${primitiveColors.base.white};
|
|
143
|
+
border-radius: 10px;
|
|
144
|
+
padding: 8px 12px;
|
|
145
|
+
font-size: ${typographyTokens.fontSizes.bodyM};
|
|
146
|
+
cursor: pointer;
|
|
147
|
+
|
|
148
|
+
&:hover {
|
|
149
|
+
filter: brightness(0.95);
|
|
150
|
+
}
|
|
151
|
+
&:active {
|
|
152
|
+
filter: brightness(0.9);
|
|
153
|
+
}
|
|
154
|
+
`;
|