From e3523db6bb7dba635410749cc32458409c2be299 Mon Sep 17 00:00:00 2001 From: "GitStart-Cal.com" <121884634+gitstart-calcom@users.noreply.github.com> Date: Thu, 31 Aug 2023 19:17:09 +0000 Subject: [PATCH] fix: Add controls for Select Field storybook file (#10936) Co-authored-by: gitstart-calcom --- .../components/form/select/select.stories.mdx | 37 ++++++++++++++----- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/packages/ui/components/form/select/select.stories.mdx b/packages/ui/components/form/select/select.stories.mdx index 80bda8d100..e2cc37c11f 100644 --- a/packages/ui/components/form/select/select.stories.mdx +++ b/packages/ui/components/form/select/select.stories.mdx @@ -1,9 +1,8 @@ -import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs"; +import { Canvas, Meta, Story } from "@storybook/addon-docs"; import { Examples, Example, - Note, Title, CustomArgsTable, VariantRow, @@ -15,7 +14,7 @@ import { SelectField } from "./Select"; - +<Title title="Select" suffix="Brief" subtitle="Version 2.0 — Last Update: 29 Aug 2022" /> ## Definition @@ -101,11 +100,31 @@ const GoodSelect = (props) => <Select {...props} components={{ Control }} />; ## Select Story <Canvas> - <Story name="Default"> - <VariantsTable titles={["Default"]} columnMinWidth={450}> - <VariantRow> - <SelectField options={options} label={"Default Select"} /> - </VariantRow> - </VariantsTable> + <Story + name="Default" + args={{ + required: false, + name: "select-field", + error: "Some error", + variant: "default", + label: "Select an item", + isMulti: false, + options, + }} + argTypes={{ + variant: { + control: { + type: "select", + options: ["default", "checkbox"], + }, + }, + }}> + {(args) => ( + <VariantsTable titles={["Default"]} columnMinWidth={300}> + <VariantRow> + <SelectField {...args} /> + </VariantRow> + </VariantsTable> + )} </Story> </Canvas>