@saasquatch/mint-components 2.2.0-6 → 2.2.0-8

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 (214) hide show
  1. package/dist/cjs/{ShadowViewAddon-1c054d52.js → ShadowViewAddon-3b477e58.js} +429 -27
  2. package/dist/cjs/{data-c03e282a.js → data-89ac73dd.js} +1 -0
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/mint-components.cjs.js +1 -1
  5. package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +48 -307
  6. package/dist/cjs/sqm-big-stat_46.cjs.entry.js +334 -36
  7. package/dist/cjs/sqm-code-verification.cjs.entry.js +1 -1
  8. package/dist/cjs/sqm-email-verification_2.cjs.entry.js +20 -13
  9. package/dist/cjs/sqm-empty_4.cjs.entry.js +1 -1
  10. package/dist/cjs/{sqm-partner-info-modal-view-97770d03.js → sqm-partner-info-modal-view-f6faecf5.js} +1 -1
  11. package/dist/cjs/{sqm-portal-container-view-70a47420.js → sqm-portal-container-view-757f921b.js} +5 -6
  12. package/dist/cjs/{sqm-portal-email-verification-view-d51c2a06.js → sqm-portal-email-verification-view-abb773a7.js} +1 -1
  13. package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +2 -2
  14. package/dist/cjs/sqm-portal-forgot-password_6.cjs.entry.js +5 -5
  15. package/dist/cjs/{sqm-portal-profile-view-e6927959.js → sqm-portal-profile-view-3515e1e5.js} +1 -1
  16. package/dist/cjs/sqm-portal-profile.cjs.entry.js +2 -2
  17. package/dist/cjs/{sqm-portal-registration-form-view-fd48f1d3.js → sqm-portal-registration-form-view-a45f7a52.js} +1 -1
  18. package/dist/cjs/{sqm-portal-reset-password-view-d90d77f9.js → sqm-portal-reset-password-view-a767b044.js} +1 -1
  19. package/dist/cjs/sqm-portal-reset-password.cjs.entry.js +2 -2
  20. package/dist/cjs/{sqm-portal-verify-email-view-6258dcae.js → sqm-portal-verify-email-view-717d0633.js} +1 -1
  21. package/dist/cjs/sqm-referral-table_11.cjs.entry.js +1 -1
  22. package/dist/cjs/sqm-rewards-table-customer-note-cell.cjs.entry.js +1 -1
  23. package/dist/cjs/sqm-stencilbook.cjs.entry.js +176 -32
  24. package/dist/cjs/{sqm-text-span-view-8a32dd8c.js → sqm-text-span-view-b9e10f5d.js} +1 -1
  25. package/dist/cjs/sqm-text-span.cjs.entry.js +1 -1
  26. package/dist/cjs/{sqm-user-info-form-view-4d56b339.js → sqm-user-info-form-view-0e1ddbe4.js} +3 -388
  27. package/dist/cjs/{usePayoutStatus-0a98ee05.js → useIndirectTaxForm-c3c1ec56.js} +291 -0
  28. package/dist/cjs/utils-a3b3d05b.js +478 -0
  29. package/dist/collection/components/sqm-big-stat/useBigStat.js +5 -6
  30. package/dist/collection/components/sqm-checkbox-field/sqm-checkbox-field-view.js +1 -1
  31. package/dist/collection/components/sqm-checkbox-field/sqm-checkbox-field.js +2 -3
  32. package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal-view.js +1 -1
  33. package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal.js +4 -4
  34. package/dist/collection/components/sqm-partner-info-modal/usePartnerInfoModal.js +15 -8
  35. package/dist/collection/components/sqm-portal-container/sqm-portal-container-view.js +6 -7
  36. package/dist/collection/components/sqm-portal-google-login/sqm-portal-google-login.js +1 -1
  37. package/dist/collection/components/sqm-portal-login/sqm-portal-login.js +1 -1
  38. package/dist/collection/components/sqm-referral-iframe/ReferralIframe.stories.js +1 -0
  39. package/dist/collection/components/sqm-referral-iframe/sqm-referral-iframe-view.js +1 -1
  40. package/dist/collection/components/sqm-referral-iframe/sqm-referral-iframe.js +27 -1
  41. package/dist/collection/components/sqm-share-code/sqm-share-code.js +0 -1
  42. package/dist/collection/components/sqm-share-link/ShareLink.stories.js +136 -11
  43. package/dist/collection/components/sqm-share-link/UseShareLink.stories.js +14 -5
  44. package/dist/collection/components/sqm-share-link/sqm-share-link-view.js +192 -0
  45. package/dist/collection/components/sqm-share-link/sqm-share-link.js +935 -48
  46. package/dist/collection/components/sqm-share-link/useShareLink.js +227 -14
  47. package/dist/collection/components/sqm-text-span/sqm-text-span-view.js +1 -1
  48. package/dist/collection/components/tax-and-cash/data.js +1 -0
  49. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/formDefinitions.js +19 -1
  50. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.js +50 -0
  51. package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/sqm-indirect-tax-form.js +4 -4
  52. package/dist/collection/components/tax-and-cash/sqm-payout-details-card/sqm-payout-details-card.js +2 -2
  53. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.js +65 -7
  54. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.js +49 -3
  55. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +2 -2
  56. package/dist/esm/{ShadowViewAddon-4d554869.js → ShadowViewAddon-e115fa1c.js} +431 -30
  57. package/dist/esm/{data-017e5ef2.js → data-8698cbc6.js} +1 -0
  58. package/dist/esm/loader.js +1 -1
  59. package/dist/esm/mint-components.js +1 -1
  60. package/dist/esm/sqm-banking-info-form_10.entry.js +36 -295
  61. package/dist/esm/sqm-big-stat_46.entry.js +333 -35
  62. package/dist/esm/sqm-code-verification.entry.js +1 -1
  63. package/dist/esm/sqm-email-verification_2.entry.js +20 -13
  64. package/dist/esm/sqm-empty_4.entry.js +1 -1
  65. package/dist/esm/{sqm-partner-info-modal-view-5709904e.js → sqm-partner-info-modal-view-d6f3a215.js} +1 -1
  66. package/dist/esm/{sqm-portal-container-view-a8c708cd.js → sqm-portal-container-view-200c9df8.js} +6 -7
  67. package/dist/esm/{sqm-portal-email-verification-view-58bad294.js → sqm-portal-email-verification-view-fde1eb35.js} +1 -1
  68. package/dist/esm/sqm-portal-email-verification.entry.js +2 -2
  69. package/dist/esm/sqm-portal-forgot-password_6.entry.js +5 -5
  70. package/dist/esm/{sqm-portal-profile-view-115bad4a.js → sqm-portal-profile-view-2018590a.js} +1 -1
  71. package/dist/esm/sqm-portal-profile.entry.js +2 -2
  72. package/dist/esm/{sqm-portal-registration-form-view-9bf30b56.js → sqm-portal-registration-form-view-79265df5.js} +1 -1
  73. package/dist/esm/{sqm-portal-reset-password-view-f8d1689c.js → sqm-portal-reset-password-view-f84c04cf.js} +1 -1
  74. package/dist/esm/sqm-portal-reset-password.entry.js +2 -2
  75. package/dist/esm/{sqm-portal-verify-email-view-c053ead1.js → sqm-portal-verify-email-view-590f964b.js} +1 -1
  76. package/dist/esm/sqm-referral-table_11.entry.js +1 -1
  77. package/dist/esm/sqm-rewards-table-customer-note-cell.entry.js +1 -1
  78. package/dist/esm/sqm-stencilbook.entry.js +174 -30
  79. package/dist/esm/{sqm-text-span-view-4db9e33f.js → sqm-text-span-view-72f43dff.js} +1 -1
  80. package/dist/esm/sqm-text-span.entry.js +1 -1
  81. package/dist/esm/{sqm-user-info-form-view-d13f9d3e.js → sqm-user-info-form-view-e1ba6009.js} +3 -385
  82. package/dist/esm/{usePayoutStatus-227ae365.js → useIndirectTaxForm-b2888ea5.js} +291 -3
  83. package/dist/esm/utils-4f5cd04c.js +467 -0
  84. package/dist/esm-es5/ShadowViewAddon-e115fa1c.js +1 -0
  85. package/dist/esm-es5/data-8698cbc6.js +1 -0
  86. package/dist/esm-es5/loader.js +1 -1
  87. package/dist/esm-es5/mint-components.js +1 -1
  88. package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
  89. package/dist/esm-es5/sqm-big-stat_46.entry.js +1 -1
  90. package/dist/esm-es5/sqm-code-verification.entry.js +1 -1
  91. package/dist/esm-es5/sqm-email-verification_2.entry.js +1 -1
  92. package/dist/esm-es5/sqm-empty_4.entry.js +1 -1
  93. package/dist/esm-es5/{sqm-partner-info-modal-view-5709904e.js → sqm-partner-info-modal-view-d6f3a215.js} +1 -1
  94. package/dist/esm-es5/sqm-portal-container-view-200c9df8.js +1 -0
  95. package/dist/esm-es5/{sqm-portal-email-verification-view-58bad294.js → sqm-portal-email-verification-view-fde1eb35.js} +1 -1
  96. package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
  97. package/dist/esm-es5/sqm-portal-forgot-password_6.entry.js +1 -1
  98. package/dist/esm-es5/{sqm-portal-profile-view-115bad4a.js → sqm-portal-profile-view-2018590a.js} +1 -1
  99. package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
  100. package/dist/esm-es5/{sqm-portal-registration-form-view-9bf30b56.js → sqm-portal-registration-form-view-79265df5.js} +1 -1
  101. package/dist/esm-es5/{sqm-portal-reset-password-view-f8d1689c.js → sqm-portal-reset-password-view-f84c04cf.js} +1 -1
  102. package/dist/esm-es5/sqm-portal-reset-password.entry.js +1 -1
  103. package/dist/esm-es5/{sqm-portal-verify-email-view-c053ead1.js → sqm-portal-verify-email-view-590f964b.js} +1 -1
  104. package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
  105. package/dist/esm-es5/sqm-rewards-table-customer-note-cell.entry.js +1 -1
  106. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  107. package/dist/esm-es5/{sqm-text-span-view-4db9e33f.js → sqm-text-span-view-72f43dff.js} +1 -1
  108. package/dist/esm-es5/sqm-text-span.entry.js +1 -1
  109. package/dist/esm-es5/sqm-user-info-form-view-e1ba6009.js +1 -0
  110. package/dist/esm-es5/useIndirectTaxForm-b2888ea5.js +6 -0
  111. package/dist/esm-es5/utils-4f5cd04c.js +1 -0
  112. package/dist/mint-components/mint-components.esm.js +1 -1
  113. package/dist/mint-components/{p-4034f157.js → p-0afa6148.js} +1 -1
  114. package/dist/mint-components/p-0b1e90fe.system.js +1 -0
  115. package/dist/mint-components/{p-731c4d33.entry.js → p-13d1b10d.entry.js} +1 -1
  116. package/dist/mint-components/{p-b1b20d42.entry.js → p-1d398dbc.entry.js} +1 -1
  117. package/dist/mint-components/p-1e6a2945.js +1 -0
  118. package/dist/mint-components/p-1efb42e2.js +499 -0
  119. package/dist/mint-components/p-1f387c7b.system.js +1 -1
  120. package/dist/mint-components/{p-d6ccb6fc.entry.js → p-2ed13619.entry.js} +1 -1
  121. package/dist/mint-components/{p-b1765c78.system.js → p-31815fb6.system.js} +1 -1
  122. package/dist/mint-components/p-335a5736.entry.js +1 -0
  123. package/dist/mint-components/{p-dbc8afaa.system.entry.js → p-33ca28ba.system.entry.js} +1 -1
  124. package/dist/mint-components/{p-0f042aa6.entry.js → p-3596e241.entry.js} +2 -2
  125. package/dist/mint-components/{p-1faa6ddf.system.entry.js → p-37e24621.system.entry.js} +1 -1
  126. package/dist/mint-components/{p-dafe30c3.entry.js → p-4d73a616.entry.js} +1 -1
  127. package/dist/mint-components/{p-9ba8b28b.system.entry.js → p-51ae6716.system.entry.js} +1 -1
  128. package/dist/mint-components/p-58c24352.system.js +6 -0
  129. package/dist/mint-components/{p-00046ec1.js → p-5c52100b.js} +1 -0
  130. package/dist/mint-components/{p-f368f04a.system.js → p-686dd5eb.system.js} +1 -1
  131. package/dist/mint-components/{p-379cb9f1.system.js → p-7562cd98.system.js} +1 -1
  132. package/dist/mint-components/{p-bd972473.system.js → p-7628e56f.system.js} +1 -1
  133. package/dist/mint-components/{p-d71a8b38.entry.js → p-7cbdf341.entry.js} +2 -2
  134. package/dist/mint-components/p-7d2d9ef9.system.js +1 -0
  135. package/dist/mint-components/{p-8d073bdf.entry.js → p-84495fb8.entry.js} +1 -1
  136. package/dist/mint-components/{p-cfba6b4e.system.entry.js → p-86d20b47.system.entry.js} +1 -1
  137. package/dist/mint-components/{p-71561bb2.system.entry.js → p-8899ff38.system.entry.js} +1 -1
  138. package/dist/mint-components/p-9674856e.entry.js +9 -0
  139. package/dist/mint-components/p-9c1f5317.system.js +1 -0
  140. package/dist/mint-components/p-9f48640d.js +1 -0
  141. package/dist/mint-components/{p-df88dcaa.system.js → p-a4825ec2.system.js} +1 -1
  142. package/dist/mint-components/p-a88b8165.system.entry.js +1 -0
  143. package/dist/mint-components/p-abe9f5b1.js +99 -0
  144. package/dist/mint-components/{p-31edeff4.system.js → p-ae2f610e.system.js} +1 -1
  145. package/dist/mint-components/p-b222bace.system.entry.js +1 -0
  146. package/dist/mint-components/{p-45e2a83a.js → p-b3ad957c.js} +1 -1
  147. package/dist/mint-components/{p-2ab31786.js → p-b871d158.js} +1 -1
  148. package/dist/mint-components/p-b96ed8eb.js +1 -0
  149. package/dist/mint-components/p-bbd41807.entry.js +291 -0
  150. package/dist/mint-components/{p-9b15ee47.system.js → p-be6a0dee.system.js} +1 -1
  151. package/dist/mint-components/{p-a7f72a66.js → p-bee4af5d.js} +1 -1
  152. package/dist/mint-components/{p-0102ad17.system.entry.js → p-c0f8f977.system.entry.js} +1 -1
  153. package/dist/mint-components/{p-50d959bd.js → p-c813ec64.js} +1 -1
  154. package/dist/mint-components/p-cdabd9de.system.js +1 -0
  155. package/dist/mint-components/{p-e516e8ca.system.entry.js → p-cfc35705.system.entry.js} +1 -1
  156. package/dist/mint-components/p-d2ede7cd.system.entry.js +1 -0
  157. package/dist/mint-components/{p-e1292288.system.entry.js → p-d3b1ab20.system.entry.js} +1 -1
  158. package/dist/mint-components/p-db6bf7cf.system.entry.js +1 -0
  159. package/dist/mint-components/p-e30abc44.js +1 -0
  160. package/dist/mint-components/{p-3218bb1d.entry.js → p-e506bf7f.entry.js} +1 -1
  161. package/dist/mint-components/{p-ae4994e1.js → p-e8e7af06.js} +1 -1
  162. package/dist/mint-components/p-ebc519bc.system.js +1 -0
  163. package/dist/mint-components/{p-eee0bcf4.entry.js → p-ef32fa8f.entry.js} +1 -1
  164. package/dist/mint-components/{p-ca5b9f4d.system.entry.js → p-fa85ea51.system.entry.js} +1 -1
  165. package/dist/mint-components/p-ffcebe78.entry.js +83 -0
  166. package/dist/types/components/sqm-checkbox-field/sqm-checkbox-field.d.ts +1 -1
  167. package/dist/types/components/sqm-referral-iframe/sqm-referral-iframe-view.d.ts +1 -0
  168. package/dist/types/components/sqm-referral-iframe/sqm-referral-iframe.d.ts +5 -0
  169. package/dist/types/components/sqm-share-link/ShareLink.stories.d.ts +9 -0
  170. package/dist/types/components/sqm-share-link/UseShareLink.stories.d.ts +6 -0
  171. package/dist/types/components/sqm-share-link/sqm-share-link-view.d.ts +41 -0
  172. package/dist/types/components/sqm-share-link/sqm-share-link.d.ts +195 -2
  173. package/dist/types/components/sqm-share-link/useShareLink.d.ts +33 -4
  174. package/dist/types/components/tax-and-cash/data.d.ts +2 -0
  175. package/dist/types/components/tax-and-cash/sqm-banking-info-form/formDefinitions.d.ts +6 -0
  176. package/dist/types/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.d.ts +8 -0
  177. package/dist/types/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.d.ts +2 -0
  178. package/dist/types/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.d.ts +10 -0
  179. package/dist/types/components.d.ts +397 -4
  180. package/docs/docs.docx +0 -0
  181. package/docs/raisins.json +1 -1
  182. package/grapesjs/grapesjs.js +1 -1
  183. package/package.json +1 -1
  184. package/readme.md +60 -1
  185. package/shoelace/assets/icons/twitter-x.svg +4 -0
  186. package/dist/cjs/utils-15ce04e3.js +0 -93
  187. package/dist/esm/utils-17daa419.js +0 -85
  188. package/dist/esm-es5/ShadowViewAddon-4d554869.js +0 -1
  189. package/dist/esm-es5/data-017e5ef2.js +0 -1
  190. package/dist/esm-es5/sqm-portal-container-view-a8c708cd.js +0 -1
  191. package/dist/esm-es5/sqm-user-info-form-view-d13f9d3e.js +0 -1
  192. package/dist/esm-es5/usePayoutStatus-227ae365.js +0 -6
  193. package/dist/esm-es5/utils-17daa419.js +0 -1
  194. package/dist/mint-components/p-00dd7f08.js +0 -1
  195. package/dist/mint-components/p-3254fbb4.entry.js +0 -291
  196. package/dist/mint-components/p-4a8ffa03.system.js +0 -1
  197. package/dist/mint-components/p-4e34bcb1.system.js +0 -1
  198. package/dist/mint-components/p-53d90eb5.js +0 -463
  199. package/dist/mint-components/p-5e300ec1.system.js +0 -6
  200. package/dist/mint-components/p-614723aa.js +0 -1
  201. package/dist/mint-components/p-6af71f23.entry.js +0 -9
  202. package/dist/mint-components/p-6c23abd8.entry.js +0 -1
  203. package/dist/mint-components/p-753d06ef.entry.js +0 -133
  204. package/dist/mint-components/p-7aace2b3.system.js +0 -1
  205. package/dist/mint-components/p-b0ab1065.system.entry.js +0 -1
  206. package/dist/mint-components/p-b52a7da9.system.entry.js +0 -1
  207. package/dist/mint-components/p-b699f76e.system.js +0 -1
  208. package/dist/mint-components/p-b6a1e2ac.js +0 -1
  209. package/dist/mint-components/p-b7370480.js +0 -1
  210. package/dist/mint-components/p-ce7d824b.js +0 -49
  211. package/dist/mint-components/p-e93cdcbd.system.js +0 -1
  212. package/dist/mint-components/p-eb285d38.system.entry.js +0 -1
  213. package/dist/mint-components/p-f782ff10.system.entry.js +0 -1
  214. package/docs/stats.json +0 -122783
@@ -1,4 +1,4 @@
1
- import { h, Host } from "@stencil/core";
1
+ import { h } from "@stencil/core";
2
2
  import { createStyleSheet } from "../../styling/JSS";
3
3
  export function PortalContainerView(props, children) {
4
4
  const style = {
@@ -24,10 +24,9 @@ export function PortalContainerView(props, children) {
24
24
  }`;
25
25
  const sheet = createStyleSheet(style);
26
26
  const styleString = sheet.toString();
27
- return (h(Host, null,
28
- h("div", { class: sheet.classes.Container, part: "sqm-base" },
29
- h("style", { type: "text/css" },
30
- vanillaStyle,
31
- styleString),
32
- children)));
27
+ return (h("div", { class: sheet.classes.Container, part: "sqm-base" },
28
+ h("style", { type: "text/css" },
29
+ vanillaStyle,
30
+ styleString),
31
+ children));
33
32
  }
@@ -87,7 +87,7 @@ export class PortalGoogleLogin {
87
87
  const styleString = sheet.toString();
88
88
  const content = {
89
89
  forgotPasswordButton: (h("slot", { name: "forgotPassword" },
90
- h("a", { onClick: () => navigation.push(states.forgotPasswordPath) }, this.forgotPasswordLabel))),
90
+ h("a", { part: "forgot-password-link", onClick: () => navigation.push(states.forgotPasswordPath) }, this.forgotPasswordLabel))),
91
91
  googleButton: (h("sqm-google-sign-in", { onInitComplete: callbacks.googleSubmit })),
92
92
  secondaryButton: (h("slot", { name: "secondaryButton" },
93
93
  h("style", null, styleString),
@@ -79,7 +79,7 @@ export class PortalLogin {
79
79
  const styleString = sheet.toString();
80
80
  const content = {
81
81
  forgotPasswordButton: (h("slot", { name: "forgotPassword" },
82
- h("a", { onClick: () => navigation.push(states.forgotPasswordPath) }, this.forgotPasswordLabel))),
82
+ h("a", { part: "forgot-password-link", onClick: () => navigation.push(states.forgotPasswordPath) }, this.forgotPasswordLabel))),
83
83
  googleButton: null,
84
84
  secondaryButton: (h("slot", { name: "secondaryButton" },
85
85
  h("style", null, styleString),
@@ -16,6 +16,7 @@ const props = {
16
16
  iframeSrc: "https://example.com",
17
17
  iframeHeight: "100%",
18
18
  iframeWidth: "100%",
19
+ codeParam: "rsCode",
19
20
  },
20
21
  },
21
22
  };
@@ -25,5 +25,5 @@ export function ReferralIframeView(props) {
25
25
  const styleString = sheet.toString();
26
26
  return (h("div", { class: sheet.classes.Container },
27
27
  h("style", { type: "text/css" }, styleString),
28
- h("iframe", { class: sheet.classes.IFrame, src: `${content.iframeSrc}?rsCode=${data.shareCode}` })));
28
+ h("iframe", { class: sheet.classes.IFrame, src: `${content.iframeSrc}?${encodeURIComponent(content.codeParam)}=${data.shareCode}` })));
29
29
  }
@@ -22,6 +22,11 @@ export class SqmReferralIframe {
22
22
  * @uiName IFrame width
23
23
  */
24
24
  this.iframeWidth = "100%";
25
+ /**
26
+ * Override the default parameter name used in the iframe
27
+ * @uiName Referral code parameter name
28
+ */
29
+ this.codeParam = "rsCode";
25
30
  withHooks(this);
26
31
  }
27
32
  disconnectedCallback() { }
@@ -108,12 +113,33 @@ export class SqmReferralIframe {
108
113
  "reflect": false,
109
114
  "defaultValue": "\"100%\""
110
115
  },
116
+ "codeParam": {
117
+ "type": "string",
118
+ "mutable": false,
119
+ "complexType": {
120
+ "original": "string",
121
+ "resolved": "string",
122
+ "references": {}
123
+ },
124
+ "required": false,
125
+ "optional": false,
126
+ "docs": {
127
+ "tags": [{
128
+ "text": "Referral code parameter name",
129
+ "name": "uiName"
130
+ }],
131
+ "text": "Override the default parameter name used in the iframe"
132
+ },
133
+ "attribute": "code-param",
134
+ "reflect": false,
135
+ "defaultValue": "\"rsCode\""
136
+ },
111
137
  "demoData": {
112
138
  "type": "unknown",
113
139
  "mutable": false,
114
140
  "complexType": {
115
141
  "original": "DemoData<ReferralIframeViewProps>",
116
- "resolved": "{ states?: { content: { iframeSrc: string; iframeHeight: string; iframeWidth: string; }; }; data?: { shareCode: string; }; }",
142
+ "resolved": "{ states?: { content: { iframeSrc: string; iframeHeight: string; iframeWidth: string; codeParam: string; }; }; data?: { shareCode: string; }; }",
117
143
  "references": {
118
144
  "DemoData": {
119
145
  "location": "import",
@@ -415,7 +415,6 @@ function useDemoShareCode(props) {
415
415
  borderRadius: props.borderRadius,
416
416
  borderColor: props.borderColor,
417
417
  buttonType: props.buttonType,
418
- rewardStatus: "AVAILABLE",
419
418
  open,
420
419
  onClick: () => {
421
420
  // Should well supported: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
@@ -1,5 +1,6 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { CopyTextView } from "../views/copy-text-view";
3
+ import { ShareLinkView } from "./sqm-share-link-view";
3
4
  import scenario from "./ShareLink.feature";
4
5
  export default {
5
6
  title: "Components/Share Link",
@@ -77,18 +78,142 @@ export const CustomStyles = () => {
77
78
  return h(CopyTextView, Object.assign({}, props));
78
79
  };
79
80
  export const CustomStylesWithDemoHooks = () => {
80
- const props = {
81
- copyString: "https://noah.example.com",
82
- open: false,
83
- tooltiptext: "Copied!",
84
- backgroundColor: "#1ed760",
85
- borderRadius: "30px",
86
- textColor: "red",
87
- buttonType: "primary",
88
- borderColor: "#121212",
89
- };
90
- return (h("sqm-share-link", { demoData: { ...props }, backgroundColor: "#1ed760" }));
81
+ return (h("sqm-share-link", { demoData: {
82
+ copyTextViewProps: {
83
+ copyString: "https://noah.example.com",
84
+ open: false,
85
+ tooltiptext: "Copied!",
86
+ backgroundColor: "#1ed760",
87
+ borderRadius: "30px",
88
+ textColor: "red",
89
+ buttonType: "primary",
90
+ borderColor: "#121212",
91
+ },
92
+ }, backgroundColor: "#1ed760" }));
91
93
  };
92
94
  export const FullStack = () => {
93
95
  return h("sqm-share-link", null);
94
96
  };
97
+ // Customize URL stories
98
+ const noopFn = () => { };
99
+ const defaultCustomizeProps = {
100
+ copyTextViewProps: {
101
+ copyString: "https://ssqt.co/abc123",
102
+ open: false,
103
+ tooltiptext: "Copied!",
104
+ },
105
+ allowCustomization: true,
106
+ customizeLinkLabel: "Customize Link",
107
+ saveLabelText: "Save",
108
+ savingLabelText: "Saving...",
109
+ cancelLabelText: "Cancel",
110
+ editLabelText: "Edit your link",
111
+ charactersRemainingText: "{count} characters remaining",
112
+ validatingLabelText: "Validating...",
113
+ isEditing: false,
114
+ editValue: "",
115
+ domainPrefix: "https://ssqt.co/",
116
+ editsRemaining: 3,
117
+ maxEdits: 5,
118
+ limitReached: false,
119
+ validationError: null,
120
+ isValidating: false,
121
+ isSaving: false,
122
+ characterLimit: 15,
123
+ minCharacters: 3,
124
+ charactersRemaining: 15,
125
+ editLimitText: "You can edit your link up to 5 times.",
126
+ editLimitReachedText: "5 edit limit reached. To make more changes, please contact {supportLink}.",
127
+ supportLinkText: "Support",
128
+ customizeDisabled: false,
129
+ customizeDisabledTooltip: "Link customization is not available.",
130
+ minCharactersText: "Minimum 3 characters",
131
+ onCustomizeClick: noopFn,
132
+ onEditValueChange: noopFn,
133
+ onSave: noopFn,
134
+ onCancel: noopFn,
135
+ };
136
+ export const CustomizeUrlDefault = () => {
137
+ return h(ShareLinkView, Object.assign({}, defaultCustomizeProps));
138
+ };
139
+ export const CustomizeUrlEditing = () => {
140
+ return (h(ShareLinkView, Object.assign({}, {
141
+ ...defaultCustomizeProps,
142
+ isEditing: true,
143
+ editValue: "nvoiwb18",
144
+ charactersRemaining: 7,
145
+ })));
146
+ };
147
+ export const CustomizeUrlCustomized = () => {
148
+ return (h(ShareLinkView, Object.assign({}, {
149
+ ...defaultCustomizeProps,
150
+ copyTextViewProps: {
151
+ ...defaultCustomizeProps.copyTextViewProps,
152
+ copyString: "https://ssqt.co/bobtesterson",
153
+ },
154
+ })));
155
+ };
156
+ export const CustomizeUrlLimitReached = () => {
157
+ return (h(ShareLinkView, Object.assign({}, {
158
+ ...defaultCustomizeProps,
159
+ copyTextViewProps: {
160
+ ...defaultCustomizeProps.copyTextViewProps,
161
+ copyString: "https://ssqt.co/bobtesterson",
162
+ },
163
+ editsRemaining: 0,
164
+ limitReached: true,
165
+ })));
166
+ };
167
+ export const CustomizeUrlDisabled = () => {
168
+ return (h(ShareLinkView, Object.assign({}, {
169
+ ...defaultCustomizeProps,
170
+ customizeDisabled: true,
171
+ })));
172
+ };
173
+ export const CustomizeUrlValidationError = () => {
174
+ return (h(ShareLinkView, Object.assign({}, {
175
+ ...defaultCustomizeProps,
176
+ isEditing: true,
177
+ editValue: "nvoiwb18",
178
+ charactersRemaining: 7,
179
+ validationError: {
180
+ code: "EXISTING_CODE_CONFLICT",
181
+ title: "This link is already taken",
182
+ description: "Try adding numbers, a dash or underscore to create a unique link.",
183
+ },
184
+ })));
185
+ };
186
+ export const CustomizeUrlInvalidCharacters = () => {
187
+ return (h(ShareLinkView, Object.assign({}, {
188
+ ...defaultCustomizeProps,
189
+ isEditing: true,
190
+ editValue: "nvoiwb18",
191
+ charactersRemaining: 7,
192
+ validationError: {
193
+ code: "INVALID_CHARACTER",
194
+ title: "Please use only letters, numbers, dashes and underscores",
195
+ description: "Special characters can break the link when sharing.",
196
+ },
197
+ })));
198
+ };
199
+ export const CustomizeUrlProfanity = () => {
200
+ return (h(ShareLinkView, Object.assign({}, {
201
+ ...defaultCustomizeProps,
202
+ isEditing: true,
203
+ editValue: "nvoiwb18",
204
+ charactersRemaining: 7,
205
+ validationError: {
206
+ code: "BLOCKED_WORD",
207
+ title: "Please try a different link",
208
+ description: "This link contains a restricted word.",
209
+ },
210
+ })));
211
+ };
212
+ export const CustomizeUrlSaving = () => {
213
+ return (h(ShareLinkView, Object.assign({}, {
214
+ ...defaultCustomizeProps,
215
+ isEditing: true,
216
+ editValue: "bobtesterson",
217
+ isSaving: true,
218
+ })));
219
+ };
@@ -1,7 +1,7 @@
1
1
  import { setUserIdentity } from "@saasquatch/component-boilerplate";
2
2
  import { useEffect } from "@saasquatch/universal-hooks";
3
3
  import { h } from "@stencil/core";
4
- import { CopyTextView } from "../views/copy-text-view";
4
+ import { ShareLinkView } from "./sqm-share-link-view";
5
5
  import { useShareLink } from "./useShareLink";
6
6
  import { createHookStory } from "../sqm-stencilbook/HookStoryAddon";
7
7
  export default {
@@ -39,11 +39,11 @@ export const BareBonesView = createHookStory(() => {
39
39
  return (h("div", null,
40
40
  "Sharelink:",
41
41
  " ",
42
- h("code", { style: { borderStyle: "solid", borderWidth: "1px", padding: "2px" } }, res.copyString)));
42
+ h("code", { style: { borderStyle: "solid", borderWidth: "1px", padding: "2px" } }, res.copyTextViewProps.copyString)));
43
43
  });
44
44
  export const RegularView = createHookStory(() => {
45
45
  setupGraphQL();
46
- return (h(CopyTextView, Object.assign({}, useShareLink({
46
+ return (h(ShareLinkView, Object.assign({}, useShareLink({
47
47
  programId: "klip-referral-program",
48
48
  tooltiptext: "Copied to clipboard",
49
49
  tooltiplifespan: 1000,
@@ -51,9 +51,18 @@ export const RegularView = createHookStory(() => {
51
51
  });
52
52
  export const FastTooltip = createHookStory(() => {
53
53
  setupGraphQL();
54
- return (h(CopyTextView, Object.assign({}, useShareLink({
54
+ return (h(ShareLinkView, Object.assign({}, useShareLink({
55
55
  programId: "klip-referral-program",
56
- tooltiptext: "⠀⠀⠀⠀⠀⠀⠀⠀⠀HELLO THERE!!!\n⠀⠀⠀⡯⡯⡾⠝⠘⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢊⠘⡮⣣⠪⠢⡑⡌\n⠀⠀⠀⠟⠝⠈⠀⠀⠀⠡⠀⠠⢈⠠⢐⢠⢂⢔⣐⢄⡂⢔⠀⡁⢉⠸⢨⢑⠕⡌\n⠀⠀⡀⠁⠀⠀⠀⡀⢂⠡⠈⡔⣕⢮⣳⢯⣿⣻⣟⣯⣯⢷⣫⣆⡂⠀⠀⢐⠑⡌\n⢀⠠⠐⠈⠀⢀⢂⠢⡂⠕⡁⣝⢮⣳⢽⡽⣾⣻⣿⣯⡯⣟⣞⢾⢜⢆⠀⡀⠀⠪\n⣬⠂⠀⠀⢀⢂⢪⠨⢂⠥⣺⡪⣗⢗⣽⢽⡯⣿⣽⣷⢿⡽⡾⡽⣝⢎⠀⠀⠀⢡\n⣿⠀⠀⠀⢂⠢⢂⢥⢱⡹⣪⢞⡵⣻⡪⡯⡯⣟⡾⣿⣻⡽⣯⡻⣪⠧⠑⠀⠁⢐\n⣿⠀⠀⠀⠢⢑⠠⠑⠕⡝⡎⡗⡝⡎⣞⢽⡹⣕⢯⢻⠹⡹⢚⠝⡷⡽⡨⠀⠀⢔\n⣿⡯⠀⢈⠈⢄⠂⠂⠐⠀⠌⠠⢑⠱⡱⡱⡑⢔⠁⠀⡀⠐⠐⠐⡡⡹⣪⠀⠀⢘\n⣿⣽⠀⡀⡊⠀⠐⠨⠈⡁⠂⢈⠠⡱⡽⣷⡑⠁⠠⠑⠀⢉⢇⣤⢘⣪⢽⠀⢌⢎\n⣿⢾⠀⢌⠌⠀⡁⠢⠂⠐⡀⠀⢀⢳⢽⣽⡺⣨⢄⣑⢉⢃⢭⡲⣕⡭⣹⠠⢐⢗\n⣿⡗⠀⠢⠡⡱⡸⣔⢵⢱⢸⠈⠀⡪⣳⣳⢹⢜⡵⣱⢱⡱⣳⡹⣵⣻⢔⢅⢬⡷\n⣷⡇⡂⠡⡑⢕⢕⠕⡑⠡⢂⢊⢐⢕⡝⡮⡧⡳⣝⢴⡐⣁⠃⡫⡒⣕⢏⡮⣷⡟\n⣷⣻⣅⠑⢌⠢⠁⢐⠠⠑⡐⠐⠌⡪⠮⡫⠪⡪⡪⣺⢸⠰⠡⠠⠐⢱⠨⡪⡪⡰\n⣯⢷⣟⣇⡂⡂⡌⡀⠀⠁⡂⠅⠂⠀⡑⡄⢇⠇⢝⡨⡠⡁⢐⠠⢀⢪⡐⡜⡪⡊\n⣿⢽⡾⢹⡄⠕⡅⢇⠂⠑⣴⡬⣬⣬⣆⢮⣦⣷⣵⣷⡗⢃⢮⠱⡸⢰⢱⢸⢨⢌\n⣯⢯⣟⠸⣳⡅⠜⠔⡌⡐⠈⠻⠟⣿⢿⣿⣿⠿⡻⣃⠢⣱⡳⡱⡩⢢⠣⡃⠢⠁\n⡯⣟⣞⡇⡿⣽⡪⡘⡰⠨⢐⢀⠢⢢⢄⢤⣰⠼⡾⢕⢕⡵⣝⠎⢌⢪⠪⡘⡌⠀\n⡯⣳⠯⠚⢊⠡⡂⢂⠨⠊⠔⡑⠬⡸⣘⢬⢪⣪⡺⡼⣕⢯⢞⢕⢝⠎⢻⢼⣀⠀\n⠁⡂⠔⡁⡢⠣⢀⠢⠀⠅⠱⡐⡱⡘⡔⡕⡕⣲⡹⣎⡮⡏⡑⢜⢼⡱⢩⣗⣯⣟\n⢀⢂⢑⠀⡂⡃⠅⠊⢄⢑⠠⠑⢕⢕⢝⢮⢺⢕⢟⢮⢊⢢⢱⢄⠃⣇⣞⢞⣞⢾\n⢀⠢⡑⡀⢂⢊⠠⠁⡂⡐⠀⠅⡈⠪⠪⠪⠣⠫⠑⡁⢔⠕⣜⣜⢦⡰⡎⡯⡾⡽",
56
+ tooltiptext: "Copied to clipboard",
57
57
  tooltiplifespan: 500,
58
58
  }))));
59
59
  });
60
+ export const CustomizeUrlEnabled = createHookStory(() => {
61
+ setupGraphQL();
62
+ return (h(ShareLinkView, Object.assign({}, useShareLink({
63
+ programId: "klip-referral-program",
64
+ tooltiptext: "Copied to clipboard",
65
+ tooltiplifespan: 1000,
66
+ allowCustomization: true,
67
+ }))));
68
+ });
@@ -0,0 +1,192 @@
1
+ import { h } from "@stencil/core";
2
+ import { intl } from "../../global/global";
3
+ import { createStyleSheet } from "../../styling/JSS";
4
+ import { CopyTextView } from "../views/copy-text-view";
5
+ const vanillaStyle = `
6
+ :host {
7
+ display: block;
8
+ width: 100%;
9
+ }
10
+ `;
11
+ export function ShareLinkView(props) {
12
+ const { copyTextViewProps, allowCustomization, customizeLinkLabel, saveLabelText, savingLabelText, cancelLabelText, editLabelText, charactersRemainingText, validatingLabelText, isEditing, editValue, domainPrefix, editsRemaining, limitReached, validationError, isValidating, isSaving, characterLimit, minCharacters, charactersRemaining, editLimitText, editLimitReachedText, supportLinkText, customizeDisabled, customizeDisabledTooltip, onCustomizeClick, onEditValueChange, onSave, onCancel, minCharactersText, } = props;
13
+ const style = {
14
+ Container: {
15
+ display: "flex",
16
+ flexDirection: "column",
17
+ gap: "var(--sl-spacing-xx-small)",
18
+ width: "100%",
19
+ },
20
+ CustomizeLinkText: {
21
+ paddingTop: "var(--sl-spacing-xx-small)",
22
+ margin: "0",
23
+ fontSize: "var(--sl-font-size-small)",
24
+ fontWeight: "600",
25
+ cursor: "pointer",
26
+ color: "var(--sl-color-neutral-900)",
27
+ textAlign: "left",
28
+ "&:hover": {
29
+ textDecoration: "underline",
30
+ },
31
+ },
32
+ CustomizeLinkDisabled: {
33
+ paddingTop: "var(--sl-spacing-xx-small)",
34
+ margin: "0",
35
+ fontSize: "var(--sl-font-size-small)",
36
+ fontWeight: "600",
37
+ color: "var(--sl-color-neutral-400)",
38
+ cursor: "default",
39
+ textAlign: "left",
40
+ },
41
+ EditContainer: {
42
+ display: "flex",
43
+ flexDirection: "column",
44
+ gap: "var(--sl-spacing-x-small)",
45
+ width: "100%",
46
+ },
47
+ EditInputWrapper: {
48
+ display: "flex",
49
+ alignItems: "center",
50
+ width: "100%",
51
+ border: "var(--sqm-border-thickness, 1px) solid var(--sqm-input-border-color, #d1d5db)",
52
+ borderRadius: "var(--sqm-border-radius-normal, 4px)",
53
+ background: "var(--sqm-input-background, #fff)",
54
+ overflow: "hidden",
55
+ "&:focus-within": {
56
+ borderColor: "#999999",
57
+ boxShadow: "0 0 0 var(--sl-focus-ring-width) var(--sl-input-focus-ring-color)",
58
+ },
59
+ },
60
+ DomainPrefix: {
61
+ padding: "0 0 0 var(--sl-spacing-medium)",
62
+ fontSize: "var(--sl-font-size-medium)",
63
+ color: "var(--sl-color-neutral-500)",
64
+ whiteSpace: "nowrap",
65
+ userSelect: "none",
66
+ lineHeight: "var(--sl-input-height-medium)",
67
+ },
68
+ EditInput: {
69
+ "&::part(base)": {
70
+ border: "none",
71
+ borderRadius: "0",
72
+ },
73
+ "&::part(input)": {
74
+ margin: 0,
75
+ },
76
+ },
77
+ EditLabel: {
78
+ margin: "0",
79
+ fontSize: "var(--sl-font-size-small)",
80
+ color: "var(--sl-color-neutral-500)",
81
+ },
82
+ HelperText: {
83
+ paddingTop: "var(--sl-spacing-xx-small)",
84
+ margin: "0",
85
+ fontSize: "var(--sl-font-size-small)",
86
+ color: "var(--sl-color-neutral-500)",
87
+ },
88
+ ErrorText: {
89
+ margin: "0",
90
+ fontSize: "var(--sl-font-size-small)",
91
+ color: "var(--sqm-danger-color-text, #dc2626)",
92
+ },
93
+ ActionRow: {
94
+ display: "flex",
95
+ gap: "var(--sl-spacing-medium)",
96
+ alignItems: "center",
97
+ },
98
+ SaveButton: {
99
+ cursor: "pointer",
100
+ fontFamily: "var(--sl-font-sans)",
101
+ fontSize: "var(--sl-font-size-small)",
102
+ fontWeight: "600",
103
+ padding: "var(--sl-spacing-x-small) var(--sl-spacing-medium)",
104
+ borderRadius: "var(--sqm-border-radius-normal, 4px)",
105
+ border: "1px solid var(--sl-color-neutral-900)",
106
+ background: "var(--sl-color-neutral-900)",
107
+ color: "#fff",
108
+ "&:disabled": {
109
+ opacity: "0.5",
110
+ cursor: "default",
111
+ },
112
+ },
113
+ CancelButton: {
114
+ margin: "0",
115
+ fontSize: "var(--sl-font-size-small)",
116
+ fontWeight: "600",
117
+ cursor: "pointer",
118
+ background: "none",
119
+ border: "none",
120
+ fontFamily: "var(--sl-font-sans)",
121
+ color: "var(--sl-color-neutral-500)",
122
+ "&::part(label)": {
123
+ padding: "0",
124
+ },
125
+ },
126
+ LimitReachedContainer: {
127
+ display: "flex",
128
+ alignItems: "center",
129
+ gap: "var(--sl-spacing-x-small)",
130
+ },
131
+ };
132
+ const sheet = createStyleSheet(style);
133
+ const styleString = sheet.toString();
134
+ const errorMessageType = (validationError === null || validationError === void 0 ? void 0 : validationError.code) === "EXISTING_CODE_CONFLICT" ? "info" : "warning";
135
+ const showCharactersRemaining = charactersRemaining <= 14;
136
+ const editLimitMessage = intl.formatMessage({
137
+ id: "editLimitText",
138
+ defaultMessage: editLimitText,
139
+ }, { editsRemaining });
140
+ // Editing state
141
+ if (isEditing) {
142
+ return (h("div", { class: sheet.classes.Container },
143
+ h("style", { type: "text/css" },
144
+ styleString,
145
+ vanillaStyle),
146
+ h("p", { class: sheet.classes.EditLabel }, editLabelText),
147
+ h("div", { class: sheet.classes.EditInputWrapper },
148
+ h("span", { class: sheet.classes.DomainPrefix }, domainPrefix),
149
+ h("sl-input", { class: sheet.classes.EditInput, type: "text", value: editValue, onInput: (e) => onEditValueChange(e.target.value), onKeyDown: (e) => {
150
+ if (e.key === "/" || e.key === "@")
151
+ e.preventDefault();
152
+ }, disabled: isSaving, maxLength: characterLimit })),
153
+ h("p", { class: sheet.classes.HelperText },
154
+ editLimitMessage,
155
+ " ",
156
+ charactersRemaining > 12 && minCharactersText,
157
+ showCharactersRemaining &&
158
+ ` ${intl.formatMessage({
159
+ id: "charactersRemainingText",
160
+ defaultMessage: charactersRemainingText,
161
+ }, { charactersRemaining })}`),
162
+ validationError && (h("sqm-form-message", { type: errorMessageType, style: { paddingBottom: "var(--sl-spacing-xx-small)" } },
163
+ h("p", { part: "alert-title" }, validationError.title),
164
+ validationError.description)),
165
+ isValidating && (h("p", { class: sheet.classes.HelperText }, validatingLabelText)),
166
+ h("div", { class: sheet.classes.ActionRow },
167
+ h("button", { class: sheet.classes.SaveButton, onClick: onSave, disabled: isSaving ||
168
+ isValidating ||
169
+ !!validationError ||
170
+ !editValue ||
171
+ editValue.length < minCharacters }, isSaving ? savingLabelText : saveLabelText),
172
+ h("sl-button", { type: "text", class: sheet.classes.CancelButton, onClick: onCancel, disabled: isSaving }, cancelLabelText))));
173
+ }
174
+ // Default / Customized / Limit reached states
175
+ return (h("div", { class: sheet.classes.Container },
176
+ h("style", { type: "text/css" },
177
+ styleString,
178
+ vanillaStyle),
179
+ h(CopyTextView, Object.assign({}, copyTextViewProps)),
180
+ allowCustomization &&
181
+ (customizeDisabled ? (h("sl-tooltip", { content: customizeDisabledTooltip, placement: "top", style: { display: "inline-block", width: "fit-content" } },
182
+ h("p", { class: sheet.classes.CustomizeLinkDisabled }, customizeLinkLabel))) : (h("div", { class: sheet.classes.LimitReachedContainer },
183
+ h("p", { class: limitReached
184
+ ? sheet.classes.CustomizeLinkDisabled
185
+ : sheet.classes.CustomizeLinkText, onClick: limitReached ? undefined : onCustomizeClick }, customizeLinkLabel),
186
+ allowCustomization && limitReached && (h("p", { class: sheet.classes.HelperText }, intl.formatMessage({
187
+ id: "editLimitReached",
188
+ defaultMessage: editLimitReachedText,
189
+ }, {
190
+ supportLink: (h("a", { target: "_blank", href: "https://help.impact.com/other/readme/get-help-and-support" }, supportLinkText)),
191
+ }))))))));
192
+ }