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

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 (85) hide show
  1. package/dist/cjs/{ShadowViewAddon-c0a5fdf8.js → ShadowViewAddon-f5ca0367.js} +75 -47
  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 +117 -120
  5. package/dist/cjs/sqm-lead-dropdown-field-view-0211d640.js +67 -0
  6. package/dist/cjs/sqm-lead-dropdown-field.cjs.entry.js +81 -0
  7. package/dist/cjs/sqm-lead-input-field-view-5a0b1aed.js +51 -0
  8. package/dist/cjs/sqm-lead-input-field.cjs.entry.js +84 -0
  9. package/dist/cjs/sqm-stencilbook.cjs.entry.js +167 -49
  10. package/dist/cjs/useLeadFormState-c83d2034.js +72 -0
  11. package/dist/collection/collection-manifest.json +3 -1
  12. package/dist/collection/components/sqm-lead-form/LeadForm.stories.js +35 -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 +63 -0
  16. package/dist/collection/components/sqm-lead-form/sqm-lead-dropdown-field.js +199 -0
  17. package/dist/collection/components/sqm-lead-form/sqm-lead-form-view.js +77 -48
  18. package/dist/collection/components/sqm-lead-form/sqm-lead-form.js +150 -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 +228 -0
  21. package/dist/collection/components/sqm-lead-form/useLeadDropdownField.js +10 -0
  22. package/dist/collection/components/sqm-lead-form/useLeadForm.js +36 -7
  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-b360202a.js} +76 -48
  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 +114 -117
  29. package/dist/esm/sqm-lead-dropdown-field-view-62e74a36.js +65 -0
  30. package/dist/esm/sqm-lead-dropdown-field.entry.js +77 -0
  31. package/dist/esm/sqm-lead-input-field-view-9b23f22c.js +49 -0
  32. package/dist/esm/sqm-lead-input-field.entry.js +80 -0
  33. package/dist/esm/sqm-stencilbook.entry.js +167 -49
  34. package/dist/esm/useLeadFormState-9016d812.js +68 -0
  35. package/dist/esm-es5/ShadowViewAddon-b360202a.js +1 -0
  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-62e74a36.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-9b23f22c.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-00590b7a.system.js +1 -0
  47. package/dist/mint-components/p-036e8dad.system.js +1 -0
  48. package/dist/mint-components/{p-8dc110b0.entry.js → p-0f2bbd2a.entry.js} +2 -2
  49. package/dist/mint-components/p-1d704c40.system.js +1 -0
  50. package/dist/mint-components/p-2192104c.entry.js +1 -0
  51. package/dist/mint-components/p-2d15db9b.system.entry.js +1 -0
  52. package/dist/mint-components/{p-373a92a2.js → p-2efc0d36.js} +24 -24
  53. package/dist/mint-components/p-37996351.system.js +1 -1
  54. package/dist/mint-components/p-3e327cc8.system.entry.js +1 -0
  55. package/dist/mint-components/p-789e2217.entry.js +273 -0
  56. package/dist/mint-components/p-84a9e392.system.entry.js +1 -0
  57. package/dist/mint-components/p-8698266c.system.js +1 -0
  58. package/dist/mint-components/p-b54f8e03.entry.js +1 -0
  59. package/dist/mint-components/p-cd10001b.js +1 -0
  60. package/dist/mint-components/p-de5321fc.system.entry.js +1 -0
  61. package/dist/mint-components/p-f6717dd7.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 +8 -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 +6 -1
  74. package/dist/types/components/sqm-lead-form/useLeadInputField.d.ts +6 -0
  75. package/dist/types/components/sqm-referral-iframe/useReferralIframe.d.ts +1 -1
  76. package/dist/types/components.d.ts +194 -12
  77. package/docs/docs.docx +0 -0
  78. package/docs/raisins.json +1 -1
  79. package/grapesjs/grapesjs.js +1 -1
  80. package/package.json +1 -1
  81. package/dist/esm-es5/ShadowViewAddon-aa7177fe.js +0 -1
  82. package/dist/mint-components/p-02a6e0df.system.entry.js +0 -1
  83. package/dist/mint-components/p-0c6ab3ec.system.entry.js +0 -1
  84. package/dist/mint-components/p-6349fb7c.entry.js +0 -265
  85. package/dist/mint-components/p-72e5e84f.system.js +0 -1
@@ -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-${fieldLabel}`,
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[content.fieldName]) ? {
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[content.fieldName]) ||
44
+ content.requiredFieldErrorMessage,
45
+ }
46
+ : [])))));
47
+ }
48
+
49
+ export { LeadInputFieldView as L };
@@ -0,0 +1,80 @@
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 { g as getProps, a as getMissingProps } from './utils-334c1e34.js';
7
+ import './JSS-67b5cff8.js';
8
+ import './mixins-83f90fa1.js';
9
+ import { L as LEAD_FORM_STATE_CONTEXT, R as RequiredPropsError } from './useLeadFormState-9016d812.js';
10
+ import { L as LeadInputFieldView } from './sqm-lead-input-field-view-9b23f22c.js';
11
+
12
+ function useLeadInputField() {
13
+ const leadFormState = d(LEAD_FORM_STATE_CONTEXT);
14
+ return {
15
+ states: {
16
+ leadFormState,
17
+ },
18
+ };
19
+ }
20
+
21
+ const LeadInputField = class {
22
+ constructor(hostRef) {
23
+ registerInstance(this, hostRef);
24
+ this.ignored = true;
25
+ /**
26
+ * @uiName Input type
27
+ * @uiType string
28
+ * @uiEnum ["text", "date", "tel"]
29
+ * @uiEnumNames ["Text", "Date", "Phone Number"]
30
+ */
31
+ this.fieldType = "text";
32
+ /**
33
+ * The message to be displayed when a required field is not filled.
34
+ *
35
+ * @uiName Required field message
36
+ * @uiWidget textArea
37
+ */
38
+ this.requiredFieldErrorMessage = "Please enter a {fieldLabel}";
39
+ /**
40
+ * @uiName Optional
41
+ * @default
42
+ */
43
+ this.fieldOptional = false;
44
+ h(this);
45
+ }
46
+ disconnectedCallback() { }
47
+ render() {
48
+ const content = {
49
+ ...getProps(this),
50
+ };
51
+ const missingProps = getMissingProps([
52
+ {
53
+ attribute: "field-name",
54
+ value: this.fieldName,
55
+ },
56
+ ]);
57
+ if (!isDemo() && missingProps) {
58
+ return (h$1(RequiredPropsError, { missingProps: missingProps, heading: "An error occured while loading this form", subheading: "A technical problem prevented this input field from loading. Please contact us with the link to this page.", description: "Values for the following attributes are missing:" }));
59
+ }
60
+ const { states } = isDemo()
61
+ ? useLeadInputFieldDemo(this)
62
+ : useLeadInputField();
63
+ return (h$1(LeadInputFieldView, { states: states, content: content }));
64
+ }
65
+ };
66
+ function useLeadInputFieldDemo(props) {
67
+ return cjs({
68
+ states: {
69
+ leadForState: {},
70
+ },
71
+ content: {
72
+ fieldName: props.fieldName,
73
+ fieldLabel: props.fieldLabel,
74
+ fieldType: props.fieldType,
75
+ requiredFieldErrorMessage: props.requiredFieldErrorMessage,
76
+ },
77
+ }, props.demoData || {}, { arrayMerge: (_, a) => a });
78
+ }
79
+
80
+ export { LeadInputField as sqm_lead_input_field };
@@ -16,6 +16,7 @@ import { A as AssetCardView } from './sqm-asset-card-view-fe5db3c0.js';
16
16
  import { C as CloseButtonView } from './sqm-close-button-view-f9819751.js';
17
17
  import './index-ffa26b43.js';
18
18
  import { E as EmailRegistrationView } from './email-registration-view-a7818cf2.js';
19
+ import { L as LeadDropdownFieldView } from './sqm-lead-dropdown-field-view-62e74a36.js';
19
20
  import { L as LeaderboardRankView } from './sqm-leaderboard-rank-view-753c8d4a.js';
20
21
  import { L as LogoutCurrentUserView } from './sqm-logout-current-user-view-8ef8180f.js';
21
22
  import { N as NavigationSidebarView } from './sqm-navigation-sidebar-view-9d802b78.js';
@@ -31,9 +32,10 @@ import { P as PortalResetPasswordView } from './sqm-portal-reset-password-view-5
31
32
  import { P as PortalVerifyEmailView } from './sqm-portal-verify-email-view-b12cb894.js';
32
33
  import './ErrorView-48e2b969.js';
33
34
  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 LeadFormView, Q as autoColorScaleCss, U as ShadowViewAddon } from './ShadowViewAddon-aa7177fe.js';
35
+ 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-b360202a.js';
35
36
  import { P as PortalContainerView, a as PortalSectionView } from './sqm-portal-container-view-1683ae32.js';
36
37
  import { O as OtherRegionSlotView, I as InvoiceTableView, T as TaxForm } from './sqm-invoice-table-view-7f376a75.js';
38
+ import { L as LeadInputFieldView } from './sqm-lead-input-field-view-9b23f22c.js';
37
39
 
38
40
  /**
39
41
  * lodash (Custom Build) <https://lodash.com/>
@@ -15832,6 +15834,7 @@ const LeadForm_stories = {
15832
15834
  };
15833
15835
  const defaultProps$t = {
15834
15836
  states: {
15837
+ success: false,
15835
15838
  leadFormState: {},
15836
15839
  error: "",
15837
15840
  loading: false,
@@ -15840,80 +15843,67 @@ const defaultProps$t = {
15840
15843
  callbacks: {
15841
15844
  submit: () => console.log("Submit!"),
15842
15845
  inputFunction: () => { },
15846
+ resetForm: () => { },
15843
15847
  },
15844
15848
  refs: {
15845
15849
  formRef: {},
15846
15850
  },
15847
15851
  content: {
15852
+ submitLabel: "Submit",
15848
15853
  pageLabel: "Submit your information",
15854
+ resubmitFormLabel: "Refer Another Friend",
15849
15855
  requiredFieldErrorMessage: "Cannot be empty",
15850
15856
  invalidEmailErrorMessage: "Must be a valid email address",
15857
+ submitSuccessHeader: "Referral submitted",
15858
+ 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.",
15859
+ submitErrorHeader: "An error occurred while submitting",
15860
+ submitErrorDescription: "Please try again later. If the problem continues, contact Support",
15851
15861
  },
15852
15862
  };
15853
- const errorProps$c = {
15863
+ const successProps$5 = {
15864
+ ...defaultProps$t,
15854
15865
  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
+ ...defaultProps$t.states,
15867
+ success: true,
15868
+ error: null,
15866
15869
  },
15867
15870
  content: {
15868
- pageLabel: "Submit your information",
15869
- requiredFieldErrorMessage: "Cannot be empty",
15870
- invalidEmailErrorMessage: "Must be a valid email address",
15871
+ ...defaultProps$t.content,
15872
+ pageLabel: "Refer your friend",
15873
+ },
15874
+ };
15875
+ const errorProps$c = {
15876
+ ...defaultProps$t,
15877
+ states: {
15878
+ ...defaultProps$t.states,
15879
+ error: "Something went wrong. Please try again.",
15880
+ leadFormState: {
15881
+ validationErrors: {
15882
+ firstName: "Please enter a first name",
15883
+ lastName: "Please enter a last name",
15884
+ email: "Please enter a valid email",
15885
+ },
15886
+ },
15871
15887
  },
15872
15888
  };
15873
15889
  const loadingProps$9 = {
15890
+ ...defaultProps$t,
15874
15891
  states: {
15875
- leadFormState: {},
15876
- error: "",
15892
+ ...defaultProps$t.states,
15877
15893
  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
15894
  },
15892
15895
  };
15893
15896
  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
- },
15897
+ ...defaultProps$t,
15907
15898
  content: {
15908
- pageLabel: "Submit your information",
15909
- requiredFieldErrorMessage: "Cannot be empty",
15910
- invalidEmailErrorMessage: "Must be a valid email address",
15899
+ ...defaultProps$t.content,
15911
15900
  formData: (h("div", null,
15912
15901
  h("sl-input", { style: { marginBottom: "var(--sl-spacing-x-large)" }, exportparts: "label: input-label, base: input-base", label: "Slotted Input", required: true }),
15913
15902
  h("sl-input", { exportparts: "label: input-label, base: input-base", label: "Slotted Input 2", required: true }))),
15914
15903
  },
15915
15904
  };
15916
15905
  const Default$r = () => h(LeadFormView, Object.assign({}, defaultProps$t));
15906
+ const LeadSubmitSuccess = () => h(LeadFormView, Object.assign({}, successProps$5));
15917
15907
  const LeadSubmitWithError = () => h(LeadFormView, Object.assign({}, errorProps$c));
15918
15908
  const LeadSubmitLoading = () => h(LeadFormView, Object.assign({}, loadingProps$9));
15919
15909
  const FieldsHidden$2 = () => {
@@ -15921,6 +15911,7 @@ const FieldsHidden$2 = () => {
15921
15911
  states: {
15922
15912
  leadFormState: {},
15923
15913
  error: "",
15914
+ success: false,
15924
15915
  loading: true,
15925
15916
  referralCode: "ABC123",
15926
15917
  },
@@ -15932,12 +15923,137 @@ const LeadForm = /*#__PURE__*/Object.freeze({
15932
15923
  __proto__: null,
15933
15924
  'default': LeadForm_stories,
15934
15925
  Default: Default$r,
15926
+ LeadSubmitSuccess: LeadSubmitSuccess,
15935
15927
  LeadSubmitWithError: LeadSubmitWithError,
15936
15928
  LeadSubmitLoading: LeadSubmitLoading,
15937
15929
  FieldsHidden: FieldsHidden$2,
15938
15930
  SlottedInputs: SlottedInputs$2
15939
15931
  });
15940
15932
 
15933
+ const LeadInputField_stories = {
15934
+ title: "Components/Lead Form Input Field",
15935
+ };
15936
+ const defaultProps$u = {
15937
+ states: {
15938
+ leadFormState: {
15939
+ validationErrors: {},
15940
+ loading: false,
15941
+ disabled: false,
15942
+ initialData: {},
15943
+ },
15944
+ },
15945
+ content: {
15946
+ fieldName: "firstName",
15947
+ fieldLabel: "First Name",
15948
+ fieldType: "text",
15949
+ requiredFieldErrorMessage: "Please {fieldAction} a {fieldLabel}",
15950
+ fieldOptional: false,
15951
+ },
15952
+ };
15953
+ const Default$s = () => h(LeadInputFieldView, Object.assign({}, defaultProps$u));
15954
+ const WithError = () => (h(LeadInputFieldView, Object.assign({}, defaultProps$u, { states: {
15955
+ ...defaultProps$u.states,
15956
+ leadFormState: {
15957
+ ...defaultProps$u.states.leadFormState,
15958
+ validationErrors: {
15959
+ firstName: "Please enter a first name",
15960
+ },
15961
+ },
15962
+ } })));
15963
+ const Disabled$2 = () => (h(LeadInputFieldView, Object.assign({}, defaultProps$u, { states: {
15964
+ ...defaultProps$u.states,
15965
+ leadFormState: {
15966
+ ...defaultProps$u.states.leadFormState,
15967
+ disabled: true,
15968
+ },
15969
+ } })));
15970
+ const WithInitialValue = () => (h(LeadInputFieldView, Object.assign({}, defaultProps$u, { states: {
15971
+ ...defaultProps$u.states,
15972
+ leadFormState: {
15973
+ ...defaultProps$u.states.leadFormState,
15974
+ initialData: {
15975
+ firstName: "Jane",
15976
+ },
15977
+ },
15978
+ } })));
15979
+
15980
+ const LeadInputField = /*#__PURE__*/Object.freeze({
15981
+ __proto__: null,
15982
+ 'default': LeadInputField_stories,
15983
+ Default: Default$s,
15984
+ WithError: WithError,
15985
+ Disabled: Disabled$2,
15986
+ WithInitialValue: WithInitialValue
15987
+ });
15988
+
15989
+ const LeadFormDropdownField_stories = {
15990
+ title: "Components/Lead Form Dropdown Field",
15991
+ };
15992
+ const defaultProps$v = {
15993
+ states: {
15994
+ leadFormState: {
15995
+ validationErrors: {},
15996
+ loading: false,
15997
+ disabled: false,
15998
+ initialData: {},
15999
+ },
16000
+ },
16001
+ content: {
16002
+ dropdownName: "country",
16003
+ dropdownLabel: "Country",
16004
+ requiredFieldErrorMessage: "Please select a country",
16005
+ dropdownOptional: false,
16006
+ selectOptions: [
16007
+ h("sl-menu-item", { value: "red" }, "Canada"),
16008
+ h("sl-menu-item", { value: "blue" }, "United States"),
16009
+ h("sl-menu-item", { value: "green" }, "Mexico"),
16010
+ ],
16011
+ },
16012
+ };
16013
+ const Default$t = () => h(LeadDropdownFieldView, Object.assign({}, defaultProps$v));
16014
+ const WithError$1 = () => (h(LeadDropdownFieldView, Object.assign({}, defaultProps$v, { states: {
16015
+ ...defaultProps$v.states,
16016
+ leadFormState: {
16017
+ ...defaultProps$v.states.leadFormState,
16018
+ validationErrors: {
16019
+ country: "Please select a country",
16020
+ },
16021
+ },
16022
+ } })));
16023
+ const Disabled$3 = () => (h(LeadDropdownFieldView, Object.assign({}, defaultProps$v, { states: {
16024
+ ...defaultProps$v.states,
16025
+ leadFormState: {
16026
+ ...defaultProps$v.states.leadFormState,
16027
+ disabled: true,
16028
+ },
16029
+ } })));
16030
+ const Loading$d = () => (h(LeadDropdownFieldView, Object.assign({}, defaultProps$v, { states: {
16031
+ ...defaultProps$v.states,
16032
+ leadFormState: {
16033
+ ...defaultProps$v.states.leadFormState,
16034
+ loading: true,
16035
+ },
16036
+ } })));
16037
+ const WithInitialValue$1 = () => (h(LeadDropdownFieldView, Object.assign({}, defaultProps$v, { states: {
16038
+ ...defaultProps$v.states,
16039
+ leadFormState: {
16040
+ ...defaultProps$v.states.leadFormState,
16041
+ initialData: {
16042
+ country: "Canada",
16043
+ },
16044
+ },
16045
+ } })));
16046
+
16047
+ const LeadFormDropdownField = /*#__PURE__*/Object.freeze({
16048
+ __proto__: null,
16049
+ 'default': LeadFormDropdownField_stories,
16050
+ Default: Default$t,
16051
+ WithError: WithError$1,
16052
+ Disabled: Disabled$3,
16053
+ Loading: Loading$d,
16054
+ WithInitialValue: WithInitialValue$1
16055
+ });
16056
+
15941
16057
  /**
15942
16058
  *
15943
16059
  * Themes
@@ -15950,7 +16066,7 @@ const LeadForm = /*#__PURE__*/Object.freeze({
15950
16066
  *
15951
16067
  */
15952
16068
  //
15953
- const Default$s = `
16069
+ const Default$u = `
15954
16070
  // No CSS
15955
16071
  `;
15956
16072
  const Orangey = `
@@ -15984,7 +16100,7 @@ const Klip = `
15984
16100
 
15985
16101
  const Themes = /*#__PURE__*/Object.freeze({
15986
16102
  __proto__: null,
15987
- Default: Default$s,
16103
+ Default: Default$u,
15988
16104
  Orangey: Orangey,
15989
16105
  Netflix: Netflix,
15990
16106
  SaaSquatchCorporate: SaaSquatchCorporate,
@@ -18676,6 +18792,8 @@ const stories = [
18676
18792
  PayoutStatusAlert,
18677
18793
  QRCode,
18678
18794
  LeadForm,
18795
+ LeadInputField,
18796
+ LeadFormDropdownField,
18679
18797
  ];
18680
18798
  const StencilStorybook = class {
18681
18799
  constructor(hostRef) {
@@ -0,0 +1,68 @@
1
+ import { h } from './index-91e7729f.js';
2
+ import { k as useState, y } from './stencil-hooks.module-4bc38af4.js';
3
+ import { i as intl } from './global-be1f9992.js';
4
+ import { _ } from './index.module-89a79f66.js';
5
+ import { c as createStyleSheet } from './JSS-67b5cff8.js';
6
+
7
+ const style = {
8
+ IconStyle: {
9
+ display: "block",
10
+ position: "absolute",
11
+ top: "23px",
12
+ },
13
+ DivStyle: {
14
+ marginLeft: "28px",
15
+ },
16
+ Details: {
17
+ marginLeft: "28px",
18
+ },
19
+ Heading: {
20
+ display: "inline-block",
21
+ },
22
+ Children: {
23
+ display: "none",
24
+ },
25
+ };
26
+ const sheet = createStyleSheet(style);
27
+ const styleString = sheet.toString();
28
+ 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) {
29
+ if (!missingProps)
30
+ return false;
31
+ const host = _();
32
+ const [detailsOpen, setDetailsOpen] = useState(false);
33
+ return (h("sl-alert", { type: "danger", open: true },
34
+ h("style", { type: "text/css" }, styleString),
35
+ h("div", { slot: "icon", class: sheet.classes.IconStyle },
36
+ h("sl-icon", { name: "exclamation-octagon" })),
37
+ h("div", { class: sheet.classes.DivStyle },
38
+ h("h2", { class: sheet.classes.Heading }, intl.formatMessage({
39
+ id: `error-heading`,
40
+ defaultMessage: heading,
41
+ })),
42
+ h("p", null, intl.formatMessage({
43
+ id: `error-subheading`,
44
+ defaultMessage: subheading,
45
+ }))),
46
+ h("details", { class: sheet.classes.Details },
47
+ h("summary", { onClick: () => setDetailsOpen(!detailsOpen) },
48
+ detailsOpen ? "Less" : "More",
49
+ " details"),
50
+ h("p", null, intl.formatMessage({
51
+ id: `error-description`,
52
+ defaultMessage: description,
53
+ }, { tagName: host.tagName.toLowerCase() })),
54
+ h("ul", null, missingProps.map((prop) => (h("li", null,
55
+ h("strong", null, prop.attribute)))))),
56
+ h("div", { class: sheet.classes.Children }, children)));
57
+ }
58
+
59
+ const LEAD_FORM_STATE_CONTEXT = "sq:lead-form-state";
60
+ const LEAD_FORM_STATE_CONTEXT_INTERNAL = "sq:lead-form-state-internal";
61
+ function useLeadFormState(formState) {
62
+ const host = _();
63
+ const [leadFormState, setLeadFormState] = y(host, LEAD_FORM_STATE_CONTEXT, formState);
64
+ y(host, LEAD_FORM_STATE_CONTEXT_INTERNAL, [leadFormState, setLeadFormState]);
65
+ return { leadFormState, setLeadFormState };
66
+ }
67
+
68
+ export { LEAD_FORM_STATE_CONTEXT as L, RequiredPropsError as R, useLeadFormState as u };