@hubspot/ui-extensions 0.0.1-beta.0 → 0.0.1-beta.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/README.md CHANGED
@@ -19,6 +19,7 @@ React components and utilities for extending HubSpot's UI.
19
19
  - [Input](#input)
20
20
  - [Link](#link)
21
21
  - [LoadingSpinner](#loadingspinner)
22
+ - [NumberInput](#numberInput)
22
23
  - [ProgressBar](#progressbar)
23
24
  - [Select](#select)
24
25
  - [Stack](#stack)
@@ -55,7 +56,6 @@ The Alert component accepts the following props:
55
56
  ```typescript
56
57
  export interface AlertProps {
57
58
  title: string;
58
- body?: string;
59
59
  children?: ReactNode;
60
60
  variant?: 'info' | 'warning' | 'success' | 'error' | 'danger';
61
61
  }
@@ -64,7 +64,6 @@ export interface AlertProps {
64
64
  | Prop | Type | Default | Description |
65
65
  | --- | --- | --- | --- |
66
66
  | `title` | `string` | `N/A` | The title text for the alert message. |
67
- | `body` | `string(optional)` | `N/A` | The main content of the alert message. If not provided, the children prop is used. |
68
67
  | `children` | `ReactNode(optional)` | `N/A` | The main content of the alert message when the body prop is not provided. |
69
68
  | `variant` | `'info' \| 'warning' \| 'success' \|'error' \| 'danger'` `(optional)` | `'info'` | Sets the color variation of the alert |
70
69
 
@@ -77,22 +76,18 @@ const Extension = () => {
77
76
  <Alert title="Important Info" variant="info">
78
77
  This is an informative message.
79
78
  </Alert>
80
- <Alert
81
- title="Success"
82
- body="Operation completed successfully."
83
- variant="success"
84
- />
85
- <Alert title="Warning" body="Proceed with caution." variant="warning" />
86
- <Alert
87
- title="Error"
88
- body="Something went wrong. Please try again."
89
- variant="error"
90
- />
91
- <Alert
92
- title="Danger"
93
- body="This action cannot be undone. Be careful."
94
- variant="danger"
95
- />
79
+ <Alert title="Success"variant="success">
80
+ Operation completed successfully.
81
+ </Alert>
82
+ <Alert title="Warning" variant="warning" >
83
+ Proceed with caution.
84
+ </Alert>
85
+ <Alert title="Error" variant="error" >
86
+ Something went wrong. Please try again.
87
+ </Alert>
88
+ <Alert title="Danger" variant="danger" >
89
+ This action cannot be undone. Be careful.
90
+ </Alert>
96
91
  </>
97
92
  );
98
93
  };
@@ -712,7 +707,7 @@ import { LoadingSpinner } from '@hubspot/ui-extensions';
712
707
  export interface LoadingSpinnerProps {
713
708
  label: string;
714
709
  showLabel?: boolean;
715
- size?: 'xs' | 'sm' | 'md';
710
+ size?: 'xs' | 'extra-small' | 'sm' | 'small' | 'md' | 'medium';
716
711
  layout?: 'inline' | 'centered';
717
712
  }
718
713
  ```
@@ -721,7 +716,7 @@ export interface LoadingSpinnerProps {
721
716
  | --- | --- | --- | --- |
722
717
  | `label` | `string` | `N/A` | The companion text for the loading spinner. |
723
718
  | `showLabel` | `boolean(optional)` | `false` | if `true`, the label will be visible alongside the loading spinner. |
724
- | `size` | `'xs'\| 'sm' \| 'md'` `(optional)` | `'sm'` | The size of the loading spinner icon. |
719
+ | `size` | `'xs' \| 'sm' \| 'md' \| 'extra-small' \| 'small' \| 'medium'` `(optional)` | `'sm'` | The size of the loading spinner icon. |
725
720
  | `layout` | `'inline'\| 'centered'` `(optional)` | `N/A` | Use the `centered` option for layout as a convenience for the common pattern of filling the space of its parent. |
726
721
 
727
722
  ##### Usage
@@ -731,6 +726,79 @@ const Extension = () => {
731
726
  return <LoadingSpinner label="Loading..." />;
732
727
  };
733
728
  ```
729
+ ### NumberInput
730
+
731
+ ##### Import
732
+
733
+ ```javascript
734
+ import { NumberInput } from '@hubspot/ui-extensions';
735
+ ```
736
+
737
+ ##### Props
738
+
739
+ ```typescript
740
+ export interface NumberInputProps {
741
+ label: string;
742
+ name: string;
743
+ value?: number;
744
+ required?: boolean;
745
+ readOnly?: boolean;
746
+ description?: string;
747
+ tooltip?: string;
748
+ placeholder?: string;
749
+ error?: boolean;
750
+ defaultValue?: number;
751
+ validationMessage?: string;
752
+ onChange?: (value: number) => void;
753
+ onInput?: (value: number) => void;
754
+ onBlur?: (value: number) => void;
755
+ onFocus?: (value: number) => void;
756
+ min?: number;
757
+ max?: number;
758
+ precision?: number;
759
+ formatStyle?: 'decimal' | 'percentage';
760
+ }
761
+ ```
762
+
763
+ | Prop | Type | Default | Description |
764
+ | --- | --- | --- | --- |
765
+ | `label` | `string` | `N/A` | The label text to display for the form input element |
766
+ | `name` | `string` | `N/A` | The unique identifier for the input element, this could be thought of as the HTML5 [Input element's name attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name) |
767
+ | `value` | `number(optional)` | `''` | The value of the input |
768
+ | `required` | `boolean(optional)` | `false` | Determines if the required indicator should be displayed |
769
+ | `readOnly` | `boolean(optional)` | `false` | Determines if the field is editable or not. |
770
+ | `description` | `string(optional)` | `N/A` | Instructional message to display to the user to help understand the purpose of the input. |
771
+ | `tooltip` | `string(optional)` | `N/A` | Text that will appear in a tooltip next to the input label. |
772
+ | `placeholder` | `string(optional)` | `N/A` | Text that appears in the input when it has no value set. |
773
+ | `error` | `boolean(optional)` | `false` | If set to true, `validationMessage` is displayed as an error message, if it was provided. The input will also render it's error state to let the user know there is an error. If false, `validationMessage` is displayed as a success message. |
774
+ | `validationMessage` | `string(optional)` | `''` | The text to show if the input has an error. |
775
+ | `onChange` | `(value: number) => void(optional)` | `N/A` | A callback function that is invoked when the value is committed. Currently these times are `onBlur` of the input and when the user submits the form. |
776
+ | `onInput` | `(value: number) => void(optional)` | `N/A` | A function that is called and passed the value every time the field is edited by the user. It is recommended that you do not use this value to update state, that is what `onChange` should be used for. Instead this should be used for validation. |
777
+ | `onBlur` | `(value: number) => void(optional)` | `N/A` | A function that is called and passed the value every time the field loses focus. |
778
+ | `onFocus` | `(value: number) => void(optional)` | `N/A` | A function that is called and passed the value every time the field gets focused. |
779
+ | `min` | `number(optional)` | `N/A` | Sets the lower bound of your input. |
780
+ | `max` | `number(optional)` | `N/A` | Sets the upper bound of your input. |
781
+ | `precision` | `number(optional)` | `N/A` | Represents the number of digits to the right of the decimal point. |
782
+ | `precision` | `number(optional)` | `N/A` | Represents the number of digits to the right of the decimal point. |
783
+ | `formatStyle` | `'decimal' \| 'percentage'` | `'decimal'` | Formats the input as a decimal point number or a percentage. |
784
+
785
+ ##### Usage
786
+
787
+ ```javascript
788
+ const Extension = () => {
789
+ const [portalCount, setPortalCount] = useState(0);
790
+ return (
791
+ <NumberInput
792
+ label={'HubSpot Portal Count'}
793
+ name="portalsNumber"
794
+ description={'Number of active portals'}
795
+ placeholder={'number of portals'}
796
+ value={portalCount}
797
+ onChange={value => setPortalCount(value)}
798
+ />
799
+ );
800
+ };
801
+ ```
734
802
 
735
803
  ### ProgressBar
736
804
 
@@ -875,7 +943,18 @@ import { Stack } from '@hubspot/ui-extensions';
875
943
 
876
944
  ```typescript
877
945
  interface StackProps {
878
- distance?: 'flush' | 'small' | 'extra-small' | 'medium' | 'large';
946
+ distance?:
947
+ | 'flush'
948
+ | 'small'
949
+ | 'extra-small'
950
+ | 'medium'
951
+ | 'large'
952
+ | 'extra-large'
953
+ | 'xs'
954
+ | 'sm'
955
+ | 'md'
956
+ | 'lg'
957
+ | 'xl';
879
958
  direction?: 'row' | 'column';
880
959
  children?: ReactNode;
881
960
  }
@@ -883,7 +962,7 @@ interface StackProps {
883
962
 
884
963
  | Prop | Type | Default | Description |
885
964
  | --- | --- | --- | --- |
886
- | `distance` | `'flush' \| 'extra-small' \| 'small' \| 'medium' \| 'large'` | `'small'` | Amount of space between each child component passed as children |
965
+ | `distance` | `'flush' \| 'extra-small' \| 'small' \| 'medium' \| 'large' \| 'extra-large' \| 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'small'` | Amount of space between each child component passed as children |
887
966
  | `direction` | `'row' \| 'column'` | `'column'` | Stacks elements in the vertical or horizontal direction. |
888
967
  | `children` | `ReactNode` | `N/A` | Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components. |
889
968
 
@@ -1465,29 +1544,37 @@ import { Text } from '@hubspot/ui-extensions';
1465
1544
  ##### Props
1466
1545
 
1467
1546
  ```typescript
1468
- interface TextProps {
1469
- format?: 'plaintext' | 'markdown';
1547
+ export interface TextFormatOptions {
1548
+ fontWeight?: 'regular' | 'bold' | 'demibold';
1549
+ italic?: boolean;
1550
+ lineDecoration?: 'none' | 'underline' | 'strikethrough';
1551
+ }
1552
+
1553
+ export type TextProps = {
1470
1554
  variant?: 'bodytext' | 'microcopy';
1555
+ inline?: boolean;
1471
1556
  children: ReactNode;
1472
- tagName?: 'p' | 'span' | 'small';
1473
- }
1557
+ format?: TextFormatOptions;
1558
+ };
1474
1559
  ```
1475
1560
 
1476
1561
  | Prop | Type | Default | Description |
1477
1562
  | --- | --- | --- | --- |
1478
- | `format` | `'plaintext' \| 'markdown'` `(optional)` | `'plaintext'` | Type of formatting for the display text. |
1563
+ | `format` | `'TextFormatOptions'` `(optional)` | `N/A` | Type of formatting options for the text. |
1479
1564
  | `children` | `string` | `N/A` | Text to be displayed as body text. |
1480
1565
  | `variant` | `'bodytext' \| 'microcopy'` | `'bodytext'` | Type of text to display |
1481
1566
  | `tagName` | `'p' \| 'small' \| 'span'` | `'bodytext'` | Type of text element(tag) to display. |
1567
+ | `inline` | `boolean(optional)` | `false` | If `false` the text component will not insert a line break. |
1482
1568
 
1483
- #### Markdown
1569
+ #### Format Options
1484
1570
 
1485
- Markdown syntax supported in the component:
1571
+ - bold text: `{ fontWeight: 'bold' }`
1572
+ - semibold text: `{ fontWeight: 'demibold' }`
1573
+ - italicized text: `{ italic: true }`
1574
+ - strikethrough text: `{ lineDecoration: 'strikethrough' }`
1575
+ - underlined text: `{ lineDecoration: 'underline' }`
1576
+ - inline text: `<Text inline={true}/>`
1486
1577
 
1487
- - bold text: `**like this**` or `__like this__`
1488
- - italicized text: `*like this*` or `_like this_`
1489
- - inline code: `` `like this` ``
1490
- - links: `[visible anchor text](https://www.hubspot.com/)`
1491
1578
 
1492
1579
  ##### Usage
1493
1580
 
@@ -1495,10 +1582,21 @@ Markdown syntax supported in the component:
1495
1582
  const Extension = () => {
1496
1583
  return (
1497
1584
  <>
1498
- <Text format="markdown">**Bold**</Text>
1499
- <Text format="markdown">*Italics*</Text>
1500
- <Text>**Not Bold because format isn't markdown**</Text>
1501
- <Text variant="microcopy">This is going to be small</Text>
1585
+ <Text>Plain text</Text>
1586
+ <Text format={{ fontWeight: 'bold' }}>Bold</Text>
1587
+ <Text format={{ italic: true }}>Italics</Text>
1588
+ <Text format={{ fontWeight: 'bold', italic: true }}>
1589
+ Bold and Italic text
1590
+ </Text>
1591
+ <Text format={{ lineDecoration: 'strikethrough' }}>
1592
+ Strikethrough Text
1593
+ </Text>
1594
+ <Text variant="microcopy">
1595
+ Microcopy text
1596
+ <Text inline={true} format={{ fontWeight: 'bold' }}>
1597
+ with inner bold
1598
+ </Text>
1599
+ </Text>
1502
1600
  </>
1503
1601
  );
1504
1602
  };
@@ -1,4 +1,4 @@
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 } 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,9 @@ 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, true>>;
66
+ } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Input", InputProps<string>, true>>;
67
67
  declare const Textarea: "Textarea" & {
68
68
  readonly type?: "Textarea" | undefined;
69
69
  readonly props?: TextareaProps | undefined;
@@ -164,4 +164,14 @@ declare const Link: "Link" & {
164
164
  readonly props?: LinkProps | undefined;
165
165
  readonly children?: true | undefined;
166
166
  } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"Link", LinkProps, true>>;
167
- export { Alert, 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, };
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, };
@@ -32,4 +32,6 @@ const TableBody = createRemoteReactComponent('TableBody');
32
32
  const TableHeader = createRemoteReactComponent('TableHeader');
33
33
  const TableHead = createRemoteReactComponent('TableHead');
34
34
  const Link = createRemoteReactComponent('Link');
35
- export { Alert, 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, };
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, };
@@ -1,4 +1,9 @@
1
- import { CrmAssociationPivotProps, CrmAssociationTableProps, CrmDataHighlightProps, CrmPropertyListProps, CrmReportProps } from '../types';
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;
@@ -24,4 +29,9 @@ declare const CrmAssociationPivot: "CrmAssociationPivot" & {
24
29
  readonly props?: CrmAssociationPivotProps | undefined;
25
30
  readonly children?: true | undefined;
26
31
  } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"CrmAssociationPivot", CrmAssociationPivotProps, true>>;
27
- export { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, };
32
+ declare const CrmAssociationPropertyList: "CrmAssociationPropertyList" & {
33
+ readonly type?: "CrmAssociationPropertyList" | undefined;
34
+ readonly props?: CrmAssociationPropertyListProps | undefined;
35
+ readonly children?: true | undefined;
36
+ } & import("@remote-ui/react").ReactComponentTypeFromRemoteComponentType<import("@remote-ui/types").RemoteComponentType<"CrmAssociationPropertyList", CrmAssociationPropertyListProps, true>>;
37
+ export { CrmObjectProperty, CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmAssociationPropertyList, };
@@ -1,7 +1,9 @@
1
1
  import { createExtensionComponent } from '../utils/createExtensionComponent';
2
+ const CrmObjectProperty = createExtensionComponent('CrmObjectProperty');
2
3
  const CrmPropertyList = createExtensionComponent('CrmPropertyList');
3
4
  const CrmAssociationTable = createExtensionComponent('CrmAssociationTable');
4
5
  const CrmDataHighlight = createExtensionComponent('CrmDataHighlight');
5
6
  const CrmReport = createExtensionComponent('CrmReport');
6
7
  const CrmAssociationPivot = createExtensionComponent('CrmAssociationPivot');
7
- export { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, };
8
+ const CrmAssociationPropertyList = createExtensionComponent('CrmAssociationPropertyList');
9
+ export { CrmObjectProperty, CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, CrmAssociationPropertyList, };
@@ -1,2 +1,2 @@
1
- import { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot } from './components';
2
- export { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, };
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, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, } from './components';
2
- export { CrmPropertyList, CrmAssociationTable, CrmDataHighlight, CrmReport, CrmAssociationPivot, };
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, Textarea, Tile, ToggleGroup, Link, } 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, Textarea, Tile, ToggleGroup, Link, } 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,7 +1,6 @@
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
  }
@@ -29,7 +28,7 @@ export interface DescriptionListProps {
29
28
  direction?: 'row' | 'column';
30
29
  }
31
30
  export interface DividerProps {
32
- distance?: 'flush' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';
31
+ distance?: AllDistances;
33
32
  }
34
33
  export interface EmptyStateProps {
35
34
  flush?: boolean;
@@ -61,21 +60,22 @@ export interface ImageProps {
61
60
  src: string;
62
61
  width?: number;
63
62
  }
64
- export interface InputProps {
63
+ export interface InputProps<T = string> {
65
64
  label: string;
66
65
  name: string;
67
- value?: string;
66
+ value?: T;
68
67
  required?: boolean;
69
68
  readOnly?: boolean;
70
69
  description?: string;
71
70
  tooltip?: string;
72
71
  placeholder?: string;
73
72
  error?: boolean;
73
+ defaultValue?: T;
74
74
  validationMessage?: string;
75
- onChange?: (value: string) => void;
76
- onInput?: (value: string) => void;
77
- onBlur?: (value: string) => void;
78
- onFocus?: (value: string) => void;
75
+ onChange?: (value: T) => void;
76
+ onInput?: (value: T) => void;
77
+ onBlur?: (value: T) => void;
78
+ onFocus?: (value: T) => void;
79
79
  }
80
80
  export interface TextareaProps extends InputProps {
81
81
  cols?: number;
@@ -83,6 +83,12 @@ export interface TextareaProps extends InputProps {
83
83
  rows?: number;
84
84
  resize?: 'vertical' | 'horizontal' | 'both' | 'none';
85
85
  }
86
+ export interface NumberInputProps extends InputProps<number> {
87
+ min?: number;
88
+ max?: number;
89
+ precision?: number;
90
+ formatStyle?: 'decimal' | 'percentage';
91
+ }
86
92
  export interface ProgressBarProps {
87
93
  title?: string;
88
94
  showPercentage?: boolean;
@@ -194,9 +200,12 @@ export interface Context {
194
200
  portal: PortalContext;
195
201
  }
196
202
  export interface StackProps {
197
- distance?: 'flush' | 'small' | 'extra-small' | 'medium' | 'large';
203
+ distance?: AllDistances;
198
204
  children?: React.ReactNode;
199
205
  direction?: 'row' | 'column';
206
+ justify?: 'center' | 'end' | 'start';
207
+ align?: 'start' | 'center' | 'baseline' | 'end' | 'stretch';
208
+ width?: 'auto' | '100%';
200
209
  }
201
210
  export interface StatisticsTrendProps {
202
211
  value: string;
@@ -310,10 +319,12 @@ export interface CrmMiddleExtensionPoint extends ExtensionPointContract {
310
319
  CrmDataHighlight: ComponentType<CrmDataHighlightProps>;
311
320
  CrmReport: ComponentType<CrmReportProps>;
312
321
  CrmAssociationPivot: ComponentType<CrmAssociationPivotProps>;
322
+ CrmObjectProperty?: ComponentType<CrmObjectPropertyProps>;
323
+ CrmAssociationPropertyList?: ComponentType<CrmAssociationPropertyListProps>;
313
324
  };
314
325
  }
315
326
  export interface CrmDataHighlightProps {
316
- properties: string[];
327
+ properties: Array<string>;
317
328
  objectTypeId?: string;
318
329
  objectId?: number;
319
330
  }
@@ -321,17 +332,22 @@ export interface CrmReportProps {
321
332
  reportId: string;
322
333
  }
323
334
  export interface CrmPropertyListProps {
324
- properties: string[];
335
+ properties: Array<string>;
325
336
  direction?: string;
326
337
  objectTypeId?: string;
327
338
  objectId?: number;
328
339
  }
340
+ export interface CrmObjectPropertyProps {
341
+ properties: Array<string>;
342
+ objectTypeId?: string;
343
+ objectId?: number;
344
+ }
329
345
  type CrmSortDescriptor = {
330
346
  columnName: string;
331
347
  direction: 1 | -1;
332
348
  };
333
349
  interface CrmSearchFilter {
334
- operator: 'EQ' | 'NEQ' | 'LT' | 'LTE' | 'GT' | 'GTE' | 'BETWEEN' | 'IN' | 'NOT_IN' | 'HAS_PROPERTY' | 'NOT_HAS_PROPERTY' | 'ROLLING_DATE_RANGE' | 'TIME_UNIT_TO_DATE';
350
+ operator: 'EQ' | 'NEQ' | 'LT' | 'LTE' | 'GT' | 'GTE' | 'BETWEEN' | 'IN' | 'NOT_IN' | 'HAS_PROPERTY' | 'NOT_HAS_PROPERTY';
335
351
  value?: string | number;
336
352
  values?: string | number;
337
353
  highValue?: string | number;
@@ -354,6 +370,13 @@ export interface CrmAssociationPivotProps {
354
370
  preFilters?: Array<CrmSearchFilter>;
355
371
  sort?: Array<CrmSortDescriptor>;
356
372
  }
373
+ export interface CrmAssociationPropertyListProps {
374
+ objectTypeId: string;
375
+ properties: Array<string>;
376
+ associationLabels?: Array<string>;
377
+ filters?: Array<CrmSearchFilter>;
378
+ sort?: Array<CrmSortDescriptor>;
379
+ }
357
380
  interface CrmSidebarExtensionPoint extends ExtensionPointContract {
358
381
  actions: {
359
382
  reloadPage: ReloadPageAction;
@@ -391,7 +414,7 @@ interface OpenIframeActionPayload {
391
414
  export interface LoadingSpinnerProps {
392
415
  label: string;
393
416
  showLabel?: boolean;
394
- size?: 'xs' | 'sm' | 'md';
417
+ size?: TShirtSizes['xs'] | TShirtSizes['sm'] | TShirtSizes['md'];
395
418
  layout?: 'inline' | 'centered';
396
419
  }
397
420
  export interface TableElementProps {
@@ -430,4 +453,18 @@ export interface LinkProps {
430
453
  export type JsonValue = string | number | boolean | null | JsonValue[] | {
431
454
  [key: string]: JsonValue;
432
455
  };
456
+ export interface BoxProps {
457
+ children: ReactNode;
458
+ grow?: boolean;
459
+ alignSelf?: 'start' | 'center' | 'baseline' | 'end' | 'stretch' | 'auto';
460
+ }
461
+ interface TShirtSizes {
462
+ xs: 'extra-small' | 'xs';
463
+ sm: 'small' | 'sm';
464
+ md: 'medium' | 'md';
465
+ lg: 'large' | 'lg';
466
+ xl: 'extra-large' | 'xl';
467
+ }
468
+ export type AllSizes = TShirtSizes['xs'] | TShirtSizes['sm'] | TShirtSizes['md'] | TShirtSizes['lg'] | TShirtSizes['xl'];
469
+ export type AllDistances = 'flush' | AllSizes;
433
470
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/ui-extensions",
3
- "version": "0.0.1-beta.0",
3
+ "version": "0.0.1-beta.1",
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": "0bfb66cacc456a73f05a40841938e6b42f87aaba"
51
+ "gitHead": "3b1fd0b35b8aa6c88847d27cc3c6b94e635f0452"
52
52
  }