@saasquatch/mint-components 1.5.1-1 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -6
- package/dist/cjs/{ShadowViewAddon-16dae1bc.js → ShadowViewAddon-8151e5d3.js} +2 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/{sqm-big-stat_35.cjs.entry.js → sqm-big-stat_34.cjs.entry.js} +43 -164
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +7 -107
- package/dist/collection/collection-manifest.json +0 -1
- package/dist/collection/components/sqm-checkbox-field/CheckboxField.stories.js +1 -1
- package/dist/collection/components/sqm-checkbox-field/sqm-checkbox-field-view.js +2 -1
- package/dist/collection/components/sqm-checkbox-field/sqm-checkbox-field.js +1 -1
- package/dist/collection/components/sqm-checkbox-field/useCheckboxField.js +2 -2
- package/dist/collection/components/sqm-dropdown-field/sqm-dropdown-field.js +3 -3
- package/dist/collection/components/sqm-dropdown-field/useDropdownField.js +2 -2
- package/dist/collection/components/sqm-name-fields/sqm-name-fields.js +1 -1
- package/dist/collection/components/sqm-name-fields/useNameFields.js +2 -2
- package/dist/collection/components/sqm-portal-register/sqm-portal-register.js +1 -1
- package/dist/collection/components/sqm-portal-register/useValidationState.js +2 -2
- package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +0 -2
- package/dist/esm/{ShadowViewAddon-3908b50d.js → ShadowViewAddon-e42c07c6.js} +2 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/{sqm-big-stat_35.entry.js → sqm-big-stat_34.entry.js} +47 -167
- package/dist/esm/sqm-stencilbook.entry.js +7 -107
- package/dist/esm-es5/{ShadowViewAddon-3908b50d.js → ShadowViewAddon-e42c07c6.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-big-stat_34.entry.js +1 -0
- 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-fc6c07a7.entry.js → p-23259e4c.entry.js} +12 -21
- package/dist/mint-components/p-436da6b8.system.js +1 -1
- package/dist/mint-components/{p-268d0240.js → p-55358561.js} +1 -1
- package/dist/mint-components/{p-9d83a0b3.system.entry.js → p-5bc9f6f4.system.entry.js} +1 -1
- package/dist/mint-components/{p-c648f983.system.js → p-6c9bd397.system.js} +1 -1
- package/dist/mint-components/{p-aa6292e7.entry.js → p-6cb9eed6.entry.js} +2 -2
- package/dist/mint-components/p-b2770bdb.system.entry.js +1 -0
- package/dist/types/components/sqm-checkbox-field/sqm-checkbox-field-view.d.ts +2 -1
- package/dist/types/components/sqm-checkbox-field/useCheckboxField.d.ts +1 -5
- package/dist/types/components/sqm-dropdown-field/sqm-dropdown-field-view.d.ts +2 -1
- package/dist/types/components/sqm-dropdown-field/useDropdownField.d.ts +1 -5
- package/dist/types/components/sqm-name-fields/sqm-name-fields-view.d.ts +2 -1
- package/dist/types/components/sqm-name-fields/useNameFields.d.ts +1 -5
- package/dist/types/components/sqm-portal-register/useValidationState.d.ts +1 -0
- package/dist/types/components.d.ts +0 -62
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +1 -1
- package/dist/collection/components/sqm-country-field/UseCountryField.stories.js +0 -91
- package/dist/collection/components/sqm-country-field/sqm-country-field-view.js +0 -47
- package/dist/collection/components/sqm-country-field/sqm-country-field.js +0 -197
- package/dist/collection/components/sqm-country-field/useCountryField.js +0 -23
- package/dist/esm-es5/sqm-big-stat_35.entry.js +0 -1
- package/dist/mint-components/p-29e6a994.system.entry.js +0 -1
- package/dist/types/components/sqm-country-field/UseCountryField.stories.d.ts +0 -40
- package/dist/types/components/sqm-country-field/sqm-country-field-view.d.ts +0 -18
- package/dist/types/components/sqm-country-field/sqm-country-field.d.ts +0 -33
- package/dist/types/components/sqm-country-field/useCountryField.d.ts +0 -10
|
@@ -18,7 +18,7 @@ require('./luxon-59ca7d19.js');
|
|
|
18
18
|
const utils = require('./utils-01dbfd4a.js');
|
|
19
19
|
require('./sqm-text-span-view-ab4ad6ef.js');
|
|
20
20
|
require('./sqm-portal-container-view-2d11ed71.js');
|
|
21
|
-
const ShadowViewAddon = require('./ShadowViewAddon-
|
|
21
|
+
const ShadowViewAddon = require('./ShadowViewAddon-8151e5d3.js');
|
|
22
22
|
require('./sqm-portal-section-view-765aae4d.js');
|
|
23
23
|
|
|
24
24
|
const BigStat = class {
|
|
@@ -123,9 +123,15 @@ const CardFeed = class {
|
|
|
123
123
|
}
|
|
124
124
|
};
|
|
125
125
|
|
|
126
|
-
const
|
|
126
|
+
const FORM_VALIDATION_CONTEXT = "sq:validation-state";
|
|
127
|
+
function useValidationState(formState) {
|
|
128
|
+
const host = index_module.P();
|
|
129
|
+
const [validationState, setValidationState] = stencilHooks_module.y(host, FORM_VALIDATION_CONTEXT, formState);
|
|
130
|
+
return { validationState, setValidationState };
|
|
131
|
+
}
|
|
132
|
+
|
|
127
133
|
function useCheckboxField() {
|
|
128
|
-
const validationState = stencilHooks_module.d(
|
|
134
|
+
const validationState = stencilHooks_module.d(FORM_VALIDATION_CONTEXT);
|
|
129
135
|
const [checked, setChecked] = stencilHooks_module.useState(false);
|
|
130
136
|
return {
|
|
131
137
|
states: {
|
|
@@ -188,133 +194,6 @@ function useCheckboxFieldDemo(props) {
|
|
|
188
194
|
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
189
195
|
}
|
|
190
196
|
|
|
191
|
-
const CONTEXT_NAME$1 = "sq:validation-state";
|
|
192
|
-
function useDropdownField() {
|
|
193
|
-
const validationState = stencilHooks_module.d(CONTEXT_NAME$1);
|
|
194
|
-
return {
|
|
195
|
-
states: {
|
|
196
|
-
validationErrors: validationState === null || validationState === void 0 ? void 0 : validationState.validationErrors,
|
|
197
|
-
},
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
const style = {
|
|
202
|
-
ErrorStyle: {
|
|
203
|
-
"--sl-input-border-color": "var(--sl-color-danger-500)",
|
|
204
|
-
"--sl-input-background-color": "var(--sl-color-danger-10)",
|
|
205
|
-
"--sl-input-border-color-focus": "var(--sl-color-danger-500)",
|
|
206
|
-
"--sl-input-border-color-hover": "var(--sl-color-danger-500)",
|
|
207
|
-
},
|
|
208
|
-
ErrorMessageStyle: {
|
|
209
|
-
margin: 0,
|
|
210
|
-
color: "var(--sl-color-danger-500)",
|
|
211
|
-
fontSize: "var(--sl-input-help-text-font-size-medium)",
|
|
212
|
-
},
|
|
213
|
-
FieldContainer: {
|
|
214
|
-
"margin-bottom": "var(--sl-spacing-large)",
|
|
215
|
-
},
|
|
216
|
-
};
|
|
217
|
-
const vanillaStyle = `
|
|
218
|
-
:host {
|
|
219
|
-
margin: 0 auto;
|
|
220
|
-
width: 100%;
|
|
221
|
-
display: block;
|
|
222
|
-
}
|
|
223
|
-
sl-select::part(label){
|
|
224
|
-
font-size: var(--sl-input-label-font-size-small);
|
|
225
|
-
font-weight: var(--sl-font-weight-semibold);
|
|
226
|
-
}
|
|
227
|
-
`;
|
|
228
|
-
JSS.jss.setup(JSS.create());
|
|
229
|
-
const sheet = JSS.jss.createStyleSheet(style);
|
|
230
|
-
const styleString = sheet.toString();
|
|
231
|
-
function CountryFieldView(props) {
|
|
232
|
-
var _a;
|
|
233
|
-
const { states, content, data } = props;
|
|
234
|
-
const validationErrors = states === null || states === void 0 ? void 0 : states.validationErrors;
|
|
235
|
-
return (index.h("div", { class: sheet.classes.FieldContainer },
|
|
236
|
-
index.h("style", { type: "text/css" },
|
|
237
|
-
vanillaStyle,
|
|
238
|
-
styleString),
|
|
239
|
-
index.h("sl-select", Object.assign({ exportparts: "label: input-label", label: content.dropdownLabel, name: `/${content.dropdownName}` }, (content.dropdownRequired ? { required: true } : []), ((validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors[content.dropdownName]) ? {
|
|
240
|
-
class: sheet.classes.ErrorStyle,
|
|
241
|
-
}
|
|
242
|
-
: [])), (_a = data.countries) === null || _a === void 0 ? void 0 : _a.map((country) => (index.h("sl-menu-item", { value: country.displayName }, country.displayName)))),
|
|
243
|
-
(validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors[content.dropdownName]) && (index.h("p", { class: sheet.classes.ErrorMessageStyle }, content.errorMessage))));
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
const GET_COUNTRIES = index_module.dist.gql `
|
|
247
|
-
query countryList($locale: RSLocale) {
|
|
248
|
-
countries(limit: 250) {
|
|
249
|
-
data {
|
|
250
|
-
countryCode
|
|
251
|
-
displayName(locale: $locale)
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
`;
|
|
256
|
-
function useCountryField(props) {
|
|
257
|
-
var _a;
|
|
258
|
-
const user = index_module.ie();
|
|
259
|
-
const locale = props.locale || index_module.An();
|
|
260
|
-
const { data: res } = index_module.sn(GET_COUNTRIES, { locale }, user && locale === undefined);
|
|
261
|
-
return {
|
|
262
|
-
data: {
|
|
263
|
-
countries: (_a = res === null || res === void 0 ? void 0 : res.countries) === null || _a === void 0 ? void 0 : _a.data,
|
|
264
|
-
},
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
const CountryField = class {
|
|
269
|
-
constructor(hostRef) {
|
|
270
|
-
index.registerInstance(this, hostRef);
|
|
271
|
-
this.ignored = true;
|
|
272
|
-
/**
|
|
273
|
-
* @uiName Country name attribute
|
|
274
|
-
*/
|
|
275
|
-
this.dropdownName = "countryCode";
|
|
276
|
-
/**
|
|
277
|
-
* @uiName Country Dropdown label
|
|
278
|
-
*/
|
|
279
|
-
this.dropdownLabel = "Country";
|
|
280
|
-
/**
|
|
281
|
-
* @uiName Unselected error message
|
|
282
|
-
*/
|
|
283
|
-
this.errorMessage = "Must select a country";
|
|
284
|
-
/**
|
|
285
|
-
* @uiName Required
|
|
286
|
-
*/
|
|
287
|
-
this.dropdownRequired = true;
|
|
288
|
-
/**
|
|
289
|
-
* @uiName Country name locale override
|
|
290
|
-
*/
|
|
291
|
-
this.locale = null;
|
|
292
|
-
stencilHooks_module.h$1(this);
|
|
293
|
-
}
|
|
294
|
-
disconnectedCallback() { }
|
|
295
|
-
render() {
|
|
296
|
-
const content = {
|
|
297
|
-
...utils.getProps(this),
|
|
298
|
-
selectOptions: index.h("slot", null),
|
|
299
|
-
};
|
|
300
|
-
const { states } = useDropdownField();
|
|
301
|
-
const { data } = index_module.jn()
|
|
302
|
-
? useCountryFieldDemo(this)
|
|
303
|
-
: useCountryField(this);
|
|
304
|
-
return (index.h(CountryFieldView, { states: states, content: content, data: data }));
|
|
305
|
-
}
|
|
306
|
-
};
|
|
307
|
-
function useCountryFieldDemo(props) {
|
|
308
|
-
return cjs.cjs({
|
|
309
|
-
states: {
|
|
310
|
-
validationErrors: [],
|
|
311
|
-
},
|
|
312
|
-
data: {
|
|
313
|
-
countries: [],
|
|
314
|
-
},
|
|
315
|
-
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
316
|
-
}
|
|
317
|
-
|
|
318
197
|
function DividedLayoutView(props, children) {
|
|
319
198
|
const getBorder = () => {
|
|
320
199
|
if (props.direction === "row") {
|
|
@@ -382,6 +261,15 @@ const DividedLayout = class {
|
|
|
382
261
|
}
|
|
383
262
|
};
|
|
384
263
|
|
|
264
|
+
function useDropdownField() {
|
|
265
|
+
const validationState = stencilHooks_module.d(FORM_VALIDATION_CONTEXT);
|
|
266
|
+
return {
|
|
267
|
+
states: {
|
|
268
|
+
validationErrors: validationState === null || validationState === void 0 ? void 0 : validationState.validationErrors,
|
|
269
|
+
},
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
|
|
385
273
|
const DropdownField = class {
|
|
386
274
|
constructor(hostRef) {
|
|
387
275
|
index.registerInstance(this, hostRef);
|
|
@@ -393,7 +281,7 @@ const DropdownField = class {
|
|
|
393
281
|
/**
|
|
394
282
|
* @uiName Unselected error message
|
|
395
283
|
*/
|
|
396
|
-
this.errorMessage = "
|
|
284
|
+
this.errorMessage = "Select an option";
|
|
397
285
|
/**
|
|
398
286
|
* @uiName Required
|
|
399
287
|
*/
|
|
@@ -1055,9 +943,8 @@ function useLeaderboardDemo(props) {
|
|
|
1055
943
|
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
1056
944
|
}
|
|
1057
945
|
|
|
1058
|
-
const CONTEXT_NAME$2 = "sq:validation-state";
|
|
1059
946
|
function useNameFields(props) {
|
|
1060
|
-
const validationState = stencilHooks_module.d(
|
|
947
|
+
const validationState = stencilHooks_module.d(FORM_VALIDATION_CONTEXT);
|
|
1061
948
|
return {
|
|
1062
949
|
states: {
|
|
1063
950
|
validationErrors: validationState === null || validationState === void 0 ? void 0 : validationState.validationErrors,
|
|
@@ -1464,13 +1351,6 @@ function useLoginDemo(props) {
|
|
|
1464
1351
|
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
1465
1352
|
}
|
|
1466
1353
|
|
|
1467
|
-
const CONTEXT_NAME$3 = "sq:validation-state";
|
|
1468
|
-
function useValidationState(formState) {
|
|
1469
|
-
const host = index_module.P();
|
|
1470
|
-
const [validationState, setValidationState] = stencilHooks_module.y(host, CONTEXT_NAME$3, formState);
|
|
1471
|
-
return { validationState, setValidationState };
|
|
1472
|
-
}
|
|
1473
|
-
|
|
1474
1354
|
// This file is a workaround for a bug in web browsers' "native"
|
|
1475
1355
|
// ES6 importing system which is uncapable of importing "*.json" files.
|
|
1476
1356
|
// https://github.com/catamphetamine/libphonenumber-js/issues/239
|
|
@@ -5719,7 +5599,7 @@ const ProgramMenu = class {
|
|
|
5719
5599
|
}
|
|
5720
5600
|
};
|
|
5721
5601
|
|
|
5722
|
-
const style
|
|
5602
|
+
const style = {
|
|
5723
5603
|
Container: {
|
|
5724
5604
|
display: "flex",
|
|
5725
5605
|
color: "var(--sl-color-neutral-900)",
|
|
@@ -5753,9 +5633,9 @@ const style$1 = {
|
|
|
5753
5633
|
},
|
|
5754
5634
|
},
|
|
5755
5635
|
};
|
|
5756
|
-
const sheet
|
|
5757
|
-
const styleString
|
|
5758
|
-
const vanillaStyle
|
|
5636
|
+
const sheet = JSS.createStyleSheet(style);
|
|
5637
|
+
const styleString = sheet.toString();
|
|
5638
|
+
const vanillaStyle = `
|
|
5759
5639
|
:host{
|
|
5760
5640
|
display: block;
|
|
5761
5641
|
}
|
|
@@ -5763,9 +5643,9 @@ const vanillaStyle$1 = `
|
|
|
5763
5643
|
function ReferralCardView(props) {
|
|
5764
5644
|
return (index.h("div", null,
|
|
5765
5645
|
index.h("style", { type: "text/css" },
|
|
5766
|
-
styleString
|
|
5767
|
-
vanillaStyle
|
|
5768
|
-
index.h("div", { class: sheet
|
|
5646
|
+
styleString,
|
|
5647
|
+
vanillaStyle),
|
|
5648
|
+
index.h("div", { class: sheet.classes.Container },
|
|
5769
5649
|
index.h("div", { class: "left", style: {
|
|
5770
5650
|
alignSelf: props.verticalAlignment,
|
|
5771
5651
|
} }, props.slots.left),
|
|
@@ -5821,7 +5701,7 @@ function useReferralIframe(props) {
|
|
|
5821
5701
|
};
|
|
5822
5702
|
}
|
|
5823
5703
|
|
|
5824
|
-
const style$
|
|
5704
|
+
const style$1 = {
|
|
5825
5705
|
IconStyle: {
|
|
5826
5706
|
display: "block",
|
|
5827
5707
|
position: "absolute",
|
|
@@ -5840,21 +5720,21 @@ const style$2 = {
|
|
|
5840
5720
|
margin: "30px",
|
|
5841
5721
|
},
|
|
5842
5722
|
};
|
|
5843
|
-
const sheet$
|
|
5844
|
-
const styleString$
|
|
5723
|
+
const sheet$1 = JSS.createStyleSheet(style$1);
|
|
5724
|
+
const styleString$1 = sheet$1.toString();
|
|
5845
5725
|
function RequiredPropsError({ missingProps }) {
|
|
5846
5726
|
if (!missingProps)
|
|
5847
5727
|
return false;
|
|
5848
5728
|
const host = index_module.P();
|
|
5849
5729
|
const [detailsOpen, setDetailsOpen] = stencilHooks_module.useState(false);
|
|
5850
|
-
return (index.h("sl-alert", { type: "danger", open: true, class: sheet$
|
|
5851
|
-
index.h("style", { type: "text/css" }, styleString$
|
|
5852
|
-
index.h("div", { slot: "icon", class: sheet$
|
|
5730
|
+
return (index.h("sl-alert", { type: "danger", open: true, class: sheet$1.classes.Alert },
|
|
5731
|
+
index.h("style", { type: "text/css" }, styleString$1),
|
|
5732
|
+
index.h("div", { slot: "icon", class: sheet$1.classes.IconStyle },
|
|
5853
5733
|
index.h("sl-icon", { name: "exclamation-octagon" })),
|
|
5854
|
-
index.h("div", { class: sheet$
|
|
5855
|
-
index.h("h2", { class: sheet$
|
|
5734
|
+
index.h("div", { class: sheet$1.classes.DivStyle },
|
|
5735
|
+
index.h("h2", { class: sheet$1.classes.Heading }, "There was a problem loading this page"),
|
|
5856
5736
|
index.h("p", null, "There was a technical problem that prevented this page from loading. Please contact us with the link to this page.")),
|
|
5857
|
-
index.h("details", { class: sheet$
|
|
5737
|
+
index.h("details", { class: sheet$1.classes.Details },
|
|
5858
5738
|
index.h("summary", { onClick: () => setDetailsOpen(!detailsOpen) },
|
|
5859
5739
|
detailsOpen ? "Less" : "More",
|
|
5860
5740
|
" details"),
|
|
@@ -7502,7 +7382,7 @@ const Gift = () => (index.h("svg", { width: "24", height: "24", viewBox: "0 0 24
|
|
|
7502
7382
|
const Circle = () => (index.h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
7503
7383
|
index.h("circle", { cx: "12", cy: "12", r: "9", fill: "currentColor", stroke: "currentColor", "stroke-width": "2" })));
|
|
7504
7384
|
|
|
7505
|
-
const style$
|
|
7385
|
+
const style$2 = {
|
|
7506
7386
|
TimelineReward: {
|
|
7507
7387
|
color: "var(--sl-color-neutral-900)",
|
|
7508
7388
|
lineHeight: "var(--sl-line-height-dense)",
|
|
@@ -7545,9 +7425,9 @@ const style$3 = {
|
|
|
7545
7425
|
},
|
|
7546
7426
|
},
|
|
7547
7427
|
};
|
|
7548
|
-
const sheet$
|
|
7549
|
-
const styleString$
|
|
7550
|
-
const vanillaStyle$
|
|
7428
|
+
const sheet$2 = JSS.createStyleSheet(style$2);
|
|
7429
|
+
const styleString$2 = sheet$2.toString();
|
|
7430
|
+
const vanillaStyle$1 = `
|
|
7551
7431
|
:host{
|
|
7552
7432
|
display: block;
|
|
7553
7433
|
}
|
|
@@ -7559,10 +7439,10 @@ const vanillaStyle$2 = `
|
|
|
7559
7439
|
function TimelineEntryView(props) {
|
|
7560
7440
|
var _a;
|
|
7561
7441
|
const timeline_icon = (_a = props.icon) !== null && _a !== void 0 ? _a : props.iconState;
|
|
7562
|
-
return (index.h("div", { class: sheet$
|
|
7442
|
+
return (index.h("div", { class: sheet$2.classes.TimelineReward },
|
|
7563
7443
|
index.h("style", { type: "text/css" },
|
|
7564
|
-
styleString$
|
|
7565
|
-
vanillaStyle$
|
|
7444
|
+
styleString$2,
|
|
7445
|
+
vanillaStyle$1),
|
|
7566
7446
|
index.h("div", { class: "container" },
|
|
7567
7447
|
index.h("div", { class: "line" }, "/"),
|
|
7568
7448
|
index.h("div", { class: "step" },
|
|
@@ -7655,7 +7535,6 @@ exports.sqm_big_stat = BigStat;
|
|
|
7655
7535
|
exports.sqm_brand = BrandComponent;
|
|
7656
7536
|
exports.sqm_card_feed = CardFeed;
|
|
7657
7537
|
exports.sqm_checkbox_field = CheckboxField;
|
|
7658
|
-
exports.sqm_country_field = CountryField;
|
|
7659
7538
|
exports.sqm_divided_layout = DividedLayout;
|
|
7660
7539
|
exports.sqm_dropdown_field = DropdownField;
|
|
7661
7540
|
exports.sqm_edit_profile = EditProfile;
|
|
@@ -27,7 +27,7 @@ const sqmPortalContainerView = require('./sqm-portal-container-view-2d11ed71.js'
|
|
|
27
27
|
const sqmPortalProfileView = require('./sqm-portal-profile-view-b77382f6.js');
|
|
28
28
|
const sqmPortalResetPasswordView = require('./sqm-portal-reset-password-view-042073ca.js');
|
|
29
29
|
const sqmPortalVerifyEmailView = require('./sqm-portal-verify-email-view-cb3c9c2f.js');
|
|
30
|
-
const ShadowViewAddon = require('./ShadowViewAddon-
|
|
30
|
+
const ShadowViewAddon = require('./ShadowViewAddon-8151e5d3.js');
|
|
31
31
|
const sqmPortalSectionView = require('./sqm-portal-section-view-765aae4d.js');
|
|
32
32
|
|
|
33
33
|
/**
|
|
@@ -9381,7 +9381,7 @@ const ReferralIframeReadme = "# sqm-referral-iframe\r\n\r\n\r\n\r\n<!-- Auto Gen
|
|
|
9381
9381
|
|
|
9382
9382
|
const ForgotPasswordReadme = "# sqm-portal-forgot-password\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| -------------- | --------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- |\r\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; success: boolean; loginPath: string; }; content?: { secondaryButton: any; messageSlot: any; emailLabel?: string; submitLabel?: string; }; }` | `undefined` |\r\n| `emailLabel` | `email-label` | | `string` | `\"Email\"` |\r\n| `loginPath` | `login-path` | | `string` | `\"/login\"` |\r\n| `redirectPath` | `redirect-path` | The page that users are redirected to from the password reset email. | `string` | `\"/resetPassword\"` |\r\n| `submitLabel` | `submit-label` | | `string` | `\"Request Password Reset\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Depends on\r\n\r\n- [sqm-form-message](../sqm-form-message)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-portal-forgot-password --> sqm-form-message\r\n style sqm-portal-forgot-password fill:#f9f,stroke:#333,stroke-width:4px\r\n```\r\n\r\n----------------------------------------------\r\n\r\n*Built with [StencilJS](https://stenciljs.com/)*\r\n";
|
|
9383
9383
|
|
|
9384
|
-
const RegisterReadme = "# sqm-portal-register\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\n\n\n## Properties\n\n| Property | Attribute | Description | Type | Default |\n| -------------------------- | ---------------------------- | ------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |\n| `confirmPassword` | `confirm-password` | | `boolean` | `false` |\n| `confirmPasswordLabel` | `confirm-password-label` | | `string` | `\"Confirm Password\"` |\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; confirmPassword: boolean; hideInputs: boolean; validationState?: FormState; enablePasswordValidation?: boolean; loginPath: string; }; content?: { formData?: VNode; terms?: VNode; passwordField?: VNode; secondaryButton?: VNode; emailLabel?: string; passwordLabel?: string; submitLabel?: string; pageLabel?: string; confirmPasswordLabel: string; };
|
|
9384
|
+
const RegisterReadme = "# sqm-portal-register\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| -------------------------- | ---------------------------- | ------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |\r\n| `confirmPassword` | `confirm-password` | | `boolean` | `false` |\r\n| `confirmPasswordLabel` | `confirm-password-label` | | `string` | `\"Confirm Password\"` |\r\n| `demoData` | -- | | `{ states?: { error: string; loading: boolean; confirmPassword: boolean; hideInputs: boolean; validationState?: FormState; enablePasswordValidation?: boolean; loginPath: string; }; refs?: { formRef: any; }; content?: { formData?: VNode; terms?: VNode; passwordField?: VNode; secondaryButton?: VNode; emailLabel?: string; passwordLabel?: string; submitLabel?: string; pageLabel?: string; confirmPasswordLabel: string; }; }` | `undefined` |\r\n| `emailLabel` | `email-label` | | `string` | `\"Email\"` |\r\n| `enablePasswordValidation` | `enable-password-validation` | | `boolean` | `true` |\r\n| `hideInputs` | `hide-inputs` | | `boolean` | `false` |\r\n| `loginLabel` | `login-label` | | `string` | `\"Sign in\"` |\r\n| `loginPath` | `login-path` | | `string` | `\"/login\"` |\r\n| `nextPage` | `next-page` | | `string` | `\"/\"` |\r\n| `pageLabel` | `page-label` | | `string` | `\"Register\"` |\r\n| `passwordLabel` | `password-label` | | `string` | `\"Password\"` |\r\n| `redirectPath` | `redirect-path` | The page that users are redirected to from the verification email. | `string` | `\"/verifyEmail\"` |\r\n| `submitLabel` | `submit-label` | | `string` | `\"Register\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Used by\r\n\r\n - [sqm-stencilbook](../sqm-stencilbook)\r\n\r\n### Depends on\r\n\r\n- [sqm-form-message](../sqm-form-message)\r\n- [sqm-password-field](../sqm-password-field)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-portal-register --> sqm-form-message\r\n sqm-portal-register --> sqm-password-field\r\n sqm-stencilbook --> sqm-portal-register\r\n style sqm-portal-register fill:#f9f,stroke:#333,stroke-width:4px\r\n```\r\n\r\n----------------------------------------------\r\n\r\n*Built with [StencilJS](https://stenciljs.com/)*\r\n";
|
|
9385
9385
|
|
|
9386
9386
|
const EditProfileReadme = "# sqm-portal-profile\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\r\n\r\n\r\n## Properties\r\n\r\n| Property | Attribute | Description | Type | Default |\r\n| ------------------------ | --------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |\r\n| `countrytext` | `countrytext` | | `string` | `\"Country\"` |\r\n| `demoData` | -- | | `{ states?: { success: boolean; loading: boolean; submitDisabled: boolean; showCountry: boolean; formState: { country: string; firstName: string; lastName: string; errors: any; error: string; }; user: { id: string; accountId: string; firstName: string; lastName: string; email: string; countryCode: string; }; text: { firstnametext: string; lastnametext: string; emailtext: string; countrytext: string; editProfileHeader: string; editProfileSubHeader: string; submitChangeButtonText: string; }; }; }` | `undefined` |\r\n| `editProfileHeader` | `edit-profile-header` | | `string` | `\"Edit your profile\"` |\r\n| `editProfileSubHeader` | `edit-profile-sub-header` | | `string` | `\"Personal Information\"` |\r\n| `emailtext` | `emailtext` | | `string` | `\"Email\"` |\r\n| `firstnametext` | `firstnametext` | | `string` | `\"First Name\"` |\r\n| `lastnametext` | `lastnametext` | | `string` | `\"Last Name\"` |\r\n| `showCountry` | `show-country` | | `boolean` | `true` |\r\n| `submitChangeButtonText` | `submit-change-button-text` | | `string` | `\"Submit Changes\"` |\r\n\r\n\r\n## Dependencies\r\n\r\n### Depends on\r\n\r\n- [sqm-form-message](../sqm-form-message)\r\n\r\n### Graph\r\n```mermaid\r\ngraph TD;\r\n sqm-portal-profile --> sqm-form-message\r\n style sqm-portal-profile fill:#f9f,stroke:#333,stroke-width:4px\r\n```\r\n\r\n----------------------------------------------\r\n\r\n*Built with [StencilJS](https://stenciljs.com/)*\r\n";
|
|
9387
9387
|
|
|
@@ -9971,7 +9971,7 @@ const TermsAndConditionsLongCustomLabel = createHookStory(() => (index.h(ShadowV
|
|
|
9971
9971
|
//@ts-ignore
|
|
9972
9972
|
content: {
|
|
9973
9973
|
...defaultRegisterProps.content,
|
|
9974
|
-
terms: (index.h("sqm-checkbox-field", { "checkbox-label": "Participants must be at least 18 years of age and a legal resident of the U.S. or Canada. By signing up to participate in the rewards program, you agree to the
|
|
9974
|
+
terms: (index.h("sqm-checkbox-field", { "checkbox-label": "Participants must be at least 18 years of age and a legal resident of the U.S. or Canada. By signing up to participate in the rewards program, you agree to the {labelLink}.", "checkbox-label-link": "https://www.example.com", "checkbox-label-link-text": "terms", "checkbox-name": "termsAndConditions" })),
|
|
9975
9975
|
} }))));
|
|
9976
9976
|
|
|
9977
9977
|
const CheckboxField = /*#__PURE__*/Object.freeze({
|
|
@@ -10146,105 +10146,6 @@ const UseDropdownField = /*#__PURE__*/Object.freeze({
|
|
|
10146
10146
|
Countries: Countries
|
|
10147
10147
|
});
|
|
10148
10148
|
|
|
10149
|
-
const UseCountryField_stories = {
|
|
10150
|
-
title: "Hooks / useCountryField",
|
|
10151
|
-
};
|
|
10152
|
-
function setupGraphQL$b({ token, id }) {
|
|
10153
|
-
const accountId = id;
|
|
10154
|
-
//@ts-ignore
|
|
10155
|
-
window.widgetIdent = {
|
|
10156
|
-
tenantAlias: "test_a74miwdpofztj",
|
|
10157
|
-
appDomain: "https://staging.referralsaasquatch.com",
|
|
10158
|
-
};
|
|
10159
|
-
stencilHooks_module.useEffect(() => {
|
|
10160
|
-
index_module.ae({
|
|
10161
|
-
accountId,
|
|
10162
|
-
id,
|
|
10163
|
-
jwt: token,
|
|
10164
|
-
});
|
|
10165
|
-
return () => {
|
|
10166
|
-
window.widgetIdent = undefined;
|
|
10167
|
-
index_module.ae(undefined);
|
|
10168
|
-
};
|
|
10169
|
-
}, []);
|
|
10170
|
-
return { id, accountId };
|
|
10171
|
-
}
|
|
10172
|
-
const Default$d = createHookStory(() => {
|
|
10173
|
-
setupGraphQL$b({
|
|
10174
|
-
token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoibm9sb2NhbGUiLCJhY2NvdW50SWQiOiJub2xvY2FsZSJ9fQ.ACri_gO_eIdNfh3ifMmbbDp7gZz3yjT_8mfiQ96T-BY",
|
|
10175
|
-
id: "nolocale",
|
|
10176
|
-
});
|
|
10177
|
-
return (index.h("sqm-portal-register", null,
|
|
10178
|
-
index.h("sqm-country-field", { slot: "formData" })));
|
|
10179
|
-
});
|
|
10180
|
-
const English = createHookStory(() => {
|
|
10181
|
-
setupGraphQL$b({
|
|
10182
|
-
token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImFjY291bnRJZCI6InNhbWVuZ2xpc2giLCJpZCI6InNhbWVuZ2xpc2gifX0._6OTVF3gcipu_ibgthUNr5UHwC-2E_lhCENI5HpYvcw",
|
|
10183
|
-
id: "samenglish",
|
|
10184
|
-
});
|
|
10185
|
-
return (index.h("sqm-portal-register", null,
|
|
10186
|
-
index.h("sqm-country-field", { slot: "formData" })));
|
|
10187
|
-
});
|
|
10188
|
-
const French = createHookStory(() => {
|
|
10189
|
-
setupGraphQL$b({
|
|
10190
|
-
token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImFjY291bnRJZCI6InNhbWZyZW5jaCIsImlkIjoic2FtZnJlbmNoIn19.cwhasHpfU5MLV4vGbCQcazb6p19iSw5pD2zyrVHgePg",
|
|
10191
|
-
id: "samfrench",
|
|
10192
|
-
});
|
|
10193
|
-
return (index.h("sqm-portal-register", null,
|
|
10194
|
-
index.h("sqm-country-field", { slot: "formData" })));
|
|
10195
|
-
});
|
|
10196
|
-
const Turkish = createHookStory(() => {
|
|
10197
|
-
setupGraphQL$b({
|
|
10198
|
-
token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImFjY291bnRJZCI6InNhbXR1cmtleSIsImlkIjoic2FtdHVya2V5In19.usSMe0RWg8W5FtwcvJayvAlxTw6vMxjTyWXaP8jI8_U",
|
|
10199
|
-
id: "samturkey",
|
|
10200
|
-
});
|
|
10201
|
-
return (index.h("sqm-portal-register", null,
|
|
10202
|
-
index.h("sqm-country-field", { slot: "formData" })));
|
|
10203
|
-
});
|
|
10204
|
-
const NoUser = createHookStory(() => {
|
|
10205
|
-
//@ts-ignore
|
|
10206
|
-
window.widgetIdent = {
|
|
10207
|
-
tenantAlias: "test_a74miwdpofztj",
|
|
10208
|
-
appDomain: "https://staging.referralsaasquatch.com",
|
|
10209
|
-
};
|
|
10210
|
-
stencilHooks_module.useEffect(() => {
|
|
10211
|
-
index_module.ae(undefined);
|
|
10212
|
-
return () => {
|
|
10213
|
-
window.widgetIdent = undefined;
|
|
10214
|
-
index_module.ae(undefined);
|
|
10215
|
-
};
|
|
10216
|
-
}, []);
|
|
10217
|
-
return (index.h("sqm-portal-register", null,
|
|
10218
|
-
index.h("sqm-country-field", { slot: "formData" })));
|
|
10219
|
-
});
|
|
10220
|
-
const NoUserFrench = createHookStory(() => {
|
|
10221
|
-
//@ts-ignore
|
|
10222
|
-
window.widgetIdent = {
|
|
10223
|
-
tenantAlias: "test_a74miwdpofztj",
|
|
10224
|
-
appDomain: "https://staging.referralsaasquatch.com",
|
|
10225
|
-
};
|
|
10226
|
-
stencilHooks_module.useEffect(() => {
|
|
10227
|
-
index_module.ae(undefined);
|
|
10228
|
-
return () => {
|
|
10229
|
-
window.widgetIdent = undefined;
|
|
10230
|
-
index_module.ae(undefined);
|
|
10231
|
-
};
|
|
10232
|
-
}, []);
|
|
10233
|
-
return (index.h("sqm-portal-register", null,
|
|
10234
|
-
index.h("sqm-country-field", { slot: "formData", locale: "fr" })));
|
|
10235
|
-
});
|
|
10236
|
-
|
|
10237
|
-
const UseCountryField = /*#__PURE__*/Object.freeze({
|
|
10238
|
-
__proto__: null,
|
|
10239
|
-
'default': UseCountryField_stories,
|
|
10240
|
-
Default: Default$d,
|
|
10241
|
-
English: English,
|
|
10242
|
-
French: French,
|
|
10243
|
-
Turkish: Turkish,
|
|
10244
|
-
NoUser: NoUser,
|
|
10245
|
-
NoUserFrench: NoUserFrench
|
|
10246
|
-
});
|
|
10247
|
-
|
|
10248
10149
|
const scenario$i = "@author:derek\r\n@owner:derek\r\nFeature: Reward Exchange List\r\n\r\n The Reward Exchange List gives end users the power to exchange their rewards for other rewards.\r\n It populates a list from the reward exchange rules set up on a given tenant.\r\n\r\n Background:\r\n Given a tenant with reward exchange rules\r\n\r\n @motivating\r\n @ui\r\n Scenario: The empty state is shown if there are no visible exchanges\r\n Given a user with no visible exchanges\r\n When they view the reward exchange\r\n Then no exchange options are displayed\r\n And they see an image of a present\r\n And \"Redeem Rewards\" in bold\r\n And \"Use your points to redeem rewards once they become available\" below the bolded text\r\n And the pagination buttons are disabled\r\n\r\n @minutae\r\n @ui\r\n Scenario: A custom empty state can be provided\r\n Given a user with no visible exchanges\r\n And a custom empty state has been supplied in the \"empty\" slot\r\n When they view the reward exchange\r\n Then they see the custom empty state\r\n\r\n @motivating\r\n @ui\r\n Scenario: A Loading Skeleton is displayed when the reward exchange rules are loading\r\n Given a user\r\n When they load the reward exchange list\r\n Then they see a loading Skeleton\r\n And it has 8 skeleton cards\r\n When the reward exchange rules have loaded\r\n Then the skeleton is replaced with reward exchange options\r\n\r\n @motivating\r\n Scenario: An error banner appears when the reward exchange list fails to load\r\n Given a user trying to view the reward exchange list\r\n But it fails to load\r\n Then an error banner is displayed\r\n And it displays \"Unable to load reward exchange list. Please try again\"\r\n\r\n @motivating\r\n @ui\r\n Scenario: The exchange progress bar progresses through the exchange process\r\n Given a user who is eligible for the tenants reward exchange rules\r\n When they view the reward exchange list\r\n Then the process bar displays the following elements\r\n | elements |\r\n | Step 1 `Rewards` title in black |\r\n | Step 1 circle with green outline, white fill and number 1 in green |\r\n | Step 2 `Select` title in grey |\r\n | Step 2 circle with grey fill and number 2 in white |\r\n | Step 3 `Confirm` title in grey |\r\n | Step 3 circle with grey fill and number 3 in white |\r\n | lines between all steps are greyed out |\r\n When they continue to the selection page\r\n Then the progress bar displays the following elements\r\n | elements |\r\n | Step 1 `Rewards` title in black |\r\n | Step 1 circle with white checkmark and green fill |\r\n | Step 2 `Select` title in black |\r\n | Step 2 circle with green outline, white fill and number 2 in green |\r\n | Step 3 `Confirm` title in grey |\r\n | Step 3 circle with grey fill and number 3 in white |\r\n | Green line between step 1 and 2 |\r\n | Grey line between step 2 and 3 |\r\n When they continue to the confirmation page\r\n Then the progress bar displays the following elements\r\n | elements |\r\n | Step 1 `Rewards` title in black |\r\n | Step 1 circle with white checkmark and green fill |\r\n | Step 2 `Select` title in black |\r\n | Step 2 circle with white checkmark and green fill |\r\n | Step 3 `Confirm` title in black |\r\n | Step 3 circle with green outline, white fill and number 3 in green |\r\n | Green line between all steps |\r\n When they continue to the redemption page\r\n Then the progress bar displays the following elements\r\n | elements |\r\n | Step 1 `Rewards` title in black |\r\n | Step 1 circle with white checkmark and green fill |\r\n | Step 2 `Select` title in black |\r\n | Step 2 circle with white checkmark and green fill |\r\n | Step 3 `Confirm` title in black |\r\n | Step 3 circle with white checkmark and green fill |\r\n | Green line between all steps |\r\n\r\n @motivating\r\n Scenario: Users must choose a reward exchange option to continue to the selection page\r\n Given a user who is eligible for the tenants reward exchange rules\r\n When they view the reward exchange list\r\n Then the 'Continue' button is disabled\r\n When they select a reward exchange card\r\n Then the card is outlined in brand colour with a brand colour cirlcular check box icon in the top right\r\n And the continue button is no longer disabled\r\n When they click \"Continue\"\r\n Then they are brought to the selection page\r\n\r\n @motivating\r\n @ui\r\n Scenario: Reward exchange rule names and images are used in the reward exchange cards\r\n Given a tenant reward exchange rule\r\n And it has name \"My Visa Exchange Rule\"\r\n And it has an image\r\n When a user views the reward exchange list\r\n Then they see a exchange card with title \"My Visa Exchange Rule\"\r\n And the exchange image on the left hand side of the card\r\n\r\n @motivating\r\n Scenario Outline: Reward exchange source values are displayed on reward exchange cards\r\n Given a <type> reward exchange rule\r\n When a user views the reward exchange list\r\n Then they see <text> under the name on the exchange option cards\r\n And the pretty values are localized to a user locale\r\n Examples:\r\n | type | text |\r\n | FIXED_GLOBAL_REWARD | the exchange source pretty value |\r\n | STEPPED_FIXED_GLOBAL_REWARD | the exchange source min pretty value to the source max pretty value |\r\n | VARIABLE_GLOBAL_REWARD | the exchange source min pretty value to the source max pretty value |\r\n | VARIABLE_CREDIT_REWARD | the exchange source min pretty value to the source max pretty value |\r\n\r\n @motivating\r\n Scenario Outline: Reward exchange cards can display customized error messages\r\n Given a reward exchange rule\r\n And it has <availabilityPredicate>\r\n And the reward exchange list has prop \"not-available-error\" with <value>\r\n When the user views the reward exchange list\r\n Then the card for the reward exchange rule is disabled\r\n And <message> is displayed\r\n Examples:\r\n | availabilityPredicate | value | message |\r\n | 'champion' in user.segments ? \"NOT_CHAMPION\" : true | {unavailableReasonCode, select, NOT_CHAMPION {Sorry must be a champion!} other {unavailableReasonCode} } | Sorry must be a champion! |\r\n | user.customFields.purchaseCount < 10 ? \"MORE_PURCHASE\" : true | {unavailableReasonCode, select, MORE_PURCHASE {Complete 10 purchases to unlock} other {unavailableReasonCode} } | Complete 10 purchases to unlock |\r\n\r\n @motivating\r\n Scenario: Exchange options are disabled if they put a user over the W9 limit\r\n Given a user who is approaching their W9 limit\r\n And a reward exchange rule\r\n And its destination reward has a US taxable value that would put the user over their limit\r\n When they view the reward exchange list\r\n Then the reward exchange card is disabled\r\n And a \"US Tax Limit\" error message is displayed on to the right of a exclamation triangle icon\r\n And the text is orange\r\n And the icon is orange\r\n\r\n @motivating\r\n Scenario Outline: Exchange options are disabled if a users lacks enough credit to redeem\r\n Given a <type> reward exchange rule\r\n But the user lacks enough credit to exchange for it\r\n When they view the reward exchange list\r\n Then the reward exchange card is disabled\r\n And a <text> error message is displayed on to the right of a exclamation triangle icon\r\n And the text is orange\r\n And the icon is orange\r\n Examples:\r\n | type | text |\r\n | FIXED_GLOBAL_REWARD | {prettySourceValue} required |\r\n | STEPPED_FIXED_GLOBAL_REWARD | {prettySourceMinValue} required |\r\n | VARIABLE_GLOBAL_REWARD | {prettySourceMinValue} required |\r\n | VARIABLE_CREDIT_REWARD | {prettySourceMinValue} required |\r\n\r\n @motivating\r\n Scenario: Users can go back to the Rewards page from the Select page\r\n Given a user viewing the Select page\r\n Then they see a \"Cancel\" text button\r\n And a \"Continue to confirmation\" brand colour button in the bottom right corner\r\n When they click \"Cancel\"\r\n Then they return to the Rewards page\r\n\r\n @motivating\r\n Scenario: Users can go back to the Select Page from the Confirm page\r\n Given a user viewing the Confirm page\r\n Then they see a \"Back\" text button\r\n And a \"Redeem\" brand colour button in the bottom right corner\r\n When they click \"Back\"\r\n Then they return to the Select Page\r\n\r\n @motivating\r\n Scenario: Reward rules with visibility predicates that evaluates to false are not shown\r\n Given a tenant reward exchange rule with visibility predicates that evaluates to false\r\n When a user views the reward exchange list\r\n Then they do not see the card for that reward exchange rule\r\n\r\n @motivating\r\n Scenario Outline: Users can choose their reward option for variable rewards on the Select page\r\n Given a <type> exchange rule\r\n And it has the following fields\r\n | fields |\r\n | name |\r\n | description |\r\n | image |\r\n When a user views the reward exchange list\r\n And they progress to the Select page for this exchange\r\n Then they see the exchange rule image on the left hand side\r\n And on the right hand side they see the following in this order from top to bottom\r\n | elements |\r\n | exchange name |\r\n | exchange description |\r\n | select list with all exchange options using pretty values, destination reward above source reward |\r\n Examples:\r\n | type |\r\n | STEPPED_FIXED_GLOBAL_REWARD |\r\n | VARIABLE_GLOBAL_REWARD |\r\n | VARIABLE_CREDIT_REWARD |\r\n\r\n @motivating\r\n Scenario: Users who selected a fixed exchange rule see exchange information on the Select page\r\n Given a \"FIXED_GLOBAL_REWARD\" exchange rule\r\n And it has the following fields\r\n | fields |\r\n | name |\r\n | description |\r\n | image |\r\n When a user views the reward exchange list\r\n And they progress to the Select page for this exchange\r\n Then they see the exchange rule image on the left hand side\r\n And on the right hand side they see the following in this order from top to bottom\r\n | elements |\r\n | exchange name |\r\n | exchange source pretty value displayed in brand colour |\r\n | exchange description |\r\n\r\n @motivating\r\n Scenario Outline: Users selection variable rewards can only select rewards they are eligible to exchange for\r\n Given a <type> exchange rule\r\n When a user views the reward exchange list\r\n And they progress to the Select page for this exchange\r\n Then they see a drop down with all the reward exchange selections\r\n When they click on the drop down\r\n But they are not eligible for all of the exchanges options <dueToReason>\r\n Then the ineligble options are disabled\r\n And under the source value is <text>\r\n Examples:\r\n | type | dueToReason | text |\r\n | STEPPED_FIXED_GLOBAL_REWARD | due to insufficent source value | {prettySourceValue} required |\r\n | VARIABLE_GLOBAL_REWARD | due to insufficent source value | {prettySourceValue} required |\r\n | VARIABLE_CREDIT_REWARD | due to insufficent source value | {prettySourceValue} required |\r\n | STEPPED_FIXED_GLOBAL_REWARD | W9 | US Tax Limit |\r\n | VARIABLE_GLOBAL_REWARD | W9 | US Tax Limit |\r\n | VARIABLE_CREDIT_REWARD | W9 | US Tax Limit |\r\n\r\n @motivating\r\n Scenario Outline: The Confirm page allows users to view their exchange before committing\r\n Given a <type> exchange rule\r\n When a user views the reward exchange list\r\n And they select the exchange\r\n And they progress to Confirm page\r\n Then they see a row with title \"Reward\"\r\n And it contains the exchange name\r\n And it contains the exchange image\r\n And they <maySee> a row with title \"Reward Amount\"\r\n And it <mayContain> <amountTitle>\r\n And they see a row with title \"Cost to Redeem\"\r\n And it contains the source reward pretty value in bolded text\r\n Examples:\r\n | type | maySee | mayContain | amountTitle |\r\n | FIXED_GLOBAL_REWARD | don't | doesn't contain | N/A |\r\n | VARIABLE_GLOBAL_REWARD | see | contains | the pretty destination value |\r\n | STEPPED_FIXED_GLOBAL_REWARD | see | contains | the pretty destination value |\r\n | VARIABLE_CREDIT_REWARD | see | contains | the pretty destination value |\r\n\r\n @motivating\r\n Scenario: An error banner is displayed if an error occurs during redemeption\r\n Given a user has selected a reward to exchange\r\n And is on the confirmation page\r\n When they click \"Redeem\"\r\n But an error occurs\r\n Then an error banner appears\r\n And it contains details about the error\r\n And the reward exchange is not completed\r\n\r\n @motivating\r\n Scenario: Confetti is displayed when a reward exchange succeeds\r\n Given a user has selected a reward to exchange\r\n And they are on the confirmation page\r\n When they click \"Redeem\"\r\n And the exchange is successful\r\n Then they see confetti centered on the success page\r\n And they see text describing what they exchanged for their new reward\r\n And they see a \"Done\" brand colour button\r\n When they click \"Done\"\r\n Then they see the Rewards page\r\n\r\n @motivating\r\n Scenario: Fuel tank codes are shown when a reward exchange succeeds\r\n Given a user has selected to exchange for a fuel tank reward\r\n When they complete the reward exchange\r\n And are on the success page\r\n Then they see a textbox with their fuel tank code\r\n And a clipboard icon\r\n When they click the clipboard icon\r\n Then their fuel tank code is copied to their clipboard\r\n\r\n @motivating\r\n Scenario Outline: Users can exchange for any type of reward\r\n Given a <type> reward exchange rule for a <reward>\r\n And a user who has enough source credit to exchange for the reward\r\n When they go through the exchange flow\r\n And exchange for their reward\r\n Then their credit is exchanged for the <reward>\r\n Examples:\r\n | type | reward |\r\n | FIXED_GLOBAL_REWARD | gift card |\r\n | FIXED_GLOBAL_REWARD | fuel tank code |\r\n | FIXED_GLOBAL_REWARD | discount |\r\n | FIXED_GLOBAL_REWARD | credit reward |\r\n | STEPPED_FIXED_GLOBAL_REWARD | gift card |\r\n | STEPPED_FIXED_GLOBAL_REWARD | discount |\r\n | STEPPED_FIXED_GLOBAL_REWARD | credit reward |\r\n | VARIABLE_GLOBAL_REWARD | gift card |\r\n | VARIABLE_GLOBAL_REWARD | discount |\r\n | VARIABLE_GLOBAL_REWARD | credit reward |\r\n | VARIABLE_CREDIT_REWARD | credit reward |";
|
|
10249
10150
|
|
|
10250
10151
|
const RewardExchangeList_stories = {
|
|
@@ -11314,7 +11215,7 @@ const RewardsTable$1 = /*#__PURE__*/Object.freeze({
|
|
|
11314
11215
|
const UseReferralTable_stories = {
|
|
11315
11216
|
title: "Hooks / useReferralTable",
|
|
11316
11217
|
};
|
|
11317
|
-
function setupGraphQL$
|
|
11218
|
+
function setupGraphQL$b() {
|
|
11318
11219
|
const id = "testestest";
|
|
11319
11220
|
const accountId = id;
|
|
11320
11221
|
//@ts-ignore
|
|
@@ -11357,7 +11258,7 @@ function setupGraphQLKlip$1({ token, id }) {
|
|
|
11357
11258
|
return { id, accountId };
|
|
11358
11259
|
}
|
|
11359
11260
|
const ReferralTable$1 = createHookStory(() => {
|
|
11360
|
-
setupGraphQL$
|
|
11261
|
+
setupGraphQL$b();
|
|
11361
11262
|
index_module.A("sam-partner-test-2");
|
|
11362
11263
|
return (index.h("sqm-referral-table", null,
|
|
11363
11264
|
index.h("sqm-referral-table-user-column", null),
|
|
@@ -12659,7 +12560,7 @@ const ShareCode$1 = /*#__PURE__*/Object.freeze({
|
|
|
12659
12560
|
*
|
|
12660
12561
|
*/
|
|
12661
12562
|
//
|
|
12662
|
-
const Default$
|
|
12563
|
+
const Default$d = `
|
|
12663
12564
|
// No CSS
|
|
12664
12565
|
`;
|
|
12665
12566
|
const Orangey = `
|
|
@@ -12693,7 +12594,7 @@ const Klip = `
|
|
|
12693
12594
|
|
|
12694
12595
|
const Themes = /*#__PURE__*/Object.freeze({
|
|
12695
12596
|
__proto__: null,
|
|
12696
|
-
Default: Default$
|
|
12597
|
+
Default: Default$d,
|
|
12697
12598
|
Orangey: Orangey,
|
|
12698
12599
|
Netflix: Netflix,
|
|
12699
12600
|
SaaSquatchCorporate: SaaSquatchCorporate,
|
|
@@ -15301,7 +15202,6 @@ const stories = [
|
|
|
15301
15202
|
UseLeaderboard,
|
|
15302
15203
|
UseCheckboxField,
|
|
15303
15204
|
UseDropdownField,
|
|
15304
|
-
UseCountryField,
|
|
15305
15205
|
Router,
|
|
15306
15206
|
PortalFrame,
|
|
15307
15207
|
EditProfile,
|
|
@@ -80,5 +80,5 @@ export const TermsAndConditionsLongCustomLabel = createHookStory(() => (h(Portal
|
|
|
80
80
|
//@ts-ignore
|
|
81
81
|
content: {
|
|
82
82
|
...defaultRegisterProps.content,
|
|
83
|
-
terms: (h("sqm-checkbox-field", { "checkbox-label": "Participants must be at least 18 years of age and a legal resident of the U.S. or Canada. By signing up to participate in the rewards program, you agree to the
|
|
83
|
+
terms: (h("sqm-checkbox-field", { "checkbox-label": "Participants must be at least 18 years of age and a legal resident of the U.S. or Canada. By signing up to participate in the rewards program, you agree to the {labelLink}.", "checkbox-label-link": "https://www.example.com", "checkbox-label-link-text": "terms", "checkbox-name": "termsAndConditions" })),
|
|
84
84
|
} }))));
|
|
@@ -33,7 +33,8 @@ const vanillaStyle = `
|
|
|
33
33
|
}
|
|
34
34
|
sl-checkbox::part(label){
|
|
35
35
|
font-size: var(--sl-input-label-font-size-small);
|
|
36
|
-
font-weight: var(--sl-font-weight-
|
|
36
|
+
font-weight: var(--sl-font-weight-normal);
|
|
37
|
+
line-height: 20px;
|
|
37
38
|
}
|
|
38
39
|
sl-checkbox::part(base){
|
|
39
40
|
align-items: start;
|
|
@@ -176,7 +176,7 @@ export class CheckboxField {
|
|
|
176
176
|
"mutable": false,
|
|
177
177
|
"complexType": {
|
|
178
178
|
"original": "DemoData<CheckboxFieldViewProps>",
|
|
179
|
-
"resolved": "{ states?: { validationErrors?:
|
|
179
|
+
"resolved": "{ states?: { validationErrors?: ValidationErrors; checked: boolean; }; content?: { checkboxName: string; checkboxLabel: string; checkboxLabelLink?: string; checkboxLabelLinkText?: string; checkboxRequired?: boolean; errorMessage: string; }; }",
|
|
180
180
|
"references": {
|
|
181
181
|
"DemoData": {
|
|
182
182
|
"location": "import",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useDomContext } from "@saasquatch/stencil-hooks";
|
|
2
2
|
import { useState } from "@saasquatch/universal-hooks";
|
|
3
|
-
|
|
3
|
+
import { FORM_VALIDATION_CONTEXT, } from "../sqm-portal-register/useValidationState";
|
|
4
4
|
export function useCheckboxField() {
|
|
5
|
-
const validationState = useDomContext(
|
|
5
|
+
const validationState = useDomContext(FORM_VALIDATION_CONTEXT);
|
|
6
6
|
const [checked, setChecked] = useState(false);
|
|
7
7
|
return {
|
|
8
8
|
states: {
|