willba-component-library 0.2.78 → 0.2.79
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/lib/assets/IconsSvg.d.ts +9 -0
- package/lib/components/Button/Button.d.ts +29 -0
- package/lib/components/Button/Button.stories.d.ts +7 -0
- package/lib/components/Button/index.d.ts +1 -0
- package/lib/components/FilterBar/FilterBar.d.ts +5 -0
- package/lib/components/FilterBar/FilterBar.stories.d.ts +6 -0
- package/lib/components/FilterBar/FilterBarTypes.d.ts +56 -0
- package/lib/components/FilterBar/components/buttons/index.d.ts +4 -0
- package/lib/components/FilterBar/components/buttons/select-button/SelectButton.d.ts +10 -0
- package/lib/components/FilterBar/components/buttons/tab-button/TabButton.d.ts +10 -0
- package/lib/components/FilterBar/components/categories/Categories.d.ts +8 -0
- package/lib/components/FilterBar/components/divider/Divider.d.ts +3 -0
- package/lib/components/FilterBar/components/guests/GuestCount/GuestCount.d.ts +4 -0
- package/lib/components/FilterBar/components/guests/Guests.d.ts +10 -0
- package/lib/components/FilterBar/components/index.d.ts +4 -0
- package/lib/components/FilterBar/hooks/index.d.ts +2 -0
- package/lib/components/FilterBar/hooks/useFilterBar.d.ts +27 -0
- package/lib/components/FilterBar/hooks/useScrollInToView.d.ts +9 -0
- package/lib/components/FilterBar/index.d.ts +2 -0
- package/lib/components/FilterBar/utils/index.d.ts +1 -0
- package/lib/components/FilterBar/utils/parseGuests.d.ts +17 -0
- package/lib/components/FilterCalendar/FilterCalendar.d.ts +5 -0
- package/lib/components/FilterCalendar/FilterCalendar.stories.d.ts +8 -0
- package/lib/components/FilterCalendar/FilterCalendarTypes.d.ts +9 -0
- package/lib/components/FilterCalendar/components/Footer.d.ts +10 -0
- package/lib/components/FilterCalendar/hooks/useFilterCalendar.d.ts +28 -0
- package/lib/components/FilterCalendar/index.d.ts +2 -0
- package/lib/core/components/buttons/close-button/CloseButton.d.ts +7 -0
- package/lib/core/components/buttons/submit-button/SubmitButton.d.ts +13 -0
- package/lib/core/components/calendar/Calendar.d.ts +5 -0
- package/lib/core/components/calendar/CalendarTypes.d.ts +46 -0
- package/lib/core/components/calendar/hooks/index.d.ts +3 -0
- package/lib/core/components/calendar/hooks/useCalendarLoadingSpinner.d.ts +5 -0
- package/lib/core/components/calendar/hooks/useCalendarTooltips.d.ts +5 -0
- package/lib/core/components/calendar/hooks/useUpdateDisabledDates.d.ts +14 -0
- package/lib/core/components/calendar/utils/calendarSelectionRules.d.ts +15 -0
- package/lib/core/components/calendar/utils/checkForContinuousSelection.d.ts +11 -0
- package/lib/core/components/calendar/utils/disabledDatesByPage.d.ts +9 -0
- package/lib/core/components/calendar/utils/handleCalendarModifiers.d.ts +47 -0
- package/lib/core/components/calendar/utils/handleRangeContextDisabledDates.d.ts +27 -0
- package/lib/core/components/calendar/utils/index.d.ts +8 -0
- package/lib/core/components/calendar/utils/nightsCount.d.ts +6 -0
- package/lib/core/components/calendar/utils/parseDate.d.ts +7 -0
- package/lib/core/components/calendar/utils/parseDates.d.ts +6 -0
- package/lib/core/components/index.d.ts +3 -0
- package/lib/core/hooks/index.d.ts +3 -0
- package/lib/core/hooks/useAwaitRender.d.ts +1 -0
- package/lib/core/hooks/useCloseFilterSection.d.ts +8 -0
- package/lib/core/hooks/useUpdateTranslations.d.ts +5 -0
- package/lib/i18n.d.ts +2 -0
- package/lib/index.d.ts +127 -0
- package/lib/index.esm.js +12203 -0
- package/lib/index.esm.js.map +1 -0
- package/lib/index.js +12225 -0
- package/lib/index.js.map +1 -0
- package/lib/index.umd.js +12229 -0
- package/lib/index.umd.js.map +1 -0
- package/lib/themes/useTheme.d.ts +15 -0
- package/package.json +1 -1
- package/willba-component-library-0.2.77.tgz +0 -0
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
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 };
|