@sybilion/uilib 1.3.100 → 1.3.102
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/Banner/Banner.js +11 -0
- package/dist/esm/components/ui/Banner/Banner.styl.js +7 -0
- package/dist/esm/components/widgets/DriversComparisonChart/DriversComparisonChart.js +4 -2
- package/dist/esm/index.js +1 -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/index.d.ts +1 -0
- package/package.json +1 -1
- 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/widgets/DriversComparisonChart/DriversComparisonChart.tsx +15 -13
- package/src/index.ts +1 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import { Button } from '../Button/Button.js';
|
|
4
|
+
import { XIcon, InfoIcon } from 'lucide-react';
|
|
5
|
+
import S from './Banner.styl.js';
|
|
6
|
+
|
|
7
|
+
function Banner({ children, className, icon: Icon = InfoIcon, onClose, }) {
|
|
8
|
+
return (jsxs("div", { className: cn(S.root, className), "data-slot": "banner", children: [Icon !== false && jsx(Icon, { className: S.icon, size: 16 }), children, onClose && (jsx(Button, { variant: "ghost", icon: true, type: "button", onClick: onClose, className: S.closeButton, children: jsx(XIcon, { size: 16 }) }))] }));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { Banner };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import styleInject from 'style-inject';
|
|
2
|
+
|
|
3
|
+
var css_248z = ".Banner_root__zegJA{align-items:center;background-color:var(--card);border-radius:var(--p-2);display:flex;flex-wrap:wrap;margin-bottom:var(--p-10);margin-top:calc(var(--p-4)*-1);padding:var(--p-3) var(--p-4);width:-moz-fit-content;width:fit-content}.Banner_root__zegJA a{padding:0 var(--p-1)}.Banner_icon__q5xFu{display:inline-block;margin-right:var(--p-3)}.Banner_closeButton__cj0WU{margin-left:var(--p-1);opacity:.5;transition:opacity .2s ease}.Banner_closeButton__cj0WU:hover{opacity:1}";
|
|
4
|
+
var S = {"root":"Banner_root__zegJA","icon":"Banner_icon__q5xFu","closeButton":"Banner_closeButton__cj0WU"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { S as default };
|
|
@@ -114,7 +114,8 @@ function DriversComparisonChart({ payload, datasetHistorical = [], loading = fal
|
|
|
114
114
|
const tableSeriesRows = useMemo(() => {
|
|
115
115
|
if (sortedDriversWithData.length === 0)
|
|
116
116
|
return [];
|
|
117
|
-
return sortedDriversWithData
|
|
117
|
+
return sortedDriversWithData
|
|
118
|
+
.map((driver, idx) => {
|
|
118
119
|
const raw = driver.importance;
|
|
119
120
|
const importance = typeof raw === 'number' && Number.isFinite(raw) ? raw : null;
|
|
120
121
|
const lagSource = originalDriversById.get(String(driver.id)) ?? driver;
|
|
@@ -125,7 +126,8 @@ function DriversComparisonChart({ payload, datasetHistorical = [], loading = fal
|
|
|
125
126
|
importance,
|
|
126
127
|
lag: getLagDisplayForView(resolveDriverLagLabel(lagSource), viewTab),
|
|
127
128
|
};
|
|
128
|
-
})
|
|
129
|
+
})
|
|
130
|
+
.sort((a, b) => b.importance - a.importance);
|
|
129
131
|
}, [originalDriversById, sortedDriversWithData, viewTab]);
|
|
130
132
|
const seriesInitKeyResolved = seriesInitKey ?? `${tableSeriesRows.map(r => r.id).join(',') || 'none'}`;
|
|
131
133
|
const backtestsSeriesInitKeyRef = useRef('');
|
package/dist/esm/index.js
CHANGED
|
@@ -15,6 +15,7 @@ export { AppHeaderHost, AppHeaderPortal } from './components/ui/AppHeader/AppHea
|
|
|
15
15
|
export { PAGE_HEADER_ACTIONS_ID, PAGE_HEADER_ID } from './components/ui/AppHeader/appChromeAnchors.js';
|
|
16
16
|
export { Avatar, AvatarFallback, AvatarImage } from './components/ui/Avatar/Avatar.js';
|
|
17
17
|
export { Badge } from './components/ui/Badge/Badge.js';
|
|
18
|
+
export { Banner } from './components/ui/Banner/Banner.js';
|
|
18
19
|
export { Chip } from './components/ui/Chip/Chip.js';
|
|
19
20
|
export { Kicker } from './components/ui/Kicker/Kicker.js';
|
|
20
21
|
export { PullQuote } from './components/ui/PullQuote/PullQuote.js';
|
|
@@ -13,6 +13,7 @@ export * from './components/ui/AnalysisLineIcon';
|
|
|
13
13
|
export * from './components/ui/AppHeader';
|
|
14
14
|
export * from './components/ui/Avatar';
|
|
15
15
|
export * from './components/ui/Badge';
|
|
16
|
+
export * from './components/ui/Banner';
|
|
16
17
|
export * from './components/ui/Chip';
|
|
17
18
|
export * from './components/ui/Kicker';
|
|
18
19
|
export * from './components/ui/PullQuote';
|
package/package.json
CHANGED
|
@@ -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
|
+
}
|
|
@@ -199,19 +199,21 @@ export function DriversComparisonChart({
|
|
|
199
199
|
|
|
200
200
|
const tableSeriesRows = useMemo(() => {
|
|
201
201
|
if (sortedDriversWithData.length === 0) return [];
|
|
202
|
-
return sortedDriversWithData
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
202
|
+
return sortedDriversWithData
|
|
203
|
+
.map((driver, idx) => {
|
|
204
|
+
const raw = driver.importance;
|
|
205
|
+
const importance =
|
|
206
|
+
typeof raw === 'number' && Number.isFinite(raw) ? raw : null;
|
|
207
|
+
const lagSource = originalDriversById.get(String(driver.id)) ?? driver;
|
|
208
|
+
return {
|
|
209
|
+
id: DRIVER_FORECAST_ID_BASE + idx,
|
|
210
|
+
name: driver.name || String(driver.id),
|
|
211
|
+
color: getForecastColor(idx + 1),
|
|
212
|
+
importance,
|
|
213
|
+
lag: getLagDisplayForView(resolveDriverLagLabel(lagSource), viewTab),
|
|
214
|
+
};
|
|
215
|
+
})
|
|
216
|
+
.sort((a, b) => b.importance - a.importance);
|
|
215
217
|
}, [originalDriversById, sortedDriversWithData, viewTab]);
|
|
216
218
|
|
|
217
219
|
const seriesInitKeyResolved =
|
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';
|