import { Meta, StoryObj } from "@storybook/react-vite"; import Template from "@tsed/tailwind-formio"; import { Icon } from "./Icon"; /** * Icon component to display icons based on [BxIcons](https://boxicons.com/). * * ## Usage * * ```ts * import {Icon} from "@tsed/react-formio/atoms/icon/Icon"; * ``` * * ## Override Icon * * This component is registered with the name `Icon` and can be overridden with the following code: * * ```ts * registerComponent("Icon", MyIconComponent); * ``` */ export default { title: "Icon", component: Icon, argTypes: { name: { control: "text" }, iconset: { control: "select", options: ["bx", "lu"] }, spinning: { control: "boolean" } }, parameters: { children: "Text", variant: "primary" } } satisfies Meta; type Story = StoryObj; export const Usage: Story = { args: { name: "save" } }; export const Size: Story = { args: { name: "save" }, render(args) { return (
{["text-sm", "text-large", "text-xl", "text-3xl", "text-8xl"].map((className) => (
))}
); } }; export const Colors: Story = { args: { name: "save" }, render(args) { return (
{["text-sm text-red-600", "text-large text-primary", "text-xl text-secondary", "text-3xl text-green-600"].map((className) => (
))}
); } }; export const Rounded: Story = { args: { name: "save" }, render(args) { return (
{["text-sm bg-red-600", "text-large bg-primary", "text-xl bg-secondary", "text-3xl bg-green-600"].map((className) => (
))}
); } }; /** * Formio needs theses icons to be displayed in the form builder and other places. */ export const PresetsForFormio: Story = { args: { name: "save" }, render() { return (

Lucide

See more{" "} here
{Object.entries(Template.templates.tailwind.ICONS["lu"]).map(([icon]) => (
{icon}
))}

BxIcons

See more{" "} here
{Object.entries(Template.templates.tailwind.ICONS["bx"]).map(([icon]) => (
{icon}
))}
); } };