@nivaro/react 0.1.182 → 0.1.183

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
@@ -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;
package/dist/index.js CHANGED
@@ -72811,6 +72811,7 @@ export {
72811
72811
  zq as BooleanField,
72812
72812
  eF as BroadcastView,
72813
72813
  _g as CellCopyLayer,
72814
+ _m as ChangeReasonDialog,
72814
72815
  US as ChatChannelBrowser,
72815
72816
  IS as ChatChannelSettings,
72816
72817
  xF as ChatPanel,
@@ -72926,6 +72927,7 @@ export {
72926
72927
  sw as canOpenDm,
72927
72928
  lF as canPreviewFile,
72928
72929
  VF as captureErrorClip,
72930
+ xc as changeReasonChallenge,
72929
72931
  rw as chatAvatarColor,
72930
72932
  aw as chatInitials,
72931
72933
  Lu as choiceLabel,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nivaro/react",
3
- "version": "0.1.182",
3
+ "version": "0.1.183",
4
4
  "description": "React hooks and components for Nivaro CMS forms",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",