import type { Meta, StoryObj } from "@storybook/react"; import type { SegmentProps } from "./Segment"; import { Segment } from "./Segment"; import type { SegmentGroupProps } from "./SegmentGroup"; import { SegmentGroup } from "./SegmentGroup"; import { Text, Flex, TextField, TextArea, RadioGroup, Radio, Select, Option, Divider, } from ".."; type StoryType = StoryObj; const meta: Meta = { title: "Layout/Segment", component: Segment, excludeStories: [ "ColouredBackground", "HorizontalStack2", "HorizontalStack3", "Nested2", "Nested3", "BottomGapRemoved", "CompoundLayout", "GapAround", "PaymentDetails", ], argTypes: { colour: { control: { type: "select" }, options: ["", "primary", "secondary", "grey", "subtle"], }, inverted: { control: { type: "boolean" }, if: { arg: "colour", }, }, }, }; const sizeOptions = [ "", "size-xs", "size-s", "size-m", "size-l", "size-xl", "size-xxl", ]; export const Single: StoryType = { render: (args: SegmentProps) => ( General liability* $300.00 Contractor‘s equipment and small tools $80.00 Cyber insurance $250.00 ), args: { heading: "Today's Payment", inverted: false, }, }; export const VerticalStack: StoryType = { render: (args: SegmentProps) => ( Item Item Item ), args: { heading: "", inverted: true, }, }; export const HorizontalStack: Meta = { render: (args: SegmentGroupProps) => ( Item Item Item ), args: { horizontal: true, gap: "size-xs", }, argTypes: { gap: { control: { type: "select" }, options: [...sizeOptions], }, }, parameters: { controls: { exclude: ["heading", "colour"], }, }, }; export const Nested: StoryType = { render: (args: SegmentProps) => ( Item Item Item ), args: { heading: "Today's Payment", inverted: false, }, }; export const Nested2 = () => ( Item Item ); export const Nested3 = () => ( Item ); export const ColouredBackground = () => (
Subtle Secondary Primary Secondary
); export const HorizontalStack2 = () => ( Item Item ); export const HorizontalStack3 = () => ( Item ); export const BottomGapRemoved = () => (