/* * Copyright (c) 2020 - present Cloudogu GmbH * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation, version 3. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more * details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see https://www.gnu.org/licenses/. */ // import React from "react"; // import { storiesOf } from "@storybook/react"; // import DropDown from "./DropDown"; // // storiesOf("Forms/DropDown", module) // .add("Default", () => ( // { // // nothing to do // }} // /> // )) // .add("With Translation", () => ( // { // // nothing to do // }} // /> // )) // .add("Add preselect if missing in options", () => ( // { // // nothing to do // }} // /> // )); import React from "react"; import type { Meta, StoryObj } from "@storybook/react"; import DropDown from "./DropDown"; const meta: Meta = { title: "Forms/DropDown", component: DropDown, parameters: { layout: "centered", }, argTypes: { optionSelected: { action: "optionSelected" }, }, tags: ["autodocs"], }; export default meta; type Story = StoryObj; export const Default: Story = { args: { options: ["en", "de", "es"], preselectedOption: "de", }, }; export const WithDisplayValues: Story = { name: "With Custom Display Values", args: { optionValues: ["hg2g", "dirk", "liff"], options: ["The Hitchhiker's Guide to the Galaxy", "Dirk Gently’s Holistic Detective Agency", "The Meaning Of Liff"], preselectedOption: "dirk", }, }; export const PreselectedOptionNotInList: Story = { name: "Preselected Value Not In Options", args: { optionValues: ["alpha", "beta", "gamma"], options: ["A", "B", "C"], preselectedOption: "D", }, };