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

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-69513385.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-e2373fc6.js +51 -0
  8. package/dist/cjs/sqm-lead-input-field.cjs.entry.js +86 -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 +248 -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-0f91101f.js +67 -0
  30. package/dist/esm/sqm-lead-dropdown-field.entry.js +71 -0
  31. package/dist/esm/sqm-lead-input-field-view-6bc3aae8.js +49 -0
  32. package/dist/esm/sqm-lead-input-field.entry.js +82 -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-0f91101f.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-6bc3aae8.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-12f4bb08.system.entry.js +1 -0
  47. package/dist/mint-components/p-13c67985.system.entry.js +1 -0
  48. package/dist/mint-components/p-1d704c40.system.js +1 -0
  49. package/dist/mint-components/p-37996351.system.js +1 -1
  50. package/dist/mint-components/{p-373a92a2.js → p-4139feb5.js} +3 -3
  51. package/dist/mint-components/p-47144172.system.entry.js +1 -0
  52. package/dist/mint-components/p-4e42e6a1.entry.js +1 -0
  53. package/dist/mint-components/p-506e7681.js +1 -0
  54. package/dist/mint-components/p-68acdfe8.system.js +1 -0
  55. package/dist/mint-components/p-6c57e7e6.js +1 -0
  56. package/dist/mint-components/{p-8dc110b0.entry.js → p-a15b3197.entry.js} +2 -2
  57. package/dist/mint-components/{p-72e5e84f.system.js → p-ad6420a2.system.js} +1 -1
  58. package/dist/mint-components/p-daf77001.system.js +1 -0
  59. package/dist/mint-components/p-db412748.system.entry.js +1 -0
  60. package/dist/mint-components/p-e358f0c1.entry.js +265 -0
  61. package/dist/mint-components/p-f16bd3ab.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 +16 -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 +15 -0
  71. package/dist/types/components/sqm-lead-form/sqm-lead-input-field.d.ts +50 -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 +196 -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
@@ -0,0 +1,48 @@
1
+ import { h } from "@stencil/core";
2
+ import { LeadInputFieldView, } from "./sqm-lead-input-field-view";
3
+ export default {
4
+ title: "Components/Lead Form Input Field",
5
+ };
6
+ const defaultProps = {
7
+ states: {
8
+ leadFormState: {
9
+ validationErrors: {},
10
+ loading: false,
11
+ disabled: false,
12
+ initialData: {},
13
+ },
14
+ },
15
+ content: {
16
+ fieldName: "firstName",
17
+ fieldLabel: "First Name",
18
+ fieldType: "text",
19
+ requiredFieldErrorMessage: "Please {fieldAction} a {fieldLabel}",
20
+ fieldOptional: false,
21
+ },
22
+ };
23
+ export const Default = () => h(LeadInputFieldView, Object.assign({}, defaultProps));
24
+ export const WithError = () => (h(LeadInputFieldView, Object.assign({}, defaultProps, { states: {
25
+ ...defaultProps.states,
26
+ leadFormState: {
27
+ ...defaultProps.states.leadFormState,
28
+ validationErrors: {
29
+ firstName: "Please enter a first name",
30
+ },
31
+ },
32
+ } })));
33
+ export const Disabled = () => (h(LeadInputFieldView, Object.assign({}, defaultProps, { states: {
34
+ ...defaultProps.states,
35
+ leadFormState: {
36
+ ...defaultProps.states.leadFormState,
37
+ disabled: true,
38
+ },
39
+ } })));
40
+ export const WithInitialValue = () => (h(LeadInputFieldView, Object.assign({}, defaultProps, { states: {
41
+ ...defaultProps.states,
42
+ leadFormState: {
43
+ ...defaultProps.states.leadFormState,
44
+ initialData: {
45
+ firstName: "Jane",
46
+ },
47
+ },
48
+ } })));
@@ -0,0 +1,65 @@
1
+ import { h } from "@stencil/core";
2
+ import jss from "jss";
3
+ import preset from "jss-preset-default";
4
+ import { intl } from "../../global/global";
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(preset());
33
+ const sheet = jss.createStyleSheet(style);
34
+ const styleString = sheet.toString();
35
+ export 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), required: content.required, 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
+ }
@@ -0,0 +1,193 @@
1
+ import { isDemo } from "@saasquatch/component-boilerplate";
2
+ import { withHooks } from "@saasquatch/stencil-hooks";
3
+ import { Component, h, Prop, State } from "@stencil/core";
4
+ import deepmerge from "deepmerge";
5
+ import { RequiredPropsError } from "../../utils/RequiredPropsError";
6
+ import { getMissingProps, getProps } from "../../utils/utils";
7
+ import { LeadDropdownFieldView, } from "./sqm-lead-dropdown-field-view";
8
+ import { useLeadDropdownField } from "./useLeadDropdownField";
9
+ /**
10
+ * @uiName Lead Form Dropdown Field
11
+ * @validParents ["sqm-lead-form"]
12
+ * @slots [{"name":"", "title":"Drop Down Option"}]
13
+ * @exampleGroup Microsite Components
14
+ * @example Lead Form Dropdown Field - <sqm-lead-dropdown-field dropdown-label="Select an option" required-field-error-message="Please select an option"><sl-menu-item value="option-1">Option 1</sl-menu-item><sl-menu-item value="option-2">Option 2</sl-menu-item><sl-menu-item value="option-3">Option 3</sl-menu-item></sqm-lead-dropdown-field>
15
+ */
16
+ export class LeadDropdownField {
17
+ constructor() {
18
+ this.ignored = true;
19
+ /**
20
+ * @uiName Dropdown label
21
+ */
22
+ this.dropdownLabel = "Select an option";
23
+ /**
24
+ * The message to be displayed when a required field is not filled.
25
+ *
26
+ * @uiName Required field message
27
+ * @uiWidget textArea
28
+ */
29
+ this.requiredFieldErrorMessage = "Please select a {dropdownLabel}";
30
+ /**
31
+ * @uiName Optional
32
+ * @default
33
+ */
34
+ this.dropdownOptional = false;
35
+ withHooks(this);
36
+ }
37
+ disconnectedCallback() { }
38
+ render() {
39
+ const missingProps = getMissingProps([
40
+ {
41
+ attribute: "dropdown-name",
42
+ value: this.dropdownName,
43
+ },
44
+ ]);
45
+ if (!isDemo() && missingProps) {
46
+ return (h(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:" },
47
+ h("slot", null)));
48
+ }
49
+ const content = {
50
+ ...getProps(this),
51
+ selectOptions: h("slot", null),
52
+ };
53
+ const { states } = isDemo()
54
+ ? useLeadDropdownFieldDemo(this)
55
+ : useLeadDropdownField();
56
+ return (h(LeadDropdownFieldView, { states: states, content: content }));
57
+ }
58
+ static get is() { return "sqm-lead-dropdown-field"; }
59
+ static get properties() { return {
60
+ "dropdownName": {
61
+ "type": "string",
62
+ "mutable": false,
63
+ "complexType": {
64
+ "original": "string",
65
+ "resolved": "string",
66
+ "references": {}
67
+ },
68
+ "required": false,
69
+ "optional": false,
70
+ "docs": {
71
+ "tags": [{
72
+ "text": "Dropdown name attribute",
73
+ "name": "uiName"
74
+ }, {
75
+ "text": undefined,
76
+ "name": "required"
77
+ }],
78
+ "text": "This name is used as the key for this form field on submission. The name must be unique within this specific form."
79
+ },
80
+ "attribute": "dropdown-name",
81
+ "reflect": false
82
+ },
83
+ "dropdownLabel": {
84
+ "type": "string",
85
+ "mutable": false,
86
+ "complexType": {
87
+ "original": "string",
88
+ "resolved": "string",
89
+ "references": {}
90
+ },
91
+ "required": false,
92
+ "optional": false,
93
+ "docs": {
94
+ "tags": [{
95
+ "text": "Dropdown label",
96
+ "name": "uiName"
97
+ }],
98
+ "text": ""
99
+ },
100
+ "attribute": "dropdown-label",
101
+ "reflect": false,
102
+ "defaultValue": "\"Select an option\""
103
+ },
104
+ "requiredFieldErrorMessage": {
105
+ "type": "string",
106
+ "mutable": false,
107
+ "complexType": {
108
+ "original": "string",
109
+ "resolved": "string",
110
+ "references": {}
111
+ },
112
+ "required": false,
113
+ "optional": false,
114
+ "docs": {
115
+ "tags": [{
116
+ "text": "Required field message",
117
+ "name": "uiName"
118
+ }, {
119
+ "text": "textArea",
120
+ "name": "uiWidget"
121
+ }],
122
+ "text": "The message to be displayed when a required field is not filled."
123
+ },
124
+ "attribute": "required-field-error-message",
125
+ "reflect": false,
126
+ "defaultValue": "\"Please select a {dropdownLabel}\""
127
+ },
128
+ "dropdownOptional": {
129
+ "type": "boolean",
130
+ "mutable": false,
131
+ "complexType": {
132
+ "original": "boolean",
133
+ "resolved": "boolean",
134
+ "references": {}
135
+ },
136
+ "required": false,
137
+ "optional": true,
138
+ "docs": {
139
+ "tags": [{
140
+ "text": "Optional",
141
+ "name": "uiName"
142
+ }, {
143
+ "text": undefined,
144
+ "name": "default"
145
+ }],
146
+ "text": ""
147
+ },
148
+ "attribute": "dropdown-optional",
149
+ "reflect": false,
150
+ "defaultValue": "false"
151
+ },
152
+ "demoData": {
153
+ "type": "unknown",
154
+ "mutable": false,
155
+ "complexType": {
156
+ "original": "DemoData<DropdownFieldViewProps>",
157
+ "resolved": "{ states?: { leadFormState?: LeadFormState; }; content?: { required: boolean; dropdownName: string; dropdownLabel: string; dropdownOptional?: boolean; requiredFieldErrorMessage?: string; selectOptions?: VNode | VNode[]; }; }",
158
+ "references": {
159
+ "DemoData": {
160
+ "location": "import",
161
+ "path": "../../global/demo"
162
+ },
163
+ "DropdownFieldViewProps": {
164
+ "location": "import",
165
+ "path": "./sqm-lead-dropdown-field-view"
166
+ }
167
+ }
168
+ },
169
+ "required": false,
170
+ "optional": true,
171
+ "docs": {
172
+ "tags": [{
173
+ "text": undefined,
174
+ "name": "undocumented"
175
+ }, {
176
+ "text": "object",
177
+ "name": "uiType"
178
+ }],
179
+ "text": ""
180
+ }
181
+ }
182
+ }; }
183
+ static get states() { return {
184
+ "ignored": {}
185
+ }; }
186
+ }
187
+ function useLeadDropdownFieldDemo(props) {
188
+ return deepmerge({
189
+ states: {
190
+ leadFormState: {},
191
+ },
192
+ }, props.demoData || {}, { arrayMerge: (_, a) => a });
193
+ }
@@ -2,6 +2,7 @@ import { h } from "@stencil/core";
2
2
  import { AuthButtonsContainer, AuthColumn, AuthWrapper, ErrorStyles, HostBlock, } from "../../global/mixins";
3
3
  import { createStyleSheet } from "../../styling/JSS";
4
4
  import { TextSpanView } from "../sqm-text-span/sqm-text-span-view";
5
+ import { intl } from "../../global/global";
5
6
  const style = {
6
7
  Wrapper: { ...AuthWrapper, "max-width": "600px" },
7
8
  Column: AuthColumn,
@@ -10,7 +11,24 @@ const style = {
10
11
  margin: "0 auto",
11
12
  width: "100%",
12
13
  },
14
+ NameFieldWrapper: {
15
+ display: "flex",
16
+ gap: "var(--sl-spacing-medium)",
17
+ },
18
+ ContinueButton: { maxWidth: "169px" },
13
19
  ButtonsContainer: AuthButtonsContainer,
20
+ SuccessAlertContainer: {
21
+ "&::part(base)": {
22
+ backgroundColor: "var(--sl-color-green-100)",
23
+ borderTop: "none",
24
+ },
25
+ },
26
+ ErrorAlertContainer: {
27
+ "&::part(base)": {
28
+ backgroundColor: "var(--sl-color-red-100)",
29
+ borderTop: "none",
30
+ },
31
+ },
14
32
  ErrorStyle: ErrorStyles,
15
33
  };
16
34
  const vanillaStyle = `
@@ -31,50 +49,65 @@ sqm-portal-register {
31
49
  const sheet = createStyleSheet(style);
32
50
  const styleString = sheet.toString();
33
51
  export function LeadFormView(props) {
34
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
52
+ var _a, _b, _c, _d;
35
53
  const { states, refs, callbacks, content } = props;
36
54
  if (states.error) {
37
55
  window.scrollTo({ top: 0, left: 0, behavior: "smooth" });
38
56
  }
57
+ const getRequiredFieldErrorMessage = ({ fieldLabel, }) => intl.formatMessage({
58
+ id: "requiredFieldErrorMessage",
59
+ defaultMessage: content.requiredFieldErrorMessage,
60
+ }, {
61
+ fieldLabel,
62
+ });
63
+ if (states.success) {
64
+ return (h("div", { class: sheet.classes.Wrapper, part: "sqm-base" },
65
+ h("style", { type: "text/css" },
66
+ vanillaStyle,
67
+ styleString),
68
+ h(TextSpanView, { type: "h3" }, content.pageLabel),
69
+ h("sqm-form-message", { exportparts: "success-icon" },
70
+ h("b", null, content.submitSuccessHeader),
71
+ h("br", null),
72
+ h("div", { part: "successalert-text" }, content.submitSuccessDescription)),
73
+ h("sl-button", {
74
+ // AL: TODO add button to allow user to submit another form
75
+ class: sheet.classes.ContinueButton,
76
+ // onClick={callbacks.submitAnotherForm}
77
+ loading: states.loading, exportparts: "base: primarybutton-base", type: "default" }, content.resubmitFormLabel)));
78
+ }
39
79
  return (h("div", { class: sheet.classes.Wrapper, part: "sqm-base" },
40
80
  h("style", { type: "text/css" },
41
81
  vanillaStyle,
42
82
  styleString),
43
83
  h(TextSpanView, { type: "h3" }, content.pageLabel),
44
84
  h("sl-form", { class: sheet.classes.Column, "onSl-submit": callbacks.submit, ref: (el) => (refs.formRef.current = el), novalidate: true },
45
- states.error && (h("sqm-form-message", { type: "error", exportparts: "erroralert-icon" },
46
- h("div", { part: "erroralert-text" }, props.states.error))),
47
- h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", type: "text", name: "/lastName", label: content.firstNameLabel || "First Name", disabled: states.loading, required: true, validationError: ({ value }) => {
48
- if (!value) {
49
- return content.requiredFieldErrorMessage;
50
- }
51
- } }, (((_b = (_a = states.leadFormState) === null || _a === void 0 ? void 0 : _a.validationErrors) === null || _b === void 0 ? void 0 : _b.firstName) ? {
52
- class: sheet.classes.ErrorStyle,
53
- helpText: ((_d = (_c = states.leadFormState) === null || _c === void 0 ? void 0 : _c.validationErrors) === null || _d === void 0 ? void 0 : _d.firstName) ||
54
- content.requiredFieldErrorMessage,
55
- }
56
- : []))),
57
- h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", type: "text", name: "/lastName", label: content.lastNameLabel || "Last Name", disabled: states.loading, required: true, validationError: ({ value }) => {
58
- if (!value) {
59
- return content.requiredFieldErrorMessage;
60
- }
61
- } }, (((_f = (_e = states.leadFormState) === null || _e === void 0 ? void 0 : _e.validationErrors) === null || _f === void 0 ? void 0 : _f.lastName) ? {
62
- class: sheet.classes.ErrorStyle,
63
- helpText: ((_h = (_g = states.leadFormState) === null || _g === void 0 ? void 0 : _g.validationErrors) === null || _h === void 0 ? void 0 : _h.lastName) ||
64
- content.requiredFieldErrorMessage,
65
- }
66
- : []))),
85
+ states.error && (h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: "danger", class: sheet.classes.ErrorAlertContainer, open: true },
86
+ h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
87
+ h("b", null, content.submitErrorHeader),
88
+ h("br", null),
89
+ intl.formatMessage({
90
+ id: "submitErrorDescription",
91
+ defaultMessage: content.submitErrorDescription,
92
+ }, {
93
+ supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, content.supportLink)),
94
+ }))),
95
+ h("div", { class: sheet.classes.NameFieldWrapper },
96
+ h("sqm-lead-input-field", { style: { width: "50%" }, "field-label": "First Name", "field-name": "firstName" }),
97
+ h("sqm-lead-input-field", { style: { width: "50%" }, "field-label": "Last Name", "field-name": "lastName" })),
67
98
  h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", type: "email", name: "/email", label: content.emailLabel || "Email", disabled: states.loading, required: true, validationError: ({ value }) => {
68
99
  if (!value) {
69
- return content.requiredFieldErrorMessage;
100
+ return getRequiredFieldErrorMessage({
101
+ fieldLabel: content.emailLabel || "Email",
102
+ });
70
103
  }
71
104
  // this matches shoelace validation, but could be better
72
105
  if (!value.includes("@")) {
73
106
  return content.invalidEmailErrorMessage;
74
107
  }
75
- } }, (((_k = (_j = states.leadFormState) === null || _j === void 0 ? void 0 : _j.validationErrors) === null || _k === void 0 ? void 0 : _k.email) ? {
108
+ } }, (((_b = (_a = states.leadFormState) === null || _a === void 0 ? void 0 : _a.validationErrors) === null || _b === void 0 ? void 0 : _b.email) ? {
76
109
  class: sheet.classes.ErrorStyle,
77
- helpText: ((_m = (_l = states.leadFormState) === null || _l === void 0 ? void 0 : _l.validationErrors) === null || _m === void 0 ? void 0 : _m.email) ||
110
+ helpText: ((_d = (_c = states.leadFormState) === null || _c === void 0 ? void 0 : _c.validationErrors) === null || _d === void 0 ? void 0 : _d.email) ||
78
111
  content.requiredFieldErrorMessage,
79
112
  }
80
113
  : []))),