{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "tabs",
  "title": "Tabs",
  "description": "Astro tab panels with shared pill and underline appearances.",
  "dependencies": [
    "@data-slot/tabs",
    "class-variance-authority",
    "cn"
  ],
  "registryDependencies": [
    "@gnostic/segmented-control"
  ],
  "files": [
    {
      "path": "packages/ui/src/components/ui/tabs/index.ts",
      "content": "export { default as Tabs } from './tabs.astro'\nexport { default as TabsList } from './tabs-list.astro'\nexport { default as TabsTrigger } from './tabs-trigger.astro'\nexport { default as TabsContent } from './tabs-content.astro'\nexport {\n    tabsListVariants,\n    type TabsListVariantProps,\n    type TabsSize,\n    type TabsVariant,\n} from './tabs-list-variants'\n",
      "type": "registry:file",
      "target": "~/src/components/ui/tabs/index.ts"
    },
    {
      "path": "packages/ui/src/components/ui/tabs/tabs-content.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n  value?: string\n}\n\nconst { class: className, hidden = true, value, ...props } = Astro.props\n---\n\n<div\n  data-slot=\"tabs-content\"\n  hidden={hidden}\n  data-value={value}\n  class={cn(\"flex-1 outline-none\", className)}\n  {...props}\n>\n  <slot />\n</div>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/tabs/tabs-content.astro"
    },
    {
      "path": "packages/ui/src/components/ui/tabs/tabs-list-variants.ts",
      "content": "import { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from 'cn'\n\nimport type { SegmentedControlSize } from '../../../lib/segmented-control.ts'\n\n/**\n * Optical sizes from the coss segmented control.\n * The list writes these as CSS variables. A trigger reads them\n * unless that trigger sets its own size.\n *\n * @see https://coss.com/ui/docs/components/tabs\n */\n\nexport type TabsSize = SegmentedControlSize\n\nexport type TabsVariant = 'default' | 'underline'\n\nconst tabsListStyles = cva(\"text-muted-foreground relative z-0 flex w-fit items-center justify-center gap-x-0.5 group-data-[orientation=vertical]/tabs:flex-col group/tabs-list\", {\n    variants: {\n        variant: {\n            default: \"bg-muted text-muted-foreground/72 rounded-lg p-0.5 group-data-[orientation=vertical]/tabs:rounded-[min(var(--radius-lg),1rem)]\",\n            underline: \"*:data-[slot=tabs-trigger]:hover:bg-accent group-data-[orientation=horizontal]/tabs:py-1 group-data-[orientation=vertical]/tabs:px-1\",\n        },\n        size: {\n            sm: \"[--tabs-item-height:--spacing(7.5)] [--tabs-item-padding-inline:calc(var(--spacing)*2-1px)] sm:[--tabs-item-height:--spacing(6.5)]\",\n            default: \"[--tabs-item-height:--spacing(8.5)] [--tabs-item-padding-inline:calc(var(--spacing)*2.5-1px)] sm:[--tabs-item-height:--spacing(7.5)]\",\n            lg: \"[--tabs-item-height:--spacing(9.5)] [--tabs-item-padding-inline:calc(var(--spacing)*3-1px)] sm:[--tabs-item-height:--spacing(8.5)]\",\n        },\n    },\n    defaultVariants: {\n        variant: 'default',\n        size: 'default',\n    },\n})\n\nexport const tabsListVariants = (...args: Parameters<typeof tabsListStyles>) =>\n    cn(tabsListStyles(...args))\n\nexport type TabsListVariantProps = VariantProps<typeof tabsListVariants>\n\n/**\n * The indicator follows the active trigger through the CSS variables\n * that @data-slot/tabs writes on this element.\n */\nconst tabsIndicatorStyles = cva(\"pointer-events-none absolute top-(--active-tab-top) left-(--active-tab-left) h-(--active-tab-height) w-(--active-tab-width) transition-all duration-200 ease-in-out\", {\n    variants: {\n        variant: {\n            default: \"bg-background dark:bg-input -z-1 rounded-md shadow-sm/5 group-data-[orientation=vertical]/tabs:rounded-[min(var(--radius-md),1rem)]\",\n            underline: \"bg-primary z-10 group-data-[orientation=horizontal]/tabs:top-[calc(var(--active-tab-top)+var(--active-tab-height)-1px)] group-data-[orientation=horizontal]/tabs:h-0.5 group-data-[orientation=vertical]/tabs:left-[calc(var(--active-tab-left)-1px)] group-data-[orientation=vertical]/tabs:w-0.5\",\n        },\n    },\n    defaultVariants: {\n        variant: 'default',\n    },\n})\n\nexport const tabsIndicatorVariants = (\n    ...args: Parameters<typeof tabsIndicatorStyles>\n) => cn(tabsIndicatorStyles(...args))\n",
      "type": "registry:file",
      "target": "~/src/components/ui/tabs/tabs-list-variants.ts"
    },
    {
      "path": "packages/ui/src/components/ui/tabs/tabs-list.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"cn\"\n\nimport {\n  tabsListVariants,\n  tabsIndicatorVariants,\n  type TabsSize,\n  type TabsVariant,\n} from \"./tabs-list-variants\"\n\ntype Props = HTMLAttributes<\"div\"> & {\n  variant?: TabsVariant\n  /** Sets the size of every trigger in this list. */\n  size?: TabsSize\n}\n\nexport { tabsIndicatorVariants } from \"./tabs-list-variants\"\n\nconst {\n  class: className,\n  variant = \"default\",\n  size = \"default\",\n  ...props\n} = Astro.props\n---\n\n<div\n  data-slot=\"tabs-list\"\n  data-variant={variant}\n  data-size={size}\n  class={cn(tabsListVariants({ variant, size }), className)}\n  {...props}\n>\n  <slot />\n  {/* Sliding active surface. The tabs script positions it. */}\n  <div\n    data-slot=\"tabs-indicator\"\n    aria-hidden=\"true\"\n    class={tabsIndicatorVariants({ variant })}\n  ></div>\n</div>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/tabs/tabs-list.astro"
    },
    {
      "path": "packages/ui/src/components/ui/tabs/tabs-trigger.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"cn\"\n\nimport { type TabsSize } from \"./tabs-list-variants\"\nimport { segmentedControlItemSizeClassNames } from \"../../../lib/segmented-control.ts\"\n\ntype Props = HTMLAttributes<\"button\"> & {\n  value?: string\n  /** Replaces the size inherited from TabsList. */\n  size?: TabsSize\n}\n\nconst { class: className, value, size, type = \"button\", ...props } = Astro.props\n---\n\n<button\n  data-slot=\"tabs-trigger\"\n  data-value={value}\n  data-size={size}\n  type={type}\n  class={cn(\n    \"relative flex shrink-0 grow cursor-pointer items-center justify-center gap-1.5 rounded-md border border-transparent font-medium whitespace-nowrap text-base outline-none transition-[color,background-color,box-shadow] hover:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-64 data-disabled:pointer-events-none data-disabled:opacity-64 aria-disabled:pointer-events-none aria-disabled:opacity-64 group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start data-[state=active]:text-foreground sm:text-sm [&_svg]:pointer-events-none [&_svg]:-mx-0.5 [&_svg]:shrink-0 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/tabs:rounded-[min(var(--radius-md),1rem)]\",\n    size\n      ? segmentedControlItemSizeClassNames[size]\n      : \"h-(--tabs-item-height) px-(--tabs-item-padding-inline)\",\n    className,\n  )}\n  {...props}\n>\n  <slot />\n</button>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/tabs/tabs-trigger.astro"
    },
    {
      "path": "packages/ui/src/components/ui/tabs/tabs.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"cn\"\nimport type { TabsProps } from \"./types.ts\"\n\ntype Props = HTMLAttributes<\"div\"> & TabsProps\n\nconst {\n  class: className,\n  defaultValue,\n  orientation = \"horizontal\",\n  activationMode,\n  ...props\n} = Astro.props\n---\n\n{/*\n  data-orientation is the value @data-slot/tabs reads for keyboard navigation.\n  Styles select that value with data-[orientation=horizontal] and\n  data-[orientation=vertical].\n*/}\n<div\n  data-slot=\"tabs\"\n  data-default-value={defaultValue}\n  data-orientation={orientation}\n  data-activation-mode={activationMode}\n  class={cn(\"flex flex-col gap-2 data-[orientation=vertical]:flex-row group/tabs\", className)}\n  {...props}\n>\n  <slot />\n</div>\n\n<script>\n  import { create } from \"@data-slot/tabs\"\n  import type { TabsController } from \"@data-slot/tabs\"\n\n  const controllers: TabsController[] = []\n\n  // Place the active indicator on the same turn the tabs bind.\n  // The library also schedules a frame; this call covers the first paint.\n  const initialize = () => {\n    const next = create()\n    for (const controller of next) controller.updateIndicator()\n    controllers.push(...next)\n  }\n\n  initialize()\n  document.addEventListener(\"astro:page-load\", initialize)\n  document.addEventListener(\"astro:before-swap\", () => {\n    for (const controller of controllers) controller.destroy()\n    controllers.length = 0\n  })\n</script>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/tabs/tabs.astro"
    },
    {
      "path": "packages/ui/src/components/ui/tabs/types.ts",
      "content": "import type { TabsOptions } from '@data-slot/tabs'\nimport type { VariantProps } from 'class-variance-authority'\n\nimport type { tabsListVariants } from './tabs-list-variants.ts'\n\n/** Tabs configuration rendered as data attributes. */\nexport type TabsProps = Pick<\n    TabsOptions,\n    'defaultValue' | 'orientation' | 'activationMode'\n>\n\nexport type TabsListProps = VariantProps<typeof tabsListVariants>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/tabs/types.ts"
    }
  ],
  "meta": {
    "framework": "astro",
    "source": "@gnostic/ui",
    "testedDependencies": {
      "@data-slot/tabs": "^1.1.2",
      "class-variance-authority": "^0.7.1",
      "cn": "0.5.2"
    }
  },
  "docs": "https://ui.gnosticai.com/components/tabs",
  "categories": [
    "ui"
  ],
  "type": "registry:ui"
}
