willba-component-library 0.1.52 → 0.1.53
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/index.esm.js +7 -7
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +7 -7
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +7 -7
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FilterBar/FilterBar.css +5 -2
- package/src/components/FilterBar/FilterBar.stories.tsx +1 -4
- package/src/components/FilterBar/components/buttons/select-button/SelectButton.css +2 -2
- package/src/components/FilterBar/components/buttons/select-button/SelectButton.tsx +4 -3
- package/src/components/FilterBar/components/buttons/tab-button/TabButton.css +1 -10
- package/src/components/FilterBar/hooks/useFilterBar.tsx +2 -3
- package/src/components/FilterBar/utils/parseGuests.tsx +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
.will-root {
|
|
2
2
|
z-index: 999;
|
|
3
|
-
width:
|
|
3
|
+
width: fit-content;
|
|
4
|
+
min-width: 796px;
|
|
4
5
|
max-height: 100vh;
|
|
5
6
|
position: relative;
|
|
6
7
|
}
|
|
@@ -57,7 +58,9 @@
|
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
@media (max-width: 960px) {
|
|
60
|
-
.will-root {
|
|
61
|
+
.will-root {
|
|
62
|
+
width: 100%;
|
|
63
|
+
max-height: 100vh;
|
|
61
64
|
z-index: 3;
|
|
62
65
|
}
|
|
63
66
|
|
|
@@ -45,10 +45,7 @@ export const Primary: Story = {
|
|
|
45
45
|
},
|
|
46
46
|
render: (args) => (
|
|
47
47
|
<div style={{ background: 'grey', padding: '30px', height: '100vh' }}>
|
|
48
|
-
<FilterBar
|
|
49
|
-
{...args}
|
|
50
|
-
onSubmit={false ? null : (val: Filters) => console.log(val)}
|
|
51
|
-
/>
|
|
48
|
+
<FilterBar {...args} onSubmit={false ? null : (val: Filters) => null} />
|
|
52
49
|
</div>
|
|
53
50
|
),
|
|
54
51
|
}
|
|
@@ -23,9 +23,10 @@ export const SelectButton = ({
|
|
|
23
23
|
<p className={`select-button-label ${active ? 'active' : ''}`}>
|
|
24
24
|
{label}
|
|
25
25
|
</p>
|
|
26
|
-
<p
|
|
27
|
-
{description}
|
|
28
|
-
|
|
26
|
+
<p
|
|
27
|
+
className={`select-button-description ${active ? 'active' : ''}`}
|
|
28
|
+
dangerouslySetInnerHTML={{ __html: description }}
|
|
29
|
+
/>
|
|
29
30
|
</div>
|
|
30
31
|
</span>
|
|
31
32
|
</button>
|
|
@@ -18,7 +18,6 @@ export const useFilterBar = ({
|
|
|
18
18
|
onSubmit,
|
|
19
19
|
}: Props) => {
|
|
20
20
|
const [selectedPath, setSelectedPath] = useState('/events')
|
|
21
|
-
|
|
22
21
|
const [selectedFilter, setSelectedFilter] = useState<string | boolean>(false)
|
|
23
22
|
const [calendarRange, setCalendarRange] = useState<DateRange | undefined>()
|
|
24
23
|
|
|
@@ -121,7 +120,7 @@ export const useFilterBar = ({
|
|
|
121
120
|
|
|
122
121
|
handleSelectedFilter(false)
|
|
123
122
|
|
|
124
|
-
if (onSubmit) {
|
|
123
|
+
if (onSubmit && selectedPath === '/rooms') {
|
|
125
124
|
const updatedParamsObject: { [key: string]: string } = {}
|
|
126
125
|
|
|
127
126
|
updatedParams.forEach((value, key) => {
|
|
@@ -142,7 +141,7 @@ export const useFilterBar = ({
|
|
|
142
141
|
}
|
|
143
142
|
|
|
144
143
|
handleSelectedFilter(false)
|
|
145
|
-
return onSubmit
|
|
144
|
+
return onSubmit && selectedPath === '/rooms'
|
|
146
145
|
? onSubmit(newParams)
|
|
147
146
|
: (window.location.href = `${redirectUrl}/${selectedPath}${
|
|
148
147
|
querySearchParams ? `?${querySearchParams.toString()}` : ''
|
|
@@ -10,7 +10,9 @@ export const parseGuests = ({ ageCategoryCounts, ageCategories }: Props) =>
|
|
|
10
10
|
const ageCategory = ageCategories.find((c) => c.id === key[key.length - 1])
|
|
11
11
|
|
|
12
12
|
if (ageCategory && value) {
|
|
13
|
-
acc += `${acc ? ' -' : ''} ${
|
|
13
|
+
acc += `${acc ? ' -' : ''} ${
|
|
14
|
+
ageCategory.name
|
|
15
|
+
}: <span style="display: inline-block; width: 21px">${value}</span>`
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
return acc
|