@hubspot/ui-extensions 0.10.1 → 0.11.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/{pages/home/components.d.ts → __synced__/appHomeRemoteComponents.synced.d.ts} +7 -7
- package/dist/{pages/home/components.js → __synced__/appHomeRemoteComponents.synced.js} +1 -0
- package/dist/{crm/components.d.ts → __synced__/crmRemoteComponents.synced.d.ts} +40 -41
- package/dist/__synced__/crmRemoteComponents.synced.js +15 -0
- package/dist/{experimental/types.d.ts → __synced__/experimental/types.synced.d.ts} +6 -1
- package/dist/__synced__/experimentalRemoteComponents.synced.d.ts +94 -0
- package/dist/__synced__/experimentalRemoteComponents.synced.js +56 -0
- package/dist/__synced__/remoteComponents.synced.d.ts +579 -0
- package/dist/{coreComponents.js → __synced__/remoteComponents.synced.js} +89 -69
- package/dist/__synced__/types/actions.synced.d.ts +57 -0
- package/dist/__synced__/types/actions.synced.js +1 -0
- package/dist/__synced__/types/components/accordion.synced.d.ts +48 -0
- package/dist/__synced__/types/components/accordion.synced.js +1 -0
- package/dist/__synced__/types/components/alert.synced.d.ts +24 -0
- package/dist/__synced__/types/components/alert.synced.js +1 -0
- package/dist/__synced__/types/components/app-home-header-actions.synced.d.ts +39 -0
- package/dist/__synced__/types/components/app-home-header-actions.synced.js +1 -0
- package/dist/__synced__/types/components/button-row.synced.d.ts +44 -0
- package/dist/__synced__/types/components/button-row.synced.js +1 -0
- package/dist/__synced__/types/components/button.synced.d.ts +89 -0
- package/dist/__synced__/types/components/button.synced.js +1 -0
- package/dist/__synced__/types/components/card.synced.d.ts +12 -0
- package/dist/__synced__/types/components/card.synced.js +1 -0
- package/dist/__synced__/types/components/chart.synced.d.ts +137 -0
- package/dist/__synced__/types/components/chart.synced.js +5 -0
- package/dist/__synced__/types/components/description-list.synced.d.ts +36 -0
- package/dist/__synced__/types/components/description-list.synced.js +1 -0
- package/dist/__synced__/types/components/divider.synced.d.ts +14 -0
- package/dist/__synced__/types/components/divider.synced.js +1 -0
- package/dist/__synced__/types/components/dropdown.synced.d.ts +84 -0
- package/dist/__synced__/types/components/dropdown.synced.js +1 -0
- package/dist/__synced__/types/components/empty-state.synced.d.ts +51 -0
- package/dist/__synced__/types/components/empty-state.synced.js +1 -0
- package/dist/__synced__/types/components/error-state.synced.d.ts +24 -0
- package/dist/__synced__/types/components/error-state.synced.js +1 -0
- package/dist/__synced__/types/components/form.synced.d.ts +29 -0
- package/dist/__synced__/types/components/form.synced.js +1 -0
- package/dist/__synced__/types/components/heading.synced.d.ts +19 -0
- package/dist/__synced__/types/components/heading.synced.js +1 -0
- package/dist/__synced__/types/components/icon.synced.d.ts +29 -0
- package/dist/__synced__/types/components/icon.synced.js +1 -0
- package/dist/__synced__/types/components/iframe.synced.d.ts +20 -0
- package/dist/__synced__/types/components/iframe.synced.js +1 -0
- package/dist/__synced__/types/components/illustration.synced.d.ts +53 -0
- package/dist/__synced__/types/components/illustration.synced.js +43 -0
- package/dist/__synced__/types/components/image.synced.d.ts +40 -0
- package/dist/__synced__/types/components/image.synced.js +1 -0
- package/dist/__synced__/types/components/index.synced.d.ts +38 -0
- package/dist/__synced__/types/components/index.synced.js +1 -0
- package/dist/__synced__/types/components/inputs.synced.d.ts +350 -0
- package/dist/__synced__/types/components/inputs.synced.js +1 -0
- package/dist/__synced__/types/components/layouts.synced.d.ts +172 -0
- package/dist/__synced__/types/components/layouts.synced.js +1 -0
- package/dist/__synced__/types/components/link.synced.d.ts +38 -0
- package/dist/__synced__/types/components/link.synced.js +1 -0
- package/dist/__synced__/types/components/list.synced.d.ts +18 -0
- package/dist/__synced__/types/components/list.synced.js +1 -0
- package/dist/__synced__/types/components/loading-spinner.synced.d.ts +31 -0
- package/dist/__synced__/types/components/loading-spinner.synced.js +1 -0
- package/dist/__synced__/types/components/modal.synced.d.ts +60 -0
- package/dist/__synced__/types/components/modal.synced.js +1 -0
- package/dist/__synced__/types/components/panel.synced.d.ts +73 -0
- package/dist/__synced__/types/components/panel.synced.js +1 -0
- package/dist/__synced__/types/components/progress-bar.synced.d.ts +48 -0
- package/dist/__synced__/types/components/progress-bar.synced.js +1 -0
- package/dist/__synced__/types/components/selects.synced.d.ts +130 -0
- package/dist/__synced__/types/components/selects.synced.js +1 -0
- package/dist/__synced__/types/components/statistics.synced.d.ts +56 -0
- package/dist/__synced__/types/components/statistics.synced.js +1 -0
- package/dist/__synced__/types/components/status-tag.synced.d.ts +42 -0
- package/dist/__synced__/types/components/status-tag.synced.js +1 -0
- package/dist/__synced__/types/components/step-indicator.synced.d.ts +44 -0
- package/dist/__synced__/types/components/step-indicator.synced.js +1 -0
- package/dist/__synced__/types/components/table.synced.d.ts +138 -0
- package/dist/__synced__/types/components/table.synced.js +1 -0
- package/dist/__synced__/types/components/tabs.synced.d.ts +55 -0
- package/dist/__synced__/types/components/tabs.synced.js +1 -0
- package/dist/__synced__/types/components/tag.synced.d.ts +32 -0
- package/dist/__synced__/types/components/tag.synced.js +1 -0
- package/dist/__synced__/types/components/text.synced.d.ts +93 -0
- package/dist/__synced__/types/components/text.synced.js +1 -0
- package/dist/__synced__/types/components/tile.synced.d.ts +24 -0
- package/dist/__synced__/types/components/tile.synced.js +1 -0
- package/dist/__synced__/types/components/toggle.synced.d.ts +60 -0
- package/dist/__synced__/types/components/toggle.synced.js +1 -0
- package/dist/__synced__/types/components/toggleInputs.synced.d.ts +191 -0
- package/dist/__synced__/types/components/toggleInputs.synced.js +1 -0
- package/dist/__synced__/types/components/tooltip.synced.d.ts +12 -0
- package/dist/__synced__/types/components/tooltip.synced.js +1 -0
- package/dist/__synced__/types/context.synced.d.ts +82 -0
- package/dist/__synced__/types/context.synced.js +1 -0
- package/dist/__synced__/types/crm.synced.d.ts +248 -0
- package/dist/__synced__/types/crm.synced.js +1 -0
- package/dist/__synced__/types/extension-points.synced.d.ts +122 -0
- package/dist/__synced__/types/extension-points.synced.js +9 -0
- package/dist/__synced__/types/http-requests.synced.d.ts +106 -0
- package/dist/__synced__/types/http-requests.synced.js +8 -0
- package/dist/__synced__/types/index.synced.d.ts +8 -0
- package/dist/__synced__/types/index.synced.js +1 -0
- package/dist/__synced__/types/reactions.synced.d.ts +12 -0
- package/dist/__synced__/types/reactions.synced.js +1 -0
- package/dist/__synced__/types/shared.synced.d.ts +196 -0
- package/dist/{types.js → __synced__/types/shared.synced.js} +0 -68
- package/dist/__synced__/utils/remote-component-registry.synced.d.ts +80 -0
- package/dist/__synced__/utils/remote-component-registry.synced.js +64 -0
- package/dist/crm/index.d.ts +2 -2
- package/dist/crm/index.js +1 -2
- package/dist/experimental/index.d.ts +2 -73
- package/dist/experimental/index.js +1 -34
- package/dist/experimental/testing/internal/constants.d.ts +2 -0
- package/dist/experimental/testing/internal/constants.js +1 -0
- package/dist/experimental/testing/internal/debug.d.ts +8 -0
- package/dist/experimental/testing/internal/debug.js +10 -0
- package/dist/experimental/testing/internal/element.d.ts +11 -0
- package/dist/experimental/testing/internal/element.js +67 -0
- package/dist/experimental/testing/internal/errors.d.ts +44 -0
- package/dist/experimental/testing/internal/errors.js +52 -0
- package/dist/experimental/testing/internal/fragment.d.ts +8 -0
- package/dist/experimental/testing/internal/fragment.js +44 -0
- package/dist/experimental/testing/internal/print.d.ts +6 -0
- package/dist/experimental/testing/internal/print.js +114 -0
- package/dist/experimental/testing/internal/query.d.ts +57 -0
- package/dist/experimental/testing/internal/query.js +231 -0
- package/dist/experimental/testing/internal/root.d.ts +8 -0
- package/dist/experimental/testing/internal/root.js +44 -0
- package/dist/experimental/testing/internal/text.d.ts +9 -0
- package/dist/experimental/testing/internal/text.js +16 -0
- package/dist/experimental/testing/internal/types-internal.d.ts +47 -0
- package/dist/experimental/testing/internal/types-internal.js +1 -0
- package/dist/experimental/testing/type-utils.d.ts +29 -0
- package/dist/experimental/testing/type-utils.js +37 -0
- package/dist/experimental/testing/types.d.ts +240 -0
- package/dist/experimental/testing/types.js +10 -0
- package/dist/hubspot.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/pages/home/index.d.ts +1 -0
- package/dist/pages/home/index.js +1 -0
- package/package.json +12 -10
- package/dist/coreComponents.d.ts +0 -844
- package/dist/crm/components.js +0 -15
- package/dist/experimental/testing/index.d.ts +0 -14
- package/dist/experimental/testing/index.js +0 -33
- package/dist/experimental/testing/jest/matchers/index.d.ts +0 -6
- package/dist/experimental/testing/jest/matchers/index.js +0 -6
- package/dist/types.d.ts +0 -3167
- package/dist/utils/createExtensionComponent.d.ts +0 -3
- package/dist/utils/createExtensionComponent.js +0 -4
- /package/dist/{experimental/types.js → __synced__/experimental/types.synced.js} +0 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { AllDistances } from '../shared.synced';
|
|
3
|
+
/**
|
|
4
|
+
* The props type for {@link !components.Stack}.
|
|
5
|
+
*
|
|
6
|
+
* @category Component Props
|
|
7
|
+
*/
|
|
8
|
+
export interface StackProps {
|
|
9
|
+
/**
|
|
10
|
+
* Sets the spacing between components.
|
|
11
|
+
*/
|
|
12
|
+
distance?: AllDistances;
|
|
13
|
+
/**
|
|
14
|
+
* Sets the content that will render inside the component.
|
|
15
|
+
*/
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Arranges components `horizontally` or `vertically` by setting the main axis.
|
|
19
|
+
*/
|
|
20
|
+
direction?: 'row' | 'column';
|
|
21
|
+
/**
|
|
22
|
+
* Distributes components along the main axis using the available free space.
|
|
23
|
+
*/
|
|
24
|
+
justify?: 'center' | 'end' | 'start';
|
|
25
|
+
/**
|
|
26
|
+
* Distributes components along the cross-axis using the available free space.
|
|
27
|
+
*/
|
|
28
|
+
align?: 'start' | 'center' | 'baseline' | 'end' | 'stretch';
|
|
29
|
+
/**
|
|
30
|
+
* Sets the width of the stack.
|
|
31
|
+
*/
|
|
32
|
+
width?: 'auto' | '100%';
|
|
33
|
+
}
|
|
34
|
+
export type FlexJustify = 'center' | 'end' | 'start' | 'around' | 'between';
|
|
35
|
+
export type FlexAlign = 'start' | 'center' | 'baseline' | 'end' | 'stretch';
|
|
36
|
+
/**
|
|
37
|
+
* The props type for {@link !components.Flex}.
|
|
38
|
+
*
|
|
39
|
+
* @category Component Props
|
|
40
|
+
*/
|
|
41
|
+
export interface FlexProps {
|
|
42
|
+
/**
|
|
43
|
+
* Sets the spacing between components.
|
|
44
|
+
*
|
|
45
|
+
* @defaultValue `"flush"`
|
|
46
|
+
*/
|
|
47
|
+
gap?: AllDistances;
|
|
48
|
+
/**
|
|
49
|
+
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components.
|
|
50
|
+
*
|
|
51
|
+
*/
|
|
52
|
+
children?: ReactNode;
|
|
53
|
+
/**
|
|
54
|
+
* Arranges components `horizontally` or `vertically` by setting the main axis.
|
|
55
|
+
*
|
|
56
|
+
* @defaultValue `"row"`
|
|
57
|
+
*/
|
|
58
|
+
direction?: 'row' | 'column';
|
|
59
|
+
/**
|
|
60
|
+
* Distributes components along the main axis using the available free space.
|
|
61
|
+
*
|
|
62
|
+
* @defaultValue `"start"`
|
|
63
|
+
*/
|
|
64
|
+
justify?: FlexJustify;
|
|
65
|
+
/**
|
|
66
|
+
* Distributes components along the cross-axis using the available free space.
|
|
67
|
+
*
|
|
68
|
+
* @defaultValue `"stretch"`
|
|
69
|
+
*/
|
|
70
|
+
align?: FlexAlign;
|
|
71
|
+
/**
|
|
72
|
+
* Overrides Flex's `alignItem` value for this element.
|
|
73
|
+
*
|
|
74
|
+
*/
|
|
75
|
+
alignSelf?: FlexAlign;
|
|
76
|
+
/**
|
|
77
|
+
* Whether components will wrap instead of trying to fit on one line.
|
|
78
|
+
*
|
|
79
|
+
* @defaultValue `"nowrap"`
|
|
80
|
+
*/
|
|
81
|
+
wrap?: boolean | 'wrap' | 'nowrap';
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The props type for {@link !components.Box}.
|
|
85
|
+
*
|
|
86
|
+
* @category Component Props
|
|
87
|
+
*/
|
|
88
|
+
export interface BoxProps {
|
|
89
|
+
/**
|
|
90
|
+
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components.
|
|
91
|
+
*
|
|
92
|
+
*/
|
|
93
|
+
children: ReactNode;
|
|
94
|
+
/**
|
|
95
|
+
* Overrides Flex's `alignItem` value for this element.
|
|
96
|
+
*
|
|
97
|
+
* @defaultValue `"auto"`
|
|
98
|
+
*/
|
|
99
|
+
alignSelf?: 'start' | 'center' | 'baseline' | 'end' | 'stretch' | 'auto';
|
|
100
|
+
/**
|
|
101
|
+
* Sets how the item will grow or shrink when it's a direct ancestor of the Flex component.
|
|
102
|
+
* ##### Options in detail
|
|
103
|
+
*
|
|
104
|
+
*- `initial`: The item is sized according to its width and height properties. It shrinks to its minimum size to fit the container, but does not grow to absorb any extra free space in the flex container.
|
|
105
|
+
*- `auto`: The item is sized according to its width and height properties, but grows to absorb any extra free space in the flex container, and shrinks to its minimum size to fit the container.
|
|
106
|
+
*- `none`: The item is sized according to its width and height properties. It is fully inflexible: it neither shrinks nor grows in relation to the flex container.
|
|
107
|
+
*- `number`: Tells a component to fill all available space, shared evenly amongst other components with the same parent. The larger the flex given, the higher the ratio of space a component will take compared to its siblings.
|
|
108
|
+
*
|
|
109
|
+
* @defaultValue `"initial"`
|
|
110
|
+
*/
|
|
111
|
+
flex?: 'initial' | 'auto' | 'none' | number;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* The props type for {@link !components.Inline}.
|
|
115
|
+
*
|
|
116
|
+
* @category Component Props
|
|
117
|
+
*/
|
|
118
|
+
export interface InlineProps {
|
|
119
|
+
/**
|
|
120
|
+
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components.
|
|
121
|
+
*
|
|
122
|
+
*/
|
|
123
|
+
children?: ReactNode;
|
|
124
|
+
/**
|
|
125
|
+
* Distributes components along the main axis using the available free space.
|
|
126
|
+
* @defaultValue `"start"`
|
|
127
|
+
*/
|
|
128
|
+
justify?: FlexJustify;
|
|
129
|
+
/**
|
|
130
|
+
* Distributes components along the cross-axis using the available free space.
|
|
131
|
+
* @defaultValue `"center"`
|
|
132
|
+
*/
|
|
133
|
+
align?: FlexAlign;
|
|
134
|
+
/**
|
|
135
|
+
* Sets the spacing between components.
|
|
136
|
+
*
|
|
137
|
+
* @defaultValue `"flush"`
|
|
138
|
+
*/
|
|
139
|
+
gap?: AllDistances;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* The props type for {@link !components.AutoGrid}.
|
|
143
|
+
*
|
|
144
|
+
* @category Component Props
|
|
145
|
+
*/
|
|
146
|
+
export interface AutoGridProps {
|
|
147
|
+
/**
|
|
148
|
+
* Sets the width of each column in the grid.
|
|
149
|
+
* 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.
|
|
150
|
+
* When `flexible` is false, columns are exactly this width.
|
|
151
|
+
*/
|
|
152
|
+
columnWidth: number;
|
|
153
|
+
/**
|
|
154
|
+
* Sets the spacing between grid items.
|
|
155
|
+
*
|
|
156
|
+
* @defaultValue `"flush"`
|
|
157
|
+
*/
|
|
158
|
+
gap?: AllDistances;
|
|
159
|
+
/**
|
|
160
|
+
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components.
|
|
161
|
+
*
|
|
162
|
+
*/
|
|
163
|
+
children?: ReactNode;
|
|
164
|
+
/**
|
|
165
|
+
* Whether columns should expand to fill available space.
|
|
166
|
+
* When true, columns will be at least `columnWidth` but grow equally to fill the container.
|
|
167
|
+
* When false, columns are exactly `columnWidth`.
|
|
168
|
+
*
|
|
169
|
+
* @defaultValue `false`
|
|
170
|
+
*/
|
|
171
|
+
flexible?: boolean;
|
|
172
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { OverlayComponentProps, ExtensionEvent, HrefProp } from '../shared.synced';
|
|
3
|
+
import { ReactionsHandler } from '../reactions.synced';
|
|
4
|
+
/**
|
|
5
|
+
* The props type for {@link !components.Link}.
|
|
6
|
+
*
|
|
7
|
+
* @category Component Props
|
|
8
|
+
*/
|
|
9
|
+
export interface LinkProps extends OverlayComponentProps {
|
|
10
|
+
/**
|
|
11
|
+
* Sets the content that will render inside the component.
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* The URL that will be opened on click. Links to pages in the HubSpot account will open in the same tab, while non-HubSpot links will open in a new tab.
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
href: HrefProp;
|
|
20
|
+
/**
|
|
21
|
+
* The color variation of the link.
|
|
22
|
+
*
|
|
23
|
+
* @defaultValue `"primary"`
|
|
24
|
+
*/
|
|
25
|
+
variant?: 'primary' | 'destructive' | 'light' | 'dark';
|
|
26
|
+
/**
|
|
27
|
+
* A function that will be invoked with the link is clicked.
|
|
28
|
+
*
|
|
29
|
+
* @event
|
|
30
|
+
*/
|
|
31
|
+
onClick?: ReactionsHandler<ExtensionEvent>;
|
|
32
|
+
/**
|
|
33
|
+
* When set to true, `event.preventDefault()` will be invoked before the `onClick` function is called, preventing automatic navigation to the href URL.
|
|
34
|
+
*
|
|
35
|
+
* @defaultValue `false`
|
|
36
|
+
*/
|
|
37
|
+
preventDefault?: boolean;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The props type for {@link !components.List}.
|
|
4
|
+
*
|
|
5
|
+
* @category Component Props
|
|
6
|
+
*/
|
|
7
|
+
export interface ListProps {
|
|
8
|
+
/**
|
|
9
|
+
* The content of the list. Each child will be wrapped in an `li` tag.
|
|
10
|
+
*/
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* The type of list to render.
|
|
14
|
+
*
|
|
15
|
+
* @defaultValue `"unordered"`
|
|
16
|
+
*/
|
|
17
|
+
variant?: 'unordered' | 'unordered-styled' | 'ordered' | 'ordered-styled' | 'inline' | 'inline-divided';
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TShirtSizes } from '../shared.synced';
|
|
2
|
+
/**
|
|
3
|
+
* The props type for {@link !components.LoadingSpinner}.
|
|
4
|
+
*
|
|
5
|
+
* @category Component Props
|
|
6
|
+
*/
|
|
7
|
+
export interface LoadingSpinnerProps {
|
|
8
|
+
/**
|
|
9
|
+
* The text that displays next to the spinner. Note: the label is not shown by default, you must set `showLabel` to `true` to display the label.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
label: string;
|
|
13
|
+
/**
|
|
14
|
+
* When set to `true`, the label will appear next to the spinner.
|
|
15
|
+
*
|
|
16
|
+
* @defaultValue `false`
|
|
17
|
+
*/
|
|
18
|
+
showLabel?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The size of the spinner.
|
|
21
|
+
*
|
|
22
|
+
* @defaultValue `"sm"`
|
|
23
|
+
*/
|
|
24
|
+
size?: TShirtSizes['xs'] | TShirtSizes['sm'] | TShirtSizes['md'];
|
|
25
|
+
/**
|
|
26
|
+
* The position of the spinner. Can be one of `inline` or `centered`.
|
|
27
|
+
*
|
|
28
|
+
* @defaultValue `"inline"`
|
|
29
|
+
*/
|
|
30
|
+
layout?: 'inline' | 'centered';
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TShirtSizes } from '../shared.synced';
|
|
3
|
+
export interface ModalProps {
|
|
4
|
+
/**
|
|
5
|
+
* Accessibility label.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
'aria-label'?: string;
|
|
9
|
+
/**
|
|
10
|
+
* The main content of the modal when it opens.
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* A unique ID for the modal
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
id: string;
|
|
19
|
+
/**
|
|
20
|
+
* A function that will be invoked when the modal has finished opening.
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
onOpen?: () => void;
|
|
24
|
+
/**
|
|
25
|
+
* A function that will be invoked when the modal has finished closing.
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
onClose?: () => void;
|
|
29
|
+
/**
|
|
30
|
+
* The width of the modal
|
|
31
|
+
*
|
|
32
|
+
* @defaultValue `"sm"`
|
|
33
|
+
*/
|
|
34
|
+
width?: TShirtSizes['sm'] | TShirtSizes['md'] | TShirtSizes['lg'];
|
|
35
|
+
/**
|
|
36
|
+
* The title of the modal
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
title?: string;
|
|
40
|
+
/**
|
|
41
|
+
* The variant of the modal
|
|
42
|
+
*
|
|
43
|
+
* @defaultValue `"default"`
|
|
44
|
+
*/
|
|
45
|
+
variant?: 'danger' | 'default';
|
|
46
|
+
}
|
|
47
|
+
export interface ModalBodyProps {
|
|
48
|
+
/**
|
|
49
|
+
* The main content of the modal
|
|
50
|
+
*
|
|
51
|
+
*/
|
|
52
|
+
children: ReactNode;
|
|
53
|
+
}
|
|
54
|
+
export interface ModalFooterProps {
|
|
55
|
+
/**
|
|
56
|
+
* The footer of the modal
|
|
57
|
+
*
|
|
58
|
+
*/
|
|
59
|
+
children: ReactNode;
|
|
60
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TShirtSizes } from '../shared.synced';
|
|
3
|
+
export interface PanelProps {
|
|
4
|
+
/**
|
|
5
|
+
* Accessibility label.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
'aria-label'?: string;
|
|
9
|
+
/**
|
|
10
|
+
* The main content of the panel when it opens.
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* A unique ID for the panel
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
id: string;
|
|
19
|
+
/**
|
|
20
|
+
* A function that will be invoked when the panel has finished opening.
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
onOpen?: () => void;
|
|
24
|
+
/**
|
|
25
|
+
* A function that will be invoked when the panel has finished closing.
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
onClose?: () => void;
|
|
29
|
+
/**
|
|
30
|
+
* The width of the panel
|
|
31
|
+
*
|
|
32
|
+
* @defaultValue `"sm"`
|
|
33
|
+
*/
|
|
34
|
+
width?: TShirtSizes['sm'] | TShirtSizes['md'] | TShirtSizes['lg'];
|
|
35
|
+
/**
|
|
36
|
+
* The title of the panel
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
title?: string;
|
|
40
|
+
/**
|
|
41
|
+
* The variant of the panel
|
|
42
|
+
*
|
|
43
|
+
* @defaultValue `"default"`
|
|
44
|
+
*/
|
|
45
|
+
variant?: 'modal' | 'default';
|
|
46
|
+
}
|
|
47
|
+
export interface PanelSectionProps {
|
|
48
|
+
/**
|
|
49
|
+
* When set to `true`, the section will have no bottom margin
|
|
50
|
+
*
|
|
51
|
+
* @defaultValue `false`
|
|
52
|
+
*/
|
|
53
|
+
flush?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* The main content of the section
|
|
56
|
+
*
|
|
57
|
+
*/
|
|
58
|
+
children: ReactNode;
|
|
59
|
+
}
|
|
60
|
+
export interface PanelBodyProps {
|
|
61
|
+
/**
|
|
62
|
+
* The main content of the body
|
|
63
|
+
*
|
|
64
|
+
*/
|
|
65
|
+
children: ReactNode;
|
|
66
|
+
}
|
|
67
|
+
export interface PanelFooterProps {
|
|
68
|
+
/**
|
|
69
|
+
* The main content of the footer
|
|
70
|
+
*
|
|
71
|
+
*/
|
|
72
|
+
children: ReactNode;
|
|
73
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The props type for {@link !components.ProgressBar}.
|
|
3
|
+
*
|
|
4
|
+
* @category Component Props
|
|
5
|
+
*/
|
|
6
|
+
export interface ProgressBarProps {
|
|
7
|
+
/**
|
|
8
|
+
* The text that displays above the progress bar.
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
title?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Accessibility label.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
'aria-label'?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the progress bar displays the completion percentage.
|
|
19
|
+
*
|
|
20
|
+
* @defaultValue `false`
|
|
21
|
+
*/
|
|
22
|
+
showPercentage?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* The number representing the progress so far.
|
|
25
|
+
*
|
|
26
|
+
* @defaultValue `0`
|
|
27
|
+
*/
|
|
28
|
+
value?: number;
|
|
29
|
+
/**
|
|
30
|
+
* The maximum value of the progress bar.
|
|
31
|
+
*
|
|
32
|
+
* @defaultValue `100`
|
|
33
|
+
*/
|
|
34
|
+
maxValue?: number;
|
|
35
|
+
/**
|
|
36
|
+
* The text that explains the current state of the value property. For example, "150 out of 250". Displays above the progress bar on the right side.
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
valueDescription?: string;
|
|
40
|
+
/**
|
|
41
|
+
* The color that indicates the type of progress bar.
|
|
42
|
+
*
|
|
43
|
+
* @defaultValue `"success"`
|
|
44
|
+
*/
|
|
45
|
+
variant?: 'success' | 'danger' | 'warning';
|
|
46
|
+
/** @deprecated use maxValue instead */
|
|
47
|
+
valueMax?: number;
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic collection of props for select components
|
|
3
|
+
* @internal
|
|
4
|
+
* */
|
|
5
|
+
export interface BaseSelectProps {
|
|
6
|
+
/**
|
|
7
|
+
* The text that displays above to the dropdown menu.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
label?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The unique identifier for the select element.
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
name?: string;
|
|
16
|
+
/**
|
|
17
|
+
* When set to `true`, displays a required field indicator.
|
|
18
|
+
*
|
|
19
|
+
* @defaultValue `false`
|
|
20
|
+
*/
|
|
21
|
+
required?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* When set to `true`, sets the field as read-only on the CRM record, and users will not be able to fill the input field.
|
|
24
|
+
*
|
|
25
|
+
* @defaultValue `false`
|
|
26
|
+
*/
|
|
27
|
+
readOnly?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Displayed text that describes the field's purpose.
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
description?: string;
|
|
33
|
+
/**
|
|
34
|
+
* The text that displays in a tooltip next to the label.
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
|
+
tooltip?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Text that appears in the input when no value is set.
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
placeholder?: string;
|
|
43
|
+
/**
|
|
44
|
+
* When set to `true`, `validationMessage` is displayed as an error message if provided.
|
|
45
|
+
* The input will also render its error state to let the user know there's an error.
|
|
46
|
+
* If left `false` (default), `validationMessage` is displayed as a success message.
|
|
47
|
+
*
|
|
48
|
+
* @defaultValue `false`
|
|
49
|
+
*/
|
|
50
|
+
error?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* The text to show if the input has an error.
|
|
53
|
+
*
|
|
54
|
+
*/
|
|
55
|
+
validationMessage?: string;
|
|
56
|
+
/**
|
|
57
|
+
* The variant type for the select.
|
|
58
|
+
*
|
|
59
|
+
* @defaultValue `"input"`
|
|
60
|
+
*/
|
|
61
|
+
variant?: 'transparent' | 'input';
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The props type for {@link !components.Select}.
|
|
65
|
+
*
|
|
66
|
+
* @category Component Props
|
|
67
|
+
*/
|
|
68
|
+
export interface SelectProps extends BaseSelectProps {
|
|
69
|
+
/**
|
|
70
|
+
* The value of the select input.
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
value?: string | number | boolean;
|
|
74
|
+
/**
|
|
75
|
+
* A callback function that is invoked when the value is committed.
|
|
76
|
+
*
|
|
77
|
+
* @event
|
|
78
|
+
*/
|
|
79
|
+
onChange?: (value: NonNullable<SelectProps['value']>) => void;
|
|
80
|
+
/**
|
|
81
|
+
* The variant type for the select.
|
|
82
|
+
*
|
|
83
|
+
* @defaultValue `"input"`
|
|
84
|
+
*/
|
|
85
|
+
variant?: 'transparent' | 'input';
|
|
86
|
+
/**
|
|
87
|
+
* A function that is called and passed the value every time the search field is
|
|
88
|
+
* edited by the user. Prefer updating state in onChange as it fires less
|
|
89
|
+
* frequently, and if you need to update state here, consider debouncing your function.
|
|
90
|
+
*
|
|
91
|
+
* @event
|
|
92
|
+
*/
|
|
93
|
+
onInput?: (value: string) => void;
|
|
94
|
+
/**
|
|
95
|
+
* The options to display in the dropdown menu.
|
|
96
|
+
*/
|
|
97
|
+
options: {
|
|
98
|
+
/** Will be used as the display text. **/
|
|
99
|
+
label: string;
|
|
100
|
+
/** Should be the option's unique identifier, which is submitted with the form. **/
|
|
101
|
+
value: string | number | boolean;
|
|
102
|
+
}[];
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* The props type for {@link !components.MultiSelect}.
|
|
106
|
+
*
|
|
107
|
+
* @category Component Props
|
|
108
|
+
*/
|
|
109
|
+
export interface MultiSelectProps extends BaseSelectProps {
|
|
110
|
+
/**
|
|
111
|
+
* The value of the select input.
|
|
112
|
+
*
|
|
113
|
+
*/
|
|
114
|
+
value?: (string | number | boolean)[];
|
|
115
|
+
/**
|
|
116
|
+
* A callback function that is invoked when the value is committed.
|
|
117
|
+
*
|
|
118
|
+
* @event
|
|
119
|
+
*/
|
|
120
|
+
onChange?: (value: NonNullable<MultiSelectProps['value']>) => void;
|
|
121
|
+
/**
|
|
122
|
+
* The options to display in the dropdown menu.
|
|
123
|
+
*/
|
|
124
|
+
options: {
|
|
125
|
+
/** Will be used as the display text. **/
|
|
126
|
+
label: string;
|
|
127
|
+
/** Should be the option's unique identifier, which is submitted with the form. **/
|
|
128
|
+
value: string | number | boolean;
|
|
129
|
+
}[];
|
|
130
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The props type for {@link !components.StatisticsTrend}.
|
|
4
|
+
*
|
|
5
|
+
* @category Component Props
|
|
6
|
+
*/
|
|
7
|
+
export interface StatisticsTrendProps {
|
|
8
|
+
/**
|
|
9
|
+
* The text to be displayed as the trend value.
|
|
10
|
+
*/
|
|
11
|
+
value: string;
|
|
12
|
+
/**
|
|
13
|
+
* The direction of the trend arrow.
|
|
14
|
+
*
|
|
15
|
+
* @defaultValue `"increase"`
|
|
16
|
+
*/
|
|
17
|
+
direction: 'increase' | 'decrease';
|
|
18
|
+
/**
|
|
19
|
+
* The color of the trend arrow.
|
|
20
|
+
*/
|
|
21
|
+
color?: 'red' | 'green';
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The props type for {@link !components.StatisticsItem}.
|
|
25
|
+
*
|
|
26
|
+
* @category Component Props
|
|
27
|
+
*/
|
|
28
|
+
export interface StatisticsItemProps {
|
|
29
|
+
/**
|
|
30
|
+
* The unique identifier.
|
|
31
|
+
*/
|
|
32
|
+
id?: string;
|
|
33
|
+
/**
|
|
34
|
+
* The item's label text.
|
|
35
|
+
*/
|
|
36
|
+
label: string;
|
|
37
|
+
/**
|
|
38
|
+
* The string to be displayed as the item's primary number.
|
|
39
|
+
*/
|
|
40
|
+
number: string | number;
|
|
41
|
+
/**
|
|
42
|
+
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components. The children should be {@link !components.StatisticsTrend} or {@link !components.Text}.
|
|
43
|
+
*/
|
|
44
|
+
children?: ReactNode;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The props type for {@link !components.Statistics}.
|
|
48
|
+
*
|
|
49
|
+
* @category Component Props
|
|
50
|
+
*/
|
|
51
|
+
export interface StatisticsProps {
|
|
52
|
+
/**
|
|
53
|
+
* Sets the content that will render inside the component. This prop is passed implicitly by providing sub-components. The children should be {@link !components.StatisticsItem}.
|
|
54
|
+
*/
|
|
55
|
+
children: ReactNode;
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|