@servicetitan/mpa-components 1.9.0 → 1.11.0

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 (119) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/lib/components/brands/brand-card/brand-card.d.ts +4 -0
  3. package/lib/components/brands/brand-card/brand-card.d.ts.map +1 -0
  4. package/lib/components/brands/brand-card/brand-card.js +61 -0
  5. package/lib/components/brands/brand-card/brand-card.js.map +1 -0
  6. package/lib/components/brands/cards-grid/cards-grid.d.ts +6 -0
  7. package/lib/components/brands/cards-grid/cards-grid.d.ts.map +1 -0
  8. package/lib/components/brands/cards-grid/cards-grid.js +8 -0
  9. package/lib/components/brands/cards-grid/cards-grid.js.map +1 -0
  10. package/lib/components/brands/index.d.ts +2 -0
  11. package/lib/components/brands/index.d.ts.map +1 -0
  12. package/lib/components/brands/index.js +2 -0
  13. package/lib/components/brands/index.js.map +1 -0
  14. package/lib/components/brands/styles.module.less +73 -0
  15. package/lib/components/campaign-actions/action-button/action-button-archive.js +1 -1
  16. package/lib/components/campaign-actions/action-button/action-button-archive.js.map +1 -1
  17. package/lib/components/campaign-actions/action-button/action-button-clone.js +1 -1
  18. package/lib/components/campaign-actions/action-button/action-button-clone.js.map +1 -1
  19. package/lib/components/campaign-actions/action-button/action-button-edit.js +1 -1
  20. package/lib/components/campaign-actions/action-button/action-button-edit.js.map +1 -1
  21. package/lib/components/campaign-actions/action-button/action-button-unarchive.js +1 -1
  22. package/lib/components/campaign-actions/action-button/action-button-unarchive.js.map +1 -1
  23. package/lib/components/campaign-actions/action-button/action-button.js +2 -2
  24. package/lib/components/campaign-actions/action-button/action-button.js.map +1 -1
  25. package/lib/components/campaign-actions/actions-button/actions-button.js +2 -2
  26. package/lib/components/campaign-actions/actions-button/actions-button.js.map +1 -1
  27. package/lib/components/campaign-actions/actions-button/campaign-actions.js +2 -2
  28. package/lib/components/campaign-actions/actions-button/campaign-actions.js.map +1 -1
  29. package/lib/components/settings/company-details/index.js +2 -2
  30. package/lib/components/settings/company-details/index.js.map +1 -1
  31. package/lib/components/settings/company-email-footer/company-email-footer.stories.d.ts +0 -1
  32. package/lib/components/settings/company-email-footer/company-email-footer.stories.d.ts.map +1 -1
  33. package/lib/components/settings/company-email-footer/index.js +2 -2
  34. package/lib/components/settings/company-email-footer/index.js.map +1 -1
  35. package/lib/components/settings/company-email-reply-to/company-email-reply-to.stories.d.ts +0 -1
  36. package/lib/components/settings/company-email-reply-to/company-email-reply-to.stories.d.ts.map +1 -1
  37. package/lib/components/settings/company-email-reply-to/index.js +1 -1
  38. package/lib/components/settings/company-email-reply-to/index.js.map +1 -1
  39. package/lib/components/settings/company-email-sender/company-email-sender.stories.d.ts +0 -1
  40. package/lib/components/settings/company-email-sender/company-email-sender.stories.d.ts.map +1 -1
  41. package/lib/components/settings/company-email-sender/custom-domain-sender.js +3 -3
  42. package/lib/components/settings/company-email-sender/custom-domain-sender.js.map +1 -1
  43. package/lib/components/settings/company-email-sender/simple-sender.js +1 -1
  44. package/lib/components/settings/company-email-sender/simple-sender.js.map +1 -1
  45. package/lib/components/settings/company-trade-checkbox/index.d.ts +0 -1
  46. package/lib/components/settings/company-trade-checkbox/index.d.ts.map +1 -1
  47. package/lib/components/settings/company-trade-checkbox/index.js +1 -1
  48. package/lib/components/settings/company-trade-checkbox/index.js.map +1 -1
  49. package/lib/components/settings/company-trades-picker/company-trades-picker.stories.js +4 -1
  50. package/lib/components/settings/company-trades-picker/company-trades-picker.stories.js.map +1 -1
  51. package/lib/components/settings/company-trades-picker/index.js +5 -5
  52. package/lib/components/settings/company-trades-picker/index.js.map +1 -1
  53. package/lib/components/settings/double-opt-in/double-opt-in.stories.d.ts +0 -1
  54. package/lib/components/settings/double-opt-in/double-opt-in.stories.d.ts.map +1 -1
  55. package/lib/components/settings/double-opt-in/index.js +1 -1
  56. package/lib/components/settings/double-opt-in/index.js.map +1 -1
  57. package/lib/components/settings/email-preview/email-preview.js +1 -1
  58. package/lib/components/settings/email-preview/email-preview.js.map +1 -1
  59. package/lib/components/settings/email-preview/opt-in-email-preview.js.map +1 -1
  60. package/lib/components/settings/email-preview/opt-out-email-preview.js.map +1 -1
  61. package/lib/components/settings/email-validation/email-validation.stories.js +26 -37
  62. package/lib/components/settings/email-validation/email-validation.stories.js.map +1 -1
  63. package/lib/components/settings/email-validation/index.d.ts.map +1 -1
  64. package/lib/components/settings/email-validation/index.js +2 -2
  65. package/lib/components/settings/email-validation/index.js.map +1 -1
  66. package/lib/components/settings/form-errors-list/index.js +2 -2
  67. package/lib/components/settings/form-errors-list/index.js.map +1 -1
  68. package/lib/components/settings/logo-picker/index.js +5 -14
  69. package/lib/components/settings/logo-picker/index.js.map +1 -1
  70. package/lib/components/settings/opt-out-message/index.js +1 -1
  71. package/lib/components/settings/opt-out-message/index.js.map +1 -1
  72. package/lib/components/settings/opt-out-message/opt-out-message.stories.d.ts +0 -1
  73. package/lib/components/settings/opt-out-message/opt-out-message.stories.d.ts.map +1 -1
  74. package/lib/components/settings/result-definitions-modal/header.js +1 -1
  75. package/lib/components/settings/result-definitions-modal/header.js.map +1 -1
  76. package/lib/components/settings/result-definitions-modal/index.js +1 -1
  77. package/lib/components/settings/result-definitions-modal/index.js.map +1 -1
  78. package/lib/components/settings/result-definitions-modal/row.js +1 -1
  79. package/lib/components/settings/result-definitions-modal/row.js.map +1 -1
  80. package/lib/components/settings/settings-section/index.js +1 -1
  81. package/lib/components/settings/settings-section/index.js.map +1 -1
  82. package/lib/components/settings/settings-section/settings-section.stories.d.ts +0 -1
  83. package/lib/components/settings/settings-section/settings-section.stories.d.ts.map +1 -1
  84. package/lib/components/settings/settings-section/settings-section.stories.js +1 -1
  85. package/lib/components/settings/settings-section/settings-section.stories.js.map +1 -1
  86. package/lib/enums/brands.d.ts +21 -0
  87. package/lib/enums/brands.d.ts.map +1 -0
  88. package/lib/enums/brands.js +2 -0
  89. package/lib/enums/brands.js.map +1 -0
  90. package/lib/index.d.ts +1 -0
  91. package/lib/index.d.ts.map +1 -1
  92. package/lib/index.js +1 -0
  93. package/lib/index.js.map +1 -1
  94. package/lib/utils/helpers.js +1 -1
  95. package/lib/utils/helpers.js.map +1 -1
  96. package/package.json +15 -11
  97. package/src/components/brands/brand-card/brand-card.tsx +245 -0
  98. package/src/components/brands/cards-grid/cards-grid.tsx +16 -0
  99. package/src/components/brands/index.ts +1 -0
  100. package/src/components/brands/styles.module.less +73 -0
  101. package/src/components/brands/styles.module.less.d.ts +11 -0
  102. package/src/components/settings/company-details/index.tsx +1 -1
  103. package/src/components/settings/company-email-footer/index.tsx +1 -1
  104. package/src/components/settings/company-email-reply-to/index.tsx +1 -1
  105. package/src/components/settings/company-email-sender/custom-domain-sender.tsx +4 -4
  106. package/src/components/settings/company-email-sender/simple-sender.tsx +2 -2
  107. package/src/components/settings/company-trades-picker/company-trades-picker.stories.tsx +2 -2
  108. package/src/components/settings/company-trades-picker/index.tsx +1 -1
  109. package/src/components/settings/double-opt-in/index.tsx +3 -3
  110. package/src/components/settings/email-preview/email-preview.tsx +1 -1
  111. package/src/components/settings/email-preview/opt-in-email-preview.tsx +1 -1
  112. package/src/components/settings/email-validation/index.tsx +5 -5
  113. package/src/components/settings/form-errors-list/index.tsx +2 -2
  114. package/src/components/settings/logo-picker/index.tsx +2 -2
  115. package/src/components/settings/opt-out-message/index.tsx +2 -2
  116. package/src/components/settings/settings-section/index.tsx +1 -1
  117. package/src/enums/brands.ts +23 -0
  118. package/src/index.ts +1 -1
  119. package/tsconfig.tsbuildinfo +1 -1
@@ -40,7 +40,7 @@ export const CompanyEmailSender: FC<CompanyEmailSenderProps> = observer(
40
40
 
41
41
  senderName.onChange(data.value);
42
42
  },
43
- [senderName]
43
+ [senderName],
44
44
  );
45
45
 
46
46
  const handleSenderDomainChange = useCallback(
@@ -51,7 +51,7 @@ export const CompanyEmailSender: FC<CompanyEmailSenderProps> = observer(
51
51
 
52
52
  senderDomain.onChange(data.value);
53
53
  },
54
- [senderDomain]
54
+ [senderDomain],
55
55
  );
56
56
 
57
57
  const handleSenderEmailChange = useCallback(
@@ -62,7 +62,7 @@ export const CompanyEmailSender: FC<CompanyEmailSenderProps> = observer(
62
62
 
63
63
  senderEmail.onChange(data.value);
64
64
  },
65
- [senderEmail]
65
+ [senderEmail],
66
66
  );
67
67
 
68
68
  return (
@@ -156,5 +156,5 @@ export const CompanyEmailSender: FC<CompanyEmailSenderProps> = observer(
156
156
  </Form>
157
157
  </SettingsSection>
158
158
  );
159
- }
159
+ },
160
160
  );
@@ -22,7 +22,7 @@ export const CompanyEmailSender: FC<CompanyEmailSender> = observer(
22
22
 
23
23
  senderName.onChange(data.value);
24
24
  },
25
- [senderName]
25
+ [senderName],
26
26
  );
27
27
 
28
28
  const handleSenderEmailBlur = useCallback(() => {
@@ -71,5 +71,5 @@ export const CompanyEmailSender: FC<CompanyEmailSender> = observer(
71
71
  </Form>
72
72
  </SettingsSection>
73
73
  );
74
- }
74
+ },
75
75
  );
@@ -68,10 +68,10 @@ export function CompanyTradesPicker() {
68
68
  trades.map(trade => ({
69
69
  ...trade,
70
70
  active: trade.value === t ? !trade.active : trade.active,
71
- }))
71
+ })),
72
72
  );
73
73
  },
74
- [trades]
74
+ [trades],
75
75
  );
76
76
 
77
77
  return <Component<TradeType> trades={trades} onTradeChange={selectTrade} />;
@@ -40,7 +40,7 @@ export function CompanyTradesPicker<T extends string | number = string>({
40
40
  }: CompanyTradesPickerProps<T>) {
41
41
  const rows = useMemo(
42
42
  () => chunk(trades, columns).map((row, idx) => ({ row, key: `row=${idx}` })),
43
- [trades, columns]
43
+ [trades, columns],
44
44
  );
45
45
 
46
46
  return (
@@ -40,7 +40,7 @@ export const DoubleOptIn: FC<DoubleOptInProps> = observer(
40
40
  onHandleClickEnable?.(checked);
41
41
  enabled.onChange(checked);
42
42
  },
43
- [enabled, onHandleClickEnable]
43
+ [enabled, onHandleClickEnable],
44
44
  );
45
45
 
46
46
  const [Confirm, handleConfirmed] = useConfirm(handleClickEnable);
@@ -100,7 +100,7 @@ export const DoubleOptIn: FC<DoubleOptInProps> = observer(
100
100
  <Form.Input
101
101
  className={classnames(
102
102
  Styles.buttonInput,
103
- 'm-b-2-i qa-double-opt-in-button-text'
103
+ 'm-b-2-i qa-double-opt-in-button-text',
104
104
  )}
105
105
  value={emailButtonText.value}
106
106
  onChange={emailButtonText.onChangeHandler}
@@ -145,5 +145,5 @@ export const DoubleOptIn: FC<DoubleOptInProps> = observer(
145
145
  />
146
146
  </SettingsSection>
147
147
  );
148
- }
148
+ },
149
149
  );
@@ -50,7 +50,7 @@ export const EmailPreview: FC<EmailPreviewProps> = ({
50
50
  <a
51
51
  className={classnames(
52
52
  Styles.button,
53
- 'qa-email-preview-button-text'
53
+ 'qa-email-preview-button-text',
54
54
  )}
55
55
  >
56
56
  {buttonText}
@@ -26,5 +26,5 @@ export const OptInEmailPreview: FC<OptInEmailPreviewProps> = observer(
26
26
  footer={footerText}
27
27
  />
28
28
  );
29
- }
29
+ },
30
30
  );
@@ -44,7 +44,7 @@ export interface EmailValidationTableRecord<T> {
44
44
 
45
45
  export interface EmailValidationProps<
46
46
  TEmailValidationType extends string | number = string,
47
- TEmailValidationResult extends string | number = string
47
+ TEmailValidationResult extends string | number = string,
48
48
  > {
49
49
  className?: string;
50
50
  loading: boolean;
@@ -56,7 +56,7 @@ export interface EmailValidationProps<
56
56
 
57
57
  interface EmailValidationHocOptions<
58
58
  TEmailValidationType extends string | number = string,
59
- TEmailValidationResult extends string | number = string
59
+ TEmailValidationResult extends string | number = string,
60
60
  > {
61
61
  resultToText: Map<TEmailValidationResult, string>;
62
62
  levelTypeMap: {
@@ -71,7 +71,7 @@ interface EmailValidationHocOptions<
71
71
 
72
72
  export function emailValidationHoc<
73
73
  TEmailValidationType extends string | number = string,
74
- TEmailValidationResult extends string | number = string
74
+ TEmailValidationResult extends string | number = string,
75
75
  >({
76
76
  resultToText,
77
77
  levelTypeMap,
@@ -81,7 +81,7 @@ export function emailValidationHoc<
81
81
  }: EmailValidationHocOptions<TEmailValidationType, TEmailValidationResult>) {
82
82
  const ResultColumnMenuFilter = multiSelectColumnMenuFilter(
83
83
  [...resultToText.keys()],
84
- result => resultToText.get(result)!
84
+ result => resultToText.get(result)!,
85
85
  );
86
86
 
87
87
  const ResultCell: FC<TableCellProps> = props => {
@@ -115,7 +115,7 @@ export function emailValidationHoc<
115
115
  (riskType: TEmailValidationType) => () => {
116
116
  setValidationRiskType(riskType);
117
117
  },
118
- [setValidationRiskType]
118
+ [setValidationRiskType],
119
119
  );
120
120
 
121
121
  const handleClickLearnMore = () => {
@@ -20,7 +20,7 @@ export const FormErrorsList: FC<FormErrorsListProps> = observer(
20
20
  {field.error}
21
21
  </li>
22
22
  ) : null;
23
- }
23
+ },
24
24
  );
25
25
  };
26
26
 
@@ -39,5 +39,5 @@ export const FormErrorsList: FC<FormErrorsListProps> = observer(
39
39
  <ul className="qa-settings-email-error-list">{getErrors()}</ul>
40
40
  </Banner>
41
41
  );
42
- }
42
+ },
43
43
  );
@@ -84,7 +84,7 @@ export const LogoPicker: FC<LogoPickerProps> = observer(
84
84
  try {
85
85
  const size = await getImageSize(imageUrl);
86
86
  setRecommendLargerImage(
87
- size.height < minDimensions.height || size.width < minDimensions.width
87
+ size.height < minDimensions.height || size.width < minDimensions.width,
88
88
  );
89
89
  setLocalError('');
90
90
 
@@ -206,7 +206,7 @@ export const LogoPicker: FC<LogoPickerProps> = observer(
206
206
  )}
207
207
  </div>
208
208
  );
209
- }
209
+ },
210
210
  );
211
211
 
212
212
  interface LogoCardProps {
@@ -106,7 +106,7 @@ export const OptOutMessage: FC<OptOutMessageProps> = observer(
106
106
  <Form.Input
107
107
  className={classnames(
108
108
  Styles.buttonInput,
109
- 'm-b-3-i qa-opt-out-message-button-text'
109
+ 'm-b-3-i qa-opt-out-message-button-text',
110
110
  )}
111
111
  value={buttonText.value}
112
112
  onChange={buttonText.onChangeHandler}
@@ -153,5 +153,5 @@ export const OptOutMessage: FC<OptOutMessageProps> = observer(
153
153
  <OptOutEmailPreview {...formState} open={isPreviewOpen} onClose={closePreview} />
154
154
  </SettingsSection>
155
155
  );
156
- }
156
+ },
157
157
  );
@@ -38,5 +38,5 @@ export const SettingsSection: FC<SectionProps> = observer(
38
38
  </Card>
39
39
  </Layout.Section>
40
40
  </Layout>
41
- )
41
+ ),
42
42
  );
@@ -0,0 +1,23 @@
1
+ import { DomainValidationStatus } from '@servicetitan/marketing-services-api/dist/settings/brand.mrk.api';
2
+
3
+ export interface BrandAction {
4
+ name: string;
5
+ disabled?: boolean;
6
+
7
+ tooltipMessage?: string;
8
+ inProgress?: boolean;
9
+ isConfigured?: boolean;
10
+ href?: string;
11
+ action?: () => void;
12
+ }
13
+
14
+ export interface BrandCardProps {
15
+ id: string;
16
+ actions: BrandAction | BrandAction[];
17
+ logo?: string;
18
+ name?: string;
19
+ isDefault: boolean;
20
+ email?: string;
21
+ domainValidationStatus?: DomainValidationStatus;
22
+ isShared: boolean;
23
+ }
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export * from './components/settings';
2
2
  export * from './components/campaign-actions';
3
-
3
+ export * from './enums/brands';
4
4
  export * from './utils/helpers';