{"$schema":"https://ui.shadcn.com/schema/registry-item.json","author":"Eduardo Calvo <edu@smoothui.dev>","css":{},"dependencies":["@base-ui/react","motion"],"description":"Animated Toggle Group primitive for SmoothUI — segmented single or multi selection.","devDependencies":[],"files":[{"content":"\"use client\";\n\nimport { ToggleGroup as ToggleGroupPrimitive } from \"@base-ui/react/toggle-group\";\nimport { cn } from \"@/lib/utils\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport Toggle from \"../toggle\";\n\nexport type ToggleGroupRootProps = ComponentProps<\n  typeof ToggleGroupPrimitive\n> & {\n  className?: string;\n  children?: ReactNode;\n  /**\n   * When `\"single\"`, only one item can be pressed (maps to `multiple={false}`).\n   * When `\"multiple\"`, many items can be pressed.\n   */\n  type?: \"single\" | \"multiple\";\n};\n\nexport type ToggleGroupItemProps = {\n  \"aria-label\"?: string;\n  children?: ReactNode;\n  className?: string;\n  disabled?: boolean;\n  value: string;\n};\n\n/** Convenience alias for AutoTypeTable */\nexport type ToggleGroupProps = ToggleGroupRootProps;\n\n/**\n * SmoothUI Toggle Group — Base UI twin (default).\n * Segmented-control look; nest Toggle / ToggleGroupItem children.\n */\nconst ToggleGroupRoot = ({\n  className,\n  children,\n  multiple,\n  type,\n  ...props\n}: ToggleGroupRootProps) => {\n  const isMultiple = multiple ?? type === \"multiple\";\n  return (\n    <ToggleGroupPrimitive\n      className={cn(\n        \"inline-flex items-center justify-center gap-0.5 rounded-lg bg-foreground/10 p-1\",\n        \"data-orientation-vertical:flex-col\",\n        className\n      )}\n      data-slot=\"toggle-group\"\n      multiple={isMultiple}\n      {...props}\n    >\n      {children}\n    </ToggleGroupPrimitive>\n  );\n};\n\nconst ToggleGroupItem = ({\n  className,\n  children,\n  ...props\n}: ToggleGroupItemProps) => (\n  <Toggle\n    className={cn(\n      \"h-8 shrink-0 rounded-md border-transparent bg-transparent px-2.5 shadow-none\",\n      \"hover:bg-muted/80\",\n      // Dark: lift the chip with foreground tint; `bg-background`/`bg-input` look sunken on stage\n      \"data-pressed:bg-background data-pressed:text-foreground data-pressed:shadow-sm dark:data-pressed:bg-foreground/15\",\n      className\n    )}\n    {...props}\n  >\n    {children}\n  </Toggle>\n);\n\nexport { ToggleGroupItem, ToggleGroupRoot };\n\nexport default ToggleGroupRoot;\n","path":"index.tsx","target":"components/smoothui/toggle-group/index.tsx","type":"registry:ui"}],"name":"toggle-group","registryDependencies":["https://smoothui.dev/r/toggle.json"],"title":"Toggle Group","type":"registry:ui"}