@hubspot/ui-extensions 0.8.17 → 0.8.20

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.
@@ -11,3 +11,9 @@ export declare const Slider: "Slider" & {
11
11
  readonly props?: types.SliderProps | undefined;
12
12
  readonly children?: true | undefined;
13
13
  } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Slider", types.SliderProps, true>>;
14
+ /** @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. */
15
+ export declare const Icon: "Icon" & {
16
+ readonly type?: "Icon" | undefined;
17
+ readonly props?: types.IconProps | undefined;
18
+ readonly children?: true | undefined;
19
+ } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Icon", types.IconProps, true>>;
@@ -3,3 +3,5 @@ import { createRemoteReactComponent } from '@remote-ui/react';
3
3
  export const Tooltip = createRemoteReactComponent('Tooltip');
4
4
  /** @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. */
5
5
  export const Slider = createRemoteReactComponent('Slider');
6
+ /** @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. */
7
+ export const Icon = createRemoteReactComponent('Icon');
@@ -1 +1 @@
1
- export { Tooltip, Slider } from './experimentalComponents';
1
+ export { Tooltip, Slider, Icon } from './experimentalComponents';
@@ -1 +1 @@
1
- export { Tooltip, Slider } from './experimentalComponents';
1
+ export { Tooltip, Slider, Icon } from './experimentalComponents';
package/dist/hubspot.d.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  import { ReactElement } from 'react';
2
- import type { ExtensionPoints, ExtensionPointApi, ServerlessRunnerParams } from './types';
2
+ import type { ExtensionPoints, ExtensionPointApi, ServerlessRunnerParams, HubSpotFetchRequestURI, HubSpotFetchOptions } from './types';
3
3
  export declare function extend_V2<ExtensionPointName extends keyof ExtensionPoints>(renderExtensionCallback: (api: ExtensionPointApi<ExtensionPointName>) => ReactElement<any>): any;
4
4
  export declare function serverless<T = any>(name: ServerlessRunnerParams['name'], options?: Omit<ServerlessRunnerParams, 'name'>): Promise<T>;
5
+ export declare function fetch(url: HubSpotFetchRequestURI, options?: HubSpotFetchOptions): Promise<Response>;
5
6
  export declare const hubspot: {
6
7
  extend: typeof extend_V2;
7
8
  serverless: typeof serverless;
9
+ fetch: typeof fetch;
8
10
  };
package/dist/hubspot.js CHANGED
@@ -4,7 +4,11 @@ export function extend_V2(renderExtensionCallback) {
4
4
  export function serverless(name, options) {
5
5
  return self.serverless(name, options);
6
6
  }
7
+ export function fetch(url, options) {
8
+ return self.hsFetch(url, options);
9
+ }
7
10
  export const hubspot = {
8
11
  extend: extend_V2,
9
12
  serverless,
13
+ fetch,
10
14
  };
package/dist/types.d.ts CHANGED
@@ -67,7 +67,7 @@ export interface ButtonProps {
67
67
  */
68
68
  type?: 'button' | 'reset' | 'submit';
69
69
  /**
70
- * The displayable text for the Button.
70
+ * Sets the content that will render inside the Button. This prop is passed implicitly by providing sub-components. Only regular text and Icons are permitted.
71
71
  */
72
72
  children: ReactNode;
73
73
  /**
@@ -262,6 +262,66 @@ export interface HeadingProps {
262
262
  */
263
263
  inline?: boolean;
264
264
  }
265
+ /**
266
+ * The props type for {@link !components.Icon}.
267
+ *
268
+ * @ignore
269
+ * @experimental
270
+ * @category Component Props
271
+ */
272
+ export interface IconProps {
273
+ /**
274
+ * Sets the specific icon to display.
275
+ */
276
+ type: IconTypes;
277
+ /**
278
+ * Sets the size of the icon. If this prop is not provided, the icon will default to the size of its parent.
279
+ *
280
+ * @defaultValue `"medium"`
281
+ */
282
+ size?: TShirtSizes['sm'] | TShirtSizes['md'] | TShirtSizes['lg'];
283
+ /**
284
+ * Sets the text that a screenreader will read for this icon.
285
+ */
286
+ screenReaderText?: string;
287
+ }
288
+ export declare const iconTypes: {
289
+ readonly success: "success";
290
+ readonly remove: "remove";
291
+ readonly add: "add";
292
+ readonly attach: "attach";
293
+ readonly date: "date";
294
+ readonly delete: "delete";
295
+ readonly edit: "edit";
296
+ readonly email: "email";
297
+ readonly exclamation: "exclamation";
298
+ readonly location: "location";
299
+ readonly upCarat: "upCarat";
300
+ readonly downCarat: "downCarat";
301
+ readonly warning: "warning";
302
+ readonly shoppingCart: "cart";
303
+ readonly clock: "time";
304
+ readonly comment: "comments";
305
+ readonly contact: "contacts";
306
+ readonly star: "favorite";
307
+ readonly file: "file";
308
+ readonly reports: "reports";
309
+ readonly video: "video";
310
+ readonly robot: "simpleBot";
311
+ readonly refresh: "refresh";
312
+ readonly faceHappy: "emoji";
313
+ readonly faceSad: "emojiLineSad";
314
+ readonly upload: "upload";
315
+ readonly download: "download";
316
+ readonly left: "left";
317
+ readonly right: "right";
318
+ readonly dataSync: "dataSync";
319
+ readonly imageGallery: "imageGallery";
320
+ readonly search: "search";
321
+ readonly save: "saveEditableView";
322
+ readonly notification: "notification";
323
+ };
324
+ export type IconTypes = keyof typeof iconTypes;
265
325
  /**
266
326
  * The props type for {@link !components.Image}.
267
327
  *
@@ -1296,7 +1356,7 @@ export type ReloadPageAction = () => void;
1296
1356
  /** @ignore */
1297
1357
  export type FetchCrmObjectPropertiesAction = (properties: string[] | '*') => Promise<Record<string, string>>;
1298
1358
  /** @ignore */
1299
- export type OpenIframeModalAction = (action: OpenIframeActionPayload) => void;
1359
+ export type OpenIframeModalAction = (action: OpenIframeActionPayload, onClose?: () => void) => void;
1300
1360
  /** @ignore */
1301
1361
  export type refreshObjectPropertiesAction = () => void;
1302
1362
  /** @ignore */
@@ -2203,4 +2263,12 @@ export interface SliderProps extends Omit<BaseInputForNumber, 'placeholder'> {
2203
2263
  */
2204
2264
  size?: TShirtSizes['md'] | TShirtSizes['lg'];
2205
2265
  }
2266
+ export interface HubSpotFetchOptions {
2267
+ method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
2268
+ timeout?: number;
2269
+ body?: {
2270
+ [key: string]: unknown;
2271
+ };
2272
+ }
2273
+ export type HubSpotFetchRequestURI = string | URL;
2206
2274
  export {};
package/dist/types.js CHANGED
@@ -17,6 +17,42 @@ export class FormSubmitExtensionEvent extends ExtensionEvent {
17
17
  this.targetValue = value;
18
18
  }
19
19
  }
20
+ export const iconTypes = {
21
+ success: 'success',
22
+ remove: 'remove',
23
+ add: 'add',
24
+ attach: 'attach',
25
+ date: 'date',
26
+ delete: 'delete',
27
+ edit: 'edit',
28
+ email: 'email',
29
+ exclamation: 'exclamation',
30
+ location: 'location',
31
+ upCarat: 'upCarat',
32
+ downCarat: 'downCarat',
33
+ warning: 'warning',
34
+ shoppingCart: 'cart',
35
+ clock: 'time',
36
+ comment: 'comments',
37
+ contact: 'contacts',
38
+ star: 'favorite',
39
+ file: 'file',
40
+ reports: 'reports',
41
+ video: 'video',
42
+ robot: 'simpleBot',
43
+ refresh: 'refresh',
44
+ faceHappy: 'emoji',
45
+ faceSad: 'emojiLineSad',
46
+ upload: 'upload',
47
+ download: 'download',
48
+ left: 'left',
49
+ right: 'right',
50
+ dataSync: 'dataSync',
51
+ imageGallery: 'imageGallery',
52
+ search: 'search',
53
+ save: 'saveEditableView',
54
+ notification: 'notification',
55
+ };
20
56
  /**
21
57
  * @category Serverless
22
58
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/ui-extensions",
3
- "version": "0.8.17",
3
+ "version": "0.8.20",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -51,5 +51,5 @@
51
51
  "devDependencies": {
52
52
  "typescript": "5.0.4"
53
53
  },
54
- "gitHead": "c056fcf4f48454c6f4cd7986fd1f5b5f619d1605"
54
+ "gitHead": "6aee5b2b08bb56a07bbafbcaafe455f491d47233"
55
55
  }