@hubspot/ui-extensions 0.11.5 → 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/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/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 +2 -2
|
@@ -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;
|
|
@@ -11,12 +11,12 @@ export interface ProgressBarProps extends BaseComponentProps {
|
|
|
11
11
|
*/
|
|
12
12
|
title?: string;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* The accessibility label.
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
'aria-label'?: string;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* When set to `true`, the progress bar will display the completion percentage.
|
|
20
20
|
*
|
|
21
21
|
* @defaultValue `false`
|
|
22
22
|
*/
|
|
@@ -34,12 +34,12 @@ export interface ProgressBarProps extends BaseComponentProps {
|
|
|
34
34
|
*/
|
|
35
35
|
maxValue?: number;
|
|
36
36
|
/**
|
|
37
|
-
* The text that explains the current state of the value property. For example, "150 out of 250"
|
|
37
|
+
* The text that explains the current state of the `value` property. For example, `"150 out of 250"`.
|
|
38
38
|
*
|
|
39
39
|
*/
|
|
40
40
|
valueDescription?: string;
|
|
41
41
|
/**
|
|
42
|
-
* The color
|
|
42
|
+
* The color to indicate progress sentiment.
|
|
43
43
|
*
|
|
44
44
|
* @defaultValue `"success"`
|
|
45
45
|
*/
|
|
@@ -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
|
*/
|