@thecb/components 12.0.0-beta.0 → 12.0.0-beta.2
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/README.md +33 -11
- package/ai-docs/architecture.md +71 -0
- package/ai-docs/components.md +167 -0
- package/ai-docs/conventions.md +162 -0
- package/ai-docs/figma-mcp.md +66 -0
- package/ai-docs/integration-guidelines.md +142 -0
- package/dist/index.cjs.js +27805 -25779
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +286 -12
- package/dist/index.esm.js +26589 -24593
- package/dist/index.esm.js.map +1 -1
- package/package.json +17 -8
- package/src/components/atoms/alert/Alert.js +10 -1
- package/src/components/atoms/alert/Alert.mdx +19 -0
- package/src/components/atoms/alert/Alert.stories.js +150 -0
- package/src/components/atoms/badge/Badge.js +39 -25
- package/src/components/atoms/badge/Badge.mdx +27 -0
- package/src/components/atoms/badge/Badge.stories.js +168 -0
- package/src/components/atoms/badge/Badge.theme.js +49 -1
- package/src/components/atoms/badge/index.d.ts +11 -0
- package/src/components/atoms/breadcrumb/Breadcrumb.mdx +21 -0
- package/src/components/atoms/breadcrumb/Breadcrumb.stories.js +47 -0
- package/src/components/atoms/button-with-action/ButtonWithAction.js +3 -29
- package/src/components/atoms/button-with-action/ButtonWithAction.stories.js +14 -1
- package/src/components/atoms/button-with-action/ButtonWithAction.theme.js +97 -56
- package/src/components/atoms/button-with-action/index.d.ts +1 -0
- package/src/components/atoms/button-with-link/ButtonWithLink.mdx +21 -0
- package/src/components/atoms/button-with-link/ButtonWithLink.stories.js +161 -0
- package/src/components/atoms/card/Card.js +22 -1
- package/src/components/atoms/card/Card.mdx +41 -0
- package/src/components/atoms/card/Card.stories.js +360 -0
- package/src/components/atoms/card/Card.theme.js +2 -0
- package/src/components/atoms/card/CardText.js +39 -11
- package/src/components/atoms/card/index.d.ts +8 -1
- package/src/components/atoms/card-type/CardType.js +55 -0
- package/src/components/atoms/card-type/CardType.stories.js +86 -0
- package/src/components/atoms/card-type/index.js +3 -0
- package/src/components/atoms/checkbox/Checkbox.js +121 -93
- package/src/components/atoms/checkbox/Checkbox.mdx +15 -0
- package/src/components/atoms/checkbox/Checkbox.oldstories.js +17 -13
- package/src/components/atoms/checkbox/Checkbox.stories.js +149 -0
- package/src/components/atoms/checkbox/Checkbox.theme.js +6 -2
- package/src/components/atoms/country-dropdown/CountryDropdown.mdx +36 -0
- package/src/components/atoms/country-dropdown/CountryDropdown.stories.js +76 -0
- package/src/components/atoms/detail/Detail.js +0 -26
- package/src/components/atoms/detail/Detail.mdx +32 -0
- package/src/components/atoms/detail/Detail.stories.js +156 -0
- package/src/components/atoms/display-box/DisplayBox.mdx +11 -0
- package/src/components/atoms/display-box/DisplayBox.stories.js +69 -0
- package/src/components/atoms/dropdown/Dropdown.js +17 -5
- package/src/components/atoms/dropdown/Dropdown.mdx +65 -0
- package/src/components/atoms/dropdown/Dropdown.stories.js +128 -0
- package/src/components/atoms/dropdown/Dropdown.theme.js +6 -6
- package/src/components/atoms/dropdown/DropdownIcon.js +1 -0
- package/src/components/atoms/dropdown/DropdownIconV2.js +50 -0
- package/src/components/atoms/dropdown/index.d.ts +59 -0
- package/src/components/atoms/form-layouts/FormInput.js +105 -61
- package/src/components/atoms/form-layouts/FormInput.mdx +38 -0
- package/src/components/atoms/form-layouts/FormInput.stories.js +219 -0
- package/src/components/atoms/form-layouts/FormTextarea.js +207 -0
- package/src/components/atoms/form-layouts/FormTextarea.mdx +48 -0
- package/src/components/atoms/form-layouts/FormTextarea.stories.js +265 -0
- package/src/components/atoms/form-layouts/index.d.ts +34 -1
- package/src/components/atoms/form-layouts/index.js +3 -1
- package/src/components/atoms/form-select/FormSelect.js +5 -3
- package/src/components/atoms/form-select/FormSelect.mdx +42 -0
- package/src/components/atoms/form-select/FormSelect.stories.js +76 -0
- package/src/components/atoms/form-select/FormSelect.styled.js +2 -2
- package/src/components/atoms/form-select/FormSelect.theme.js +6 -3
- package/src/components/atoms/form-select/index.d.ts +3 -0
- package/src/components/atoms/formatted-address/FormattedAddress.mdx +13 -0
- package/src/components/atoms/formatted-address/FormattedAddress.stories.js +138 -0
- package/src/components/atoms/formatted-bank-account/FormattedBankAccount.js +2 -2
- package/src/components/atoms/formatted-bank-account/FormattedBankAccount.mdx +17 -0
- package/src/components/atoms/formatted-bank-account/FormattedBankAccount.stories.js +57 -0
- package/src/components/atoms/formatted-bank-account/FormattedBankAccount.theme.js +2 -2
- package/src/components/atoms/formatted-credit-card/FormattedCreditCard.js +14 -10
- package/src/components/atoms/formatted-credit-card/FormattedCreditCard.mdx +40 -0
- package/src/components/atoms/formatted-credit-card/FormattedCreditCard.stories.js +74 -0
- package/src/components/atoms/formatted-credit-card/FormattedCreditCard.theme.js +2 -2
- package/src/components/atoms/icons/AgencyIcon.js +24 -0
- package/src/components/atoms/icons/AmExLargeIcon.js +54 -0
- package/src/components/atoms/icons/AmExSmallIcon.js +54 -0
- package/src/components/atoms/icons/AutopayIcon.js +9 -1
- package/src/components/atoms/icons/BankGenericSmallIcon.js +48 -0
- package/src/components/atoms/icons/CaretArrowDown.d.ts +9 -0
- package/src/components/atoms/icons/CaretArrowDown.js +22 -0
- package/src/components/atoms/icons/CaretArrowUp.d.ts +9 -0
- package/src/components/atoms/icons/CaretArrowUp.js +22 -0
- package/src/components/atoms/icons/CarrotIcon.js +2 -0
- package/src/components/atoms/icons/CashSmallIcon.js +21 -0
- package/src/components/atoms/icons/CashieringImage.d.ts +1 -0
- package/src/components/atoms/icons/CashieringImage.js +254 -0
- package/src/components/atoms/icons/CheckboxCheckmarkIcon.js +45 -0
- package/src/components/atoms/icons/CustomerSearchIcon.js +30 -79
- package/src/components/atoms/icons/DiscoverLargeIcon.js +137 -0
- package/src/components/atoms/icons/DiscoverSmallIcon.js +137 -0
- package/src/components/atoms/icons/ExternalLinkIcon.js +10 -2
- package/src/components/atoms/icons/GenericCardLarge.js +1 -1
- package/src/components/atoms/icons/GenericSmallIcon.js +27 -0
- package/src/components/atoms/icons/GuidedCheckoutImage.js +105 -26
- package/src/components/atoms/icons/IconAdd.js +2 -2
- package/src/components/atoms/icons/Icons.mdx +40 -0
- package/src/components/atoms/icons/Icons.stories.js +343 -0
- package/src/components/atoms/icons/KioskImage.js +223 -338
- package/src/components/atoms/icons/MasterCardLargeIcon.js +35 -0
- package/src/components/atoms/icons/MasterCardSmallIcon.js +35 -0
- package/src/components/atoms/icons/{NoCustomerResultsIcon.js → NoResultsIcon.js} +10 -6
- package/src/components/atoms/icons/NotFoundIcon.js +70 -333
- package/src/components/atoms/icons/OverageIcon.js +27 -0
- package/src/components/atoms/icons/PaydotImage.d.ts +1 -0
- package/src/components/atoms/icons/PaydotImage.js +46 -0
- package/src/components/atoms/icons/PaymentSearchIcon.js +7 -42
- package/src/components/atoms/icons/PaymentStatusIcon.d.ts +1 -0
- package/src/components/atoms/icons/PaymentStatusIcon.js +28 -0
- package/src/components/atoms/icons/PeriscopeFailedIcon.js +2 -2
- package/src/components/atoms/icons/PersonIcon.d.ts +1 -0
- package/src/components/atoms/icons/PersonIcon.js +28 -0
- package/src/components/atoms/icons/ProfileImage.js +58 -37
- package/src/components/atoms/icons/RevenueManagementImage.js +138 -393
- package/src/components/atoms/icons/ReversalNeededIcon.js +27 -0
- package/src/components/atoms/icons/SearchIcon.js +4 -3
- package/src/components/atoms/icons/ShortageIcon.js +21 -0
- package/src/components/atoms/icons/StandardCheckoutImage.js +105 -336
- package/src/components/atoms/icons/SuccessfulIconMedium.js +3 -2
- package/src/components/atoms/icons/VisaLargeIcon.js +40 -0
- package/src/components/atoms/icons/VisaSmallIcon.js +40 -0
- package/src/components/atoms/icons/WireSmallIcon.js +22 -0
- package/src/components/atoms/icons/icons.oldstories.js +47 -31
- package/src/components/atoms/icons/index.d.ts +4 -1
- package/src/components/atoms/icons/index.js +47 -7
- package/src/components/atoms/index.d.ts +4 -0
- package/src/components/atoms/index.js +3 -1
- package/src/components/atoms/jumbo/Jumbo.js +18 -3
- package/src/components/atoms/labeled-amount/LabeledAmount.mdx +23 -0
- package/src/components/atoms/labeled-amount/LabeledAmount.stories.js +118 -0
- package/src/components/atoms/layouts/Box.styled.js +34 -22
- package/src/components/atoms/layouts/Center.styled.js +2 -0
- package/src/components/atoms/layouts/Motion.js +25 -6
- package/src/components/atoms/layouts/Motion.styled.js +36 -0
- package/src/components/atoms/layouts/Stack.js +2 -0
- package/src/components/atoms/layouts/Stack.styled.js +2 -0
- package/src/components/atoms/line-item/LineItem.mdx +28 -0
- package/src/components/atoms/line-item/LineItem.stories.js +95 -0
- package/src/components/atoms/link/ExternalLink.d.ts +1 -0
- package/src/components/atoms/link/ExternalLink.js +37 -19
- package/src/components/atoms/link/ExternalLink.styled.js +2 -0
- package/src/components/atoms/link/InternalLink.js +11 -1
- package/src/components/atoms/link/InternalLink.styled.js +22 -2
- package/src/components/atoms/link/Link.mdx +19 -0
- package/src/components/atoms/link/Link.stories.js +183 -0
- package/src/components/atoms/loading/Loading.mdx +13 -0
- package/src/components/atoms/loading/Loading.stories.js +22 -0
- package/src/components/atoms/loading-line/LoadingLine.js +23 -11
- package/src/components/atoms/loading-line/LoadingLine.mdx +15 -0
- package/src/components/atoms/loading-line/LoadingLine.stories.js +132 -0
- package/src/components/atoms/loading-line/LoadingPill.styled.js +7 -6
- package/src/components/atoms/nav-footer/NavFooter.mdx +15 -0
- package/src/components/atoms/nav-footer/NavFooter.stories.js +244 -0
- package/src/components/atoms/nav-header/NavHeader.mdx +13 -0
- package/src/components/atoms/nav-header/NavHeader.stories.js +130 -0
- package/src/components/atoms/nav-tabs/NavTabs.mdx +30 -0
- package/src/components/atoms/nav-tabs/NavTabs.stories.js +49 -0
- package/src/components/atoms/password-requirements/PasswordRequirements.js +3 -3
- package/src/components/atoms/password-requirements/PasswordRequirements.mdx +39 -0
- package/src/components/atoms/password-requirements/PasswordRequirements.stories.js +139 -0
- package/src/components/atoms/placeholder/Placeholder.mdx +19 -0
- package/src/components/atoms/placeholder/Placeholder.stories.js +170 -0
- package/src/components/atoms/radio-button-with-label/RadioButtonWithLabel.js +13 -7
- package/src/components/atoms/radio-button-with-label/RadioButtonWithLabel.theme.js +9 -3
- package/src/components/atoms/search/Search.js +123 -0
- package/src/components/atoms/search/Search.oldstories.js +58 -0
- package/src/components/atoms/search/Search.theme.js +9 -0
- package/src/components/atoms/search/index.d.ts +27 -0
- package/src/components/atoms/search/index.js +3 -0
- package/src/components/atoms/searchable-select/SearchableSelect.mdx +44 -0
- package/src/components/atoms/searchable-select/SearchableSelect.stories.js +137 -0
- package/src/components/atoms/sortable-table-heading/SortableTableHeading.js +47 -0
- package/src/components/atoms/sortable-table-heading/SortableTableHeading.oldstories.js +19 -0
- package/src/components/atoms/sortable-table-heading/SortableTableHeading.theme.js +9 -0
- package/src/components/atoms/sortable-table-heading/index.d.ts +15 -0
- package/src/components/atoms/sortable-table-heading/index.js +3 -0
- package/src/components/atoms/spinner/Spinner.js +2 -1
- package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.mdx +36 -0
- package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.stories.js +78 -0
- package/src/components/atoms/state-province-dropdown/options.js +4 -1
- package/src/components/atoms/tab/Tab.js +2 -2
- package/src/components/atoms/table/Table.mdx +71 -0
- package/src/components/atoms/table/Table.oldstories.js +84 -0
- package/src/components/atoms/table/Table.stories.js +65 -0
- package/src/components/atoms/table/TableRow.js +1 -0
- package/src/components/atoms/title/Title.js +0 -23
- package/src/components/atoms/title/Title.mdx +26 -0
- package/src/components/atoms/title/Title.stories.js +144 -0
- package/src/components/atoms/title/Title.theme.js +3 -0
- package/src/components/atoms/toggle-switch/ToggleSwitch.js +66 -48
- package/src/components/atoms/toggle-switch/ToggleSwitch.mdx +17 -0
- package/src/components/atoms/toggle-switch/ToggleSwitch.stories.js +111 -0
- package/src/components/atoms/toggle-switch/ToggleSwitch.theme.js +8 -5
- package/src/components/atoms/typeahead-input/TypeaheadInput.mdx +13 -0
- package/src/components/atoms/typeahead-input/TypeaheadInput.stories.js +63 -0
- package/src/components/atoms/wallet-name/WalletName.js +6 -4
- package/src/components/atoms/wallet-name/WalletName.oldstories.js +26 -1
- package/src/components/atoms/wallet-name/index.d.ts +2 -0
- package/src/components/molecules/address-form/AddressForm.mdx +18 -0
- package/src/components/molecules/address-form/AddressForm.stories.js +224 -0
- package/src/components/molecules/banner/Banner.mdx +23 -0
- package/src/components/molecules/banner/Banner.stories.js +125 -0
- package/src/components/molecules/change-password-form/ChangePasswordForm.mdx +15 -0
- package/src/components/molecules/change-password-form/ChangePasswordForm.stories.js +206 -0
- package/src/components/molecules/collapsible-section/CollapsibleSection.js +1 -1
- package/src/components/molecules/collapsible-section/CollapsibleSection.mdx +15 -0
- package/src/components/molecules/collapsible-section/CollapsibleSection.stories.js +217 -0
- package/src/components/molecules/collapsible-section/index.d.ts +2 -2
- package/src/components/molecules/contact-card/ContactCard.js +157 -0
- package/src/components/molecules/contact-card/ContactCard.stories.js +80 -0
- package/src/components/molecules/contact-card/ContactCard.styled.js +44 -0
- package/src/components/molecules/contact-card/index.d.ts +16 -0
- package/src/components/molecules/contact-card/index.js +3 -0
- package/src/components/molecules/edit-name-form/EditNameForm.mdx +13 -0
- package/src/components/molecules/edit-name-form/EditNameForm.stories.js +117 -0
- package/src/components/molecules/editable-list/EditableList.js +6 -1
- package/src/components/molecules/email-form/EmailForm.js +9 -1
- package/src/components/molecules/email-form/EmailForm.state.js +1 -1
- package/src/components/molecules/email-form/EmailForm.stories.js +210 -0
- package/src/components/molecules/forgot-password-form/ForgotPasswordForm.js +2 -1
- package/src/components/molecules/hero-image/HeroImage.js +135 -0
- package/src/components/molecules/hero-image/HeroImage.mdx +15 -0
- package/src/components/molecules/hero-image/HeroImage.stories.js +149 -0
- package/src/components/molecules/hero-image/HeroImage.styled.js +83 -0
- package/src/components/molecules/hero-image/HeroImage.theme.js +109 -0
- package/src/components/molecules/hero-image/index.js +3 -0
- package/src/components/molecules/idle-modal/IdleModal.js +101 -0
- package/src/components/molecules/idle-modal/IdleModal.mdx +17 -0
- package/src/components/molecules/idle-modal/IdleModal.stories.js +180 -0
- package/src/components/molecules/idle-modal/index.d.ts +16 -0
- package/src/components/molecules/idle-modal/index.js +3 -0
- package/src/components/molecules/index.d.ts +1 -0
- package/src/components/molecules/index.js +7 -0
- package/src/components/molecules/link-card/LinkCard.js +31 -20
- package/src/components/molecules/link-card/LinkCard.mdx +17 -0
- package/src/components/molecules/link-card/LinkCard.stories.js +528 -0
- package/src/components/molecules/link-card/LinkCard.styled.js +28 -21
- package/src/components/molecules/link-card/LinkCard.theme.js +6 -4
- package/src/components/molecules/link-card/index.d.ts +3 -1
- package/src/components/molecules/login-form/LoginForm.js +2 -1
- package/src/components/molecules/login-form/LoginForm.mdx +16 -0
- package/src/components/molecules/login-form/LoginForm.stories.js +120 -0
- package/src/components/molecules/modal/Modal.mdx +17 -0
- package/src/components/molecules/modal/Modal.stories.js +362 -0
- package/src/components/molecules/modal/ModalControlV1.js +3 -0
- package/src/components/molecules/modal/ModalControlV2.js +2 -0
- package/src/components/molecules/modal/__private__/CloseButton.js +2 -1
- package/src/components/molecules/module/Module.mdx +17 -0
- package/src/components/molecules/module/Module.stories.js +273 -0
- package/src/components/molecules/multiple-select-filter/MultipleSelectFilter.js +229 -0
- package/src/components/molecules/multiple-select-filter/MultipleSelectFilter.oldstories.js +74 -0
- package/src/components/molecules/multiple-select-filter/MultipleSelectFilter.styled.js +65 -0
- package/src/components/molecules/multiple-select-filter/MultipleSelectFilter.theme.js +13 -0
- package/src/components/molecules/multiple-select-filter/__private__/ActionLinkButton.js +27 -0
- package/src/components/molecules/multiple-select-filter/__private__/FilterButton.js +97 -0
- package/src/components/molecules/multiple-select-filter/__private__/FilterDropdown.js +27 -0
- package/src/components/molecules/multiple-select-filter/__private__/FilterableList.js +146 -0
- package/src/components/molecules/multiple-select-filter/__private__/FilterableListItem.js +78 -0
- package/src/components/molecules/multiple-select-filter/__private__/SearchBox.js +41 -0
- package/src/components/molecules/multiple-select-filter/__private__/useKeyboardNavigation.js +84 -0
- package/src/components/molecules/multiple-select-filter/__private__/util.js +44 -0
- package/src/components/molecules/multiple-select-filter/index.d.ts +34 -0
- package/src/components/molecules/multiple-select-filter/index.js +3 -0
- package/src/components/molecules/nav-menu/NavMenuMobile.js +27 -29
- package/src/components/molecules/nav-menu/NavMenuMobile.mdx +21 -0
- package/src/components/molecules/nav-menu/NavMenuMobile.stories.js +100 -0
- package/src/components/molecules/obligation/Obligation.js +141 -3
- package/src/components/molecules/obligation/Obligation.mdx +23 -0
- package/src/components/molecules/obligation/Obligation.stories.js +642 -0
- package/src/components/molecules/obligation/icons/PropertyBusinessIcon.js +2 -2
- package/src/components/molecules/obligation/icons/PropertyCarIcon.js +2 -2
- package/src/components/molecules/obligation/icons/PropertyCommercialVehicleIcon.js +2 -2
- package/src/components/molecules/obligation/icons/PropertyGarageIcon.js +2 -2
- package/src/components/molecules/obligation/icons/PropertyLandIcon.js +2 -2
- package/src/components/molecules/obligation/icons/PropertyMotorcycleIcon.js +2 -2
- package/src/components/molecules/obligation/icons/PropertyPersonalIcon.js +2 -2
- package/src/components/molecules/obligation/icons/PropertyStorefrontIcon.js +2 -2
- package/src/components/molecules/obligation/modules/AmountModule.js +64 -38
- package/src/components/molecules/obligation/modules/AutopayModalModule.js +37 -12
- package/src/components/molecules/obligation/modules/InactiveControlsModule.js +56 -12
- package/src/components/molecules/obligation/modules/InactiveTitleModule.js +1 -1
- package/src/components/molecules/obligation/modules/PaymentDetailsActions.js +42 -10
- package/src/components/molecules/obligation/modules/RemoveAccountModalModule.js +4 -1
- package/src/components/molecules/pagination/Pagination.mdx +15 -0
- package/src/components/molecules/pagination/Pagination.stories.js +181 -0
- package/src/components/molecules/partial-amount-form/PartialAmountField.js +68 -29
- package/src/components/molecules/partial-amount-form/PartialAmountField.theme.js +7 -0
- package/src/components/molecules/payment-button-bar/PaymentButtonBar.js +15 -8
- package/src/components/molecules/payment-details/PaymentDetails.js +1 -2
- package/src/components/molecules/payment-details/PaymentDetails.oldstories.js +0 -1
- package/src/components/molecules/payment-form-ach/PaymentFormACH.js +2 -0
- package/src/components/molecules/payment-form-ach/PaymentFormACH.state.js +2 -2
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +6 -2
- package/src/components/molecules/payment-form-card/PaymentFormCard.state.js +2 -1
- package/src/components/molecules/phone-form/PhoneForm.js +7 -1
- package/src/components/molecules/phone-form/PhoneForm.state.js +1 -1
- package/src/components/molecules/popover/Popover.js +1 -15
- package/src/components/molecules/popover/Popover.mdx +15 -0
- package/src/components/molecules/popover/Popover.stories.js +220 -0
- package/src/components/molecules/radio-group/RadioGroup.js +8 -3
- package/src/components/molecules/radio-group/index.d.ts +1 -0
- package/src/components/molecules/radio-section/InnerRadioSection.js +3 -3
- package/src/components/molecules/radio-section/RadioSection.js +87 -44
- package/src/components/molecules/radio-section/RadioSection.stories.js +142 -0
- package/src/components/molecules/radio-section/radio-button/RadioButton.js +9 -5
- package/src/components/molecules/registration-banner/RegistrationBanner.js +115 -0
- package/src/components/molecules/registration-banner/RegistrationBanner.mdx +15 -0
- package/src/components/molecules/registration-banner/RegistrationBanner.stories.js +80 -0
- package/src/components/molecules/registration-banner/RegistrationBanner.styled.js +46 -0
- package/src/components/molecules/registration-banner/RegistrationBanner.theme.js +6 -0
- package/src/components/molecules/registration-banner/index.d.ts +15 -0
- package/src/components/molecules/registration-banner/index.js +3 -0
- package/src/components/molecules/registration-form/RegistrationForm.js +2 -1
- package/src/components/molecules/tab-sidebar/TabSidebar.js +5 -3
- package/src/components/molecules/tabs/Tabs.js +25 -9
- package/src/components/molecules/tabs/Tabs.mdx +17 -0
- package/src/components/molecules/tabs/Tabs.stories.js +149 -0
- package/src/components/molecules/tabs/index.d.ts +21 -0
- package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.js +1 -1
- package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.stories.js +110 -0
- package/src/components/molecules/toast-notification/Toast.mdx +15 -0
- package/src/components/molecules/toast-notification/Toast.stories.js +183 -0
- package/src/components/molecules/toast-notification/ToastNotification.js +74 -43
- package/src/components/molecules/tooltip/Tooltip.js +269 -0
- package/src/components/molecules/tooltip/Tooltip.mdx +25 -0
- package/src/components/molecules/tooltip/Tooltip.stories.js +287 -0
- package/src/components/molecules/tooltip/Tooltip.theme.js +18 -0
- package/src/components/molecules/tooltip/index.d.ts +34 -0
- package/src/components/molecules/tooltip/index.js +3 -0
- package/src/components/molecules/turnstile-widget/TurnstileWidget.js +183 -0
- package/src/components/molecules/turnstile-widget/index.js +3 -0
- package/src/components/templates/sidebar-stack-content/SidebarStackContent.js +1 -1
- package/src/constants/colors.d.ts +4 -0
- package/src/constants/colors.js +8 -1
- package/src/constants/regex_constants.js +1 -1
- package/src/constants/style_constants.js +13 -0
- package/src/deprecated/spinner/Spinner.js +8 -20
- package/src/hooks/index.js +2 -0
- package/src/hooks/use-conditionally-add-validator/index.js +20 -0
- package/src/hooks/use-outside-click/index.js +4 -5
- package/src/hooks/use-turnstile-script/index.js +49 -0
- package/src/util/formats.js +6 -3
- package/src/util/general.js +67 -4
- package/src/util/idleTimerUtils.js +36 -0
- package/src/util/index.js +3 -1
- package/src/util/themeUtils.js +24 -14
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/atoms/alert/Alert.oldstories.js +0 -28
- package/src/components/atoms/badge/Badge.oldstories.js +0 -33
- package/src/components/atoms/breadcrumb/Breadcrumb.oldstories.js +0 -38
- package/src/components/atoms/button-with-action/ButtonWithAction.oldstories.js +0 -56
- package/src/components/atoms/button-with-link/ButtonWithLink.oldstories.js +0 -32
- package/src/components/atoms/country-dropdown/CountryDropdown.oldstories.js +0 -42
- package/src/components/atoms/display-box/DisplayBox.oldstories.js +0 -25
- package/src/components/atoms/display-card/DisplayCard.js +0 -88
- package/src/components/atoms/display-card/DisplayCard.oldstories.js +0 -24
- package/src/components/atoms/display-card/index.js +0 -3
- package/src/components/atoms/dropdown/Dropdown.oldstories.js +0 -47
- package/src/components/atoms/form-select/FormSelect.oldstories.js +0 -50
- package/src/components/atoms/formatted-address/FormattedAddress.oldstories.js +0 -32
- package/src/components/atoms/icons/NoPaymentResultsIcon.js +0 -54
- package/src/components/atoms/icons/PointOfSaleImage.d.ts +0 -1
- package/src/components/atoms/icons/PointOfSaleImage.js +0 -439
- package/src/components/atoms/labeled-amount/LabeledAmount.oldstories.js +0 -42
- package/src/components/atoms/line-item/LineItem.oldstories.js +0 -28
- package/src/components/atoms/link/Link.oldstories.js +0 -57
- package/src/components/atoms/loading-line/LoadingLine.oldstories.js +0 -28
- package/src/components/atoms/nav-footer/NavFooter.oldstories.js +0 -31
- package/src/components/atoms/nav-header/NavHeader.oldstories.js +0 -29
- package/src/components/atoms/password-requirements/PasswordRequirements.oldstories.js +0 -75
- package/src/components/atoms/placeholder/Placeholder.oldstories.js +0 -42
- package/src/components/atoms/searchable-select/SearchableSelect.oldstories.js +0 -62
- package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.oldstories.js +0 -53
- package/src/components/atoms/toggle-switch/ToggleSwitch.oldstories.js +0 -28
- package/src/components/molecules/.DS_Store +0 -0
- package/src/components/molecules/address-form/AddressForm.oldstories.js +0 -21
- package/src/components/molecules/banner/Banner.oldstories.js +0 -29
- package/src/components/molecules/change-password-form/ChangePasswordForm.oldstories.js +0 -22
- package/src/components/molecules/collapsible-section/CollapsibleSection.oldstories.js +0 -68
- package/src/components/molecules/edit-name-form/EdidNameForm.oldstories.js +0 -24
- package/src/components/molecules/link-card/LinkCard.oldstories.js +0 -87
- package/src/components/molecules/login-form/LoginForm.oldstories.js +0 -24
- package/src/components/molecules/modal/Modal.oldstories.js +0 -139
- package/src/components/molecules/module/Module.oldstories.js +0 -31
- package/src/components/molecules/obligation/.DS_Store +0 -0
- package/src/components/molecules/pagination/Pagination.oldstories.js +0 -32
- package/src/components/molecules/tabs/Tabs.oldstories.js +0 -241
- package/src/components/molecules/toast-notification/ToastNotification.oldstories.js +0 -105
- package/src/stories/Button.stories.ts +0 -53
- package/src/stories/Button.tsx +0 -48
- package/src/stories/Configure.mdx +0 -364
- package/src/stories/Header.stories.ts +0 -33
- package/src/stories/Header.tsx +0 -56
- package/src/stories/Page.stories.ts +0 -32
- package/src/stories/Page.tsx +0 -73
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +0 -5
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +0 -15
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +0 -3
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +0 -12
- package/src/stories/assets/youtube.svg +0 -4
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/src/stories/page.css +0 -69
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { WHITE, GHOST_GREY } from "../../../constants/colors";
|
|
3
|
+
import { Box } from "../../atoms/layouts";
|
|
4
|
+
import Pagination from "./Pagination";
|
|
5
|
+
import { fn } from "@storybook/test";
|
|
6
|
+
import { FONT_WEIGHT_SEMIBOLD } from "../../../constants/style_constants";
|
|
7
|
+
|
|
8
|
+
const meta = {
|
|
9
|
+
title: "Molecules/Pagination",
|
|
10
|
+
component: Pagination,
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: "centered"
|
|
13
|
+
},
|
|
14
|
+
tags: ["!autodocs"],
|
|
15
|
+
args: {
|
|
16
|
+
activeBorderWidth: "3px",
|
|
17
|
+
ariaLabel: undefined,
|
|
18
|
+
arrowColor: undefined,
|
|
19
|
+
borderRadius: "3px",
|
|
20
|
+
buttonHeight: "44px",
|
|
21
|
+
buttonWidth: "44px",
|
|
22
|
+
childGap: "24px",
|
|
23
|
+
currentPage: undefined,
|
|
24
|
+
fontSize: "17px",
|
|
25
|
+
fontWeight: "900",
|
|
26
|
+
numberColor: undefined,
|
|
27
|
+
pageCount: undefined,
|
|
28
|
+
pageNext: fn(),
|
|
29
|
+
pagePrevious: fn(),
|
|
30
|
+
setCurrentPage: fn()
|
|
31
|
+
},
|
|
32
|
+
argTypes: {
|
|
33
|
+
activeBorderWidth: {
|
|
34
|
+
description: "The width of the border around the active page number",
|
|
35
|
+
table: {
|
|
36
|
+
type: { summary: "string" },
|
|
37
|
+
defaultValue: { summary: "3px" }
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
ariaLabel: {
|
|
41
|
+
description: "aria-label value for pagination container",
|
|
42
|
+
table: {
|
|
43
|
+
type: { summary: "string" },
|
|
44
|
+
defaultValue: { summary: undefined }
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
arrowColor: {
|
|
48
|
+
description:
|
|
49
|
+
"Override for arrow color, if undefined component uses themed values",
|
|
50
|
+
table: {
|
|
51
|
+
type: { summary: "string" },
|
|
52
|
+
defaultValue: { summary: undefined }
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
borderRadius: {
|
|
56
|
+
description: "Border radius of the border around pagination controls",
|
|
57
|
+
table: {
|
|
58
|
+
type: { summary: "string" },
|
|
59
|
+
defaultValue: { summary: "3px" }
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
buttonHeight: {
|
|
63
|
+
description: "Height of pagination buttons",
|
|
64
|
+
table: {
|
|
65
|
+
type: { summary: "string" },
|
|
66
|
+
defaultValue: { summary: "44px" }
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
buttonWidth: {
|
|
70
|
+
description: "Width of pagination buttons",
|
|
71
|
+
table: {
|
|
72
|
+
type: { summary: "string" },
|
|
73
|
+
defaultValue: { summary: "44px" }
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
childGap: {
|
|
77
|
+
description: "Gap between pagination buttons",
|
|
78
|
+
table: {
|
|
79
|
+
type: { summary: "string" },
|
|
80
|
+
defaultValue: { summary: "24px" }
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
currentPage: {
|
|
84
|
+
description: "Current active page",
|
|
85
|
+
table: {
|
|
86
|
+
type: { summary: "number" },
|
|
87
|
+
defaultValue: { summary: undefined }
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
fontSize: {
|
|
91
|
+
descripton: "Font size of page buttons",
|
|
92
|
+
table: {
|
|
93
|
+
type: { summary: "string" },
|
|
94
|
+
defaultValue: { summary: "17px" }
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
fontWeight: {
|
|
98
|
+
description: "Font weight of page buttons",
|
|
99
|
+
table: {
|
|
100
|
+
type: { summary: "string" },
|
|
101
|
+
defaultValue: { summary: "900" }
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
numberColor: {
|
|
105
|
+
description:
|
|
106
|
+
"Override for color of pagination number buttons, if undefined will use themed values",
|
|
107
|
+
table: {
|
|
108
|
+
type: { summary: "string" },
|
|
109
|
+
defaultValue: { summary: undefined }
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
pageCount: {
|
|
113
|
+
description: "Total number of pages",
|
|
114
|
+
table: {
|
|
115
|
+
type: { summary: "number" },
|
|
116
|
+
defaultValue: { summary: undefined }
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
pageNext: {
|
|
120
|
+
description: "Function to call when next button is clicked",
|
|
121
|
+
table: {
|
|
122
|
+
type: { summary: "function" },
|
|
123
|
+
defaultValue: { summary: undefined }
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
pagePrevious: {
|
|
127
|
+
description: "Function to call when previous button is clicked",
|
|
128
|
+
table: {
|
|
129
|
+
type: { summary: "function" },
|
|
130
|
+
defaultValue: { summary: undefined }
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
setCurrentPage: {
|
|
134
|
+
description: "Function to call when user selects a numerical page button",
|
|
135
|
+
table: {
|
|
136
|
+
type: { summary: "function" },
|
|
137
|
+
defaultValue: { summary: undefined }
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export default meta;
|
|
144
|
+
|
|
145
|
+
export const BasicPagination = {
|
|
146
|
+
args: {
|
|
147
|
+
activeBorderWidth: "3px",
|
|
148
|
+
childGap: "24px",
|
|
149
|
+
borderRadius: "4px",
|
|
150
|
+
fontSize: "14px",
|
|
151
|
+
buttonHeight: "44px",
|
|
152
|
+
buttonWidth: "44px",
|
|
153
|
+
fontWeight: FONT_WEIGHT_SEMIBOLD,
|
|
154
|
+
pageCount: 12,
|
|
155
|
+
ariaLabel: "Pagination"
|
|
156
|
+
},
|
|
157
|
+
render: args => {
|
|
158
|
+
const [currentPage, setCurrentPage] = useState(5);
|
|
159
|
+
|
|
160
|
+
return (
|
|
161
|
+
<Box
|
|
162
|
+
background={WHITE}
|
|
163
|
+
borderRadius="4px"
|
|
164
|
+
boxShadow={`0px 0px 5px 0px ${GHOST_GREY}`}
|
|
165
|
+
padding={"24px"}
|
|
166
|
+
>
|
|
167
|
+
<Pagination
|
|
168
|
+
{...args}
|
|
169
|
+
currentPage={currentPage}
|
|
170
|
+
pageNext={() =>
|
|
171
|
+
currentPage < 12 ? setCurrentPage(currentPage + 1) : fn()
|
|
172
|
+
}
|
|
173
|
+
pagePrevious={() =>
|
|
174
|
+
currentPage > 1 ? setCurrentPage(currentPage - 1) : fn()
|
|
175
|
+
}
|
|
176
|
+
setCurrentPage={page => setCurrentPage(page.pageNumber)}
|
|
177
|
+
/>
|
|
178
|
+
</Box>
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
};
|
|
@@ -1,40 +1,71 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { equals } from "ramda";
|
|
3
3
|
import { FormInput } from "../../atoms/form-layouts";
|
|
4
|
-
import { displayCurrency } from "../../../util/general";
|
|
5
|
-
import Text from "../../atoms
|
|
6
|
-
|
|
4
|
+
import { createIdFromString, displayCurrency } from "../../../util/general";
|
|
5
|
+
import { Stack, Detail, Text, Box } from "../../atoms";
|
|
6
|
+
import { themeComponent } from "../../../util/themeUtils";
|
|
7
|
+
import { fallbackValues } from "./PartialAmountField.theme";
|
|
7
8
|
const PartialAmountField = ({
|
|
8
9
|
lineItem,
|
|
9
10
|
field,
|
|
10
11
|
showErrors,
|
|
11
12
|
errorMessages,
|
|
12
13
|
moneyFormat,
|
|
13
|
-
fieldActions
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
14
|
+
fieldActions,
|
|
15
|
+
themeValues
|
|
16
|
+
}) => {
|
|
17
|
+
const id = createIdFromString(
|
|
18
|
+
`${lineItem.description}-${lineItem.subDescription}`
|
|
19
|
+
);
|
|
20
|
+
return (
|
|
21
|
+
<FormInput
|
|
22
|
+
ariaLabelledBy={null}
|
|
23
|
+
id={id}
|
|
24
|
+
labelTextWhenNoError={id}
|
|
25
|
+
labelDisplayOverride={
|
|
26
|
+
<Stack childGap="0px">
|
|
27
|
+
<Box as="label" for={id} padding="0">
|
|
28
|
+
<Detail
|
|
29
|
+
as="span"
|
|
30
|
+
extraStyles="display: block;"
|
|
31
|
+
variant={themeValues.detailVariant}
|
|
32
|
+
weight={themeValues.weightTitle}
|
|
33
|
+
>
|
|
34
|
+
{lineItem.description}
|
|
35
|
+
</Detail>
|
|
36
|
+
<Detail
|
|
37
|
+
as="span"
|
|
38
|
+
extraStyles="display: block;"
|
|
39
|
+
variant={themeValues.detailVariant}
|
|
40
|
+
weight="400"
|
|
41
|
+
>
|
|
42
|
+
{lineItem.subDescription}
|
|
43
|
+
</Detail>
|
|
44
|
+
</Box>
|
|
45
|
+
</Stack>
|
|
46
|
+
}
|
|
47
|
+
key={lineItem.id}
|
|
48
|
+
field={field}
|
|
49
|
+
fieldActions={fieldActions}
|
|
50
|
+
showErrors={showErrors}
|
|
51
|
+
errorMessages={errorMessages}
|
|
52
|
+
style={{ textAlign: "right" }}
|
|
53
|
+
placeholder="$0.00"
|
|
54
|
+
formatter={moneyFormat}
|
|
55
|
+
isNum
|
|
56
|
+
decorator={
|
|
57
|
+
<Text variant="p">
|
|
58
|
+
Amount owed:{" "}
|
|
59
|
+
{
|
|
60
|
+
<Text variant="p" weight="600">
|
|
61
|
+
{displayCurrency(lineItem.amount)}
|
|
62
|
+
</Text>
|
|
63
|
+
}
|
|
64
|
+
</Text>
|
|
65
|
+
}
|
|
66
|
+
/>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
38
69
|
|
|
39
70
|
function arePropsEqual(prevProps, nextProps) {
|
|
40
71
|
return (
|
|
@@ -46,4 +77,12 @@ function arePropsEqual(prevProps, nextProps) {
|
|
|
46
77
|
);
|
|
47
78
|
}
|
|
48
79
|
|
|
49
|
-
export default React.memo(
|
|
80
|
+
export default React.memo(
|
|
81
|
+
themeComponent(
|
|
82
|
+
PartialAmountField,
|
|
83
|
+
"PartialAmountField",
|
|
84
|
+
fallbackValues,
|
|
85
|
+
"default"
|
|
86
|
+
),
|
|
87
|
+
arePropsEqual
|
|
88
|
+
);
|
|
@@ -25,19 +25,26 @@ const PaymentButtonBar = ({
|
|
|
25
25
|
hideBackButton = false,
|
|
26
26
|
buttonGroupStyles,
|
|
27
27
|
hideAdditionalButton = false,
|
|
28
|
-
additionalButton
|
|
28
|
+
additionalButton,
|
|
29
|
+
nextButtonTestId = null,
|
|
30
|
+
backButtonTestId = null
|
|
29
31
|
}) => {
|
|
30
32
|
const { isMobile } = useContext(ThemeContext);
|
|
31
33
|
|
|
34
|
+
// cancel URLs are external (back to client system)
|
|
35
|
+
const handleCancel = () => {
|
|
36
|
+
window.location.href = cancelURL;
|
|
37
|
+
};
|
|
38
|
+
|
|
32
39
|
const backButton =
|
|
33
40
|
!!cancelURL && !!cancelText ? (
|
|
34
|
-
<
|
|
41
|
+
<ButtonWithAction
|
|
35
42
|
text={cancelText}
|
|
36
|
-
|
|
43
|
+
action={handleCancel}
|
|
37
44
|
variant={backButtonVariant}
|
|
38
45
|
extraStyles={isMobile && "flex-grow: 1"}
|
|
39
|
-
dataQa={cancelText}
|
|
40
|
-
aria-
|
|
46
|
+
dataQa={backButtonTestId || cancelText}
|
|
47
|
+
aria-label={`${cancelText}, navigate back to previous site`}
|
|
41
48
|
role="link"
|
|
42
49
|
/>
|
|
43
50
|
) : (
|
|
@@ -48,7 +55,7 @@ const PaymentButtonBar = ({
|
|
|
48
55
|
action={backButtonAction}
|
|
49
56
|
extraStyles={isMobile && "flex-grow: 1"}
|
|
50
57
|
dataQa="Back"
|
|
51
|
-
aria-
|
|
58
|
+
aria-label={"Back, navigate to previous page"}
|
|
52
59
|
role="link"
|
|
53
60
|
/>
|
|
54
61
|
)
|
|
@@ -60,7 +67,7 @@ const PaymentButtonBar = ({
|
|
|
60
67
|
text={redirectText}
|
|
61
68
|
variant={forwardButtonVariant}
|
|
62
69
|
extraStyles={isMobile && "flex-grow: 1"}
|
|
63
|
-
dataQa={redirectText}
|
|
70
|
+
dataQa={nextButtonTestId || redirectText}
|
|
64
71
|
disabled={isForwardButtonDisabled}
|
|
65
72
|
aria-labelledby={`${kebabCaseString(redirectText)}-button`}
|
|
66
73
|
role={forwardButtonAriaRole}
|
|
@@ -73,7 +80,7 @@ const PaymentButtonBar = ({
|
|
|
73
80
|
action={forwardButtonAction}
|
|
74
81
|
isLoading={forwardButtonLoading}
|
|
75
82
|
extraStyles={isMobile && "flex-grow: 1"}
|
|
76
|
-
dataQa={forwardButtonText}
|
|
83
|
+
dataQa={nextButtonTestId || forwardButtonText}
|
|
77
84
|
disabled={isForwardButtonDisabled}
|
|
78
85
|
aria-labelledby={`${kebabCaseString(forwardButtonText)}-button`}
|
|
79
86
|
role={forwardButtonAriaRole}
|
|
@@ -260,7 +260,6 @@ const PaymentDetails = ({
|
|
|
260
260
|
// end partial void section
|
|
261
261
|
isLoading = false,
|
|
262
262
|
isError = false,
|
|
263
|
-
multiCartEnabled = false,
|
|
264
263
|
agencyDisplayName
|
|
265
264
|
}) => {
|
|
266
265
|
const [isOpen, setIsOpen] = useState(initiallyOpen);
|
|
@@ -292,7 +291,7 @@ const PaymentDetails = ({
|
|
|
292
291
|
));
|
|
293
292
|
const agencySubheading = (
|
|
294
293
|
<>
|
|
295
|
-
{
|
|
294
|
+
{agencyDisplayName && (
|
|
296
295
|
<Cluster
|
|
297
296
|
justify="space-between"
|
|
298
297
|
align="center"
|
|
@@ -160,7 +160,6 @@ export const paymentDetails = () => (
|
|
|
160
160
|
collapsibleOnMobile={boolean("collapsibleOnMobile", false, "props")}
|
|
161
161
|
initiallyOpen={boolean("initiallyOpen", true, "props")}
|
|
162
162
|
hideTitle={boolean("hideTitle", false, "props")}
|
|
163
|
-
multiCartEnabled={true}
|
|
164
163
|
agencyDisplayName="Office of Charitable Trust"
|
|
165
164
|
/>
|
|
166
165
|
);
|
|
@@ -49,6 +49,7 @@ const PaymentFormACH = ({
|
|
|
49
49
|
[isRoutingNumber.error]: "Invalid routing number"
|
|
50
50
|
};
|
|
51
51
|
const confirmRoutingNumberErrors = {
|
|
52
|
+
[required.error]: "Confirm routing number is required",
|
|
52
53
|
[matchesField.error]:
|
|
53
54
|
"Confirm routing number field must match routing number"
|
|
54
55
|
};
|
|
@@ -57,6 +58,7 @@ const PaymentFormACH = ({
|
|
|
57
58
|
[hasLength.error]: "Account number must be between 5 and 17 digits"
|
|
58
59
|
};
|
|
59
60
|
const confirmAccountNumberErrors = {
|
|
61
|
+
[required.error]: "Confirm account number is required",
|
|
60
62
|
[matchesField.error]:
|
|
61
63
|
"Confirm account number field must match account number"
|
|
62
64
|
};
|
|
@@ -16,7 +16,7 @@ const formConfig = {
|
|
|
16
16
|
constraints: [onlyIntegers(), hasLength(0, 9)]
|
|
17
17
|
},
|
|
18
18
|
confirmRoutingNumber: {
|
|
19
|
-
validators: [matchesField("routingNumber")],
|
|
19
|
+
validators: [required(), matchesField("routingNumber")],
|
|
20
20
|
constraints: [onlyIntegers(), hasLength(0, 9)]
|
|
21
21
|
},
|
|
22
22
|
accountNumber: {
|
|
@@ -24,7 +24,7 @@ const formConfig = {
|
|
|
24
24
|
constraints: [onlyIntegers(), hasLength(0, 17)]
|
|
25
25
|
},
|
|
26
26
|
confirmAccountNumber: {
|
|
27
|
-
validators: [matchesField("accountNumber")],
|
|
27
|
+
validators: [required(), matchesField("accountNumber")],
|
|
28
28
|
constraints: [onlyIntegers(), hasLength(0, 17)]
|
|
29
29
|
},
|
|
30
30
|
accountType: {
|
|
@@ -5,7 +5,8 @@ import {
|
|
|
5
5
|
hasLength,
|
|
6
6
|
matchesRegex,
|
|
7
7
|
dateAfterToday,
|
|
8
|
-
isValidMonth
|
|
8
|
+
isValidMonth,
|
|
9
|
+
includesPotentialCardNumber
|
|
9
10
|
} from "redux-freeform";
|
|
10
11
|
import Checkbox from "../../atoms/checkbox";
|
|
11
12
|
import CountryDropdown from "../../atoms/country-dropdown";
|
|
@@ -64,7 +65,9 @@ const PaymentFormCard = ({
|
|
|
64
65
|
}, []);
|
|
65
66
|
|
|
66
67
|
const nameOnCardErrors = {
|
|
67
|
-
[required.error]: "Name is required"
|
|
68
|
+
[required.error]: "Name is required",
|
|
69
|
+
[includesPotentialCardNumber.error]:
|
|
70
|
+
"Please only enter your name or business name"
|
|
68
71
|
};
|
|
69
72
|
const creditCardNumberErrors = {
|
|
70
73
|
[required.error]: "Credit card number is required",
|
|
@@ -134,6 +137,7 @@ const PaymentFormCard = ({
|
|
|
134
137
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
135
138
|
isNum
|
|
136
139
|
autocompleteValue="cc-number"
|
|
140
|
+
name="cc-number"
|
|
137
141
|
isRequired={true}
|
|
138
142
|
/>
|
|
139
143
|
<FormInputRow
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
required,
|
|
4
4
|
onlyIntegers,
|
|
5
5
|
hasLength,
|
|
6
|
+
includesPotentialCardNumber,
|
|
6
7
|
matchesRegex,
|
|
7
8
|
validateWhen,
|
|
8
9
|
dateAfterToday,
|
|
@@ -18,7 +19,7 @@ const formConfig = {
|
|
|
18
19
|
validators: [required()]
|
|
19
20
|
},
|
|
20
21
|
nameOnCard: {
|
|
21
|
-
validators: [required()]
|
|
22
|
+
validators: [required(), includesPotentialCardNumber()]
|
|
22
23
|
},
|
|
23
24
|
creditCardNumber: {
|
|
24
25
|
validators: [required(), hasLength(15, 16)],
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
import { noop } from "../../../util/general";
|
|
10
10
|
import Checkbox from "../../atoms/checkbox";
|
|
11
11
|
import { phoneFormats, formatDelimiter } from "../../../util/formats";
|
|
12
|
+
import { useConditionallyAddValidator } from "../../../hooks";
|
|
12
13
|
|
|
13
14
|
const PhoneForm = ({
|
|
14
15
|
variant = "default",
|
|
@@ -25,11 +26,16 @@ const PhoneForm = ({
|
|
|
25
26
|
if (clearOnDismount) {
|
|
26
27
|
useEffect(() => () => actions.form.clear(), []);
|
|
27
28
|
}
|
|
29
|
+
useConditionallyAddValidator(
|
|
30
|
+
isRequired,
|
|
31
|
+
required,
|
|
32
|
+
actions.fields.phone.addValidator,
|
|
33
|
+
actions.fields.phone.removeValidator
|
|
34
|
+
);
|
|
28
35
|
const phoneErrorMessage = {
|
|
29
36
|
[required.error]: "Phone number is required",
|
|
30
37
|
[hasLength.error]: "Phone number must be 10 digits"
|
|
31
38
|
};
|
|
32
|
-
|
|
33
39
|
return (
|
|
34
40
|
<FormContainer variant={variant} role="form" aria-label="Phone number">
|
|
35
41
|
<FormInputColumn>
|
|
@@ -5,24 +5,10 @@ import Paragraph from "../../atoms/paragraph";
|
|
|
5
5
|
import { Box } from "../../atoms/layouts";
|
|
6
6
|
import ButtonWithAction from "../../atoms/button-with-action";
|
|
7
7
|
import { useOutsideClick } from "../../../hooks";
|
|
8
|
-
import { noop } from "../../../util/general";
|
|
8
|
+
import { noop, arrowBorder } from "../../../util/general";
|
|
9
9
|
import { ESCAPE } from "../../../constants/keyboard";
|
|
10
10
|
import { fallbackValues } from "./Popover.theme";
|
|
11
11
|
|
|
12
|
-
const arrowBorder = (borderColor, direction, width = "8px") => {
|
|
13
|
-
const angle = `${width} solid transparent`;
|
|
14
|
-
const straight = `${width} solid ${borderColor}`;
|
|
15
|
-
if (direction == "down") {
|
|
16
|
-
return `border-left: ${angle}; border-right: ${angle}; border-top: ${straight}`;
|
|
17
|
-
} else if (direction == "up") {
|
|
18
|
-
return `border-left: ${angle}; border-right: ${angle}; border-bottom: ${straight}`;
|
|
19
|
-
} else if (direction == "left") {
|
|
20
|
-
return `border-top: ${angle}; border-bottom: ${angle}; border-right: ${straight}`;
|
|
21
|
-
} else if (direction == "right") {
|
|
22
|
-
return `border-top: ${angle}; border-bottom: ${angle}; border-left: ${straight}`;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
|
|
26
12
|
const Popover = ({
|
|
27
13
|
themeValues,
|
|
28
14
|
triggerText = "",
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as PopoverStories from './Popover.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={PopoverStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
The Popover is a fully accessible widget to display additional information when a user hovers over a specified trigger element. The trigger can either be text supplied using the `triggerText` prop, or a custom Icon component supplied using the `icon` prop.
|
|
10
|
+
|
|
11
|
+
The Popover can be positioned to appear anywhere around the trigger element using the position props. Content and style of the Popover are customizable.
|
|
12
|
+
|
|
13
|
+
<Controls />
|
|
14
|
+
|
|
15
|
+
<Story />
|