@caratlogic/design-system 0.1.13 → 0.1.19
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 +1 -1
- package/dist/components/molecules/CustomField/CustomField.types.d.ts +28 -0
- package/dist/components/molecules/CustomField/CustomField.types.d.ts.map +1 -0
- package/dist/components/molecules/CustomField/CustomFieldInput.d.ts +43 -0
- package/dist/components/molecules/CustomField/CustomFieldInput.d.ts.map +1 -0
- package/dist/components/molecules/CustomField/CustomFieldValue.d.ts +17 -0
- package/dist/components/molecules/CustomField/CustomFieldValue.d.ts.map +1 -0
- package/dist/components/molecules/CustomField/fieldTypeIcon.d.ts +4 -0
- package/dist/components/molecules/CustomField/fieldTypeIcon.d.ts.map +1 -0
- package/dist/components/molecules/CustomField/fieldValueHelpers.d.ts +10 -0
- package/dist/components/molecules/CustomField/fieldValueHelpers.d.ts.map +1 -0
- package/dist/components/molecules/CustomField/index.d.ts +8 -0
- package/dist/components/molecules/CustomField/index.d.ts.map +1 -0
- package/dist/components/organisms/ActivityFeed/ActivityFeed.accessibility.d.ts +10 -0
- package/dist/components/organisms/ActivityFeed/ActivityFeed.accessibility.d.ts.map +1 -0
- package/dist/components/organisms/ActivityFeed/ActivityFeed.components.d.ts +22 -0
- package/dist/components/organisms/ActivityFeed/ActivityFeed.components.d.ts.map +1 -0
- package/dist/components/organisms/ActivityFeed/ActivityFeed.constants.d.ts +19 -0
- package/dist/components/organisms/ActivityFeed/ActivityFeed.constants.d.ts.map +1 -0
- package/dist/components/organisms/ActivityFeed/ActivityFeed.d.ts +11 -0
- package/dist/components/organisms/ActivityFeed/ActivityFeed.d.ts.map +1 -0
- package/dist/components/organisms/ActivityFeed/ActivityFeed.types.d.ts +102 -0
- package/dist/components/organisms/ActivityFeed/ActivityFeed.types.d.ts.map +1 -0
- package/dist/components/organisms/ActivityFeed/ActivityFeed.utils.d.ts +12 -0
- package/dist/components/organisms/ActivityFeed/ActivityFeed.utils.d.ts.map +1 -0
- package/dist/components/organisms/ActivityFeed/index.d.ts +4 -0
- package/dist/components/organisms/ActivityFeed/index.d.ts.map +1 -0
- package/dist/index.cjs.js +1031 -354
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +1020 -355
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Value and type primitives shared by every custom-field surface —
|
|
3
|
+
* manufacturing stages and inventory Extra properties alike.
|
|
4
|
+
*
|
|
5
|
+
* Feature folders import from here; they never import from each other.
|
|
6
|
+
*/
|
|
7
|
+
/** KYC-aligned set the backends accept. `boolean` is legacy — prefer `toggle`. */
|
|
8
|
+
export type CustomFieldType = 'text' | 'textarea' | 'email' | 'phone' | 'number' | 'date' | 'time' | 'dropdown' | 'radio' | 'checkbox' | 'multiSelect' | 'toggle' | 'boolean' | 'image' | 'file' | 'docsWithExpiry';
|
|
9
|
+
/** An uploaded object, stored verbatim by the backend as an opaque `value`. */
|
|
10
|
+
export interface UploadedFileValue {
|
|
11
|
+
/** S3 key returned by the presigned-URL flow. */
|
|
12
|
+
key: string;
|
|
13
|
+
name: string;
|
|
14
|
+
url?: string;
|
|
15
|
+
size?: number;
|
|
16
|
+
mimeType?: string;
|
|
17
|
+
}
|
|
18
|
+
/** `docsWithExpiry` pairs one upload with an expiry date. */
|
|
19
|
+
export interface DocsWithExpiryValue {
|
|
20
|
+
file?: UploadedFileValue | null;
|
|
21
|
+
expiryDate?: string | null;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Any single value a custom field can hold. Callers with extra cases compose
|
|
25
|
+
* on top — manufacturing's `StageValue` adds its certificate array.
|
|
26
|
+
*/
|
|
27
|
+
export type FieldValue = string | number | boolean | string[] | UploadedFileValue | DocsWithExpiryValue | null;
|
|
28
|
+
//# sourceMappingURL=CustomField.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomField.types.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/CustomField/CustomField.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,kFAAkF;AAClF,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,UAAU,GACV,OAAO,GACP,OAAO,GACP,QAAQ,GACR,MAAM,GACN,MAAM,GACN,UAAU,GACV,OAAO,GACP,UAAU,GACV,aAAa,GACb,QAAQ,GACR,SAAS,GACT,OAAO,GACP,MAAM,GACN,gBAAgB,CAAC;AAErB,+EAA+E;AAC/E,MAAM,WAAW,iBAAiB;IAChC,iDAAiD;IACjD,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,6DAA6D;AAC7D,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,MAAM,UAAU,GAClB,MAAM,GACN,MAAM,GACN,OAAO,GACP,MAAM,EAAE,GACR,iBAAiB,GACjB,mBAAmB,GACnB,IAAI,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { FieldValue } from './CustomField.types';
|
|
3
|
+
/** Upload variants, which the caller renders via `renderUpload`. */
|
|
4
|
+
export type CustomFieldUploadVariant = 'image' | 'file' | 'docsWithExpiry';
|
|
5
|
+
export interface CustomFieldDescriptor {
|
|
6
|
+
/** DOM id / form key for the rendered control. */
|
|
7
|
+
id: string;
|
|
8
|
+
type: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
options?: string[];
|
|
12
|
+
/** Latest date the picker allows. */
|
|
13
|
+
maxDate?: Date;
|
|
14
|
+
expiryDateLabel?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface CustomFieldInputProps {
|
|
17
|
+
field: CustomFieldDescriptor;
|
|
18
|
+
value: FieldValue;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
invalid?: boolean;
|
|
21
|
+
onChange: (value: FieldValue) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Upload control, supplied by the caller. Uploading needs an API client, so
|
|
24
|
+
* it is injected rather than imported — that is what keeps this component
|
|
25
|
+
* free of app dependencies.
|
|
26
|
+
*/
|
|
27
|
+
renderUpload?: (args: {
|
|
28
|
+
id: string;
|
|
29
|
+
variant: CustomFieldUploadVariant;
|
|
30
|
+
value: FieldValue;
|
|
31
|
+
expiryDateLabel?: string;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
onChange: (value: FieldValue) => void;
|
|
34
|
+
}) => ReactNode;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Renders one control for a field described by `type` and its option metadata.
|
|
38
|
+
*
|
|
39
|
+
* Covers the field types shared by every custom-field surface. Types specific
|
|
40
|
+
* to one feature stay with that feature, which handles them before delegating.
|
|
41
|
+
*/
|
|
42
|
+
export declare function CustomFieldInput({ field, value, disabled, invalid, onChange, renderUpload, }: CustomFieldInputProps): ReactNode;
|
|
43
|
+
//# sourceMappingURL=CustomFieldInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomFieldInput.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/CustomField/CustomFieldInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AAWrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD,oEAAoE;AACpE,MAAM,MAAM,wBAAwB,GAAG,OAAO,GAAG,MAAM,GAAG,gBAAgB,CAAC;AAE3E,MAAM,WAAW,qBAAqB;IACpC,kDAAkD;IAClD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,qCAAqC;IACrC,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,qBAAqB,CAAC;IAC7B,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE;QACpB,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,wBAAwB,CAAC;QAClC,KAAK,EAAE,UAAU,CAAC;QAClB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;KACvC,KAAK,SAAS,CAAC;CACjB;AAOD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,KAAK,EACL,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,YAAY,GACb,EAAE,qBAAqB,GAAG,SAAS,CA6LnC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { FieldValue } from './CustomField.types';
|
|
3
|
+
/** Muted dash, so an uncaptured field reads as blank rather than as a value. */
|
|
4
|
+
export declare const EmptyValue: () => ReactElement;
|
|
5
|
+
export interface CustomFieldValueProps {
|
|
6
|
+
type: string;
|
|
7
|
+
value: FieldValue;
|
|
8
|
+
/** Appended after a numeric value, e.g. `ct`. */
|
|
9
|
+
unit?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A captured value rendered for reading rather than editing. Edit forms use
|
|
13
|
+
* real inputs; a disabled input full of placeholders is much harder to scan
|
|
14
|
+
* than plain text, and reads as broken rather than empty.
|
|
15
|
+
*/
|
|
16
|
+
export declare function CustomFieldValue({ type, value, unit, }: CustomFieldValueProps): ReactElement;
|
|
17
|
+
//# sourceMappingURL=CustomFieldValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomFieldValue.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/CustomField/CustomFieldValue.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAEV,UAAU,EAEX,MAAM,qBAAqB,CAAC;AAmC7B,gFAAgF;AAChF,eAAO,MAAM,UAAU,QAAO,YAE7B,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,UAAU,CAAC;IAClB,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EACJ,KAAK,EACL,IAAI,GACL,EAAE,qBAAqB,GAAG,YAAY,CAgDtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldTypeIcon.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/CustomField/fieldTypeIcon.ts"],"names":[],"mappings":"AAAA,OAAO,EAeL,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AAqBtB,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAEtD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FieldValue } from './CustomField.types';
|
|
2
|
+
/** Shown in a read-only control whose value was never filled in. */
|
|
3
|
+
export declare const NOT_CAPTURED = "Not captured";
|
|
4
|
+
export declare const asText: (value: FieldValue) => string;
|
|
5
|
+
export declare const asList: (value: FieldValue) => string[];
|
|
6
|
+
/** Blank for display purposes — a number `0` is a real value, not blank. */
|
|
7
|
+
export declare const isBlank: (value: FieldValue) => boolean;
|
|
8
|
+
/** Treats blank strings, empty arrays and empty upload objects as uncaptured. */
|
|
9
|
+
export declare function isValueEmpty(value: FieldValue | undefined): boolean;
|
|
10
|
+
//# sourceMappingURL=fieldValueHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldValueHelpers.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/CustomField/fieldValueHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,oEAAoE;AACpE,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C,eAAO,MAAM,MAAM,GAAI,OAAO,UAAU,KAAG,MACH,CAAC;AAEzC,eAAO,MAAM,MAAM,GAAI,OAAO,UAAU,KAAG,MAAM,EAGzC,CAAC;AAET,4EAA4E;AAC5E,eAAO,MAAM,OAAO,GAAI,OAAO,UAAU,KAAG,OAC0B,CAAC;AAEvE,iFAAiF;AACjF,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAOnE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { CustomFieldInput } from './CustomFieldInput';
|
|
2
|
+
export { CustomFieldValue, EmptyValue } from './CustomFieldValue';
|
|
3
|
+
export { fieldTypeIcon } from './fieldTypeIcon';
|
|
4
|
+
export { asList, asText, isBlank, isValueEmpty, NOT_CAPTURED, } from './fieldValueHelpers';
|
|
5
|
+
export type { CustomFieldDescriptor, CustomFieldInputProps, CustomFieldUploadVariant, } from './CustomFieldInput';
|
|
6
|
+
export type { CustomFieldValueProps } from './CustomFieldValue';
|
|
7
|
+
export type { CustomFieldType, DocsWithExpiryValue, FieldValue, UploadedFileValue, } from './CustomField.types';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/CustomField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,MAAM,EACN,MAAM,EACN,OAAO,EACP,YAAY,EACZ,YAAY,GACb,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,YAAY,EACV,eAAe,EACf,mBAAmB,EACnB,UAAU,EACV,iBAAiB,GAClB,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const ACTIVITY_FEED_ARIA: {
|
|
2
|
+
readonly feedLabel: "Activity feed";
|
|
3
|
+
readonly expandRow: (summary: string) => string;
|
|
4
|
+
readonly collapseRow: (summary: string) => string;
|
|
5
|
+
readonly expandAutomatedGroup: (count: number) => string;
|
|
6
|
+
readonly collapseAutomatedGroup: (count: number) => string;
|
|
7
|
+
readonly copyReference: "Copy reference";
|
|
8
|
+
readonly changesTable: "Fields changed by this entry";
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=ActivityFeed.accessibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActivityFeed.accessibility.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/ActivityFeed/ActivityFeed.accessibility.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;kCAER,MAAM;oCACJ,MAAM;2CACC,MAAM;6CAEJ,MAAM;;;CAI9B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import type { ActivityDayGroup, ActivityEntry, ActivityStatusTone } from './ActivityFeed.types';
|
|
3
|
+
export declare function ActivityDayHeader({ group, }: {
|
|
4
|
+
group: ActivityDayGroup;
|
|
5
|
+
}): ReactElement;
|
|
6
|
+
interface ActivityRowProps {
|
|
7
|
+
entry: ActivityEntry;
|
|
8
|
+
showRail: boolean;
|
|
9
|
+
statusColors: Record<string, ActivityStatusTone>;
|
|
10
|
+
}
|
|
11
|
+
export declare function ActivityRow({ entry, showRail, statusColors, }: ActivityRowProps): ReactElement;
|
|
12
|
+
interface AutomatedGroupRowProps {
|
|
13
|
+
entries: ActivityEntry[];
|
|
14
|
+
statusColors: Record<string, ActivityStatusTone>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A run of automated entries folded into one line. Scheduled reminders are the
|
|
18
|
+
* bulk of a busy day and rarely the thing a reader came for.
|
|
19
|
+
*/
|
|
20
|
+
export declare function ActivityAutomatedGroupRow({ entries, statusColors, }: AutomatedGroupRowProps): ReactElement;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=ActivityFeed.components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActivityFeed.components.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/ActivityFeed/ActivityFeed.components.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAgBpD,OAAO,KAAK,EACV,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAE9B,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,GACN,EAAE;IACD,KAAK,EAAE,gBAAgB,CAAC;CACzB,GAAG,YAAY,CAYf;AA6ND,UAAU,gBAAgB;IACxB,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;CAClD;AAED,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,YAAY,GACb,EAAE,gBAAgB,GAAG,YAAY,CAyFjC;AAED,UAAU,sBAAsB;IAC9B,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;CAClD;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,OAAO,EACP,YAAY,GACb,EAAE,sBAAsB,GAAG,YAAY,CAwDvC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type LucideIcon } from 'lucide-react';
|
|
2
|
+
import type { ActivityCategory } from './ActivityFeed.types';
|
|
3
|
+
interface CategoryMeta {
|
|
4
|
+
label: string;
|
|
5
|
+
icon: LucideIcon;
|
|
6
|
+
/** Token-based tone for the row's icon disc and the filter pill's dot. */
|
|
7
|
+
iconClassName: string;
|
|
8
|
+
dotClassName: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Categories carry both a colour and a distinct icon — the colour alone never
|
|
12
|
+
* distinguishes them, so the feed stays readable without relying on hue.
|
|
13
|
+
*/
|
|
14
|
+
export declare const ACTIVITY_CATEGORY_META: Record<ActivityCategory, CategoryMeta>;
|
|
15
|
+
export declare const ACTIVITY_CATEGORIES: ActivityCategory[];
|
|
16
|
+
/** Feed grid: time gutter, icon rail, content, expand control. */
|
|
17
|
+
export declare const ACTIVITY_ROW_GRID = "grid grid-cols-[52px_32px_minmax(0,1fr)_36px] gap-x-3";
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=ActivityFeed.constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActivityFeed.constants.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/ActivityFeed/ActivityFeed.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,UAAU,YAAY;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,UAAU,CAAC;IACjB,0EAA0E;IAC1E,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,gBAAgB,EAAE,YAAY,CA+BzE,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAE3B,gBAAgB,EAAE,CAAC;AAExB,kEAAkE;AAClE,eAAO,MAAM,iBAAiB,0DAC2B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import type { ActivityFeedProps } from './ActivityFeed.types';
|
|
3
|
+
/**
|
|
4
|
+
* Day-grouped activity feed: a time gutter, a category icon on a connecting
|
|
5
|
+
* rail, a one-sentence description, and per-row details on demand.
|
|
6
|
+
*
|
|
7
|
+
* Presentational by design — it fetches nothing and knows no domain vocabulary.
|
|
8
|
+
* The host maps its records to `ActivityEntry` and owns paging via `onLoadMore`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function ActivityFeed({ entries, isLoading, hasMore, isLoadingMore, onLoadMore, groupAutomated, fill, statusColors, emptyMessage, className, }: ActivityFeedProps): ReactElement;
|
|
11
|
+
//# sourceMappingURL=ActivityFeed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActivityFeed.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/ActivityFeed/ActivityFeed.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAYnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAiB9D;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,SAAiB,EACjB,OAAe,EACf,aAAqB,EACrB,UAAU,EACV,cAAqB,EACrB,IAAY,EACZ,YAAiB,EACjB,YAA0C,EAC1C,SAAS,GACV,EAAE,iBAAiB,GAAG,YAAY,CAyElC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data contract for the activity feed. Deliberately free of any KYC vocabulary:
|
|
3
|
+
* the host maps its own records onto these entries, so the feed can be lifted
|
|
4
|
+
* into the design system and reused by another product unchanged.
|
|
5
|
+
*/
|
|
6
|
+
export type ActivityCategory = 'customer' | 'form' | 'communication' | 'verification' | 'status';
|
|
7
|
+
export type ActivityActorKind = 'admin' | 'customer' | 'system';
|
|
8
|
+
export interface ActivityActor {
|
|
9
|
+
id?: string;
|
|
10
|
+
name: string;
|
|
11
|
+
kind: ActivityActorKind;
|
|
12
|
+
}
|
|
13
|
+
/** Who the entry is about, as recorded at the time it happened. */
|
|
14
|
+
export interface ActivityContact {
|
|
15
|
+
id?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
company?: string;
|
|
18
|
+
email?: string;
|
|
19
|
+
roles?: string[];
|
|
20
|
+
isActive?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** One field-level change, rendered as a Before → After row. */
|
|
23
|
+
export interface ActivityChange {
|
|
24
|
+
field: string;
|
|
25
|
+
before?: string;
|
|
26
|
+
after?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ActivityLink {
|
|
29
|
+
label: string;
|
|
30
|
+
onClick: () => void;
|
|
31
|
+
}
|
|
32
|
+
export interface ActivityEntry {
|
|
33
|
+
id: string;
|
|
34
|
+
/** ISO timestamp. Drives both the day grouping and the time gutter. */
|
|
35
|
+
createdAt: string;
|
|
36
|
+
category: ActivityCategory;
|
|
37
|
+
actor: ActivityActor;
|
|
38
|
+
/** Sentence fragment after the actor's name, e.g. "approved KYC for". */
|
|
39
|
+
action: string;
|
|
40
|
+
/** Optional linked subject closing the sentence, e.g. the company. */
|
|
41
|
+
subject?: ActivityLink;
|
|
42
|
+
/** One muted line under the sentence. Keep it to the essentials. */
|
|
43
|
+
detail?: string;
|
|
44
|
+
statusFrom?: string;
|
|
45
|
+
statusTo?: string;
|
|
46
|
+
contact?: ActivityContact;
|
|
47
|
+
changes: ActivityChange[];
|
|
48
|
+
/**
|
|
49
|
+
* Show the changes table even when `changes` is empty, to state that a field
|
|
50
|
+
* diff was expected and none was recorded. Off hides the table entirely, which
|
|
51
|
+
* is right for events that never describe a change.
|
|
52
|
+
*/
|
|
53
|
+
changesExpected?: boolean;
|
|
54
|
+
/** Correlation id shown in the expanded footer. */
|
|
55
|
+
reference: string;
|
|
56
|
+
notes?: string;
|
|
57
|
+
/** Extra links in the expanded footer, e.g. "Open customer". */
|
|
58
|
+
links?: ActivityLink[];
|
|
59
|
+
}
|
|
60
|
+
export interface ActivityFeedProps {
|
|
61
|
+
entries: ActivityEntry[];
|
|
62
|
+
isLoading?: boolean;
|
|
63
|
+
/** Renders the load-more control when there are older entries to fetch. */
|
|
64
|
+
hasMore?: boolean;
|
|
65
|
+
isLoadingMore?: boolean;
|
|
66
|
+
onLoadMore?: () => void;
|
|
67
|
+
/**
|
|
68
|
+
* Collapse consecutive automated entries on the same day into one row that
|
|
69
|
+
* expands on demand. Off leaves every automated entry in place.
|
|
70
|
+
*/
|
|
71
|
+
groupAutomated?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Stretch to the host's height. Off (the default) leaves the feed sized to its
|
|
74
|
+
* content, which is what a page that scrolls as a whole wants.
|
|
75
|
+
*/
|
|
76
|
+
fill?: boolean;
|
|
77
|
+
/** Tone map for the status chips, keyed by status label. */
|
|
78
|
+
statusColors?: Record<string, ActivityStatusTone>;
|
|
79
|
+
emptyMessage?: string;
|
|
80
|
+
className?: string;
|
|
81
|
+
}
|
|
82
|
+
export type ActivityStatusTone = 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'destructive';
|
|
83
|
+
/** A day's worth of entries, newest-first or oldest-first as supplied. */
|
|
84
|
+
export interface ActivityDayGroup {
|
|
85
|
+
key: string;
|
|
86
|
+
/** "Today" / "Yesterday" / weekday name. */
|
|
87
|
+
label: string;
|
|
88
|
+
/** Full date, shown beside the label. */
|
|
89
|
+
dateLabel: string;
|
|
90
|
+
rows: ActivityRowItem[];
|
|
91
|
+
count: number;
|
|
92
|
+
}
|
|
93
|
+
/** A feed row is either one entry or a collapsed run of automated ones. */
|
|
94
|
+
export type ActivityRowItem = {
|
|
95
|
+
kind: 'entry';
|
|
96
|
+
entry: ActivityEntry;
|
|
97
|
+
} | {
|
|
98
|
+
kind: 'automated-group';
|
|
99
|
+
id: string;
|
|
100
|
+
entries: ActivityEntry[];
|
|
101
|
+
};
|
|
102
|
+
//# sourceMappingURL=ActivityFeed.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActivityFeed.types.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/ActivityFeed/ActivityFeed.types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ActivityDayGroup, ActivityEntry } from './ActivityFeed.types';
|
|
2
|
+
export declare function formatActivityTime(iso: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* Bucket entries by calendar day, preserving the order they arrive in so the
|
|
5
|
+
* caller keeps control of newest-first vs oldest-first.
|
|
6
|
+
*/
|
|
7
|
+
export declare function groupActivityByDay(entries: ActivityEntry[], groupAutomated: boolean, now?: Date): ActivityDayGroup[];
|
|
8
|
+
/** Initials for the contact avatar, capped at two letters. */
|
|
9
|
+
export declare function initialsOf(name: string): string;
|
|
10
|
+
/** Shortens a correlation id so it never pushes the footer's actions off-row. */
|
|
11
|
+
export declare function truncateReference(reference: string, max?: number): string;
|
|
12
|
+
//# sourceMappingURL=ActivityFeed.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActivityFeed.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/ActivityFeed/ActivityFeed.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,aAAa,EAEd,MAAM,sBAAsB,CAAC;AAE9B,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQtD;AAgED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,aAAa,EAAE,EACxB,cAAc,EAAE,OAAO,EACvB,GAAG,GAAE,IAAiB,GACrB,gBAAgB,EAAE,CAyBpB;AAED,8DAA8D;AAC9D,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQ/C;AAED,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,SAAK,GAAG,MAAM,CAErE"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ActivityFeed } from './ActivityFeed';
|
|
2
|
+
export { ACTIVITY_CATEGORIES, ACTIVITY_CATEGORY_META, } from './ActivityFeed.constants';
|
|
3
|
+
export type { ActivityActor, ActivityActorKind, ActivityCategory, ActivityChange, ActivityContact, ActivityDayGroup, ActivityEntry, ActivityFeedProps, ActivityLink, ActivityRowItem, ActivityStatusTone, } from './ActivityFeed.types';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/ActivityFeed/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,kBAAkB,GACnB,MAAM,sBAAsB,CAAC"}
|