@saasquatch/mint-components 1.12.0-9 → 1.12.1-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/dist/cjs/{ShadowViewAddon-040cffad.js → ShadowViewAddon-88821c64.js} +3 -6
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/mint-components.cjs.js +1 -1
  4. package/dist/cjs/sqm-banking-info-form_16.cjs.entry.js +79 -202
  5. package/dist/cjs/sqm-big-stat_39.cjs.entry.js +160 -281
  6. package/dist/cjs/{sqm-invoice-table-view-c58966f8.js → sqm-invoice-table-view-a9133a11.js} +0 -98
  7. package/dist/cjs/sqm-portal-registration-form-view-621348a6.js +85 -0
  8. package/dist/cjs/sqm-portal-registration-form.cjs.entry.js +12 -81
  9. package/dist/cjs/sqm-stencilbook.cjs.entry.js +323 -334
  10. package/dist/collection/collection-manifest.json +1 -6
  11. package/dist/collection/components/sqm-big-stat/useBigStat.js +3 -6
  12. package/dist/collection/components/sqm-checkbox-field/sqm-checkbox-field.js +5 -5
  13. package/dist/collection/components/sqm-marketing-emails-checkbox/MarketingEmailsCheckbox.stories.js +11 -0
  14. package/dist/collection/components/sqm-marketing-emails-checkbox/sqm-marketing-emails-checkbox.js +160 -0
  15. package/dist/collection/components/sqm-portal-registration-form/PortalRegistrationForm.stories.js +5 -1
  16. package/dist/collection/components/sqm-portal-registration-form/sqm-portal-registration-form-view.js +1 -1
  17. package/dist/collection/components/sqm-portal-registration-form/sqm-portal-registration-form.js +3 -2
  18. package/dist/collection/components/sqm-portal-registration-form/usePortalRegistrationForm.js +6 -0
  19. package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +4 -8
  20. package/dist/collection/components/tax-and-cash/BankingForm.stories.js +0 -2
  21. package/dist/collection/components/tax-and-cash/TaxForm.stories.js +0 -96
  22. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.js +1 -5
  23. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +38 -101
  24. package/dist/collection/components/tax-and-cash/sqm-docusign-form/docusign-iframe/DocusignIframe.js +2 -15
  25. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/data.js +0 -7
  26. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.js +8 -8
  27. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.js +2 -2
  28. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.js +0 -22
  29. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +9 -99
  30. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/useTaxAndCashDashboard.js +1 -8
  31. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +2 -2
  32. package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +11 -14
  33. package/dist/esm/{ShadowViewAddon-69b61037.js → ShadowViewAddon-65c8679e.js} +3 -6
  34. package/dist/esm/loader.js +1 -1
  35. package/dist/esm/mint-components.js +1 -1
  36. package/dist/esm/sqm-banking-info-form_16.entry.js +79 -202
  37. package/dist/esm/sqm-big-stat_39.entry.js +159 -280
  38. package/dist/esm/{sqm-invoice-table-view-d1cfdaf4.js → sqm-invoice-table-view-71915a5e.js} +0 -98
  39. package/dist/esm/sqm-portal-registration-form-view-1d3066e1.js +83 -0
  40. package/dist/esm/sqm-portal-registration-form.entry.js +18 -87
  41. package/dist/esm/sqm-stencilbook.entry.js +323 -334
  42. package/dist/esm/stencil-hooks.module-ac12ca1c.js +1 -1
  43. package/dist/esm-es5/ShadowViewAddon-65c8679e.js +1 -0
  44. package/dist/esm-es5/loader.js +1 -1
  45. package/dist/esm-es5/mint-components.js +1 -1
  46. package/dist/esm-es5/sqm-banking-info-form_16.entry.js +1 -1
  47. package/dist/esm-es5/sqm-big-stat_39.entry.js +1 -1
  48. package/dist/esm-es5/sqm-invoice-table-view-71915a5e.js +1 -0
  49. package/dist/esm-es5/sqm-portal-registration-form-view-1d3066e1.js +1 -0
  50. package/dist/esm-es5/sqm-portal-registration-form.entry.js +1 -1
  51. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  52. package/dist/esm-es5/stencil-hooks.module-ac12ca1c.js +1 -1
  53. package/dist/mint-components/mint-components.esm.js +1 -1
  54. package/dist/mint-components/p-1279f7a3.system.entry.js +1 -0
  55. package/dist/mint-components/p-15a64357.entry.js +13 -0
  56. package/dist/mint-components/p-17f56865.entry.js +9 -0
  57. package/dist/mint-components/p-2a414b2e.system.js +2 -2
  58. package/dist/mint-components/p-3cb18382.system.js +1 -0
  59. package/dist/mint-components/p-40b1de58.js +1 -0
  60. package/dist/mint-components/p-4112e198.system.js +1 -0
  61. package/dist/mint-components/p-5cd917db.js +1 -0
  62. package/dist/mint-components/p-6792c8d8.system.entry.js +1 -0
  63. package/dist/mint-components/p-a02afa72.system.js +1 -0
  64. package/dist/mint-components/p-acd77a6e.entry.js +223 -0
  65. package/dist/mint-components/p-b3e97f8a.system.entry.js +1 -0
  66. package/dist/mint-components/{p-9eae245f.js → p-b651706a.js} +3 -6
  67. package/dist/mint-components/p-b8233366.entry.js +174 -0
  68. package/dist/mint-components/p-ca809fdd.system.js +1 -1
  69. package/dist/mint-components/p-cb38b9b0.system.entry.js +1 -0
  70. package/dist/mint-components/p-fd2c5407.js +2 -2
  71. package/dist/types/components/sqm-checkbox-field/sqm-checkbox-field-view.d.ts +1 -1
  72. package/dist/types/components/sqm-checkbox-field/sqm-checkbox-field.d.ts +4 -4
  73. package/dist/types/components/sqm-marketing-emails-checkbox/MarketingEmailsCheckbox.stories.d.ts +8 -0
  74. package/dist/types/components/sqm-marketing-emails-checkbox/sqm-marketing-emails-checkbox.d.ts +34 -0
  75. package/dist/types/components/sqm-portal-registration-form/PortalRegistrationForm.stories.d.ts +1 -0
  76. package/dist/types/components/sqm-portal-registration-form/sqm-portal-registration-form-view.d.ts +1 -0
  77. package/dist/types/components/sqm-portal-registration-form/sqm-portal-registration-form.d.ts +1 -1
  78. package/dist/types/components/tax-and-cash/TaxForm.stories.d.ts +0 -2
  79. package/dist/types/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.d.ts +0 -2
  80. package/dist/types/components/tax-and-cash/sqm-docusign-form/useDocusignForm.d.ts +1 -1
  81. package/dist/types/components/tax-and-cash/sqm-tax-and-cash/data.d.ts +0 -6
  82. package/dist/types/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.d.ts +2 -2
  83. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.d.ts +0 -12
  84. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.d.ts +2 -19
  85. package/dist/types/components.d.ts +108 -625
  86. package/docs/docs.docx +0 -0
  87. package/docs/raisins.json +1 -1
  88. package/grapesjs/grapesjs.js +1 -1
  89. package/package.json +2 -2
  90. package/dist/cjs/extractProps-fd93ba62.js +0 -21
  91. package/dist/cjs/keys-cff24974.js +0 -11
  92. package/dist/cjs/sqm-code-verification.cjs.entry.js +0 -342
  93. package/dist/cjs/sqm-email-verification.cjs.entry.js +0 -283
  94. package/dist/cjs/sqm-scroll.cjs.entry.js +0 -109
  95. package/dist/cjs/sqm-widget-verification-internal.cjs.entry.js +0 -103
  96. package/dist/cjs/sqm-widget-verification.cjs.entry.js +0 -210
  97. package/dist/cjs/usePayoutStatus-b9fb7399.js +0 -70
  98. package/dist/cjs/useVerificationEmail-6aacdb71.js +0 -169
  99. package/dist/collection/components/sqm-payout-button-scroll/PayoutButtonScroll.stories.js +0 -8
  100. package/dist/collection/components/sqm-payout-button-scroll/sqm-payout-button-scroll-view.js +0 -23
  101. package/dist/collection/components/sqm-payout-button-scroll/sqm-payout-button-scroll.js +0 -118
  102. package/dist/collection/components/sqm-payout-button-scroll/usePayoutButton.js +0 -44
  103. package/dist/collection/components/sqm-widget-verification/keys.js +0 -4
  104. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/WidgetCodeVerification.stories.js +0 -36
  105. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification-view.js +0 -128
  106. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification.js +0 -301
  107. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/useCodeVerification.js +0 -153
  108. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/WidgetEmailVerification.stories.js +0 -42
  109. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification-view.js +0 -91
  110. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification.js +0 -226
  111. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/useEmailVerification.js +0 -126
  112. package/dist/collection/components/sqm-widget-verification/sqm-widget-verification-internal.js +0 -339
  113. package/dist/collection/components/sqm-widget-verification/sqm-widget-verification.js +0 -557
  114. package/dist/collection/components/sqm-widget-verification/useVerificationEmail.js +0 -165
  115. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/PayoutStatusAlert.stories.js +0 -22
  116. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.js +0 -131
  117. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.js +0 -354
  118. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.js +0 -65
  119. package/dist/esm/extractProps-ae1afbb3.js +0 -19
  120. package/dist/esm/keys-db1897ae.js +0 -6
  121. package/dist/esm/sqm-code-verification.entry.js +0 -338
  122. package/dist/esm/sqm-email-verification.entry.js +0 -279
  123. package/dist/esm/sqm-scroll.entry.js +0 -105
  124. package/dist/esm/sqm-widget-verification-internal.entry.js +0 -99
  125. package/dist/esm/sqm-widget-verification.entry.js +0 -206
  126. package/dist/esm/usePayoutStatus-1a635054.js +0 -67
  127. package/dist/esm/useVerificationEmail-c32696ba.js +0 -167
  128. package/dist/esm-es5/ShadowViewAddon-69b61037.js +0 -1
  129. package/dist/esm-es5/extractProps-ae1afbb3.js +0 -1
  130. package/dist/esm-es5/keys-db1897ae.js +0 -1
  131. package/dist/esm-es5/sqm-code-verification.entry.js +0 -1
  132. package/dist/esm-es5/sqm-email-verification.entry.js +0 -1
  133. package/dist/esm-es5/sqm-invoice-table-view-d1cfdaf4.js +0 -1
  134. package/dist/esm-es5/sqm-scroll.entry.js +0 -1
  135. package/dist/esm-es5/sqm-widget-verification-internal.entry.js +0 -1
  136. package/dist/esm-es5/sqm-widget-verification.entry.js +0 -1
  137. package/dist/esm-es5/usePayoutStatus-1a635054.js +0 -1
  138. package/dist/esm-es5/useVerificationEmail-c32696ba.js +0 -1
  139. package/dist/mint-components/p-1712a9fd.entry.js +0 -11
  140. package/dist/mint-components/p-1e616d45.system.js +0 -1
  141. package/dist/mint-components/p-24092973.entry.js +0 -9
  142. package/dist/mint-components/p-26468242.js +0 -1
  143. package/dist/mint-components/p-331d060e.entry.js +0 -223
  144. package/dist/mint-components/p-3925bcd6.entry.js +0 -13
  145. package/dist/mint-components/p-39840341.js +0 -1
  146. package/dist/mint-components/p-4364001c.entry.js +0 -12
  147. package/dist/mint-components/p-4bd7a472.js +0 -1
  148. package/dist/mint-components/p-517224ef.js +0 -19
  149. package/dist/mint-components/p-5a23b560.system.entry.js +0 -1
  150. package/dist/mint-components/p-64491210.system.entry.js +0 -1
  151. package/dist/mint-components/p-8300d8c8.system.js +0 -1
  152. package/dist/mint-components/p-8bddb468.system.entry.js +0 -1
  153. package/dist/mint-components/p-9596e97c.system.entry.js +0 -1
  154. package/dist/mint-components/p-974070c4.system.entry.js +0 -1
  155. package/dist/mint-components/p-a85f57bb.entry.js +0 -1
  156. package/dist/mint-components/p-a8645c1b.system.js +0 -1
  157. package/dist/mint-components/p-b2a99637.system.js +0 -1
  158. package/dist/mint-components/p-b62faaa5.system.entry.js +0 -1
  159. package/dist/mint-components/p-c05e7b9f.entry.js +0 -195
  160. package/dist/mint-components/p-c510fb88.entry.js +0 -1
  161. package/dist/mint-components/p-c7057066.system.entry.js +0 -1
  162. package/dist/mint-components/p-d7806f31.js +0 -48
  163. package/dist/mint-components/p-e01ac27c.system.js +0 -1
  164. package/dist/mint-components/p-e45a8501.system.entry.js +0 -1
  165. package/dist/mint-components/p-e990dc21.system.js +0 -1
  166. package/dist/mint-components/p-ead27698.system.entry.js +0 -1
  167. package/dist/mint-components/p-f340214f.entry.js +0 -25
  168. package/dist/types/components/sqm-payout-button-scroll/PayoutButtonScroll.stories.d.ts +0 -5
  169. package/dist/types/components/sqm-payout-button-scroll/sqm-payout-button-scroll-view.d.ts +0 -10
  170. package/dist/types/components/sqm-payout-button-scroll/sqm-payout-button-scroll.d.ts +0 -26
  171. package/dist/types/components/sqm-payout-button-scroll/usePayoutButton.d.ts +0 -7
  172. package/dist/types/components/sqm-widget-verification/keys.d.ts +0 -4
  173. package/dist/types/components/sqm-widget-verification/sqm-code-verification/WidgetCodeVerification.stories.d.ts +0 -9
  174. package/dist/types/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification-view.d.ts +0 -26
  175. package/dist/types/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification.d.ts +0 -54
  176. package/dist/types/components/sqm-widget-verification/sqm-code-verification/useCodeVerification.d.ts +0 -25
  177. package/dist/types/components/sqm-widget-verification/sqm-email-verification/WidgetEmailVerification.stories.d.ts +0 -10
  178. package/dist/types/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification-view.d.ts +0 -21
  179. package/dist/types/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification.d.ts +0 -40
  180. package/dist/types/components/sqm-widget-verification/sqm-email-verification/useEmailVerification.d.ts +0 -10
  181. package/dist/types/components/sqm-widget-verification/sqm-widget-verification-internal.d.ts +0 -20
  182. package/dist/types/components/sqm-widget-verification/sqm-widget-verification.d.ts +0 -87
  183. package/dist/types/components/sqm-widget-verification/useVerificationEmail.d.ts +0 -14
  184. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/PayoutStatusAlert.stories.d.ts +0 -10
  185. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.d.ts +0 -30
  186. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.d.ts +0 -62
  187. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.d.ts +0 -21
@@ -1,118 +0,0 @@
1
- import { Component, h, Prop, State } from "@stencil/core";
2
- import { withHooks } from "@saasquatch/stencil-hooks";
3
- import { getProps } from "../../utils/utils";
4
- import { PayoutButtonScrollView, } from "./sqm-payout-button-scroll-view";
5
- import deepmerge from "deepmerge";
6
- /**
7
- * @uiName Payout Button Scroll
8
- */
9
- export class PayoutButtonScroll {
10
- constructor() {
11
- /**
12
- * @uiName Payout button text
13
- */
14
- this.payoutButtonText = "Payouts & Tax Settings";
15
- /**
16
- * Description text under payout button
17
- * @uiName Payout button description text
18
- */
19
- this.payoutButtonDescription = "Check your payout settings to see when you’ll get paid out next";
20
- this.ignored = true;
21
- withHooks(this);
22
- }
23
- disconnectedCallback() { }
24
- getTextProps() {
25
- return getProps(this);
26
- }
27
- render() {
28
- const props = useDemoPayoutButtonScroll(this);
29
- return h(PayoutButtonScrollView, Object.assign({}, props));
30
- }
31
- static get is() { return "sqm-payout-button-scroll"; }
32
- static get encapsulation() { return "shadow"; }
33
- static get properties() { return {
34
- "payoutButtonText": {
35
- "type": "string",
36
- "mutable": false,
37
- "complexType": {
38
- "original": "string",
39
- "resolved": "string",
40
- "references": {}
41
- },
42
- "required": false,
43
- "optional": false,
44
- "docs": {
45
- "tags": [{
46
- "text": "Payout button text",
47
- "name": "uiName"
48
- }],
49
- "text": ""
50
- },
51
- "attribute": "payout-button-text",
52
- "reflect": false,
53
- "defaultValue": "\"Payouts & Tax Settings\""
54
- },
55
- "payoutButtonDescription": {
56
- "type": "string",
57
- "mutable": false,
58
- "complexType": {
59
- "original": "string",
60
- "resolved": "string",
61
- "references": {}
62
- },
63
- "required": false,
64
- "optional": false,
65
- "docs": {
66
- "tags": [{
67
- "text": "Payout button description text",
68
- "name": "uiName"
69
- }],
70
- "text": "Description text under payout button"
71
- },
72
- "attribute": "payout-button-description",
73
- "reflect": false,
74
- "defaultValue": "\"Check your payout settings to see when you\u2019ll get paid out next\""
75
- },
76
- "demoData": {
77
- "type": "unknown",
78
- "mutable": false,
79
- "complexType": {
80
- "original": "DemoData<PayoutButtonScrollViewProps>",
81
- "resolved": "{ states?: { payoutSettingsComplete: boolean; }; }",
82
- "references": {
83
- "DemoData": {
84
- "location": "import",
85
- "path": "../../global/demo"
86
- },
87
- "PayoutButtonScrollViewProps": {
88
- "location": "import",
89
- "path": "./sqm-payout-button-scroll-view"
90
- }
91
- }
92
- },
93
- "required": false,
94
- "optional": true,
95
- "docs": {
96
- "tags": [{
97
- "text": undefined,
98
- "name": "undocumented"
99
- }, {
100
- "text": "object",
101
- "name": "uiType"
102
- }],
103
- "text": ""
104
- }
105
- }
106
- }; }
107
- static get states() { return {
108
- "ignored": {}
109
- }; }
110
- }
111
- function useDemoPayoutButtonScroll(props) {
112
- return deepmerge({
113
- states: {
114
- payoutSettingsComplete: false,
115
- },
116
- text: props.getTextProps(),
117
- }, props.demoData || {}, { arrayMerge: (_, a) => a });
118
- }
@@ -1,44 +0,0 @@
1
- import { gql } from "graphql-request";
2
- import { useQuery } from "@saasquatch/component-boilerplate";
3
- import { useEffect, useState } from "@saasquatch/universal-hooks";
4
- const GET_PAYOUT_DETAILS = gql `
5
- query getPayoutDetails {
6
- user: viewer {
7
- ... on User {
8
- id
9
- impactConnection {
10
- connected
11
- publisher {
12
- id
13
- payoutsAccount {
14
- hold
15
- balance
16
- }
17
- }
18
- }
19
- }
20
- }
21
- }
22
- `;
23
- export function usePayoutButton(props) {
24
- const { data, refetch } = useQuery(GET_PAYOUT_DETAILS, {});
25
- const [completed, setCompleted] = useState(false);
26
- useEffect(() => {
27
- var _a, _b, _c;
28
- if (!data)
29
- return;
30
- const hasCompleted = (_c = (_b = (_a = data.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher) === null || _c === void 0 ? void 0 : _c.payoutAccount;
31
- setCompleted(hasCompleted);
32
- }, [data]);
33
- useEffect(() => {
34
- const cb = () => refetch();
35
- window.addEventListener("sqm:tax-form-updated", cb);
36
- return () => window.removeEventListener("sqm:tax-form-updated", cb);
37
- }, []);
38
- return {
39
- states: {
40
- payoutSettingsComplete: completed,
41
- },
42
- text: props.getTextProps(),
43
- };
44
- }
@@ -1,4 +0,0 @@
1
- export const SHOW_CODE_NAMESPACE = "sq:code-verification";
2
- export const VERIFICATION_EMAIL_NAMESPACE = "sq:verification-email";
3
- export const VERIFICATION_PARENT_NAMESPACE = "sq:verification-context";
4
- export const VERIFICATION_EVENT_KEY = "sq:code-verified";
@@ -1,36 +0,0 @@
1
- import { h } from "@stencil/core";
2
- export default {
3
- title: "Components/Widget Code Verification",
4
- };
5
- const defaultProps = {
6
- initialiseLoading: false,
7
- email: "testemail@example.com",
8
- loading: false,
9
- verifyFailed: false,
10
- emailResent: false,
11
- };
12
- export const Default = () => (h("sqm-code-verification", { demoData: { states: defaultProps } }));
13
- export const InitialLoading = () => (h("sqm-code-verification", { demoData: {
14
- states: {
15
- ...defaultProps,
16
- initialiseLoading: true,
17
- },
18
- } }));
19
- export const Loading = () => (h("sqm-code-verification", { demoData: {
20
- states: {
21
- ...defaultProps,
22
- loading: true,
23
- },
24
- } }));
25
- export const CodeResent = () => (h("sqm-code-verification", { demoData: {
26
- states: {
27
- ...defaultProps,
28
- emailResent: true,
29
- },
30
- } }));
31
- export const VerificationFailed = () => (h("sqm-code-verification", { demoData: {
32
- states: {
33
- ...defaultProps,
34
- verifyFailed: true,
35
- },
36
- } }));
@@ -1,128 +0,0 @@
1
- import { h } from "@stencil/core";
2
- import { createStyleSheet } from "../../../styling/JSS";
3
- import { TextSpanView } from "../../sqm-text-span/sqm-text-span-view";
4
- import { ErrorStyles } from "../../../global/mixins";
5
- import { intl } from "../../../global/global";
6
- const style = {
7
- Wrapper: {
8
- display: "flex",
9
- flexDirection: "column",
10
- gap: "var(--sl-spacing-medium)",
11
- maxWidth: "515px",
12
- },
13
- HeaderContainer: {
14
- display: "flex",
15
- flexDirection: "column",
16
- },
17
- InputsContainer: {
18
- display: "flex",
19
- gap: "var(--sl-spacing-medium)",
20
- position: "relative",
21
- flexDirection: "column",
22
- },
23
- CodeInputContainer: {
24
- display: "flex",
25
- gap: "var(--sl-spacing-medium)",
26
- },
27
- CodeInput: {
28
- maxWidth: "40px",
29
- "&::part(input)": {
30
- margin: "0",
31
- padding: "0 var(--sl-input-spacing-small)",
32
- fontSize: "var(--sl-font-size-large)",
33
- },
34
- },
35
- CodeInputError: {
36
- ...ErrorStyles,
37
- maxWidth: "40px",
38
- "&::part(input)": {
39
- margin: "0",
40
- padding: "0 var(--sl-input-spacing-small)",
41
- fontSize: "var(--sl-font-size-large)",
42
- },
43
- },
44
- ErrorText: {
45
- color: "var(--sl-color-danger-500)",
46
- fontSize: "var(--sl-font-size-small)",
47
- margin: "0",
48
- },
49
- ContinueButton: {
50
- width: "100%",
51
- maxWidth: "100px",
52
- },
53
- FooterContainer: {
54
- display: "flex",
55
- flexDirection: "column",
56
- },
57
- SkeletonOne: {
58
- width: "50%",
59
- height: "16px",
60
- },
61
- SkeletonTwo: {
62
- width: "30%",
63
- height: "34px",
64
- },
65
- SkeletonThree: {
66
- width: "15%",
67
- height: "24px",
68
- },
69
- };
70
- const vanillaStyle = `
71
- :host {
72
- display: block;
73
- }
74
- :host([hidden]): {
75
- display: none;
76
- }
77
-
78
-
79
- `;
80
- const sheet = createStyleSheet(style);
81
- const styleString = sheet.toString();
82
- export function WidgetCodeVerificationView(props) {
83
- const { states, refs, callbacks, text } = props;
84
- const resendCodeText = intl.formatMessage({
85
- id: "resendCodeText",
86
- defaultMessage: text.resendCodeText,
87
- }, {
88
- resendCodeLink: (h("a", { href: "", style: { textDecoration: "none" }, onClick: (e) => {
89
- e.preventDefault();
90
- callbacks.resendEmail();
91
- } }, text.resendCodeLabel)),
92
- });
93
- const codeResentSuccessfully = intl.formatMessage({
94
- id: "codeResentSuccessfully",
95
- defaultMessage: text.codeResentSuccessfullyText,
96
- }, {
97
- email: states.email,
98
- });
99
- const inputClass = states.verifyFailed
100
- ? sheet.classes.CodeInputError
101
- : sheet.classes.CodeInput;
102
- return (h("div", { part: "sqm-base" },
103
- h("style", { type: "text/css" },
104
- vanillaStyle,
105
- styleString),
106
- h("div", { class: sheet.classes.Wrapper },
107
- h("div", { class: sheet.classes.HeaderContainer },
108
- h(TextSpanView, { type: "p" }, intl.formatMessage({
109
- id: `emailHeaderText`,
110
- defaultMessage: states.verifyFailed
111
- ? text.reverifyCodeHeaderText
112
- : text.verifyCodeHeaderText,
113
- }, { email: states.email }))),
114
- states.emailResent && (h("sqm-form-message", { type: "success", exportparts: "successalert-icon" },
115
- h("b", null, codeResentSuccessfully))),
116
- h("div", { class: sheet.classes.InputsContainer },
117
- h("div", { ref: refs.codeWrapperRef, class: sheet.classes.CodeInputContainer },
118
- h("sl-input", { class: inputClass, name: "code" }),
119
- h("sl-input", { class: inputClass, name: "code" }),
120
- h("sl-input", { class: inputClass, name: "code" }),
121
- h("sl-input", { class: inputClass, name: "code" }),
122
- h("sl-input", { class: inputClass, name: "code" }),
123
- h("sl-input", { class: inputClass, name: "code" })),
124
- states.verifyFailed && (h("p", { class: sheet.classes.ErrorText }, text.invalidCodeText)),
125
- h("sl-button", { class: sheet.classes.ContinueButton, onClick: callbacks.submitCode, disabled: states.loading || states.initialiseLoading, loading: states.loading || states.initialiseLoading, exportparts: "base: primarybutton-base", type: "primary" }, text.verifyText)),
126
- h("div", { class: sheet.classes.FooterContainer },
127
- h(TextSpanView, { type: "p" }, resendCodeText)))));
128
- }
@@ -1,301 +0,0 @@
1
- import { isDemo, useSetParent } from "@saasquatch/component-boilerplate";
2
- import { useState, withHooks } from "@saasquatch/stencil-hooks";
3
- import { Component, h, Prop } from "@stencil/core";
4
- import deepmerge from "deepmerge";
5
- import { getProps } from "../../../utils/utils";
6
- import { WidgetCodeVerificationView, } from "./sqm-code-verification-view";
7
- import { useWidgetCodeVerification } from "./useCodeVerification";
8
- import { VERIFICATION_PARENT_NAMESPACE } from "../keys";
9
- export class WidgetCodeVerification {
10
- constructor() {
11
- /**
12
- * @uiName Verify code widget header text
13
- */
14
- this.verifyCodeHeaderText = "Enter the code sent to {email} from our referral provider, impact.com.";
15
- /**
16
- * @uiName Reverify code widget header text
17
- */
18
- this.reverifyCodeHeaderText = "Enter the code sent to {email} from our referral provider, impact.com.";
19
- /**
20
- * Text displayed under verify button
21
- * @uiName Resend code text
22
- */
23
- this.resendCodeText = "Didn't receive your code? {resendCodeLink}";
24
- /**
25
- * The link that appears in the resend code link
26
- * @uiName Resend code label
27
- */
28
- this.resendCodeLabel = "Resend code";
29
- /**
30
- * Link text displayed under verify button
31
- * @uiName Resend code text
32
- */
33
- this.codeResentSuccessfullyText = "Another code has been sent to {email}";
34
- /**
35
- * Error text displayed under verification input
36
- * @uiName Invalid code text
37
- */
38
- this.invalidCodeText = "Please check your code and try again. If you’re still having trouble, try resending your code.";
39
- /**
40
- * @uiName Verify code button text
41
- */
42
- this.verifyText = "Verify";
43
- /**
44
- * Displayed when the email verification fails due to a network error. The participant can try refreshing the page.
45
- * @uiName Network error message
46
- */
47
- this.networkErrorMessage = "An error occurred while verifying your email. Please refresh the page and try again.";
48
- withHooks(this);
49
- }
50
- disconnectedCallback() { }
51
- getTextProps() {
52
- return getProps(this);
53
- }
54
- render() {
55
- const props = isDemo()
56
- ? useDemoWidgetCodeVerification(this)
57
- : useWidgetCodeVerification(this);
58
- return h(WidgetCodeVerificationView, Object.assign({}, props));
59
- }
60
- static get is() { return "sqm-code-verification"; }
61
- static get encapsulation() { return "shadow"; }
62
- static get properties() { return {
63
- "verifyCodeHeaderText": {
64
- "type": "string",
65
- "mutable": false,
66
- "complexType": {
67
- "original": "string",
68
- "resolved": "string",
69
- "references": {}
70
- },
71
- "required": false,
72
- "optional": false,
73
- "docs": {
74
- "tags": [{
75
- "text": "Verify code widget header text",
76
- "name": "uiName"
77
- }],
78
- "text": ""
79
- },
80
- "attribute": "verify-code-header-text",
81
- "reflect": false,
82
- "defaultValue": "\"Enter the code sent to {email} from our referral provider, impact.com.\""
83
- },
84
- "reverifyCodeHeaderText": {
85
- "type": "string",
86
- "mutable": false,
87
- "complexType": {
88
- "original": "string",
89
- "resolved": "string",
90
- "references": {}
91
- },
92
- "required": false,
93
- "optional": false,
94
- "docs": {
95
- "tags": [{
96
- "text": "Reverify code widget header text",
97
- "name": "uiName"
98
- }],
99
- "text": ""
100
- },
101
- "attribute": "reverify-code-header-text",
102
- "reflect": false,
103
- "defaultValue": "\"Enter the code sent to {email} from our referral provider, impact.com.\""
104
- },
105
- "resendCodeText": {
106
- "type": "string",
107
- "mutable": false,
108
- "complexType": {
109
- "original": "string",
110
- "resolved": "string",
111
- "references": {}
112
- },
113
- "required": false,
114
- "optional": false,
115
- "docs": {
116
- "tags": [{
117
- "text": "Resend code text",
118
- "name": "uiName"
119
- }],
120
- "text": "Text displayed under verify button"
121
- },
122
- "attribute": "resend-code-text",
123
- "reflect": false,
124
- "defaultValue": "\"Didn't receive your code? {resendCodeLink}\""
125
- },
126
- "resendCodeLabel": {
127
- "type": "string",
128
- "mutable": false,
129
- "complexType": {
130
- "original": "string",
131
- "resolved": "string",
132
- "references": {}
133
- },
134
- "required": false,
135
- "optional": false,
136
- "docs": {
137
- "tags": [{
138
- "text": "Resend code label",
139
- "name": "uiName"
140
- }],
141
- "text": "The link that appears in the resend code link"
142
- },
143
- "attribute": "resend-code-label",
144
- "reflect": false,
145
- "defaultValue": "\"Resend code\""
146
- },
147
- "codeResentSuccessfullyText": {
148
- "type": "string",
149
- "mutable": false,
150
- "complexType": {
151
- "original": "string",
152
- "resolved": "string",
153
- "references": {}
154
- },
155
- "required": false,
156
- "optional": false,
157
- "docs": {
158
- "tags": [{
159
- "text": "Resend code text",
160
- "name": "uiName"
161
- }],
162
- "text": "Link text displayed under verify button"
163
- },
164
- "attribute": "code-resent-successfully-text",
165
- "reflect": false,
166
- "defaultValue": "\"Another code has been sent to {email}\""
167
- },
168
- "invalidCodeText": {
169
- "type": "string",
170
- "mutable": false,
171
- "complexType": {
172
- "original": "string",
173
- "resolved": "string",
174
- "references": {}
175
- },
176
- "required": false,
177
- "optional": false,
178
- "docs": {
179
- "tags": [{
180
- "text": "Invalid code text",
181
- "name": "uiName"
182
- }],
183
- "text": "Error text displayed under verification input"
184
- },
185
- "attribute": "invalid-code-text",
186
- "reflect": false,
187
- "defaultValue": "\"Please check your code and try again. If you\u2019re still having trouble, try resending your code.\""
188
- },
189
- "verifyText": {
190
- "type": "string",
191
- "mutable": false,
192
- "complexType": {
193
- "original": "string",
194
- "resolved": "string",
195
- "references": {}
196
- },
197
- "required": false,
198
- "optional": false,
199
- "docs": {
200
- "tags": [{
201
- "text": "Verify code button text",
202
- "name": "uiName"
203
- }],
204
- "text": ""
205
- },
206
- "attribute": "verify-text",
207
- "reflect": false,
208
- "defaultValue": "\"Verify\""
209
- },
210
- "networkErrorMessage": {
211
- "type": "string",
212
- "mutable": false,
213
- "complexType": {
214
- "original": "string",
215
- "resolved": "string",
216
- "references": {}
217
- },
218
- "required": false,
219
- "optional": false,
220
- "docs": {
221
- "tags": [{
222
- "text": "Network error message",
223
- "name": "uiName"
224
- }],
225
- "text": "Displayed when the email verification fails due to a network error. The participant can try refreshing the page."
226
- },
227
- "attribute": "network-error-message",
228
- "reflect": false,
229
- "defaultValue": "\"An error occurred while verifying your email. Please refresh the page and try again.\""
230
- },
231
- "demoData": {
232
- "type": "unknown",
233
- "mutable": false,
234
- "complexType": {
235
- "original": "DemoData<WidgetCodeVerificationViewProps>",
236
- "resolved": "{ states?: { initialiseLoading: boolean; loading: boolean; email: string; verifyFailed?: boolean; emailResent: boolean; }; refs?: { codeWrapperRef: any; }; }",
237
- "references": {
238
- "DemoData": {
239
- "location": "import",
240
- "path": "../../../global/demo"
241
- },
242
- "WidgetCodeVerificationViewProps": {
243
- "location": "import",
244
- "path": "./sqm-code-verification-view"
245
- }
246
- }
247
- },
248
- "required": false,
249
- "optional": true,
250
- "docs": {
251
- "tags": [{
252
- "text": undefined,
253
- "name": "undocumented"
254
- }, {
255
- "text": "object",
256
- "name": "uiType"
257
- }],
258
- "text": ""
259
- }
260
- },
261
- "onVerification": {
262
- "type": "unknown",
263
- "mutable": false,
264
- "complexType": {
265
- "original": "(token: string) => any",
266
- "resolved": "(token: string) => any",
267
- "references": {}
268
- },
269
- "required": false,
270
- "optional": true,
271
- "docs": {
272
- "tags": [{
273
- "text": undefined,
274
- "name": "undocumented"
275
- }],
276
- "text": ""
277
- }
278
- }
279
- }; }
280
- }
281
- function useDemoWidgetCodeVerification(props) {
282
- const [emailResent, setEmailResent] = useState(false);
283
- const setVerifiedContext = useSetParent(VERIFICATION_PARENT_NAMESPACE);
284
- return deepmerge({
285
- states: {
286
- loading: false,
287
- email: "test@example.com",
288
- emailResent,
289
- resendError: true,
290
- verifyFailed: true,
291
- },
292
- refs: {
293
- codeWrapperRef: () => { },
294
- },
295
- callbacks: {
296
- resendEmail: async () => setEmailResent(true),
297
- submitCode: async () => setVerifiedContext(true),
298
- },
299
- text: props.getTextProps(),
300
- }, props.demoData || {}, { arrayMerge: (_, a) => a });
301
- }