@datum-cloud/activity-ui 0.6.0-dev.5b51180 → 0.6.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/dist/index.esm.js CHANGED
@@ -1188,48 +1188,6 @@ function constructNow(date) {
1188
1188
  return constructFrom(date, Date.now());
1189
1189
  }
1190
1190
 
1191
- /**
1192
- * The {@link isSameDay} function options.
1193
- */
1194
-
1195
- /**
1196
- * @name isSameDay
1197
- * @category Day Helpers
1198
- * @summary Are the given dates in the same day (and year and month)?
1199
- *
1200
- * @description
1201
- * Are the given dates in the same day (and year and month)?
1202
- *
1203
- * @param laterDate - The first date to check
1204
- * @param earlierDate - The second date to check
1205
- * @param options - An object with options
1206
- *
1207
- * @returns The dates are in the same day (and year and month)
1208
- *
1209
- * @example
1210
- * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?
1211
- * const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))
1212
- * //=> true
1213
- *
1214
- * @example
1215
- * // Are 4 September and 4 October in the same day?
1216
- * const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))
1217
- * //=> false
1218
- *
1219
- * @example
1220
- * // Are 4 September, 2014 and 4 September, 2015 in the same day?
1221
- * const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))
1222
- * //=> false
1223
- */
1224
- function isSameDay(laterDate, earlierDate, options) {
1225
- const [dateLeft_, dateRight_] = normalizeDates(
1226
- options?.in,
1227
- laterDate,
1228
- earlierDate,
1229
- );
1230
- return +startOfDay(dateLeft_) === +startOfDay(dateRight_);
1231
- }
1232
-
1233
1191
  /**
1234
1192
  * @name isDate
1235
1193
  * @category Common Helpers
@@ -3966,36 +3924,6 @@ function formatISO(date, options) {
3966
3924
  return result;
3967
3925
  }
3968
3926
 
3969
- /**
3970
- * The {@link isToday} function options.
3971
- */
3972
-
3973
- /**
3974
- * @name isToday
3975
- * @category Day Helpers
3976
- * @summary Is the given date today?
3977
- * @pure false
3978
- *
3979
- * @description
3980
- * Is the given date today?
3981
- *
3982
- * @param date - The date to check
3983
- * @param options - An object with options
3984
- *
3985
- * @returns The date is today
3986
- *
3987
- * @example
3988
- * // If today is 6 October 2014, is 6 October 14:00:00 today?
3989
- * const result = isToday(new Date(2014, 9, 6, 14, 0))
3990
- * //=> true
3991
- */
3992
- function isToday(date, options) {
3993
- return isSameDay(
3994
- constructFrom(date, date),
3995
- constructNow(date),
3996
- );
3997
- }
3998
-
3999
3927
  /**
4000
3928
  * The {@link subDays} function options.
4001
3929
  */
@@ -4023,36 +3951,6 @@ function subDays(date, amount, options) {
4023
3951
  return addDays(date, -amount, options);
4024
3952
  }
4025
3953
 
4026
- /**
4027
- * The {@link isYesterday} function options.
4028
- */
4029
-
4030
- /**
4031
- * @name isYesterday
4032
- * @category Day Helpers
4033
- * @summary Is the given date yesterday?
4034
- * @pure false
4035
- *
4036
- * @description
4037
- * Is the given date yesterday?
4038
- *
4039
- * @param date - The date to check
4040
- * @param options - An object with options
4041
- *
4042
- * @returns The date is yesterday
4043
- *
4044
- * @example
4045
- * // If today is 6 October 2014, is 5 October 14:00:00 yesterday?
4046
- * const result = isYesterday(new Date(2014, 9, 5, 14, 0))
4047
- * //=> true
4048
- */
4049
- function isYesterday(date, options) {
4050
- return isSameDay(
4051
- constructFrom(date, date),
4052
- subDays(constructNow(date), 1),
4053
- );
4054
- }
4055
-
4056
3954
  /**
4057
3955
  * The {@link subHours} function options.
4058
3956
  */
@@ -7994,7 +7892,7 @@ const createLucideIcon = (iconName, iconNode) => {
7994
7892
  */
7995
7893
 
7996
7894
 
7997
- const __iconNode$o = [
7895
+ const __iconNode$n = [
7998
7896
  [
7999
7897
  "path",
8000
7898
  {
@@ -8003,7 +7901,7 @@ const __iconNode$o = [
8003
7901
  }
8004
7902
  ]
8005
7903
  ];
8006
- const Activity = createLucideIcon("activity", __iconNode$o);
7904
+ const Activity = createLucideIcon("activity", __iconNode$n);
8007
7905
 
8008
7906
  /**
8009
7907
  * @license lucide-react v0.577.0 - ISC
@@ -8013,7 +7911,7 @@ const Activity = createLucideIcon("activity", __iconNode$o);
8013
7911
  */
8014
7912
 
8015
7913
 
8016
- const __iconNode$n = [
7914
+ const __iconNode$m = [
8017
7915
  ["path", { d: "M10.268 21a2 2 0 0 0 3.464 0", key: "vwvbt9" }],
8018
7916
  [
8019
7917
  "path",
@@ -8023,7 +7921,7 @@ const __iconNode$n = [
8023
7921
  }
8024
7922
  ]
8025
7923
  ];
8026
- const Bell = createLucideIcon("bell", __iconNode$n);
7924
+ const Bell = createLucideIcon("bell", __iconNode$m);
8027
7925
 
8028
7926
  /**
8029
7927
  * @license lucide-react v0.577.0 - ISC
@@ -8033,8 +7931,8 @@ const Bell = createLucideIcon("bell", __iconNode$n);
8033
7931
  */
8034
7932
 
8035
7933
 
8036
- const __iconNode$m = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
8037
- const Check = createLucideIcon("check", __iconNode$m);
7934
+ const __iconNode$l = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
7935
+ const Check = createLucideIcon("check", __iconNode$l);
8038
7936
 
8039
7937
  /**
8040
7938
  * @license lucide-react v0.577.0 - ISC
@@ -8044,8 +7942,8 @@ const Check = createLucideIcon("check", __iconNode$m);
8044
7942
  */
8045
7943
 
8046
7944
 
8047
- const __iconNode$l = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
8048
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$l);
7945
+ const __iconNode$k = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
7946
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$k);
8049
7947
 
8050
7948
  /**
8051
7949
  * @license lucide-react v0.577.0 - ISC
@@ -8055,8 +7953,8 @@ const ChevronDown = createLucideIcon("chevron-down", __iconNode$l);
8055
7953
  */
8056
7954
 
8057
7955
 
8058
- const __iconNode$k = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
8059
- const ChevronRight = createLucideIcon("chevron-right", __iconNode$k);
7956
+ const __iconNode$j = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
7957
+ const ChevronRight = createLucideIcon("chevron-right", __iconNode$j);
8060
7958
 
8061
7959
  /**
8062
7960
  * @license lucide-react v0.577.0 - ISC
@@ -8066,8 +7964,8 @@ const ChevronRight = createLucideIcon("chevron-right", __iconNode$k);
8066
7964
  */
8067
7965
 
8068
7966
 
8069
- const __iconNode$j = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
8070
- const ChevronUp = createLucideIcon("chevron-up", __iconNode$j);
7967
+ const __iconNode$i = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
7968
+ const ChevronUp = createLucideIcon("chevron-up", __iconNode$i);
8071
7969
 
8072
7970
  /**
8073
7971
  * @license lucide-react v0.577.0 - ISC
@@ -8077,12 +7975,12 @@ const ChevronUp = createLucideIcon("chevron-up", __iconNode$j);
8077
7975
  */
8078
7976
 
8079
7977
 
8080
- const __iconNode$i = [
7978
+ const __iconNode$h = [
8081
7979
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
8082
7980
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
8083
7981
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
8084
7982
  ];
8085
- const CircleAlert = createLucideIcon("circle-alert", __iconNode$i);
7983
+ const CircleAlert = createLucideIcon("circle-alert", __iconNode$h);
8086
7984
 
8087
7985
  /**
8088
7986
  * @license lucide-react v0.577.0 - ISC
@@ -8092,11 +7990,11 @@ const CircleAlert = createLucideIcon("circle-alert", __iconNode$i);
8092
7990
  */
8093
7991
 
8094
7992
 
8095
- const __iconNode$h = [
7993
+ const __iconNode$g = [
8096
7994
  ["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
8097
7995
  ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
8098
7996
  ];
8099
- const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$h);
7997
+ const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$g);
8100
7998
 
8101
7999
  /**
8102
8000
  * @license lucide-react v0.577.0 - ISC
@@ -8106,11 +8004,11 @@ const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$h);
8106
8004
  */
8107
8005
 
8108
8006
 
8109
- const __iconNode$g = [
8007
+ const __iconNode$f = [
8110
8008
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
8111
8009
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
8112
8010
  ];
8113
- const CircleCheck = createLucideIcon("circle-check", __iconNode$g);
8011
+ const CircleCheck = createLucideIcon("circle-check", __iconNode$f);
8114
8012
 
8115
8013
  /**
8116
8014
  * @license lucide-react v0.577.0 - ISC
@@ -8120,12 +8018,12 @@ const CircleCheck = createLucideIcon("circle-check", __iconNode$g);
8120
8018
  */
8121
8019
 
8122
8020
 
8123
- const __iconNode$f = [
8021
+ const __iconNode$e = [
8124
8022
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
8125
8023
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
8126
8024
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
8127
8025
  ];
8128
- const CircleX = createLucideIcon("circle-x", __iconNode$f);
8026
+ const CircleX = createLucideIcon("circle-x", __iconNode$e);
8129
8027
 
8130
8028
  /**
8131
8029
  * @license lucide-react v0.577.0 - ISC
@@ -8135,11 +8033,11 @@ const CircleX = createLucideIcon("circle-x", __iconNode$f);
8135
8033
  */
8136
8034
 
8137
8035
 
8138
- const __iconNode$e = [
8036
+ const __iconNode$d = [
8139
8037
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
8140
8038
  ["path", { d: "M12 6v6l4 2", key: "mmk7yg" }]
8141
8039
  ];
8142
- const Clock = createLucideIcon("clock", __iconNode$e);
8040
+ const Clock = createLucideIcon("clock", __iconNode$d);
8143
8041
 
8144
8042
  /**
8145
8043
  * @license lucide-react v0.577.0 - ISC
@@ -8149,11 +8047,11 @@ const Clock = createLucideIcon("clock", __iconNode$e);
8149
8047
  */
8150
8048
 
8151
8049
 
8152
- const __iconNode$d = [
8050
+ const __iconNode$c = [
8153
8051
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
8154
8052
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
8155
8053
  ];
8156
- const Copy = createLucideIcon("copy", __iconNode$d);
8054
+ const Copy = createLucideIcon("copy", __iconNode$c);
8157
8055
 
8158
8056
  /**
8159
8057
  * @license lucide-react v0.577.0 - ISC
@@ -8163,7 +8061,7 @@ const Copy = createLucideIcon("copy", __iconNode$d);
8163
8061
  */
8164
8062
 
8165
8063
 
8166
- const __iconNode$c = [
8064
+ const __iconNode$b = [
8167
8065
  [
8168
8066
  "path",
8169
8067
  {
@@ -8173,7 +8071,7 @@ const __iconNode$c = [
8173
8071
  ],
8174
8072
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
8175
8073
  ];
8176
- const Eye = createLucideIcon("eye", __iconNode$c);
8074
+ const Eye = createLucideIcon("eye", __iconNode$b);
8177
8075
 
8178
8076
  /**
8179
8077
  * @license lucide-react v0.577.0 - ISC
@@ -8183,8 +8081,8 @@ const Eye = createLucideIcon("eye", __iconNode$c);
8183
8081
  */
8184
8082
 
8185
8083
 
8186
- const __iconNode$b = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
8187
- const LoaderCircle = createLucideIcon("loader-circle", __iconNode$b);
8084
+ const __iconNode$a = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
8085
+ const LoaderCircle = createLucideIcon("loader-circle", __iconNode$a);
8188
8086
 
8189
8087
  /**
8190
8088
  * @license lucide-react v0.577.0 - ISC
@@ -8194,7 +8092,7 @@ const LoaderCircle = createLucideIcon("loader-circle", __iconNode$b);
8194
8092
  */
8195
8093
 
8196
8094
 
8197
- const __iconNode$a = [
8095
+ const __iconNode$9 = [
8198
8096
  [
8199
8097
  "path",
8200
8098
  {
@@ -8204,7 +8102,7 @@ const __iconNode$a = [
8204
8102
  ],
8205
8103
  ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
8206
8104
  ];
8207
- const Pencil = createLucideIcon("pencil", __iconNode$a);
8105
+ const Pencil = createLucideIcon("pencil", __iconNode$9);
8208
8106
 
8209
8107
  /**
8210
8108
  * @license lucide-react v0.577.0 - ISC
@@ -8214,11 +8112,11 @@ const Pencil = createLucideIcon("pencil", __iconNode$a);
8214
8112
  */
8215
8113
 
8216
8114
 
8217
- const __iconNode$9 = [
8115
+ const __iconNode$8 = [
8218
8116
  ["path", { d: "M5 12h14", key: "1ays0h" }],
8219
8117
  ["path", { d: "M12 5v14", key: "s699le" }]
8220
8118
  ];
8221
- const Plus = createLucideIcon("plus", __iconNode$9);
8119
+ const Plus = createLucideIcon("plus", __iconNode$8);
8222
8120
 
8223
8121
  /**
8224
8122
  * @license lucide-react v0.577.0 - ISC
@@ -8228,13 +8126,13 @@ const Plus = createLucideIcon("plus", __iconNode$9);
8228
8126
  */
8229
8127
 
8230
8128
 
8231
- const __iconNode$8 = [
8129
+ const __iconNode$7 = [
8232
8130
  ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
8233
8131
  ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
8234
8132
  ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
8235
8133
  ["path", { d: "M8 16H3v5", key: "1cv678" }]
8236
8134
  ];
8237
- const RefreshCw = createLucideIcon("refresh-cw", __iconNode$8);
8135
+ const RefreshCw = createLucideIcon("refresh-cw", __iconNode$7);
8238
8136
 
8239
8137
  /**
8240
8138
  * @license lucide-react v0.577.0 - ISC
@@ -8244,11 +8142,11 @@ const RefreshCw = createLucideIcon("refresh-cw", __iconNode$8);
8244
8142
  */
8245
8143
 
8246
8144
 
8247
- const __iconNode$7 = [
8145
+ const __iconNode$6 = [
8248
8146
  ["path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8", key: "1p45f6" }],
8249
8147
  ["path", { d: "M21 3v5h-5", key: "1q7to0" }]
8250
8148
  ];
8251
- const RotateCw = createLucideIcon("rotate-cw", __iconNode$7);
8149
+ const RotateCw = createLucideIcon("rotate-cw", __iconNode$6);
8252
8150
 
8253
8151
  /**
8254
8152
  * @license lucide-react v0.577.0 - ISC
@@ -8258,32 +8156,11 @@ const RotateCw = createLucideIcon("rotate-cw", __iconNode$7);
8258
8156
  */
8259
8157
 
8260
8158
 
8261
- const __iconNode$6 = [
8159
+ const __iconNode$5 = [
8262
8160
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
8263
8161
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
8264
8162
  ];
8265
- const Search = createLucideIcon("search", __iconNode$6);
8266
-
8267
- /**
8268
- * @license lucide-react v0.577.0 - ISC
8269
- *
8270
- * This source code is licensed under the ISC license.
8271
- * See the LICENSE file in the root directory of this source tree.
8272
- */
8273
-
8274
-
8275
- const __iconNode$5 = [
8276
- ["path", { d: "M10 5H3", key: "1qgfaw" }],
8277
- ["path", { d: "M12 19H3", key: "yhmn1j" }],
8278
- ["path", { d: "M14 3v4", key: "1sua03" }],
8279
- ["path", { d: "M16 17v4", key: "1q0r14" }],
8280
- ["path", { d: "M21 12h-9", key: "1o4lsq" }],
8281
- ["path", { d: "M21 19h-5", key: "1rlt1p" }],
8282
- ["path", { d: "M21 5h-7", key: "1oszz2" }],
8283
- ["path", { d: "M8 10v4", key: "tgpxqk" }],
8284
- ["path", { d: "M8 12H3", key: "a7s4jb" }]
8285
- ];
8286
- const SlidersHorizontal = createLucideIcon("sliders-horizontal", __iconNode$5);
8163
+ const Search = createLucideIcon("search", __iconNode$5);
8287
8164
 
8288
8165
  /**
8289
8166
  * @license lucide-react v0.577.0 - ISC
@@ -10413,6 +10290,36 @@ function ActivityExpandedDetails({ activity, compact = false, }) {
10413
10290
  return (jsx(TooltipProvider, { children: compact ? (jsx(DetailPanelShell, { children: body })) : (jsx("div", { className: "mt-4 pt-4 border-t border-border", children: body })) }));
10414
10291
  }
10415
10292
 
10293
+ // Number of columns rendered for the feed variant. Used as the colSpan on
10294
+ // the expanded-detail row so it stretches across the full width.
10295
+ const ACTIVITY_FEED_COLUMN_COUNT = 5;
10296
+ /**
10297
+ * Get avatar initials from actor name
10298
+ */
10299
+ function getActorInitials(name) {
10300
+ const parts = name.split(/[@\s.]+/).filter(Boolean);
10301
+ if (parts.length === 0)
10302
+ return "?";
10303
+ if (parts.length === 1)
10304
+ return parts[0].charAt(0).toUpperCase();
10305
+ return (parts[0].charAt(0) + parts[parts.length - 1].charAt(0)).toUpperCase();
10306
+ }
10307
+ /**
10308
+ * Get Tailwind classes for actor avatar based on actor type
10309
+ */
10310
+ function getActorAvatarClasses(actorType, compact) {
10311
+ const baseClasses = cn("rounded-full flex items-center justify-center shrink-0 font-semibold", compact ? "w-5 h-5 text-1xs" : "w-6 h-6 text-1xs");
10312
+ switch (actorType) {
10313
+ case "user":
10314
+ return cn(baseClasses, "bg-primary text-primary-foreground");
10315
+ case "controller":
10316
+ return cn(baseClasses, "bg-secondary text-secondary-foreground");
10317
+ case "machine account":
10318
+ return cn(baseClasses, "bg-muted text-muted-foreground");
10319
+ default:
10320
+ return cn(baseClasses, "bg-muted text-muted-foreground");
10321
+ }
10322
+ }
10416
10323
  /**
10417
10324
  * Extract verb from activity summary (e.g., "alice created HTTPProxy" -> "created")
10418
10325
  */
@@ -10421,24 +10328,24 @@ function extractVerb(summary) {
10421
10328
  if (words.length >= 2) {
10422
10329
  return words[1].toLowerCase();
10423
10330
  }
10424
- return 'unknown';
10331
+ return "unknown";
10425
10332
  }
10426
10333
  /**
10427
- * Normalize a verb to a canonical form used for coloring/icons/grouping.
10334
+ * Normalize verb to a canonical form for coloring
10428
10335
  */
10429
10336
  function normalizeVerb(verb) {
10430
10337
  const normalized = verb.toLowerCase();
10431
- if (normalized.includes('create') || normalized.includes('add'))
10432
- return 'create';
10433
- if (normalized.includes('delete') || normalized.includes('remove'))
10434
- return 'delete';
10435
- if (normalized.includes('update') ||
10436
- normalized.includes('patch') ||
10437
- normalized.includes('modify') ||
10438
- normalized.includes('change') ||
10439
- normalized.includes('edit'))
10440
- return 'update';
10441
- return 'other';
10338
+ if (normalized.includes("create") || normalized.includes("add"))
10339
+ return "create";
10340
+ if (normalized.includes("delete") || normalized.includes("remove"))
10341
+ return "delete";
10342
+ if (normalized.includes("update") ||
10343
+ normalized.includes("patch") ||
10344
+ normalized.includes("modify") ||
10345
+ normalized.includes("change") ||
10346
+ normalized.includes("edit"))
10347
+ return "update";
10348
+ return "other";
10442
10349
  }
10443
10350
  /**
10444
10351
  * Get icon container + icon color classes based on verb
@@ -10446,25 +10353,25 @@ function normalizeVerb(verb) {
10446
10353
  function getActionIconClasses(verb) {
10447
10354
  const normalizedVerb = normalizeVerb(verb);
10448
10355
  switch (normalizedVerb) {
10449
- case 'create':
10356
+ case "create":
10450
10357
  return {
10451
- container: 'bg-blue-50 dark:bg-blue-950',
10452
- icon: 'text-blue-500 dark:text-blue-400',
10358
+ container: "bg-[var(--success-100)]",
10359
+ icon: "text-[var(--success-500)]",
10453
10360
  };
10454
- case 'update':
10361
+ case "update":
10455
10362
  return {
10456
- container: 'bg-green-50 dark:bg-green-950',
10457
- icon: 'text-green-600 dark:text-green-400',
10363
+ container: "bg-[var(--info-100)]",
10364
+ icon: "text-[var(--info-500)]",
10458
10365
  };
10459
- case 'delete':
10366
+ case "delete":
10460
10367
  return {
10461
- container: 'bg-red-50 dark:bg-red-950',
10462
- icon: 'text-red-500 dark:text-red-400',
10368
+ container: "bg-destructive/10",
10369
+ icon: "text-destructive",
10463
10370
  };
10464
10371
  default:
10465
10372
  return {
10466
- container: 'bg-slate-100 dark:bg-slate-800',
10467
- icon: 'text-slate-500 dark:text-slate-400',
10373
+ container: "bg-muted",
10374
+ icon: "text-muted-foreground",
10468
10375
  };
10469
10376
  }
10470
10377
  }
@@ -10474,51 +10381,20 @@ function getActionIconClasses(verb) {
10474
10381
  function getTimelineIcon(verb) {
10475
10382
  const normalizedVerb = normalizeVerb(verb);
10476
10383
  switch (normalizedVerb) {
10477
- case 'create':
10384
+ case "create":
10478
10385
  return Plus;
10479
- case 'update':
10386
+ case "update":
10480
10387
  return Pencil;
10481
- case 'delete':
10388
+ case "delete":
10482
10389
  return Trash2;
10483
10390
  default:
10484
10391
  return Activity;
10485
10392
  }
10486
10393
  }
10487
-
10488
- // Number of columns rendered for the feed variant. Used as the colSpan on
10489
- // the expanded-detail row so it stretches across the full width.
10490
- const ACTIVITY_FEED_COLUMN_COUNT = 5;
10491
- /**
10492
- * Get avatar initials from actor name
10493
- */
10494
- function getActorInitials(name) {
10495
- const parts = name.split(/[@\s.]+/).filter(Boolean);
10496
- if (parts.length === 0)
10497
- return "?";
10498
- if (parts.length === 1)
10499
- return parts[0].charAt(0).toUpperCase();
10500
- return (parts[0].charAt(0) + parts[parts.length - 1].charAt(0)).toUpperCase();
10501
- }
10502
- /**
10503
- * Get Tailwind classes for actor avatar based on actor type
10504
- */
10505
- function getActorAvatarClasses(actorType, compact) {
10506
- const baseClasses = cn("rounded-full flex items-center justify-center shrink-0 font-semibold", compact ? "w-5 h-5 text-1xs" : "w-6 h-6 text-1xs");
10507
- switch (actorType) {
10508
- case "user":
10509
- return cn(baseClasses, "bg-primary text-primary-foreground");
10510
- case "controller":
10511
- return cn(baseClasses, "bg-secondary text-secondary-foreground");
10512
- case "machine account":
10513
- return cn(baseClasses, "bg-muted text-muted-foreground");
10514
- default:
10515
- return cn(baseClasses, "bg-muted text-muted-foreground");
10516
- }
10517
- }
10518
10394
  /**
10519
10395
  * ActivityFeedItem renders a single activity in the feed or timeline
10520
10396
  */
10521
- function ActivityFeedItem({ activity, onResourceClick, resourceLinkResolver, tenantLinkResolver, tenantRenderer, onActorClick, onActivityClick, isSelected = false, className = "", compact = false, isNew = false, variant = "feed", isLast = false, defaultExpanded = false, density = "default", }) {
10397
+ function ActivityFeedItem({ activity, onResourceClick, resourceLinkResolver, tenantLinkResolver, tenantRenderer, onActorClick, onActivityClick, isSelected = false, className = "", compact = false, isNew = false, variant = "feed", isLast = false, defaultExpanded = false, }) {
10522
10398
  const [isExpanded, setIsExpanded] = useState(defaultExpanded);
10523
10399
  const { spec, metadata } = activity;
10524
10400
  const { actor, summary, links, tenant } = spec;
@@ -10539,7 +10415,7 @@ function ActivityFeedItem({ activity, onResourceClick, resourceLinkResolver, ten
10539
10415
  if (isTimeline) {
10540
10416
  const { container: iconBg, icon: iconColor } = getActionIconClasses(verb);
10541
10417
  const Icon = getTimelineIcon(verb);
10542
- return (jsxs("div", { className: cn(!isLast && !isExpanded && "border-b border-border", className), children: [jsxs("div", { className: cn("flex items-center gap-3 cursor-pointer group", density === "compact" ? "py-1.5" : "py-3", isSelected && "bg-muted/40"), onClick: toggleExpand, children: [jsx("div", { className: cn("rounded-md shrink-0 flex items-center justify-center", density === "compact" ? "w-6 h-6" : "w-8 h-8", iconBg, iconColor), children: jsx(Icon, { size: 16, strokeWidth: 2 }) }), jsx("div", { className: "flex-1 min-w-0 text-sm text-foreground leading-snug", children: jsx(ActivityFeedSummary, { summary: summary, links: links, onResourceClick: onResourceClick, resourceLinkResolver: resourceLinkResolver, resourceLinkContext: { tenant } }) }), tenant && (jsx("div", { className: "shrink-0", children: tenantRenderer ? (tenantRenderer(tenant)) : (jsx(TenantBadge, { tenant: tenant, tenantLinkResolver: tenantLinkResolver, size: "compact" })) })), jsx("span", { className: "text-xs text-muted-foreground whitespace-nowrap shrink-0", children: jsx(Timestamp, { value: timestamp }) }), jsx(Button, { type: "quaternary", theme: "borderless", size: "small", className: "h-5 py-0 px-1 text-base text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0", onClick: toggleExpand, "aria-expanded": isExpanded, children: isExpanded ? "−" : "+" })] }), isExpanded && (jsx(ActivityExpandedDetails, { activity: activity, tenantLinkResolver: tenantLinkResolver, compact: true }))] }));
10418
+ return (jsxs("div", { className: cn(!isLast && !isExpanded && "border-b border-border", className), children: [jsxs("div", { className: cn("flex items-center gap-3 py-3 cursor-pointer group", isSelected && "bg-muted/40"), onClick: toggleExpand, children: [jsx("div", { className: cn("w-8 h-8 rounded-md shrink-0 flex items-center justify-center", iconBg, iconColor), children: jsx(Icon, { size: 16, strokeWidth: 2 }) }), jsx("div", { className: "flex-1 min-w-0 text-sm text-foreground leading-snug", children: jsx(ActivityFeedSummary, { summary: summary, links: links, onResourceClick: onResourceClick, resourceLinkResolver: resourceLinkResolver, resourceLinkContext: { tenant } }) }), tenant && (jsx("div", { className: "shrink-0", children: tenantRenderer ? (tenantRenderer(tenant)) : (jsx(TenantBadge, { tenant: tenant, tenantLinkResolver: tenantLinkResolver, size: "compact" })) })), jsx("span", { className: "text-xs text-muted-foreground whitespace-nowrap shrink-0", children: jsx(Timestamp, { value: timestamp }) }), jsx(Button, { type: "quaternary", theme: "borderless", size: "small", className: "h-5 py-0 px-1 text-base text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0", onClick: toggleExpand, "aria-expanded": isExpanded, children: isExpanded ? "−" : "+" })] }), isExpanded && (jsx(ActivityExpandedDetails, { activity: activity, tenantLinkResolver: tenantLinkResolver, compact: true }))] }));
10543
10419
  }
10544
10420
  // Feed variant — flat-column table row. Columns: Actor | Summary |
10545
10421
  // Tenant | When | expand toggle. Renders an additional TableRow with a
@@ -10832,7 +10708,7 @@ const getSelectedPreset$1 = (timeRange) => {
10832
10708
  /**
10833
10709
  * ActivityFeedFilters provides filter controls for the activity feed
10834
10710
  */
10835
- function ActivityFeedFilters({ client, filters, timeRange, onFiltersChange, onTimeRangeChange, disabled = false, hiddenFilters = [], className = "", extraFilters, layout = "inline", }) {
10711
+ function ActivityFeedFilters({ client, filters, timeRange, onFiltersChange, onTimeRangeChange, disabled = false, hiddenFilters = [], className = "", extraFilters, }) {
10836
10712
  const { resourceKinds, actorNames, apiGroups, resourceNamespaces, error: facetsError, } = useFacets(client, timeRange, filters);
10837
10713
  // Log facets error for debugging
10838
10714
  if (facetsError) {
@@ -11052,186 +10928,12 @@ function ActivityFeedFilters({ client, filters, timeRange, onFiltersChange, onTi
11052
10928
  clearTimeout(searchDebounceRef.current);
11053
10929
  onFiltersChangeRef.current({ ...filtersRef.current, search: undefined });
11054
10930
  }, []);
11055
- const searchInput = (jsxs("div", { className: "relative min-w-[200px] flex-1 max-w-xs", children: [jsx(Search, { className: "absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" }), jsx(Input, { type: "text", placeholder: "Search activities...", value: searchInputValue, onChange: handleSearchChange, className: "pl-8 h-7 text-xs pr-6" }), searchInputValue && (jsx("button", { onClick: handleSearchClear, className: "absolute right-1.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors", "aria-label": "Clear search", children: jsx(X, { className: "h-3.5 w-3.5" }) }))] }));
11056
- const changeSourceControl = !hiddenFilters.includes("changeSource") && (jsx(ChangeSourceToggle, { value: filters.changeSource || "all", onChange: handleChangeSourceChange, disabled: disabled }));
11057
- const filterChips = activeFilterIds.map((filterId) => {
11058
- const config = FILTER_CONFIGS$1[filterId];
11059
- return (jsx(FilterChip, { label: config.label, values: getFilterValues(filterId), options: config.inputMode === "typeahead"
11060
- ? getFilterOptions(filterId)
11061
- : undefined, onValuesChange: (values) => handleFilterChange(filterId, values), onClear: () => handleFilterClear(filterId), onPopoverClose: () => handlePopoverClose(filterId), inputMode: config.inputMode, placeholder: config.placeholder, searchPlaceholder: config.searchPlaceholder, autoOpen: pendingFilter === filterId, disabled: disabled }, filterId));
11062
- });
11063
- const addFilterControl = (jsx(AddFilterDropdown, { availableFilters: availableFilters, activeFilterIds: activeFilterIds, onAddFilter: handleAddFilter, hasActiveFilters: activeFilterIds.length > 0, disabled: disabled }));
11064
- const timeRangeControl = (jsx(TimeRangeDropdown, { presets: TIME_PRESETS$1, selectedPreset: selectedPreset, onPresetSelect: handleTimePresetSelect, onCustomRangeApply: handleCustomRangeApply, customStart: customStart, customEnd: customEnd, disabled: disabled, displayLabel: getTimeRangeLabel() }));
11065
- if (layout === "compact") {
11066
- const activeFilterCount = activeFilterIds.length +
11067
- (!hiddenFilters.includes("changeSource") &&
11068
- filters.changeSource &&
11069
- filters.changeSource !== "all"
11070
- ? 1
11071
- : 0);
11072
- return (jsx("div", { className: `border-b border-border py-4 ${className}`, children: jsxs("div", { className: "flex flex-wrap gap-2 items-center", children: [searchInput, jsxs(Popover, { children: [jsx(PopoverTrigger, { asChild: true, children: jsxs("button", { type: "button", disabled: disabled, className: cn("flex h-7 items-center gap-1.5 rounded-md border border-border bg-background px-2 text-xs", "text-muted-foreground hover:text-foreground hover:border-foreground/50 transition-colors", "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", "disabled:cursor-not-allowed disabled:opacity-50"), children: [jsx(SlidersHorizontal, { className: "h-3.5 w-3.5" }), jsx("span", { className: "font-medium", children: "Filters" }), activeFilterCount > 0 && (jsx("span", { className: "ml-0.5 rounded-full bg-primary text-primary-foreground text-[10px] font-semibold leading-none px-1.5 py-0.5", children: activeFilterCount }))] }) }), jsx(PopoverContent, { className: "w-[320px] p-3", sideOffset: 4, align: "start", children: jsxs("div", { className: "flex flex-col gap-3", children: [changeSourceControl, jsxs("div", { className: "flex flex-wrap gap-2 items-center", children: [filterChips, addFilterControl] }), extraFilters, timeRangeControl] }) })] })] }) }));
11073
- }
11074
10931
  return (jsx("div", { className: `border-b border-border py-4 ${className}`, children: jsxs("div", { className: "flex flex-wrap gap-2 items-center", children: [!hiddenFilters.includes("changeSource") && (jsx(ChangeSourceToggle, { value: filters.changeSource || "all", onChange: handleChangeSourceChange, disabled: disabled })), jsxs("div", { className: "relative min-w-[200px] flex-1 max-w-xs", children: [jsx(Search, { className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" }), jsx(Input, { type: "text", placeholder: "Search activities...", value: searchInputValue, onChange: handleSearchChange, className: "h-9 pl-9 pr-9 text-xs md:text-xs" }), searchInputValue && (jsx("button", { onClick: handleSearchClear, className: "absolute right-0 top-0 flex h-9 w-9 items-center justify-center rounded-r-lg text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", "aria-label": "Clear search", children: jsx(X, { className: "h-3.5 w-3.5" }) }))] }), activeFilterIds.map((filterId) => {
11075
10932
  const config = FILTER_CONFIGS$1[filterId];
11076
10933
  return (jsx(FilterChip, { label: config.label, values: getFilterValues(filterId), options: config.inputMode === "typeahead"
11077
10934
  ? getFilterOptions(filterId)
11078
10935
  : undefined, onValuesChange: (values) => handleFilterChange(filterId, values), onClear: () => handleFilterClear(filterId), onPopoverClose: () => handlePopoverClose(filterId), inputMode: config.inputMode, placeholder: config.placeholder, searchPlaceholder: config.searchPlaceholder, autoOpen: pendingFilter === filterId, disabled: disabled }, filterId));
11079
- }), jsx(AddFilterDropdown, { availableFilters: availableFilters, activeFilterIds: activeFilterIds, onAddFilter: handleAddFilter, hasActiveFilters: activeFilterIds.length > 0, disabled: disabled }), extraFilters, jsx("div", { className: "flex-1 min-w-[20px]" }), timeRangeControl] }) }));
11080
- }
11081
-
11082
- const KIND_PLURALS = {
11083
- DNSRecordSet: "DNS records",
11084
- };
11085
- function pluralizeKind(kind, count) {
11086
- if (count === 1)
11087
- return kind;
11088
- return KIND_PLURALS[kind] ?? `${kind}s`;
11089
- }
11090
- const VERB_LABEL = {
11091
- create: "created",
11092
- update: "updated",
11093
- delete: "deleted",
11094
- other: "changed",
11095
- };
11096
- /**
11097
- * ActivityFeedGroupItem renders a run of consecutive same verb/kind/actor
11098
- * activities (see `groupActivities`) as a single collapsed row in the
11099
- * "digest" timeline. A group of size 1 renders exactly like a normal
11100
- * `ActivityFeedItem` — no visual change for ungrouped activities. Larger
11101
- * groups render a synthesized summary ("{actor} created 12 DNS records")
11102
- * that expands to reveal the individual activities underneath.
11103
- */
11104
- function ActivityFeedGroupItem({ group, resourceLinkResolver, tenantLinkResolver, tenantRenderer, onActorClick, onActivityClick, isLast = false, }) {
11105
- const [isExpanded, setIsExpanded] = useState(false);
11106
- if (group.count === 1) {
11107
- return (jsx(ActivityFeedItem, { activity: group.activities[0], resourceLinkResolver: resourceLinkResolver, tenantLinkResolver: tenantLinkResolver, tenantRenderer: tenantRenderer, onActorClick: onActorClick, onActivityClick: onActivityClick, variant: "timeline", density: "compact", isLast: isLast }));
11108
- }
11109
- const { container: iconBg, icon: iconColor } = getActionIconClasses(group.verb);
11110
- const Icon = getTimelineIcon(group.verb);
11111
- const actorVisible = group.actorDisplayName || group.actorName;
11112
- const summary = `${actorVisible} ${VERB_LABEL[group.verb]} ${group.count} ${pluralizeKind(group.kind, group.count)}`;
11113
- const toggleExpand = (e) => {
11114
- e.stopPropagation();
11115
- setIsExpanded((prev) => !prev);
11116
- };
11117
- return (jsxs("div", { className: cn(!isLast && !isExpanded && "border-b border-border"), children: [jsxs("div", { className: "flex items-center gap-3 py-1.5 cursor-pointer group", onClick: toggleExpand, children: [jsxs("div", { className: cn("w-6 h-6 rounded-md shrink-0 flex items-center justify-center relative", iconBg, iconColor), children: [jsx(Icon, { size: 14, strokeWidth: 2 }), jsx("span", { className: "absolute -bottom-1 -right-1 rounded-full bg-background border border-border px-1 text-[10px] font-semibold leading-tight text-foreground", children: group.count })] }), jsx("div", { className: "flex-1 min-w-0 text-xs text-foreground leading-normal", children: summary }), group.tenant && (jsx("div", { className: "shrink-0", children: tenantRenderer ? (tenantRenderer(group.tenant)) : (jsx(TenantBadge, { tenant: group.tenant, tenantLinkResolver: tenantLinkResolver, size: "compact" })) })), jsx("span", { className: "text-xs text-muted-foreground whitespace-nowrap shrink-0", children: jsx(Timestamp, { value: group.latestTimestamp }) }), jsx(Button, { type: "quaternary", theme: "borderless", size: "small", className: "h-5 py-0 px-1 text-base text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0", onClick: toggleExpand, "aria-expanded": isExpanded, children: isExpanded ? "−" : "+" })] }), isExpanded && (jsx("div", { className: "pl-11 flex flex-col", children: group.activities.map((activity, index) => (jsx(ActivityFeedItem, { activity: activity, resourceLinkResolver: resourceLinkResolver, tenantLinkResolver: tenantLinkResolver, tenantRenderer: tenantRenderer, onActorClick: onActorClick, onActivityClick: onActivityClick, compact: true, density: "compact", variant: "timeline", isLast: index === group.activities.length - 1 }, activity.metadata?.uid || activity.metadata?.name))) }))] }));
11118
- }
11119
-
11120
- /**
11121
- * Thin stat strip summarizing the activities currently loaded in the feed —
11122
- * e.g. "18 changes · 3 people · 1 system". Computed client-side over the
11123
- * loaded/paginated activities; it is a quick-glance headline, not a
11124
- * full-range aggregate (that would require a backend facet query).
11125
- */
11126
- function ActivityDigestSummary({ activities, className = "" }) {
11127
- const stats = useMemo(() => {
11128
- const humanActors = new Set();
11129
- const systemActors = new Set();
11130
- for (const activity of activities) {
11131
- const { actor, changeSource } = activity.spec;
11132
- if (changeSource === "human") {
11133
- humanActors.add(actor.name);
11134
- }
11135
- else {
11136
- systemActors.add(actor.name);
11137
- }
11138
- }
11139
- return {
11140
- total: activities.length,
11141
- people: humanActors.size,
11142
- systems: systemActors.size,
11143
- };
11144
- }, [activities]);
11145
- if (stats.total === 0)
11146
- return null;
11147
- const parts = [`${stats.total} ${stats.total === 1 ? "change" : "changes"}`];
11148
- if (stats.people > 0)
11149
- parts.push(`${stats.people} ${stats.people === 1 ? "person" : "people"}`);
11150
- if (stats.systems > 0)
11151
- parts.push(`${stats.systems} ${stats.systems === 1 ? "system" : "systems"}`);
11152
- return (jsx("div", { className: `px-1 pt-4 pb-2 text-xs text-muted-foreground ${className}`, children: parts.join(" · ") }));
11153
- }
11154
-
11155
- function tenantKey(tenant) {
11156
- if (!tenant)
11157
- return '';
11158
- return `${tenant.type}:${tenant.name}`;
11159
- }
11160
- function groupSignature(activity) {
11161
- const { spec } = activity;
11162
- const verb = normalizeVerb(extractVerb(spec.summary));
11163
- return [verb, spec.resource.kind, spec.actor.name, tenantKey(spec.tenant)].join('|');
11164
- }
11165
- /**
11166
- * Group consecutive activities that share verb + resource kind + actor +
11167
- * tenant. Activities are assumed to already be sorted newest-first (as
11168
- * returned by `useActivityFeed`); only adjacent items are merged, so a
11169
- * burst of matching activities collapses into one group without needing
11170
- * any time-window heuristics.
11171
- */
11172
- function groupActivities(activities) {
11173
- const groups = [];
11174
- for (const activity of activities) {
11175
- const signature = groupSignature(activity);
11176
- const last = groups[groups.length - 1];
11177
- if (last && last.key === signature) {
11178
- last.activities.push(activity);
11179
- last.count += 1;
11180
- continue;
11181
- }
11182
- const { spec } = activity;
11183
- groups.push({
11184
- key: signature,
11185
- verb: normalizeVerb(extractVerb(spec.summary)),
11186
- kind: spec.resource.kind,
11187
- actorName: spec.actor.name,
11188
- actorDisplayName: spec.actor.displayName,
11189
- tenant: spec.tenant,
11190
- activities: [activity],
11191
- count: 1,
11192
- latestTimestamp: activity.metadata?.creationTimestamp,
11193
- });
11194
- }
11195
- return groups;
11196
- }
11197
- function dayLabel(timestamp) {
11198
- if (!timestamp)
11199
- return 'Unknown date';
11200
- const date = new Date(timestamp);
11201
- if (Number.isNaN(date.getTime()))
11202
- return 'Unknown date';
11203
- if (isToday(date))
11204
- return 'Today';
11205
- if (isYesterday(date))
11206
- return 'Yesterday';
11207
- return format(date, 'MMMM d, yyyy');
11208
- }
11209
- /**
11210
- * Bucket activities into calendar-day sections (Today / Yesterday / a
11211
- * formatted date), then group consecutive matching activities within each
11212
- * day. Bucketing by day first (rather than grouping across the whole list)
11213
- * keeps a group from silently spanning a day boundary.
11214
- */
11215
- function groupActivitiesByDay(activities) {
11216
- const sections = [];
11217
- let currentLabel = null;
11218
- let currentBucket = [];
11219
- const flush = () => {
11220
- if (currentLabel !== null && currentBucket.length > 0) {
11221
- sections.push({ label: currentLabel, groups: groupActivities(currentBucket) });
11222
- }
11223
- };
11224
- for (const activity of activities) {
11225
- const label = dayLabel(activity.metadata?.creationTimestamp);
11226
- if (label !== currentLabel) {
11227
- flush();
11228
- currentLabel = label;
11229
- currentBucket = [];
11230
- }
11231
- currentBucket.push(activity);
11232
- }
11233
- flush();
11234
- return sections;
10936
+ }), jsx(AddFilterDropdown, { availableFilters: availableFilters, activeFilterIds: activeFilterIds, onAddFilter: handleAddFilter, hasActiveFilters: activeFilterIds.length > 0, disabled: disabled }), extraFilters, jsx("div", { className: "flex-1 min-w-[20px]" }), jsx(TimeRangeDropdown, { presets: TIME_PRESETS$1, selectedPreset: selectedPreset, onPresetSelect: handleTimePresetSelect, onCustomRangeApply: handleCustomRangeApply, customStart: customStart, customEnd: customEnd, disabled: disabled, displayLabel: getTimeRangeLabel() })] }) }));
11235
10937
  }
11236
10938
 
11237
10939
  /**
@@ -11362,10 +11064,10 @@ function ActivityFeed({ client, initialFilters = { changeSource: "human" }, init
11362
11064
  // Parent containers must have proper height constraints (h-screen/h-full + overflow-hidden)
11363
11065
  const effectiveMaxHeight = maxHeight === "none" ? undefined : maxHeight;
11364
11066
  const listClasses = "flex-1 min-h-0 overflow-y-auto flex flex-col";
11365
- return (jsx(TooltipProvider, { delayDuration: 200, children: jsxs(Card, { className: containerClasses, children: [enableStreaming && (jsxs("div", { className: "flex items-center justify-between", children: [jsxs("div", { className: "flex items-center", children: [isStreaming && !watchError && (jsx(TooltipProvider, { delayDuration: 300, children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsxs("div", { className: "flex items-center gap-2", children: [jsxs("span", { className: "relative flex h-2 w-2", children: [jsx("span", { className: "animate-ping absolute inline-flex h-full w-full rounded-full bg-[var(--success-500)] opacity-75" }), jsx("span", { className: "relative inline-flex rounded-full h-2 w-2 bg-[var(--success-500)]" })] }), jsx("span", { className: "text-xs text-muted-foreground", children: "Streaming activity..." })] }) }), jsx(TooltipContent, { className: "text-xs", children: jsx("p", { children: "New activities will appear automatically" }) })] }) })), watchError && (jsx(TooltipProvider, { delayDuration: 300, children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "relative flex h-2 w-2", children: jsx("span", { className: "relative inline-flex rounded-full h-2 w-2 bg-destructive" }) }), jsx("span", { className: "text-xs text-destructive", children: "Connection error" })] }) }), jsx(TooltipContent, { className: "text-xs", children: jsx("p", { children: "Stream connection lost" }) })] }) })), newActivitiesCount > 0 && !watchError && (jsxs(Badge, { variant: "secondary", className: "text-xs", children: ["+", newActivitiesCount, " new"] }))] }), jsx(Button, { type: "tertiary", theme: "outline", size: "small", onClick: handleStreamingToggle, children: watchError ? (jsxs(Fragment, { children: [jsxs("svg", { className: "w-4 h-4 mr-1.5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", strokeWidth: "2", children: [jsx("path", { d: "M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4" }), jsx("circle", { cx: "12", cy: "12", r: "3" })] }), "Retry"] })) : isStreaming ? (jsxs(Fragment, { children: [jsxs("svg", { className: "w-4 h-4 mr-1.5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [jsx("rect", { x: "6", y: "4", width: "4", height: "16" }), jsx("rect", { x: "14", y: "4", width: "4", height: "16" })] }), "Pause"] })) : (jsxs(Fragment, { children: [jsx("svg", { className: "w-4 h-4 mr-1.5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: jsx("polygon", { points: "5,3 19,12 5,21", fill: "currentColor" }) }), "Resume"] })) })] })), showFilters && (jsx(ActivityFeedFilters, { client: client, filters: filters, timeRange: timeRange, onFiltersChange: handleFiltersChange, onTimeRangeChange: handleTimeRangeChange, disabled: isLoading, hiddenFilters: hiddenFilters, layout: variant === "digest" ? "compact" : "inline" })), variant === "digest" && !isLoading && activities.length > 0 && (jsx(ActivityDigestSummary, { activities: activities })), jsx(ApiErrorAlert, { error: error, onRetry: refresh, className: "mb-4", errorFormatter: errorFormatter }), jsx(ApiErrorAlert, { error: watchError, onRetry: startStreaming, className: "mb-4", errorFormatter: errorFormatter }), !policiesLoading && hasPolicies === false && (jsxs("div", { className: "flex flex-col items-center py-12 px-8 text-center bg-muted border border-dashed border-border rounded-xl mb-4", children: [jsx("div", { className: "flex justify-center mb-4 text-muted-foreground", children: jsxs("svg", { width: "56", height: "56", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [jsx("path", { d: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2" }), jsx("rect", { x: "9", y: "3", width: "6", height: "4", rx: "1" }), jsx("path", { d: "M9 12h6" }), jsx("path", { d: "M9 16h6" })] }) }), jsx("h3", { className: "m-0 mb-2 text-lg font-semibold text-foreground leading-snug", children: "Get started with activity logging" }), jsx("p", { className: "m-0 mb-6 text-sm leading-relaxed text-muted-foreground max-w-[400px]", children: "Activity policies define which resources to track and how to summarize changes. Create your first policy to start seeing activity logs here." }), onCreatePolicy && (jsx(Button, { onClick: onCreatePolicy, children: "Create Policy" }))] })), jsxs("div", { className: listClasses, ref: scrollContainerRef, style: effectiveMaxHeight ? { maxHeight: effectiveMaxHeight } : undefined, children: [!isLoading &&
11067
+ return (jsx(TooltipProvider, { delayDuration: 200, children: jsxs(Card, { className: containerClasses, children: [enableStreaming && (jsxs("div", { className: "flex items-center justify-between", children: [jsxs("div", { className: "flex items-center", children: [isStreaming && !watchError && (jsx(TooltipProvider, { delayDuration: 300, children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsxs("div", { className: "flex items-center gap-2", children: [jsxs("span", { className: "relative flex h-2 w-2", children: [jsx("span", { className: "animate-ping absolute inline-flex h-full w-full rounded-full bg-[var(--success-500)] opacity-75" }), jsx("span", { className: "relative inline-flex rounded-full h-2 w-2 bg-[var(--success-500)]" })] }), jsx("span", { className: "text-xs text-muted-foreground", children: "Streaming activity..." })] }) }), jsx(TooltipContent, { className: "text-xs", children: jsx("p", { children: "New activities will appear automatically" }) })] }) })), watchError && (jsx(TooltipProvider, { delayDuration: 300, children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "relative flex h-2 w-2", children: jsx("span", { className: "relative inline-flex rounded-full h-2 w-2 bg-destructive" }) }), jsx("span", { className: "text-xs text-destructive", children: "Connection error" })] }) }), jsx(TooltipContent, { className: "text-xs", children: jsx("p", { children: "Stream connection lost" }) })] }) })), newActivitiesCount > 0 && !watchError && (jsxs(Badge, { variant: "secondary", className: "text-xs", children: ["+", newActivitiesCount, " new"] }))] }), jsx(Button, { type: "tertiary", theme: "outline", size: "small", onClick: handleStreamingToggle, children: watchError ? (jsxs(Fragment, { children: [jsxs("svg", { className: "w-4 h-4 mr-1.5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", strokeWidth: "2", children: [jsx("path", { d: "M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4" }), jsx("circle", { cx: "12", cy: "12", r: "3" })] }), "Retry"] })) : isStreaming ? (jsxs(Fragment, { children: [jsxs("svg", { className: "w-4 h-4 mr-1.5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [jsx("rect", { x: "6", y: "4", width: "4", height: "16" }), jsx("rect", { x: "14", y: "4", width: "4", height: "16" })] }), "Pause"] })) : (jsxs(Fragment, { children: [jsx("svg", { className: "w-4 h-4 mr-1.5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: jsx("polygon", { points: "5,3 19,12 5,21", fill: "currentColor" }) }), "Resume"] })) })] })), showFilters && (jsx(ActivityFeedFilters, { client: client, filters: filters, timeRange: timeRange, onFiltersChange: handleFiltersChange, onTimeRangeChange: handleTimeRangeChange, disabled: isLoading, hiddenFilters: hiddenFilters })), jsx(ApiErrorAlert, { error: error, onRetry: refresh, className: "mb-4", errorFormatter: errorFormatter }), jsx(ApiErrorAlert, { error: watchError, onRetry: startStreaming, className: "mb-4", errorFormatter: errorFormatter }), !policiesLoading && hasPolicies === false && (jsxs("div", { className: "flex flex-col items-center py-12 px-8 text-center bg-muted border border-dashed border-border rounded-xl mb-4", children: [jsx("div", { className: "flex justify-center mb-4 text-muted-foreground", children: jsxs("svg", { width: "56", height: "56", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [jsx("path", { d: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2" }), jsx("rect", { x: "9", y: "3", width: "6", height: "4", rx: "1" }), jsx("path", { d: "M9 12h6" }), jsx("path", { d: "M9 16h6" })] }) }), jsx("h3", { className: "m-0 mb-2 text-lg font-semibold text-foreground leading-snug", children: "Get started with activity logging" }), jsx("p", { className: "m-0 mb-6 text-sm leading-relaxed text-muted-foreground max-w-[400px]", children: "Activity policies define which resources to track and how to summarize changes. Create your first policy to start seeing activity logs here." }), onCreatePolicy && (jsx(Button, { onClick: onCreatePolicy, children: "Create Policy" }))] })), jsxs("div", { className: listClasses, ref: scrollContainerRef, style: effectiveMaxHeight ? { maxHeight: effectiveMaxHeight } : undefined, children: [!isLoading &&
11366
11068
  activities.length === 0 &&
11367
11069
  hasPolicies !== false &&
11368
- (variant === "timeline" || variant === "digest") && (jsxs("div", { className: "py-12 text-center text-muted-foreground", children: [jsx("p", { className: "m-0", children: "No activities found" }), jsx("p", { className: "text-sm text-muted-foreground mt-2 m-0", children: "Try adjusting your filters or time range" })] })), variant === "digest" ? (jsxs(Fragment, { children: [isLoading && activities.length === 0 && (jsx(Fragment, { children: Array.from({ length: 8 }).map((_, index) => (jsx(ActivityFeedItemSkeleton, { compact: compact }, index))) })), groupActivitiesByDay(activities).map((section) => (jsxs("div", { className: "flex flex-col", children: [jsx("div", { className: "sticky top-0 z-10 bg-card pt-2 pb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: section.label }), section.groups.map((group, index) => (jsx(ActivityFeedGroupItem, { group: group, resourceLinkResolver: resourceLinkResolver, tenantLinkResolver: tenantLinkResolver, tenantRenderer: tenantRenderer, onActorClick: handleActorClick, onActivityClick: onActivityClick, isLast: index === section.groups.length - 1 }, `${section.label}-${group.key}-${index}`)))] }, section.label)))] })) : variant === "timeline" ? (jsxs(Fragment, { children: [isLoading && activities.length === 0 && (jsx(Fragment, { children: Array.from({ length: 8 }).map((_, index) => (jsx(ActivityFeedItemSkeleton, { compact: compact }, index))) })), activities.map((activity, index) => (jsx(ActivityFeedItem, { activity: activity, onResourceClick: onResourceClick, resourceLinkResolver: resourceLinkResolver, tenantLinkResolver: tenantLinkResolver, tenantRenderer: tenantRenderer, onActorClick: handleActorClick, onActivityClick: onActivityClick, compact: compact, isNew: enableStreaming && index < newActivitiesCount, variant: variant, isLast: index === activities.length - 1 }, activity.metadata?.uid || activity.metadata?.name)))] })) : (jsxs(Table, { className: "w-full", children: [jsx(TableHeader, { children: jsxs(TableRow, { children: [jsx(TableHead, { className: "w-12", "aria-label": "Actor" }), jsx(TableHead, { children: "Summary" }), jsx(TableHead, { children: "Tenant" }), jsx(TableHead, { className: "w-[170px]", children: "When" }), jsx(TableHead, { className: "w-10", "aria-label": "Expand" })] }) }), jsxs(TableBody, { children: [isLoading && activities.length === 0 && (jsx(Fragment, { children: Array.from({ length: 8 }).map((_, index) => (jsxs(TableRow, { children: [jsx(TableCell, { className: "py-2", children: jsx(Skeleton, { className: "h-6 w-6 rounded-full" }) }), jsx(TableCell, { className: "py-2", children: jsx(Skeleton, { className: "h-4 w-3/4" }) }), jsx(TableCell, { className: "py-2", children: jsx(Skeleton, { className: "h-5 w-32 rounded-full" }) }), jsx(TableCell, { className: "py-2", children: jsx(Skeleton, { className: "h-4 w-24" }) }), jsx(TableCell, { className: "py-2", children: jsx(Skeleton, { className: "h-6 w-6" }) })] }, `sk-${index}`))) })), !isLoading &&
11070
+ variant === "timeline" && (jsxs("div", { className: "py-12 text-center text-muted-foreground", children: [jsx("p", { className: "m-0", children: "No activities found" }), jsx("p", { className: "text-sm text-muted-foreground mt-2 m-0", children: "Try adjusting your filters or time range" })] })), variant === "timeline" ? (jsxs(Fragment, { children: [isLoading && activities.length === 0 && (jsx(Fragment, { children: Array.from({ length: 8 }).map((_, index) => (jsx(ActivityFeedItemSkeleton, { compact: compact }, index))) })), activities.map((activity, index) => (jsx(ActivityFeedItem, { activity: activity, onResourceClick: onResourceClick, resourceLinkResolver: resourceLinkResolver, tenantLinkResolver: tenantLinkResolver, tenantRenderer: tenantRenderer, onActorClick: handleActorClick, onActivityClick: onActivityClick, compact: compact, isNew: enableStreaming && index < newActivitiesCount, variant: variant, isLast: index === activities.length - 1 }, activity.metadata?.uid || activity.metadata?.name)))] })) : (jsxs(Table, { className: "w-full", children: [jsx(TableHeader, { children: jsxs(TableRow, { children: [jsx(TableHead, { className: "w-12", "aria-label": "Actor" }), jsx(TableHead, { children: "Summary" }), jsx(TableHead, { children: "Tenant" }), jsx(TableHead, { className: "w-[170px]", children: "When" }), jsx(TableHead, { className: "w-10", "aria-label": "Expand" })] }) }), jsxs(TableBody, { children: [isLoading && activities.length === 0 && (jsx(Fragment, { children: Array.from({ length: 8 }).map((_, index) => (jsxs(TableRow, { children: [jsx(TableCell, { className: "py-2", children: jsx(Skeleton, { className: "h-6 w-6 rounded-full" }) }), jsx(TableCell, { className: "py-2", children: jsx(Skeleton, { className: "h-4 w-3/4" }) }), jsx(TableCell, { className: "py-2", children: jsx(Skeleton, { className: "h-5 w-32 rounded-full" }) }), jsx(TableCell, { className: "py-2", children: jsx(Skeleton, { className: "h-4 w-24" }) }), jsx(TableCell, { className: "py-2", children: jsx(Skeleton, { className: "h-6 w-6" }) })] }, `sk-${index}`))) })), !isLoading &&
11369
11071
  activities.length === 0 &&
11370
11072
  hasPolicies !== false && (jsx(TableRow, { children: jsxs(TableCell, { colSpan: ACTIVITY_FEED_COLUMN_COUNT, className: "text-center py-12 text-muted-foreground", children: [jsx("div", { children: "No activities found" }), jsx("div", { className: "text-sm mt-2", children: "Try adjusting your filters or time range" })] }) })), activities.map((activity, index) => (jsx(ActivityFeedItem, { activity: activity, onResourceClick: onResourceClick, resourceLinkResolver: resourceLinkResolver, tenantLinkResolver: tenantLinkResolver, tenantRenderer: tenantRenderer, onActorClick: handleActorClick, onActivityClick: onActivityClick, compact: compact, isNew: enableStreaming && index < newActivitiesCount, variant: variant, isLast: index === activities.length - 1 }, activity.metadata?.uid || activity.metadata?.name)))] })] })), infiniteScroll && hasMore && (jsx("div", { ref: loadMoreTriggerRef, className: "h-px mt-4" })), !infiniteScroll && activities.length > 0 ? (jsxs("div", { className: "flex items-center justify-between gap-4 px-4 py-3 border-t border-border text-sm text-muted-foreground", children: [jsxs("span", { children: [activities.length, " ", activities.length === 1 ? "activity" : "activities", hasMore ? " so far" : ""] }), hasMore ? (jsx(Button, { type: "tertiary", theme: "outline", size: "small", htmlType: "button", onClick: handleLoadMoreClick, disabled: isLoading, children: isLoading ? "Loading…" : "Load more" })) : (jsx("span", { children: "End of results" }))] })) : null] })] }) }));
11371
11073
  }
@@ -16754,5 +16456,5 @@ const POLICY_FILTER_FIELDS = [
16754
16456
  },
16755
16457
  ];
16756
16458
 
16757
- export { ACTIVITY_FILTER_FIELDS, AUDIT_TEMPLATES, ActionMultiSelect, ActionToggle, ActivityApiClient, ActivityDigestSummary, ActivityExpandedDetails, ActivityFeed, ActivityFeedFilters, ActivityFeedGroupItem, ActivityFeedItem, ActivityFeedItemSkeleton, ActivityFeedSummary, ActivityLayout, ApiError, ApiErrorAlert, AuditEventViewer, AuditLogExpandedDetails, AuditLogFeedItem, AuditLogFilters, AuditLogQueryComponent, Badge, CelEditor, ChangeSourceToggle, Combobox, DateTimeRangePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, EVENT_FACET_FIELDS, EVENT_FILTER_FIELDS, EVENT_TEMPLATES, EventExpandedDetails, EventFeedItem, EventTypeToggle, EventsFeed, FILTER_FIELDS, FilterBuilder, FilterBuilderWithAutocomplete, MultiCombobox, NetworkError, POLICY_FILTER_FIELDS, PolicyActivityView, PolicyActivityViewSkeleton, PolicyDetailView, PolicyEditView, PolicyEditor, PolicyList, PolicyPreviewPanel, PolicyPreviewResult, PolicyResourceForm, PolicyRuleEditor, PolicyRuleEditorDialog, PolicyRuleList, PolicyRuleListItem, ReindexJobCreate, ReindexJobDetailView, ReindexJobDialog, ReindexJobList, ResourceHistoryView, RulePreviewPanel, SampleInputTemplates, SimpleQueryBuilder, TenantBadge, TimeRangeDropdown, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UserSelect, badgeVariants, buildAuditLogCEL, cn, copyToClipboard, defaultErrorFormatter, defaultResourceLinkResolver, extractEvent, extractFieldPaths, extractFieldPathsFromMany, generateShareableUrl, getReindexJobDuration, getReindexJobStatusMessage, groupActivities, groupActivitiesByDay, isEventRecord, isReindexJobRunning, isReindexJobTerminal, parseActivityFilters, parseApiError, parseEventFilters, parseTimeRange, serializeActivityFilters, serializeEventFilters, useActivityFeed, useAuditLogFacets, useAuditLogQuery, useEventFacets, useEventsFeed, useFacets, usePolicyEditor, usePolicyList, usePolicyPreview, useReindexJobs };
16459
+ export { ACTIVITY_FILTER_FIELDS, AUDIT_TEMPLATES, ActionMultiSelect, ActionToggle, ActivityApiClient, ActivityExpandedDetails, ActivityFeed, ActivityFeedFilters, ActivityFeedItem, ActivityFeedItemSkeleton, ActivityFeedSummary, ActivityLayout, ApiError, ApiErrorAlert, AuditEventViewer, AuditLogExpandedDetails, AuditLogFeedItem, AuditLogFilters, AuditLogQueryComponent, Badge, CelEditor, ChangeSourceToggle, Combobox, DateTimeRangePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, EVENT_FACET_FIELDS, EVENT_FILTER_FIELDS, EVENT_TEMPLATES, EventExpandedDetails, EventFeedItem, EventTypeToggle, EventsFeed, FILTER_FIELDS, FilterBuilder, FilterBuilderWithAutocomplete, MultiCombobox, NetworkError, POLICY_FILTER_FIELDS, PolicyActivityView, PolicyActivityViewSkeleton, PolicyDetailView, PolicyEditView, PolicyEditor, PolicyList, PolicyPreviewPanel, PolicyPreviewResult, PolicyResourceForm, PolicyRuleEditor, PolicyRuleEditorDialog, PolicyRuleList, PolicyRuleListItem, ReindexJobCreate, ReindexJobDetailView, ReindexJobDialog, ReindexJobList, ResourceHistoryView, RulePreviewPanel, SampleInputTemplates, SimpleQueryBuilder, TenantBadge, TimeRangeDropdown, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UserSelect, badgeVariants, buildAuditLogCEL, cn, copyToClipboard, defaultErrorFormatter, defaultResourceLinkResolver, extractEvent, extractFieldPaths, extractFieldPathsFromMany, generateShareableUrl, getReindexJobDuration, getReindexJobStatusMessage, isEventRecord, isReindexJobRunning, isReindexJobTerminal, parseActivityFilters, parseApiError, parseEventFilters, parseTimeRange, serializeActivityFilters, serializeEventFilters, useActivityFeed, useAuditLogFacets, useAuditLogQuery, useEventFacets, useEventsFeed, useFacets, usePolicyEditor, usePolicyList, usePolicyPreview, useReindexJobs };
16758
16460
  //# sourceMappingURL=index.esm.js.map