import React from "react"; import { createComponentTemplate } from "vibe-storybook-components"; import Search from "../Search"; import { createStoryMetaSettingsDecorator } from "../../../storybook"; import DialogContentContainer from "../../DialogContentContainer/DialogContentContainer"; import Combobox from "../../Combobox/Combobox"; import Flex from "../../Flex/Flex"; import { Decorator, Meta, StoryObj } from "@storybook/react"; import IconButton from "../../IconButton/IconButton"; import FilterIcon from "../../Icon/Icons/components/Filter"; const metaSettings = createStoryMetaSettingsDecorator({ component: Search, iconPropNamesArray: ["searchIconName", "clearIconName"] }); const searchTemplate = createComponentTemplate(Search); export default { title: "Inputs/Search", component: Search, argTypes: metaSettings.argTypes, decorators: metaSettings.decorators } satisfies Meta; type Story = StoryObj; const withFixedWidth: Decorator = Story => (
); export const Overview: Story = { render: searchTemplate.bind({}), args: { placeholder: "Placeholder text here" }, decorators: [withFixedWidth], parameters: { docs: { liveEdit: { isEnabled: false } } } }; export const Sizes: Story = { render: () => ( <> ), decorators: [ Story => ( ), withFixedWidth ], parameters: { docs: { liveEdit: { scope: { Search } } } } }; export const WithAdditionalAction: Story = { render: () => ( } /> ), decorators: [withFixedWidth], parameters: { docs: { liveEdit: { scope: { Search, FilterIcon } } } } }; const options = [ { id: "1", label: "Cheese Cake" }, { id: "2", label: "Muffin" }, { id: "3", label: "Cookie" }, { id: "4", label: "Cup cake" }, { id: "5", label: "Banana lottie" } ]; export const FilterInCombobox: Story = { render: () => ( ), decorators: [ Story => ( ), withFixedWidth ], parameters: { docs: { liveEdit: { scope: { options } } } } };