import { define } from '../src' import { ExampleSection } from './ssr/helpers' const TabSwitcher = define('TabSwitcher', { parts: { Input: { base: 'input[type=radio]', display: 'none', }, TabBar: { display: 'flex', gap: 0, borderBottom: '2px solid #e5e7eb', marginBottom: 24, }, TabLabel: { base: 'label', padding: '12px 24px', position: 'relative', marginBottom: -2, background: 'transparent', borderBottom: '2px solid transparent', color: '#6b7280', fontSize: 14, fontWeight: 500, cursor: 'pointer', transition: 'all 0.2s ease', states: { ':hover': { color: '#111827', } }, selectors: { '.TabSwitcher_Input:checked + &': { color: '#3b82f6', borderBottom: '2px solid #3b82f6' } } }, Content: { display: 'none', padding: 20, background: '#f9fafb', borderRadius: 8, selectors: { '.TabSwitcher_Input:checked ~ &': { display: 'block' } } } }, render({ props, parts: { Root, Input, TabBar, TabLabel, Content } }) { return ( {props.tabs?.map((tab: any, index: number) => ( <> {tab.label} ))} {props.tabs?.map((tab: any) => ( {tab.content} ))} ) } }) const Pills = define('Pills', { parts: { Input: { base: 'input[type=radio]', display: 'none', }, PillBar: { display: 'flex', gap: 8, flexWrap: 'wrap', }, PillLabel: { base: 'label', padding: '8px 16px', background: '#f3f4f6', border: 'none', borderRadius: 20, color: '#6b7280', fontSize: 14, fontWeight: 500, cursor: 'pointer', transition: 'all 0.2s ease', states: { ':hover': { background: '#e5e7eb', color: '#111827', } }, selectors: { '.Pills_Input:checked + &': { background: '#3b82f6', color: 'white' }, '.Pills_Input:checked + &:hover': { background: '#2563eb' } } } }, render({ props, parts: { Root, Input, PillBar, PillLabel } }) { return ( {props.items?.map((item: any, index: number) => ( <> {item.label} ))} ) } }) const VerticalNav = define('VerticalNav', { parts: { Input: { base: 'input[type=radio]', display: 'none', }, NavBar: { display: 'flex', flexDirection: 'column', gap: 4, width: 240, }, NavLabel: { base: 'label', padding: '12px 16px', display: 'flex', alignItems: 'center', gap: 12, background: 'transparent', borderRadius: 8, color: '#6b7280', fontSize: 14, fontWeight: 500, cursor: 'pointer', transition: 'all 0.2s ease', states: { ':hover': { background: '#f3f4f6', color: '#111827', } }, selectors: { '.VerticalNav_Input:checked + &': { background: '#eff6ff', color: '#3b82f6', }, '.VerticalNav_Input:checked + &:hover': { background: '#dbeafe', color: '#2563eb' } } }, Icon: { width: 20, height: 20, display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: 18, } }, render({ props, parts: { Root, Input, NavBar, NavLabel, Icon } }) { return ( {props.items?.map((item: any, index: number) => ( <> {item.icon && {item.icon}} {item.label} ))} ) } }) const Breadcrumbs = define('Breadcrumbs', { display: 'flex', alignItems: 'center', gap: 8, flexWrap: 'wrap', parts: { Item: { base: 'a', color: '#6b7280', fontSize: 14, textDecoration: 'none', transition: 'color 0.2s ease', states: { ':hover': { color: '#3b82f6', } } }, Separator: { color: '#d1d5db', fontSize: 14, userSelect: 'none', }, Current: { color: '#111827', fontSize: 14, fontWeight: 500, } }, render({ props, parts: { Root, Item, Separator, Current } }) { return ( {props.items?.map((item: any, index: number) => ( <> {index === props.items.length - 1 ? ( {item.label} ) : ( <> {item.label} / )} ))} ) } }) const Tabs = define('Tabs', { display: 'flex', gap: 0, borderBottom: '2px solid #e5e7eb', parts: { Tab: { base: 'button', padding: '12px 24px', position: 'relative', marginBottom: -2, background: 'transparent', border: 'none', borderBottom: '2px solid transparent', color: '#6b7280', fontSize: 14, fontWeight: 500, cursor: 'pointer', transition: 'all 0.2s ease', states: { ':hover': { color: '#111827', } } } }, variants: { active: { parts: { Tab: { color: '#3b82f6', borderBottom: '2px solid #3b82f6', } } } }, render({ props, parts: { Root, Tab } }) { return ( {props.items?.map((item: any) => ( {item.label} ))} ) } }) const SimplePills = define('SimplePills', { display: 'flex', gap: 8, flexWrap: 'wrap', parts: { Pill: { base: 'button', padding: '8px 16px', background: '#f3f4f6', border: 'none', borderRadius: 20, color: '#6b7280', fontSize: 14, fontWeight: 500, cursor: 'pointer', transition: 'all 0.2s ease', states: { ':hover': { background: '#e5e7eb', color: '#111827', } } } }, variants: { active: { parts: { Pill: { background: '#3b82f6', color: 'white', states: { ':hover': { background: '#2563eb', color: 'white', } } } } } }, render({ props, parts: { Root, Pill } }) { return ( {props.items?.map((item: any) => ( {item.label} ))} ) } }) const SimpleVerticalNav = define('SimpleVerticalNav', { display: 'flex', flexDirection: 'column', gap: 4, width: 240, parts: { NavItem: { base: 'button', padding: '12px 16px', display: 'flex', alignItems: 'center', gap: 12, background: 'transparent', border: 'none', borderRadius: 8, color: '#6b7280', fontSize: 14, fontWeight: 500, textAlign: 'left', cursor: 'pointer', transition: 'all 0.2s ease', states: { ':hover': { background: '#f3f4f6', color: '#111827', } } }, Icon: { width: 20, height: 20, display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: 18, } }, variants: { active: { parts: { NavItem: { background: '#eff6ff', color: '#3b82f6', states: { ':hover': { background: '#dbeafe', color: '#2563eb', } } } } } }, render({ props, parts: { Root, NavItem, Icon } }) { return ( {props.items?.map((item: any) => ( {item.icon && {item.icon}} {item.label} ))} ) } }) export const NavigationExamplesContent = () => ( <> Overview content

}, { id: 'analytics', label: 'Analytics', content:

Analytics content

}, { id: 'reports', label: 'Reports', content:

Reports content

}, { id: 'settings', label: 'Settings', content:

Settings content

}, ]} />
)