@saasquatch/mint-components 1.13.5 → 1.15.0-0
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/ErrorView-b2fcf954.js +35 -0
- package/dist/cjs/{ShadowViewAddon-14a02da4.js → ShadowViewAddon-787391f7.js} +6 -5
- package/dist/cjs/copy-text-view-c85acaaa.js +96 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/sqm-banking-info-form_17.cjs.entry.js +3 -2
- package/dist/cjs/sqm-big-stat_41.cjs.entry.js +3 -2
- package/dist/cjs/{sqm-invoice-table-view-baded4af.js → sqm-invoice-table-view-16ac73d0.js} +2 -31
- package/dist/cjs/sqm-pagination_3.cjs.entry.js +6 -5
- package/dist/cjs/sqm-qr-code-view-15dfc0b6.js +103 -0
- package/dist/cjs/sqm-qr-code.cjs.entry.js +207 -0
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +68 -5
- package/dist/cjs/{copy-text-view-a5524c20.js → useReferralCodes-82e8797b.js} +0 -93
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/sqm-card-feed/sqm-card-feed.js +2 -0
- package/dist/collection/components/sqm-qr-code/QRCode.stories.js +47 -0
- package/dist/collection/components/sqm-qr-code/sqm-qr-code-view.js +98 -0
- package/dist/collection/components/sqm-qr-code/sqm-qr-code.js +293 -0
- package/dist/collection/components/sqm-qr-code/useQRCode.js +124 -0
- package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +2 -0
- package/dist/esm/ErrorView-48e2b969.js +33 -0
- package/dist/esm/{ShadowViewAddon-23a6afab.js → ShadowViewAddon-cf230f50.js} +2 -1
- package/dist/esm/copy-text-view-782137ba.js +94 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-banking-info-form_17.entry.js +2 -1
- package/dist/esm/sqm-big-stat_41.entry.js +3 -2
- package/dist/esm/{sqm-invoice-table-view-af69cd33.js → sqm-invoice-table-view-2c726568.js} +2 -30
- package/dist/esm/sqm-pagination_3.entry.js +2 -1
- package/dist/esm/sqm-qr-code-view-f1d0763b.js +101 -0
- package/dist/esm/sqm-qr-code.entry.js +203 -0
- package/dist/esm/sqm-stencilbook.entry.js +68 -5
- package/dist/esm/{copy-text-view-459a2e35.js → useReferralCodes-8f75921a.js} +1 -93
- package/dist/esm-es5/ErrorView-48e2b969.js +1 -0
- package/dist/esm-es5/ShadowViewAddon-cf230f50.js +1 -0
- package/dist/esm-es5/copy-text-view-782137ba.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-banking-info-form_17.entry.js +1 -1
- package/dist/esm-es5/sqm-big-stat_41.entry.js +1 -1
- package/dist/esm-es5/sqm-invoice-table-view-2c726568.js +1 -0
- package/dist/esm-es5/sqm-pagination_3.entry.js +1 -1
- package/dist/esm-es5/sqm-qr-code-view-f1d0763b.js +1 -0
- package/dist/esm-es5/sqm-qr-code.entry.js +1 -0
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/esm-es5/useReferralCodes-8f75921a.js +1 -0
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-0c78815e.system.entry.js +1 -0
- package/dist/mint-components/{p-01010af0.entry.js → p-116baa69.entry.js} +1 -1
- package/dist/mint-components/p-1f089c3f.system.entry.js +1 -0
- package/dist/mint-components/p-31015791.js +1 -0
- package/dist/mint-components/p-37996351.system.js +1 -1
- package/dist/mint-components/p-3a62a7e2.system.js +1 -0
- package/dist/mint-components/p-3b90e01b.system.js +1 -0
- package/dist/mint-components/p-3f067fd5.js +1 -0
- package/dist/mint-components/p-3f7b81b8.js +52 -0
- package/dist/mint-components/p-4e773bb1.system.entry.js +1 -0
- package/dist/mint-components/p-53730ffe.entry.js +17 -0
- package/dist/mint-components/p-562428ef.system.js +1 -0
- package/dist/mint-components/{p-23ed5e6f.entry.js → p-57eef0af.entry.js} +4 -4
- package/dist/mint-components/p-5cb7f9fc.system.entry.js +1 -0
- package/dist/mint-components/{p-d3d74266.js → p-6cc141b9.js} +2 -2
- package/dist/mint-components/{p-b51e79b3.entry.js → p-7846937e.entry.js} +2 -2
- package/dist/mint-components/p-9acb5038.js +1 -0
- package/dist/mint-components/p-a7746488.system.js +1 -0
- package/dist/mint-components/p-aad32fb6.system.js +1 -0
- package/dist/mint-components/p-daee25f9.system.entry.js +1 -0
- package/dist/mint-components/p-dbc0e4f8.system.js +1 -0
- package/dist/mint-components/{p-ba9b5b20.entry.js → p-ef6381d4.entry.js} +2 -2
- package/dist/mint-components/p-f56bedd5.js +1 -0
- package/dist/types/components/sqm-card-feed/sqm-card-feed.d.ts +2 -0
- package/dist/types/components/sqm-qr-code/QRCode.stories.d.ts +12 -0
- package/dist/types/components/sqm-qr-code/sqm-qr-code-view.d.ts +15 -0
- package/dist/types/components/sqm-qr-code/sqm-qr-code.d.ts +52 -0
- package/dist/types/components/sqm-qr-code/useQRCode.d.ts +3 -0
- package/dist/types/components.d.ts +94 -0
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/ShadowViewAddon-23a6afab.js +0 -1
- package/dist/esm-es5/copy-text-view-459a2e35.js +0 -1
- package/dist/esm-es5/sqm-invoice-table-view-af69cd33.js +0 -1
- package/dist/mint-components/p-33ed6f1c.system.entry.js +0 -1
- package/dist/mint-components/p-717cc8ac.system.js +0 -1
- package/dist/mint-components/p-71bc04d2.system.entry.js +0 -1
- package/dist/mint-components/p-7e7cbccf.system.js +0 -1
- package/dist/mint-components/p-7f2d4212.js +0 -52
- package/dist/mint-components/p-8da00a59.system.entry.js +0 -1
- package/dist/mint-components/p-8f8245da.system.entry.js +0 -1
- package/dist/mint-components/p-9320582e.system.js +0 -1
- package/dist/mint-components/p-962f3200.js +0 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-a29c60ef.js');
|
|
4
|
+
const JSS = require('./JSS-8503a151.js');
|
|
5
|
+
const ErrorView = require('./ErrorView-b2fcf954.js');
|
|
6
|
+
|
|
7
|
+
const style = {
|
|
8
|
+
DialogContainer: {
|
|
9
|
+
maxWidth: "390px !important",
|
|
10
|
+
},
|
|
11
|
+
Container: {
|
|
12
|
+
width: "100%",
|
|
13
|
+
display: "flex",
|
|
14
|
+
flexDirection: "row",
|
|
15
|
+
gap: "var(--sl-spacing-small)",
|
|
16
|
+
},
|
|
17
|
+
TextContainer: {
|
|
18
|
+
display: "flex",
|
|
19
|
+
gap: "var(--sl-spacing-medium)",
|
|
20
|
+
flexDirection: "column",
|
|
21
|
+
alignItems: "center",
|
|
22
|
+
},
|
|
23
|
+
ButtonContainer: {
|
|
24
|
+
display: "flex",
|
|
25
|
+
gap: "var(--sl-spacing-medium)",
|
|
26
|
+
},
|
|
27
|
+
FooterContainer: {
|
|
28
|
+
textAlign: "left",
|
|
29
|
+
display: "flex",
|
|
30
|
+
flexDirection: "column",
|
|
31
|
+
gap: "var(--sl-spacing-medium)",
|
|
32
|
+
},
|
|
33
|
+
CodeContainer: {
|
|
34
|
+
display: "flex",
|
|
35
|
+
width: "100%",
|
|
36
|
+
alignItems: "center",
|
|
37
|
+
justifyContent: "center",
|
|
38
|
+
},
|
|
39
|
+
Code: {
|
|
40
|
+
width: "100%",
|
|
41
|
+
height: "100%",
|
|
42
|
+
maxWidth: "335px",
|
|
43
|
+
},
|
|
44
|
+
TextButton: {
|
|
45
|
+
"&::part(base)": {
|
|
46
|
+
color: "var(--sl-color-gray-600)",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
LoadingSkeleton: {
|
|
50
|
+
"&::part(indicator)": {
|
|
51
|
+
borderRadius: "0px !important",
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
const sheet = JSS.createStyleSheet(style);
|
|
56
|
+
const styleString = sheet.toString();
|
|
57
|
+
const vanillaStyle = `
|
|
58
|
+
:host{
|
|
59
|
+
display: flex;
|
|
60
|
+
width: 100%;
|
|
61
|
+
}
|
|
62
|
+
@media (max-width: 499px) {
|
|
63
|
+
:host{
|
|
64
|
+
display: block;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
}`;
|
|
68
|
+
function QrCodeView({ error, qrLink, titleText, downloadCodeText, printCodeText, errorHeaderText, errorDescriptionText, createDownloadable, createPrintable, hideTitle, alignment, loading, }) {
|
|
69
|
+
const codeAlignment = alignment === "left"
|
|
70
|
+
? "flex-start"
|
|
71
|
+
: alignment === "right"
|
|
72
|
+
? "flex-end"
|
|
73
|
+
: "center";
|
|
74
|
+
const getCodeContent = (error, qrLink, loading) => {
|
|
75
|
+
if (error) {
|
|
76
|
+
return (index.h(ErrorView.ErrorView, { loadingErrorAlertDescription: errorHeaderText, loadingErrorAlertHeader: errorDescriptionText }));
|
|
77
|
+
}
|
|
78
|
+
else if (loading) {
|
|
79
|
+
return (index.h("sl-skeleton", { className: sheet.classes.LoadingSkeleton, effect: "sheen", style: {
|
|
80
|
+
width: "100px",
|
|
81
|
+
height: "100px",
|
|
82
|
+
borderRadius: "0px !important",
|
|
83
|
+
} }));
|
|
84
|
+
}
|
|
85
|
+
else if (qrLink) {
|
|
86
|
+
return (index.h("svg", { width: "100", height: "100" },
|
|
87
|
+
index.h("image", { href: qrLink, width: "100", height: "100" })));
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
};
|
|
91
|
+
const codeContent = getCodeContent(error, qrLink, loading);
|
|
92
|
+
return (index.h("div", { class: sheet.classes.Container, style: { justifyContent: codeAlignment }, part: "sqm-base" },
|
|
93
|
+
index.h("style", null, vanillaStyle),
|
|
94
|
+
index.h("style", null, styleString),
|
|
95
|
+
index.h("div", { class: sheet.classes.TextContainer, style: { alignItems: codeAlignment } },
|
|
96
|
+
!hideTitle && index.h("span", { part: "sqm-title" }, titleText),
|
|
97
|
+
codeContent,
|
|
98
|
+
index.h("div", { class: sheet.classes.ButtonContainer },
|
|
99
|
+
index.h("sl-button", { size: "small", exportparts: "base: defaultbutton-base", type: "default", onClick: createDownloadable }, downloadCodeText),
|
|
100
|
+
index.h("sl-button", { size: "small", exportparts: "base: textbutton-base", type: "text", onClick: createPrintable, class: sheet.classes.TextButton }, printCodeText)))));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
exports.QrCodeView = QrCodeView;
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-a29c60ef.js');
|
|
6
|
+
const stencilHooks_module = require('./stencil-hooks.module-3a336b0f.js');
|
|
7
|
+
const index_module = require('./index.module-ee84433d.js');
|
|
8
|
+
const cjs = require('./cjs-1066ec21.js');
|
|
9
|
+
const utils = require('./utils-6847bc06.js');
|
|
10
|
+
require('./JSS-8503a151.js');
|
|
11
|
+
const useReferralCodes = require('./useReferralCodes-82e8797b.js');
|
|
12
|
+
require('./ErrorView-b2fcf954.js');
|
|
13
|
+
const sqmQrCodeView = require('./sqm-qr-code-view-15dfc0b6.js');
|
|
14
|
+
|
|
15
|
+
const ShareLinkQuery = index_module.dist.gql `
|
|
16
|
+
query shareLink($programId: ID, $engagementMedium: UserEngagementMedium!) {
|
|
17
|
+
user: viewer {
|
|
18
|
+
... on User {
|
|
19
|
+
shareLink(
|
|
20
|
+
programId: $programId
|
|
21
|
+
engagementMedium: $engagementMedium
|
|
22
|
+
shareMedium: DIRECT
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
const WIDGET_ENGAGEMENT_EVENT = index_module.dist.gql `
|
|
29
|
+
mutation loadEvent($eventMeta: UserAnalyticsEvent!) {
|
|
30
|
+
createUserAnalyticsEvent(eventMeta: $eventMeta)
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
function useQRCode(props) {
|
|
34
|
+
var _a;
|
|
35
|
+
const programId = index_module.H();
|
|
36
|
+
const user = index_module.J();
|
|
37
|
+
const engagementMedium = index_module.B();
|
|
38
|
+
const contextData = index_module.Fn(useReferralCodes.REFERRAL_CODES_NAMESPACE);
|
|
39
|
+
const [qrLink, setQrUrl] = stencilHooks_module.useState(null);
|
|
40
|
+
const [error, setError] = stencilHooks_module.useState(false);
|
|
41
|
+
const [loading, setLoading] = stencilHooks_module.useState(false);
|
|
42
|
+
const { data, errors, loading: requestLoading, } = index_module.wn(ShareLinkQuery, { programId, engagementMedium }, !(user === null || user === void 0 ? void 0 : user.jwt) || (contextData === null || contextData === void 0 ? void 0 : contextData.shareLink) !== undefined);
|
|
43
|
+
const [sendLoadEvent] = index_module.$e(WIDGET_ENGAGEMENT_EVENT);
|
|
44
|
+
const shareLink = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.shareLink;
|
|
45
|
+
const qrPrefix = `${shareLink}?qrCode`;
|
|
46
|
+
const completeLoading = requestLoading || loading;
|
|
47
|
+
stencilHooks_module.useEffect(() => {
|
|
48
|
+
if (!shareLink)
|
|
49
|
+
return;
|
|
50
|
+
const getQrCode = async () => {
|
|
51
|
+
setLoading(true);
|
|
52
|
+
try {
|
|
53
|
+
const res = await fetch(`${shareLink}?qrCode&qrCodeImageFormat=svg&qrCodeQuietZoneSize=0`);
|
|
54
|
+
const blob = await res.blob();
|
|
55
|
+
const url = URL.createObjectURL(blob);
|
|
56
|
+
setQrUrl(url);
|
|
57
|
+
}
|
|
58
|
+
catch (e) {
|
|
59
|
+
setError(true);
|
|
60
|
+
}
|
|
61
|
+
finally {
|
|
62
|
+
setLoading(false);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
getQrCode();
|
|
66
|
+
}, [shareLink]);
|
|
67
|
+
const fireEvent = async () => {
|
|
68
|
+
sendLoadEvent({
|
|
69
|
+
eventMeta: {
|
|
70
|
+
programId,
|
|
71
|
+
id: user === null || user === void 0 ? void 0 : user.id,
|
|
72
|
+
accountId: user === null || user === void 0 ? void 0 : user.accountId,
|
|
73
|
+
type: "USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",
|
|
74
|
+
meta: {
|
|
75
|
+
engagementMedium,
|
|
76
|
+
shareMedium: "DIRECT",
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
const createDownloadable = async () => {
|
|
82
|
+
try {
|
|
83
|
+
const res = await fetch(`${qrPrefix}&qrCodeSize=800&qrCodeImageFormat=png`);
|
|
84
|
+
const blob = await res.blob();
|
|
85
|
+
const url = URL.createObjectURL(blob);
|
|
86
|
+
// Successful
|
|
87
|
+
if (blob)
|
|
88
|
+
fireEvent();
|
|
89
|
+
// Trigger download
|
|
90
|
+
const link = document.createElement("a");
|
|
91
|
+
link.href = url;
|
|
92
|
+
link.download = "qrCode.png";
|
|
93
|
+
document.body.appendChild(link);
|
|
94
|
+
link.click();
|
|
95
|
+
document.body.removeChild(link);
|
|
96
|
+
}
|
|
97
|
+
catch (e) {
|
|
98
|
+
console.error("Failed to fetch QR code:", e);
|
|
99
|
+
setError(true);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
const createPrintable = async () => {
|
|
103
|
+
try {
|
|
104
|
+
const res = await fetch(`${qrPrefix}&qrCodeSize=1000&qrCodeImageFormat=png&qrCodeErrorCorrectionLevel=H`);
|
|
105
|
+
const blob = await res.blob();
|
|
106
|
+
const url = URL.createObjectURL(blob);
|
|
107
|
+
// Successful
|
|
108
|
+
if (blob)
|
|
109
|
+
fireEvent();
|
|
110
|
+
// Trigger print
|
|
111
|
+
const page = window.open("about:blank", "_new");
|
|
112
|
+
const img = page.document.createElement("img");
|
|
113
|
+
img.src = url;
|
|
114
|
+
img.onload = () => {
|
|
115
|
+
page.print();
|
|
116
|
+
page.close();
|
|
117
|
+
};
|
|
118
|
+
page.document.body.appendChild(img);
|
|
119
|
+
}
|
|
120
|
+
catch (e) {
|
|
121
|
+
console.error("Failed to fetch QR code: ", e);
|
|
122
|
+
setError(true);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
return {
|
|
126
|
+
...props,
|
|
127
|
+
loading: completeLoading,
|
|
128
|
+
qrLink,
|
|
129
|
+
error: error,
|
|
130
|
+
createDownloadable,
|
|
131
|
+
createPrintable,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const QrCode = class {
|
|
136
|
+
constructor(hostRef) {
|
|
137
|
+
index.registerInstance(this, hostRef);
|
|
138
|
+
/**
|
|
139
|
+
* @uiName Title
|
|
140
|
+
*/
|
|
141
|
+
this.titleText = "Share your QR code";
|
|
142
|
+
/**
|
|
143
|
+
* @uiName View QR code text
|
|
144
|
+
*/
|
|
145
|
+
this.viewCodeText = "View QR code";
|
|
146
|
+
/**
|
|
147
|
+
* @uiName Download QR code text
|
|
148
|
+
*/
|
|
149
|
+
this.downloadCodeText = "Download";
|
|
150
|
+
/**
|
|
151
|
+
* @uiName Print QR code text
|
|
152
|
+
*/
|
|
153
|
+
this.printCodeText = "Print";
|
|
154
|
+
/**
|
|
155
|
+
* @uiName Header for error banner
|
|
156
|
+
*/
|
|
157
|
+
this.errorHeaderText = "There was an error loading your QR code";
|
|
158
|
+
/**
|
|
159
|
+
* @uiName Description for error banner
|
|
160
|
+
*/
|
|
161
|
+
this.errorDescriptionText = "Please refresh this page and try again";
|
|
162
|
+
/**
|
|
163
|
+
* @uiName Hide title
|
|
164
|
+
*/
|
|
165
|
+
this.hideTitle = false;
|
|
166
|
+
/**
|
|
167
|
+
* @uiName QR code alignment
|
|
168
|
+
* @uiType string
|
|
169
|
+
* @uiEnum ["left", "center", "right"]
|
|
170
|
+
* @uiEnumNames ["Left", "Center", "Right"]
|
|
171
|
+
*/
|
|
172
|
+
this.alignment = "center";
|
|
173
|
+
stencilHooks_module.h$1(this);
|
|
174
|
+
}
|
|
175
|
+
disconnectedCallback() { }
|
|
176
|
+
render() {
|
|
177
|
+
const thisProps = utils.getProps(this);
|
|
178
|
+
const props = index_module.isDemo() ? useDemoQRCode(thisProps) : useQRCode(thisProps);
|
|
179
|
+
return index.h(sqmQrCodeView.QrCodeView, Object.assign({}, props));
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
function useDemoQRCode(props) {
|
|
183
|
+
const [dialogIsOpen, setDialog] = stencilHooks_module.useState(false);
|
|
184
|
+
return cjs.cjs({
|
|
185
|
+
dialogIsOpen,
|
|
186
|
+
hideTitle: props.hideTitle,
|
|
187
|
+
showDialog: () => setDialog(true),
|
|
188
|
+
hideDialog: () => setDialog(false),
|
|
189
|
+
titleText: props.titleText,
|
|
190
|
+
viewCodeText: props.viewCodeText,
|
|
191
|
+
downloadCodeText: props.downloadCodeText,
|
|
192
|
+
printCodeText: props.printCodeText,
|
|
193
|
+
alignment: props.alignment,
|
|
194
|
+
qrLink: "https://media.istockphoto.com/id/1251071788/vector/qr-code-bar-code-black-icon-digital-technology.jpg?s=612x612&w=0&k=20&c=maw4OqMSEegAdSo8Drm9HO7i1ddddvP2YaL1UuWbRig=",
|
|
195
|
+
fireViewQrEvent: () => {
|
|
196
|
+
console.log("View QR Code clicked");
|
|
197
|
+
},
|
|
198
|
+
createDownloadable: async () => {
|
|
199
|
+
console.log("Download QR Code clicked");
|
|
200
|
+
},
|
|
201
|
+
createPrintable: async () => {
|
|
202
|
+
console.log("Print QR Code clicked");
|
|
203
|
+
},
|
|
204
|
+
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
exports.sqm_qr_code = QrCode;
|
|
@@ -9,8 +9,9 @@ const index_module = require('./index.module-ee84433d.js');
|
|
|
9
9
|
require('./cjs-1066ec21.js');
|
|
10
10
|
require('./utils-6847bc06.js');
|
|
11
11
|
const JSS = require('./JSS-8503a151.js');
|
|
12
|
-
|
|
12
|
+
require('./useReferralCodes-82e8797b.js');
|
|
13
13
|
require('./mixins-f7e0377a.js');
|
|
14
|
+
const copyTextView = require('./copy-text-view-c85acaaa.js');
|
|
14
15
|
const GenericTableView = require('./GenericTableView-a9f4ba75.js');
|
|
15
16
|
require('./useChildElements-1b35d945.js');
|
|
16
17
|
const luxon = require('./luxon-2926d85f.js');
|
|
@@ -32,9 +33,11 @@ const sqmPortalProfileView = require('./sqm-portal-profile-view-33164798.js');
|
|
|
32
33
|
require('./utilities-78f5e169.js');
|
|
33
34
|
const sqmPortalResetPasswordView = require('./sqm-portal-reset-password-view-fe602822.js');
|
|
34
35
|
const sqmPortalVerifyEmailView = require('./sqm-portal-verify-email-view-7b678f34.js');
|
|
35
|
-
|
|
36
|
+
require('./ErrorView-b2fcf954.js');
|
|
37
|
+
const sqmQrCodeView = require('./sqm-qr-code-view-15dfc0b6.js');
|
|
38
|
+
const ShadowViewAddon = require('./ShadowViewAddon-787391f7.js');
|
|
36
39
|
const sqmPortalContainerView = require('./sqm-portal-container-view-4f15143a.js');
|
|
37
|
-
const sqmInvoiceTableView = require('./sqm-invoice-table-view-
|
|
40
|
+
const sqmInvoiceTableView = require('./sqm-invoice-table-view-16ac73d0.js');
|
|
38
41
|
|
|
39
42
|
/**
|
|
40
43
|
* lodash (Custom Build) <https://lodash.com/>
|
|
@@ -15756,6 +15759,65 @@ const PortalGoogleRegistrationFormStories = /*#__PURE__*/Object.freeze({
|
|
|
15756
15759
|
TermsAndConditions: TermsAndConditions$4
|
|
15757
15760
|
});
|
|
15758
15761
|
|
|
15762
|
+
const QRCode_stories = {
|
|
15763
|
+
title: "Components/QR Code",
|
|
15764
|
+
};
|
|
15765
|
+
const defaultProps$s = {
|
|
15766
|
+
hideTitle: false,
|
|
15767
|
+
loading: false,
|
|
15768
|
+
alignment: "center",
|
|
15769
|
+
error: false,
|
|
15770
|
+
qrLink: "https://media.istockphoto.com/id/1251071788/vector/qr-code-bar-code-black-icon-digital-technology.jpg?s=612x612&w=0&k=20&c=maw4OqMSEegAdSo8Drm9HO7i1ddddvP2YaL1UuWbRig=",
|
|
15771
|
+
createDownloadable: async () => {
|
|
15772
|
+
console.log("Download QR Code clicked");
|
|
15773
|
+
},
|
|
15774
|
+
createPrintable: async () => {
|
|
15775
|
+
console.log("Print QR Code clicked");
|
|
15776
|
+
},
|
|
15777
|
+
titleText: "Share your QR code",
|
|
15778
|
+
downloadCodeText: "Download",
|
|
15779
|
+
printCodeText: "Print",
|
|
15780
|
+
errorHeaderText: "There was an error loading your QR code",
|
|
15781
|
+
errorDescriptionText: "Please refresh this page and try again",
|
|
15782
|
+
};
|
|
15783
|
+
const Default$q = () => {
|
|
15784
|
+
return index.h(sqmQrCodeView.QrCodeView, Object.assign({}, defaultProps$s));
|
|
15785
|
+
};
|
|
15786
|
+
const HideTitle = () => {
|
|
15787
|
+
return index.h(sqmQrCodeView.QrCodeView, Object.assign({}, defaultProps$s, { hideTitle: true }));
|
|
15788
|
+
};
|
|
15789
|
+
const LeftAlign$1 = () => {
|
|
15790
|
+
return index.h(sqmQrCodeView.QrCodeView, Object.assign({}, defaultProps$s, { alignment: "left" }));
|
|
15791
|
+
};
|
|
15792
|
+
const CenterAlign = () => {
|
|
15793
|
+
return index.h(sqmQrCodeView.QrCodeView, Object.assign({}, defaultProps$s, { alignment: "center" }));
|
|
15794
|
+
};
|
|
15795
|
+
const RightAlign$1 = () => {
|
|
15796
|
+
return index.h(sqmQrCodeView.QrCodeView, Object.assign({}, defaultProps$s, { alignment: "right" }));
|
|
15797
|
+
};
|
|
15798
|
+
const Loading$c = () => {
|
|
15799
|
+
return index.h(sqmQrCodeView.QrCodeView, Object.assign({}, defaultProps$s, { loading: true }));
|
|
15800
|
+
};
|
|
15801
|
+
const Error$c = () => {
|
|
15802
|
+
return index.h(sqmQrCodeView.QrCodeView, Object.assign({}, defaultProps$s, { error: true }));
|
|
15803
|
+
};
|
|
15804
|
+
const DownloadError = () => {
|
|
15805
|
+
return index.h(sqmQrCodeView.QrCodeView, Object.assign({}, defaultProps$s, { error: true }));
|
|
15806
|
+
};
|
|
15807
|
+
|
|
15808
|
+
const QRCode = /*#__PURE__*/Object.freeze({
|
|
15809
|
+
__proto__: null,
|
|
15810
|
+
'default': QRCode_stories,
|
|
15811
|
+
Default: Default$q,
|
|
15812
|
+
HideTitle: HideTitle,
|
|
15813
|
+
LeftAlign: LeftAlign$1,
|
|
15814
|
+
CenterAlign: CenterAlign,
|
|
15815
|
+
RightAlign: RightAlign$1,
|
|
15816
|
+
Loading: Loading$c,
|
|
15817
|
+
Error: Error$c,
|
|
15818
|
+
DownloadError: DownloadError
|
|
15819
|
+
});
|
|
15820
|
+
|
|
15759
15821
|
/**
|
|
15760
15822
|
*
|
|
15761
15823
|
* Themes
|
|
@@ -15768,7 +15830,7 @@ const PortalGoogleRegistrationFormStories = /*#__PURE__*/Object.freeze({
|
|
|
15768
15830
|
*
|
|
15769
15831
|
*/
|
|
15770
15832
|
//
|
|
15771
|
-
const Default$
|
|
15833
|
+
const Default$r = `
|
|
15772
15834
|
// No CSS
|
|
15773
15835
|
`;
|
|
15774
15836
|
const Orangey = `
|
|
@@ -15802,7 +15864,7 @@ const Klip = `
|
|
|
15802
15864
|
|
|
15803
15865
|
const Themes = /*#__PURE__*/Object.freeze({
|
|
15804
15866
|
__proto__: null,
|
|
15805
|
-
Default: Default$
|
|
15867
|
+
Default: Default$r,
|
|
15806
15868
|
Orangey: Orangey,
|
|
15807
15869
|
Netflix: Netflix,
|
|
15808
15870
|
SaaSquatchCorporate: SaaSquatchCorporate,
|
|
@@ -18492,6 +18554,7 @@ const stories = [
|
|
|
18492
18554
|
WidgetCodeVerification,
|
|
18493
18555
|
PayoutButtonScroll,
|
|
18494
18556
|
PayoutStatusAlert,
|
|
18557
|
+
QRCode,
|
|
18495
18558
|
];
|
|
18496
18559
|
const StencilStorybook = class {
|
|
18497
18560
|
constructor(hostRef) {
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-a29c60ef.js');
|
|
4
3
|
const stencilHooks_module = require('./stencil-hooks.module-3a336b0f.js');
|
|
5
4
|
const index_module = require('./index.module-ee84433d.js');
|
|
6
|
-
const JSS = require('./JSS-8503a151.js');
|
|
7
|
-
const mixins = require('./mixins-f7e0377a.js');
|
|
8
5
|
|
|
9
6
|
const GET_REFERRAL_CODES = index_module.dist.gql `
|
|
10
7
|
query getCodes(
|
|
@@ -135,96 +132,6 @@ function useReferralCodes(props) {
|
|
|
135
132
|
};
|
|
136
133
|
}
|
|
137
134
|
|
|
138
|
-
const style = {
|
|
139
|
-
HostBlock: mixins.HostBlock,
|
|
140
|
-
inputStyle: {
|
|
141
|
-
"&::part(input)": { textOverflow: "ellipsis", width: "100%" },
|
|
142
|
-
"&::part(base)": { cursor: "pointer", overflow: "visible" },
|
|
143
|
-
width: "100%",
|
|
144
|
-
},
|
|
145
|
-
inputErrorStyle: {
|
|
146
|
-
"&::part(base)": {
|
|
147
|
-
border: "2px solid red",
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
ContainerDiv: {
|
|
151
|
-
display: "flex",
|
|
152
|
-
alignItems: "flex-start",
|
|
153
|
-
flexDirection: "column",
|
|
154
|
-
justifyContent: "center",
|
|
155
|
-
gap: "var(--sl-spacing-x-small)",
|
|
156
|
-
width: "100%",
|
|
157
|
-
},
|
|
158
|
-
containerStyle: {
|
|
159
|
-
display: "flex",
|
|
160
|
-
alignItems: "center",
|
|
161
|
-
gap: "var(--sl-spacing-x-small)",
|
|
162
|
-
width: "100%",
|
|
163
|
-
},
|
|
164
|
-
errorTextStyle: {
|
|
165
|
-
margin: "0",
|
|
166
|
-
color: "var(--sl-color-danger-500)",
|
|
167
|
-
},
|
|
168
|
-
notificationTextStyle: {
|
|
169
|
-
margin: "0",
|
|
170
|
-
color: "var(--sl-color-neutral-500)",
|
|
171
|
-
},
|
|
172
|
-
};
|
|
173
|
-
const vanillaStyle = `
|
|
174
|
-
:host{
|
|
175
|
-
display: block;
|
|
176
|
-
width: 100%;
|
|
177
|
-
}
|
|
178
|
-
`;
|
|
179
|
-
const textAlignStyle = {
|
|
180
|
-
right: `
|
|
181
|
-
sl-input::part(input){
|
|
182
|
-
text-align: right;
|
|
183
|
-
}`,
|
|
184
|
-
center: `
|
|
185
|
-
sl-input::part(input){
|
|
186
|
-
text-align: center;
|
|
187
|
-
}`,
|
|
188
|
-
left: ``,
|
|
189
|
-
};
|
|
190
|
-
const disabledStyles = `
|
|
191
|
-
sl-input::part(input){
|
|
192
|
-
cursor: default;
|
|
193
|
-
}
|
|
194
|
-
`;
|
|
195
|
-
const sheet = JSS.createStyleSheet(style);
|
|
196
|
-
const styleString = sheet.toString();
|
|
197
|
-
function CopyTextView(props) {
|
|
198
|
-
const { buttonStyle = "icon" } = props;
|
|
199
|
-
const error = !props.loading && props.error;
|
|
200
|
-
const inputText = error ? props.inputPlaceholderText : props.copyString;
|
|
201
|
-
const disabled = error || props.loading || props.disabled;
|
|
202
|
-
const tooltipPlacement = props.buttonStyle === "button-below"
|
|
203
|
-
? "bottom"
|
|
204
|
-
: props.buttonStyle === "button-outside"
|
|
205
|
-
? "top"
|
|
206
|
-
: "top-end";
|
|
207
|
-
const copyButton = (index.h("sl-tooltip", { trigger: "manual", content: props.tooltiptext, placement: tooltipPlacement, disabled: props.disabled, open: props.open, skidding: props.buttonStyle === "icon" ? -5 : 0, slot: "suffix" }, buttonStyle === "icon" ? (index.h("sl-icon-button", { exportparts: "base: icon-button-base", onClick: () => { var _a; return (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props); }, name: "files", disabled: disabled })) : (index.h("sl-button", { exportparts: "base: copy-button-base", onClick: () => { var _a; return (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props); }, size: "medium", style: { width: `${buttonStyle === "button-below" && "100%"}` }, disabled: disabled, type: "primary" }, props.copyButtonLabel || "Copy"))));
|
|
208
|
-
return (index.h("div", { class: sheet.classes.ContainerDiv },
|
|
209
|
-
index.h("style", { type: "text/css" },
|
|
210
|
-
styleString,
|
|
211
|
-
vanillaStyle,
|
|
212
|
-
textAlignStyle[props.textAlign],
|
|
213
|
-
disabled && disabledStyles),
|
|
214
|
-
index.h("div", { class: sheet.classes.containerStyle, style: {
|
|
215
|
-
flexDirection: `${buttonStyle === "button-below" ? "column" : "row"}`,
|
|
216
|
-
} },
|
|
217
|
-
index.h("sl-input", { class: `${sheet.classes.inputStyle} ${error ? sheet.classes.inputErrorStyle : ""}`, exportparts: "base: input-base, input: input-label", value: props.loading ? "Loading..." : inputText, readonly: true, disabled: disabled },
|
|
218
|
-
buttonStyle === "icon" && copyButton,
|
|
219
|
-
error && (index.h("p", { slot: "help-text", class: sheet.classes.errorTextStyle }, props.errorText))),
|
|
220
|
-
(buttonStyle === "button-outside" || buttonStyle === "button-below") &&
|
|
221
|
-
copyButton),
|
|
222
|
-
props.isCopied &&
|
|
223
|
-
props.showNotificationText &&
|
|
224
|
-
props.notificationText && (index.h("p", { part: "sqm-notification-text", class: sheet.classes.notificationTextStyle }, props.notificationText))));
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
exports.CopyTextView = CopyTextView;
|
|
228
135
|
exports.REFERRAL_CODES_NAMESPACE = REFERRAL_CODES_NAMESPACE;
|
|
229
136
|
exports.REFERRAL_CODES_PAGINATION_CONTEXT = REFERRAL_CODES_PAGINATION_CONTEXT;
|
|
230
137
|
exports.SET_CODE_COPIED = SET_CODE_COPIED;
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"./components/sqm-program-explainer/sqm-program-explainer.js",
|
|
73
73
|
"./components/sqm-program-explainer-step/sqm-program-explainer-step.js",
|
|
74
74
|
"./components/sqm-program-menu/sqm-program-menu.js",
|
|
75
|
+
"./components/sqm-qr-code/sqm-qr-code.js",
|
|
75
76
|
"./components/sqm-referral-card/sqm-referral-card.js",
|
|
76
77
|
"./components/sqm-referral-code/sqm-referral-code.js",
|
|
77
78
|
"./components/sqm-referral-iframe/sqm-referral-iframe.js",
|
|
@@ -5,6 +5,8 @@ import { CardFeedView } from "./sqm-card-feed-view";
|
|
|
5
5
|
/**
|
|
6
6
|
* @uiName Card Feed
|
|
7
7
|
* @slots [{"name":"","title":"Cards"}]
|
|
8
|
+
* @validParents ["sqm-brand","sqm-portal-container", "sqm-popup-container-sqm-hero", "sqm-titled-section", "div"]
|
|
9
|
+
* @validChildren ["sqm-task-card"]
|
|
8
10
|
* @exampleGroup Rewards
|
|
9
11
|
* @example Task Card Feed - <sqm-card-feed gap="24" width="347"> <sqm-task-card reward-amount="20" goal="1" card-title="Complete a Survey" description="Fill out our NPS survey and get 20 points for giving us honest feedback." button-text="Take survey" reward-unit="Points" completed-text="Completed {finite, select, 0 {{count, plural, =1 {{count} time} other {{count} times}}} other {{count}/{finite} times}}" ended-message="Ended {endDate}" expiry-message="Ends {endDate}" finite="0" starts-on-message="Starts {startDate}" > </sqm-task-card> <sqm-task-card reward-amount="250" goal="500" show-progress-bar card-title="Spend $500" description="Earn 250 points when you spend $500 or more." button-text="See plans" completed-text="Completed {finite, select, 0 {{count, plural, =1 {{count} time} other {{count} times}}} other {{count}/{finite} times}}" ended-message="Ended {endDate}" expiry-message="Ends {endDate}" progress-bar-unit="$" finite="0" reward-unit="Points" starts-on-message="Starts {startDate}" > </sqm-task-card> <sqm-task-card goal="1" reward-amount="50" card-title="Follow Us on X" description="Earn 50 points when you Follow Us on X!" button-text="Follow" button-link="https://twitter.com/" open-new-tab="true" event-key="socialFollow" completed-text="Completed {finite, select, 0 {{count, plural, =1 {{count} time} other {{count} times}}} other {{count}/{finite} times}}" ended-message="Ended {endDate}" expiry-message="Ends {endDate}" finite="0" reward-unit="Points" starts-on-message="Starts {startDate}" > </sqm-task-card> <sqm-task-card reward-amount="1" reward-unit="Free Month" goal="1" card-title="Upgrade Your Plan" description="Receive one free month for being a committed customer when you upgrade your plan." button-text="Upgrade" completed-text="Completed {finite, select, 0 {{count, plural, =1 {{count} time} other {{count} times}}} other {{count}/{finite} times}}" ended-message="Ended {endDate}" expiry-message="Ends {endDate}" open-new-tab="false" finite="0" starts-on-message="Starts {startDate}" > </sqm-task-card> </sqm-card-feed>
|
|
10
12
|
*/
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { QrCodeView } from "./sqm-qr-code-view";
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/QR Code",
|
|
5
|
+
};
|
|
6
|
+
const defaultProps = {
|
|
7
|
+
hideTitle: false,
|
|
8
|
+
loading: false,
|
|
9
|
+
alignment: "center",
|
|
10
|
+
error: false,
|
|
11
|
+
qrLink: "https://media.istockphoto.com/id/1251071788/vector/qr-code-bar-code-black-icon-digital-technology.jpg?s=612x612&w=0&k=20&c=maw4OqMSEegAdSo8Drm9HO7i1ddddvP2YaL1UuWbRig=",
|
|
12
|
+
createDownloadable: async () => {
|
|
13
|
+
console.log("Download QR Code clicked");
|
|
14
|
+
},
|
|
15
|
+
createPrintable: async () => {
|
|
16
|
+
console.log("Print QR Code clicked");
|
|
17
|
+
},
|
|
18
|
+
titleText: "Share your QR code",
|
|
19
|
+
downloadCodeText: "Download",
|
|
20
|
+
printCodeText: "Print",
|
|
21
|
+
errorHeaderText: "There was an error loading your QR code",
|
|
22
|
+
errorDescriptionText: "Please refresh this page and try again",
|
|
23
|
+
};
|
|
24
|
+
export const Default = () => {
|
|
25
|
+
return h(QrCodeView, Object.assign({}, defaultProps));
|
|
26
|
+
};
|
|
27
|
+
export const HideTitle = () => {
|
|
28
|
+
return h(QrCodeView, Object.assign({}, defaultProps, { hideTitle: true }));
|
|
29
|
+
};
|
|
30
|
+
export const LeftAlign = () => {
|
|
31
|
+
return h(QrCodeView, Object.assign({}, defaultProps, { alignment: "left" }));
|
|
32
|
+
};
|
|
33
|
+
export const CenterAlign = () => {
|
|
34
|
+
return h(QrCodeView, Object.assign({}, defaultProps, { alignment: "center" }));
|
|
35
|
+
};
|
|
36
|
+
export const RightAlign = () => {
|
|
37
|
+
return h(QrCodeView, Object.assign({}, defaultProps, { alignment: "right" }));
|
|
38
|
+
};
|
|
39
|
+
export const Loading = () => {
|
|
40
|
+
return h(QrCodeView, Object.assign({}, defaultProps, { loading: true }));
|
|
41
|
+
};
|
|
42
|
+
export const Error = () => {
|
|
43
|
+
return h(QrCodeView, Object.assign({}, defaultProps, { error: true }));
|
|
44
|
+
};
|
|
45
|
+
export const DownloadError = () => {
|
|
46
|
+
return h(QrCodeView, Object.assign({}, defaultProps, { error: true }));
|
|
47
|
+
};
|