@hubspot/ui-extensions 0.10.0 → 0.10.1
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/coreComponents.d.ts +12 -0
- package/dist/coreComponents.js +8 -0
- package/dist/crm/hooks/useAssociations.d.ts +3 -0
- package/dist/crm/hooks/useAssociations.js +3 -5
- package/dist/crm/hooks/useCrmProperties.d.ts +0 -2
- package/dist/crm/hooks/useCrmProperties.js +0 -7
- package/dist/experimental/index.d.ts +1 -7
- package/dist/experimental/index.js +1 -3
- package/dist/experimental/types.d.ts +0 -9
- package/dist/types.d.ts +39 -0
- package/package.json +2 -2
package/dist/coreComponents.d.ts
CHANGED
|
@@ -830,3 +830,15 @@ export declare const CurrencyInput: "CurrencyInput" & {
|
|
|
830
830
|
readonly props?: types.InlineProps | undefined;
|
|
831
831
|
readonly children?: true | undefined;
|
|
832
832
|
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Inline", types.InlineProps, true>>;
|
|
833
|
+
/**
|
|
834
|
+
* The `AutoGrid` component renders a responsive grid layout that automatically adjusts the number of columns based on available space. Use this component to create flexible grid layouts for cards, tiles, or other content.
|
|
835
|
+
*
|
|
836
|
+
* **Links:**
|
|
837
|
+
*
|
|
838
|
+
* - {@link https://developers.hubspot.com/docs/reference/ui-components/standard-components/simple-grid Docs}
|
|
839
|
+
*/
|
|
840
|
+
export declare const AutoGrid: "AutoGrid" & {
|
|
841
|
+
readonly type?: "AutoGrid" | undefined;
|
|
842
|
+
readonly props?: types.AutoGridProps | undefined;
|
|
843
|
+
readonly children?: true | undefined;
|
|
844
|
+
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"AutoGrid", types.AutoGridProps, true>>;
|
package/dist/coreComponents.js
CHANGED
|
@@ -558,3 +558,11 @@ export const CurrencyInput = createRemoteReactComponent('CurrencyInput');
|
|
|
558
558
|
*
|
|
559
559
|
* - {@link https://developers.hubspot.com/docs/reference/ui-components/standard-components/inline Docs}
|
|
560
560
|
*/ export const Inline = createRemoteReactComponent('Inline');
|
|
561
|
+
/**
|
|
562
|
+
* The `AutoGrid` component renders a responsive grid layout that automatically adjusts the number of columns based on available space. Use this component to create flexible grid layouts for cards, tiles, or other content.
|
|
563
|
+
*
|
|
564
|
+
* **Links:**
|
|
565
|
+
*
|
|
566
|
+
* - {@link https://developers.hubspot.com/docs/reference/ui-components/standard-components/simple-grid Docs}
|
|
567
|
+
*/
|
|
568
|
+
export const AutoGrid = createRemoteReactComponent('AutoGrid');
|
|
@@ -19,4 +19,7 @@ export interface UseAssociationsResult {
|
|
|
19
19
|
isLoading: boolean;
|
|
20
20
|
pagination: UseAssociationsPagination;
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* A hook to fetch and manage associations between CRM objects with pagination support.
|
|
24
|
+
*/
|
|
22
25
|
export declare function useAssociations(config: Omit<FetchAssociationsRequest, 'offset'>, options?: UseAssociationsOptions): UseAssociationsResult;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useEffect, useReducer, useMemo, useRef, useCallback } from 'react';
|
|
2
|
-
import { logger } from '../../logger';
|
|
3
2
|
import { fetchAssociations, DEFAULT_PAGE_SIZE, calculatePaginationFlags, } from '../utils/fetchAssociations';
|
|
4
3
|
function createInitialState(pageSize) {
|
|
5
4
|
return {
|
|
@@ -80,13 +79,12 @@ function associationsReducer(state, action) {
|
|
|
80
79
|
}
|
|
81
80
|
}
|
|
82
81
|
const DEFAULT_OPTIONS = {};
|
|
82
|
+
/**
|
|
83
|
+
* A hook to fetch and manage associations between CRM objects with pagination support.
|
|
84
|
+
*/
|
|
83
85
|
export function useAssociations(config, options = DEFAULT_OPTIONS) {
|
|
84
86
|
const pageSize = config?.pageLength ?? DEFAULT_PAGE_SIZE;
|
|
85
87
|
const [state, dispatch] = useReducer(associationsReducer, useMemo(() => createInitialState(pageSize), [pageSize]));
|
|
86
|
-
// Log experimental warning once on mount
|
|
87
|
-
useEffect(() => {
|
|
88
|
-
logger.warn('useAssociations is an experimental hook and might change or be removed in the future.');
|
|
89
|
-
}, []);
|
|
90
88
|
/**
|
|
91
89
|
* HOOK OPTIMIZATION:
|
|
92
90
|
*
|
|
@@ -6,7 +6,5 @@ export interface CrmPropertiesState {
|
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* A hook for using and managing CRM properties.
|
|
9
|
-
*
|
|
10
|
-
* @experimental This hook is experimental and might change or be removed in future versions.
|
|
11
9
|
*/
|
|
12
10
|
export declare function useCrmProperties(propertyNames: string[], options?: FetchCrmPropertiesOptions): CrmPropertiesState;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useEffect, useReducer, useMemo, useRef } from 'react';
|
|
2
|
-
import { logger } from '../../logger';
|
|
3
2
|
import { fetchCrmProperties, } from '../utils/fetchCrmProperties';
|
|
4
3
|
const initialState = {
|
|
5
4
|
properties: {},
|
|
@@ -35,15 +34,9 @@ function crmPropertiesReducer(state, action) {
|
|
|
35
34
|
const DEFAULT_OPTIONS = {};
|
|
36
35
|
/**
|
|
37
36
|
* A hook for using and managing CRM properties.
|
|
38
|
-
*
|
|
39
|
-
* @experimental This hook is experimental and might change or be removed in future versions.
|
|
40
37
|
*/
|
|
41
38
|
export function useCrmProperties(propertyNames, options = DEFAULT_OPTIONS) {
|
|
42
39
|
const [state, dispatch] = useReducer(crmPropertiesReducer, initialState);
|
|
43
|
-
// Log experimental warning once on mount
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
logger.warn('useCrmProperties is an experimental hook and might change or be removed in the future.');
|
|
46
|
-
}, []);
|
|
47
40
|
/**
|
|
48
41
|
* HOOK OPTIMIZATION:
|
|
49
42
|
*
|
|
@@ -27,12 +27,6 @@ declare const Center: "Center" & {
|
|
|
27
27
|
readonly children?: true | undefined;
|
|
28
28
|
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Center", experimentalTypes.CenterProps, true>>;
|
|
29
29
|
/** @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. */
|
|
30
|
-
declare const SimpleGrid: "SimpleGrid" & {
|
|
31
|
-
readonly type?: "SimpleGrid" | undefined;
|
|
32
|
-
readonly props?: experimentalTypes.SimpleGridProps | undefined;
|
|
33
|
-
readonly children?: true | undefined;
|
|
34
|
-
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"SimpleGrid", experimentalTypes.SimpleGridProps, true>>;
|
|
35
|
-
/** @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. */
|
|
36
30
|
declare const Grid: "Grid" & {
|
|
37
31
|
readonly type?: "Grid" | undefined;
|
|
38
32
|
readonly props?: experimentalTypes.GridProps | undefined;
|
|
@@ -78,4 +72,4 @@ declare const FileInput: "FileInput" & {
|
|
|
78
72
|
readonly props?: experimentalTypes.FileInputProps | undefined;
|
|
79
73
|
readonly children?: true | undefined;
|
|
80
74
|
} & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"FileInput", experimentalTypes.FileInputProps, true>>;
|
|
81
|
-
export { Iframe, MediaObject, Stack2, Center,
|
|
75
|
+
export { Iframe, MediaObject, Stack2, Center, GridItem, Grid, SettingsView, ExpandableText, Popover, FileInput, };
|
|
@@ -12,8 +12,6 @@ const Stack2 = createRemoteReactComponent('Stack2');
|
|
|
12
12
|
/** @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. */
|
|
13
13
|
const Center = createRemoteReactComponent('Center');
|
|
14
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
|
-
const SimpleGrid = createRemoteReactComponent('SimpleGrid');
|
|
16
|
-
/** @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. */
|
|
17
15
|
const Grid = createRemoteReactComponent('Grid');
|
|
18
16
|
/** @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. */
|
|
19
17
|
const GridItem = createRemoteReactComponent('GridItem');
|
|
@@ -35,4 +33,4 @@ const ExpandableText = createRemoteReactComponent('ExpandableText');
|
|
|
35
33
|
*/
|
|
36
34
|
const Popover = createRemoteReactComponent('Popover');
|
|
37
35
|
const FileInput = createRemoteReactComponent('FileInput');
|
|
38
|
-
export { Iframe, MediaObject, Stack2, Center,
|
|
36
|
+
export { Iframe, MediaObject, Stack2, Center, GridItem, Grid, SettingsView, ExpandableText, Popover, FileInput, };
|
|
@@ -48,15 +48,6 @@ export interface MediaObjectProps {
|
|
|
48
48
|
itemLeft?: RemoteFragment;
|
|
49
49
|
itemRight?: RemoteFragment;
|
|
50
50
|
}
|
|
51
|
-
/**
|
|
52
|
-
* @ignore
|
|
53
|
-
* @experimental do not use in production
|
|
54
|
-
*/
|
|
55
|
-
export interface SimpleGridProps extends BaseLayout {
|
|
56
|
-
minColumnWidth: number | string;
|
|
57
|
-
gap?: AllDistances;
|
|
58
|
-
children?: ReactNode;
|
|
59
|
-
}
|
|
60
51
|
export interface GridProps {
|
|
61
52
|
justify?: FlexJustify;
|
|
62
53
|
align?: FlexAlign;
|
package/dist/types.d.ts
CHANGED
|
@@ -720,6 +720,7 @@ export interface DropdownProps {
|
|
|
720
720
|
*/
|
|
721
721
|
disabled?: boolean;
|
|
722
722
|
}
|
|
723
|
+
export type EmptyStateImageName = 'addOnReporting' | 'announcement' | 'api' | 'automatedTesting' | 'beta' | 'building' | 'callingSetUp' | 'companies' | 'components' | 'cone' | 'contacts' | 'contentStrategy' | 'customObjects' | 'customerExperience' | 'customerSupport' | 'deals' | 'developerSecurityUpdate' | 'electronicSignature' | 'electronicSignatureEmptyState' | 'emailConfirmation' | 'emptyStateCharts' | 'idea' | 'integrations' | 'leads' | 'lock' | 'meetings' | 'missedGoal' | 'multipleObjects' | 'object' | 'productsShoppingCart' | 'registration' | 'sandboxAddOn' | 'social' | 'store' | 'storeDisabled' | 'successfullyConnectedEmail' | 'target' | 'task' | 'tickets' | 'voteAndSearch';
|
|
723
724
|
/**
|
|
724
725
|
* The props type for {@link !components.EmptyState}.
|
|
725
726
|
*
|
|
@@ -762,6 +763,12 @@ export interface EmptyStateProps {
|
|
|
762
763
|
* @defaultValue `250`
|
|
763
764
|
*/
|
|
764
765
|
imageWidth?: number;
|
|
766
|
+
/**
|
|
767
|
+
* The name of the image to display.
|
|
768
|
+
*
|
|
769
|
+
* @defaultValue `"emptyStateCharts"`
|
|
770
|
+
*/
|
|
771
|
+
imageName?: EmptyStateImageName;
|
|
765
772
|
}
|
|
766
773
|
/**
|
|
767
774
|
* The props type for {@link !components.ErrorState}.
|
|
@@ -1448,6 +1455,38 @@ export interface InlineProps {
|
|
|
1448
1455
|
*/
|
|
1449
1456
|
gap?: AllDistances;
|
|
1450
1457
|
}
|
|
1458
|
+
/**
|
|
1459
|
+
* The props type for {@link !components.AutoGrid}.
|
|
1460
|
+
*
|
|
1461
|
+
* @category Component Props
|
|
1462
|
+
*/
|
|
1463
|
+
export interface AutoGridProps {
|
|
1464
|
+
/**
|
|
1465
|
+
* Sets the width of each column in the grid.
|
|
1466
|
+
* 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.
|
|
1467
|
+
* When `flexible` is false, columns are exactly this width.
|
|
1468
|
+
*/
|
|
1469
|
+
columnWidth: number;
|
|
1470
|
+
/**
|
|
1471
|
+
* Sets the spacing between grid items.
|
|
1472
|
+
*
|
|
1473
|
+
* @defaultValue `"flush"`
|
|
1474
|
+
*/
|
|
1475
|
+
gap?: AllDistances;
|
|
1476
|
+
/**
|
|
1477
|
+
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components.
|
|
1478
|
+
*
|
|
1479
|
+
*/
|
|
1480
|
+
children?: ReactNode;
|
|
1481
|
+
/**
|
|
1482
|
+
* Whether columns should expand to fill available space.
|
|
1483
|
+
* When true, columns will be at least `columnWidth` but grow equally to fill the container.
|
|
1484
|
+
* When false, columns are exactly `columnWidth`.
|
|
1485
|
+
*
|
|
1486
|
+
* @defaultValue `false`
|
|
1487
|
+
*/
|
|
1488
|
+
flexible?: boolean;
|
|
1489
|
+
}
|
|
1451
1490
|
/**
|
|
1452
1491
|
* The props type for {@link !components.Link}.
|
|
1453
1492
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/ui-extensions",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"tsd": {
|
|
73
73
|
"directory": "src/__tests__/test-d"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "d3300e12daf61bc1931da0e79d62aede9675a750"
|
|
76
76
|
}
|