@hubspot/ui-extensions 0.12.0 → 0.12.2

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/hooks/useExtensionActions.d.ts +17 -1
  2. package/dist/hooks/useExtensionActions.js +16 -0
  3. package/dist/hooks/useExtensionApi.d.ts +20 -0
  4. package/dist/hooks/useExtensionApi.js +22 -0
  5. package/dist/hooks/useExtensionContext.d.ts +17 -1
  6. package/dist/hooks/useExtensionContext.js +16 -0
  7. package/dist/index.d.ts +2 -1
  8. package/dist/index.js +2 -1
  9. package/dist/shared/remoteComponents.d.ts +11 -2
  10. package/dist/shared/remoteComponents.js +9 -0
  11. package/dist/shared/types/components/accordion.d.ts +1 -1
  12. package/dist/shared/types/components/alert.d.ts +1 -1
  13. package/dist/shared/types/components/app-home-header-actions.d.ts +2 -2
  14. package/dist/shared/types/components/button-row.d.ts +1 -1
  15. package/dist/shared/types/components/button.d.ts +4 -3
  16. package/dist/shared/types/components/chart.d.ts +71 -10
  17. package/dist/shared/types/components/description-list.d.ts +3 -3
  18. package/dist/shared/types/components/divider.d.ts +5 -1
  19. package/dist/shared/types/components/dropdown.d.ts +2 -2
  20. package/dist/shared/types/components/empty-state.d.ts +1 -1
  21. package/dist/shared/types/components/error-state.d.ts +1 -1
  22. package/dist/shared/types/components/form.d.ts +1 -1
  23. package/dist/shared/types/components/heading.d.ts +1 -1
  24. package/dist/shared/types/components/icon.d.ts +1 -1
  25. package/dist/shared/types/components/illustration.d.ts +1 -1
  26. package/dist/shared/types/components/image.d.ts +3 -2
  27. package/dist/shared/types/components/index.d.ts +1 -0
  28. package/dist/shared/types/components/inputs.d.ts +8 -8
  29. package/dist/shared/types/components/layouts.d.ts +5 -5
  30. package/dist/shared/types/components/link.d.ts +3 -2
  31. package/dist/shared/types/components/list.d.ts +1 -1
  32. package/dist/shared/types/components/loading-spinner.d.ts +1 -1
  33. package/dist/shared/types/components/progress-bar.d.ts +1 -1
  34. package/dist/shared/types/components/selects.d.ts +2 -2
  35. package/dist/shared/types/components/spacer.d.ts +14 -0
  36. package/dist/shared/types/components/spacer.js +1 -0
  37. package/dist/shared/types/components/statistics.d.ts +5 -5
  38. package/dist/shared/types/components/status-tag.d.ts +1 -1
  39. package/dist/shared/types/components/step-indicator.d.ts +1 -1
  40. package/dist/shared/types/components/table.d.ts +4 -4
  41. package/dist/shared/types/components/tag.d.ts +3 -2
  42. package/dist/shared/types/components/text.d.ts +1 -1
  43. package/dist/shared/types/components/tile.d.ts +1 -1
  44. package/dist/shared/types/components/toggle.d.ts +1 -1
  45. package/dist/shared/types/components/toggleInputs.d.ts +3 -3
  46. package/dist/shared/types/context.d.ts +2 -0
  47. package/dist/shared/types/crm.d.ts +186 -42
  48. package/dist/shared/types/extension-points.d.ts +6 -1
  49. package/dist/shared/types/shared.d.ts +8 -0
  50. package/dist/shared/types/worker-globals.d.ts +5 -1
  51. package/dist/testing/__tests__/mocks.useExtensionApi.spec.d.ts +1 -0
  52. package/dist/testing/__tests__/mocks.useExtensionApi.spec.js +72 -0
  53. package/dist/testing/internal/mocks/mock-hooks.js +9 -0
  54. package/dist/testing/internal/types-internal.d.ts +2 -0
  55. package/dist/testing/types.d.ts +10 -0
  56. package/package.json +5 -5
@@ -1,4 +1,20 @@
1
1
  import type { ExtensionPoints } from '../shared/types/extension-points.ts';
2
- declare function useExtensionActionsInternal<ExtensionPoint extends keyof ExtensionPoints>(): import("../shared/types/extension-points.ts").ExtensionPointApiActions<ExtensionPoint>;
2
+ declare function useExtensionActionsInternal<TExtensionPoint extends keyof ExtensionPoints>(): import("../shared/types/extension-points.ts").ExtensionPointApiActions<TExtensionPoint>;
3
+ /**
4
+ * Hook that provides access to extension actions for the specified extension point.
5
+ *
6
+ * Actions are methods provided by the host application that extensions can invoke to
7
+ * interact with the platform, such as showing notifications, opening modals, or
8
+ * navigating to different views.
9
+ *
10
+ * @typeParam TExtensionPoint - The extension point location (e.g., 'crm.record.tab', 'settings')
11
+ * @returns The actions object containing all available action methods for the extension point
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * const actions = useExtensionActions<'crm.record.tab'>();
16
+ * // Use actions like: actions.openIframeModal(...)
17
+ * ```
18
+ */
3
19
  export declare const useExtensionActions: typeof useExtensionActionsInternal;
4
20
  export {};
@@ -3,4 +3,20 @@ import { createMockAwareHook } from "../internal/hook-utils.js";
3
3
  function useExtensionActionsInternal() {
4
4
  return getWorkerGlobals().hsWorkerAPI.useExtensionActions();
5
5
  }
6
+ /**
7
+ * Hook that provides access to extension actions for the specified extension point.
8
+ *
9
+ * Actions are methods provided by the host application that extensions can invoke to
10
+ * interact with the platform, such as showing notifications, opening modals, or
11
+ * navigating to different views.
12
+ *
13
+ * @typeParam TExtensionPoint - The extension point location (e.g., 'crm.record.tab', 'settings')
14
+ * @returns The actions object containing all available action methods for the extension point
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * const actions = useExtensionActions<'crm.record.tab'>();
19
+ * // Use actions like: actions.openIframeModal(...)
20
+ * ```
21
+ */
6
22
  export const useExtensionActions = createMockAwareHook('useExtensionActions', useExtensionActionsInternal);
@@ -0,0 +1,20 @@
1
+ import type { ExtensionPoints } from '../shared/types/extension-points.ts';
2
+ declare function useExtensionApiInternal<TExtensionPoint extends keyof ExtensionPoints>(): import("../shared/types/extension-points.ts").ExtensionPointFullApi<TExtensionPoint>;
3
+ /**
4
+ * Hook that provides access to the full extension API for the specified extension point.
5
+ *
6
+ * The extension API includes:
7
+ * - `actions`: Methods to interact with the host application
8
+ * - `context`: Contextual data about the current environment
9
+ * - `runServerlessFunction`: Function to execute serverless functions (deprecated)
10
+ *
11
+ * @typeParam TExtensionPoint - The extension point location (e.g., 'crm.record.tab', 'settings')
12
+ * @returns The complete extension API object containing actions, context, and runServerlessFunction
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * const { actions, context, runServerlessFunction } = useExtensionApi<'crm.record.tab'>();
17
+ * ```
18
+ */
19
+ export declare const useExtensionApi: typeof useExtensionApiInternal;
20
+ export {};
@@ -0,0 +1,22 @@
1
+ import { getWorkerGlobals } from "../internal/global-utils.js";
2
+ import { createMockAwareHook } from "../internal/hook-utils.js";
3
+ function useExtensionApiInternal() {
4
+ return getWorkerGlobals().hsWorkerAPI.useExtensionApi();
5
+ }
6
+ /**
7
+ * Hook that provides access to the full extension API for the specified extension point.
8
+ *
9
+ * The extension API includes:
10
+ * - `actions`: Methods to interact with the host application
11
+ * - `context`: Contextual data about the current environment
12
+ * - `runServerlessFunction`: Function to execute serverless functions (deprecated)
13
+ *
14
+ * @typeParam TExtensionPoint - The extension point location (e.g., 'crm.record.tab', 'settings')
15
+ * @returns The complete extension API object containing actions, context, and runServerlessFunction
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * const { actions, context, runServerlessFunction } = useExtensionApi<'crm.record.tab'>();
20
+ * ```
21
+ */
22
+ export const useExtensionApi = createMockAwareHook('useExtensionApi', useExtensionApiInternal);
@@ -1,4 +1,20 @@
1
1
  import type { ExtensionPoints } from '../shared/types/extension-points.ts';
2
- declare function useExtensionContextInternal<ExtensionPoint extends keyof ExtensionPoints>(): import("../shared/types/extension-points.ts").ExtensionPointApiContext<ExtensionPoint>;
2
+ declare function useExtensionContextInternal<TExtensionPoint extends keyof ExtensionPoints>(): import("../shared/types/extension-points.ts").ExtensionPointApiContext<TExtensionPoint>;
3
+ /**
4
+ * Hook that provides access to contextual data for the specified extension point.
5
+ *
6
+ * The context contains information about the current environment where the extension
7
+ * is running, such as the current CRM object, user information, portal settings,
8
+ * and other relevant data specific to the extension point location.
9
+ *
10
+ * @typeParam TExtensionPoint - The extension point location (e.g., 'crm.record.tab', 'settings')
11
+ * @returns The context object containing environment-specific data for the extension point
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * const context = useExtensionContext<'crm.record.tab'>();
16
+ * // Access properties like: context.crm.objectId, context.user, context.portal
17
+ * ```
18
+ */
3
19
  export declare const useExtensionContext: typeof useExtensionContextInternal;
4
20
  export {};
@@ -3,4 +3,20 @@ import { createMockAwareHook } from "../internal/hook-utils.js";
3
3
  function useExtensionContextInternal() {
4
4
  return getWorkerGlobals().hsWorkerAPI.useExtensionContext();
5
5
  }
6
+ /**
7
+ * Hook that provides access to contextual data for the specified extension point.
8
+ *
9
+ * The context contains information about the current environment where the extension
10
+ * is running, such as the current CRM object, user information, portal settings,
11
+ * and other relevant data specific to the extension point location.
12
+ *
13
+ * @typeParam TExtensionPoint - The extension point location (e.g., 'crm.record.tab', 'settings')
14
+ * @returns The context object containing environment-specific data for the extension point
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * const context = useExtensionContext<'crm.record.tab'>();
19
+ * // Access properties like: context.crm.objectId, context.user, context.portal
20
+ * ```
21
+ */
6
22
  export const useExtensionContext = createMockAwareHook('useExtensionContext', useExtensionContextInternal);
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import './clientTypes.ts';
2
2
  export { hubspot } from './hubspot.ts';
3
3
  export { logger } from './logger.ts';
4
4
  export * from './shared/types/index.ts';
5
- export { Accordion, Alert, AutoGrid, BarChart, Box, Button, ButtonRow, Card, Checkbox, CurrencyInput, DateInput, DescriptionList, DescriptionListItem, Divider, Dropdown, EmptyState, ErrorState, Flex, Form, Heading, Icon, Illustration, Image, Inline, Input, LineChart, Link, List, LoadingButton, LoadingSpinner, Modal, ModalBody, ModalFooter, MultiSelect, NumberInput, Panel, PanelBody, PanelFooter, PanelSection, ProgressBar, RadioButton, ScoreCircle, SearchInput, Select, Stack, Statistics, StatisticsItem, StatisticsTrend, StatusTag, StepIndicator, StepperInput, Tab, Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, Tag, Text, TextArea, Textarea, Tile, TimeInput, Toggle, ToggleGroup, Tooltip, } from './shared/remoteComponents.tsx';
5
+ export { Accordion, Alert, AutoGrid, BarChart, Box, Button, ButtonRow, Card, Checkbox, CurrencyInput, DateInput, DescriptionList, DescriptionListItem, Divider, Dropdown, EmptyState, ErrorState, Flex, Form, Heading, Icon, Illustration, Image, Inline, Input, LineChart, Link, List, LoadingButton, LoadingSpinner, Modal, ModalBody, ModalFooter, MultiSelect, NumberInput, Panel, PanelBody, PanelFooter, PanelSection, ProgressBar, RadioButton, ScoreCircle, SearchInput, Select, Spacer, Stack, Statistics, StatisticsItem, StatisticsTrend, StatusTag, StepIndicator, StepperInput, Tab, Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, Tag, Text, TextArea, Textarea, Tile, TimeInput, Toggle, ToggleGroup, Tooltip, } from './shared/remoteComponents.tsx';
6
6
  export { useExtensionContext } from './hooks/useExtensionContext.tsx';
7
7
  export { useExtensionActions } from './hooks/useExtensionActions.tsx';
8
+ export { useExtensionApi } from './hooks/useExtensionApi.tsx';
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ import "./clientTypes.js";
3
3
  export { hubspot } from "./hubspot.js";
4
4
  export { logger } from "./logger.js";
5
5
  export * from "./shared/types/index.js";
6
- export { Accordion, Alert, AutoGrid, BarChart, Box, Button, ButtonRow, Card, Checkbox, CurrencyInput, DateInput, DescriptionList, DescriptionListItem, Divider, Dropdown, EmptyState, ErrorState, Flex, Form, Heading, Icon, Illustration, Image, Inline, Input, LineChart, Link, List, LoadingButton, LoadingSpinner, Modal, ModalBody, ModalFooter, MultiSelect, NumberInput, Panel, PanelBody, PanelFooter, PanelSection, ProgressBar, RadioButton, ScoreCircle, SearchInput, Select, Stack, Statistics, StatisticsItem, StatisticsTrend, StatusTag, StepIndicator, StepperInput, Tab, Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, Tag, Text, TextArea, Textarea, Tile, TimeInput, Toggle, ToggleGroup, Tooltip, } from "./shared/remoteComponents.js";
6
+ export { Accordion, Alert, AutoGrid, BarChart, Box, Button, ButtonRow, Card, Checkbox, CurrencyInput, DateInput, DescriptionList, DescriptionListItem, Divider, Dropdown, EmptyState, ErrorState, Flex, Form, Heading, Icon, Illustration, Image, Inline, Input, LineChart, Link, List, LoadingButton, LoadingSpinner, Modal, ModalBody, ModalFooter, MultiSelect, NumberInput, Panel, PanelBody, PanelFooter, PanelSection, ProgressBar, RadioButton, ScoreCircle, SearchInput, Select, Spacer, Stack, Statistics, StatisticsItem, StatisticsTrend, StatusTag, StepIndicator, StepperInput, Tab, Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, Tag, Text, TextArea, Textarea, Tile, TimeInput, Toggle, ToggleGroup, Tooltip, } from "./shared/remoteComponents.js";
7
7
  export { useExtensionContext } from "./hooks/useExtensionContext.js";
8
8
  export { useExtensionActions } from "./hooks/useExtensionActions.js";
9
+ export { useExtensionApi } from "./hooks/useExtensionApi.js";
@@ -59,6 +59,15 @@ export declare const DescriptionListItem: import("./types/shared.ts").HubSpotRea
59
59
  * - {@link https://developers.hubspot.com/docs/reference/ui-components/standard-components/divider Docs}
60
60
  */
61
61
  export declare const Divider: import("./types/shared.ts").HubSpotReactComponent<componentTypes.DividerProps>;
62
+ /**
63
+ * The `Spacer` component renders vertical space between components. Use this component
64
+ * to add consistent spacing without using empty wrapper components.
65
+ *
66
+ * **Links:**
67
+ *
68
+ * - {@link https://developers.hubspot.com/docs/reference/ui-components/standard-components/spacer Docs}
69
+ */
70
+ export declare const Spacer: import("./types/shared.ts").HubSpotReactComponent<componentTypes.SpacerProps>;
62
71
  /**
63
72
  * The `EmptyState` component sets the content that appears when the extension is in an empty state. Use this component when there's no content or data to help guide users.
64
73
  *
@@ -483,7 +492,7 @@ export declare const LoadingButton: import("./types/shared.ts").HubSpotReactComp
483
492
  * - {@link https://developers.hubspot.com/docs/reference/ui-components/standard-components/charts Charts Docs}
484
493
  * - {@link https://github.com/HubSpot/ui-extensions-examples/tree/main/charts-example Charts Example}
485
494
  */
486
- export declare const BarChart: import("./types/shared.ts").HubSpotReactComponent<componentTypes.ChartProps>;
495
+ export declare const BarChart: import("./types/shared.ts").HubSpotReactComponent<componentTypes.BarChartProps>;
487
496
  /**
488
497
  * The `LineChart` component renders a line chart for visualizing data. This type of chart is best suited for time series plots or trend data.
489
498
  *
@@ -493,7 +502,7 @@ export declare const BarChart: import("./types/shared.ts").HubSpotReactComponent
493
502
  * - {@link https://developers.hubspot.com/docs/reference/ui-components/standard-components/charts Charts Docs}
494
503
  * - {@link https://github.com/HubSpot/ui-extensions-examples/tree/main/charts-example Charts Example}
495
504
  */
496
- export declare const LineChart: import("./types/shared.ts").HubSpotReactComponent<componentTypes.ChartProps>;
505
+ export declare const LineChart: import("./types/shared.ts").HubSpotReactComponent<componentTypes.LineChartProps>;
497
506
  /**
498
507
  * The `ScoreCircle` component displays a score value (0-100) as a circular progress indicator with color-coded bands.
499
508
  * Scores are color-coded: 0-32 (alert/red), 33-65 (warning/yellow), 66-100 (success/green).
@@ -63,6 +63,15 @@ export const DescriptionListItem = createAndRegisterRemoteReactComponent('Descri
63
63
  * - {@link https://developers.hubspot.com/docs/reference/ui-components/standard-components/divider Docs}
64
64
  */
65
65
  export const Divider = createAndRegisterRemoteReactComponent('Divider');
66
+ /**
67
+ * The `Spacer` component renders vertical space between components. Use this component
68
+ * to add consistent spacing without using empty wrapper components.
69
+ *
70
+ * **Links:**
71
+ *
72
+ * - {@link https://developers.hubspot.com/docs/reference/ui-components/standard-components/spacer Docs}
73
+ */
74
+ export const Spacer = createAndRegisterRemoteReactComponent('Spacer');
66
75
  /**
67
76
  * The `EmptyState` component sets the content that appears when the extension is in an empty state. Use this component when there's no content or data to help guide users.
68
77
  *
@@ -1,7 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { TShirtSizes, BaseComponentProps } from '../shared.ts';
3
3
  /**
4
- * The props type for {@link !components.Accordion}.
4
+ * The props type for [Accordion](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/accordion).
5
5
  *
6
6
  * @category Component Props
7
7
  */
@@ -1,7 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { BaseComponentProps } from '../shared.ts';
3
3
  /**
4
- * The props type for {@link !components.Alert}.
4
+ * The props type for [Alert](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/alert).
5
5
  *
6
6
  * @category Component Props
7
7
  */
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
2
2
  import { ReactionsHandler } from '../reactions.ts';
3
3
  import { ExtensionEvent, OverlayComponentProps, HrefProp, BaseComponentProps } from '../shared.ts';
4
4
  /**
5
- * The props type for {@link !components.HeaderActions}.
5
+ * The props type for [HeaderActions](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/create-an-app-home-page#headeractions).
6
6
  *
7
7
  * @category Component Props
8
8
  */
@@ -13,7 +13,7 @@ export interface HeaderActionsProps extends BaseComponentProps {
13
13
  children: ReactNode;
14
14
  }
15
15
  /**
16
- * The props type for {@link !components.HeaderActions}.
16
+ * The props type for [HeaderActions](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/create-an-app-home-page#headeractions).
17
17
  *
18
18
  * @category Component Props
19
19
  */
@@ -1,7 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { TShirtSizes, BaseComponentProps } from '../shared.ts';
3
3
  /**
4
- * The props type for {@link !components.ButtonRow}.
4
+ * The props type for [ButtonRow](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/button-row).
5
5
  *
6
6
  * @category Component Props
7
7
  */
@@ -3,7 +3,8 @@ import { OverlayComponentProps, HrefProp, TShirtSizes, IconNames, ExtensionEvent
3
3
  import { ReactionsHandler } from '../reactions.ts';
4
4
  export interface BaseButtonProps extends BaseComponentProps {
5
5
  /**
6
- * A function that will be invoked when the button is clicked. It receives no arguments and its return value is ignored.
6
+ * A function that will be invoked when the button is clicked. It receives an event object and a reactions object
7
+ * with methods to control overlays. Its return value is ignored.
7
8
  *
8
9
  * @event
9
10
  */
@@ -52,7 +53,7 @@ export interface BaseButtonProps extends BaseComponentProps {
52
53
  truncate?: boolean;
53
54
  }
54
55
  /**
55
- * The props type for {@link !components.Button}.
56
+ * The props type for [Button](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/button).
56
57
  *
57
58
  * @category Component Props
58
59
  */
@@ -71,7 +72,7 @@ export interface LoadingButtonOverlayOptions {
71
72
  openBehavior?: 'onClick' | 'onLoadingFinish';
72
73
  }
73
74
  /**
74
- * The props type for {@link !components.LoadingButton}.
75
+ * The props type for [LoadingButton](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/loading-button).
75
76
  *
76
77
  * @category Component Props
77
78
  */
@@ -1,32 +1,93 @@
1
1
  import { BaseComponentProps } from '../shared.ts';
2
+ export interface ChartProps extends BaseComponentProps {
3
+ /**
4
+ * An object containing the chart's data in an array.
5
+ */
6
+ data: ChartDataRow[] | {
7
+ data: ChartDataRow[];
8
+ options?: ChartDataOptions;
9
+ };
10
+ /**
11
+ * Configures the chart's axes.
12
+ */
13
+ axes: ChartAxisPair;
14
+ /**
15
+ * Additional chart configuration options. Options include:
16
+ * - `title` (string): a title for the chart.
17
+ * - `showLegend` (boolean): set to `true` to display a legend above the chart.
18
+ * - `showDataLabels` (boolean): set to `true` to display labels above data points.
19
+ * - `showTooltips` (boolean): set to `true` to display tooltips for data points on hover.
20
+ * - `colorList` (array): specify a custom order for colors to be used in the report.
21
+ *
22
+ * Learn more about [chart options](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/charts/overview#chart-options).
23
+ */
24
+ options?: ChartOptions;
25
+ }
2
26
  /**
3
- * The props type for {@link !components.BarChart}.
27
+ * The props type for [BarChart](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/charts/bar-chart).
4
28
  *
5
29
  * @category Component Props
6
30
  */
7
- export type BarChartProps = ChartProps;
31
+ export interface BarChartProps extends ChartProps {
32
+ /**
33
+ * An object containing the chart's data in an array.
34
+ * - Data should be formatted as comma-separated objects containing key-value pairs.
35
+ * - Data will be displayed in the order it's provided, so any sorting will need to be done before passing it to the component.
36
+ * - While it's recommended to pre-format your data to be human-readable, you can also provide the `propertyLabels` parameter via this prop's `options` to relabel data values. See example in the [Stacking section](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/charts/bar-chart#stacking).
37
+ *
38
+ * Learn more about [formatting data](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/charts/overview#formatting-data).
39
+ */
40
+ data: ChartDataRow[] | {
41
+ data: ChartDataRow[];
42
+ options?: ChartDataOptions;
43
+ };
44
+ /**
45
+ * Configures the chart's axes. Using the `x` and `y` fields, you'll configure each axis individually with `field` and `fieldType` parameters, along with an optional `label` parameter:
46
+ * - `field` (Required): the field from your dataset to use. This value will be used as the displayed axis label if no `label` is specified.
47
+ * - `fieldType` (Required): the type of field. Can be `category`, `datetime`, or `linear`. Learn more about [field types](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/charts/overview#configuring-axes).
48
+ * - `label`: the axis label. If not specified, the `field` value will be used.
49
+ *
50
+ * You can also include an `options` field to further configure the axes with the following options:
51
+ * - `groupFieldByColor` (string): specify a field to [apply color](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/charts/bar-chart#colors) to for visual clarity.
52
+ * - `stacking` (boolean): [stack grouped data](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/charts/bar-chart#stacking) instead of always rendering separate bars.
53
+ * - `colors` (object): [specify colors for values](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/charts/bar-chart#specify-colors-per-field-value) in the field specified in `groupFieldByColor`.
54
+ *
55
+ * Learn more about [chart axes](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/charts/overview#configuring-axes).
56
+ */
57
+ axes: ChartAxisPair;
58
+ }
8
59
  /**
9
- * The props type for {@link !components.LineChart}.
60
+ * The props type for [LineChart](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/charts/line-chart).
10
61
  *
11
62
  * @category Component Props
12
63
  */
13
- export type LineChartProps = ChartProps;
14
- export interface ChartProps extends BaseComponentProps {
64
+ export interface LineChartProps extends ChartProps {
15
65
  /**
16
66
  * An object containing the chart's data in an array.
67
+ * - Data should be formatted as comma-separated objects containing key-value pairs.
68
+ * - Data will be displayed in the order it's provided, so any sorting will need to be done before passing it to the component.
69
+ * - While it's recommended to pre-format your data to be human-readable, you can also provide the `propertyLabels` parameter via this prop's `options` to relabel data values. See example in the [Stacking section](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/charts/line-chart#stacking).
70
+ *
71
+ * Learn more about [formatting data](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/charts/overview#formatting-data).
17
72
  */
18
73
  data: ChartDataRow[] | {
19
74
  data: ChartDataRow[];
20
75
  options?: ChartDataOptions;
21
76
  };
22
77
  /**
23
- * Configures the chart's axes.
78
+ * Configures the chart's axes. Using the `x` and `y` fields, you'll configure each axis individually with `field` and `fieldType` parameters, along with an optional `label` parameter:
79
+ * - `field` (Required): the field from your dataset to use. This value will be used as the displayed axis label if no `label` is specified.
80
+ * - `fieldType` (Required): the type of field. Can be `category`, `datetime`, or `linear`. Learn more about [field types](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/charts/overview#configuring-axes).
81
+ * - `label`: the axis label. If not specified, the `field` value will be used.
82
+ *
83
+ * You can also include an `options` field to further configure the axes with the following options:
84
+ * - `groupFieldByColor` (string): specify a field to [apply color](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/charts/line-chart#colors) to for visual clarity.
85
+ * - `stacking` (boolean): [stack grouped data](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/charts/line-chart#stacking) instead of always rendering separated lines.
86
+ * - `colors` (object): [specify colors for values](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/charts/line-chart#specify-colors-per-field-value) in the field specified in `groupFieldByColor`.
87
+ *
88
+ * Learn more about [chart axes](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/charts/overview#configuring-axes).
24
89
  */
25
90
  axes: ChartAxisPair;
26
- /**
27
- * Additional chart configuration options.
28
- */
29
- options?: ChartOptions;
30
91
  }
31
92
  export type ChartDataRow = {
32
93
  [key: string]: number | string;
@@ -1,7 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { BaseComponentProps } from '../shared.ts';
3
3
  /**
4
- * The props type for {@link !components.DescriptionListItem}.
4
+ * The props type for [DescriptionListItem](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/description-list).
5
5
  *
6
6
  * @category Component Props
7
7
  */
@@ -18,13 +18,13 @@ export interface DescriptionListItemProps extends BaseComponentProps {
18
18
  label: string;
19
19
  }
20
20
  /**
21
- * The props type for {@link !components.DescriptionList}.
21
+ * The props type for [DescriptionList](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/description-list).
22
22
  *
23
23
  * @category Component Props
24
24
  */
25
25
  export interface DescriptionListProps extends BaseComponentProps {
26
26
  /**
27
- * Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components. The children should be {@link !components.DescriptionListItem}.
27
+ * Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components. The children should be [DescriptionListItem](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/description-list).
28
28
  *
29
29
  */
30
30
  children: ReactNode;
@@ -1,6 +1,6 @@
1
1
  import { AllDistances, BaseComponentProps } from '../shared.ts';
2
2
  /**
3
- * The props type for {@link !components.Divider}.
3
+ * The props type for [Divider](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/divider).
4
4
  *
5
5
  * @category Component Props
6
6
  */
@@ -10,5 +10,9 @@ export interface DividerProps extends BaseComponentProps {
10
10
  *
11
11
  * @defaultValue `"small"`
12
12
  */
13
+ size?: AllDistances;
14
+ /**
15
+ * @deprecated Use `size` instead.
16
+ */
13
17
  distance?: AllDistances;
14
18
  }
@@ -20,7 +20,7 @@ export interface DropdownOption {
20
20
  onClick?: () => void;
21
21
  }
22
22
  /**
23
- * The props type for {@link !components.DropdownButtonItem}.
23
+ * The props type for [DropdownButtonItem](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/dropdown).
24
24
  *
25
25
  * @category Component Props
26
26
  */
@@ -38,7 +38,7 @@ export interface DropdownButtonItemProps extends OverlayComponentProps, BaseComp
38
38
  onClick?: ReactionsHandler<ExtensionEvent>;
39
39
  }
40
40
  /**
41
- * The props type for {@link !components.Dropdown}.
41
+ * The props type for [Dropdown](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/dropdown).
42
42
  *
43
43
  * @category Component Props
44
44
  */
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
2
2
  import { BaseComponentProps } from '../shared.ts';
3
3
  export type EmptyStateImageName = 'addOnReporting' | 'announcement' | 'api' | 'automatedTesting' | 'beta' | 'building' | 'callingSetUp' | 'companies' | 'components' | 'cone' | 'contacts' | 'contentStrategy' | 'customObjects' | 'customerExperience' | 'customerSupport' | 'deals' | 'developerSecurityUpdate' | 'electronicSignature' | 'electronicSignatureEmptyState' | 'emailConfirmation' | 'emptyStateCharts' | 'idea' | 'integrations' | 'leads' | 'lock' | 'meetings' | 'missedGoal' | 'multipleObjects' | 'object' | 'productsShoppingCart' | 'registration' | 'sandboxAddOn' | 'social' | 'store' | 'storeDisabled' | 'successfullyConnectedEmail' | 'target' | 'task' | 'tickets' | 'voteAndSearch';
4
4
  /**
5
- * The props type for {@link !components.EmptyState}.
5
+ * The props type for [EmptyState](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/empty-state).
6
6
  *
7
7
  * @category Component Props
8
8
  */
@@ -1,7 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { BaseComponentProps } from '../shared.ts';
3
3
  /**
4
- * The props type for {@link !components.ErrorState}.
4
+ * The props type for [ErrorState](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/error-state).
5
5
  *
6
6
  * @category Component Props
7
7
  */
@@ -3,7 +3,7 @@ import { FormSubmitExtensionEvent, BaseComponentProps } from '../shared.ts';
3
3
  import { ReactionsHandler } from '../reactions.ts';
4
4
  export type FormInputValues = Record<string, string | number>;
5
5
  /**
6
- * The props type for {@link !components.Form}.
6
+ * The props type for [Form](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/form).
7
7
  *
8
8
  * @category Component Props
9
9
  */
@@ -1,7 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { BaseComponentProps } from '../shared.ts';
3
3
  /**
4
- * The props type for {@link !components.Heading}.
4
+ * The props type for [Heading](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/heading).
5
5
  *
6
6
  * @category Component Props
7
7
  */
@@ -1,7 +1,7 @@
1
1
  import { TShirtSizes, IconNames, BaseComponentProps } from '../shared.ts';
2
2
  export type IconColor = 'alert' | 'warning' | 'success' | 'inherit';
3
3
  /**
4
- * The props type for {@link !components.Icon}.
4
+ * The props type for [Icon](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/icon).
5
5
  *
6
6
  * @category Component Props
7
7
  */
@@ -1,6 +1,6 @@
1
1
  import { BaseComponentProps } from '../shared.ts';
2
2
  /**
3
- * The props type for {@link !components.Illustration}.
3
+ * The props type for [Illustration](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/illustration).
4
4
  *
5
5
  * @category Component Props
6
6
  */
@@ -1,7 +1,7 @@
1
1
  import { OverlayComponentProps, HrefProp, ExtensionEvent, BaseComponentProps } from '../shared.ts';
2
2
  import { ReactionsHandler } from '../reactions.ts';
3
3
  /**
4
- * The props type for {@link !components.Image}.
4
+ * The props type for [Image](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/image).
5
5
  *
6
6
  * @category Component Props
7
7
  */
@@ -22,7 +22,8 @@ export interface ImageProps extends OverlayComponentProps, BaseComponentProps {
22
22
  */
23
23
  href?: HrefProp;
24
24
  /**
25
- * A function that will be called when the image is clicked. This function will receive no arguments and any returned values will be ignored.
25
+ * A function that will be invoked when the button is clicked. It receives an event object and a reactions object
26
+ * with methods to control overlays. Its return value is ignored.
26
27
  *
27
28
  * @event
28
29
  */
@@ -26,6 +26,7 @@ export type * from './panel.ts';
26
26
  export type * from './progress-bar.ts';
27
27
  export type * from './score.ts';
28
28
  export type * from './selects.ts';
29
+ export type * from './spacer.ts';
29
30
  export type * from './statistics.ts';
30
31
  export type * from './status-tag.ts';
31
32
  export type * from './step-indicator.ts';
@@ -80,7 +80,7 @@ interface BaseInputProps<T = string, V = string> extends BaseComponentProps {
80
80
  onFocus?: (value: V) => void;
81
81
  }
82
82
  /**
83
- * The props type for {@link !components.Input}.
83
+ * The props type for [Input](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/input).
84
84
  *
85
85
  * @category Component Props
86
86
  */
@@ -93,7 +93,7 @@ export interface InputProps extends BaseInputProps {
93
93
  type?: 'text' | 'password';
94
94
  }
95
95
  /**
96
- * The props type for {@link !components.TextArea}.
96
+ * The props type for [TextArea](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/text-area).
97
97
  *
98
98
  * @category Component Props
99
99
  */
@@ -130,7 +130,7 @@ export type TextareaProps = TextAreaProps;
130
130
  * */
131
131
  type BaseInputForNumber = Omit<BaseInputProps<number, number>, 'onInput'>;
132
132
  /**
133
- * The props type for {@link !components.NumberInput}.
133
+ * The props type for [NumberInput](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/number-input).
134
134
  *
135
135
  * @category Component Props
136
136
  */
@@ -157,7 +157,7 @@ export interface NumberInputProps extends BaseInputForNumber {
157
157
  onInput?: (value: number) => void;
158
158
  }
159
159
  /**
160
- * The props type for {@link !components.CurrencyInput}.
160
+ * The props type for [CurrencyInput](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/currency-input).
161
161
  *
162
162
  * @category Component Props
163
163
  */
@@ -181,7 +181,7 @@ export interface CurrencyInputProps extends BaseInputForNumber {
181
181
  max?: number;
182
182
  }
183
183
  /**
184
- * The props type for {@link !components.StepperInput}.
184
+ * The props type for [StepperInput](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/stepper-input).
185
185
  *
186
186
  * @category Component Props
187
187
  */
@@ -219,7 +219,7 @@ export interface DateInputEventsPayload extends BaseDate {
219
219
  * */
220
220
  type BaseDateInputForDate = Omit<BaseInputProps<BaseDate | null, DateInputEventsPayload>, 'onInput' | 'placeholder'>;
221
221
  /**
222
- * The props type for {@link !components.DateInput}.
222
+ * The props type for [DateInput](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/date-input).
223
223
  *
224
224
  * @category Component Props
225
225
  */
@@ -306,7 +306,7 @@ export interface TimeInputEventsPayload extends BaseTime {
306
306
  * */
307
307
  type BaseTimeInputForTime = Omit<BaseInputProps<BaseTime | null, TimeInputEventsPayload>, 'onInput' | 'placeholder' | 'onChange'>;
308
308
  /**
309
- * The props type for {@link !components.TimeInput}.
309
+ * The props type for [TimeInput](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/time-input).
310
310
  *
311
311
  * @category Component Props
312
312
  */
@@ -338,7 +338,7 @@ export interface TimeInputProps extends BaseTimeInputForTime {
338
338
  timezone?: 'userTz' | 'portalTz';
339
339
  }
340
340
  /**
341
- * The props type for {@link !components.SearchInput}.
341
+ * The props type for [SearchInput](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/search-input).
342
342
  *
343
343
  * @category Component Props
344
344
  */