willba-component-library 0.3.26 → 0.4.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.
Files changed (159) hide show
  1. package/README.md +75 -113
  2. package/lib/components/FilterBar/FilterBar.d.ts +1 -1
  3. package/lib/components/FilterCalendar/FilterCalendar.d.ts +1 -1
  4. package/lib/core/i18n/I18nProvider.d.ts +6 -0
  5. package/lib/core/i18n/index.d.ts +1 -0
  6. package/lib/embed.d.ts +18 -0
  7. package/lib/embed.esm.js +74 -0
  8. package/lib/embed.esm.js.map +1 -0
  9. package/lib/embed.umd.js +74 -0
  10. package/lib/embed.umd.js.map +1 -0
  11. package/lib/i18n.d.ts +2 -2
  12. package/lib/index.d.ts +2 -2
  13. package/lib/index.esm.js +1112 -931
  14. package/lib/index.esm.js.map +1 -1
  15. package/lib/index.js +1111 -930
  16. package/lib/index.js.map +1 -1
  17. package/package.json +9 -1
  18. package/.nvmrc +0 -1
  19. package/.storybook/main.ts +0 -17
  20. package/.storybook/preview.ts +0 -15
  21. package/lib/components/FilterBar/components/buttons/index.d.ts +0 -4
  22. package/lib/components/FilterBar/components/buttons/select-button/SelectButton.d.ts +0 -13
  23. package/lib/components/FilterBar/components/buttons/tab-button/TabButton.d.ts +0 -10
  24. package/lib/components/FilterBar/components/cards/image-card/ImageCard.d.ts +0 -11
  25. package/lib/components/FilterBar/components/cards/index.d.ts +0 -1
  26. package/lib/components/FilterBar/components/categories/Categories.d.ts +0 -8
  27. package/lib/components/FilterBar/components/common/FilterSectionHeader.d.ts +0 -8
  28. package/lib/components/FilterBar/components/dates/Dates.d.ts +0 -17
  29. package/lib/components/FilterBar/components/dates/index.d.ts +0 -1
  30. package/lib/components/FilterBar/components/guests/GuestCount/GuestCount.d.ts +0 -4
  31. package/lib/components/FilterBar/components/guests/Guests.d.ts +0 -12
  32. package/lib/components/FilterBar/components/locations/Locations.d.ts +0 -14
  33. package/lib/components/FilterBar/hooks/useFilterBar.d.ts +0 -32
  34. package/lib/components/FilterBar/hooks/useFilterUi.d.ts +0 -8
  35. package/lib/components/FilterBar/utils/calculateDropdownPosition.d.ts +0 -12
  36. package/lib/components/FilterBar/utils/getLocalizedContent.d.ts +0 -8
  37. package/lib/core/components/buttons/close-button/CloseButton.d.ts +0 -7
  38. package/lib/core/components/buttons/submit-button/SubmitButton.d.ts +0 -14
  39. package/lib/index.umd.js +0 -12489
  40. package/lib/index.umd.js.map +0 -1
  41. package/prettier.config.js +0 -6
  42. package/rollup.config.mjs +0 -63
  43. package/src/assets/IconsSvg.tsx +0 -69
  44. package/src/components/Button/Button.stories.tsx +0 -34
  45. package/src/components/Button/Button.tsx +0 -56
  46. package/src/components/Button/button.css +0 -30
  47. package/src/components/Button/index.ts +0 -1
  48. package/src/components/FilterBar/FilterBar.css +0 -35
  49. package/src/components/FilterBar/FilterBar.stories.tsx +0 -116
  50. package/src/components/FilterBar/FilterBar.tsx +0 -64
  51. package/src/components/FilterBar/FilterBarTypes.ts +0 -71
  52. package/src/components/FilterBar/components/Divider/Divider.css +0 -14
  53. package/src/components/FilterBar/components/Divider/Divider.tsx +0 -7
  54. package/src/components/FilterBar/components/FilterControls/FilterControls.css +0 -22
  55. package/src/components/FilterBar/components/FilterControls/FilterControls.tsx +0 -139
  56. package/src/components/FilterBar/components/FilterPanels/Categories/Categories.css +0 -21
  57. package/src/components/FilterBar/components/FilterPanels/Categories/Categories.tsx +0 -49
  58. package/src/components/FilterBar/components/FilterPanels/Dates/Dates.css +0 -9
  59. package/src/components/FilterBar/components/FilterPanels/Dates/Dates.tsx +0 -60
  60. package/src/components/FilterBar/components/FilterPanels/FilterPanels.css +0 -22
  61. package/src/components/FilterBar/components/FilterPanels/FilterPanels.tsx +0 -111
  62. package/src/components/FilterBar/components/FilterPanels/Guests/GuestCount/GuestCount.css +0 -58
  63. package/src/components/FilterBar/components/FilterPanels/Guests/GuestCount/GuestCount.tsx +0 -85
  64. package/src/components/FilterBar/components/FilterPanels/Guests/Guests.css +0 -24
  65. package/src/components/FilterBar/components/FilterPanels/Guests/Guests.tsx +0 -59
  66. package/src/components/FilterBar/components/FilterPanels/Locations/Locations.css +0 -16
  67. package/src/components/FilterBar/components/FilterPanels/Locations/Locations.tsx +0 -94
  68. package/src/components/FilterBar/components/FilterPanels/SectionHeader/SectionHeader.css +0 -34
  69. package/src/components/FilterBar/components/FilterPanels/SectionHeader/SectionHeader.tsx +0 -17
  70. package/src/components/FilterBar/components/FilterTabs/FilterTabs.css +0 -10
  71. package/src/components/FilterBar/components/FilterTabs/FilterTabs.tsx +0 -50
  72. package/src/components/FilterBar/components/ImageCard/ImageCard.css +0 -30
  73. package/src/components/FilterBar/components/ImageCard/ImageCard.tsx +0 -45
  74. package/src/components/FilterBar/components/SelectButton/SelectButton.css +0 -76
  75. package/src/components/FilterBar/components/SelectButton/SelectButton.tsx +0 -54
  76. package/src/components/FilterBar/components/TabButton/TabButton.css +0 -36
  77. package/src/components/FilterBar/components/TabButton/TabButton.tsx +0 -23
  78. package/src/components/FilterBar/components/index.ts +0 -6
  79. package/src/components/FilterBar/hooks/index.ts +0 -5
  80. package/src/components/FilterBar/hooks/useFilterActions.tsx +0 -126
  81. package/src/components/FilterBar/hooks/useFilterRefs.tsx +0 -21
  82. package/src/components/FilterBar/hooks/useFilterState.tsx +0 -86
  83. package/src/components/FilterBar/hooks/usePanelPosition.tsx +0 -52
  84. package/src/components/FilterBar/hooks/useScrollInToView.tsx +0 -29
  85. package/src/components/FilterBar/index.ts +0 -3
  86. package/src/components/FilterBar/providers/FilterBarProvider.tsx +0 -172
  87. package/src/components/FilterBar/providers/index.ts +0 -1
  88. package/src/components/FilterBar/utils/ageCategoriesRules.ts +0 -27
  89. package/src/components/FilterBar/utils/index.tsx +0 -3
  90. package/src/components/FilterBar/utils/parseGuests.tsx +0 -65
  91. package/src/components/FilterBar/utils/parseLocations.ts +0 -28
  92. package/src/components/FilterCalendar/FilterCalendar.css +0 -109
  93. package/src/components/FilterCalendar/FilterCalendar.stories.tsx +0 -554
  94. package/src/components/FilterCalendar/FilterCalendar.tsx +0 -115
  95. package/src/components/FilterCalendar/FilterCalendarTypes.ts +0 -11
  96. package/src/components/FilterCalendar/components/Footer.tsx +0 -96
  97. package/src/components/FilterCalendar/hooks/useFilterCalendar.ts +0 -163
  98. package/src/components/FilterCalendar/index.ts +0 -3
  99. package/src/core/components/buttons/CloseButton/CloseButton.css +0 -33
  100. package/src/core/components/buttons/CloseButton/CloseButton.tsx +0 -16
  101. package/src/core/components/buttons/SubmitButton/SubmitButton.css +0 -54
  102. package/src/core/components/buttons/SubmitButton/SubmitButton.tsx +0 -42
  103. package/src/core/components/calendar/Calendar.css +0 -280
  104. package/src/core/components/calendar/Calendar.tsx +0 -253
  105. package/src/core/components/calendar/CalendarTypes.ts +0 -48
  106. package/src/core/components/calendar/hooks/index.ts +0 -3
  107. package/src/core/components/calendar/hooks/useCalendarLoadingSpinner.tsx +0 -19
  108. package/src/core/components/calendar/hooks/useCalendarTooltips.tsx +0 -125
  109. package/src/core/components/calendar/hooks/useUpdateDisabledDates.tsx +0 -105
  110. package/src/core/components/calendar/utils/calendarSelectionRules.tsx +0 -180
  111. package/src/core/components/calendar/utils/checkForContinuousSelection.tsx +0 -86
  112. package/src/core/components/calendar/utils/disabledDatesByPage.tsx +0 -31
  113. package/src/core/components/calendar/utils/handleCalendarModifiers.tsx +0 -118
  114. package/src/core/components/calendar/utils/handleRangeContextDisabledDates.tsx +0 -75
  115. package/src/core/components/calendar/utils/index.ts +0 -8
  116. package/src/core/components/calendar/utils/nightsCount.tsx +0 -19
  117. package/src/core/components/calendar/utils/parseDate.tsx +0 -17
  118. package/src/core/components/calendar/utils/parseDates.tsx +0 -12
  119. package/src/core/components/index.ts +0 -7
  120. package/src/core/hooks/index.ts +0 -4
  121. package/src/core/hooks/useAutoFocus.tsx +0 -27
  122. package/src/core/hooks/useAwaitRender.tsx +0 -12
  123. package/src/core/hooks/useCloseFilterSection.tsx +0 -29
  124. package/src/core/hooks/useUpdateTranslations.tsx +0 -14
  125. package/src/i18n.ts +0 -27
  126. package/src/index.ts +0 -8
  127. package/src/locales/en/common.json +0 -18
  128. package/src/locales/en/filterBar.json +0 -33
  129. package/src/locales/fi/common.json +0 -19
  130. package/src/locales/fi/filterBar.json +0 -33
  131. package/src/themes/Default.css +0 -69
  132. package/src/themes/useTheme.tsx +0 -27
  133. package/stories/Button.stories.ts +0 -50
  134. package/stories/Button.tsx +0 -53
  135. package/stories/Configure.mdx +0 -364
  136. package/stories/Header.stories.ts +0 -27
  137. package/stories/Header.tsx +0 -70
  138. package/stories/Page.stories.ts +0 -29
  139. package/stories/Page.tsx +0 -91
  140. package/stories/assets/accessibility.png +0 -0
  141. package/stories/assets/accessibility.svg +0 -5
  142. package/stories/assets/addon-library.png +0 -0
  143. package/stories/assets/assets.png +0 -0
  144. package/stories/assets/context.png +0 -0
  145. package/stories/assets/discord.svg +0 -15
  146. package/stories/assets/docs.png +0 -0
  147. package/stories/assets/figma-plugin.png +0 -0
  148. package/stories/assets/github.svg +0 -3
  149. package/stories/assets/share.png +0 -0
  150. package/stories/assets/styling.png +0 -0
  151. package/stories/assets/testing.png +0 -0
  152. package/stories/assets/theming.png +0 -0
  153. package/stories/assets/tutorials.svg +0 -12
  154. package/stories/assets/youtube.svg +0 -4
  155. package/stories/button.css +0 -30
  156. package/stories/header.css +0 -32
  157. package/stories/page.css +0 -69
  158. package/tsconfig.json +0 -29
  159. /package/lib/components/FilterBar/components/{divider → Divider}/Divider.d.ts +0 -0
@@ -1,96 +0,0 @@
1
- import React from 'react'
2
- import { useTranslation } from 'react-i18next'
3
- import { useMediaQuery } from 'react-responsive'
4
- import { DateRange } from 'react-day-picker'
5
-
6
- import { Palette } from '../../../themes/useTheme'
7
- import { nightsCount, parseDate } from '../../../core/components/calendar/utils'
8
- import { IconsSvg } from '../../../assets/IconsSvg'
9
- import { SubmitButton } from '../../../core/components'
10
-
11
- export const Footer = ({
12
- calendarHasError,
13
- calendarRange,
14
- handleClearDates,
15
- language,
16
- palette,
17
- }: {
18
- calendarHasError: boolean
19
- calendarRange?: DateRange
20
- handleClearDates: () => void
21
- language?: string
22
- palette: Palette
23
- }) => {
24
- const { t } = useTranslation()
25
- const isMobile = useMediaQuery({ maxWidth: 600 })
26
-
27
- const nights = nightsCount({
28
- calendarRange: calendarRange,
29
- })
30
-
31
- return (
32
- <div className="will-calendar-footer-actions-wrapper">
33
- <div className="will-calendar-footer-dates">
34
- {calendarHasError ? (
35
- <div className="will-calendar-footer-error">
36
- {calendarHasError &&
37
- renderCalendarErrorMessage({
38
- palette,
39
- message: t(
40
- `common:errors.calendarErrors.checkInAvailabilityError`
41
- ),
42
- })}
43
- </div>
44
- ) : (
45
- <div>
46
- <span>
47
- {parseDate({
48
- date: calendarRange?.from,
49
- dateFormat: 'EEEEEE d.M.yyyy',
50
- language,
51
- }) || t('common:checkIn')}
52
- </span>
53
- <span className="will-calendar-footer-dates-separator">-</span>
54
- <span>
55
- {parseDate({
56
- date: calendarRange?.to,
57
- dateFormat: 'EEEEEE d.M.yyyy',
58
- language,
59
- }) || t('common:checkOut')}
60
- </span>
61
- </div>
62
- )}
63
-
64
- <span className="will-calendar-footer-booked">
65
- {!calendarHasError && nights
66
- ? `${nights} ${t(`common:${nights === 1 ? 'night' : 'nights'}`)}`
67
- : ''}
68
- </span>
69
- </div>
70
-
71
- <div className="will-calendar-footer-actions">
72
- <SubmitButton
73
- onClick={handleClearDates}
74
- disabled={!calendarRange?.from}
75
- label={t(`common:clearDates`)}
76
- variant="text"
77
- />
78
- </div>
79
- </div>
80
- )
81
- }
82
-
83
- /////////
84
-
85
- const renderCalendarErrorMessage = ({
86
- message,
87
- palette,
88
- }: {
89
- message?: string
90
- palette: Palette
91
- }) => (
92
- <>
93
- <IconsSvg fill={palette?.error || 'inherit'} size={25} icon="warning" />
94
- <span>{message || ''}</span>
95
- </>
96
- )
@@ -1,163 +0,0 @@
1
- import { useEffect, useState } from 'react'
2
- import { DateRange, Matcher } from 'react-day-picker'
3
- import { compareAsc, endOfDay, format, isAfter, parseISO } from 'date-fns'
4
- import {
5
- DisableCalendarDates,
6
- RangeContext,
7
- } from 'src/core/components/calendar/CalendarTypes'
8
-
9
- type Props = {
10
- onSubmit: (val: any) => void
11
- setToggleCalendar: (val: boolean) => void
12
- noActiveSelection?: boolean
13
- toggleCalendar?: boolean
14
- outerRangeContext?: RangeContext
15
- outerDisableCalendarDates?: DisableCalendarDates
16
- }
17
-
18
- export const useFilterCalendar = ({
19
- onSubmit,
20
- setToggleCalendar,
21
- noActiveSelection,
22
- toggleCalendar,
23
- outerRangeContext,
24
- outerDisableCalendarDates,
25
- }: Props) => {
26
- // State
27
- const [calendarRange, setCalendarRange] = useState<DateRange | undefined>()
28
- const [rangeContext, setRangeContext] = useState<RangeContext | undefined>(
29
- outerRangeContext
30
- )
31
- const [initialCalendarRange, setInitialCalendarRange] = useState<
32
- DateRange | undefined
33
- >()
34
- const [disabledDates, setDisabledDates] = useState<Matcher[]>([])
35
- const [updateCalendarMonthNavigation, setUpdateCalendarMonthNavigation] =
36
- useState<boolean>(false)
37
- const [updateCalendarDefaultMonth, setUpdateCalendarDefaultMonth] =
38
- useState<number>(0)
39
-
40
- const [calendarHasError, setCalendarHasError] = useState<boolean>(false)
41
-
42
- const [updatedForSubmit, setUpdatedForSubmit] = useState<boolean>(false)
43
- const [disableCalendarDates, setDisableCalendarDates] =
44
- useState<DisableCalendarDates>()
45
-
46
- // Lifecycle
47
-
48
- // Handle update component with new data
49
- useEffect(() => {
50
- if (outerDisableCalendarDates?.availableDates) {
51
- setDisableCalendarDates({
52
- availableDates: [
53
- ...outerDisableCalendarDates.availableDates.sort((a, b) =>
54
- compareAsc(a.checkIn, b.checkIn)
55
- ),
56
- ],
57
- disabledDates: outerDisableCalendarDates.disabledDates
58
- ? [
59
- ...outerDisableCalendarDates.disabledDates.sort((a, b) =>
60
- compareAsc(a.from, b.from)
61
- ),
62
- ]
63
- : [],
64
- })
65
- }
66
-
67
- if (disabledDates && !!outerDisableCalendarDates?.disabledDates?.length) {
68
- setDisabledDates({
69
- ...disabledDates,
70
- ...outerDisableCalendarDates.disabledDates,
71
- })
72
- }
73
- }, [outerDisableCalendarDates])
74
-
75
- // Handle Range Context initial selections
76
- useEffect(() => {
77
- if (typeof window === 'undefined') return
78
-
79
- const urlSearchParams = new URLSearchParams(window.location.search)
80
-
81
- const startDateParam = urlSearchParams.get('startDate')
82
- const endDateParam = urlSearchParams.get('endDate')
83
-
84
- if (startDateParam && endDateParam) {
85
- if (noActiveSelection) {
86
- handleClearDates()
87
- setUpdateCalendarDefaultMonth((prev) => prev + 1)
88
- setUpdatedForSubmit(false)
89
- setRangeContext(outerRangeContext)
90
- setInitialCalendarRange({
91
- from: new Date(startDateParam),
92
- to: new Date(endDateParam),
93
- })
94
- setCalendarRange({
95
- from: new Date(startDateParam),
96
- to: new Date(endDateParam),
97
- })
98
- } else {
99
- setCalendarRange({
100
- from: new Date(startDateParam),
101
- to: new Date(endDateParam),
102
- })
103
- }
104
- }
105
- }, [toggleCalendar])
106
-
107
- // Handle submit dates
108
- useEffect(() => {
109
- const formatString = 'dd.MM.yyyy'
110
- const initialRangeTo = initialCalendarRange?.to
111
- ? format(initialCalendarRange.to, formatString)
112
- : null
113
- const initialRangeFrom = initialCalendarRange?.from
114
- ? format(initialCalendarRange.from, formatString)
115
- : null
116
- const calendarRangeTo = calendarRange?.to
117
- ? format(calendarRange.to, formatString)
118
- : null
119
- const calendarRangeFrom = calendarRange?.from
120
- ? format(calendarRange.from, formatString)
121
- : null
122
-
123
- if (!!(calendarRangeTo && calendarRangeFrom && updatedForSubmit)) {
124
- if (
125
- !!(calendarRangeTo !== initialRangeTo) ||
126
- !!(calendarRangeFrom !== initialRangeFrom)
127
- ) {
128
- handleSubmit()
129
- } else {
130
- setToggleCalendar(false)
131
- }
132
- }
133
- }, [calendarRange])
134
-
135
- // Methods
136
- const handleSubmit = () => {
137
- setToggleCalendar(false)
138
- return onSubmit(calendarRange)
139
- }
140
-
141
- const handleClearDates = () => {
142
- setDisabledDates([])
143
- setCalendarRange(undefined)
144
- setCalendarHasError(false)
145
- setInitialCalendarRange(undefined)
146
- }
147
-
148
- return {
149
- handleSubmit,
150
- handleClearDates,
151
- setCalendarRange,
152
- setUpdateCalendarMonthNavigation,
153
- calendarRange,
154
- disabledDates,
155
- updateCalendarMonthNavigation,
156
- updateCalendarDefaultMonth,
157
- calendarHasError,
158
- setCalendarHasError,
159
- setUpdatedForSubmit,
160
- rangeContext,
161
- disableCalendarDates,
162
- }
163
- }
@@ -1,3 +0,0 @@
1
- export { default } from './FilterCalendar'
2
-
3
- export * from './FilterCalendarTypes'
@@ -1,33 +0,0 @@
1
- .will-filter-bar-close-button {
2
- width: auto;
3
- height: auto;
4
- /* background-color: var(--will-grey); */
5
- color: var(--will-grey);
6
- padding: 2px 7px;
7
- border-radius: 50%;
8
- cursor: pointer;
9
- border: none;
10
- display: flex;
11
- align-items: center;
12
- font-size: 23px;
13
- /* display: none; */
14
-
15
- position: absolute;
16
- top: 10px;
17
- right: 10px;
18
-
19
- min-height: 35px;
20
- }
21
-
22
- @media (max-width: 960px) {
23
- .will-filter-bar-close-button {
24
- top: 10px;
25
- right: 10px;
26
-
27
- border-radius: 25px;
28
- margin-left:0;
29
-
30
- display: flex;
31
- justify-content: center;
32
- }
33
- }
@@ -1,16 +0,0 @@
1
- import React from 'react'
2
- import { IoIosCloseCircleOutline } from 'react-icons/io'
3
-
4
- import './CloseButton.css'
5
-
6
- interface CloseButtonPropsType {
7
- handleClose: () => void
8
- }
9
-
10
- export const CloseButton = ({ handleClose }: CloseButtonPropsType) => {
11
- return (
12
- <button className="will-filter-bar-close-button" onClick={handleClose}>
13
- <IoIosCloseCircleOutline />
14
- </button>
15
- )
16
- }
@@ -1,54 +0,0 @@
1
- .will-filter-bar-submit-button {
2
- width: auto;
3
- height: auto;
4
- padding: 10px 20px;
5
- border-radius: 20px;
6
- cursor: pointer;
7
- border: none;
8
- white-space: nowrap;
9
- text-transform: uppercase;
10
- font-size: 12px;
11
- display: flex;
12
- align-items: center;
13
- user-select: none;
14
- }
15
-
16
- /* Submit button variants */
17
- .will-filter-bar-submit-button.default {
18
- background-color: var(--will-primary);
19
- color: var(--will-white);
20
- }
21
-
22
- .will-filter-bar-submit-button.text {
23
- background-color: transparent;
24
- color: var(--will-black);
25
- text-decoration: underline;
26
- font-weight: 500;
27
- font-size: 15px;
28
- padding: 0 10px;
29
- }
30
-
31
- .will-filter-bar-submit-button span {
32
- margin-right: 10px;
33
- display: flex;
34
- }
35
-
36
- button.will-filter-bar-submit-button:disabled {
37
- opacity: 0.5;
38
- cursor: not-allowed;
39
- }
40
-
41
-
42
- @media (max-width: 960px) {
43
- .will-filter-bar-submit-button {
44
- justify-content: center;
45
-
46
- }
47
- }
48
-
49
- /* --- */
50
-
51
- @keyframes spin {
52
- 0% { transform: rotate(0deg); }
53
- 100% { transform: rotate(360deg); }
54
- }
@@ -1,42 +0,0 @@
1
- import React from 'react'
2
- import { FaSpinner } from 'react-icons/fa'
3
- import { ReactNode } from 'react'
4
-
5
- import './SubmitButton.css'
6
-
7
- type SubmitButtonVariant = 'text' | 'full'
8
-
9
- type Props = {
10
- onClick?: () => void
11
- startIcon?: ReactNode
12
- label?: string
13
- disabled?: boolean
14
- isLoading?: boolean
15
- variant?: SubmitButtonVariant
16
- }
17
-
18
- export const SubmitButton = ({
19
- onClick,
20
- startIcon,
21
- label,
22
- disabled,
23
- isLoading,
24
- variant,
25
- }: Props) => {
26
- return (
27
- <button
28
- className={`will-filter-bar-submit-button ${variant || 'default'}`}
29
- onClick={onClick}
30
- disabled={disabled || isLoading}
31
- >
32
- {isLoading ? (
33
- <span>
34
- {<FaSpinner style={{ animation: 'spin 1s linear infinite' }} />}
35
- </span>
36
- ) : (
37
- startIcon && <span>{startIcon}</span>
38
- )}
39
- {label || 'Label'}
40
- </button>
41
- )
42
- }
@@ -1,280 +0,0 @@
1
- .will-calendar-filter-container {
2
- display: flex;
3
- justify-content: center;
4
- user-select: none;
5
- }
6
-
7
- /* Calendar overrides */
8
- .will-calendar-filter-container .rdp {
9
- margin: 0;
10
- }
11
-
12
- .will-calendar-filter-container .DayPicker {
13
- font-size: 25px;
14
- }
15
-
16
- .will-calendar-filter-container .rdp-month {
17
- position: relative;
18
- }
19
-
20
- .will-calendar-filter-container .rdp-month.rdp-caption_start {
21
- padding-left: 70px;
22
- }
23
-
24
- .will-calendar-filter-container .rdp-month.rdp-caption_end {
25
- padding-right: 70px;
26
- }
27
-
28
- .will-calendar-filter-container .rdp-month .rdp-nav {
29
- border: 1px solid var(--will-primary);
30
- border-radius: 50%;
31
- }
32
-
33
- .will-calendar-filter-container .rdp-month .rdp-nav svg {
34
- color: var(--will-primary);
35
- }
36
-
37
- .will-calendar-filter-container .rdp-month .rdp-caption {
38
- position: initial;
39
- }
40
-
41
- .will-calendar-filter-container .rdp-month .rdp-caption > .rdp-caption_label,
42
- .will-calendar-filter-container .rdp-table .rdp-head {
43
- opacity: 0.6;
44
- }
45
-
46
- .will-calendar-filter-container .rdp-table {
47
- border-collapse: separate;
48
- border-spacing: 0px 2px;
49
- }
50
-
51
- .will-calendar-filter-container
52
- .rdp-button_reset.rdp-button.rdp-day.rdp-day_selected {
53
- background-color: var(--will-primary);
54
- opacity: 1;
55
- color: var(--will-white);
56
- }
57
-
58
- .will-calendar-filter-container .my-today:not(.rdp-day_selected) {
59
- font-weight: 700;
60
- opacity: 1;
61
- color: var(--will-primary);
62
- }
63
-
64
- .will-calendar-filter-container .rdp-cell {
65
- position: relative;
66
- }
67
-
68
- .will-calendar-filter-container .rdp-cell button {
69
- font-weight: 500;
70
- }
71
-
72
- .will-calendar-filter-container .rdp-cell button.booked {
73
- font-weight: 400;
74
- cursor: not-allowed;
75
- }
76
-
77
- .will-calendar-filter-container .rdp-cell .rdp-button[disabled] {
78
- color: var(--will-transparent-black);
79
- opacity: 1;
80
- }
81
-
82
- @media (max-width: 960px) {
83
- .will-calendar-filter-container .rdp-month .rdp-nav {
84
- border: none;
85
- border-radius: initial;
86
- }
87
-
88
- .will-calendar-filter-container .rdp-month.rdp-caption_start {
89
- padding-left: 10px;
90
- }
91
-
92
- .will-calendar-filter-container .rdp-month.rdp-caption_end {
93
- padding-right: 10px;
94
- }
95
- }
96
-
97
- /* Tooltips */
98
- .will-root .will-calendar-filter-container .will-calendar-tooltip,
99
- .will-root .will-calendar-filter-container .will-calendar-tooltip-check-out,
100
- .will-root
101
- .will-calendar-filter-container
102
- .will-calendar-tooltip-overlapping-date,
103
- .will-root
104
- .will-calendar-filter-container
105
- .will-calendar-tooltip-check-out-only,
106
- .will-root
107
- .will-calendar-filter-container
108
- .will-calendar-tooltip-check-in-only {
109
- position: absolute;
110
- top: -42px;
111
- transform: translateX(calc(-50% + 20px));
112
- display: none;
113
- white-space: nowrap;
114
- z-index: 2;
115
- }
116
-
117
- .will-root .will-calendar-filter-container .will-calendar-tooltip > div,
118
- .will-root
119
- .will-calendar-filter-container
120
- .will-calendar-tooltip-check-out
121
- > div,
122
- .will-root
123
- .will-calendar-filter-container
124
- .will-calendar-tooltip-overlapping-date
125
- > div,
126
- .will-root
127
- .will-calendar-filter-container
128
- .will-calendar-tooltip-check-out-only
129
- > div,
130
- .will-root
131
- .will-calendar-filter-container
132
- .will-calendar-tooltip-check-in-only
133
- > div {
134
- background-color: white;
135
- position: relative;
136
- padding: 5px 10px;
137
- border: 1px solid var(--will-primary);
138
- border-radius: 5px;
139
- }
140
-
141
- .will-root .will-calendar-filter-container .will-calendar-tooltip::before,
142
- .will-root
143
- .will-calendar-filter-container
144
- .will-calendar-tooltip-check-out::before,
145
- .will-root
146
- .will-calendar-filter-container
147
- .will-calendar-tooltip-overlapping-date::before,
148
- .will-root
149
- .will-calendar-filter-container
150
- .will-calendar-tooltip-check-out-only::before,
151
- .will-root
152
- .will-calendar-filter-container
153
- .will-calendar-tooltip-check-in-only::before {
154
- content: '';
155
- width: 10px;
156
- height: 10px;
157
- border: 1px solid var(--will-primary);
158
- position: absolute;
159
- bottom: -4px;
160
- left: calc(50% - 5.555px);
161
- rotate: 45deg;
162
- z-index: 0;
163
- background-color: var(--will-white);
164
- }
165
-
166
- .will-root
167
- .will-calendar-filter-container
168
- .rdp-cell:hover
169
- .will-calendar-tooltip,
170
- .will-root
171
- .will-calendar-filter-container
172
- .rdp-cell:hover
173
- .will-calendar-tooltip-check-out,
174
- .will-root
175
- .will-calendar-filter-container
176
- .rdp-cell:hover
177
- .will-calendar-tooltip-overlapping-date,
178
- .will-root
179
- .will-calendar-filter-container
180
- .rdp-cell:hover
181
- .will-calendar-tooltip-check-out-only,
182
- .will-root
183
- .will-calendar-filter-container
184
- .rdp-cell:hover
185
- .will-calendar-tooltip-check-in-only {
186
- display: block;
187
- }
188
-
189
- /* Loading spinner */
190
-
191
- .will-root .will-calendar-filter-container .rdp-months {
192
- position: relative;
193
- }
194
-
195
- .will-root .will-calendar-filter-container .will-calendar-spinner {
196
- position: absolute;
197
- top: 0;
198
- bottom: 0;
199
- left: 0;
200
- right: 0;
201
- background-color: var(--will-white-transparent);
202
- z-index: 3;
203
- display: none;
204
- justify-content: center;
205
- align-items: center;
206
- font-weight: 600;
207
- }
208
-
209
- /* No active selection */
210
-
211
- .will-root .will-calendar-filter-container .no-active-selection-start,
212
- .will-root .will-calendar-filter-container .no-active-selection-mid,
213
- .will-root .will-calendar-filter-container .no-active-selection-end {
214
- position: initial;
215
- }
216
-
217
- .will-root .will-calendar-filter-container .no-active-selection-start::before,
218
- .will-root .will-calendar-filter-container .no-active-selection-mid::before,
219
- .will-root .will-calendar-filter-container .no-active-selection-end::before {
220
- content: '';
221
- position: absolute;
222
- width: 100%;
223
- height: 100%;
224
- border: 2px solid var(--will-light-grey);
225
- box-sizing: border-box;
226
- }
227
-
228
- .will-root .will-calendar-filter-container .no-active-selection-start::before {
229
- border-right: none;
230
- border-top-left-radius: 50%;
231
- border-bottom-left-radius: 50%;
232
- }
233
-
234
- .will-root .will-calendar-filter-container .no-active-selection-mid::before {
235
- border-right: none;
236
- border-left: none;
237
- }
238
-
239
- .will-root .will-calendar-filter-container .no-active-selection-end::before {
240
- border-left: none;
241
- border-top-right-radius: 50%;
242
- border-bottom-right-radius: 50%;
243
- }
244
-
245
- .will-root
246
- .will-calendar-filter-container
247
- .rdp-day_selected.rdp-day_range_middle.checkout-option {
248
- background-color: var(--will-primary-lightest);
249
- color: inherit;
250
- }
251
-
252
- /* Overlapping date */
253
-
254
- .will-root .will-calendar-filter-container .overlapping-date {
255
- user-select: none;
256
- pointer-events: none;
257
- }
258
-
259
- .will-root .will-calendar-filter-container .overlapping-date:hover {
260
- cursor: not-allowed;
261
- }
262
-
263
- @media (max-width: 600px) {
264
- /* Tooltips */
265
- .will-root .will-calendar-filter-container .will-calendar-tooltip,
266
- .will-root .will-calendar-filter-container .will-calendar-tooltip-check-out,
267
- .will-root
268
- .will-calendar-filter-container
269
- .will-calendar-tooltip-overlapping-date,
270
- .will-root
271
- .will-calendar-filter-container
272
- .will-calendar-tooltip-check-out-only,
273
- .will-root
274
- .will-calendar-filter-container
275
- .will-calendar-tooltip-check-in-only {
276
- top: -70px;
277
- white-space: wrap;
278
- max-width: 120px;
279
- }
280
- }