@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,165 +0,0 @@
1
- import { useLazyQuery, useMutation, useUserIdentity, } from "@saasquatch/component-boilerplate";
2
- import { useEffect, useState } from "@saasquatch/universal-hooks";
3
- import { gql } from "graphql-request";
4
- const UserLookupQuery = gql `
5
- query userLookup {
6
- viewer {
7
- ... on User {
8
- id
9
- accountId
10
- email
11
- impactConnection {
12
- user {
13
- id
14
- email
15
- }
16
- }
17
- }
18
- }
19
- }
20
- `;
21
- const ParticipantVerificationEmailMutation = gql `
22
- mutation requestUserEmailVerification($user: UserIdInput!) {
23
- requestUserEmailVerification(user: $user) {
24
- success
25
- }
26
- }
27
- `;
28
- const ImpactVerificationEmailMutation = gql `
29
- mutation requestImpactPublisherEmail2FA($user: UserIdInput!) {
30
- requestImpactPublisherEmail2FA(user: $user) {
31
- success
32
- }
33
- }
34
- `;
35
- const VerifyUserEmailMutation = gql `
36
- mutation verifyUserEmail($user: UserIdInput!, $code: String!) {
37
- verifyUserEmail(user: $user, code: $code) {
38
- id
39
- accountId
40
- email
41
- emailVerified
42
- }
43
- }
44
- `;
45
- const SubmitImpactCodeMutation = gql `
46
- mutation submitImpactPublisherEmail2FACode(
47
- $user: UserIdInput!
48
- $code: String!
49
- ) {
50
- submitImpactPublisherEmail2FACode(user: $user, code: $code) {
51
- verifiedEmail
52
- accessKey
53
- }
54
- }
55
- `;
56
- // ! It's important when using this hook to ensure initialisation
57
- // ! is done before calling any mutations
58
- export function useVerificationEmail() {
59
- const userIdentity = useUserIdentity();
60
- const [hasEmails, setHasEmails] = useState({
61
- participant: false,
62
- impact: false,
63
- });
64
- const [fetch] = useLazyQuery(UserLookupQuery);
65
- // Send mutations
66
- const [sendParticipantEmail, { loading: participantEmailLoading, errors: participantEmailErrors },] = useMutation(ParticipantVerificationEmailMutation);
67
- const [sendImpactEmail, { loading: impactEmailLoading, errors: impactEmailErrors },] = useMutation(ImpactVerificationEmailMutation);
68
- const sendLoading = participantEmailLoading || impactEmailLoading;
69
- const sendErrors = participantEmailErrors || impactEmailErrors;
70
- // Verification mutations
71
- const [verifyUserEmail, { loading: verifyMutationLoading, errors: verifyMutationErrors },] = useMutation(VerifyUserEmailMutation);
72
- const [submitImpactCode, { loading: submitImpactCodeLoading, errors: submitImpactCodeErrors },] = useMutation(SubmitImpactCodeMutation);
73
- const verifyLoading = verifyMutationLoading || submitImpactCodeLoading;
74
- const verifyErrors = verifyMutationErrors || submitImpactCodeErrors;
75
- const [initialized, setInitialized] = useState(false);
76
- const initialise = async () => {
77
- var _a, _b, _c, _d;
78
- try {
79
- const lookup = await fetch({});
80
- if (!lookup || lookup instanceof Error)
81
- throw new Error();
82
- setHasEmails({
83
- participant: !!((_a = lookup === null || lookup === void 0 ? void 0 : lookup.viewer) === null || _a === void 0 ? void 0 : _a.email),
84
- impact: !!((_d = (_c = (_b = lookup === null || lookup === void 0 ? void 0 : lookup.viewer) === null || _b === void 0 ? void 0 : _b.impactConnection) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.email),
85
- });
86
- setInitialized(true);
87
- }
88
- catch (e) {
89
- console.error("Could not initialise verification", e);
90
- }
91
- };
92
- const sendVerificationEmail = async () => {
93
- let result = null;
94
- if (!initialized)
95
- return result;
96
- if (!hasEmails.participant && !hasEmails.impact)
97
- return result;
98
- try {
99
- const request = hasEmails.impact ? sendImpactEmail : sendParticipantEmail;
100
- const res = await request({
101
- user: {
102
- id: userIdentity.id,
103
- accountId: userIdentity.accountId,
104
- },
105
- });
106
- if (res instanceof Error || !res)
107
- throw new Error();
108
- result = hasEmails.impact
109
- ? res.requestImpactPublisherEmail2FA
110
- : res.requestUserEmailVerification;
111
- }
112
- catch (e) {
113
- console.error("Could not send verification email", e);
114
- }
115
- finally {
116
- return result;
117
- }
118
- };
119
- const verifyVerificationEmail = async (code) => {
120
- var _a;
121
- let result = null;
122
- if (!initialized)
123
- return result;
124
- if (!hasEmails.participant && !hasEmails.impact)
125
- return result;
126
- try {
127
- const request = hasEmails.impact ? submitImpactCode : verifyUserEmail;
128
- const res = await request({
129
- user: {
130
- id: userIdentity.id,
131
- accountId: userIdentity.accountId,
132
- },
133
- code,
134
- });
135
- if (res instanceof Error || !res)
136
- throw new Error();
137
- result = {
138
- success: true,
139
- accessKey: hasEmails.impact
140
- ? (_a = res.submitImpactPublisherEmail2FACode) === null || _a === void 0 ? void 0 : _a.accessKey : undefined,
141
- };
142
- }
143
- catch (e) {
144
- console.error("Could not verify email", e);
145
- }
146
- finally {
147
- return result;
148
- }
149
- };
150
- useEffect(() => {
151
- if (!initialized)
152
- initialise();
153
- }, []);
154
- return {
155
- initialized,
156
- send: [
157
- sendVerificationEmail,
158
- { loading: sendLoading, errors: sendErrors },
159
- ],
160
- verify: [
161
- verifyVerificationEmail,
162
- { loading: verifyLoading, errors: verifyErrors },
163
- ],
164
- };
165
- }
@@ -1,22 +0,0 @@
1
- import { h } from "@stencil/core";
2
- export default {
3
- title: "Components/Payout Status Alert",
4
- };
5
- const defaultProps = {
6
- error: false,
7
- status: "INFORMATION_REQUIRED",
8
- loading: false,
9
- showVerifyIdentity: false,
10
- };
11
- export const InformationRequired = () => (h("sqm-payout-status-alert", { demoData: { states: defaultProps } }));
12
- export const VerifyIdentity = () => (h("sqm-payout-status-alert", { demoData: { states: { ...defaultProps, status: "VERIFICATION_NEEDED" } } }));
13
- export const VerifyIdentityOpen = () => (h("sqm-payout-status-alert", { demoData: {
14
- states: {
15
- ...defaultProps,
16
- status: "VERIFICATION_NEEDED",
17
- showVerifyIdentity: true,
18
- },
19
- } }));
20
- export const Hold = () => (h("sqm-payout-status-alert", { demoData: { states: { ...defaultProps, status: "HOLD" } } }));
21
- export const Loading = () => (h("sqm-payout-status-alert", { demoData: { states: { ...defaultProps, loading: true } } }));
22
- export const Error = () => (h("sqm-payout-status-alert", { demoData: { states: { ...defaultProps, error: true } } }));
@@ -1,131 +0,0 @@
1
- import { h } from "@stencil/core";
2
- import { createStyleSheet } from "../../../styling/JSS";
3
- const style = {
4
- SkeletonOne: {
5
- width: "50%",
6
- height: "16px",
7
- },
8
- AlertDescriptionText: {
9
- margin: "0",
10
- marginBottom: "var(--sl-spacing-small)",
11
- },
12
- ErrorAlertContainer: {
13
- "&::part(base)": {
14
- backgroundColor: "var(--sl-color-red-100)",
15
- borderTop: "none",
16
- },
17
- "& sl-icon::part(base)": {
18
- color: "var(--sl-color-danger-500)",
19
- },
20
- },
21
- WarningAlertContainer: {
22
- "&::part(base)": {
23
- backgroundColor: "var(--sl-color-yellow-100)",
24
- borderTop: "none",
25
- },
26
- "& sl-icon::part(base)": {
27
- color: "var(--sl-color-danger-500)",
28
- },
29
- },
30
- InfoAlertContainer: {
31
- "&::part(base)": {
32
- backgroundColor: "var(--sl-color-sky-100)",
33
- borderTop: "none",
34
- },
35
- "& sl-icon::part(base)": {
36
- color: "var(--sl-color-blue-500)",
37
- },
38
- },
39
- Dialog: {
40
- "&::part(panel)": {
41
- height: "600px",
42
- },
43
- "&::part(close-button)": {
44
- marginBottom: "var(--sl-spacing-xx-large)",
45
- },
46
- "&::part(title)": {
47
- display: "none",
48
- },
49
- "&::part(header)": {},
50
- "&::part(body)": { padding: "0" },
51
- "&::part(footer)": {},
52
- },
53
- };
54
- const sheet = createStyleSheet(style);
55
- const styleString = sheet.toString();
56
- export function PayoutStatusAlertView(props) {
57
- var _a, _b, _c, _d, _e;
58
- const { text, states, data, callbacks } = props;
59
- if (states.loading) {
60
- return h("sl-skeleton", { class: sheet.classes.SkeletonOne });
61
- }
62
- if (states.status === "DONE") {
63
- return h("div", null);
64
- }
65
- function getAlert(status) {
66
- if (states.error)
67
- return {
68
- header: text.errorHeader,
69
- description: text.errorDescription,
70
- buttonText: null,
71
- alertType: "critical",
72
- icon: "exclamation-triangle",
73
- class: sheet.classes.ErrorAlertContainer,
74
- };
75
- switch (status) {
76
- case "INFORMATION_REQUIRED":
77
- return {
78
- header: text.informationRequiredHeader,
79
- description: text.informationRequiredDescription,
80
- buttonText: text.informationRequiredButtonText,
81
- alertType: "info",
82
- icon: "info-circle",
83
- class: sheet.classes.InfoAlertContainer,
84
- };
85
- case "VERIFICATION_NEEDED":
86
- return {
87
- header: text.verificationRequiredHeader,
88
- description: text.verificationRequiredDescription,
89
- buttonText: text.verificationRequiredButtonText,
90
- alertType: "warning",
91
- icon: "exclamation-triangle",
92
- class: sheet.classes.WarningAlertContainer,
93
- };
94
- case "HOLD":
95
- return {
96
- header: text.holdHeader,
97
- description: text.holdDescription,
98
- buttonText: null,
99
- alertType: "warning",
100
- icon: "exclamation-triangle",
101
- class: sheet.classes.WarningAlertContainer,
102
- };
103
- default:
104
- return;
105
- }
106
- }
107
- //AL: TODO hookup ID
108
- function getButton(status) {
109
- switch (status) {
110
- case "INFORMATION_REQUIRED":
111
- return data.type === "SquatchJS2" ? (h("sqm-scroll", { "scroll-tag-name": "sqm-tabs", "button-text": text.informationRequiredButtonText, "scroll-animation": "smooth" })) : data.type === "SquatchPortal" ? (h("sl-button", { type: "default", onClick: callbacks.onTermsClick }, text.informationRequiredButtonText)) : (h("sl-button", { type: "default" }, text.informationRequiredButtonText));
112
- case "VERIFICATION_NEEDED":
113
- return (h("sl-button", { type: "default", loading: states.loading,
114
- //AL: TODO callback to open verification form
115
- onClick: () => callbacks.onClick }, text.verificationRequiredButtonText));
116
- default:
117
- return;
118
- }
119
- }
120
- return (h("div", { part: "sqm-base" },
121
- h("style", { type: "text/css" }, styleString),
122
- h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: (_a = getAlert(states.status)) === null || _a === void 0 ? void 0 : _a.alertType, class: (_b = getAlert(states.status)) === null || _b === void 0 ? void 0 : _b.class, open: true },
123
- h("sl-icon", { slot: "icon", name: (_c = getAlert(states.status)) === null || _c === void 0 ? void 0 : _c.icon }),
124
- h("strong", null, (_d = getAlert(states.status)) === null || _d === void 0 ? void 0 : _d.header),
125
- h("p", { class: sheet.classes.AlertDescriptionText }, (_e = getAlert(states.status)) === null || _e === void 0 ? void 0 : _e.description),
126
- getButton(states.status)),
127
- h("sl-dialog", { noDismiss: true, class: sheet.classes.Dialog, open: states.showVerifyIdentity, "onSl-hide": callbacks.onCancel },
128
- h("iframe", {
129
- // AL: TODO replace iframe URL with verification url when available
130
- scrolling: "yes", frameBorder: "0", width: "100%", height: "100%", src: "https://impacttech.complytaxforms.com/ServiceRedirect.aspx?Language=eng&Param1=UxBORV4bOIrqNb4gbpNmtvW3wjdZJyx4gPElIGMJNR8=&UUID=B576EA3E-80FD-4D85-AA59-653D23A7CCE8" }))));
131
- }
@@ -1,354 +0,0 @@
1
- import { withHooks } from "@saasquatch/stencil-hooks";
2
- import { Component, h, Prop } from "@stencil/core";
3
- import deepmerge from "deepmerge";
4
- import { getProps } from "../../../utils/utils";
5
- import { PayoutStatusAlertView, } from "./sqm-payout-status-alert-view";
6
- import { usePayoutStatus } from "./usePayoutStatus";
7
- import { isDemo } from "@saasquatch/component-boilerplate";
8
- /**
9
- * @uiName Payout Status Alert
10
- * @exampleGroup Tax and Cash
11
- * @example Payout Status Alert - <sqm-payout-status-alert></sqm-payout-status-alert>
12
- */
13
- export class PayoutStatusAlert {
14
- constructor() {
15
- /**
16
- * @uiName Info required alert header
17
- */
18
- this.informationRequiredHeader = "Payout and tax information required";
19
- /**
20
- * @uiName Info required alert description
21
- */
22
- this.informationRequiredDescription = "Submit your banking details and tax documents to receive your rewards.";
23
- /**
24
- * @uiName Info required alert button text
25
- */
26
- this.informationRequiredButtonText = "Payouts & Tax Settings";
27
- /**
28
- * @uiName Verification required alert header
29
- */
30
- this.verificationRequiredHeader = "Verify your identity";
31
- /**
32
- * @uiName Verification required alert description
33
- */
34
- this.verificationRequiredDescription = "Complete your verification to start receiving your cash rewards. It should only take a few minutes verify.";
35
- /**
36
- * @uiName Verification required alert button text
37
- */
38
- this.verificationRequiredButtonText = "Start Verification";
39
- /**
40
- * @uiName Payout on hold alert header
41
- */
42
- this.holdHeader = "Your payouts and account are on hold";
43
- /**
44
- * @uiName Payout on hold alert description
45
- */
46
- this.holdDescription = "Please check your inbox for an email from our referral provider, impact.com. It contains details on how to resolve this issue. If you need further assistance, feel free to reach out to {support email}.";
47
- /**
48
- * @uiName Cash & Payouts Terms and Conditions url
49
- */
50
- this.termsUrl = "https://terms.advocate.impact.com/PayoutTermsAndConditions.html";
51
- /**
52
- * @uiName Error header
53
- */
54
- this.errorHeader = "Could not determine payout status.";
55
- /**
56
- * @uiName Error description
57
- */
58
- this.errorDescription = "There was an error with determining your payout status.";
59
- withHooks(this);
60
- }
61
- disconnectedCallback() { }
62
- getTextProps() {
63
- return getProps(this);
64
- }
65
- render() {
66
- const props = isDemo()
67
- ? useDemoPayoutStatusAlert(this)
68
- : usePayoutStatus(this);
69
- console.log({ props });
70
- return h(PayoutStatusAlertView, Object.assign({}, props));
71
- }
72
- static get is() { return "sqm-payout-status-alert"; }
73
- static get encapsulation() { return "shadow"; }
74
- static get properties() { return {
75
- "informationRequiredHeader": {
76
- "type": "string",
77
- "mutable": false,
78
- "complexType": {
79
- "original": "string",
80
- "resolved": "string",
81
- "references": {}
82
- },
83
- "required": false,
84
- "optional": false,
85
- "docs": {
86
- "tags": [{
87
- "text": "Info required alert header",
88
- "name": "uiName"
89
- }],
90
- "text": ""
91
- },
92
- "attribute": "information-required-header",
93
- "reflect": false,
94
- "defaultValue": "\"Payout and tax information required\""
95
- },
96
- "informationRequiredDescription": {
97
- "type": "string",
98
- "mutable": false,
99
- "complexType": {
100
- "original": "string",
101
- "resolved": "string",
102
- "references": {}
103
- },
104
- "required": false,
105
- "optional": false,
106
- "docs": {
107
- "tags": [{
108
- "text": "Info required alert description",
109
- "name": "uiName"
110
- }],
111
- "text": ""
112
- },
113
- "attribute": "information-required-description",
114
- "reflect": false,
115
- "defaultValue": "\"Submit your banking details and tax documents to receive your rewards.\""
116
- },
117
- "informationRequiredButtonText": {
118
- "type": "string",
119
- "mutable": false,
120
- "complexType": {
121
- "original": "string",
122
- "resolved": "string",
123
- "references": {}
124
- },
125
- "required": false,
126
- "optional": false,
127
- "docs": {
128
- "tags": [{
129
- "text": "Info required alert button text",
130
- "name": "uiName"
131
- }],
132
- "text": ""
133
- },
134
- "attribute": "information-required-button-text",
135
- "reflect": false,
136
- "defaultValue": "\"Payouts & Tax Settings\""
137
- },
138
- "verificationRequiredHeader": {
139
- "type": "string",
140
- "mutable": false,
141
- "complexType": {
142
- "original": "string",
143
- "resolved": "string",
144
- "references": {}
145
- },
146
- "required": false,
147
- "optional": false,
148
- "docs": {
149
- "tags": [{
150
- "text": "Verification required alert header",
151
- "name": "uiName"
152
- }],
153
- "text": ""
154
- },
155
- "attribute": "verification-required-header",
156
- "reflect": false,
157
- "defaultValue": "\"Verify your identity\""
158
- },
159
- "verificationRequiredDescription": {
160
- "type": "string",
161
- "mutable": false,
162
- "complexType": {
163
- "original": "string",
164
- "resolved": "string",
165
- "references": {}
166
- },
167
- "required": false,
168
- "optional": false,
169
- "docs": {
170
- "tags": [{
171
- "text": "Verification required alert description",
172
- "name": "uiName"
173
- }],
174
- "text": ""
175
- },
176
- "attribute": "verification-required-description",
177
- "reflect": false,
178
- "defaultValue": "\"Complete your verification to start receiving your cash rewards. It should only take a few minutes verify.\""
179
- },
180
- "verificationRequiredButtonText": {
181
- "type": "string",
182
- "mutable": false,
183
- "complexType": {
184
- "original": "string",
185
- "resolved": "string",
186
- "references": {}
187
- },
188
- "required": false,
189
- "optional": false,
190
- "docs": {
191
- "tags": [{
192
- "text": "Verification required alert button text",
193
- "name": "uiName"
194
- }],
195
- "text": ""
196
- },
197
- "attribute": "verification-required-button-text",
198
- "reflect": false,
199
- "defaultValue": "\"Start Verification\""
200
- },
201
- "holdHeader": {
202
- "type": "string",
203
- "mutable": false,
204
- "complexType": {
205
- "original": "string",
206
- "resolved": "string",
207
- "references": {}
208
- },
209
- "required": false,
210
- "optional": false,
211
- "docs": {
212
- "tags": [{
213
- "text": "Payout on hold alert header",
214
- "name": "uiName"
215
- }],
216
- "text": ""
217
- },
218
- "attribute": "hold-header",
219
- "reflect": false,
220
- "defaultValue": "\"Your payouts and account are on hold\""
221
- },
222
- "holdDescription": {
223
- "type": "string",
224
- "mutable": false,
225
- "complexType": {
226
- "original": "string",
227
- "resolved": "string",
228
- "references": {}
229
- },
230
- "required": false,
231
- "optional": false,
232
- "docs": {
233
- "tags": [{
234
- "text": "Payout on hold alert description",
235
- "name": "uiName"
236
- }],
237
- "text": ""
238
- },
239
- "attribute": "hold-description",
240
- "reflect": false,
241
- "defaultValue": "\"Please check your inbox for an email from our referral provider, impact.com. It contains details on how to resolve this issue. If you need further assistance, feel free to reach out to {support email}.\""
242
- },
243
- "termsUrl": {
244
- "type": "string",
245
- "mutable": false,
246
- "complexType": {
247
- "original": "string",
248
- "resolved": "string",
249
- "references": {}
250
- },
251
- "required": false,
252
- "optional": false,
253
- "docs": {
254
- "tags": [{
255
- "text": "Cash & Payouts Terms and Conditions url",
256
- "name": "uiName"
257
- }],
258
- "text": ""
259
- },
260
- "attribute": "terms-url",
261
- "reflect": false,
262
- "defaultValue": "\"https://terms.advocate.impact.com/PayoutTermsAndConditions.html\""
263
- },
264
- "errorHeader": {
265
- "type": "string",
266
- "mutable": false,
267
- "complexType": {
268
- "original": "string",
269
- "resolved": "string",
270
- "references": {}
271
- },
272
- "required": false,
273
- "optional": false,
274
- "docs": {
275
- "tags": [{
276
- "text": "Error header",
277
- "name": "uiName"
278
- }],
279
- "text": ""
280
- },
281
- "attribute": "error-header",
282
- "reflect": false,
283
- "defaultValue": "\"Could not determine payout status.\""
284
- },
285
- "errorDescription": {
286
- "type": "string",
287
- "mutable": false,
288
- "complexType": {
289
- "original": "string",
290
- "resolved": "string",
291
- "references": {}
292
- },
293
- "required": false,
294
- "optional": false,
295
- "docs": {
296
- "tags": [{
297
- "text": "Error description",
298
- "name": "uiName"
299
- }],
300
- "text": ""
301
- },
302
- "attribute": "error-description",
303
- "reflect": false,
304
- "defaultValue": "\"There was an error with determining your payout status.\""
305
- },
306
- "demoData": {
307
- "type": "unknown",
308
- "mutable": false,
309
- "complexType": {
310
- "original": "DemoData<PayoutStatusAlertViewProps>",
311
- "resolved": "{ states?: { error: boolean; loading: boolean; status: PayoutStatus; showVerifyIdentity: boolean; }; data?: { type: \"SquatchJS2\" | \"SquatchAndroid\" | \"SquatchIOS\" | \"SquatchPortal\" | \"SquatchAdmin\" | \"None\"; }; }",
312
- "references": {
313
- "DemoData": {
314
- "location": "import",
315
- "path": "../../../global/demo"
316
- },
317
- "PayoutStatusAlertViewProps": {
318
- "location": "import",
319
- "path": "./sqm-payout-status-alert-view"
320
- }
321
- }
322
- },
323
- "required": false,
324
- "optional": true,
325
- "docs": {
326
- "tags": [{
327
- "text": undefined,
328
- "name": "undocumented"
329
- }, {
330
- "text": "object",
331
- "name": "uiType"
332
- }],
333
- "text": ""
334
- }
335
- }
336
- }; }
337
- }
338
- function useDemoPayoutStatusAlert(props) {
339
- return deepmerge({
340
- states: {
341
- error: false,
342
- status: "INFORMATION_REQUIRED",
343
- loading: false,
344
- showVerifyIdentity: false,
345
- },
346
- data: { type: "SquatchAdmin" },
347
- text: props.getTextProps(),
348
- callbacks: {
349
- onTermsClick: () => { },
350
- onClick: () => console.log("show"),
351
- onCancel: () => console.log("hide"),
352
- },
353
- }, props.demoData || {}, { arrayMerge: (_, a) => a });
354
- }