hs-uix 1.6.5 → 1.7.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 +2 -0
- package/common-components.d.ts +152 -0
- package/dist/common-components.js +1385 -77
- package/dist/common-components.mjs +1438 -82
- package/dist/datatable.js +291 -239
- package/dist/datatable.mjs +207 -155
- package/dist/feed.js +939 -0
- package/dist/feed.mjs +927 -0
- package/dist/form.js +115 -93
- package/dist/form.mjs +115 -93
- package/dist/index.js +3529 -1060
- package/dist/index.mjs +3231 -770
- package/dist/kanban.js +286 -225
- package/dist/kanban.mjs +180 -119
- package/dist/utils.js +2906 -2
- package/dist/utils.mjs +2944 -1
- package/feed.d.ts +1 -0
- package/index.d.ts +51 -2
- package/package.json +17 -4
- package/packages/datatable/README.md +1046 -0
- package/packages/datatable/index.d.ts +246 -0
- package/packages/feed/README.md +224 -0
- package/packages/feed/index.d.ts +261 -0
- package/packages/form/README.md +1229 -0
- package/packages/form/index.d.ts +498 -0
- package/packages/kanban/README.md +707 -0
- package/packages/kanban/index.d.ts +367 -0
- package/utils.d.ts +122 -0
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@ npm install hs-uix
|
|
|
14
14
|
```jsx
|
|
15
15
|
import { DataTable } from "hs-uix/datatable";
|
|
16
16
|
import { FormBuilder } from "hs-uix/form";
|
|
17
|
+
import { Feed } from "hs-uix/feed";
|
|
17
18
|
import { AutoStatusTag, AutoTag, KeyValueList, SectionHeader } from "hs-uix/common-components";
|
|
18
19
|
import { formatCurrency, formatDate } from "hs-uix/utils";
|
|
19
20
|
|
|
@@ -30,6 +31,7 @@ Requires `react` >= 18.0.0 and `@hubspot/ui-extensions` >= 0.12.0 as peer depend
|
|
|
30
31
|
| **DataTable** | Filterable, sortable, paginated table with auto-sized columns, inline editing, row grouping, and more | [Full documentation](https://github.com/05bmckay/hs-uix/blob/main/packages/datatable/README.md) |
|
|
31
32
|
| **FormBuilder** | Declarative, config-driven form with validation, multi-step wizards, and 20+ field types | [Full documentation](https://github.com/05bmckay/hs-uix/blob/main/packages/form/README.md) |
|
|
32
33
|
| **Kanban** | Stage-based board with filters, sort, headline metrics, card action bars, and DataTable-parity card field config | [Full documentation](https://github.com/05bmckay/hs-uix/blob/main/packages/kanban/README.md) |
|
|
34
|
+
| **Feed** | Activity feed / timeline with a standard item shape, date grouping, load-more pagination, and HubSpot-native item regions | [Full documentation](https://github.com/05bmckay/hs-uix/blob/main/packages/feed/README.md) |
|
|
33
35
|
| **Common Components** | Thin visual wrappers over HubSpot primitives — `AutoTag`, `AutoStatusTag`, `AvatarStack`, `SectionHeader`, `KeyValueList`, `StyledText` | [Full documentation](https://github.com/05bmckay/hs-uix/blob/main/src/common-components/README.md) |
|
|
34
36
|
| **Utils** | Pure helpers for formatting, options, HubSpot value guards, and tag-variant inference | [Full documentation](https://github.com/05bmckay/hs-uix/blob/main/src/utils/README.md) |
|
|
35
37
|
|
package/common-components.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
+
import type { BuiltOption } from "./utils";
|
|
2
3
|
import type {
|
|
3
4
|
AutoTagOptions,
|
|
4
5
|
AutoTagVariant,
|
|
@@ -99,6 +100,46 @@ export interface AvatarStackProps {
|
|
|
99
100
|
alt?: string;
|
|
100
101
|
}
|
|
101
102
|
|
|
103
|
+
export interface CrmLookupSelectProps {
|
|
104
|
+
objectType: "contact" | "contacts" | "company" | "companies" | "deal" | "deals" | string;
|
|
105
|
+
properties?: string[];
|
|
106
|
+
name?: string;
|
|
107
|
+
label?: string;
|
|
108
|
+
value?: string | number | boolean | Array<string | number | boolean>;
|
|
109
|
+
onChange?: (value: string | number | boolean | Array<string | number | boolean>) => void;
|
|
110
|
+
multiple?: boolean;
|
|
111
|
+
placeholder?: string;
|
|
112
|
+
description?: string;
|
|
113
|
+
tooltip?: string;
|
|
114
|
+
required?: boolean;
|
|
115
|
+
readOnly?: boolean;
|
|
116
|
+
error?: boolean;
|
|
117
|
+
validationMessage?: string;
|
|
118
|
+
variant?: "transparent" | "input";
|
|
119
|
+
debounce?: number;
|
|
120
|
+
minSearchLength?: number;
|
|
121
|
+
pageLength?: number;
|
|
122
|
+
option?: {
|
|
123
|
+
label?: string | ((row: Record<string, unknown>) => unknown);
|
|
124
|
+
value?: string | ((row: Record<string, unknown>) => unknown);
|
|
125
|
+
description?: string | ((row: Record<string, unknown>) => unknown);
|
|
126
|
+
fallbackLabel?: string;
|
|
127
|
+
mapOption?: (row: Record<string, unknown>) => BuiltOption;
|
|
128
|
+
};
|
|
129
|
+
labelProperty?: string | ((row: Record<string, unknown>) => unknown);
|
|
130
|
+
valueProperty?: string | ((row: Record<string, unknown>) => unknown);
|
|
131
|
+
descriptionProperty?: string | ((row: Record<string, unknown>) => unknown);
|
|
132
|
+
selectedOptions?: BuiltOption | BuiltOption[];
|
|
133
|
+
format?: Record<string, unknown>;
|
|
134
|
+
row?: Record<string, unknown>;
|
|
135
|
+
baseConfig?: Record<string, unknown>;
|
|
136
|
+
query?: string;
|
|
137
|
+
onSearchChange?: (query: string) => void;
|
|
138
|
+
noResultsOption?: BuiltOption;
|
|
139
|
+
loadingOption?: BuiltOption;
|
|
140
|
+
selectProps?: Record<string, unknown>;
|
|
141
|
+
}
|
|
142
|
+
|
|
102
143
|
export interface StyledTextFormat {
|
|
103
144
|
fontWeight?: "bold" | "demibold" | "regular" | number;
|
|
104
145
|
italic?: boolean;
|
|
@@ -149,12 +190,123 @@ export interface StyledTextDataUriOptions extends Omit<StyledTextSharedProps, "c
|
|
|
149
190
|
|
|
150
191
|
export interface StyledTextProps extends StyledTextSharedProps {}
|
|
151
192
|
|
|
193
|
+
export type SpinnerName =
|
|
194
|
+
| "braille"
|
|
195
|
+
| "braillewave"
|
|
196
|
+
| "dna"
|
|
197
|
+
| "scan"
|
|
198
|
+
| "rain"
|
|
199
|
+
| "scanline"
|
|
200
|
+
| "pulse"
|
|
201
|
+
| "snake"
|
|
202
|
+
| "sparkle"
|
|
203
|
+
| "cascade"
|
|
204
|
+
| "columns"
|
|
205
|
+
| "orbit"
|
|
206
|
+
| "breathe"
|
|
207
|
+
| "waverows"
|
|
208
|
+
| "checkerboard"
|
|
209
|
+
| "helix"
|
|
210
|
+
| "fillsweep"
|
|
211
|
+
| "diagswipe";
|
|
212
|
+
|
|
213
|
+
export interface SpinnerPreset {
|
|
214
|
+
frames: readonly string[];
|
|
215
|
+
interval: number;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export interface SpinnerProps {
|
|
219
|
+
name?: SpinnerName | string;
|
|
220
|
+
frames?: readonly string[];
|
|
221
|
+
interval?: number;
|
|
222
|
+
label?: ReactNode;
|
|
223
|
+
children?: ReactNode;
|
|
224
|
+
paused?: boolean;
|
|
225
|
+
gap?: string;
|
|
226
|
+
variant?: "bodytext" | "microcopy";
|
|
227
|
+
format?: StyledTextFormat;
|
|
228
|
+
inline?: boolean;
|
|
229
|
+
truncate?: boolean | { tooltipText?: string };
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export type IconSize =
|
|
233
|
+
| number
|
|
234
|
+
| "xs"
|
|
235
|
+
| "extra-small"
|
|
236
|
+
| "sm"
|
|
237
|
+
| "small"
|
|
238
|
+
| "md"
|
|
239
|
+
| "med"
|
|
240
|
+
| "medium"
|
|
241
|
+
| "lg"
|
|
242
|
+
| "large"
|
|
243
|
+
| "xl"
|
|
244
|
+
| "extra-large";
|
|
245
|
+
|
|
246
|
+
export interface IconPathObject {
|
|
247
|
+
d: string;
|
|
248
|
+
fill?: string;
|
|
249
|
+
fillRule?: "nonzero" | "evenodd";
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export type IconPath = string | IconPathObject;
|
|
253
|
+
|
|
254
|
+
export interface IconEntry {
|
|
255
|
+
/** Defaults to "0 0 24 24" when omitted. */
|
|
256
|
+
viewBox?: string;
|
|
257
|
+
paths: IconPath[];
|
|
258
|
+
/** Optional transform applied to all paths (e.g. a mirror/rotation). */
|
|
259
|
+
transform?: string;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export interface IconProps {
|
|
263
|
+
/** A registered glyph name (native or custom). Unknown names render nothing. */
|
|
264
|
+
name: string;
|
|
265
|
+
/** A semantic token ("inherit" | "alert" | "warning" | "success") or any CSS color. */
|
|
266
|
+
color?: string;
|
|
267
|
+
size?: IconSize;
|
|
268
|
+
/** Accessible label for screen readers. */
|
|
269
|
+
screenReaderText?: string;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export interface IconDataUriResult {
|
|
273
|
+
src: string;
|
|
274
|
+
width: number;
|
|
275
|
+
height: number;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export interface IconDataUriOptions {
|
|
279
|
+
size?: IconSize;
|
|
280
|
+
color?: string;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export declare function Icon(props: IconProps): ReactNode;
|
|
284
|
+
/** Custom glyph names registered in this library (excludes native names). */
|
|
285
|
+
export declare const ICON_NAMES: string[];
|
|
286
|
+
/** The custom glyph registry, keyed by icon name. */
|
|
287
|
+
export declare const ICONS: Record<string, IconEntry>;
|
|
288
|
+
/** The native `@hubspot/ui-extensions` `<Icon>` name whitelist, sorted. */
|
|
289
|
+
export declare const NATIVE_ICON_NAME_LIST: string[];
|
|
290
|
+
/** Build an SVG data URI from a registered name or an inline entry. Null for unknown names. */
|
|
291
|
+
export declare function makeIconDataUri(
|
|
292
|
+
nameOrEntry: string | IconEntry,
|
|
293
|
+
options?: IconDataUriOptions
|
|
294
|
+
): IconDataUriResult | null;
|
|
295
|
+
/** Parse a raw `<svg>` string into a registry entry (drops mask/defs, keeps per-path fills). */
|
|
296
|
+
export declare function svgToIconEntry(raw: string): IconEntry;
|
|
297
|
+
|
|
152
298
|
export declare function AutoTag(props: AutoTagProps): ReactNode;
|
|
153
299
|
export declare function AutoStatusTag(props: AutoStatusTagProps): ReactNode;
|
|
154
300
|
export declare function SectionHeader(props: SectionHeaderProps): ReactNode;
|
|
155
301
|
export declare function KeyValueList(props: KeyValueListProps): ReactNode;
|
|
156
302
|
export declare function AvatarStack(props: AvatarStackProps): ReactNode;
|
|
303
|
+
export declare function CrmLookupSelect(props: CrmLookupSelectProps): ReactNode;
|
|
157
304
|
export declare function StyledText(props: StyledTextProps): ReactNode;
|
|
305
|
+
export declare function Spinner(props: SpinnerProps): ReactNode;
|
|
306
|
+
export declare const SPINNERS: Record<SpinnerName, SpinnerPreset>;
|
|
307
|
+
export declare const SPINNER_NAMES: SpinnerName[];
|
|
308
|
+
export declare function gridToBraille(grid: boolean[][]): string;
|
|
309
|
+
export declare function makeGrid(rows: number, cols: number): boolean[][];
|
|
158
310
|
export declare function makeAvatarStackDataUri(
|
|
159
311
|
items?: AvatarStackItem[] | null,
|
|
160
312
|
options?: Omit<AvatarStackProps, "items" | "alt">
|