@movmo_app/react-common 0.20.0 → 0.21.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.d.ts CHANGED
@@ -20,6 +20,33 @@ import * as SwitchPrimitive from '@radix-ui/react-switch';
20
20
  import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
21
21
  import { User } from '@movmo_app/types';
22
22
 
23
+ /** What a `403 account_deletion_pending` carries. Both fields are optional. */
24
+ export declare interface AccountDeletionPending {
25
+ /** RFC3339 instant the account will be deleted. */
26
+ scheduledFor?: string;
27
+ /** Server-issued link that restores the account. */
28
+ restoreUrl?: string;
29
+ }
30
+
31
+ /**
32
+ * Shown in place of a flow when the signed-in account is scheduled for
33
+ * deletion. Presentational: the host decides when to render it and where
34
+ * "Go to your Movmo account" goes.
35
+ */
36
+ export declare const AccountDeletionPendingCard: ({ scheduledFor, accountsUrl, onClose, closeLabel, headingRef, }: AccountDeletionPendingCardProps) => React_2.ReactElement;
37
+
38
+ export declare interface AccountDeletionPendingCardProps {
39
+ /** RFC3339 deletion instant (`403 account_deletion_pending` / `User.account_deletion`). */
40
+ scheduledFor?: string;
41
+ /** Where "Go to your Movmo account" leads (same tab). */
42
+ accountsUrl: string;
43
+ /** Renders a secondary button labelled `closeLabel` when both are set. */
44
+ onClose?: () => void;
45
+ closeLabel?: string;
46
+ /** Lets the host move focus to the heading when the card replaces other content. */
47
+ headingRef?: React_2.Ref<HTMLHeadingElement>;
48
+ }
49
+
23
50
  /** Untitled UI `alert-circle`. */
24
51
  export declare const AlertCircleIcon: (props: IconProps) => JSX_2.Element;
25
52
 
@@ -230,6 +257,21 @@ export declare const findLocaleOption: (languageCode: string, regionCode: string
230
257
  /** Untitled UI `fingerprint-04`. */
231
258
  export declare const FingerprintIcon: (props: IconProps) => JSX_2.Element;
232
259
 
260
+ /**
261
+ * Long date ("November 6, 2026") in the viewer's locale and time zone. Returns
262
+ * "" for an empty or unparseable value.
263
+ */
264
+ export declare function formatDeletionDate(iso: string, locale?: string): string;
265
+
266
+ /**
267
+ * Recognises the "account is scheduled for deletion" rejection: an axios-style
268
+ * error (`{ response: { status: 403, data: { code: 'account_deletion_pending',
269
+ * scheduled_for?, restore_url? } } }`) or this package's own `AuthError`
270
+ * (`code: 'account_deletion_pending'`, which carries no dates). Returns `null`
271
+ * for anything else. Never throws.
272
+ */
273
+ export declare function getAccountDeletionPending(err: unknown): AccountDeletionPending | null;
274
+
233
275
  export declare const getCurrencyDisplayText: (option: CurrencyOption) => string;
234
276
 
235
277
  export declare const getLanguageDisplayName: (option: LocaleOption) => string;
@@ -704,14 +746,18 @@ export declare function readPromptState(cookie?: string, now?: number): PromptSt
704
746
  * entry ("I can't use my passkey"): recovery starts from the sign-in page. No autofill, no discoverable "Sign in with passkey", no
705
747
  * enrollment prompt. The flow is single-use and is mounted only while open,
706
748
  * so every open starts fresh. In a framed window it only says "Manage
707
- * passkeys on the Movmo Security page." and makes no sign-in or WebAuthn call.
749
+ * passkeys on the Movmo Security page." (or, for `delete-account`, to open the
750
+ * account in its own window) and makes no sign-in or WebAuthn call.
708
751
  */
709
752
  export declare const ReauthDialog: ({ isOpen, ...props }: ReauthDialogProps) => JSX_2.Element | null;
710
753
 
711
754
  export declare interface ReauthDialogProps {
712
755
  isOpen: boolean;
713
- /** Picks the description: "…to add a passkey." or "…to remove this passkey." */
714
- action: 'add' | 'remove';
756
+ /**
757
+ * Picks the description: "…to add a passkey.", "…to remove this passkey." or
758
+ * "…to delete your account."
759
+ */
760
+ action: 'add' | 'remove' | 'delete-account';
715
761
  /** The signed-in account. Its email is locked; its id must match whoever signs in. */
716
762
  account: {
717
763
  id: string;
@@ -796,6 +842,16 @@ export declare const ShieldTickIcon: (props: IconProps) => JSX_2.Element;
796
842
  */
797
843
  export declare function shouldOfferPasskey(now?: number, s?: PromptState | null): boolean;
798
844
 
845
+ /**
846
+ * Tells the provider the account is gone from this sign-in's point of view: no
847
+ * credential is accepted any more (`signalAllAcceptedCredentials` with an empty
848
+ * list). Call it only after the deletion request answered 202, with a handle
849
+ * fetched BEFORE the request (the server forgets it afterwards). Same rules as
850
+ * the other signals: best effort, synchronous, never awaited, never logged,
851
+ * no-op when framed or when the static is missing.
852
+ */
853
+ export declare function signalAccountDeletion(handle: PasskeySignalFallback): void;
854
+
799
855
  /**
800
856
  * Tells the credential provider which passkeys the server still accepts and the
801
857
  * account's current name (WebAuthn Signal API; MOVMO-738). Best effort: