{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "components-base-toggle-group",
  "title": "Toggle Group",
  "description": "Provides a shared state to a series of toggle buttons.",
  "registryDependencies": [
    "@animate-ui/primitives-base-toggle-group"
  ],
  "files": [
    {
      "path": "registry/components/base/toggle-group/index.tsx",
      "content": "import * as React from 'react';\nimport { type VariantProps } from 'class-variance-authority';\n\nimport {\n  ToggleGroup as ToggleGroupPrimitive,\n  Toggle as TogglePrimitive,\n  ToggleGroupHighlight as ToggleGroupHighlightPrimitive,\n  ToggleHighlight as ToggleHighlightPrimitive,\n  useToggleGroup as useToggleGroupPrimitive,\n  type ToggleGroupProps as ToggleGroupPrimitiveProps,\n  type ToggleProps as TogglePrimitiveProps,\n} from '@/components/animate-ui/primitives/base/toggle-group';\nimport { toggleVariants } from '@/components/animate-ui/components/base/toggle';\nimport { cn } from '@/lib/utils';\nimport { getStrictContext } from '@/lib/get-strict-context';\n\nconst [ToggleGroupProvider, useToggleGroup] =\n  getStrictContext<VariantProps<typeof toggleVariants>>('ToggleGroupContext');\n\ntype ToggleGroupProps = ToggleGroupPrimitiveProps &\n  VariantProps<typeof toggleVariants>;\n\nfunction ToggleGroup({\n  className,\n  variant,\n  size,\n  children,\n  multiple,\n  ...props\n}: ToggleGroupProps) {\n  return (\n    <ToggleGroupPrimitive\n      data-variant={variant}\n      data-size={size}\n      className={cn(\n        'group/toggle-group flex gap-0.5 w-fit items-center rounded-lg data-[variant=outline]:shadow-xs data-[variant=outline]:border data-[variant=outline]:p-0.5',\n        className,\n      )}\n      multiple={multiple}\n      {...props}\n    >\n      <ToggleGroupProvider value={{ variant, size }}>\n        {!multiple ? (\n          <ToggleGroupHighlightPrimitive className=\"bg-accent rounded-md\">\n            {children}\n          </ToggleGroupHighlightPrimitive>\n        ) : (\n          children\n        )}\n      </ToggleGroupProvider>\n    </ToggleGroupPrimitive>\n  );\n}\n\ntype ToggleProps = TogglePrimitiveProps & VariantProps<typeof toggleVariants>;\n\nfunction Toggle({ className, children, variant, size, ...props }: ToggleProps) {\n  const { variant: contextVariant, size: contextSize } = useToggleGroup();\n  const { multiple } = useToggleGroupPrimitive();\n\n  return (\n    <ToggleHighlightPrimitive\n      value={props.value?.toString()}\n      className={cn(multiple && 'bg-accent rounded-md')}\n    >\n      <TogglePrimitive\n        data-variant={contextVariant || variant}\n        data-size={contextSize || size}\n        className={cn(\n          toggleVariants({\n            variant: contextVariant || variant,\n            size: contextSize || size,\n          }),\n          'min-w-0 border-0 flex-1 shrink-0 shadow-none rounded-md focus:z-10 focus-visible:z-10',\n          className,\n        )}\n        {...props}\n      >\n        {children}\n      </TogglePrimitive>\n    </ToggleHighlightPrimitive>\n  );\n}\n\nexport { ToggleGroup, Toggle, type ToggleGroupProps, type ToggleProps };\n",
      "type": "registry:ui",
      "target": "components/animate-ui/components/base/toggle-group.tsx"
    }
  ],
  "type": "registry:ui"
}