@saasquatch/mint-components 2.1.7 → 2.1.8-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 (56) hide show
  1. package/dist/cjs/{ShadowViewAddon-1d15cdf7.js → ShadowViewAddon-5ce32291.js} +89 -0
  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_10.cjs.entry.js +377 -50
  5. package/dist/cjs/{sqm-big-stat_45.cjs.entry.js → sqm-big-stat_46.cjs.entry.js} +329 -1
  6. package/dist/cjs/sqm-stencilbook.cjs.entry.js +158 -1
  7. package/dist/collection/collection-manifest.json +1 -0
  8. package/dist/collection/components/sqm-partner-info-modal/PartnerInfoModal.stories.js +143 -0
  9. package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal-view.js +90 -0
  10. package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal.js +462 -0
  11. package/dist/collection/components/sqm-partner-info-modal/usePartnerInfoModal.js +180 -0
  12. package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +2 -0
  13. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/formDefinitions.js +75 -37
  14. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.js +688 -13
  15. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +95 -1
  16. package/dist/esm/{ShadowViewAddon-53b9090b.js → ShadowViewAddon-9d97b5d5.js} +89 -1
  17. package/dist/esm/loader.js +1 -1
  18. package/dist/esm/mint-components.js +1 -1
  19. package/dist/esm/sqm-banking-info-form_10.entry.js +377 -50
  20. package/dist/esm/{sqm-big-stat_45.entry.js → sqm-big-stat_46.entry.js} +333 -6
  21. package/dist/esm/sqm-stencilbook.entry.js +158 -1
  22. package/dist/esm-es5/{ShadowViewAddon-53b9090b.js → ShadowViewAddon-9d97b5d5.js} +1 -1
  23. package/dist/esm-es5/loader.js +1 -1
  24. package/dist/esm-es5/mint-components.js +1 -1
  25. package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
  26. package/dist/esm-es5/sqm-big-stat_46.entry.js +1 -0
  27. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  28. package/dist/mint-components/mint-components.esm.js +1 -1
  29. package/dist/mint-components/p-0f036907.system.js +1 -0
  30. package/dist/mint-components/{p-0e6c90b1.entry.js → p-22e39d2c.entry.js} +90 -21
  31. package/dist/mint-components/p-499885aa.entry.js +9 -0
  32. package/dist/mint-components/p-a6621899.system.entry.js +1 -0
  33. package/dist/mint-components/{p-e980472a.js → p-adc4e263.js} +25 -25
  34. package/dist/mint-components/p-b0253f4c.entry.js +108 -0
  35. package/dist/mint-components/p-ca098be1.system.js +1 -1
  36. package/dist/mint-components/p-d93e19e9.system.entry.js +1 -0
  37. package/dist/mint-components/p-e45a9966.system.entry.js +1 -0
  38. package/dist/types/components/sqm-partner-info-modal/PartnerInfoModal.stories.d.ts +13 -0
  39. package/dist/types/components/sqm-partner-info-modal/sqm-partner-info-modal-view.d.ts +41 -0
  40. package/dist/types/components/sqm-partner-info-modal/sqm-partner-info-modal.d.ts +80 -0
  41. package/dist/types/components/sqm-partner-info-modal/usePartnerInfoModal.d.ts +16 -0
  42. package/dist/types/components/tax-and-cash/sqm-banking-info-form/formDefinitions.d.ts +2 -0
  43. package/dist/types/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.d.ts +4 -0
  44. package/dist/types/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.d.ts +165 -0
  45. package/dist/types/components.d.ts +378 -0
  46. package/docs/docs.docx +0 -0
  47. package/docs/raisins.json +1 -1
  48. package/grapesjs/grapesjs.js +1 -1
  49. package/package.json +1 -1
  50. package/dist/esm-es5/sqm-big-stat_45.entry.js +0 -1
  51. package/dist/mint-components/p-54ea8b9b.system.entry.js +0 -1
  52. package/dist/mint-components/p-807ed3bf.system.js +0 -1
  53. package/dist/mint-components/p-cacb897d.system.entry.js +0 -1
  54. package/dist/mint-components/p-de7bb373.entry.js +0 -9
  55. package/dist/mint-components/p-e9258d20.system.entry.js +0 -1
  56. package/dist/mint-components/p-ff378015.entry.js +0 -106
@@ -25,6 +25,95 @@ export const paypalFeeMap = {
25
25
  const ACH_PAYMENT_METHOD = 3;
26
26
  const WIRE_PAYMENT_METHOD = 5;
27
27
  const PAYPAL_PAYMENT_METHOD = 7;
28
+ /**
29
+ * Maps GraphQL validation error field names to form field names.
30
+ */
31
+ const API_FIELD_TO_FORM_FIELD = {
32
+ // bankProvinceState → form uses bankState
33
+ bankProvinceState: "bankState",
34
+ };
35
+ /**
36
+ * Maps Impact API error code paths (from validationErrors[].errorPath) to short,
37
+ * readable frontend error codes used in the ICU select props.
38
+ */
39
+ const API_ERROR_PATH_TO_FRONTEND = {
40
+ // Beneficiary account name
41
+ "withdrawal.settings.error.empty_beneficiaryname": "empty",
42
+ "withdrawal.settings.error.invalid_character_beneficiaryname": "invalidCharacters",
43
+ "withdrawal.settings.error.numeric_beneficiaryname": "numeric",
44
+ "withdrawal_settings.error.beneficiaryname.size": "tooLong",
45
+ "withdrawal.settings.error.non_english_beneficiaryname": "nonEnglish",
46
+ "withdrawal_settings.error.business_beneficiaryname_match": "businessNameMismatch",
47
+ "withdrawal_settings.error.beneficiaryname_match": "nameMismatch",
48
+ "withdrawal_settings.error.business_checkpayeename_match": "businessPayeeMismatch",
49
+ "withdrawal_settings.error.checkpayeename_match": "payeeMismatch",
50
+ // Bank account number
51
+ "withdrawal.settings.error.accountnumber.empty": "empty",
52
+ "withdrawal.settings.error.accountnumber.uk": "invalidUk",
53
+ "withdrawal.settings.error.bankaccount.invalid": "invalid",
54
+ // IBAN
55
+ "withdrawal.settings.error.iban": "ibanEmpty",
56
+ "withdrawal.settings.error.iban.alphanumeric": "ibanAlphanumeric",
57
+ "withdrawal.settings.error.iban.invalid": "ibanInvalid",
58
+ "withdrawal.settings.error.iban.uk.country.mismatch": "ibanCountryMismatch",
59
+ // Routing code
60
+ "withdrawal.settings.error.bsbNumber": "invalidBsb",
61
+ "withdrawal.settings.error.sortcode": "invalidSortCode",
62
+ "withdrawal.settings.error.routingNumber": "empty",
63
+ "withdrawal.settings.error.routingcode": "invalid",
64
+ // SWIFT / BIC
65
+ "withdrawal.settings.error.bic": "empty",
66
+ "withdrawal.settings.error.bic.alphanumeric": "alphanumeric",
67
+ "withdrawal.settings.error.bic.invalid": "invalid",
68
+ // Bank account type
69
+ "global.error.invalid.accounttype": "empty",
70
+ // Bank name
71
+ "withdrawal.settings.error.bankName": "empty",
72
+ // Tax payer ID
73
+ "withdrawal.settings.error.taxPayerId": "empty",
74
+ "withdrawal.settings.error.taxPayerId.ar": "emptyAr",
75
+ "withdrawal.settings.error.taxPayerId.kr": "emptyKr",
76
+ "withdrawal.settings.error.taxPayerId.alphanumeric": "alphanumeric",
77
+ "withdrawal.settings.error.taxPayerId.alphanumeric.ar": "alphanumericAr",
78
+ "withdrawal.settings.error.taxPayerId.alphanumeric.kr": "alphanumericKr",
79
+ "withdrawal.settings.error.taxPayerId.invalid": "invalid",
80
+ "withdrawal.settings.error.taxPayerId.invalid.ar": "invalidAr",
81
+ "withdrawal.settings.error.taxPayerId.invalid.kr": "invalidKr",
82
+ "withdrawal.settings.error.taxPayerId.invalid.kzt": "invalidKzt",
83
+ "withdrawal.settings.error.taxPayerId.cnpj": "cnpjTooShort",
84
+ "withdrawal.settings.error.taxPayerId.cpf": "cpfTooShort",
85
+ // Patronymic name
86
+ "withdrawal.settings.error.patronymicName": "empty",
87
+ "withdrawal.settings.error.patronymicName.alphanumeric": "alphanumeric",
88
+ // VO code
89
+ "withdrawal.settings.error.voCode": "empty",
90
+ "withdrawal.settings.error.voCode.alphanumeric": "alphanumeric",
91
+ // Agency code
92
+ "withdrawal.settings.error.agencyCode": "empty",
93
+ "withdrawal.settings.error.agencyCode.alphanumeric": "alphanumeric",
94
+ "withdrawal.settings.error.agencyCode.length": "tooShort",
95
+ // Bank address fields
96
+ "withdrawal.settings.error.bankAddress": "empty",
97
+ "withdrawal.settings.error.bankCity": "empty",
98
+ "withdrawal.settings.error.bankProvinceState": "empty",
99
+ "withdrawal.settings.error.bankPostalCode": "empty",
100
+ // Branch code / name
101
+ "withdrawal.settings.error.branchCode": "invalid",
102
+ "withdrawal.settings.error.branchName": "empty",
103
+ // Classification code
104
+ "withdrawal.settings.error.classificationCode.invalid": "empty",
105
+ "withdrawal.settings.error.classificationCode.invalid.kzt": "invalidKzt",
106
+ // PayPal
107
+ "payment.error.email": "empty",
108
+ "payment.error.paypal_not_supported": "unsupportedCurrency",
109
+ "payment.error.email.invalid": "invalidEmail",
110
+ "payment.error.paypal_verification_incomplete": "verificationIncomplete",
111
+ // Payment schedule
112
+ "payment.error.no_threshold": "empty",
113
+ "payment.error.invalid_threshold": "invalid",
114
+ "payment.error.no_dayOfMonth": "empty",
115
+ "payment.error.invalid_dayOfMonth": "invalid",
116
+ };
28
117
  export function getFormInputs({ bitset, formMap }) {
29
118
  // Convert bitset to binary representation
30
119
  const binary = bitset.toString(2).padStart(Object.keys(formMap).length, "0");
@@ -48,6 +137,7 @@ const SAVE_WITHDRAWAL_SETTINGS = gql `
48
137
  validationErrors {
49
138
  field
50
139
  message
140
+ code
51
141
  }
52
142
  }
53
143
  }
@@ -63,6 +153,7 @@ const UPDATE_WITHDRAWAL_SETTINGS = gql `
63
153
  validationErrors {
64
154
  field
65
155
  message
156
+ code
66
157
  }
67
158
  }
68
159
  }
@@ -235,10 +326,13 @@ export function useBankingInfoForm(props) {
235
326
  else if (!success) {
236
327
  console.error("Validation failed: ", validationErrors);
237
328
  const mappedValidationErrors = validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.reduce((agg, error) => {
329
+ const formField = API_FIELD_TO_FORM_FIELD[error.field] || error.field;
330
+ const errorCode = API_ERROR_PATH_TO_FRONTEND[error.errorPath] || error.errorPath;
238
331
  return {
239
332
  ...agg,
240
- [error.field]: {
333
+ [formField]: {
241
334
  type: "invalid",
335
+ errorCode,
242
336
  },
243
337
  };
244
338
  }, {});
@@ -4463,6 +4463,94 @@ function LeadDropdownFieldView(props) {
4463
4463
  })))));
4464
4464
  }
4465
4465
 
4466
+ const style$b = {
4467
+ Dialog: {
4468
+ "&::part(panel)": {
4469
+ maxWidth: "480px",
4470
+ },
4471
+ "&::part(title)": {
4472
+ fontSize: "var(--sl-font-size-x-large)",
4473
+ fontWeight: "600",
4474
+ padding: "var(--sl-spacing-x-large) var(--sl-spacing-x-large) 0 var(--sl-spacing-x-large)",
4475
+ },
4476
+ "&::part(body)": {
4477
+ padding: "var(--sl-spacing-small) var(--sl-spacing-x-large)",
4478
+ fontSize: "var(--sl-font-size-small)",
4479
+ overflow: "visible",
4480
+ },
4481
+ "&::part(footer)": {
4482
+ display: "flex",
4483
+ flexDirection: "column",
4484
+ gap: "var(--sl-spacing-small)",
4485
+ padding: "var(--sl-spacing-small) var(--sl-spacing-x-large) var(--sl-spacing-x-large)",
4486
+ },
4487
+ "&::part(overlay)": {
4488
+ background: "rgba(0, 0, 0, 0.5)",
4489
+ },
4490
+ "&::part(close-button)": {
4491
+ display: "none",
4492
+ },
4493
+ },
4494
+ FormFields: {
4495
+ display: "flex",
4496
+ gap: "var(--sl-spacing-medium)",
4497
+ marginTop: "var(--sl-spacing-medium)",
4498
+ "& > *": {
4499
+ flex: 1,
4500
+ },
4501
+ },
4502
+ ErrorMessage: {
4503
+ color: "var(--sqm-danger-color-text, #d32f2f)",
4504
+ fontSize: "var(--sl-font-size-small)",
4505
+ marginTop: "var(--sl-spacing-x-small)",
4506
+ },
4507
+ SearchInput: {
4508
+ "&::part(base)": {
4509
+ border: "none",
4510
+ borderBottom: "1px solid var(--sl-color-neutral-300)",
4511
+ borderRadius: "0",
4512
+ },
4513
+ },
4514
+ };
4515
+ function PartnerInfoModalView(props) {
4516
+ var _a, _b;
4517
+ const { states, callbacks, text } = props;
4518
+ const sheet = createStyleSheet(style$b);
4519
+ const styleString = sheet.toString();
4520
+ const description = states.isExistingPartner
4521
+ ? text.descriptionExistingPartner
4522
+ : text.descriptionNewPartner;
4523
+ const buttonLabel = states.isExistingPartner
4524
+ ? text.confirmButtonLabel
4525
+ : text.submitButtonLabel;
4526
+ return (h("sl-dialog", { class: sheet.classes.Dialog, open: states.open, noHeader: false, label: intl.formatMessage({
4527
+ id: "modalBrandHeader",
4528
+ defaultMessage: text.modalBrandHeader,
4529
+ }, { brandName: states.brandName }), "onSl-request-close": (e) => {
4530
+ e.preventDefault();
4531
+ }, "onSl-hide": (e) => {
4532
+ var _a;
4533
+ // Prevent closing when clicking outside the dialog but not dropdowns
4534
+ if (((_a = e.target) === null || _a === void 0 ? void 0 : _a.tagName) === "SL-DIALOG") {
4535
+ e.preventDefault();
4536
+ }
4537
+ } },
4538
+ h("style", { type: "text/css" }, styleString),
4539
+ h("p", null, description),
4540
+ h("div", { class: sheet.classes.FormFields },
4541
+ h("sl-select", { exportparts: "label: input-label, base: input-base", label: text.countryLabel, value: states.countryCode, disabled: states.submitting, required: true, "onSl-select": callbacks.onCountryChange },
4542
+ h("sl-input", { class: sheet.classes.SearchInput, placeholder: text.searchCountryPlaceholder, onKeyDown: (e) => e.stopPropagation(), "onSl-input": (e) => { var _a; return callbacks.onCountrySearch(((_a = e.target) === null || _a === void 0 ? void 0 : _a.value) || ""); } }), (_a = states.filteredCountries) === null || _a === void 0 ? void 0 :
4543
+ _a.map((c) => (h("sl-menu-item", { value: c.countryCode }, c.displayName)))),
4544
+ h("sl-select", { exportparts: "label: input-label, base: input-base", label: text.currencyLabel, value: states.currency, disabled: states.submitting, required: true, "onSl-select": callbacks.onCurrencyChange },
4545
+ h("sl-input", { class: sheet.classes.SearchInput, placeholder: text.searchCurrencyPlaceholder, onKeyDown: (e) => e.stopPropagation(), "onSl-input": (e) => { var _a; return callbacks.onCurrencySearch(((_a = e.target) === null || _a === void 0 ? void 0 : _a.value) || ""); } }), (_b = states.filteredCurrencies) === null || _b === void 0 ? void 0 :
4546
+ _b.map((c) => (h("sl-menu-item", { value: c.currencyCode },
4547
+ c.currencyCode,
4548
+ " - ",
4549
+ c.displayName))))),
4550
+ states.error && h("p", { class: sheet.classes.ErrorMessage }, states.error),
4551
+ h("sl-button", { slot: "footer", type: "primary", loading: states.submitting, disabled: states.submitting || !states.countryCode || !states.currency, onClick: callbacks.onSubmit, style: { width: "100%" }, exportparts: "base: primarybutton-base" }, buttonLabel)));
4552
+ }
4553
+
4466
4554
  const map = new Map();
4467
4555
  function withShadowView(component) {
4468
4556
  // TODO: Could only do this if rendered in a Stencilbook environment to prevent unintended side-effects
@@ -4497,4 +4585,4 @@ const ShadowViewAddon = ({ story }, children) => {
4497
4585
  h(TagName, { "stencilbook-shadow-view": randomInt })));
4498
4586
  };
4499
4587
 
4500
- export { empty as A, BigStatView as B, CardFeedView as C, DropdownFieldView as D, EditProfileView as E, rewardExchange as F, useShareButton as G, HeroView as H, InputFieldView as I, useShareLink as J, ProgressBarView as K, LeaderboardView as L, ProgressBar as M, NameFieldsView as N, LeadFormView as O, PortalChangePasswordView as P, LeadDropdownFieldView as Q, ReferralIframeView as R, StatContainerView as S, TaskCardView as T, ShadowViewAddon as U, useBigStat as V, withShadowView as W, demoRewardExchange as X, ShareButtonView as a, PoweredByImg as b, BaseRegistrationFormView as c, CheckboxFieldView as d, CouponCodeView as e, ChangeMarktingView as f, PortalFooterView as g, PortalFrameView as h, RewardExchangeView as i, rewardExchangeLongText as j, rewardExchangeSelected as k, chooseAmountFixed as l, chooseAmountFixedNoDescription as m, chooseAmountVariable as n, chooseAmountVariableNoDescription as o, chooseAmountVariableDisabled as p, chooseAmountVariableUnavailable as q, rewardExchangeCustomErrorMsg as r, confirmFixed as s, confirmVariable as t, useDemoBigStat as u, redemptionError as v, queryError as w, success as x, successVariable as y, loading as z };
4588
+ export { empty as A, BigStatView as B, CardFeedView as C, DropdownFieldView as D, EditProfileView as E, rewardExchange as F, useShareButton as G, HeroView as H, InputFieldView as I, useShareLink as J, ProgressBarView as K, LeaderboardView as L, ProgressBar as M, NameFieldsView as N, LeadFormView as O, PortalChangePasswordView as P, LeadDropdownFieldView as Q, ReferralIframeView as R, StatContainerView as S, TaskCardView as T, PartnerInfoModalView as U, ShadowViewAddon as V, useBigStat as W, withShadowView as X, demoRewardExchange as Y, ShareButtonView as a, PoweredByImg as b, BaseRegistrationFormView as c, CheckboxFieldView as d, CouponCodeView as e, ChangeMarktingView as f, PortalFooterView as g, PortalFrameView as h, RewardExchangeView as i, rewardExchangeLongText as j, rewardExchangeSelected as k, chooseAmountFixed as l, chooseAmountFixedNoDescription as m, chooseAmountVariable as n, chooseAmountVariableNoDescription as o, chooseAmountVariableDisabled as p, chooseAmountVariableUnavailable as q, rewardExchangeCustomErrorMsg as r, confirmFixed as s, confirmVariable as t, useDemoBigStat as u, redemptionError as v, queryError as w, success as x, successVariable as y, loading as z };