@nivaro/react 0.1.282 → 0.1.283

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.d.ts CHANGED
@@ -346,6 +346,20 @@ declare interface AvailableBulkAction {
346
346
  guard?: GuardRule[] | null;
347
347
  }
348
348
 
349
+ export declare interface BannerLine {
350
+ api: string;
351
+ tone: 'danger' | 'warning' | 'neutral' | 'positive';
352
+ text: string;
353
+ obligation_id: number;
354
+ outcome: string;
355
+ }
356
+
357
+ /** Newest obligation per partner, in the words the record's reader needs:
358
+ * when they were told, or when they should have been and why not. Pure —
359
+ * no fetch, so it's unit-testable without a DOM and reusable by the record
360
+ * banner AND anywhere else that ends up wanting the same sentence. */
361
+ export declare function bannerLines(rows: Row[], now?: Date): BannerLine[];
362
+
349
363
  export declare function BaseMap({ pins, bubbles, statusLine, onPinClick, onBubbleClick, minHeight, focus }: {
350
364
  pins: BaseMapPin[];
351
365
  bubbles?: BaseMapBubble[];
@@ -1229,6 +1243,17 @@ export declare function dmPeer(room: string, self: string): string | null;
1229
1243
 
1230
1244
  export declare function dmRoom(a: string, b: string): string;
1231
1245
 
1246
+ /** One dot per partner, worst outcome winning — a red dot must never be
1247
+ * hidden behind a green one from the same partner. Superseded rows are
1248
+ * never a partner's CURRENT state, so they never contribute a dot at all. */
1249
+ export declare function dotsForRecord(rows: Array<{
1250
+ api: string;
1251
+ outcome: string;
1252
+ }>): Array<{
1253
+ api: string;
1254
+ tone: 'positive' | 'warning' | 'danger' | 'neutral';
1255
+ }>;
1256
+
1232
1257
  declare type DrawerRelationConfig = string | {
1233
1258
  field: string;
1234
1259
  hint?: {
@@ -2262,6 +2287,55 @@ declare interface InputBinding {
2262
2287
  binding_value: string;
2263
2288
  }
2264
2289
 
2290
+ export declare function IntegrationDots({ rows, className }: IntegrationDotsProps): JSX.Element;
2291
+
2292
+ export declare interface IntegrationDotsProps {
2293
+ rows: Array<{
2294
+ api: string;
2295
+ outcome: string;
2296
+ }> | undefined;
2297
+ className?: string;
2298
+ }
2299
+
2300
+ export declare function IntegrationObligationsView({ api, className }: IntegrationObligationsViewProps): JSX.Element;
2301
+
2302
+ export declare interface IntegrationObligationsViewProps {
2303
+ /** Pre-select and scope the board to one partner's tiles. Absent (the
2304
+ * admin Integration Health page's usage) shows every registered API. */
2305
+ api?: string;
2306
+ className?: string;
2307
+ }
2308
+
2309
+ /** The filter-pill set the collection browser offers (its own conditions[]
2310
+ * round trip to `/items/:collection` — the queue has no equivalent server
2311
+ * path, so it gets the column but not the filter). Values are the same
2312
+ * bucket names `applyIntegrationsFilter` (api/src/services/items.ts) reads,
2313
+ * so a picked value needs no translation before it rides a condition. */
2314
+ export declare const INTEGRATIONS_FILTER_OPTIONS: {
2315
+ value: string;
2316
+ label: string;
2317
+ }[];
2318
+
2319
+ export declare function IntegrationStatusBanner({ collection, itemId }: IntegrationStatusBannerProps): JSX.Element | null;
2320
+
2321
+ /**
2322
+ * One line per partner on the record: were they told, when, and if not, why
2323
+ * not. Sits above `ErpFailureBanner`, which keeps the payload/response view
2324
+ * and the retry mutation — this answers a different question ("was the
2325
+ * partner told, and when") and does not replace it.
2326
+ *
2327
+ * Renders nothing when the record has no obligations, so a collection with
2328
+ * no integrations pays one cached request and shows no chrome.
2329
+ *
2330
+ * `roleForTone` is imported from `IntegrationObligationsView` (the board)
2331
+ * rather than duplicated here, so the board and this banner can never
2332
+ * disagree about what "overdue" looks like.
2333
+ */
2334
+ export declare interface IntegrationStatusBannerProps {
2335
+ collection: string;
2336
+ itemId: string | number;
2337
+ }
2338
+
2265
2339
  export declare function ItemActionButtons({ collection, itemId }: {
2266
2340
  collection: string;
2267
2341
  itemId: string;
@@ -3177,6 +3251,23 @@ declare interface O2MFieldInfo {
3177
3251
  parentId: string;
3178
3252
  }
3179
3253
 
3254
+ /**
3255
+ * Pure filter-state helpers for the integration obligations board
3256
+ * (`IntegrationObligationsView`). Kept separate from the component so the
3257
+ * query-param and tone rules are unit-testable without a DOM.
3258
+ */
3259
+ export declare interface ObligationFilterState {
3260
+ api: string | null;
3261
+ kind: string | null;
3262
+ outcome: string[];
3263
+ ageHours: number | null;
3264
+ }
3265
+
3266
+ /** Unset filters are omitted entirely — an empty string would narrow the
3267
+ * query to rows whose column is empty, which is never what a cleared filter
3268
+ * means. */
3269
+ export declare function obligationQueryParams(s: ObligationFilterState): Record<string, string>;
3270
+
3180
3271
  /**
3181
3272
  * Offline banner (#348): connectivity loss shows an honest "offline — changes
3182
3273
  * paused" strip and clears itself when the connection returns. Uses the
@@ -4438,6 +4529,21 @@ export declare interface RoomInfo {
4438
4529
  */
4439
4530
  declare type RoomOpener = (room: string, label?: string) => void;
4440
4531
 
4532
+ declare interface Row {
4533
+ id: number;
4534
+ api: string;
4535
+ kind: string;
4536
+ outcome: string;
4537
+ reason: string | null;
4538
+ due_at: string;
4539
+ resolved_at: string | null;
4540
+ /** 'transition' | 'hook' | 'flow' | 'cron' | 'reconcile' | 'manual' —
4541
+ * kept as a bare string rather than importing the server's
4542
+ * ObligationTrigger union into this client lib for one comparison, so a
4543
+ * new trigger kind added server-side never breaks this file's build. */
4544
+ trigger?: string;
4545
+ }
4546
+
4441
4547
  export declare const ROW_HIGHLIGHT_TINTS: Record<string, {
4442
4548
  row: string;
4443
4549
  text: string;
@@ -4864,6 +4970,13 @@ export declare function titleCase(str: string): string;
4864
4970
 
4865
4971
  export declare type TokenResolver = (path: string) => unknown;
4866
4972
 
4973
+ /** Which of the four alert tones an outcome reads as — overdue/failed/missing
4974
+ * are the record still does NOT have what it should (danger); pending and
4975
+ * skipped are in flight or a deliberate no with a reason (warning, worth a
4976
+ * look, not an alarm); sent is the good outcome (positive); anything else
4977
+ * (superseded) is informational (neutral). */
4978
+ export declare function toneForOutcome(outcome: string): 'danger' | 'warning' | 'neutral' | 'positive';
4979
+
4867
4980
  /** Install the listeners. Safe to call more than once. */
4868
4981
  export declare function trackActivity(): void;
4869
4982