import type { Meta, StoryObj } from '@storybook/nextjs-vite';
import { fn } from 'storybook/test';
import { OpenFrameLogo, OpenFrameText } from '../components/icons';
import { ClockHistoryIcon } from '../components/icons-v2-generated/date-and-time/clock-history-icon';
import { BellIcon } from '../components/icons-v2-generated/interface/bell-icon';
import { HeaderButton } from '../components/navigation/header-button';
import { HeaderMingoButton } from '../components/navigation/header-mingo-button';
import { TopNavigation } from '../components/navigation/top-navigation';
import { Button } from '../components/ui/button';
const logo = (
<>
>
);
const navLinks = (
);
const burgerCell = (
}
/>
);
const sideActionCells = (
<>
}
/>
}
/>
>
);
const meta = {
title: 'Navigation/TopNavigation',
component: TopNavigation,
parameters: {
layout: 'fullscreen',
docs: {
description: {
component:
'Unified ODS top-navigation shell (Figma `[UPD] top-navigation`, node 2797-5978). ' +
'Owns the bar geometry only — 48px mobile / 56px md+ height, top/bottom borders, background — and the zone layout ' +
'`[leading][logo][center][cta][sideActions]`. Dividers belong to the cells (`border-l` / `border-r`), not the bar. ' +
'Consumers: the console `AppHeader` (centerBreakpoint `md`, global search in the center zone) and the marketing ' +
'`Header` (centerBreakpoint `lg`, nav links in the center zone). Resize the viewport to see the tablet burger and ' +
'the mobile arrangement.',
},
},
},
tags: ['autodocs'],
argTypes: {
centerBreakpoint: { control: 'radio', options: ['md', 'lg'] },
size: { control: 'radio', options: ['small', 'big'] },
backgroundClassName: { control: 'text' },
mobileTopBorder: { control: 'boolean' },
},
decorators: [
Story => (
),
],
} satisfies Meta;
export default meta;
type Story = StoryObj;
/**
* The full marketing arrangement per the Figma spec: burger (below `lg`),
* logo (grows below `lg`), centered nav links (from `lg`), CTA and the
* side-action cells. Resize across 800px / 1280px to see all three device
* variants.
*/
export const MarketingFull: Story = {
args: {
leading: burgerCell,
logo,
logoClassName: 'gap-2',
center: navLinks,
cta: (
),
sideActions: sideActionCells,
},
};
/**
* The `big` (72px) bar every hub/marketing site renders — same zones, taller
* bar and 72px cells (Figma 2936-6812). `small` (56px) is the console size.
*/
export const MarketingBig: Story = {
args: {
...MarketingFull.args,
size: 'big',
// Big bar carries the full default-size CTA (Figma 2936-6812), not the
// 32px mono control.
cta: (
),
},
};
/**
* Console-style arrangement: no logo/nav (the app sidebar owns branding),
* `centerBreakpoint="md"` so the center zone (here just the spacer) starts at
* 800px, side-action cells flush right. This is the shape `AppHeader` renders.
*/
export const ConsoleShape: Story = {
args: {
centerBreakpoint: 'md',
sideActions: sideActionCells,
},
};
/**
* Per-platform background override — platforms may run the bar on `bg-ods-bg`
* instead of the default `bg-ods-card`. Keep the override opaque.
*/
export const CustomBackground: Story = {
args: {
...MarketingFull.args,
backgroundClassName: 'bg-ods-bg',
},
};
/**
* Logo-only bar (e.g. the `openframe` platform in the hub): every optional
* zone omitted — the logo zone grows and nothing else renders.
*/
export const LogoOnly: Story = {
args: {
logo,
logoClassName: 'gap-2',
},
};