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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "willba-component-library",
3
- "version": "0.0.62",
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
- .will-filter-bar-underlay {
33
- background-color: red;
34
- position: absolute;
35
- top:0;
36
- left: 0;
37
- width: 100%;
38
- height: 100%;
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
- <div className={`will-root ${themeClass}`}>
52
- <div className={`will-filter-bar will-filter-bar-underlay`}>
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
- </div>
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, useState } from 'react'
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}
@@ -3,4 +3,13 @@
3
3
  margin: 0 10px;
4
4
  height: 35px;
5
5
  background-color: #384265;
6
+ }
7
+
8
+ @media (max-width: 1024px) {
9
+ .will-filter-bar-divider {
10
+ width: 100%;
11
+ margin: 0 10px;
12
+ height: 1px;
13
+ background-color: #384265;
14
+ }
6
15
  }
@@ -9,3 +9,12 @@
9
9
  font-size: 15px;
10
10
  text-align: initial;
11
11
  }
12
+
13
+ @media (max-width: 1024px) {
14
+ .will-filter-bar-select-button {
15
+ margin: 15px 0;
16
+ text-align: center;
17
+ }
18
+ }
19
+
20
+
@@ -16,4 +16,12 @@
16
16
 
17
17
  .will-filter-bar-submit-button span {
18
18
  margin-right: 10px;
19
- }
19
+ display: flex;
20
+ }
21
+
22
+ @media (max-width: 1024px) {
23
+ .will-filter-bar-submit-button {
24
+ justify-content: center;
25
+ margin-bottom: 25px;
26
+ }
27
+ }
@@ -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
- {/* <FontAwesomeIcon icon={faSearch} /> */} <FaSearch />
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: any) => {
12
+ const handleSelectedFilter = (id: number | boolean) => {
13
13
  setSelectedFilter(id)
14
14
  }
15
15
 
@@ -21,6 +21,14 @@
21
21
 
22
22
  /* Confines */
23
23
  --will-box-shadow: 0px 6px 11px 0px #a7a4a480;
24
+
25
+ /* Breakpoints */
26
+
27
+ --will-lg: 1140px;
28
+ --will-md: 960px;
29
+ --will-sm: 600px;
30
+ --will-xl: 1280px;
31
+ --will-xs: 0px;
24
32
  }
25
33
 
26
34
  /* Typography */