Skip to content

Commit 3052711

Browse files
frontend: apply sidebar improvements
1 parent 0c7b89d commit 3052711

File tree

5 files changed

+10
-13
lines changed

5 files changed

+10
-13
lines changed

frontend/src/components/layout/sidebar.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import {
2929
SidebarMenuButton,
3030
SidebarMenuItem,
3131
SidebarProvider,
32-
SidebarRail,
3332
useSidebar,
3433
} from 'components/redpanda-ui/components/sidebar';
3534
import { ChevronsLeft, ChevronsRight, ChevronUp, LogOut, Settings } from 'lucide-react';
@@ -268,8 +267,6 @@ export function AppSidebar() {
268267
</SidebarMenuItem>
269268
</SidebarMenu>
270269
</SidebarFooter>
271-
272-
<SidebarRail />
273270
</Sidebar>
274271
);
275272
}

frontend/src/components/redpanda-ui/components/motion-highlight.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function MotionHighlight<T extends string>(props: MotionHighlightProps<T>) {
102102
defaultValue,
103103
onValueChange,
104104
className,
105-
transition = { type: 'spring', stiffness: 350, damping: 35 },
105+
transition = { type: 'tween', ease: 'easeOut', duration: 0.2 },
106106
hover = false,
107107
enabled = true,
108108
controlledItems,

frontend/src/components/redpanda-ui/components/sidebar.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ function Sidebar({
251251
{/* This is what handles the sidebar gap on desktop */}
252252
<div
253253
className={cn(
254-
'relative w-(--sidebar-width) bg-transparent transition-[width] duration-400 ease-[cubic-bezier(0.7,-0.15,0.25,1.15)]',
254+
'relative w-(--sidebar-width) bg-transparent transition-[width] duration-300 ease-out',
255255
'group-data-[collapsible=offcanvas]:w-0',
256256
'group-data-[side=right]:rotate-180',
257257
variant === 'floating' || variant === 'inset'
@@ -262,7 +262,7 @@ function Sidebar({
262262
/>
263263
<div
264264
className={cn(
265-
'fixed inset-y-0 z-10 flex max-md:hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-400 ease-[cubic-bezier(0.75,0,0.25,1)]',
265+
'fixed inset-y-0 z-10 flex max-md:hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-300 ease-out',
266266
side === 'left'
267267
? 'left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]'
268268
: 'right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]',
@@ -723,7 +723,7 @@ function SidebarMenuSub({ className, ...props }: SidebarMenuSubProps) {
723723
return (
724724
<ul
725725
className={cn(
726-
'mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5',
726+
'mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-1 py-0.5',
727727
'group-data-[collapsible=icon]:hidden',
728728
className
729729
)}
@@ -764,7 +764,7 @@ const SidebarMenuSubButton = React.forwardRef<HTMLAnchorElement, SidebarMenuSubB
764764
<Comp
765765
aria-disabled={props['aria-disabled']}
766766
className={cn(
767-
'flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-0.5 text-sidebar-foreground outline-hidden ring-sidebar-ring focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-50 [&:not([data-highlight])]:hover:bg-sidebar-accent [&:not([data-highlight])]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground',
767+
'flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-hidden ring-sidebar-ring focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-50 [&:not([data-highlight])]:hover:bg-sidebar-accent [&:not([data-highlight])]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground',
768768
'data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground',
769769
size === 'sm' && 'text-xs',
770770
size === 'md' && 'text-sm',

frontend/src/components/redpanda-ui/components/tooltip.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function TooltipContent({
8181
className,
8282
side = 'top',
8383
sideOffset = 4,
84-
transition = { type: 'spring', stiffness: 300, damping: 25 },
84+
transition = { type: 'tween', ease: 'easeOut', duration: 0.15 },
8585
arrow = true,
8686
children,
8787
testId,
@@ -104,7 +104,7 @@ function TooltipContent({
104104
exit={{ opacity: 0, scale: 0, ...initialPosition }}
105105
transition={transition}
106106
className={cn(
107-
'relative bg-primary text-primary-foreground shadow-md w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-sm text-balance',
107+
'relative bg-base-800 dark:bg-base-700 text-white shadow-md w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-sm text-balance',
108108
className,
109109
)}
110110
>
@@ -113,7 +113,7 @@ function TooltipContent({
113113
{arrow && (
114114
<TooltipPrimitive.Arrow
115115
data-slot="tooltip-content-arrow"
116-
className="bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px]"
116+
className="bg-base-800 fill-base-800 dark:bg-base-700 dark:fill-base-700 z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px]"
117117
/>
118118
)}
119119
</motion.div>

frontend/src/components/redpanda-ui/style/theme.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
--color-sidebar-accent: oklch(1 0 0 / 8%);
7777
--color-sidebar-accent-foreground: var(--color-base-100);
7878
--color-sidebar-border: var(--color-base-600);
79-
--color-sidebar-ring: var(--color-primary-500);
79+
--color-sidebar-ring: var(--color-secondary-400);
8080
--color-selection: oklch(0.8462 0.027 262.33);
8181
--color-selection-foreground: var(--color-base-800);
8282
--color-sidebar-selection: oklch(0.5547 0.087 264.14);
@@ -127,7 +127,7 @@
127127
--color-sidebar-accent: oklch(0 0 0 / 24%);
128128
--color-sidebar-accent-foreground: var(--color-base-100);
129129
--color-sidebar-border: var(--color-base-500);
130-
--color-sidebar-ring: var(--color-primary-500);
130+
--color-sidebar-ring: var(--color-secondary-400);
131131
--color-selection: oklch(0.8462 0.027 262.33);
132132
--color-selection-foreground: var(--color-base-200);
133133
--color-sidebar-selection: oklch(0.5547 0.087 264.14);

0 commit comments

Comments
 (0)