import type { Meta, StoryObj } from "@storybook/react-vite"; import { StarRegularIcon } from "alouette-icons/phosphor-icons/Star"; import type { ReactNode } from "react"; import type { AccentOrNeutral } from "../../core/AlouetteConfig"; import { AccentScope } from "../containers/AccentScope"; import { Story, neutralAndAccents } from "../story-components/Story"; import { StoryGrid } from "../story-components/StoryGrid"; import { Icon } from "./Icon"; import { Text } from "./Text"; import { View } from "./View"; type ThisStory = StoryObj; export default { title: "alouette/Primitives/Icon", component: Icon, parameters: { componentSubtitle: "Renders an SVG icon, tinted via a text-colour className and sized in px", docs: { description: { component: `### Usage - **icon**: an SVG element, e.g. \`\` from \`alouette-icons/phosphor-icons/*\` - **size**: square size in px (defaults to 20) - **className**: text-colour token driving the tint (defaults to \`text-sharp\`) ~~~tsx } className="text-accent" size={24} /> ~~~`, }, }, }, } satisfies Meta; export const PreviewStory: ThisStory = { name: "Icon Preview", parameters: { layout: "padded", chromatic: { disableSnapshot: true }, }, args: { icon: , }, }; interface TintRowProps { className: string; } function TintRow({ className }: TintRowProps): ReactNode { return ( } className={className} size={24} /> {className} ); } function AccentColumn({ accent }: { accent: AccentOrNeutral }): ReactNode { return ( ); } export const VariantsStory: ThisStory = { name: "Icon Variants", render: () => ( {neutralAndAccents.map((accent) => ( ))} {([16, 20, 24, 32, 48] as const).map((size) => ( } size={size} /> {size} ))} ), };