@datum-cloud/activity-ui 0.6.0 → 0.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.
@@ -0,0 +1,40 @@
1
+ import type { Activity, Tenant } from '../types/activity';
2
+ import { type NormalizedVerb } from './verb';
3
+ /**
4
+ * A run of consecutive activities that share a verb, resource kind, actor,
5
+ * and tenant — e.g. a burst of DNS records created by the same controller
6
+ * in one reconcile. A group of size 1 wraps a single ungrouped activity.
7
+ */
8
+ export interface ActivityGroup {
9
+ key: string;
10
+ verb: NormalizedVerb;
11
+ kind: string;
12
+ actorName: string;
13
+ actorDisplayName?: string;
14
+ tenant?: Tenant;
15
+ activities: Activity[];
16
+ count: number;
17
+ /** Timestamp of the most recent activity in the group (activities are newest-first). */
18
+ latestTimestamp?: string;
19
+ }
20
+ /**
21
+ * Group consecutive activities that share verb + resource kind + actor +
22
+ * tenant. Activities are assumed to already be sorted newest-first (as
23
+ * returned by `useActivityFeed`); only adjacent items are merged, so a
24
+ * burst of matching activities collapses into one group without needing
25
+ * any time-window heuristics.
26
+ */
27
+ export declare function groupActivities(activities: Activity[]): ActivityGroup[];
28
+ export interface ActivityDaySection {
29
+ /** Day label, e.g. "Today", "Yesterday", or a formatted date */
30
+ label: string;
31
+ groups: ActivityGroup[];
32
+ }
33
+ /**
34
+ * Bucket activities into calendar-day sections (Today / Yesterday / a
35
+ * formatted date), then group consecutive matching activities within each
36
+ * day. Bucketing by day first (rather than grouping across the whole list)
37
+ * keeps a group from silently spanning a day boundary.
38
+ */
39
+ export declare function groupActivitiesByDay(activities: Activity[]): ActivityDaySection[];
40
+ //# sourceMappingURL=groupActivities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"groupActivities.d.ts","sourceRoot":"","sources":["../../src/lib/groupActivities.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAA8B,KAAK,cAAc,EAAE,MAAM,QAAQ,CAAC;AAEzE;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,QAAQ,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,wFAAwF;IACxF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAaD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,QAAQ,EAAE,GAAG,aAAa,EAAE,CA4BvE;AAED,MAAM,WAAW,kBAAkB;IACjC,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,aAAa,EAAE,CAAC;CACzB;AAWD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,QAAQ,EAAE,GAAG,kBAAkB,EAAE,CAwBjF"}
@@ -0,0 +1,22 @@
1
+ import type { ElementType } from 'react';
2
+ /**
3
+ * Extract verb from activity summary (e.g., "alice created HTTPProxy" -> "created")
4
+ */
5
+ export declare function extractVerb(summary: string): string;
6
+ export type NormalizedVerb = 'create' | 'update' | 'delete' | 'other';
7
+ /**
8
+ * Normalize a verb to a canonical form used for coloring/icons/grouping.
9
+ */
10
+ export declare function normalizeVerb(verb: string): NormalizedVerb;
11
+ /**
12
+ * Get icon container + icon color classes based on verb
13
+ */
14
+ export declare function getActionIconClasses(verb: string): {
15
+ container: string;
16
+ icon: string;
17
+ };
18
+ /**
19
+ * Get the Lucide icon component for the timeline node based on verb
20
+ */
21
+ export declare function getTimelineIcon(verb: string): ElementType;
22
+ //# sourceMappingURL=verb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verb.d.ts","sourceRoot":"","sources":["../../src/lib/verb.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEzC;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAMnD;AAED,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEtE;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAa1D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAwBtF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAYzD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datum-cloud/activity-ui",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "React components for Kubernetes Activity",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",