@hubspot/ui-extensions 0.0.1-prealpha.6 → 0.1.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/README.md +685 -275
- package/dist/coreComponents.d.ts +29 -4
- package/dist/coreComponents.js +6 -1
- package/dist/crm/components.d.ts +31 -6
- package/dist/crm/components.js +7 -2
- package/dist/crm/index.d.ts +2 -2
- package/dist/crm/index.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/types.d.ts +195 -50
- package/dist/types.js +5 -0
- package/package.json +2 -2
package/dist/coreComponents.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AlertProps, ButtonProps, ButtonRowProps, CardProps, DescriptionListProps, DescriptionListItemProps, DividerProps, EmptyStateProps, ErrorStateProps, FormProps, HeadingProps, ImageProps, InputProps, LoadingSpinnerProps, ProgressBarProps, SelectProps, TagProps, TextProps, TileProps, StackProps, StatisticsProps, StatisticsItemProps, StatisticsTrendProps, TableProps, TableElementProps } from './types';
|
|
1
|
+
import type { AlertProps, ButtonProps, ButtonRowProps, CardProps, DescriptionListProps, DescriptionListItemProps, DividerProps, EmptyStateProps, ErrorStateProps, FormProps, HeadingProps, ImageProps, InputProps, TextareaProps, LoadingSpinnerProps, ProgressBarProps, SelectProps, TagProps, TextProps, TileProps, StackProps, StatisticsProps, StatisticsItemProps, StatisticsTrendProps, TableProps, TableElementProps, ToggleGroupProps, LinkProps, NumberInputProps, BoxProps } from './types';
|
|
2
2
|
declare const Alert: "Alert" & {
|
|
3
3
|
readonly type?: "Alert" | undefined;
|
|
4
4
|
readonly props?: AlertProps | undefined;
|
|
@@ -61,9 +61,14 @@ declare const Image: "Image" & {
|
|
|
61
61
|
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Image", ImageProps, true>>;
|
|
62
62
|
declare const Input: "Input" & {
|
|
63
63
|
readonly type?: "Input" | undefined;
|
|
64
|
-
readonly props?: InputProps | undefined;
|
|
64
|
+
readonly props?: InputProps<string> | undefined;
|
|
65
65
|
readonly children?: true | undefined;
|
|
66
|
-
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Input", InputProps
|
|
66
|
+
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Input", InputProps<string>, true>>;
|
|
67
|
+
declare const Textarea: "Textarea" & {
|
|
68
|
+
readonly type?: "Textarea" | undefined;
|
|
69
|
+
readonly props?: TextareaProps | undefined;
|
|
70
|
+
readonly children?: true | undefined;
|
|
71
|
+
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Textarea", TextareaProps, true>>;
|
|
67
72
|
declare const LoadingSpinner: "LoadingSpinner" & {
|
|
68
73
|
readonly type?: "LoadingSpinner" | undefined;
|
|
69
74
|
readonly props?: LoadingSpinnerProps | undefined;
|
|
@@ -94,6 +99,11 @@ declare const Tile: "Tile" & {
|
|
|
94
99
|
readonly props?: TileProps | undefined;
|
|
95
100
|
readonly children?: true | undefined;
|
|
96
101
|
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Tile", TileProps, true>>;
|
|
102
|
+
declare const ToggleGroup: "ToggleGroup" & {
|
|
103
|
+
readonly type?: "ToggleGroup" | undefined;
|
|
104
|
+
readonly props?: ToggleGroupProps | undefined;
|
|
105
|
+
readonly children?: true | undefined;
|
|
106
|
+
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"ToggleGroup", ToggleGroupProps, true>>;
|
|
97
107
|
declare const Stack: "Stack" & {
|
|
98
108
|
readonly type?: "Stack" | undefined;
|
|
99
109
|
readonly props?: StackProps | undefined;
|
|
@@ -149,4 +159,19 @@ declare const TableHead: "TableHead" & {
|
|
|
149
159
|
readonly props?: TableElementProps | undefined;
|
|
150
160
|
readonly children?: true | undefined;
|
|
151
161
|
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"TableHead", TableElementProps, true>>;
|
|
152
|
-
|
|
162
|
+
declare const Link: "Link" & {
|
|
163
|
+
readonly type?: "Link" | undefined;
|
|
164
|
+
readonly props?: LinkProps | undefined;
|
|
165
|
+
readonly children?: true | undefined;
|
|
166
|
+
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Link", LinkProps, true>>;
|
|
167
|
+
declare const NumberInput: "NumberInput" & {
|
|
168
|
+
readonly type?: "NumberInput" | undefined;
|
|
169
|
+
readonly props?: NumberInputProps | undefined;
|
|
170
|
+
readonly children?: true | undefined;
|
|
171
|
+
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"NumberInput", NumberInputProps, true>>;
|
|
172
|
+
declare const Box: "Box" & {
|
|
173
|
+
readonly type?: "Box" | undefined;
|
|
174
|
+
readonly props?: BoxProps | undefined;
|
|
175
|
+
readonly children?: true | undefined;
|
|
176
|
+
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Box", BoxProps, true>>;
|
|
177
|
+
export { Alert, Box, Button, ButtonRow, Card, DescriptionList, DescriptionListItem, Divider, EmptyState, ErrorState, Form, Heading, Image, Input, Textarea, LoadingSpinner, Link, ProgressBar, Select, Stack, Statistics, StatisticsItem, StatisticsTrend, Table, TableFooter, TableCell, TableRow, TableBody, TableHeader, TableHead, Tag, Text, Tile, ToggleGroup, NumberInput, };
|
package/dist/coreComponents.js
CHANGED
|
@@ -12,12 +12,14 @@ const Form = createRemoteReactComponent('Form');
|
|
|
12
12
|
const Heading = createRemoteReactComponent('Heading');
|
|
13
13
|
const Image = createRemoteReactComponent('Image');
|
|
14
14
|
const Input = createRemoteReactComponent('Input');
|
|
15
|
+
const Textarea = createRemoteReactComponent('Textarea');
|
|
15
16
|
const LoadingSpinner = createRemoteReactComponent('LoadingSpinner');
|
|
16
17
|
const ProgressBar = createRemoteReactComponent('ProgressBar');
|
|
17
18
|
const Select = createRemoteReactComponent('Select');
|
|
18
19
|
const Tag = createRemoteReactComponent('Tag');
|
|
19
20
|
const Text = createRemoteReactComponent('Text');
|
|
20
21
|
const Tile = createRemoteReactComponent('Tile');
|
|
22
|
+
const ToggleGroup = createRemoteReactComponent('ToggleGroup');
|
|
21
23
|
const Stack = createRemoteReactComponent('Stack');
|
|
22
24
|
const StatisticsItem = createRemoteReactComponent('StatisticsItem');
|
|
23
25
|
const Statistics = createRemoteReactComponent('Statistics');
|
|
@@ -29,4 +31,7 @@ const TableRow = createRemoteReactComponent('TableRow');
|
|
|
29
31
|
const TableBody = createRemoteReactComponent('TableBody');
|
|
30
32
|
const TableHeader = createRemoteReactComponent('TableHeader');
|
|
31
33
|
const TableHead = createRemoteReactComponent('TableHead');
|
|
32
|
-
|
|
34
|
+
const Link = createRemoteReactComponent('Link');
|
|
35
|
+
const NumberInput = createRemoteReactComponent('NumberInput');
|
|
36
|
+
const Box = createRemoteReactComponent('Box');
|
|
37
|
+
export { Alert, Box, Button, ButtonRow, Card, DescriptionList, DescriptionListItem, Divider, EmptyState, ErrorState, Form, Heading, Image, Input, Textarea, LoadingSpinner, Link, ProgressBar, Select, Stack, Statistics, StatisticsItem, StatisticsTrend, Table, TableFooter, TableCell, TableRow, TableBody, TableHeader, TableHead, Tag, Text, Tile, ToggleGroup, NumberInput, };
|
package/dist/crm/components.d.ts
CHANGED
|
@@ -1,12 +1,37 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CrmAssociationPivotProps, CrmAssociationTableProps, CrmDataHighlightProps, CrmObjectPropertyProps, CrmPropertyListProps, CrmReportProps, CrmAssociationPropertyListProps } from '../types';
|
|
2
|
+
declare const CrmObjectProperty: "CrmObjectProperty" & {
|
|
3
|
+
readonly type?: "CrmObjectProperty" | undefined;
|
|
4
|
+
readonly props?: CrmObjectPropertyProps | undefined;
|
|
5
|
+
readonly children?: true | undefined;
|
|
6
|
+
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"CrmObjectProperty", CrmObjectPropertyProps, true>>;
|
|
2
7
|
declare const CrmPropertyList: "CrmPropertyList" & {
|
|
3
8
|
readonly type?: "CrmPropertyList" | undefined;
|
|
4
9
|
readonly props?: CrmPropertyListProps | undefined;
|
|
5
10
|
readonly children?: true | undefined;
|
|
6
11
|
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"CrmPropertyList", CrmPropertyListProps, true>>;
|
|
7
|
-
declare const
|
|
8
|
-
readonly type?: "
|
|
9
|
-
readonly props?:
|
|
12
|
+
declare const CrmAssociationTable: "CrmAssociationTable" & {
|
|
13
|
+
readonly type?: "CrmAssociationTable" | undefined;
|
|
14
|
+
readonly props?: CrmAssociationTableProps | undefined;
|
|
15
|
+
readonly children?: true | undefined;
|
|
16
|
+
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"CrmAssociationTable", CrmAssociationTableProps, true>>;
|
|
17
|
+
declare const CrmDataHighlight: "CrmDataHighlight" & {
|
|
18
|
+
readonly type?: "CrmDataHighlight" | undefined;
|
|
19
|
+
readonly props?: CrmDataHighlightProps | undefined;
|
|
20
|
+
readonly children?: true | undefined;
|
|
21
|
+
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"CrmDataHighlight", CrmDataHighlightProps, true>>;
|
|
22
|
+
declare const CrmReport: "CrmReport" & {
|
|
23
|
+
readonly type?: "CrmReport" | undefined;
|
|
24
|
+
readonly props?: CrmReportProps | undefined;
|
|
25
|
+
readonly children?: true | undefined;
|
|
26
|
+
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"CrmReport", CrmReportProps, true>>;
|
|
27
|
+
declare const CrmAssociationPivot: "CrmAssociationPivot" & {
|
|
28
|
+
readonly type?: "CrmAssociationPivot" | undefined;
|
|
29
|
+
readonly props?: CrmAssociationPivotProps | undefined;
|
|
30
|
+
readonly children?: true | undefined;
|
|
31
|
+
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"CrmAssociationPivot", CrmAssociationPivotProps, true>>;
|
|
32
|
+
declare const CrmAssociationPropertyList: "CrmAssociationPropertyList" & {
|
|
33
|
+
readonly type?: "CrmAssociationPropertyList" | undefined;
|
|
34
|
+
readonly props?: CrmAssociationPropertyListProps | undefined;
|
|
10
35
|
readonly children?: true | undefined;
|
|
11
|
-
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"
|
|
12
|
-
export { CrmPropertyList,
|
|
36
|
+
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"CrmAssociationPropertyList", CrmAssociationPropertyListProps, true>>;
|
|
37
|
+
export { CrmObjectProperty, CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmAssociationPropertyList, };
|
package/dist/crm/components.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { createExtensionComponent } from '../utils/createExtensionComponent';
|
|
2
|
+
const CrmObjectProperty = createExtensionComponent('CrmObjectProperty');
|
|
2
3
|
const CrmPropertyList = createExtensionComponent('CrmPropertyList');
|
|
3
|
-
const
|
|
4
|
-
|
|
4
|
+
const CrmAssociationTable = createExtensionComponent('CrmAssociationTable');
|
|
5
|
+
const CrmDataHighlight = createExtensionComponent('CrmDataHighlight');
|
|
6
|
+
const CrmReport = createExtensionComponent('CrmReport');
|
|
7
|
+
const CrmAssociationPivot = createExtensionComponent('CrmAssociationPivot');
|
|
8
|
+
const CrmAssociationPropertyList = createExtensionComponent('CrmAssociationPropertyList');
|
|
9
|
+
export { CrmObjectProperty, CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmAssociationPropertyList, };
|
package/dist/crm/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CrmPropertyList,
|
|
2
|
-
export { CrmPropertyList,
|
|
1
|
+
import { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmObjectProperty, CrmAssociationPropertyList } from './components';
|
|
2
|
+
export { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmObjectProperty, CrmAssociationPropertyList, };
|
package/dist/crm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CrmPropertyList,
|
|
2
|
-
export { CrmPropertyList,
|
|
1
|
+
import { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmObjectProperty, CrmAssociationPropertyList, } from './components';
|
|
2
|
+
export { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmObjectProperty, CrmAssociationPropertyList, };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { Alert, Button, ButtonRow, Card, DescriptionList, DescriptionListItem, Divider, EmptyState, ErrorState, Form, Heading, Image, Input, LoadingSpinner, ProgressBar, Select, Stack, Statistics, StatisticsItem, StatisticsTrend, Table, TableFooter, TableCell, TableRow, TableBody, TableHeader, TableHead, Tag, Text, Tile, } from './coreComponents';
|
|
1
|
+
export { Alert, Button, ButtonRow, Card, DescriptionList, DescriptionListItem, Divider, EmptyState, ErrorState, Form, Heading, Image, Input, LoadingSpinner, ProgressBar, Select, Stack, Statistics, StatisticsItem, StatisticsTrend, Table, TableFooter, TableCell, TableRow, TableBody, TableHeader, TableHead, Tag, Text, Textarea, Tile, ToggleGroup, Link, NumberInput, Box, } from './coreComponents';
|
|
2
2
|
export { hubspot } from './hubspot';
|
|
3
3
|
export * from './types';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { Alert, Button, ButtonRow, Card, DescriptionList, DescriptionListItem, Divider, EmptyState, ErrorState, Form, Heading, Image, Input, LoadingSpinner, ProgressBar, Select, Stack, Statistics, StatisticsItem, StatisticsTrend, Table, TableFooter, TableCell, TableRow, TableBody, TableHeader, TableHead, Tag, Text, Tile, } from './coreComponents';
|
|
1
|
+
export { Alert, Button, ButtonRow, Card, DescriptionList, DescriptionListItem, Divider, EmptyState, ErrorState, Form, Heading, Image, Input, LoadingSpinner, ProgressBar, Select, Stack, Statistics, StatisticsItem, StatisticsTrend, Table, TableFooter, TableCell, TableRow, TableBody, TableHeader, TableHead, Tag, Text, Textarea, Tile, ToggleGroup, Link, NumberInput, Box, } from './coreComponents';
|
|
2
2
|
export { hubspot } from './hubspot';
|
|
3
3
|
export * from './types';
|
package/dist/types.d.ts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { ReactNode, ComponentType } from 'react';
|
|
2
2
|
export interface AlertProps {
|
|
3
3
|
title: string;
|
|
4
|
-
body?: string;
|
|
5
4
|
children?: ReactNode;
|
|
6
5
|
variant?: 'info' | 'warning' | 'success' | 'error' | 'danger';
|
|
7
6
|
}
|
|
8
7
|
export interface ButtonProps {
|
|
9
|
-
text: string;
|
|
10
8
|
onClick?: () => void;
|
|
11
9
|
href?: string;
|
|
12
10
|
disabled?: boolean;
|
|
13
11
|
variant?: 'primary' | 'secondary' | 'destructive';
|
|
14
12
|
type?: 'button' | 'reset' | 'submit';
|
|
13
|
+
children: ReactNode;
|
|
15
14
|
}
|
|
16
15
|
export interface ButtonRowProps {
|
|
17
16
|
children: ReactNode;
|
|
@@ -29,7 +28,7 @@ export interface DescriptionListProps {
|
|
|
29
28
|
direction?: 'row' | 'column';
|
|
30
29
|
}
|
|
31
30
|
export interface DividerProps {
|
|
32
|
-
distance?:
|
|
31
|
+
distance?: AllDistances;
|
|
33
32
|
}
|
|
34
33
|
export interface EmptyStateProps {
|
|
35
34
|
flush?: boolean;
|
|
@@ -51,8 +50,8 @@ export interface FormProps {
|
|
|
51
50
|
preventDefault?: boolean;
|
|
52
51
|
}
|
|
53
52
|
export interface HeadingProps {
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
children: ReactNode;
|
|
54
|
+
inline?: boolean;
|
|
56
55
|
}
|
|
57
56
|
export interface ImageProps {
|
|
58
57
|
alt?: string;
|
|
@@ -60,22 +59,36 @@ export interface ImageProps {
|
|
|
60
59
|
onClick?: () => void;
|
|
61
60
|
src: string;
|
|
62
61
|
width?: number;
|
|
62
|
+
height?: number;
|
|
63
63
|
}
|
|
64
|
-
export interface InputProps {
|
|
64
|
+
export interface InputProps<T = string> {
|
|
65
65
|
label: string;
|
|
66
66
|
name: string;
|
|
67
|
-
value?:
|
|
67
|
+
value?: T;
|
|
68
68
|
required?: boolean;
|
|
69
|
-
|
|
69
|
+
readOnly?: boolean;
|
|
70
70
|
description?: string;
|
|
71
71
|
tooltip?: string;
|
|
72
72
|
placeholder?: string;
|
|
73
73
|
error?: boolean;
|
|
74
|
+
defaultValue?: T;
|
|
74
75
|
validationMessage?: string;
|
|
75
|
-
onChange?: (value:
|
|
76
|
-
onInput?: (value:
|
|
77
|
-
onBlur?: (value:
|
|
78
|
-
onFocus?: (value:
|
|
76
|
+
onChange?: (value: T) => void;
|
|
77
|
+
onInput?: (value: T) => void;
|
|
78
|
+
onBlur?: (value: T) => void;
|
|
79
|
+
onFocus?: (value: T) => void;
|
|
80
|
+
}
|
|
81
|
+
export interface TextareaProps extends InputProps {
|
|
82
|
+
cols?: number;
|
|
83
|
+
maxLength?: number;
|
|
84
|
+
rows?: number;
|
|
85
|
+
resize?: 'vertical' | 'horizontal' | 'both' | 'none';
|
|
86
|
+
}
|
|
87
|
+
export interface NumberInputProps extends InputProps<number> {
|
|
88
|
+
min?: number;
|
|
89
|
+
max?: number;
|
|
90
|
+
precision?: number;
|
|
91
|
+
formatStyle?: 'decimal' | 'percentage';
|
|
79
92
|
}
|
|
80
93
|
export interface ProgressBarProps {
|
|
81
94
|
title?: string;
|
|
@@ -90,7 +103,7 @@ export interface SelectProps {
|
|
|
90
103
|
name: string;
|
|
91
104
|
value?: string | number;
|
|
92
105
|
required?: boolean;
|
|
93
|
-
|
|
106
|
+
readOnly?: boolean;
|
|
94
107
|
description?: string;
|
|
95
108
|
tooltip?: string;
|
|
96
109
|
placeholder?: string;
|
|
@@ -103,23 +116,21 @@ export interface SelectProps {
|
|
|
103
116
|
}[];
|
|
104
117
|
}
|
|
105
118
|
export interface TagProps {
|
|
106
|
-
|
|
119
|
+
children: ReactNode;
|
|
107
120
|
onClick?: () => void;
|
|
108
121
|
variant?: 'default' | 'warning' | 'success' | 'error';
|
|
109
122
|
}
|
|
110
|
-
interface
|
|
111
|
-
|
|
112
|
-
|
|
123
|
+
export interface TextFormatOptions {
|
|
124
|
+
fontWeight?: 'regular' | 'bold' | 'demibold';
|
|
125
|
+
italic?: boolean;
|
|
126
|
+
lineDecoration?: 'none' | 'underline' | 'strikethrough';
|
|
113
127
|
}
|
|
114
|
-
export
|
|
115
|
-
|
|
128
|
+
export type TextProps = {
|
|
129
|
+
variant?: 'bodytext' | 'microcopy';
|
|
130
|
+
inline?: boolean;
|
|
116
131
|
children: ReactNode;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
format: 'markdown';
|
|
120
|
-
text: string;
|
|
121
|
-
}
|
|
122
|
-
export type TextProps = PlainTextProps | MarkdownTextProps;
|
|
132
|
+
format?: TextFormatOptions;
|
|
133
|
+
};
|
|
123
134
|
export interface TileProps {
|
|
124
135
|
children: ReactNode;
|
|
125
136
|
flush?: boolean;
|
|
@@ -129,6 +140,48 @@ interface Team {
|
|
|
129
140
|
name: string;
|
|
130
141
|
teammates: number[];
|
|
131
142
|
}
|
|
143
|
+
export type ToggleGroupOption = {
|
|
144
|
+
label: string;
|
|
145
|
+
value: string;
|
|
146
|
+
initialIsChecked?: boolean;
|
|
147
|
+
readonly?: boolean;
|
|
148
|
+
description?: string;
|
|
149
|
+
};
|
|
150
|
+
interface ToggleGroupListBaseProps {
|
|
151
|
+
name: ToggleGroupProps['name'];
|
|
152
|
+
options: ToggleGroupProps['options'];
|
|
153
|
+
variant: ToggleGroupProps['variant'];
|
|
154
|
+
inline?: boolean;
|
|
155
|
+
}
|
|
156
|
+
export interface CheckboxListProps extends ToggleGroupListBaseProps {
|
|
157
|
+
value?: CheckboxGroupProps['value'];
|
|
158
|
+
onChange?: CheckboxGroupProps['onChange'];
|
|
159
|
+
}
|
|
160
|
+
export interface RadioButtonListProps extends ToggleGroupListBaseProps {
|
|
161
|
+
value?: RadioButtonGroupProps['value'];
|
|
162
|
+
onChange?: RadioButtonGroupProps['onChange'];
|
|
163
|
+
}
|
|
164
|
+
interface CheckboxGroupProps {
|
|
165
|
+
toggleType: 'checkboxList';
|
|
166
|
+
onChange?: (value: this['value']) => void;
|
|
167
|
+
value?: string[];
|
|
168
|
+
}
|
|
169
|
+
interface RadioButtonGroupProps {
|
|
170
|
+
toggleType: 'radioButtonList';
|
|
171
|
+
onChange?: (value: this['value']) => void;
|
|
172
|
+
value?: string;
|
|
173
|
+
}
|
|
174
|
+
export type ToggleGroupProps = {
|
|
175
|
+
name: string;
|
|
176
|
+
label: string;
|
|
177
|
+
validationMessage?: string;
|
|
178
|
+
required?: boolean;
|
|
179
|
+
tooltip?: string;
|
|
180
|
+
error?: boolean;
|
|
181
|
+
options: Array<ToggleGroupOption>;
|
|
182
|
+
inline?: boolean;
|
|
183
|
+
variant?: 'default' | 'small';
|
|
184
|
+
} & (CheckboxGroupProps | RadioButtonGroupProps);
|
|
132
185
|
export interface UserContext {
|
|
133
186
|
id: number;
|
|
134
187
|
emails: string[];
|
|
@@ -148,9 +201,12 @@ export interface Context {
|
|
|
148
201
|
portal: PortalContext;
|
|
149
202
|
}
|
|
150
203
|
export interface StackProps {
|
|
151
|
-
distance?:
|
|
204
|
+
distance?: AllDistances;
|
|
152
205
|
children?: React.ReactNode;
|
|
153
206
|
direction?: 'row' | 'column';
|
|
207
|
+
justify?: 'center' | 'end' | 'start';
|
|
208
|
+
align?: 'start' | 'center' | 'baseline' | 'end' | 'stretch';
|
|
209
|
+
width?: 'auto' | '100%';
|
|
154
210
|
}
|
|
155
211
|
export interface StatisticsTrendProps {
|
|
156
212
|
value: string;
|
|
@@ -166,21 +222,57 @@ export interface StatisticsProps {
|
|
|
166
222
|
children: ReactNode;
|
|
167
223
|
}
|
|
168
224
|
export interface ServerlessRunnerParams {
|
|
225
|
+
/**
|
|
226
|
+
* Name of the serverless function
|
|
227
|
+
*/
|
|
169
228
|
name: string;
|
|
170
|
-
|
|
171
|
-
|
|
229
|
+
/**
|
|
230
|
+
* Names of CRM object properties to be retrieved and supplied to the function as `context.propertiesToSend`
|
|
231
|
+
*/
|
|
232
|
+
propertiesToSend?: string[];
|
|
233
|
+
/**
|
|
234
|
+
* Additional parameters to be supplied to the function as `context.parameters`
|
|
235
|
+
*/
|
|
236
|
+
parameters?: JsonValue;
|
|
237
|
+
/**
|
|
238
|
+
* @deprecated Optional payload supplied to the function as `context.event.payload`.
|
|
239
|
+
* Support for this param may be removed in the future. Use `parameters` instead.
|
|
240
|
+
*/
|
|
241
|
+
payload?: JsonValue;
|
|
242
|
+
}
|
|
243
|
+
export declare enum ServerlessExecutionStatus {
|
|
244
|
+
Success = "SUCCESS",
|
|
245
|
+
Error = "ERROR"
|
|
246
|
+
}
|
|
247
|
+
export type ServerlessExecutionResult = {
|
|
248
|
+
status: ServerlessExecutionStatus.Success;
|
|
249
|
+
response: JsonValue;
|
|
250
|
+
} | {
|
|
251
|
+
status: ServerlessExecutionStatus.Error;
|
|
252
|
+
message: string;
|
|
253
|
+
};
|
|
254
|
+
export type ServerlessFuncRunner = (params: ServerlessRunnerParams) => Promise<ServerlessExecutionResult>;
|
|
255
|
+
export interface ServerlessExecutionRequest {
|
|
256
|
+
appId: number;
|
|
257
|
+
extensibleCardId: number;
|
|
258
|
+
serverlessFunction: string;
|
|
259
|
+
location: keyof ExtensionPoints;
|
|
260
|
+
objectQuery?: {
|
|
261
|
+
objectId: number;
|
|
262
|
+
objectTypeId: string;
|
|
263
|
+
objectPropertyNames: string[];
|
|
264
|
+
};
|
|
265
|
+
parameters?: JsonValue;
|
|
266
|
+
event?: {
|
|
267
|
+
type: 'SERVERLESS_ACTION_HOOK';
|
|
268
|
+
payload: JsonValue;
|
|
269
|
+
};
|
|
270
|
+
objectId?: number;
|
|
271
|
+
objectTypeId?: string;
|
|
172
272
|
}
|
|
173
|
-
export
|
|
174
|
-
export interface ServerlessSuccessResponse {
|
|
273
|
+
export interface ServerlessExecutionResponse {
|
|
175
274
|
logId: string;
|
|
176
|
-
response
|
|
177
|
-
message?: {
|
|
178
|
-
type: 'SUCCESS' | 'ERROR';
|
|
179
|
-
body: string;
|
|
180
|
-
} | string;
|
|
181
|
-
context?: Record<string, unknown>;
|
|
182
|
-
section?: Record<string, unknown>;
|
|
183
|
-
};
|
|
275
|
+
response?: JsonValue;
|
|
184
276
|
}
|
|
185
277
|
export interface ServerlessErrorResponse {
|
|
186
278
|
responseJSON?: {
|
|
@@ -215,10 +307,7 @@ export type AddAlertAction = (args: {
|
|
|
215
307
|
message: string;
|
|
216
308
|
}) => void;
|
|
217
309
|
export type ReloadPageAction = () => void;
|
|
218
|
-
export type FetchCrmObjectPropertiesAction = (properties: string[]) => Promise<
|
|
219
|
-
name: string;
|
|
220
|
-
value: string;
|
|
221
|
-
}[]>;
|
|
310
|
+
export type FetchCrmObjectPropertiesAction = (properties: string[]) => Promise<Record<string, string>>;
|
|
222
311
|
export type OpenIframeModalAction = (action: OpenIframeActionPayload) => void;
|
|
223
312
|
export interface CrmMiddleExtensionPoint extends ExtensionPointContract {
|
|
224
313
|
actions: {
|
|
@@ -228,25 +317,46 @@ export interface CrmMiddleExtensionPoint extends ExtensionPointContract {
|
|
|
228
317
|
openIframeModal: OpenIframeModalAction;
|
|
229
318
|
};
|
|
230
319
|
customComponents: {
|
|
231
|
-
CrmPropertyList
|
|
232
|
-
|
|
320
|
+
CrmPropertyList: ComponentType<CrmPropertyListProps>;
|
|
321
|
+
CrmAssociationTable: ComponentType<CrmAssociationTableProps>;
|
|
322
|
+
CrmDataHighlight: ComponentType<CrmDataHighlightProps>;
|
|
323
|
+
CrmReport: ComponentType<CrmReportProps>;
|
|
324
|
+
CrmAssociationPivot: ComponentType<CrmAssociationPivotProps>;
|
|
325
|
+
CrmObjectProperty?: ComponentType<CrmObjectPropertyProps>;
|
|
326
|
+
CrmAssociationPropertyList?: ComponentType<CrmAssociationPropertyListProps>;
|
|
233
327
|
};
|
|
234
328
|
}
|
|
329
|
+
export interface CrmDataHighlightProps {
|
|
330
|
+
properties: Array<string>;
|
|
331
|
+
objectTypeId?: string;
|
|
332
|
+
objectId?: number;
|
|
333
|
+
}
|
|
334
|
+
export interface CrmReportProps {
|
|
335
|
+
reportId: string;
|
|
336
|
+
}
|
|
235
337
|
export interface CrmPropertyListProps {
|
|
236
|
-
properties: string
|
|
338
|
+
properties: Array<string>;
|
|
237
339
|
direction?: string;
|
|
340
|
+
objectTypeId?: string;
|
|
341
|
+
objectId?: number;
|
|
342
|
+
}
|
|
343
|
+
export interface CrmObjectPropertyProps {
|
|
344
|
+
properties: Array<string>;
|
|
345
|
+
objectTypeId?: string;
|
|
346
|
+
objectId?: number;
|
|
238
347
|
}
|
|
239
348
|
type CrmSortDescriptor = {
|
|
240
349
|
columnName: string;
|
|
241
350
|
direction: 1 | -1;
|
|
242
351
|
};
|
|
243
352
|
interface CrmSearchFilter {
|
|
244
|
-
operator: 'EQ' | 'NEQ' | 'LT' | 'LTE' | 'GT' | 'GTE' | 'BETWEEN' | 'IN' | 'NOT_IN' | 'HAS_PROPERTY' | 'NOT_HAS_PROPERTY'
|
|
353
|
+
operator: 'EQ' | 'NEQ' | 'LT' | 'LTE' | 'GT' | 'GTE' | 'BETWEEN' | 'IN' | 'NOT_IN' | 'HAS_PROPERTY' | 'NOT_HAS_PROPERTY';
|
|
245
354
|
value?: string | number;
|
|
355
|
+
values?: string | number;
|
|
246
356
|
highValue?: string | number;
|
|
247
357
|
property: string;
|
|
248
358
|
}
|
|
249
|
-
export interface
|
|
359
|
+
export interface CrmAssociationTableProps {
|
|
250
360
|
objectTypeId: string;
|
|
251
361
|
propertyColumns: Array<string>;
|
|
252
362
|
quickFilterProperties?: Array<string>;
|
|
@@ -256,6 +366,20 @@ export interface CrmAssociationsTableProps {
|
|
|
256
366
|
preFilters?: Array<CrmSearchFilter>;
|
|
257
367
|
sort?: Array<CrmSortDescriptor>;
|
|
258
368
|
}
|
|
369
|
+
export interface CrmAssociationPivotProps {
|
|
370
|
+
objectTypeId: string;
|
|
371
|
+
associationLabels?: Array<string>;
|
|
372
|
+
maxAssociations?: number;
|
|
373
|
+
preFilters?: Array<CrmSearchFilter>;
|
|
374
|
+
sort?: Array<CrmSortDescriptor>;
|
|
375
|
+
}
|
|
376
|
+
export interface CrmAssociationPropertyListProps {
|
|
377
|
+
objectTypeId: string;
|
|
378
|
+
properties: Array<string>;
|
|
379
|
+
associationLabels?: Array<string>;
|
|
380
|
+
filters?: Array<CrmSearchFilter>;
|
|
381
|
+
sort?: Array<CrmSortDescriptor>;
|
|
382
|
+
}
|
|
259
383
|
interface CrmSidebarExtensionPoint extends ExtensionPointContract {
|
|
260
384
|
actions: {
|
|
261
385
|
reloadPage: ReloadPageAction;
|
|
@@ -283,7 +407,6 @@ export interface ExtensionPointApi<ExtensionPointName extends keyof ExtensionPoi
|
|
|
283
407
|
context: Context;
|
|
284
408
|
runServerlessFunction: ServerlessFuncRunner;
|
|
285
409
|
actions: ExtensionPoints[ExtensionPointName]['actions'];
|
|
286
|
-
customComponents: string[];
|
|
287
410
|
}
|
|
288
411
|
interface OpenIframeActionPayload {
|
|
289
412
|
uri: string;
|
|
@@ -294,9 +417,8 @@ interface OpenIframeActionPayload {
|
|
|
294
417
|
export interface LoadingSpinnerProps {
|
|
295
418
|
label: string;
|
|
296
419
|
showLabel?: boolean;
|
|
297
|
-
size?: 'xs' | 'sm' | 'md';
|
|
420
|
+
size?: TShirtSizes['xs'] | TShirtSizes['sm'] | TShirtSizes['md'];
|
|
298
421
|
layout?: 'inline' | 'centered';
|
|
299
|
-
grow?: boolean;
|
|
300
422
|
}
|
|
301
423
|
export interface TableElementProps {
|
|
302
424
|
children: React.ReactNode;
|
|
@@ -326,4 +448,27 @@ export declare class RemoteEvent<V> {
|
|
|
326
448
|
targetValue: V;
|
|
327
449
|
constructor(value: V, event: Event);
|
|
328
450
|
}
|
|
451
|
+
export interface LinkProps {
|
|
452
|
+
children: ReactNode;
|
|
453
|
+
href: string;
|
|
454
|
+
variant?: 'primary' | 'destructive' | 'light' | 'dark';
|
|
455
|
+
onClick?: () => void;
|
|
456
|
+
}
|
|
457
|
+
export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
458
|
+
[key: string]: JsonValue;
|
|
459
|
+
};
|
|
460
|
+
export interface BoxProps {
|
|
461
|
+
children: ReactNode;
|
|
462
|
+
grow?: boolean;
|
|
463
|
+
alignSelf?: 'start' | 'center' | 'baseline' | 'end' | 'stretch' | 'auto';
|
|
464
|
+
}
|
|
465
|
+
interface TShirtSizes {
|
|
466
|
+
xs: 'extra-small' | 'xs';
|
|
467
|
+
sm: 'small' | 'sm';
|
|
468
|
+
md: 'medium' | 'md';
|
|
469
|
+
lg: 'large' | 'lg';
|
|
470
|
+
xl: 'extra-large' | 'xl';
|
|
471
|
+
}
|
|
472
|
+
export type AllSizes = TShirtSizes['xs'] | TShirtSizes['sm'] | TShirtSizes['md'] | TShirtSizes['lg'] | TShirtSizes['xl'];
|
|
473
|
+
export type AllDistances = 'flush' | AllSizes;
|
|
329
474
|
export {};
|
package/dist/types.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export var ServerlessExecutionStatus;
|
|
2
|
+
(function (ServerlessExecutionStatus) {
|
|
3
|
+
ServerlessExecutionStatus["Success"] = "SUCCESS";
|
|
4
|
+
ServerlessExecutionStatus["Error"] = "ERROR";
|
|
5
|
+
})(ServerlessExecutionStatus || (ServerlessExecutionStatus = {}));
|
|
1
6
|
export class RemoteEvent {
|
|
2
7
|
type;
|
|
3
8
|
bubbles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/ui-extensions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"typescript": "5.0.4"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "abac5960e6277af827714dcd4150ad7606e6a481"
|
|
52
52
|
}
|