@oatfi/ui 0.4.0 → 0.5.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,304 @@ 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
+ */
683
+ declare const MethodCard: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$default" | "$readonly"> & {
684
+ $default?: boolean;
685
+ $readonly?: boolean;
686
+ }, never> & Partial<Pick<styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$default" | "$readonly"> & {
687
+ $default?: boolean;
688
+ $readonly?: boolean;
689
+ }, never>>> & string;
690
+ 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;
691
+ /** `$tight` for a card with no form fields under the header. */
692
+ declare const MethodHeader: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$tight"> & {
693
+ $tight?: boolean;
694
+ }, never> & Partial<Pick<styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$tight"> & {
695
+ $tight?: boolean;
696
+ }, never>>> & string;
697
+ 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;
698
+ /** Two-up field row that stacks on narrow screens. */
699
+ 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;
700
+ /** Accent-tinted note with a leading icon slot. */
701
+ 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;
702
+ 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;
703
+ 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;
704
+
705
+ interface PlaidMethodCardProps {
706
+ plaidData?: {
707
+ institution?: {
708
+ name?: string;
709
+ } | null;
710
+ accounts?: {
711
+ mask?: string;
712
+ accountMask?: string;
713
+ }[] | null;
714
+ } | null;
715
+ isDefault?: boolean;
716
+ onSelectDefault?: () => void;
717
+ /** Distinguishes the radio group when several cards share a page. */
718
+ name?: string;
719
+ testId?: string;
720
+ }
721
+ /**
722
+ * Read-only payment method sourced from Plaid. It cannot be edited or removed
723
+ * here — disconnecting happens wherever the bank connection is managed — but it
724
+ * can still be chosen as the default.
725
+ *
726
+ * Routing is deliberately absent: Plaid Link metadata exposes an account mask but
727
+ * no routing number client-side.
728
+ */
729
+ declare function PlaidMethodCard({ plaidData, isDefault, onSelectDefault, name, testId, }: PlaidMethodCardProps): react__default.JSX.Element;
730
+
731
+ interface ManualMethodValue {
732
+ id: string;
733
+ account: string;
734
+ routing: string;
735
+ }
736
+ interface ManualMethodCardProps {
737
+ /** Zero-based; rendered as "Account {index + 1}". */
738
+ index: number;
739
+ value: ManualMethodValue;
740
+ isDefault?: boolean;
741
+ /** Disables removal when this is the last remaining method. */
742
+ trashDisabled?: boolean;
743
+ disabled?: boolean;
744
+ accountError?: string;
745
+ routingError?: string;
746
+ onSelectDefault?: () => void;
747
+ onChangeField: (field: 'account' | 'routing', next: string) => void;
748
+ onBlurField: (field: 'account' | 'routing') => void;
749
+ onRemove?: () => void;
750
+ name?: string;
751
+ }
752
+ /**
753
+ * Editable manual payment method — account and routing number.
754
+ *
755
+ * Validation is the caller's: pass `accountError`/`routingError` and use
756
+ * `onBlurField` to decide when to surface them. Onboarding shows errors on blur
757
+ * and never while typing, which is worth keeping.
758
+ */
759
+ declare function ManualMethodCard({ index, value, isDefault, trashDisabled, disabled, accountError, routingError, onSelectDefault, onChangeField, onBlurField, onRemove, name, }: ManualMethodCardProps): react__default.JSX.Element;
760
+
761
+ interface AchVerificationConsentProps {
762
+ consentGiven?: boolean;
763
+ onChange: (checked: boolean) => void;
764
+ disabled?: boolean;
765
+ /** Label for the action the consent is attached to. Defaults to "Continue". */
766
+ actionLabel?: string;
767
+ testId?: string;
768
+ }
769
+ /**
770
+ * ACH verification consent and PATRIOT Act acknowledgement, required before
771
+ * payment methods can be saved.
772
+ *
773
+ * `actionLabel` exists because the copy names the button the borrower is about to
774
+ * press — "By clicking Continue…" is right in a stepped flow, but a servicing
775
+ * screen that saves in place needs its own verb.
776
+ */
777
+ declare function AchVerificationConsent({ consentGiven, onChange, disabled, actionLabel, testId, }: AchVerificationConsentProps): react__default.JSX.Element;
778
+
481
779
  interface PreviewProps {
482
780
  /** Partner branding to render the sample with. Omit for the default theme. */
483
781
  branding?: Branding;
@@ -491,5 +789,5 @@ interface PreviewProps {
491
789
  */
492
790
  declare function Preview({ branding, className }: PreviewProps): react__default.JSX.Element;
493
791
 
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 };
792
+ 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 };
793
+ export type { AchVerificationConsentProps, BadgeVariant, Branding, CollapsibleSourceProps, CurrencyInputProps, DateInputProps, DotsMenuOption, DotsMenuProps, DropDownProps, EmailInputProps, FileInputProps, FootnoteLink, FootnoteProps, LoaderProps, ManualMethodCardProps, 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 };