@sybilion/uilib 1.4.14 → 1.4.16
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/agent-glossary/content-prompt.generated.ts +28 -23
- package/dist/agent-glossary/content.generated.ts +28 -23
- package/dist/agent-glossary/content.index.md +1 -1
- package/dist/agent-glossary/content.md +28 -23
- package/dist/agent-glossary/content.prompt.md +28 -23
- package/dist/agent-glossary/workspace.generated.ts +1 -1
- package/dist/agent-glossary/workspace.index.md +1 -1
- package/dist/agent-glossary/workspace.md +1 -1
- package/dist/esm/components/ui/Chat/ChatChrome/ChatChrome.js +28 -3
- package/dist/esm/components/ui/Chat/ChatSheet/useChatPanelChromeModel.js +31 -1
- package/dist/esm/components/ui/DropdownMenu/DropdownMenu.styl.js +2 -2
- package/dist/esm/components/ui/Page/Breadcrumbs/Breadcrumbs.js +28 -1
- package/dist/esm/components/ui/PanelResizeHandle/PanelResizeHandle.js +50 -0
- package/dist/esm/components/ui/Sidebar/Sidebar.styl.js +3 -3
- package/dist/esm/components/ui/Sidebar/SidebarAside.js +36 -0
- package/dist/esm/components/ui/Sidebar/SidebarContent/SidebarContent.js +13 -0
- package/dist/esm/components/ui/Sidebar/SidebarContent/SidebarContent.styl.js +7 -0
- package/dist/esm/components/ui/Sidebar/SidebarFooter/SidebarFooter.js +9 -0
- package/dist/esm/components/ui/Sidebar/SidebarFooter/SidebarFooter.styl.js +7 -0
- package/dist/esm/components/ui/Sidebar/SidebarGroup/SidebarGroup.js +9 -0
- package/dist/esm/components/ui/Sidebar/SidebarGroup/SidebarGroup.styl.js +7 -0
- package/dist/esm/components/ui/Sidebar/SidebarGroupAction/SidebarGroupAction.js +11 -0
- package/dist/esm/components/ui/Sidebar/SidebarGroupAction/SidebarGroupAction.styl.js +7 -0
- package/dist/esm/components/ui/Sidebar/SidebarMenu/SidebarMenu.js +15 -0
- package/dist/esm/components/ui/Sidebar/SidebarMenu/SidebarMenu.styl.js +7 -0
- package/dist/esm/components/ui/Sidebar/SidebarMenuAction/SidebarMenuAction.js +11 -0
- package/dist/esm/components/ui/Sidebar/SidebarMenuAction/SidebarMenuAction.styl.js +7 -0
- package/dist/esm/components/ui/Sidebar/SidebarMenuButton/SidebarMenuButton.js +16 -0
- package/dist/esm/components/ui/Sidebar/SidebarMenuButton/SidebarMenuButton.styl.js +7 -0
- package/dist/esm/components/ui/Sidebar/SidebarMenuSub/SidebarMenuSub.js +12 -0
- package/dist/esm/components/ui/Sidebar/SidebarMenuSub/SidebarMenuSub.styl.js +7 -0
- package/dist/esm/components/ui/Sidebar/SidebarMenuSubButton/SidebarMenuSubButton.js +32 -0
- package/dist/esm/components/ui/Sidebar/SidebarMenuSubButton/SidebarMenuSubButton.styl.js +7 -0
- package/dist/esm/components/ui/Sidebar/SidebarProvider/SidebarProvider.js +314 -0
- package/dist/esm/components/ui/Sidebar/SidebarProvider/SidebarProvider.styl.js +7 -0
- package/dist/esm/components/ui/Sidebar/SidebarRail/SidebarRail.js +11 -0
- package/dist/esm/components/ui/Sidebar/SidebarRail/SidebarRail.styl.js +7 -0
- package/dist/esm/components/ui/Sidebar/SidebarResizeHandle/SidebarResizeHandle.js +26 -0
- package/dist/esm/components/ui/Sidebar/SidebarResizeHandle/SidebarResizeHandle.styl.js +7 -0
- package/dist/esm/components/ui/Sidebar/SidebarSeparator/SidebarSeparator.js +10 -0
- package/dist/esm/components/ui/Sidebar/SidebarSeparator/SidebarSeparator.styl.js +7 -0
- package/dist/esm/components/ui/Sidebar/SidebarTrigger/SidebarTrigger.js +16 -0
- package/dist/esm/components/ui/Sidebar/SidebarTrigger/SidebarTrigger.styl.js +7 -0
- package/dist/esm/components/ui/Sidebar/sidebarConstants.js +7 -0
- package/dist/esm/components/ui/Sidebar/sidebarContext.js +28 -0
- package/dist/esm/components/ui/Sidebar/sidebarUtils.js +41 -0
- package/dist/esm/components/widgets/DriverMap/DriverMap.js +8 -8
- package/dist/esm/components/widgets/DriversComparisonChart/DriversComparisonChart.js +26 -5
- package/dist/esm/components/widgets/PerformanceChart/PerformanceChart.js +2 -2
- package/dist/esm/components/widgets/PerformanceChart/PerformanceTable.js +28 -6
- package/dist/esm/components/widgets/SidebarDatasetsItemsGrouped/SidebarDatasetsItemsGrouped.js +28 -1
- package/dist/esm/index.js +18 -1
- package/dist/esm/types/src/components/ui/PanelResizeHandle/PanelResizeHandle.d.ts +9 -0
- package/dist/esm/types/src/components/ui/Sidebar/Sidebar.d.ts +19 -108
- package/dist/esm/types/src/components/ui/Sidebar/Sidebar.types.d.ts +41 -0
- package/dist/esm/types/src/components/ui/Sidebar/SidebarAside.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Sidebar/SidebarContent/SidebarContent.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Sidebar/SidebarFooter/SidebarFooter.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Sidebar/SidebarGroup/SidebarGroup.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Sidebar/SidebarGroupAction/SidebarGroupAction.d.ts +4 -0
- package/dist/esm/types/src/components/ui/Sidebar/SidebarMenu/SidebarMenu.d.ts +4 -0
- package/dist/esm/types/src/components/ui/Sidebar/SidebarMenuAction/SidebarMenuAction.d.ts +5 -0
- package/dist/esm/types/src/components/ui/Sidebar/SidebarMenuButton/SidebarMenuButton.d.ts +10 -0
- package/dist/esm/types/src/components/ui/Sidebar/SidebarMenuSub/SidebarMenuSub.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Sidebar/SidebarMenuSubButton/SidebarMenuSubButton.d.ts +9 -0
- package/dist/esm/types/src/components/ui/Sidebar/SidebarProvider/SidebarProvider.d.ts +11 -0
- package/dist/esm/types/src/components/ui/Sidebar/SidebarRail/SidebarRail.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Sidebar/SidebarResizeHandle/SidebarResizeHandle.d.ts +4 -0
- package/dist/esm/types/src/components/ui/Sidebar/SidebarSeparator/SidebarSeparator.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Sidebar/SidebarTrigger/SidebarTrigger.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Sidebar/sidebarConstants.d.ts +5 -0
- package/dist/esm/types/src/components/ui/Sidebar/sidebarContext.d.ts +7 -0
- package/dist/esm/types/src/components/ui/Sidebar/sidebarUtils.d.ts +3 -0
- package/dist/esm/types/src/components/widgets/DriverMap/DriverMap.d.ts +2 -1
- package/dist/esm/types/src/components/widgets/PerformanceChart/PerformanceChart.d.ts +2 -1
- package/dist/esm/types/src/components/widgets/PerformanceChart/PerformanceTable.d.ts +2 -1
- package/package.json +1 -1
- package/src/components/ui/ChartAreaInteractive/AGENT.md +0 -4
- package/src/components/ui/Chat/ChatChrome/ChatChrome.tsx +5 -2
- package/src/components/ui/DropdownMenu/DropdownMenu.styl +4 -1
- package/src/components/ui/PanelResizeHandle/PanelResizeHandle.tsx +89 -0
- package/src/components/ui/Sidebar/Sidebar.styl +23 -625
- package/src/components/ui/Sidebar/Sidebar.styl.d.ts +0 -33
- package/src/components/ui/Sidebar/Sidebar.tsx +25 -1157
- package/src/components/ui/Sidebar/Sidebar.types.ts +46 -0
- package/src/components/ui/Sidebar/SidebarAside.tsx +92 -0
- package/src/components/ui/Sidebar/SidebarContent/SidebarContent.styl +27 -0
- package/src/components/ui/Sidebar/SidebarContent/SidebarContent.styl.d.ts +7 -0
- package/src/components/ui/Sidebar/SidebarContent/SidebarContent.tsx +29 -0
- package/src/components/ui/Sidebar/SidebarFooter/SidebarFooter.styl +7 -0
- package/src/components/ui/Sidebar/SidebarFooter/SidebarFooter.styl.d.ts +7 -0
- package/src/components/ui/Sidebar/SidebarFooter/SidebarFooter.tsx +15 -0
- package/src/components/ui/Sidebar/SidebarGroup/SidebarGroup.styl +10 -0
- package/src/components/ui/Sidebar/SidebarGroup/SidebarGroup.styl.d.ts +7 -0
- package/src/components/ui/Sidebar/SidebarGroup/SidebarGroup.tsx +15 -0
- package/src/components/ui/Sidebar/SidebarGroupAction/SidebarGroupAction.styl +34 -0
- package/src/components/ui/Sidebar/SidebarGroupAction/SidebarGroupAction.styl.d.ts +7 -0
- package/src/components/ui/Sidebar/SidebarGroupAction/SidebarGroupAction.tsx +23 -0
- package/src/components/ui/Sidebar/SidebarMenu/SidebarMenu.styl +60 -0
- package/src/components/ui/Sidebar/SidebarMenu/SidebarMenu.styl.d.ts +12 -0
- package/src/components/ui/Sidebar/SidebarMenu/SidebarMenu.tsx +40 -0
- package/src/components/ui/Sidebar/SidebarMenuAction/SidebarMenuAction.styl +73 -0
- package/src/components/ui/Sidebar/SidebarMenuAction/SidebarMenuAction.styl.d.ts +8 -0
- package/src/components/ui/Sidebar/SidebarMenuAction/SidebarMenuAction.tsx +31 -0
- package/src/components/ui/Sidebar/SidebarMenuButton/SidebarMenuButton.styl +107 -0
- package/src/components/ui/Sidebar/SidebarMenuButton/SidebarMenuButton.styl.d.ts +15 -0
- package/src/components/ui/Sidebar/SidebarMenuButton/SidebarMenuButton.tsx +82 -0
- package/src/components/ui/Sidebar/SidebarMenuSub/SidebarMenuSub.styl +39 -0
- package/src/components/ui/Sidebar/SidebarMenuSub/SidebarMenuSub.styl.d.ts +8 -0
- package/src/components/ui/Sidebar/SidebarMenuSub/SidebarMenuSub.tsx +29 -0
- package/src/components/ui/Sidebar/SidebarMenuSubButton/SidebarMenuSubButton.styl +71 -0
- package/src/components/ui/Sidebar/SidebarMenuSubButton/SidebarMenuSubButton.styl.d.ts +8 -0
- package/src/components/ui/Sidebar/SidebarMenuSubButton/SidebarMenuSubButton.tsx +80 -0
- package/src/components/ui/Sidebar/SidebarProvider/SidebarProvider.styl +45 -0
- package/src/components/ui/Sidebar/SidebarProvider/SidebarProvider.styl.d.ts +9 -0
- package/src/components/ui/Sidebar/SidebarProvider/SidebarProvider.tsx +447 -0
- package/src/components/ui/Sidebar/SidebarRail/SidebarRail.styl +42 -0
- package/src/components/ui/Sidebar/SidebarRail/SidebarRail.styl.d.ts +7 -0
- package/src/components/ui/Sidebar/SidebarRail/SidebarRail.tsx +22 -0
- package/src/components/ui/Sidebar/SidebarResizeHandle/SidebarResizeHandle.styl +37 -0
- package/src/components/ui/Sidebar/SidebarResizeHandle/SidebarResizeHandle.styl.d.ts +7 -0
- package/src/components/ui/Sidebar/SidebarResizeHandle/SidebarResizeHandle.tsx +54 -0
- package/src/components/ui/Sidebar/SidebarSeparator/SidebarSeparator.styl +7 -0
- package/src/components/ui/Sidebar/SidebarSeparator/SidebarSeparator.styl.d.ts +7 -0
- package/src/components/ui/Sidebar/SidebarSeparator/SidebarSeparator.tsx +20 -0
- package/src/components/ui/Sidebar/SidebarTrigger/SidebarTrigger.styl +11 -0
- package/src/components/ui/Sidebar/SidebarTrigger/SidebarTrigger.styl.d.ts +7 -0
- package/src/components/ui/Sidebar/SidebarTrigger/SidebarTrigger.tsx +34 -0
- package/src/components/ui/Sidebar/sidebarConstants.ts +6 -0
- package/src/components/ui/Sidebar/sidebarContext.tsx +46 -0
- package/src/components/ui/Sidebar/sidebarUtils.ts +47 -0
- package/src/components/widgets/DriverMap/AGENT.md +0 -4
- package/src/components/widgets/DriverMap/DriverMap.tsx +11 -10
- package/src/components/widgets/DriversComparisonChart/AGENT.md +0 -4
- package/src/components/widgets/PerformanceChart/AGENT.md +0 -4
- package/src/components/widgets/PerformanceChart/PerformanceChart.tsx +3 -0
- package/src/components/widgets/PerformanceChart/PerformanceTable.tsx +3 -1
- package/src/components/widgets/SidebarDatasetsItemsGrouped/AGENT.md +28 -11
- package/src/docs/components/DocsGuidance/DocsGuidance.styl +1 -0
- package/dist/esm/components/ui/Sidebar/Sidebar.js +0 -542
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
|
|
4
|
+
import { Button } from '#uilib/components/ui/Button';
|
|
5
|
+
import { PanelLeft } from 'lucide-react';
|
|
6
|
+
|
|
7
|
+
import S from './SidebarTrigger.styl';
|
|
8
|
+
import { useSidebarActions } from '../sidebarContext';
|
|
9
|
+
|
|
10
|
+
export function SidebarTrigger({
|
|
11
|
+
className,
|
|
12
|
+
onClick,
|
|
13
|
+
...props
|
|
14
|
+
}: ComponentProps<typeof Button>) {
|
|
15
|
+
const { toggleSidebar } = useSidebarActions();
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Button
|
|
19
|
+
data-sidebar="trigger"
|
|
20
|
+
data-slot="sidebar-trigger"
|
|
21
|
+
variant="ghost"
|
|
22
|
+
icon
|
|
23
|
+
className={cn(S.sidebarTrigger, className)}
|
|
24
|
+
onClick={event => {
|
|
25
|
+
onClick?.(event);
|
|
26
|
+
toggleSidebar();
|
|
27
|
+
}}
|
|
28
|
+
{...props}
|
|
29
|
+
>
|
|
30
|
+
<PanelLeft size={20} strokeWidth={1.5} className="text-foreground" />
|
|
31
|
+
{/* <span className="sr-only">Toggle Sidebar</span> */}
|
|
32
|
+
</Button>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const SIDEBAR_WIDTH_MOBILE = '18rem';
|
|
2
|
+
export const SIDEBAR_WIDTH_ICON = '3rem';
|
|
3
|
+
export const SIDEBAR_KEYBOARD_SHORTCUT = 'b';
|
|
4
|
+
|
|
5
|
+
/** Fired when nav open closes chat for layout; ChatSheet clears `?chat=` so URL sync does not reopen chat. */
|
|
6
|
+
export const DISMISS_CHAT_FOR_LAYOUT_EVENT = 'sybilion:dismiss-chat-for-layout';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createContext, useContext, useMemo } from 'react';
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
SidebarActionsContextProps,
|
|
5
|
+
SidebarContextProps,
|
|
6
|
+
SidebarStateContextProps,
|
|
7
|
+
} from './Sidebar.types';
|
|
8
|
+
|
|
9
|
+
const SidebarActionsContext = createContext<SidebarActionsContextProps | null>(
|
|
10
|
+
null,
|
|
11
|
+
);
|
|
12
|
+
const SidebarStateContext = createContext<SidebarStateContextProps | null>(
|
|
13
|
+
null,
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
export function useSidebarActions() {
|
|
17
|
+
const context = useContext(SidebarActionsContext);
|
|
18
|
+
if (!context) {
|
|
19
|
+
throw new Error('useSidebarActions must be used within a SidebarProvider.');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return context;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function useSidebarState() {
|
|
26
|
+
const context = useContext(SidebarStateContext);
|
|
27
|
+
if (!context) {
|
|
28
|
+
throw new Error('useSidebarState must be used within a SidebarProvider.');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return context;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function useSidebar(): SidebarContextProps {
|
|
35
|
+
const actions = useSidebarActions();
|
|
36
|
+
const state = useSidebarState();
|
|
37
|
+
return useMemo(
|
|
38
|
+
() => ({
|
|
39
|
+
...state,
|
|
40
|
+
...actions,
|
|
41
|
+
}),
|
|
42
|
+
[state, actions],
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { SidebarActionsContext, SidebarStateContext };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CHAT_WIDTH_DEFAULT_PX,
|
|
3
|
+
CHAT_WIDTH_MIN_PX,
|
|
4
|
+
CHAT_WIDTH_STORAGE_KEY,
|
|
5
|
+
SIDEBAR_WIDTH_DEFAULT_PX,
|
|
6
|
+
SIDEBAR_WIDTH_MIN_PX,
|
|
7
|
+
SIDEBAR_WIDTH_STORAGE_KEY_PCT,
|
|
8
|
+
SIDEBAR_WIDTH_STORAGE_KEY_PX,
|
|
9
|
+
clampSidebarWidthPx,
|
|
10
|
+
defaultChatWidthPx,
|
|
11
|
+
} from '#uilib/hooks/panelWidth';
|
|
12
|
+
import { LS } from '@homecode/ui';
|
|
13
|
+
|
|
14
|
+
export function isEditableKeyboardTarget(el: Element | null): boolean {
|
|
15
|
+
if (!el) return false;
|
|
16
|
+
if (el instanceof HTMLElement && el.isContentEditable) return true;
|
|
17
|
+
const tag = el.tagName;
|
|
18
|
+
return tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function readInitialSidebarWidthPx(storageKeyPx: string): number {
|
|
22
|
+
if (typeof window === 'undefined') return SIDEBAR_WIDTH_DEFAULT_PX;
|
|
23
|
+
const stored = LS.get(storageKeyPx);
|
|
24
|
+
if (typeof stored === 'number' && stored >= SIDEBAR_WIDTH_MIN_PX) {
|
|
25
|
+
return stored;
|
|
26
|
+
}
|
|
27
|
+
if (storageKeyPx === SIDEBAR_WIDTH_STORAGE_KEY_PX) {
|
|
28
|
+
const legacyPct = LS.get(SIDEBAR_WIDTH_STORAGE_KEY_PCT);
|
|
29
|
+
if (typeof legacyPct === 'number' && legacyPct > 0) {
|
|
30
|
+
const w = window.innerWidth;
|
|
31
|
+
return clampSidebarWidthPx(Math.round((legacyPct / 100) * w), w, {
|
|
32
|
+
chatPanelOpen: false,
|
|
33
|
+
chatWidthPx: 0,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return SIDEBAR_WIDTH_DEFAULT_PX;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function readInitialChatWidthPx(): number {
|
|
41
|
+
if (typeof window === 'undefined') return CHAT_WIDTH_DEFAULT_PX;
|
|
42
|
+
const stored = LS.get(CHAT_WIDTH_STORAGE_KEY);
|
|
43
|
+
if (typeof stored === 'number' && stored >= CHAT_WIDTH_MIN_PX) {
|
|
44
|
+
return stored;
|
|
45
|
+
}
|
|
46
|
+
return defaultChatWidthPx(window.innerWidth);
|
|
47
|
+
}
|
|
@@ -18,10 +18,6 @@ DriverMap renders a world map with regional driver badges, a bottom strip for wo
|
|
|
18
18
|
- Pass isLoading to both the map and the card so their loading states stay in sync.
|
|
19
19
|
- Provide a driverSelector in DriverCard so users can page through drivers without using the map.
|
|
20
20
|
|
|
21
|
-
## Report tile
|
|
22
|
-
|
|
23
|
-
- `drivers_map` — tile resolves analysis id, fetches drivers, passes list + selection.
|
|
24
|
-
|
|
25
21
|
## Host provides
|
|
26
22
|
|
|
27
23
|
- `drivers` as `DriverData[]` from analysis API
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import cn from 'classnames';
|
|
2
|
-
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
-
|
|
4
|
-
import { WorldMap } from '#uilib/components/ui/WorldMap';
|
|
5
|
-
import useEvent from '#uilib/hooks/useEvent';
|
|
6
|
-
import { Shimmer } from '@homecode/ui';
|
|
7
|
-
|
|
8
1
|
import { BadgeSize, DriverIcon } from './DriverIcon/DriverIcon';
|
|
9
|
-
import constants from './DriverIcon/DriverIcon.constants.json';
|
|
10
2
|
import {
|
|
11
3
|
calculateBadgeSizes,
|
|
12
4
|
findMostSpecificRegion,
|
|
13
5
|
getDriverCoordinates,
|
|
14
6
|
hasValidCoords,
|
|
15
7
|
} from './DriverMap.helpers';
|
|
16
|
-
import
|
|
8
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
9
|
+
|
|
17
10
|
import type { DriverData } from './driverMapGeography';
|
|
11
|
+
import S from './DriverMap.styl';
|
|
12
|
+
import { Shimmer } from '@homecode/ui';
|
|
13
|
+
import { WorldMap } from '#uilib/components/ui/WorldMap';
|
|
14
|
+
import cn from 'classnames';
|
|
15
|
+
import constants from './DriverIcon/DriverIcon.constants.json';
|
|
18
16
|
import { getHighestImportanceDriver } from './driverMapSelection';
|
|
17
|
+
import useEvent from '#uilib/hooks/useEvent';
|
|
19
18
|
|
|
20
19
|
export interface DriverMapProps {
|
|
20
|
+
className?: string;
|
|
21
21
|
drivers: DriverData[];
|
|
22
22
|
isLoading: boolean;
|
|
23
23
|
setSelectedDriver: (driver: DriverData) => void;
|
|
@@ -29,6 +29,7 @@ const delay = (ms: number) => new Promise<void>(r => setTimeout(r, ms));
|
|
|
29
29
|
const transitionDelay = () => delay(constants.FADE_DURATION);
|
|
30
30
|
|
|
31
31
|
export function DriverMap({
|
|
32
|
+
className,
|
|
32
33
|
drivers,
|
|
33
34
|
isLoading,
|
|
34
35
|
setSelectedDriver,
|
|
@@ -168,7 +169,7 @@ export function DriverMap({
|
|
|
168
169
|
});
|
|
169
170
|
|
|
170
171
|
return (
|
|
171
|
-
<div className={cn(S.root, isTransitioning && S.inTransition)}>
|
|
172
|
+
<div className={cn(S.root, isTransitioning && S.inTransition, className)}>
|
|
172
173
|
<div className={S.mapInner}>
|
|
173
174
|
<WorldMap className={S.mapWorld} />
|
|
174
175
|
{isLoading && <Shimmer className={S.shimmerOverlay} size="l" />}
|
|
@@ -16,10 +16,6 @@ DriversComparisonChart plots a normalized target line against the normalized ser
|
|
|
16
16
|
- Provide a statusHint when the payload is empty so users understand why the chart is blank.
|
|
17
17
|
- Control viewTab from the page when an external Lagged/Overlapped switcher should stay in sync.
|
|
18
18
|
|
|
19
|
-
## Report tile
|
|
20
|
-
|
|
21
|
-
- `drivers_comparison_chart` — host loads normalized backtests payload + dataset historical.
|
|
22
|
-
|
|
23
19
|
## Host provides
|
|
24
20
|
|
|
25
21
|
- `payload`: BacktestsComponentPayload from platform SDK (host fetch per analysis)
|
|
@@ -14,10 +14,6 @@ PerformanceChart is a widget for evaluating forecast accuracy. It plots per-hori
|
|
|
14
14
|
|
|
15
15
|
- Wire the loading, empty, and hint props to your data-fetch state so the widget shows the right placeholder.
|
|
16
16
|
|
|
17
|
-
## Report tile
|
|
18
|
-
|
|
19
|
-
- `performance_chart` — host loads performance payload + dataset series.
|
|
20
|
-
|
|
21
17
|
## Host provides
|
|
22
18
|
|
|
23
19
|
- `performanceData` (PerformanceChartPayload) and `historicalData` from performance API
|
|
@@ -147,6 +147,7 @@ export type PerformanceChartProps = {
|
|
|
147
147
|
onEditCustomPerformance?: () => void;
|
|
148
148
|
showAddEditCustomDataButton?: boolean;
|
|
149
149
|
addEditCustomDataDisabled?: boolean;
|
|
150
|
+
tableFullWidth?: boolean;
|
|
150
151
|
|
|
151
152
|
hiddenSeries?: Set<string>;
|
|
152
153
|
onToggleLegendSeries?: (key: string) => void;
|
|
@@ -193,6 +194,7 @@ export function PerformanceChart({
|
|
|
193
194
|
onEditCustomPerformance,
|
|
194
195
|
showAddEditCustomDataButton = false,
|
|
195
196
|
addEditCustomDataDisabled = false,
|
|
197
|
+
tableFullWidth,
|
|
196
198
|
|
|
197
199
|
hiddenSeries: hiddenSeriesProp,
|
|
198
200
|
onToggleLegendSeries,
|
|
@@ -1262,6 +1264,7 @@ export function PerformanceChart({
|
|
|
1262
1264
|
onEditCustomPerformance={onEditCustomPerformance}
|
|
1263
1265
|
showAddEditCustomDataButton={showAddEditCustomDataButton}
|
|
1264
1266
|
addEditCustomDataDisabled={addEditCustomDataDisabled}
|
|
1267
|
+
fullWidth={tableFullWidth}
|
|
1265
1268
|
/>
|
|
1266
1269
|
)}
|
|
1267
1270
|
</Tabs>
|
|
@@ -87,6 +87,7 @@ interface PerformanceTableProps {
|
|
|
87
87
|
/** Last row with Add custom data (hidden when custom row already present); per-horizon + spaghetti. */
|
|
88
88
|
showAddEditCustomDataButton?: boolean;
|
|
89
89
|
addEditCustomDataDisabled?: boolean;
|
|
90
|
+
fullWidth?: boolean;
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
// Calculate color for a model key
|
|
@@ -103,6 +104,7 @@ export function PerformanceTable({
|
|
|
103
104
|
onEditCustomPerformance,
|
|
104
105
|
showAddEditCustomDataButton = false,
|
|
105
106
|
addEditCustomDataDisabled = false,
|
|
107
|
+
fullWidth = true,
|
|
106
108
|
}: PerformanceTableProps) {
|
|
107
109
|
// Separate Sybilion AI model from drift model
|
|
108
110
|
const { sybilionModel, driftModel } = useMemo(() => {
|
|
@@ -197,7 +199,7 @@ export function PerformanceTable({
|
|
|
197
199
|
<div className={S.tableWrapper}>
|
|
198
200
|
<PageXScroll
|
|
199
201
|
size="md"
|
|
200
|
-
fullWidth
|
|
202
|
+
fullWidth={fullWidth}
|
|
201
203
|
innerClassName={S.tableContainer}
|
|
202
204
|
scrollbarClassName={S.scrollbar}
|
|
203
205
|
>
|
|
@@ -1,18 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
SidebarDatasetsItemsGrouped renders expandable sidebar groups of datasets, bucketed by target type, region, or category. Each group toggles open to show dataset links with selection highlight; the group containing the selected dataset opens automatically.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## When to use
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
- When the app shell sidebar needs grouped dataset navigation instead of a flat list.
|
|
6
|
+
- To let users browse datasets by target type, region, or category with collapsible sections.
|
|
7
|
+
- When selection should highlight both the active dataset and its parent group.
|
|
8
|
+
- Alongside `preItems` / `postItems` to sandwich custom nav entries around the grouped list.
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
## When not to use
|
|
9
11
|
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
12
|
+
- In-page or report content where no sidebar slot exists.
|
|
13
|
+
- For a flat dataset list without grouping; render individual `SidebarMenuItem` entries instead.
|
|
14
|
+
- When datasets lack the metadata needed for the chosen `groupBy` key (regions, categories, or target type).
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
## Do
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
- Pass `selectedDatasetId` and `onDatasetClick` so clicks navigate and the active dataset stays highlighted.
|
|
19
|
+
- Set `defaultExpandedGroupNames` when specific groups should start open; omit it to start collapsed and rely on auto-expand for the selected dataset's group.
|
|
20
|
+
- Handle loading before passing `datasets`; the widget has no built-in loading state.
|
|
17
21
|
|
|
18
|
-
|
|
22
|
+
## Host provides
|
|
23
|
+
|
|
24
|
+
- `datasets` as `SidebarDatasetsItemsGroupedDataset[]` from the datasets API
|
|
25
|
+
- `groupBy` — `'target_type'`, `'regions'`, or `'categories'`
|
|
26
|
+
- `selectedDatasetId` and `onDatasetClick` for controlled navigation
|
|
27
|
+
- Optional `preItems` / `postItems`, `defaultExpandedGroupNames`, `className`
|
|
28
|
+
|
|
29
|
+
## Requires
|
|
30
|
+
|
|
31
|
+
- `datasets`; `groupBy`; `onDatasetClick` for navigation.
|
|
32
|
+
|
|
33
|
+
## Empty/loading
|
|
34
|
+
|
|
35
|
+
- Empty `datasets` renders no groups; loading is handled by the host before pass-in.
|