@hubspot/ui-extensions 0.11.5 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/hs-internal/__tests__/createRemoteComponentInternal.spec.d.ts +1 -0
- package/dist/hs-internal/__tests__/createRemoteComponentInternal.spec.js +139 -0
- package/dist/hs-internal/index.d.ts +35 -0
- package/dist/hs-internal/index.js +20 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/shared/remoteComponents.d.ts +9 -0
- package/dist/shared/remoteComponents.js +9 -0
- 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/index.d.ts +1 -0
- package/dist/shared/types/components/inputs.d.ts +61 -63
- 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/score.d.ts +13 -0
- package/dist/shared/types/components/score.js +1 -0
- 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/index.d.ts +1 -1
- package/dist/shared/types/index.js +1 -0
- package/dist/shared/types/shared.d.ts +128 -78
- package/dist/shared/types/shared.js +123 -78
- package/dist/shared/types/worker-globals.d.ts +11 -10
- package/dist/testing/__tests__/mocks.useAssociations.spec.js +92 -4
- package/dist/testing/__tests__/mocks.useCrmProperties.spec.js +55 -7
- package/dist/testing/internal/mocks/mock-hooks.js +4 -0
- package/package.json +4 -3
|
@@ -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;
|
|
@@ -24,6 +24,7 @@ export type * from './loading-spinner.ts';
|
|
|
24
24
|
export type * from './modal.ts';
|
|
25
25
|
export type * from './panel.ts';
|
|
26
26
|
export type * from './progress-bar.ts';
|
|
27
|
+
export type * from './score.ts';
|
|
27
28
|
export type * from './selects.ts';
|
|
28
29
|
export type * from './statistics.ts';
|
|
29
30
|
export type * from './status-tag.ts';
|
|
@@ -5,11 +5,11 @@ import { BaseComponentProps } from '../shared.ts';
|
|
|
5
5
|
* */
|
|
6
6
|
interface BaseInputProps<T = string, V = string> extends BaseComponentProps {
|
|
7
7
|
/**
|
|
8
|
-
* The
|
|
8
|
+
* The text that displays above the input. Required if `inputType` is not set to `hidden`.
|
|
9
9
|
*/
|
|
10
10
|
label: string;
|
|
11
11
|
/**
|
|
12
|
-
* The unique identifier
|
|
12
|
+
* The input's unique identifier, similar to the HTML input element name attribute.
|
|
13
13
|
*/
|
|
14
14
|
name: string;
|
|
15
15
|
/**
|
|
@@ -17,31 +17,31 @@ interface BaseInputProps<T = string, V = string> extends BaseComponentProps {
|
|
|
17
17
|
*/
|
|
18
18
|
value?: T;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* When set to `true`, displays a required field indicator.
|
|
21
21
|
*
|
|
22
22
|
* @defaultValue `false`
|
|
23
23
|
*/
|
|
24
24
|
required?: boolean;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* When set to `true`, users will not be able to enter a value into the field.
|
|
27
27
|
*
|
|
28
28
|
* @defaultValue `false`
|
|
29
29
|
*/
|
|
30
30
|
readOnly?: boolean;
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* Displayed text that describes the field's purpose.
|
|
33
33
|
*/
|
|
34
34
|
description?: string;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* The text that displays in a tooltip next to the input label.
|
|
37
37
|
*/
|
|
38
38
|
tooltip?: string;
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
40
|
+
* The text that appears in the input before a value is set.
|
|
41
41
|
*/
|
|
42
42
|
placeholder?: string;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* When set to `true`, `validationMessage` is displayed as an error message if provided. The input will also render in an error state so that users are aware. If left `false`, `validationMessage` is displayed as a success message.
|
|
45
45
|
*
|
|
46
46
|
* @defaultValue `false`
|
|
47
47
|
*/
|
|
@@ -51,29 +51,29 @@ interface BaseInputProps<T = string, V = string> extends BaseComponentProps {
|
|
|
51
51
|
*/
|
|
52
52
|
defaultValue?: T;
|
|
53
53
|
/**
|
|
54
|
-
* The text to show
|
|
54
|
+
* The text to show if the input has an error.
|
|
55
55
|
*/
|
|
56
56
|
validationMessage?: string;
|
|
57
57
|
/**
|
|
58
|
-
* A callback function that is invoked when the value is committed. Currently these
|
|
58
|
+
* A callback function that is invoked when the value is committed. Currently, these are `onBlur` of the input and when the user submits the form.
|
|
59
59
|
*
|
|
60
60
|
* @event
|
|
61
61
|
*/
|
|
62
62
|
onChange?: (value: V) => void;
|
|
63
63
|
/**
|
|
64
|
-
* A function that is called and
|
|
64
|
+
* A function that is called and passes the value when the field is edited by the user. Should be used for validation. It's recommended that you don't use this value to update state (use `onChange` instead).
|
|
65
65
|
*
|
|
66
66
|
* @event
|
|
67
67
|
*/
|
|
68
68
|
onInput?: (value: V) => void;
|
|
69
69
|
/**
|
|
70
|
-
* A function that is called and
|
|
70
|
+
* A function that is called and passes the value when the field loses focus.
|
|
71
71
|
*
|
|
72
72
|
* @event
|
|
73
73
|
*/
|
|
74
74
|
onBlur?: (value: V) => void;
|
|
75
75
|
/**
|
|
76
|
-
* A function that is called and passed the value
|
|
76
|
+
* A function that is called and passed the value when the field gets focused.
|
|
77
77
|
*
|
|
78
78
|
* @event
|
|
79
79
|
*/
|
|
@@ -86,7 +86,7 @@ interface BaseInputProps<T = string, V = string> extends BaseComponentProps {
|
|
|
86
86
|
*/
|
|
87
87
|
export interface InputProps extends BaseInputProps {
|
|
88
88
|
/**
|
|
89
|
-
*
|
|
89
|
+
* The type of input. An input with the `'password'` type will hide the characters that the user types.
|
|
90
90
|
*
|
|
91
91
|
* @defaultValue `"text"`
|
|
92
92
|
*/
|
|
@@ -103,7 +103,7 @@ export interface TextAreaProps extends BaseInputProps {
|
|
|
103
103
|
*/
|
|
104
104
|
cols?: number;
|
|
105
105
|
/**
|
|
106
|
-
* The maximum number of characters (UTF-16 code units) that the user can enter. If not specified,
|
|
106
|
+
* The maximum number of characters (UTF-16 code units) that the user can enter. If not specified, maximum length is unlimited.
|
|
107
107
|
*/
|
|
108
108
|
maxLength?: number;
|
|
109
109
|
/**
|
|
@@ -111,7 +111,7 @@ export interface TextAreaProps extends BaseInputProps {
|
|
|
111
111
|
*/
|
|
112
112
|
rows?: number;
|
|
113
113
|
/**
|
|
114
|
-
* Sets whether the
|
|
114
|
+
* Sets whether the text field is resizable, and if so, in which directions.
|
|
115
115
|
*
|
|
116
116
|
* @defaultValue `"both"`
|
|
117
117
|
*/
|
|
@@ -137,21 +137,18 @@ type BaseInputForNumber = Omit<BaseInputProps<number, number>, 'onInput'>;
|
|
|
137
137
|
export interface NumberInputProps extends BaseInputForNumber {
|
|
138
138
|
/**
|
|
139
139
|
* Sets the lower bound of the input.
|
|
140
|
-
*
|
|
141
140
|
*/
|
|
142
141
|
min?: number;
|
|
143
142
|
/**
|
|
144
143
|
* Sets the upper bound of the input.
|
|
145
|
-
*
|
|
146
144
|
*/
|
|
147
145
|
max?: number;
|
|
148
146
|
/**
|
|
149
147
|
* Sets the number of digits to the right of the decimal point.
|
|
150
|
-
*
|
|
151
148
|
*/
|
|
152
149
|
precision?: number;
|
|
153
150
|
/**
|
|
154
|
-
* Formats the input as a decimal
|
|
151
|
+
* Formats the input as a decimal or percentage.
|
|
155
152
|
*
|
|
156
153
|
* @defaultValue `"decimal"`
|
|
157
154
|
*/
|
|
@@ -171,16 +168,15 @@ export interface CurrencyInputProps extends BaseInputForNumber {
|
|
|
171
168
|
*/
|
|
172
169
|
currency?: string;
|
|
173
170
|
/**
|
|
174
|
-
* Sets the number of decimal places for the currency
|
|
175
|
-
* If not provided, defaults to currency-specific precision
|
|
171
|
+
* Sets the number of decimal places for the currency. If not provided, defaults to currency-specific precision.
|
|
176
172
|
*/
|
|
177
173
|
precision?: number;
|
|
178
174
|
/**
|
|
179
|
-
* Sets the lower bound of the input
|
|
175
|
+
* Sets the lower bound of the input (handled by underlying component).
|
|
180
176
|
*/
|
|
181
177
|
min?: number;
|
|
182
178
|
/**
|
|
183
|
-
* Sets the upper bound of the input
|
|
179
|
+
* Sets the upper bound of the input (handled by underlying component).
|
|
184
180
|
*/
|
|
185
181
|
max?: number;
|
|
186
182
|
}
|
|
@@ -190,20 +186,18 @@ export interface CurrencyInputProps extends BaseInputForNumber {
|
|
|
190
186
|
* @category Component Props
|
|
191
187
|
*/
|
|
192
188
|
export interface StepperInputProps extends Omit<NumberInputProps, 'onInput'> {
|
|
193
|
-
/** The amount that the current value will increase or decrease
|
|
189
|
+
/** The amount that the current value will increase or decrease by. Default is `1`.
|
|
194
190
|
* @defaultValue `1`
|
|
195
191
|
*/
|
|
196
192
|
stepSize?: number;
|
|
197
193
|
/**
|
|
198
|
-
* Text that will appear in a tooltip
|
|
199
|
-
* can't increase the current value.
|
|
194
|
+
* Text that will appear in a tooltip when the user has reached the minimum value.
|
|
200
195
|
*/
|
|
201
|
-
|
|
196
|
+
minValueReachedTooltip?: string;
|
|
202
197
|
/**
|
|
203
|
-
* Text that will appear in a tooltip
|
|
204
|
-
* can't decrease the current value.
|
|
198
|
+
* Text that will appear in a tooltip when the user has reached the maximum value.
|
|
205
199
|
*/
|
|
206
|
-
|
|
200
|
+
maxValueReachedTooltip?: string;
|
|
207
201
|
}
|
|
208
202
|
/** Object that represents dates. */
|
|
209
203
|
export interface BaseDate {
|
|
@@ -231,60 +225,64 @@ type BaseDateInputForDate = Omit<BaseInputProps<BaseDate | null, DateInputEvents
|
|
|
231
225
|
*/
|
|
232
226
|
export interface DateInputProps extends BaseDateInputForDate {
|
|
233
227
|
/**
|
|
234
|
-
* Sets the earliest date
|
|
228
|
+
* Sets the earliest valid date available using the following format: `{ year: number; month: number; date: number }`
|
|
235
229
|
*/
|
|
236
230
|
min?: BaseDate;
|
|
237
231
|
/**
|
|
238
|
-
* Sets the latest date
|
|
232
|
+
* Sets the latest valid date available using the following format: `{ year: number; month: number; date: number }`
|
|
239
233
|
*/
|
|
240
234
|
max?: BaseDate;
|
|
241
235
|
/**
|
|
242
236
|
* Sets the message that users will see when they hover over dates before the min date.
|
|
243
|
-
*
|
|
244
|
-
* @defaultValue `"You must choose a newer date"`
|
|
245
237
|
*/
|
|
246
238
|
minValidationMessage?: string;
|
|
247
239
|
/**
|
|
248
240
|
* Sets the message that users will see when the hover over dates after the max date.
|
|
249
|
-
*
|
|
250
|
-
* @defaultValue `"You must choose an older date"`
|
|
251
241
|
*/
|
|
252
242
|
maxValidationMessage?: string;
|
|
253
243
|
/**
|
|
254
|
-
*
|
|
244
|
+
* The date format.
|
|
255
245
|
*
|
|
256
|
-
*
|
|
246
|
+
* - `short`: 09/04/1986
|
|
247
|
+
* - `long`: September 4, 1986
|
|
248
|
+
* - `medium`: Sep 4, 1986
|
|
249
|
+
* - `standard`: 1986-09-04
|
|
250
|
+
* - `YYYY-MM-DD`: 1986-09-04
|
|
251
|
+
* - `L`: 09/04/1986
|
|
252
|
+
* - `LL`: September 4, 1986
|
|
253
|
+
* - `ll`: Sep 4, 1986
|
|
257
254
|
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
* - short: `09/04/1986`
|
|
261
|
-
* - long: `September 4, 1986`
|
|
262
|
-
* - medium : `Sep 4, 1986`
|
|
263
|
-
* - standard: `1986-09-04`
|
|
264
|
-
* - L: `09/04/1986`
|
|
265
|
-
* - LL: `September 4, 1986`
|
|
266
|
-
* - ll : `Sep 4, 1986`
|
|
267
|
-
* - YYYY-MM-DD: `1986-09-04`
|
|
255
|
+
* @defaultValue `'short'`
|
|
268
256
|
*/
|
|
269
257
|
format?: 'YYYY-MM-DD' | 'L' | 'LL' | 'll' | 'short' | 'long' | 'medium' | 'standard';
|
|
270
258
|
/**
|
|
271
|
-
* Sets the
|
|
259
|
+
* Sets the label of the button that clears the date.
|
|
260
|
+
*/
|
|
261
|
+
clearButtonLabel?: string;
|
|
262
|
+
/**
|
|
263
|
+
* Sets the label of the button that inserts today's date.
|
|
264
|
+
*/
|
|
265
|
+
todayButtonLabel?: string;
|
|
266
|
+
/**
|
|
267
|
+
* Sets the timezone that the component will user to calculate valid dates.
|
|
272
268
|
*
|
|
273
|
-
*
|
|
269
|
+
* - `userTz` (default): the user's time zone.
|
|
270
|
+
* - `portalTz`: the portal's default time zone.
|
|
271
|
+
*
|
|
272
|
+
* @defaultValue `'userTz'`
|
|
274
273
|
*/
|
|
275
274
|
timezone?: 'userTz' | 'portalTz';
|
|
276
275
|
/**
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
*
|
|
276
|
+
* The value of the input. Must include the year, month, and day.
|
|
277
|
+
* - `year`: the four-digit year (e.g., `2023`).
|
|
278
|
+
* - `month`: starting at `0`, the number of the month (e.g., `0` = January, `11` = December).
|
|
279
|
+
* - `date`: the number of the day (e.g., `1` = the first day of the month).
|
|
280
280
|
*/
|
|
281
|
-
|
|
281
|
+
value?: BaseDate;
|
|
282
282
|
/**
|
|
283
|
-
*
|
|
284
|
-
*
|
|
285
|
-
* @defaultValue `"Today"`
|
|
283
|
+
* The default date value. Uses the same format as the value field.
|
|
286
284
|
*/
|
|
287
|
-
|
|
285
|
+
defaultValue?: BaseDate;
|
|
288
286
|
}
|
|
289
287
|
/**
|
|
290
288
|
* Object that represents times.
|
|
@@ -320,11 +318,11 @@ export interface TimeInputProps extends BaseTimeInputForTime {
|
|
|
320
318
|
*/
|
|
321
319
|
onChange?: (value: TimeInputEventsPayload) => void;
|
|
322
320
|
/**
|
|
323
|
-
* Sets the earliest time
|
|
321
|
+
* Sets the earliest valid time available.
|
|
324
322
|
*/
|
|
325
323
|
min?: BaseTime;
|
|
326
324
|
/**
|
|
327
|
-
* Sets the latest time
|
|
325
|
+
* Sets the latest valid time available.
|
|
328
326
|
*/
|
|
329
327
|
max?: BaseTime;
|
|
330
328
|
/**
|
|
@@ -334,7 +332,7 @@ export interface TimeInputProps extends BaseTimeInputForTime {
|
|
|
334
332
|
*/
|
|
335
333
|
interval?: number;
|
|
336
334
|
/**
|
|
337
|
-
* Sets the timezone that the component will
|
|
335
|
+
* Sets the timezone that the component will use to calculate valid times.
|
|
338
336
|
*
|
|
339
337
|
*/
|
|
340
338
|
timezone?: 'userTz' | 'portalTz';
|
|
@@ -345,7 +343,7 @@ export interface TimeInputProps extends BaseTimeInputForTime {
|
|
|
345
343
|
* @category Component Props
|
|
346
344
|
*/
|
|
347
345
|
export interface SearchInputProps extends BaseInputProps {
|
|
348
|
-
/**
|
|
346
|
+
/** When set to `true`, shows a clear button to clear the input. Default is `true`. */
|
|
349
347
|
clearable?: boolean;
|
|
350
348
|
}
|
|
351
349
|
export {};
|
|
@@ -51,7 +51,7 @@ export interface FlexProps extends BaseComponentProps {
|
|
|
51
51
|
*/
|
|
52
52
|
children?: ReactNode;
|
|
53
53
|
/**
|
|
54
|
-
* Arranges components
|
|
54
|
+
* Arranges the components horizontally or vertically by setting the main axis.
|
|
55
55
|
*
|
|
56
56
|
* @defaultValue `"row"`
|
|
57
57
|
*/
|
|
@@ -69,12 +69,11 @@ export interface FlexProps extends BaseComponentProps {
|
|
|
69
69
|
*/
|
|
70
70
|
align?: FlexAlign;
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
72
|
+
* Distributes a child component along the cross-axis using the available free space. Use this prop for nested `Flex` and `Box` components to align them differently from other child components in the `Flex` group.
|
|
74
73
|
*/
|
|
75
74
|
alignSelf?: FlexAlign;
|
|
76
75
|
/**
|
|
77
|
-
* Whether components will wrap
|
|
76
|
+
* Whether components will wrap rather than trying to fit on one line.
|
|
78
77
|
*
|
|
79
78
|
* @defaultValue `"nowrap"`
|
|
80
79
|
*/
|
|
@@ -92,21 +91,19 @@ export interface BoxProps extends BaseComponentProps {
|
|
|
92
91
|
*/
|
|
93
92
|
children: ReactNode;
|
|
94
93
|
/**
|
|
95
|
-
*
|
|
94
|
+
* Distributes a child component along the cross-axis using the available free space. Use this prop for nested `Box` components to align them differently from other child components in the `Flex` group.
|
|
96
95
|
*
|
|
97
96
|
* @defaultValue `"auto"`
|
|
98
97
|
*/
|
|
99
98
|
alignSelf?: 'start' | 'center' | 'baseline' | 'end' | 'stretch' | 'auto';
|
|
100
99
|
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
*- `none`: The item is sized according to its width and height properties. It is fully inflexible: it neither shrinks nor grows in relation to the flex container.
|
|
107
|
-
*- `number`: Tells a component to fill all available space, shared evenly amongst other components with the same parent. The larger the flex given, the higher the ratio of space a component will take compared to its siblings.
|
|
100
|
+
* Distributes components based on the available empty space around them. Options are as follows:
|
|
101
|
+
* - `initial`: The item is sized according to its width and height properties. It shrinks to its minimum size to fit the container, but does not grow to absorb any extra free space in the flex container.
|
|
102
|
+
* - `auto`: The item is sized according to its width and height properties, but grows to absorb any extra free space in the flex container, and shrinks to its minimum size to fit the container.
|
|
103
|
+
* - `none`: The item is sized according to its width and height properties. It is fully inflexible: it neither shrinks nor grows in relation to the flex container.
|
|
104
|
+
* - Number: tells a component to fill all available space, shared evenly amongst other components with the same parent. The larger the flex given, the higher the ratio of space a component will take compared to its siblings.
|
|
108
105
|
*
|
|
109
|
-
* @defaultValue `"
|
|
106
|
+
* @defaultValue `"auto"`
|
|
110
107
|
*/
|
|
111
108
|
flex?: 'initial' | 'auto' | 'none' | number;
|
|
112
109
|
}
|
|
@@ -118,21 +115,22 @@ export interface BoxProps extends BaseComponentProps {
|
|
|
118
115
|
export interface InlineProps extends BaseComponentProps {
|
|
119
116
|
/**
|
|
120
117
|
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components.
|
|
121
|
-
*
|
|
122
118
|
*/
|
|
123
119
|
children?: ReactNode;
|
|
124
120
|
/**
|
|
125
121
|
* Distributes components along the main axis using the available free space.
|
|
122
|
+
*
|
|
126
123
|
* @defaultValue `"start"`
|
|
127
124
|
*/
|
|
128
125
|
justify?: FlexJustify;
|
|
129
126
|
/**
|
|
130
127
|
* Distributes components along the cross-axis using the available free space.
|
|
131
|
-
*
|
|
128
|
+
*
|
|
129
|
+
* @defaultValue `"stretch"`
|
|
132
130
|
*/
|
|
133
131
|
align?: FlexAlign;
|
|
134
132
|
/**
|
|
135
|
-
*
|
|
133
|
+
* The amount of spacing between components.
|
|
136
134
|
*
|
|
137
135
|
* @defaultValue `"flush"`
|
|
138
136
|
*/
|
|
@@ -145,26 +143,21 @@ export interface InlineProps extends BaseComponentProps {
|
|
|
145
143
|
*/
|
|
146
144
|
export interface AutoGridProps extends BaseComponentProps {
|
|
147
145
|
/**
|
|
148
|
-
* Sets
|
|
149
|
-
* When `flexible` is true, columns will be at least this width (or collapse to container width if smaller), then expand equally to fill available space.
|
|
150
|
-
* When `flexible` is false, columns are exactly this width.
|
|
146
|
+
* Sets width of each column in pixels. When `flexible` is `true`, acts as minimum width before expanding.
|
|
151
147
|
*/
|
|
152
148
|
columnWidth: number;
|
|
153
149
|
/**
|
|
154
|
-
* Sets
|
|
150
|
+
* Sets spacing between grid items.
|
|
155
151
|
*
|
|
156
152
|
* @defaultValue `"flush"`
|
|
157
153
|
*/
|
|
158
154
|
gap?: AllDistances;
|
|
159
155
|
/**
|
|
160
156
|
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components.
|
|
161
|
-
*
|
|
162
157
|
*/
|
|
163
158
|
children?: ReactNode;
|
|
164
159
|
/**
|
|
165
|
-
*
|
|
166
|
-
* When true, columns will be at least `columnWidth` but grow equally to fill the container.
|
|
167
|
-
* When false, columns are exactly `columnWidth`.
|
|
160
|
+
* When `false`, columns have exact `columnWidth`. When `true`, columns expand equally to fill available space with `columnWidth` as the minimum.
|
|
168
161
|
*
|
|
169
162
|
* @defaultValue `false`
|
|
170
163
|
*/
|
|
@@ -13,24 +13,27 @@ export interface LinkProps extends OverlayComponentProps, BaseComponentProps {
|
|
|
13
13
|
*/
|
|
14
14
|
children: ReactNode;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* Sets the link's URL and open behavior. Contains the following fields:
|
|
17
|
+
* - `url` (string): the URL that will open on click.
|
|
18
|
+
* - `external` (boolean): set to `true` to open the URL in a new tab and display an external link icon. By default:
|
|
19
|
+
* - Links to HubSpot app pages will open in the same tab and will not include an icon.
|
|
20
|
+
* - Links to non-HubSpot app pages will open in a new tab and include the icon.
|
|
18
21
|
*/
|
|
19
22
|
href: HrefProp;
|
|
20
23
|
/**
|
|
21
|
-
* The color
|
|
24
|
+
* The color of the link.
|
|
22
25
|
*
|
|
23
26
|
* @defaultValue `"primary"`
|
|
24
27
|
*/
|
|
25
28
|
variant?: 'primary' | 'destructive' | 'light' | 'dark';
|
|
26
29
|
/**
|
|
27
|
-
* A function that
|
|
30
|
+
* A function that is invoked when the link is clicked. The function receives no arguments and its return value is ignored.
|
|
28
31
|
*
|
|
29
32
|
* @event
|
|
30
33
|
*/
|
|
31
34
|
onClick?: ReactionsHandler<ExtensionEvent>;
|
|
32
35
|
/**
|
|
33
|
-
* When set to true
|
|
36
|
+
* When set to `true`, `event.preventDefault()` will be invoked before the `onClick` function is called, preventing automatic navigation to the href URL.
|
|
34
37
|
*
|
|
35
38
|
* @defaultValue `false`
|
|
36
39
|
*/
|
|
@@ -6,12 +6,12 @@ import { TShirtSizes, BaseComponentProps } from '../shared.ts';
|
|
|
6
6
|
*/
|
|
7
7
|
export interface LoadingSpinnerProps extends BaseComponentProps {
|
|
8
8
|
/**
|
|
9
|
-
* The text that displays next to the spinner.
|
|
9
|
+
* The text that displays next to the spinner.
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
12
|
label: string;
|
|
13
13
|
/**
|
|
14
|
-
* When set to `true`, the label will appear next to the spinner.
|
|
14
|
+
* When set to `true`, the `label` will appear next to the spinner.
|
|
15
15
|
*
|
|
16
16
|
* @defaultValue `false`
|
|
17
17
|
*/
|
|
@@ -23,7 +23,7 @@ export interface LoadingSpinnerProps extends BaseComponentProps {
|
|
|
23
23
|
*/
|
|
24
24
|
size?: TShirtSizes['xs'] | TShirtSizes['sm'] | TShirtSizes['md'];
|
|
25
25
|
/**
|
|
26
|
-
* The position of the spinner.
|
|
26
|
+
* The position of the spinner.
|
|
27
27
|
*
|
|
28
28
|
* @defaultValue `"inline"`
|
|
29
29
|
*/
|
|
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { TShirtSizes, BaseComponentProps } from '../shared.ts';
|
|
3
3
|
export interface ModalProps extends BaseComponentProps {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* The modal's accessibility label.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
'aria-label'?: string;
|
|
@@ -12,7 +12,7 @@ export interface ModalProps extends BaseComponentProps {
|
|
|
12
12
|
*/
|
|
13
13
|
children?: ReactNode;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* The unique identifier for the modal.
|
|
16
16
|
*
|
|
17
17
|
*/
|
|
18
18
|
id: string;
|
|
@@ -27,18 +27,18 @@ export interface ModalProps extends BaseComponentProps {
|
|
|
27
27
|
*/
|
|
28
28
|
onClose?: () => void;
|
|
29
29
|
/**
|
|
30
|
-
* The width of the modal
|
|
30
|
+
* The width of the modal.
|
|
31
31
|
*
|
|
32
32
|
* @defaultValue `"sm"`
|
|
33
33
|
*/
|
|
34
34
|
width?: TShirtSizes['sm'] | TShirtSizes['md'] | TShirtSizes['lg'];
|
|
35
35
|
/**
|
|
36
|
-
* The title of the modal
|
|
36
|
+
* The title of the modal, displayed at in the modal's top bar.
|
|
37
37
|
*
|
|
38
38
|
*/
|
|
39
39
|
title?: string;
|
|
40
40
|
/**
|
|
41
|
-
* The
|
|
41
|
+
* The type of modal. See the [variants section](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/modal#variants) for more information.
|
|
42
42
|
*
|
|
43
43
|
* @defaultValue `"default"`
|
|
44
44
|
*/
|
|
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { TShirtSizes, BaseComponentProps } from '../shared.ts';
|
|
3
3
|
export interface PanelProps extends BaseComponentProps {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* The panel's accessibility label.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
'aria-label'?: string;
|
|
@@ -12,7 +12,7 @@ export interface PanelProps extends BaseComponentProps {
|
|
|
12
12
|
*/
|
|
13
13
|
children?: ReactNode;
|
|
14
14
|
/**
|
|
15
|
-
* A unique ID for the panel
|
|
15
|
+
* A unique ID for the panel.
|
|
16
16
|
*
|
|
17
17
|
*/
|
|
18
18
|
id: string;
|
|
@@ -27,18 +27,18 @@ export interface PanelProps extends BaseComponentProps {
|
|
|
27
27
|
*/
|
|
28
28
|
onClose?: () => void;
|
|
29
29
|
/**
|
|
30
|
-
* The width of the panel
|
|
30
|
+
* The width of the panel.
|
|
31
31
|
*
|
|
32
32
|
* @defaultValue `"sm"`
|
|
33
33
|
*/
|
|
34
34
|
width?: TShirtSizes['sm'] | TShirtSizes['md'] | TShirtSizes['lg'];
|
|
35
35
|
/**
|
|
36
|
-
* The
|
|
36
|
+
* The text that displays at the top of the panel.
|
|
37
37
|
*
|
|
38
38
|
*/
|
|
39
39
|
title?: string;
|
|
40
40
|
/**
|
|
41
|
-
* The variant
|
|
41
|
+
* The panel variant. The `modal` variant includes better screen reader focus on the panel and is recommended for visual and motor accessibility and tab navigation. See [variants](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/panel#variants) for more information.
|
|
42
42
|
*
|
|
43
43
|
* @defaultValue `"default"`
|
|
44
44
|
*/
|
|
@@ -46,13 +46,13 @@ export interface PanelProps extends BaseComponentProps {
|
|
|
46
46
|
}
|
|
47
47
|
export interface PanelSectionProps extends BaseComponentProps {
|
|
48
48
|
/**
|
|
49
|
-
* When set to `true`, the section will have no bottom margin
|
|
49
|
+
* When set to `true`, the section will have no bottom margin.
|
|
50
50
|
*
|
|
51
51
|
* @defaultValue `false`
|
|
52
52
|
*/
|
|
53
53
|
flush?: boolean;
|
|
54
54
|
/**
|
|
55
|
-
* The main content of the section
|
|
55
|
+
* The main content of the section.
|
|
56
56
|
*
|
|
57
57
|
*/
|
|
58
58
|
children: ReactNode;
|