@hubspot/ui-extensions 0.11.4 → 0.11.6
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.
- package/dist/__tests__/crm/hooks/useAssociations.spec.js +96 -0
- package/dist/__tests__/crm/hooks/useCrmProperties.spec.js +170 -1
- package/dist/crm/hooks/useAssociations.d.ts +2 -0
- package/dist/crm/hooks/useAssociations.js +87 -0
- package/dist/crm/hooks/useCrmProperties.d.ts +5 -1
- package/dist/crm/hooks/useCrmProperties.js +81 -2
- package/dist/hooks/useExtensionActions.d.ts +4 -0
- package/dist/hooks/useExtensionActions.js +6 -0
- package/dist/hooks/useExtensionContext.d.ts +4 -0
- package/dist/hooks/useExtensionContext.js +6 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/internal/global-utils.js +4 -0
- package/dist/internal/hook-utils.d.ts +10 -3
- package/dist/internal/hook-utils.js +10 -1
- package/dist/shared/types/components/accordion.d.ts +5 -5
- package/dist/shared/types/components/alert.d.ts +2 -2
- package/dist/shared/types/components/button-row.d.ts +5 -2
- package/dist/shared/types/components/button.d.ts +16 -10
- package/dist/shared/types/components/chart.d.ts +3 -3
- package/dist/shared/types/components/description-list.d.ts +2 -2
- package/dist/shared/types/components/dropdown.d.ts +8 -8
- package/dist/shared/types/components/empty-state.d.ts +5 -7
- package/dist/shared/types/components/error-state.d.ts +2 -2
- package/dist/shared/types/components/form.d.ts +2 -2
- package/dist/shared/types/components/heading.d.ts +1 -1
- package/dist/shared/types/components/icon.d.ts +4 -5
- package/dist/shared/types/components/illustration.d.ts +12 -0
- package/dist/shared/types/components/image.d.ts +9 -4
- package/dist/shared/types/components/inputs.d.ts +51 -64
- package/dist/shared/types/components/layouts.d.ts +17 -24
- package/dist/shared/types/components/link.d.ts +8 -5
- package/dist/shared/types/components/loading-spinner.d.ts +3 -3
- package/dist/shared/types/components/modal.d.ts +5 -5
- package/dist/shared/types/components/panel.d.ts +7 -7
- package/dist/shared/types/components/progress-bar.d.ts +4 -4
- package/dist/shared/types/components/selects.d.ts +11 -20
- package/dist/shared/types/components/statistics.d.ts +2 -2
- package/dist/shared/types/components/status-tag.d.ts +5 -5
- package/dist/shared/types/components/step-indicator.d.ts +5 -7
- package/dist/shared/types/components/table.d.ts +22 -12
- package/dist/shared/types/components/tabs.d.ts +10 -10
- package/dist/shared/types/components/tag.d.ts +2 -2
- package/dist/shared/types/components/text.d.ts +15 -21
- package/dist/shared/types/components/tile.d.ts +2 -2
- package/dist/shared/types/components/toggle.d.ts +12 -14
- package/dist/shared/types/components/toggleInputs.d.ts +26 -19
- package/dist/shared/types/components/tooltip.d.ts +1 -1
- package/dist/shared/types/crm.d.ts +52 -0
- package/dist/shared/types/http-requests.d.ts +2 -2
- package/dist/shared/types/shared.d.ts +123 -78
- package/dist/shared/types/shared.js +123 -78
- package/dist/shared/types/worker-globals.d.ts +15 -0
- package/dist/{experimental/testing → testing}/__tests__/debug.spec.js +1 -1
- package/dist/{experimental/testing → testing}/__tests__/find.spec.js +1 -1
- package/dist/{experimental/testing → testing}/__tests__/findAll.spec.js +1 -1
- package/dist/{experimental/testing → testing}/__tests__/findAllChildren.spec.js +1 -1
- package/dist/{experimental/testing → testing}/__tests__/findByTestId.spec.js +1 -1
- package/dist/{experimental/testing → testing}/__tests__/findChild.spec.js +1 -1
- package/dist/{experimental/testing → testing}/__tests__/fragments.spec.js +1 -1
- package/dist/{experimental/testing → testing}/__tests__/invalid-components.spec.js +1 -1
- package/dist/{experimental/testing → testing}/__tests__/isMatch.spec.js +1 -1
- package/dist/{experimental/testing → testing}/__tests__/logger.spec.js +1 -1
- package/dist/{experimental/testing → testing}/__tests__/maybeFind.spec.js +1 -1
- package/dist/{experimental/testing → testing}/__tests__/maybeFindByTestId.spec.js +1 -1
- package/dist/{experimental/testing → testing}/__tests__/maybeFindChild.spec.js +1 -1
- package/dist/{experimental/testing → testing}/__tests__/mocks.runServerlessFunction.spec.js +1 -1
- package/dist/testing/__tests__/mocks.useAssociations.spec.js +135 -0
- package/dist/testing/__tests__/mocks.useCrmProperties.spec.js +106 -0
- package/dist/testing/__tests__/mocks.useExtensionActions.spec.js +32 -0
- package/dist/testing/__tests__/mocks.useExtensionContext.spec.js +46 -0
- package/dist/{experimental/testing → testing}/__tests__/props.spec.js +1 -1
- package/dist/{experimental/testing → testing}/__tests__/testId.spec.js +1 -1
- package/dist/{experimental/testing → testing}/__tests__/trigger.spec.js +1 -1
- package/dist/{experimental/testing → testing}/__tests__/type-utils.spec.js +1 -1
- package/dist/testing/__tests__/waitFor.spec.d.ts +1 -0
- package/dist/{experimental/testing → testing}/__tests__/waitFor.spec.js +1 -1
- package/dist/{experimental/testing → testing}/internal/convert.js +1 -1
- package/dist/{experimental/testing → testing}/internal/element.d.ts +1 -1
- package/dist/{experimental/testing → testing}/internal/errors.js +1 -1
- package/dist/{experimental/testing → testing}/internal/match.d.ts +1 -1
- package/dist/{experimental/testing → testing}/internal/mocks/index.d.ts +1 -1
- package/dist/{experimental/testing → testing}/internal/mocks/mock-extension-point-api.d.ts +1 -1
- package/dist/{experimental/testing → testing}/internal/mocks/mock-extension-point-api.js +1 -1
- package/dist/testing/internal/mocks/mock-hooks.d.ts +3 -0
- package/dist/{experimental/testing → testing}/internal/mocks/mock-hooks.js +14 -0
- package/dist/{experimental/testing → testing}/internal/print.js +1 -1
- package/dist/{experimental/testing → testing}/internal/query.d.ts +1 -1
- package/dist/{experimental/testing → testing}/internal/query.js +1 -1
- package/dist/{experimental/testing → testing}/internal/types-internal.d.ts +7 -3
- package/dist/testing/internal/types-internal.js +1 -0
- package/dist/{experimental/testing → testing}/render.d.ts +1 -1
- package/dist/{experimental/testing → testing}/render.js +7 -7
- package/dist/{experimental/testing → testing}/types.d.ts +25 -5
- package/dist/{experimental/testing → testing}/utils.d.ts +1 -1
- package/dist/{experimental/testing → testing}/utils.js +1 -1
- package/package.json +3 -3
- package/dist/experimental/testing/__tests__/mocks.useAssociations.spec.js +0 -47
- package/dist/experimental/testing/__tests__/mocks.useCrmProperties.spec.js +0 -58
- package/dist/experimental/testing/internal/mocks/mock-hooks.d.ts +0 -2
- /package/dist/{experimental/testing → testing}/__tests__/createRenderer.spec.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/__tests__/createRenderer.spec.js +0 -0
- /package/dist/{experimental/testing → testing}/__tests__/debug.spec.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/__tests__/find.spec.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/__tests__/findAll.spec.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/__tests__/findAllChildren.spec.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/__tests__/findByTestId.spec.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/__tests__/findChild.spec.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/__tests__/fragments.spec.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/__tests__/invalid-components.spec.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/__tests__/isMatch.spec.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/__tests__/logger.spec.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/__tests__/maybeFind.spec.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/__tests__/maybeFindByTestId.spec.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/__tests__/maybeFindChild.spec.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/__tests__/mocks.actions.spec.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/__tests__/mocks.actions.spec.js +0 -0
- /package/dist/{experimental/testing → testing}/__tests__/mocks.context.spec.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/__tests__/mocks.context.spec.js +0 -0
- /package/dist/{experimental/testing → testing}/__tests__/mocks.runServerlessFunction.spec.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/__tests__/mocks.useAssociations.spec.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/__tests__/mocks.useCrmProperties.spec.d.ts +0 -0
- /package/dist/{experimental/testing/__tests__/props.spec.d.ts → testing/__tests__/mocks.useExtensionActions.spec.d.ts} +0 -0
- /package/dist/{experimental/testing/__tests__/testId.spec.d.ts → testing/__tests__/mocks.useExtensionContext.spec.d.ts} +0 -0
- /package/dist/{experimental/testing/__tests__/trigger.spec.d.ts → testing/__tests__/props.spec.d.ts} +0 -0
- /package/dist/{experimental/testing/__tests__/type-utils.spec.d.ts → testing/__tests__/testId.spec.d.ts} +0 -0
- /package/dist/{experimental/testing/__tests__/waitFor.spec.d.ts → testing/__tests__/trigger.spec.d.ts} +0 -0
- /package/dist/{experimental/testing/internal/types-internal.js → testing/__tests__/type-utils.spec.d.ts} +0 -0
- /package/dist/{experimental/testing → testing}/index.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/index.js +0 -0
- /package/dist/{experimental/testing → testing}/internal/constants.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/internal/constants.js +0 -0
- /package/dist/{experimental/testing → testing}/internal/convert.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/internal/debug.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/internal/debug.js +0 -0
- /package/dist/{experimental/testing → testing}/internal/document.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/internal/document.js +0 -0
- /package/dist/{experimental/testing → testing}/internal/element.js +0 -0
- /package/dist/{experimental/testing → testing}/internal/errors.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/internal/fragment.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/internal/fragment.js +0 -0
- /package/dist/{experimental/testing → testing}/internal/match.js +0 -0
- /package/dist/{experimental/testing → testing}/internal/mocks/index.js +0 -0
- /package/dist/{experimental/testing → testing}/internal/print.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/internal/root.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/internal/root.js +0 -0
- /package/dist/{experimental/testing → testing}/internal/text.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/internal/text.js +0 -0
- /package/dist/{experimental/testing → testing}/internal/type-utils-internal.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/internal/type-utils-internal.js +0 -0
- /package/dist/{experimental/testing → testing}/internal/utils/promise-utils.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/internal/utils/promise-utils.js +0 -0
- /package/dist/{experimental/testing → testing}/type-utils.d.ts +0 -0
- /package/dist/{experimental/testing → testing}/type-utils.js +0 -0
- /package/dist/{experimental/testing → testing}/types.js +0 -0
|
@@ -7,7 +7,7 @@ import { TShirtSizes, BaseComponentProps } from '../shared.ts';
|
|
|
7
7
|
*/
|
|
8
8
|
export interface AccordionProps extends BaseComponentProps {
|
|
9
9
|
/**
|
|
10
|
-
* The title text
|
|
10
|
+
* The accordion's title text.
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
13
|
title: string;
|
|
@@ -17,19 +17,19 @@ export interface AccordionProps extends BaseComponentProps {
|
|
|
17
17
|
*/
|
|
18
18
|
children: ReactNode;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* When set to `true`, the accordion will be open on initial page load. The `open` prop takes precedence over this prop.
|
|
21
21
|
*
|
|
22
22
|
* @defaultValue `false`
|
|
23
23
|
*/
|
|
24
24
|
defaultOpen?: boolean;
|
|
25
25
|
/**
|
|
26
|
-
* When set to `true`, the accordion's
|
|
26
|
+
* When set to `true`, the accordion's state cannot be changed.
|
|
27
27
|
*
|
|
28
28
|
* @defaultValue `false`
|
|
29
29
|
*/
|
|
30
30
|
disabled?: boolean;
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* Controls the accordion's open state programmatically. When set to `true`, the accordion will open. Takes precedence over `defaultOpen`.
|
|
33
33
|
*
|
|
34
34
|
*/
|
|
35
35
|
open?: boolean;
|
|
@@ -40,7 +40,7 @@ export interface AccordionProps extends BaseComponentProps {
|
|
|
40
40
|
*/
|
|
41
41
|
size?: TShirtSizes['xs'] | TShirtSizes['sm'] | TShirtSizes['md'];
|
|
42
42
|
/**
|
|
43
|
-
* A function that will be invoked when the title is clicked.
|
|
43
|
+
* A function that will be invoked when the accordion title is clicked. This function receives no arguments and its returned value is ignored.
|
|
44
44
|
*
|
|
45
45
|
* @event
|
|
46
46
|
*/
|
|
@@ -7,7 +7,7 @@ import { BaseComponentProps } from '../shared.ts';
|
|
|
7
7
|
*/
|
|
8
8
|
export interface AlertProps extends BaseComponentProps {
|
|
9
9
|
/**
|
|
10
|
-
* The bolded
|
|
10
|
+
* The bolded text of the alert.
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
13
|
title: string;
|
|
@@ -17,7 +17,7 @@ export interface AlertProps extends BaseComponentProps {
|
|
|
17
17
|
*/
|
|
18
18
|
children?: ReactNode;
|
|
19
19
|
/**
|
|
20
|
-
* The color of the alert.
|
|
20
|
+
* The color of the alert. See [variants](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/alert#variants) for more information.
|
|
21
21
|
*
|
|
22
22
|
* @defaultValue `"info"`
|
|
23
23
|
*/
|
|
@@ -11,13 +11,16 @@ export interface ButtonRowProps extends BaseComponentProps {
|
|
|
11
11
|
*/
|
|
12
12
|
children: ReactNode;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* By default, when the number of buttons exceeds the available horizontal space, the extra buttons will collapse into a single dropdown menu button. Set this prop to `true` to prevent the dropdown button from being interacted with.
|
|
15
15
|
*
|
|
16
16
|
* @defaultValue `false`
|
|
17
17
|
*/
|
|
18
18
|
disableDropdown?: boolean;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* When the included buttons exceed the available space, use this prop to customize the dropdown button. This prop takes an object containing the following `key: 'value'` pairs:
|
|
21
|
+
* - `size`: the size of the button. Can be `'xs'`, `'sm'`, or `'md'` (default).
|
|
22
|
+
* - `text`: the button's text. By default, is set to `More`. If set to an empty value, will display a gear icon.
|
|
23
|
+
* - `variant`: the button variation. Can be `'primary'`, `'secondary'` (default), or `'transparent'`.
|
|
21
24
|
*/
|
|
22
25
|
dropDownButtonOptions?: ButtonRownDropDownButtonOptionsProps;
|
|
23
26
|
}
|
|
@@ -3,27 +3,33 @@ 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.
|
|
6
|
+
* A function that will be invoked when the button is clicked. It receives no arguments and its return value is ignored.
|
|
7
7
|
*
|
|
8
8
|
* @event
|
|
9
9
|
*/
|
|
10
10
|
onClick?: ReactionsHandler<ExtensionEvent>;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Include this prop to open a URL on click. Contains the following fields:
|
|
13
|
+
* - `url` (string): the URL that will open on click.
|
|
14
|
+
* - `external` (boolean): set to `true` to open the URL in a new tab and display an external link icon. By default:
|
|
15
|
+
* - Links to HubSpot app pages will open in the same tab and will not include an icon.
|
|
16
|
+
* - Links to non-HubSpot app pages will open in a new tab and include the icon.
|
|
17
|
+
*
|
|
18
|
+
* When a button includes both `href` and an `onClick` action, both will be executed on button click.
|
|
13
19
|
*/
|
|
14
20
|
href?: HrefProp;
|
|
15
21
|
/**
|
|
16
|
-
*
|
|
22
|
+
* When set to `true`, the button will render in a greyed-out state and cannot be clicked.
|
|
17
23
|
*/
|
|
18
24
|
disabled?: boolean;
|
|
19
25
|
/**
|
|
20
|
-
* Sets the color
|
|
26
|
+
* Sets the color of the button.
|
|
21
27
|
*
|
|
22
28
|
* @defaultValue `"secondary"`
|
|
23
29
|
*/
|
|
24
30
|
variant?: 'primary' | 'secondary' | 'destructive' | 'transparent';
|
|
25
31
|
/**
|
|
26
|
-
* Sets the HTML attribute
|
|
32
|
+
* Sets the `role` HTML attribute of the button.
|
|
27
33
|
*
|
|
28
34
|
* @defaultValue `"button"`
|
|
29
35
|
*/
|
|
@@ -33,13 +39,13 @@ export interface BaseButtonProps extends BaseComponentProps {
|
|
|
33
39
|
*/
|
|
34
40
|
children: ReactNode;
|
|
35
41
|
/**
|
|
36
|
-
*
|
|
42
|
+
* The size of the button.
|
|
37
43
|
*
|
|
38
44
|
* @defaultValue `"md"`
|
|
39
45
|
*/
|
|
40
46
|
size?: TShirtSizes['xs'] | TShirtSizes['sm'] | TShirtSizes['md'];
|
|
41
47
|
/**
|
|
42
|
-
* When set to `true`, long button text will be truncated with an ellipsis (`...`)
|
|
48
|
+
* When set to `true`, long button text will be truncated with an ellipsis (`...`), with the full text displayed in a tooltip on hover.
|
|
43
49
|
*
|
|
44
50
|
* @defaultValue `false`
|
|
45
51
|
*/
|
|
@@ -71,13 +77,13 @@ export interface LoadingButtonOverlayOptions {
|
|
|
71
77
|
*/
|
|
72
78
|
export interface LoadingButtonProps extends BaseButtonProps, OverlayComponentProps {
|
|
73
79
|
/**
|
|
74
|
-
* Sets the color
|
|
80
|
+
* Sets the color of the button.
|
|
75
81
|
*
|
|
76
82
|
* @defaultValue `"secondary"`
|
|
77
83
|
*/
|
|
78
84
|
variant?: 'primary' | 'secondary' | 'destructive';
|
|
79
85
|
/**
|
|
80
|
-
*
|
|
86
|
+
* Set to `true` to display the loading indicator and disable the button. Default is `false`.
|
|
81
87
|
*
|
|
82
88
|
* @defaultValue `false`
|
|
83
89
|
*/
|
|
@@ -87,7 +93,7 @@ export interface LoadingButtonProps extends BaseButtonProps, OverlayComponentPro
|
|
|
87
93
|
*/
|
|
88
94
|
overlayOptions?: LoadingButtonOverlayOptions;
|
|
89
95
|
/**
|
|
90
|
-
*
|
|
96
|
+
* Set to an icon name to display an icon after loading. By default, will display a check mark.
|
|
91
97
|
*
|
|
92
98
|
* @defaultValue `"success"`
|
|
93
99
|
*/
|
|
@@ -13,18 +13,18 @@ export type BarChartProps = ChartProps;
|
|
|
13
13
|
export type LineChartProps = ChartProps;
|
|
14
14
|
export interface ChartProps extends BaseComponentProps {
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* An object containing the chart's data in an array.
|
|
17
17
|
*/
|
|
18
18
|
data: ChartDataRow[] | {
|
|
19
19
|
data: ChartDataRow[];
|
|
20
20
|
options?: ChartDataOptions;
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Configures the chart's axes.
|
|
24
24
|
*/
|
|
25
25
|
axes: ChartAxisPair;
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* Additional chart configuration options.
|
|
28
28
|
*/
|
|
29
29
|
options?: ChartOptions;
|
|
30
30
|
}
|
|
@@ -12,7 +12,7 @@ export interface DescriptionListItemProps extends BaseComponentProps {
|
|
|
12
12
|
*/
|
|
13
13
|
children: ReactNode;
|
|
14
14
|
/**
|
|
15
|
-
* Text to
|
|
15
|
+
* Text to display as the label.
|
|
16
16
|
*
|
|
17
17
|
*/
|
|
18
18
|
label: string;
|
|
@@ -29,7 +29,7 @@ export interface DescriptionListProps extends BaseComponentProps {
|
|
|
29
29
|
*/
|
|
30
30
|
children: ReactNode;
|
|
31
31
|
/**
|
|
32
|
-
* The direction the label
|
|
32
|
+
* The direction that the label and value pairs are displayed.
|
|
33
33
|
*
|
|
34
34
|
* @defaultValue `"column"`
|
|
35
35
|
*/
|
|
@@ -31,8 +31,7 @@ export interface DropdownButtonItemProps extends OverlayComponentProps, BaseComp
|
|
|
31
31
|
*/
|
|
32
32
|
children: ReactNode;
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
35
|
-
* It receives no arguments and its return value is ignored.
|
|
34
|
+
* The function invoked when the item is clicked.
|
|
36
35
|
*
|
|
37
36
|
* @event
|
|
38
37
|
*/
|
|
@@ -45,8 +44,9 @@ export interface DropdownButtonItemProps extends OverlayComponentProps, BaseComp
|
|
|
45
44
|
*/
|
|
46
45
|
export interface DropdownProps extends BaseComponentProps {
|
|
47
46
|
/**
|
|
48
|
-
* The
|
|
49
|
-
*
|
|
47
|
+
* The options included in the dropdown menu. Each option includes:
|
|
48
|
+
* - `label`: the text label for the option.
|
|
49
|
+
* - `onClick`: the function that gets invoked when the option is selected.
|
|
50
50
|
*
|
|
51
51
|
* @deprecated This prop is deprecated and will be removed in a future release.
|
|
52
52
|
* Use child components instead to define dropdown menu items. For example,
|
|
@@ -54,25 +54,25 @@ export interface DropdownProps extends BaseComponentProps {
|
|
|
54
54
|
*/
|
|
55
55
|
options?: DropdownOption[];
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
57
|
+
* The type of dropdown button to display. `'primary'` and `'secondary'` will display a blue and grey button, respectively, while `'transparent'` will display a blue hyperlink.
|
|
58
58
|
*
|
|
59
59
|
* @defaultValue `"secondary"`
|
|
60
60
|
*/
|
|
61
61
|
variant?: 'primary' | 'secondary' | 'transparent';
|
|
62
62
|
/**
|
|
63
|
-
*
|
|
63
|
+
* The button text.
|
|
64
64
|
*
|
|
65
65
|
* @defaultValue `"More"`
|
|
66
66
|
*/
|
|
67
67
|
buttonText?: string;
|
|
68
68
|
/**
|
|
69
|
-
*
|
|
69
|
+
* The size of the button.
|
|
70
70
|
*
|
|
71
71
|
* @defaultValue `"md"`
|
|
72
72
|
*/
|
|
73
73
|
buttonSize?: TShirtSizes['xs'] | TShirtSizes['sm'] | TShirtSizes['md'];
|
|
74
74
|
/**
|
|
75
|
-
*
|
|
75
|
+
* When set to `true`, the dropdown button cannot be focused or clicked.
|
|
76
76
|
*
|
|
77
77
|
* @defaultValue `false`
|
|
78
78
|
*/
|
|
@@ -8,7 +8,7 @@ export type EmptyStateImageName = 'addOnReporting' | 'announcement' | 'api' | 'a
|
|
|
8
8
|
*/
|
|
9
9
|
export interface EmptyStateProps extends BaseComponentProps {
|
|
10
10
|
/**
|
|
11
|
-
* When set to `true`, removes the default vertical margins
|
|
11
|
+
* When set to `true`, removes the default vertical margins for the component.
|
|
12
12
|
*
|
|
13
13
|
* @defaultValue `false`
|
|
14
14
|
*/
|
|
@@ -21,30 +21,28 @@ export interface EmptyStateProps extends BaseComponentProps {
|
|
|
21
21
|
/**
|
|
22
22
|
* The text for the title header.
|
|
23
23
|
*
|
|
24
|
-
* @defaultValue `"All is not lost."`
|
|
25
|
-
*
|
|
26
24
|
*/
|
|
27
25
|
title?: string;
|
|
28
26
|
/**
|
|
29
|
-
*
|
|
27
|
+
* The layout direction of the content.
|
|
30
28
|
*
|
|
31
29
|
* @defaultValue `"horizontal"`
|
|
32
30
|
*/
|
|
33
31
|
layout?: 'horizontal' | 'vertical';
|
|
34
32
|
/**
|
|
35
|
-
* When set to `true`, swaps the visual order of the text (primary) and image (secondary) content. This ensures the primary content is
|
|
33
|
+
* When set to `true`, swaps out the visual order of the text (primary) and image (secondary) content. This ensures that the primary content is presented first to screen readers.
|
|
36
34
|
*
|
|
37
35
|
* @defaultValue `false`
|
|
38
36
|
*/
|
|
39
37
|
reverseOrder?: boolean;
|
|
40
38
|
/**
|
|
41
|
-
* The max-width
|
|
39
|
+
* The max-width for the image container.
|
|
42
40
|
*
|
|
43
41
|
* @defaultValue `250`
|
|
44
42
|
*/
|
|
45
43
|
imageWidth?: number;
|
|
46
44
|
/**
|
|
47
|
-
* The name of the image
|
|
45
|
+
* The name of the image.
|
|
48
46
|
*
|
|
49
47
|
* @defaultValue `"emptyStateCharts"`
|
|
50
48
|
*/
|
|
@@ -12,12 +12,12 @@ export interface ErrorStateProps extends BaseComponentProps {
|
|
|
12
12
|
*/
|
|
13
13
|
children: ReactNode;
|
|
14
14
|
/**
|
|
15
|
-
* The text of the
|
|
15
|
+
* The text of the component header.
|
|
16
16
|
*
|
|
17
17
|
*/
|
|
18
18
|
title?: string;
|
|
19
19
|
/**
|
|
20
|
-
* The type of
|
|
20
|
+
* The type of image that will be displayed.
|
|
21
21
|
*
|
|
22
22
|
* @defaultValue `"error"`
|
|
23
23
|
*/
|
|
@@ -14,7 +14,7 @@ export interface FormProps extends BaseComponentProps {
|
|
|
14
14
|
*/
|
|
15
15
|
children: ReactNode;
|
|
16
16
|
/**
|
|
17
|
-
* The function that is called when the form is submitted. It will receive a
|
|
17
|
+
* The function that is called when the form is submitted. It will receive a `RemoteEvent` as an argument and its return value will be ignored.
|
|
18
18
|
*
|
|
19
19
|
* @event
|
|
20
20
|
*/
|
|
@@ -22,7 +22,7 @@ export interface FormProps extends BaseComponentProps {
|
|
|
22
22
|
/** @deprecated the value for `preventDefault` is now always `true`, use `onSubmit` to handle all form submission behavior */
|
|
23
23
|
preventDefault?: boolean;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Set this field to `'off'` to prevent autocompletion software (e.g., browser, password managers) from auto-filling form fields.
|
|
26
26
|
* @defaultValue `"on"`
|
|
27
27
|
*/
|
|
28
28
|
autoComplete?: 'off' | 'on';
|
|
@@ -7,23 +7,22 @@ export type IconColor = 'alert' | 'warning' | 'success' | 'inherit';
|
|
|
7
7
|
*/
|
|
8
8
|
export interface IconProps extends BaseComponentProps {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* The color of the icon.
|
|
11
11
|
*
|
|
12
12
|
* @defaultValue `"inherit"`
|
|
13
13
|
*/
|
|
14
14
|
color?: IconColor;
|
|
15
15
|
/**
|
|
16
|
-
* Sets the
|
|
16
|
+
* Sets the icon to display.
|
|
17
17
|
*/
|
|
18
18
|
name: IconNames;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* By default, the size of the icon is set automatically based on the parent component. If you need to override the default size, you can specify one to use instead.
|
|
21
21
|
*
|
|
22
|
-
* @defaultValue `"medium"`
|
|
23
22
|
*/
|
|
24
23
|
size?: TShirtSizes['sm'] | TShirtSizes['md'] | TShirtSizes['lg'];
|
|
25
24
|
/**
|
|
26
|
-
* Sets the text that
|
|
25
|
+
* Sets the text that screen readers will read for the icon.
|
|
27
26
|
*/
|
|
28
27
|
screenReaderText?: string;
|
|
29
28
|
}
|
|
@@ -5,9 +5,21 @@ import { BaseComponentProps } from '../shared.ts';
|
|
|
5
5
|
* @category Component Props
|
|
6
6
|
*/
|
|
7
7
|
export interface IllustrationProps extends BaseComponentProps {
|
|
8
|
+
/**
|
|
9
|
+
* The name of the illustration.
|
|
10
|
+
*/
|
|
8
11
|
name: IllustrationNames;
|
|
12
|
+
/**
|
|
13
|
+
* The illustration's alt text for accessibility.
|
|
14
|
+
*/
|
|
9
15
|
alt: string;
|
|
16
|
+
/**
|
|
17
|
+
* The width of the illustration in pixels.
|
|
18
|
+
*/
|
|
10
19
|
width?: number;
|
|
20
|
+
/**
|
|
21
|
+
* The height of the illustration in pixels.
|
|
22
|
+
*/
|
|
11
23
|
height?: number;
|
|
12
24
|
}
|
|
13
25
|
export declare const illustrationNames: {
|
|
@@ -7,23 +7,28 @@ import { ReactionsHandler } from '../reactions.ts';
|
|
|
7
7
|
*/
|
|
8
8
|
export interface ImageProps extends OverlayComponentProps, BaseComponentProps {
|
|
9
9
|
/**
|
|
10
|
-
* The alt text for the image.
|
|
10
|
+
* The alt text for the image, similar to the `alt` attribute for the HTML img tag.
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
13
|
alt?: string;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* When provided, sets the URL that will open when the image is clicked. Contains the following fields:
|
|
16
|
+
* - `url` (string): the URL that will open on click.
|
|
17
|
+
* - `external` (boolean): set to `true` to open the URL in a new tab. By default:
|
|
18
|
+
* - Links to HubSpot app pages will open in the same tab.
|
|
19
|
+
* - Links to non-HubSpot app pages will open in a new tab.
|
|
16
20
|
*
|
|
21
|
+
* When an image includes both `href` and an `onClick` action, both will be executed on button click.
|
|
17
22
|
*/
|
|
18
23
|
href?: HrefProp;
|
|
19
24
|
/**
|
|
20
|
-
* A function that will be called when the image is clicked.
|
|
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.
|
|
21
26
|
*
|
|
22
27
|
* @event
|
|
23
28
|
*/
|
|
24
29
|
onClick?: ReactionsHandler<ExtensionEvent>;
|
|
25
30
|
/**
|
|
26
|
-
* The
|
|
31
|
+
* The source of the image display. You can specify a URL or you can import the image directly if it's within your project.
|
|
27
32
|
*
|
|
28
33
|
*/
|
|
29
34
|
src: string;
|