willba-component-library 0.0.46 → 0.0.48
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/.nvmrc +1 -0
- package/lib/components/FilterBar/components/select-button/SelectButton.d.ts +1 -1
- package/lib/index.esm.js +4812 -195
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +4826 -209
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +13075 -8458
- package/lib/index.umd.js.map +1 -1
- package/lib/themes/useTheme.d.ts +1 -1
- package/package.json +5 -2
- package/rollup.config.mjs +4 -0
- package/src/components/FilterBar/FilterBar.css +17 -9
- package/src/components/FilterBar/FilterBar.tsx +61 -49
- package/src/components/FilterBar/components/calendar/Calendar.css +60 -2
- package/src/components/FilterBar/components/calendar/Calendar.tsx +22 -11
- package/src/components/FilterBar/components/categories/Categories.css +9 -3
- package/src/components/FilterBar/components/categories/Categories.tsx +3 -3
- package/src/components/FilterBar/components/divider/Divider.css +1 -1
- package/src/components/FilterBar/components/divider/Divider.tsx +1 -1
- package/src/components/FilterBar/components/guests/Guests.css +29 -10
- package/src/components/FilterBar/components/guests/Guests.tsx +44 -14
- package/src/components/FilterBar/components/select-button/SelectButton.css +3 -1
- package/src/components/FilterBar/components/select-button/SelectButton.tsx +6 -2
- package/src/components/FilterBar/components/submit-button/SubmitButton.css +11 -3
- package/src/components/FilterBar/components/submit-button/SubmitButton.tsx +10 -2
- package/src/index.ts +2 -0
- package/src/locales/en/filterBar.json +5 -1
- package/src/locales/fi/filterBar.json +5 -1
- package/src/themes/Default.css +33 -7
- package/src/themes/useTheme.tsx +8 -27
- package/lib/index.css +0 -480
- package/lib/index.esm.css +0 -480
- package/lib/index.umd.css +0 -480
- package/lib/themes/Default.css +0 -13
- package/lib/themes/Kisakallio.css +0 -3
- package/lib/themes/Pajulahti.css +0 -3
- package/src/themes/Kisakallio.css +0 -3
- package/src/themes/Pajulahti.css +0 -3
package/lib/themes/useTheme.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "willba-component-library",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.48",
|
|
4
4
|
"description": "A stroybook 6 with TypeScript demo",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/index.esm.js",
|
|
@@ -14,11 +14,14 @@
|
|
|
14
14
|
"author": "Willba",
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
|
+
"@fortawesome/free-solid-svg-icons": "^6.4.2",
|
|
18
|
+
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
17
19
|
"classnames": "^2.3.2",
|
|
18
20
|
"date-fns": "^2.30.0",
|
|
19
21
|
"i18next": "^23.4.4",
|
|
20
22
|
"react-day-picker": "^8.8.0",
|
|
21
|
-
"react-i18next": "^13.1.1"
|
|
23
|
+
"react-i18next": "^13.1.1",
|
|
24
|
+
"typeface-montserrat": "^1.1.13"
|
|
22
25
|
},
|
|
23
26
|
"peerDependencies": {
|
|
24
27
|
"react": "^18.2.0",
|
package/rollup.config.mjs
CHANGED
|
@@ -1,31 +1,39 @@
|
|
|
1
|
-
.filter-bar {
|
|
1
|
+
.will-filter-bar {
|
|
2
2
|
box-sizing: border-box;
|
|
3
3
|
max-width: 1100px;
|
|
4
4
|
position: relative;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
.filter-bar-header {
|
|
7
|
+
.will-filter-bar-header {
|
|
8
8
|
display: flex;
|
|
9
9
|
justify-content: space-between;
|
|
10
|
-
align-items: center;
|
|
11
10
|
padding: 10px 20px;
|
|
12
11
|
position: relative;
|
|
13
12
|
z-index: 222;
|
|
14
13
|
|
|
15
14
|
border-radius: 40px;
|
|
16
|
-
background-color:
|
|
17
|
-
box-shadow:
|
|
15
|
+
background-color: var(--will-white);
|
|
16
|
+
box-shadow: var(--will-box-shadow);
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
.filter-bar-container {
|
|
21
|
-
background-color:
|
|
19
|
+
.will-filter-bar-container {
|
|
20
|
+
background-color: var(--will-white);
|
|
22
21
|
min-height: 100px;
|
|
23
22
|
|
|
24
23
|
padding: 90px 40px 30px 40px;
|
|
25
24
|
position: absolute;
|
|
26
25
|
top: 0;
|
|
27
26
|
z-index: 111;
|
|
28
|
-
border-radius:
|
|
27
|
+
border-radius: 25px;
|
|
29
28
|
width: -webkit-fill-available;
|
|
30
|
-
box-shadow: var(--box-shadow);
|
|
29
|
+
box-shadow: var(--will-box-shadow);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.will-filter-bar-underlay {
|
|
33
|
+
background-color: red;
|
|
34
|
+
position: absolute;
|
|
35
|
+
top:0;
|
|
36
|
+
left: 0;
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: 100%;
|
|
31
39
|
}
|
|
@@ -8,8 +8,8 @@ import Calendar from './components/calendar/Calendar'
|
|
|
8
8
|
import Guests from './components/guests/Guests'
|
|
9
9
|
import Categories from './components/categories/Categories'
|
|
10
10
|
|
|
11
|
-
import useFilterBar from './hooks/useFilterBar'
|
|
12
11
|
import useTheme from '../../themes/useTheme'
|
|
12
|
+
import useFilterBar from './hooks/useFilterBar'
|
|
13
13
|
|
|
14
14
|
import './FilterBar.css'
|
|
15
15
|
import '../../themes/Default.css'
|
|
@@ -21,8 +21,7 @@ type FilterBarProps = {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export default function FilterBar({ vendor, language }: FilterBarProps) {
|
|
24
|
-
useTheme({ vendor })
|
|
25
|
-
|
|
24
|
+
const themeClass = useTheme({ vendor })
|
|
26
25
|
const [rerenderKey, setRerenderKey] = useState(0)
|
|
27
26
|
|
|
28
27
|
useEffect(() => {
|
|
@@ -49,53 +48,66 @@ export default function FilterBar({ vendor, language }: FilterBarProps) {
|
|
|
49
48
|
} = useFilterBar()
|
|
50
49
|
|
|
51
50
|
return (
|
|
52
|
-
<div className={`
|
|
53
|
-
<div className=
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
{
|
|
79
|
-
<Calendar
|
|
80
|
-
calendarRange={calendarRange}
|
|
81
|
-
setCalendarRange={setCalendarRange}
|
|
82
|
-
/>
|
|
83
|
-
)}
|
|
84
|
-
{selectedFilter === 3 && (
|
|
85
|
-
<Guests
|
|
86
|
-
guestsAdults={guestsAdults}
|
|
87
|
-
guestsKids={guestsKids}
|
|
88
|
-
decrementAdults={() => setGuestsAdults(guestsAdults - 1)}
|
|
89
|
-
incrementAdults={() => setGuestsAdults(guestsAdults + 1)}
|
|
90
|
-
decrementKids={() => setGuestsKids(guestsKids - 1)}
|
|
91
|
-
incrementKids={() => setGuestsKids(guestsKids + 1)}
|
|
92
|
-
/>
|
|
93
|
-
)}
|
|
94
|
-
{selectedFilter === 4 && (
|
|
95
|
-
<Categories categories={categories} setCategories={setCategories} />
|
|
96
|
-
)}
|
|
51
|
+
<div className={`will-root ${themeClass}`}>
|
|
52
|
+
<div className={`will-filter-bar will-filter-bar-underlay`}>
|
|
53
|
+
<div className="will-filter-bar-header">
|
|
54
|
+
<SelectButton
|
|
55
|
+
style={fontWigthBold(selectedFilter === 1 || selectedFilter === 2)}
|
|
56
|
+
label={t('calendar.startDate')}
|
|
57
|
+
onClick={() => handleSelectedFilter(1)}
|
|
58
|
+
/>
|
|
59
|
+
<Divider />
|
|
60
|
+
<SelectButton
|
|
61
|
+
style={fontWigthBold(selectedFilter === 1 || selectedFilter === 2)}
|
|
62
|
+
label={t('calendar.endDate')}
|
|
63
|
+
onClick={() => handleSelectedFilter(2)}
|
|
64
|
+
/>
|
|
65
|
+
<Divider />
|
|
66
|
+
<SelectButton
|
|
67
|
+
label={t('guests.label')}
|
|
68
|
+
onClick={() => handleSelectedFilter(3)}
|
|
69
|
+
style={fontWigthBold(selectedFilter === 3)}
|
|
70
|
+
/>
|
|
71
|
+
<Divider />
|
|
72
|
+
<SelectButton
|
|
73
|
+
label={t('categories.label')}
|
|
74
|
+
onClick={() => handleSelectedFilter(4)}
|
|
75
|
+
style={fontWigthBold(selectedFilter === 4)}
|
|
76
|
+
/>
|
|
77
|
+
<SubmitButton onClick={handleSubmit} />
|
|
97
78
|
</div>
|
|
98
|
-
|
|
79
|
+
|
|
80
|
+
{selectedFilter && (
|
|
81
|
+
<div className="will-filter-bar-container">
|
|
82
|
+
{(selectedFilter === 1 || selectedFilter === 2) && (
|
|
83
|
+
<Calendar
|
|
84
|
+
calendarRange={calendarRange}
|
|
85
|
+
setCalendarRange={setCalendarRange}
|
|
86
|
+
/>
|
|
87
|
+
)}
|
|
88
|
+
{selectedFilter === 3 && (
|
|
89
|
+
<Guests
|
|
90
|
+
guestsAdults={guestsAdults}
|
|
91
|
+
guestsKids={guestsKids}
|
|
92
|
+
decrementAdults={() => setGuestsAdults(guestsAdults - 1)}
|
|
93
|
+
incrementAdults={() => setGuestsAdults(guestsAdults + 1)}
|
|
94
|
+
decrementKids={() => setGuestsKids(guestsKids - 1)}
|
|
95
|
+
incrementKids={() => setGuestsKids(guestsKids + 1)}
|
|
96
|
+
/>
|
|
97
|
+
)}
|
|
98
|
+
{selectedFilter === 4 && (
|
|
99
|
+
<Categories
|
|
100
|
+
categories={categories}
|
|
101
|
+
setCategories={setCategories}
|
|
102
|
+
/>
|
|
103
|
+
)}
|
|
104
|
+
</div>
|
|
105
|
+
)}
|
|
106
|
+
</div>
|
|
99
107
|
</div>
|
|
100
108
|
)
|
|
101
109
|
}
|
|
110
|
+
|
|
111
|
+
const fontWigthBold = (input: boolean) => {
|
|
112
|
+
return { fontWeight: input ? 'bold' : 'initial' }
|
|
113
|
+
}
|
|
@@ -1,4 +1,62 @@
|
|
|
1
|
-
.filter-bar-calendar {
|
|
1
|
+
/* .will-filter-bar-calendar {} */
|
|
2
|
+
|
|
3
|
+
.will-calendar-filter-header {
|
|
4
|
+
padding: 15px 0;
|
|
5
|
+
border-bottom: 1px solid var(--will-grey);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.will-calendar-filter-title {
|
|
9
|
+
font-size: 16px;
|
|
10
|
+
text-transform: uppercase;
|
|
11
|
+
margin: 10px 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.will-calendar-filter-container {
|
|
2
15
|
display: flex;
|
|
3
16
|
justify-content: center;
|
|
4
|
-
|
|
17
|
+
padding-top: 20px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* Calendar overrides */
|
|
21
|
+
|
|
22
|
+
.will-calendar-filter-container .rdp-month {
|
|
23
|
+
position: relative;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.will-calendar-filter-container .rdp-month.rdp-caption_start {
|
|
27
|
+
padding-left: 70px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.will-calendar-filter-container .rdp-month.rdp-caption_end {
|
|
31
|
+
padding-right: 70px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.will-calendar-filter-container .rdp-month .rdp-nav {
|
|
35
|
+
border: 1px solid var(--will-primary);
|
|
36
|
+
border-radius: 50%;
|
|
37
|
+
left: 25;
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.will-calendar-filter-container .rdp-month .rdp-nav svg {
|
|
42
|
+
color: var(--will-primary);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
.will-calendar-filter-container .rdp-month .rdp-caption {
|
|
47
|
+
position: initial;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.will-calendar-filter-container .rdp-month .rdp-caption > .rdp-caption_label,
|
|
51
|
+
.will-calendar-filter-container .rdp-table .rdp-head {
|
|
52
|
+
opacity: .6;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.will-calendar-filter-container .rdp-button_reset.rdp-button.rdp-day {
|
|
56
|
+
opacity: 0.7;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.will-calendar-filter-container .rdp-button_reset.rdp-button.rdp-day.rdp-day_selected {
|
|
60
|
+
background-color: var(--will-primary);
|
|
61
|
+
opacity: 1;
|
|
62
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
|
-
|
|
3
|
-
import { addDays } from 'date-fns'
|
|
2
|
+
import { useTranslation } from 'react-i18next'
|
|
4
3
|
import { DateRange, DayPicker } from 'react-day-picker'
|
|
4
|
+
import { addDays } from 'date-fns'
|
|
5
5
|
|
|
6
6
|
import 'react-day-picker/dist/style.css'
|
|
7
7
|
import './Calendar.css'
|
|
@@ -9,6 +9,8 @@ import './Calendar.css'
|
|
|
9
9
|
const currentMonth = new Date()
|
|
10
10
|
|
|
11
11
|
export default function Calendar({ calendarRange, setCalendarRange }: any) {
|
|
12
|
+
const { t } = useTranslation('filterBar')
|
|
13
|
+
|
|
12
14
|
const defaultCalendarSelected: DateRange = {
|
|
13
15
|
from: currentMonth,
|
|
14
16
|
to: addDays(currentMonth, 0),
|
|
@@ -19,15 +21,24 @@ export default function Calendar({ calendarRange, setCalendarRange }: any) {
|
|
|
19
21
|
}, [])
|
|
20
22
|
|
|
21
23
|
return (
|
|
22
|
-
<div className="filter-bar-calendar">
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
<div className="will-filter-bar-calendar">
|
|
25
|
+
<div className="will-calendar-filter-header">
|
|
26
|
+
<h3 className="will-calendar-filter-title">{t('calendar.title')}</h3>
|
|
27
|
+
</div>
|
|
28
|
+
<div className="will-calendar-filter-container">
|
|
29
|
+
<DayPicker
|
|
30
|
+
id="will-calendar"
|
|
31
|
+
mode="range"
|
|
32
|
+
showOutsideDays
|
|
33
|
+
fixedWeeks
|
|
34
|
+
numberOfMonths={2}
|
|
35
|
+
weekStartsOn={1}
|
|
36
|
+
max={31}
|
|
37
|
+
defaultMonth={currentMonth}
|
|
38
|
+
selected={calendarRange}
|
|
39
|
+
onSelect={setCalendarRange}
|
|
40
|
+
/>
|
|
41
|
+
</div>
|
|
31
42
|
</div>
|
|
32
43
|
)
|
|
33
44
|
}
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
.filter-bar-categories {
|
|
1
|
+
.will-filter-bar-categories {
|
|
2
2
|
text-align: center;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
.categories-filter-
|
|
5
|
+
.will-categories-filter-title {
|
|
6
|
+
font-size: 16px;
|
|
7
|
+
text-transform: uppercase;
|
|
8
|
+
margin: 10px 0 30px 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.will-categories-filter-inner {
|
|
6
12
|
display: flex;
|
|
7
13
|
align-items: center;
|
|
8
14
|
justify-content: center;
|
|
9
15
|
gap: 20px;
|
|
10
16
|
}
|
|
11
17
|
|
|
12
|
-
.categories-filter-inner input {
|
|
18
|
+
.will-categories-filter-inner input {
|
|
13
19
|
cursor: pointer;
|
|
14
20
|
margin-right: 10px;
|
|
15
21
|
}
|
|
@@ -21,9 +21,9 @@ export default function Categories({ categories, setCategories }: any) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
return (
|
|
24
|
-
<div className="filter-bar-categories">
|
|
25
|
-
<h3>{t('categories.label')}</h3>
|
|
26
|
-
<div className="categories-filter-inner">
|
|
24
|
+
<div className="will-filter-bar-categories">
|
|
25
|
+
<h3 className="will-categories-filter-title">{t('categories.label')}</h3>
|
|
26
|
+
<div className="will-categories-filter-inner">
|
|
27
27
|
{categoriesPlaceholder.map((itm, idx) => (
|
|
28
28
|
<div key={idx}>
|
|
29
29
|
<input
|
|
@@ -1,44 +1,63 @@
|
|
|
1
|
-
.filter-bar-guests {
|
|
1
|
+
.will-filter-bar-guests {
|
|
2
2
|
text-align: initial;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
.guests-filter-
|
|
5
|
+
.will-guests-filter-title {
|
|
6
|
+
font-size: 16px;
|
|
7
|
+
text-transform: uppercase;
|
|
8
|
+
margin: 10px 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.will-guests-filter-subtitle {
|
|
12
|
+
font-size: 15px;
|
|
13
|
+
font-weight: 500;
|
|
14
|
+
color:var(--will-text)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
.will-guests-filter-label, .will-guests-filter-count {
|
|
19
|
+
font-size: 18px;
|
|
20
|
+
color: var(--will-text)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.will-guests-filter-container {
|
|
6
24
|
display: flex;
|
|
7
25
|
margin-top: 30px;
|
|
8
26
|
}
|
|
9
27
|
|
|
10
|
-
.guests-filter-inner {
|
|
28
|
+
.will-guests-filter-inner {
|
|
11
29
|
display: flex;
|
|
12
30
|
align-items: center;
|
|
13
31
|
}
|
|
14
32
|
|
|
15
|
-
.guests-filter-inner:not(:last-child) {
|
|
33
|
+
.will-guests-filter-inner:not(:last-child) {
|
|
16
34
|
margin-right: 50px;
|
|
17
35
|
}
|
|
18
36
|
|
|
19
|
-
.guests-filter-
|
|
37
|
+
.will-guests-filter-label {
|
|
20
38
|
display: block;
|
|
21
39
|
margin-right: 20px;
|
|
22
40
|
font-weight: bold;
|
|
23
41
|
}
|
|
24
42
|
|
|
25
|
-
.guests-filter-inner > div {
|
|
43
|
+
.will-guests-filter-inner > div {
|
|
26
44
|
display: flex;
|
|
27
45
|
align-items: center;
|
|
28
46
|
}
|
|
29
47
|
|
|
30
|
-
.guests-filter-
|
|
31
|
-
margin: 0
|
|
48
|
+
.will-guests-filter-count {
|
|
49
|
+
margin: 0 15px;
|
|
32
50
|
}
|
|
33
51
|
|
|
34
|
-
.guests-filter-
|
|
52
|
+
.will-guests-filter-button {
|
|
35
53
|
border-radius: 50%;
|
|
36
54
|
border: none;
|
|
37
|
-
background-color:
|
|
55
|
+
background-color: var(--will-onahau);
|
|
38
56
|
width: 25px;
|
|
39
57
|
height: 25px;
|
|
40
58
|
display: flex;
|
|
41
59
|
justify-content: center;
|
|
42
60
|
align-items: center;
|
|
43
61
|
font-size: 20px;
|
|
62
|
+
cursor: pointer;
|
|
44
63
|
}
|
|
@@ -14,29 +14,59 @@ export default function Guests({
|
|
|
14
14
|
const { t } = useTranslation('filterBar')
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
|
-
<div className="filter-bar-guests">
|
|
18
|
-
<h3>{t('guests.title')}</h3>
|
|
19
|
-
<p>{t('guests.subtitle')}</p>
|
|
17
|
+
<div className="will-filter-bar-guests">
|
|
18
|
+
<h3 className="will-guests-filter-title">{t('guests.title')}</h3>
|
|
19
|
+
<p className="will-guests-filter-subtitle">{t('guests.subtitle')}</p>
|
|
20
20
|
|
|
21
|
-
<div className="guests-filter-container">
|
|
22
|
-
<div className="guests-filter-inner">
|
|
23
|
-
<span
|
|
21
|
+
<div className="will-guests-filter-container">
|
|
22
|
+
<div className="will-guests-filter-inner">
|
|
23
|
+
<span className="will-guests-filter-label">
|
|
24
|
+
{t('guests.adultsLabel')}
|
|
25
|
+
</span>
|
|
24
26
|
<div>
|
|
25
|
-
<button
|
|
27
|
+
<button
|
|
28
|
+
className="will-guests-filter-button"
|
|
29
|
+
onClick={decrementAdults}
|
|
30
|
+
disabled={guestsAdults < 2}
|
|
31
|
+
style={{
|
|
32
|
+
cursor: guestsAdults < 2 ? 'initial' : 'pointer',
|
|
33
|
+
paddingBottom: '4px',
|
|
34
|
+
}}
|
|
35
|
+
>
|
|
26
36
|
-
|
|
27
37
|
</button>
|
|
28
|
-
<span>{guestsAdults}</span>
|
|
29
|
-
<button
|
|
38
|
+
<span className="will-guests-filter-count">{guestsAdults}</span>
|
|
39
|
+
<button
|
|
40
|
+
className="will-guests-filter-button"
|
|
41
|
+
onClick={incrementAdults}
|
|
42
|
+
>
|
|
43
|
+
+
|
|
44
|
+
</button>
|
|
30
45
|
</div>
|
|
31
46
|
</div>
|
|
32
|
-
<div className="guests-filter-inner">
|
|
33
|
-
<span
|
|
47
|
+
<div className="will-guests-filter-inner">
|
|
48
|
+
<span className="will-guests-filter-label">
|
|
49
|
+
{t('guests.kidsLabel')}
|
|
50
|
+
</span>
|
|
34
51
|
<div>
|
|
35
|
-
<button
|
|
52
|
+
<button
|
|
53
|
+
className="will-guests-filter-button"
|
|
54
|
+
onClick={decrementKids}
|
|
55
|
+
disabled={guestsKids < 1}
|
|
56
|
+
style={{
|
|
57
|
+
cursor: guestsKids < 1 ? 'initial' : 'pointer',
|
|
58
|
+
paddingBottom: '4px',
|
|
59
|
+
}}
|
|
60
|
+
>
|
|
36
61
|
-
|
|
37
62
|
</button>
|
|
38
|
-
<span>{guestsKids}</span>
|
|
39
|
-
<button
|
|
63
|
+
<span className="will-guests-filter-count">{guestsKids}</span>
|
|
64
|
+
<button
|
|
65
|
+
className="will-guests-filter-button"
|
|
66
|
+
onClick={incrementKids}
|
|
67
|
+
>
|
|
68
|
+
+
|
|
69
|
+
</button>
|
|
40
70
|
</div>
|
|
41
71
|
</div>
|
|
42
72
|
</div>
|
|
@@ -2,9 +2,13 @@ import React from 'react'
|
|
|
2
2
|
|
|
3
3
|
import './SelectButton.css'
|
|
4
4
|
|
|
5
|
-
export default function SelectButton({ label, onClick }: any) {
|
|
5
|
+
export default function SelectButton({ label, onClick, style }: any) {
|
|
6
6
|
return (
|
|
7
|
-
<button
|
|
7
|
+
<button
|
|
8
|
+
className="will-filter-bar-select-button"
|
|
9
|
+
onClick={onClick}
|
|
10
|
+
style={style}
|
|
11
|
+
>
|
|
8
12
|
{label}
|
|
9
13
|
</button>
|
|
10
14
|
)
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
.filter-bar-submit-button {
|
|
1
|
+
.will-filter-bar-submit-button {
|
|
2
2
|
width: auto;
|
|
3
3
|
height: auto;
|
|
4
|
-
background-color:
|
|
5
|
-
color:
|
|
4
|
+
background-color: var(--will-primary);
|
|
5
|
+
color: var(--will-white);
|
|
6
6
|
padding: 10px 20px;
|
|
7
7
|
border-radius: 20px;
|
|
8
8
|
cursor: pointer;
|
|
9
9
|
border: none;
|
|
10
10
|
white-space: nowrap;
|
|
11
|
+
text-transform: uppercase;
|
|
12
|
+
font-size: 12px;
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.will-filter-bar-submit-button span {
|
|
18
|
+
margin-right: 10px;
|
|
11
19
|
}
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
+
import { useTranslation } from 'react-i18next'
|
|
3
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
4
|
+
import { faSearch } from '@fortawesome/free-solid-svg-icons'
|
|
2
5
|
|
|
3
6
|
import './SubmitButton.css'
|
|
4
7
|
|
|
5
8
|
export default function SubmitButton({ onClick }: any) {
|
|
9
|
+
const { t } = useTranslation('filterBar')
|
|
10
|
+
|
|
6
11
|
return (
|
|
7
|
-
<button className="filter-bar-submit-button" onClick={onClick}>
|
|
8
|
-
|
|
12
|
+
<button className="will-filter-bar-submit-button" onClick={onClick}>
|
|
13
|
+
<span>
|
|
14
|
+
<FontAwesomeIcon icon={faSearch} />
|
|
15
|
+
</span>
|
|
16
|
+
{t('submit.label')}
|
|
9
17
|
</button>
|
|
10
18
|
)
|
|
11
19
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"calendar": {
|
|
3
3
|
"startDate": "Start date",
|
|
4
|
-
"endDate": "End date"
|
|
4
|
+
"endDate": "End date",
|
|
5
|
+
"title": "Calendar"
|
|
5
6
|
},
|
|
6
7
|
"guests": {
|
|
7
8
|
"label": "Guests",
|
|
@@ -13,5 +14,8 @@
|
|
|
13
14
|
"categories": {
|
|
14
15
|
"label": "Categories",
|
|
15
16
|
"title": "Category"
|
|
17
|
+
},
|
|
18
|
+
"submit": {
|
|
19
|
+
"label": "Search"
|
|
16
20
|
}
|
|
17
21
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"calendar": {
|
|
3
3
|
"startDate": "Aloitus päivämäärä",
|
|
4
|
-
"endDate": "Päättymis päivämäärä"
|
|
4
|
+
"endDate": "Päättymis päivämäärä",
|
|
5
|
+
"title": "Kalenteri"
|
|
5
6
|
},
|
|
6
7
|
"guests": {
|
|
7
8
|
"label": "Vieraat",
|
|
@@ -13,5 +14,8 @@
|
|
|
13
14
|
"categories": {
|
|
14
15
|
"label": "Kategoriat",
|
|
15
16
|
"title": "Kategoria"
|
|
17
|
+
},
|
|
18
|
+
"submit": {
|
|
19
|
+
"label": "Hae"
|
|
16
20
|
}
|
|
17
21
|
}
|