import { Meta } from "@storybook/react";
import { IconProps } from "./IconProps";
import Icon from "./Icon";

export default {
  title: "Design System/Common Utilities/Icons/Icon",
  component: Icon,
  tags: ["autodocs"],
  parameters: {
    docs: {
      description: {
        component:
          'Icon component is used to display font icons. All Kendo UI Icons are supported. \n\n```javascript\nimport { Icon } from "@renault-ui-library"\n```',
      },
    },
  },
  argTypes: {
    dataTestId: {
      control: { type: "text" },
      description: "Specifies the data-test-id attribute for testing purposes.",
    },
    className: {
      control: { type: "text" },
      description:
        "Specifies a list of CSS classes that will be added to the root DOM element.",
    },
    flip: {
      control: {
        type: "select",
        options: ["default", "horizontal", "vertical", "both"],
      },
      description: "Specifies the icon flip direction.",
    },
    id: {
      control: { type: "text" },
      description: "Sets the id of the icon element.",
    },
    name: {
      control: { type: "text" },
      description: "Represents the name of the icon.",
    },
    size: {
      control: {
        type: "select",
        options: [
          "default",
          "xsmall",
          "small",
          "medium",
          "large",
          "xlarge",
          "xxlarge",
          "xxxlarge",
        ],
      },
      description: "Specifies the size of the icon.",
    },
    style: {
      control: { type: "object" },
      description: "Sets additional CSS styles to the icon.",
    },
    tabIndex: {
      control: { type: "number" },
      description: "Sets the tabIndex of the icon element.",
    },
    themeColor: {
      control: {
        type: "select",
        options: [
          "inherit",
          "primary",
          "secondary",
          "tertiary",
          "info",
          "success",
          "warning",
          "error",
          "dark",
          "light",
          "inverse",
        ],
      },
      description: "Specifies the theme color of the Icon.",
    },
  },
} as Meta;

export const Default = (args: IconProps): JSX.Element => <Icon {...args} />;

Default.args = {
  dataTestId: "icon-data-testid",
  name: "home",
};
