import { Meta } from "@storybook/react";
import { TextAreaProps } from "./TextAreaProps";
import TextArea from "./TextArea";

export default {
  title: "Design System/Inputs/TextArea",
  component: TextArea,
  tags: ["autodocs"],
  parameters: {
    docs: {
      description: {
        component:
          'The KendoReact TextArea component offers a highly customizable interface for the user to submit value on multiple lines. \n\n```javascript\nimport { TextArea } from "@renault-ui-library"\n```',
      },
    },
  },
  argTypes: {
    dataTestId: {
      control: { type: "text" },
      description: "Specifies the data-test-id attribute for testing purposes.",
    },
    ariaDescribedBy: {
      control: { type: "text" },
      description: "Aria described by attribute",
    },
    ariaLabelledBy: {
      control: { type: "text" },
      description: "Aria labelled by attribute",
    },
    autoSize: {
      control: { type: "boolean" },
      description: "Auto size for the text area",
    },
    className: {
      control: { type: "text" },
      description: "Class name for the text area",
    },
    defaultValue: {
      control: { type: "text" },
      description: "Default value for the text area",
    },
    dir: {
      control: { type: "select", options: ["ltr", "rtl", "auto"] },
      description: "Direction for the text area",
    },
    disabled: {
      control: { type: "boolean" },
      description: "Disabled state for the text area",
    },
    fillMode: {
      control: { type: "select", options: [null, "flat", "outline", "solid"] },
      description: "Fill mode for the text area",
    },
    id: {
      control: { type: "text" },
      description: "ID for the text area",
    },
    name: {
      control: { type: "text" },
      description: "Name for the text area",
    },
    placeholder: {
      control: { type: "text" },
      description: "Placeholder for the text area",
    },
    readOnly: {
      control: { type: "boolean" },
      description: "Read-only state for the text area",
    },
    required: {
      control: { type: "boolean" },
      description: "Required state for the text area",
    },
    rounded: {
      control: {
        type: "select",
        options: [null, "small", "medium", "full", "large"],
      },
      description: "Rounded corners for the text area",
    },
    rows: {
      control: { type: "number" },
      description: "Rows for the text area",
    },
    size: {
      control: { type: "select", options: [null, "small", "medium", "large"] },
      description: "Size for the text area",
    },
    style: {
      control: { type: "object" },
      description: "Style for the text area",
    },
    tabIndex: {
      control: { type: "number" },
      description: "Tab index for the text area",
    },
    valid: {
      control: { type: "boolean" },
      description: "Valid state for the text area",
    },
    validationMessage: {
      control: { type: "text" },
      description: "Validation message for the text area",
    },
    validityStyles: {
      control: { type: "boolean" },
      description: "Validity styles for the text area",
    },
    value: {
      control: { type: "text" },
      description: "Value for the text area",
    },
  },
} as Meta;

export const Default = (args: TextAreaProps): JSX.Element => (
  <TextArea {...args} style={{ width: 300 }} />
);

Default.args = {
  dataTestId: "text-area-data-testid",
  defaultValue: "Default text",
};
