{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "toggle-group-story",
  "title": "Toggle Group Story",
  "author": "Lloyd Richards <lloyd.d.richards@gmail.com>",
  "description": "Interactive Storybook stories demonstrating toggle group component usage and variants",
  "dependencies": [
    "lucide-react",
    "react-aria-components"
  ],
  "registryDependencies": [
    "toggle-group"
  ],
  "files": [
    {
      "path": "registry/ui/toggle-group-story/toggle-group-aria.stories.tsx",
      "content": "import { expect, userEvent } from \"storybook/test\";\nimport type { Meta, StoryObj } from \"@storybook/nextjs-vite\";\nimport { Bold, Italic, Underline } from \"lucide-react\";\n\nimport {\n  ToggleGroup,\n  ToggleGroupItem,\n} from \"@/components/ui/toggle-group\";\n\n/**\n * A set of two-state buttons that can be toggled on or off.\n */\nconst meta = {\n  id: \"ui-aria-togglegroup\",\n  title: \"ui/ToggleGroup\",\n  component: ToggleGroup,\n  tags: [\"autodocs\"],\n  argTypes: {\n    selectionMode: {\n      options: [\"multiple\", \"single\"],\n      control: { type: \"radio\" },\n    },\n  },\n  args: {\n    variant: \"default\",\n    size: \"default\",\n    selectionMode: \"multiple\",\n    isDisabled: false,\n  },\n  render: (args) => (\n    <ToggleGroup aria-label=\"Formatting\" {...args}>\n      <ToggleGroupItem id=\"bold\" aria-label=\"Toggle bold\">\n        <Bold className=\"h-4 w-4\" />\n      </ToggleGroupItem>\n      <ToggleGroupItem id=\"italic\" aria-label=\"Toggle italic\">\n        <Italic className=\"h-4 w-4\" />\n      </ToggleGroupItem>\n      <ToggleGroupItem id=\"underline\" aria-label=\"Toggle underline\">\n        <Underline className=\"h-4 w-4\" />\n      </ToggleGroupItem>\n    </ToggleGroup>\n  ),\n  parameters: {\n    layout: \"centered\",\n  },\n} satisfies Meta<typeof ToggleGroup>;\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\n/**\n * The default form of the toggle group.\n */\nexport const Default: Story = {};\n\n/**\n * Use the `outline` variant to emphasizing the individuality of each button\n * while keeping them visually cohesive.\n */\nexport const Outline: Story = {\n  args: {\n    variant: \"outline\",\n  },\n};\n\n/**\n * Use the `single` type to create exclusive selection within the button\n * group, allowing only one button to be active at a time.\n */\nexport const Single: Story = {\n  args: {\n    selectionMode: \"single\",\n  },\n};\n\n/**\n * Use the `sm` size for a compact version of the button group, featuring\n * smaller buttons for spaces with limited real estate.\n */\nexport const Small: Story = {\n  args: {\n    size: \"sm\",\n  },\n};\n\n/**\n * Use the `lg` size for a more prominent version of the button group, featuring\n * larger buttons for emphasis.\n */\nexport const Large: Story = {\n  args: {\n    size: \"lg\",\n  },\n};\n\n/**\n * Add the `isDisabled` prop to a button to prevent interactions.\n */\nexport const Disabled: Story = {\n  args: {\n    isDisabled: true,\n  },\n};\n\n/** Enable two formatting options in a multiple-selection group. */\nexport const KeyboardInteraction: Story = {\n  tags: [\"!dev\", \"!autodocs\"],\n  play: async ({ canvas }) => {\n    const bold = canvas.getByRole(\"button\", { name: \"Toggle bold\" });\n    const italic = canvas.getByRole(\"button\", { name: \"Toggle italic\" });\n    bold.focus();\n    await userEvent.keyboard(\" {ArrowRight} \");\n    await expect(bold).toHaveAttribute(\"aria-pressed\", \"true\");\n    await expect(italic).toHaveAttribute(\"aria-pressed\", \"true\");\n  },\n};\n",
      "type": "registry:component",
      "target": "@ui/toggle-group.stories.tsx"
    }
  ],
  "categories": [
    "ui",
    "storybook",
    "toggle-group",
    "form"
  ],
  "type": "registry:component"
}