@abcagency/hc-ui-components 1.0.4 → 1.0.6
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/dist/globals.css +1 -1
- package/dist/index.js +237 -376
- package/package.json +37 -38
- package/rollup.config.js +3 -1
- package/src/components/layout/footer.js +7 -7
- package/src/components/layout/layout.js +1 -1
- package/src/components/modules/accordions/MapAccordionItem.js +69 -69
- package/src/components/modules/accordions/default.js +8 -8
- package/src/components/modules/accordions/filterItem.js +53 -53
- package/src/components/modules/accordions/filters.js +44 -44
- package/src/components/modules/animations/slidein.js +1 -1
- package/src/components/modules/buttons/button-group-apply.js +85 -85
- package/src/components/modules/buttons/commute-pill.js +21 -21
- package/src/components/modules/buttons/default.js +16 -16
- package/src/components/modules/buttons/items-pill.js +2 -2
- package/src/components/modules/buttons/pill-wrapper.js +1 -1
- package/src/components/modules/buttons/show-all-button.js +20 -20
- package/src/components/modules/cards/default.js +8 -8
- package/src/components/modules/cards/filter.js +5 -5
- package/src/components/modules/dialogs/apply-dialog.js +47 -47
- package/src/components/modules/filter/commute.js +151 -149
- package/src/components/modules/filter/index.js +86 -86
- package/src/components/modules/filter/item.js +77 -77
- package/src/components/modules/filter/location.js +13 -13
- package/src/components/modules/filter/points-of-interest.js +6 -6
- package/src/components/modules/filter/radio-item.js +51 -51
- package/src/components/modules/filter/search.js +91 -89
- package/src/components/modules/filter/sort.js +83 -83
- package/src/components/modules/grid.js +17 -36
- package/src/components/modules/icon.js +33 -33
- package/src/components/modules/jobListing/listing-details.js +88 -88
- package/src/components/modules/maps/info-window-card.js +17 -17
- package/src/components/modules/maps/info-window-content.js +60 -60
- package/src/components/modules/maps/list/field-mapper.js +111 -113
- package/src/components/modules/maps/list/header-item.js +90 -90
- package/src/components/modules/maps/list/header.js +46 -46
- package/src/components/modules/maps/list/index.js +104 -104
- package/src/components/modules/maps/list/item-expand-card/index.js +1 -1
- package/src/components/modules/maps/list/item-expand-card/recruiter-contact-nav.js +3 -3
- package/src/components/modules/maps/list/item-expand-card/recruiter-details.js +4 -4
- package/src/components/modules/maps/list/list-item/index.js +133 -133
- package/src/components/modules/maps/map-list.js +73 -73
- package/src/components/modules/maps/map.js +26 -25
- package/src/components/modules/maps/tabs.js +79 -79
- package/src/components/modules/navigation/nav-link.js +2 -2
- package/src/components/modules/navigation/navbar.js +21 -24
- package/src/components/modules/navigation/skip-link.js +1 -1
- package/src/components/modules/navigation/social.js +3 -3
- package/src/components/modules/sections/default.js +2 -2
- package/src/contexts/mapListContext.js +19 -18
- package/src/index.js +103 -116
- package/src/styles/globals.css +23 -25
- package/src/tailwind/tailwind.config.js +6 -5
- package/src/util/fieldMapper.js +1 -1
- package/src/util/loading.js +2 -2
- package/src/components/modules/filter/search.js.rej +0 -9
- package/src/components/modules/form.js +0 -362
- package/src/components/modules/jumbotron.js +0 -81
- package/src/components/modules/video-player.js +0 -126
package/src/styles/globals.css
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
@tailwind
|
|
3
|
-
@tailwind
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
@
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
height:fit-content;
|
|
25
|
-
} */
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
|
5
|
+
/* @layer base {
|
|
6
|
+
html {
|
|
7
|
+
@apply text-400 text-uiText [scroll-behavior:smooth];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@layer components {
|
|
12
|
+
.track * {
|
|
13
|
+
@apply pointer-events-none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.hc-stretched-link::after {
|
|
17
|
+
@apply content-[''] absolute inset-0 z-[1] pointer-events-auto bg-transparent;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.hc-fit-content{
|
|
22
|
+
height:fit-content;
|
|
23
|
+
} */
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
const defaultTheme = require("tailwindcss/defaultTheme");
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
prefix: "hc-",
|
|
5
|
+
content: [
|
|
6
|
+
'../**/*.{js,ts,jsx,tsx,mdx}',
|
|
7
|
+
'../components/**/*.{js,ts,jsx,tsx,mdx}',
|
|
8
|
+
],
|
|
9
|
+
presets: [require(`./preset.default.js`)],
|
|
9
10
|
theme: {
|
|
10
11
|
extend: {
|
|
11
12
|
animation: {
|
package/src/util/fieldMapper.js
CHANGED
package/src/util/loading.js
CHANGED
|
@@ -3,10 +3,10 @@ import React from 'react'
|
|
|
3
3
|
|
|
4
4
|
const Loading = ({ color = '#c0c0c0' }) => {
|
|
5
5
|
return (
|
|
6
|
-
<div className="flex items-center justify-center w-full h-full">
|
|
6
|
+
<div className="hc-flex hc-items-center hc-justify-center hc-w-full hc-h-full">
|
|
7
7
|
<Icon
|
|
8
8
|
icon="ph:spinner"
|
|
9
|
-
className="animate-spin text-gray-300"
|
|
9
|
+
className="hc-animate-spin hc-text-gray-300"
|
|
10
10
|
width="40"
|
|
11
11
|
height="40"
|
|
12
12
|
/>
|
|
@@ -1,362 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { useForm, Controller } from 'react-hook-form';
|
|
3
|
-
import { yupResolver } from '@hookform/resolvers/yup';
|
|
4
|
-
import Slider from 'react-slider';
|
|
5
|
-
import * as Yup from 'yup';
|
|
6
|
-
|
|
7
|
-
let validationSchema = Yup.object().shape({
|
|
8
|
-
name: Yup.string()
|
|
9
|
-
.required("is required"),
|
|
10
|
-
email: Yup.string()
|
|
11
|
-
.email("Invalid email address format")
|
|
12
|
-
.required("is required"),
|
|
13
|
-
message: Yup.string()
|
|
14
|
-
.required("is required"),
|
|
15
|
-
transportation: Yup.array()
|
|
16
|
-
.min(1, "Select a transportation type"),
|
|
17
|
-
state: Yup.string()
|
|
18
|
-
.required("is required"),
|
|
19
|
-
distance: Yup.number()
|
|
20
|
-
.min(1, "is required")
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const ContactForm = () => {
|
|
24
|
-
const {
|
|
25
|
-
register,
|
|
26
|
-
handleSubmit,
|
|
27
|
-
setValue,
|
|
28
|
-
control,
|
|
29
|
-
trigger,
|
|
30
|
-
reset,
|
|
31
|
-
formState:{ errors }
|
|
32
|
-
} = useForm({
|
|
33
|
-
mode: 'onBlur',
|
|
34
|
-
defaultValues: {
|
|
35
|
-
name: '',
|
|
36
|
-
email: '',
|
|
37
|
-
message: '',
|
|
38
|
-
transportation: [],
|
|
39
|
-
favoriteColor: 'pink',
|
|
40
|
-
state: '',
|
|
41
|
-
distance: 0
|
|
42
|
-
},
|
|
43
|
-
resolver: yupResolver(validationSchema)
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
47
|
-
|
|
48
|
-
const onSubmit = values => {
|
|
49
|
-
setIsSubmitting(true);
|
|
50
|
-
setTimeout(() => {
|
|
51
|
-
alert(JSON.stringify(values, null, 2));
|
|
52
|
-
reset();
|
|
53
|
-
setIsSubmitting(false);
|
|
54
|
-
}, 1000);
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const transportationOptions = ['Car', 'Boat', 'Plane'];
|
|
58
|
-
const favoriteColorOptions = ['blue', 'green', 'pink', 'red', 'yellow'];
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<form
|
|
62
|
-
onSubmit={handleSubmit(onSubmit)}
|
|
63
|
-
>
|
|
64
|
-
<div className="sm:grid grid-cols-2 gap-4">
|
|
65
|
-
<div className="mb-6">
|
|
66
|
-
<label
|
|
67
|
-
className="inline-block mb-2 text-xs font-bold uppercase"
|
|
68
|
-
htmlFor="name"
|
|
69
|
-
>
|
|
70
|
-
Name
|
|
71
|
-
</label>
|
|
72
|
-
|
|
73
|
-
{errors.name &&
|
|
74
|
-
<span
|
|
75
|
-
id="name-error"
|
|
76
|
-
name="name"
|
|
77
|
-
className="inline-block text-red-500 uppercase text-xs font-bold ml-1"
|
|
78
|
-
>
|
|
79
|
-
{errors.name?.message}
|
|
80
|
-
</span>
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
<input
|
|
84
|
-
{...register("name")}
|
|
85
|
-
type="text"
|
|
86
|
-
name="name"
|
|
87
|
-
placeholder="First and Last Name"
|
|
88
|
-
className={`w-full rounded-md transition-colors ${
|
|
89
|
-
errors.name ? "border-red-500" : "border-gray-800"
|
|
90
|
-
}`}
|
|
91
|
-
aria-invalid={errors.name ? 'true' : null}
|
|
92
|
-
aria-describedby={errors.name ? 'name-error' : null}
|
|
93
|
-
aria-required="true"
|
|
94
|
-
disabled={isSubmitting}
|
|
95
|
-
/>
|
|
96
|
-
</div>
|
|
97
|
-
|
|
98
|
-
<div className="mb-6">
|
|
99
|
-
<label
|
|
100
|
-
className="inline-block mb-2 text-xs font-bold uppercase"
|
|
101
|
-
htmlFor="email"
|
|
102
|
-
>
|
|
103
|
-
Email
|
|
104
|
-
</label>
|
|
105
|
-
|
|
106
|
-
{errors.email &&
|
|
107
|
-
<span
|
|
108
|
-
id="email-error"
|
|
109
|
-
name="email"
|
|
110
|
-
className="inline-block text-red-500 uppercase text-xs font-bold ml-1"
|
|
111
|
-
>
|
|
112
|
-
{errors.email?.message}
|
|
113
|
-
</span>
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
<input
|
|
117
|
-
{...register("email")}
|
|
118
|
-
type="email"
|
|
119
|
-
name="email"
|
|
120
|
-
placeholder="user@domain.com"
|
|
121
|
-
className={`w-full rounded-md transition-colors ${
|
|
122
|
-
errors.email ? "border-red-500" : "border-gray-800"
|
|
123
|
-
}`}
|
|
124
|
-
aria-invalid={errors.email ? 'true' : null}
|
|
125
|
-
aria-describedby={errors.email? 'email-error' : null}
|
|
126
|
-
aria-required="true"
|
|
127
|
-
disabled={isSubmitting}
|
|
128
|
-
/>
|
|
129
|
-
</div>
|
|
130
|
-
</div>
|
|
131
|
-
|
|
132
|
-
<div className="grid grid-cols-2 gap-4">
|
|
133
|
-
<div className="mb-6">
|
|
134
|
-
<h2 id="transportation-group-title" className="inline-block text-xs uppercase font-bold mb-2">Transportation</h2>
|
|
135
|
-
|
|
136
|
-
{errors.transportation &&
|
|
137
|
-
<span
|
|
138
|
-
id="transportation-error"
|
|
139
|
-
name="email"
|
|
140
|
-
className="inline-block text-red-500 uppercase text-xs font-bold ml-1"
|
|
141
|
-
>
|
|
142
|
-
{errors.transportation?.message}
|
|
143
|
-
</span>
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
<div role="group" aria-labelledby="transportation-group-title" className="flex flex-col items-start">
|
|
147
|
-
{transportationOptions.map(value => (
|
|
148
|
-
<label
|
|
149
|
-
key={value}
|
|
150
|
-
className="inline-flex items-center mb-3"
|
|
151
|
-
>
|
|
152
|
-
<input
|
|
153
|
-
{...register(`transportation`)}
|
|
154
|
-
id={`transportation${value}`}
|
|
155
|
-
value={value}
|
|
156
|
-
type="checkbox"
|
|
157
|
-
className="rounded h-5 w-5 text-indigo-700 border-gray-800 transition-colors"
|
|
158
|
-
/>
|
|
159
|
-
<span className="ml-2">{value}</span>
|
|
160
|
-
</label>
|
|
161
|
-
))}
|
|
162
|
-
</div>
|
|
163
|
-
</div>
|
|
164
|
-
|
|
165
|
-
<div className="mb-6">
|
|
166
|
-
<h2 id="favorite-color-group-title" className="inline-block text-xs uppercase font-bold mb-2">Favorite color</h2>
|
|
167
|
-
|
|
168
|
-
<div role="group" aria-labelledby="favorite-color-group-title" className="flex flex-col items-start">
|
|
169
|
-
{favoriteColorOptions.map(value => (
|
|
170
|
-
<label
|
|
171
|
-
key={value}
|
|
172
|
-
className="inline-flex items-center mb-3"
|
|
173
|
-
>
|
|
174
|
-
<input
|
|
175
|
-
{...register(`favoriteColor`)}
|
|
176
|
-
id={`favoriteColor${value}`}
|
|
177
|
-
value={value}
|
|
178
|
-
type="radio"
|
|
179
|
-
name="favoriteColor"
|
|
180
|
-
className="rounded-full h-5 w-5 text-indigo-700 border-gray-800 transition-colors"
|
|
181
|
-
/>
|
|
182
|
-
<span className="ml-2 capitalize">{value}</span>
|
|
183
|
-
</label>
|
|
184
|
-
))}
|
|
185
|
-
</div>
|
|
186
|
-
</div>
|
|
187
|
-
</div>
|
|
188
|
-
|
|
189
|
-
<div className="grid grid-cols-2 gap-4">
|
|
190
|
-
<div className="mb-6">
|
|
191
|
-
<label
|
|
192
|
-
className="inline-block mb-2 text-xs font-bold uppercase"
|
|
193
|
-
htmlFor="state"
|
|
194
|
-
>
|
|
195
|
-
State
|
|
196
|
-
</label>
|
|
197
|
-
|
|
198
|
-
{errors.state &&
|
|
199
|
-
<span
|
|
200
|
-
id="state-error"
|
|
201
|
-
name="state"
|
|
202
|
-
className="inline-block text-red-500 uppercase text-xs font-bold ml-1"
|
|
203
|
-
>
|
|
204
|
-
{errors.state?.message}
|
|
205
|
-
</span>
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
<select
|
|
209
|
-
{...register(`state`)}
|
|
210
|
-
className={`w-full rounded-md transition-colors ${
|
|
211
|
-
errors.state ? "border-red-500" : "border-gray-800"
|
|
212
|
-
}`}
|
|
213
|
-
aria-invalid={errors.state ? 'true' : null}
|
|
214
|
-
aria-describedby={errors.state ? 'state-error' : null}
|
|
215
|
-
aria-required="true"
|
|
216
|
-
disabled={isSubmitting}
|
|
217
|
-
>
|
|
218
|
-
<option value="">Select a state</option>
|
|
219
|
-
<option value="AL">Alabama</option>
|
|
220
|
-
<option value="AK">Alaska</option>
|
|
221
|
-
<option value="AZ">Arizona</option>
|
|
222
|
-
<option value="AR">Arkansas</option>
|
|
223
|
-
<option value="CA">California</option>
|
|
224
|
-
<option value="CO">Colorado</option>
|
|
225
|
-
<option value="CT">Connecticut</option>
|
|
226
|
-
<option value="DE">Delaware</option>
|
|
227
|
-
<option value="DC">District Of Columbia</option>
|
|
228
|
-
<option value="FL">Florida</option>
|
|
229
|
-
<option value="GA">Georgia</option>
|
|
230
|
-
<option value="HI">Hawaii</option>
|
|
231
|
-
<option value="ID">Idaho</option>
|
|
232
|
-
<option value="IL">Illinois</option>
|
|
233
|
-
<option value="IN">Indiana</option>
|
|
234
|
-
<option value="IA">Iowa</option>
|
|
235
|
-
<option value="KS">Kansas</option>
|
|
236
|
-
<option value="KY">Kentucky</option>
|
|
237
|
-
<option value="LA">Louisiana</option>
|
|
238
|
-
<option value="ME">Maine</option>
|
|
239
|
-
<option value="MD">Maryland</option>
|
|
240
|
-
<option value="MA">Massachusetts</option>
|
|
241
|
-
<option value="MI">Michigan</option>
|
|
242
|
-
<option value="MN">Minnesota</option>
|
|
243
|
-
<option value="MS">Mississippi</option>
|
|
244
|
-
<option value="MO">Missouri</option>
|
|
245
|
-
<option value="MT">Montana</option>
|
|
246
|
-
<option value="NE">Nebraska</option>
|
|
247
|
-
<option value="NV">Nevada</option>
|
|
248
|
-
<option value="NH">New Hampshire</option>
|
|
249
|
-
<option value="NJ">New Jersey</option>
|
|
250
|
-
<option value="NM">New Mexico</option>
|
|
251
|
-
<option value="NY">New York</option>
|
|
252
|
-
<option value="NC">North Carolina</option>
|
|
253
|
-
<option value="ND">North Dakota</option>
|
|
254
|
-
<option value="OH">Ohio</option>
|
|
255
|
-
<option value="OK">Oklahoma</option>
|
|
256
|
-
<option value="OR">Oregon</option>
|
|
257
|
-
<option value="PA">Pennsylvania</option>
|
|
258
|
-
<option value="RI">Rhode Island</option>
|
|
259
|
-
<option value="SC">South Carolina</option>
|
|
260
|
-
<option value="SD">South Dakota</option>
|
|
261
|
-
<option value="TN">Tennessee</option>
|
|
262
|
-
<option value="TX">Texas</option>
|
|
263
|
-
<option value="UT">Utah</option>
|
|
264
|
-
<option value="VT">Vermont</option>
|
|
265
|
-
<option value="VA">Virginia</option>
|
|
266
|
-
<option value="WA">Washington</option>
|
|
267
|
-
<option value="WV">West Virginia</option>
|
|
268
|
-
<option value="WI">Wisconsin</option>
|
|
269
|
-
<option value="WY">Wyoming</option>
|
|
270
|
-
</select>
|
|
271
|
-
</div>
|
|
272
|
-
<div className="mb-6 overflow-hidden">
|
|
273
|
-
<label
|
|
274
|
-
className="inline-block mb-2 text-xs font-bold uppercase"
|
|
275
|
-
htmlFor="distance"
|
|
276
|
-
>
|
|
277
|
-
Distance
|
|
278
|
-
</label>
|
|
279
|
-
|
|
280
|
-
{errors.distance &&
|
|
281
|
-
<span
|
|
282
|
-
id="distance-error"
|
|
283
|
-
name="distance"
|
|
284
|
-
className="inline-block text-red-500 uppercase text-xs font-bold ml-1"
|
|
285
|
-
>
|
|
286
|
-
{errors.distance?.message}
|
|
287
|
-
</span>
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
<Controller
|
|
291
|
-
name="distance"
|
|
292
|
-
control={control}
|
|
293
|
-
render={({ field }) =>
|
|
294
|
-
<>
|
|
295
|
-
<input
|
|
296
|
-
{...field}
|
|
297
|
-
type="hidden"
|
|
298
|
-
aria-invalid={errors.distance ? 'true' : null}
|
|
299
|
-
aria-describedby={errors.distance ? 'distance-error' : null}
|
|
300
|
-
aria-required="true"
|
|
301
|
-
/>
|
|
302
|
-
|
|
303
|
-
<Slider
|
|
304
|
-
max={99}
|
|
305
|
-
className="py-4"
|
|
306
|
-
thumbClassName={`p-2 w-10 rounded-full bg-gray-100 text-gray-700 transform -translate-y-1/3 text-center outline-none cursor-grab focus:bg-indigo-700 focus:text-white transition-colors ${errors.distance && "!text-red-500"}`}
|
|
307
|
-
trackClassName="bg-gray-300 h-3 rounded-md transition-colors"
|
|
308
|
-
renderThumb={(props, state) => <div {...props}>{state.valueNow}</div>}
|
|
309
|
-
onChange={v => setValue('distance', v)}
|
|
310
|
-
onAfterChange={() => trigger('distance')}
|
|
311
|
-
/>
|
|
312
|
-
</>
|
|
313
|
-
}
|
|
314
|
-
/>
|
|
315
|
-
</div>
|
|
316
|
-
</div>
|
|
317
|
-
|
|
318
|
-
<div className="mb-6">
|
|
319
|
-
<label
|
|
320
|
-
className="inline-block mb-2 text-xs font-bold uppercase"
|
|
321
|
-
htmlFor="message"
|
|
322
|
-
>
|
|
323
|
-
Message
|
|
324
|
-
</label>
|
|
325
|
-
|
|
326
|
-
{errors.message &&
|
|
327
|
-
<span
|
|
328
|
-
id="message-error"
|
|
329
|
-
name="message"
|
|
330
|
-
className="inline-block text-red-500 uppercase text-xs font-bold ml-1"
|
|
331
|
-
>
|
|
332
|
-
{errors.message?.message}
|
|
333
|
-
</span>
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
<textarea
|
|
337
|
-
{...register(`message`)}
|
|
338
|
-
id="message"
|
|
339
|
-
placeholder="Say something..."
|
|
340
|
-
rows="8"
|
|
341
|
-
className={`w-full rounded-md transition-colors ${
|
|
342
|
-
errors.message ? "border-red-500" : "border-gray-800"
|
|
343
|
-
}`}
|
|
344
|
-
aria-invalid={errors.message ? 'true' : null}
|
|
345
|
-
aria-describedby={errors.message ? 'state-error' : null}
|
|
346
|
-
aria-required="true"
|
|
347
|
-
disabled={isSubmitting}
|
|
348
|
-
/>
|
|
349
|
-
</div>
|
|
350
|
-
|
|
351
|
-
<button
|
|
352
|
-
type="submit"
|
|
353
|
-
className="px-4 py-2 text-sm font-bold text-white bg-gray-700 border-b-4 border-gray-800 rounded hover:border-gray-700 hover:bg-gray-600 transfrom disabled:bg-gray-200 disabled:text-gray-400 transition-colors"
|
|
354
|
-
disabled={isSubmitting}
|
|
355
|
-
>
|
|
356
|
-
{isSubmitting ? "Please wait..." : "Submit"}
|
|
357
|
-
</button>
|
|
358
|
-
</form>
|
|
359
|
-
);
|
|
360
|
-
};
|
|
361
|
-
|
|
362
|
-
export default ContactForm;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { twMerge } from 'tailwind-merge';
|
|
2
|
-
import React from 'react'
|
|
3
|
-
|
|
4
|
-
const Jumbotron = ({
|
|
5
|
-
className,
|
|
6
|
-
contentClasses,
|
|
7
|
-
image,
|
|
8
|
-
children,
|
|
9
|
-
...rest
|
|
10
|
-
}) => {
|
|
11
|
-
return (
|
|
12
|
-
<section
|
|
13
|
-
className={twMerge(
|
|
14
|
-
'relative grid grid-cols-1 auto-rows-min md:grid-rows-1 overflow-hidden bg-gray-800 text-white',
|
|
15
|
-
className ?? ''
|
|
16
|
-
)}
|
|
17
|
-
{...rest}
|
|
18
|
-
>
|
|
19
|
-
<div
|
|
20
|
-
className={twMerge(
|
|
21
|
-
'md:row-span-full col-span-full grid place-content-center relative z-10 container p-4',
|
|
22
|
-
contentClasses ?? ''
|
|
23
|
-
)}
|
|
24
|
-
>
|
|
25
|
-
{children}
|
|
26
|
-
</div>
|
|
27
|
-
|
|
28
|
-
{image && image}
|
|
29
|
-
</section>
|
|
30
|
-
);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const JumbotronTitle = ({
|
|
34
|
-
className,
|
|
35
|
-
children
|
|
36
|
-
}) => {
|
|
37
|
-
return (
|
|
38
|
-
<h1
|
|
39
|
-
className={twMerge(
|
|
40
|
-
'text-3xl font-bold',
|
|
41
|
-
className ?? ''
|
|
42
|
-
)}
|
|
43
|
-
>
|
|
44
|
-
{children}
|
|
45
|
-
</h1>
|
|
46
|
-
);
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export const JumbotronImage = ({
|
|
50
|
-
image,
|
|
51
|
-
alt,
|
|
52
|
-
className,
|
|
53
|
-
containerClassName,
|
|
54
|
-
...rest
|
|
55
|
-
}) => {
|
|
56
|
-
return (
|
|
57
|
-
<div
|
|
58
|
-
className={twMerge(
|
|
59
|
-
'relative order-first md:order-last row-span-full col-span-full',
|
|
60
|
-
containerClassName ?? ''
|
|
61
|
-
)}
|
|
62
|
-
>
|
|
63
|
-
<img
|
|
64
|
-
src={image || image.src}
|
|
65
|
-
width={image.width ? image.width : null}
|
|
66
|
-
height={image.height ? image.height : null}
|
|
67
|
-
alt={alt ?? ''}
|
|
68
|
-
className={twMerge(
|
|
69
|
-
'md:col-start-1 h-full w-full object-cover object-center opacity-70 md:opacity-20',
|
|
70
|
-
className ?? ''
|
|
71
|
-
)}
|
|
72
|
-
{...rest}
|
|
73
|
-
/>
|
|
74
|
-
</div>
|
|
75
|
-
);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
Jumbotron.Title = JumbotronTitle;
|
|
79
|
-
Jumbotron.Image = JumbotronImage;
|
|
80
|
-
|
|
81
|
-
export default Jumbotron;
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import React, { useRef, useState, useEffect } from 'react';
|
|
2
|
-
import ReactPlayer from 'react-player/lazy';
|
|
3
|
-
|
|
4
|
-
import Icon from '~/components/modules/icon';
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
Responsive video player using react-player
|
|
8
|
-
@url: https://github.com/CookPete/react-player
|
|
9
|
-
|
|
10
|
-
@url: Video file URL
|
|
11
|
-
@placeholder: Video poster image
|
|
12
|
-
@playerOptions: Use to pass in any extra options to react-player
|
|
13
|
-
@containerClasses: Pass extra classes to the container element
|
|
14
|
-
@aspectRatio: Set player aspect ratio (Default: 16x9)
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
const isBrowser = typeof window !== 'undefined';
|
|
18
|
-
|
|
19
|
-
const VideoPlayer = ({
|
|
20
|
-
url,
|
|
21
|
-
imageAlt,
|
|
22
|
-
placeholder,
|
|
23
|
-
className,
|
|
24
|
-
containerClassName,
|
|
25
|
-
aspectRatio,
|
|
26
|
-
playOnLoad = false,
|
|
27
|
-
muted = false,
|
|
28
|
-
autoPlay = true,
|
|
29
|
-
...playerOptions
|
|
30
|
-
}) => {
|
|
31
|
-
const [lightMode, setLightMode] = useState(placeholder);
|
|
32
|
-
const [isReady, setIsReady] = useState(false);
|
|
33
|
-
const [isPlaying, setIsPlaying] = useState(autoPlay);
|
|
34
|
-
const [played, setPlayed] = useState(0);
|
|
35
|
-
const [seekTo, setSeekTo] = useState(null);
|
|
36
|
-
const [pageLoaded, setPageLoaded] = useState(false);
|
|
37
|
-
const playerRef = useRef(null);
|
|
38
|
-
const divRef = useRef(null);
|
|
39
|
-
|
|
40
|
-
useEffect(() => {
|
|
41
|
-
if (isBrowser) {
|
|
42
|
-
setPageLoaded(true);
|
|
43
|
-
}
|
|
44
|
-
}, [autoPlay, setPageLoaded]);
|
|
45
|
-
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
if (isReady && seekTo) {
|
|
48
|
-
playerRef.current.seekTo(parseFloat(seekTo), 'seconds');
|
|
49
|
-
setIsPlaying(true);
|
|
50
|
-
if (isBrowser && divRef.current) {
|
|
51
|
-
divRef.current.scrollIntoView({
|
|
52
|
-
behavior: 'smooth',
|
|
53
|
-
block: 'center'
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
setSeekTo(null);
|
|
57
|
-
}
|
|
58
|
-
}, [isReady, seekTo]);
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<div
|
|
62
|
-
className={`${containerClassName ?? ''}`}
|
|
63
|
-
>
|
|
64
|
-
<div
|
|
65
|
-
ref={divRef}
|
|
66
|
-
className="block relative w-full overflow-hidden"
|
|
67
|
-
>
|
|
68
|
-
{/*
|
|
69
|
-
Inline switch to set player aspect ratio
|
|
70
|
-
@default: 16x9
|
|
71
|
-
@usage: aspectRatio="21x9"
|
|
72
|
-
*/}
|
|
73
|
-
{
|
|
74
|
-
{
|
|
75
|
-
'21x9': <span className="block pt-[42.86%]" aria-hidden="true"></span>,
|
|
76
|
-
'16x9': <span className="block pt-[56.25%]" aria-hidden="true"></span>,
|
|
77
|
-
'4x3': <span className="block pt-[75%]" aria-hidden="true"></span>,
|
|
78
|
-
'1x1': <span className="block pt-[100%]" aria-hidden="true"></span>
|
|
79
|
-
}[aspectRatio]
|
|
80
|
-
|| <span className="block pt-[56.25%]" aria-hidden="true"></span>
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
{pageLoaded &&
|
|
84
|
-
<ReactPlayer
|
|
85
|
-
ref={playerRef}
|
|
86
|
-
className={`
|
|
87
|
-
absolute inset-y-0 left-0 w-full h-full border-0 my-0
|
|
88
|
-
${className ?? ''}
|
|
89
|
-
`}
|
|
90
|
-
url={url}
|
|
91
|
-
light={playOnLoad ? false : lightMode === false ? lightMode : placeholder}
|
|
92
|
-
progressInterval={3000}
|
|
93
|
-
// eslint-disable-next-line no-unused-vars
|
|
94
|
-
onProgress={(played, loaded) => {
|
|
95
|
-
setPlayed(played);
|
|
96
|
-
if (isBrowser) {
|
|
97
|
-
document.querySelectorAll('button:focus').forEach(el => el.blur());
|
|
98
|
-
}
|
|
99
|
-
}}
|
|
100
|
-
onReady={() => { setIsReady(true); setIsPlaying(autoPlay);}}
|
|
101
|
-
onPlay={() => setIsPlaying(true)}
|
|
102
|
-
onPause={() => setIsPlaying(false)}
|
|
103
|
-
playing={isPlaying}
|
|
104
|
-
autoPlay={autoPlay}
|
|
105
|
-
width="100%"
|
|
106
|
-
height="100%"
|
|
107
|
-
muted={muted}
|
|
108
|
-
playIcon={
|
|
109
|
-
<button className="bg-blue-400 bg-opacity-70 p-1 rounded-full transition-colors hover:bg-opacity-90 focus:bg-opacity-90">
|
|
110
|
-
<span className="sr-only">Play</span>
|
|
111
|
-
<Icon
|
|
112
|
-
icon="fe:play"
|
|
113
|
-
sizeClasses="w-16 h-16"
|
|
114
|
-
className="text-white drop-shadow-md translate-x-1"
|
|
115
|
-
/>
|
|
116
|
-
</button>
|
|
117
|
-
}
|
|
118
|
-
{...playerOptions}
|
|
119
|
-
/>
|
|
120
|
-
}
|
|
121
|
-
</div>
|
|
122
|
-
</div>
|
|
123
|
-
);
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
export default VideoPlayer;
|