diff --git a/src/stories/components/Select.mdx b/src/stories/components/Select.mdx new file mode 100644 index 0000000..9fc8b04 --- /dev/null +++ b/src/stories/components/Select.mdx @@ -0,0 +1,53 @@ +import { Canvas, Controls, Meta, Source } from "@storybook/blocks"; +import * as SelectStories from "./Select.stories"; + + + +# Select + +## Usage notes + +> The select component should only be used as a last resort in +> public-facing services because research shows that some users +> find selects very difficult to use. + +Please also refer to [GOV.UK Design System documentation on +Select](https://design-system.service.gov.uk/components/select/) for more +information. + +## Example + + + + +## Variants + +### Medium size + + + +### Small size + + + +## States + +### Disabled + + + +### Error + + + +## Implementation notes + +- add `ds-Select` as base class to a `select` element +- combine with one size modifier: `ds-select-small` or `ds-select-medium` +- note: `options` can't be styled + + + +Please check out the code on the given examples and otherwise +refer to [mdn web docs on \ + + + + + + + `; + }, + argTypes: { + label: { control: "text" }, + size: { + options: ["default", "medium", "small"], + control: { type: "radio" }, + }, + disabled: { + description: "Is the select not available for interaction?", + }, + error: { + description: "Is the select highlighted as not valid?", + }, + }, + args: { + size: "default", + label: loremSentences(1), + disabled: false, + error: false, + }, +} satisfies Meta; + +export default meta; + +type Story = StoryObj; + +export const Default = {} satisfies Story; +export const Disabled = { args: { disabled: true } } satisfies Story; +export const Error = { args: { error: true } } satisfies Story; +export const Small = { args: { size: "small" } } satisfies Story; +export const Medium = { args: { size: "medium" } } satisfies Story;