@sybilion/uilib 1.4.13 → 1.4.15
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/DriversComparisonChart/DriversComparisonChart.js +26 -5
- package/dist/esm/components/widgets/PerformanceChart/PerformanceTable.js +26 -4
- 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 -106
- 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/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 -621
- package/src/components/ui/Sidebar/Sidebar.styl.d.ts +0 -33
- package/src/components/ui/Sidebar/Sidebar.tsx +25 -1145
- 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/DriversComparisonChart/AGENT.md +0 -4
- package/src/components/widgets/PerformanceChart/AGENT.md +0 -4
- package/src/components/widgets/SidebarDatasetsItemsGrouped/AGENT.md +28 -11
- package/src/docs/components/DocsGuidance/DocsGuidance.styl +1 -0
- package/src/docs/components/DocsSidebar/DocsSidebar.tsx +14 -8
- package/src/docs/pages/SmartTextTruncatePage.styl +2 -14
- package/src/docs/pages/SmartTextTruncatePage.styl.d.ts +0 -1
- package/src/docs/pages/SmartTextTruncatePage.tsx +0 -6
- package/dist/esm/components/ui/Sidebar/Sidebar.js +0 -541
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ComponentProps, RefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
/** Pass `viewTransition: false` to avoid nesting `document.startViewTransition` (e.g. chat open already animating). */
|
|
4
|
+
export type SetSidebarOpenOptions = {
|
|
5
|
+
viewTransition?: boolean;
|
|
6
|
+
/** Nav closed for layout (chat/width); restore when chat closes — do not persist closed cookie. */
|
|
7
|
+
layoutAutoClose?: boolean;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type SetPanelWidthOptions = { persist?: boolean };
|
|
11
|
+
|
|
12
|
+
export type SidebarActionsContextProps = {
|
|
13
|
+
setOpen: (open: boolean, options?: SetSidebarOpenOptions) => void;
|
|
14
|
+
toggleSidebar: () => void;
|
|
15
|
+
setSidebarWidthPx: (px: number, options?: SetPanelWidthOptions) => void;
|
|
16
|
+
setChatWidthPx: (px: number, options?: SetPanelWidthOptions) => void;
|
|
17
|
+
setChatPanelOpen: (open: boolean) => void;
|
|
18
|
+
getShellWidth: () => number;
|
|
19
|
+
/** Read shell chat open without subscribing to SidebarStateContext. */
|
|
20
|
+
getChatPanelOpen: () => boolean;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type SidebarStateContextProps = {
|
|
24
|
+
isOpen: boolean;
|
|
25
|
+
sidebarWidthPx: number;
|
|
26
|
+
chatWidthPx: number;
|
|
27
|
+
chatPanelOpen: boolean;
|
|
28
|
+
/** Portal target for the AI chat side panel (right column). */
|
|
29
|
+
chatPanelContainer: HTMLDivElement | null;
|
|
30
|
+
/** App shell wrapper; used to set `--chat-panel-width` (and `--chat-panel-height` on mobile only). */
|
|
31
|
+
sidebarWrapperRef: RefObject<HTMLDivElement | null>;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type SidebarContextProps = SidebarStateContextProps &
|
|
35
|
+
SidebarActionsContextProps;
|
|
36
|
+
|
|
37
|
+
export type SidebarProps = ComponentProps<'div'> & {
|
|
38
|
+
defaultOpen?: boolean;
|
|
39
|
+
open?: boolean;
|
|
40
|
+
onOpenChange?: (open: boolean) => void;
|
|
41
|
+
side?: 'left' | 'right';
|
|
42
|
+
variant?: 'sidebar' | 'floating' | 'inset';
|
|
43
|
+
collapsible?: 'offcanvas' | 'icon' | 'none';
|
|
44
|
+
fullHeightResizer?: boolean;
|
|
45
|
+
brandText?: string;
|
|
46
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { CSSProperties, useEffect, useRef } from 'react';
|
|
2
|
+
import { Sheet, SheetContent } from '#uilib/components/ui/Sheet';
|
|
3
|
+
import { useSidebarActions, useSidebarState } from './sidebarContext';
|
|
4
|
+
|
|
5
|
+
import { Logo } from '#uilib/components/ui/Logo/Logo';
|
|
6
|
+
import S from './Sidebar.styl';
|
|
7
|
+
import { SIDEBAR_WIDTH_MOBILE } from './sidebarConstants';
|
|
8
|
+
import type { SidebarProps } from './Sidebar.types';
|
|
9
|
+
import { SidebarResizeHandle } from './SidebarResizeHandle/SidebarResizeHandle';
|
|
10
|
+
import cn from 'classnames';
|
|
11
|
+
import { useIsSidebarSheetLayout } from '#uilib/hooks/useIsSidebarSheetLayout';
|
|
12
|
+
|
|
13
|
+
export function Sidebar({
|
|
14
|
+
defaultOpen = true,
|
|
15
|
+
open: openProp,
|
|
16
|
+
onOpenChange: setOpenProp,
|
|
17
|
+
className,
|
|
18
|
+
side = 'left',
|
|
19
|
+
variant = 'sidebar',
|
|
20
|
+
collapsible = 'offcanvas',
|
|
21
|
+
children,
|
|
22
|
+
fullHeightResizer = false,
|
|
23
|
+
brandText = 'Sybilion',
|
|
24
|
+
...props
|
|
25
|
+
}: SidebarProps) {
|
|
26
|
+
const isSidebarSheetLayout = useIsSidebarSheetLayout();
|
|
27
|
+
const { isOpen } = useSidebarState();
|
|
28
|
+
const { setOpen } = useSidebarActions();
|
|
29
|
+
|
|
30
|
+
const prevSheetLayoutRef = useRef(isSidebarSheetLayout);
|
|
31
|
+
|
|
32
|
+
/** Narrow shell: sidebar is a sheet; collapse only when crossing into this mode. */
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
const enteredSheetLayout =
|
|
35
|
+
isSidebarSheetLayout && !prevSheetLayoutRef.current;
|
|
36
|
+
prevSheetLayoutRef.current = isSidebarSheetLayout;
|
|
37
|
+
if (enteredSheetLayout) setOpen(false);
|
|
38
|
+
}, [isSidebarSheetLayout, setOpen]);
|
|
39
|
+
|
|
40
|
+
if (collapsible === 'none') {
|
|
41
|
+
return (
|
|
42
|
+
<div
|
|
43
|
+
data-slot="sidebar"
|
|
44
|
+
className={cn(S.sidebarNone, className)}
|
|
45
|
+
{...props}
|
|
46
|
+
>
|
|
47
|
+
{children}
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (isSidebarSheetLayout) {
|
|
53
|
+
return (
|
|
54
|
+
<Sheet open={isOpen} onOpenChange={setOpen} {...props}>
|
|
55
|
+
<SheetContent
|
|
56
|
+
data-sidebar="sidebar"
|
|
57
|
+
data-slot="sidebar"
|
|
58
|
+
className={cn(S.sheetContentSidebar, className)}
|
|
59
|
+
style={
|
|
60
|
+
{
|
|
61
|
+
'--gap-top': '40px',
|
|
62
|
+
'--sidebar-width': SIDEBAR_WIDTH_MOBILE,
|
|
63
|
+
} as CSSProperties
|
|
64
|
+
}
|
|
65
|
+
side={side}
|
|
66
|
+
>
|
|
67
|
+
<div className={cn(S.sheetSidebarInner)} data-sheet-sidebar-inner="">
|
|
68
|
+
<div className={S.sheetSidebarLogo}>
|
|
69
|
+
<Logo size="md" brandText={brandText} />
|
|
70
|
+
</div>
|
|
71
|
+
{children}
|
|
72
|
+
</div>
|
|
73
|
+
</SheetContent>
|
|
74
|
+
</Sheet>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<aside
|
|
80
|
+
className={cn(S.sidebar, S[`variant-${variant}`], className)}
|
|
81
|
+
data-full-height-resizer={fullHeightResizer ? '' : undefined}
|
|
82
|
+
data-state={isOpen ? 'expanded' : 'collapsed'}
|
|
83
|
+
data-collapsible={!isOpen ? collapsible : ''}
|
|
84
|
+
data-variant={variant}
|
|
85
|
+
data-side={side}
|
|
86
|
+
{...props}
|
|
87
|
+
>
|
|
88
|
+
{children}
|
|
89
|
+
<SidebarResizeHandle side={side} />
|
|
90
|
+
</aside>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@import '../../../../lib/theme.styl';
|
|
2
|
+
|
|
3
|
+
.sidebarContent
|
|
4
|
+
position absolute
|
|
5
|
+
display flex
|
|
6
|
+
flex 1
|
|
7
|
+
flex-direction column
|
|
8
|
+
gap var(--p-16)
|
|
9
|
+
overflow auto
|
|
10
|
+
|
|
11
|
+
width 100%
|
|
12
|
+
height 100vh
|
|
13
|
+
min-height 0
|
|
14
|
+
max-height 100%
|
|
15
|
+
|
|
16
|
+
@media (min-width MOBILE)
|
|
17
|
+
height calc(100vh - var(--gap-top) - var(--app-banner-height, 0px))
|
|
18
|
+
|
|
19
|
+
&[data-collapsible="icon"]
|
|
20
|
+
overflow hidden
|
|
21
|
+
|
|
22
|
+
[data-sheet-sidebar-inner] &
|
|
23
|
+
position relative
|
|
24
|
+
flex 1
|
|
25
|
+
min-height 0
|
|
26
|
+
height auto
|
|
27
|
+
max-height none
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
|
|
4
|
+
import { Scroll } from '@homecode/ui';
|
|
5
|
+
|
|
6
|
+
import S from './SidebarContent.styl';
|
|
7
|
+
|
|
8
|
+
export function SidebarContent({
|
|
9
|
+
className,
|
|
10
|
+
innerClassName,
|
|
11
|
+
children,
|
|
12
|
+
}: ComponentProps<typeof Scroll>) {
|
|
13
|
+
// const sidebarContentTransition = useViewTransition({
|
|
14
|
+
// transitionName: 'sidebar-content',
|
|
15
|
+
// });
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Scroll
|
|
19
|
+
y
|
|
20
|
+
autoHide
|
|
21
|
+
fadeSize="l"
|
|
22
|
+
offset={{ y: { before: 40, after: 20 } }}
|
|
23
|
+
className={cn(S.sidebarContent, className)}
|
|
24
|
+
innerClassName={innerClassName}
|
|
25
|
+
>
|
|
26
|
+
{children}
|
|
27
|
+
</Scroll>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
|
|
4
|
+
import S from './SidebarFooter.styl';
|
|
5
|
+
|
|
6
|
+
export function SidebarFooter({ className, ...props }: ComponentProps<'div'>) {
|
|
7
|
+
return (
|
|
8
|
+
<div
|
|
9
|
+
data-slot="sidebar-footer"
|
|
10
|
+
data-sidebar="footer"
|
|
11
|
+
className={cn(S.sidebarFooter, className)}
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
|
|
4
|
+
import S from './SidebarGroup.styl';
|
|
5
|
+
|
|
6
|
+
export function SidebarGroup({ className, ...props }: ComponentProps<'div'>) {
|
|
7
|
+
return (
|
|
8
|
+
<div
|
|
9
|
+
data-slot="sidebar-group"
|
|
10
|
+
data-sidebar="group"
|
|
11
|
+
className={cn(S.sidebarGroup, className)}
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
@import '../../../../lib/theme.styl';
|
|
2
|
+
|
|
3
|
+
.sidebarGroupAction
|
|
4
|
+
color var(--sidebar-foreground)
|
|
5
|
+
position absolute
|
|
6
|
+
top 0.875rem
|
|
7
|
+
right 0.75rem
|
|
8
|
+
display flex
|
|
9
|
+
aspect-ratio 1
|
|
10
|
+
width 1.25rem
|
|
11
|
+
align-items center
|
|
12
|
+
justify-content center
|
|
13
|
+
border-radius 0.375rem
|
|
14
|
+
padding 0
|
|
15
|
+
outline none
|
|
16
|
+
transition transform
|
|
17
|
+
&:hover
|
|
18
|
+
background-color var(--sidebar-accent)
|
|
19
|
+
color var(--sidebar-accent-foreground)
|
|
20
|
+
&:focus-visible
|
|
21
|
+
box-shadow 0 0 0 2px var(--sidebar-ring)
|
|
22
|
+
& > svg
|
|
23
|
+
width 1rem
|
|
24
|
+
height 1rem
|
|
25
|
+
flex-shrink 0
|
|
26
|
+
&::after
|
|
27
|
+
content ""
|
|
28
|
+
position absolute
|
|
29
|
+
inset -0.5rem
|
|
30
|
+
@media (min-width 768px)
|
|
31
|
+
&::after
|
|
32
|
+
display none
|
|
33
|
+
&[data-collapsible="icon"]
|
|
34
|
+
display none
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
|
|
4
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
5
|
+
|
|
6
|
+
import S from './SidebarGroupAction.styl';
|
|
7
|
+
|
|
8
|
+
export function SidebarGroupAction({
|
|
9
|
+
className,
|
|
10
|
+
asChild = false,
|
|
11
|
+
...props
|
|
12
|
+
}: ComponentProps<'button'> & { asChild?: boolean }) {
|
|
13
|
+
const Comp = asChild ? Slot : 'button';
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<Comp
|
|
17
|
+
data-slot="sidebar-group-action"
|
|
18
|
+
data-sidebar="group-action"
|
|
19
|
+
className={cn(S.sidebarGroupAction, className)}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
@import '../../../../lib/theme.styl';
|
|
2
|
+
|
|
3
|
+
.sidebarMenu
|
|
4
|
+
display flex
|
|
5
|
+
flex-direction column
|
|
6
|
+
gap var(--p-4)
|
|
7
|
+
width 100%
|
|
8
|
+
min-width 0
|
|
9
|
+
padding 0 var(--p-11) var(--p-10) var(--p-8)
|
|
10
|
+
list-style none
|
|
11
|
+
|
|
12
|
+
@media (max-width unit(MOBILE, 'px'))
|
|
13
|
+
padding-right var(--p-8)
|
|
14
|
+
|
|
15
|
+
.sidebarMenuItem
|
|
16
|
+
position relative
|
|
17
|
+
cursor pointer
|
|
18
|
+
|
|
19
|
+
.sidebarMenuBadge
|
|
20
|
+
color var(--sidebar-foreground)
|
|
21
|
+
pointer-events none
|
|
22
|
+
position absolute
|
|
23
|
+
right 0.25rem
|
|
24
|
+
display flex
|
|
25
|
+
height 1.25rem
|
|
26
|
+
min-width 1.25rem
|
|
27
|
+
align-items center
|
|
28
|
+
justify-content center
|
|
29
|
+
border-radius 0.375rem
|
|
30
|
+
padding-left 0.25rem
|
|
31
|
+
padding-right 0.25rem
|
|
32
|
+
font-weight 500
|
|
33
|
+
user-select none
|
|
34
|
+
&[data-size="sm"]
|
|
35
|
+
top 0.25rem
|
|
36
|
+
&[data-size="md"]
|
|
37
|
+
top 0.375rem
|
|
38
|
+
&[data-size="lg"]
|
|
39
|
+
top 0.625rem
|
|
40
|
+
&[data-collapsible="icon"]
|
|
41
|
+
display none
|
|
42
|
+
|
|
43
|
+
.sidebarMenuSkeleton
|
|
44
|
+
display flex
|
|
45
|
+
height 2rem
|
|
46
|
+
align-items center
|
|
47
|
+
gap 0.5rem
|
|
48
|
+
border-radius 0.375rem
|
|
49
|
+
padding-left 0.5rem
|
|
50
|
+
padding-right 0.5rem
|
|
51
|
+
|
|
52
|
+
.sidebarMenuSkeletonIcon
|
|
53
|
+
width 1rem
|
|
54
|
+
height 1rem
|
|
55
|
+
border-radius 0.375rem
|
|
56
|
+
|
|
57
|
+
.sidebarMenuSkeletonText
|
|
58
|
+
height 1rem
|
|
59
|
+
flex 1
|
|
60
|
+
max-width var(--skeleton-width)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This file is automatically generated.
|
|
2
|
+
// Please do not change this file!
|
|
3
|
+
interface CssExports {
|
|
4
|
+
'sidebarMenu': string;
|
|
5
|
+
'sidebarMenuBadge': string;
|
|
6
|
+
'sidebarMenuItem': string;
|
|
7
|
+
'sidebarMenuSkeleton': string;
|
|
8
|
+
'sidebarMenuSkeletonIcon': string;
|
|
9
|
+
'sidebarMenuSkeletonText': string;
|
|
10
|
+
}
|
|
11
|
+
export const cssExports: CssExports;
|
|
12
|
+
export default cssExports;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
|
|
4
|
+
import S from './SidebarMenu.styl';
|
|
5
|
+
|
|
6
|
+
export function SidebarMenu({ className, ...props }: ComponentProps<'ul'>) {
|
|
7
|
+
return (
|
|
8
|
+
<ul
|
|
9
|
+
data-slot="sidebar-menu"
|
|
10
|
+
data-sidebar="menu"
|
|
11
|
+
className={cn(S.sidebarMenu, className)}
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function SidebarMenuItem({ className, ...props }: ComponentProps<'li'>) {
|
|
18
|
+
return (
|
|
19
|
+
<li
|
|
20
|
+
data-slot="sidebar-menu-item"
|
|
21
|
+
data-sidebar="menu-item"
|
|
22
|
+
className={cn(S.sidebarMenuItem, className)}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function SidebarMenuBadge({
|
|
29
|
+
className,
|
|
30
|
+
...props
|
|
31
|
+
}: ComponentProps<'div'>) {
|
|
32
|
+
return (
|
|
33
|
+
<div
|
|
34
|
+
data-slot="sidebar-menu-badge"
|
|
35
|
+
data-sidebar="menu-badge"
|
|
36
|
+
className={cn(S.sidebarMenuBadge, className)}
|
|
37
|
+
{...props}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
@import '../../../../lib/theme.styl';
|
|
2
|
+
|
|
3
|
+
.sidebarMenuAction
|
|
4
|
+
color var(--sidebar-foreground)
|
|
5
|
+
position absolute
|
|
6
|
+
top var(--p-2)
|
|
7
|
+
right var(--p-2)
|
|
8
|
+
display flex
|
|
9
|
+
aspect-ratio 1
|
|
10
|
+
width 1.25rem
|
|
11
|
+
align-items center
|
|
12
|
+
justify-content center
|
|
13
|
+
border-radius 0.375rem
|
|
14
|
+
padding 0
|
|
15
|
+
outline none
|
|
16
|
+
opacity 0
|
|
17
|
+
cursor pointer
|
|
18
|
+
transition transform
|
|
19
|
+
|
|
20
|
+
&::before
|
|
21
|
+
content ""
|
|
22
|
+
position absolute
|
|
23
|
+
right 0
|
|
24
|
+
width calc(100% + var(--p-4))
|
|
25
|
+
height 100%
|
|
26
|
+
background-image linear-gradient(to left, var(--sidebar-accent) 70%, transparent 100%)
|
|
27
|
+
transition opacity 0.2s ease-in-out
|
|
28
|
+
pointer-events none
|
|
29
|
+
|
|
30
|
+
[data-slot="sidebar-menu-sub-item"]:hover &
|
|
31
|
+
opacity 1
|
|
32
|
+
|
|
33
|
+
&:focus-visible
|
|
34
|
+
box-shadow 0 0 0 2px var(--sidebar-ring)
|
|
35
|
+
|
|
36
|
+
& > svg
|
|
37
|
+
pointer-events none
|
|
38
|
+
z-index 1
|
|
39
|
+
width 1rem
|
|
40
|
+
height 1rem
|
|
41
|
+
flex-shrink 0
|
|
42
|
+
opacity .5
|
|
43
|
+
transition opacity 0.2s ease-in-out
|
|
44
|
+
|
|
45
|
+
&:hover > svg
|
|
46
|
+
opacity 1
|
|
47
|
+
|
|
48
|
+
&::after
|
|
49
|
+
content ""
|
|
50
|
+
position absolute
|
|
51
|
+
inset -0.5rem
|
|
52
|
+
@media (min-width 768px)
|
|
53
|
+
display none
|
|
54
|
+
|
|
55
|
+
&[data-size="sm"]
|
|
56
|
+
top 0.25rem
|
|
57
|
+
&[data-size="md"]
|
|
58
|
+
top 0.375rem
|
|
59
|
+
&[data-size="lg"]
|
|
60
|
+
top 0.625rem
|
|
61
|
+
|
|
62
|
+
&[data-collapsible="icon"]
|
|
63
|
+
display none
|
|
64
|
+
|
|
65
|
+
&.showOnHover
|
|
66
|
+
&[data-active="true"]
|
|
67
|
+
color var(--sidebar-accent-foreground)
|
|
68
|
+
&[data-state="open"]
|
|
69
|
+
opacity 1
|
|
70
|
+
@media (min-width 768px)
|
|
71
|
+
opacity 0
|
|
72
|
+
&:focus-within, &:hover
|
|
73
|
+
opacity 1
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
|
|
4
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
5
|
+
|
|
6
|
+
import S from './SidebarMenuAction.styl';
|
|
7
|
+
|
|
8
|
+
export function SidebarMenuAction({
|
|
9
|
+
className,
|
|
10
|
+
asChild = false,
|
|
11
|
+
showOnHover = false,
|
|
12
|
+
...props
|
|
13
|
+
}: ComponentProps<'button'> & {
|
|
14
|
+
asChild?: boolean;
|
|
15
|
+
showOnHover?: boolean;
|
|
16
|
+
}) {
|
|
17
|
+
const Comp = asChild ? Slot : 'button';
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<Comp
|
|
21
|
+
data-slot="sidebar-menu-action"
|
|
22
|
+
data-sidebar="menu-action"
|
|
23
|
+
className={cn(
|
|
24
|
+
S.sidebarMenuAction,
|
|
25
|
+
showOnHover && S.showOnHover,
|
|
26
|
+
className,
|
|
27
|
+
)}
|
|
28
|
+
{...props}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
@import '../../../../lib/theme.styl';
|
|
2
|
+
|
|
3
|
+
.sidebarMenuButton > span
|
|
4
|
+
text-transform capitalize
|
|
5
|
+
min-width 0
|
|
6
|
+
|
|
7
|
+
&:first-child
|
|
8
|
+
flex-grow 1
|
|
9
|
+
|
|
10
|
+
.sidebarMenuButton
|
|
11
|
+
display flex
|
|
12
|
+
width 100%
|
|
13
|
+
align-items center
|
|
14
|
+
justify-content flex-start
|
|
15
|
+
gap var(--p-2)
|
|
16
|
+
overflow hidden
|
|
17
|
+
border-radius var(--p-3)
|
|
18
|
+
padding var(--p-6) var(--p-3)
|
|
19
|
+
text-align left
|
|
20
|
+
outline none
|
|
21
|
+
cursor pointer
|
|
22
|
+
transition all
|
|
23
|
+
color var(--sidebar-foreground)
|
|
24
|
+
text-decoration none
|
|
25
|
+
|
|
26
|
+
&:visited
|
|
27
|
+
color var(--sidebar-foreground)
|
|
28
|
+
|
|
29
|
+
&:hover
|
|
30
|
+
text-decoration none
|
|
31
|
+
|
|
32
|
+
[data-slot="sidebar-menu-sub-item"]:hover &
|
|
33
|
+
[data-slot="sidebar-menu-sub-item"]:active &
|
|
34
|
+
[data-slot="sidebar-menu-sub-item"][data-state="open"] &
|
|
35
|
+
background-color var(--sidebar-accent)
|
|
36
|
+
color var(--sidebar-accent-foreground)
|
|
37
|
+
|
|
38
|
+
&:focus-visible
|
|
39
|
+
box-shadow 0 0 0 2px var(--sidebar-ring)
|
|
40
|
+
|
|
41
|
+
&:disabled, &[aria-disabled="true"]
|
|
42
|
+
pointer-events none
|
|
43
|
+
opacity 0.5
|
|
44
|
+
|
|
45
|
+
&[data-active="true"]
|
|
46
|
+
background-color var(--sidebar-accent)
|
|
47
|
+
font-weight 500
|
|
48
|
+
color var(--sidebar-accent-foreground)
|
|
49
|
+
|
|
50
|
+
&[data-collapsible="icon"]
|
|
51
|
+
width 2rem !important
|
|
52
|
+
height 2rem !important
|
|
53
|
+
padding 0.5rem !important
|
|
54
|
+
|
|
55
|
+
& > svg
|
|
56
|
+
width var(--p-5)
|
|
57
|
+
height var(--p-5)
|
|
58
|
+
flex-shrink 0
|
|
59
|
+
|
|
60
|
+
&.size-sm
|
|
61
|
+
height 1.75rem
|
|
62
|
+
&.size-md
|
|
63
|
+
height var(--p-12)
|
|
64
|
+
&.size-lg
|
|
65
|
+
height 3rem
|
|
66
|
+
&[data-collapsible="icon"]
|
|
67
|
+
padding 0 !important
|
|
68
|
+
|
|
69
|
+
&.variant-outline
|
|
70
|
+
background-color var(--background)
|
|
71
|
+
box-shadow 0 0 0 1px var(--sidebar-border)
|
|
72
|
+
&:hover
|
|
73
|
+
background-color var(--sidebar-accent)
|
|
74
|
+
color var(--sidebar-accent-foreground)
|
|
75
|
+
box-shadow 0 0 0 1px var(--sidebar-accent)
|
|
76
|
+
|
|
77
|
+
.sidebarMenuButtonLabel
|
|
78
|
+
flex-grow 1
|
|
79
|
+
|
|
80
|
+
.sidebarMenuButtonChevron
|
|
81
|
+
margin-left auto
|
|
82
|
+
display flex
|
|
83
|
+
flex-shrink 0
|
|
84
|
+
align-items center
|
|
85
|
+
transition transform 0.1s ease-out
|
|
86
|
+
opacity 0.5
|
|
87
|
+
|
|
88
|
+
.sidebarMenuButton:hover &
|
|
89
|
+
opacity 1
|
|
90
|
+
|
|
91
|
+
&.expanded
|
|
92
|
+
transform rotate(90deg)
|
|
93
|
+
|
|
94
|
+
& > svg
|
|
95
|
+
width var(--p-5)
|
|
96
|
+
height var(--p-5)
|
|
97
|
+
|
|
98
|
+
.sidebarMenuButtonCta
|
|
99
|
+
display flex
|
|
100
|
+
width 100%
|
|
101
|
+
justify-content flex-start
|
|
102
|
+
text-align left
|
|
103
|
+
|
|
104
|
+
& > svg
|
|
105
|
+
width var(--p-5)
|
|
106
|
+
height var(--p-5)
|
|
107
|
+
flex-shrink 0
|