Files
8582b92f90 refactor(deps): Tailwind 4 (CSS-first) + Zod 4 + ESLint 10 + types/node 26 + ai-kit 0.6.2 (#168)
Tailwind 3.4 -> 4.3:
- tailwind.config.js DELETED; tokens now live in an @theme inline block in
  app/globals.css (semantic names unchanged: action, paper, edge, ink...)
- postcss.config.js -> @tailwindcss/postcss; autoprefixer dropped (built in)
- @tailwind directives -> @import 'tailwindcss'; forms/typography via @plugin
- daisyui removed (no daisyui class used anywhere)
- next/font vars renamed --font-inter/--font-fraunces to break the circular
  var() the old --font-sans binding would create inside @theme
- v4 deleted *-opacity-* utilities: every bg/text/ring-opacity-N rewritten to
  slash syntax (bg-action/90, ring-black/5, ...); dynamic accent tint gets a
  literal class map in lib/config/colors.ts so the scanner sees each class
- dead v3-era aspect-w/h custom utilities removed (unused; v4 has aspect-*)

Zod 3.24 -> 4.5:
- .errors -> .issues everywhere
- z.string().uuid( -> .guid( (v4 uuid() is RFC-variant-strict; DB ids aren't)
- z.record(z.unknown()) -> z.record(z.string(), z.unknown())
- object .default({}) -> .prefault({}) (v4 default takes the full output value)

ESLint 9 -> 10: eslint-plugin-react's version:'detect' calls the removed
context.getFilename; pin settings.react.version='19' AFTER the next configs.

Verify (format+lint+typecheck+selfhost+test+build) green: 272 tests pass.


Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-31 12:45:49 +00:00

71 lines
2.2 KiB
TypeScript

'use client';
import Link from 'next/link';
import type { MenuChildItem, MegaMenuConfig } from '@/types/navigation';
import { MegaMenuItem } from './MegaMenuItem';
interface MegaMenuPanelProps {
items: MenuChildItem[];
config?: MegaMenuConfig;
onNavigate?: () => void;
}
/**
* Megamenu dropdown panel with configurable header, grid, and footer
* Supports 1-3 column layouts based on config
*/
export function MegaMenuPanel({ items, config, onNavigate }: MegaMenuPanelProps) {
const columns = config?.columns ?? 2;
const gridCols = {
1: 'lg:grid-cols-1',
2: 'lg:grid-cols-2',
3: 'lg:grid-cols-3',
}[columns];
return (
<div className="overflow-hidden rounded-xl bg-white shadow-2xl ring-1 ring-black/5 border border-gray-100">
{/* Optional Header */}
{config?.header && (
<div
className={`border-b border-gray-100 px-6 py-4 ${config.header.gradient ?? 'bg-action-tint'}`}
>
<h3 className="text-sm font-semibold text-gray-900">{config.header.title}</h3>
{config.header.subtitle && (
<p className="mt-1 text-xs text-gray-600">{config.header.subtitle}</p>
)}
</div>
)}
{/* Menu Items Grid */}
<div className={`relative grid gap-1 bg-white p-4 ${gridCols}`}>
{items.map((item) => (
<MegaMenuItem key={item.label} item={item} onNavigate={onNavigate} />
))}
</div>
{/* Optional Footer CTA */}
{config?.footer && (
<div className="border-t border-gray-100 bg-gray-50 px-6 py-4">
<Link
href={config.footer.href}
onClick={onNavigate}
className="group flex items-center justify-between text-sm font-medium text-gray-900 hover:text-action transition-colors"
>
<span>{config.footer.label}</span>
<svg
className="h-4 w-4 transition-transform group-hover:translate-x-1"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
aria-hidden="true"
>
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
</svg>
</Link>
</div>
)}
</div>
);
}