@hubspot/ui-extensions 0.8.30 → 0.8.32
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/experimental/index.d.ts +13 -1
- package/dist/experimental/index.js +5 -1
- package/dist/types.d.ts +142 -1
- package/dist/types.js +5 -0
- package/package.json +2 -2
|
@@ -5,4 +5,16 @@ declare const Iframe: "Iframe" & {
|
|
|
5
5
|
readonly props?: types.IframeProps | undefined;
|
|
6
6
|
readonly children?: true | undefined;
|
|
7
7
|
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Iframe", types.IframeProps, true>>;
|
|
8
|
-
|
|
8
|
+
/** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
|
|
9
|
+
declare const BarChart: "BarChart" & {
|
|
10
|
+
readonly type?: "BarChart" | undefined;
|
|
11
|
+
readonly props?: types.ChartProps | undefined;
|
|
12
|
+
readonly children?: true | undefined;
|
|
13
|
+
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"BarChart", types.ChartProps, true>>;
|
|
14
|
+
/** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
|
|
15
|
+
declare const LineChart: "LineChart" & {
|
|
16
|
+
readonly type?: "LineChart" | undefined;
|
|
17
|
+
readonly props?: types.ChartProps | undefined;
|
|
18
|
+
readonly children?: true | undefined;
|
|
19
|
+
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"LineChart", types.ChartProps, true>>;
|
|
20
|
+
export { Iframe, BarChart, LineChart };
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { createRemoteReactComponent } from '@remote-ui/react';
|
|
2
2
|
/** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
|
|
3
3
|
const Iframe = createRemoteReactComponent('Iframe');
|
|
4
|
-
|
|
4
|
+
/** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
|
|
5
|
+
const BarChart = createRemoteReactComponent('BarChart');
|
|
6
|
+
/** @experimental This component is experimental. Avoid using it in production due to potential breaking changes. Your feedback is valuable for improvements. Stay tuned for updates. */
|
|
7
|
+
const LineChart = createRemoteReactComponent('LineChart');
|
|
8
|
+
export { Iframe, BarChart, LineChart };
|
package/dist/types.d.ts
CHANGED
|
@@ -177,6 +177,143 @@ export interface CardProps {
|
|
|
177
177
|
*/
|
|
178
178
|
children: ReactNode;
|
|
179
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* The props type for {@link !components.BarChart}.
|
|
182
|
+
*
|
|
183
|
+
* @category Component Props
|
|
184
|
+
*/
|
|
185
|
+
export type BarChartProps = ChartProps;
|
|
186
|
+
/**
|
|
187
|
+
* The props type for {@link !components.LineChart}.
|
|
188
|
+
*
|
|
189
|
+
* @category Component Props
|
|
190
|
+
*/
|
|
191
|
+
export type LineChartProps = ChartProps;
|
|
192
|
+
export interface ChartProps {
|
|
193
|
+
/**
|
|
194
|
+
* The data used to render the chart. You can optionally provide configuration options.
|
|
195
|
+
*/
|
|
196
|
+
data: ChartDataRow[] | {
|
|
197
|
+
data: ChartDataRow[];
|
|
198
|
+
options?: ChartDataOptions;
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* The configuration for the axes of the chart.
|
|
202
|
+
*/
|
|
203
|
+
axes: ChartAxisPair;
|
|
204
|
+
/**
|
|
205
|
+
* Configuration options for the chart as a whole.
|
|
206
|
+
*/
|
|
207
|
+
options?: ChartOptions;
|
|
208
|
+
}
|
|
209
|
+
export type ChartDataRow = {
|
|
210
|
+
[key: string]: number | string;
|
|
211
|
+
};
|
|
212
|
+
export type ChartDataOptions = {
|
|
213
|
+
/**
|
|
214
|
+
* A mapping of fields to human-readable labels.
|
|
215
|
+
* We recommend pre-formatting your data to be human-readable instead of using this configuration.
|
|
216
|
+
*/
|
|
217
|
+
propertyLabels?: {
|
|
218
|
+
[fields: string]: Record<string, string>;
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
export type ChartAxisPair = {
|
|
222
|
+
/**
|
|
223
|
+
* The field to use for the horizontal x-axis.
|
|
224
|
+
*/
|
|
225
|
+
x: ChartAxis;
|
|
226
|
+
/**
|
|
227
|
+
* The field to use for the vertical y-axis.
|
|
228
|
+
*/
|
|
229
|
+
y: ChartAxis;
|
|
230
|
+
/**
|
|
231
|
+
* Configuration options for the pair of axes.
|
|
232
|
+
*/
|
|
233
|
+
options?: AxisPairOptions;
|
|
234
|
+
};
|
|
235
|
+
export type ChartAxis = {
|
|
236
|
+
/**
|
|
237
|
+
* The dataset field that should be graphed on this axis.
|
|
238
|
+
*/
|
|
239
|
+
field: string;
|
|
240
|
+
/**
|
|
241
|
+
* The type of data in the field property. Please read the documentation for the expected formats for each fieldType.
|
|
242
|
+
*/
|
|
243
|
+
fieldType: ChartFieldType;
|
|
244
|
+
/**
|
|
245
|
+
* The axis display label. Note: this will also be used in the legend and the hover tooltips.
|
|
246
|
+
*/
|
|
247
|
+
label?: string;
|
|
248
|
+
};
|
|
249
|
+
export type AxisPairOptions = {
|
|
250
|
+
/**
|
|
251
|
+
* If provided, the data will be grouped by color for this field.
|
|
252
|
+
*/
|
|
253
|
+
groupFieldByColor?: string;
|
|
254
|
+
/**
|
|
255
|
+
* When set to true, grouped data will be stacked.
|
|
256
|
+
*
|
|
257
|
+
* @defaultValue `false`
|
|
258
|
+
*/
|
|
259
|
+
stacking?: boolean;
|
|
260
|
+
/**
|
|
261
|
+
* If provided, assigns a color to each specified values of the field provided in `groupFieldByColor`.
|
|
262
|
+
*/
|
|
263
|
+
colors?: {
|
|
264
|
+
[key: string]: ChartColor;
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
export declare const chartFieldTypes: {
|
|
268
|
+
readonly datetime: "datetime";
|
|
269
|
+
readonly linear: "linear";
|
|
270
|
+
readonly category: "category";
|
|
271
|
+
};
|
|
272
|
+
/**
|
|
273
|
+
* The type of field for this axis.
|
|
274
|
+
* - `datetime`: Used for time data, such as JavaScript timestamps.
|
|
275
|
+
* - `linear`: Used for numerical data, such as quantities.
|
|
276
|
+
* - `category`: Used for categorical data, such as different types of products.
|
|
277
|
+
*
|
|
278
|
+
* Please read the documentation for recommended usage.
|
|
279
|
+
*/
|
|
280
|
+
export type ChartFieldType = keyof typeof chartFieldTypes;
|
|
281
|
+
export type ChartOptions = {
|
|
282
|
+
/**
|
|
283
|
+
* Renders a title above the chart.
|
|
284
|
+
*/
|
|
285
|
+
title?: string;
|
|
286
|
+
/**
|
|
287
|
+
* When set to `true`, shows a legend for the chart.
|
|
288
|
+
*
|
|
289
|
+
* @defaultValue `false`
|
|
290
|
+
*/
|
|
291
|
+
showLegend?: boolean;
|
|
292
|
+
/**
|
|
293
|
+
* When set to `true`, shows hover tooltips for the charted data.
|
|
294
|
+
*
|
|
295
|
+
* @defaultValue `false`
|
|
296
|
+
*/
|
|
297
|
+
showTooltips?: boolean;
|
|
298
|
+
/**
|
|
299
|
+
* When set to `true`, shows labels for the data directly on the chart.
|
|
300
|
+
*
|
|
301
|
+
* @defaultValue `false`
|
|
302
|
+
*/
|
|
303
|
+
showDataLabels?: boolean;
|
|
304
|
+
/**
|
|
305
|
+
* Use to choose the order in which our chart colors are assigned to your data. Unspecified colors will be chosen after the ones you've provided here,
|
|
306
|
+
* so you don't need to provide a complete list of all possible colors.
|
|
307
|
+
* Please read the documentation for guidance on color usage.
|
|
308
|
+
*/
|
|
309
|
+
colorList?: ChartColor[];
|
|
310
|
+
/** @deprecated use colorList instead */
|
|
311
|
+
colors?: ChartColor[];
|
|
312
|
+
};
|
|
313
|
+
/**
|
|
314
|
+
* The allowed colors for data displayed on the chart.
|
|
315
|
+
*/
|
|
316
|
+
export type ChartColor = 'orange' | 'aqua' | 'purple' | 'yellow' | 'pink' | 'blue' | 'green' | 'darkOrange' | 'darkAqua' | 'darkPurple' | 'darkYellow' | 'darkPink' | 'darkBlue' | 'darkGreen';
|
|
180
317
|
/**
|
|
181
318
|
* The props type for {@link !components.DescriptionListItem}.
|
|
182
319
|
*
|
|
@@ -1351,6 +1488,10 @@ export interface StatisticsTrendProps {
|
|
|
1351
1488
|
* @defaultValue `"increase"`
|
|
1352
1489
|
*/
|
|
1353
1490
|
direction: 'increase' | 'decrease';
|
|
1491
|
+
/**
|
|
1492
|
+
* The color of the trend arrow.
|
|
1493
|
+
*/
|
|
1494
|
+
color?: 'red' | 'green';
|
|
1354
1495
|
}
|
|
1355
1496
|
/**
|
|
1356
1497
|
* The props type for {@link !components.StatisticsItem}.
|
|
@@ -1484,7 +1625,7 @@ export interface ExtensionCardContextData {
|
|
|
1484
1625
|
objectId: number | string;
|
|
1485
1626
|
objectTypeId: string;
|
|
1486
1627
|
location: keyof ExtensionPoints;
|
|
1487
|
-
appAccessLevel
|
|
1628
|
+
appAccessLevel: 'PRIVATE' | 'PUBLIC';
|
|
1488
1629
|
}
|
|
1489
1630
|
/** @ignore */
|
|
1490
1631
|
export type ExtensionPointAction = (...args: any[]) => Promise<any> | void;
|
package/dist/types.js
CHANGED
|
@@ -17,6 +17,11 @@ export class FormSubmitExtensionEvent extends ExtensionEvent {
|
|
|
17
17
|
this.targetValue = value;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
+
export const chartFieldTypes = {
|
|
21
|
+
datetime: 'datetime',
|
|
22
|
+
linear: 'linear',
|
|
23
|
+
category: 'category',
|
|
24
|
+
};
|
|
20
25
|
export const iconNames = {
|
|
21
26
|
success: 'success',
|
|
22
27
|
remove: 'remove',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/ui-extensions",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.32",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"typescript": "5.0.4"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "b592c6da355c4287b3498686743cdcbeb230e20b"
|
|
55
55
|
}
|