@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
|
@@ -5,13 +5,11 @@ import { BaseComponentProps } from '../shared.ts';
|
|
|
5
5
|
* */
|
|
6
6
|
export interface BaseSelectProps extends BaseComponentProps {
|
|
7
7
|
/**
|
|
8
|
-
* The text that displays above
|
|
9
|
-
*
|
|
8
|
+
* The text that displays above the input.
|
|
10
9
|
*/
|
|
11
10
|
label?: string;
|
|
12
11
|
/**
|
|
13
|
-
* The unique identifier
|
|
14
|
-
*
|
|
12
|
+
* The input's unique identifier.
|
|
15
13
|
*/
|
|
16
14
|
name?: string;
|
|
17
15
|
/**
|
|
@@ -21,19 +19,17 @@ export interface BaseSelectProps extends BaseComponentProps {
|
|
|
21
19
|
*/
|
|
22
20
|
required?: boolean;
|
|
23
21
|
/**
|
|
24
|
-
* When set to `true`,
|
|
22
|
+
* When set to `true`, users will not be able to fill the input field.
|
|
25
23
|
*
|
|
26
24
|
* @defaultValue `false`
|
|
27
25
|
*/
|
|
28
26
|
readOnly?: boolean;
|
|
29
27
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
28
|
+
* Text that describes the field's purpose.
|
|
32
29
|
*/
|
|
33
30
|
description?: string;
|
|
34
31
|
/**
|
|
35
32
|
* The text that displays in a tooltip next to the label.
|
|
36
|
-
*
|
|
37
33
|
*/
|
|
38
34
|
tooltip?: string;
|
|
39
35
|
/**
|
|
@@ -50,12 +46,11 @@ export interface BaseSelectProps extends BaseComponentProps {
|
|
|
50
46
|
*/
|
|
51
47
|
error?: boolean;
|
|
52
48
|
/**
|
|
53
|
-
* The text to
|
|
54
|
-
*
|
|
49
|
+
* The text to display if the input has an error.
|
|
55
50
|
*/
|
|
56
51
|
validationMessage?: string;
|
|
57
52
|
/**
|
|
58
|
-
* The
|
|
53
|
+
* The visual style of the button
|
|
59
54
|
*
|
|
60
55
|
* @defaultValue `"input"`
|
|
61
56
|
*/
|
|
@@ -68,8 +63,7 @@ export interface BaseSelectProps extends BaseComponentProps {
|
|
|
68
63
|
*/
|
|
69
64
|
export interface SelectProps extends BaseSelectProps {
|
|
70
65
|
/**
|
|
71
|
-
* The value of the
|
|
72
|
-
*
|
|
66
|
+
* The value of the input.
|
|
73
67
|
*/
|
|
74
68
|
value?: string | number | boolean;
|
|
75
69
|
/**
|
|
@@ -79,21 +73,19 @@ export interface SelectProps extends BaseSelectProps {
|
|
|
79
73
|
*/
|
|
80
74
|
onChange?: (value: NonNullable<SelectProps['value']>) => void;
|
|
81
75
|
/**
|
|
82
|
-
* The
|
|
76
|
+
* The visual style of the button
|
|
83
77
|
*
|
|
84
78
|
* @defaultValue `"input"`
|
|
85
79
|
*/
|
|
86
80
|
variant?: 'transparent' | 'input';
|
|
87
81
|
/**
|
|
88
|
-
* A function that is called and passed the value every time the search field is
|
|
89
|
-
* edited by the user. Prefer updating state in onChange as it fires less
|
|
90
|
-
* frequently, and if you need to update state here, consider debouncing your function.
|
|
82
|
+
* A callback function that is called and passed the value every time the search field is edited by the user. Prefer updating state in `onChange` as it fires less frequently, and if you need to update state here, consider debouncing your function.
|
|
91
83
|
*
|
|
92
84
|
* @event
|
|
93
85
|
*/
|
|
94
86
|
onInput?: (value: string) => void;
|
|
95
87
|
/**
|
|
96
|
-
* The options to display in the dropdown menu.
|
|
88
|
+
* The options to display in the dropdown menu. `label` will be used as the display text, and `value` should be the option's unique identifier, which is submitted with the form.
|
|
97
89
|
*/
|
|
98
90
|
options: {
|
|
99
91
|
/** Will be used as the display text. **/
|
|
@@ -109,8 +101,7 @@ export interface SelectProps extends BaseSelectProps {
|
|
|
109
101
|
*/
|
|
110
102
|
export interface MultiSelectProps extends BaseSelectProps {
|
|
111
103
|
/**
|
|
112
|
-
* The value of the
|
|
113
|
-
*
|
|
104
|
+
* The value of the input.
|
|
114
105
|
*/
|
|
115
106
|
value?: (string | number | boolean)[];
|
|
116
107
|
/**
|
|
@@ -28,11 +28,11 @@ export interface StatisticsTrendProps extends BaseComponentProps {
|
|
|
28
28
|
*/
|
|
29
29
|
export interface StatisticsItemProps extends BaseComponentProps {
|
|
30
30
|
/**
|
|
31
|
-
* The unique identifier.
|
|
31
|
+
* The statistic item's unique identifier.
|
|
32
32
|
*/
|
|
33
33
|
id?: string;
|
|
34
34
|
/**
|
|
35
|
-
* The item's label
|
|
35
|
+
* The item's label.
|
|
36
36
|
*/
|
|
37
37
|
label: string;
|
|
38
38
|
/**
|
|
@@ -7,15 +7,15 @@ import { BaseComponentProps } from '../shared.ts';
|
|
|
7
7
|
*/
|
|
8
8
|
export interface StatusTagProps extends BaseComponentProps {
|
|
9
9
|
/**
|
|
10
|
-
* The
|
|
10
|
+
* The color of the dot indicator.
|
|
11
11
|
*
|
|
12
12
|
* @defaultValue `"default"`
|
|
13
13
|
*/
|
|
14
14
|
variant?: 'danger' | 'warning' | 'info' | 'success' | 'default';
|
|
15
15
|
/**
|
|
16
|
-
* When set to true
|
|
16
|
+
* When set to `true`, the status tag's dot will be a ring instead of a filled-in circle.
|
|
17
17
|
*
|
|
18
|
-
* @defaultValue `false
|
|
18
|
+
* @defaultValue `false`
|
|
19
19
|
*/
|
|
20
20
|
hollow?: boolean;
|
|
21
21
|
/**
|
|
@@ -25,13 +25,13 @@ export interface StatusTagProps extends BaseComponentProps {
|
|
|
25
25
|
*/
|
|
26
26
|
onClick?: () => void;
|
|
27
27
|
/**
|
|
28
|
-
* When set to true
|
|
28
|
+
* When set to `true`, the status tag will include a small, clickable x icon to remove it.
|
|
29
29
|
*
|
|
30
30
|
* @defaultValue `false`
|
|
31
31
|
*/
|
|
32
32
|
showRemoveIcon?: boolean;
|
|
33
33
|
/**
|
|
34
|
-
* A function that will be invoked when the
|
|
34
|
+
* A function that will be invoked when the remove icon is clicked.
|
|
35
35
|
*
|
|
36
36
|
* @event
|
|
37
37
|
*/
|
|
@@ -22,21 +22,19 @@ export interface StepIndicatorProps extends BaseComponentProps {
|
|
|
22
22
|
*/
|
|
23
23
|
circleSize?: AllSizes;
|
|
24
24
|
/**
|
|
25
|
-
* The currently active step. Steps are
|
|
25
|
+
* The currently active step. Steps are zero-based, meaning the first step is assigned `0`.
|
|
26
26
|
*/
|
|
27
27
|
currentStep?: number;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* -
|
|
32
|
-
* - compact: only shows the title of the currently active step.
|
|
33
|
-
* - flush: only shows the title of the currently active step and removes left and right margins.
|
|
29
|
+
* Sets component spacing.
|
|
30
|
+
* - `compact`: only shows the title of the currently active step.
|
|
31
|
+
* - `flush`: only shows the title of the currently active step and removes left and right margin.
|
|
34
32
|
*
|
|
35
33
|
* @defaultValue `"default"`
|
|
36
34
|
*/
|
|
37
35
|
variant?: 'default' | 'compact' | 'flush';
|
|
38
36
|
/**
|
|
39
|
-
* A function that
|
|
37
|
+
* A function that is invoked when a step in the indicator is clicked. The function receives the current step index as an argument (zero-based). Use this to update the currently active step.
|
|
40
38
|
*
|
|
41
39
|
* @event
|
|
42
40
|
*/
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { BaseComponentProps } from '../shared.ts';
|
|
3
3
|
export interface AlignmentProps {
|
|
4
|
+
/**
|
|
5
|
+
* Sets the alignment of the table element.
|
|
6
|
+
*/
|
|
4
7
|
align?: 'left' | 'center' | 'right';
|
|
5
8
|
}
|
|
6
9
|
export interface WidthProps {
|
|
10
|
+
/**
|
|
11
|
+
* Sets the width of the table element.
|
|
12
|
+
* - `min`: the content will only be as wide as required, overflowing if the content is wider than the table. A horizontal scrollbar will appear when there is overflow.
|
|
13
|
+
* - `max`: the content will expand to occupy the maximum available width without overflowing.
|
|
14
|
+
* - `auto`: the content will adjust its width based on the available space without overflowing.
|
|
15
|
+
*/
|
|
7
16
|
width?: 'min' | 'max' | 'auto' | number;
|
|
8
17
|
}
|
|
9
18
|
export interface TableElementProps extends BaseComponentProps {
|
|
@@ -17,6 +26,9 @@ export interface TableElementProps extends BaseComponentProps {
|
|
|
17
26
|
*/
|
|
18
27
|
export type BaseTableHeaderProps = TableElementProps & AlignmentProps & WidthProps & BaseComponentProps;
|
|
19
28
|
export type TableCellProps = TableElementProps & AlignmentProps & WidthProps & {
|
|
29
|
+
/**
|
|
30
|
+
* Sets the number of columns a cell should span.
|
|
31
|
+
*/
|
|
20
32
|
colSpan?: number;
|
|
21
33
|
} & BaseComponentProps;
|
|
22
34
|
/**
|
|
@@ -34,21 +46,19 @@ export interface UnSortedTableHeaderProps extends BaseTableHeaderProps {
|
|
|
34
46
|
*/
|
|
35
47
|
export interface SortedTableHeaderProps extends BaseTableHeaderProps {
|
|
36
48
|
/**
|
|
37
|
-
*
|
|
49
|
+
* Visually indicates with an arrow which way the rows are sorted.
|
|
38
50
|
*
|
|
39
51
|
* @defaultValue `"none"`
|
|
40
52
|
*/
|
|
41
53
|
sortDirection: 'ascending' | 'descending' | 'none';
|
|
42
54
|
/**
|
|
43
|
-
* A
|
|
44
|
-
* It's required when sort = `ascending`, `descending` or `none`.
|
|
55
|
+
* A function that will be invoked when the header is clicked. It receives a `sortDirection` as an argument (cannot be none or a null value).
|
|
45
56
|
*
|
|
46
57
|
* @event
|
|
47
|
-
* @defaultValue `"none"`
|
|
48
58
|
*/
|
|
49
59
|
onSortChange: (value: NonNullable<SortedTableHeaderProps['sortDirection']>) => void;
|
|
50
60
|
/**
|
|
51
|
-
*
|
|
61
|
+
* When set to `true`, users cannot change the sort ordering. It has no effect if `sortDirection` is set to `never` or undefined.
|
|
52
62
|
*
|
|
53
63
|
* @defaultValue `false`
|
|
54
64
|
*/
|
|
@@ -62,13 +72,13 @@ export interface SortedTableHeaderProps extends BaseTableHeaderProps {
|
|
|
62
72
|
export type TableHeaderProps = SortedTableHeaderProps | UnSortedTableHeaderProps;
|
|
63
73
|
interface BaseTableProps extends BaseComponentProps {
|
|
64
74
|
/**
|
|
65
|
-
* When set to false
|
|
75
|
+
* When set to `false`, the table will not include borders.
|
|
66
76
|
*
|
|
67
77
|
* @defaultValue `true`
|
|
68
78
|
*/
|
|
69
79
|
bordered?: boolean;
|
|
70
80
|
/**
|
|
71
|
-
* When set to `true`, the table will not
|
|
81
|
+
* When set to `true`, the table will not include bottom margin.
|
|
72
82
|
*
|
|
73
83
|
* @defaultValue `false`
|
|
74
84
|
*/
|
|
@@ -104,27 +114,27 @@ export interface TablePaginatedProps extends BaseTableProps {
|
|
|
104
114
|
*/
|
|
105
115
|
pageCount: number;
|
|
106
116
|
/**
|
|
107
|
-
* When set to `false`, hides the text labels for
|
|
117
|
+
* When set to `false`, hides the text labels for First/Prev/Next buttons. The button labels will still be accessible to screen readers.
|
|
108
118
|
*
|
|
109
119
|
* @defaultValue `true`
|
|
110
120
|
*/
|
|
111
121
|
showButtonLabels?: boolean;
|
|
112
122
|
/**
|
|
113
|
-
* When set to `true`, displays the
|
|
123
|
+
* When set to `true`, displays the First/Last page buttons.
|
|
114
124
|
*
|
|
115
125
|
* @defaultValue `false`
|
|
116
126
|
*/
|
|
117
127
|
showFirstLastButtons?: boolean;
|
|
118
128
|
/**
|
|
119
|
-
*
|
|
129
|
+
* The maximum number of page buttons to display.
|
|
120
130
|
*/
|
|
121
131
|
maxVisiblePageButtons?: number;
|
|
122
132
|
/**
|
|
123
|
-
* Denotes the current page.
|
|
133
|
+
* Denotes the current page number.
|
|
124
134
|
*/
|
|
125
135
|
page?: number;
|
|
126
136
|
/**
|
|
127
|
-
* A function that
|
|
137
|
+
* A function that is invoked when the page pagination button is clicked. It receives the new page number as an argument.
|
|
128
138
|
*
|
|
129
139
|
* @event
|
|
130
140
|
*/
|
|
@@ -6,38 +6,38 @@ export interface TabsProps extends BaseComponentProps {
|
|
|
6
6
|
*/
|
|
7
7
|
children?: ReactNode;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* A function that gets invoked when the selected tab changes.
|
|
10
10
|
*/
|
|
11
11
|
onSelectedChange?: ((selectedId: string) => void) | ((selectedId: number) => void) | ((selectedId: number | string) => void);
|
|
12
12
|
/**
|
|
13
|
-
* The
|
|
13
|
+
* The ID of the tab to display by default (as set by the `Tab`'s `tabId` prop).
|
|
14
14
|
*/
|
|
15
15
|
defaultSelected?: string | number;
|
|
16
16
|
/**
|
|
17
|
-
* The currently selected tab ID
|
|
17
|
+
* The currently selected tab ID, for controlling the component via React state.
|
|
18
18
|
*/
|
|
19
19
|
selected?: string | number;
|
|
20
20
|
/**
|
|
21
|
-
* Visual style
|
|
21
|
+
* Visual style of the tabs.
|
|
22
22
|
* @defaultValue 'default'
|
|
23
23
|
*/
|
|
24
24
|
variant?: 'default' | 'enclosed';
|
|
25
25
|
/**
|
|
26
|
-
* Whether the
|
|
26
|
+
* Whether the tabs should fill the available space.
|
|
27
27
|
*/
|
|
28
28
|
fill?: boolean;
|
|
29
29
|
}
|
|
30
30
|
export interface TabProps extends BaseComponentProps {
|
|
31
31
|
/**
|
|
32
|
-
* Whether the tab
|
|
32
|
+
* Whether the tab should be disabled. When set to `false`, tab will be greyed out and not clickable.
|
|
33
33
|
*/
|
|
34
34
|
disabled?: boolean;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* The tab's unique identifier.
|
|
37
37
|
*/
|
|
38
38
|
tabId?: string | number;
|
|
39
39
|
/**
|
|
40
|
-
* The title text
|
|
40
|
+
* The tab's title text.
|
|
41
41
|
*/
|
|
42
42
|
title?: string;
|
|
43
43
|
/**
|
|
@@ -45,11 +45,11 @@ export interface TabProps extends BaseComponentProps {
|
|
|
45
45
|
*/
|
|
46
46
|
children?: ReactNode;
|
|
47
47
|
/**
|
|
48
|
-
* The
|
|
48
|
+
* The text that appears in a tooltip on hover.
|
|
49
49
|
*/
|
|
50
50
|
tooltip?: string;
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
52
|
+
* Where the tooltip should appear, relative to the tab.
|
|
53
53
|
* @defaultValue 'top'
|
|
54
54
|
*/
|
|
55
55
|
tooltipPlacement?: 'top' | 'bottom' | 'left' | 'right';
|
|
@@ -12,13 +12,13 @@ export interface TagProps extends OverlayComponentProps, BaseComponentProps {
|
|
|
12
12
|
*/
|
|
13
13
|
children: ReactNode;
|
|
14
14
|
/**
|
|
15
|
-
* The
|
|
15
|
+
* The color of the alert.
|
|
16
16
|
*
|
|
17
17
|
* @defaultValue `"default"`
|
|
18
18
|
*/
|
|
19
19
|
variant?: 'default' | 'warning' | 'success' | 'error' | 'info';
|
|
20
20
|
/**
|
|
21
|
-
* A function that will be invoked when the tag is clicked.
|
|
21
|
+
* A function that will be invoked when the tag is clicked. The function receives no arguments and its return value is ignored.
|
|
22
22
|
*
|
|
23
23
|
* @event
|
|
24
24
|
*/
|
|
@@ -48,16 +48,13 @@ export interface TruncateOptions {
|
|
|
48
48
|
*/
|
|
49
49
|
export type TextProps = {
|
|
50
50
|
/**
|
|
51
|
-
* The style of text to display.
|
|
52
|
-
*
|
|
53
|
-
* - bodytext: the default value which renders the standard text size.
|
|
54
|
-
* - microcopy: smaller text used for adding context.
|
|
51
|
+
* The style of text to display.
|
|
55
52
|
*
|
|
56
53
|
* @defaultValue `"bodytext"`
|
|
57
54
|
*/
|
|
58
55
|
variant?: 'bodytext' | 'microcopy';
|
|
59
56
|
/**
|
|
60
|
-
* When set to `true`,
|
|
57
|
+
* When set to `true`, will insert text without breaking the line.
|
|
61
58
|
*
|
|
62
59
|
* @defaultValue `false`
|
|
63
60
|
*/
|
|
@@ -67,26 +64,23 @@ export type TextProps = {
|
|
|
67
64
|
*/
|
|
68
65
|
children: ReactNode;
|
|
69
66
|
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* - {
|
|
74
|
-
* - {
|
|
75
|
-
* - {
|
|
76
|
-
* - {
|
|
77
|
-
* - { lineDecoration: 'underline' }
|
|
78
|
-
* - <Text inline={true}>
|
|
67
|
+
* Text formatting options, which include:
|
|
68
|
+
* - `{ fontWeight: 'bold' }`
|
|
69
|
+
* - `{ fontWeight: 'demibold' }`
|
|
70
|
+
* - `{ italic: true }`
|
|
71
|
+
* - `{ lineDecoration: 'strikethrough' }`
|
|
72
|
+
* - `{ lineDecoration: 'underline' }`
|
|
73
|
+
* - `{ textTransform: '...' }` - Controls text capitalization
|
|
79
74
|
*/
|
|
80
75
|
format?: TextFormatOptions;
|
|
81
76
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
77
|
+
* Truncates long strings to a single line. If the full string doesn't fit on one line, the excess text will display in a tooltip on hover.
|
|
78
|
+
* - `false` (default): text is not truncated.
|
|
79
|
+
* - `true`: truncates text to a single line. Full text will display in a tooltip on hover.
|
|
85
80
|
*
|
|
86
|
-
*
|
|
87
|
-
* - `
|
|
88
|
-
* - {
|
|
89
|
-
* - { maxWidth: 150 } => sets the width(in pixel) of the line.
|
|
81
|
+
* Alternatively, set this prop to one of the following objects to specify truncate options:
|
|
82
|
+
* - `{tooltipText: 'string'}`: truncates the string and sets the contents of the tooltip.
|
|
83
|
+
* - `{maxWidth: number}`: sets the width of the line in pixels.
|
|
90
84
|
*
|
|
91
85
|
* @defaultValue `false`
|
|
92
86
|
*/
|
|
@@ -11,13 +11,13 @@ export interface TileProps extends BaseComponentProps {
|
|
|
11
11
|
*/
|
|
12
12
|
children: ReactNode;
|
|
13
13
|
/**
|
|
14
|
-
* When set to `true`, reduces the
|
|
14
|
+
* When set to `true`, reduces the amount of padding in the tile.
|
|
15
15
|
*
|
|
16
16
|
* @defaultValue `false`
|
|
17
17
|
*/
|
|
18
18
|
compact?: boolean;
|
|
19
19
|
/**
|
|
20
|
-
* When set to `true`, removes left and right padding from tile contents.
|
|
20
|
+
* When set to `true`, removes left and right padding from the tile contents.
|
|
21
21
|
*
|
|
22
22
|
* @defaultValue `false`
|
|
23
23
|
*/
|
|
@@ -6,55 +6,53 @@ import { TShirtSizes, BaseComponentProps } from '../shared.ts';
|
|
|
6
6
|
*/
|
|
7
7
|
export interface ToggleProps extends BaseComponentProps {
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Whether the toggle is selected.
|
|
10
10
|
*/
|
|
11
11
|
checked?: boolean;
|
|
12
12
|
/**
|
|
13
|
-
* When set to `true`,
|
|
13
|
+
* When set to `true`, users will not be able to select the toggle.
|
|
14
14
|
*/
|
|
15
15
|
readonly?: boolean;
|
|
16
16
|
/**
|
|
17
|
-
* The unique identifier
|
|
17
|
+
* The input's unique identifier.
|
|
18
18
|
*/
|
|
19
19
|
name?: string;
|
|
20
20
|
/**
|
|
21
|
-
* The size
|
|
21
|
+
* The size of the toggle. Only `'md'` sized toggles can display text on the toggle (ON, OFF). All other sizes will hide checked/unchecked text.
|
|
22
22
|
*
|
|
23
|
-
* @defaultValue `"
|
|
23
|
+
* @defaultValue `"md"`
|
|
24
24
|
*/
|
|
25
25
|
size?: TShirtSizes['xs'] | TShirtSizes['sm'] | TShirtSizes['md'] | 'default';
|
|
26
26
|
/**
|
|
27
|
-
* A function that is
|
|
27
|
+
* A function that is invoked when the toggle is clicked.
|
|
28
28
|
*
|
|
29
29
|
* @event
|
|
30
30
|
*/
|
|
31
31
|
onChange?: (checked: boolean) => void;
|
|
32
32
|
/**
|
|
33
|
-
* When set to `true`, the
|
|
34
|
-
* set the default `checked` state when the component is **uncontrolled**.
|
|
33
|
+
* When set to `true`, the toggle will be selected by default. Sets the default `checked` state when the component is uncontrolled.
|
|
35
34
|
*/
|
|
36
35
|
initialIsChecked?: boolean;
|
|
37
36
|
/**
|
|
38
|
-
* The
|
|
39
|
-
* inline, or hidden. When hidden, it will remain usable for screen readers.
|
|
37
|
+
* The text that displays above the input.
|
|
40
38
|
*/
|
|
41
39
|
label: string;
|
|
42
40
|
/**
|
|
43
|
-
*
|
|
41
|
+
* The display option for the toggle label.
|
|
44
42
|
*
|
|
45
43
|
* @defaultValue `"inline"`
|
|
46
44
|
*/
|
|
47
45
|
labelDisplay?: 'inline' | 'top' | 'hidden';
|
|
48
46
|
/**
|
|
49
|
-
* The text that
|
|
47
|
+
* The text that displays on the toggle when checked. Extra small and small toggles will not display any text.
|
|
50
48
|
*
|
|
51
49
|
* @defaultValue `"ON"`
|
|
52
50
|
*/
|
|
53
51
|
textChecked?: string;
|
|
54
52
|
/**
|
|
55
|
-
* The text that
|
|
53
|
+
* The text that displays on the toggle when not checked. Extra small and small toggles will not display any text.
|
|
56
54
|
*
|
|
57
|
-
* @defaultValue `"
|
|
55
|
+
* @defaultValue `"OFF"`
|
|
58
56
|
*/
|
|
59
57
|
textUnchecked?: string;
|
|
60
58
|
}
|
|
@@ -6,53 +6,57 @@ import { BaseComponentProps } from '../shared.ts';
|
|
|
6
6
|
*/
|
|
7
7
|
export interface CheckboxProps extends BaseComponentProps {
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
* but on the server this is the value given to the data submitted with the checkbox's name.
|
|
9
|
+
* The checkbox value. This value is not displayed on the card, but is passed on the server side when submitted, along with the checkbox name.
|
|
11
10
|
*/
|
|
12
11
|
value?: string;
|
|
13
12
|
/**
|
|
14
|
-
*
|
|
13
|
+
* When set to `true`, the checkbox is selected.
|
|
14
|
+
*
|
|
15
|
+
* @defaultValue `false`
|
|
15
16
|
*/
|
|
16
17
|
checked?: boolean;
|
|
17
18
|
/** @deprecated use readOnly instead */
|
|
18
19
|
readonly?: boolean;
|
|
19
20
|
/**
|
|
20
|
-
* When set to `true`, the
|
|
21
|
+
* When set to `true`, the checkbox cannot be selected.
|
|
21
22
|
*/
|
|
22
23
|
readOnly?: boolean;
|
|
23
24
|
/**
|
|
24
|
-
*
|
|
25
|
+
* Text that describes the field's purpose.
|
|
25
26
|
*/
|
|
26
27
|
description?: string;
|
|
27
28
|
/**
|
|
28
|
-
* The unique identifier
|
|
29
|
+
* The checkbox's unique identifier.
|
|
29
30
|
*/
|
|
30
31
|
name?: string;
|
|
31
32
|
/**
|
|
32
|
-
* The size
|
|
33
|
+
* The size of the checkbox.
|
|
33
34
|
*
|
|
34
35
|
* @defaultValue `"default"`
|
|
35
36
|
*/
|
|
36
37
|
variant?: 'default' | 'small';
|
|
37
38
|
/**
|
|
38
|
-
* A function that is called when the
|
|
39
|
+
* A callback function that is called when the checkbox is selected or cleared. Passes the new value.
|
|
39
40
|
*
|
|
40
41
|
* @event
|
|
41
42
|
*/
|
|
42
43
|
onChange?: (checked: boolean, value: string) => void;
|
|
43
|
-
/** The text that displays
|
|
44
|
+
/** The text that displays next to the checkbox. */
|
|
44
45
|
children?: React.ReactNode;
|
|
45
46
|
/**
|
|
46
|
-
*
|
|
47
|
+
* When set to `true`, arranges checkboxes side by side.
|
|
48
|
+
*
|
|
49
|
+
* @defaultValue `false`
|
|
47
50
|
*/
|
|
48
51
|
inline?: boolean;
|
|
49
52
|
/**
|
|
50
|
-
* When set to `true`, the
|
|
51
|
-
*
|
|
53
|
+
* When set to `true`, the checkbox is selected by default.
|
|
54
|
+
*
|
|
55
|
+
* @defaultValue `false`
|
|
52
56
|
*/
|
|
53
57
|
initialIsChecked?: boolean;
|
|
54
58
|
/**
|
|
55
|
-
*
|
|
59
|
+
* The checkbox's accessibility label.
|
|
56
60
|
*/
|
|
57
61
|
'aria-label'?: string;
|
|
58
62
|
}
|
|
@@ -91,15 +95,15 @@ export interface RadioButtonListProps extends ToggleGroupListBaseProps {
|
|
|
91
95
|
type ToggleType = 'checkboxList' | 'radioButtonList';
|
|
92
96
|
export interface CommonGroupProps extends BaseComponentProps {
|
|
93
97
|
/**
|
|
94
|
-
*
|
|
98
|
+
* The type of toggle, whether checkboxes or radio buttons. Radio buttons only allow one option to be selected.
|
|
95
99
|
*/
|
|
96
100
|
toggleType?: ToggleType;
|
|
97
101
|
/**
|
|
98
|
-
* The unique identifier
|
|
102
|
+
* The input's unique identifier.
|
|
99
103
|
*/
|
|
100
104
|
name: string;
|
|
101
105
|
/**
|
|
102
|
-
* The
|
|
106
|
+
* The text that displays above the toggles.
|
|
103
107
|
*/
|
|
104
108
|
label: string;
|
|
105
109
|
/**
|
|
@@ -117,13 +121,13 @@ export interface CommonGroupProps extends BaseComponentProps {
|
|
|
117
121
|
*/
|
|
118
122
|
tooltip?: string;
|
|
119
123
|
/**
|
|
120
|
-
* When set to `true`, `validationMessage` is displayed as an error message if provided. The input will also render its error state to let the user know there is an error. If left false
|
|
124
|
+
* When set to `true`, `validationMessage` is displayed as an error message if provided. The input will also render its error state to let the user know there is an error. If left `false`, `validationMessage` is displayed as a success message.
|
|
121
125
|
*
|
|
122
126
|
* @defaultValue `false`
|
|
123
127
|
*/
|
|
124
128
|
error?: boolean;
|
|
125
129
|
/**
|
|
126
|
-
* An array of options to display in the
|
|
130
|
+
* An array of options to display in the group.
|
|
127
131
|
*
|
|
128
132
|
* @defaultValue `[]`
|
|
129
133
|
*/
|
|
@@ -135,11 +139,14 @@ export interface CommonGroupProps extends BaseComponentProps {
|
|
|
135
139
|
*/
|
|
136
140
|
inline?: boolean;
|
|
137
141
|
/**
|
|
138
|
-
* The size
|
|
142
|
+
* The size of the toggle.
|
|
139
143
|
*
|
|
140
144
|
* @defaultValue `"default"`
|
|
141
145
|
*/
|
|
142
146
|
variant?: 'default' | 'small';
|
|
147
|
+
/**
|
|
148
|
+
* The value of the toggle group.
|
|
149
|
+
*/
|
|
143
150
|
value?: string[] | string;
|
|
144
151
|
}
|
|
145
152
|
type CheckboxGroupProps = {
|
|
@@ -6,7 +6,7 @@ export interface TooltipProps extends BaseComponentProps {
|
|
|
6
6
|
*/
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* The position where the tooltip will be displayed, relative to the parent UI component.
|
|
10
10
|
* @default 'top'
|
|
11
11
|
*/
|
|
12
12
|
placement?: 'top' | 'bottom' | 'left' | 'right';
|