import type { Meta, StoryObj } from "@storybook/react" import { SvgUse } from "../../shared/SvgUse" import { ToggleGroup, ToggleGroupItem } from "./ToggleGroup" /** * A ToggleGroup component for controlling a group of toggles. */ const meta = { title: "base/form/ToggleGroup", component: ToggleGroup, tags: ["autodocs"], parameters: { layout: "centered", }, } satisfies Meta export default meta type Story = StoryObj /** * Basic toggle group with text items. */ export const Basic: Story = { args: { type: "single", }, render: () => ( Left Center Right ), } /** * Toggle group with outline variant. */ export const Outline: Story = { args: { type: "single", variant: "outline", }, render: () => ( Day Week Month Year ), } /** * Toggle group allowing multiple selections. */ export const Multiple: Story = { args: { type: "multiple", variant: "outline", }, render: () => ( ), } /** * Toggle group with different size variants. */ export const Sizes: Story = { args: { type: "single", }, render: () => (
Apple Banana Orange Apple Banana Orange Apple Banana Orange
), } /** * Toggle group with icons and text. */ export const WithIconsAndText: Story = { args: { type: "single", variant: "outline", }, render: () => ( Facebook WhatsApp LinkedIn ), } /** * Toggle group with disabled items. */ export const DisabledItems: Story = { args: { type: "single", variant: "outline", }, render: () => ( Low Medium High Critical ), } /** * Practical example of using ToggleGroup for text alignment. */ export const TextAlignment: Story = { args: { type: "single", size: "sm", variant: "outline", }, render: () => (

Text Alignment

Sample text that would be aligned according to the selected alignment option.

), } /** * Example of using ToggleGroup for view selection. */ export const ViewToggle: Story = { args: { type: "single", variant: "outline", size: "sm", }, render: () => (

Gallery

{[1, 2, 3, 4, 5, 6].map(item => (
))}
), }