@saasquatch/mint-components 1.3.2-12 → 1.3.2-13
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/sqm-divided-layout_30.cjs.entry.js +348 -430
- package/dist/collection/components/sqm-portal-register/sqm-portal-register.js +1 -1
- package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeListData.js +2 -2
- package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js +30 -30
- package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list.js +4 -7
- package/dist/collection/components/sqm-reward-exchange-list/useRewardExchangeList.js +7 -31
- package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +0 -2
- package/dist/collection/components/sqm-task-card/TaskCard.stories.js +167 -222
- package/dist/collection/components/sqm-task-card/progress-bar/progress-bar-view.js +12 -5
- package/dist/collection/components/sqm-task-card/sqm-task-card-view.js +82 -50
- package/dist/collection/components/sqm-task-card/sqm-task-card.js +10 -2
- package/dist/esm/sqm-divided-layout_30.entry.js +348 -430
- package/dist/esm-es5/sqm-divided-layout_30.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-16f5a7cb.system.js +1 -1
- package/dist/mint-components/{p-d2e71fe0.entry.js → p-3f7218fb.entry.js} +10 -10
- package/dist/mint-components/p-b6b4022a.system.entry.js +1 -0
- package/dist/types/components/sqm-reward-exchange-list/RewardExchangeListData.d.ts +2 -2
- package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.d.ts +2 -2
- package/dist/types/components/sqm-task-card/TaskCard.stories.d.ts +9 -4
- package/dist/types/components/sqm-task-card/progress-bar/progress-bar-view.d.ts +1 -0
- package/dist/types/components/sqm-task-card/sqm-task-card-view.d.ts +1 -1
- package/dist/types/components/sqm-task-card/sqm-task-card.d.ts +2 -1
- package/dist/types/components.d.ts +1 -1
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +1 -1
- package/dist/collection/components/sqm-task-card/progress-bar/progress-bar.stories.js +0 -53
- package/dist/mint-components/p-b47179b8.system.entry.js +0 -1
- package/dist/types/components/sqm-task-card/progress-bar/progress-bar.stories.d.ts +0 -12
|
@@ -14803,7 +14803,6 @@ const EXCHANGE = index_module.dist.gql `
|
|
|
14803
14803
|
`;
|
|
14804
14804
|
function useRewardExchangeList(props) {
|
|
14805
14805
|
var _a, _b, _c, _d;
|
|
14806
|
-
const drawerRef = _extends.useRef();
|
|
14807
14806
|
const [exchangeState, setExchangeState] = _extends.useReducer((state, next) => ({
|
|
14808
14807
|
...state,
|
|
14809
14808
|
...next,
|
|
@@ -14817,22 +14816,16 @@ function useRewardExchangeList(props) {
|
|
|
14817
14816
|
const { selectedItem, selectedStep, redeemStage, amount, exchangeError } = exchangeState;
|
|
14818
14817
|
const user = index_module.T();
|
|
14819
14818
|
const [exchange, { data: exchangeResponse, errors }] = index_module.be(EXCHANGE);
|
|
14820
|
-
const { data, loading } = index_module.en(GET_EXCHANGE_LIST, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
14819
|
+
const { data, loading, refetch } = index_module.en(GET_EXCHANGE_LIST, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
14821
14820
|
_extends.useEffect(() => {
|
|
14822
14821
|
var _a, _b;
|
|
14823
14822
|
if ((_b = (_a = exchangeResponse === null || exchangeResponse === void 0 ? void 0 : exchangeResponse.exchangeReward) === null || _a === void 0 ? void 0 : _a.reward) === null || _b === void 0 ? void 0 : _b.id) {
|
|
14824
14823
|
setExchangeState({ redeemStage: "success" });
|
|
14825
14824
|
}
|
|
14826
14825
|
if (!!errors) {
|
|
14827
|
-
console.log("YEA");
|
|
14828
14826
|
setExchangeState({ exchangeError: true });
|
|
14829
14827
|
}
|
|
14830
14828
|
}, [exchangeResponse, errors]);
|
|
14831
|
-
function openDrawer() {
|
|
14832
|
-
var _a;
|
|
14833
|
-
setExchangeState({ redeemStage: "chooseReward" });
|
|
14834
|
-
(_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.show();
|
|
14835
|
-
}
|
|
14836
14829
|
function exchangeReward() {
|
|
14837
14830
|
if (!selectedItem)
|
|
14838
14831
|
return;
|
|
@@ -14890,29 +14883,16 @@ function useRewardExchangeList(props) {
|
|
|
14890
14883
|
}
|
|
14891
14884
|
exchange({ exchangeRewardInput: exchangeVariables });
|
|
14892
14885
|
}
|
|
14893
|
-
const resetState =
|
|
14894
|
-
|
|
14895
|
-
// selects also trigger an sl-hide event :(
|
|
14896
|
-
//@ts-ignore - componentId is not private here
|
|
14897
|
-
if (((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.componentId) !== ((_b = drawerRef.current) === null || _b === void 0 ? void 0 : _b.componentId))
|
|
14898
|
-
return;
|
|
14886
|
+
const resetState = (refresh) => {
|
|
14887
|
+
refresh && refetch();
|
|
14899
14888
|
setExchangeState({
|
|
14900
14889
|
amount: 0,
|
|
14901
14890
|
selectedStep: undefined,
|
|
14902
14891
|
selectedItem: undefined,
|
|
14903
14892
|
exchangeError: false,
|
|
14893
|
+
redeemStage: "chooseReward",
|
|
14904
14894
|
});
|
|
14905
|
-
}
|
|
14906
|
-
_extends.useEffect(() => {
|
|
14907
|
-
if (!(drawerRef === null || drawerRef === void 0 ? void 0 : drawerRef.current))
|
|
14908
|
-
return;
|
|
14909
|
-
const drawer = drawerRef.current;
|
|
14910
|
-
// Clear input value when drawer is closed
|
|
14911
|
-
drawer.addEventListener("sl-hide", resetState);
|
|
14912
|
-
return () => {
|
|
14913
|
-
drawer.removeEventListener("sl-hide", resetState);
|
|
14914
|
-
};
|
|
14915
|
-
}, [drawerRef.current]);
|
|
14895
|
+
};
|
|
14916
14896
|
function setStage(stage) {
|
|
14917
14897
|
setExchangeState({ redeemStage: stage });
|
|
14918
14898
|
}
|
|
@@ -14930,17 +14910,13 @@ function useRewardExchangeList(props) {
|
|
|
14930
14910
|
},
|
|
14931
14911
|
data: {
|
|
14932
14912
|
exchangeList: (_b = (_a = data === null || data === void 0 ? void 0 : data.viewer) === null || _a === void 0 ? void 0 : _a.visibleRewardExchangeItems) === null || _b === void 0 ? void 0 : _b.data,
|
|
14933
|
-
//@ts-ignore
|
|
14934
14913
|
fuelTankCode: (_d = (_c = exchangeResponse === null || exchangeResponse === void 0 ? void 0 : exchangeResponse.exchangeReward) === null || _c === void 0 ? void 0 : _c.reward) === null || _d === void 0 ? void 0 : _d.fuelTankCode,
|
|
14935
14914
|
},
|
|
14936
14915
|
callbacks: {
|
|
14937
14916
|
exchangeReward,
|
|
14938
|
-
openDrawer,
|
|
14939
14917
|
setExchangeState,
|
|
14940
14918
|
setStage,
|
|
14941
|
-
|
|
14942
|
-
refs: {
|
|
14943
|
-
drawerRef,
|
|
14919
|
+
resetState,
|
|
14944
14920
|
},
|
|
14945
14921
|
};
|
|
14946
14922
|
}
|
|
@@ -15121,7 +15097,7 @@ function RewardExchangeView(props) {
|
|
|
15121
15097
|
flexWrap: "wrap",
|
|
15122
15098
|
margin: "var(--sl-spacing-medium) 0",
|
|
15123
15099
|
"& .cancel": {
|
|
15124
|
-
width: "
|
|
15100
|
+
width: "20%",
|
|
15125
15101
|
marginLeft: "auto",
|
|
15126
15102
|
marginRight: "var(--sl-spacing-medium)",
|
|
15127
15103
|
"&::part(base)": {
|
|
@@ -15130,7 +15106,7 @@ function RewardExchangeView(props) {
|
|
|
15130
15106
|
},
|
|
15131
15107
|
},
|
|
15132
15108
|
"& .continue": {
|
|
15133
|
-
width: "
|
|
15109
|
+
width: "20%",
|
|
15134
15110
|
"&::part(base)": {
|
|
15135
15111
|
background: "var(--sl-color-neutral-500)",
|
|
15136
15112
|
fontWeight: "var(--sl-font-weight-normal)",
|
|
@@ -15143,7 +15119,7 @@ function RewardExchangeView(props) {
|
|
|
15143
15119
|
jssPresetDefault_esm.jss.setup(jssPresetDefault_esm.create());
|
|
15144
15120
|
const sheet = jssPresetDefault_esm.jss.createStyleSheet(style);
|
|
15145
15121
|
const styleString = sheet.toString();
|
|
15146
|
-
const { states, data, callbacks
|
|
15122
|
+
const { states, data, callbacks } = props;
|
|
15147
15123
|
const { selectedItem, selectedStep } = states;
|
|
15148
15124
|
function getInput() {
|
|
15149
15125
|
var _a, _b;
|
|
@@ -15170,8 +15146,6 @@ function RewardExchangeView(props) {
|
|
|
15170
15146
|
}
|
|
15171
15147
|
function chooseReward() {
|
|
15172
15148
|
var _a;
|
|
15173
|
-
const nextStage = "chooseAmount";
|
|
15174
|
-
// console.log({ nextStage, ruleType: selectedItem?.ruleType });
|
|
15175
15149
|
return [
|
|
15176
15150
|
index.h("div", { style: {
|
|
15177
15151
|
display: "grid",
|
|
@@ -15227,7 +15201,8 @@ function RewardExchangeView(props) {
|
|
|
15227
15201
|
: item.unavailableReasonCode))))));
|
|
15228
15202
|
})),
|
|
15229
15203
|
index.h("div", { class: sheet.classes.KutayButton },
|
|
15230
|
-
index.h("sl-button", { class: "
|
|
15204
|
+
index.h("sl-button", { class: "cancel", size: "large", type: "text" }, "Cancel"),
|
|
15205
|
+
index.h("sl-button", { class: "continue", size: "large", onClick: () => callbacks.setStage("chooseAmount"), disabled: !states.selectedItem }, "Continue")),
|
|
15231
15206
|
];
|
|
15232
15207
|
}
|
|
15233
15208
|
function chooseAmount() {
|
|
@@ -15237,13 +15212,10 @@ function RewardExchangeView(props) {
|
|
|
15237
15212
|
index.h("p", null, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description),
|
|
15238
15213
|
index.h("div", { class: sheet.classes.InputBox }, input),
|
|
15239
15214
|
index.h("div", { class: sheet.classes.KutayButton },
|
|
15240
|
-
index.h("sl-button", { class: "cancel", size: "large", type: "text", onClick: () => callbacks.
|
|
15241
|
-
index.h("sl-button", { class: "continue", size: "large", onClick: () => callbacks.setStage("confirmation"), disabled: states.
|
|
15242
|
-
(input && !states.amount) }, "Continue to confirmation"))));
|
|
15215
|
+
index.h("sl-button", { class: "cancel", size: "large", type: "text", onClick: () => callbacks.resetState() }, "Cancel"),
|
|
15216
|
+
index.h("sl-button", { class: "continue", size: "large", onClick: () => callbacks.setStage("confirmation"), disabled: input && !states.amount }, "Continue to confirmation"))));
|
|
15243
15217
|
}
|
|
15244
|
-
// console.log({ selectedItem, selectedStep });
|
|
15245
15218
|
function confirmation() {
|
|
15246
|
-
const previousStage = "chooseAmount";
|
|
15247
15219
|
return (index.h("div", null,
|
|
15248
15220
|
index.h("h2", null, "Confirm and redeem"),
|
|
15249
15221
|
index.h("div", { style: { textAlign: "center" } },
|
|
@@ -15263,13 +15235,14 @@ function RewardExchangeView(props) {
|
|
|
15263
15235
|
index.h("p", { style: { marginBottom: "0", flex: "1" } }, selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue)))),
|
|
15264
15236
|
index.h("div", { class: sheet.classes.Buttons },
|
|
15265
15237
|
index.h("sl-button", { onClick: callbacks.exchangeReward, style: { display: "block" }, class: sheet.classes.Button }, "Redeem"),
|
|
15266
|
-
index.h("a", { onClick: () => callbacks.setStage(
|
|
15238
|
+
index.h("a", { onClick: () => callbacks.setStage("chooseAmount"), style: { display: "block" }, class: sheet.classes.Button }, "Back"))));
|
|
15267
15239
|
}
|
|
15268
15240
|
function success() {
|
|
15269
15241
|
return (index.h("div", { style: { textAlign: "center" } },
|
|
15270
15242
|
index.h("img", { class: sheet.classes.FullImage, src: index.getAssetPath("./assets/Reward-icon.png") }),
|
|
15271
15243
|
index.h("p", { style: { color: "forestgreen" } }, "Reward Redeemed"),
|
|
15272
|
-
(data === null || data === void 0 ? void 0 : data.fuelTankCode) && index.h("pre", null, data === null || data === void 0 ? void 0 : data.fuelTankCode)
|
|
15244
|
+
(data === null || data === void 0 ? void 0 : data.fuelTankCode) && index.h("pre", null, data === null || data === void 0 ? void 0 : data.fuelTankCode),
|
|
15245
|
+
index.h("sl-button", { onClick: () => callbacks.resetState(true) }, "Done")));
|
|
15273
15246
|
}
|
|
15274
15247
|
const stages = {
|
|
15275
15248
|
chooseReward: () => chooseReward(),
|
|
@@ -15291,7 +15264,25 @@ function RewardExchangeView(props) {
|
|
|
15291
15264
|
})),
|
|
15292
15265
|
index.h(ProgressBar, { stageCount: 3, currentStage: stageNumber })));
|
|
15293
15266
|
}
|
|
15294
|
-
|
|
15267
|
+
// const BackButton = () => {
|
|
15268
|
+
// if (states.redeemStage === "success") return "";
|
|
15269
|
+
// let previousStage: Stages = "";
|
|
15270
|
+
// if (states.redeemStage === "confirmation") {
|
|
15271
|
+
// previousStage = "chooseAmount";
|
|
15272
|
+
// } else if (states.redeemStage === "chooseAmount") {
|
|
15273
|
+
// previousStage = "chooseReward";
|
|
15274
|
+
// }
|
|
15275
|
+
// return (
|
|
15276
|
+
// <div slot="label">
|
|
15277
|
+
// <a
|
|
15278
|
+
// style={{ cursor: "pointer", fontSize: "80%", color: "#858585" }}
|
|
15279
|
+
// onClick={() => callbacks.setStage(previousStage)}
|
|
15280
|
+
// >
|
|
15281
|
+
// <LeftArrow /> Back
|
|
15282
|
+
// </a>
|
|
15283
|
+
// </div>
|
|
15284
|
+
// );
|
|
15285
|
+
// };
|
|
15295
15286
|
return (index.h("div", { class: sheet.classes.Container },
|
|
15296
15287
|
index.h("style", { type: "text/css" }, styleString),
|
|
15297
15288
|
index.h("div", null,
|
|
@@ -15322,10 +15313,10 @@ const SqmRewardExchangeList = class {
|
|
|
15322
15313
|
// if (missingProps) {
|
|
15323
15314
|
// return <RequiredPropsError missingProps={missingProps} />;
|
|
15324
15315
|
// }
|
|
15325
|
-
const { states, data, callbacks
|
|
15316
|
+
const { states, data, callbacks } = index_module.j()
|
|
15326
15317
|
? useRewardExchangeListDemo(utils.getProps(this))
|
|
15327
15318
|
: useRewardExchangeList(utils.getProps(this));
|
|
15328
|
-
return (index.h(index.Host, { style: { display: "contents" } }, index.h(RewardExchangeView, { states: states, data: data, callbacks: callbacks
|
|
15319
|
+
return (index.h(index.Host, { style: { display: "contents" } }, index.h(RewardExchangeView, { states: states, data: data, callbacks: callbacks })));
|
|
15329
15320
|
}
|
|
15330
15321
|
static get assetsDirs() { return ["assets"]; }
|
|
15331
15322
|
};
|
|
@@ -15346,12 +15337,9 @@ function useRewardExchangeListDemo(props) {
|
|
|
15346
15337
|
},
|
|
15347
15338
|
callbacks: {
|
|
15348
15339
|
exchangeReward: () => { },
|
|
15349
|
-
openDrawer: () => { },
|
|
15350
15340
|
setExchangeState: (_) => { },
|
|
15351
15341
|
setStage: (_) => { },
|
|
15352
|
-
|
|
15353
|
-
refs: {
|
|
15354
|
-
drawerRef: {},
|
|
15342
|
+
resetState: () => { }
|
|
15355
15343
|
},
|
|
15356
15344
|
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
15357
15345
|
}
|
|
@@ -21034,6 +21022,69 @@ const PasswordField = /*#__PURE__*/Object.freeze({
|
|
|
21034
21022
|
ValidationError: ValidationError
|
|
21035
21023
|
});
|
|
21036
21024
|
|
|
21025
|
+
/**
|
|
21026
|
+
* Displays a cartesian product of the input props
|
|
21027
|
+
*
|
|
21028
|
+
* @returns
|
|
21029
|
+
*/
|
|
21030
|
+
function MatrixStory({ matrix, props, Component, }) {
|
|
21031
|
+
const propMatrix = Object.keys(matrix).map((propKey) => {
|
|
21032
|
+
const propValues = matrix[propKey];
|
|
21033
|
+
return propValues.map((val) => {
|
|
21034
|
+
return {
|
|
21035
|
+
[propKey]: val,
|
|
21036
|
+
};
|
|
21037
|
+
});
|
|
21038
|
+
});
|
|
21039
|
+
const combinations = cartesian(...propMatrix);
|
|
21040
|
+
const propsCombinations = combinations.map((combo) => {
|
|
21041
|
+
return combo.reduce((props, prop) => {
|
|
21042
|
+
return {
|
|
21043
|
+
...props,
|
|
21044
|
+
...prop,
|
|
21045
|
+
};
|
|
21046
|
+
}, {});
|
|
21047
|
+
});
|
|
21048
|
+
return propsCombinations.map((combo) => {
|
|
21049
|
+
const example = { ...props, ...combo };
|
|
21050
|
+
return (index.h("div", null,
|
|
21051
|
+
index.h(PropsTable, { values: example }),
|
|
21052
|
+
index.h("hr", null),
|
|
21053
|
+
index.h(Component, Object.assign({}, example))));
|
|
21054
|
+
});
|
|
21055
|
+
}
|
|
21056
|
+
function PropsTable({ values }) {
|
|
21057
|
+
return (index.h("table", null,
|
|
21058
|
+
index.h("tbody", null, Object.keys(values).map((key) => {
|
|
21059
|
+
return (index.h("tr", null,
|
|
21060
|
+
index.h("th", null, key),
|
|
21061
|
+
index.h("td", null, JSON.stringify(values[key]))));
|
|
21062
|
+
}))));
|
|
21063
|
+
}
|
|
21064
|
+
/**
|
|
21065
|
+
* Source: https://stackoverflow.com/questions/15298912/javascript-generating-combinations-from-n-arrays-with-m-elements
|
|
21066
|
+
*
|
|
21067
|
+
* TODO: Could replace with a fork of https://www.npmjs.com/package/cartesian
|
|
21068
|
+
*
|
|
21069
|
+
* @param args - an array of arrays
|
|
21070
|
+
* @returns combinations of the elements in those array
|
|
21071
|
+
*/
|
|
21072
|
+
function cartesian(...args) {
|
|
21073
|
+
var r = [], max = args.length - 1;
|
|
21074
|
+
function helper(arr, i) {
|
|
21075
|
+
for (var j = 0, l = args[i].length; j < l; j++) {
|
|
21076
|
+
var a = arr.slice(0); // clone arr
|
|
21077
|
+
a.push(args[i][j]);
|
|
21078
|
+
if (i == max)
|
|
21079
|
+
r.push(a);
|
|
21080
|
+
else
|
|
21081
|
+
helper(a, i + 1);
|
|
21082
|
+
}
|
|
21083
|
+
}
|
|
21084
|
+
helper([], 0);
|
|
21085
|
+
return r;
|
|
21086
|
+
}
|
|
21087
|
+
|
|
21037
21088
|
const checkmark_circle = () => {
|
|
21038
21089
|
return (index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18" },
|
|
21039
21090
|
index.h("path", { fill: "currentColor", "fill-rule": "evenodd", d: "M1.636 9a7.364 7.364 0 1114.728 0A7.364 7.364 0 011.636 9zM9 0a9 9 0 100 18A9 9 0 009 0zm5.192 6.266a.982.982 0 00-1.548-1.208l-4.787 6.137-2.58-2.58a.982.982 0 00-1.39 1.388l3.367 3.366a.982.982 0 001.468-.09l5.47-7.013z", "clip-rule": "evenodd" })));
|
|
@@ -21051,7 +21102,7 @@ const gift = () => {
|
|
|
21051
21102
|
};
|
|
21052
21103
|
|
|
21053
21104
|
function ProgressBarView(props) {
|
|
21054
|
-
const { progress = 0, goal = 1, steps = false, progressBarUnit = "", repeatable = false, complete = false, } = props;
|
|
21105
|
+
const { progress = 0, goal = 1, steps = false, progressBarUnit = "", repeatable = false, complete = false, expired = false, } = props;
|
|
21055
21106
|
console.log("progress bar props", props);
|
|
21056
21107
|
const gift1 = gift();
|
|
21057
21108
|
const gift2 = gift();
|
|
@@ -21080,7 +21131,10 @@ function ProgressBarView(props) {
|
|
|
21080
21131
|
ProgressBar: {
|
|
21081
21132
|
"& .progress-bar": {
|
|
21082
21133
|
height: "15px",
|
|
21083
|
-
marginTop: steps
|
|
21134
|
+
marginTop: steps
|
|
21135
|
+
? "var(--sl-spacing-medium)"
|
|
21136
|
+
: "var(--sl-spacing-large)",
|
|
21137
|
+
filter: expired ? "grayscale(1)" : "",
|
|
21084
21138
|
marginBottom: "var(--sl-spacing-xx-large)",
|
|
21085
21139
|
marginRight: "var(--sl-spacing-x-small)",
|
|
21086
21140
|
fontSize: "var(--sl-font-size-x-small)",
|
|
@@ -21098,7 +21152,9 @@ function ProgressBarView(props) {
|
|
|
21098
21152
|
width: "100%",
|
|
21099
21153
|
height: "4px",
|
|
21100
21154
|
borderRadius: "4px",
|
|
21101
|
-
backgroundColor: complete
|
|
21155
|
+
backgroundColor: complete
|
|
21156
|
+
? "var(--sl-color-success-500)"
|
|
21157
|
+
: "var(--sl-color-primary-500)",
|
|
21102
21158
|
},
|
|
21103
21159
|
"& .progress": {
|
|
21104
21160
|
display: "block",
|
|
@@ -21111,7 +21167,9 @@ function ProgressBarView(props) {
|
|
|
21111
21167
|
width: "12px",
|
|
21112
21168
|
height: "12px",
|
|
21113
21169
|
display: "flex",
|
|
21114
|
-
backgroundColor: complete
|
|
21170
|
+
backgroundColor: complete
|
|
21171
|
+
? "var(--sl-color-success-500)"
|
|
21172
|
+
: "var(--sl-color-primary-500)",
|
|
21115
21173
|
borderRadius: "50%",
|
|
21116
21174
|
position: "relative",
|
|
21117
21175
|
left: "47%",
|
|
@@ -21301,7 +21359,7 @@ function ProgressBarView(props) {
|
|
|
21301
21359
|
}
|
|
21302
21360
|
else {
|
|
21303
21361
|
items.push(index.h("div", { class: "remain" }));
|
|
21304
|
-
items.push(index.h("div", { class: "empty" },
|
|
21362
|
+
items.push(index.h("div", { class: "empty" }, i));
|
|
21305
21363
|
}
|
|
21306
21364
|
}
|
|
21307
21365
|
else if (i == goal) {
|
|
@@ -21359,7 +21417,6 @@ function ProgressBarView(props) {
|
|
|
21359
21417
|
}
|
|
21360
21418
|
|
|
21361
21419
|
function TaskCardView(props) {
|
|
21362
|
-
const { rewardAmount, cardTitle, description, showProgressBar, progress = 0, goal, rewardUnit, repeatable, showExpiry, dateExpires, buttonText, buttonLink, loading, } = props;
|
|
21363
21420
|
console.log({ props });
|
|
21364
21421
|
const checkmark_circle$1 = checkmark_circle();
|
|
21365
21422
|
const arrow_left_right$1 = arrow_left_right();
|
|
@@ -21373,16 +21430,28 @@ function TaskCardView(props) {
|
|
|
21373
21430
|
position: "relative",
|
|
21374
21431
|
boxSizing: "border-box",
|
|
21375
21432
|
minWidth: "347px",
|
|
21376
|
-
background: "var(--sl-color-
|
|
21377
|
-
border: "1px solid var(--sl-color-
|
|
21433
|
+
background: "var(--sl-color-neutral-0)",
|
|
21434
|
+
border: "1px solid var(--sl-color-neutral-300)",
|
|
21378
21435
|
borderRadius: "var(--sl-border-radius-medium)",
|
|
21379
21436
|
fontSize: "var(--sl-font-size-small)",
|
|
21380
21437
|
lineHeight: "var(--sl-line-height-dense)",
|
|
21438
|
+
color: "var(--sl-color-neutral-600)",
|
|
21381
21439
|
},
|
|
21382
21440
|
"& .main.complete": {
|
|
21383
21441
|
background: "var(--sl-color-success-50)",
|
|
21384
21442
|
borderColor: "var(--sl-color-success-700)",
|
|
21385
21443
|
},
|
|
21444
|
+
"& .main.expired": {
|
|
21445
|
+
color: "var(--sl-color-neutral-400)",
|
|
21446
|
+
background: "var(--sl-color-neutral-100)",
|
|
21447
|
+
},
|
|
21448
|
+
"& .title": {
|
|
21449
|
+
fontSize: "var(--sl-font-size-small)",
|
|
21450
|
+
fontWeight: "var(--sl-font-weight-semibold)",
|
|
21451
|
+
},
|
|
21452
|
+
"& .black": {
|
|
21453
|
+
color: "var(--sl-color-neutral-1000)",
|
|
21454
|
+
},
|
|
21386
21455
|
},
|
|
21387
21456
|
Header: {
|
|
21388
21457
|
display: "flex",
|
|
@@ -21395,7 +21464,6 @@ function TaskCardView(props) {
|
|
|
21395
21464
|
},
|
|
21396
21465
|
"& .value": {
|
|
21397
21466
|
alignSelf: "center",
|
|
21398
|
-
color: "var(--sl-color-black)",
|
|
21399
21467
|
fontSize: "var(--sl-font-size-x-large)",
|
|
21400
21468
|
fontWeight: "var(--sl-font-weight-semibold)",
|
|
21401
21469
|
lineHeight: "100%",
|
|
@@ -21404,16 +21472,21 @@ function TaskCardView(props) {
|
|
|
21404
21472
|
"& .text": {
|
|
21405
21473
|
alignSelf: "end",
|
|
21406
21474
|
textTransform: "uppercase",
|
|
21407
|
-
color: "var(--sl-color-gray-600)",
|
|
21408
21475
|
fontSize: "var(--sl-font-size-x-small)",
|
|
21409
21476
|
lineHeight: "var(--sl-font-size-medium)",
|
|
21410
21477
|
marginRight: "var(--sl-spacing-xx-small)",
|
|
21411
21478
|
},
|
|
21412
|
-
|
|
21413
|
-
|
|
21414
|
-
|
|
21415
|
-
|
|
21416
|
-
|
|
21479
|
+
"& .end": {
|
|
21480
|
+
color: "var(--sl-color-warning-600)",
|
|
21481
|
+
fontWeight: "var(--sl-font-weight-semibold)",
|
|
21482
|
+
marginBottom: "var(--sl-spacing-xx-small)",
|
|
21483
|
+
},
|
|
21484
|
+
"& .black": {
|
|
21485
|
+
color: "var(--sl-color-neutral-1000)",
|
|
21486
|
+
},
|
|
21487
|
+
"& .neutral": {
|
|
21488
|
+
color: "var(--sl-color-neutral-400)",
|
|
21489
|
+
},
|
|
21417
21490
|
},
|
|
21418
21491
|
Footer: {
|
|
21419
21492
|
display: "flex",
|
|
@@ -21425,58 +21498,69 @@ function TaskCardView(props) {
|
|
|
21425
21498
|
marginTop: "auto",
|
|
21426
21499
|
verticalAlign: "text-bottom",
|
|
21427
21500
|
fontSize: "var(--sl-font-size-x-small)",
|
|
21428
|
-
color: "var(--sl-color-gray-600)",
|
|
21429
21501
|
},
|
|
21430
21502
|
"& .success": {
|
|
21431
|
-
color: "var(--sl-color-success-600)
|
|
21503
|
+
color: "var(--sl-color-success-600)",
|
|
21432
21504
|
fontWeight: "var(--sl-font-weight-semibold)",
|
|
21433
21505
|
},
|
|
21434
21506
|
"& .action": {
|
|
21435
21507
|
marginTop: "auto",
|
|
21436
21508
|
marginLeft: "auto",
|
|
21509
|
+
"&::part(base)": {
|
|
21510
|
+
color: "var(--sl-color-neutral-0)",
|
|
21511
|
+
borderRadius: "var(--sl-border-radius-medium)",
|
|
21512
|
+
},
|
|
21513
|
+
"&.disabled::part(base)": {
|
|
21514
|
+
border: "1px solid var(--sl-color-neutral-400)",
|
|
21515
|
+
background: "var(--sl-color-neutral-400)",
|
|
21516
|
+
},
|
|
21437
21517
|
},
|
|
21438
|
-
"&
|
|
21439
|
-
color: "var(--sl-color-
|
|
21440
|
-
background: "var(--sl-color-primary-500)",
|
|
21441
|
-
border: "1px solid var(--sl-color-primary-500)",
|
|
21442
|
-
borderRadius: "var(--sl-border-radius-medium)",
|
|
21443
|
-
},
|
|
21444
|
-
"& sl-button.action.completed::part(base) ": {
|
|
21445
|
-
border: "1px solid var(--sl-color-gray-300)!important",
|
|
21446
|
-
background: "var(--sl-color-gray-300)!important",
|
|
21518
|
+
"& .neutral": {
|
|
21519
|
+
color: "var(--sl-color-neutral-400)",
|
|
21447
21520
|
},
|
|
21448
21521
|
},
|
|
21449
21522
|
};
|
|
21450
21523
|
jssPresetDefault_esm.jss.setup(jssPresetDefault_esm.create());
|
|
21451
21524
|
const sheet = jssPresetDefault_esm.jss.createStyleSheet(style);
|
|
21452
21525
|
const styleString = sheet.toString();
|
|
21453
|
-
const showComplete = progress >= goal;
|
|
21454
|
-
const repetitions = showProgressBar
|
|
21455
|
-
|
|
21456
|
-
|
|
21526
|
+
const showComplete = props.progress >= props.goal;
|
|
21527
|
+
const repetitions = props.showProgressBar
|
|
21528
|
+
? Math.floor(props.progress / props.goal)
|
|
21529
|
+
: props.progress;
|
|
21530
|
+
const taskComplete = showComplete && props.repeatable === false;
|
|
21531
|
+
const dateExpire = props.showExpiry && luxon.DateTime.fromISO(props.dateExpires.split("/").pop());
|
|
21532
|
+
const taskExpired = props.showExpiry && luxon.DateTime.now() > dateExpire;
|
|
21533
|
+
const dateExpireText = dateExpire.toLocaleString(luxon.DateTime.DATE_FULL);
|
|
21534
|
+
console.log(taskExpired);
|
|
21457
21535
|
return (index.h("div", { class: sheet.classes.TaskCard },
|
|
21458
|
-
index.h("div", { class:
|
|
21536
|
+
index.h("div", { class: taskExpired ? "main expired" : taskComplete ? "main complete" : "main" },
|
|
21459
21537
|
index.h("style", { type: "text/css" }, styleString),
|
|
21460
|
-
index.h("div", { class: sheet.classes.Header },
|
|
21461
|
-
|
|
21462
|
-
|
|
21463
|
-
|
|
21464
|
-
|
|
21465
|
-
|
|
21466
|
-
|
|
21467
|
-
|
|
21538
|
+
index.h("div", { class: sheet.classes.Header }, props.loading ? (index.h("sl-skeleton", { style: { width: "22%", margin: "0" } })) : (index.h("div", null,
|
|
21539
|
+
taskExpired && (index.h("div", { class: "end" },
|
|
21540
|
+
" ",
|
|
21541
|
+
"Ended " + dateExpireText,
|
|
21542
|
+
" ")),
|
|
21543
|
+
showComplete && (index.h("span", { class: taskExpired ? "icon neutral" : "icon" }, checkmark_circle$1)),
|
|
21544
|
+
index.h("span", { class: taskExpired ? "value" : "value black" }, props.rewardAmount),
|
|
21545
|
+
index.h("span", { class: "text" }, props.rewardUnit)))),
|
|
21546
|
+
props.loading ? (index.h("sl-skeleton", { style: { width: "42%", margin: "0 16px" } })) : (index.h("div", { class: taskExpired ? "title" : "title black" }, props.cardTitle)),
|
|
21547
|
+
props.loading ? (index.h("sl-skeleton", { style: { width: "91%", margin: "12px 16px" } })) : (index.h(Details, Object.assign({}, props))),
|
|
21548
|
+
props.showProgressBar && props.loading ? (index.h("sl-skeleton", { style: { width: "91%", margin: "0 auto" } })) : (props.showProgressBar && (index.h(ProgressBarView, Object.assign({}, props, { complete: taskComplete, expired: taskExpired })))),
|
|
21549
|
+
index.h("div", { class: sheet.classes.Footer }, props.loading ? (index.h("sl-skeleton", { style: { width: "25%", marginLeft: "auto" } })) : (index.h("div", { style: { display: "contents" } },
|
|
21468
21550
|
index.h("span", { class: "text" },
|
|
21469
|
-
repeatable && (index.h("div", null,
|
|
21470
|
-
index.h("span", { class: repetitions > 0
|
|
21471
|
-
|
|
21472
|
-
|
|
21473
|
-
|
|
21474
|
-
|
|
21475
|
-
|
|
21476
|
-
|
|
21477
|
-
|
|
21478
|
-
|
|
21479
|
-
|
|
21551
|
+
props.repeatable && (index.h("div", null,
|
|
21552
|
+
index.h("span", { class: repetitions > 0
|
|
21553
|
+
? taskExpired
|
|
21554
|
+
? "icon neutral"
|
|
21555
|
+
: "icon success"
|
|
21556
|
+
: "icon" }, arrow_left_right$1),
|
|
21557
|
+
index.h("span", { class: repetitions > 0
|
|
21558
|
+
? taskExpired
|
|
21559
|
+
? "neutral"
|
|
21560
|
+
: "success"
|
|
21561
|
+
: "" }, "Completed " + repetitions + " times"))),
|
|
21562
|
+
props.showExpiry && !taskExpired && (index.h("span", null, "Ends " + dateExpireText))),
|
|
21563
|
+
index.h("sl-button", { class: taskComplete || taskExpired ? "action disabled" : "action", type: "primary", size: "small", onClick: () => window.open(props.buttonLink), disabled: taskComplete || taskExpired }, props.buttonText)))))));
|
|
21480
21564
|
}
|
|
21481
21565
|
function Details(props) {
|
|
21482
21566
|
const style = {
|
|
@@ -21491,7 +21575,7 @@ function Details(props) {
|
|
|
21491
21575
|
position: "absolute",
|
|
21492
21576
|
top: "var(--sl-spacing-medium)",
|
|
21493
21577
|
right: "var(--sl-spacing-medium)",
|
|
21494
|
-
color: "var(--sl-color-
|
|
21578
|
+
color: "var(--sl-color-neutral-700)",
|
|
21495
21579
|
fontSize: "var(--sl-font-size-large)",
|
|
21496
21580
|
"& :hover": {
|
|
21497
21581
|
color: "var(--sl-color-primary-700)",
|
|
@@ -21500,16 +21584,21 @@ function Details(props) {
|
|
|
21500
21584
|
transition: "transform var(--sl-transition-medium) ease",
|
|
21501
21585
|
},
|
|
21502
21586
|
"& input:checked ~ .summary": {
|
|
21503
|
-
transition: "
|
|
21587
|
+
transition: "all var(--sl-transition-medium) ease",
|
|
21504
21588
|
maxHeight: "300px",
|
|
21589
|
+
marginBottom: props.steps
|
|
21590
|
+
? "var(--sl-spacing-large)"
|
|
21591
|
+
: props.showProgressBar
|
|
21592
|
+
? "var(--sl-spacing-xx-large)"
|
|
21593
|
+
: "var(--sl-spacing-large)",
|
|
21505
21594
|
},
|
|
21506
21595
|
"& .summary": {
|
|
21507
21596
|
display: "block",
|
|
21508
21597
|
overflow: "hidden",
|
|
21509
|
-
|
|
21510
|
-
fontSize: "var(--sl-font-size-x-small)",
|
|
21598
|
+
fontSize: "var(--sl-font-size-small)",
|
|
21511
21599
|
maxHeight: "0px",
|
|
21512
|
-
transition: "
|
|
21600
|
+
transition: "all var(--sl-transition-fast) ease-out",
|
|
21601
|
+
marginBottom: "var(--sl-spacing-medium)",
|
|
21513
21602
|
},
|
|
21514
21603
|
},
|
|
21515
21604
|
};
|
|
@@ -21526,14 +21615,21 @@ function Details(props) {
|
|
|
21526
21615
|
index.h("span", { class: "summary" }, props.description))));
|
|
21527
21616
|
}
|
|
21528
21617
|
|
|
21529
|
-
const
|
|
21618
|
+
const scenarioTaskCard = "@author:derek\r\n@owner:\r\nFeature: Task Card\r\n\r\n\tScenario: A header, body title, description and a CTA button are always displayed\r\n\t\tGiven the Task Card is configured with the following props\r\n\t\t\t| prop | value |\r\n\t\t\t| rewardAmount | \"40\" |\r\n\t\t\t| rewardUnit | \"Points\" |\r\n\t\t\t| cardTitle | Complete a survey |\r\n\t\t\t| description | Fill out our survey form and receive points! |\r\n\t\t\t| buttonText | Take Survey |\r\n\t\t\t| buttonLink | https://example.com/ |\r\n\t\tWhen a user views the Task Card\r\n\t\tThen they see \"40 Points\" as the heading\r\n\t\tAnd the \"40\" is bolded\r\n\t\tAnd they see \"Complete a survey\" bolded in the body\r\n\t\tAnd a details icon in the top right hand corner\r\n\t\tAnd a button with text \"Take Survey\" in the bottom right hand corner\r\n\t\tWhen they click the button\r\n\t\tThen they are redirected to \"example.com\" in a new window\r\n\t\tWhen they click the details icon\r\n\t\tThen \"Fill out our survey form and receive points!\" is shown as the card description\r\n\r\n\tScenario: A loading state is displayed while the Task Card is loading\r\n\t\tGiven a Task Card component\r\n\t\tWhen a user views the Task Card\r\n\t\tThen a loading state is displayed\r\n\t\tWhen the Task Card has loaded\r\n\t\tThen the loading state disapears\r\n\r\n\tScenario Outline: The Progress Bar can be shown or hidden but is hidden by default\r\n\t\tGiven a Task Card component\r\n\t\tAnd it <mayHave> \"showProgressBar\" <value>\r\n\t\tWhen a user views the Task Card\r\n\t\tThen the progress bar <mayBe> displayed\r\n\t\tExamples:\r\n\t\t\t| mayHave | value | mayBe |\r\n\t\t\t| has | true | is |\r\n\t\t\t| has | false | isn't |\r\n\t\t\t| doesn't have | | isn't |\r\n\r\n\tScenario Outline: Tasks can be repeatable or one-time only but are one-time only be default\r\n\t\tGiven a Task Card component\r\n\t\tAnd it <mayHave> \"repeatable\" <value>\r\n\t\tAnd a user who has already completed the task\r\n\t\tWhen they views the Task Card\r\n\t\tThen they see a green checkmark icon beside the card heading\r\n\t\tAnd the card <mayBe> green\r\n\t\tAnd the card's border <mayBe> green\r\n\t\tAnd the CTA button <mayBe> disabled\r\n\t\tAnd the CTA button <mayBe> grey\r\n\t\tExamples:\r\n\t\t\t| mayHave | value | mayBe |\r\n\t\t\t| has | true | isn't |\r\n\t\t\t| has | false | is |\r\n\t\t\t| doesn't have | | is |\r\n\r\n\tScenario: Task Expiries can be configured and disable the CTA after the expiry\r\n\t\tGiven a Task Card component\r\n\t\tAnd it is configured for <expiry>\r\n\t\tWhen a user views the Card on <day>\r\n\t\tThen they the expiry on <cardLocation>\r\n\t\tAnd the text <mayBe> orange\r\n\t\tAnd the card <mayBe> disabled\r\n\t\tAnd the card <mayBe> grey\r\n\t\tAnd the user <mayBe> unable to complete the loyalty task\r\n\t\tExamples:\r\n\t\t\t| expiry | day | cardLocation | mayBe |\r\n\t\t\t| Dec 31 2021 11:59:59 | Dec 1st 2021 12:00:00 | bottom left | isn't |\r\n\t\t\t| Dec 31 2021 11:59:59 | Dec 31 2021 11:00:00 | top right | isn't |\r\n\t\t\t| Dec 31 2021 11:59:59 | Jan 15th 2022 10:00:00 | top right | is |\r\n\r\n\tScenario Outline: Task expiry can be hidden or shown but is hidden by default\r\n\t\tGiven a Task Card\r\n\t\tAnd it is configured with an expiry\r\n\t\tAnd it <mayHave> \"showExpiry\" <value>\r\n\t\tWhen a user views the Task card\r\n\t\tThen the expiry <mayBe> shown in the bottom left hand corner\r\n\t\tExamples:\r\n\t\t\t| mayHave | value | mayBe |\r\n\t\t\t| has | true | is |\r\n\t\t\t| has | false | isn't |\r\n\t\t\t| doesn't have | | isn't |\r\n\r\n\t#DS: Currently this text is non configurable and isnt set up for proper pluralization\r\n\tScenario Outline: A task completion count is displayed for repeatable tasks\r\n\t\tGiven a Task Card is configured for a repeatable task\r\n\t\tAnd has \"goalCompletionNumber\" <goalCompletionNumberValue>\r\n\t\tAnd a user with <userGoalProgress>\r\n\t\tWhen the user views the task card\r\n\t\tThen they see a repeat icon\r\n\t\tAnd the <text> in the bottom left hand corner\r\n\t\tAnd the <text> is green\r\n\t\tExamples:\r\n\t\t\t| goalCompletionNumber | userGoalProgress | text |\r\n\t\t\t| 1 | 0 | Completed 0 times |\r\n\t\t\t| 1 | 1 | Completed 1 times |\r\n\t\t\t| 1 | 2 | Completed 2 times |\r\n\t\t\t| 10 | 5 | Completed 0 times |\r\n\t\t\t| 10 | 12 | Completed 1 times |\r\n\t\t\t| 10 | 29 | Completed 2 times |\r\n\r\n\tScenario Outline: The source of a user's progress can be a custom field or a program goal\r\n\t\tGiven a Task Card is configured to have <progressSourcePath> progress source\r\n\t\tAnd a user\r\n\t\tWhen they view the Task card\r\n\t\tThen the value at <progressSourcePath> is used to benchmark their progress against the Goal Completion Count\r\n\t\tExamples:\r\n\t\t\t| value |\r\n\t\t\t| /customFields/activityCount |\r\n\t\t\t| /customFields/purchaseTotal |\r\n\t\t\t| /programGoals/count%2FComment-on-Article |\r\n\t\t\t| /programGoals/count/Referral-Started%2Freferrals |\r\n\r\n\tScenario Outline: The users completion of a goal is calculated by the Goal Completion Number\r\n\t\tGiven a Task Card is configured to have <goalValue>\r\n\t\tAnd a user who has <progressValue>\r\n\t\tWhen they view the Task Card\r\n\t\tThen they are shown to have <progressValue> towards <goalValue>\r\n\t\tWhen their progress grows larger than <goalValue>\r\n\t\tThen the task is marked as completed\r\n\t\tExamples:\r\n\t\t\t| goalValue | progressValue |\r\n\t\t\t| 1 | 0 |\r\n\t\t\t| 10 | 9 |\r\n\t\t\t| 5 | 2 |\r\n\r\n\tScenario: The Goal Completion Number defaults to 1\r\n\t\tGiven a Task Card without a configured \"goalCompletionNumber\"\r\n\t\tAnd a user who has <progressValue>\r\n\t\tWhen they view the Task Card\r\n\t\tThen it <mayBe> marked as completed\r\n\t\tExamples:\r\n\t\t\t| progressValue | mayBe |\r\n\t\t\t| 0 | isn't |\r\n\t\t\t| 1 | is |\r\n\t\t\t| 2 | is |";
|
|
21530
21619
|
|
|
21620
|
+
const scenarioProgressBar = "@author:\r\n@owner:\r\nFeature: Task Card Progress Bar\r\n\r\n\tScenario Outline: Progress Bar\r\n\r\n\t\tGiven <progress> and <goal>\r\n\t\tThen I have <progressBar>\r\n\t\tAnd <progressBar> shows <progress> with <unit> above\r\n\t\tAnd gift icon has <color>\r\n\t\tAnd gift icon shows <goal> with <unit> below\r\n\r\n\t\tExamples:\r\n\t\t\t| progress | goal | progressBar | unit | color |\r\n\t\t\t| -100 | 500 | ●――――――――――――――――――🎁 | $ | no |\r\n\t\t\t| 0 | 500 | ●――――――――――――――――――🎁 | $ | no |\r\n\t\t\t| 250 | 500 | ―――――――――●―――――――――🎁 | $ | no |\r\n\t\t\t| 500 | 500 | ―――――――――――――――――――🎁 | $ | yes |\r\n\t\t\t| 1000 | 500 | ―――――――――――――――――――🎁 | $ | yes |\r\n\r\n\tScenario Outline: Progress Bar Steps\r\n\r\n\t\tGiven <progress> and <goal>\r\n\t\tAnd steps is enabled\r\n\t\tThen I have <progressBar>\r\n\t\tAnd <progressBar> has incrementing steps from 1 to <goal>\r\n\t\tAnd gift icon has <color>\r\n\t\tAnd gift icon shows <goal> below\r\n\r\n\t\tExamples:\r\n\t\t\t| progress | goal | progressBar | color |\r\n\t\t\t| -1 | 5 | ―――○―――○―――○―――○―――🎁 | no |\r\n\t\t\t| 0 | 5 | ―――○―――○―――○―――○―――🎁 | no |\r\n\t\t\t| 1 | 5 | ―――●―――○―――○―――○―――🎁 | no |\r\n\t\t\t| 5 | 5 | ―――○―――○―――○―――●―――🎁 | yes |\r\n\t\t\t| 7 | 5 | ―――○―――○―――○―――●―――🎁 | yes |\r\n\r\n\r\n\tScenario Outline: Progress Bar Repeatable\r\n\r\n\t\tGiven <progress> and <goal>\r\n\t\tThen I have <progressBar>\r\n\t\tAnd <progressBar> shows <progress> with <unit> above\r\n\t\tAnd <icon1> has <color1>\r\n\t\tAnd <icon2> has <color2>\r\n\t\tAnd <icon3> has <color3>\r\n\t\tAnd <icon1> shows <text1> below\r\n\t\tAnd <icon2> shows <text2> below\r\n\t\tAnd <icon3> shows <text3> below\r\n\r\n\t\tExamples:\r\n\t\t\t| progress | goal | progressBar | unit | icon1 | icon2 | icon3 | color1 | color2 | color3 | text 1 | text 2 | text 3 |\r\n\t\t\t| 250 | 500 | ――――●――――🎁―――――――🎁 | $ | NA | gift | gift | NA | no | no | NA | 500 | 1000 |\r\n\t\t\t| 500 | 500 | ―――――――――🎁―――――――🎁 | $ | NA | gift | gift | NA | yes | no | NA | 500 | 1000 |\r\n\t\t\t| 750 | 500 | ―――――――――🎁―――●―――🎁 | $ | NA | gift | gift | NA | yes | no | NA | 500 | 1000 |\r\n\t\t\t| 1000 | 500 | 🎁―――――――🎁―――――――🎁 | $ | gift | gift | gift | yes | yes | no | 500 | 1000 | 1500 |\r\n\t\t\t| 1250 | 500 | 🎁―――――――🎁―――●―――🎁 | $ | gift | gift | gift | yes | yes | no | 500 | 1000 | 1500 |\r\n\r\n\t# \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t math logic inside text ?\r\n\t# | 1250 | 500 | 🎁―――――――🎁―――●―――🎁 | gift | gift | gift | yes | yes | no | goal * (⌊ progress / goal ⌋ - 1) | goal * ⌊ progress / goal ⌋ | goal * (⌊ progress / goal ⌋ +1) |\r\n\r\n\r\n\tScenario Outline: Progress Bar Steps Repeatable\r\n\r\n\t\tGiven <progress> and <goal>\r\n\t\tAnd steps is enabled\r\n\t\tThen I have <progressBar>\r\n\t\tAnd <progressBar> has incrementing steps\r\n\r\n\t\tExamples:\r\n\t\t\t| progress | goal | progressBar |";
|
|
21621
|
+
|
|
21622
|
+
const scenario$5 = scenarioTaskCard + scenarioProgressBar;
|
|
21531
21623
|
const TaskCard_stories = {
|
|
21532
21624
|
title: "Components/Task Card/",
|
|
21533
21625
|
parameters: {
|
|
21534
21626
|
scenario: scenario$5,
|
|
21535
21627
|
},
|
|
21536
21628
|
};
|
|
21629
|
+
const storyFrame = {
|
|
21630
|
+
display: "inline-flex",
|
|
21631
|
+
gap: "32px",
|
|
21632
|
+
};
|
|
21537
21633
|
const resizable = {
|
|
21538
21634
|
width: "347px",
|
|
21539
21635
|
minWidth: "347px",
|
|
@@ -21541,49 +21637,55 @@ const resizable = {
|
|
|
21541
21637
|
height: "fit-content",
|
|
21542
21638
|
overflow: "hidden",
|
|
21543
21639
|
};
|
|
21544
|
-
const
|
|
21545
|
-
|
|
21546
|
-
|
|
21547
|
-
|
|
21548
|
-
|
|
21549
|
-
|
|
21550
|
-
|
|
21551
|
-
|
|
21552
|
-
|
|
21553
|
-
|
|
21554
|
-
|
|
21555
|
-
|
|
21556
|
-
|
|
21557
|
-
|
|
21558
|
-
|
|
21559
|
-
|
|
21560
|
-
|
|
21561
|
-
|
|
21562
|
-
|
|
21563
|
-
|
|
21564
|
-
|
|
21565
|
-
|
|
21566
|
-
|
|
21567
|
-
|
|
21568
|
-
|
|
21569
|
-
|
|
21570
|
-
|
|
21571
|
-
|
|
21572
|
-
|
|
21573
|
-
|
|
21574
|
-
|
|
21575
|
-
|
|
21576
|
-
|
|
21577
|
-
|
|
21578
|
-
|
|
21579
|
-
|
|
21580
|
-
|
|
21581
|
-
|
|
21582
|
-
|
|
21583
|
-
|
|
21584
|
-
|
|
21585
|
-
|
|
21586
|
-
|
|
21640
|
+
const oneAction = {
|
|
21641
|
+
rewardAmount: 20,
|
|
21642
|
+
rewardUnit: "Points",
|
|
21643
|
+
cardTitle: "Complete a survey",
|
|
21644
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21645
|
+
repeatable: false,
|
|
21646
|
+
showProgressBar: false,
|
|
21647
|
+
progress: 0,
|
|
21648
|
+
goal: 1,
|
|
21649
|
+
buttonText: "Take survey",
|
|
21650
|
+
buttonLink: "https://example.com/",
|
|
21651
|
+
showExpiry: false,
|
|
21652
|
+
dateExpires: null,
|
|
21653
|
+
loading: false,
|
|
21654
|
+
};
|
|
21655
|
+
const coupleActions = {
|
|
21656
|
+
rewardAmount: 40,
|
|
21657
|
+
rewardUnit: "Points",
|
|
21658
|
+
cardTitle: "Comment on 5 articles",
|
|
21659
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21660
|
+
repeatable: false,
|
|
21661
|
+
showProgressBar: true,
|
|
21662
|
+
steps: true,
|
|
21663
|
+
progress: 1,
|
|
21664
|
+
goal: 5,
|
|
21665
|
+
buttonText: "Take survey",
|
|
21666
|
+
buttonLink: "https://example.com/",
|
|
21667
|
+
showExpiry: false,
|
|
21668
|
+
dateExpires: null,
|
|
21669
|
+
loading: false,
|
|
21670
|
+
};
|
|
21671
|
+
const manyActions = {
|
|
21672
|
+
rewardAmount: 150,
|
|
21673
|
+
rewardUnit: "Points",
|
|
21674
|
+
cardTitle: "Spend $500 at our Store",
|
|
21675
|
+
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21676
|
+
repeatable: false,
|
|
21677
|
+
showProgressBar: true,
|
|
21678
|
+
progress: 100,
|
|
21679
|
+
goal: 500,
|
|
21680
|
+
progressBarUnit: "$",
|
|
21681
|
+
buttonText: "Take survey",
|
|
21682
|
+
buttonLink: "https://example.com/",
|
|
21683
|
+
showExpiry: false,
|
|
21684
|
+
dateExpires: null,
|
|
21685
|
+
loading: false,
|
|
21686
|
+
};
|
|
21687
|
+
const TaskCardNotRepeatable = () => {
|
|
21688
|
+
return (index.h("div", { style: storyFrame },
|
|
21587
21689
|
index.h("div", { style: resizable },
|
|
21588
21690
|
index.h("h4", null, "One Action"),
|
|
21589
21691
|
index.h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
|
|
@@ -21594,9 +21696,6 @@ const NotRepeatable = () => {
|
|
|
21594
21696
|
index.h("h5", null)),
|
|
21595
21697
|
index.h("div", { style: resizable },
|
|
21596
21698
|
index.h("h4", null, "A Couple Actions"),
|
|
21597
|
-
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 0 })),
|
|
21598
|
-
" ",
|
|
21599
|
-
index.h("h5", null),
|
|
21600
21699
|
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
|
|
21601
21700
|
" ",
|
|
21602
21701
|
index.h("h5", null),
|
|
@@ -21605,9 +21704,6 @@ const NotRepeatable = () => {
|
|
|
21605
21704
|
index.h("h5", null)),
|
|
21606
21705
|
index.h("div", { style: resizable },
|
|
21607
21706
|
index.h("h4", null, "Many Actions"),
|
|
21608
|
-
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 0 })),
|
|
21609
|
-
" ",
|
|
21610
|
-
index.h("h5", null),
|
|
21611
21707
|
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 230 })),
|
|
21612
21708
|
" ",
|
|
21613
21709
|
index.h("h5", null),
|
|
@@ -21615,329 +21711,142 @@ const NotRepeatable = () => {
|
|
|
21615
21711
|
" ",
|
|
21616
21712
|
index.h("h5", null))));
|
|
21617
21713
|
};
|
|
21618
|
-
const
|
|
21619
|
-
|
|
21620
|
-
rewardAmount: 20,
|
|
21621
|
-
rewardUnit: "Points",
|
|
21622
|
-
cardTitle: "Complete a survey",
|
|
21623
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21624
|
-
buttonText: "Take survey",
|
|
21625
|
-
goal: 1,
|
|
21626
|
-
showExpiry: true,
|
|
21627
|
-
repeatable: false,
|
|
21628
|
-
dateExpires: "Nov 1, 2021",
|
|
21629
|
-
buttonLink: "https://example.com/",
|
|
21630
|
-
showProgressBar: false,
|
|
21631
|
-
loading: false,
|
|
21632
|
-
};
|
|
21633
|
-
const coupleActions = {
|
|
21634
|
-
rewardAmount: 40,
|
|
21635
|
-
rewardUnit: "Points",
|
|
21636
|
-
cardTitle: "Comment on 5 articles",
|
|
21637
|
-
showProgressBar: true,
|
|
21638
|
-
goal: 5,
|
|
21639
|
-
steps: true,
|
|
21640
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21641
|
-
buttonText: "Start reading",
|
|
21642
|
-
showExpiry: true,
|
|
21643
|
-
repeatable: false,
|
|
21644
|
-
dateExpires: "Nov 1, 2021",
|
|
21645
|
-
buttonLink: "https://example.com/",
|
|
21646
|
-
loading: false,
|
|
21647
|
-
};
|
|
21648
|
-
const manyActions = {
|
|
21649
|
-
rewardAmount: 150,
|
|
21650
|
-
rewardUnit: "Points",
|
|
21651
|
-
repeatable: false,
|
|
21652
|
-
cardTitle: "Spend $500 at our Store",
|
|
21653
|
-
showProgressBar: true,
|
|
21654
|
-
goal: 500,
|
|
21655
|
-
progressBarUnit: "$",
|
|
21656
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21657
|
-
buttonText: "Visit our Store",
|
|
21658
|
-
showExpiry: true,
|
|
21659
|
-
dateExpires: "Nov 1, 2021",
|
|
21660
|
-
buttonLink: "https://example.com/",
|
|
21661
|
-
loading: false,
|
|
21662
|
-
};
|
|
21663
|
-
return (index.h("div", { style: { display: "inline-flex", gap: "32px" } },
|
|
21714
|
+
const TaskCardRepeatable = () => {
|
|
21715
|
+
return (index.h("div", { style: storyFrame },
|
|
21664
21716
|
index.h("div", { style: resizable },
|
|
21665
21717
|
index.h("h4", null, "One Action"),
|
|
21666
|
-
index.h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
|
|
21718
|
+
index.h(TaskCardView, Object.assign({}, oneAction, { progress: 0, repeatable: true })),
|
|
21667
21719
|
" ",
|
|
21668
21720
|
index.h("h5", null),
|
|
21669
|
-
index.h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
|
|
21721
|
+
index.h(TaskCardView, Object.assign({}, oneAction, { progress: 1, repeatable: true })),
|
|
21670
21722
|
" ",
|
|
21671
21723
|
index.h("h5", null)),
|
|
21672
21724
|
index.h("div", { style: resizable },
|
|
21673
21725
|
index.h("h4", null, "A Couple Actions"),
|
|
21674
|
-
index.h(TaskCardView, Object.assign({}, coupleActions, { progress:
|
|
21675
|
-
" ",
|
|
21726
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 1, repeatable: true })),
|
|
21676
21727
|
index.h("h5", null),
|
|
21677
|
-
index.h(TaskCardView, Object.assign({}, coupleActions, { progress:
|
|
21678
|
-
" ",
|
|
21728
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 5, repeatable: true })),
|
|
21679
21729
|
index.h("h5", null),
|
|
21680
|
-
index.h(TaskCardView, Object.assign({}, coupleActions, { progress:
|
|
21681
|
-
"
|
|
21730
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 7, repeatable: true })),
|
|
21731
|
+
index.h("h5", null),
|
|
21732
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 10, repeatable: true })),
|
|
21682
21733
|
index.h("h5", null)),
|
|
21683
21734
|
index.h("div", { style: resizable },
|
|
21684
21735
|
index.h("h4", null, "Many Actions"),
|
|
21685
|
-
index.h(TaskCardView, Object.assign({}, manyActions, { progress:
|
|
21686
|
-
" ",
|
|
21736
|
+
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 100, repeatable: true })),
|
|
21687
21737
|
index.h("h5", null),
|
|
21688
|
-
index.h(TaskCardView, Object.assign({}, manyActions, { progress:
|
|
21689
|
-
" ",
|
|
21738
|
+
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 500, repeatable: true })),
|
|
21690
21739
|
index.h("h5", null),
|
|
21691
|
-
index.h(TaskCardView, Object.assign({}, manyActions, { progress:
|
|
21692
|
-
"
|
|
21740
|
+
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 650, repeatable: true })),
|
|
21741
|
+
index.h("h5", null),
|
|
21742
|
+
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 1000, repeatable: true })),
|
|
21693
21743
|
index.h("h5", null))));
|
|
21694
21744
|
};
|
|
21695
|
-
const
|
|
21696
|
-
const
|
|
21697
|
-
|
|
21698
|
-
|
|
21699
|
-
showExpiry: false,
|
|
21700
|
-
cardTitle: "Complete a survey",
|
|
21701
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21702
|
-
buttonText: "Take survey",
|
|
21703
|
-
goal: 1,
|
|
21704
|
-
repeatable: true,
|
|
21705
|
-
buttonLink: "https://example.com/",
|
|
21706
|
-
showProgressBar: false,
|
|
21707
|
-
loading: false,
|
|
21708
|
-
};
|
|
21709
|
-
const coupleActions = {
|
|
21710
|
-
rewardAmount: 40,
|
|
21711
|
-
rewardUnit: "Points",
|
|
21712
|
-
showExpiry: false,
|
|
21713
|
-
cardTitle: "Comment on 5 articles",
|
|
21714
|
-
showProgressBar: true,
|
|
21715
|
-
repeatable: true,
|
|
21716
|
-
goal: 5,
|
|
21717
|
-
steps: true,
|
|
21718
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21719
|
-
buttonText: "Start reading",
|
|
21720
|
-
buttonLink: "https://example.com/",
|
|
21721
|
-
loading: false,
|
|
21722
|
-
};
|
|
21723
|
-
const manyActions = {
|
|
21724
|
-
rewardAmount: 150,
|
|
21725
|
-
rewardUnit: "Points",
|
|
21726
|
-
showExpiry: false,
|
|
21727
|
-
cardTitle: "Spend $500 at our Store",
|
|
21728
|
-
showProgressBar: true,
|
|
21729
|
-
repeatable: true,
|
|
21730
|
-
goal: 500,
|
|
21731
|
-
progressBarUnit: "$",
|
|
21732
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21733
|
-
buttonText: "Visit our Store",
|
|
21734
|
-
buttonLink: "https://example.com/",
|
|
21735
|
-
loading: false,
|
|
21745
|
+
const TaskCardDateExpires = () => {
|
|
21746
|
+
const expire = {
|
|
21747
|
+
showExpiry: true,
|
|
21748
|
+
dateExpires: "2021-12-01T08:00:00.000Z/2077-12-01T08:00:00.000Z",
|
|
21736
21749
|
};
|
|
21737
|
-
|
|
21750
|
+
const expireRepeat = { ...expire, repeatable: true };
|
|
21751
|
+
return (index.h("div", { style: storyFrame },
|
|
21738
21752
|
index.h("div", { style: resizable },
|
|
21739
21753
|
index.h("h4", null, "One Action"),
|
|
21740
|
-
index.h(TaskCardView, Object.assign({}, oneAction,
|
|
21754
|
+
index.h(TaskCardView, Object.assign({}, oneAction, expire)),
|
|
21741
21755
|
" ",
|
|
21742
21756
|
index.h("h5", null),
|
|
21743
|
-
index.h(TaskCardView, Object.assign({}, oneAction,
|
|
21757
|
+
index.h(TaskCardView, Object.assign({}, oneAction, expireRepeat)),
|
|
21744
21758
|
" ",
|
|
21745
21759
|
index.h("h5", null)),
|
|
21746
21760
|
index.h("div", { style: resizable },
|
|
21747
21761
|
index.h("h4", null, "A Couple Actions"),
|
|
21748
|
-
index.h(TaskCardView, Object.assign({}, coupleActions,
|
|
21762
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, expire)),
|
|
21749
21763
|
" ",
|
|
21750
21764
|
index.h("h5", null),
|
|
21751
|
-
index.h(TaskCardView, Object.assign({}, coupleActions,
|
|
21765
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, expireRepeat)),
|
|
21766
|
+
" ",
|
|
21767
|
+
index.h("h5", null)),
|
|
21768
|
+
index.h("div", { style: resizable },
|
|
21769
|
+
index.h("h4", null, "Many Actions"),
|
|
21770
|
+
index.h(TaskCardView, Object.assign({}, manyActions, expire)),
|
|
21752
21771
|
" ",
|
|
21753
21772
|
index.h("h5", null),
|
|
21754
|
-
index.h(TaskCardView, Object.assign({},
|
|
21773
|
+
index.h(TaskCardView, Object.assign({}, manyActions, expireRepeat)),
|
|
21774
|
+
" ",
|
|
21775
|
+
index.h("h5", null))));
|
|
21776
|
+
};
|
|
21777
|
+
const TaskCardLoading = () => {
|
|
21778
|
+
const loading = { loading: true };
|
|
21779
|
+
return (index.h("div", { style: storyFrame },
|
|
21780
|
+
index.h("div", { style: resizable },
|
|
21781
|
+
index.h("h4", null, "One Action"),
|
|
21782
|
+
index.h(TaskCardView, Object.assign({}, oneAction, loading)),
|
|
21755
21783
|
" ",
|
|
21756
21784
|
index.h("h5", null),
|
|
21757
|
-
index.h(TaskCardView, Object.assign({},
|
|
21785
|
+
index.h(TaskCardView, Object.assign({}, oneAction, loading)),
|
|
21758
21786
|
" ",
|
|
21759
21787
|
index.h("h5", null)),
|
|
21760
21788
|
index.h("div", { style: resizable },
|
|
21761
|
-
index.h("h4", null, "
|
|
21762
|
-
index.h(TaskCardView, Object.assign({},
|
|
21789
|
+
index.h("h4", null, "A Couple Actions"),
|
|
21790
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, loading)),
|
|
21763
21791
|
" ",
|
|
21764
21792
|
index.h("h5", null),
|
|
21765
|
-
index.h(TaskCardView, Object.assign({},
|
|
21793
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, loading)),
|
|
21766
21794
|
" ",
|
|
21767
|
-
index.h("h5", null),
|
|
21768
|
-
|
|
21795
|
+
index.h("h5", null)),
|
|
21796
|
+
index.h("div", { style: resizable },
|
|
21797
|
+
index.h("h4", null, "Many Actions"),
|
|
21798
|
+
index.h(TaskCardView, Object.assign({}, manyActions, loading)),
|
|
21769
21799
|
" ",
|
|
21770
21800
|
index.h("h5", null),
|
|
21771
|
-
index.h(TaskCardView, Object.assign({}, manyActions,
|
|
21801
|
+
index.h(TaskCardView, Object.assign({}, manyActions, loading)),
|
|
21772
21802
|
" ",
|
|
21773
21803
|
index.h("h5", null))));
|
|
21774
21804
|
};
|
|
21775
|
-
const
|
|
21776
|
-
const
|
|
21777
|
-
rewardAmount: 20,
|
|
21778
|
-
rewardUnit: "Points",
|
|
21779
|
-
cardTitle: "Complete a survey",
|
|
21780
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21781
|
-
buttonText: "Take survey",
|
|
21782
|
-
goal: 1,
|
|
21783
|
-
repeatable: true,
|
|
21784
|
-
showExpiry: true,
|
|
21785
|
-
dateExpires: "Nov 1, 2021",
|
|
21786
|
-
buttonLink: "https://example.com/",
|
|
21787
|
-
showProgressBar: false,
|
|
21788
|
-
loading: false,
|
|
21789
|
-
};
|
|
21790
|
-
const coupleActions = {
|
|
21791
|
-
rewardAmount: 40,
|
|
21792
|
-
rewardUnit: "Points",
|
|
21793
|
-
cardTitle: "Comment on 5 articles",
|
|
21794
|
-
showProgressBar: true,
|
|
21795
|
-
repeatable: true,
|
|
21796
|
-
goal: 5,
|
|
21797
|
-
steps: true,
|
|
21798
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21799
|
-
buttonText: "Start reading",
|
|
21800
|
-
showExpiry: true,
|
|
21801
|
-
dateExpires: "Nov 1, 2021",
|
|
21802
|
-
buttonLink: "https://example.com/",
|
|
21803
|
-
loading: false,
|
|
21804
|
-
};
|
|
21805
|
-
const manyActions = {
|
|
21806
|
-
rewardAmount: 150,
|
|
21807
|
-
rewardUnit: "Points",
|
|
21808
|
-
cardTitle: "Spend $500 at our Store",
|
|
21809
|
-
showProgressBar: true,
|
|
21810
|
-
repeatable: true,
|
|
21811
|
-
goal: 500,
|
|
21812
|
-
progressBarUnit: "$",
|
|
21813
|
-
description: "Description of action and reward. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget quisque commodo leo.",
|
|
21814
|
-
buttonText: "Visit our Store",
|
|
21805
|
+
const TaskCardExpired = () => {
|
|
21806
|
+
const expire = {
|
|
21815
21807
|
showExpiry: true,
|
|
21816
|
-
dateExpires: "
|
|
21817
|
-
buttonLink: "https://example.com/",
|
|
21818
|
-
loading: false,
|
|
21808
|
+
dateExpires: "2021-12-01T08:00:00.000Z/2021-12-01T08:00:00.000Z",
|
|
21819
21809
|
};
|
|
21820
|
-
|
|
21810
|
+
const expireRepeat = { ...expire, repeatable: true };
|
|
21811
|
+
return (index.h("div", { style: storyFrame },
|
|
21821
21812
|
index.h("div", { style: resizable },
|
|
21822
21813
|
index.h("h4", null, "One Action"),
|
|
21823
|
-
index.h(TaskCardView, Object.assign({}, oneAction, { progress: 0 })),
|
|
21814
|
+
index.h(TaskCardView, Object.assign({}, oneAction, { progress: 0 }, expire)),
|
|
21824
21815
|
" ",
|
|
21825
21816
|
index.h("h5", null),
|
|
21826
|
-
index.h(TaskCardView, Object.assign({}, oneAction, { progress: 1 })),
|
|
21817
|
+
index.h(TaskCardView, Object.assign({}, oneAction, { progress: 1 }, expire)),
|
|
21818
|
+
" ",
|
|
21819
|
+
index.h("h5", null),
|
|
21820
|
+
index.h(TaskCardView, Object.assign({}, oneAction, { progress: 0 }, expireRepeat)),
|
|
21821
|
+
" ",
|
|
21822
|
+
index.h("h5", null),
|
|
21823
|
+
index.h(TaskCardView, Object.assign({}, oneAction, { progress: 1 }, expireRepeat)),
|
|
21827
21824
|
" ",
|
|
21828
21825
|
index.h("h5", null)),
|
|
21829
21826
|
index.h("div", { style: resizable },
|
|
21830
21827
|
index.h("h4", null, "A Couple Actions"),
|
|
21831
|
-
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 })),
|
|
21828
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 }, expire)),
|
|
21832
21829
|
" ",
|
|
21833
21830
|
index.h("h5", null),
|
|
21834
|
-
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 })),
|
|
21831
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 }, expire)),
|
|
21835
21832
|
" ",
|
|
21836
21833
|
index.h("h5", null),
|
|
21837
|
-
index.h(TaskCardView, Object.assign({}, coupleActions, { progress:
|
|
21838
|
-
" ",
|
|
21834
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 1 }, expireRepeat)),
|
|
21839
21835
|
index.h("h5", null),
|
|
21840
|
-
index.h(TaskCardView, Object.assign({}, coupleActions, { progress:
|
|
21841
|
-
" ",
|
|
21836
|
+
index.h(TaskCardView, Object.assign({}, coupleActions, { progress: 5 }, expireRepeat)),
|
|
21842
21837
|
index.h("h5", null)),
|
|
21843
21838
|
index.h("div", { style: resizable },
|
|
21844
21839
|
index.h("h4", null, "Many Actions"),
|
|
21845
|
-
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 100 })),
|
|
21840
|
+
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 100 }, expire)),
|
|
21846
21841
|
" ",
|
|
21847
21842
|
index.h("h5", null),
|
|
21848
|
-
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 500 })),
|
|
21843
|
+
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 500 }, expire)),
|
|
21849
21844
|
" ",
|
|
21850
21845
|
index.h("h5", null),
|
|
21851
|
-
index.h(TaskCardView, Object.assign({}, manyActions, { progress:
|
|
21852
|
-
" ",
|
|
21846
|
+
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 100 }, expireRepeat)),
|
|
21853
21847
|
index.h("h5", null),
|
|
21854
|
-
index.h(TaskCardView, Object.assign({}, manyActions, { progress:
|
|
21855
|
-
" ",
|
|
21848
|
+
index.h(TaskCardView, Object.assign({}, manyActions, { progress: 500 }, expireRepeat)),
|
|
21856
21849
|
index.h("h5", null))));
|
|
21857
|
-
};
|
|
21858
|
-
|
|
21859
|
-
const TaskCard$1 = /*#__PURE__*/Object.freeze({
|
|
21860
|
-
__proto__: null,
|
|
21861
|
-
'default': TaskCard_stories,
|
|
21862
|
-
NotRepeatable: NotRepeatable,
|
|
21863
|
-
NotRepeatableWithExpiry: NotRepeatableWithExpiry,
|
|
21864
|
-
Repeatable: Repeatable,
|
|
21865
|
-
RepeatableWithExpiry: RepeatableWithExpiry
|
|
21866
|
-
});
|
|
21867
|
-
|
|
21868
|
-
/**
|
|
21869
|
-
* Displays a cartesian product of the input props
|
|
21870
|
-
*
|
|
21871
|
-
* @returns
|
|
21872
|
-
*/
|
|
21873
|
-
function MatrixStory({ matrix, props, Component, }) {
|
|
21874
|
-
const propMatrix = Object.keys(matrix).map((propKey) => {
|
|
21875
|
-
const propValues = matrix[propKey];
|
|
21876
|
-
return propValues.map((val) => {
|
|
21877
|
-
return {
|
|
21878
|
-
[propKey]: val,
|
|
21879
|
-
};
|
|
21880
|
-
});
|
|
21881
|
-
});
|
|
21882
|
-
const combinations = cartesian(...propMatrix);
|
|
21883
|
-
const propsCombinations = combinations.map((combo) => {
|
|
21884
|
-
return combo.reduce((props, prop) => {
|
|
21885
|
-
return {
|
|
21886
|
-
...props,
|
|
21887
|
-
...prop,
|
|
21888
|
-
};
|
|
21889
|
-
}, {});
|
|
21890
|
-
});
|
|
21891
|
-
return propsCombinations.map((combo) => {
|
|
21892
|
-
const example = { ...props, ...combo };
|
|
21893
|
-
return (index.h("div", null,
|
|
21894
|
-
index.h(PropsTable, { values: example }),
|
|
21895
|
-
index.h("hr", null),
|
|
21896
|
-
index.h(Component, Object.assign({}, example))));
|
|
21897
|
-
});
|
|
21898
|
-
}
|
|
21899
|
-
function PropsTable({ values }) {
|
|
21900
|
-
return (index.h("table", null,
|
|
21901
|
-
index.h("tbody", null, Object.keys(values).map((key) => {
|
|
21902
|
-
return (index.h("tr", null,
|
|
21903
|
-
index.h("th", null, key),
|
|
21904
|
-
index.h("td", null, JSON.stringify(values[key]))));
|
|
21905
|
-
}))));
|
|
21906
|
-
}
|
|
21907
|
-
/**
|
|
21908
|
-
* Source: https://stackoverflow.com/questions/15298912/javascript-generating-combinations-from-n-arrays-with-m-elements
|
|
21909
|
-
*
|
|
21910
|
-
* TODO: Could replace with a fork of https://www.npmjs.com/package/cartesian
|
|
21911
|
-
*
|
|
21912
|
-
* @param args - an array of arrays
|
|
21913
|
-
* @returns combinations of the elements in those array
|
|
21914
|
-
*/
|
|
21915
|
-
function cartesian(...args) {
|
|
21916
|
-
var r = [], max = args.length - 1;
|
|
21917
|
-
function helper(arr, i) {
|
|
21918
|
-
for (var j = 0, l = args[i].length; j < l; j++) {
|
|
21919
|
-
var a = arr.slice(0); // clone arr
|
|
21920
|
-
a.push(args[i][j]);
|
|
21921
|
-
if (i == max)
|
|
21922
|
-
r.push(a);
|
|
21923
|
-
else
|
|
21924
|
-
helper(a, i + 1);
|
|
21925
|
-
}
|
|
21926
|
-
}
|
|
21927
|
-
helper([], 0);
|
|
21928
|
-
return r;
|
|
21929
|
-
}
|
|
21930
|
-
|
|
21931
|
-
const scenario$6 = "@author:\r\n@owner:\r\nFeature: Task Card Progress Bar\r\n\r\n\tScenario Outline: Progress Bar\r\n\r\n\t\tGiven <progress> and <goal>\r\n\t\tThen I have <progressBar>\r\n\t\tAnd <progressBar> shows <progress> with <unit> above\r\n\t\tAnd gift icon has <color>\r\n\t\tAnd gift icon shows <goal> with <unit> below\r\n\r\n\t\tExamples:\r\n\t\t\t| progress | goal | progressBar | unit | color |\r\n\t\t\t| -100 | 500 | ●――――――――――――――――――🎁 | $ | no |\r\n\t\t\t| 0 | 500 | ●――――――――――――――――――🎁 | $ | no |\r\n\t\t\t| 250 | 500 | ―――――――――●―――――――――🎁 | $ | no |\r\n\t\t\t| 500 | 500 | ―――――――――――――――――――🎁 | $ | yes |\r\n\t\t\t| 1000 | 500 | ―――――――――――――――――――🎁 | $ | yes |\r\n\r\n\tScenario Outline: Progress Bar Steps\r\n\r\n\t\tGiven <progress> and <goal>\r\n\t\tAnd steps is enabled\r\n\t\tThen I have <progressBar>\r\n\t\tAnd <progressBar> has incrementing steps from 1 to <goal>\r\n\t\tAnd gift icon has <color>\r\n\t\tAnd gift icon shows <goal> below\r\n\r\n\t\tExamples:\r\n\t\t\t| progress | goal | progressBar | color |\r\n\t\t\t| -1 | 5 | ―――○―――○―――○―――○―――🎁 | no |\r\n\t\t\t| 0 | 5 | ―――○―――○―――○―――○―――🎁 | no |\r\n\t\t\t| 1 | 5 | ―――●―――○―――○―――○―――🎁 | no |\r\n\t\t\t| 5 | 5 | ―――○―――○―――○―――●―――🎁 | yes |\r\n\t\t\t| 7 | 5 | ―――○―――○―――○―――●―――🎁 | yes |\r\n\r\n\r\n\tScenario Outline: Progress Bar Repeatable\r\n\r\n\t\tGiven <progress> and <goal>\r\n\t\tThen I have <progressBar>\r\n\t\tAnd <progressBar> shows <progress> with <unit> above\r\n\t\tAnd <icon1> has <color1>\r\n\t\tAnd <icon2> has <color2>\r\n\t\tAnd <icon3> has <color3>\r\n\t\tAnd <icon1> shows <text1> below\r\n\t\tAnd <icon2> shows <text2> below\r\n\t\tAnd <icon3> shows <text3> below\r\n\r\n\t\tExamples:\r\n\t\t\t| progress | goal | progressBar | unit | icon1 | icon2 | icon3 | color1 | color2 | color3 | text 1 | text 2 | text 3 |\r\n\t\t\t| 250 | 500 | ――――●――――🎁―――――――🎁 | $ | NA | gift | gift | NA | no | no | NA | 500 | 1000 |\r\n\t\t\t| 500 | 500 | ―――――――――🎁―――――――🎁 | $ | NA | gift | gift | NA | yes | no | NA | 500 | 1000 |\r\n\t\t\t| 750 | 500 | ―――――――――🎁―――●―――🎁 | $ | NA | gift | gift | NA | yes | no | NA | 500 | 1000 |\r\n\t\t\t| 1000 | 500 | 🎁―――――――🎁―――――――🎁 | $ | gift | gift | gift | yes | yes | no | 500 | 1000 | 1500 |\r\n\t\t\t| 1250 | 500 | 🎁―――――――🎁―――●―――🎁 | $ | gift | gift | gift | yes | yes | no | 500 | 1000 | 1500 |\r\n\r\n\t# \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t math logic inside text ?\r\n\t# | 1250 | 500 | 🎁―――――――🎁―――●―――🎁 | gift | gift | gift | yes | yes | no | goal * (⌊ progress / goal ⌋ - 1) | goal * ⌊ progress / goal ⌋ | goal * (⌊ progress / goal ⌋ +1) |\r\n\r\n\r\n\tScenario Outline: Progress Bar Steps Repeatable\r\n\r\n\t\tGiven <progress> and <goal>\r\n\t\tAnd steps is enabled\r\n\t\tThen I have <progressBar>\r\n\t\tAnd <progressBar> has incrementing steps\r\n\r\n\t\tExamples:\r\n\t\t\t| progress | goal | progressBar |";
|
|
21932
|
-
|
|
21933
|
-
const progressBar_stories = {
|
|
21934
|
-
title: "Components/Task Card Progress Bar",
|
|
21935
|
-
parameters: {
|
|
21936
|
-
scenario: scenario$6,
|
|
21937
|
-
},
|
|
21938
|
-
};
|
|
21939
|
-
const Default$a = () => {
|
|
21940
|
-
return index.h(ProgressBarView, null);
|
|
21941
21850
|
};
|
|
21942
21851
|
const ProgressBar$1 = () => {
|
|
21943
21852
|
const props = {
|
|
@@ -21980,10 +21889,14 @@ const ProgressBarStepsRepeatable = () => {
|
|
|
21980
21889
|
index.h(MatrixStory, { matrix: { progress: [1, 5, 7, 12] }, props: props, Component: ProgressBarView })));
|
|
21981
21890
|
};
|
|
21982
21891
|
|
|
21983
|
-
const
|
|
21892
|
+
const TaskCard$1 = /*#__PURE__*/Object.freeze({
|
|
21984
21893
|
__proto__: null,
|
|
21985
|
-
'default':
|
|
21986
|
-
|
|
21894
|
+
'default': TaskCard_stories,
|
|
21895
|
+
TaskCardNotRepeatable: TaskCardNotRepeatable,
|
|
21896
|
+
TaskCardRepeatable: TaskCardRepeatable,
|
|
21897
|
+
TaskCardDateExpires: TaskCardDateExpires,
|
|
21898
|
+
TaskCardLoading: TaskCardLoading,
|
|
21899
|
+
TaskCardExpired: TaskCardExpired,
|
|
21987
21900
|
ProgressBar: ProgressBar$1,
|
|
21988
21901
|
ProgressBarSteps: ProgressBarSteps,
|
|
21989
21902
|
ProgressBarRepeatable: ProgressBarRepeatable,
|
|
@@ -25002,7 +24915,7 @@ const ReferralIframeReadme = "# sqm-referral-iframe\r\n\r\n\r\n\r\n<!-- Auto Gen
|
|
|
25002
24915
|
|
|
25003
24916
|
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; }; content?: { secondaryButton: any; messageSlot: any; emailLabel?: string; submitLabel?: string; }; }` | `undefined` |\r\n| `emailLabel` | `email-label` | | `string` | `\"Email\"` |\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";
|
|
25004
24917
|
|
|
25005
|
-
const RegisterReadme = "# sqm-portal-register\r\n\r\n\r\n\r\n<!-- Auto Generated Below -->\
|
|
24918
|
+
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; }; content?: { formData?: any; passwordField?: any; secondaryButton?: any; emailLabel?: string; passwordLabel?: string; submitLabel?: string; pageLabel?: string; confirmPasswordLabel: string; }; refs?: { formRef: any; }; }` | `undefined` |\n| `emailLabel` | `email-label` | | `string` | `\"Email\"` |\n| `enablePasswordValidation` | `enable-password-validation` | | `boolean` | `true` |\n| `hideInputs` | `hide-inputs` | | `boolean` | `false` |\n| `loginLabel` | `login-label` | | `string` | `\"Sign in\"` |\n| `nextPage` | `next-page` | | `string` | `\"/\"` |\n| `pageLabel` | `page-label` | | `string` | `\"Register\"` |\n| `passwordLabel` | `password-label` | | `string` | `\"Password\"` |\n| `submitLabel` | `submit-label` | | `string` | `\"Register\"` |\n\n\n## Dependencies\n\n### Used by\n\n - [sqm-stencilbook](../sqm-stencilbook)\n\n### Depends on\n\n- [sqm-form-message](../sqm-form-message)\n- [sqm-password-field](../sqm-password-field)\n\n### Graph\n```mermaid\ngraph TD;\n sqm-portal-register --> sqm-form-message\n sqm-portal-register --> sqm-password-field\n sqm-stencilbook --> sqm-portal-register\n style sqm-portal-register fill:#f9f,stroke:#333,stroke-width:4px\n```\n\n----------------------------------------------\n\n*Built with [StencilJS](https://stenciljs.com/)*\n";
|
|
25006
24919
|
|
|
25007
24920
|
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";
|
|
25008
24921
|
|
|
@@ -25208,7 +25121,7 @@ const ProgramMenu$1 = /*#__PURE__*/Object.freeze({
|
|
|
25208
25121
|
const PoweredByImg_stories = {
|
|
25209
25122
|
title: "Powered By",
|
|
25210
25123
|
};
|
|
25211
|
-
const Default$
|
|
25124
|
+
const Default$a = () => {
|
|
25212
25125
|
return index.h(sqmPortalFooterView.PoweredByImg, null);
|
|
25213
25126
|
};
|
|
25214
25127
|
const CustomColor = () => {
|
|
@@ -25221,17 +25134,17 @@ const CustomWidthAndHeight = () => {
|
|
|
25221
25134
|
const PoweredByImg = /*#__PURE__*/Object.freeze({
|
|
25222
25135
|
__proto__: null,
|
|
25223
25136
|
'default': PoweredByImg_stories,
|
|
25224
|
-
Default: Default$
|
|
25137
|
+
Default: Default$a,
|
|
25225
25138
|
CustomColor: CustomColor,
|
|
25226
25139
|
CustomWidthAndHeight: CustomWidthAndHeight
|
|
25227
25140
|
});
|
|
25228
25141
|
|
|
25229
|
-
const scenario$
|
|
25142
|
+
const scenario$6 = "Feature: Portal Footer\r\n\r\n Background: A user is viewing the portal\r\n Given a hosted portal\r\n And a user is viewing the portal\r\n And the portal has a footer\r\n\r\n Scenario Outline: FAQ and T&C links/text are configurable and open in a new page when clicked\r\n Given the footer has prop \"terms-link\" with value \"https://example.com/terms\"\r\n And prop \"terms-text\" with value \"Terms and Conditions\"\r\n And prop \"faq-link\" with value \"https://example.com/FAQ\"\r\n And prop \"faq-text\" with value \"Visit FAQ\"\r\n When a user clicks on the \"Visit FAQ\" link\r\n Then they will be redirected to \"https://example.com/FAQ\" in a new page\r\n When they go back to the portal\r\n And click on the \"Terms and Conditions\" link\r\n Then they will be redirected to \"https://example.com/terms\" in a new page\r\n\r\n Scenario Outline: FAQ/T&C Links are not shown if a link is not provided\r\n Given the footer does not have <linkProp>\r\n But it <mayHave> <textProp> with <value>\r\n Then the <link> will not be shown in the footer\r\n Examples:\r\n | linkProp | mayHave | textProp | value | link |\r\n | terms-link | has | termsText | Terms and Conditions | T&C Link |\r\n | faq-link | has | faqText | Visit FAQ | FAQ Link |\r\n | terms-link | doesn't have | | | T&C Link |\r\n | faq-link | doesn't have | | | FAQ Link |\r\n\r\n Scenario Outline: The support email and text is configurable but has a default\r\n Given the footer <mayHave> <emailPropWithValue>\r\n And the footer <mayAlsoHave> <textPropWithValue>\r\n Then the footer's support email text is <renderedEmailText>\r\n And the email address will be a mailto link with <mailtoEmail>\r\n When the user clicks on the email address mailto Link\r\n Then the users preferred email client will open with a draft email to <mailtoEmail>\r\n Examples:\r\n | mayHave | emailPropWithValue | mayAlsoHave | textPropWithValue | mailtoEmail | renderedEmailText |\r\n | has | support@saasquatch.com | has | For support please contact {email} | support@saasquatch.com | For support please contact support@saasquatch.com |\r\n | doesn't have | N/A | doesn't have | N/A | support@example.com | For program support, contact support@example.com |\r\n\r\n Scenario Outline: Powered by SaaSquatch is shown by default\r\n Given the footer <mayHaveProp> \"show-powered-by\" with <value>\r\n Then the powered by SaaSquatch image <mayBeShown>\r\n Examples:\r\n | mayHaveProp | value | mayBeShown |\r\n | has prop | true | is shown |\r\n | has prop | false | isn't shown |\r\n | has prop | test | is shown |\r\n | has prop | | is shown |\r\n | doesn't have prop | | is shown |\r\n\r\n Scenario: Powered By Saasquatch links out to \"https://saasquatch.com\"\r\n Given the footer has the powered by SaaSquatch image\r\n When a user clicks on it\r\n Then they will be redirected to \"https://saasquatch.com\" in a new page";
|
|
25230
25143
|
|
|
25231
25144
|
const PortalFooter_stories = {
|
|
25232
25145
|
title: "Portal Footer",
|
|
25233
25146
|
parameters: {
|
|
25234
|
-
scenario: scenario$
|
|
25147
|
+
scenario: scenario$6,
|
|
25235
25148
|
},
|
|
25236
25149
|
};
|
|
25237
25150
|
const defaultProps$9 = {
|
|
@@ -25260,12 +25173,12 @@ const PortalFooter = /*#__PURE__*/Object.freeze({
|
|
|
25260
25173
|
FooterNoPoweredBy: FooterNoPoweredBy
|
|
25261
25174
|
});
|
|
25262
25175
|
|
|
25263
|
-
const scenario$
|
|
25176
|
+
const scenario$7 = "Feature: Hero Unit\r\n\r\n Background: A portal with a hero unit exists\r\n Given a hosted portal\r\n And the portal has hero unit on the login page\r\n And a user is viewing the login page\r\n\r\n Scenario: The hero unit defaults to a single column layout\r\n Given a hero unit does not have a \"columns\" prop\r\n But the following html is wrapped by the hero unit\r\n \"\"\"\r\n <sqm-portal-login></sqm-portal-login>\r\n <div slot=\"secondary-column\">\r\n <h1 style=\"text-align:center\">Get Referring!</h1>\r\n <p style=\"text-align:center\">\r\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\r\n eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim\r\n ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut\r\n aliquip ex ea commodo consequat. Duis aute irure dolor in\r\n reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla\r\n pariatur.\r\n </p>\r\n </div>\r\n \"\"\"\r\n Then only a single column will be displayed\r\n And within it will be the login component\r\n\r\n Scenario Outline: The hero unit supports single or dual column layouts\r\n Given a hero unit with prop \"columns\" having <columnValue>\r\n And it wraps <html>\r\n Then the hero unit displays <columnValue> columns\r\n Examples:\r\n | columnValue | html |\r\n | 1 | <h1>Column 1!</h1> |\r\n | 2 | <h1>Column 1!</h1><div slot=\"secondary-column\"><h1 style=\"text-align:center\">Column 2!</h1></div> |\r\n\r\n Scenario: HTML to be displayed in the second column comes from the \"secondary-column\" slot\r\n Given a hero unit with \"columns\" \"2\"\r\n And the following html\r\n \"\"\"\r\n <h1>Column 1!</h1>\r\n <div>\r\n <h1 style=\"text-align:center\">Column 2!</h1>\r\n </div>\r\n \"\"\"\r\n When the hero unit is rendered\r\n Then only one column is displayed with content\r\n And column 1 will contain the \"Column 1!\" text\r\n And column 1 will contain the \"Column 2!\" text\r\n When the div for column two is updated to have 'slot=\"secondary-column\"'\r\n Then the two columns are displayed with content\r\n And column 1 will contain the \"Column 1!\" text\r\n And column 2 will contain the \"Column 2!\" text\r\n\r\n Scenario Outline: A background for the hero unit can be set as an image or colour\r\n Given a hero unit with <backgroundPropValue>\r\n Then the background will be <background>\r\n Examples:\r\n | background | background |\r\n | https://images.unsplash.com/photo-1599676821464-3555954838d | image of misty mountains |\r\n | LightSlateGrey | light slate grey |\r\n | #00FF00 | green |\r\n | rgb(128,0,128) | purple |\r\n\r\n Scenario Outline: Wrap Direction can be configured for mobile experiences\r\n Given a hero unit with the following HTML\r\n \"\"\"\r\n <h1>Column 1!</h1>\r\n <div slot=\"secondary-column\">\r\n <h1 style=\"text-align:center\">Column 2!</h1>\r\n </div>\r\n \"\"\"\r\n And prop \"wrap-direction\" has <value>\r\n When the window width is less than 600px\r\n Then the two columns will stack\r\n And <column> will be on top\r\n Examples:\r\n | value | column |\r\n | wrap | 1 |\r\n | wrap-reverse | 2 |\r\n | | 1 |";
|
|
25264
25177
|
|
|
25265
25178
|
const Hero_stories = {
|
|
25266
25179
|
title: "Hero Layout",
|
|
25267
25180
|
parameters: {
|
|
25268
|
-
scenario: scenario$
|
|
25181
|
+
scenario: scenario$7,
|
|
25269
25182
|
},
|
|
25270
25183
|
};
|
|
25271
25184
|
const LoginOneColumn = () => {
|
|
@@ -25442,12 +25355,12 @@ const Hero = /*#__PURE__*/Object.freeze({
|
|
|
25442
25355
|
TwoColumnLoginWithImgElement: TwoColumnLoginWithImgElement
|
|
25443
25356
|
});
|
|
25444
25357
|
|
|
25445
|
-
const scenario$
|
|
25358
|
+
const scenario$8 = "@owner:sam\r\n@author:sam\r\n\r\nFeature: Referral Iframe\r\n\r\n Used to provide an external form for submitting referral leads using the current user's referral code\r\n\r\n Background: A user is logged in\r\n Given there is a logged in user\r\n\r\n @motivating\r\n Scenario: Referral code is passed to the iframe as a query parameter\r\n Given the \"iframe-src\" is \"https://example.com\"\r\n And the user has navigated to \"/refer\"\r\n And the user's referral code is \"BOBBYREFER\"\r\n When the iframe content is loaded\r\n Then the iframe url will be \"https://example.com?rsCode=BOBBYREFER\"\r\n\r\n @ui\r\n Scenario Outline: The height and width of the iFrame can be controlled via props\r\n Given the \"iframe-src\" is \"https://example.com\"\r\n And the iframe content is 1000x1000\r\n And the \"iframe-height\" is set to <heightValue>\r\n And the \"iframe-width\" is set to <widthValue>\r\n Then the content of the iframe will be displayed with scrollbars\r\n And the dimension of the iFrame displayed will be 500x500\r\n When the \"iframe-height\" is set to <heightValue>\r\n And the \"iframe-width\" is set to <widthValue>\r\n Then the full content of the iframe will be displayed on the page\r\n And the dimension of the iFrame displayed will be 1000x1000\r\n Examples:\r\n | heightValue | widthValue |\r\n | 500px | 500px |\r\n | 50% | 50% |\r\n\r\n @minutae\r\n Scenario Outline: The iFrame will fail fast if a iFrame source isn't provided\r\n Given \"iframe-src\" <mayBeAnAttribute>\r\n And it <mayHaveValue>\r\n When a user views the referral iFrame component\r\n Then an alert with an error message is displayed in place of the iFrame\r\n And it has a details section\r\n When \"More details\" is clicked\r\n Then the following information will be displayed\r\n | component being used |\r\n | missing attribute(s) |\r\n\r\n Examples:\r\n | mayBeAnAttribute | mayHaveValue |\r\n | is not an attribute | N/A |\r\n | is an attribute | \"\" |\r\n | is an attribute | |";
|
|
25446
25359
|
|
|
25447
25360
|
const ReferralIframe_stories = {
|
|
25448
25361
|
title: "Referral Iframe",
|
|
25449
25362
|
parameters: {
|
|
25450
|
-
scenario: scenario$
|
|
25363
|
+
scenario: scenario$8,
|
|
25451
25364
|
},
|
|
25452
25365
|
};
|
|
25453
25366
|
const props = {
|
|
@@ -25478,12 +25391,12 @@ const ReferralIframe$1 = /*#__PURE__*/Object.freeze({
|
|
|
25478
25391
|
ReferralIframeError: ReferralIframeError
|
|
25479
25392
|
});
|
|
25480
25393
|
|
|
25481
|
-
const scenario$
|
|
25394
|
+
const scenario$9 = "@owner:sam\r\n@author:sam\r\n\r\nFeature: Name Fields\r\n\r\n Fields to be used to fill the first and last name of a user during registration\r\n\r\n Background:\r\n Given the current page is \"/register\"\r\n\r\n @motivating\r\n Scenario: Both first name and last name are required\r\n Given the email field has valid input\r\n And the password field has valid input\r\n And first name field is empty\r\n And last name field is empty\r\n When register is clicked\r\n Then the name fields will be highlighted in red\r\n And the error messages will say \"Cannot be empty\"\r\n\r\n @motivating\r\n Scenario: First and last name are upserted with the SaaSquatch user\r\n Given all fields have been filled with data\r\n | firstName | lastName | email | password |\r\n | Bob | Testerson | bob@example.com | SecurePassword1 |\r\n When register is clicked\r\n Then the email verification page will be loaded\r\n And the user will be upserted\r\n And the SaaSquatch user will contain data\r\n | firstName | lastName | email |\r\n | Bob | Testerson | bob@example.com |\r\n\r\n";
|
|
25482
25395
|
|
|
25483
25396
|
const NameFields_stories = {
|
|
25484
25397
|
title: "Name Fields",
|
|
25485
25398
|
parameters: {
|
|
25486
|
-
scenario: scenario$
|
|
25399
|
+
scenario: scenario$9,
|
|
25487
25400
|
},
|
|
25488
25401
|
};
|
|
25489
25402
|
const props$1 = {
|
|
@@ -25536,7 +25449,7 @@ const baseResponse = (data) => ({
|
|
|
25536
25449
|
},
|
|
25537
25450
|
callbacks: {
|
|
25538
25451
|
exchangeReward: null,
|
|
25539
|
-
|
|
25452
|
+
resetState: null,
|
|
25540
25453
|
setStage: null,
|
|
25541
25454
|
setExchangeState: null,
|
|
25542
25455
|
refs: null,
|
|
@@ -25730,7 +25643,7 @@ const test2 = {
|
|
|
25730
25643
|
},
|
|
25731
25644
|
callbacks: {
|
|
25732
25645
|
exchangeReward: null,
|
|
25733
|
-
|
|
25646
|
+
resetState: null,
|
|
25734
25647
|
setStage: null,
|
|
25735
25648
|
setExchangeState: null,
|
|
25736
25649
|
refs: {
|
|
@@ -25750,7 +25663,7 @@ const resizable$1 = {
|
|
|
25750
25663
|
height: "fit-content",
|
|
25751
25664
|
overflow: "hidden",
|
|
25752
25665
|
};
|
|
25753
|
-
const Default$
|
|
25666
|
+
const Default$b = () => {
|
|
25754
25667
|
return (index.h("div", { style: resizable$1 },
|
|
25755
25668
|
index.h(RewardExchangeView, Object.assign({}, test))));
|
|
25756
25669
|
};
|
|
@@ -25762,7 +25675,7 @@ const Default2 = () => {
|
|
|
25762
25675
|
const RewardExchangeList = /*#__PURE__*/Object.freeze({
|
|
25763
25676
|
__proto__: null,
|
|
25764
25677
|
'default': RewardExchangeList_stories,
|
|
25765
|
-
Default: Default$
|
|
25678
|
+
Default: Default$b,
|
|
25766
25679
|
Default2: Default2
|
|
25767
25680
|
});
|
|
25768
25681
|
|
|
@@ -28386,7 +28299,6 @@ const stories = [
|
|
|
28386
28299
|
UserName,
|
|
28387
28300
|
PasswordField,
|
|
28388
28301
|
TaskCard$1,
|
|
28389
|
-
TaskCardProgressBar,
|
|
28390
28302
|
PortalTemplates,
|
|
28391
28303
|
ProgramMenu$1,
|
|
28392
28304
|
PoweredByImg,
|
|
@@ -28481,6 +28393,12 @@ const TaskCard$2 = class {
|
|
|
28481
28393
|
* @uiName Show Goal Expiry
|
|
28482
28394
|
*/
|
|
28483
28395
|
this.showExpiry = false;
|
|
28396
|
+
/**
|
|
28397
|
+
* @uiName Date Goal Expires
|
|
28398
|
+
* @uiWidget DateRange
|
|
28399
|
+
* @uiOptions {"allowPastDates":true, "months": 1}
|
|
28400
|
+
*/
|
|
28401
|
+
this.dateExpires = "/";
|
|
28484
28402
|
/**
|
|
28485
28403
|
* @uiName CTA Button Text
|
|
28486
28404
|
*/
|