@sybilion/uilib 1.3.99 → 1.3.101
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/esm/components/ui/AnalysesSelector/AnalysesSelector.js +61 -14
- package/dist/esm/components/ui/AnalysesSelector/AnalysesSelector.styl.js +2 -2
- package/dist/esm/components/ui/AnalysesSelector/SelectInlineRenamer.js +102 -0
- package/dist/esm/components/ui/Banner/Banner.js +11 -0
- package/dist/esm/components/ui/Banner/Banner.styl.js +7 -0
- package/dist/esm/components/ui/Chart/Chart.js +9 -5
- package/dist/esm/components/ui/Chart/chartForecastVisualization.constants.js +23 -0
- package/dist/esm/components/ui/Chart/components/ConfidenceBands.js +9 -0
- package/dist/esm/components/ui/Chart/components/CustomChartLegend/CustomChartLegend.js +2 -2
- package/dist/esm/components/ui/Chart/components/ForecastBoundaries.js +32 -0
- package/dist/esm/components/ui/Chart/components/ForecastLine.js +24 -0
- package/dist/esm/components/ui/Chart/components/HistoricalLine.js +24 -0
- package/dist/esm/components/ui/Chart/hooks/useChartAnimation.js +17 -0
- package/dist/esm/components/ui/Chart/hooks/useChartColors.js +12 -0
- package/dist/esm/components/ui/Chart/hooks/useLegendState.js +30 -0
- package/dist/esm/components/ui/Chart/tools/formatters.js +19 -3
- package/dist/esm/components/ui/ChartAreaInteractive/ChartAreaInteractive.helpers.js +1 -10
- package/dist/esm/components/ui/Select/Select.js +3 -3
- package/dist/esm/components/widgets/DriverCard/DriverCard.js +6 -6
- package/dist/esm/components/widgets/DriverCard/DriverPerformanceChart.js +9 -5
- package/dist/esm/components/widgets/DriversComparisonChart/DriversComparisonChart.styl.js +1 -1
- package/dist/esm/components/widgets/PerformanceChart/PerformanceChart.styl.js +1 -1
- package/dist/esm/index.js +11 -1
- package/dist/esm/types/src/components/ui/AnalysesSelector/AnalysesSelector.d.ts +1 -1
- package/dist/esm/types/src/components/ui/AnalysesSelector/AnalysesSelector.types.d.ts +7 -1
- package/dist/esm/types/src/components/ui/AnalysesSelector/SelectInlineRenamer.d.ts +12 -0
- package/dist/esm/types/src/components/ui/Banner/Banner.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Banner/Banner.types.d.ts +10 -0
- package/dist/esm/types/src/components/ui/Banner/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Chart/Chart.d.ts +9 -0
- package/dist/esm/types/src/components/ui/Chart/components/index.d.ts +1 -1
- package/dist/esm/types/src/components/ui/Chart/tools/formatters.d.ts +3 -1
- package/dist/esm/types/src/components/ui/ChartAreaInteractive/index.d.ts +1 -1
- package/dist/esm/types/src/components/ui/Select/Select.d.ts +1 -1
- package/dist/esm/types/src/components/ui/Select/Select.types.d.ts +1 -0
- package/dist/esm/types/src/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/ui/AnalysesSelector/AnalysesSelector.styl +62 -1
- package/src/components/ui/AnalysesSelector/AnalysesSelector.styl.d.ts +8 -0
- package/src/components/ui/AnalysesSelector/AnalysesSelector.tsx +136 -27
- package/src/components/ui/AnalysesSelector/AnalysesSelector.types.ts +7 -2
- package/src/components/ui/AnalysesSelector/SelectInlineRenamer.tsx +191 -0
- package/src/components/ui/Banner/Banner.styl +28 -0
- package/src/components/ui/Banner/Banner.styl.d.ts +9 -0
- package/src/components/ui/Banner/Banner.tsx +32 -0
- package/src/components/ui/Banner/Banner.types.ts +8 -0
- package/src/components/ui/Banner/index.ts +2 -0
- package/src/components/ui/Chart/Chart.tsx +16 -0
- package/src/components/ui/Chart/components/CustomChartLegend/CustomChartLegend.tsx +2 -3
- package/src/components/ui/Chart/components/index.ts +5 -1
- package/src/components/ui/Chart/tools/formatters.ts +20 -2
- package/src/components/ui/ChartAreaInteractive/index.ts +15 -1
- package/src/components/ui/Select/Select.tsx +13 -5
- package/src/components/ui/Select/Select.types.ts +1 -0
- package/src/components/widgets/DriverCard/DriverCard.tsx +7 -8
- package/src/components/widgets/DriversComparisonChart/DriversComparisonChart.styl +0 -1
- package/src/components/widgets/PerformanceChart/PerformanceChart.styl +1 -1
- package/src/index.ts +1 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
3
|
+
|
|
4
|
+
import { Button } from '#uilib/components/ui/Button';
|
|
5
|
+
import { Input } from '#uilib/components/ui/Input';
|
|
6
|
+
import { TextShimmer } from '#uilib/components/ui/TextShimmer/TextShimmer';
|
|
7
|
+
import {
|
|
8
|
+
Tooltip,
|
|
9
|
+
TooltipContent,
|
|
10
|
+
TooltipTrigger,
|
|
11
|
+
} from '#uilib/components/ui/Tooltip';
|
|
12
|
+
import { PencilSimpleIcon } from '@phosphor-icons/react';
|
|
13
|
+
|
|
14
|
+
import S from './AnalysesSelector.styl';
|
|
15
|
+
|
|
16
|
+
const LABEL_MAX = 64;
|
|
17
|
+
const MANUALLY_ADJUSTED_NAME = 'Manually adjusted';
|
|
18
|
+
const MANUALLY_ADJUSTED_RENAME_MAX =
|
|
19
|
+
LABEL_MAX - MANUALLY_ADJUSTED_NAME.length;
|
|
20
|
+
|
|
21
|
+
type SelectInlineRenamerProps = {
|
|
22
|
+
value: string;
|
|
23
|
+
/** Shown in trigger when not editing; defaults to `value`. */
|
|
24
|
+
displayLabel?: string;
|
|
25
|
+
onChange: (value: string) => void | Promise<void>;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
className?: string;
|
|
28
|
+
isRenaming: boolean;
|
|
29
|
+
onEnterRenaming: () => void;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const stopSelectBubble = (e: React.SyntheticEvent) => {
|
|
33
|
+
e.stopPropagation();
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const stopSelectOpen = (e: React.SyntheticEvent) => {
|
|
37
|
+
e.preventDefault();
|
|
38
|
+
e.stopPropagation();
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const stopRenamerKeyboardBubble = (e: React.KeyboardEvent) => {
|
|
42
|
+
e.stopPropagation();
|
|
43
|
+
e.nativeEvent.stopImmediatePropagation();
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export function SelectInlineRenamer({
|
|
47
|
+
value,
|
|
48
|
+
displayLabel,
|
|
49
|
+
onChange,
|
|
50
|
+
onEnterRenaming,
|
|
51
|
+
disabled,
|
|
52
|
+
className,
|
|
53
|
+
isRenaming,
|
|
54
|
+
}: SelectInlineRenamerProps) {
|
|
55
|
+
const [draft, setDraft] = useState(value);
|
|
56
|
+
const [isSaving, setIsSaving] = useState(false);
|
|
57
|
+
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
if (!isSaving) {
|
|
60
|
+
setDraft(value);
|
|
61
|
+
}
|
|
62
|
+
}, [value, isSaving]);
|
|
63
|
+
|
|
64
|
+
const exitRenaming = useCallback(() => {
|
|
65
|
+
if (isRenaming) {
|
|
66
|
+
onEnterRenaming();
|
|
67
|
+
}
|
|
68
|
+
}, [isRenaming, onEnterRenaming]);
|
|
69
|
+
|
|
70
|
+
const persistRename = useCallback(
|
|
71
|
+
async (trimmed: string) => {
|
|
72
|
+
setIsSaving(true);
|
|
73
|
+
setDraft(trimmed);
|
|
74
|
+
exitRenaming();
|
|
75
|
+
try {
|
|
76
|
+
await onChange(trimmed);
|
|
77
|
+
} catch {
|
|
78
|
+
setDraft(value);
|
|
79
|
+
} finally {
|
|
80
|
+
setIsSaving(false);
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
[exitRenaming, onChange, value],
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
const commit = useCallback(() => {
|
|
87
|
+
const trimmed = draft.trim();
|
|
88
|
+
if (trimmed && trimmed !== value) {
|
|
89
|
+
void persistRename(trimmed);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
exitRenaming();
|
|
93
|
+
setDraft(value);
|
|
94
|
+
}, [draft, exitRenaming, persistRename, value]);
|
|
95
|
+
|
|
96
|
+
const cancel = useCallback(() => {
|
|
97
|
+
exitRenaming();
|
|
98
|
+
setDraft(value);
|
|
99
|
+
}, [exitRenaming, value]);
|
|
100
|
+
|
|
101
|
+
const onKeyDown = useCallback(
|
|
102
|
+
(e: React.KeyboardEvent<HTMLInputElement>) => {
|
|
103
|
+
stopRenamerKeyboardBubble(e);
|
|
104
|
+
|
|
105
|
+
if (e.key === 'Enter' && draft.trim()) {
|
|
106
|
+
e.preventDefault();
|
|
107
|
+
const trimmed = draft.trim();
|
|
108
|
+
if (trimmed !== value) {
|
|
109
|
+
void persistRename(trimmed);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
exitRenaming();
|
|
113
|
+
setDraft(trimmed);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (e.key === 'Escape') {
|
|
117
|
+
e.preventDefault();
|
|
118
|
+
cancel();
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
[cancel, draft, exitRenaming, persistRename, value],
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
const onKeyUp = useCallback((e: React.KeyboardEvent<HTMLInputElement>) => {
|
|
125
|
+
if (e.key !== ' ') return;
|
|
126
|
+
|
|
127
|
+
e.preventDefault();
|
|
128
|
+
e.stopPropagation();
|
|
129
|
+
}, []);
|
|
130
|
+
|
|
131
|
+
const onDraftChange = useCallback(
|
|
132
|
+
(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
133
|
+
setDraft(e.target.value.slice(0, MANUALLY_ADJUSTED_RENAME_MAX));
|
|
134
|
+
},
|
|
135
|
+
[],
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
if (isRenaming) {
|
|
139
|
+
return (
|
|
140
|
+
<Input
|
|
141
|
+
className={cn(S.selectInlineRenamerInput, className)}
|
|
142
|
+
autoFocus
|
|
143
|
+
variant="clean"
|
|
144
|
+
size="sm"
|
|
145
|
+
value={draft}
|
|
146
|
+
maxLength={MANUALLY_ADJUSTED_RENAME_MAX}
|
|
147
|
+
onChange={onDraftChange}
|
|
148
|
+
onBlur={commit}
|
|
149
|
+
onKeyDown={onKeyDown}
|
|
150
|
+
onKeyUp={onKeyUp}
|
|
151
|
+
onPointerDown={stopSelectBubble}
|
|
152
|
+
onClick={stopSelectBubble}
|
|
153
|
+
/>
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const triggerLabel = isSaving ? draft : (displayLabel ?? value);
|
|
158
|
+
|
|
159
|
+
return (
|
|
160
|
+
<div className={cn(S.selectInlineRenamer, className)}>
|
|
161
|
+
{isSaving ? (
|
|
162
|
+
<TextShimmer as="span" className={S.label}>
|
|
163
|
+
{triggerLabel}
|
|
164
|
+
</TextShimmer>
|
|
165
|
+
) : (
|
|
166
|
+
<span className={S.label}>{triggerLabel}</span>
|
|
167
|
+
)}
|
|
168
|
+
{!disabled && !isSaving && (
|
|
169
|
+
<Tooltip>
|
|
170
|
+
<TooltipTrigger asChild>
|
|
171
|
+
<Button
|
|
172
|
+
variant="ghost"
|
|
173
|
+
size="sm"
|
|
174
|
+
type="button"
|
|
175
|
+
className={S.renamerEditButton}
|
|
176
|
+
onPointerDown={stopSelectOpen}
|
|
177
|
+
onClick={e => {
|
|
178
|
+
e.stopPropagation();
|
|
179
|
+
setDraft(value);
|
|
180
|
+
onEnterRenaming();
|
|
181
|
+
}}
|
|
182
|
+
>
|
|
183
|
+
<PencilSimpleIcon size={16} />
|
|
184
|
+
</Button>
|
|
185
|
+
</TooltipTrigger>
|
|
186
|
+
<TooltipContent side="bottom">Rename</TooltipContent>
|
|
187
|
+
</Tooltip>
|
|
188
|
+
)}
|
|
189
|
+
</div>
|
|
190
|
+
);
|
|
191
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.root
|
|
2
|
+
display flex
|
|
3
|
+
align-items center
|
|
4
|
+
flex-wrap wrap
|
|
5
|
+
|
|
6
|
+
width fit-content
|
|
7
|
+
padding var(--p-3) var(--p-4)
|
|
8
|
+
margin-top calc(var(--p-4) * -1)
|
|
9
|
+
margin-bottom var(--p-10)
|
|
10
|
+
|
|
11
|
+
background-color var(--card)
|
|
12
|
+
border-radius var(--p-2)
|
|
13
|
+
|
|
14
|
+
a
|
|
15
|
+
padding 0 var(--p-1)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
.icon
|
|
19
|
+
display inline-block
|
|
20
|
+
margin-right var(--p-3)
|
|
21
|
+
|
|
22
|
+
.closeButton
|
|
23
|
+
margin-left var(--p-1)
|
|
24
|
+
opacity .5
|
|
25
|
+
transition opacity 200ms ease
|
|
26
|
+
|
|
27
|
+
&:hover
|
|
28
|
+
opacity 1
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
|
|
3
|
+
import { Button } from '#uilib/components/ui/Button';
|
|
4
|
+
import { InfoIcon, XIcon } from 'lucide-react';
|
|
5
|
+
|
|
6
|
+
import S from './Banner.styl';
|
|
7
|
+
import type { BannerProps } from './Banner.types';
|
|
8
|
+
|
|
9
|
+
export function Banner({
|
|
10
|
+
children,
|
|
11
|
+
className,
|
|
12
|
+
icon: Icon = InfoIcon,
|
|
13
|
+
onClose,
|
|
14
|
+
}: BannerProps) {
|
|
15
|
+
return (
|
|
16
|
+
<div className={cn(S.root, className)} data-slot="banner">
|
|
17
|
+
{Icon !== false && <Icon className={S.icon} size={16} />}
|
|
18
|
+
{children}
|
|
19
|
+
{onClose && (
|
|
20
|
+
<Button
|
|
21
|
+
variant="ghost"
|
|
22
|
+
icon
|
|
23
|
+
type="button"
|
|
24
|
+
onClick={onClose}
|
|
25
|
+
className={S.closeButton}
|
|
26
|
+
>
|
|
27
|
+
<XIcon size={16} />
|
|
28
|
+
</Button>
|
|
29
|
+
)}
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -34,3 +34,19 @@ export {
|
|
|
34
34
|
type ChartEmptyStateProps,
|
|
35
35
|
type ChartEmptyStatusTone,
|
|
36
36
|
} from './components/ChartEmptyState/ChartEmptyState';
|
|
37
|
+
export { ConfidenceBands } from './components/ConfidenceBands';
|
|
38
|
+
export { ForecastBoundaries } from './components/ForecastBoundaries';
|
|
39
|
+
export { ForecastLine } from './components/ForecastLine';
|
|
40
|
+
export { HistoricalLine } from './components/HistoricalLine';
|
|
41
|
+
export {
|
|
42
|
+
DEFAULT_QUANTILE_BAND_COLOR,
|
|
43
|
+
QuantileBands,
|
|
44
|
+
} from './components/QuantileBands';
|
|
45
|
+
export {
|
|
46
|
+
formatCompactAxisNumber,
|
|
47
|
+
formatDate,
|
|
48
|
+
formatNumber,
|
|
49
|
+
} from './tools/formatters';
|
|
50
|
+
export { useChartAnimation } from './hooks/useChartAnimation';
|
|
51
|
+
export { useChartColors } from './hooks/useChartColors';
|
|
52
|
+
export { useLegendState } from './hooks/useLegendState';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import cn from 'classnames';
|
|
2
1
|
import { useCallback, useMemo } from 'react';
|
|
3
2
|
|
|
4
3
|
import { AnalysesSelector } from '#uilib/components/ui/AnalysesSelector';
|
|
5
|
-
|
|
6
4
|
import S from './CustomChartLegend.styl';
|
|
5
|
+
import cn from 'classnames';
|
|
7
6
|
|
|
8
7
|
interface CustomChartLegendPayloadItem {
|
|
9
8
|
value: string;
|
|
@@ -138,7 +137,7 @@ export function CustomChartLegend({
|
|
|
138
137
|
selectedIds={selectedIds}
|
|
139
138
|
onItemToggle={handleItemToggle}
|
|
140
139
|
inlineMode
|
|
141
|
-
size="
|
|
140
|
+
size="xs"
|
|
142
141
|
variant="clear"
|
|
143
142
|
onFailedItemClick={onFailedAnalysisClick}
|
|
144
143
|
enableToggleHidden
|
|
@@ -5,7 +5,11 @@ export { ChartGrid } from './ChartGrid';
|
|
|
5
5
|
export { ChartLegendContent } from './ChartLegendContent';
|
|
6
6
|
export { ChartTooltipContent } from './ChartTooltipContent';
|
|
7
7
|
export { ForecastLine } from './ForecastLine';
|
|
8
|
-
export {
|
|
8
|
+
export {
|
|
9
|
+
formatCompactAxisNumber,
|
|
10
|
+
formatDate,
|
|
11
|
+
formatNumber,
|
|
12
|
+
} from '../tools/formatters';
|
|
9
13
|
export { HistoricalLine } from './HistoricalLine';
|
|
10
14
|
export { useChartAnimation } from '../hooks/useChartAnimation';
|
|
11
15
|
export { useChartColors } from '../hooks/useChartColors';
|
|
@@ -1,15 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Format number for display (with k/m abbreviations)
|
|
2
|
+
* Format number for display (with k/m/b abbreviations)
|
|
3
3
|
*/
|
|
4
4
|
export const formatNumber = (value: number): string => {
|
|
5
|
+
if (Math.abs(value) >= 1000000000) {
|
|
6
|
+
return (value / 1000000000).toFixed(1).replace(/\.0$/, '') + 'B';
|
|
7
|
+
}
|
|
5
8
|
if (Math.abs(value) >= 1000000) {
|
|
6
9
|
return (value / 1000000).toFixed(1).replace(/\.0$/, '') + 'M';
|
|
7
|
-
}
|
|
10
|
+
}
|
|
11
|
+
if (Math.abs(value) >= 1000) {
|
|
8
12
|
return (value / 1000).toFixed(1).replace(/\.0$/, '') + 'K';
|
|
9
13
|
}
|
|
10
14
|
return value.toFixed(0);
|
|
11
15
|
};
|
|
12
16
|
|
|
17
|
+
/** Shorter Y-axis style labels (integer B/M/K) for tight layouts. */
|
|
18
|
+
export const formatCompactAxisNumber = (value: number): string => {
|
|
19
|
+
if (Math.abs(value) >= 1000000000) {
|
|
20
|
+
return `${Math.round(value / 1000000000)}B`;
|
|
21
|
+
}
|
|
22
|
+
if (Math.abs(value) >= 1000000) {
|
|
23
|
+
return `${Math.round(value / 1000000)}M`;
|
|
24
|
+
}
|
|
25
|
+
if (Math.abs(value) >= 1000) {
|
|
26
|
+
return `${Math.round(value / 1000)}K`;
|
|
27
|
+
}
|
|
28
|
+
return value.toFixed(0);
|
|
29
|
+
};
|
|
30
|
+
|
|
13
31
|
/**
|
|
14
32
|
* Round a number based on its magnitude
|
|
15
33
|
* - 2 digits (10-99): round to nearest 10
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
export * from './ChartAreaInteractive';
|
|
2
|
-
export
|
|
2
|
+
export {
|
|
3
|
+
DRAG_TIME_RANGE_PREFIX,
|
|
4
|
+
encodeDragTimeRange,
|
|
5
|
+
filterDataForTimeRange,
|
|
6
|
+
findPinPositionForDate,
|
|
7
|
+
isAnalysisDone,
|
|
8
|
+
isAnalysisFailed,
|
|
9
|
+
isAnalysisNotFailed,
|
|
10
|
+
isTimeRangePreset,
|
|
11
|
+
longDateFormatter,
|
|
12
|
+
parseDragTimeRange,
|
|
13
|
+
shortDateFormatter,
|
|
14
|
+
type FilterDataForTimeRangeOptions,
|
|
15
|
+
type TimeRangePreset,
|
|
16
|
+
} from './ChartAreaInteractive.helpers';
|
|
3
17
|
export * from './ChartAreaInteractive.types';
|
|
4
18
|
export * from './ChartLines';
|
|
5
19
|
export type { OverlayMode } from './ChartAreaInteractive.types';
|
|
@@ -45,6 +45,7 @@ function SelectTrigger({
|
|
|
45
45
|
darker = false,
|
|
46
46
|
children,
|
|
47
47
|
hideChevron = false,
|
|
48
|
+
asChild = false,
|
|
48
49
|
...props
|
|
49
50
|
}: SelectTriggerProps) {
|
|
50
51
|
return (
|
|
@@ -53,13 +54,20 @@ function SelectTrigger({
|
|
|
53
54
|
data-size={size}
|
|
54
55
|
data-variant={variant}
|
|
55
56
|
className={cn(S.selectTrigger, darker && S.darker, className)}
|
|
57
|
+
asChild={asChild}
|
|
56
58
|
{...props}
|
|
57
59
|
>
|
|
58
|
-
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
{asChild ? (
|
|
61
|
+
children
|
|
62
|
+
) : (
|
|
63
|
+
<>
|
|
64
|
+
{children}
|
|
65
|
+
{!hideChevron && (
|
|
66
|
+
<SelectPrimitive.Icon asChild>
|
|
67
|
+
<ChevronDownIcon className={S.selectIcon} />
|
|
68
|
+
</SelectPrimitive.Icon>
|
|
69
|
+
)}
|
|
70
|
+
</>
|
|
63
71
|
)}
|
|
64
72
|
</SelectPrimitive.Trigger>
|
|
65
73
|
);
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { Card, CardContent } from '@sybilion/uilib';
|
|
3
2
|
import { CoffeeIcon, TrendDownIcon, TrendUpIcon } from '@phosphor-icons/react';
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
4
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from '../../ui/Tooltip';
|
|
4
5
|
|
|
5
6
|
import { Badge } from '../../ui/Badge';
|
|
6
|
-
import {
|
|
7
|
+
import type { DriverData } from '../DriverMap/driverMapGeography';
|
|
8
|
+
import { DriverPerformanceChart } from './DriverPerformanceChart';
|
|
7
9
|
import { LabelWithId } from '../../ui/LabelWithId';
|
|
10
|
+
import S from './DriverCard.styl';
|
|
8
11
|
import { Skeleton } from '../../ui/Skeleton';
|
|
9
|
-
import { Tooltip, TooltipContent, TooltipTrigger } from '../../ui/Tooltip';
|
|
10
12
|
import { getCategoryIcon } from '../DriverMap/driverCategoryIcon';
|
|
11
|
-
import type { DriverData } from '../DriverMap/driverMapGeography';
|
|
12
|
-
import S from './DriverCard.styl';
|
|
13
|
-
import { DriverPerformanceChart } from './DriverPerformanceChart';
|
|
14
13
|
|
|
15
14
|
export interface DriverCardProps {
|
|
16
15
|
selectedDriver: DriverData | null;
|
|
@@ -114,7 +113,7 @@ export function DriverCard({
|
|
|
114
113
|
|
|
115
114
|
if (isLoading) {
|
|
116
115
|
return (
|
|
117
|
-
<Card className={S.root}>
|
|
116
|
+
<Card className={S.root} radiusSize="xl">
|
|
118
117
|
<CardContent noScroll>
|
|
119
118
|
<div className={S.skeletonContainer}>
|
|
120
119
|
<Skeleton className={`${S.skeletonItem} ${S.hs} ${S.w75}`} />
|
package/src/index.ts
CHANGED
|
@@ -18,6 +18,7 @@ export * from './components/ui/AnalysisLineIcon';
|
|
|
18
18
|
export * from './components/ui/AppHeader';
|
|
19
19
|
export * from './components/ui/Avatar';
|
|
20
20
|
export * from './components/ui/Badge';
|
|
21
|
+
export * from './components/ui/Banner';
|
|
21
22
|
export * from './components/ui/Chip';
|
|
22
23
|
export * from './components/ui/Kicker';
|
|
23
24
|
export * from './components/ui/PullQuote';
|