@sybilion/uilib 1.4.9 → 1.4.11
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 +27 -0
- package/dist/agent-glossary/content.generated.ts +27 -0
- package/dist/agent-glossary/content.index.md +4 -0
- package/dist/agent-glossary/content.md +27 -0
- package/dist/agent-glossary/content.prompt.md +27 -0
- package/dist/agent-glossary/workspace.generated.ts +2 -2
- package/dist/agent-glossary/workspace.index.md +2 -2
- package/dist/agent-glossary/workspace.md +2 -2
- package/dist/esm/components/ui/AnalysesSelector/AnalysesSelector.js +2 -2
- package/dist/esm/components/ui/Button/Button.styl.js +1 -1
- package/dist/esm/components/ui/ButtonGroup/ButtonGroup.js +9 -0
- package/dist/esm/components/ui/ButtonGroup/ButtonGroup.styl.js +7 -0
- package/dist/esm/components/ui/Chart/Chart.js +3 -3
- package/dist/esm/components/ui/Chat/ChatPrompt/ChatPrompt.styl.js +1 -1
- package/dist/esm/components/ui/Chat/ChatPrompt/ChatPromptComposer.js +1 -1
- package/dist/esm/components/ui/Chat/ChatSheet/ChatSheet.js +13 -0
- package/dist/esm/components/ui/Chat/ChatSheet/useChatPanelChromeModel.js +10 -7
- package/dist/esm/components/ui/Chip/Chip.js +3 -4
- package/dist/esm/components/ui/Chip/Chip.styl.js +2 -2
- package/dist/esm/components/ui/FileChip/FileChip.js +1 -1
- package/dist/esm/components/ui/Page/pageScrollRestoration.js +22 -0
- package/dist/esm/components/ui/Page/usePageScrollRestoration.js +73 -0
- package/dist/esm/components/ui/Renamer/Renamer.js +2 -2
- package/dist/esm/components/ui/Renamer/Renamer.styl.js +2 -2
- package/dist/esm/components/ui/Sidebar/Sidebar.js +91 -73
- package/dist/esm/components/widgets/DriverCard/DriverCard.js +7 -7
- package/dist/esm/components/widgets/DriverCard/DriverPerformanceChart.js +3 -3
- package/dist/esm/components/widgets/DriverMap/DriverIcon/DriverIcon.js +2 -2
- package/dist/esm/components/widgets/DriverMap/DriverIcon/DriverIcon.styl.js +1 -1
- package/dist/esm/components/widgets/DriversComparisonChart/DriversComparisonChart.js +1 -0
- package/dist/esm/components/widgets/PerformanceChart/PerformanceTable.js +1 -0
- package/dist/esm/components/widgets/SybilionAppHeader/SybilionAppHeader.styl.js +1 -1
- package/dist/esm/index.js +4 -2
- package/dist/esm/types/src/components/ui/ButtonGroup/ButtonGroup.d.ts +3 -0
- package/dist/esm/types/src/components/ui/ButtonGroup/ButtonGroup.types.d.ts +3 -0
- package/dist/esm/types/src/components/ui/ButtonGroup/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Chip/Chip.d.ts +1 -1
- package/dist/esm/types/src/components/ui/Chip/Chip.types.d.ts +4 -2
- package/dist/esm/types/src/components/ui/Page/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Page/pageScrollRestoration.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Page/usePageScrollRestoration.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Sidebar/Sidebar.d.ts +13 -6
- package/dist/esm/types/src/docs/pages/ButtonGroupPage.d.ts +1 -0
- package/dist/esm/types/src/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/ui/AnalysesSelector/AnalysesSelector.tsx +3 -3
- package/src/components/ui/AnalysisLineIcon/AGENT.md +1 -1
- package/src/components/ui/Avatar/AGENT.md +1 -1
- package/src/components/ui/Button/Button.styl +11 -5
- package/src/components/ui/ButtonGroup/AGENT.md +29 -0
- package/src/components/ui/ButtonGroup/ButtonGroup.styl +21 -0
- package/src/components/ui/{Badge/Badge.styl.d.ts → ButtonGroup/ButtonGroup.styl.d.ts} +0 -6
- package/src/components/ui/ButtonGroup/ButtonGroup.tsx +17 -0
- package/src/components/ui/ButtonGroup/ButtonGroup.types.ts +3 -0
- package/src/components/ui/ButtonGroup/index.ts +2 -0
- package/src/components/ui/Chat/ChatPrompt/ChatPrompt.styl +2 -0
- package/src/components/ui/Chat/ChatPrompt/ChatPromptComposer.tsx +1 -0
- package/src/components/ui/Chat/ChatSheet/ChatSheet.tsx +15 -0
- package/src/components/ui/Chat/ChatSheet/useChatPanelChromeModel.tsx +21 -9
- package/src/components/ui/Chip/AGENT.md +4 -3
- package/src/components/ui/Chip/Chip.styl +17 -0
- package/src/components/ui/Chip/Chip.styl.d.ts +2 -0
- package/src/components/ui/Chip/Chip.tsx +10 -6
- package/src/components/ui/Chip/Chip.types.ts +5 -2
- package/src/components/ui/FileChip/FileChip.tsx +1 -1
- package/src/components/ui/Page/index.ts +2 -0
- package/src/components/ui/Page/pageScrollRestoration.ts +22 -0
- package/src/components/ui/Page/usePageScrollRestoration.ts +90 -0
- package/src/components/ui/Renamer/Renamer.styl +24 -4
- package/src/components/ui/Renamer/Renamer.styl.d.ts +2 -0
- package/src/components/ui/Renamer/Renamer.tsx +2 -1
- package/src/components/ui/Sidebar/Sidebar.tsx +158 -99
- package/src/components/widgets/DriverCard/DriverCard.tsx +12 -10
- package/src/components/widgets/DriverMap/DriverIcon/DriverIcon.styl +1 -0
- package/src/components/widgets/DriverMap/DriverIcon/DriverIcon.tsx +3 -3
- package/src/components/widgets/SybilionAppHeader/SybilionAppHeader.styl +2 -2
- package/src/docs/pages/ButtonGroupPage.tsx +45 -0
- package/src/docs/pages/ChipPage.tsx +37 -0
- package/src/docs/pages/RenamerPage.tsx +97 -6
- package/src/docs/pages/VimeoEmbedPage.tsx +4 -5
- package/src/docs/registry.ts +6 -12
- package/src/index.ts +1 -1
- package/dist/esm/components/ui/Badge/Badge.js +0 -11
- package/dist/esm/components/ui/Badge/Badge.styl.js +0 -7
- package/dist/esm/types/src/components/ui/Badge/Badge.d.ts +0 -3
- package/dist/esm/types/src/components/ui/Badge/Badge.types.d.ts +0 -6
- package/dist/esm/types/src/components/ui/Badge/index.d.ts +0 -2
- package/dist/esm/types/src/docs/pages/BadgePage.d.ts +0 -1
- package/dist/esm/types/src/docs/pages/TogglePage.d.ts +0 -1
- package/src/components/ui/Badge/AGENT.md +0 -16
- package/src/components/ui/Badge/Badge.styl +0 -95
- package/src/components/ui/Badge/Badge.tsx +0 -31
- package/src/components/ui/Badge/Badge.types.ts +0 -7
- package/src/components/ui/Badge/index.ts +0 -2
- package/src/docs/pages/BadgePage.tsx +0 -30
- package/src/docs/pages/TogglePage.tsx +0 -27
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import cn from 'classnames';
|
|
3
|
-
import { createContext, useContext, useState, useRef, useCallback, useLayoutEffect, useEffect
|
|
3
|
+
import { createContext, useContext, useMemo, useState, useRef, useCallback, useLayoutEffect, useEffect } from 'react';
|
|
4
4
|
import { Button } from '../Button/Button.js';
|
|
5
5
|
import { Logo } from '../Logo/Logo.js';
|
|
6
6
|
import { Separator } from '../Separator/Separator.js';
|
|
7
7
|
import { Sheet, SheetContent } from '../Sheet/Sheet.js';
|
|
8
8
|
import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from '../Tooltip/Tooltip.js';
|
|
9
|
-
import { clampSidebarWidthPx, CHAT_WIDTH_STORAGE_KEY, shellFitsSidebarsLayout, SIDEBAR_WIDTH_DEFAULT_PX, SIDEBAR_WIDTH_MIN_PX, SIDEBAR_WIDTH_STORAGE_KEY_PX, SIDEBAR_WIDTH_STORAGE_KEY_PCT, CHAT_WIDTH_DEFAULT_PX, CHAT_WIDTH_MIN_PX, defaultChatWidthPx
|
|
9
|
+
import { clampSidebarWidthPx, CHAT_WIDTH_STORAGE_KEY, clampChatWidthPx, shellFitsSidebarsLayout, SIDEBAR_WIDTH_DEFAULT_PX, SIDEBAR_WIDTH_MIN_PX, SIDEBAR_WIDTH_STORAGE_KEY_PX, SIDEBAR_WIDTH_STORAGE_KEY_PCT, CHAT_WIDTH_DEFAULT_PX, CHAT_WIDTH_MIN_PX, defaultChatWidthPx } from '../../../hooks/panelWidth.js';
|
|
10
10
|
import useElemDrag from '../../../hooks/useDragElem.js';
|
|
11
11
|
import useEvent from '../../../hooks/useEvent.js';
|
|
12
12
|
import { useIsSidebarSheetLayout } from '../../../hooks/useIsSidebarSheetLayout.js';
|
|
@@ -59,14 +59,30 @@ function readInitialChatWidthPx() {
|
|
|
59
59
|
}
|
|
60
60
|
return defaultChatWidthPx(window.innerWidth);
|
|
61
61
|
}
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
const SidebarActionsContext = createContext(null);
|
|
63
|
+
const SidebarStateContext = createContext(null);
|
|
64
|
+
function useSidebarActions() {
|
|
65
|
+
const context = useContext(SidebarActionsContext);
|
|
65
66
|
if (!context) {
|
|
66
|
-
throw new Error('
|
|
67
|
+
throw new Error('useSidebarActions must be used within a SidebarProvider.');
|
|
67
68
|
}
|
|
68
69
|
return context;
|
|
69
70
|
}
|
|
71
|
+
function useSidebarState() {
|
|
72
|
+
const context = useContext(SidebarStateContext);
|
|
73
|
+
if (!context) {
|
|
74
|
+
throw new Error('useSidebarState must be used within a SidebarProvider.');
|
|
75
|
+
}
|
|
76
|
+
return context;
|
|
77
|
+
}
|
|
78
|
+
function useSidebar() {
|
|
79
|
+
const actions = useSidebarActions();
|
|
80
|
+
const state = useSidebarState();
|
|
81
|
+
return useMemo(() => ({
|
|
82
|
+
...state,
|
|
83
|
+
...actions,
|
|
84
|
+
}), [state, actions]);
|
|
85
|
+
}
|
|
70
86
|
function SidebarProvider({ defaultOpen = getCookie('isSidebarOpen') ?? true, className, style, children, userId, sidebarWidthStorageKey, persistSidebarWidthWithoutConsent = false, ...props }) {
|
|
71
87
|
const sidebarLsKey = sidebarWidthStorageKey ?? SIDEBAR_WIDTH_STORAGE_KEY_PX;
|
|
72
88
|
const allowPersistSidebarWidth = persistSidebarWidthWithoutConsent ||
|
|
@@ -86,10 +102,14 @@ function SidebarProvider({ defaultOpen = getCookie('isSidebarOpen') ?? true, cla
|
|
|
86
102
|
const [chatPanelOpen, _setChatPanelOpen] = useState(false);
|
|
87
103
|
const sidebarWidthRef = useRef(sidebarWidthPx);
|
|
88
104
|
const chatWidthRef = useRef(chatWidthPx);
|
|
105
|
+
const isOpenRef = useRef(isOpen);
|
|
106
|
+
const chatPanelOpenRef = useRef(chatPanelOpen);
|
|
89
107
|
/** Left nav was auto-closed because chat opened on a narrow shell; reopen when chat closes. */
|
|
90
108
|
const sidebarAutoClosedForChatRef = useRef(false);
|
|
91
109
|
sidebarWidthRef.current = sidebarWidthPx;
|
|
92
110
|
chatWidthRef.current = chatWidthPx;
|
|
111
|
+
isOpenRef.current = isOpen;
|
|
112
|
+
chatPanelOpenRef.current = chatPanelOpen;
|
|
93
113
|
const mergeWrapperRef = useCallback((el) => {
|
|
94
114
|
wrapperRef.current = el;
|
|
95
115
|
setShellEl(el);
|
|
@@ -105,34 +125,29 @@ function SidebarProvider({ defaultOpen = getCookie('isSidebarOpen') ?? true, cla
|
|
|
105
125
|
}
|
|
106
126
|
return typeof window !== 'undefined' ? window.innerWidth : 1200;
|
|
107
127
|
}, []);
|
|
128
|
+
const getChatPanelOpen = useCallback(() => chatPanelOpenRef.current, []);
|
|
108
129
|
const setSidebarWidthPx = useCallback((px, options) => {
|
|
109
130
|
const persist = options?.persist !== false;
|
|
110
131
|
const shellW = getShellWidth();
|
|
111
132
|
const next = clampSidebarWidthPx(px, shellW, {
|
|
112
|
-
chatPanelOpen,
|
|
113
|
-
chatWidthPx,
|
|
133
|
+
chatPanelOpen: chatPanelOpenRef.current,
|
|
134
|
+
chatWidthPx: chatWidthRef.current,
|
|
114
135
|
});
|
|
115
136
|
_setSidebarWidthPx(next);
|
|
116
137
|
if (persist && allowPersistSidebarWidth) {
|
|
117
138
|
LS.set(sidebarLsKey, next);
|
|
118
139
|
}
|
|
119
|
-
}, [
|
|
120
|
-
getShellWidth,
|
|
121
|
-
chatPanelOpen,
|
|
122
|
-
chatWidthPx,
|
|
123
|
-
sidebarLsKey,
|
|
124
|
-
allowPersistSidebarWidth,
|
|
125
|
-
]);
|
|
140
|
+
}, [getShellWidth, sidebarLsKey, allowPersistSidebarWidth]);
|
|
126
141
|
const setChatWidthPx = useCallback((px, options) => {
|
|
127
142
|
const persist = options?.persist !== false;
|
|
128
143
|
const shellW = getShellWidth();
|
|
129
|
-
const effectiveSidebarW =
|
|
144
|
+
const effectiveSidebarW = isOpenRef.current ? sidebarWidthRef.current : 0;
|
|
130
145
|
const next = clampChatWidthPx(px, shellW, effectiveSidebarW);
|
|
131
146
|
_setChatWidthPx(next);
|
|
132
147
|
if (persist && getCookiePreferences(userId)?.functional) {
|
|
133
148
|
LS.set(CHAT_WIDTH_STORAGE_KEY, next);
|
|
134
149
|
}
|
|
135
|
-
}, [getShellWidth,
|
|
150
|
+
}, [getShellWidth, userId]);
|
|
136
151
|
const handleShellResize = useCallback((shellW) => {
|
|
137
152
|
shellWidthRef.current = shellW;
|
|
138
153
|
const prev = prevShellWidthRef.current;
|
|
@@ -142,14 +157,14 @@ function SidebarProvider({ defaultOpen = getCookie('isSidebarOpen') ?? true, cla
|
|
|
142
157
|
const sScaled = Math.round((s * shellW) / prev);
|
|
143
158
|
const cScaled = Math.round((c * shellW) / prev);
|
|
144
159
|
const effS = (navOpen, sidebarPx) => navOpen ? sidebarPx : 0;
|
|
145
|
-
let cNext = clampChatWidthPx(cScaled, shellW, effS(
|
|
160
|
+
let cNext = clampChatWidthPx(cScaled, shellW, effS(isOpenRef.current, sScaled));
|
|
146
161
|
let sNext = clampSidebarWidthPx(sScaled, shellW, {
|
|
147
|
-
chatPanelOpen,
|
|
162
|
+
chatPanelOpen: chatPanelOpenRef.current,
|
|
148
163
|
chatWidthPx: cNext,
|
|
149
164
|
});
|
|
150
|
-
cNext = clampChatWidthPx(cScaled, shellW, effS(
|
|
165
|
+
cNext = clampChatWidthPx(cScaled, shellW, effS(isOpenRef.current, sNext));
|
|
151
166
|
sNext = clampSidebarWidthPx(sScaled, shellW, {
|
|
152
|
-
chatPanelOpen,
|
|
167
|
+
chatPanelOpen: chatPanelOpenRef.current,
|
|
153
168
|
chatWidthPx: cNext,
|
|
154
169
|
});
|
|
155
170
|
_setSidebarWidthPx(sNext);
|
|
@@ -162,22 +177,22 @@ function SidebarProvider({ defaultOpen = getCookie('isSidebarOpen') ?? true, cla
|
|
|
162
177
|
}
|
|
163
178
|
}
|
|
164
179
|
prevShellWidthRef.current = shellW;
|
|
165
|
-
}, [
|
|
180
|
+
}, [userId, sidebarLsKey, allowPersistSidebarWidth]);
|
|
166
181
|
const fitPanelWidthsToShell = useCallback(() => {
|
|
167
182
|
const shellW = getShellWidth();
|
|
168
183
|
if (shellW <= 0)
|
|
169
184
|
return;
|
|
170
185
|
const s = sidebarWidthRef.current;
|
|
171
186
|
const c = chatWidthRef.current;
|
|
172
|
-
const effS =
|
|
187
|
+
const effS = isOpenRef.current ? s : 0;
|
|
173
188
|
let cNext = clampChatWidthPx(c, shellW, effS);
|
|
174
189
|
let sNext = clampSidebarWidthPx(s, shellW, {
|
|
175
|
-
chatPanelOpen,
|
|
190
|
+
chatPanelOpen: chatPanelOpenRef.current,
|
|
176
191
|
chatWidthPx: cNext,
|
|
177
192
|
});
|
|
178
|
-
cNext = clampChatWidthPx(c, shellW,
|
|
193
|
+
cNext = clampChatWidthPx(c, shellW, isOpenRef.current ? sNext : 0);
|
|
179
194
|
sNext = clampSidebarWidthPx(s, shellW, {
|
|
180
|
-
chatPanelOpen,
|
|
195
|
+
chatPanelOpen: chatPanelOpenRef.current,
|
|
181
196
|
chatWidthPx: cNext,
|
|
182
197
|
});
|
|
183
198
|
if (sNext !== s || cNext !== c) {
|
|
@@ -190,14 +205,7 @@ function SidebarProvider({ defaultOpen = getCookie('isSidebarOpen') ?? true, cla
|
|
|
190
205
|
LS.set(CHAT_WIDTH_STORAGE_KEY, cNext);
|
|
191
206
|
}
|
|
192
207
|
}
|
|
193
|
-
}, [
|
|
194
|
-
chatPanelOpen,
|
|
195
|
-
getShellWidth,
|
|
196
|
-
isOpen,
|
|
197
|
-
userId,
|
|
198
|
-
sidebarLsKey,
|
|
199
|
-
allowPersistSidebarWidth,
|
|
200
|
-
]);
|
|
208
|
+
}, [getShellWidth, userId, sidebarLsKey, allowPersistSidebarWidth]);
|
|
201
209
|
useLayoutEffect(() => {
|
|
202
210
|
if (!shellEl || isSidebarSheetLayout)
|
|
203
211
|
return;
|
|
@@ -215,34 +223,36 @@ function SidebarProvider({ defaultOpen = getCookie('isSidebarOpen') ?? true, cla
|
|
|
215
223
|
return;
|
|
216
224
|
const shellW = getShellWidth();
|
|
217
225
|
const layoutAfterOpen = {
|
|
218
|
-
mainSidebarOpen: openingMain ||
|
|
219
|
-
chatPanelOpen: openingChat ||
|
|
220
|
-
sidebarWidthPx,
|
|
221
|
-
chatWidthPx,
|
|
226
|
+
mainSidebarOpen: openingMain || isOpenRef.current,
|
|
227
|
+
chatPanelOpen: openingChat || chatPanelOpenRef.current,
|
|
228
|
+
sidebarWidthPx: sidebarWidthRef.current,
|
|
229
|
+
chatWidthPx: chatWidthRef.current,
|
|
222
230
|
};
|
|
223
231
|
if (shellFitsSidebarsLayout(shellW, layoutAfterOpen))
|
|
224
232
|
return;
|
|
225
|
-
if (openingMain &&
|
|
233
|
+
if (openingMain && chatPanelOpenRef.current) {
|
|
226
234
|
_setChatPanelOpen(false);
|
|
227
235
|
if (typeof window !== 'undefined') {
|
|
228
236
|
window.dispatchEvent(new CustomEvent(DISMISS_CHAT_FOR_LAYOUT_EVENT));
|
|
229
237
|
}
|
|
230
238
|
}
|
|
231
|
-
else if (openingChat &&
|
|
239
|
+
else if (openingChat && isOpenRef.current) {
|
|
232
240
|
sidebarAutoClosedForChatRef.current = true;
|
|
233
241
|
setIsOpen(false);
|
|
234
242
|
}
|
|
235
|
-
}, [
|
|
236
|
-
isSidebarSheetLayout,
|
|
237
|
-
getShellWidth,
|
|
238
|
-
isOpen,
|
|
239
|
-
chatPanelOpen,
|
|
240
|
-
sidebarWidthPx,
|
|
241
|
-
chatWidthPx,
|
|
242
|
-
]);
|
|
243
|
+
}, [isSidebarSheetLayout, getShellWidth]);
|
|
243
244
|
const setChatPanelOpen = useCallback((open) => {
|
|
244
245
|
if (open) {
|
|
245
246
|
closeOppositeSidebarIfNoSpace(false, true);
|
|
247
|
+
const shellW = getShellWidth();
|
|
248
|
+
if (shellW > 0 && !isSidebarSheetLayout) {
|
|
249
|
+
const navOpenAfter = isOpenRef.current && !sidebarAutoClosedForChatRef.current;
|
|
250
|
+
const effNav = navOpenAfter ? sidebarWidthRef.current : 0;
|
|
251
|
+
const cNext = clampChatWidthPx(chatWidthRef.current, shellW, effNav);
|
|
252
|
+
if (cNext !== chatWidthRef.current) {
|
|
253
|
+
_setChatWidthPx(cNext);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
246
256
|
_setChatPanelOpen(true);
|
|
247
257
|
return;
|
|
248
258
|
}
|
|
@@ -254,7 +264,12 @@ function SidebarProvider({ defaultOpen = getCookie('isSidebarOpen') ?? true, cla
|
|
|
254
264
|
setCookie('isSidebarOpen', 'true', 60 * 60 * 24 * 7);
|
|
255
265
|
}
|
|
256
266
|
}
|
|
257
|
-
}, [
|
|
267
|
+
}, [
|
|
268
|
+
closeOppositeSidebarIfNoSpace,
|
|
269
|
+
getShellWidth,
|
|
270
|
+
isSidebarSheetLayout,
|
|
271
|
+
userId,
|
|
272
|
+
]);
|
|
258
273
|
const setOpen = useCallback((value, options) => {
|
|
259
274
|
const layoutAutoClose = options?.layoutAutoClose === true;
|
|
260
275
|
if (value) {
|
|
@@ -283,7 +298,7 @@ function SidebarProvider({ defaultOpen = getCookie('isSidebarOpen') ?? true, cla
|
|
|
283
298
|
setCookie('isSidebarOpen', value.toString(), 60 * 60 * 24 * 7);
|
|
284
299
|
}
|
|
285
300
|
}, [isSidebarSheetLayout, userId, closeOppositeSidebarIfNoSpace]);
|
|
286
|
-
const toggleSidebar = useCallback(() => setOpen(!
|
|
301
|
+
const toggleSidebar = useCallback(() => setOpen(!isOpenRef.current), [setOpen]);
|
|
287
302
|
useEffect(() => {
|
|
288
303
|
const shell = wrapperRef.current;
|
|
289
304
|
if (!shell)
|
|
@@ -326,40 +341,41 @@ function SidebarProvider({ defaultOpen = getCookie('isSidebarOpen') ?? true, cla
|
|
|
326
341
|
}
|
|
327
342
|
},
|
|
328
343
|
});
|
|
329
|
-
const
|
|
330
|
-
isOpen,
|
|
344
|
+
const sidebarActionsValue = useMemo(() => ({
|
|
331
345
|
setOpen,
|
|
332
346
|
toggleSidebar,
|
|
333
|
-
sidebarWidthPx,
|
|
334
347
|
setSidebarWidthPx,
|
|
335
|
-
chatWidthPx,
|
|
336
348
|
setChatWidthPx,
|
|
337
|
-
chatPanelOpen,
|
|
338
349
|
setChatPanelOpen,
|
|
339
350
|
getShellWidth,
|
|
340
|
-
|
|
341
|
-
sidebarWrapperRef: wrapperRef,
|
|
351
|
+
getChatPanelOpen,
|
|
342
352
|
}), [
|
|
343
|
-
isOpen,
|
|
344
353
|
setOpen,
|
|
345
354
|
toggleSidebar,
|
|
346
|
-
sidebarWidthPx,
|
|
347
355
|
setSidebarWidthPx,
|
|
348
|
-
chatWidthPx,
|
|
349
356
|
setChatWidthPx,
|
|
350
|
-
|
|
357
|
+
setChatPanelOpen,
|
|
351
358
|
getShellWidth,
|
|
352
|
-
|
|
359
|
+
getChatPanelOpen,
|
|
353
360
|
]);
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
361
|
+
const sidebarStateValue = useMemo(() => ({
|
|
362
|
+
isOpen,
|
|
363
|
+
sidebarWidthPx,
|
|
364
|
+
chatWidthPx,
|
|
365
|
+
chatPanelOpen,
|
|
366
|
+
chatPanelContainer,
|
|
367
|
+
sidebarWrapperRef: wrapperRef,
|
|
368
|
+
}), [isOpen, sidebarWidthPx, chatWidthPx, chatPanelOpen, chatPanelContainer]);
|
|
369
|
+
return (jsx(SidebarActionsContext.Provider, { value: sidebarActionsValue, children: jsx(SidebarStateContext.Provider, { value: sidebarStateValue, children: jsx(TooltipProvider, { delayDuration: 0, children: jsxs("div", { ref: mergeWrapperRef, "data-slot": "sidebar-wrapper", "data-state": isOpen ? 'expanded' : 'collapsed', style: {
|
|
370
|
+
'--sidebar-width': `${sidebarWidthPx}px`,
|
|
371
|
+
'--sidebar-width-icon': SIDEBAR_WIDTH_ICON,
|
|
372
|
+
...style,
|
|
373
|
+
}, className: cn(SidebarStem.sidebarWrapper, className), ...props, children: [jsx("div", { className: SidebarStem.sidebarMainShell, children: children }), jsx("div", { ref: onChatPanelMount, className: SidebarStem.chatPanelMount, "data-slot": "chat-panel-mount" })] }) }) }) }));
|
|
359
374
|
}
|
|
360
375
|
function Sidebar({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, side = 'left', variant = 'sidebar', collapsible = 'offcanvas', children, fullHeightResizer = false, brandText = 'Sybilion', ...props }) {
|
|
361
376
|
const isSidebarSheetLayout = useIsSidebarSheetLayout();
|
|
362
|
-
const { isOpen
|
|
377
|
+
const { isOpen } = useSidebarState();
|
|
378
|
+
const { setOpen } = useSidebarActions();
|
|
363
379
|
const prevSheetLayoutRef = useRef(isSidebarSheetLayout);
|
|
364
380
|
/** Narrow shell: sidebar is a sheet; collapse only when crossing into this mode. */
|
|
365
381
|
useEffect(() => {
|
|
@@ -380,14 +396,14 @@ function Sidebar({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp
|
|
|
380
396
|
return (jsxs("aside", { className: cn(SidebarStem.sidebar, SidebarStem[`variant-${variant}`], className, fullHeightResizer && SidebarStem.fullHeightResizer), "data-state": isOpen ? 'expanded' : 'collapsed', "data-collapsible": !isOpen ? collapsible : '', "data-variant": variant, "data-side": side, ...props, children: [children, jsx(SidebarResizeHandle, { side: side })] }));
|
|
381
397
|
}
|
|
382
398
|
function SidebarTrigger({ className, onClick, ...props }) {
|
|
383
|
-
const { toggleSidebar } =
|
|
399
|
+
const { toggleSidebar } = useSidebarActions();
|
|
384
400
|
return (jsx(Button, { "data-sidebar": "trigger", "data-slot": "sidebar-trigger", variant: "ghost", icon: true, className: cn(SidebarStem.sidebarTrigger, className), onClick: event => {
|
|
385
401
|
onClick?.(event);
|
|
386
402
|
toggleSidebar();
|
|
387
403
|
}, ...props, children: jsx(PanelLeft, { size: 20, strokeWidth: 1.5, className: "text-foreground" }) }));
|
|
388
404
|
}
|
|
389
405
|
function SidebarRail({ className, ...props }) {
|
|
390
|
-
const { toggleSidebar } =
|
|
406
|
+
const { toggleSidebar } = useSidebarActions();
|
|
391
407
|
return (jsx("button", { "data-sidebar": "rail", "data-slot": "sidebar-rail", "aria-label": "Toggle Sidebar", tabIndex: -1, onClick: toggleSidebar, title: "Toggle Sidebar", className: cn(SidebarStem.sidebarRail, className), ...props }));
|
|
392
408
|
}
|
|
393
409
|
function PanelResizeHandle({ className, edge, isActive, startWidthPx, getShellWidth, onDragWidth, onDragComplete, ...props }) {
|
|
@@ -432,7 +448,8 @@ function PanelResizeHandle({ className, edge, isActive, startWidthPx, getShellWi
|
|
|
432
448
|
return (jsx("div", { ref: handleRef, "data-slot": "panel-resize-handle", "data-edge": edge, className: className, ...props }));
|
|
433
449
|
}
|
|
434
450
|
function SidebarResizeHandle({ className, side = 'left', ...props }) {
|
|
435
|
-
const { isOpen, sidebarWidthPx
|
|
451
|
+
const { isOpen, sidebarWidthPx } = useSidebarState();
|
|
452
|
+
const { setSidebarWidthPx, getShellWidth } = useSidebarActions();
|
|
436
453
|
const isSidebarSheetLayout = useIsSidebarSheetLayout();
|
|
437
454
|
const edge = side === 'left' ? 'trailing' : 'leading';
|
|
438
455
|
const onDragWidth = useCallback((rawPx) => {
|
|
@@ -489,7 +506,8 @@ function SidebarMenuSubItem({ className, ...props }) {
|
|
|
489
506
|
}
|
|
490
507
|
function SidebarMenuSubButton({ asChild = false, size = 'md', isActive = false, tooltip, className, onClick, ...props }) {
|
|
491
508
|
const Comp = asChild ? Slot : 'a';
|
|
492
|
-
const { isOpen
|
|
509
|
+
const { isOpen } = useSidebarState();
|
|
510
|
+
const { setOpen } = useSidebarActions();
|
|
493
511
|
const isSidebarSheetLayout = useIsSidebarSheetLayout();
|
|
494
512
|
const handleClick = (event) => {
|
|
495
513
|
if (isSidebarSheetLayout && isOpen)
|
|
@@ -507,4 +525,4 @@ function SidebarMenuSubButton({ asChild = false, size = 'md', isActive = false,
|
|
|
507
525
|
return (jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: button }), jsx(TooltipContent, { side: "right", align: "center", hidden: !isOpen || isSidebarSheetLayout, ...tooltip })] }));
|
|
508
526
|
}
|
|
509
527
|
|
|
510
|
-
export { DISMISS_CHAT_FOR_LAYOUT_EVENT, PanelResizeHandle, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarResizeHandle, SidebarSeparator, SidebarTrigger, useSidebar };
|
|
528
|
+
export { DISMISS_CHAT_FOR_LAYOUT_EVENT, PanelResizeHandle, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarResizeHandle, SidebarSeparator, SidebarTrigger, useSidebar, useSidebarActions, useSidebarState };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { Card, CardContent } from '../../ui/Card/Card.js';
|
|
3
|
-
import { CoffeeIcon, TrendUpIcon, TrendDownIcon } from '@phosphor-icons/react';
|
|
4
2
|
import React__default, { useMemo } from 'react';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { CoffeeIcon, TrendUpIcon, TrendDownIcon } from '@phosphor-icons/react';
|
|
4
|
+
import { Card, CardContent } from '../../ui/Card/Card.js';
|
|
5
|
+
import { Chip } from '../../ui/Chip/Chip.js';
|
|
8
6
|
import { LabelWithId } from '../../ui/LabelWithId/LabelWithId.js';
|
|
9
|
-
import S from './DriverCard.styl.js';
|
|
10
7
|
import { Skeleton } from '../../ui/Skeleton/Skeleton.js';
|
|
8
|
+
import { Tooltip, TooltipTrigger, TooltipContent } from '../../ui/Tooltip/Tooltip.js';
|
|
11
9
|
import { getCategoryIcon } from '../DriverMap/driverCategoryIcon.js';
|
|
10
|
+
import S from './DriverCard.styl.js';
|
|
11
|
+
import { DriverPerformanceChart } from './DriverPerformanceChart.js';
|
|
12
12
|
|
|
13
13
|
function DriverCard({ selectedDriver, isLoading, inQueue = false, driverSelector, }) {
|
|
14
14
|
const importanceDisplay = useMemo(() => {
|
|
@@ -83,7 +83,7 @@ function DriverCard({ selectedDriver, isLoading, inQueue = false, driverSelector
|
|
|
83
83
|
const directionText = direction > 0 ? 'Positive' : 'Negative';
|
|
84
84
|
const DirectionIcon = direction > 0 ? TrendUpIcon : TrendDownIcon;
|
|
85
85
|
const nameElem = (jsx("h4", { className: `${S.driverTitle} ${S.truncated}`, children: name }));
|
|
86
|
-
return (jsx(Card, { className: S.root, paddingSize: "l", radiusSize: "xl", children: jsx(CardContent, { noScroll: true, children: jsxs("div", { className: S.cardContent, children: [jsx("div", { className: S.driverHeader, children: jsxs("div", { className: S.headerContent, children: [jsxs("div", { className: S.topHeader, children: [jsxs("p", { className: S.categoryInfo, children: [jsx("span", { className: S.categoryIcon, children: getCategoryIcon(category) }), jsx("span", { className: S.categoryText, children: category })] }), driverSelector] }), name.length > 60 ? (jsxs(Tooltip, { children: [jsx(LabelWithId, { id: id, label: jsx(TooltipTrigger, { asChild: true, children: nameElem }) }), jsx(TooltipContent, { side: "left", className: S.tooltipContent, overTrigger: true, children: jsx("div", { className: S.tooltipTitle, children: name }) })] })) : (jsx(LabelWithId, { id: id, label: nameElem })), jsx("p", { className: S.regionDisplay, children: regionDisplay })] }) }), jsx("div", { className: S.metricsSection, children: jsx("div", { className: S.importanceScore, children: importanceDisplay }) }), jsxs("div", { className: S.directionLagSection, children: [jsxs(
|
|
86
|
+
return (jsx(Card, { className: S.root, paddingSize: "l", radiusSize: "xl", children: jsx(CardContent, { noScroll: true, children: jsxs("div", { className: S.cardContent, children: [jsx("div", { className: S.driverHeader, children: jsxs("div", { className: S.headerContent, children: [jsxs("div", { className: S.topHeader, children: [jsxs("p", { className: S.categoryInfo, children: [jsx("span", { className: S.categoryIcon, children: getCategoryIcon(category) }), jsx("span", { className: S.categoryText, children: category })] }), driverSelector] }), name.length > 60 ? (jsxs(Tooltip, { children: [jsx(LabelWithId, { id: id, label: jsx(TooltipTrigger, { asChild: true, children: nameElem }) }), jsx(TooltipContent, { side: "left", className: S.tooltipContent, overTrigger: true, children: jsx("div", { className: S.tooltipTitle, children: name }) })] })) : (jsx(LabelWithId, { id: id, label: nameElem })), jsx("p", { className: S.regionDisplay, children: regionDisplay })] }) }), jsx("div", { className: S.metricsSection, children: jsx("div", { className: S.importanceScore, children: importanceDisplay }) }), jsxs("div", { className: S.directionLagSection, children: [jsxs(Chip, { variant: direction > 0 ? 'positive' : 'negative', squared: true, className: S.directionBadge, children: [jsx(DirectionIcon, { className: S.trendIcon }), directionText, " correlation"] }), jsxs("span", { className: S.lagInfo, children: ["Lag: ", lag] })] }), jsx(DriverPerformanceChart, { driver: selectedDriver }), jsx("p", { className: S.description, children: summary ?? '' })] }) }) }));
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
export { DriverCard };
|
|
@@ -7,15 +7,15 @@ import { ChartContainer } from '../../ui/Chart/components/ChartContainer.js';
|
|
|
7
7
|
import '../../ui/Chart/Chart.context.js';
|
|
8
8
|
import '../../ui/Chart/Chart.styl.js';
|
|
9
9
|
import '../../ui/AnalysisLineIcon/AnalysisLineIcon.styl.js';
|
|
10
|
-
import '
|
|
11
|
-
import '../../ui/
|
|
10
|
+
import 'lucide-react';
|
|
11
|
+
import '../../ui/Chip/Chip.styl.js';
|
|
12
12
|
import '../../ui/LabelWithId/LabelWithId.styl.js';
|
|
13
13
|
import '@radix-ui/react-select';
|
|
14
|
-
import 'lucide-react';
|
|
15
14
|
import '../../ui/Select/Select.styl.js';
|
|
16
15
|
import '../../ui/TextShimmer/TextShimmer.js';
|
|
17
16
|
import '@phosphor-icons/react';
|
|
18
17
|
import '../../ui/AnalysesSelector/AnalysesSelector.styl.js';
|
|
18
|
+
import '@radix-ui/react-slot';
|
|
19
19
|
import '../../ui/Button/Button.styl.js';
|
|
20
20
|
import '../../ui/Input/Input.js';
|
|
21
21
|
import '../../ui/Tooltip/Tooltip.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import cn from 'classnames';
|
|
3
|
-
import {
|
|
3
|
+
import { Chip } from '../../../ui/Chip/Chip.js';
|
|
4
4
|
import { Tooltip, TooltipTrigger, TooltipContent } from '../../../ui/Tooltip/Tooltip.js';
|
|
5
5
|
import { getCategoryIcon } from '../driverCategoryIcon.js';
|
|
6
6
|
import S from './DriverIcon.styl.js';
|
|
@@ -15,7 +15,7 @@ function DriverIcon({ driver, size, isSelected, onClick, isVisible, isLoading =
|
|
|
15
15
|
left: `${driver.coordinates.x}%`,
|
|
16
16
|
top: `${driver.coordinates.y}%`,
|
|
17
17
|
zIndex: isSelected ? 2 : '',
|
|
18
|
-
}, children: jsx(
|
|
18
|
+
}, children: jsx(Chip, { variant: "neutral", squared: true, className: S.badge, children: jsx("div", { className: S.icon, children: getCategoryIcon(driver.category) }) }) }) }), jsx(TooltipContent, { side: "top", className: S.tooltipContent, children: jsxs("div", { className: S.tooltipSpacing, children: [jsxs("div", { className: S.tooltipCategory, children: [jsx("span", { className: S.tooltipCategoryIcon, children: getCategoryIcon(driver.category) }), jsx("span", { className: S.tooltipCategoryText, children: driver.category })] }), jsx("div", { className: S.tooltipName, children: driver.name })] }) })] }));
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export { BADGE_SIZES, DriverIcon };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styleInject from 'style-inject';
|
|
2
2
|
|
|
3
|
-
var css_248z = "@media (max-width:768px){:root{--page-x-padding:var(--p-6);--page-y-padding:var(--p-6)}}.DriverIcon_root__LJkZV{cursor:pointer;outline:none;position:absolute;transform:translateX(-50%) translateY(-50%)}.DriverIcon_root__LJkZV:hover{transition:transform .3s ease-out}.DriverIcon_root__LJkZV:focus{outline:none}.DriverIcon_badge__gV6XC,.DriverIcon_loadingHidden__fm2N0{opacity:0;pointer-events:none}.DriverIcon_badge__gV6XC{padding:.25rem;transform:translateY(10px);transition:all .3s ease-out}.DriverIcon_badge__gV6XC svg{height:20px;width:20px}.DriverIcon_size-s__5oC0V,.DriverIcon_size-s__5oC0V .DriverIcon_badge__gV6XC{border-radius:10px;height:2rem;width:2rem}.DriverIcon_size-m__HoK4J,.DriverIcon_size-m__HoK4J .DriverIcon_badge__gV6XC{border-radius:12px;height:2.5rem;width:2.5rem}.DriverIcon_size-l__6solM,.DriverIcon_size-l__6solM .DriverIcon_badge__gV6XC{border-radius:14px;height:3rem;width:3rem}.DriverIcon_visible__HVfIl .DriverIcon_badge__gV6XC{opacity:1;transform:translateY(0);transition:.3s ease-out;transition-property:opacity,transform}.DriverIcon_visible__HVfIl .DriverIcon_badge__gV6XC span{transition:box-shadow 0s ease-out .1s}.DriverIcon_root__LJkZV:first-child .DriverIcon_badge__gV6XC{transition-delay:30ms}.DriverIcon_visible__HVfIl:first-child .DriverIcon_badge__gV6XC{transition-delay:60ms}.DriverIcon_hidden__udGUf:first-child .DriverIcon_badge__gV6XC{transition-duration:.27s}.DriverIcon_root__LJkZV:nth-child(2) .DriverIcon_badge__gV6XC{transition-delay:60ms}.DriverIcon_visible__HVfIl:nth-child(2) .DriverIcon_badge__gV6XC{transition-delay:.12s}.DriverIcon_hidden__udGUf:nth-child(2) .DriverIcon_badge__gV6XC{transition-duration:.24s}.DriverIcon_root__LJkZV:nth-child(3) .DriverIcon_badge__gV6XC{transition-delay:90ms}.DriverIcon_visible__HVfIl:nth-child(3) .DriverIcon_badge__gV6XC{transition-delay:.18s}.DriverIcon_hidden__udGUf:nth-child(3) .DriverIcon_badge__gV6XC{transition-duration:.21s}.DriverIcon_root__LJkZV:nth-child(4) .DriverIcon_badge__gV6XC{transition-delay:.12s}.DriverIcon_visible__HVfIl:nth-child(4) .DriverIcon_badge__gV6XC{transition-delay:.24s}.DriverIcon_hidden__udGUf:nth-child(4) .DriverIcon_badge__gV6XC{transition-duration:.18s}.DriverIcon_root__LJkZV:nth-child(5) .DriverIcon_badge__gV6XC{transition-delay:.15s}.DriverIcon_visible__HVfIl:nth-child(5) .DriverIcon_badge__gV6XC{transition-delay:.3s}.DriverIcon_hidden__udGUf:nth-child(5) .DriverIcon_badge__gV6XC{transition-duration:.15s}.DriverIcon_root__LJkZV:nth-child(6) .DriverIcon_badge__gV6XC{transition-delay:.18s}.DriverIcon_visible__HVfIl:nth-child(6) .DriverIcon_badge__gV6XC{transition-delay:.36s}.DriverIcon_hidden__udGUf:nth-child(6) .DriverIcon_badge__gV6XC{transition-duration:.12s}.DriverIcon_root__LJkZV:hover{z-index:10}.DriverIcon_root__LJkZV:hover .DriverIcon_badge__gV6XC{box-shadow:0 0 0 1px var(--background);transform:scale(1.1);transition-delay:0ms;transition-duration:.2s}.DriverIcon_selected__-yaRV .DriverIcon_badge__gV6XC,.DriverIcon_selected__-yaRV:hover .DriverIcon_badge__gV6XC{box-shadow:inset 0 0 0 3px var(--sb-cyan-400);transform:scale(1.1)}.dark .DriverIcon_selected__-yaRV .DriverIcon_badge__gV6XC,.dark .DriverIcon_selected__-yaRV:hover .DriverIcon_badge__gV6XC{box-shadow:inset 0 0 0 2px var(--sb-cyan-500)}.DriverIcon_root__LJkZV:not(.DriverIcon_selected__-yaRV):hover .DriverIcon_icon__1XnNP{transform:scale(1.05)}.DriverIcon_tooltipContent__a5p3p{background-color:var(--popover);border:1px solid var(--border);box-shadow:0 10px 15px -3px rgba(0,0,0,.1);color:var(--popover-foreground);font-family:var(--font-family-body);font-size:.75rem;max-width:20rem}.DriverIcon_tooltipCategory__k036X{align-items:center;color:var(--muted-foreground);display:flex;gap:.25rem}.DriverIcon_tooltipCategoryIcon__CKac6{color:var(--muted-foreground);height:.75rem;width:.75rem}.DriverIcon_tooltipCategoryText__YaHvf{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}.DriverIcon_tooltipName__3YJCB{font-weight:400}.DriverIcon_tooltipSpacing__p2MvJ{display:flex;flex-direction:column;gap:.25rem}";
|
|
3
|
+
var css_248z = "@media (max-width:768px){:root{--page-x-padding:var(--p-6);--page-y-padding:var(--p-6)}}.DriverIcon_root__LJkZV{cursor:pointer;outline:none;position:absolute;transform:translateX(-50%) translateY(-50%)}.DriverIcon_root__LJkZV:hover{transition:transform .3s ease-out}.DriverIcon_root__LJkZV:focus{outline:none}.DriverIcon_badge__gV6XC,.DriverIcon_loadingHidden__fm2N0{opacity:0;pointer-events:none}.DriverIcon_badge__gV6XC{justify-content:center;padding:.25rem;transform:translateY(10px);transition:all .3s ease-out}.DriverIcon_badge__gV6XC svg{height:20px;width:20px}.DriverIcon_size-s__5oC0V,.DriverIcon_size-s__5oC0V .DriverIcon_badge__gV6XC{border-radius:10px;height:2rem;width:2rem}.DriverIcon_size-m__HoK4J,.DriverIcon_size-m__HoK4J .DriverIcon_badge__gV6XC{border-radius:12px;height:2.5rem;width:2.5rem}.DriverIcon_size-l__6solM,.DriverIcon_size-l__6solM .DriverIcon_badge__gV6XC{border-radius:14px;height:3rem;width:3rem}.DriverIcon_visible__HVfIl .DriverIcon_badge__gV6XC{opacity:1;transform:translateY(0);transition:.3s ease-out;transition-property:opacity,transform}.DriverIcon_visible__HVfIl .DriverIcon_badge__gV6XC span{transition:box-shadow 0s ease-out .1s}.DriverIcon_root__LJkZV:first-child .DriverIcon_badge__gV6XC{transition-delay:30ms}.DriverIcon_visible__HVfIl:first-child .DriverIcon_badge__gV6XC{transition-delay:60ms}.DriverIcon_hidden__udGUf:first-child .DriverIcon_badge__gV6XC{transition-duration:.27s}.DriverIcon_root__LJkZV:nth-child(2) .DriverIcon_badge__gV6XC{transition-delay:60ms}.DriverIcon_visible__HVfIl:nth-child(2) .DriverIcon_badge__gV6XC{transition-delay:.12s}.DriverIcon_hidden__udGUf:nth-child(2) .DriverIcon_badge__gV6XC{transition-duration:.24s}.DriverIcon_root__LJkZV:nth-child(3) .DriverIcon_badge__gV6XC{transition-delay:90ms}.DriverIcon_visible__HVfIl:nth-child(3) .DriverIcon_badge__gV6XC{transition-delay:.18s}.DriverIcon_hidden__udGUf:nth-child(3) .DriverIcon_badge__gV6XC{transition-duration:.21s}.DriverIcon_root__LJkZV:nth-child(4) .DriverIcon_badge__gV6XC{transition-delay:.12s}.DriverIcon_visible__HVfIl:nth-child(4) .DriverIcon_badge__gV6XC{transition-delay:.24s}.DriverIcon_hidden__udGUf:nth-child(4) .DriverIcon_badge__gV6XC{transition-duration:.18s}.DriverIcon_root__LJkZV:nth-child(5) .DriverIcon_badge__gV6XC{transition-delay:.15s}.DriverIcon_visible__HVfIl:nth-child(5) .DriverIcon_badge__gV6XC{transition-delay:.3s}.DriverIcon_hidden__udGUf:nth-child(5) .DriverIcon_badge__gV6XC{transition-duration:.15s}.DriverIcon_root__LJkZV:nth-child(6) .DriverIcon_badge__gV6XC{transition-delay:.18s}.DriverIcon_visible__HVfIl:nth-child(6) .DriverIcon_badge__gV6XC{transition-delay:.36s}.DriverIcon_hidden__udGUf:nth-child(6) .DriverIcon_badge__gV6XC{transition-duration:.12s}.DriverIcon_root__LJkZV:hover{z-index:10}.DriverIcon_root__LJkZV:hover .DriverIcon_badge__gV6XC{box-shadow:0 0 0 1px var(--background);transform:scale(1.1);transition-delay:0ms;transition-duration:.2s}.DriverIcon_selected__-yaRV .DriverIcon_badge__gV6XC,.DriverIcon_selected__-yaRV:hover .DriverIcon_badge__gV6XC{box-shadow:inset 0 0 0 3px var(--sb-cyan-400);transform:scale(1.1)}.dark .DriverIcon_selected__-yaRV .DriverIcon_badge__gV6XC,.dark .DriverIcon_selected__-yaRV:hover .DriverIcon_badge__gV6XC{box-shadow:inset 0 0 0 2px var(--sb-cyan-500)}.DriverIcon_root__LJkZV:not(.DriverIcon_selected__-yaRV):hover .DriverIcon_icon__1XnNP{transform:scale(1.05)}.DriverIcon_tooltipContent__a5p3p{background-color:var(--popover);border:1px solid var(--border);box-shadow:0 10px 15px -3px rgba(0,0,0,.1);color:var(--popover-foreground);font-family:var(--font-family-body);font-size:.75rem;max-width:20rem}.DriverIcon_tooltipCategory__k036X{align-items:center;color:var(--muted-foreground);display:flex;gap:.25rem}.DriverIcon_tooltipCategoryIcon__CKac6{color:var(--muted-foreground);height:.75rem;width:.75rem}.DriverIcon_tooltipCategoryText__YaHvf{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}.DriverIcon_tooltipName__3YJCB{font-weight:400}.DriverIcon_tooltipSpacing__p2MvJ{display:flex;flex-direction:column;gap:.25rem}";
|
|
4
4
|
var S = {"root":"DriverIcon_root__LJkZV","loadingHidden":"DriverIcon_loadingHidden__fm2N0","badge":"DriverIcon_badge__gV6XC","size-s":"DriverIcon_size-s__5oC0V","size-m":"DriverIcon_size-m__HoK4J","size-l":"DriverIcon_size-l__6solM","visible":"DriverIcon_visible__HVfIl","hidden":"DriverIcon_hidden__udGUf","selected":"DriverIcon_selected__-yaRV","icon":"DriverIcon_icon__1XnNP","tooltipContent":"DriverIcon_tooltipContent__a5p3p","tooltipCategory":"DriverIcon_tooltipCategory__k036X","tooltipCategoryIcon":"DriverIcon_tooltipCategoryIcon__CKac6","tooltipCategoryText":"DriverIcon_tooltipCategoryText__YaHvf","tooltipName":"DriverIcon_tooltipName__3YJCB","tooltipSpacing":"DriverIcon_tooltipSpacing__p2MvJ"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
@@ -19,6 +19,7 @@ import '../../ui/Page/PageEmptyCanvas/PageEmptyCanvas.styl.js';
|
|
|
19
19
|
import '../../ui/Page/PageContent/PageContent.styl.js';
|
|
20
20
|
import '@homecode/ui';
|
|
21
21
|
import '../../ui/Page/PageScroll/PageScroll.styl.js';
|
|
22
|
+
import '../../../tools/env.js';
|
|
22
23
|
import { PageXScroll } from '../../ui/Page/PageXScroll/PageXScroll.js';
|
|
23
24
|
import '../../ui/Logo/Logo.styl.js';
|
|
24
25
|
import '../../ui/Page/PageFooter/PageFooter.styl.js';
|
|
@@ -18,6 +18,7 @@ import '../../ui/Page/PageEmptyCanvas/PageEmptyCanvas.styl.js';
|
|
|
18
18
|
import '../../ui/Page/PageContent/PageContent.styl.js';
|
|
19
19
|
import '@homecode/ui';
|
|
20
20
|
import '../../ui/Page/PageScroll/PageScroll.styl.js';
|
|
21
|
+
import '../../../tools/env.js';
|
|
21
22
|
import { PageXScroll } from '../../ui/Page/PageXScroll/PageXScroll.js';
|
|
22
23
|
import '../../ui/Logo/Logo.styl.js';
|
|
23
24
|
import '../../ui/Page/PageFooter/PageFooter.styl.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styleInject from 'style-inject';
|
|
2
2
|
|
|
3
|
-
var css_248z = "@media (max-width:768px){:root{--page-x-padding:var(--p-6);--page-y-padding:var(--p-6)}}.SybilionAppHeader_actionsAnchor__ress2
|
|
3
|
+
var css_248z = "@media (max-width:768px){:root{--page-x-padding:var(--p-6);--page-y-padding:var(--p-6)}}.SybilionAppHeader_actionsAnchor__ress2{align-items:center;display:flex;flex-shrink:0;gap:var(--p-2)}.SybilionAppHeader_pageActionsPortal__9C5ww{align-items:center;display:flex;flex-shrink:0;gap:var(--p-1)}.SybilionAppHeader_pageActionsPortal__9C5ww:empty{display:none}.SybilionAppHeader_logoArea__3HAhG{align-items:center;display:flex;gap:var(--p-2);left:40px;position:absolute;top:22px;z-index:10}@media (max-width:768px){.SybilionAppHeader_logoArea__3HAhG{left:22px}}@media (min-width:768px){[data-slot=sidebar-wrapper][data-state=expanded]:not([data-slot=app-shell] [data-slot=sidebar-wrapper]) [data-slot=app-shell]:not([data-slot=app-shell] [data-slot=app-shell]) .SybilionAppHeader_logoArea__3HAhG:not([data-slot=app-shell] [data-slot=app-shell] *){left:calc(var(--sidebar-width)*-1 + 52px);position:absolute}[data-slot=app-shell] [data-slot=sidebar-wrapper][data-state=expanded] [data-slot=app-shell] .SybilionAppHeader_logoArea__3HAhG{left:calc(var(--sidebar-width)*-1 + 44px);position:absolute}[data-slot=app-shell] [data-slot=sidebar-wrapper][data-state=collapsed] [data-slot=app-shell] .SybilionAppHeader_logoArea__3HAhG{left:var(--p-8);position:absolute}}.SybilionAppHeader_logoLink__bH-KX{align-items:center;color:var(--color-foreground);display:flex;font-size:1.5rem;font-weight:400;gap:.5rem;text-decoration:none;white-space:nowrap;width:-moz-fit-content;width:fit-content}.SybilionAppHeader_logoLink__bH-KX svg{display:inline-flex;flex-shrink:0;height:32px;transition:transform .1s ease-in-out;width:auto}.SybilionAppHeader_logoLink__bH-KX:hover svg{transform:scale(1.05)}";
|
|
4
4
|
var S = {"actionsAnchor":"SybilionAppHeader_actionsAnchor__ress2","pageActionsPortal":"SybilionAppHeader_pageActionsPortal__9C5ww","logoArea":"SybilionAppHeader_logoArea__3HAhG","logoLink":"SybilionAppHeader_logoLink__bH-KX"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
package/dist/esm/index.js
CHANGED
|
@@ -14,7 +14,6 @@ export { AnalysisLineIcon } from './components/ui/AnalysisLineIcon/AnalysisLineI
|
|
|
14
14
|
export { AppHeaderHost, AppHeaderPortal } from './components/ui/AppHeader/AppHeader.js';
|
|
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
|
-
export { Badge } from './components/ui/Badge/Badge.js';
|
|
18
17
|
export { Banner } from './components/ui/Banner/Banner.js';
|
|
19
18
|
export { Chip } from './components/ui/Chip/Chip.js';
|
|
20
19
|
export { Kicker } from './components/ui/Kicker/Kicker.js';
|
|
@@ -22,6 +21,7 @@ export { PullQuote } from './components/ui/PullQuote/PullQuote.js';
|
|
|
22
21
|
export { SignalCard } from './components/ui/SignalCard/SignalCard.js';
|
|
23
22
|
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from './components/ui/Breadcrumb/Breadcrumb.js';
|
|
24
23
|
export { Button } from './components/ui/Button/Button.js';
|
|
24
|
+
export { ButtonGroup } from './components/ui/ButtonGroup/ButtonGroup.js';
|
|
25
25
|
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, LinkCard } from './components/ui/Card/Card.js';
|
|
26
26
|
export { ChartLegend, ChartTooltip } from './components/ui/Chart/Chart.js';
|
|
27
27
|
export { THEMES } from './components/ui/Chart/Chart.types.js';
|
|
@@ -78,6 +78,8 @@ export { PageHeader } from './components/ui/Page/PageHeader/PageHeader.js';
|
|
|
78
78
|
export { PageEmptyCanvas } from './components/ui/Page/PageEmptyCanvas/PageEmptyCanvas.js';
|
|
79
79
|
export { PageContent, PageContentSection } from './components/ui/Page/PageContent/PageContent.js';
|
|
80
80
|
export { PageScroll } from './components/ui/Page/PageScroll/PageScroll.js';
|
|
81
|
+
export { usePageScrollRestoration } from './components/ui/Page/usePageScrollRestoration.js';
|
|
82
|
+
export { readSavedScrollTop } from './components/ui/Page/pageScrollRestoration.js';
|
|
81
83
|
export { PageXScroll } from './components/ui/Page/PageXScroll/PageXScroll.js';
|
|
82
84
|
export { Breadcrumbs } from './components/ui/Page/Breadcrumbs/Breadcrumbs.js';
|
|
83
85
|
export { PageFooter } from './components/ui/Page/PageFooter/PageFooter.js';
|
|
@@ -90,7 +92,7 @@ export { Renamer } from './components/ui/Renamer/Renamer.js';
|
|
|
90
92
|
export { Select, SelectContent, SelectGroup, SelectItem, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue } from './components/ui/Select/Select.js';
|
|
91
93
|
export { Separator } from './components/ui/Separator/Separator.js';
|
|
92
94
|
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from './components/ui/Sheet/Sheet.js';
|
|
93
|
-
export { DISMISS_CHAT_FOR_LAYOUT_EVENT, PanelResizeHandle, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarResizeHandle, SidebarSeparator, SidebarTrigger, useSidebar } from './components/ui/Sidebar/Sidebar.js';
|
|
95
|
+
export { DISMISS_CHAT_FOR_LAYOUT_EVENT, PanelResizeHandle, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarResizeHandle, SidebarSeparator, SidebarTrigger, useSidebar, useSidebarActions, useSidebarState } from './components/ui/Sidebar/Sidebar.js';
|
|
94
96
|
export { Skeleton } from './components/ui/Skeleton/Skeleton.js';
|
|
95
97
|
export { Slider } from './components/ui/Slider/Slider.js';
|
|
96
98
|
export { SmartTextTruncate } from './components/ui/SmartTextTruncate/SmartTextTruncate.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ChipProps } from './Chip.types';
|
|
2
|
-
declare function Chip({ className, variant, dot, trend, children, ...props }: ChipProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare function Chip({ className, variant, dot, trend, squared, children, ...props }: ChipProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export { Chip };
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { type ComponentProps } from 'react';
|
|
2
|
-
export type ChipVariant = 'neutral' | 'line' | 'active' | 'filled' | 'accent' | 'positive' | 'negative';
|
|
2
|
+
export type ChipVariant = 'neutral' | 'line' | 'active' | 'filled' | 'accent' | 'positive' | 'negative' | 'yellow';
|
|
3
3
|
export type ChipTrend = 'up' | 'down';
|
|
4
4
|
export interface ChipProps extends ComponentProps<'span'> {
|
|
5
5
|
variant?: ChipVariant;
|
|
6
6
|
/**
|
|
7
7
|
* Show the 6px status dot. Defaults to true for the neutral variant
|
|
8
|
-
* and false for all others.
|
|
8
|
+
* (when not squared) and false for all others.
|
|
9
9
|
*/
|
|
10
10
|
dot?: boolean;
|
|
11
11
|
/** Render a Lucide trend arrow before the label. */
|
|
12
12
|
trend?: ChipTrend;
|
|
13
|
+
/** Use compact squared corners instead of the default pill shape. */
|
|
14
|
+
squared?: boolean;
|
|
13
15
|
}
|
|
@@ -5,6 +5,8 @@ export { PageHeader } from './PageHeader/PageHeader';
|
|
|
5
5
|
export { PageEmptyCanvas } from './PageEmptyCanvas/PageEmptyCanvas';
|
|
6
6
|
export { PageContent, PageContentSection } from './PageContent/PageContent';
|
|
7
7
|
export { PageScroll } from './PageScroll/PageScroll';
|
|
8
|
+
export { usePageScrollRestoration } from './usePageScrollRestoration';
|
|
9
|
+
export { readSavedScrollTop } from './pageScrollRestoration';
|
|
8
10
|
export { PageXScroll } from './PageXScroll/PageXScroll';
|
|
9
11
|
export { Breadcrumbs } from './Breadcrumbs/Breadcrumbs';
|
|
10
12
|
export { PageFooter } from './PageFooter/PageFooter';
|
|
@@ -15,22 +15,27 @@ export type SetSidebarOpenOptions = {
|
|
|
15
15
|
/** Nav closed for layout (chat/width); restore when chat closes — do not persist closed cookie. */
|
|
16
16
|
layoutAutoClose?: boolean;
|
|
17
17
|
};
|
|
18
|
-
type
|
|
19
|
-
isOpen: boolean;
|
|
18
|
+
type SidebarActionsContextProps = {
|
|
20
19
|
setOpen: (open: boolean, options?: SetSidebarOpenOptions) => void;
|
|
21
20
|
toggleSidebar: () => void;
|
|
22
|
-
sidebarWidthPx: number;
|
|
23
21
|
setSidebarWidthPx: (px: number, options?: SetPanelWidthOptions) => void;
|
|
24
|
-
chatWidthPx: number;
|
|
25
22
|
setChatWidthPx: (px: number, options?: SetPanelWidthOptions) => void;
|
|
26
|
-
chatPanelOpen: boolean;
|
|
27
23
|
setChatPanelOpen: (open: boolean) => void;
|
|
28
24
|
getShellWidth: () => number;
|
|
25
|
+
/** Read shell chat open without subscribing to SidebarStateContext. */
|
|
26
|
+
getChatPanelOpen: () => boolean;
|
|
27
|
+
};
|
|
28
|
+
type SidebarStateContextProps = {
|
|
29
|
+
isOpen: boolean;
|
|
30
|
+
sidebarWidthPx: number;
|
|
31
|
+
chatWidthPx: number;
|
|
32
|
+
chatPanelOpen: boolean;
|
|
29
33
|
/** Portal target for the AI chat side panel (right column). */
|
|
30
34
|
chatPanelContainer: HTMLDivElement | null;
|
|
31
35
|
/** App shell wrapper; used to set `--chat-panel-width` (and `--chat-panel-height` on mobile only). */
|
|
32
36
|
sidebarWrapperRef: RefObject<HTMLDivElement | null>;
|
|
33
37
|
};
|
|
38
|
+
type SidebarContextProps = SidebarStateContextProps & SidebarActionsContextProps;
|
|
34
39
|
type SidebarProps = ComponentProps<'div'> & {
|
|
35
40
|
defaultOpen?: boolean;
|
|
36
41
|
open?: boolean;
|
|
@@ -41,6 +46,8 @@ type SidebarProps = ComponentProps<'div'> & {
|
|
|
41
46
|
fullHeightResizer?: boolean;
|
|
42
47
|
brandText?: string;
|
|
43
48
|
};
|
|
49
|
+
declare function useSidebarActions(): SidebarActionsContextProps;
|
|
50
|
+
declare function useSidebarState(): SidebarStateContextProps;
|
|
44
51
|
declare function useSidebar(): SidebarContextProps;
|
|
45
52
|
declare function SidebarProvider({ defaultOpen, className, style, children, userId, sidebarWidthStorageKey, persistSidebarWidthWithoutConsent, ...props }: ComponentProps<'div'> & {
|
|
46
53
|
defaultOpen?: boolean;
|
|
@@ -91,4 +98,4 @@ declare function SidebarMenuSubButton({ asChild, size, isActive, tooltip, classN
|
|
|
91
98
|
isActive?: boolean;
|
|
92
99
|
tooltip?: string | ComponentProps<typeof TooltipContent>;
|
|
93
100
|
}): import("react/jsx-runtime").JSX.Element;
|
|
94
|
-
export { PanelResizeHandle, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarResizeHandle, SidebarSeparator, SidebarTrigger, useSidebar, };
|
|
101
|
+
export { PanelResizeHandle, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarResizeHandle, SidebarSeparator, SidebarTrigger, useSidebar, useSidebarActions, useSidebarState, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function ButtonGroupPage(): import("react/jsx-runtime").JSX.Element;
|