import { Meta } from "@storybook/react";
import { MultiViewCalendarProps } from "./MultiViewCalendarProps";
import MultiViewCalendar from "./MultiViewCalendar";

export default {
  title: "Design System/Date Inputs/MultiViewCalendar",
  component: MultiViewCalendar,
  tags: ["autodocs"],
  parameters: {
    docs: {
      description: {
        component:
          'The KendoReact MultiViewCalendar supports the selection of and navigation between dates as well as date ranges for scheduling appointments. \n\n```javascript\nimport { MultiViewCalendar } from "@renault-ui-library"\n```',
      },
    },
  },
  argTypes: {
    dataTestId: {
      control: { type: "text" },
      description: "Specifies the data-test-id attribute for testing purposes.",
    },
    activeRangeEnd: {
      control: { type: "text" },
      description:
        "Specifies which end of the defined selection range will be marked as active. If the selection range is undefined, the value is ignored.",
    },
    allowReverse: {
      control: { type: "boolean" },
      description:
        "If set to true, the component skips the validation of whether the from value is after the to value.",
    },
    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" },
      description:
        "Defines the bottommost view to which the user can navigate.",
    },
    cell: {
      control: { type: "text" },
      description:
        "Enables the customization or the override of the default MultiViewCalendar cell.",
    },
    className: {
      control: { type: "text" },
      description: "Sets the className of the MultiViewCalendar.",
    },
    defaultActiveView: {
      control: { type: "select" },
      description:
        "Sets the default active view of the MultiViewCalendar. If not set, the MultiViewCalendar displays the month view.",
    },
    defaultValue: {
      control: { type: "text" },
      description: "Sets the default value of the MultiViewCalendar.",
    },
    disabled: {
      control: { type: "boolean" },
      description: "Determines whether the MultiViewCalendar is disabled.",
    },
    focusedDate: {
      control: { type: "text" },
      description: "Sets the initial focused date of the MultiViewCalendar.",
    },
    headerTitle: {
      control: { type: "text" },
      description:
        "Enables the customization or the override of the default header title in the MultiViewCalendar.",
    },
    id: {
      control: { type: "text" },
      description: "Sets the id of the MultiViewCalendar.",
    },
    max: {
      control: { type: "text" },
      description:
        "Sets the maximum allowed date of the MultiViewCalendar. Defaults to 2099-12-31.",
    },
    min: {
      control: { type: "text" },
      description:
        "Sets the minimum allowed date of the MultiViewCalendar. Defaults to 1900-1-1.",
    },
    mode: {
      control: { type: "select" },
      description:
        "Sets the selection mode of the MultiViewCalendar. The available modes are: single, multiple, range.",
    },
    tabIndex: {
      control: { type: "number" },
      description: "Sets the tabIndex property of the MultiViewCalendar.",
    },
    topView: {
      control: { type: "select" },
      description: "Defines the topmost view to which the user can navigate.",
    },
    value: {
      control: { type: "text" },
      description:
        "Sets the value of the MultiViewCalendar. Based on the value type, the MultiViewcalendar renders a single, multiple, or range selection.",
    },
    views: {
      control: { type: "number" },
      description:
        "Sets the views property of the MultiViewCalendar and defines the number of rendered views.",
    },
    weekCell: {
      control: { type: "text" },
      description:
        "Enables the customization or the override of the default week cell in the MultiViewCalendar.",
    },
    weekNumber: {
      control: { type: "boolean" },
      description: "Determines if the week number column will be displayed.",
    },
    onBlur: {
      control: { type: "function" },
      description: "Fires each time the MultiViewCalendar is blurred.",
    },
    onChange: {
      control: { type: "function" },
      description:
        "An event that is called after the value of the MultiViewCalendar has changed.",
    },
    onFocus: {
      control: { type: "function" },
      description: "Fires each time the MultiViewCalendar is focused.",
    },
  },
} as Meta;

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

Default.args = {
  dataTestId: "mwc-data-testid",
  disabled: false,
  mode: "multiple",
  views: 2,
  bottomView: "month",
};
