@oatfi/ui 0.4.0 → 0.6.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
@@ -478,6 +478,339 @@ interface DotsMenuProps {
478
478
  */
479
479
  declare function DotsMenu({ options, iconSize, ariaLabel, testId, }: DotsMenuProps): react__default.JSX.Element;
480
480
 
481
+ /**
482
+ * Accent asterisk marker, for annotating a label whose explanation appears in an
483
+ * `AsteriskNote` below it. Render with `aria-hidden` — the note carries the
484
+ * meaning, the mark is decoration.
485
+ */
486
+ declare const AsteriskMark: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLElement>, HTMLElement>, never> & Partial<Pick<react.DetailedHTMLProps<react.HTMLAttributes<HTMLElement>, HTMLElement>, never>>> & string;
487
+ /**
488
+ * Muted italic helper text paired with an `AsteriskMark`. Use the `.asterisk`
489
+ * class on a leading span to render the marker upright and accented inside the
490
+ * italic run:
491
+ *
492
+ * ```tsx
493
+ * <AsteriskNote>
494
+ * <span className="asterisk" aria-hidden="true">*</span>
495
+ * Provide Financial Statements to be approved for a higher credit limit.
496
+ * </AsteriskNote>
497
+ * ```
498
+ *
499
+ * Named `AsteriskNote` rather than `Footnote` deliberately: this package already
500
+ * exports a `Footnote`, which is an entirely different thing — a page-bottom
501
+ * `<footer>` with a title and links. The two were separate components sharing one
502
+ * name across repos, which is how they drifted.
503
+ *
504
+ * All colours come from theme tokens, so partner white-labelling recolours both.
505
+ */
506
+ declare const AsteriskNote: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never> & Partial<Pick<react.DetailedHTMLProps<react.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never>>> & string;
507
+
508
+ /**
509
+ * `info` — accent-tinted, for a suggestion ("Recommended")
510
+ * `success` — outlined green, for a confirmed state ("Verified")
511
+ * `neutral` — outlined grey, for a plain source label ("Via Plaid")
512
+ * `filled` — solid accent, for the one selected item in a set ("Default")
513
+ */
514
+ type BadgeVariant = 'info' | 'success' | 'neutral' | 'filled';
515
+ /**
516
+ * Small uppercase status pill.
517
+ *
518
+ * Overlaps `StatusTag` in role — both label a state in a few words — but they are
519
+ * not interchangeable: `StatusTag` is a solid filled tag with capitalised text,
520
+ * this is an uppercase letter-spaced pill. Both are in shipped, QA-approved UI, so
521
+ * consolidating them would change screens rather than clean up code.
522
+ *
523
+ * The four variants exist because onboarding grew two separate `Badge`
524
+ * components — one on the verification sources page, one on payment methods —
525
+ * with the same name, different looks, and colliding variant names (that one's
526
+ * unstyled default was this one's `neutral`, and its `default` was `filled`).
527
+ * Callers should always pass `$variant` explicitly rather than relying on the
528
+ * fallback.
529
+ */
530
+ declare const Badge: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "$variant"> & {
531
+ $variant?: BadgeVariant;
532
+ }, never> & Partial<Pick<styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "$variant"> & {
533
+ $variant?: BadgeVariant;
534
+ }, never>>> & string;
535
+
536
+ /** An already-uploaded file, as returned by the API rather than a local `File`. */
537
+ interface UploadedFile {
538
+ id: string;
539
+ fileName: string;
540
+ fileSize: number;
541
+ }
542
+ interface UploadZoneProps {
543
+ /** Comma-separated extension list, e.g. `.pdf,.xlsx`. */
544
+ accept?: string;
545
+ /** Requirements line under the drop target, e.g. "PDF up to 25MB each". */
546
+ hint?: string;
547
+ files?: UploadedFile[];
548
+ /** Called with the raw `FileList` from the picker or a drop. */
549
+ onAdd: (files: FileList) => void;
550
+ onRemove: (id: string) => void;
551
+ /** Ids currently being deleted — each shows a spinner instead of a remove button. */
552
+ removingIds?: Set<string>;
553
+ disabled?: boolean;
554
+ inputId?: string;
555
+ testId?: string;
556
+ }
557
+ /**
558
+ * Multi-file drop target with a list of what has already been uploaded.
559
+ *
560
+ * Distinct from `FileInput`, which is a single-file form field that validates and
561
+ * emits `(file, error)`. This one accepts many files, reports nothing about
562
+ * validity, and renders server-side state — the caller owns validation, upload
563
+ * and deletion. Keyboard accessible: the zone is a `role="button"` that opens the
564
+ * picker on Enter or Space.
565
+ */
566
+ declare function UploadZone({ accept, hint, files, onAdd, onRemove, removingIds, disabled, inputId, testId, }: UploadZoneProps): react__default.JSX.Element;
567
+
568
+ interface CollapsibleSourceProps {
569
+ title: string;
570
+ /** One-line description under the title. */
571
+ desc?: string;
572
+ /**
573
+ * Optional asterisk note. Its presence adds an `AsteriskMark` to the title and
574
+ * renders the note under the description.
575
+ */
576
+ note?: string;
577
+ open?: boolean;
578
+ onToggle?: () => void;
579
+ children?: react__default.ReactNode;
580
+ testId?: string;
581
+ }
582
+ /**
583
+ * One expandable verification/upload source: a header row that toggles, with the
584
+ * content revealed below. Only the open source is expanded, so a caller managing
585
+ * several passes `open` and `onToggle` per source.
586
+ *
587
+ * Purely presentational — it owns no open state and knows nothing about what it
588
+ * contains.
589
+ */
590
+ declare function CollapsibleSource({ title, desc, note, open, onToggle, children, testId, }: CollapsibleSourceProps): react__default.JSX.Element;
591
+
592
+ /** The subset of a Plaid connection this tile renders. */
593
+ interface PlaidConnection {
594
+ institution?: {
595
+ name?: string;
596
+ } | null;
597
+ accounts?: {
598
+ mask?: string;
599
+ accountMask?: string;
600
+ }[] | null;
601
+ }
602
+ interface PlaidTileProps {
603
+ /** Null or undefined renders the unconnected state. */
604
+ plaidData?: PlaidConnection | null;
605
+ onConnect?: () => void;
606
+ isConnecting?: boolean;
607
+ /** Rendered as `data-testid` on the connect/reconnect button. */
608
+ testId?: string;
609
+ }
610
+ /**
611
+ * Bank-connection tile for Plaid: shows the connected institution and masked
612
+ * account, or a prompt to connect.
613
+ *
614
+ * Styled through the MUI palette rather than styled-components theme tokens,
615
+ * because it needs `alpha()` on the success colour. Both are driven by the same
616
+ * partner branding via `buildMuiTheme`, so white-labelling still applies.
617
+ */
618
+ declare function PlaidTile({ plaidData, onConnect, isConnecting, testId }: PlaidTileProps): react__default.JSX.Element;
619
+
620
+ interface TermsDocumentProps {
621
+ /**
622
+ * **Already-sanitized** HTML. This component renders it with
623
+ * `dangerouslySetInnerHTML` and does no sanitizing of its own — the caller owns
624
+ * that, because sanitizing here would make DOMPurify a dependency of every
625
+ * consumer of this package.
626
+ *
627
+ * Callers fetch terms as HTML from the API, decode entities, run DOMPurify, and
628
+ * pass the result. Never pass anything that has not been through that.
629
+ */
630
+ html: string;
631
+ className?: string;
632
+ testId?: string;
633
+ }
634
+ /**
635
+ * Scrollable panel for a terms or disclosure document.
636
+ *
637
+ * Note the background: onboarding's original read `theme.colors.paper`, which is
638
+ * not a token in this theme, so it silently resolved to nothing and the panel had
639
+ * no background at all. This uses `surface`, which is what it was reaching for.
640
+ */
641
+ declare function TermsDocument({ html, className, testId }: TermsDocumentProps): react__default.JSX.Element;
642
+ /** Right-aligned hint under an action, e.g. why a button is disabled. */
643
+ declare const HelperText: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react__default.DetailedHTMLProps<react__default.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never> & Partial<Pick<react__default.DetailedHTMLProps<react__default.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>>> & string;
644
+
645
+ /**
646
+ * Underwriting outcomes as the API reports them.
647
+ *
648
+ * The declined set is deliberately wide: `CLOSED_NO_DECISION`, `DECLINED`,
649
+ * `DENIED`, `ERROR`, `N/A` and `REJECTED` all mean "no" to a borrower and are
650
+ * shown identically. Anything unrecognised — including `MANUAL_REVIEW`,
651
+ * `NOT_EXECUTED` and `null` — falls through to the manual-review message rather
652
+ * than showing nothing, because an unknown status must never read as approval.
653
+ */
654
+ type UnderwritingDecision = 'PROCESSING' | 'APPROVED' | 'MANUAL_REVIEW' | 'NOT_EXECUTED' | 'CLOSED_NO_DECISION' | 'DECLINED' | 'DENIED' | 'ERROR' | 'N/A' | 'REJECTED';
655
+ interface UnderwritingStatusProps {
656
+ status?: string | null;
657
+ /**
658
+ * Pre-formatted for display, e.g. `"$50,000.00"`. A string rather than a number
659
+ * so currency formatting stays with the consumer — this package has no locale or
660
+ * currency opinion. Omit to show approval without an amount.
661
+ */
662
+ creditLimit?: string | null;
663
+ /** Rendered under the approved state, for follow-on actions. */
664
+ children?: react__default.ReactNode;
665
+ testId?: string;
666
+ }
667
+ /**
668
+ * The borrower-facing result of underwriting: in progress, approved, declined, or
669
+ * under manual review.
670
+ *
671
+ * Presentational only — it neither fetches nor polls. The caller owns the status
672
+ * and re-renders this as it changes.
673
+ */
674
+ declare function UnderwritingStatus({ status, creditLimit, children, testId, }: UnderwritingStatusProps): react__default.JSX.Element;
675
+
676
+ /**
677
+ * Layout for a payment-method row: a radio, a body, and a header with a title and
678
+ * a trailing action.
679
+ *
680
+ * `$default` marks the selected method (accent border and tint); `$readonly` marks
681
+ * one the borrower cannot edit here, such as an account managed through Plaid;
682
+ * `$edited` marks one carrying changes that have not been saved yet.
683
+ */
684
+ declare const MethodCard: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$default" | "$readonly" | "$edited"> & {
685
+ $default?: boolean;
686
+ $readonly?: boolean;
687
+ $edited?: boolean;
688
+ }, never> & Partial<Pick<styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$default" | "$readonly" | "$edited"> & {
689
+ $default?: boolean;
690
+ $readonly?: boolean;
691
+ $edited?: boolean;
692
+ }, never>>> & string;
693
+ declare const MethodBody: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
694
+ /** `$tight` for a card with no form fields under the header. */
695
+ declare const MethodHeader: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$tight"> & {
696
+ $tight?: boolean;
697
+ }, never> & Partial<Pick<styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$tight"> & {
698
+ $tight?: boolean;
699
+ }, never>>> & string;
700
+ declare const MethodTitle: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never> & Partial<Pick<react.DetailedHTMLProps<react.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>>> & string;
701
+ /** Two-up field row that stacks on narrow screens. */
702
+ declare const FieldsGrid: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
703
+ /** Accent-tinted note with a leading icon slot. */
704
+ declare const Banner: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
705
+ /**
706
+ * Footer row for a step's actions.
707
+ *
708
+ * `space-between` is for the two-part footer a stepped flow has — Back on the
709
+ * left, status and the primary action on the right. A servicing screen that saves
710
+ * in place has no Back, and space-between then drops its lone action on the left,
711
+ * where it reads as the secondary half of a pair that isn't there. So a single
712
+ * child is pushed to the right instead; two or more keep the split.
713
+ */
714
+ declare const FooterActions: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
715
+ declare const FooterRight: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
716
+
717
+ interface PlaidMethodCardProps {
718
+ plaidData?: {
719
+ institution?: {
720
+ name?: string;
721
+ } | null;
722
+ accounts?: {
723
+ mask?: string;
724
+ accountMask?: string;
725
+ }[] | null;
726
+ } | null;
727
+ isDefault?: boolean;
728
+ onSelectDefault?: () => void;
729
+ /** Distinguishes the radio group when several cards share a page. */
730
+ name?: string;
731
+ testId?: string;
732
+ }
733
+ /**
734
+ * Read-only payment method sourced from Plaid. It cannot be edited or removed
735
+ * here — disconnecting happens wherever the bank connection is managed — but it
736
+ * can still be chosen as the default.
737
+ *
738
+ * Routing is deliberately absent: Plaid Link metadata exposes an account mask but
739
+ * no routing number client-side.
740
+ */
741
+ declare function PlaidMethodCard({ plaidData, isDefault, onSelectDefault, name, testId, }: PlaidMethodCardProps): react__default.JSX.Element;
742
+
743
+ interface ManualMethodValue {
744
+ id: string;
745
+ account: string;
746
+ routing: string;
747
+ }
748
+ /**
749
+ * Where the row stands against what is stored.
750
+ *
751
+ * `saved` — on file and unchanged. `edited` — on file, with changes not yet
752
+ * written. A row the borrower has just added is neither: omit the prop.
753
+ *
754
+ * Only `edited` is marked. `saved` deliberately renders the same as a new row for
755
+ * now — the card stays quiet until the borrower actually changes something — but
756
+ * it remains a distinct value because the caller already tells the two apart, and
757
+ * marking a stored row is a change of copy here rather than a change of API.
758
+ *
759
+ * The caller owns the comparison, because only it knows what was loaded.
760
+ */
761
+ type ManualMethodStatus = 'saved' | 'edited';
762
+ interface ManualMethodCardProps {
763
+ /** Zero-based; rendered as "Account {index + 1}". */
764
+ index: number;
765
+ value: ManualMethodValue;
766
+ isDefault?: boolean;
767
+ /**
768
+ * Whether this account is already stored, and whether it has been changed
769
+ * since. Omit for a row the borrower has just added. Only `edited` is marked.
770
+ */
771
+ status?: ManualMethodStatus;
772
+ /** Disables removal when this is the last remaining method. */
773
+ trashDisabled?: boolean;
774
+ disabled?: boolean;
775
+ accountError?: string;
776
+ routingError?: string;
777
+ onSelectDefault?: () => void;
778
+ onChangeField: (field: 'account' | 'routing', next: string) => void;
779
+ onBlurField: (field: 'account' | 'routing') => void;
780
+ onRemove?: () => void;
781
+ name?: string;
782
+ }
783
+ /**
784
+ * Editable manual payment method — account and routing number.
785
+ *
786
+ * Validation is the caller's: pass `accountError`/`routingError` and use
787
+ * `onBlurField` to decide when to surface them. Onboarding shows errors on blur
788
+ * and never while typing, which is worth keeping.
789
+ *
790
+ * A stored account is an ordinary editable field here — nothing about the inputs
791
+ * says the borrower is overwriting something real. `status` is what says it, and
792
+ * it is worth passing wherever saved accounts are rendered.
793
+ */
794
+ declare function ManualMethodCard({ index, value, isDefault, status, trashDisabled, disabled, accountError, routingError, onSelectDefault, onChangeField, onBlurField, onRemove, name, }: ManualMethodCardProps): react__default.JSX.Element;
795
+
796
+ interface AchVerificationConsentProps {
797
+ consentGiven?: boolean;
798
+ onChange: (checked: boolean) => void;
799
+ disabled?: boolean;
800
+ /** Label for the action the consent is attached to. Defaults to "Continue". */
801
+ actionLabel?: string;
802
+ testId?: string;
803
+ }
804
+ /**
805
+ * ACH verification consent and PATRIOT Act acknowledgement, required before
806
+ * payment methods can be saved.
807
+ *
808
+ * `actionLabel` exists because the copy names the button the borrower is about to
809
+ * press — "By clicking Continue…" is right in a stepped flow, but a servicing
810
+ * screen that saves in place needs its own verb.
811
+ */
812
+ declare function AchVerificationConsent({ consentGiven, onChange, disabled, actionLabel, testId, }: AchVerificationConsentProps): react__default.JSX.Element;
813
+
481
814
  interface PreviewProps {
482
815
  /** Partner branding to render the sample with. Omit for the default theme. */
483
816
  branding?: Branding;
@@ -491,5 +824,5 @@ interface PreviewProps {
491
824
  */
492
825
  declare function Preview({ branding, className }: PreviewProps): react__default.JSX.Element;
493
826
 
494
- export { AutocompleteInput, BaseInput, Body100, Body200, Body400, Button, ButtonContainer, CheckboxInput, Container, Content, CurrencyInput, DateInput, DetailElement, DetailRow, DetailsContainer, DotsMenu, DropDown, DropdownContainer, DropdownItem, DropdownList, EmailInput, FileInput, FlexColumnWrapper, FlexRowWrapper, Footnote, Form, FormActions, FormCheckboxLabel, FormColumn, FormRow, FormSubtitle, FormTitle, H1, H2, H3, InputError, InputLabel, InputWrapper, Loader, NoResults, PhoneInput, Preview, RadioInput, SSNInput, SearchDropdown, SelectInput, StatusTag, Stepper, Tabs, TaxIdInput, TermsList, TextInput, ThemeProvider, buildMuiTheme, defaultTheme, mergeBranding, useTheme };
495
- export type { Branding, CurrencyInputProps, DateInputProps, DotsMenuOption, DotsMenuProps, DropDownProps, EmailInputProps, FileInputProps, FootnoteLink, FootnoteProps, LoaderProps, Option, PhoneInputProps, PreviewProps, SSNInputProps, SearchDropdownProps, StepperProps, StepperStep, Tab, TabsProps, TaxIdInputProps, TextInputProps, Theme, ThemeBorder, ThemeColors, ThemeProviderProps, ThemeTypography };
827
+ export { AchVerificationConsent, AsteriskMark, AsteriskNote, AutocompleteInput, Badge, Banner, BaseInput, Body100, Body200, Body400, Button, ButtonContainer, CheckboxInput, CollapsibleSource, Container, Content, CurrencyInput, DateInput, DetailElement, DetailRow, DetailsContainer, DotsMenu, DropDown, DropdownContainer, DropdownItem, DropdownList, EmailInput, FieldsGrid, FileInput, FlexColumnWrapper, FlexRowWrapper, FooterActions, FooterRight, Footnote, Form, FormActions, FormCheckboxLabel, FormColumn, FormRow, FormSubtitle, FormTitle, H1, H2, H3, HelperText, InputError, InputLabel, InputWrapper, Loader, ManualMethodCard, MethodBody, MethodCard, MethodHeader, MethodTitle, NoResults, PhoneInput, PlaidMethodCard, PlaidTile, Preview, RadioInput, SSNInput, SearchDropdown, SelectInput, StatusTag, Stepper, Tabs, TaxIdInput, TermsDocument, TermsList, TextInput, ThemeProvider, UnderwritingStatus, UploadZone, buildMuiTheme, defaultTheme, mergeBranding, useTheme };
828
+ export type { AchVerificationConsentProps, BadgeVariant, Branding, CollapsibleSourceProps, CurrencyInputProps, DateInputProps, DotsMenuOption, DotsMenuProps, DropDownProps, EmailInputProps, FileInputProps, FootnoteLink, FootnoteProps, LoaderProps, ManualMethodCardProps, ManualMethodStatus, ManualMethodValue, Option, PhoneInputProps, PlaidConnection, PlaidMethodCardProps, PlaidTileProps, PreviewProps, SSNInputProps, SearchDropdownProps, StepperProps, StepperStep, Tab, TabsProps, TaxIdInputProps, TermsDocumentProps, TextInputProps, Theme, ThemeBorder, ThemeColors, ThemeProviderProps, ThemeTypography, UnderwritingDecision, UnderwritingStatusProps, UploadZoneProps, UploadedFile };