@saasquatch/mint-components 1.14.6-3 → 1.14.6-31
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.
- package/dist/cjs/{ShadowViewAddon-40f0bc74.js → ShadowViewAddon-cfd0e201.js} +115 -48
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/{sqm-big-stat_42.cjs.entry.js → sqm-big-stat_43.cjs.entry.js} +136 -22
- package/dist/cjs/{sqm-lead-input-field-view-6344cd93.js → sqm-lead-input-field-view-89308aab.js} +7 -7
- package/dist/cjs/sqm-lead-input-field.cjs.entry.js +12 -2
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +17 -10
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/sqm-dropdown-field/sqm-dropdown-field-view.js +1 -1
- package/dist/collection/components/sqm-lead-form/LeadForm.stories.js +5 -2
- package/dist/collection/components/sqm-lead-form/LeadFormDropdownField.stories.js +3 -0
- package/dist/collection/components/sqm-lead-form/LeadInputField.stories.js +1 -0
- package/dist/collection/components/sqm-lead-form/sqm-lead-dropdown-field-view.js +8 -10
- package/dist/collection/components/sqm-lead-form/sqm-lead-dropdown-field.js +62 -2
- package/dist/collection/components/sqm-lead-form/sqm-lead-form-view.js +56 -50
- package/dist/collection/components/sqm-lead-form/sqm-lead-form.js +64 -34
- package/dist/collection/components/sqm-lead-form/sqm-lead-input-field-view.js +7 -7
- package/dist/collection/components/sqm-lead-form/sqm-lead-input-field.js +34 -3
- package/dist/collection/components/sqm-lead-form/useLeadForm.js +32 -6
- package/dist/esm/{ShadowViewAddon-8a0d9e83.js → ShadowViewAddon-00515b50.js} +116 -50
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/{sqm-big-stat_42.entry.js → sqm-big-stat_43.entry.js} +136 -23
- package/dist/esm/{sqm-lead-input-field-view-f1dd4b77.js → sqm-lead-input-field-view-4ede5d7f.js} +7 -7
- package/dist/esm/sqm-lead-input-field.entry.js +12 -2
- package/dist/esm/sqm-stencilbook.entry.js +12 -5
- package/dist/esm-es5/ShadowViewAddon-00515b50.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-big-stat_43.entry.js +1 -0
- package/dist/esm-es5/sqm-lead-input-field-view-4ede5d7f.js +1 -0
- package/dist/esm-es5/sqm-lead-input-field.entry.js +1 -1
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-01dd541f.system.js +1 -0
- package/dist/mint-components/p-37996351.system.js +1 -1
- package/dist/mint-components/p-6544656d.system.js +1 -0
- package/dist/mint-components/p-6ba44ca9.js +1 -0
- package/dist/mint-components/{p-cd1c6113.entry.js → p-ad24132a.entry.js} +2 -2
- package/dist/mint-components/p-c2375fad.system.entry.js +1 -0
- package/dist/mint-components/{p-e358f0c1.entry.js → p-cc9ec01e.entry.js} +28 -20
- package/dist/mint-components/p-d3144467.system.entry.js +1 -0
- package/dist/mint-components/p-d3e72503.entry.js +1 -0
- package/dist/mint-components/{p-4139feb5.js → p-eb9ecf25.js} +24 -24
- package/dist/mint-components/p-fbbb85f0.system.entry.js +1 -0
- package/dist/types/components/sqm-lead-form/LeadFormDropdownField.stories.d.ts +1 -0
- package/dist/types/components/sqm-lead-form/sqm-lead-dropdown-field-view.d.ts +3 -1
- package/dist/types/components/sqm-lead-form/sqm-lead-dropdown-field.d.ts +10 -1
- package/dist/types/components/sqm-lead-form/sqm-lead-form-view.d.ts +2 -1
- package/dist/types/components/sqm-lead-form/sqm-lead-form.d.ts +18 -9
- package/dist/types/components/sqm-lead-form/sqm-lead-input-field-view.d.ts +1 -0
- package/dist/types/components/sqm-lead-form/sqm-lead-input-field.d.ts +4 -0
- package/dist/types/components/sqm-lead-form/useLeadForm.d.ts +2 -1
- package/dist/types/components/sqm-referral-iframe/useReferralIframe.d.ts +1 -1
- package/dist/types/components.d.ts +63 -19
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/sqm-lead-dropdown-field-view-03a3e03f.js +0 -69
- package/dist/cjs/sqm-lead-dropdown-field.cjs.entry.js +0 -75
- package/dist/esm/sqm-lead-dropdown-field-view-4c85fe20.js +0 -67
- package/dist/esm/sqm-lead-dropdown-field.entry.js +0 -71
- package/dist/esm-es5/ShadowViewAddon-8a0d9e83.js +0 -1
- package/dist/esm-es5/sqm-big-stat_42.entry.js +0 -1
- package/dist/esm-es5/sqm-lead-dropdown-field-view-4c85fe20.js +0 -1
- package/dist/esm-es5/sqm-lead-dropdown-field.entry.js +0 -1
- package/dist/esm-es5/sqm-lead-input-field-view-f1dd4b77.js +0 -1
- package/dist/mint-components/p-13c67985.system.entry.js +0 -1
- package/dist/mint-components/p-15f1ff1d.system.js +0 -1
- package/dist/mint-components/p-26da31c6.js +0 -1
- package/dist/mint-components/p-4d5b02af.js +0 -1
- package/dist/mint-components/p-87384d9e.system.js +0 -1
- package/dist/mint-components/p-875861d7.system.entry.js +0 -1
- package/dist/mint-components/p-8af8ab01.system.entry.js +0 -1
- package/dist/mint-components/p-9e1570bf.system.entry.js +0 -1
- package/dist/mint-components/p-ad6420a2.system.js +0 -1
- package/dist/mint-components/p-b8c15858.entry.js +0 -1
- package/dist/mint-components/p-f59d6012.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useMutation } from "@saasquatch/component-boilerplate";
|
|
1
|
+
import { useMutation, useProgramId, useQuery, useUserIdentity, } from "@saasquatch/component-boilerplate";
|
|
2
2
|
import { useCallback, useEffect, useRef, useState, } from "@saasquatch/universal-hooks";
|
|
3
3
|
import { gql } from "graphql-request";
|
|
4
4
|
import jsonpointer from "jsonpointer";
|
|
@@ -11,10 +11,23 @@ const SUBMIT_LEAD = gql `
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
`;
|
|
14
|
+
const GET_USER_DETAILS = gql `
|
|
15
|
+
query getUser($programId: ID) {
|
|
16
|
+
viewer {
|
|
17
|
+
... on User {
|
|
18
|
+
referralCode(programId: $programId)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
14
23
|
export function useLeadForm(props) {
|
|
15
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
24
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
16
25
|
const formRef = useRef(null);
|
|
17
26
|
const { leadFormState, setLeadFormState } = useLeadFormState({});
|
|
27
|
+
const programId = useProgramId();
|
|
28
|
+
const user = useUserIdentity();
|
|
29
|
+
const { data: userDetails } = useQuery(GET_USER_DETAILS, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt) || !programId);
|
|
30
|
+
console.log({ userDetails });
|
|
18
31
|
const [submitLead, { loading, errors, data }] = useMutation(SUBMIT_LEAD);
|
|
19
32
|
const [success, setSuccess] = useState(false);
|
|
20
33
|
useEffect(() => {
|
|
@@ -27,7 +40,7 @@ export function useLeadForm(props) {
|
|
|
27
40
|
};
|
|
28
41
|
}, [formRef.current]);
|
|
29
42
|
const submit = async (event) => {
|
|
30
|
-
var _a
|
|
43
|
+
var _a;
|
|
31
44
|
let formControls = event.target.getFormControls();
|
|
32
45
|
let formData = {};
|
|
33
46
|
let validationErrors = {};
|
|
@@ -74,8 +87,7 @@ export function useLeadForm(props) {
|
|
|
74
87
|
error: "",
|
|
75
88
|
validationErrors: {},
|
|
76
89
|
});
|
|
77
|
-
|
|
78
|
-
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) {
|
|
90
|
+
if ((_a = result === null || result === void 0 ? void 0 : result.submitForm) === null || _a === void 0 ? void 0 : _a.success) {
|
|
79
91
|
setSuccess(true);
|
|
80
92
|
}
|
|
81
93
|
}
|
|
@@ -95,6 +107,18 @@ export function useLeadForm(props) {
|
|
|
95
107
|
const asYouType = new AsYouType("US");
|
|
96
108
|
e.target.value = asYouType.input(e.target.value);
|
|
97
109
|
}, []);
|
|
110
|
+
function resetForm() {
|
|
111
|
+
var _a, _b;
|
|
112
|
+
setLeadFormState({
|
|
113
|
+
loading: false,
|
|
114
|
+
error: "",
|
|
115
|
+
validationErrors: {},
|
|
116
|
+
});
|
|
117
|
+
(_b = (_a = formRef.current) === null || _a === void 0 ? void 0 : _a.getFormControls()) === null || _b === void 0 ? void 0 : _b.forEach((c) => {
|
|
118
|
+
c.value = "";
|
|
119
|
+
});
|
|
120
|
+
setSuccess(false);
|
|
121
|
+
}
|
|
98
122
|
let errorMessage = "";
|
|
99
123
|
if ((_a = errors === null || errors === void 0 ? void 0 : errors.response) === null || _a === void 0 ? void 0 : _a["error"]) {
|
|
100
124
|
errorMessage = props.networkErrorMessage;
|
|
@@ -106,17 +130,19 @@ export function useLeadForm(props) {
|
|
|
106
130
|
errorMessage =
|
|
107
131
|
((_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);
|
|
108
132
|
}
|
|
133
|
+
console.log({ errors, errorMessage });
|
|
109
134
|
return {
|
|
110
135
|
states: {
|
|
111
136
|
loading,
|
|
112
137
|
error: errorMessage,
|
|
113
138
|
success,
|
|
114
139
|
leadFormState,
|
|
115
|
-
referralCode: "
|
|
140
|
+
referralCode: ((_k = userDetails === null || userDetails === void 0 ? void 0 : userDetails.viewer) === null || _k === void 0 ? void 0 : _k.referralCode) || "",
|
|
116
141
|
},
|
|
117
142
|
callbacks: {
|
|
118
143
|
submit,
|
|
119
144
|
inputFunction,
|
|
145
|
+
resetForm,
|
|
120
146
|
},
|
|
121
147
|
refs: {
|
|
122
148
|
formRef,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h, c as Host, d as getAssetPath, g as getElement } from './index-91e7729f.js';
|
|
1
|
+
import { h, c as Host, d as getAssetPath, F as Fragment, g as getElement } from './index-91e7729f.js';
|
|
2
2
|
import { k as useState, b as browser, u as useMemo } from './stencil-hooks.module-4bc38af4.js';
|
|
3
3
|
import { i as intl } from './global-be1f9992.js';
|
|
4
4
|
import { d as dist, H, J, F as Fn, w as wn, $ as $e, B, g as getEnvironmentSDK, L } from './index.module-89a79f66.js';
|
|
@@ -2842,7 +2842,7 @@ const style$9 = {
|
|
|
2842
2842
|
fontSize: "var(--sl-input-help-text-font-size-medium)",
|
|
2843
2843
|
},
|
|
2844
2844
|
FieldContainer: {
|
|
2845
|
-
"margin-bottom": "var(--sl-spacing-
|
|
2845
|
+
"margin-bottom": "var(--sl-spacing-medium)",
|
|
2846
2846
|
},
|
|
2847
2847
|
};
|
|
2848
2848
|
const vanillaStyle$5 = `
|
|
@@ -4045,7 +4045,12 @@ function CouponCodeView(props) {
|
|
|
4045
4045
|
}
|
|
4046
4046
|
|
|
4047
4047
|
const style$d = {
|
|
4048
|
-
Wrapper: {
|
|
4048
|
+
Wrapper: {
|
|
4049
|
+
...AuthWrapper,
|
|
4050
|
+
"max-width": "600px",
|
|
4051
|
+
border: "none",
|
|
4052
|
+
margin: "0",
|
|
4053
|
+
},
|
|
4049
4054
|
Column: AuthColumn,
|
|
4050
4055
|
HostBlock: HostBlock,
|
|
4051
4056
|
":host": {
|
|
@@ -4055,6 +4060,7 @@ const style$d = {
|
|
|
4055
4060
|
NameFieldWrapper: {
|
|
4056
4061
|
display: "flex",
|
|
4057
4062
|
gap: "var(--sl-spacing-medium)",
|
|
4063
|
+
marginBottom: "0 !important",
|
|
4058
4064
|
},
|
|
4059
4065
|
ContinueButton: { maxWidth: "169px" },
|
|
4060
4066
|
ButtonsContainer: AuthButtonsContainer,
|
|
@@ -4070,6 +4076,10 @@ const style$d = {
|
|
|
4070
4076
|
borderTop: "none",
|
|
4071
4077
|
},
|
|
4072
4078
|
},
|
|
4079
|
+
NameInput: {
|
|
4080
|
+
marginBottom: "0",
|
|
4081
|
+
width: "50%",
|
|
4082
|
+
},
|
|
4073
4083
|
ErrorStyle: ErrorStyles,
|
|
4074
4084
|
};
|
|
4075
4085
|
const vanillaStyle$8 = `
|
|
@@ -4092,6 +4102,7 @@ const styleString$d = sheet$d.toString();
|
|
|
4092
4102
|
function LeadFormView(props) {
|
|
4093
4103
|
var _a, _b, _c, _d;
|
|
4094
4104
|
const { states, refs, callbacks, content } = props;
|
|
4105
|
+
console.log({ states });
|
|
4095
4106
|
if (states.error) {
|
|
4096
4107
|
window.scrollTo({ top: 0, left: 0, behavior: "smooth" });
|
|
4097
4108
|
}
|
|
@@ -4101,8 +4112,8 @@ function LeadFormView(props) {
|
|
|
4101
4112
|
}, {
|
|
4102
4113
|
fieldLabel,
|
|
4103
4114
|
});
|
|
4104
|
-
|
|
4105
|
-
|
|
4115
|
+
return (h(Fragment, null,
|
|
4116
|
+
states.success && (h("div", { class: sheet$d.classes.Wrapper, part: "sqm-base" },
|
|
4106
4117
|
h("style", { type: "text/css" },
|
|
4107
4118
|
vanillaStyle$8,
|
|
4108
4119
|
styleString$d),
|
|
@@ -4111,51 +4122,106 @@ function LeadFormView(props) {
|
|
|
4111
4122
|
h("b", null, content.submitSuccessHeader),
|
|
4112
4123
|
h("br", null),
|
|
4113
4124
|
h("div", { part: "successalert-text" }, content.submitSuccessDescription)),
|
|
4114
|
-
h("sl-button", {
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4125
|
+
h("sl-button", { class: sheet$d.classes.ContinueButton, onClick: callbacks.resetForm, loading: states.loading, exportparts: "base: primarybutton-base", type: "default" }, content.resubmitFormLabel))),
|
|
4126
|
+
h("div", { class: sheet$d.classes.Wrapper, part: "sqm-base", style: { display: states.success ? "none" : "block" } },
|
|
4127
|
+
h("style", { type: "text/css" },
|
|
4128
|
+
vanillaStyle$8,
|
|
4129
|
+
styleString$d),
|
|
4130
|
+
h(TextSpanView, { type: "h3" }, content.pageLabel),
|
|
4131
|
+
h("sl-form", { class: sheet$d.classes.Column, "onSl-submit": callbacks.submit, ref: (el) => (refs.formRef.current = el), novalidate: true },
|
|
4132
|
+
states.error && (h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: "danger", class: sheet$d.classes.ErrorAlertContainer, open: true },
|
|
4133
|
+
h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
|
|
4134
|
+
h("b", null, content.submitErrorHeader),
|
|
4135
|
+
h("br", null),
|
|
4136
|
+
intl.formatMessage({
|
|
4137
|
+
id: "submitErrorDescription",
|
|
4138
|
+
defaultMessage: content.submitErrorDescription,
|
|
4139
|
+
}, {
|
|
4140
|
+
supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, content.supportLinkText)),
|
|
4141
|
+
}))),
|
|
4142
|
+
h("div", { class: sheet$d.classes.NameFieldWrapper },
|
|
4143
|
+
h("sqm-lead-input-field", { class: sheet$d.classes.NameInput, "field-label": content.firstNameLabel || "First Name", "field-name": "firstName" }),
|
|
4144
|
+
h("sqm-lead-input-field", { class: sheet$d.classes.NameInput, "field-label": content.lastNameLabel || "Last Name", "field-name": "lastName" })),
|
|
4145
|
+
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 }) => {
|
|
4146
|
+
if (!value) {
|
|
4147
|
+
return getRequiredFieldErrorMessage({
|
|
4148
|
+
fieldLabel: content.emailLabel || "Email",
|
|
4149
|
+
});
|
|
4150
|
+
}
|
|
4151
|
+
// this matches shoelace validation, but could be better
|
|
4152
|
+
if (!value.includes("@")) {
|
|
4153
|
+
return content.invalidEmailErrorMessage;
|
|
4154
|
+
}
|
|
4155
|
+
} }, (((_b = (_a = states.leadFormState) === null || _a === void 0 ? void 0 : _a.validationErrors) === null || _b === void 0 ? void 0 : _b.email) ? {
|
|
4156
|
+
class: sheet$d.classes.ErrorStyle,
|
|
4157
|
+
helpText: ((_d = (_c = states.leadFormState) === null || _c === void 0 ? void 0 : _c.validationErrors) === null || _d === void 0 ? void 0 : _d.email) ||
|
|
4158
|
+
content.requiredFieldErrorMessage,
|
|
4159
|
+
}
|
|
4160
|
+
: []))),
|
|
4161
|
+
h("input", { type: "hidden", hidden: true, name: "/referralCode", value: states.referralCode }),
|
|
4162
|
+
content.formData,
|
|
4163
|
+
h("div", { class: sheet$d.classes.ButtonsContainer },
|
|
4164
|
+
h("sl-button", { submit: true, loading: states.loading, exportparts: "base: primarybutton-base", type: "primary" }, content.submitLabel || "Register"))))));
|
|
4165
|
+
}
|
|
4166
|
+
|
|
4167
|
+
const style$e = {
|
|
4168
|
+
ErrorStyle: {
|
|
4169
|
+
"--sl-input-border-color": "var(--sl-color-danger-500)",
|
|
4170
|
+
"--sl-input-background-color": "var(--sl-color-danger-10)",
|
|
4171
|
+
"--sl-input-border-color-focus": "var(--sl-color-danger-500)",
|
|
4172
|
+
"--sl-input-border-color-hover": "var(--sl-color-danger-500)",
|
|
4173
|
+
},
|
|
4174
|
+
ErrorMessageStyle: {
|
|
4175
|
+
margin: 0,
|
|
4176
|
+
color: "var(--sl-color-danger-500)",
|
|
4177
|
+
fontSize: "var(--sl-input-help-text-font-size-medium)",
|
|
4178
|
+
},
|
|
4179
|
+
FieldContainer: {
|
|
4180
|
+
"margin-bottom": "var(--sl-spacing-large)",
|
|
4181
|
+
},
|
|
4182
|
+
};
|
|
4183
|
+
const vanillaStyle$9 = `
|
|
4184
|
+
:host {
|
|
4185
|
+
margin: 0 auto;
|
|
4186
|
+
width: 100%;
|
|
4187
|
+
display: block;
|
|
4188
|
+
}
|
|
4189
|
+
sl-select::part(label){
|
|
4190
|
+
font-size: var(--sl-input-label-font-size-small);
|
|
4191
|
+
font-weight: var(--sl-font-weight-semibold);
|
|
4192
|
+
}
|
|
4193
|
+
`;
|
|
4194
|
+
jss.setup(create());
|
|
4195
|
+
const sheet$e = jss.createStyleSheet(style$e);
|
|
4196
|
+
const styleString$e = sheet$e.toString();
|
|
4197
|
+
function LeadDropdownFieldView(props) {
|
|
4198
|
+
var _a, _b, _c, _d, _e;
|
|
4199
|
+
const { states, content } = props;
|
|
4200
|
+
const validationErrors = (_a = states === null || states === void 0 ? void 0 : states.leadFormState) === null || _a === void 0 ? void 0 : _a.validationErrors;
|
|
4201
|
+
console.log({ validationErrors });
|
|
4202
|
+
const getRequiredFieldErrorMessage = ({ dropdownLabel, }) => intl.formatMessage({
|
|
4203
|
+
id: `requiredFieldErrorMessage-${dropdownLabel}`,
|
|
4204
|
+
defaultMessage: content.requiredFieldErrorMessage,
|
|
4205
|
+
}, {
|
|
4206
|
+
dropdownLabel,
|
|
4207
|
+
});
|
|
4208
|
+
return (h("div", { class: sheet$e.classes.FieldContainer, part: "sqm-base" },
|
|
4121
4209
|
h("style", { type: "text/css" },
|
|
4122
|
-
vanillaStyle$
|
|
4123
|
-
styleString$
|
|
4124
|
-
h(
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
h("sqm-lead-input-field", { style: { width: "50%" }, "field-label": "First Name", "field-name": "firstName" }),
|
|
4138
|
-
h("sqm-lead-input-field", { style: { width: "50%" }, "field-label": "Last Name", "field-name": "lastName" })),
|
|
4139
|
-
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 }) => {
|
|
4140
|
-
if (!value) {
|
|
4141
|
-
return getRequiredFieldErrorMessage({
|
|
4142
|
-
fieldLabel: content.emailLabel || "Email",
|
|
4143
|
-
});
|
|
4144
|
-
}
|
|
4145
|
-
// this matches shoelace validation, but could be better
|
|
4146
|
-
if (!value.includes("@")) {
|
|
4147
|
-
return content.invalidEmailErrorMessage;
|
|
4148
|
-
}
|
|
4149
|
-
} }, (((_b = (_a = states.leadFormState) === null || _a === void 0 ? void 0 : _a.validationErrors) === null || _b === void 0 ? void 0 : _b.email) ? {
|
|
4150
|
-
class: sheet$d.classes.ErrorStyle,
|
|
4151
|
-
helpText: ((_d = (_c = states.leadFormState) === null || _c === void 0 ? void 0 : _c.validationErrors) === null || _d === void 0 ? void 0 : _d.email) ||
|
|
4152
|
-
content.requiredFieldErrorMessage,
|
|
4153
|
-
}
|
|
4154
|
-
: []))),
|
|
4155
|
-
h("input", { type: "hidden", hidden: true, name: "/rsReferralCode", value: states.referralCode }),
|
|
4156
|
-
content.formData,
|
|
4157
|
-
h("div", { class: sheet$d.classes.ButtonsContainer },
|
|
4158
|
-
h("sl-button", { submit: true, loading: states.loading, exportparts: "base: primarybutton-base", type: "primary" }, content.submitLabel || "Register")))));
|
|
4210
|
+
vanillaStyle$9,
|
|
4211
|
+
styleString$e),
|
|
4212
|
+
h("sl-select", Object.assign({ exportparts: "label: input-label, base: input-base", label: `${content.dropdownLabel}${content.dropdownOptional ? ` ${content.optionalLabel}` : ""}`, name: `/${content.dropdownName}`, multiple: content.multiple }, (!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 }) => {
|
|
4213
|
+
if (!value && !content.dropdownOptional) {
|
|
4214
|
+
return getRequiredFieldErrorMessage({
|
|
4215
|
+
dropdownLabel: content.dropdownLabel,
|
|
4216
|
+
});
|
|
4217
|
+
}
|
|
4218
|
+
} }, (((_e = (_d = states.leadFormState) === null || _d === void 0 ? void 0 : _d.validationErrors) === null || _e === void 0 ? void 0 : _e[content.dropdownName]) ? {
|
|
4219
|
+
class: sheet$e.classes.ErrorStyle,
|
|
4220
|
+
}
|
|
4221
|
+
: [])), content.selectOptions),
|
|
4222
|
+
(validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors[content.dropdownName]) && (h("p", { class: sheet$e.classes.ErrorMessageStyle }, getRequiredFieldErrorMessage({
|
|
4223
|
+
dropdownLabel: content.dropdownLabel,
|
|
4224
|
+
})))));
|
|
4159
4225
|
}
|
|
4160
4226
|
|
|
4161
4227
|
function t(t,n,r){return Math.min(Math.max(t,r),n)}class n extends Error{constructor(t){super(`Failed to parse color: "${t}"`);}}function r(r){if("string"!=typeof r)throw new n(r);if("transparent"===r.trim().toLowerCase())return [0,0,0,0];let e=r.trim();e=u.test(r)?function(t){const r=t.toLowerCase().trim(),e=o[function(t){let n=5381,r=t.length;for(;r;)n=33*n^t.charCodeAt(--r);return (n>>>0)%2341}(r)];if(!e)throw new n(t);return `#${e}`}(r):r;const f=s.exec(e);if(f){const t=Array.from(f).slice(1);return [...t.slice(0,3).map(t=>parseInt(_(t,2),16)),parseInt(_(t[3]||"f",2),16)/255]}const p=i.exec(e);if(p){const t=Array.from(p).slice(1);return [...t.slice(0,3).map(t=>parseInt(t,16)),parseInt(t[3]||"ff",16)/255]}const z=a.exec(e);if(z){const t=Array.from(z).slice(1);return [...t.slice(0,3).map(t=>parseInt(t,10)),parseFloat(t[3]||"1")]}const h=c.exec(e);if(h){const[e,o,_,s]=Array.from(h).slice(1).map(parseFloat);if(t(0,100,o)!==o)throw new n(r);if(t(0,100,_)!==_)throw new n(r);return [...l(e,o,_),s||1]}throw new n(r)}const e=t=>parseInt(t.replace(/_/g,""),36),o="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((t,n)=>{const r=e(n.substring(0,3)),o=e(n.substring(3)).toString(16);let _="";for(let t=0;t<6-o.length;t++)_+="0";return t[r]=`${_}${o}`,t},{}),_=(t,n)=>Array.from(Array(n)).map(()=>t).join(""),s=new RegExp(`^#${_("([a-f0-9])",3)}([a-f0-9])?$`,"i"),i=new RegExp(`^#${_("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),a=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${_(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),c=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,u=/^[a-z]+$/i,f=t=>Math.round(255*t),l=(t,n,r)=>{let e=r/100;if(0===n)return [e,e,e].map(f);const o=(t%360+360)%360/60,_=(1-Math.abs(2*e-1))*(n/100),s=_*(1-Math.abs(o%2-1));let i=0,a=0,c=0;o>=0&&o<1?(i=_,a=s):o>=1&&o<2?(i=s,a=_):o>=2&&o<3?(a=_,c=s):o>=3&&o<4?(a=s,c=_):o>=4&&o<5?(i=s,c=_):o>=5&&o<6&&(i=_,c=s);const u=e-_/2;return [i+u,a+u,c+u].map(f)};function p(t){const[n,e,o,_]=r(t).map((t,n)=>3===n?t:t/255),s=Math.max(n,e,o),i=Math.min(n,e,o),a=(s+i)/2;if(s===i)return [0,0,a,_];const c=s-i;return [60*(n===s?(e-o)/c+(e<o?6:0):e===s?(o-n)/c+2:(n-e)/c+4),a>.5?c/(2-s-i):c/(s+i),a,_]}function z(n,r,e,o){return `hsla(${(n%360).toFixed()}, ${t(0,100,100*r).toFixed()}%, ${t(0,100,100*e).toFixed()}%, ${parseFloat(t(0,1,o).toFixed(3))})`}
|
|
@@ -4243,4 +4309,4 @@ const ShadowViewAddon = ({ story }, children) => {
|
|
|
4243
4309
|
h(TagName, { "stencilbook-shadow-view": randomInt })));
|
|
4244
4310
|
};
|
|
4245
4311
|
|
|
4246
|
-
export { loading as A, BigStatView as B, ChangeMarktingView as C, DropdownFieldView as D, EditProfileView as E, empty as F, rewardExchange as G, HeroView as H, InputFieldView as I, CardFeedView as J, CouponCodeView as K, LeaderboardView as L, ProgressBar as M, NameFieldsView as N, LeadFormView as O, PortalFrameView as P,
|
|
4312
|
+
export { loading as A, BigStatView as B, ChangeMarktingView as C, DropdownFieldView as D, EditProfileView as E, empty as F, rewardExchange as G, HeroView as H, InputFieldView as I, CardFeedView as J, CouponCodeView as K, LeaderboardView as L, ProgressBar as M, NameFieldsView as N, LeadFormView as O, PortalFrameView as P, LeadDropdownFieldView as Q, ReferralIframeView as R, ShareButtonView as S, TaskCardView as T, autoColorScaleCss as U, ShadowViewAddon as V, useBigStat as W, withShadowView as X, demoRewardExchange as Y, useShareButton as a, useDemoBigStat as b, StatContainerView as c, PortalChangePasswordView as d, PortalRegisterView as e, ProgressBarView as f, PoweredByImg as g, PortalFooterView as h, CheckboxFieldView as i, RewardExchangeView as j, rewardExchangeLongText as k, rewardExchangeSelected as l, chooseAmountFixed as m, chooseAmountFixedNoDescription as n, chooseAmountVariable as o, chooseAmountVariableNoDescription as p, chooseAmountVariableDisabled as q, rewardExchangeCustomErrorMsg as r, chooseAmountVariableUnavailable as s, confirmFixed as t, useShareLink as u, confirmVariable as v, redemptionError as w, queryError as x, success as y, successVariable as z };
|