willba-component-library 0.2.76 → 0.2.78
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/package.json +1 -1
- package/src/core/components/calendar/Calendar.css +2 -3
- package/src/themes/Default.css +1 -0
- package/willba-component-library-0.2.77.tgz +0 -0
- package/lib/assets/IconsSvg.d.ts +0 -9
- package/lib/assets/SpinnerSvg.d.ts +0 -5
- package/lib/components/Button/Button.d.ts +0 -29
- package/lib/components/Button/Button.stories.d.ts +0 -7
- package/lib/components/Button/index.d.ts +0 -1
- package/lib/components/FilterBar/FilterBar.d.ts +0 -5
- package/lib/components/FilterBar/FilterBar.stories.d.ts +0 -6
- package/lib/components/FilterBar/FilterBarTypes.d.ts +0 -56
- package/lib/components/FilterBar/components/buttons/close-button/CloseButton.d.ts +0 -7
- package/lib/components/FilterBar/components/buttons/index.d.ts +0 -4
- package/lib/components/FilterBar/components/buttons/select-button/SelectButton.d.ts +0 -10
- package/lib/components/FilterBar/components/buttons/submit-button/SubmitButton.d.ts +0 -3
- package/lib/components/FilterBar/components/buttons/tab-button/TabButton.d.ts +0 -10
- package/lib/components/FilterBar/components/calendar/Calendar.d.ts +0 -14
- package/lib/components/FilterBar/components/categories/Categories.d.ts +0 -8
- package/lib/components/FilterBar/components/divider/Divider.d.ts +0 -3
- package/lib/components/FilterBar/components/guests/GuestCount/GuestCount.d.ts +0 -4
- package/lib/components/FilterBar/components/guests/Guests.d.ts +0 -10
- package/lib/components/FilterBar/components/index.d.ts +0 -4
- package/lib/components/FilterBar/hooks/index.d.ts +0 -2
- package/lib/components/FilterBar/hooks/useCloseFilterSection.d.ts +0 -8
- package/lib/components/FilterBar/hooks/useFilterBar.d.ts +0 -27
- package/lib/components/FilterBar/hooks/useScrollInToView.d.ts +0 -9
- package/lib/components/FilterBar/hooks/useUpdateTranslations.d.ts +0 -5
- package/lib/components/FilterBar/index.d.ts +0 -2
- package/lib/components/FilterBar/utils/index.d.ts +0 -1
- package/lib/components/FilterBar/utils/parseDates.d.ts +0 -6
- package/lib/components/FilterBar/utils/parseGuests.d.ts +0 -17
- package/lib/components/FilterCalendar/FilterCalendar.d.ts +0 -5
- package/lib/components/FilterCalendar/FilterCalendar.stories.d.ts +0 -8
- package/lib/components/FilterCalendar/FilterCalendarTypes.d.ts +0 -9
- package/lib/components/FilterCalendar/components/Footer.d.ts +0 -10
- package/lib/components/FilterCalendar/hooks/useFilterCalendar.d.ts +0 -28
- package/lib/components/FilterCalendar/index.d.ts +0 -2
- package/lib/core/components/buttons/close-button/CloseButton.d.ts +0 -7
- package/lib/core/components/buttons/submit-button/SubmitButton.d.ts +0 -13
- package/lib/core/components/calendar/Calendar.d.ts +0 -5
- package/lib/core/components/calendar/CalendarTypes.d.ts +0 -46
- package/lib/core/components/calendar/hooks/index.d.ts +0 -3
- package/lib/core/components/calendar/hooks/useCalendarLoadingSpinner.d.ts +0 -5
- package/lib/core/components/calendar/hooks/useCalendarTooltips.d.ts +0 -5
- package/lib/core/components/calendar/hooks/useUpdateDisabledDates.d.ts +0 -14
- package/lib/core/components/calendar/utils/calendarSelectionRules.d.ts +0 -15
- package/lib/core/components/calendar/utils/checkForContinuousSelection.d.ts +0 -11
- package/lib/core/components/calendar/utils/disabledDatesByPage.d.ts +0 -9
- package/lib/core/components/calendar/utils/handleCalendarModifiers.d.ts +0 -47
- package/lib/core/components/calendar/utils/handleRangeContextDisabledDates.d.ts +0 -27
- package/lib/core/components/calendar/utils/index.d.ts +0 -8
- package/lib/core/components/calendar/utils/nightsCount.d.ts +0 -6
- package/lib/core/components/calendar/utils/parseDate.d.ts +0 -7
- package/lib/core/components/calendar/utils/parseDates.d.ts +0 -6
- package/lib/core/components/index.d.ts +0 -3
- package/lib/core/hooks/index.d.ts +0 -3
- package/lib/core/hooks/useAwaitRender.d.ts +0 -1
- package/lib/core/hooks/useCloseFilterSection.d.ts +0 -8
- package/lib/core/hooks/useUpdateTranslations.d.ts +0 -5
- package/lib/core/utils/handleOverlappingDates.d.ts +0 -1
- package/lib/core/utils/index.d.ts +0 -3
- package/lib/core/utils/nightsCount.d.ts +0 -6
- package/lib/core/utils/parseDate.d.ts +0 -7
- package/lib/core/utils/parseDates.d.ts +0 -6
- package/lib/i18n.d.ts +0 -2
- package/lib/index.d.ts +0 -127
- package/lib/index.esm.js +0 -12203
- package/lib/index.esm.js.map +0 -1
- package/lib/index.js +0 -12225
- package/lib/index.js.map +0 -1
- package/lib/index.umd.js +0 -12229
- package/lib/index.umd.js.map +0 -1
- package/lib/themes/useTheme.d.ts +0 -15
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { DateRange, Matcher } from 'react-day-picker';
|
|
2
|
-
import { DisableCalendarDates, RangeContext } from '../CalendarTypes';
|
|
3
|
-
type Props = {
|
|
4
|
-
rangeContext?: RangeContext;
|
|
5
|
-
availableDates?: DisableCalendarDates['availableDates'];
|
|
6
|
-
calendarRange?: DateRange;
|
|
7
|
-
};
|
|
8
|
-
export declare const handleRangeContextDisabledDates: ({ rangeContext, availableDates, calendarRange, }: Props) => {
|
|
9
|
-
findFirstPossibleRangeContextCheckIn: {
|
|
10
|
-
checkIn: Date;
|
|
11
|
-
firstCheckOut: Date;
|
|
12
|
-
lastCheckOut: Date;
|
|
13
|
-
} | undefined;
|
|
14
|
-
findLastPossibleRangeContextCheckOut: {
|
|
15
|
-
checkIn: Date;
|
|
16
|
-
firstCheckOut: Date;
|
|
17
|
-
lastCheckOut: Date;
|
|
18
|
-
} | undefined;
|
|
19
|
-
firstPossibleRangeContextCheckIn: Matcher[];
|
|
20
|
-
lastPossibleRangeContextCheckOut: Matcher[];
|
|
21
|
-
currentSelectionLastCheckoutDate: {
|
|
22
|
-
checkIn: Date;
|
|
23
|
-
firstCheckOut: Date;
|
|
24
|
-
lastCheckOut: Date;
|
|
25
|
-
} | undefined;
|
|
26
|
-
};
|
|
27
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { parseDates } from './parseDates';
|
|
2
|
-
export { parseDate } from './parseDate';
|
|
3
|
-
export { nightsCount } from './nightsCount';
|
|
4
|
-
export { calendarSelectionRules } from './calendarSelectionRules';
|
|
5
|
-
export { disabledDatesByPage } from './disabledDatesByPage';
|
|
6
|
-
export { handleCalendarModifiers } from './handleCalendarModifiers';
|
|
7
|
-
export { handleRangeContextDisabledDates } from './handleRangeContextDisabledDates';
|
|
8
|
-
export { checkForContinuousSelection } from './checkForContinuousSelection';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useAwaitRender: () => null | undefined;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
type Props = {
|
|
3
|
-
handleSelectedFilter: (arg: boolean) => void;
|
|
4
|
-
};
|
|
5
|
-
export declare const useCloseFilterSection: ({ handleSelectedFilter }: Props) => {
|
|
6
|
-
filtersRef: import("react").MutableRefObject<HTMLDivElement | null>;
|
|
7
|
-
};
|
|
8
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const handleOverlappingDates: () => void;
|
package/lib/i18n.d.ts
DELETED
package/lib/index.d.ts
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { DateRange, Matcher } from 'react-day-picker';
|
|
3
|
-
|
|
4
|
-
interface ButtonProps {
|
|
5
|
-
/**
|
|
6
|
-
* Is this the principal call to action on the page?
|
|
7
|
-
*/
|
|
8
|
-
type?: "primary" | "secondary";
|
|
9
|
-
/**
|
|
10
|
-
* What background color to use
|
|
11
|
-
*/
|
|
12
|
-
textColor?: string;
|
|
13
|
-
/**
|
|
14
|
-
* How large should the button be?
|
|
15
|
-
*/
|
|
16
|
-
size?: "small" | "medium" | "large";
|
|
17
|
-
/**
|
|
18
|
-
* Button contents
|
|
19
|
-
*/
|
|
20
|
-
label: string;
|
|
21
|
-
/**
|
|
22
|
-
* Optional click handler
|
|
23
|
-
*/
|
|
24
|
-
onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Primary UI component for user interaction
|
|
28
|
-
*/
|
|
29
|
-
declare const Button: ({ type, textColor, size, onClick, label, }: ButtonProps) => React.JSX.Element;
|
|
30
|
-
|
|
31
|
-
type Palette = {
|
|
32
|
-
primary: string;
|
|
33
|
-
secondary: string;
|
|
34
|
-
error: string;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
type CalendarOffset = {
|
|
38
|
-
[key: string]: number;
|
|
39
|
-
};
|
|
40
|
-
type DisableCalendarDates = {
|
|
41
|
-
availableDates?: {
|
|
42
|
-
checkIn: Date;
|
|
43
|
-
firstCheckOut: Date;
|
|
44
|
-
lastCheckOut: Date;
|
|
45
|
-
}[];
|
|
46
|
-
disabledDates?: {
|
|
47
|
-
to: Date;
|
|
48
|
-
from: Date;
|
|
49
|
-
}[];
|
|
50
|
-
disabledDatesByPage?: {
|
|
51
|
-
page: string;
|
|
52
|
-
offset: number;
|
|
53
|
-
}[];
|
|
54
|
-
};
|
|
55
|
-
type RangeContext = {
|
|
56
|
-
from: Date;
|
|
57
|
-
to: Date;
|
|
58
|
-
};
|
|
59
|
-
type CalendarTypes = {
|
|
60
|
-
calendarRange?: DateRange | undefined;
|
|
61
|
-
setCalendarRange: (range: DateRange | undefined) => void;
|
|
62
|
-
calendarOffset?: CalendarOffset;
|
|
63
|
-
selectedPath?: string;
|
|
64
|
-
language?: string;
|
|
65
|
-
disableCalendarDates?: DisableCalendarDates;
|
|
66
|
-
requestDates?: (val: Date) => void;
|
|
67
|
-
disabledDates?: Matcher[];
|
|
68
|
-
setDisabledDates?: (arg: Matcher[]) => void;
|
|
69
|
-
loadingData?: boolean;
|
|
70
|
-
showFeedback?: boolean;
|
|
71
|
-
noActiveSelection?: boolean;
|
|
72
|
-
palette?: Palette;
|
|
73
|
-
updateCalendarMonthNavigation?: boolean;
|
|
74
|
-
setUpdateCalendarMonthNavigation?: (arg: (prev: boolean) => boolean) => void;
|
|
75
|
-
updateCalendarDefaultMonth?: number;
|
|
76
|
-
setCalendarHasError?: (arg: boolean) => void;
|
|
77
|
-
setUpdatedForSubmit?: (arg: boolean) => void;
|
|
78
|
-
rangeContext?: RangeContext;
|
|
79
|
-
calendarHasError?: boolean;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
type FilterBarProps = {
|
|
83
|
-
language?: string;
|
|
84
|
-
ageCategories?: AgeCategoryType[];
|
|
85
|
-
redirectUrl?: string;
|
|
86
|
-
palette?: Palette;
|
|
87
|
-
onSubmit?: ((val: Filters) => void) | null;
|
|
88
|
-
fullWidth?: boolean;
|
|
89
|
-
disableCalendarDates?: DisableCalendarDates;
|
|
90
|
-
mode?: string;
|
|
91
|
-
defaultTab?: string;
|
|
92
|
-
tabs?: Tab[];
|
|
93
|
-
outerLoading?: boolean;
|
|
94
|
-
};
|
|
95
|
-
type AgeCategoryType = {
|
|
96
|
-
id: string;
|
|
97
|
-
name: string;
|
|
98
|
-
minVal: number;
|
|
99
|
-
sortOrder: number;
|
|
100
|
-
};
|
|
101
|
-
type Filters = {
|
|
102
|
-
[key: string]: string;
|
|
103
|
-
};
|
|
104
|
-
type Translations = {
|
|
105
|
-
en: string;
|
|
106
|
-
fi: string;
|
|
107
|
-
[key: string]: string;
|
|
108
|
-
};
|
|
109
|
-
type Tab = {
|
|
110
|
-
path: string;
|
|
111
|
-
default?: boolean;
|
|
112
|
-
order: number;
|
|
113
|
-
label?: Translations;
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
declare function FilterBar({ language, ageCategories, redirectUrl, palette, onSubmit, fullWidth, disableCalendarDates, mode, tabs, outerLoading, }: FilterBarProps): React.JSX.Element;
|
|
117
|
-
|
|
118
|
-
interface FilterCalendarTypes extends Partial<CalendarTypes> {
|
|
119
|
-
palette: Palette;
|
|
120
|
-
onSubmit: (val: DateRange) => void;
|
|
121
|
-
toggleCalendar: boolean;
|
|
122
|
-
setToggleCalendar: (val: boolean) => void;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
declare function FilterCalendar({ calendarOffset, language, palette, onSubmit, disableCalendarDates: outerDisableCalendarDates, toggleCalendar, loadingData, setToggleCalendar, requestDates, showFeedback, noActiveSelection, rangeContext: outerRangeContext, }: FilterCalendarTypes): React.JSX.Element;
|
|
126
|
-
|
|
127
|
-
export { Button, FilterBar, FilterCalendar, FilterCalendarTypes, Tab };
|