import React, { forwardRef, Ref, useMemo, useRef } from "react"; import { CalendarDate, createCalendar, DateValue, GregorianCalendar, toCalendar, } from "@internationalized/date"; import { DateFormatterOptions, useDateFormatter, useLocale, } from "@react-aria/i18n"; import { CalendarState, RangeCalendarState, useCalendarState, useRangeCalendarState, } from "@react-stately/calendar"; import { CalendarAria, useCalendar, useRangeCalendar, } from "@react-aria/calendar"; import { useSelect, UseSelectReturnValue, UseSelectStateChange, } from "downshift"; import classNames from "classnames"; import { CalendarProps, RangeCalendarProps } from "react-aria"; import { range } from ":/utils"; import { Button } from ":/components/Button"; import { CalendarGrid } from ":/components/Forms/DatePicker/CalendarGrid"; import { useCunningham } from ":/components/Provider"; // todo to be factorized with the select component interface Option { value: number; label: string; disabled?: boolean; } // todo to be factorized with the select component const optionToString = (option: Option | null) => { return option ? option.label : ""; }; type DropdownValuesProps = { options: Array