@saasquatch/mint-components 1.14.5 → 1.14.6-1

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.
Files changed (44) hide show
  1. package/dist/cjs/{ShadowViewAddon-787391f7.js → ShadowViewAddon-c0a5fdf8.js} +83 -0
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/mint-components.cjs.js +1 -1
  4. package/dist/cjs/{sqm-big-stat_41.cjs.entry.js → sqm-big-stat_42.cjs.entry.js} +218 -3
  5. package/dist/cjs/sqm-stencilbook.cjs.entry.js +115 -3
  6. package/dist/collection/collection-manifest.json +1 -0
  7. package/dist/collection/components/sqm-lead-form/LeadForm.stories.js +102 -0
  8. package/dist/collection/components/sqm-lead-form/sqm-lead-form-view.js +85 -0
  9. package/dist/collection/components/sqm-lead-form/sqm-lead-form.js +353 -0
  10. package/dist/collection/components/sqm-lead-form/useLeadForm.js +122 -0
  11. package/dist/collection/components/sqm-lead-form/useLeadFormState.js +10 -0
  12. package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +2 -0
  13. package/dist/esm/{ShadowViewAddon-cf230f50.js → ShadowViewAddon-aa7177fe.js} +83 -1
  14. package/dist/esm/loader.js +1 -1
  15. package/dist/esm/mint-components.js +1 -1
  16. package/dist/esm/{sqm-big-stat_41.entry.js → sqm-big-stat_42.entry.js} +220 -6
  17. package/dist/esm/sqm-stencilbook.entry.js +115 -3
  18. package/dist/esm-es5/{ShadowViewAddon-cf230f50.js → ShadowViewAddon-aa7177fe.js} +1 -1
  19. package/dist/esm-es5/loader.js +1 -1
  20. package/dist/esm-es5/mint-components.js +1 -1
  21. package/dist/esm-es5/sqm-big-stat_42.entry.js +1 -0
  22. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  23. package/dist/mint-components/mint-components.esm.js +1 -1
  24. package/dist/mint-components/p-02a6e0df.system.entry.js +1 -0
  25. package/dist/mint-components/{p-6cc141b9.js → p-373a92a2.js} +1 -1
  26. package/dist/mint-components/p-37996351.system.js +1 -1
  27. package/dist/mint-components/p-72e5e84f.system.js +1 -0
  28. package/dist/mint-components/{p-4d7108af.entry.js → p-8dc110b0.entry.js} +2 -2
  29. package/dist/mint-components/p-cde11800.system.entry.js +1 -0
  30. package/dist/mint-components/{p-f7f8545f.entry.js → p-ede3d2f9.entry.js} +25 -19
  31. package/dist/types/components/sqm-lead-form/LeadForm.stories.d.ts +9 -0
  32. package/dist/types/components/sqm-lead-form/sqm-lead-form-view.d.ts +28 -0
  33. package/dist/types/components/sqm-lead-form/sqm-lead-form.d.ts +66 -0
  34. package/dist/types/components/sqm-lead-form/useLeadForm.d.ts +23 -0
  35. package/dist/types/components/sqm-lead-form/useLeadFormState.d.ts +19 -0
  36. package/dist/types/components.d.ts +114 -0
  37. package/docs/docs.docx +0 -0
  38. package/docs/raisins.json +1 -1
  39. package/grapesjs/grapesjs.js +1 -1
  40. package/package.json +1 -1
  41. package/dist/esm-es5/sqm-big-stat_41.entry.js +0 -1
  42. package/dist/mint-components/p-28c615f2.system.entry.js +0 -1
  43. package/dist/mint-components/p-562428ef.system.js +0 -1
  44. package/dist/mint-components/p-caca540c.system.entry.js +0 -1
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, h as h$1, c as Host } from './index-91e7729f.js';
2
- import { n as h, f as useEffect, k as useState, i as d, m as useRef, u as useMemo, b as browser, j as useReducer } from './stencil-hooks.module-4bc38af4.js';
2
+ import { n as h, f as useEffect, k as useState, i as d, m as useRef, y, u as useMemo, b as browser, j as useReducer } from './stencil-hooks.module-4bc38af4.js';
3
3
  import { i as intl } from './global-be1f9992.js';
4
- import { i as isDemo, _, d as dist, J, H, $ as $e, w as wn, B, L, y as yn, j as jn, r as Ue, V as Ve, u as useCallback, Q as Qe, k as kn } from './index.module-89a79f66.js';
4
+ import { i as isDemo, _, d as dist, J, H, $ as $e, w as wn, B, j as jn, u as useCallback, L, y as yn, r as Ue, V as Ve, Q as Qe, k as kn } from './index.module-89a79f66.js';
5
5
  import { j as jsonpointer } from './jsonpointer-388a7082.js';
6
6
  import { c as cjs } from './cjs-bdfb4486.js';
7
7
  import { g as getProps, a as getMissingProps } from './utils-334c1e34.js';
@@ -19,7 +19,7 @@ import { P as PortalLoginView } from './sqm-portal-login-view-7e49609a.js';
19
19
  import { u as usePortalLogin } from './usePortalLogin-ef647a50.js';
20
20
  import { A as AsYouType } from './AsYouType-46f67d0d.js';
21
21
  import { i as isEmpty } from './utilities-5b0ca040.js';
22
- import { b as useDemoBigStat, U as useBigStat, B as BigStatView, O as autoColorScaleCss, J as CardFeedView, i as CheckboxFieldView, K as CouponCodeView, D as DropdownFieldView, E as EditProfileView, H as HeroView, I as InputFieldView, V as withShadowView, L as LeaderboardView, N as NameFieldsView, C as ChangeMarktingView, d as PortalChangePasswordView, h as PortalFooterView, P as PortalFrameView, e as PortalRegisterView, R as ReferralIframeView, W as demoRewardExchange, j as RewardExchangeView, a as useShareButton, S as ShareButtonView, u as useShareLink, c as StatContainerView, T as TaskCardView } from './ShadowViewAddon-cf230f50.js';
22
+ import { b as useDemoBigStat, V as useBigStat, B as BigStatView, Q as autoColorScaleCss, J as CardFeedView, i as CheckboxFieldView, K as CouponCodeView, D as DropdownFieldView, E as EditProfileView, H as HeroView, I as InputFieldView, O as LeadFormView, W as withShadowView, L as LeaderboardView, N as NameFieldsView, C as ChangeMarktingView, d as PortalChangePasswordView, h as PortalFooterView, P as PortalFrameView, e as PortalRegisterView, R as ReferralIframeView, X as demoRewardExchange, j as RewardExchangeView, a as useShareButton, S as ShareButtonView, u as useShareLink, c as StatContainerView, T as TaskCardView } from './ShadowViewAddon-aa7177fe.js';
23
23
  import './sqm-portal-container-view-1683ae32.js';
24
24
  import { u as usePayoutStatus } from './usePayoutStatus-fed17fc9.js';
25
25
 
@@ -1340,6 +1340,220 @@ function useInputFieldDemo(props) {
1340
1340
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
1341
1341
  }
1342
1342
 
1343
+ const LEAD_FORM_STATE_CONTEXT = "sq:lead-form-state";
1344
+ const LEAD_FORM_STATE_CONTEXT_INTERNAL = "sq:lead-form-state-internal";
1345
+ function useLeadFormState(formState) {
1346
+ const host = _();
1347
+ const [leadFormState, setLeadFormState] = y(host, LEAD_FORM_STATE_CONTEXT, formState);
1348
+ y(host, LEAD_FORM_STATE_CONTEXT_INTERNAL, [leadFormState, setLeadFormState]);
1349
+ return { leadFormState, setLeadFormState };
1350
+ }
1351
+
1352
+ const SUBMIT_LEAD = dist.gql `
1353
+ mutation submitForm($formSubmissionInput: FormSubmissionInput) {
1354
+ submitForm(formSubmissionInput: $formSubmissionInput) {
1355
+ success
1356
+ }
1357
+ }
1358
+ `;
1359
+ function useLeadForm(props) {
1360
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1361
+ const formRef = useRef(null);
1362
+ const { leadFormState, setLeadFormState } = useLeadFormState({});
1363
+ const [submitLead, { loading, errors, data }] = $e(SUBMIT_LEAD);
1364
+ useEffect(() => {
1365
+ if (!formRef.current)
1366
+ return;
1367
+ const form = formRef.current;
1368
+ form.addEventListener("sl-input", inputFunction);
1369
+ return () => {
1370
+ form.removeEventListener("sl-input", inputFunction);
1371
+ };
1372
+ }, [formRef.current]);
1373
+ const submit = async (event) => {
1374
+ let formControls = event.target.getFormControls();
1375
+ let formData = {};
1376
+ let validationErrors = {};
1377
+ formControls === null || formControls === void 0 ? void 0 : formControls.forEach((control) => {
1378
+ if (!control.name)
1379
+ return;
1380
+ const key = control.name;
1381
+ const value = control.value;
1382
+ jsonpointer.set(formData, key, value);
1383
+ // required validation
1384
+ if (control.required && !value) {
1385
+ jsonpointer.set(validationErrors, key, props.requiredFieldErrorMessage);
1386
+ }
1387
+ // custom validation
1388
+ if (typeof control.validationError === "function") {
1389
+ const validate = control.validationError;
1390
+ const validationError = validate({ control, key, value });
1391
+ if (validationError)
1392
+ jsonpointer.set(validationErrors, key, validationError);
1393
+ }
1394
+ });
1395
+ if (Object.keys(validationErrors).length) {
1396
+ setLeadFormState({ loading: false, error: "", validationErrors });
1397
+ // early return for validation errors
1398
+ return;
1399
+ }
1400
+ setLeadFormState({
1401
+ loading: true,
1402
+ error: "",
1403
+ validationErrors: {},
1404
+ });
1405
+ formData = { ...formData };
1406
+ const variables = {
1407
+ key: props.formKey,
1408
+ formData,
1409
+ };
1410
+ try {
1411
+ const result = await submitLead({ formSubmissionInput: variables });
1412
+ if (result instanceof Error) {
1413
+ throw result;
1414
+ }
1415
+ setLeadFormState({
1416
+ loading: false,
1417
+ error: "",
1418
+ validationErrors: {},
1419
+ });
1420
+ if (result.success) {
1421
+ jn.push(props.nextPage);
1422
+ }
1423
+ }
1424
+ catch (error) {
1425
+ setLeadFormState({
1426
+ loading: false,
1427
+ error: props.networkErrorMessage,
1428
+ validationErrors: {},
1429
+ });
1430
+ }
1431
+ };
1432
+ const inputFunction = useCallback((e) => {
1433
+ var _a, _b;
1434
+ const name = (_b = (_a = e.target) === null || _a === void 0 ? void 0 : _a.type) === null || _b === void 0 ? void 0 : _b.toLowerCase();
1435
+ if (name !== "tel")
1436
+ return;
1437
+ const asYouType = new AsYouType("US");
1438
+ e.target.value = asYouType.input(e.target.value);
1439
+ }, []);
1440
+ let errorMessage = "";
1441
+ if ((_a = errors === null || errors === void 0 ? void 0 : errors.response) === null || _a === void 0 ? void 0 : _a["error"]) {
1442
+ errorMessage = props.networkErrorMessage;
1443
+ }
1444
+ else if ((errors === null || errors === void 0 ? void 0 : errors.message) && !((_b = errors === null || errors === void 0 ? void 0 : errors.response) === null || _b === void 0 ? void 0 : _b.errors.length)) {
1445
+ errorMessage = props.networkErrorMessage;
1446
+ }
1447
+ else {
1448
+ errorMessage =
1449
+ ((_f = (_e = (_d = (_c = errors === null || errors === void 0 ? void 0 : errors.response) === null || _c === void 0 ? void 0 : _c.errors) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.extensions) === null || _f === void 0 ? void 0 : _f.message) || ((_j = (_h = (_g = errors === null || errors === void 0 ? void 0 : errors.response) === null || _g === void 0 ? void 0 : _g.errors) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.message) || (leadFormState === null || leadFormState === void 0 ? void 0 : leadFormState.error);
1450
+ }
1451
+ return {
1452
+ states: {
1453
+ loading,
1454
+ error: errorMessage,
1455
+ leadFormState,
1456
+ referralCode: "ABC123",
1457
+ },
1458
+ callbacks: {
1459
+ submit,
1460
+ inputFunction,
1461
+ },
1462
+ refs: {
1463
+ formRef,
1464
+ },
1465
+ };
1466
+ }
1467
+
1468
+ const LeadForm = class {
1469
+ constructor(hostRef) {
1470
+ registerInstance(this, hostRef);
1471
+ this.ignored = true;
1472
+ /**
1473
+ * Redirect participants to this page from their verification email
1474
+ *
1475
+ * @uiName Submission redirect
1476
+ * @uiWidget pageSelect
1477
+ */
1478
+ this.nextPage = "/";
1479
+ /**
1480
+ * @uiName Email field label
1481
+ */
1482
+ this.emailLabel = "Email";
1483
+ /**
1484
+ * @uiName First Name field label
1485
+ */
1486
+ this.firstNameLabel = "First Name";
1487
+ /**
1488
+ * @uiName Last Name field label
1489
+ */
1490
+ this.lastNameLabel = "Last Name";
1491
+ /**
1492
+ * @uiName Submit button text
1493
+ */
1494
+ this.submitLabel = "Submit";
1495
+ /**
1496
+ * @uiName Header text
1497
+ */
1498
+ this.pageLabel = "Submit your information";
1499
+ this.formKey = "lead-form";
1500
+ /**
1501
+ * The message to be displayed when a required field is not filled.
1502
+ *
1503
+ * @uiName Required field message
1504
+ * @uiWidget textArea
1505
+ */
1506
+ this.requiredFieldErrorMessage = "Cannot be empty";
1507
+ /**
1508
+ * The message to be displayed when a the form submission fails unexpectedly.
1509
+ *
1510
+ * @uiName Network error message
1511
+ * @uiWidget textArea
1512
+ */
1513
+ this.networkErrorMessage = "Network request failed.";
1514
+ /**
1515
+ * The message to be displayed when the email used is invalid or blocked.
1516
+ *
1517
+ * @uiName Invalid email message
1518
+ * @uiWidget textArea
1519
+ */
1520
+ this.invalidEmailErrorMessage = "Must be a valid email address";
1521
+ h(this);
1522
+ }
1523
+ disconnectedCallback() { }
1524
+ render() {
1525
+ const { states, callbacks, refs } = isDemo()
1526
+ ? useRegisterDemo(this)
1527
+ : useLeadForm(this);
1528
+ const content = {
1529
+ formData: h$1("slot", { name: "formData" }),
1530
+ emailLabel: this.emailLabel,
1531
+ submitLabel: this.submitLabel,
1532
+ pageLabel: this.pageLabel,
1533
+ invalidEmailErrorMessage: this.invalidEmailErrorMessage,
1534
+ requiredFieldErrorMessage: this.requiredFieldErrorMessage,
1535
+ };
1536
+ return (h$1(LeadFormView, { states: states, callbacks: callbacks, content: content, refs: refs }));
1537
+ }
1538
+ };
1539
+ function useRegisterDemo(props) {
1540
+ return cjs({
1541
+ states: {
1542
+ error: "",
1543
+ loading: false,
1544
+ },
1545
+ callbacks: {
1546
+ submit: async (_event) => {
1547
+ console.log("submit");
1548
+ },
1549
+ inputFunction: () => { },
1550
+ },
1551
+ refs: {
1552
+ formRef: {},
1553
+ },
1554
+ }, props.demoData || {}, { arrayMerge: (_, a) => a });
1555
+ }
1556
+
1343
1557
  const GET_LEADERBOARD = dist.gql `
1344
1558
  query (
1345
1559
  $type: String!
@@ -3040,7 +3254,7 @@ const PortalRegister = class {
3040
3254
  disconnectedCallback() { }
3041
3255
  render() {
3042
3256
  const { states, callbacks, refs } = isDemo()
3043
- ? useRegisterDemo(this)
3257
+ ? useRegisterDemo$1(this)
3044
3258
  : usePortalRegister(this);
3045
3259
  const content = {
3046
3260
  formData: h$1("slot", { name: "formData" }),
@@ -3063,7 +3277,7 @@ const PortalRegister = class {
3063
3277
  return (h$1(PortalRegisterView, { states: states, callbacks: callbacks, content: content, refs: refs }));
3064
3278
  }
3065
3279
  };
3066
- function useRegisterDemo(props) {
3280
+ function useRegisterDemo$1(props) {
3067
3281
  return cjs({
3068
3282
  states: {
3069
3283
  error: "",
@@ -5184,4 +5398,4 @@ function useUserNameDemo(props) {
5184
5398
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
5185
5399
  }
5186
5400
 
5187
- export { BigStat as sqm_big_stat, BrandComponent as sqm_brand, CardFeed as sqm_card_feed, CheckboxField as sqm_checkbox_field, CouponCode as sqm_coupon_code, DividedLayout as sqm_divided_layout, DropdownField as sqm_dropdown_field, EditProfile as sqm_edit_profile, Hero as sqm_hero, HeroImage as sqm_hero_image, SqmHookStoryContainer as sqm_hook_story_container, Image as sqm_image, InputField as sqm_input_field, Leaderboard as sqm_leaderboard, LinkButton as sqm_link_button, MarketingEmailsCheckbox as sqm_marketing_emails_checkbox, NameFields as sqm_name_fields, NavigationMenu as sqm_navigation_menu, PayoutButtonScroll as sqm_payout_button_scroll, PayoutStatusAlert as sqm_payout_status_alert, PortalChangeMarketing as sqm_portal_change_marketing, PortalChangePassword as sqm_portal_change_password, PortalFooter as sqm_portal_footer, PortalFrame as sqm_portal_frame, PortalLogin as sqm_portal_login, PortalRegister as sqm_portal_register, ProgramExplainer as sqm_program_explainer, ProgramExplainerStep as sqm_program_explainer_step, ProgramMenu as sqm_program_menu, ReferralCard as sqm_referral_card, SqmReferralIframe as sqm_referral_iframe, SqmRewardExchangeList as sqm_reward_exchange_list, SqmRouter as sqm_router, ShareButton as sqm_share_button, ShareCode as sqm_share_code, ShareLink as sqm_share_link, StatContainer as sqm_stat_container, TaskCard as sqm_task_card, Timeline as sqm_timeline, TimelineReward as sqm_timeline_entry, UserName as sqm_user_name };
5401
+ export { BigStat as sqm_big_stat, BrandComponent as sqm_brand, CardFeed as sqm_card_feed, CheckboxField as sqm_checkbox_field, CouponCode as sqm_coupon_code, DividedLayout as sqm_divided_layout, DropdownField as sqm_dropdown_field, EditProfile as sqm_edit_profile, Hero as sqm_hero, HeroImage as sqm_hero_image, SqmHookStoryContainer as sqm_hook_story_container, Image as sqm_image, InputField as sqm_input_field, LeadForm as sqm_lead_form, Leaderboard as sqm_leaderboard, LinkButton as sqm_link_button, MarketingEmailsCheckbox as sqm_marketing_emails_checkbox, NameFields as sqm_name_fields, NavigationMenu as sqm_navigation_menu, PayoutButtonScroll as sqm_payout_button_scroll, PayoutStatusAlert as sqm_payout_status_alert, PortalChangeMarketing as sqm_portal_change_marketing, PortalChangePassword as sqm_portal_change_password, PortalFooter as sqm_portal_footer, PortalFrame as sqm_portal_frame, PortalLogin as sqm_portal_login, PortalRegister as sqm_portal_register, ProgramExplainer as sqm_program_explainer, ProgramExplainerStep as sqm_program_explainer_step, ProgramMenu as sqm_program_menu, ReferralCard as sqm_referral_card, SqmReferralIframe as sqm_referral_iframe, SqmRewardExchangeList as sqm_reward_exchange_list, SqmRouter as sqm_router, ShareButton as sqm_share_button, ShareCode as sqm_share_code, ShareLink as sqm_share_link, StatContainer as sqm_stat_container, TaskCard as sqm_task_card, Timeline as sqm_timeline, TimelineReward as sqm_timeline_entry, UserName as sqm_user_name };
@@ -31,7 +31,7 @@ import { P as PortalResetPasswordView } from './sqm-portal-reset-password-view-5
31
31
  import { P as PortalVerifyEmailView } from './sqm-portal-verify-email-view-b12cb894.js';
32
32
  import './ErrorView-48e2b969.js';
33
33
  import { Q as QrCodeView } from './sqm-qr-code-view-f1d0763b.js';
34
- import { S as ShareButtonView, L as LeaderboardView, B as BigStatView, P as PortalFrameView, E as EditProfileView, u as useShareLink, a as useShareButton, b as useDemoBigStat, c as StatContainerView, d as PortalChangePasswordView, e as PortalRegisterView, C as ChangeMarktingView, T as TaskCardView, f as ProgressBarView, g as PoweredByImg$1, h as PortalFooterView, H as HeroView, R as ReferralIframeView, N as NameFieldsView, i as CheckboxFieldView, D as DropdownFieldView, I as InputFieldView, j as RewardExchangeView, r as rewardExchangeCustomErrorMsg, k as rewardExchangeLongText, l as rewardExchangeSelected, m as chooseAmountFixed, n as chooseAmountFixedNoDescription, o as chooseAmountVariable, p as chooseAmountVariableNoDescription, q as chooseAmountVariableDisabled, s as chooseAmountVariableUnavailable, t as confirmFixed, v as confirmVariable, w as redemptionError, x as queryError, y as success, z as successVariable, A as loading, F as empty$1, G as rewardExchange, J as CardFeedView, K as CouponCodeView, M as ProgressBar$2, O as autoColorScaleCss, Q as ShadowViewAddon } from './ShadowViewAddon-cf230f50.js';
34
+ import { S as ShareButtonView, L as LeaderboardView, B as BigStatView, P as PortalFrameView, E as EditProfileView, u as useShareLink, a as useShareButton, b as useDemoBigStat, c as StatContainerView, d as PortalChangePasswordView, e as PortalRegisterView, C as ChangeMarktingView, T as TaskCardView, f as ProgressBarView, g as PoweredByImg$1, h as PortalFooterView, H as HeroView, R as ReferralIframeView, N as NameFieldsView, i as CheckboxFieldView, D as DropdownFieldView, I as InputFieldView, j as RewardExchangeView, r as rewardExchangeCustomErrorMsg, k as rewardExchangeLongText, l as rewardExchangeSelected, m as chooseAmountFixed, n as chooseAmountFixedNoDescription, o as chooseAmountVariable, p as chooseAmountVariableNoDescription, q as chooseAmountVariableDisabled, s as chooseAmountVariableUnavailable, t as confirmFixed, v as confirmVariable, w as redemptionError, x as queryError, y as success, z as successVariable, A as loading, F as empty$1, G as rewardExchange, J as CardFeedView, K as CouponCodeView, M as ProgressBar$2, O as LeadFormView, Q as autoColorScaleCss, U as ShadowViewAddon } from './ShadowViewAddon-aa7177fe.js';
35
35
  import { P as PortalContainerView, a as PortalSectionView } from './sqm-portal-container-view-1683ae32.js';
36
36
  import { O as OtherRegionSlotView, I as InvoiceTableView, T as TaxForm } from './sqm-invoice-table-view-7f376a75.js';
37
37
 
@@ -15827,6 +15827,117 @@ const QRCode = /*#__PURE__*/Object.freeze({
15827
15827
  DownloadError: DownloadError
15828
15828
  });
15829
15829
 
15830
+ const LeadForm_stories = {
15831
+ title: "Components/Lead Form",
15832
+ };
15833
+ const defaultProps$t = {
15834
+ states: {
15835
+ leadFormState: {},
15836
+ error: "",
15837
+ loading: false,
15838
+ referralCode: "ABC123",
15839
+ },
15840
+ callbacks: {
15841
+ submit: () => console.log("Submit!"),
15842
+ inputFunction: () => { },
15843
+ },
15844
+ refs: {
15845
+ formRef: {},
15846
+ },
15847
+ content: {
15848
+ pageLabel: "Submit your information",
15849
+ requiredFieldErrorMessage: "Cannot be empty",
15850
+ invalidEmailErrorMessage: "Must be a valid email address",
15851
+ },
15852
+ };
15853
+ const errorProps$c = {
15854
+ states: {
15855
+ error: "Something went wrong. Please try again.",
15856
+ leadFormState: {},
15857
+ loading: false,
15858
+ referralCode: "ABC123",
15859
+ },
15860
+ callbacks: {
15861
+ submit: () => console.log("Submit!"),
15862
+ inputFunction: () => { },
15863
+ },
15864
+ refs: {
15865
+ formRef: {},
15866
+ },
15867
+ content: {
15868
+ pageLabel: "Submit your information",
15869
+ requiredFieldErrorMessage: "Cannot be empty",
15870
+ invalidEmailErrorMessage: "Must be a valid email address",
15871
+ },
15872
+ };
15873
+ const loadingProps$9 = {
15874
+ states: {
15875
+ leadFormState: {},
15876
+ error: "",
15877
+ loading: true,
15878
+ referralCode: "ABC123",
15879
+ },
15880
+ callbacks: {
15881
+ submit: () => console.log("Submit!"),
15882
+ inputFunction: () => { },
15883
+ },
15884
+ refs: {
15885
+ formRef: {},
15886
+ },
15887
+ content: {
15888
+ pageLabel: "Submit your information",
15889
+ requiredFieldErrorMessage: "Cannot be empty",
15890
+ invalidEmailErrorMessage: "Must be a valid email address",
15891
+ },
15892
+ };
15893
+ const slottedProps$2 = {
15894
+ states: {
15895
+ leadFormState: {},
15896
+ error: "",
15897
+ loading: false,
15898
+ referralCode: "ABC123",
15899
+ },
15900
+ callbacks: {
15901
+ submit: () => console.log("Submit!"),
15902
+ inputFunction: () => { },
15903
+ },
15904
+ refs: {
15905
+ formRef: {},
15906
+ },
15907
+ content: {
15908
+ pageLabel: "Submit your information",
15909
+ requiredFieldErrorMessage: "Cannot be empty",
15910
+ invalidEmailErrorMessage: "Must be a valid email address",
15911
+ formData: (h("div", null,
15912
+ h("sl-input", { style: { marginBottom: "var(--sl-spacing-x-large)" }, exportparts: "label: input-label, base: input-base", label: "Slotted Input", required: true }),
15913
+ h("sl-input", { exportparts: "label: input-label, base: input-base", label: "Slotted Input 2", required: true }))),
15914
+ },
15915
+ };
15916
+ const Default$r = () => h(LeadFormView, Object.assign({}, defaultProps$t));
15917
+ const LeadSubmitWithError = () => h(LeadFormView, Object.assign({}, errorProps$c));
15918
+ const LeadSubmitLoading = () => h(LeadFormView, Object.assign({}, loadingProps$9));
15919
+ const FieldsHidden$2 = () => {
15920
+ return (h("sqm-lead-form", { demoData: {
15921
+ states: {
15922
+ leadFormState: {},
15923
+ error: "",
15924
+ loading: true,
15925
+ referralCode: "ABC123",
15926
+ },
15927
+ } }));
15928
+ };
15929
+ const SlottedInputs$2 = () => h(LeadFormView, Object.assign({}, slottedProps$2));
15930
+
15931
+ const LeadForm = /*#__PURE__*/Object.freeze({
15932
+ __proto__: null,
15933
+ 'default': LeadForm_stories,
15934
+ Default: Default$r,
15935
+ LeadSubmitWithError: LeadSubmitWithError,
15936
+ LeadSubmitLoading: LeadSubmitLoading,
15937
+ FieldsHidden: FieldsHidden$2,
15938
+ SlottedInputs: SlottedInputs$2
15939
+ });
15940
+
15830
15941
  /**
15831
15942
  *
15832
15943
  * Themes
@@ -15839,7 +15950,7 @@ const QRCode = /*#__PURE__*/Object.freeze({
15839
15950
  *
15840
15951
  */
15841
15952
  //
15842
- const Default$r = `
15953
+ const Default$s = `
15843
15954
  // No CSS
15844
15955
  `;
15845
15956
  const Orangey = `
@@ -15873,7 +15984,7 @@ const Klip = `
15873
15984
 
15874
15985
  const Themes = /*#__PURE__*/Object.freeze({
15875
15986
  __proto__: null,
15876
- Default: Default$r,
15987
+ Default: Default$s,
15877
15988
  Orangey: Orangey,
15878
15989
  Netflix: Netflix,
15879
15990
  SaaSquatchCorporate: SaaSquatchCorporate,
@@ -18564,6 +18675,7 @@ const stories = [
18564
18675
  PayoutButtonScroll,
18565
18676
  PayoutStatusAlert,
18566
18677
  QRCode,
18678
+ LeadForm,
18567
18679
  ];
18568
18680
  const StencilStorybook = class {
18569
18681
  constructor(hostRef) {