@hubspot/ui-extensions 0.4.0 → 0.6.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 +14 -7
- package/dist/coreComponents.d.ts +5 -4
- package/dist/coreComponents.js +1 -0
- package/dist/types.d.ts +13 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1051,7 +1051,7 @@ export interface ProgressBarProps {
|
|
|
1051
1051
|
aria-label?: string;
|
|
1052
1052
|
showPercentage?: boolean;
|
|
1053
1053
|
value?: number;
|
|
1054
|
-
|
|
1054
|
+
maxValue?: number;
|
|
1055
1055
|
valueDescription?: string;
|
|
1056
1056
|
variant?: 'success' | 'danger' | 'warning';
|
|
1057
1057
|
}
|
|
@@ -1062,7 +1062,7 @@ export interface ProgressBarProps {
|
|
|
1062
1062
|
| `title` | `string(optional)` | `N/A` | Text to be displayed in the progressbar title. |
|
|
1063
1063
|
| `showPercentage` | `boolean(optional)` | `false` | Toggles the display of the completion percentage. |
|
|
1064
1064
|
| `value` | `number(optional)` | `0` | The value of the progress indicator. |
|
|
1065
|
-
| `
|
|
1065
|
+
| `maxValue` | `number(optional)` | `100` | The maximum value of the progress bar. |
|
|
1066
1066
|
| `valueDescription` | `string(optional)` | `N/A` | Text that explains the current state of the `value` prop. Renders to the right of `title`. **Example: "10,000 of 7,500"** |
|
|
1067
1067
|
| `variant` | `'success' \| 'danger' \| 'warning'` | `'success'` | The type of progressbar to display. Defaults to success. |
|
|
1068
1068
|
| `aria-label` | `string(optional)` | `N/A` | Indicates the content of the ProgressBar to screen readers. Should be used if there's no title. |
|
|
@@ -1075,7 +1075,7 @@ const Extension = () => {
|
|
|
1075
1075
|
<ProgressBar
|
|
1076
1076
|
variant="warning"
|
|
1077
1077
|
value={50}
|
|
1078
|
-
|
|
1078
|
+
maxValue={200}
|
|
1079
1079
|
showPercentage={true}
|
|
1080
1080
|
/>
|
|
1081
1081
|
);
|
|
@@ -1565,12 +1565,16 @@ import { TableCell } from '@hubspot/ui-extensions';
|
|
|
1565
1565
|
```typescript
|
|
1566
1566
|
interface TableCellProps {
|
|
1567
1567
|
children: ReactNode;
|
|
1568
|
+
width?: 'min' | 'max' | 'auto' | number;
|
|
1569
|
+
align?: 'left' | 'center' | 'right';
|
|
1568
1570
|
}
|
|
1569
1571
|
```
|
|
1570
1572
|
|
|
1571
1573
|
| Prop | Type | Default | Description |
|
|
1572
1574
|
| --- | --- | --- | --- |
|
|
1573
1575
|
| `children` | `ReactNode` | `N/A` | Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components. |
|
|
1576
|
+
| `width` | `'min' \| 'max' \| 'auto' \| number` | `'auto'` | Sets the width of a table cell |
|
|
1577
|
+
| `align` | `'left' \| 'center' \| 'right'` | `'left'` | Sets the alignment of a table cell |
|
|
1574
1578
|
|
|
1575
1579
|
##### Usage
|
|
1576
1580
|
|
|
@@ -1713,13 +1717,16 @@ import { TableHeader } from '@hubspot/ui-extensions';
|
|
|
1713
1717
|
```typescript
|
|
1714
1718
|
interface TableHeaderProps {
|
|
1715
1719
|
children: ReactNode;
|
|
1720
|
+
width?: 'min' | 'max' | 'auto' | number;
|
|
1721
|
+
align?: 'left' | 'center' | 'right';
|
|
1716
1722
|
}
|
|
1717
1723
|
```
|
|
1718
1724
|
|
|
1719
1725
|
| Prop | Type | Default | Description |
|
|
1720
1726
|
| --- | --- | --- | --- |
|
|
1721
1727
|
| `children` | `ReactNode` | `N/A` | Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components. |
|
|
1722
|
-
|
|
1728
|
+
| `width` | `'min' \| 'max' \| 'auto' \| 'large'` | `'auto'` | Sets the width of a table header |
|
|
1729
|
+
| `align` | `'left' \| 'center' \| 'right'` | `'left'` | Sets the alignment of a table header |
|
|
1723
1730
|
##### Usage
|
|
1724
1731
|
|
|
1725
1732
|
```javascript
|
|
@@ -1728,14 +1735,14 @@ const Extension = () => {
|
|
|
1728
1735
|
<Table bordered={true}>
|
|
1729
1736
|
<TableHead>
|
|
1730
1737
|
<TableRow>
|
|
1731
|
-
<TableHeader>Name</TableHeader>
|
|
1732
|
-
<TableHeader>
|
|
1738
|
+
<TableHeader width={150} align="left">Name</TableHeader>
|
|
1739
|
+
<TableHeader>Price</TableHeader>
|
|
1733
1740
|
</TableRow>
|
|
1734
1741
|
</TableHead>
|
|
1735
1742
|
<TableBody>
|
|
1736
1743
|
<TableRow>
|
|
1737
1744
|
<TableCell>Roger Federer</TableCell>
|
|
1738
|
-
<TableCell
|
|
1745
|
+
<TableCell align="right">$1.50</TableCell>
|
|
1739
1746
|
</TableRow>
|
|
1740
1747
|
</TableBody>
|
|
1741
1748
|
</Table>
|
package/dist/coreComponents.d.ts
CHANGED
|
@@ -74,6 +74,7 @@ export declare const TextArea: "TextArea" & {
|
|
|
74
74
|
readonly props?: types.TextAreaProps | undefined;
|
|
75
75
|
readonly children?: true | undefined;
|
|
76
76
|
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"TextArea", types.TextAreaProps, true>>;
|
|
77
|
+
/** @deprecated use TextArea instead. With a capital A.*/
|
|
77
78
|
export declare const Textarea: "Textarea" & {
|
|
78
79
|
readonly type?: "Textarea" | undefined;
|
|
79
80
|
readonly props?: types.TextAreaProps | undefined;
|
|
@@ -146,9 +147,9 @@ export declare const TableFooter: "TableFooter" & {
|
|
|
146
147
|
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"TableFooter", types.TableElementProps, true>>;
|
|
147
148
|
export declare const TableCell: "TableCell" & {
|
|
148
149
|
readonly type?: "TableCell" | undefined;
|
|
149
|
-
readonly props?: types.
|
|
150
|
+
readonly props?: types.TableCellProps | undefined;
|
|
150
151
|
readonly children?: true | undefined;
|
|
151
|
-
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"TableCell", types.
|
|
152
|
+
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"TableCell", types.TableCellProps, true>>;
|
|
152
153
|
export declare const TableRow: "TableRow" & {
|
|
153
154
|
readonly type?: "TableRow" | undefined;
|
|
154
155
|
readonly props?: types.TableElementProps | undefined;
|
|
@@ -161,9 +162,9 @@ export declare const TableBody: "TableBody" & {
|
|
|
161
162
|
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"TableBody", types.TableElementProps, true>>;
|
|
162
163
|
export declare const TableHeader: "TableHeader" & {
|
|
163
164
|
readonly type?: "TableHeader" | undefined;
|
|
164
|
-
readonly props?: types.
|
|
165
|
+
readonly props?: types.TableHeaderProps | undefined;
|
|
165
166
|
readonly children?: true | undefined;
|
|
166
|
-
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"TableHeader", types.
|
|
167
|
+
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"TableHeader", types.TableHeaderProps, true>>;
|
|
167
168
|
export declare const TableHead: "TableHead" & {
|
|
168
169
|
readonly type?: "TableHead" | undefined;
|
|
169
170
|
readonly props?: types.TableElementProps | undefined;
|
package/dist/coreComponents.js
CHANGED
|
@@ -16,6 +16,7 @@ export const Link = createRemoteReactComponent('Link');
|
|
|
16
16
|
export const TextArea = createRemoteReactComponent('TextArea');
|
|
17
17
|
// Textarea was changed to TextArea
|
|
18
18
|
// Exporting both for backwards compat
|
|
19
|
+
/** @deprecated use TextArea instead. With a capital A.*/
|
|
19
20
|
export const Textarea = createRemoteReactComponent('Textarea');
|
|
20
21
|
export const LoadingSpinner = createRemoteReactComponent('LoadingSpinner');
|
|
21
22
|
export const ProgressBar = createRemoteReactComponent('ProgressBar');
|
package/dist/types.d.ts
CHANGED
|
@@ -96,7 +96,9 @@ export interface ProgressBarProps {
|
|
|
96
96
|
'aria-label'?: string;
|
|
97
97
|
showPercentage?: boolean;
|
|
98
98
|
value?: number;
|
|
99
|
+
/** @deprecated use maxValue instead */
|
|
99
100
|
valueMax?: number;
|
|
101
|
+
maxValue?: number;
|
|
100
102
|
valueDescription?: string;
|
|
101
103
|
variant?: 'success' | 'danger' | 'warning';
|
|
102
104
|
}
|
|
@@ -306,7 +308,9 @@ export interface ServerlessErrorResponse {
|
|
|
306
308
|
}
|
|
307
309
|
export interface ExtensionCardContextData {
|
|
308
310
|
cardId: string;
|
|
311
|
+
cardTitle?: string;
|
|
309
312
|
appId: number | string;
|
|
313
|
+
appName?: string;
|
|
310
314
|
objectId: number | string;
|
|
311
315
|
objectTypeId: string;
|
|
312
316
|
location: keyof ExtensionPoints;
|
|
@@ -403,6 +407,7 @@ export interface CrmStageTrackerProps {
|
|
|
403
407
|
objectId?: number;
|
|
404
408
|
objectTypeId?: string;
|
|
405
409
|
properties: Array<string>;
|
|
410
|
+
showProperties?: boolean;
|
|
406
411
|
}
|
|
407
412
|
interface CrmSidebarExtensionPoint extends ExtensionPointContract {
|
|
408
413
|
actions: {
|
|
@@ -444,9 +449,17 @@ export interface LoadingSpinnerProps {
|
|
|
444
449
|
size?: TShirtSizes['xs'] | TShirtSizes['sm'] | TShirtSizes['md'];
|
|
445
450
|
layout?: 'inline' | 'centered';
|
|
446
451
|
}
|
|
452
|
+
interface AlignmentProps {
|
|
453
|
+
align?: 'left' | 'center' | 'right';
|
|
454
|
+
}
|
|
455
|
+
interface WidthProps {
|
|
456
|
+
width?: 'min' | 'max' | 'auto' | number;
|
|
457
|
+
}
|
|
447
458
|
export interface TableElementProps {
|
|
448
459
|
children: React.ReactNode;
|
|
449
460
|
}
|
|
461
|
+
export type TableHeaderProps = TableElementProps & AlignmentProps & WidthProps;
|
|
462
|
+
export type TableCellProps = TableElementProps & AlignmentProps & WidthProps;
|
|
450
463
|
interface BaseTableProps {
|
|
451
464
|
bordered?: boolean;
|
|
452
465
|
flush?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/ui-extensions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.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": "1979c2dce0a920c10e4f8b5ec3bc16a1080120cb"
|
|
52
52
|
}
|