@stenajs-webui/calendar 23.21.7 → 23.21.9
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.
- package/dist/components/calendar-types/travel-date-calendar-panel/TravelDateCalendarPanel.d.ts +35 -0
- package/dist/components/calendar-types/travel-date-calendar-panel/__tests__/TravelDateCalendarPanel.test.d.ts +1 -0
- package/dist/features/travel-calendar/components/TravelCalendar.d.ts +5 -0
- package/dist/features/travel-calendar/components/TravelDateCalendarBody.d.ts +29 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +1489 -1409
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/dist/components/calendar-types/travel-date-calendar-panel/TravelDateCalendarPanel.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ValueAndOnValueChangeProps } from "@stenajs-webui/forms";
|
|
3
|
+
import { TravelCalendarSizeVariant } from "../../../features/travel-calendar/components/TravelCalendar";
|
|
4
|
+
import { SupportedLocaleCode } from "../../../features/localize-date-format/LocaleMapper";
|
|
5
|
+
export interface TravelDateCalendarPanelProps extends ValueAndOnValueChangeProps<string> {
|
|
6
|
+
localeCode?: SupportedLocaleCode;
|
|
7
|
+
languageLocaleCode?: SupportedLocaleCode;
|
|
8
|
+
initialMonthInFocus?: Date;
|
|
9
|
+
previousMonthButtonAriaLabel?: string;
|
|
10
|
+
nextMonthButtonAriaLabel?: string;
|
|
11
|
+
firstMonthInMonthPicker?: Date;
|
|
12
|
+
numMonthsInMonthPicker?: number;
|
|
13
|
+
isDateDisabled?: (date: Date) => boolean;
|
|
14
|
+
prevMonthDisabled?: (visibleMonth: Date) => boolean;
|
|
15
|
+
nextMonthDisabled?: (visibleMonth: Date) => boolean;
|
|
16
|
+
size?: TravelCalendarSizeVariant;
|
|
17
|
+
dateTestId?: (date: Date) => string | undefined;
|
|
18
|
+
previousMonthButtonTestId?: string;
|
|
19
|
+
nextMonthButtonTestId?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Accessible name of the calendar grid.
|
|
22
|
+
*
|
|
23
|
+
* The panel has no label of its own, so set this to whatever the date is
|
|
24
|
+
* for, unless there is a visible label next to it that already says so.
|
|
25
|
+
*/
|
|
26
|
+
calendarAriaLabel?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A calendar for picking a single travel date, without a text input.
|
|
30
|
+
*
|
|
31
|
+
* This is TravelDateCalendar without the label, text input and heading, for
|
|
32
|
+
* cases where the date is entered somewhere else. The visible month follows
|
|
33
|
+
* the value, so a date set from the outside is scrolled into view.
|
|
34
|
+
*/
|
|
35
|
+
export declare const TravelDateCalendarPanel: React.FC<TravelDateCalendarPanelProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -29,5 +29,10 @@ export interface TravelCalendarProps {
|
|
|
29
29
|
* If "left", only hovering on earlier dates will create a highlight. If undefined, no range will be highlighted.
|
|
30
30
|
*/
|
|
31
31
|
hoverHighlightDirection: "left" | "right" | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Accessible name of the calendar grid. Set this when there is no visible
|
|
34
|
+
* label next to the calendar, such as a text input or a heading.
|
|
35
|
+
*/
|
|
36
|
+
ariaLabel?: string;
|
|
32
37
|
}
|
|
33
38
|
export declare const TravelCalendar: React.FC<TravelCalendarProps>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { SupportedLocaleCode } from "../../localize-date-format/LocaleMapper";
|
|
3
|
+
import { useTravelDateInput } from "../hooks/UseTravelDateInput";
|
|
4
|
+
import { TravelCalendarSizeVariant } from "./TravelCalendar";
|
|
5
|
+
export interface TravelDateCalendarBodyProps {
|
|
6
|
+
/** The calendar state, from useTravelDateInput. */
|
|
7
|
+
inputProps: ReturnType<typeof useTravelDateInput>;
|
|
8
|
+
languageLocaleCode: SupportedLocaleCode;
|
|
9
|
+
previousMonthButtonAriaLabel: string;
|
|
10
|
+
nextMonthButtonAriaLabel: string;
|
|
11
|
+
firstMonthInMonthPicker: Date;
|
|
12
|
+
numMonthsInMonthPicker: number;
|
|
13
|
+
isDateDisabled?: (date: Date) => boolean;
|
|
14
|
+
prevMonthDisabled?: (visibleMonth: Date) => boolean;
|
|
15
|
+
nextMonthDisabled?: (visibleMonth: Date) => boolean;
|
|
16
|
+
size: TravelCalendarSizeVariant;
|
|
17
|
+
dateTestId?: (date: Date) => string | undefined;
|
|
18
|
+
previousMonthButtonTestId?: string;
|
|
19
|
+
nextMonthButtonTestId?: string;
|
|
20
|
+
calendarAriaLabel?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The month header, and either the calendar or the month picker.
|
|
24
|
+
*
|
|
25
|
+
* TravelDateCalendar and TravelDateCalendarPanel differ only in what they
|
|
26
|
+
* render above this, so this is where the shared wiring lives. It returns a
|
|
27
|
+
* fragment, which means the parts stay items of the parent layout.
|
|
28
|
+
*/
|
|
29
|
+
export declare const TravelDateCalendarBody: React.FC<TravelDateCalendarBodyProps>;
|
package/dist/index.d.ts
CHANGED
|
@@ -31,6 +31,8 @@ export * from "./components/input-types/date-range-dual-text-input/DateRangeDual
|
|
|
31
31
|
export * from "./components/input-types/travel-date-range-input/TravelDateRangeInput";
|
|
32
32
|
export * from "./components/input-types/travel-date-input/TravelDateInput";
|
|
33
33
|
export * from "./components/calendar-types/travel-date-calendar/TravelDateCalendar";
|
|
34
|
+
export * from "./components/calendar-types/travel-date-calendar-panel/TravelDateCalendarPanel";
|
|
35
|
+
export type { TravelCalendarSizeVariant } from "./features/travel-calendar/components/TravelCalendar";
|
|
34
36
|
export * from "./components/calendar-types/travel-date-range-calendar/TravelDateRangeCalendar";
|
|
35
37
|
export * from "./features/travel-calendar/hooks/DisabledDateHooks";
|
|
36
38
|
export * from "./features/travel-calendar/types";
|