{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "tabs",
  "title": "Tabs",
  "description": "Six variants (underline, pill, segmented, enclosed folder tabs, soft, vertical line), a sliding, fading or static indicator, fade or directional slide panels, tones, sizes, shapes, shadows and orientation, with icons, count badges, arrow keys and a one-line items API.",
  "dependencies": [
    "motion"
  ],
  "registryDependencies": [
    "https://goodui.dev/r/goodui-motion.json",
    "https://goodui.dev/r/number-flow.json",
    "https://goodui.dev/r/sounds.json"
  ],
  "files": [
    {
      "path": "registry/components/core/tabs.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { motion, useReducedMotion } from \"motion/react\"\nimport { cn } from \"@/lib/utils\"\nimport type { SoundName } from \"@/lib/goodui-sounds\"\nimport { GooduiTokens, spring } from \"@/lib/goodui-motion\"\nimport { NumberFlow } from \"@/components/goodui/number-flow\"\n\n/*\n * Tabs with independent layers:\n *   variant     underline, pill, segmented, enclosed (folder), soft, vertical-line\n *   indicator   how the active marker moves: none, slide (shared layout), fade\n *   transition  how the panel enters: none, fade, slide (in the direction of travel)\n *   tone, size, shape, shadow, orientation, fullWidth\n * Use the compound parts (Tabs, TabsList, TabsTrigger, TabsContent) or pass `items` for a one-liner.\n */\n\nexport type TabsVariant = \"underline\" | \"pill\" | \"segmented\" | \"enclosed\" | \"soft\" | \"vertical-line\"\nexport type TabsTone = \"primary\" | \"neutral\" | \"success\" | \"warning\" | \"danger\" | \"info\"\nexport type TabsIndicator = \"none\" | \"slide\" | \"fade\"\nexport type TabsTransition = \"none\" | \"fade\" | \"slide\"\nexport type TabsSize = \"sm\" | \"md\" | \"lg\"\nexport type TabsShape = \"auto\" | \"square\" | \"rounded\" | \"pill\"\nexport type TabsShadow = \"none\" | \"sm\" | \"md\" | \"glow\"\n\nexport type TabsItem = {\n  /** Unique id of the tab, matched against the Tabs value. */\n  value: string\n  label: React.ReactNode\n  icon?: React.ReactNode\n  /** Small count shown after the label, e.g. unread items. */\n  count?: React.ReactNode\n  disabled?: boolean\n  /** Panel content; leave it out to render the tab without a panel. */\n  content?: React.ReactNode\n}\n\nexport type TabsProps = Omit<React.ComponentProps<\"div\">, \"defaultValue\" | \"onChange\" | \"dir\"> & {\n  /** Active tab value (controlled). */\n  value?: string\n  /** Initially active tab when uncontrolled; defaults to the first enabled tab. */\n  defaultValue?: string\n  /** Called with the new value when a tab is clicked or picked with the keyboard. */\n  onValueChange?: (value: string) => void\n  /** Look of the list and marker: underline, pill, segmented, enclosed (folder tabs), soft or vertical-line. */\n  variant?: TabsVariant\n  /** Color of the active marker, text and count. */\n  tone?: TabsTone\n  /** How the active marker moves between tabs. */\n  indicator?: TabsIndicator\n  /** How a panel enters when its tab is selected. */\n  transition?: TabsTransition\n  size?: TabsSize\n  /** Corner style of tabs and marker. \"auto\" picks the natural one for the variant. */\n  shape?: TabsShape\n  /** Shadow under the active marker. */\n  shadow?: TabsShadow\n  /** Lays the list out vertically beside the panel. Ignored by enclosed; vertical-line is always vertical. */\n  orientation?: \"horizontal\" | \"vertical\"\n  /** Stretch the tabs into equal columns. */\n  fullWidth?: boolean\n  /** Plays \"tick\" when a tab is selected and the visitor has sounds on (lib/goodui-sounds); pass a sound name to pick another. Off by default. */\n  sound?: boolean | SoundName\n  /** Shortcut: renders the list and the panels for you. */\n  items?: TabsItem[]\n  /** Accessible name of the tab list when using `items`. */\n  listLabel?: string\n}\n\ntype Ctx = {\n  value: string\n  select: (v: string, focus?: boolean) => void\n  ensure: (v: string) => void\n  uid: string\n  variant: TabsVariant\n  indicator: TabsIndicator\n  transition: TabsTransition\n  size: TabsSize\n  shape: TabsShape\n  shadow: TabsShadow\n  vertical: boolean\n  fullWidth: boolean\n  dir: 1 | -1\n  touched: boolean\n  reduce: boolean\n  listRef: React.RefObject<HTMLDivElement | null>\n  /** Values whose panel is currently in the DOM, so triggers only point aria-controls at real elements. */\n  panels: Record<string, true>\n  registerPanel: (v: string) => () => void\n}\n\nconst TabsContext = React.createContext<Ctx | null>(null)\nfunction useTabs(part: string) {\n  const ctx = React.useContext(TabsContext)\n  if (!ctx) throw new Error(`<${part}> must be used inside <Tabs>`)\n  return ctx\n}\n\nconst tones = (c: string) => `\n.${c}{--pc-c:var(--primary);--pc-fg:var(--primary-foreground)}\n.${c}[data-tone=neutral]{--pc-c:var(--foreground);--pc-fg:var(--background)}\n.${c}[data-tone=success]{--pc-c:oklch(0.53 0.13 155);--pc-fg:#fff}\n.${c}[data-tone=warning]{--pc-c:oklch(0.75 0.16 70);--pc-fg:oklch(0.25 0.05 70)}\n.${c}[data-tone=danger]{--pc-c:oklch(0.56 0.21 27);--pc-fg:#fff}\n.${c}[data-tone=info]{--pc-c:oklch(0.55 0.17 250);--pc-fg:#fff}\n.dark .${c}[data-tone=success]{--pc-c:oklch(0.7 0.16 155);--pc-fg:oklch(0.2 0.05 155)}\n.dark .${c}[data-tone=danger]{--pc-c:oklch(0.68 0.2 25);--pc-fg:oklch(0.2 0.05 25)}\n.dark .${c}[data-tone=info]{--pc-c:oklch(0.7 0.15 245);--pc-fg:oklch(0.2 0.05 245)}\n.${c}{--pc-tint:color-mix(in oklab,var(--pc-c) 14%,transparent);--pc-ink:color-mix(in oklab,var(--pc-c) 82%,var(--foreground))}\n.${c}[data-tone=warning]{--pc-ink:color-mix(in oklab,var(--pc-c) 62%,var(--foreground))}\n`\n\nconst T = \".pc-tabs-trigger\"\nconst CSS = `${tones(\"pc-tabs\")}\n${T}{color:var(--muted-foreground);-webkit-tap-highlight-color:transparent}\n${T}[data-variant=segmented]{color:color-mix(in oklab,var(--muted-foreground) 80%,var(--foreground))}\n${T}:hover:not([data-state=active]){color:var(--foreground)}\n${T}[data-state=active]{color:var(--foreground)}\n${T}[data-variant=pill]:hover:not([data-state=active]),${T}[data-variant=soft]:hover:not([data-state=active]){background:color-mix(in oklab,var(--foreground) 5%,transparent)}\n${T}[data-variant=pill][data-state=active]{color:var(--pc-fg)}\n${T}[data-variant=soft][data-state=active],${T}[data-variant=vertical-line][data-state=active]{color:var(--pc-ink)}\n${T}[data-variant=vertical-line]:hover:not([data-state=active]){background:color-mix(in oklab,var(--foreground) 4%,transparent)}\n${T}[data-variant=enclosed]:hover:not([data-state=active]){background:color-mix(in oklab,var(--foreground) 4%,transparent)}\n\n.pc-tabs-ind{position:absolute;pointer-events:none;border-radius:inherit}\n.pc-tabs-ind[data-variant=underline]{left:.5rem;right:.5rem;bottom:0;height:2px;border-radius:2px;background:var(--pc-c)}\n.pc-tabs-ind[data-variant=underline][data-full]{left:0;right:0}\n.pc-tabs-ind[data-variant=pill]{inset:0;background-color:var(--pc-c);background-image:var(--pc-sheen);box-shadow:inset 0 1px var(--pc-edge-t),inset 0 -1px var(--pc-edge-b),0 0 0 1px color-mix(in oklab,var(--pc-c) 80%,black),0 1px 2px rgb(0 0 0/.2)}\n.pc-tabs-list[data-variant=segmented]{box-shadow:var(--pc-well)}\n.pc-tabs-ind[data-variant=segmented]{inset:0;background:var(--background);box-shadow:var(--pc-e1)}\n.dark .pc-tabs-ind[data-variant=segmented]{background:color-mix(in oklab,var(--foreground) 12%,var(--background))}\n.pc-tabs-ind[data-variant=enclosed]{inset:0;background:var(--card);border:1px solid var(--border);border-bottom:0;box-shadow:inset 0 2px 0 var(--pc-c)}\n.pc-tabs-ind[data-variant=soft]{inset:0;background:var(--pc-tint)}\n.pc-tabs-ind[data-variant=vertical-line]{inset-inline-start:0;top:.375rem;bottom:.375rem;width:2px;border-radius:2px;background:var(--pc-c)}\n.pc-tabs-ind[data-variant=underline][data-vertical]{left:auto;right:auto;inset-inline-end:0;top:.375rem;bottom:.375rem;width:2px;height:auto}\n.pc-tabs-ind[data-shadow=sm]{box-shadow:var(--pc-e1)}\n.pc-tabs-ind[data-shadow=md]{box-shadow:var(--pc-e2)}\n.pc-tabs-ind[data-shadow=glow]{box-shadow:0 0 0 1px color-mix(in oklab,var(--pc-c) 25%,transparent),0 4px 18px -2px color-mix(in oklab,var(--pc-c) 60%,transparent)}\n.pc-tabs-ind[data-variant=enclosed][data-shadow=sm],.pc-tabs-ind[data-variant=enclosed][data-shadow=md]{box-shadow:inset 0 2px 0 var(--pc-c),0 -4px 12px -6px rgb(0 0 0/.25)}\n.pc-tabs-ind[data-variant=enclosed][data-shadow=glow]{box-shadow:inset 0 2px 0 var(--pc-c),0 -6px 18px -8px color-mix(in oklab,var(--pc-c) 70%,transparent)}\n.pc-tabs-ind[data-anim=fade]{animation:pc-tabs-ind-in .18s var(--pc-ease-out)}\n@keyframes pc-tabs-ind-in{from{opacity:0;transform:scale(.94)}}\n\n.pc-tabs-count{background:color-mix(in oklab,var(--foreground) 8%,transparent);color:color-mix(in oklab,var(--muted-foreground) 80%,var(--foreground))}\n[data-state=active]>span>.pc-tabs-count{background:var(--pc-tint);color:var(--pc-ink)}\n[data-variant=pill][data-state=active]>span>.pc-tabs-count{background:var(--pc-fg);color:var(--pc-c)}\n\n.pc-tabs-content[data-transition=fade]{animation:pc-tabs-fade .2s var(--pc-ease-out)}\n.pc-tabs-content[data-transition=slide][data-dir=next]{animation:pc-tabs-next .24s var(--pc-ease-out)}\n.pc-tabs-content[data-transition=slide][data-dir=prev]{animation:pc-tabs-prev .24s var(--pc-ease-out)}\n@keyframes pc-tabs-fade{from{opacity:0;filter:blur(4px)}}\n.pc-tabs-content{--pc-x:1}\n.pc-tabs-content:dir(rtl){--pc-x:-1}\n@keyframes pc-tabs-next{from{opacity:0;filter:blur(4px);transform:translateX(calc(14px*var(--pc-x)))}}\n@keyframes pc-tabs-prev{from{opacity:0;filter:blur(4px);transform:translateX(calc(-14px*var(--pc-x)))}}\n@media (prefers-reduced-motion:reduce){\n  .pc-tabs-ind,.pc-tabs-content{animation:none!important}\n  .pc-tabs-trigger{transition:none!important}\n}\n`\n\nconst SIZES: Record<TabsSize, string> = {\n  sm: \"h-8 gap-1.5 px-2.5 text-[13px] [&_svg]:size-3.5\",\n  md: \"h-9 gap-2 px-3 text-sm [&_svg]:size-4\",\n  lg: \"h-11 gap-2 px-4 text-[15px] [&_svg]:size-[18px]\",\n}\nconst COUNT_SIZES: Record<TabsSize, string> = { sm: \"h-4 min-w-4 px-1 text-[10px]\", md: \"h-5 min-w-5 px-1.5 text-[11px]\", lg: \"h-5 min-w-5 px-1.5 text-xs\" }\n\nfunction triggerRadius(variant: TabsVariant, shape: TabsShape, vertical: boolean) {\n  if (variant === \"enclosed\") return { auto: \"rounded-t-lg\", rounded: \"rounded-t-lg\", square: \"rounded-none\", pill: \"rounded-t-2xl\" }[shape]\n  if (variant === \"vertical-line\") return { auto: \"rounded-e-md\", rounded: \"rounded-e-lg\", square: \"rounded-none\", pill: \"rounded-e-full\" }[shape]\n  if (variant === \"underline\" && !vertical) return { auto: \"rounded-md\", rounded: \"rounded-lg\", square: \"rounded-none\", pill: \"rounded-full\" }[shape]\n  return { auto: variant === \"pill\" ? \"rounded-full\" : variant === \"segmented\" ? \"rounded-lg\" : \"rounded-md\", rounded: \"rounded-lg\", square: \"rounded-none\", pill: \"rounded-full\" }[shape]\n}\n\n/** Inline radius for the sliding marker, so a shared-layout morph keeps its corners while it stretches. */\nfunction markerRadius(variant: TabsVariant, shape: TabsShape) {\n  if (variant === \"underline\" || variant === \"vertical-line\" || variant === \"enclosed\") return undefined\n  if (shape === \"square\") return 0\n  if (shape === \"pill\" || (shape === \"auto\" && variant === \"pill\")) return 9999\n  return variant === \"segmented\" || shape === \"rounded\" ? 8 : 6\n}\n\nfunction listClasses(variant: TabsVariant, shape: TabsShape, vertical: boolean, fullWidth: boolean) {\n  const scroll = \"overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\"\n  if (vertical) {\n    return cn(\n      \"flex shrink-0 flex-col gap-0.5 sm:w-52\",\n      variant === \"vertical-line\" && \"shadow-[inset_1px_0_0_var(--border)] rtl:shadow-[inset_-1px_0_0_var(--border)]\",\n      variant === \"underline\" && \"shadow-[inset_-1px_0_0_var(--border)] rtl:shadow-[inset_1px_0_0_var(--border)]\",\n      variant === \"segmented\" && cn(\"bg-muted p-1\", shape === \"pill\" ? \"rounded-3xl\" : shape === \"square\" ? \"rounded-none\" : \"rounded-xl\"),\n    )\n  }\n  switch (variant) {\n    case \"segmented\":\n      return cn(fullWidth ? \"flex\" : \"inline-flex max-w-full self-start\", \"gap-1 bg-muted p-1\", scroll, shape === \"pill\" ? \"rounded-full\" : shape === \"square\" ? \"rounded-none\" : \"rounded-xl\")\n    case \"underline\":\n      return cn(\"flex gap-1 shadow-[inset_0_-1px_0_var(--border)]\", scroll)\n    case \"enclosed\":\n      return cn(\"flex gap-0.5 px-1 shadow-[inset_0_-1px_0_var(--border)]\", scroll)\n    default:\n      return cn(\"flex gap-1\", scroll)\n  }\n}\n\n// Optional UI sound: the sound module is loaded only when `sound` is on, so silent apps pay nothing.\nfunction useCue(sound: boolean | SoundName | undefined) {\n  React.useEffect(() => {\n    if (sound) void import(\"@/lib/goodui-sounds\")\n  }, [sound])\n  return React.useCallback(\n    (fallback: SoundName, o?: { rate?: number; exact?: boolean }) => {\n      if (!sound) return\n      void import(\"@/lib/goodui-sounds\").then((m) => m.play(sound === true || o?.exact ? fallback : sound, { rate: o?.rate }))\n    },\n    [sound],\n  )\n}\n\nexport function Tabs({\n  value: valueProp,\n  defaultValue,\n  onValueChange,\n  variant = \"underline\",\n  tone = \"primary\",\n  indicator = \"slide\",\n  transition = \"slide\",\n  sound,\n  size = \"md\",\n  shape = \"auto\",\n  shadow = \"none\",\n  orientation = \"horizontal\",\n  fullWidth = false,\n  items,\n  listLabel,\n  className,\n  children,\n  ...props\n}: TabsProps) {\n  const uid = React.useId()\n  const prefersReduced = useReducedMotion()\n  const cue = useCue(sound)\n  // Gate reduced motion behind mount so the first client render matches the server (it picks motion.span vs span).\n  const [mounted, setMounted] = React.useState(false)\n  React.useEffect(() => setMounted(true), [])\n  const reduce = mounted && !!prefersReduced\n  const listRef = React.useRef<HTMLDivElement>(null)\n  const [inner, setInner] = React.useState(defaultValue ?? items?.find((i) => !i.disabled)?.value ?? \"\")\n  const controlled = valueProp !== undefined\n  const value = controlled ? valueProp : inner\n  const [dir, setDir] = React.useState<1 | -1>(1)\n  const [touched, setTouched] = React.useState(false)\n  const vertical = variant === \"vertical-line\" || (orientation === \"vertical\" && variant !== \"enclosed\")\n\n  const select = React.useCallback(\n    (next: string, focus = false) => {\n      const tabs = Array.from(listRef.current?.querySelectorAll<HTMLButtonElement>(\"[role=tab]\") ?? [])\n      const from = tabs.findIndex((t) => t.dataset.value === value)\n      const to = tabs.findIndex((t) => t.dataset.value === next)\n      if (focus) tabs[to]?.focus()\n      if (next === value) return\n      setDir(to < from ? -1 : 1)\n      setTouched(true)\n      if (!controlled) setInner(next)\n      onValueChange?.(next)\n      cue(\"tick\")\n    },\n    [value, controlled, onValueChange, cue],\n  )\n  // Uncontrolled tabs without a default pick the first enabled tab once the list has mounted.\n  const ensure = React.useCallback((first: string) => {\n    if (!controlled) setInner((v) => v || first)\n  }, [controlled])\n\n  const [panels, setPanels] = React.useState<Record<string, true>>({})\n  const registerPanel = React.useCallback((v: string) => {\n    setPanels((p) => (p[v] ? p : { ...p, [v]: true }))\n    return () =>\n      setPanels((p) => {\n        if (!p[v]) return p\n        const next = { ...p }\n        delete next[v]\n        return next\n      })\n  }, [])\n\n  const ctx: Ctx = { value, select, ensure, uid, variant, indicator, transition, size, shape, shadow, vertical, fullWidth, dir, touched, reduce, listRef, panels, registerPanel }\n\n  return (\n    <TabsContext.Provider value={ctx}>\n      <GooduiTokens />\n      <style href=\"pc-tabs\" precedence=\"default\">\n        {CSS}\n      </style>\n      <div\n        data-slot=\"tabs\"\n        data-variant={variant}\n        data-tone={tone}\n        data-orientation={vertical ? \"vertical\" : \"horizontal\"}\n        className={cn(\"pc-tabs flex min-w-0\", vertical ? \"flex-col gap-4 sm:flex-row sm:gap-6\" : cn(\"flex-col\", variant === \"enclosed\" ? \"gap-0\" : \"gap-3\"), className)}\n        {...props}\n      >\n        {children ??\n          (items && (\n            <>\n              <TabsList aria-label={listLabel}>\n                {items.map((it) => (\n                  <TabsTrigger key={it.value} value={it.value} icon={it.icon} count={it.count} disabled={it.disabled}>\n                    {it.label}\n                  </TabsTrigger>\n                ))}\n              </TabsList>\n              {items.map((it) =>\n                it.content !== undefined ? (\n                  <TabsContent key={it.value} value={it.value}>\n                    {it.content}\n                  </TabsContent>\n                ) : null,\n              )}\n            </>\n          ))}\n      </div>\n    </TabsContext.Provider>\n  )\n}\n\nexport type TabsListProps = React.ComponentProps<\"div\">\n\nexport function TabsList({ className, onKeyDown, children, ...props }: TabsListProps) {\n  const ctx = useTabs(\"TabsList\")\n  const { ensure, listRef } = ctx\n\n  React.useEffect(() => {\n    const first = listRef.current?.querySelector<HTMLButtonElement>(\"[role=tab]:not(:disabled)\")\n    if (first?.dataset.value) ensure(first.dataset.value)\n  }, [ensure, listRef])\n\n  const onKey = (e: React.KeyboardEvent<HTMLDivElement>) => {\n    onKeyDown?.(e)\n    if (e.defaultPrevented) return\n    const tabs = Array.from(listRef.current?.querySelectorAll<HTMLButtonElement>(\"[role=tab]:not(:disabled)\") ?? [])\n    if (!tabs.length) return\n    const i = tabs.findIndex((t) => t === document.activeElement)\n    const rtl = !!listRef.current && getComputedStyle(listRef.current).direction === \"rtl\"\n    const back = rtl ? \"ArrowRight\" : \"ArrowLeft\"\n    const fwd = rtl ? \"ArrowLeft\" : \"ArrowRight\"\n    const prev = [\"ArrowUp\", back]\n    const next = [\"ArrowDown\", fwd]\n    let to = -1\n    if (next.includes(e.key)) to = (i + 1) % tabs.length\n    else if (prev.includes(e.key)) to = (i - 1 + tabs.length) % tabs.length\n    else if (e.key === \"Home\") to = 0\n    else if (e.key === \"End\") to = tabs.length - 1\n    if (to < 0) return\n    e.preventDefault()\n    const v = tabs[to]?.dataset.value\n    if (v) ctx.select(v, true)\n  }\n\n  return (\n    <div\n      ref={listRef}\n      role=\"tablist\"\n      aria-orientation={ctx.vertical ? \"vertical\" : \"horizontal\"}\n      data-slot=\"tabs-list\"\n      data-variant={ctx.variant}\n      onKeyDown={onKey}\n      className={cn(\"pc-tabs-list relative\", listClasses(ctx.variant, ctx.shape, ctx.vertical, ctx.fullWidth), className)}\n      {...props}\n    >\n      {children}\n    </div>\n  )\n}\n\nexport type TabsTriggerProps = Omit<React.ComponentProps<\"button\">, \"value\"> & {\n  /** Matches the TabsContent with the same value. */\n  value: string\n  /** Icon before the label. */\n  icon?: React.ReactNode\n  /** Small count after the label. */\n  count?: React.ReactNode\n}\n\nconst safeId = (s: string) => s.replace(/[^\\w-]/g, \"_\")\n\nexport function TabsTrigger({ value, icon, count, className, children, disabled, onClick, ...props }: TabsTriggerProps) {\n  const ctx = useTabs(\"TabsTrigger\")\n  const active = ctx.value === value\n  const radius = triggerRadius(ctx.variant, ctx.shape, ctx.vertical)\n  const indProps = {\n    \"data-variant\": ctx.variant,\n    \"data-shadow\": ctx.shadow === \"none\" ? undefined : ctx.shadow,\n    \"data-full\": ctx.fullWidth || undefined,\n    \"data-vertical\": ctx.vertical || undefined,\n    \"aria-hidden\": true,\n  }\n  const slide = ctx.indicator === \"slide\" && !ctx.reduce\n  const radius_ = markerRadius(ctx.variant, ctx.shape)\n\n  return (\n    <button\n      type=\"button\"\n      role=\"tab\"\n      id={`${ctx.uid}-tab-${safeId(value)}`}\n      aria-selected={active}\n      aria-controls={ctx.panels[value] ? `${ctx.uid}-panel-${safeId(value)}` : undefined}\n      tabIndex={active ? 0 : -1}\n      data-slot=\"tabs-trigger\"\n      data-value={value}\n      data-state={active ? \"active\" : \"inactive\"}\n      data-variant={ctx.variant}\n      disabled={disabled}\n      onClick={(e) => {\n        onClick?.(e)\n        if (!e.defaultPrevented) ctx.select(value)\n      }}\n      className={cn(\n        \"pc-press pc-press-soft pc-tabs-trigger relative inline-flex shrink-0 items-center justify-center font-medium whitespace-nowrap outline-none select-none\",\n        \"focus-visible:ring-3 focus-visible:ring-[color-mix(in_oklab,var(--pc-c)_40%,transparent)] focus-visible:ring-inset disabled:pointer-events-none disabled:opacity-45\",\n        \"[&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n        ctx.indicator !== \"none\" && \"transition-[color,background-color] duration-200\",\n        SIZES[ctx.size],\n        radius,\n        ctx.vertical && \"w-full justify-start\",\n        ctx.vertical && ctx.variant === \"vertical-line\" && \"ps-4\",\n        ctx.fullWidth && !ctx.vertical && \"flex-1\",\n        className,\n      )}\n      {...props}\n    >\n      <GooduiTokens />\n      {active &&\n        (slide ? (\n          <motion.span\n            layoutId={`${ctx.uid}-indicator`}\n            className=\"pc-tabs-ind\"\n            style={radius_ === undefined ? undefined : { borderRadius: radius_ }}\n            transition={spring.snap}\n            {...indProps}\n          />\n        ) : (\n          <span className=\"pc-tabs-ind\" data-anim={ctx.indicator === \"fade\" && ctx.touched ? \"fade\" : undefined} {...indProps} />\n        ))}\n      <span className=\"relative z-[1] inline-flex min-w-0 items-center gap-[inherit]\">\n        {icon}\n        {children}\n        {count != null && (\n          <span data-slot=\"tabs-count\" className={cn(\"pc-tabs-count inline-flex items-center justify-center rounded-full font-semibold tabular-nums\", COUNT_SIZES[ctx.size])}>\n            {typeof count === \"number\" ? <NumberFlow value={count} /> : count}\n          </span>\n        )}\n      </span>\n    </button>\n  )\n}\n\nexport type TabsContentProps = React.ComponentProps<\"div\"> & {\n  /** Shown when the TabsTrigger with this value is active. */\n  value: string\n  /** Keep the panel in the DOM (hidden) when inactive, e.g. to preserve form state. */\n  keepMounted?: boolean\n}\n\nexport function TabsContent({ value, keepMounted, className, children, ...props }: TabsContentProps) {\n  const ctx = useTabs(\"TabsContent\")\n  const active = ctx.value === value\n  const inDom = active || !!keepMounted\n  const { registerPanel } = ctx\n  React.useEffect(() => (inDom ? registerPanel(value) : undefined), [inDom, value, registerPanel])\n  if (!inDom) return null\n  const animated = ctx.touched && !ctx.reduce && ctx.transition !== \"none\"\n  return (\n    <div\n      role=\"tabpanel\"\n      id={`${ctx.uid}-panel-${safeId(value)}`}\n      aria-labelledby={`${ctx.uid}-tab-${safeId(value)}`}\n      hidden={!active}\n      tabIndex={0}\n      data-slot=\"tabs-content\"\n      data-state={active ? \"active\" : \"inactive\"}\n      data-transition={animated ? ctx.transition : undefined}\n      data-dir={ctx.dir > 0 ? \"next\" : \"prev\"}\n      className={cn(\n        \"pc-tabs-content min-w-0 flex-1 rounded-md outline-none focus-visible:ring-3 focus-visible:ring-ring/50\",\n        ctx.variant === \"enclosed\" && \"rounded-t-none rounded-b-lg border border-t-0 bg-card p-4\",\n        className,\n      )}\n      {...props}\n    >\n      {children}\n    </div>\n  )\n}\n",
      "type": "registry:component",
      "target": "components/goodui/tabs.tsx"
    }
  ],
  "categories": [
    "components",
    "core"
  ],
  "type": "registry:component"
}
