willba-component-library 0.0.62 → 0.0.63
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/components/FilterBar/hooks/useFilterBar.d.ts +1 -1
- package/lib/index.esm.js +1842 -12
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +1842 -12
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +1842 -12
- package/lib/index.umd.js.map +1 -1
- package/package.json +3 -2
- package/src/components/FilterBar/FilterBar.css +34 -9
- package/src/components/FilterBar/FilterBar.tsx +13 -5
- package/src/components/FilterBar/components/calendar/Calendar.css +10 -1
- package/src/components/FilterBar/components/calendar/Calendar.tsx +4 -2
- package/src/components/FilterBar/components/divider/Divider.css +9 -0
- package/src/components/FilterBar/components/select-button/SelectButton.css +9 -0
- package/src/components/FilterBar/components/submit-button/SubmitButton.css +9 -1
- package/src/components/FilterBar/components/submit-button/SubmitButton.tsx +1 -1
- package/src/components/FilterBar/hooks/useFilterBar.tsx +1 -1
- package/src/themes/Default.css +8 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "willba-component-library",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.63",
|
|
4
4
|
"description": "A stroybook 6 with TypeScript demo",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/index.esm.js",
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"i18next": "^23.4.4",
|
|
20
20
|
"react-day-picker": "^8.8.0",
|
|
21
21
|
"react-i18next": "^13.1.1",
|
|
22
|
-
"react-icons": "^4.10.1"
|
|
22
|
+
"react-icons": "^4.10.1",
|
|
23
|
+
"react-responsive": "^9.0.2"
|
|
23
24
|
},
|
|
24
25
|
"peerDependencies": {
|
|
25
26
|
"react": "^18.2.0",
|
|
@@ -1,9 +1,24 @@
|
|
|
1
|
+
.will-root {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
.will-filter-bar {
|
|
2
6
|
box-sizing: border-box;
|
|
3
|
-
max-width: 1100px;
|
|
4
7
|
position: relative;
|
|
5
8
|
}
|
|
6
9
|
|
|
10
|
+
.will-filter-bar-underlay {
|
|
11
|
+
background-color: rgba(0,0,0,.6);
|
|
12
|
+
position: absolute;
|
|
13
|
+
top:0;
|
|
14
|
+
left: 0;
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
min-height: 100vh;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* Header */
|
|
7
22
|
.will-filter-bar-header {
|
|
8
23
|
display: flex;
|
|
9
24
|
justify-content: space-between;
|
|
@@ -11,11 +26,21 @@
|
|
|
11
26
|
position: relative;
|
|
12
27
|
z-index: 222;
|
|
13
28
|
|
|
29
|
+
|
|
14
30
|
border-radius: 40px;
|
|
15
31
|
background-color: var(--will-white);
|
|
16
32
|
box-shadow: var(--will-box-shadow);
|
|
17
33
|
}
|
|
18
34
|
|
|
35
|
+
@media (max-width: 1024px) {
|
|
36
|
+
.will-filter-bar-header {
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
padding: 20px;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Container */
|
|
43
|
+
|
|
19
44
|
.will-filter-bar-container {
|
|
20
45
|
background-color: var(--will-white);
|
|
21
46
|
min-height: 100px;
|
|
@@ -29,11 +54,11 @@
|
|
|
29
54
|
box-shadow: var(--will-box-shadow);
|
|
30
55
|
}
|
|
31
56
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
57
|
+
@media (max-width: 1024px) {
|
|
58
|
+
.will-filter-bar-container {
|
|
59
|
+
margin-top: 20px;
|
|
60
|
+
padding: 30px 40px;
|
|
61
|
+
position: initial;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
@@ -48,8 +48,16 @@ export default function FilterBar({ vendor, language }: FilterBarProps) {
|
|
|
48
48
|
} = useFilterBar()
|
|
49
49
|
|
|
50
50
|
return (
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
<>
|
|
52
|
+
{selectedFilter && (
|
|
53
|
+
<div
|
|
54
|
+
className={`will-filter-bar will-filter-bar-underlay`}
|
|
55
|
+
onClick={() => {
|
|
56
|
+
handleSelectedFilter(false)
|
|
57
|
+
}}
|
|
58
|
+
/>
|
|
59
|
+
)}
|
|
60
|
+
<div className={`will-root ${themeClass}`}>
|
|
53
61
|
<div className="will-filter-bar-header">
|
|
54
62
|
<SelectButton
|
|
55
63
|
style={fontWigthBold(selectedFilter === 1 || selectedFilter === 2)}
|
|
@@ -68,12 +76,12 @@ export default function FilterBar({ vendor, language }: FilterBarProps) {
|
|
|
68
76
|
onClick={() => handleSelectedFilter(3)}
|
|
69
77
|
style={fontWigthBold(selectedFilter === 3)}
|
|
70
78
|
/>
|
|
71
|
-
<Divider />
|
|
79
|
+
{/* <Divider />
|
|
72
80
|
<SelectButton
|
|
73
81
|
label={t('categories.label')}
|
|
74
82
|
onClick={() => handleSelectedFilter(4)}
|
|
75
83
|
style={fontWigthBold(selectedFilter === 4)}
|
|
76
|
-
/>
|
|
84
|
+
/> */}
|
|
77
85
|
<SubmitButton onClick={handleSubmit} />
|
|
78
86
|
</div>
|
|
79
87
|
|
|
@@ -104,7 +112,7 @@ export default function FilterBar({ vendor, language }: FilterBarProps) {
|
|
|
104
112
|
</div>
|
|
105
113
|
)}
|
|
106
114
|
</div>
|
|
107
|
-
|
|
115
|
+
</>
|
|
108
116
|
)
|
|
109
117
|
}
|
|
110
118
|
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
border: 1px solid var(--will-primary);
|
|
36
36
|
border-radius: 50%;
|
|
37
37
|
left: 25;
|
|
38
|
-
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
.will-calendar-filter-container .rdp-month .rdp-nav svg {
|
|
@@ -60,3 +59,13 @@
|
|
|
60
59
|
background-color: var(--will-primary);
|
|
61
60
|
opacity: 1;
|
|
62
61
|
}
|
|
62
|
+
|
|
63
|
+
@media (max-width: 1024px) {
|
|
64
|
+
.will-calendar-filter-container .rdp-month .rdp-nav {
|
|
65
|
+
border: none;
|
|
66
|
+
border-radius: initial;
|
|
67
|
+
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import React, { useEffect
|
|
1
|
+
import React, { useEffect } from 'react'
|
|
2
2
|
import { useTranslation } from 'react-i18next'
|
|
3
3
|
import { DateRange, DayPicker } from 'react-day-picker'
|
|
4
4
|
import { addDays } from 'date-fns'
|
|
5
|
+
import { useMediaQuery } from 'react-responsive'
|
|
5
6
|
|
|
6
7
|
import 'react-day-picker/dist/style.css'
|
|
7
8
|
import './Calendar.css'
|
|
@@ -10,6 +11,7 @@ const currentMonth = new Date()
|
|
|
10
11
|
|
|
11
12
|
export default function Calendar({ calendarRange, setCalendarRange }: any) {
|
|
12
13
|
const { t } = useTranslation('filterBar')
|
|
14
|
+
const isTablet = useMediaQuery({ maxWidth: 1024 })
|
|
13
15
|
|
|
14
16
|
const defaultCalendarSelected: DateRange = {
|
|
15
17
|
from: currentMonth,
|
|
@@ -31,7 +33,7 @@ export default function Calendar({ calendarRange, setCalendarRange }: any) {
|
|
|
31
33
|
mode="range"
|
|
32
34
|
showOutsideDays
|
|
33
35
|
fixedWeeks
|
|
34
|
-
numberOfMonths={2}
|
|
36
|
+
numberOfMonths={!isTablet ? 2 : 1}
|
|
35
37
|
weekStartsOn={1}
|
|
36
38
|
max={31}
|
|
37
39
|
defaultMonth={currentMonth}
|
|
@@ -10,7 +10,7 @@ export default function SubmitButton({ onClick }: any) {
|
|
|
10
10
|
return (
|
|
11
11
|
<button className="will-filter-bar-submit-button" onClick={onClick}>
|
|
12
12
|
<span>
|
|
13
|
-
|
|
13
|
+
<FaSearch />
|
|
14
14
|
</span>
|
|
15
15
|
{t('submit.label')}
|
|
16
16
|
</button>
|
|
@@ -9,7 +9,7 @@ export default function useFilterBar() {
|
|
|
9
9
|
const [guestsKids, setGuestsKids] = useState(0)
|
|
10
10
|
const [categories, setCategories] = useState(0)
|
|
11
11
|
|
|
12
|
-
const handleSelectedFilter = (id:
|
|
12
|
+
const handleSelectedFilter = (id: number | boolean) => {
|
|
13
13
|
setSelectedFilter(id)
|
|
14
14
|
}
|
|
15
15
|
|
package/src/themes/Default.css
CHANGED