import { Meta } from "@storybook/react";
import { RatingProps } from "./RatingProps";
import Rating from "./Rating";
export default {
  title: "Design System/Inputs/Rating",
  component: Rating,
  tags: ["autodocs"],
  parameters: {
    docs: {
      description: {
        component:
          'The KendoReact Rating component enables the user to increase, decrease, and select predefined values by clicking its icons along or using the arrow keys. \n\n```javascript\nimport { Rating } 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:
        "Identifies the element(s) which will describe the component.",
    },
    ariaLabelledBy: {
      control: { type: "text" },
      description: "Identifies the element(s) that labels the component.",
    },
    children: {
      control: { type: "text" },
      description: "The children of the component.",
    },
    className: {
      control: { type: "text" },
      description: "The class name of the component.",
    },
    defaultValue: {
      control: { type: "number" },
      description: "The default value of the component.",
    },
    dir: {
      control: { type: "text" },
      description: "The direction of the component.",
    },
    disabled: {
      control: { type: "boolean" },
      description: "If the component is disabled.",
    },
    half: {
      control: { type: "boolean" },
      description: "If the component supports half stars.",
    },
    icon: {
      control: { type: "text" },
      description: "The icon of the component.",
    },
    id: {
      control: { type: "text" },
      description: "The ID of the component.",
    },
    item: {
      control: { type: "object" },
      description: "The item renderer of the component.",
    },
    label: {
      control: { type: "text" },
      description: "The label of the component.",
    },
    max: {
      control: { type: "number" },
      description: "The maximum value of the component.",
    },
    min: {
      control: { type: "number" },
      description: "The minimum value of the component.",
    },
    name: {
      control: { type: "text" },
      description: "The name of the component.",
    },
    precision: {
      control: { type: "select", options: ["item", "half"] },
      description: "The precision of the component.",
    },
    readonly: {
      control: { type: "boolean" },
      description: "If the component is read-only.",
    },
    required: {
      control: { type: "boolean" },
      description: "If the component is required.",
    },
    selection: {
      control: { type: "select", options: ["single", "continues"] },
      description: "The selection mode of the component.",
    },
    step: {
      control: { type: "number" },
      description: "The step of the component.",
    },
    style: {
      control: { type: "object" },
      description: "The style object of the component.",
    },
    svgIcon: {
      control: { type: "object" },
      description: "The SVG icon of the component.",
    },
    svgIconOutline: {
      control: { type: "object" },
      description: "The SVG icon outline of the component.",
    },
    tabIndex: {
      control: { type: "number" },
      description: "The tabIndex of the component.",
    },
    valid: {
      control: { type: "boolean" },
      description: "If the component is valid.",
    },
    validationMessage: {
      control: { type: "text" },
      description: "The validation message of the component.",
    },
    validityStyles: {
      control: { type: "boolean" },
      description: "If the component should show validity styles.",
    },
    value: {
      control: { type: "number" },
      description: "The value of the component.",
    },
    onBlur: {
      control: { type: "action" },
      description: "Triggered after onBlur event.",
    },
    onChange: {
      control: { type: "action" },
      description: "Triggered when the value changes.",
    },
    onClick: {
      control: { type: "action" },
      description: "Triggered when an item is clicked.",
    },
    onFocus: {
      control: { type: "action" },
      description: "Triggered after onFocus event.",
    },
    onKeyDown: {
      control: { type: "action" },
      description: "Triggered when a key is pressed.",
    },
  },
} as Meta;

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

Default.args = {
  dataTestId: "card-data-testid",
};
