@saasquatch/mint-components 2.1.8-0 → 2.1.8-10

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 (58) hide show
  1. package/dist/cjs/{ShadowViewAddon-1d15cdf7.js → ShadowViewAddon-19755faf.js} +384 -9
  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 +50 -391
  5. package/dist/cjs/sqm-big-stat_45.cjs.entry.js +172 -23
  6. package/dist/cjs/sqm-stencilbook.cjs.entry.js +168 -18
  7. package/dist/collection/components/sqm-share-code/sqm-share-code.js +0 -1
  8. package/dist/collection/components/sqm-share-link/ShareLink.stories.js +142 -11
  9. package/dist/collection/components/sqm-share-link/UseShareLink.stories.js +14 -5
  10. package/dist/collection/components/sqm-share-link/sqm-share-link-view.js +173 -0
  11. package/dist/collection/components/sqm-share-link/sqm-share-link.js +536 -26
  12. package/dist/collection/components/sqm-share-link/useShareLink.js +210 -6
  13. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/formDefinitions.js +37 -75
  14. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.js +13 -688
  15. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +1 -109
  16. package/dist/esm/{ShadowViewAddon-53b9090b.js → ShadowViewAddon-23d56d60.js} +386 -12
  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 +50 -391
  20. package/dist/esm/sqm-big-stat_45.entry.js +172 -23
  21. package/dist/esm/sqm-stencilbook.entry.js +168 -18
  22. package/dist/esm-es5/ShadowViewAddon-23d56d60.js +1 -0
  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_45.entry.js +1 -1
  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-182b5b6a.js +503 -0
  30. package/dist/mint-components/{p-0e6c90b1.entry.js → p-27ec70af.entry.js} +20 -20
  31. package/dist/mint-components/p-47b630aa.entry.js +9 -0
  32. package/dist/mint-components/p-644fca99.system.js +1 -0
  33. package/dist/mint-components/p-af8c2202.system.entry.js +1 -0
  34. package/dist/mint-components/p-ca098be1.system.js +1 -1
  35. package/dist/mint-components/p-cacb897d.system.entry.js +1 -0
  36. package/dist/mint-components/p-ebe1eb7a.system.entry.js +1 -0
  37. package/dist/mint-components/p-ff378015.entry.js +106 -0
  38. package/dist/types/components/sqm-share-link/ShareLink.stories.d.ts +10 -0
  39. package/dist/types/components/sqm-share-link/UseShareLink.stories.d.ts +6 -0
  40. package/dist/types/components/sqm-share-link/sqm-share-link-view.d.ts +37 -0
  41. package/dist/types/components/sqm-share-link/sqm-share-link.d.ts +107 -2
  42. package/dist/types/components/sqm-share-link/useShareLink.d.ts +27 -4
  43. package/dist/types/components/tax-and-cash/sqm-banking-info-form/formDefinitions.d.ts +0 -2
  44. package/dist/types/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.d.ts +0 -4
  45. package/dist/types/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.d.ts +0 -165
  46. package/dist/types/components.d.ts +183 -242
  47. package/docs/docs.docx +0 -0
  48. package/docs/raisins.json +1 -1
  49. package/grapesjs/grapesjs.js +1 -1
  50. package/package.json +1 -1
  51. package/dist/esm-es5/ShadowViewAddon-53b9090b.js +0 -1
  52. package/dist/mint-components/p-17b32de7.system.entry.js +0 -1
  53. package/dist/mint-components/p-54ea8b9b.system.entry.js +0 -1
  54. package/dist/mint-components/p-7d16ee0e.entry.js +0 -108
  55. package/dist/mint-components/p-807ed3bf.system.js +0 -1
  56. package/dist/mint-components/p-de7bb373.entry.js +0 -9
  57. package/dist/mint-components/p-e9258d20.system.entry.js +0 -1
  58. package/dist/mint-components/p-e980472a.js +0 -463
@@ -27,7 +27,7 @@ const useInstantAccessRegistration = require('./useInstantAccessRegistration-239
27
27
  const useLeadFormState = require('./useLeadFormState-b4c2ab5b.js');
28
28
  const utilities = require('./utilities-fcdb9504.js');
29
29
  const ErrorView = require('./ErrorView-ee7b0f36.js');
30
- const ShadowViewAddon = require('./ShadowViewAddon-1d15cdf7.js');
30
+ const ShadowViewAddon = require('./ShadowViewAddon-19755faf.js');
31
31
  require('./sqm-portal-container-view-70a47420.js');
32
32
  const data = require('./data-8c8a08f6.js');
33
33
  const extractProps = require('./extractProps-e9c55ba8.js');
@@ -6054,7 +6054,6 @@ function useDemoShareCode(props) {
6054
6054
  borderRadius: props.borderRadius,
6055
6055
  borderColor: props.borderColor,
6056
6056
  buttonType: props.buttonType,
6057
- rewardStatus: "AVAILABLE",
6058
6057
  open,
6059
6058
  onClick: () => {
6060
6059
  // Should well supported: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
@@ -6114,6 +6113,111 @@ const ShareLink = class {
6114
6113
  * @uiGroup Style
6115
6114
  */
6116
6115
  this.buttonStyle = "icon";
6116
+ /**
6117
+ * Enable users to customize their referral link
6118
+ *
6119
+ * @uiName Customize URL
6120
+ * @uiType boolean
6121
+ */
6122
+ this.customizeUrl = false;
6123
+ /**
6124
+ * Text shown below the share link input to trigger customization
6125
+ *
6126
+ * @uiName Customize link label
6127
+ * @uiType string
6128
+ */
6129
+ this.customizeLinkLabel = "Customize Link";
6130
+ /**
6131
+ * Text for the save button in editing mode
6132
+ *
6133
+ * @uiName Save button label
6134
+ * @uiType string
6135
+ */
6136
+ this.saveLabelText = "Save";
6137
+ /**
6138
+ * Text for the cancel button in editing mode
6139
+ *
6140
+ * @uiName Cancel button label
6141
+ * @uiType string
6142
+ */
6143
+ this.cancelLabelText = "Cancel";
6144
+ /**
6145
+ * Message shown briefly after successfully saving a custom link
6146
+ *
6147
+ * @uiName Success message
6148
+ * @uiType string
6149
+ */
6150
+ this.successMessage = "Link updated successfully";
6151
+ /**
6152
+ * Title text shown when the custom link is already taken
6153
+ *
6154
+ * @uiName Existing code conflict error title
6155
+ * @uiType string
6156
+ */
6157
+ this.existingCodeConflictErrorTitle = "This link is already taken";
6158
+ /**
6159
+ * Description text shown when the custom link is already taken
6160
+ *
6161
+ * @uiName Existing code conflict error description
6162
+ * @uiType string
6163
+ */
6164
+ this.existingCodeConflictErrorDescription = "Try adding numbers, a dash or underscore to create a unique link.";
6165
+ /**
6166
+ * Title text shown when the link contains invalid characters
6167
+ *
6168
+ * @uiName Invalid characters error title
6169
+ * @uiType string
6170
+ */
6171
+ this.invalidCharactersErrorTitle = "Please use only letters, numbers, dashes and underscores";
6172
+ /**
6173
+ * Description text shown when the link contains invalid characters
6174
+ *
6175
+ * @uiName Invalid characters error description
6176
+ * @uiType string
6177
+ */
6178
+ this.invalidCharactersErrorDescription = "Special characters can break the link when sharing.";
6179
+ /**
6180
+ * Title text shown when the link contains profanity
6181
+ *
6182
+ * @uiName Profanity error title
6183
+ * @uiType string
6184
+ */
6185
+ this.profanityErrorTitle = "Please try a different link";
6186
+ /**
6187
+ * Description text shown when the link contains profanity
6188
+ *
6189
+ * @uiName Profanity error description
6190
+ * @uiType string
6191
+ */
6192
+ this.profanityErrorDescription = "This link contains a restricted word.";
6193
+ /**
6194
+ * Text describing the edit limit
6195
+ *
6196
+ * @uiName Edit limit text
6197
+ * @uiType string
6198
+ */
6199
+ this.editLimitText = "You can edit your link up to 5 times.";
6200
+ /**
6201
+ * Message shown when the edit limit has been reached. Use {supportLink} as a placeholder for the support link.
6202
+ *
6203
+ * @uiName Edit limit reached text
6204
+ * @uiType string
6205
+ */
6206
+ this.editLimitReachedText = "5 edit limit reached. To make more changes, please contact {supportLink}.";
6207
+ /**
6208
+ * Display text for the support link in the edit limit reached message
6209
+ *
6210
+ * @uiName Support link text
6211
+ * @uiType string
6212
+ */
6213
+ this.supportLinkText = "Support";
6214
+ /**
6215
+ * Tooltip text shown when link customization is disabled
6216
+ *
6217
+ * @uiName Customize disabled tooltip
6218
+ * @uiType string
6219
+ */
6220
+ this.customizeDisabledTooltip = "Link customization is not available.";
6117
6221
  domContextHooks_module.h$1(this);
6118
6222
  }
6119
6223
  disconnectedCallback() { }
@@ -6122,33 +6226,78 @@ const ShareLink = class {
6122
6226
  const props = index_module.isDemo()
6123
6227
  ? useDemoShareLink(thisProps)
6124
6228
  : ShadowViewAddon.useShareLink(thisProps);
6125
- return index.h(copyTextView.CopyTextView, Object.assign({}, props));
6229
+ return index.h(ShadowViewAddon.ShareLinkView, Object.assign({}, props));
6126
6230
  }
6127
6231
  };
6128
6232
  function useDemoShareLink(props) {
6233
+ var _a;
6129
6234
  const [open, setOpen] = domContextHooks_module.useState(false);
6235
+ const [isEditing, setIsEditing] = domContextHooks_module.useState(false);
6236
+ const [editValue, setEditValue] = domContextHooks_module.useState("");
6237
+ const [showSuccess, setShowSuccess] = domContextHooks_module.useState(false);
6130
6238
  const copyString = "https://www.example.com/sharelink/abc";
6131
- return cjs.cjs({
6132
- copyString: copyString,
6133
- tooltiptext: props.tooltiptext,
6134
- textAlign: props.textAlign,
6135
- buttonStyle: props.buttonStyle,
6136
- backgroundColor: props.backgroundColor,
6137
- textColor: props.textColor,
6138
- borderRadius: props.borderRadius,
6139
- buttonType: props.buttonType,
6140
- copyButtonLabel: props.copyButtonLabel,
6141
- borderColor: props.borderColor,
6142
- rewardStatus: "AVAILABLE",
6143
- open,
6144
- onClick: () => {
6145
- // Should well supported: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
6146
- // Only if called from a user-initiated event
6147
- navigator.clipboard.writeText(copyString);
6148
- setOpen(true);
6149
- setTimeout(() => setOpen(false), props.tooltiplifespan);
6239
+ const domainPrefix = "https://www.example.com/";
6240
+ const baseProps = {
6241
+ copyTextViewProps: {
6242
+ copyString,
6243
+ tooltiptext: props.tooltiptext,
6244
+ textAlign: props.textAlign,
6245
+ buttonStyle: props.buttonStyle,
6246
+ backgroundColor: props.backgroundColor,
6247
+ textColor: props.textColor,
6248
+ borderRadius: props.borderRadius,
6249
+ buttonType: props.buttonType,
6250
+ copyButtonLabel: props.copyButtonLabel,
6251
+ borderColor: props.borderColor,
6252
+ open,
6253
+ onClick: () => {
6254
+ navigator.clipboard.writeText(copyString);
6255
+ setOpen(true);
6256
+ setTimeout(() => setOpen(false), props.tooltiplifespan);
6257
+ },
6150
6258
  },
6151
- }, props.demoData || {}, { arrayMerge: (_, a) => a });
6259
+ customizeUrl: props.customizeUrl,
6260
+ customizeLinkLabel: props.customizeLinkLabel,
6261
+ saveLabelText: props.saveLabelText,
6262
+ cancelLabelText: props.cancelLabelText,
6263
+ successMessage: props.successMessage,
6264
+ isEditing,
6265
+ editValue,
6266
+ domainPrefix,
6267
+ editsRemaining: 5,
6268
+ maxEdits: 5,
6269
+ limitReached: false,
6270
+ validationError: null,
6271
+ isValidating: false,
6272
+ isSaving: false,
6273
+ showSuccess,
6274
+ characterLimit: 15,
6275
+ charactersRemaining: 15 - editValue.length,
6276
+ editLimitText: props.editLimitText,
6277
+ editLimitReachedText: props.editLimitReachedText,
6278
+ supportLinkText: props.supportLinkText,
6279
+ customizeDisabled: false,
6280
+ customizeDisabledTooltip: (_a = props.customizeDisabledTooltip) !== null && _a !== void 0 ? _a : "Link customization is not available.",
6281
+ onCustomizeClick: () => {
6282
+ setIsEditing(true);
6283
+ setEditValue("");
6284
+ },
6285
+ onEditValueChange: (value) => {
6286
+ setEditValue(value);
6287
+ },
6288
+ onSave: () => {
6289
+ setIsEditing(false);
6290
+ setShowSuccess(true);
6291
+ setTimeout(() => setShowSuccess(false), 3000);
6292
+ },
6293
+ onCancel: () => {
6294
+ setIsEditing(false);
6295
+ setEditValue("");
6296
+ },
6297
+ };
6298
+ return cjs.cjs(baseProps, props.demoData || {}, {
6299
+ arrayMerge: (_, a) => a,
6300
+ });
6152
6301
  }
6153
6302
 
6154
6303
  const StatContainer = class {
@@ -33,7 +33,7 @@ require('./utilities-fcdb9504.js');
33
33
  const sqmPortalResetPasswordView = require('./sqm-portal-reset-password-view-6b1acd90.js');
34
34
  require('./ErrorView-ee7b0f36.js');
35
35
  const sqmQrCodeView = require('./sqm-qr-code-view-1f2daa76.js');
36
- const ShadowViewAddon = require('./ShadowViewAddon-1d15cdf7.js');
36
+ const ShadowViewAddon = require('./ShadowViewAddon-19755faf.js');
37
37
  const sqmPortalContainerView = require('./sqm-portal-container-view-70a47420.js');
38
38
  const sqmUserInfoFormView = require('./sqm-user-info-form-view-53306f6e.js');
39
39
  const data = require('./data-8c8a08f6.js');
@@ -14054,21 +14054,151 @@ const CustomStyles$1 = () => {
14054
14054
  return index.h(copyTextView.CopyTextView, Object.assign({}, props));
14055
14055
  };
14056
14056
  const CustomStylesWithDemoHooks = () => {
14057
- const props = {
14058
- copyString: "https://noah.example.com",
14059
- open: false,
14060
- tooltiptext: "Copied!",
14061
- backgroundColor: "#1ed760",
14062
- borderRadius: "30px",
14063
- textColor: "red",
14064
- buttonType: "primary",
14065
- borderColor: "#121212",
14066
- };
14067
- return (index.h("sqm-share-link", { demoData: { ...props }, backgroundColor: "#1ed760" }));
14057
+ return (index.h("sqm-share-link", { demoData: {
14058
+ copyTextViewProps: {
14059
+ copyString: "https://noah.example.com",
14060
+ open: false,
14061
+ tooltiptext: "Copied!",
14062
+ backgroundColor: "#1ed760",
14063
+ borderRadius: "30px",
14064
+ textColor: "red",
14065
+ buttonType: "primary",
14066
+ borderColor: "#121212",
14067
+ },
14068
+ }, backgroundColor: "#1ed760" }));
14068
14069
  };
14069
14070
  const FullStack = () => {
14070
14071
  return index.h("sqm-share-link", null);
14071
14072
  };
14073
+ // Customize URL stories
14074
+ const noopFn = () => { };
14075
+ const defaultCustomizeProps = {
14076
+ copyTextViewProps: {
14077
+ copyString: "https://ssqt.co/abc123",
14078
+ open: false,
14079
+ tooltiptext: "Copied!",
14080
+ },
14081
+ customizeUrl: true,
14082
+ customizeLinkLabel: "Customize Link",
14083
+ saveLabelText: "Save",
14084
+ cancelLabelText: "Cancel",
14085
+ successMessage: "Link updated successfully",
14086
+ isEditing: false,
14087
+ editValue: "",
14088
+ domainPrefix: "https://ssqt.co/",
14089
+ editsRemaining: 3,
14090
+ maxEdits: 5,
14091
+ limitReached: false,
14092
+ validationError: null,
14093
+ isValidating: false,
14094
+ isSaving: false,
14095
+ showSuccess: false,
14096
+ characterLimit: 15,
14097
+ charactersRemaining: 15,
14098
+ editLimitText: "You can edit your link up to 5 times.",
14099
+ editLimitReachedText: "5 edit limit reached. To make more changes, please contact {supportLink}.",
14100
+ supportLinkText: "Support",
14101
+ customizeDisabled: false,
14102
+ customizeDisabledTooltip: "Link customization is not available.",
14103
+ onCustomizeClick: noopFn,
14104
+ onEditValueChange: noopFn,
14105
+ onSave: noopFn,
14106
+ onCancel: noopFn,
14107
+ };
14108
+ const CustomizeUrlDefault = () => {
14109
+ return index.h(ShadowViewAddon.ShareLinkView, Object.assign({}, defaultCustomizeProps));
14110
+ };
14111
+ const CustomizeUrlEditing = () => {
14112
+ return (index.h(ShadowViewAddon.ShareLinkView, Object.assign({}, {
14113
+ ...defaultCustomizeProps,
14114
+ isEditing: true,
14115
+ editValue: "nvoiwb18",
14116
+ charactersRemaining: 7,
14117
+ })));
14118
+ };
14119
+ const CustomizeUrlCustomized = () => {
14120
+ return (index.h(ShadowViewAddon.ShareLinkView, Object.assign({}, {
14121
+ ...defaultCustomizeProps,
14122
+ copyTextViewProps: {
14123
+ ...defaultCustomizeProps.copyTextViewProps,
14124
+ copyString: "https://ssqt.co/bobtesterson",
14125
+ },
14126
+ })));
14127
+ };
14128
+ const CustomizeUrlLimitReached = () => {
14129
+ return (index.h(ShadowViewAddon.ShareLinkView, Object.assign({}, {
14130
+ ...defaultCustomizeProps,
14131
+ copyTextViewProps: {
14132
+ ...defaultCustomizeProps.copyTextViewProps,
14133
+ copyString: "https://ssqt.co/bobtesterson",
14134
+ },
14135
+ editsRemaining: 0,
14136
+ limitReached: true,
14137
+ })));
14138
+ };
14139
+ const CustomizeUrlDisabled = () => {
14140
+ return (index.h(ShadowViewAddon.ShareLinkView, Object.assign({}, {
14141
+ ...defaultCustomizeProps,
14142
+ customizeDisabled: true,
14143
+ })));
14144
+ };
14145
+ const CustomizeUrlValidationError = () => {
14146
+ return (index.h(ShadowViewAddon.ShareLinkView, Object.assign({}, {
14147
+ ...defaultCustomizeProps,
14148
+ isEditing: true,
14149
+ editValue: "nvoiwb18",
14150
+ charactersRemaining: 7,
14151
+ validationError: {
14152
+ code: "EXISTING_CODE_CONFLICT",
14153
+ title: "This link is already taken",
14154
+ description: "Try adding numbers, a dash or underscore to create a unique link.",
14155
+ },
14156
+ })));
14157
+ };
14158
+ const CustomizeUrlInvalidCharacters = () => {
14159
+ return (index.h(ShadowViewAddon.ShareLinkView, Object.assign({}, {
14160
+ ...defaultCustomizeProps,
14161
+ isEditing: true,
14162
+ editValue: "nvoiwb18",
14163
+ charactersRemaining: 7,
14164
+ validationError: {
14165
+ code: "INVALID_CHARACTERS",
14166
+ title: "Please use only letters, numbers, dashes and underscores",
14167
+ description: "Special characters can break the link when sharing.",
14168
+ },
14169
+ })));
14170
+ };
14171
+ const CustomizeUrlProfanity = () => {
14172
+ return (index.h(ShadowViewAddon.ShareLinkView, Object.assign({}, {
14173
+ ...defaultCustomizeProps,
14174
+ isEditing: true,
14175
+ editValue: "nvoiwb18",
14176
+ charactersRemaining: 7,
14177
+ validationError: {
14178
+ code: "PROFANITY",
14179
+ title: "Please try a different link",
14180
+ description: "This link contains a restricted word.",
14181
+ },
14182
+ })));
14183
+ };
14184
+ const CustomizeUrlSaving = () => {
14185
+ return (index.h(ShadowViewAddon.ShareLinkView, Object.assign({}, {
14186
+ ...defaultCustomizeProps,
14187
+ isEditing: true,
14188
+ editValue: "bobtesterson",
14189
+ isSaving: true,
14190
+ })));
14191
+ };
14192
+ const CustomizeUrlSuccess = () => {
14193
+ return (index.h(ShadowViewAddon.ShareLinkView, Object.assign({}, {
14194
+ ...defaultCustomizeProps,
14195
+ copyTextViewProps: {
14196
+ ...defaultCustomizeProps.copyTextViewProps,
14197
+ copyString: "https://ssqt.co/bobtesterson",
14198
+ },
14199
+ showSuccess: true,
14200
+ })));
14201
+ };
14072
14202
 
14073
14203
  const ShareLink = /*#__PURE__*/Object.freeze({
14074
14204
  __proto__: null,
@@ -14083,7 +14213,17 @@ const ShareLink = /*#__PURE__*/Object.freeze({
14083
14213
  CopyButtonBelow: CopyButtonBelow$3,
14084
14214
  CustomStyles: CustomStyles$1,
14085
14215
  CustomStylesWithDemoHooks: CustomStylesWithDemoHooks,
14086
- FullStack: FullStack
14216
+ FullStack: FullStack,
14217
+ CustomizeUrlDefault: CustomizeUrlDefault,
14218
+ CustomizeUrlEditing: CustomizeUrlEditing,
14219
+ CustomizeUrlCustomized: CustomizeUrlCustomized,
14220
+ CustomizeUrlLimitReached: CustomizeUrlLimitReached,
14221
+ CustomizeUrlDisabled: CustomizeUrlDisabled,
14222
+ CustomizeUrlValidationError: CustomizeUrlValidationError,
14223
+ CustomizeUrlInvalidCharacters: CustomizeUrlInvalidCharacters,
14224
+ CustomizeUrlProfanity: CustomizeUrlProfanity,
14225
+ CustomizeUrlSaving: CustomizeUrlSaving,
14226
+ CustomizeUrlSuccess: CustomizeUrlSuccess
14087
14227
  });
14088
14228
 
14089
14229
  const UseShareLink_stories = {
@@ -14121,11 +14261,11 @@ const BareBonesView$1 = createHookStory(() => {
14121
14261
  return (index.h("div", null,
14122
14262
  "Sharelink:",
14123
14263
  " ",
14124
- index.h("code", { style: { borderStyle: "solid", borderWidth: "1px", padding: "2px" } }, res.copyString)));
14264
+ index.h("code", { style: { borderStyle: "solid", borderWidth: "1px", padding: "2px" } }, res.copyTextViewProps.copyString)));
14125
14265
  });
14126
14266
  const RegularView$2 = createHookStory(() => {
14127
14267
  setupGraphQL$c();
14128
- return (index.h(copyTextView.CopyTextView, Object.assign({}, ShadowViewAddon.useShareLink({
14268
+ return (index.h(ShadowViewAddon.ShareLinkView, Object.assign({}, ShadowViewAddon.useShareLink({
14129
14269
  programId: "klip-referral-program",
14130
14270
  tooltiptext: "Copied to clipboard",
14131
14271
  tooltiplifespan: 1000,
@@ -14133,19 +14273,29 @@ const RegularView$2 = createHookStory(() => {
14133
14273
  });
14134
14274
  const FastTooltip = createHookStory(() => {
14135
14275
  setupGraphQL$c();
14136
- return (index.h(copyTextView.CopyTextView, Object.assign({}, ShadowViewAddon.useShareLink({
14276
+ return (index.h(ShadowViewAddon.ShareLinkView, Object.assign({}, ShadowViewAddon.useShareLink({
14137
14277
  programId: "klip-referral-program",
14138
- tooltiptext: "⠀⠀⠀⠀⠀⠀⠀⠀⠀HELLO THERE!!!\n⠀⠀⠀⡯⡯⡾⠝⠘⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢊⠘⡮⣣⠪⠢⡑⡌\n⠀⠀⠀⠟⠝⠈⠀⠀⠀⠡⠀⠠⢈⠠⢐⢠⢂⢔⣐⢄⡂⢔⠀⡁⢉⠸⢨⢑⠕⡌\n⠀⠀⡀⠁⠀⠀⠀⡀⢂⠡⠈⡔⣕⢮⣳⢯⣿⣻⣟⣯⣯⢷⣫⣆⡂⠀⠀⢐⠑⡌\n⢀⠠⠐⠈⠀⢀⢂⠢⡂⠕⡁⣝⢮⣳⢽⡽⣾⣻⣿⣯⡯⣟⣞⢾⢜⢆⠀⡀⠀⠪\n⣬⠂⠀⠀⢀⢂⢪⠨⢂⠥⣺⡪⣗⢗⣽⢽⡯⣿⣽⣷⢿⡽⡾⡽⣝⢎⠀⠀⠀⢡\n⣿⠀⠀⠀⢂⠢⢂⢥⢱⡹⣪⢞⡵⣻⡪⡯⡯⣟⡾⣿⣻⡽⣯⡻⣪⠧⠑⠀⠁⢐\n⣿⠀⠀⠀⠢⢑⠠⠑⠕⡝⡎⡗⡝⡎⣞⢽⡹⣕⢯⢻⠹⡹⢚⠝⡷⡽⡨⠀⠀⢔\n⣿⡯⠀⢈⠈⢄⠂⠂⠐⠀⠌⠠⢑⠱⡱⡱⡑⢔⠁⠀⡀⠐⠐⠐⡡⡹⣪⠀⠀⢘\n⣿⣽⠀⡀⡊⠀⠐⠨⠈⡁⠂⢈⠠⡱⡽⣷⡑⠁⠠⠑⠀⢉⢇⣤⢘⣪⢽⠀⢌⢎\n⣿⢾⠀⢌⠌⠀⡁⠢⠂⠐⡀⠀⢀⢳⢽⣽⡺⣨⢄⣑⢉⢃⢭⡲⣕⡭⣹⠠⢐⢗\n⣿⡗⠀⠢⠡⡱⡸⣔⢵⢱⢸⠈⠀⡪⣳⣳⢹⢜⡵⣱⢱⡱⣳⡹⣵⣻⢔⢅⢬⡷\n⣷⡇⡂⠡⡑⢕⢕⠕⡑⠡⢂⢊⢐⢕⡝⡮⡧⡳⣝⢴⡐⣁⠃⡫⡒⣕⢏⡮⣷⡟\n⣷⣻⣅⠑⢌⠢⠁⢐⠠⠑⡐⠐⠌⡪⠮⡫⠪⡪⡪⣺⢸⠰⠡⠠⠐⢱⠨⡪⡪⡰\n⣯⢷⣟⣇⡂⡂⡌⡀⠀⠁⡂⠅⠂⠀⡑⡄⢇⠇⢝⡨⡠⡁⢐⠠⢀⢪⡐⡜⡪⡊\n⣿⢽⡾⢹⡄⠕⡅⢇⠂⠑⣴⡬⣬⣬⣆⢮⣦⣷⣵⣷⡗⢃⢮⠱⡸⢰⢱⢸⢨⢌\n⣯⢯⣟⠸⣳⡅⠜⠔⡌⡐⠈⠻⠟⣿⢿⣿⣿⠿⡻⣃⠢⣱⡳⡱⡩⢢⠣⡃⠢⠁\n⡯⣟⣞⡇⡿⣽⡪⡘⡰⠨⢐⢀⠢⢢⢄⢤⣰⠼⡾⢕⢕⡵⣝⠎⢌⢪⠪⡘⡌⠀\n⡯⣳⠯⠚⢊⠡⡂⢂⠨⠊⠔⡑⠬⡸⣘⢬⢪⣪⡺⡼⣕⢯⢞⢕⢝⠎⢻⢼⣀⠀\n⠁⡂⠔⡁⡢⠣⢀⠢⠀⠅⠱⡐⡱⡘⡔⡕⡕⣲⡹⣎⡮⡏⡑⢜⢼⡱⢩⣗⣯⣟\n⢀⢂⢑⠀⡂⡃⠅⠊⢄⢑⠠⠑⢕⢕⢝⢮⢺⢕⢟⢮⢊⢢⢱⢄⠃⣇⣞⢞⣞⢾\n⢀⠢⡑⡀⢂⢊⠠⠁⡂⡐⠀⠅⡈⠪⠪⠪⠣⠫⠑⡁⢔⠕⣜⣜⢦⡰⡎⡯⡾⡽",
14278
+ tooltiptext: "Copied to clipboard",
14139
14279
  tooltiplifespan: 500,
14140
14280
  }))));
14141
14281
  });
14282
+ const CustomizeUrlEnabled = createHookStory(() => {
14283
+ setupGraphQL$c();
14284
+ return (index.h(ShadowViewAddon.ShareLinkView, Object.assign({}, ShadowViewAddon.useShareLink({
14285
+ programId: "klip-referral-program",
14286
+ tooltiptext: "Copied to clipboard",
14287
+ tooltiplifespan: 1000,
14288
+ customizeUrl: true,
14289
+ }))));
14290
+ });
14142
14291
 
14143
14292
  const UseShareLink = /*#__PURE__*/Object.freeze({
14144
14293
  __proto__: null,
14145
14294
  'default': UseShareLink_stories,
14146
14295
  BareBonesView: BareBonesView$1,
14147
14296
  RegularView: RegularView$2,
14148
- FastTooltip: FastTooltip
14297
+ FastTooltip: FastTooltip,
14298
+ CustomizeUrlEnabled: CustomizeUrlEnabled
14149
14299
  });
14150
14300
 
14151
14301
  const scenario$C = "@author:Zach\n@owner:Zach\nFeature: Tabs\n\n The Tabs takes in the Tab component as children and maps through to display their header and content.\n\n Background: A user on the portal is viewing the widget\n Given a user viewing the Tabs component\n\n @motivating\n Scenario: Content inside the active tab is shown\n Given the header is set to <tabHeader>\n And the content inside is <tabContent>\n And the user has clicked <tabHeader>\n Then the <tabContent> is shown\n Examples:\n | tabHeader | tabContent |\n | Settings | This is the settings tab |\n | General | This is the general tab |\n | History | This is the history tab |\n\n @motivating\n @ui\n Scenario: The placement of the tabs is configurable\n Given The placement prop has been passed a valid <placement>\n Then tabs are placed on the <placementResult>\n Examples:\n | placement | placementResult |\n | | top of the content |\n | left | left hand side of the content |\n | right | right hand side of the content |\n | bottom | bottom of the content |\n\n\n @minutia\n @ui\n Scenario Outline: Tabs are setup to use the brand color\n Given the brand color is set to darkblue\n Then the text inside the active tab is darkblue\n And the underline of the active tab is darkblue\n\n @ui\n Scenario: Tabs are responsive\n Given the user is on a mobile device\n When there are more tabs than the horizontal space allows for\n Then clickable arrows appear on the left and right of the tabs\n And the tabs are scrollable\n\n @landmine\n Scenario: Program section cannot be used inside of tabs\n Given a tabs component\n And tab containing a program section with program-id \"test123\"\n And the program section wraps a component using program context\n When the tabs component is rendered\n Then the \"sq:program-id\" event listener for the program section is removed\n And the component does not use program-id \"test123\" to source its data\n And falls back to the global program id";
@@ -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,148 @@ 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
+ customizeUrl: true,
106
+ customizeLinkLabel: "Customize Link",
107
+ saveLabelText: "Save",
108
+ cancelLabelText: "Cancel",
109
+ successMessage: "Link updated successfully",
110
+ isEditing: false,
111
+ editValue: "",
112
+ domainPrefix: "https://ssqt.co/",
113
+ editsRemaining: 3,
114
+ maxEdits: 5,
115
+ limitReached: false,
116
+ validationError: null,
117
+ isValidating: false,
118
+ isSaving: false,
119
+ showSuccess: false,
120
+ characterLimit: 15,
121
+ charactersRemaining: 15,
122
+ editLimitText: "You can edit your link up to 5 times.",
123
+ editLimitReachedText: "5 edit limit reached. To make more changes, please contact {supportLink}.",
124
+ supportLinkText: "Support",
125
+ customizeDisabled: false,
126
+ customizeDisabledTooltip: "Link customization is not available.",
127
+ onCustomizeClick: noopFn,
128
+ onEditValueChange: noopFn,
129
+ onSave: noopFn,
130
+ onCancel: noopFn,
131
+ };
132
+ export const CustomizeUrlDefault = () => {
133
+ return h(ShareLinkView, Object.assign({}, defaultCustomizeProps));
134
+ };
135
+ export const CustomizeUrlEditing = () => {
136
+ return (h(ShareLinkView, Object.assign({}, {
137
+ ...defaultCustomizeProps,
138
+ isEditing: true,
139
+ editValue: "nvoiwb18",
140
+ charactersRemaining: 7,
141
+ })));
142
+ };
143
+ export const CustomizeUrlCustomized = () => {
144
+ return (h(ShareLinkView, Object.assign({}, {
145
+ ...defaultCustomizeProps,
146
+ copyTextViewProps: {
147
+ ...defaultCustomizeProps.copyTextViewProps,
148
+ copyString: "https://ssqt.co/bobtesterson",
149
+ },
150
+ })));
151
+ };
152
+ export const CustomizeUrlLimitReached = () => {
153
+ return (h(ShareLinkView, Object.assign({}, {
154
+ ...defaultCustomizeProps,
155
+ copyTextViewProps: {
156
+ ...defaultCustomizeProps.copyTextViewProps,
157
+ copyString: "https://ssqt.co/bobtesterson",
158
+ },
159
+ editsRemaining: 0,
160
+ limitReached: true,
161
+ })));
162
+ };
163
+ export const CustomizeUrlDisabled = () => {
164
+ return (h(ShareLinkView, Object.assign({}, {
165
+ ...defaultCustomizeProps,
166
+ customizeDisabled: true,
167
+ })));
168
+ };
169
+ export const CustomizeUrlValidationError = () => {
170
+ return (h(ShareLinkView, Object.assign({}, {
171
+ ...defaultCustomizeProps,
172
+ isEditing: true,
173
+ editValue: "nvoiwb18",
174
+ charactersRemaining: 7,
175
+ validationError: {
176
+ code: "EXISTING_CODE_CONFLICT",
177
+ title: "This link is already taken",
178
+ description: "Try adding numbers, a dash or underscore to create a unique link.",
179
+ },
180
+ })));
181
+ };
182
+ export const CustomizeUrlInvalidCharacters = () => {
183
+ return (h(ShareLinkView, Object.assign({}, {
184
+ ...defaultCustomizeProps,
185
+ isEditing: true,
186
+ editValue: "nvoiwb18",
187
+ charactersRemaining: 7,
188
+ validationError: {
189
+ code: "INVALID_CHARACTERS",
190
+ title: "Please use only letters, numbers, dashes and underscores",
191
+ description: "Special characters can break the link when sharing.",
192
+ },
193
+ })));
194
+ };
195
+ export const CustomizeUrlProfanity = () => {
196
+ return (h(ShareLinkView, Object.assign({}, {
197
+ ...defaultCustomizeProps,
198
+ isEditing: true,
199
+ editValue: "nvoiwb18",
200
+ charactersRemaining: 7,
201
+ validationError: {
202
+ code: "PROFANITY",
203
+ title: "Please try a different link",
204
+ description: "This link contains a restricted word.",
205
+ },
206
+ })));
207
+ };
208
+ export const CustomizeUrlSaving = () => {
209
+ return (h(ShareLinkView, Object.assign({}, {
210
+ ...defaultCustomizeProps,
211
+ isEditing: true,
212
+ editValue: "bobtesterson",
213
+ isSaving: true,
214
+ })));
215
+ };
216
+ export const CustomizeUrlSuccess = () => {
217
+ return (h(ShareLinkView, Object.assign({}, {
218
+ ...defaultCustomizeProps,
219
+ copyTextViewProps: {
220
+ ...defaultCustomizeProps.copyTextViewProps,
221
+ copyString: "https://ssqt.co/bobtesterson",
222
+ },
223
+ showSuccess: true,
224
+ })));
225
+ };