import { Meta } from "@storybook/react";
import { CalendarProps } from "./CalendarProps";
import Calendar from "./Calendar";

export default {
  title: "Design System/Date Inputs/Calendar",
  component: Calendar,
  tags: ["autodocs"],
  parameters: {
    docs: {
      description: {
        component:
          'The KendoReact Calendar is a form component that represents a graphical Gregorian calendar and supports the selection of and navigation between dates and date ranges for scheduling appointments. \n\n```javascript\nimport { Calendar } 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, similar to HTML aria-describedby attribute.",
    },
    ariaLabelledBy: {
      control: { type: "text" },
      description: "Identifies the element(s) which will label the component.",
    },
    bottomView: {
      control: {
        type: "select",
        options: ["month", "year", "decade", "century"],
      },
      description:
        "Defines the bottommost view to which the user can navigate.",
    },
    cell: {
      control: { type: "object" },
      description:
        "Enables the customization or the override of the default Calendar cell.",
    },
    className: {
      control: { type: "text" },
      description: "Sets the className of the Calendar.",
    },
    defaultActiveView: {
      control: {
        type: "select",
        options: ["month", "year", "decade", "century"],
      },
      description: "Sets the default active view of the Calendar.",
    },
    defaultValue: {
      control: { type: "date" },
      description: "Sets the default value of the Calendar.",
    },
    disabled: {
      control: { type: "boolean" },
      description: "Determines whether the Calendar is disabled.",
    },
    focusedDate: {
      control: { type: "date" },
      description: "Sets the initial focused date of the Calendar.",
    },
    headerTitle: {
      control: { type: "object" },
      description:
        "Enables the customization or the override of the default header title in the Calendar.",
    },
    id: {
      control: { type: "text" },
      description: "Sets the id of the Calendar.",
    },
    max: {
      control: { type: "date" },
      description: "Sets the maximum allowed date of the Calendar.",
    },
    min: {
      control: { type: "date" },
      description: "Sets the minimum allowed date of the Calendar.",
    },
    navigation: {
      control: { type: "boolean" },
      description: "Determines if the navigation sidebar will be displayed.",
    },
    navigationItem: {
      control: { type: "object" },
      description:
        "Enables the customization or the override of the default navigation item in the Calendar.",
    },
    smoothScroll: {
      control: { type: "boolean" },
      description:
        "Toggles the smooth scroll animation on navigation item click.",
    },
    tabIndex: {
      control: { type: "number" },
      description: "Sets the tabIndex property of the Calendar.",
    },
    topView: {
      control: {
        type: "select",
        options: ["month", "year", "decade", "century"],
      },
      description: "Defines the topmost view to which the user can navigate.",
    },
    value: {
      control: { type: "date" },
      description: "Sets the value of the Calendar.",
    },
    weekCell: {
      control: { type: "object" },
      description:
        "Enables the customization or the override of the default week-column cell in the Calendar.",
    },
    weekNumber: {
      control: { type: "boolean" },
      description: "Determines if the week number column will be displayed.",
    },
    onBlur: {
      control: { type: "action" },
      description: "Fires each time the Calendar is blurred.",
    },
    onChange: {
      control: { type: "action" },
      description:
        "An event that is called after the value of the Calendar has changed.",
    },
    onFocus: {
      control: { type: "action" },
      description: "Fires each time the Calendar is focused.",
    },
  },
} as Meta;

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

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