@axos-web-dev/shared-components 1.0.100-dev.73-slow-msg-1 → 1.0.100-dev.74

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.
@@ -60,7 +60,7 @@ const ChatWindow = ({
60
60
  e.preventDefault();
61
61
  const cleaned = cleanInput(input);
62
62
  if (isBlockedInput) return;
63
- if (cleaned != "") {
63
+ if (cleaned) {
64
64
  if (!hasEscalated) {
65
65
  blockInput?.();
66
66
  }
@@ -100,6 +100,7 @@ const Chatbot = ({
100
100
  const onChatMessageHandler = async (message) => {
101
101
  console.log("Received message:", message);
102
102
  if (["system", "virtual_agent", "user"].includes(message.$userType) && message.event === void 0) {
103
+ console.log(message.$userType, "not end user");
103
104
  addMessage(message);
104
105
  if (!hasEscalated && isBlockedInput) {
105
106
  unblockInput?.();
@@ -120,9 +121,9 @@ const Chatbot = ({
120
121
  return;
121
122
  default:
122
123
  addMessage(message);
123
- unblockInput?.();
124
124
  if (["end_user"].includes(message.$userType)) {
125
125
  if (!hasEscalated) {
126
+ console.log(message.$userType, "end user");
126
127
  addMessage(typingMessage);
127
128
  }
128
129
  }
@@ -0,0 +1,25 @@
1
+ import { FormProps } from './FormProps';
2
+
3
+ export type BoatMooringLocationInputs = {
4
+ email: string;
5
+ firstName: string;
6
+ lastName: string;
7
+ boatName: string;
8
+ marinaAddress: string;
9
+ marinaAddress2: string;
10
+ city: string;
11
+ state: string;
12
+ zip: string;
13
+ country: string;
14
+ seasonallyMove: "Yes" | "No";
15
+ charter: "Yes" | "No";
16
+ extraMarinaAddress: string;
17
+ extraMarinaAddress2: string;
18
+ extraCity: string;
19
+ extraState: string;
20
+ extraZip: string;
21
+ extraCountry: string;
22
+ charterType: "Limited Charter" | "Full-time Charter";
23
+ charterCompany: string;
24
+ };
25
+ export declare const BoatMooringLocation: ({ icon, children, onSubmit, disclosure, variant: fullVariant, headline, callToAction, validateEmail, onValidate, description, id, }: FormProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,481 @@
1
+ "use client";
2
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
3
+ import { zodResolver } from "@hookform/resolvers/zod";
4
+ import { Button } from "../Button/Button.js";
5
+ import "../Button/Button.css.js";
6
+ import "react";
7
+ import "react-use";
8
+ import { Input } from "../Input/Input.js";
9
+ import { LoadingIndicator } from "../LoadingIndicator/index.js";
10
+ import "../icons/ArrowIcon/ArrowIcon.css.js";
11
+ import SvgAxosX from "../icons/AxosX/index.js";
12
+ import SvgComponent from "../icons/AxosX/Blue.js";
13
+ import "../icons/CheckIcon/CheckIcon.css.js";
14
+ import '../assets/icons/FollowIcon/FollowIcon.css';import '../assets/icons/DownloadIcon/DownloadIcon.css';import '../assets/themes/victorie.css';import '../assets/themes/ufb.css';import '../assets/themes/premier.css';import '../assets/themes/axos.css';/* empty css */
15
+ /* empty css */
16
+ /* empty css */
17
+ /* empty css */
18
+ /* empty css */
19
+ /* empty css */
20
+ import "../utils/allowedAxosDomains.js";
21
+ import * as z from "zod";
22
+ import { associatedEmail } from "../utils/EverestValidity.js";
23
+ import { getVariant } from "../utils/getVariant.js";
24
+ import { useCachedEmailValidator } from "../utils/useCachedValidators.js";
25
+ import clsx from "clsx";
26
+ import { useForm, FormProvider } from "react-hook-form";
27
+ import { iconForm, headerContainer, headerForm, form, descriptionField, fullRowForm, formWrapper, disclosureForm, actions, formContainer } from "./Forms.css.js";
28
+ import { honeyPotSchema, isValidHoneyPot, HoneyPot } from "./HoneyPot/index.js";
29
+ import "../Input/Checkbox.js";
30
+ import "../Input/CurrencyInput.js";
31
+ import "../Input/Dropdown.js";
32
+ import "../Input/Dropdown.css.js";
33
+ import "../Input/Input.css.js";
34
+ import "../Input/InputAmount.js";
35
+ import "../Input/InputPhone.js";
36
+ import "../Input/InputTextArea.js";
37
+ import "../Input/DownPaymentInput.js";
38
+ import { RadioButtonSet, RadioButton } from "../Input/RadioButton.js";
39
+ const BoatMooringLocation = ({
40
+ icon = false,
41
+ children,
42
+ onSubmit = (values) => {
43
+ console.log(values);
44
+ },
45
+ disclosure,
46
+ variant: fullVariant = "primary",
47
+ headline,
48
+ callToAction,
49
+ validateEmail,
50
+ onValidate,
51
+ description,
52
+ id
53
+ }) => {
54
+ const cachedEmailValidator = useCachedEmailValidator(validateEmail);
55
+ const schema = z.object({
56
+ email: z.string().email({ message: "Email is required." }).refine(cachedEmailValidator, { message: "Invalid email address." }),
57
+ firstName: z.string().regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g).trim().min(1, { message: "First Name is required." }),
58
+ lastName: z.string().regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g).trim().min(1, { message: "First Name is required." }),
59
+ boatName: z.string().trim(),
60
+ marinaAddress: z.string().trim(),
61
+ marinaAddress2: z.string().trim().optional().or(z.literal("")),
62
+ city: z.string().trim(),
63
+ state: z.string().trim(),
64
+ zip: z.string().regex(/^[0-9]*$/g, { message: "Invalid zip code" }).trim().max(5, { message: "Zip code is 5 digits maximum." }),
65
+ country: z.string().trim(),
66
+ seasonallyMove: z.string().trim().optional().or(z.literal("")),
67
+ charter: z.string().trim().optional().or(z.literal("")),
68
+ extraMarinaAddress: z.string().trim().optional().or(z.literal("")),
69
+ extraMarinaAddress2: z.string().trim().optional().or(z.literal("")),
70
+ extraCity: z.string().trim().optional().or(z.literal("")),
71
+ extraState: z.string().trim().optional().or(z.literal("")),
72
+ extraZip: z.string().trim().optional().or(z.literal("")),
73
+ extraCountry: z.string().trim().optional().or(z.literal("")),
74
+ charterType: z.string().trim().optional().or(z.literal("")),
75
+ charterCompany: z.string().trim().optional().or(z.literal(""))
76
+ });
77
+ const gen_schema = schema.merge(honeyPotSchema).superRefine((data, ctx) => {
78
+ if (!isValidHoneyPot(data)) {
79
+ ctx.addIssue({
80
+ code: z.ZodIssueCode.custom,
81
+ message: "fields are not valid."
82
+ });
83
+ }
84
+ });
85
+ const methods = useForm({
86
+ resolver: zodResolver(gen_schema, {
87
+ async: true
88
+ }),
89
+ mode: "all",
90
+ shouldUnregister: true,
91
+ defaultValues: {
92
+ email: ""
93
+ }
94
+ });
95
+ const {
96
+ handleSubmit,
97
+ register,
98
+ watch,
99
+ formState: { errors, isValid, isSubmitting }
100
+ } = methods;
101
+ const seasonMove = watch("seasonallyMove");
102
+ const isCharter = watch("charter");
103
+ const renderExtraFields = seasonMove === "Yes";
104
+ const renderCharterFields = isCharter === "Yes";
105
+ const submitForm = async (data) => {
106
+ await onSubmit(data);
107
+ };
108
+ const variant = getVariant(fullVariant);
109
+ return /* @__PURE__ */ jsx("section", { id, className: clsx(formContainer({ variant })), children: /* @__PURE__ */ jsx("div", { className: clsx("containment"), children: /* @__PURE__ */ jsxs(FormProvider, { ...methods, children: [
110
+ icon && /* @__PURE__ */ jsx("div", { className: clsx("text_center", iconForm), children: ["primary", "secondary"].includes(variant) ? /* @__PURE__ */ jsx(SvgComponent, {}) : /* @__PURE__ */ jsx(SvgAxosX, {}) }),
111
+ /* @__PURE__ */ jsxs("div", { className: `${headerContainer} text_center`, children: [
112
+ /* @__PURE__ */ jsx("h2", { className: clsx("header_2", headerForm({ variant })), children: headline }),
113
+ description && /* @__PURE__ */ jsx(
114
+ "div",
115
+ {
116
+ className: clsx(
117
+ "text_center",
118
+ form,
119
+ descriptionField({ variant })
120
+ ),
121
+ children: description
122
+ }
123
+ )
124
+ ] }),
125
+ /* @__PURE__ */ jsxs(
126
+ "form",
127
+ {
128
+ className: form,
129
+ onSubmit: async (e) => {
130
+ onValidate && onValidate(e);
131
+ await handleSubmit(submitForm)(e);
132
+ e.preventDefault();
133
+ },
134
+ children: [
135
+ /* @__PURE__ */ jsxs("div", { className: clsx(formWrapper({ variant })), children: [
136
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
137
+ Input,
138
+ {
139
+ id: "firstName",
140
+ ...register("firstName", {
141
+ required: true
142
+ }),
143
+ label: "First Name",
144
+ sizes: "medium",
145
+ required: true,
146
+ error: !!errors.email,
147
+ helperText: errors.firstName?.message,
148
+ variant
149
+ }
150
+ ) }),
151
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
152
+ Input,
153
+ {
154
+ id: "lastName",
155
+ ...register("lastName", {
156
+ required: true
157
+ }),
158
+ label: "Last Name",
159
+ sizes: "medium",
160
+ required: true,
161
+ error: !!errors.email,
162
+ helperText: errors.lastName?.message,
163
+ variant
164
+ }
165
+ ) }),
166
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
167
+ Input,
168
+ {
169
+ id: "email",
170
+ ...register("email", {
171
+ required: true,
172
+ validate: {
173
+ isValid: associatedEmail
174
+ }
175
+ }),
176
+ label: "Email Address",
177
+ sizes: "medium",
178
+ required: true,
179
+ error: !!errors.email,
180
+ helperText: errors.email?.message,
181
+ variant
182
+ }
183
+ ) }),
184
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
185
+ Input,
186
+ {
187
+ id: "boatName",
188
+ ...register("boatName", { required: true }),
189
+ label: "Boat Name",
190
+ sizes: "medium",
191
+ required: true,
192
+ helperText: errors.boatName?.message,
193
+ variant
194
+ }
195
+ ) }),
196
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
197
+ Input,
198
+ {
199
+ id: "marinaAddress",
200
+ ...register("marinaAddress", { required: true }),
201
+ label: "Marina Address",
202
+ sizes: "medium",
203
+ required: true,
204
+ helperText: errors.marinaAddress?.message,
205
+ variant
206
+ }
207
+ ) }),
208
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
209
+ Input,
210
+ {
211
+ id: "marinaAddress2",
212
+ label: "Alternate Marina Address (if applicable)",
213
+ sizes: "medium",
214
+ required: false,
215
+ helperText: errors.marinaAddress2?.message,
216
+ variant
217
+ }
218
+ ) }),
219
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
220
+ Input,
221
+ {
222
+ id: "city",
223
+ ...register("city", { required: true }),
224
+ label: "City",
225
+ sizes: "medium",
226
+ required: true,
227
+ helperText: errors.city?.message,
228
+ variant
229
+ }
230
+ ) }),
231
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
232
+ Input,
233
+ {
234
+ id: "state",
235
+ ...register("state", { required: true }),
236
+ label: "State",
237
+ sizes: "medium",
238
+ required: true,
239
+ helperText: errors.state?.message,
240
+ variant
241
+ }
242
+ ) }),
243
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
244
+ Input,
245
+ {
246
+ id: "zip",
247
+ ...register("zip", { required: true }),
248
+ label: "Zip Code",
249
+ sizes: "medium",
250
+ required: true,
251
+ helperText: errors.zip?.message,
252
+ variant
253
+ }
254
+ ) }),
255
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
256
+ Input,
257
+ {
258
+ id: "country",
259
+ ...register("country", { required: true }),
260
+ label: "Country",
261
+ sizes: "medium",
262
+ required: true,
263
+ helperText: errors.country?.message,
264
+ variant
265
+ }
266
+ ) }),
267
+ /* @__PURE__ */ jsx("div", { className: fullRowForm, children: /* @__PURE__ */ jsxs(
268
+ RadioButtonSet,
269
+ {
270
+ id: "seasonallyMove",
271
+ label: "Do you move your boat seasonally?",
272
+ sizes: "medium",
273
+ required: true,
274
+ error: !!errors.seasonallyMove,
275
+ helperText: errors.seasonallyMove?.message,
276
+ variant,
277
+ children: [
278
+ /* @__PURE__ */ jsx(
279
+ RadioButton,
280
+ {
281
+ ...register("seasonallyMove", {
282
+ required: true
283
+ }),
284
+ value: "Yes",
285
+ radioText: "Yes",
286
+ groupName: "seasonallyMove"
287
+ }
288
+ ),
289
+ /* @__PURE__ */ jsx(
290
+ RadioButton,
291
+ {
292
+ ...register("seasonallyMove", {
293
+ required: true
294
+ }),
295
+ value: "No",
296
+ radioText: "No",
297
+ groupName: "seasonallyMove"
298
+ }
299
+ )
300
+ ]
301
+ }
302
+ ) }),
303
+ renderExtraFields && /* @__PURE__ */ jsxs(Fragment, { children: [
304
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
305
+ Input,
306
+ {
307
+ id: "extraMarinaAddress",
308
+ ...register("extraMarinaAddress"),
309
+ label: "Marina Address",
310
+ sizes: "medium",
311
+ required: false,
312
+ helperText: errors.extraMarinaAddress?.message,
313
+ variant
314
+ }
315
+ ) }),
316
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
317
+ Input,
318
+ {
319
+ id: "extraMarinaAddress2",
320
+ label: "Alternate Marina Address (if applicable)",
321
+ sizes: "medium",
322
+ required: false,
323
+ helperText: errors.extraMarinaAddress2?.message,
324
+ variant
325
+ }
326
+ ) }),
327
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
328
+ Input,
329
+ {
330
+ id: "extraCity",
331
+ ...register("extraCity"),
332
+ label: "City",
333
+ sizes: "medium",
334
+ required: false,
335
+ helperText: errors.extraCity?.message,
336
+ variant
337
+ }
338
+ ) }),
339
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
340
+ Input,
341
+ {
342
+ id: "extraState",
343
+ ...register("extraState"),
344
+ label: "State",
345
+ sizes: "medium",
346
+ required: false,
347
+ helperText: errors.extraState?.message,
348
+ variant
349
+ }
350
+ ) }),
351
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
352
+ Input,
353
+ {
354
+ id: "extraZip",
355
+ ...register("extraZip"),
356
+ label: "Zip Code",
357
+ sizes: "medium",
358
+ required: false,
359
+ helperText: errors.extraZip?.message,
360
+ variant
361
+ }
362
+ ) }),
363
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
364
+ Input,
365
+ {
366
+ id: "extraCountry",
367
+ ...register("extraCountry"),
368
+ label: "Country",
369
+ sizes: "medium",
370
+ required: false,
371
+ helperText: errors.extraCountry?.message,
372
+ variant
373
+ }
374
+ ) })
375
+ ] }),
376
+ /* @__PURE__ */ jsx("div", { className: fullRowForm, children: /* @__PURE__ */ jsxs(
377
+ RadioButtonSet,
378
+ {
379
+ id: "charter",
380
+ label: "Is your boat a charter?",
381
+ sizes: "medium",
382
+ required: true,
383
+ error: !!errors.charter,
384
+ helperText: errors.charter?.message,
385
+ variant,
386
+ children: [
387
+ /* @__PURE__ */ jsx(
388
+ RadioButton,
389
+ {
390
+ ...register("charter"),
391
+ value: "Yes",
392
+ radioText: "Yes",
393
+ groupName: "charter"
394
+ }
395
+ ),
396
+ /* @__PURE__ */ jsx(
397
+ RadioButton,
398
+ {
399
+ ...register("charter"),
400
+ value: "No",
401
+ radioText: "No",
402
+ groupName: "charter"
403
+ }
404
+ )
405
+ ]
406
+ }
407
+ ) }),
408
+ renderCharterFields && /* @__PURE__ */ jsxs(Fragment, { children: [
409
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
410
+ Input,
411
+ {
412
+ id: "charterCompany",
413
+ ...register("charterCompany"),
414
+ label: "Name of Charter Company: ",
415
+ sizes: "medium",
416
+ required: false,
417
+ helperText: errors.charterCompany?.message,
418
+ variant
419
+ }
420
+ ) }),
421
+ /* @__PURE__ */ jsx("div", { className: fullRowForm, children: /* @__PURE__ */ jsxs(
422
+ RadioButtonSet,
423
+ {
424
+ id: "charterType",
425
+ label: "Charter Type: ",
426
+ sizes: "medium",
427
+ required: false,
428
+ error: !!errors.charterType,
429
+ helperText: errors.charterType?.message,
430
+ variant,
431
+ children: [
432
+ /* @__PURE__ */ jsx(
433
+ RadioButton,
434
+ {
435
+ ...register("charterType"),
436
+ value: "Limited Charter",
437
+ radioText: "Limited Charter",
438
+ groupName: "charterType"
439
+ }
440
+ ),
441
+ /* @__PURE__ */ jsx(
442
+ RadioButton,
443
+ {
444
+ ...register("charterType"),
445
+ value: "Full-time Charter",
446
+ radioText: "Full-time Charter",
447
+ groupName: "charterType"
448
+ }
449
+ )
450
+ ]
451
+ }
452
+ ) })
453
+ ] }),
454
+ /* @__PURE__ */ jsx(HoneyPot, { register, variant })
455
+ ] }),
456
+ children,
457
+ /* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
458
+ /* @__PURE__ */ jsx("div", { className: actions, children: isSubmitting ? /* @__PURE__ */ jsx(
459
+ LoadingIndicator,
460
+ {
461
+ style: { marginInline: "auto" },
462
+ variant
463
+ }
464
+ ) : /* @__PURE__ */ jsx(
465
+ Button,
466
+ {
467
+ color: getVariant(callToAction?.variant),
468
+ as: "button",
469
+ type: "submit",
470
+ disabled: !isValid || isSubmitting,
471
+ children: callToAction?.displayText
472
+ }
473
+ ) })
474
+ ]
475
+ }
476
+ )
477
+ ] }) }) }, id);
478
+ };
479
+ export {
480
+ BoatMooringLocation
481
+ };
@@ -35,3 +35,4 @@ export * from './ScheduleCallPremier';
35
35
  export * from './SuccesForm';
36
36
  export * from './VendorQuestionnaire';
37
37
  export * from './WcplSurvey';
38
+ export * from './BoatMooringLocation';
@@ -42,9 +42,11 @@ import { ScheduleCallPremier } from "./ScheduleCallPremier.js";
42
42
  import { SuccesFormWrapper } from "./SuccesForm.js";
43
43
  import { VendorQuestionnaire } from "./VendorQuestionnaire.js";
44
44
  import { WCPLSurvey } from "./WcplSurvey.js";
45
+ import { BoatMooringLocation } from "./BoatMooringLocation.js";
45
46
  export {
46
47
  ApplicationStart,
47
48
  ApplyNow,
49
+ BoatMooringLocation,
48
50
  ClearingForm,
49
51
  CommercialDeposits,
50
52
  CommercialDepositsNoLendingOption,
package/dist/main.js CHANGED
@@ -103,6 +103,7 @@ import { ScheduleCallPremier } from "./Forms/ScheduleCallPremier.js";
103
103
  import { SuccesFormWrapper } from "./Forms/SuccesForm.js";
104
104
  import { VendorQuestionnaire } from "./Forms/VendorQuestionnaire.js";
105
105
  import { WCPLSurvey } from "./Forms/WcplSurvey.js";
106
+ import { BoatMooringLocation } from "./Forms/BoatMooringLocation.js";
106
107
  import { helpArticle_container, helpArticle_headline, helpArticle_p, insight_headline_2 } from "./HelpArticle/HelpArticle.css.js";
107
108
  import { HeroBanner } from "./HeroBanner/HeroBanner.js";
108
109
  import { headline_text, heroSupertag, hero_banner, hero_btns, hero_bullet_item, hero_content, hero_embedded_image, hero_img, hero_sub_bullets, hero_text, hero_wrapper, img_contents, logout, reversed, reversed_lg_image } from "./HeroBanner/HeroBanner.css.js";
@@ -249,6 +250,7 @@ export {
249
250
  default4 as AxosXBlue,
250
251
  BalanceAPYCalculator,
251
252
  Blockquote,
253
+ BoatMooringLocation,
252
254
  BreadcumbHeader,
253
255
  Bubble,
254
256
  BulletItem,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@axos-web-dev/shared-components",
3
3
  "description": "Axos shared components library for web.",
4
- "version": "1.0.100-dev.73-slow-msg-1",
4
+ "version": "1.0.100-dev.74",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",