Skip to content

Commit f7f13af

Browse files
creilly11235claude
andcommitted
feat(apollo-vertex): polish shell/sidebar with framer-motion animations and self-contained CSS
Convert sidebar width animation from CSS transitions to framer-motion spring physics matching MRS exactly. Make shell components self-contained by moving collapsible CSS to co-located file, swap hand-rolled buttons for vertex Button component, add asymmetric text fade variants via AnimatePresence, fix z-index stacking in docs preview, fix minimal header logo background, and switch locale loading state from spinner to skeleton. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9323a9f commit f7f13af

29 files changed

Lines changed: 616 additions & 291 deletions

apps/apollo-vertex/app/components/sidebar/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { SidebarExampleTemplate } from '@/templates/SidebarTemplateDynamic';
2-
import { PreviewFullScreen } from '@/app/components/preview-full-screen';
2+
import { PreviewFullScreen } from '@/app/_components/preview-full-screen';
33

44
# Sidebar
55

apps/apollo-vertex/app/patterns/shell/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Use the `variant="minimal"` prop to render a horizontal header layout instead of
1919

2020
## Features
2121

22-
- **Collapsible Sidebar**: Icon-only collapsed mode with smooth CSS transitions, built on the shadcn sidebar primitives
22+
- **Collapsible Sidebar**: Icon-only collapsed mode with smooth spring animations, built on the shadcn sidebar primitives
2323
- **Sub-Navigation**: Collapsible menu items with nested sub-items that auto-expand when active
2424
- **Collapsed Menu Handling**: Clicking a collapsible item while collapsed expands the sidebar and opens the submenu
2525
- **Custom Logo**: Support for company logos with separate light/dark mode variants

apps/apollo-vertex/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
"turkish": "Turkish",
106106
"type_a_message": "Type a message...",
107107
"user_email_placeholder": "user@company.com",
108+
"user_profile": "Profile and settings",
108109
"view": "View",
109110
"view_customer": "View customer",
110111
"view_payment_details": "View payment details",

apps/apollo-vertex/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
import "./.next/types/routes.d.ts";
3+
import "./.next/dev/types/routes.d.ts";
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
Lines changed: 6 additions & 5 deletions
Loading
Lines changed: 6 additions & 12 deletions
Loading

apps/apollo-vertex/registry.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,10 @@
506506
{
507507
"path": "registry/collapsible/collapsible.tsx",
508508
"type": "registry:ui"
509+
},
510+
{
511+
"path": "registry/collapsible/collapsible.css",
512+
"type": "registry:ui"
509513
}
510514
]
511515
},
@@ -947,14 +951,15 @@
947951
"@tanstack/react-query",
948952
"@tanstack/react-router",
949953
"pkce-challenge",
950-
"sonner"
954+
"sonner",
955+
"framer-motion"
951956
],
952957
"registryDependencies": [
953958
"button",
954959
"tooltip",
955960
"avatar",
956961
"dropdown-menu",
957-
"spinner",
962+
"skeleton",
958963
"sidebar",
959964
"collapsible"
960965
],
@@ -1003,10 +1008,6 @@
10031008
"path": "registry/shell/shell-text.tsx",
10041009
"type": "registry:ui"
10051010
},
1006-
{
1007-
"path": "registry/shell/shell-theme-toggle.tsx",
1008-
"type": "registry:ui"
1009-
},
10101011
{
10111012
"path": "registry/shell/shell-theme-provider.tsx",
10121013
"type": "registry:ui"
@@ -1034,6 +1035,10 @@
10341035
{
10351036
"path": "registry/shell/shell-user-profile-menu-items.tsx",
10361037
"type": "registry:ui"
1038+
},
1039+
{
1040+
"path": "registry/shell/shell-animations.ts",
1041+
"type": "registry:ui"
10371042
}
10381043
]
10391044
},
@@ -1118,6 +1123,7 @@
11181123
"dependencies": [
11191124
"@radix-ui/react-slot",
11201125
"class-variance-authority",
1126+
"framer-motion",
11211127
"lucide-react",
11221128
"react-i18next"
11231129
],
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@keyframes collapsible-down {
2+
from {
3+
height: 0;
4+
}
5+
to {
6+
height: var(--radix-collapsible-content-height);
7+
}
8+
}
9+
10+
@keyframes collapsible-up {
11+
from {
12+
height: var(--radix-collapsible-content-height);
13+
}
14+
to {
15+
height: 0;
16+
}
17+
}
18+
19+
@utility animate-collapsible-down {
20+
animation: collapsible-down 0.2s cubic-bezier(0.4, 0, 0.2, 1);
21+
}
22+
23+
@utility animate-collapsible-up {
24+
animation: collapsible-up 0.2s cubic-bezier(0.4, 0, 0.2, 1);
25+
}

apps/apollo-vertex/registry/collapsible/collapsible.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"use client";
22

33
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
4+
import { cn } from "@/lib/utils";
5+
import "./collapsible.css";
46

57
function Collapsible({
68
...props
@@ -20,11 +22,16 @@ function CollapsibleTrigger({
2022
}
2123

2224
function CollapsibleContent({
25+
className,
2326
...props
2427
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {
2528
return (
2629
<CollapsiblePrimitive.CollapsibleContent
2730
data-slot="collapsible-content"
31+
className={cn(
32+
"overflow-hidden transition-all duration-200 data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down",
33+
className,
34+
)}
2835
{...props}
2936
/>
3037
);
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
export const sidebarSpring = {
2+
type: "spring",
3+
stiffness: 400,
4+
damping: 30,
5+
mass: 0.5,
6+
} as const;
7+
8+
export const fastFadeTransition = {
9+
duration: 0.15,
10+
ease: [0.25, 0.46, 0.45, 0.94],
11+
} as const;
12+
13+
export const textFadeVariants = {
14+
initial: { opacity: 0, x: -10 },
15+
animate: { opacity: 1, x: 0 },
16+
exit: { opacity: 0 },
17+
};
18+
19+
export const iconHoverScale = {
20+
scale: 1.05,
21+
transition: { duration: 0.2 },
22+
};
23+
24+
export const scaleVariants = {
25+
initial: { opacity: 0, scale: 0.8 },
26+
animate: { opacity: 1, scale: 1 },
27+
exit: { opacity: 0, scale: 0.8 },
28+
};
29+
30+
export const edgeFadeVariants = {
31+
initial: { opacity: 0, scaleX: 0 },
32+
animate: { opacity: 1, scaleX: 1 },
33+
exit: { opacity: 0, scaleX: 0 },
34+
};

0 commit comments

Comments
 (0)