// @ts-nocheck import { IconButton } from "./icon-button" import { createSignal } from "solid-js" import * as mod from "./tabs" const docs = `### Overview Tabbed navigation for switching between related panels. Compose \`Tabs.List\` + \`Tabs.Trigger\` + \`Tabs.Content\`. ### API - Root accepts Kobalte Tabs props (\`value\`, \`defaultValue\`, \`onChange\`). - \`variant\` sets visual style: normal, alt, pill, settings. - \`orientation\` supports horizontal or vertical layouts. - Trigger supports \`closeButton\`, \`hideCloseButton\`, and \`onMiddleClick\`. ### Variants and states - Normal, alt, pill, settings variants. - Horizontal and vertical orientations. ### Behavior - Uses Kobalte Tabs for roving focus and selection management. ### Accessibility - TODO: confirm keyboard interactions from Kobalte Tabs. ### Theming/tokens - Uses \`data-component="tabs"\` with variant/orientation data attributes. ` export default { title: "UI/Tabs", id: "components-tabs", component: mod.Tabs, tags: ["autodocs"], parameters: { docs: { description: { component: docs, }, }, }, argTypes: { variant: { control: "select", options: ["normal", "alt", "pill", "settings"], }, orientation: { control: "select", options: ["horizontal", "vertical"], }, }, } export const Basic = { args: { variant: "normal", orientation: "horizontal", defaultValue: "overview", }, render: (props) => ( Overview Details Activity Overview content Details content Activity content ), } export const Settings = { args: { variant: "settings", orientation: "horizontal", defaultValue: "general", }, render: (props) => ( General Appearance General settings Appearance settings ), } export const Alt = { args: { variant: "alt", orientation: "horizontal", defaultValue: "first", }, render: (props) => ( First Second Alt content Alt content 2 ), } export const Vertical = { args: { variant: "pill", orientation: "vertical", defaultValue: "alpha", }, render: (props) => ( Alpha Beta Alpha content Beta content ), } export const Closable = { args: { variant: "normal", orientation: "horizontal", defaultValue: "tab-1", }, render: (props) => ( } > Tab 1 Tab 2 Closable content Standard content ), } export const MiddleClick = { args: { variant: "normal", orientation: "horizontal", defaultValue: "tab-1", }, render: (props) => { const [message, setMessage] = createSignal("Middle click a tab") return (
{message()}
setMessage("Middle clicked tab-1")}> Tab 1 setMessage("Middle clicked tab-2")}> Tab 2 Tab 1 content Tab 2 content
) }, }