import React from 'react'; import { Navbar } from '../src/lib/components/navbar/Navbar.component'; import { action } from 'storybook/actions'; import { Link } from '../src/lib/components/text/Text.component'; import { InlineInput } from '../src/lib'; import { Stack } from '../src/lib/spacing'; import { Logo } from '../src/lib/icons/branding-logo'; const tabs = [ { render: ( {}, }} defaultValue="My instance" maxLength={14} /> ), }, { selected: true, title: 'Groups', link: Groups, onClick: action('Groups clicked'), }, { selected: false, title: 'Users', link: Users, onClick: action('Users clicked'), }, { selected: false, title: 'Policies', link: Policies, onClick: action('Policies clicked'), }, { selected: false, title: 'Buckets', link: Buckets, onClick: action('Buckets clicked'), }, { selected: false, title: 'Workflows', link: Workflows, onClick: action('Workflows clicked'), }, ]; const linkTabs = [ { link: Groups, selected: true, }, { link: Users, }, { link: Policies, }, { link: Buckets, }, { link: Workflows, }, ]; const rightActions = [ { type: 'dropdown', text: 'FR', icon: , items: [ { label: 'English', name: 'EN', onClick: action('English selected'), }, ], }, { type: 'dropdown', icon: , items: [ { label: 'App 1', onClick: action('App 1 clicked'), }, ], }, { type: 'dropdown', icon: , items: [ { label: 'About', onClick: action('About clicked'), }, { label: 'Documentation', onClick: action('Documentation clicked'), }, { label: 'Onboarding', onClick: action('Onboarding clicked'), }, ], }, { type: 'custom', render: () => ( {' '} New version available ), }, { type: 'button', icon: , tooltip: { overlay: 'Toggle Theme' }, onClick: action('Theme toggle clicked'), }, { type: 'dropdown', text: 'Carlito', icon: , items: [ { label: 'Log out', onClick: action('Logout clicked'), }, ], }, ]; export default { title: 'Components/Navigation/Navbar', component: Navbar, args: { productName: 'Hardware UI', rightActions, tabs, logo: , }, }; export const BasicNavbar = {}; export const NavbarWithToggle = { args: { onToggleClick: action('toggle clicked'), }, }; export const NavbarWithCustomizedLogo = { args: { logo: , }, }; export const NavbarWithOnlyTabs = { args: { rightActions: [rightActions[4]], }, }; export const NavbarWithOnlyLinkTabs = { args: { rightActions: [rightActions[4]], tabs: linkTabs, }, }; export const NavbarDropdownShowcase = { args: { rightActions: [ { type: 'dropdown', text: 'Language', variant: 'secondary', size: 'default', items: [ { label: 'English', name: 'EN', onClick: action('English selected'), }, { label: 'Français', name: 'FR', onClick: action('French selected'), }, { label: 'Español', name: 'ES', onClick: action('Spanish selected'), }, ], }, { type: 'dropdown', text: 'Help', icon: , variant: 'outline', size: 'default', items: [ { label: 'Documentation', onClick: action('Documentation clicked'), }, { label: 'Tutorials', onClick: action('Tutorials clicked'), }, { label: 'Contact Support', onClick: action('Contact Support clicked'), }, { label: 'Release Notes', onClick: action('Release Notes clicked'), }, ], }, { type: 'dropdown', icon: , variant: 'primary', size: 'default', caret: false, items: [ { label: 'Profile Settings', onClick: action('Profile clicked'), }, { label: 'Preferences', onClick: action('Preferences clicked'), }, { label: 'API Keys', onClick: action('API Keys clicked'), }, { label: 'Log out', onClick: action('Logout clicked'), }, ], }, ], tabs: [ { selected: true, title: 'Dashboard', link: Dashboard, onClick: action('Dashboard clicked'), }, { selected: false, title: 'Analytics', link: Analytics, onClick: action('Analytics clicked'), }, ], }, parameters: { docs: { description: { story: 'This story showcases different dropdown variants within the navbar. The dropdowns use the new ButtonV2 styling with variants: secondary, outline, and primary. Notice how the different variants provide visual hierarchy and the icon-only dropdown uses caret: false for a cleaner look.', }, }, }, };