import React from "react"; import { createComponentTemplate, Link } from "vibe-storybook-components"; import IconButton from "../IconButton"; import Text from "../../Text/Text"; import Flex from "../../Flex/Flex"; import Button from "../../Button/Button"; import person1 from "./assets/person1.png"; import { Add, Bolt, CloseSmall, Doc, Drag, Filter, Item, Robot, Time } from "../../Icon/Icons"; import { createStoryMetaSettingsDecorator } from "../../../storybook"; import Icon from "../../Icon/Icon"; import Heading from "../../LegacyHeading/LegacyHeading"; import Avatar from "../../Avatar/Avatar"; import styles from "./IconButton.stories.module.scss"; import { Meta, StoryObj } from "@storybook/react"; type Story = StoryObj; const metaSettings = createStoryMetaSettingsDecorator({ component: IconButton, enumPropNamesArray: ["kind", "size", "color"], iconPropNamesArray: ["icon"], actionPropsArray: ["onClick"] }); const iconButtonTemplate = createComponentTemplate(IconButton); export default { title: "Buttons/IconButton", component: IconButton, argTypes: metaSettings.argTypes, decorators: metaSettings.decorators } satisfies Meta; export const Overview: Story = { render: iconButtonTemplate.bind({}), args: { ariaLabel: "Add", icon: Add }, parameters: { docs: { liveEdit: { isEnabled: false } } } }; export const Kinds: Story = { render: () => (
), parameters: { docs: { liveEdit: { scope: { Bolt } } } } }; export const Sizes: Story = { render: () => (
), parameters: { docs: { liveEdit: { scope: { Robot } } } } }; export const Active: Story = { render: () => (
), parameters: { docs: { liveEdit: { scope: { Doc } } } } }; export const Disabled: Story = { render: () => (
), parameters: { docs: { liveEdit: { scope: { Doc } } } } }; export const IconButtonAsToolbarButton: Story = { render: () => (
), parameters: { docs: { liveEdit: { scope: { styles, Drag, Filter } } } }, name: "Icon button as toolbar button" }; export const IconButtonAsCloseButton: Story = { render: () => ( <> Hadas Farhi deleted the item Hello World from the board Tasks 13m (Available for restore in the next 1M) ), parameters: { docs: { liveEdit: { scope: { styles, person1, Item, Time, CloseSmall } } } }, name: "Icon button as close button" };