@nivaro/react 0.1.182 → 0.1.184

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +27 -0
  2. package/dist/index.js +9413 -9313
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -341,6 +341,33 @@ declare interface CellFilterLite {
341
341
  id_value?: number | null;
342
342
  }
343
343
 
344
+ /** Shape of the 422 CHANGE_REASON_REQUIRED challenge from the items service. */
345
+ export declare interface ChangeReasonChallenge {
346
+ fields_changed: string[];
347
+ reasons: string[];
348
+ allow_free_text: boolean;
349
+ }
350
+
351
+ /**
352
+ * Extract a change-reason challenge from a failed save, or null when the
353
+ * error is anything else. Works on SDK errors (parsed body on `.response`)
354
+ * and axios-style errors (`.response.data`).
355
+ */
356
+ export declare function changeReasonChallenge(err: unknown): ChangeReasonChallenge | null;
357
+
358
+ /**
359
+ * Justification prompt shown when a save touches a change-reason-flagged
360
+ * field. Preset reasons render as a pick list; free text is allowed unless the
361
+ * collection's config disables it. Submitting retries the save with
362
+ * `_change_reason` on the payload.
363
+ */
364
+ export declare function ChangeReasonDialog({ challenge, fieldLabel, onSubmit, onCancel }: {
365
+ challenge: ChangeReasonChallenge | null;
366
+ fieldLabel?: (field: string) => string;
367
+ onSubmit: (reason: string) => void;
368
+ onCancel: () => void;
369
+ }): JSX.Element | null;
370
+
344
371
  declare interface ChannelMember {
345
372
  user: string;
346
373
  first_name: string | null;