@oatfi/ui 0.5.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.cjs.js +19 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +40 -5
- package/dist/index.esm.js +20 -3
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -678,14 +678,17 @@ declare function UnderwritingStatus({ status, creditLimit, children, testId, }:
|
|
|
678
678
|
* a trailing action.
|
|
679
679
|
*
|
|
680
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
|
|
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.
|
|
682
683
|
*/
|
|
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
|
+
declare const MethodCard: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$default" | "$readonly" | "$edited"> & {
|
|
684
685
|
$default?: boolean;
|
|
685
686
|
$readonly?: boolean;
|
|
686
|
-
|
|
687
|
+
$edited?: boolean;
|
|
688
|
+
}, never> & Partial<Pick<styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$default" | "$readonly" | "$edited"> & {
|
|
687
689
|
$default?: boolean;
|
|
688
690
|
$readonly?: boolean;
|
|
691
|
+
$edited?: boolean;
|
|
689
692
|
}, never>>> & string;
|
|
690
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;
|
|
691
694
|
/** `$tight` for a card with no form fields under the header. */
|
|
@@ -699,6 +702,15 @@ declare const MethodTitle: styled_components_dist_types.IStyledComponentBase<"we
|
|
|
699
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;
|
|
700
703
|
/** Accent-tinted note with a leading icon slot. */
|
|
701
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
|
+
*/
|
|
702
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;
|
|
703
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;
|
|
704
716
|
|
|
@@ -733,11 +745,30 @@ interface ManualMethodValue {
|
|
|
733
745
|
account: string;
|
|
734
746
|
routing: string;
|
|
735
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';
|
|
736
762
|
interface ManualMethodCardProps {
|
|
737
763
|
/** Zero-based; rendered as "Account {index + 1}". */
|
|
738
764
|
index: number;
|
|
739
765
|
value: ManualMethodValue;
|
|
740
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;
|
|
741
772
|
/** Disables removal when this is the last remaining method. */
|
|
742
773
|
trashDisabled?: boolean;
|
|
743
774
|
disabled?: boolean;
|
|
@@ -755,8 +786,12 @@ interface ManualMethodCardProps {
|
|
|
755
786
|
* Validation is the caller's: pass `accountError`/`routingError` and use
|
|
756
787
|
* `onBlurField` to decide when to surface them. Onboarding shows errors on blur
|
|
757
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.
|
|
758
793
|
*/
|
|
759
|
-
declare function ManualMethodCard({ index, value, isDefault, trashDisabled, disabled, accountError, routingError, onSelectDefault, onChangeField, onBlurField, onRemove, name, }: ManualMethodCardProps): react__default.JSX.Element;
|
|
794
|
+
declare function ManualMethodCard({ index, value, isDefault, status, trashDisabled, disabled, accountError, routingError, onSelectDefault, onChangeField, onBlurField, onRemove, name, }: ManualMethodCardProps): react__default.JSX.Element;
|
|
760
795
|
|
|
761
796
|
interface AchVerificationConsentProps {
|
|
762
797
|
consentGiven?: boolean;
|
|
@@ -790,4 +825,4 @@ interface PreviewProps {
|
|
|
790
825
|
declare function Preview({ branding, className }: PreviewProps): react__default.JSX.Element;
|
|
791
826
|
|
|
792
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 };
|
|
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 };
|
|
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 };
|
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createTheme, ThemeProvider as ThemeProvider$2, useTheme as useTheme$2, alpha } from '@mui/material/styles';
|
|
2
2
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import React, { useMemo, useId, useRef, useState } from 'react';
|
|
4
|
-
import styled, { createGlobalStyle, ThemeProvider as ThemeProvider$1, useTheme as useTheme$1 } from 'styled-components';
|
|
4
|
+
import styled, { createGlobalStyle, ThemeProvider as ThemeProvider$1, useTheme as useTheme$1, css } from 'styled-components';
|
|
5
5
|
import { TextField, InputAdornment, IconButton, FormControl, InputLabel as InputLabel$1, Select, MenuItem, FormHelperText, Autocomplete, Box, CircularProgress } from '@mui/material';
|
|
6
6
|
import CalendarMonthIcon from '@mui/icons-material/CalendarMonth';
|
|
7
7
|
import CloudUploadIcon from '@mui/icons-material/CloudUpload';
|
|
@@ -2100,6 +2100,17 @@ const MethodCard = styled.div`
|
|
|
2100
2100
|
transition:
|
|
2101
2101
|
border-color 0.15s ease,
|
|
2102
2102
|
background 0.15s ease;
|
|
2103
|
+
|
|
2104
|
+
/**
|
|
2105
|
+
* The unsaved-edit bar. It thickens the left border rather than adding one, so
|
|
2106
|
+
* the padding gives back the 2px it takes and the card's contents do not shift
|
|
2107
|
+
* when it appears mid-keystroke. Declared last so it wins over the shorthand
|
|
2108
|
+
* above, including on a $default card that already has an accent border.
|
|
2109
|
+
*/
|
|
2110
|
+
${({ theme, $edited }) => $edited && css`
|
|
2111
|
+
border-left: 3px solid ${theme.colors.accent};
|
|
2112
|
+
padding-left: 14px;
|
|
2113
|
+
`}
|
|
2103
2114
|
`;
|
|
2104
2115
|
const MethodBody = styled.div`
|
|
2105
2116
|
flex: 1;
|
|
@@ -2164,6 +2175,10 @@ const FooterActions = styled.div`
|
|
|
2164
2175
|
button {
|
|
2165
2176
|
margin-top: 0;
|
|
2166
2177
|
}
|
|
2178
|
+
|
|
2179
|
+
> :only-child {
|
|
2180
|
+
margin-left: auto;
|
|
2181
|
+
}
|
|
2167
2182
|
`;
|
|
2168
2183
|
const FooterRight = styled.div`
|
|
2169
2184
|
display: flex;
|
|
@@ -2214,6 +2229,7 @@ function ManualMethodCard({
|
|
|
2214
2229
|
index,
|
|
2215
2230
|
value,
|
|
2216
2231
|
isDefault = false,
|
|
2232
|
+
status,
|
|
2217
2233
|
trashDisabled = false,
|
|
2218
2234
|
disabled = false,
|
|
2219
2235
|
accountError,
|
|
@@ -2225,7 +2241,7 @@ function ManualMethodCard({
|
|
|
2225
2241
|
name = "default-method"
|
|
2226
2242
|
}) {
|
|
2227
2243
|
const radioId = `default-${value.id}`;
|
|
2228
|
-
return /* @__PURE__ */ jsxs(MethodCard, { $default: isDefault, children: [
|
|
2244
|
+
return /* @__PURE__ */ jsxs(MethodCard, { $default: isDefault, $edited: status === "edited", children: [
|
|
2229
2245
|
/* @__PURE__ */ jsx(
|
|
2230
2246
|
RadioInput,
|
|
2231
2247
|
{
|
|
@@ -2244,7 +2260,8 @@ function ManualMethodCard({
|
|
|
2244
2260
|
"Account ",
|
|
2245
2261
|
index + 1
|
|
2246
2262
|
] }),
|
|
2247
|
-
isDefault && /* @__PURE__ */ jsx(Badge, { $variant: "filled", children: "Default" })
|
|
2263
|
+
isDefault && /* @__PURE__ */ jsx(Badge, { $variant: "filled", children: "Default" }),
|
|
2264
|
+
status === "edited" && /* @__PURE__ */ jsx(Badge, { $variant: "info", children: "Unsaved" })
|
|
2248
2265
|
] }),
|
|
2249
2266
|
/* @__PURE__ */ jsx(
|
|
2250
2267
|
IconButton$1,
|