willba-component-library 0.2.54 → 0.2.56
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/FilterBar/FilterBar.stories.d.ts +1 -1
- package/lib/components/FilterCalendar/FilterCalendar.d.ts +1 -1
- package/lib/components/FilterCalendar/FilterCalendar.stories.d.ts +2 -1
- package/lib/components/FilterCalendar/hooks/useFilterCalendar.d.ts +3 -3
- package/lib/core/components/calendar/CalendarTypes.d.ts +8 -6
- package/lib/core/components/calendar/hooks/index.d.ts +3 -0
- package/lib/core/components/calendar/hooks/useCalendarLoadingSpinner.d.ts +7 -0
- package/lib/core/components/calendar/hooks/useCalendarTooltips.d.ts +10 -0
- package/lib/core/components/calendar/hooks/useUpdateDisabledDates.d.ts +13 -0
- package/lib/core/components/calendar/utils/calendarSelectionRules.d.ts +15 -0
- package/lib/core/components/calendar/utils/checkForContinuousSelection.d.ts +10 -0
- package/lib/core/components/calendar/utils/disabledDatesByPage.d.ts +9 -0
- package/lib/core/components/calendar/utils/handleCalendarModifiers.d.ts +46 -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/index.d.ts +10 -7
- package/lib/index.esm.js +646 -272
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +646 -272
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +646 -272
- package/lib/index.umd.js.map +1 -1
- package/lib/themes/useTheme.d.ts +2 -0
- package/package.json +1 -1
- package/src/assets/IconsSvg.tsx +66 -0
- package/src/components/FilterBar/FilterBar.stories.tsx +2 -1
- package/src/components/FilterBar/FilterBar.tsx +1 -1
- package/src/components/FilterCalendar/FilterCalendar.css +8 -9
- package/src/components/FilterCalendar/FilterCalendar.stories.tsx +345 -158
- package/src/components/FilterCalendar/FilterCalendar.tsx +69 -52
- package/src/components/FilterCalendar/FilterCalendarTypes.ts +0 -1
- package/src/components/FilterCalendar/hooks/useFilterCalendar.ts +44 -4
- package/src/core/components/buttons/submit-button/SubmitButton.tsx +1 -4
- package/src/core/components/calendar/Calendar.css +24 -6
- package/src/core/components/calendar/Calendar.tsx +127 -376
- package/src/core/components/calendar/CalendarTypes.ts +9 -4
- package/src/core/components/calendar/hooks/index.ts +3 -0
- package/src/core/components/calendar/hooks/useCalendarLoadingSpinner.tsx +25 -0
- package/src/core/components/calendar/hooks/useCalendarTooltips.tsx +139 -0
- package/src/core/components/calendar/hooks/useUpdateDisabledDates.tsx +94 -0
- package/src/core/components/calendar/utils/calendarSelectionRules.tsx +163 -0
- package/src/core/components/calendar/utils/checkForContinuousSelection.tsx +50 -0
- package/src/core/components/calendar/utils/disabledDatesByPage.tsx +36 -0
- package/src/core/components/calendar/utils/handleCalendarModifiers.tsx +151 -0
- package/src/core/components/calendar/utils/handleRangeContextDisabledDates.tsx +70 -0
- package/src/core/components/calendar/utils/index.ts +8 -0
- package/src/themes/Default.css +6 -0
- package/src/themes/useTheme.tsx +3 -0
- package/src/assets/SpinnerSvg.tsx +0 -40
- package/src/core/utils/handleOverlappingDates.tsx +0 -3
- package/src/core/utils/index.ts +0 -3
- /package/src/core/{utils → components/calendar/utils}/nightsCount.tsx +0 -0
- /package/src/core/{utils → components/calendar/utils}/parseDate.tsx +0 -0
- /package/src/core/{utils → components/calendar/utils}/parseDates.tsx +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
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'
|
package/src/themes/Default.css
CHANGED
|
@@ -23,6 +23,12 @@
|
|
|
23
23
|
--will-charcoal-blue: #384265;
|
|
24
24
|
--will-transparent-white: rgba(255, 255, 255, 0.30);
|
|
25
25
|
--will-transparent-black: rgba(171, 167, 175, 0.30);
|
|
26
|
+
--will-error: #d32f2f;
|
|
27
|
+
|
|
28
|
+
/*Color mix*/
|
|
29
|
+
--will-primary-lighter: color-mix(in srgb, var(--will-primary), white 20%);
|
|
30
|
+
--will-primary-lightest: color-mix(in srgb, var(--will-primary), white 80%);
|
|
31
|
+
|
|
26
32
|
|
|
27
33
|
/* Confines */
|
|
28
34
|
--will-box-shadow-dark: 0px 2px 12px 2px #a1a1a180;
|
package/src/themes/useTheme.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import { CSSProperties } from 'react'
|
|
|
3
3
|
export type Palette = {
|
|
4
4
|
primary: string
|
|
5
5
|
secondary: string
|
|
6
|
+
error: string
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
export type ThemeProps = {
|
|
@@ -12,12 +13,14 @@ export type ThemeProps = {
|
|
|
12
13
|
export interface CustomPaletteTypes extends CSSProperties {
|
|
13
14
|
'--will-primary'?: string
|
|
14
15
|
'--will-secondary'?: string
|
|
16
|
+
'--will-error'?: string
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
export default function useTheme({ palette }: ThemeProps) {
|
|
18
20
|
const themePalette: CustomPaletteTypes = {
|
|
19
21
|
'--will-primary': palette?.primary,
|
|
20
22
|
'--will-secondary': palette?.secondary,
|
|
23
|
+
'--will-error': palette?.error,
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
return themePalette
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
|
-
export const SpinnerSVG = ({
|
|
4
|
-
fill,
|
|
5
|
-
size,
|
|
6
|
-
}: {
|
|
7
|
-
fill?: string
|
|
8
|
-
size?: number
|
|
9
|
-
}) => (
|
|
10
|
-
<svg
|
|
11
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
-
width={`${size || 25}`}
|
|
13
|
-
height={`${size || 25}`}
|
|
14
|
-
viewBox="0 0 24 24"
|
|
15
|
-
>
|
|
16
|
-
<style>
|
|
17
|
-
{`
|
|
18
|
-
.spinner_z9k8 {
|
|
19
|
-
transform-origin: center;
|
|
20
|
-
animation: spinner_StKS .75s infinite linear;
|
|
21
|
-
}
|
|
22
|
-
@keyframes spinner_StKS {
|
|
23
|
-
100% {
|
|
24
|
-
transform: rotate(360deg);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
`}
|
|
28
|
-
</style>
|
|
29
|
-
<path
|
|
30
|
-
d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"
|
|
31
|
-
opacity=".25"
|
|
32
|
-
fill={fill}
|
|
33
|
-
/>
|
|
34
|
-
<path
|
|
35
|
-
d="M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z"
|
|
36
|
-
className="spinner_z9k8"
|
|
37
|
-
fill={fill}
|
|
38
|
-
/>
|
|
39
|
-
</svg>
|
|
40
|
-
)
|
package/src/core/utils/index.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|