@hubspot/ui-extensions 0.12.1 → 0.12.3

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 (106) hide show
  1. package/dist/__tests__/crm/utils/fetchAssociations.spec.js +1 -1
  2. package/dist/__tests__/crm/utils/fetchCrmProperties.spec.js +1 -1
  3. package/dist/crm/hooks/useAssociations.d.ts +1 -1
  4. package/dist/crm/hooks/useAssociations.js +2 -2
  5. package/dist/crm/hooks/useCrmProperties.d.ts +1 -1
  6. package/dist/crm/hooks/useCrmProperties.js +2 -2
  7. package/dist/crm/utils/fetchAssociations.d.ts +1 -1
  8. package/dist/crm/utils/fetchAssociations.js +0 -1
  9. package/dist/crm/utils/fetchCrmProperties.js +0 -1
  10. package/dist/experimental/pages/index.d.ts +4 -0
  11. package/dist/experimental/pages/index.js +3 -0
  12. package/dist/hs-internal/__tests__/createRemoteComponentInternal.spec.js +4 -4
  13. package/dist/hubspot.js +0 -1
  14. package/dist/index.d.ts +1 -1
  15. package/dist/index.js +1 -1
  16. package/dist/internal/global-utils.d.ts +1 -1
  17. package/dist/internal/hook-utils.d.ts +3 -3
  18. package/dist/shared/remoteComponents.d.ts +13 -2
  19. package/dist/shared/remoteComponents.js +13 -0
  20. package/dist/shared/types/components/accordion.d.ts +3 -3
  21. package/dist/shared/types/components/alert.d.ts +3 -3
  22. package/dist/shared/types/components/app-home-header-actions.d.ts +5 -5
  23. package/dist/shared/types/components/button-row.d.ts +3 -3
  24. package/dist/shared/types/components/button.d.ts +7 -6
  25. package/dist/shared/types/components/card.d.ts +2 -2
  26. package/dist/shared/types/components/chart.d.ts +3 -3
  27. package/dist/shared/types/components/description-list.d.ts +5 -5
  28. package/dist/shared/types/components/divider.d.ts +6 -2
  29. package/dist/shared/types/components/dropdown.d.ts +4 -5
  30. package/dist/shared/types/components/empty-state.d.ts +3 -3
  31. package/dist/shared/types/components/error-state.d.ts +3 -3
  32. package/dist/shared/types/components/form.d.ts +4 -4
  33. package/dist/shared/types/components/heading.d.ts +3 -3
  34. package/dist/shared/types/components/icon.d.ts +4 -4
  35. package/dist/shared/types/components/iframe.d.ts +1 -1
  36. package/dist/shared/types/components/illustration.d.ts +2 -2
  37. package/dist/shared/types/components/image.d.ts +5 -4
  38. package/dist/shared/types/components/index.d.ts +1 -0
  39. package/dist/shared/types/components/inputs.d.ts +9 -9
  40. package/dist/shared/types/components/layouts.d.ts +7 -7
  41. package/dist/shared/types/components/link.d.ts +6 -5
  42. package/dist/shared/types/components/list.d.ts +3 -3
  43. package/dist/shared/types/components/loading-spinner.d.ts +2 -2
  44. package/dist/shared/types/components/modal.d.ts +2 -2
  45. package/dist/shared/types/components/panel.d.ts +2 -2
  46. package/dist/shared/types/components/progress-bar.d.ts +2 -2
  47. package/dist/shared/types/components/score.d.ts +2 -2
  48. package/dist/shared/types/components/selects.d.ts +3 -3
  49. package/dist/shared/types/components/spacer.d.ts +14 -0
  50. package/dist/shared/types/components/spacer.js +1 -0
  51. package/dist/shared/types/components/statistics.d.ts +7 -7
  52. package/dist/shared/types/components/status-tag.d.ts +3 -3
  53. package/dist/shared/types/components/step-indicator.d.ts +2 -2
  54. package/dist/shared/types/components/table.d.ts +6 -6
  55. package/dist/shared/types/components/tabs.d.ts +2 -2
  56. package/dist/shared/types/components/tag.d.ts +6 -5
  57. package/dist/shared/types/components/text.d.ts +3 -3
  58. package/dist/shared/types/components/tile.d.ts +3 -3
  59. package/dist/shared/types/components/toggle.d.ts +2 -2
  60. package/dist/shared/types/components/toggleInputs.d.ts +4 -4
  61. package/dist/shared/types/components/tooltip.d.ts +2 -2
  62. package/dist/shared/types/crm.d.ts +188 -44
  63. package/dist/shared/types/experimental.d.ts +1 -1
  64. package/dist/shared/types/extend.d.ts +2 -2
  65. package/dist/shared/types/extension-points.d.ts +4 -5
  66. package/dist/shared/types/pages/app-pages-types.d.ts +75 -0
  67. package/dist/shared/types/pages/app-pages-types.js +1 -0
  68. package/dist/shared/types/pages/components/index.d.ts +2 -0
  69. package/dist/shared/types/pages/components/index.js +1 -0
  70. package/dist/shared/types/pages/components/page-link.d.ts +23 -0
  71. package/dist/shared/types/pages/components/page-link.js +1 -0
  72. package/dist/shared/types/pages/components/page-routes.d.ts +115 -0
  73. package/dist/shared/types/pages/components/page-routes.js +1 -0
  74. package/dist/shared/types/shared.d.ts +23 -1
  75. package/dist/shared/types/worker-globals.d.ts +17 -3
  76. package/dist/shared/utils/remote-component-registry.d.ts +1 -1
  77. package/dist/testing/__tests__/isMatch.spec.js +1 -1
  78. package/dist/testing/__tests__/mocks.runServerlessFunction.spec.js +1 -1
  79. package/dist/testing/__tests__/mocks.useAssociations.spec.js +2 -2
  80. package/dist/testing/__tests__/mocks.useCrmProperties.spec.js +2 -2
  81. package/dist/testing/__tests__/mocks.useExtensionActions.spec.js +1 -1
  82. package/dist/testing/__tests__/mocks.useExtensionApi.spec.js +1 -1
  83. package/dist/testing/__tests__/mocks.useExtensionContext.spec.js +1 -1
  84. package/dist/testing/internal/convert.d.ts +1 -1
  85. package/dist/testing/internal/convert.js +4 -5
  86. package/dist/testing/internal/debug.d.ts +1 -1
  87. package/dist/testing/internal/element.d.ts +1 -1
  88. package/dist/testing/internal/errors.d.ts +2 -2
  89. package/dist/testing/internal/fragment.d.ts +1 -1
  90. package/dist/testing/internal/match.d.ts +2 -2
  91. package/dist/testing/internal/mocks/index.d.ts +3 -3
  92. package/dist/testing/internal/mocks/index.js +1 -1
  93. package/dist/testing/internal/mocks/mock-extension-point-api.d.ts +2 -1
  94. package/dist/testing/internal/mocks/mock-extension-point-api.js +1 -1
  95. package/dist/testing/internal/mocks/mock-hooks.d.ts +1 -1
  96. package/dist/testing/internal/text.d.ts +2 -2
  97. package/dist/testing/internal/type-utils-internal.d.ts +2 -2
  98. package/dist/testing/internal/types-internal.d.ts +6 -6
  99. package/dist/testing/render.d.ts +2 -2
  100. package/dist/testing/render.js +5 -6
  101. package/dist/testing/type-utils.d.ts +1 -1
  102. package/dist/testing/type-utils.js +1 -1
  103. package/dist/testing/types.d.ts +9 -9
  104. package/dist/testing/utils.d.ts +1 -1
  105. package/dist/testing/utils.js +1 -1
  106. package/package.json +32 -24
@@ -1,6 +1,5 @@
1
- import { ReactNode } from 'react';
2
- import { TShirtSizes, BaseComponentProps } from './shared.ts';
3
- /** @ignore */
1
+ import type { ReactNode } from 'react';
2
+ import type { BaseComponentProps, TShirtSizes } from './shared.ts';
4
3
  export interface CrmDataHighlightProps extends BaseComponentProps {
5
4
  /**
6
5
  * The properties to display, up to four. By default, will display property data from the currently displaying record. To pull data from a specific record, include the `objectTypeId` and `objectId` props.
@@ -15,7 +14,6 @@ export interface CrmDataHighlightProps extends BaseComponentProps {
15
14
  */
16
15
  objectId?: number;
17
16
  }
18
- /** @ignore */
19
17
  export interface CrmReportProps extends BaseComponentProps {
20
18
  /**
21
19
  * The numeric ID of the single object report, which can be found in the URL when viewing the report in HubSpot.
@@ -31,7 +29,6 @@ export interface CrmReportProps extends BaseComponentProps {
31
29
  */
32
30
  use?: 'associations' | 'subject' | 'unfiltered';
33
31
  }
34
- /** @ignore */
35
32
  export interface CrmPropertyListProps extends BaseComponentProps {
36
33
  /**
37
34
  * The properties to display, up to 24. By default, will display property data from the currently displaying record. To pull data from a specific record, include the `objectTypeId` and `objectId` props.
@@ -52,12 +49,10 @@ export interface CrmPropertyListProps extends BaseComponentProps {
52
49
  */
53
50
  objectId?: number;
54
51
  }
55
- /** @ignore */
56
52
  type CrmSortDescriptor = {
57
53
  columnName: string;
58
54
  direction: 1 | -1;
59
55
  };
60
- /** @ignore */
61
56
  interface CrmSearchFilter {
62
57
  operator: 'EQ' | 'NEQ' | 'LT' | 'LTE' | 'GT' | 'GTE' | 'BETWEEN' | 'IN' | 'NOT_IN' | 'HAS_PROPERTY' | 'NOT_HAS_PROPERTY';
63
58
  value?: string | number;
@@ -65,56 +60,132 @@ interface CrmSearchFilter {
65
60
  highValue?: string | number;
66
61
  property: string;
67
62
  }
68
- /** @ignore */
69
63
  export interface CrmAssociationTableProps extends BaseComponentProps {
64
+ /**
65
+ * The numeric ID of the type of associated object to display (e.g., `0-1` for contacts). See [complete list](https://developers.hubspot.com/guides/crm/understanding-the-crm#object-type-ids) of object IDs.
66
+ */
70
67
  objectTypeId: string;
68
+ /**
69
+ * The properties to display as table columns.
70
+ */
71
71
  propertyColumns: Array<string>;
72
+ /**
73
+ * The properties that appear as filters above the table. When included, the "Association label" quick filter will always display. See note below for more details on this prop.
74
+ */
72
75
  quickFilterProperties?: Array<string>;
76
+ /**
77
+ * When set to `false`, hides the search bar above the table.
78
+ */
73
79
  searchable?: boolean;
80
+ /**
81
+ * When set to `false`, hides the pagination navigation below the table.
82
+ */
74
83
  pagination?: boolean;
84
+ /**
85
+ * When set to `false`, hides the "Association label" quick filter above the table.
86
+ */
75
87
  associationLabelFilter?: boolean;
88
+ /**
89
+ * The number of rows to include per page of results. Include the `pagination` property to enable users to navigate through returned results.
90
+ */
76
91
  pageSize?: number;
92
+ /**
93
+ * Filters the data by specific values of the associated records. Review the [CRM data filter options](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/crm-data-components/overview#filtering-data) for more information.
94
+ */
77
95
  preFilters?: Array<CrmSearchFilter>;
96
+ /**
97
+ * The default sorting behavior for the table. In each sort object in the array, you'll specify the following:
98
+ * - `columnName`: the column to sort by.
99
+ * - `direction`: the direction to sort by. Can be either `1` (ascending) or `-1` (descending). By default, order is ascending.
100
+ */
78
101
  sort?: Array<CrmSortDescriptor>;
79
102
  }
80
- /** @ignore */
81
103
  export interface CrmAssociationPivotProps extends BaseComponentProps {
104
+ /**
105
+ * The numeric ID of the type of associated object to display (e.g., `0-1` for contacts). See [complete list](https://developers.hubspot.com/guides/crm/understanding-the-crm#object-type-ids) of object IDs.
106
+ */
82
107
  objectTypeId: string;
108
+ /**
109
+ * Filters results by specific association labels. By default, all association labels will appear.
110
+ */
83
111
  associationLabels?: Array<string>;
112
+ /**
113
+ * The number of items to return in each association label group before displaying a "Show more" button.
114
+ */
84
115
  maxAssociations?: number;
116
+ /**
117
+ * Filters the data by specific values of the associated records. Review the [CRM data filter options](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/crm-data-components/overview#filtering-data) for more information.
118
+ */
85
119
  preFilters?: Array<CrmSearchFilter>;
120
+ /**
121
+ * The default sorting behavior for the table. In the array, you'll include an object for the column you want to sort by, which specifies:
122
+ * - `columnName`: the column to sort by.
123
+ * - `direction`: the direction to sort by. Can be either `1` (ascending) or `-1` (descending). By default, order is ascending.
124
+ */
86
125
  sort?: Array<CrmSortDescriptor>;
87
126
  }
88
- /** @ignore */
89
127
  export interface CrmAssociationStageTrackerProps extends BaseComponentProps {
128
+ /**
129
+ * The numeric ID of the type of associated object to display data from (e.g., `0-1` for contacts). See [complete list](https://developers.hubspot.com/guides/crm/understanding-the-crm#object-type-ids) of object IDs.
130
+ */
90
131
  objectTypeId: string;
132
+ /**
133
+ * The properties of the associated records to display, up to four.
134
+ */
91
135
  properties: Array<string>;
136
+ /**
137
+ * If provided, will only request a list of associated records with the specified label (case sensitive).
138
+ */
92
139
  associationLabels?: Array<string>;
140
+ /**
141
+ * If provided, the component will request a list of associated records that match the specified criteria. Learn more about [filtering in CRM data components](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/crm-data-components/overview#filtering-data).
142
+ */
93
143
  filters?: Array<CrmSearchFilter>;
144
+ /**
145
+ * Whether to display the properties below the progress indicator. When set to `false`, properties will not display.
146
+ */
94
147
  showProperties?: boolean;
148
+ /**
149
+ * If provided, overrides the default sorting rules used in the search query. In the array, you'll include an object for the column you want to sort by, which specifies:
150
+ * - `columnName`: the column to sort by.
151
+ * - `direction`: the direction to sort by. Can be either `1` (ascending) or `-1` (descending). By default, order is ascending.
152
+ */
95
153
  sort?: Array<CrmSortDescriptor>;
96
154
  }
97
- /** @ignore */
98
155
  export interface CrmSimpleDeadlineProps extends BaseComponentProps {
156
+ /**
157
+ * The name of the property that contains the deadline date.
158
+ */
99
159
  endDatePropertyName: string;
160
+ /**
161
+ * The properties to display below the progress bar.
162
+ */
100
163
  properties: Array<string>;
164
+ /**
165
+ * The theme to apply to the progress bar.
166
+ */
101
167
  progressTheme?: ProgressTheme;
168
+ /**
169
+ * Whether to show provided properties below the progress bar.
170
+ */
102
171
  showProperties?: boolean;
172
+ /**
173
+ * The name of the property that contains the start date.
174
+ */
103
175
  startDatePropertyName: string;
104
176
  }
105
- /** @ignore */
106
177
  export interface CrmRelativeTimelineProps {
178
+ /**
179
+ * The names of the properties to display.
180
+ */
107
181
  properties: Array<string>;
108
182
  }
109
- /** @ignore */
110
183
  interface BaseCrmStatisticItem {
111
184
  label: string;
112
185
  }
113
- /** @ignore */
114
186
  interface FilterGroup {
115
187
  filters: Array<CrmSearchFilter>;
116
188
  }
117
- /** @ignore */
118
189
  interface ProgressTheme {
119
190
  backgroundColor?: string;
120
191
  completedColor?: string;
@@ -124,16 +195,13 @@ interface ProgressTheme {
124
195
  completedGradient?: Gradient;
125
196
  upcomingGradient?: Gradient;
126
197
  }
127
- /** @ignore */
128
198
  interface PercentileMetricItem extends BaseCrmStatisticItem {
129
199
  statisticType: 'PERCENTILES';
130
200
  propertyName: string;
131
201
  percentile: number;
132
202
  filterGroups?: Array<FilterGroup>;
133
203
  }
134
- /** @ignore */
135
204
  type CrmStatisticItem = BasicMetricItem | PercentileMetricItem;
136
- /** @ignore */
137
205
  export interface CrmStatisticsProps extends BaseComponentProps {
138
206
  /**
139
207
  * The numeric ID of the type of object to fetch statistics about (e.g., `0-1` for contacts).
@@ -144,50 +212,61 @@ export interface CrmStatisticsProps extends BaseComponentProps {
144
212
  */
145
213
  statistics: Array<CrmStatisticItem>;
146
214
  }
147
- /** @ignore */
148
215
  interface BasicMetricItem extends BaseCrmStatisticItem {
149
216
  statisticType: 'SUM' | 'AVG' | 'MIN' | 'MAX' | 'DISTINCT_APPROX' | 'COUNT';
150
217
  propertyName: string;
151
218
  filterGroups?: Array<FilterGroup>;
152
219
  }
153
- /** @ignore */
154
220
  interface Gradient {
155
221
  startColor: string;
156
222
  endColor: string;
157
223
  }
158
- /** @ignore */
159
224
  export interface CrmStageTrackerProps extends BaseComponentProps {
160
225
  /**
161
226
  * The ID of the CRM record to display property data from.
162
227
  */
163
228
  objectId?: number;
164
229
  /**
165
- * The numeric ID of the type of associated object to display (e.g., `0-1` for contacts).
230
+ * The numeric ID of the type of associated object to display (e.g., `0-1` for contacts). See [complete list](https://developers.hubspot.com/guides/crm/understanding-the-crm#object-type-ids) of object IDs.
166
231
  */
167
232
  objectTypeId?: string;
168
233
  /**
169
- * The properties to display, up to four. By default, will display property data from the currently displaying record.
234
+ * The properties to display, up to four. By default, will display property data from the currently displaying record. To pull data from a specific record, include the `objectTypeId` and `objectId` props.
170
235
  */
171
236
  properties: Array<string>;
172
237
  /**
173
- * Whether to display the properties below the progress indicator.
238
+ * Whether to display the properties below the progress indicator. When set to `false`, properties will not display.
174
239
  */
175
240
  showProperties?: boolean;
176
241
  }
177
- /** @ignore */
178
242
  export interface CrmAssociationPropertyListProps extends BaseComponentProps {
243
+ /**
244
+ * The numeric ID of the type of associated object to display (e.g., `0-1` for contacts). See [complete list](https://developers.hubspot.com/guides/crm/understanding-the-crm#object-type-ids) of object IDs.
245
+ */
179
246
  objectTypeId: string;
247
+ /**
248
+ * The list of properties to display from the associated record, up to 24.
249
+ */
180
250
  properties: Array<string>;
251
+ /**
252
+ * When provided, returns associated records that have all the specified labels.
253
+ */
181
254
  associationLabels?: Array<string>;
255
+ /**
256
+ * Filters the data by specific values of the associated records. Review the [CRM data filter options](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/crm-data-components/overview#filtering-data) for more information.
257
+ */
182
258
  filters?: Array<CrmSearchFilter>;
259
+ /**
260
+ * The default sorting behavior for the table. In each sort object in the array, you'll specify the following:
261
+ * - `columnName`: the column to sort by.
262
+ * - `direction`: the direction to sort by. Can be either `1` (ascending) or `-1` (descending). By default, order is ascending.
263
+ */
183
264
  sort?: Array<CrmSortDescriptor>;
184
265
  }
185
- /** @ignore */
186
266
  interface ObjectCoordinates {
187
267
  objectTypeId: string;
188
268
  objectId: number;
189
269
  }
190
- /** @ignore */
191
270
  interface OpenRecordAssociationFormArgs {
192
271
  objectTypeId: string;
193
272
  association: {
@@ -195,7 +274,6 @@ interface OpenRecordAssociationFormArgs {
195
274
  objectId: number;
196
275
  };
197
276
  }
198
- /** @ignore */
199
277
  interface ActivityCreatorActionArgs {
200
278
  objectTypeId: string;
201
279
  objectId: number;
@@ -203,34 +281,28 @@ interface ActivityCreatorActionArgs {
203
281
  initialEmailBody?: string;
204
282
  initialEmailSubject?: string;
205
283
  }
206
- /** @ignore */
207
284
  interface EngagementAppLinkArgs {
208
285
  objectId: number | string;
209
286
  objectTypeId: string;
210
287
  engagementId: number | string;
211
288
  external?: boolean;
212
289
  }
213
- /** @ignore */
214
290
  interface RecordAppLinkArgs {
215
291
  includeEschref?: boolean;
216
292
  objectId: number;
217
293
  objectTypeId: string;
218
294
  external?: boolean;
219
295
  }
220
- /** @ignore */
221
296
  interface PageAppLinkArgs {
222
297
  path: string;
223
298
  external?: boolean;
224
299
  }
225
- /** @ignore */
226
300
  interface ExternalUrlArgs {
227
301
  href: string;
228
302
  }
229
- /** @ignore */
230
303
  interface OpenRecordCreatorFormArgs {
231
304
  objectTypeId: string;
232
305
  }
233
- /** @ignore */
234
306
  interface ActionArgs {
235
307
  PREVIEW_OBJECT: ObjectCoordinates;
236
308
  ADD_NOTE: ActivityCreatorActionArgs;
@@ -245,56 +317,128 @@ interface ActionArgs {
245
317
  EXTERNAL_URL: ExternalUrlArgs;
246
318
  OPEN_WORKFLOW_ENROLLMENT_MODAL: ObjectCoordinates;
247
319
  }
248
- /** @ignore */
249
320
  export type ArgsFor<SpecificActionType extends ActionType> = ActionArgs[SpecificActionType];
250
321
  export type ActionType = 'PREVIEW_OBJECT' | 'ADD_NOTE' | 'ADD_TASK' | 'SEND_EMAIL' | 'SCHEDULE_MEETING' | 'OPEN_RECORD_CREATOR_FORM' | 'OPEN_RECORD_ASSOCIATION_FORM' | 'ENGAGEMENT_APP_LINK' | 'RECORD_APP_LINK' | 'PAGE_APP_LINK' | 'EXTERNAL_URL' | 'OPEN_WORKFLOW_ENROLLMENT_MODAL';
251
- /** @ignore */
252
322
  interface BaseActionComponent extends BaseComponentProps {
323
+ /**
324
+ * The content that will render inside the component.
325
+ */
253
326
  children: ReactNode;
327
+ /**
328
+ * The type of action to perform. See [list of available actions](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/crm-action-components/overview#available-actions) for more information.
329
+ */
254
330
  actionType: ActionType;
331
+ /**
332
+ * An object containing the CRM object and record context for performing the action. See [list of available actions](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/crm-action-components/overview#available-actions) for required context values.
333
+ */
255
334
  actionContext: ArgsFor<ActionType>;
335
+ /**
336
+ * An optional callback that will pass any error messages that were generated. Common errors include missing required context values or the user not having sufficient permissions to perform an action.
337
+ */
256
338
  onError?: (errors: string[]) => void;
257
339
  }
258
- /** @ignore */
259
340
  export interface CrmActionButtonProps extends BaseActionComponent {
341
+ /**
342
+ * The color variation of the button.
343
+ *
344
+ * @defaultValue `"secondary"`
345
+ */
260
346
  variant?: 'primary' | 'secondary' | 'destructive';
347
+ /**
348
+ * The button's HTML `role` attribute.
349
+ *
350
+ * @defaultValue `"button"`
351
+ */
261
352
  type?: 'button' | 'reset' | 'submit';
353
+ /**
354
+ * The size of the button.
355
+ *
356
+ * @defaultValue `"medium"`
357
+ */
262
358
  size?: TShirtSizes['xs'] | TShirtSizes['sm'] | TShirtSizes['md'];
359
+ /**
360
+ * A function that will be invoked when the button is clicked. It receives no arguments and its return value is ignored.
361
+ */
263
362
  onClick?: () => void;
363
+ /**
364
+ * When set to `true`, button renders in a disabled, greyed-out state and cannot be clicked.
365
+ */
366
+ disabled?: boolean;
264
367
  }
265
- /** @ignore */
266
368
  export interface CrmActionLinkProps extends BaseActionComponent {
369
+ /**
370
+ * The color variation of the link. See the [variants section](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/crm-action-components/crm-action-link#variants) for more information.
371
+ *
372
+ * @defaultValue `"primary"`
373
+ */
267
374
  variant?: 'primary' | 'light' | 'dark' | 'destructive';
268
375
  }
269
- /** @ignore */
270
376
  export interface ActionLibraryButtonCardActionConfig<SpecificActionType extends ActionType = ActionType> {
377
+ /**
378
+ * The type of button to render:
379
+ * - `action-library-button`: a standalone button that can perform one action.
380
+ * - `dropdown`: a dropdown menu button containing multiple `'action-library-button'` actions. When using this type, you'll need to include an `options` array containing each action.
381
+ */
271
382
  type: 'action-library-button';
383
+ /**
384
+ * The type of action to perform. See [list of available actions](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/crm-action-components/overview#available-actions) for more information.
385
+ */
272
386
  actionType: SpecificActionType;
387
+ /**
388
+ * An object containing the CRM object and record context for performing the action. See [list of available actions](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/crm-action-components/overview#available-actions) for required context values.
389
+ */
273
390
  actionContext: ArgsFor<SpecificActionType>;
391
+ /**
392
+ * The button's label text.
393
+ */
274
394
  label?: string;
395
+ /**
396
+ * When set to `true`, the button or dropdown menu option will render in a disabled, greyed-out state and can't be clicked.
397
+ */
275
398
  disabled?: boolean;
399
+ /**
400
+ * Tooltip text that appears when hovering over the button or dropdown menu option.
401
+ */
276
402
  tooltipText?: string;
277
403
  }
278
- /** @ignore */
279
404
  export type DropdownCardActionConfigOptions = [
280
405
  ActionLibraryButtonCardActionConfig,
281
406
  ...ActionLibraryButtonCardActionConfig[]
282
407
  ];
283
- /** @ignore */
284
408
  export interface DropdownCardActionConfig {
409
+ /**
410
+ * The type of button to render:
411
+ * - `action-library-button`: a standalone button that can perform one action.
412
+ * - `dropdown`: a dropdown menu button containing multiple `'action-library-button'` actions. When using this type, you'll need to include an `options` array containing each action.
413
+ */
285
414
  type: 'dropdown';
415
+ /**
416
+ * For `dropdown` type buttons, this array stores objects for each action in the dropdown menu. Each action should be set to the `'action-library-button'` type.
417
+ */
286
418
  options: DropdownCardActionConfigOptions;
419
+ /**
420
+ * The button's label text.
421
+ */
287
422
  label?: string;
423
+ /**
424
+ * When set to `true`, the button or dropdown menu option will render in a disabled, greyed-out state and can't be clicked.
425
+ */
288
426
  disabled?: boolean;
427
+ /**
428
+ * Tooltip text that appears when hovering over the button or dropdown menu option.
429
+ */
289
430
  tooltipText?: string;
290
431
  }
291
- /** @ignore */
292
432
  type ErrorHandler = (errors: string[]) => void;
293
- /** @ignore */
294
433
  type CardActionConfig = ActionLibraryButtonCardActionConfig | DropdownCardActionConfig;
295
- /** @ignore */
296
434
  export type CrmCardActionsProps = BaseComponentProps & {
435
+ /**
436
+ * An array that stores fields for configuration button actions. See below for list of supported fields.
437
+ */
297
438
  actionConfigs: Array<CardActionConfig>;
439
+ /**
440
+ * An optional callback that will pass any error messages that were generated. Common errors include missing required context values or the user not having sufficient permissions to perform an action.
441
+ */
298
442
  onError?: ErrorHandler;
299
443
  };
300
444
  export {};
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { ReactionsHandler } from './reactions.ts';
3
- import type { AllDistances, ExtensionEvent, BaseComponentProps } from './shared.ts';
3
+ import type { AllDistances, BaseComponentProps, ExtensionEvent } from './shared.ts';
4
4
  /**
5
5
  * @ignore
6
6
  * @experimental do not use in production
@@ -1,4 +1,4 @@
1
- import { ReactElement } from 'react';
2
- import { ExtensionPointApi, ExtensionPoints } from './extension-points.ts';
1
+ import type { ReactElement } from 'react';
2
+ import type { ExtensionPointApi, ExtensionPoints } from './extension-points.ts';
3
3
  export type RenderExtensionCallback<TExtensionPointName extends keyof ExtensionPoints> = (api: ExtensionPointApi<TExtensionPointName>) => ReactElement<any>;
4
4
  export type HubspotExtendFunction = <TExtensionPointName extends keyof ExtensionPoints>(renderExtensionCallback: RenderExtensionCallback<TExtensionPointName>) => void;
@@ -1,10 +1,9 @@
1
- import { ComponentType } from 'react';
2
- import { TypesOfReadOnlyArray } from './shared.ts';
3
- import type { AppHomeContext, BaseContext, CrmContext } from './context.ts';
1
+ import type { ComponentType } from 'react';
4
2
  import type { AppHomeActions, CrmHostActions, SettingsActions, UiePlatformActions } from './actions.ts';
5
- import type { CrmPropertyListProps, CrmAssociationTableProps, CrmDataHighlightProps, CrmReportProps, CrmAssociationPivotProps, CrmAssociationPropertyListProps, CrmAssociationStageTrackerProps, CrmSimpleDeadlineProps, CrmRelativeTimelineProps, CrmStageTrackerProps, CrmStatisticsProps, CrmActionButtonProps, CrmActionLinkProps, CrmCardActionsProps } from './crm.ts';
6
- import type { SettingsContext, GenericContext } from './context.ts';
3
+ import type { AppHomeContext, BaseContext, CrmContext, GenericContext, SettingsContext } from './context.ts';
4
+ import type { CrmActionButtonProps, CrmActionLinkProps, CrmAssociationPivotProps, CrmAssociationPropertyListProps, CrmAssociationStageTrackerProps, CrmAssociationTableProps, CrmCardActionsProps, CrmDataHighlightProps, CrmPropertyListProps, CrmRelativeTimelineProps, CrmReportProps, CrmSimpleDeadlineProps, CrmStageTrackerProps, CrmStatisticsProps } from './crm.ts';
7
5
  import type { ServerlessFuncRunner } from './http-requests.ts';
6
+ import type { TypesOfReadOnlyArray } from './shared.ts';
8
7
  /** @ignore */
9
8
  export type ExtensionPointAction = (...args: any[]) => Promise<any> | void;
10
9
  /** @ignore */
@@ -0,0 +1,75 @@
1
+ import type { ComponentType, ReactElement } from 'react';
2
+ import type { EmptyProps, ReactFragmentProps } from '../shared.ts';
3
+ import type { PageRoutesProps } from './components/page-routes.ts';
4
+ /**
5
+ * The props type for a PageRouter component.
6
+ */
7
+ export type PageRouterProps = EmptyProps;
8
+ /**
9
+ * Represents the current page route that has been matched by the page router.
10
+ */
11
+ export interface MatchedPageRoute {
12
+ /**
13
+ * The id of the route that has been matched.
14
+ */
15
+ routeId?: string;
16
+ /**
17
+ * The path of the route that has been matched.
18
+ */
19
+ path: string;
20
+ /**
21
+ * The parameters of the route that has been matched.
22
+ */
23
+ params: Record<string, string>;
24
+ }
25
+ /**
26
+ * The component type for the page router that handles rendering matched routes.
27
+ *
28
+ * @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates.
29
+ */
30
+ export type PageRouterComponent = ComponentType<PageRouterProps>;
31
+ /**
32
+ * The function type for [createPageRouter](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/app-pages/reference#createpagerouter).
33
+ *
34
+ * Example usage:
35
+ *
36
+ * ```tsx
37
+ * const PageRouter = createPageRouter(
38
+ * <PageRoutes layoutComponent={AppLayout}>
39
+ * <PageRoutes.IndexRoute component={HomePage} id="home" />
40
+ * <PageRoutes.Route path="/docs" component={DocsPage} />
41
+ * <PageRoutes path="/customers" layoutComponent={CustomersLayout}>
42
+ * <PageRoutes.IndexRoute component={ListCustomersPage} />
43
+ * <PageRoutes.Route path="/:customerId" component={ViewCustomerPage} />
44
+ * </PageRoutes>
45
+ * <PageRoutes.AnyRoute component={NotFoundPage} />
46
+ * </PageRoutes>
47
+ * );
48
+ *
49
+ * function AppPages() {
50
+ * return <PageRouter />;
51
+ * }
52
+ *
53
+ * hubspot.extend<"pages">(() => <AppPages />);
54
+ * ```
55
+ *
56
+ * @param routes The routes to render.
57
+ * @returns The page router component.
58
+ *
59
+ * @experimental This function is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates.
60
+ */
61
+ export type CreatePageRouterFunction = (reactPageRoutesElement: ReactElement<PageRoutesProps> | ReactElement<ReactFragmentProps>) => PageRouterComponent;
62
+ /**
63
+ * The function type for [usePageRoute](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/app-pages/reference#usepageroute).
64
+ *
65
+ * Example usage:
66
+ *
67
+ * ```tsx
68
+ * const pageRoute = usePageRoute();
69
+ * ```
70
+ *
71
+ * @returns The current page route.
72
+ *
73
+ * @experimental This hook is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates.
74
+ */
75
+ export type UsePageRouteHook = () => MatchedPageRoute;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export type * from './page-link.ts';
2
+ export type * from './page-routes.ts';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { BaseComponentProps } from '../../shared.ts';
3
+ /**
4
+ * The props type for [PageLink](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/app-page-components/page-link).
5
+ *
6
+ * @category Component Props
7
+ */
8
+ export interface PageLinkProps extends BaseComponentProps {
9
+ /**
10
+ * The path to navigate to when the link is clicked. Supports path parameters (e.g. `/view-contact/:contactId`).
11
+ */
12
+ to: string;
13
+ /**
14
+ * Values for path parameters and query string entries.
15
+ * Parameters matching `:paramName` tokens in `to` are substituted into the path.
16
+ * Any remaining parameters are appended as query string entries.
17
+ */
18
+ params?: Record<string, string>;
19
+ /**
20
+ * The content to render inside the link.
21
+ */
22
+ children: ReactNode;
23
+ }
@@ -0,0 +1 @@
1
+ export {};