@stenajs-webui/calendar 20.12.0 → 20.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ import { HeadingVariant } from "@stenajs-webui/core";
3
+ import { ValueAndOnValueChangeProps } from "@stenajs-webui/forms";
4
+ export interface TravelDateCalendarProps extends ValueAndOnValueChangeProps<string> {
5
+ localeCode?: string;
6
+ initialMonthInFocus?: Date;
7
+ label?: string;
8
+ previousMonthButtonAriaLabel?: string;
9
+ nextMonthButtonAriaLabel?: string;
10
+ heading?: string;
11
+ headingLevel?: HeadingVariant;
12
+ firstMonthInMonthPicker?: Date;
13
+ numMonthsInMonthPicker?: number;
14
+ }
15
+ export declare const TravelDateCalendar: React.FC<TravelDateCalendarProps>;
@@ -0,0 +1,23 @@
1
+ import * as React from "react";
2
+ import { ReactNode } from "react";
3
+ import { HeadingVariant } from "@stenajs-webui/core";
4
+ import { ValueAndOnValueChangeProps } from "@stenajs-webui/forms";
5
+ export interface RenderBelowSingleDateCalendarArgs {
6
+ hideCalendar: () => void;
7
+ }
8
+ export interface TravelDateInputProps extends ValueAndOnValueChangeProps<string> {
9
+ localeCode?: string;
10
+ initialMonthInFocus?: Date;
11
+ label?: string;
12
+ previousMonthButtonAriaLabel?: string;
13
+ nextMonthButtonAriaLabel?: string;
14
+ heading?: string;
15
+ headingLevel?: HeadingVariant;
16
+ firstMonthInMonthPicker?: Date;
17
+ numMonthsInMonthPicker?: number;
18
+ zIndex?: number;
19
+ zIndexWhenClosed?: number;
20
+ onHideCalendar?: () => void;
21
+ renderBelowCalendar?: (args: RenderBelowSingleDateCalendarArgs) => ReactNode;
22
+ }
23
+ export declare const TravelDateInput: React.FC<TravelDateInputProps>;
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { Ref } from "react";
3
- import { VisiblePanel } from "../hooks/UseTravelDateRangeInput";
3
+ import { VisiblePanel } from "../types";
4
4
  export interface MonthHeaderProps {
5
5
  monthPickerButtonLabel: string;
6
6
  nextMonthButtonAriaLabel: string;
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ export interface TravelDateSingleTextInputFieldProps {
3
+ value: string | undefined;
4
+ onValueChange: ((value: string) => void) | undefined;
5
+ localeCode: string;
6
+ label?: string;
7
+ onFocus?: () => void;
8
+ }
9
+ export declare const TravelDateSingleTextInputField: React.FC<TravelDateSingleTextInputFieldProps>;
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ import { VisiblePanel } from "../types";
3
+ export declare const useTravelDateInput: (value: string | undefined, onValueChange: ((value: string) => void) | undefined, localeCode: string, initialMonthInFocus: Date | undefined) => {
4
+ isDateDisabled: (date: Date) => boolean;
5
+ onClickDate: (date: Date) => void;
6
+ onValueChangeByInputs: (value: string) => void;
7
+ prevMonthDisabled: boolean;
8
+ monthPickerButtonRef: import("react").RefObject<HTMLButtonElement>;
9
+ calendarId: string;
10
+ monthPickerButtonLabel: string;
11
+ visiblePanel: VisiblePanel;
12
+ setVisiblePanel: import("react").Dispatch<import("react").SetStateAction<VisiblePanel>>;
13
+ setVisibleMonth: import("react").Dispatch<import("react").SetStateAction<Date>>;
14
+ visibleMonthData: import("../../../util/calendar/CalendarDataFactory").MonthData;
15
+ todayIsInVisibleMonth: boolean;
16
+ hoverDate: Date | undefined;
17
+ setHoverDate: import("react").Dispatch<import("react").SetStateAction<Date | undefined>>;
18
+ selectedDate: Date | undefined;
19
+ today: Date;
20
+ visibleMonth: Date;
21
+ };
@@ -1,6 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { TravelDateRangeInputValue } from "../types";
3
- export type VisiblePanel = "calendar" | "month-picker";
2
+ import { TravelDateRangeInputValue, VisiblePanel } from "../types";
4
3
  export declare const useTravelDateRangeInput: (value: TravelDateRangeInputValue | undefined, onValueChange: ((value: TravelDateRangeInputValue) => void) | undefined, localeCode: string, initialMonthInFocus: Date | undefined) => {
5
4
  isDateDisabled: (date: Date) => boolean;
6
5
  onClickDate: (date: Date) => void;
@@ -2,3 +2,4 @@ export interface TravelDateRangeInputValue {
2
2
  startDate?: string;
3
3
  endDate?: string;
4
4
  }
5
+ export type VisiblePanel = "calendar" | "month-picker";
package/dist/index.d.ts CHANGED
@@ -29,6 +29,8 @@ export * from "./features/year-picker/YearPicker";
29
29
  export * from "./features/preset-picker/PresetPicker";
30
30
  export * from "./components/input-types/date-range-dual-text-input/DateRangeDualTextInput";
31
31
  export * from "./components/input-types/travel-date-range-input/TravelDateRangeInput";
32
+ export * from "./components/input-types/travel-date-input/TravelDateInput";
33
+ export * from "./components/calendar-types/travel-date-calendar/TravelDateCalendar";
32
34
  export * from "./components/calendar-types/travel-date-range-calendar/TravelDateRangeCalendar";
33
35
  export * from "./features/travel-calendar/types";
34
36
  export * from "./features/localize-date-format/LocalizedDateFormatter";