@saasquatch/mint-components 1.14.6-2 → 1.14.6-3

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 (86) hide show
  1. package/dist/cjs/{ShadowViewAddon-c0a5fdf8.js → ShadowViewAddon-40f0bc74.js} +58 -26
  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_42.cjs.entry.js +84 -116
  5. package/dist/cjs/sqm-lead-dropdown-field-view-03a3e03f.js +69 -0
  6. package/dist/cjs/sqm-lead-dropdown-field.cjs.entry.js +75 -0
  7. package/dist/cjs/sqm-lead-input-field-view-6344cd93.js +51 -0
  8. package/dist/cjs/sqm-lead-input-field.cjs.entry.js +78 -0
  9. package/dist/cjs/sqm-stencilbook.cjs.entry.js +166 -49
  10. package/dist/cjs/useLeadFormState-c83d2034.js +72 -0
  11. package/dist/collection/collection-manifest.json +2 -0
  12. package/dist/collection/components/sqm-lead-form/LeadForm.stories.js +34 -46
  13. package/dist/collection/components/sqm-lead-form/LeadFormDropdownField.stories.js +59 -0
  14. package/dist/collection/components/sqm-lead-form/LeadInputField.stories.js +48 -0
  15. package/dist/collection/components/sqm-lead-form/sqm-lead-dropdown-field-view.js +65 -0
  16. package/dist/collection/components/sqm-lead-form/sqm-lead-dropdown-field.js +193 -0
  17. package/dist/collection/components/sqm-lead-form/sqm-lead-form-view.js +59 -26
  18. package/dist/collection/components/sqm-lead-form/sqm-lead-form.js +147 -36
  19. package/dist/collection/components/sqm-lead-form/sqm-lead-input-field-view.js +47 -0
  20. package/dist/collection/components/sqm-lead-form/sqm-lead-input-field.js +222 -0
  21. package/dist/collection/components/sqm-lead-form/useLeadDropdownField.js +10 -0
  22. package/dist/collection/components/sqm-lead-form/useLeadForm.js +8 -5
  23. package/dist/collection/components/sqm-lead-form/useLeadInputField.js +10 -0
  24. package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +4 -0
  25. package/dist/esm/{ShadowViewAddon-aa7177fe.js → ShadowViewAddon-8a0d9e83.js} +58 -26
  26. package/dist/esm/loader.js +1 -1
  27. package/dist/esm/mint-components.js +1 -1
  28. package/dist/esm/sqm-big-stat_42.entry.js +81 -113
  29. package/dist/esm/sqm-lead-dropdown-field-view-4c85fe20.js +67 -0
  30. package/dist/esm/sqm-lead-dropdown-field.entry.js +71 -0
  31. package/dist/esm/sqm-lead-input-field-view-f1dd4b77.js +49 -0
  32. package/dist/esm/sqm-lead-input-field.entry.js +74 -0
  33. package/dist/esm/sqm-stencilbook.entry.js +166 -49
  34. package/dist/esm/useLeadFormState-9016d812.js +68 -0
  35. package/dist/esm-es5/{ShadowViewAddon-aa7177fe.js → ShadowViewAddon-8a0d9e83.js} +1 -1
  36. package/dist/esm-es5/loader.js +1 -1
  37. package/dist/esm-es5/mint-components.js +1 -1
  38. package/dist/esm-es5/sqm-big-stat_42.entry.js +1 -1
  39. package/dist/esm-es5/sqm-lead-dropdown-field-view-4c85fe20.js +1 -0
  40. package/dist/esm-es5/sqm-lead-dropdown-field.entry.js +1 -0
  41. package/dist/esm-es5/sqm-lead-input-field-view-f1dd4b77.js +1 -0
  42. package/dist/esm-es5/sqm-lead-input-field.entry.js +1 -0
  43. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  44. package/dist/esm-es5/useLeadFormState-9016d812.js +1 -0
  45. package/dist/mint-components/mint-components.esm.js +1 -1
  46. package/dist/mint-components/p-13c67985.system.entry.js +1 -0
  47. package/dist/mint-components/p-15f1ff1d.system.js +1 -0
  48. package/dist/mint-components/p-1d704c40.system.js +1 -0
  49. package/dist/mint-components/p-26da31c6.js +1 -0
  50. package/dist/mint-components/p-37996351.system.js +1 -1
  51. package/dist/mint-components/{p-373a92a2.js → p-4139feb5.js} +3 -3
  52. package/dist/mint-components/p-4d5b02af.js +1 -0
  53. package/dist/mint-components/p-87384d9e.system.js +1 -0
  54. package/dist/mint-components/p-875861d7.system.entry.js +1 -0
  55. package/dist/mint-components/p-8af8ab01.system.entry.js +1 -0
  56. package/dist/mint-components/p-9e1570bf.system.entry.js +1 -0
  57. package/dist/mint-components/{p-72e5e84f.system.js → p-ad6420a2.system.js} +1 -1
  58. package/dist/mint-components/p-b8c15858.entry.js +1 -0
  59. package/dist/mint-components/{p-8dc110b0.entry.js → p-cd1c6113.entry.js} +2 -2
  60. package/dist/mint-components/p-e358f0c1.entry.js +265 -0
  61. package/dist/mint-components/p-f59d6012.entry.js +1 -0
  62. package/dist/mint-components/p-f98a4354.js +1 -0
  63. package/dist/types/components/sqm-lead-form/LeadForm.stories.d.ts +1 -0
  64. package/dist/types/components/sqm-lead-form/LeadFormDropdownField.stories.d.ts +9 -0
  65. package/dist/types/components/sqm-lead-form/LeadInputField.stories.d.ts +8 -0
  66. package/dist/types/components/sqm-lead-form/sqm-lead-dropdown-field-view.d.ts +15 -0
  67. package/dist/types/components/sqm-lead-form/sqm-lead-dropdown-field.d.ts +42 -0
  68. package/dist/types/components/sqm-lead-form/sqm-lead-form-view.d.ts +7 -0
  69. package/dist/types/components/sqm-lead-form/sqm-lead-form.d.ts +24 -7
  70. package/dist/types/components/sqm-lead-form/sqm-lead-input-field-view.d.ts +14 -0
  71. package/dist/types/components/sqm-lead-form/sqm-lead-input-field.d.ts +49 -0
  72. package/dist/types/components/sqm-lead-form/useLeadDropdownField.d.ts +6 -0
  73. package/dist/types/components/sqm-lead-form/useLeadForm.d.ts +4 -0
  74. package/dist/types/components/sqm-lead-form/useLeadInputField.d.ts +6 -0
  75. package/dist/types/components.d.ts +194 -12
  76. package/docs/docs.docx +0 -0
  77. package/docs/raisins.json +1 -1
  78. package/grapesjs/grapesjs.js +1 -1
  79. package/package.json +1 -1
  80. package/dist/mint-components/p-02a6e0df.system.entry.js +0 -1
  81. package/dist/mint-components/p-0c6ab3ec.system.entry.js +0 -1
  82. package/dist/mint-components/p-6349fb7c.entry.js +0 -265
  83. package/dist/types/global/android.d.ts +0 -7
  84. package/dist/types/global/demo.d.ts +0 -2
  85. package/dist/types/stories/features.d.ts +0 -4
  86. package/dist/types/stories/templates.d.ts +0 -4
@@ -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, y, u as useMemo, b as browser, j as useReducer } from './stencil-hooks.module-4bc38af4.js';
2
+ import { n as h, f as useEffect, i as d, k as useState, m as useRef, 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, 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';
4
+ import { i as isDemo, _, d as dist, J, H, $ as $e, w as wn, B, u as useCallback, L, y as yn, j as jn, 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';
@@ -15,11 +15,12 @@ import './luxon-8d51c92b.js';
15
15
  import './sqm-text-span-view-ca32495e.js';
16
16
  import { p as pathToRegexp } from './index-ffa26b43.js';
17
17
  import { R as REGISTRATION_FORM_STATE_CONTEXT, u as useRegistrationFormState } from './useRegistrationFormState-d6f33135.js';
18
+ import { R as RequiredPropsError, u as useLeadFormState } from './useLeadFormState-9016d812.js';
18
19
  import { P as PortalLoginView } from './sqm-portal-login-view-7e49609a.js';
19
20
  import { u as usePortalLogin } from './usePortalLogin-ef647a50.js';
20
21
  import { A as AsYouType } from './AsYouType-46f67d0d.js';
21
22
  import { i as isEmpty } from './utilities-5b0ca040.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
+ 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-8a0d9e83.js';
23
24
  import './sqm-portal-container-view-1683ae32.js';
24
25
  import { u as usePayoutStatus } from './usePayoutStatus-fed17fc9.js';
25
26
 
@@ -137,58 +138,6 @@ const CardFeed = class {
137
138
  }
138
139
  };
139
140
 
140
- const style = {
141
- IconStyle: {
142
- display: "block",
143
- position: "absolute",
144
- top: "23px",
145
- },
146
- DivStyle: {
147
- marginLeft: "28px",
148
- },
149
- Details: {
150
- marginLeft: "28px",
151
- },
152
- Heading: {
153
- display: "inline-block",
154
- },
155
- Children: {
156
- display: "none",
157
- },
158
- };
159
- const sheet = createStyleSheet(style);
160
- const styleString = sheet.toString();
161
- function RequiredPropsError({ missingProps, heading = "There was a problem loading this section", subheading = "There was a technical problem that prevented this section from loading. Please contact us with the link to this page.", description = "Error occured while loading <{tagName}>. Values for the following attributes are missing:", }, children) {
162
- if (!missingProps)
163
- return false;
164
- const host = _();
165
- const [detailsOpen, setDetailsOpen] = useState(false);
166
- return (h$1("sl-alert", { type: "danger", open: true },
167
- h$1("style", { type: "text/css" }, styleString),
168
- h$1("div", { slot: "icon", class: sheet.classes.IconStyle },
169
- h$1("sl-icon", { name: "exclamation-octagon" })),
170
- h$1("div", { class: sheet.classes.DivStyle },
171
- h$1("h2", { class: sheet.classes.Heading }, intl.formatMessage({
172
- id: `error-heading`,
173
- defaultMessage: heading,
174
- })),
175
- h$1("p", null, intl.formatMessage({
176
- id: `error-subheading`,
177
- defaultMessage: subheading,
178
- }))),
179
- h$1("details", { class: sheet.classes.Details },
180
- h$1("summary", { onClick: () => setDetailsOpen(!detailsOpen) },
181
- detailsOpen ? "Less" : "More",
182
- " details"),
183
- h$1("p", null, intl.formatMessage({
184
- id: `error-description`,
185
- defaultMessage: description,
186
- }, { tagName: host.tagName.toLowerCase() })),
187
- h$1("ul", null, missingProps.map((prop) => (h$1("li", null,
188
- h$1("strong", null, prop.attribute)))))),
189
- h$1("div", { class: sheet.classes.Children }, children)));
190
- }
191
-
192
141
  function useCheckboxField(props) {
193
142
  var _a;
194
143
  const registrationFormState = d(REGISTRATION_FORM_STATE_CONTEXT);
@@ -1340,15 +1289,6 @@ function useInputFieldDemo(props) {
1340
1289
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
1341
1290
  }
1342
1291
 
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
1292
  const SUBMIT_LEAD = dist.gql `
1353
1293
  mutation submitForm($formSubmissionInput: FormSubmissionInput!) {
1354
1294
  submitForm(formSubmissionInput: $formSubmissionInput) {
@@ -1361,6 +1301,7 @@ function useLeadForm(props) {
1361
1301
  const formRef = useRef(null);
1362
1302
  const { leadFormState, setLeadFormState } = useLeadFormState({});
1363
1303
  const [submitLead, { loading, errors, data }] = $e(SUBMIT_LEAD);
1304
+ const [success, setSuccess] = useState(false);
1364
1305
  useEffect(() => {
1365
1306
  if (!formRef.current)
1366
1307
  return;
@@ -1371,6 +1312,7 @@ function useLeadForm(props) {
1371
1312
  };
1372
1313
  }, [formRef.current]);
1373
1314
  const submit = async (event) => {
1315
+ var _a, _b;
1374
1316
  let formControls = event.target.getFormControls();
1375
1317
  let formData = {};
1376
1318
  let validationErrors = {};
@@ -1417,8 +1359,9 @@ function useLeadForm(props) {
1417
1359
  error: "",
1418
1360
  validationErrors: {},
1419
1361
  });
1420
- if (result.success) {
1421
- jn.push(props.nextPage);
1362
+ console.log({ success: result.data.submitForm.success });
1363
+ if ((_b = (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.submitForm) === null || _b === void 0 ? void 0 : _b.success) {
1364
+ setSuccess(true);
1422
1365
  }
1423
1366
  }
1424
1367
  catch (error) {
@@ -1452,6 +1395,7 @@ function useLeadForm(props) {
1452
1395
  states: {
1453
1396
  loading,
1454
1397
  error: errorMessage,
1398
+ success,
1455
1399
  leadFormState,
1456
1400
  referralCode: "ABC123",
1457
1401
  },
@@ -1469,13 +1413,6 @@ const LeadForm = class {
1469
1413
  constructor(hostRef) {
1470
1414
  registerInstance(this, hostRef);
1471
1415
  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
1416
  /**
1480
1417
  * @uiName Email field label
1481
1418
  */
@@ -1492,18 +1429,42 @@ const LeadForm = class {
1492
1429
  * @uiName Submit button text
1493
1430
  */
1494
1431
  this.submitLabel = "Submit";
1432
+ /**
1433
+ * @uiName Submit another form button label
1434
+ */
1435
+ this.resubmitFormLabel = "Refer Another Friend";
1495
1436
  /**
1496
1437
  * @uiName Header text
1497
1438
  */
1498
- this.pageLabel = "Submit your information";
1439
+ this.pageLabel = "Refer your friend";
1499
1440
  this.formKey = "lead-form";
1441
+ /**
1442
+ * Optional support link for error messages.
1443
+ */
1444
+ this.supportLink = "Support";
1445
+ /**
1446
+ * Header text shown on successful submission.
1447
+ */
1448
+ this.submitSuccessHeader = "Referral submitted";
1449
+ /**
1450
+ * Description text shown on successful submission.
1451
+ */
1452
+ this.submitSuccessDescription = "Our team will contact your friend to see if they’re a good fit. In the meantime, you can track this referral on Activity page.";
1453
+ /**
1454
+ * Header text shown when an error occurs.
1455
+ */
1456
+ this.submitErrorHeader = "An error occurred while submitting";
1457
+ /**
1458
+ * Description text shown when an error occurs.
1459
+ */
1460
+ this.submitErrorDescription = "Please try again later. If the problem continues, contact {supportLink}";
1500
1461
  /**
1501
1462
  * The message to be displayed when a required field is not filled.
1502
1463
  *
1503
1464
  * @uiName Required field message
1504
1465
  * @uiWidget textArea
1505
1466
  */
1506
- this.requiredFieldErrorMessage = "Cannot be empty";
1467
+ this.requiredFieldErrorMessage = "Please enter a valid {fieldLabel}";
1507
1468
  /**
1508
1469
  * The message to be displayed when a the form submission fails unexpectedly.
1509
1470
  *
@@ -1529,7 +1490,13 @@ const LeadForm = class {
1529
1490
  formData: h$1("slot", { name: "formData" }),
1530
1491
  emailLabel: this.emailLabel,
1531
1492
  submitLabel: this.submitLabel,
1493
+ resubmitFormLabel: this.resubmitFormLabel,
1532
1494
  pageLabel: this.pageLabel,
1495
+ supportLink: this.supportLink,
1496
+ submitSuccessHeader: this.submitSuccessHeader,
1497
+ submitSuccessDescription: this.submitSuccessDescription,
1498
+ submitErrorHeader: this.submitErrorHeader,
1499
+ submitErrorDescription: this.submitErrorDescription,
1533
1500
  invalidEmailErrorMessage: this.invalidEmailErrorMessage,
1534
1501
  requiredFieldErrorMessage: this.requiredFieldErrorMessage,
1535
1502
  };
@@ -1541,6 +1508,7 @@ function useRegisterDemo(props) {
1541
1508
  states: {
1542
1509
  error: "",
1543
1510
  loading: false,
1511
+ success: false,
1544
1512
  },
1545
1513
  callbacks: {
1546
1514
  submit: async (_event) => {
@@ -1851,7 +1819,7 @@ function useLeaderboardDemo(props) {
1851
1819
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
1852
1820
  }
1853
1821
 
1854
- const style$1 = {
1822
+ const style = {
1855
1823
  Container: { display: "contents" },
1856
1824
  Link: {
1857
1825
  textDecoration: "none",
@@ -1863,16 +1831,16 @@ const vanillaStyle = `
1863
1831
  display: inline;
1864
1832
  }
1865
1833
  `;
1866
- const sheet$1 = createStyleSheet(style$1);
1867
- const styleString$1 = sheet$1.toString();
1834
+ const sheet = createStyleSheet(style);
1835
+ const styleString = sheet.toString();
1868
1836
  function LinkButtonView(props) {
1869
1837
  const { onClick, buttonText } = props;
1870
- return (h$1("span", { class: sheet$1.classes.Container, part: "sqm-base" },
1838
+ return (h$1("span", { class: sheet.classes.Container, part: "sqm-base" },
1871
1839
  h$1("style", { type: "text/css" },
1872
- styleString$1,
1840
+ styleString,
1873
1841
  vanillaStyle),
1874
1842
  h$1("sl-button", { onClick: onClick, type: "primary", exportparts: "base: primarybutton-base" },
1875
- h$1("a", { class: sheet$1.classes.Link, part: "sqm-link" }, buttonText))));
1843
+ h$1("a", { class: sheet.classes.Link, part: "sqm-link" }, buttonText))));
1876
1844
  }
1877
1845
 
1878
1846
  const LinkButton = class {
@@ -2053,7 +2021,7 @@ function useNavigationMenuDemo(props) {
2053
2021
  }
2054
2022
  NavigationMenu.style = sqmNavigationMenuCss;
2055
2023
 
2056
- const style$2 = {
2024
+ const style$1 = {
2057
2025
  Wrapper: {
2058
2026
  maxWidth: "200px",
2059
2027
  marginLeft: "auto",
@@ -2064,16 +2032,16 @@ const style$2 = {
2064
2032
  margin: "0",
2065
2033
  },
2066
2034
  };
2067
- const sheet$2 = createStyleSheet(style$2);
2068
- const styleString$2 = sheet$2.toString();
2035
+ const sheet$1 = createStyleSheet(style$1);
2036
+ const styleString$1 = sheet$1.toString();
2069
2037
  function PayoutButtonScrollView(props) {
2070
2038
  const { text, states } = props;
2071
2039
  if (!states.payoutSettingsComplete)
2072
2040
  return h$1("div", null);
2073
- return (h$1("div", { class: sheet$2.classes.Wrapper },
2074
- h$1("style", { type: "text/css" }, styleString$2),
2041
+ return (h$1("div", { class: sheet$1.classes.Wrapper },
2042
+ h$1("style", { type: "text/css" }, styleString$1),
2075
2043
  h$1("sqm-scroll", { "scroll-tag-name": "sqm-tabs", "button-text": text.payoutButtonText, "scroll-animation": "smooth" }),
2076
- h$1("p", { class: sheet$2.classes.PayoutButtonDescription }, text.payoutButtonDescription)));
2044
+ h$1("p", { class: sheet$1.classes.PayoutButtonDescription }, text.payoutButtonDescription)));
2077
2045
  }
2078
2046
 
2079
2047
  const GET_PAYOUT_DETAILS = dist.gql `
@@ -2146,7 +2114,7 @@ function useDemoPayoutButtonScroll(props) {
2146
2114
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
2147
2115
  }
2148
2116
 
2149
- const style$3 = {
2117
+ const style$2 = {
2150
2118
  SkeletonOne: {
2151
2119
  width: "50%",
2152
2120
  height: "16px",
@@ -2197,8 +2165,8 @@ const style$3 = {
2197
2165
  "&::part(footer)": {},
2198
2166
  },
2199
2167
  };
2200
- const sheet$3 = createStyleSheet(style$3);
2201
- const styleString$3 = sheet$3.toString();
2168
+ const sheet$2 = createStyleSheet(style$2);
2169
+ const styleString$2 = sheet$2.toString();
2202
2170
  function PayoutStatusAlertView(props) {
2203
2171
  const { text, states, data, callbacks } = props;
2204
2172
  function getAlert(status) {
@@ -2209,7 +2177,7 @@ function PayoutStatusAlertView(props) {
2209
2177
  buttonText: null,
2210
2178
  alertType: "critical",
2211
2179
  icon: "exclamation-triangle",
2212
- class: sheet$3.classes.ErrorAlertContainer,
2180
+ class: sheet$2.classes.ErrorAlertContainer,
2213
2181
  };
2214
2182
  switch (status) {
2215
2183
  case "INFORMATION_REQUIRED":
@@ -2219,7 +2187,7 @@ function PayoutStatusAlertView(props) {
2219
2187
  buttonText: text.informationRequiredButtonText,
2220
2188
  alertType: "info",
2221
2189
  icon: "info-circle",
2222
- class: sheet$3.classes.InfoAlertContainer,
2190
+ class: sheet$2.classes.InfoAlertContainer,
2223
2191
  };
2224
2192
  case "VERIFICATION:REQUIRED":
2225
2193
  return {
@@ -2233,7 +2201,7 @@ function PayoutStatusAlertView(props) {
2233
2201
  buttonText: text.verificationRequiredButtonText,
2234
2202
  alertType: "warning",
2235
2203
  icon: "exclamation-triangle",
2236
- class: sheet$3.classes.WarningAlertContainer,
2204
+ class: sheet$2.classes.WarningAlertContainer,
2237
2205
  };
2238
2206
  case "VERIFICATION:INTERNAL":
2239
2207
  return {
@@ -2246,7 +2214,7 @@ function PayoutStatusAlertView(props) {
2246
2214
  }),
2247
2215
  alertType: "warning",
2248
2216
  icon: "exclamation-triangle",
2249
- class: sheet$3.classes.WarningAlertContainer,
2217
+ class: sheet$2.classes.WarningAlertContainer,
2250
2218
  };
2251
2219
  case "VERIFICATION:REVIEW":
2252
2220
  return {
@@ -2259,7 +2227,7 @@ function PayoutStatusAlertView(props) {
2259
2227
  }),
2260
2228
  alertType: "warning",
2261
2229
  icon: "exclamation-triangle",
2262
- class: sheet$3.classes.WarningAlertContainer,
2230
+ class: sheet$2.classes.WarningAlertContainer,
2263
2231
  };
2264
2232
  case "VERIFICATION:FAILED":
2265
2233
  return {
@@ -2272,7 +2240,7 @@ function PayoutStatusAlertView(props) {
2272
2240
  }),
2273
2241
  alertType: "critical",
2274
2242
  icon: "exclamation-octagon",
2275
- class: sheet$3.classes.ErrorAlertContainer,
2243
+ class: sheet$2.classes.ErrorAlertContainer,
2276
2244
  };
2277
2245
  case "HOLD":
2278
2246
  return {
@@ -2286,7 +2254,7 @@ function PayoutStatusAlertView(props) {
2286
2254
  buttonText: null,
2287
2255
  alertType: "warning",
2288
2256
  icon: "exclamation-triangle",
2289
- class: sheet$3.classes.WarningAlertContainer,
2257
+ class: sheet$2.classes.WarningAlertContainer,
2290
2258
  };
2291
2259
  default:
2292
2260
  return;
@@ -2305,18 +2273,18 @@ function PayoutStatusAlertView(props) {
2305
2273
  }
2306
2274
  }
2307
2275
  if (states.loading) {
2308
- return h$1("sl-skeleton", { class: sheet$3.classes.SkeletonOne });
2276
+ return h$1("sl-skeleton", { class: sheet$2.classes.SkeletonOne });
2309
2277
  }
2310
2278
  const alertDetails = getAlert(states.status);
2311
2279
  if (states.status === "DONE" || !alertDetails) {
2312
2280
  return h$1("div", null);
2313
2281
  }
2314
2282
  return (h$1("div", { part: "sqm-base" },
2315
- h$1("style", { type: "text/css" }, styleString$3),
2283
+ h$1("style", { type: "text/css" }, styleString$2),
2316
2284
  h$1("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: alertDetails.alertType, class: alertDetails.class, open: true },
2317
2285
  h$1("sl-icon", { slot: "icon", name: alertDetails.icon }),
2318
2286
  h$1("strong", null, alertDetails.header),
2319
- h$1("p", { class: sheet$3.classes.AlertDescriptionText }, alertDetails.description),
2287
+ h$1("p", { class: sheet$2.classes.AlertDescriptionText }, alertDetails.description),
2320
2288
  getButton(states.status))));
2321
2289
  }
2322
2290
 
@@ -3470,7 +3438,7 @@ const ProgramMenu = class {
3470
3438
  }
3471
3439
  };
3472
3440
 
3473
- const style$4 = {
3441
+ const style$3 = {
3474
3442
  Container: {
3475
3443
  borderRadius: "var(--sl-border-radius-large)",
3476
3444
  color: "var(--sl-color-neutral-900)",
@@ -3498,15 +3466,15 @@ const style$4 = {
3498
3466
  },
3499
3467
  },
3500
3468
  };
3501
- const sheet$4 = createStyleSheet(style$4);
3502
- const styleString$4 = sheet$4.toString();
3469
+ const sheet$3 = createStyleSheet(style$3);
3470
+ const styleString$3 = sheet$3.toString();
3503
3471
  const vanillaStyle$1 = `
3504
3472
  :host{
3505
3473
  display: block;
3506
3474
  }
3507
3475
  `;
3508
3476
  function ReferralCardView(props) {
3509
- return (h$1("div", { part: "sqm-base", class: sheet$4.classes.Container, style: {
3477
+ return (h$1("div", { part: "sqm-base", class: sheet$3.classes.Container, style: {
3510
3478
  border: `${props.hideBorder ? "none" : "1px solid var(--sl-color-neutral-300)"}`,
3511
3479
  "padding-top": `var(--sl-spacing-${props.paddingTop})`,
3512
3480
  "padding-right": `var(--sl-spacing-${props.paddingRight})`,
@@ -3517,15 +3485,15 @@ function ReferralCardView(props) {
3517
3485
  margin: `${props.limitWidth ? "auto" : "none"}`,
3518
3486
  } },
3519
3487
  h$1("style", { type: "text/css" },
3520
- styleString$4,
3488
+ styleString$3,
3521
3489
  vanillaStyle$1),
3522
- props.hasHeader && (h$1("div", { class: sheet$4.classes.EndContainer }, props.slots.header)),
3523
- h$1("div", { part: "sqm-column-container", class: sheet$4.classes.ColumnContainer, style: {
3490
+ props.hasHeader && (h$1("div", { class: sheet$3.classes.EndContainer }, props.slots.header)),
3491
+ h$1("div", { part: "sqm-column-container", class: sheet$3.classes.ColumnContainer, style: {
3524
3492
  alignItems: props.verticalAlignment,
3525
3493
  } },
3526
3494
  props.slots.left,
3527
3495
  props.slots.right),
3528
- props.hasFooter && (h$1("div", { class: sheet$4.classes.EndContainer }, props.slots.footer))));
3496
+ props.hasFooter && (h$1("div", { class: sheet$3.classes.EndContainer }, props.slots.footer))));
3529
3497
  }
3530
3498
 
3531
3499
  const ReferralCard = class {
@@ -5248,7 +5216,7 @@ const Gift = () => (h$1("svg", { width: "24", height: "24", viewBox: "0 0 24 24"
5248
5216
  const Circle = () => (h$1("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
5249
5217
  h$1("circle", { cx: "12", cy: "12", r: "9", fill: "currentColor", stroke: "currentColor", "stroke-width": "2" })));
5250
5218
 
5251
- const style$5 = {
5219
+ const style$4 = {
5252
5220
  TimelineReward: {
5253
5221
  color: "var(--sl-color-neutral-900)",
5254
5222
  lineHeight: "var(--sl-line-height-dense)",
@@ -5291,8 +5259,8 @@ const style$5 = {
5291
5259
  },
5292
5260
  },
5293
5261
  };
5294
- const sheet$5 = createStyleSheet(style$5);
5295
- const styleString$5 = sheet$5.toString();
5262
+ const sheet$4 = createStyleSheet(style$4);
5263
+ const styleString$4 = sheet$4.toString();
5296
5264
  const vanillaStyle$2 = `
5297
5265
  :host{
5298
5266
  display: block;
@@ -5305,9 +5273,9 @@ const vanillaStyle$2 = `
5305
5273
  function TimelineEntryView(props) {
5306
5274
  var _a;
5307
5275
  const timeline_icon = (_a = props.icon) !== null && _a !== void 0 ? _a : props.iconState;
5308
- return (h$1("div", { class: sheet$5.classes.TimelineReward, part: "sqm-base" },
5276
+ return (h$1("div", { class: sheet$4.classes.TimelineReward, part: "sqm-base" },
5309
5277
  h$1("style", { type: "text/css" },
5310
- styleString$5,
5278
+ styleString$4,
5311
5279
  vanillaStyle$2),
5312
5280
  h$1("div", { class: "container", part: "sqm-entry-container" },
5313
5281
  h$1("div", { class: "line" }, "/"),
@@ -0,0 +1,67 @@
1
+ import { h } from './index-91e7729f.js';
2
+ import { i as intl } from './global-be1f9992.js';
3
+ import { j as jss, a as create } from './JSS-67b5cff8.js';
4
+
5
+ const style = {
6
+ ErrorStyle: {
7
+ "--sl-input-border-color": "var(--sl-color-danger-500)",
8
+ "--sl-input-background-color": "var(--sl-color-danger-10)",
9
+ "--sl-input-border-color-focus": "var(--sl-color-danger-500)",
10
+ "--sl-input-border-color-hover": "var(--sl-color-danger-500)",
11
+ },
12
+ ErrorMessageStyle: {
13
+ margin: 0,
14
+ color: "var(--sl-color-danger-500)",
15
+ fontSize: "var(--sl-input-help-text-font-size-medium)",
16
+ },
17
+ FieldContainer: {
18
+ "margin-bottom": "var(--sl-spacing-large)",
19
+ },
20
+ };
21
+ const vanillaStyle = `
22
+ :host {
23
+ margin: 0 auto;
24
+ width: 100%;
25
+ display: block;
26
+ }
27
+ sl-select::part(label){
28
+ font-size: var(--sl-input-label-font-size-small);
29
+ font-weight: var(--sl-font-weight-semibold);
30
+ }
31
+ `;
32
+ jss.setup(create());
33
+ const sheet = jss.createStyleSheet(style);
34
+ const styleString = sheet.toString();
35
+ function LeadDropdownFieldView(props) {
36
+ var _a, _b, _c, _d, _e, _f, _g;
37
+ const { states, content } = props;
38
+ const validationErrors = (_a = states === null || states === void 0 ? void 0 : states.leadFormState) === null || _a === void 0 ? void 0 : _a.validationErrors;
39
+ const getRequiredFieldErrorMessage = ({ dropdownLabel, }) => intl.formatMessage({
40
+ id: "requiredFieldErrorMessage",
41
+ defaultMessage: content.requiredFieldErrorMessage,
42
+ }, {
43
+ dropdownLabel,
44
+ });
45
+ return (h("div", { class: sheet.classes.FieldContainer, part: "sqm-base" },
46
+ h("style", { type: "text/css" },
47
+ vanillaStyle,
48
+ styleString),
49
+ h("sl-select", Object.assign({ exportparts: "label: input-label, base: input-base", label: content.dropdownLabel, name: `/${content.dropdownName}` }, (!content.dropdownOptional ? { required: true } : []), { disabled: ((_b = states.leadFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.leadFormState) === null || _c === void 0 ? void 0 : _c.disabled), validationError: ({ value }) => {
50
+ if (!value) {
51
+ return getRequiredFieldErrorMessage({
52
+ dropdownLabel: content.dropdownLabel,
53
+ });
54
+ }
55
+ } }, (((_e = (_d = states.leadFormState) === null || _d === void 0 ? void 0 : _d.validationErrors) === null || _e === void 0 ? void 0 : _e.firstName) ? {
56
+ class: sheet.classes.ErrorStyle,
57
+ helpText: ((_g = (_f = states.leadFormState) === null || _f === void 0 ? void 0 : _f.validationErrors) === null || _g === void 0 ? void 0 : _g.firstName) ||
58
+ content.requiredFieldErrorMessage,
59
+ }
60
+ : [])), content.selectOptions),
61
+ (validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors[content.dropdownName]) && (h("p", { class: sheet.classes.ErrorMessageStyle }, intl.formatMessage({
62
+ id: `errorMessage-${content.dropdownName}`,
63
+ defaultMessage: content.requiredFieldErrorMessage,
64
+ })))));
65
+ }
66
+
67
+ export { LeadDropdownFieldView as L };
@@ -0,0 +1,71 @@
1
+ import { r as registerInstance, h as h$1 } from './index-91e7729f.js';
2
+ import { i as d, n as h } from './stencil-hooks.module-4bc38af4.js';
3
+ import './global-be1f9992.js';
4
+ import { i as isDemo } from './index.module-89a79f66.js';
5
+ import { c as cjs } from './cjs-bdfb4486.js';
6
+ import { a as getMissingProps, g as getProps } from './utils-334c1e34.js';
7
+ import './JSS-67b5cff8.js';
8
+ import { L as LEAD_FORM_STATE_CONTEXT, R as RequiredPropsError } from './useLeadFormState-9016d812.js';
9
+ import { L as LeadDropdownFieldView } from './sqm-lead-dropdown-field-view-4c85fe20.js';
10
+
11
+ function useLeadDropdownField() {
12
+ const leadFormState = d(LEAD_FORM_STATE_CONTEXT);
13
+ return {
14
+ states: {
15
+ leadFormState,
16
+ },
17
+ };
18
+ }
19
+
20
+ const LeadDropdownField = class {
21
+ constructor(hostRef) {
22
+ registerInstance(this, hostRef);
23
+ this.ignored = true;
24
+ /**
25
+ * @uiName Dropdown label
26
+ */
27
+ this.dropdownLabel = "Select an option";
28
+ /**
29
+ * The message to be displayed when a required field is not filled.
30
+ *
31
+ * @uiName Required field message
32
+ * @uiWidget textArea
33
+ */
34
+ this.requiredFieldErrorMessage = "Please select a {dropdownLabel}";
35
+ /**
36
+ * @uiName Optional
37
+ * @default
38
+ */
39
+ this.dropdownOptional = false;
40
+ h(this);
41
+ }
42
+ disconnectedCallback() { }
43
+ render() {
44
+ const missingProps = getMissingProps([
45
+ {
46
+ attribute: "dropdown-name",
47
+ value: this.dropdownName,
48
+ },
49
+ ]);
50
+ if (!isDemo() && missingProps) {
51
+ return (h$1(RequiredPropsError, { missingProps: missingProps, heading: "An error occured while loading this form", subheading: "A technical problem prevented this drop down field from loading. Please contact us with the link to this page.", description: "Values for the following attributes are missing:" }, h$1("slot", null)));
52
+ }
53
+ const content = {
54
+ ...getProps(this),
55
+ selectOptions: h$1("slot", null),
56
+ };
57
+ const { states } = isDemo()
58
+ ? useLeadDropdownFieldDemo(this)
59
+ : useLeadDropdownField();
60
+ return (h$1(LeadDropdownFieldView, { states: states, content: content }));
61
+ }
62
+ };
63
+ function useLeadDropdownFieldDemo(props) {
64
+ return cjs({
65
+ states: {
66
+ leadFormState: {},
67
+ },
68
+ }, props.demoData || {}, { arrayMerge: (_, a) => a });
69
+ }
70
+
71
+ export { LeadDropdownField as sqm_lead_dropdown_field };
@@ -0,0 +1,49 @@
1
+ import { h } from './index-91e7729f.js';
2
+ import { i as intl } from './global-be1f9992.js';
3
+ import { j as jss, a as create } from './JSS-67b5cff8.js';
4
+ import { E as ErrorStyles } from './mixins-83f90fa1.js';
5
+
6
+ const style = {
7
+ ErrorStyle: ErrorStyles,
8
+ FieldContainer: {
9
+ "margin-bottom": "var(--sl-spacing-large)",
10
+ },
11
+ };
12
+ const vanillaStyle = `
13
+ :host {
14
+ margin: 0 auto;
15
+ width: 100%;
16
+ display: block;
17
+ }
18
+ `;
19
+ jss.setup(create());
20
+ const sheet = jss.createStyleSheet(style);
21
+ const styleString = sheet.toString();
22
+ function LeadInputFieldView(props) {
23
+ var _a, _b, _c, _d, _e, _f;
24
+ const { states, content } = props;
25
+ const getRequiredFieldErrorMessage = ({ fieldLabel, }) => intl.formatMessage({
26
+ id: "requiredFieldErrorMessage",
27
+ defaultMessage: content.requiredFieldErrorMessage,
28
+ }, {
29
+ fieldLabel,
30
+ });
31
+ return (h("div", { part: "sqm-base" },
32
+ h("style", { type: "text/css" },
33
+ vanillaStyle,
34
+ styleString),
35
+ h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", name: `/${content.fieldName}`, type: content.fieldType, label: content.fieldLabel }, (!content.fieldOptional ? { required: true } : []), { disabled: ((_a = states.leadFormState) === null || _a === void 0 ? void 0 : _a.loading) || ((_b = states.leadFormState) === null || _b === void 0 ? void 0 : _b.disabled), validationError: ({ value }) => {
36
+ if (!value) {
37
+ return getRequiredFieldErrorMessage({
38
+ fieldLabel: content.fieldLabel,
39
+ });
40
+ }
41
+ } }, (((_d = (_c = states.leadFormState) === null || _c === void 0 ? void 0 : _c.validationErrors) === null || _d === void 0 ? void 0 : _d.firstName) ? {
42
+ class: sheet.classes.ErrorStyle,
43
+ helpText: ((_f = (_e = states.leadFormState) === null || _e === void 0 ? void 0 : _e.validationErrors) === null || _f === void 0 ? void 0 : _f.firstName) ||
44
+ content.requiredFieldErrorMessage,
45
+ }
46
+ : [])))));
47
+ }
48
+
49
+ export { LeadInputFieldView as L };