@fairmint/ui 0.2.6 → 0.2.8

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.
@@ -0,0 +1,16 @@
1
+ import { SelectProps } from '../../primitives/Select/Select';
2
+ export interface USStateOption {
3
+ value: string;
4
+ label: string;
5
+ }
6
+ /** All 50 US states plus DC. Readonly to prevent accidental consumer mutation. */
7
+ export declare const US_STATES: readonly USStateOption[];
8
+ export interface USStateFieldProps extends Omit<SelectProps, "data"> {
9
+ }
10
+ /**
11
+ * US state selector for mailing address forms.
12
+ * Always shows all 50 US states + DC.
13
+ * Use StateField (when built) for tax residency — it switches between US/CA based on countryCode.
14
+ */
15
+ export declare function USStateField({ label, placeholder, ...rest }: USStateFieldProps): import("react/jsx-runtime").JSX.Element;
16
+ //# sourceMappingURL=USStateField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"USStateField.d.ts","sourceRoot":"","sources":["../../../../src/components/form/USStateField/USStateField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE1E,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,kFAAkF;AAClF,eAAO,MAAM,SAAS,EAAE,SAAS,aAAa,EAoD7C,CAAC;AAEF,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC;CAAG;AAEvE;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,EAAE,iBAAiB,2CAW9E"}
@@ -0,0 +1,52 @@
1
+ import { Area } from 'react-easy-crop';
2
+ /**
3
+ * Extracts the cropped region from an image URL using an off-screen canvas
4
+ * and returns it as a JPEG Blob.
5
+ *
6
+ * Exported for direct unit testing of the extraction logic.
7
+ */
8
+ export declare function getCroppedBlob(imageSrc: string, croppedAreaPixels: Area): Promise<Blob>;
9
+ export interface PhotoCropModalProps {
10
+ /** Whether the modal is open. */
11
+ opened: boolean;
12
+ /** The file selected by the user. Pass null to clear state on close. */
13
+ file: File | null;
14
+ /**
15
+ * Called when the user confirms the crop.
16
+ * Receives the cropped image as a JPEG Blob ready for upload.
17
+ * May be async — the Apply button stays in a loading state until the returned
18
+ * Promise resolves, preventing duplicate submissions.
19
+ * Handle upload errors inside `onConfirm` (e.g., show a notification). Any
20
+ * unhandled rejection is caught by the component and passed to `onError`.
21
+ */
22
+ onConfirm: (blob: Blob) => void | Promise<void>;
23
+ /** Called when the user cancels or closes the modal. */
24
+ onClose: () => void;
25
+ /**
26
+ * Called when crop extraction fails (canvas unavailable, image decode error)
27
+ * or when `onConfirm` throws/rejects without handling the error internally.
28
+ *
29
+ * If your `onConfirm` already handles upload errors (e.g. shows a
30
+ * notification inside a try/catch), this will not be called for upload
31
+ * failures. Use this as a safety net for errors that escape `onConfirm`.
32
+ */
33
+ onError?: (error: Error) => void;
34
+ /** Aspect ratio (width / height). Defaults to 1 (square — ideal for profile photos). */
35
+ aspect?: number;
36
+ /**
37
+ * Shape of the crop area overlay.
38
+ * - "round" (default) — circular, ideal for profile avatars.
39
+ * - "rect" — rectangular, honours the exact aspect ratio.
40
+ */
41
+ cropShape?: "round" | "rect";
42
+ }
43
+ /**
44
+ * Modal that lets the user position and crop a profile photo before upload.
45
+ * Uses react-easy-crop for the drag/zoom interaction and an off-screen canvas
46
+ * to extract the cropped JPEG Blob.
47
+ *
48
+ * The consumer is responsible for the upload step — call your upload mutation
49
+ * in the onConfirm callback.
50
+ */
51
+ export declare function PhotoCropModal({ opened, file, onConfirm, onClose, onError, aspect, cropShape, }: PhotoCropModalProps): import("react/jsx-runtime").JSX.Element;
52
+ //# sourceMappingURL=PhotoCropModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PhotoCropModal.d.ts","sourceRoot":"","sources":["../../../../src/components/generic/PhotoCropModal/PhotoCropModal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAO5C;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,iBAAiB,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAmC7F;AAED,MAAM,WAAW,mBAAmB;IAClC,iCAAiC;IACjC,MAAM,EAAE,OAAO,CAAC;IAChB,wEAAwE;IACxE,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB;;;;;;;OAOG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,wDAAwD;IACxD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,wFAAwF;IACxF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,IAAI,EACJ,SAAS,EACT,OAAO,EACP,OAAO,EACP,MAAU,EACV,SAAmB,GACpB,EAAE,mBAAmB,2CA4GrB"}
@@ -0,0 +1,5 @@
1
+ import { LoaderProps as MantineLoaderProps } from '@mantine/core';
2
+ export interface LoaderProps extends MantineLoaderProps {
3
+ }
4
+ export declare function Loader(props: LoaderProps): import("react/jsx-runtime").JSX.Element;
5
+ //# sourceMappingURL=Loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Loader.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/Loader/Loader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,WAAW,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEhG,MAAM,WAAW,WAAY,SAAQ,kBAAkB;CAAG;AAE1D,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,2CAExC"}
@@ -6,6 +6,7 @@ export { Button, type ButtonProps } from './Button/Button';
6
6
  export { Card } from './Card/Card';
7
7
  export { Checkbox } from './Checkbox/Checkbox';
8
8
  export { Drawer } from './Drawer/Drawer';
9
+ export { Loader, type LoaderProps } from './Loader/Loader';
9
10
  export { Menu } from './Menu/Menu';
10
11
  export { Modal } from './Modal/Modal';
11
12
  export { PasswordInput } from './PasswordInput/PasswordInput';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC"}
@@ -14,6 +14,22 @@ export interface InvestorProfileCardProps {
14
14
  subtitle?: string;
15
15
  /** Additional content below the profile info. */
16
16
  children?: ReactNode;
17
+ /** If undefined, no pencil icon is shown. */
18
+ onEditName?: () => void;
19
+ /** If undefined, no camera overlay is shown. */
20
+ onUploadPhoto?: () => void;
21
+ /** Shows a centered Loader over the avatar during upload. */
22
+ photoUploading?: boolean;
23
+ /**
24
+ * Icon rendered inside the pencil ActionIcon (e.g. `<IconPencil size={14} />`).
25
+ * Defaults to a built-in pencil SVG when not provided.
26
+ */
27
+ editNameIcon?: ReactNode;
28
+ /**
29
+ * Icon rendered inside the camera overlay (e.g. `<IconCamera size={20} color="white" />`).
30
+ * Defaults to a built-in camera SVG when not provided.
31
+ */
32
+ uploadPhotoIcon?: ReactNode;
17
33
  }
18
- export declare function InvestorProfileCard({ name, email, avatarUrl, verificationStatus, memberSince, subtitle, children, }: InvestorProfileCardProps): import("react/jsx-runtime").JSX.Element;
34
+ export declare function InvestorProfileCard({ name, email, avatarUrl, verificationStatus, memberSince, subtitle, children, onEditName, onUploadPhoto, photoUploading, editNameIcon, uploadPhotoIcon, }: InvestorProfileCardProps): import("react/jsx-runtime").JSX.Element;
19
35
  //# sourceMappingURL=InvestorProfileCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"InvestorProfileCard.d.ts","sourceRoot":"","sources":["../../../../src/components/specific/InvestorProfileCard/InvestorProfileCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,MAAM,WAAW,wBAAwB;IACvC,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,wJAAwJ;IACxJ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAQD,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,KAAK,EACL,SAAS,EACT,kBAAkB,EAClB,WAAW,EACX,QAAQ,EACR,QAAQ,GACT,EAAE,wBAAwB,2CAoC1B"}
1
+ {"version":3,"file":"InvestorProfileCard.d.ts","sourceRoot":"","sources":["../../../../src/components/specific/InvestorProfileCard/InvestorProfileCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AASjD,MAAM,WAAW,wBAAwB;IACvC,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,wJAAwJ;IACxJ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,gDAAgD;IAChD,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,6DAA6D;IAC7D,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;OAGG;IACH,eAAe,CAAC,EAAE,SAAS,CAAC;CAC7B;AA6CD,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,KAAK,EACL,SAAS,EACT,kBAAkB,EAClB,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,aAAa,EACb,cAAc,EACd,YAAY,EACZ,eAAe,GAChB,EAAE,wBAAwB,2CAsH1B"}