@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,76 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import FormSelect from "./FormSelect";
|
|
3
|
+
import { connect, Provider } from "react-redux";
|
|
4
|
+
import { createStore } from "redux";
|
|
5
|
+
import { createFormState, required } from "redux-freeform";
|
|
6
|
+
|
|
7
|
+
const { mapStateToProps, mapDispatchToProps, reducer } = createFormState({
|
|
8
|
+
example: {
|
|
9
|
+
validators: [required()]
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const store = createStore(
|
|
14
|
+
reducer,
|
|
15
|
+
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
const errorMessages = {
|
|
19
|
+
[required.error]: "You must choose an option!"
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const options = [
|
|
23
|
+
{ value: "", text: "Choose an option" },
|
|
24
|
+
{ value: "foo", text: "foo" },
|
|
25
|
+
{ value: "bar", text: "bar" },
|
|
26
|
+
{ value: "baz", text: "baz" },
|
|
27
|
+
{ value: "disabled", text: "disabled" }
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
const FormWrapper = props => (
|
|
31
|
+
<FormSelect
|
|
32
|
+
{...props}
|
|
33
|
+
field={props.fields.example}
|
|
34
|
+
fieldActions={props.actions.fields.example}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const ConnectedFormSelect = connect(
|
|
39
|
+
mapStateToProps,
|
|
40
|
+
mapDispatchToProps
|
|
41
|
+
)(FormWrapper);
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
title: "Atoms/FormSelect",
|
|
45
|
+
component: ConnectedFormSelect,
|
|
46
|
+
tags: ["!autodocs"],
|
|
47
|
+
args: {
|
|
48
|
+
labelTextWhenNoError: "Form Select Example",
|
|
49
|
+
errorMessages: errorMessages,
|
|
50
|
+
options: options,
|
|
51
|
+
showErrors: false,
|
|
52
|
+
onChange: null,
|
|
53
|
+
dropdownMaxHeight: "600px",
|
|
54
|
+
disabledValues: ["disabled"],
|
|
55
|
+
disabled: false,
|
|
56
|
+
hasTitles: false,
|
|
57
|
+
autocompleteValue: "",
|
|
58
|
+
smoothScroll: true,
|
|
59
|
+
dataQa: "form-select-qa",
|
|
60
|
+
widthFitOptions: false,
|
|
61
|
+
isRequired: false
|
|
62
|
+
},
|
|
63
|
+
argTypes: {
|
|
64
|
+
fieldActions: { type: "object" },
|
|
65
|
+
field: { type: "object" }
|
|
66
|
+
},
|
|
67
|
+
decorators: [
|
|
68
|
+
Story => (
|
|
69
|
+
<Provider store={store}>
|
|
70
|
+
<Story />
|
|
71
|
+
</Provider>
|
|
72
|
+
)
|
|
73
|
+
]
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const Basic = args => <ConnectedFormSelect {...args} />;
|
|
@@ -2,7 +2,7 @@ import styled from "styled-components";
|
|
|
2
2
|
import {
|
|
3
3
|
GHOST_GREY,
|
|
4
4
|
ERROR_COLOR,
|
|
5
|
-
|
|
5
|
+
LUCKY_POINT
|
|
6
6
|
} from "../../../constants/colors";
|
|
7
7
|
import { FONT_WEIGHT_REGULAR } from "../../../constants/style_constants";
|
|
8
8
|
|
|
@@ -41,7 +41,7 @@ export const SelectField = styled.select`
|
|
|
41
41
|
box-shadow: none;
|
|
42
42
|
|
|
43
43
|
&:focus {
|
|
44
|
-
border: 1px solid ${
|
|
44
|
+
border: 1px solid ${LUCKY_POINT};
|
|
45
45
|
}
|
|
46
46
|
`;
|
|
47
47
|
|
|
@@ -6,11 +6,14 @@ import {
|
|
|
6
6
|
MINESHAFT_GREY,
|
|
7
7
|
DUSTY_GREY,
|
|
8
8
|
GREY_CHATEAU,
|
|
9
|
-
ATHENS_GREY
|
|
9
|
+
ATHENS_GREY,
|
|
10
|
+
LUCKY_POINT,
|
|
11
|
+
LUCKY_POINT_DARK,
|
|
12
|
+
HAWKES_BLUE
|
|
10
13
|
} from "../../../constants/colors";
|
|
11
14
|
import { FONT_WEIGHT_REGULAR } from "../../../constants/style_constants";
|
|
12
15
|
|
|
13
|
-
const linkColor = { default: `${
|
|
16
|
+
const linkColor = { default: `${LUCKY_POINT}`, disabled: `${LUCKY_POINT}` };
|
|
14
17
|
const formBackgroundColor = {
|
|
15
18
|
default: `${WHITE}`,
|
|
16
19
|
disabled: `${WHITE}`,
|
|
@@ -33,7 +36,7 @@ const fontWeight = {
|
|
|
33
36
|
disabled: `${FONT_WEIGHT_REGULAR}`
|
|
34
37
|
};
|
|
35
38
|
const hoverFocusStyles = {
|
|
36
|
-
default: `color:
|
|
39
|
+
default: `color: ${LUCKY_POINT_DARK}; outline: none; text-decoration: underline; `,
|
|
37
40
|
disabled: `color: #6D717E;`
|
|
38
41
|
};
|
|
39
42
|
|
|
@@ -24,6 +24,9 @@ export interface FormSelectProps {
|
|
|
24
24
|
smoothScroll?: boolean;
|
|
25
25
|
dataQa?: string | null;
|
|
26
26
|
widthFitOptions?: boolean;
|
|
27
|
+
isRequired?: boolean;
|
|
28
|
+
labelTextVariant?: string;
|
|
29
|
+
errorLabelTextVariant?: string;
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
export const FormSelect: React.FC<Expand<FormSelectProps> &
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as FormattedAddressStories from './FormattedAddress.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={FormattedAddressStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
FormattedAddress is a composition of Box and Text components to help create consistent formatting of addresses. The outer padding and text color are themeable.
|
|
10
|
+
|
|
11
|
+
<Story />
|
|
12
|
+
|
|
13
|
+
<Controls />
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import FormattedAddress from "./FormattedAddress";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Atoms/FormattedAddress",
|
|
6
|
+
component: FormattedAddress,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: "centered",
|
|
9
|
+
controls: { expanded: true }
|
|
10
|
+
},
|
|
11
|
+
tags: ["!autodocs"],
|
|
12
|
+
args: {
|
|
13
|
+
street1: undefined,
|
|
14
|
+
city: undefined,
|
|
15
|
+
stateProvince: undefined,
|
|
16
|
+
country: undefined,
|
|
17
|
+
zip: undefined,
|
|
18
|
+
street2: null,
|
|
19
|
+
name: null,
|
|
20
|
+
themeValues: undefined,
|
|
21
|
+
qaPrefix: "address"
|
|
22
|
+
},
|
|
23
|
+
argTypes: {
|
|
24
|
+
street1: {
|
|
25
|
+
control: { type: "text" },
|
|
26
|
+
table: {
|
|
27
|
+
type: { summary: "string" },
|
|
28
|
+
defaultValue: { summary: undefined }
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
street2: {
|
|
32
|
+
description: "Optional",
|
|
33
|
+
control: { type: "text" },
|
|
34
|
+
table: {
|
|
35
|
+
type: { summary: "string" },
|
|
36
|
+
defaultValue: { summary: null }
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
city: {
|
|
40
|
+
control: { type: "text" },
|
|
41
|
+
table: {
|
|
42
|
+
type: { summary: "string" },
|
|
43
|
+
defaultValue: { summary: undefined }
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
stateProvince: {
|
|
47
|
+
control: { type: "text" },
|
|
48
|
+
table: {
|
|
49
|
+
type: { summary: "string" },
|
|
50
|
+
defaultValue: { summary: undefined }
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
country: {
|
|
54
|
+
description: "Optional",
|
|
55
|
+
control: { type: "text" },
|
|
56
|
+
table: {
|
|
57
|
+
type: { summary: "string" },
|
|
58
|
+
defaultValue: { summary: undefined }
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
zip: {
|
|
62
|
+
control: { type: "text" },
|
|
63
|
+
table: {
|
|
64
|
+
type: { summary: "string" },
|
|
65
|
+
defaultValue: { summary: undefined }
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
name: {
|
|
69
|
+
description: "Optional",
|
|
70
|
+
control: { type: "text" },
|
|
71
|
+
table: {
|
|
72
|
+
type: { summary: "string" },
|
|
73
|
+
defaultValue: { summary: null }
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
qaPrefix: {
|
|
77
|
+
control: { type: "text" },
|
|
78
|
+
table: {
|
|
79
|
+
type: { summary: "string" },
|
|
80
|
+
defaultValue: { summary: "address" }
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export default meta;
|
|
87
|
+
|
|
88
|
+
export const Basic = {
|
|
89
|
+
args: {
|
|
90
|
+
street1: "363 W. Erie St.",
|
|
91
|
+
city: "Chicago",
|
|
92
|
+
stateProvince: "IL",
|
|
93
|
+
zip: "60654"
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export const WithName = {
|
|
98
|
+
args: {
|
|
99
|
+
street1: "363 W. Erie St.",
|
|
100
|
+
city: "Chicago",
|
|
101
|
+
stateProvince: "IL",
|
|
102
|
+
zip: "60654",
|
|
103
|
+
name: "John Doe"
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export const WithStreet2 = {
|
|
108
|
+
args: {
|
|
109
|
+
street1: "363 W. Erie St.",
|
|
110
|
+
city: "Chicago",
|
|
111
|
+
stateProvince: "IL",
|
|
112
|
+
zip: "60654",
|
|
113
|
+
street2: "Floor 7"
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export const WithCountry = {
|
|
118
|
+
args: {
|
|
119
|
+
street1: "363 W. Erie St.",
|
|
120
|
+
city: "Chicago",
|
|
121
|
+
stateProvince: "IL",
|
|
122
|
+
zip: "60654",
|
|
123
|
+
country: "USA"
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export const WithAllProps = {
|
|
128
|
+
args: {
|
|
129
|
+
name: "John Doe",
|
|
130
|
+
street1: "363 W. Erie St.",
|
|
131
|
+
street2: "Floor 7",
|
|
132
|
+
city: "Chicago",
|
|
133
|
+
stateProvince: "IL",
|
|
134
|
+
zip: "60654",
|
|
135
|
+
country: "USA",
|
|
136
|
+
qaPrefix: "all-props"
|
|
137
|
+
}
|
|
138
|
+
};
|
|
@@ -50,8 +50,8 @@ const FormattedBankAccount = ({
|
|
|
50
50
|
<Text
|
|
51
51
|
variant="p"
|
|
52
52
|
color={themeValues.autopayTextColor}
|
|
53
|
-
extraStyles={`font-style: italic;`}
|
|
54
|
-
>{`Autopay
|
|
53
|
+
extraStyles={`font-style: italic; font-size: .75rem;`}
|
|
54
|
+
>{`Autopay On`}</Text>
|
|
55
55
|
)}
|
|
56
56
|
</Stack>
|
|
57
57
|
</BankItemWrapper>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as FormattedBankAccountStories from './FormattedBankAccount.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={FormattedBankAccountStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
The FormattedBankAccount is a simple component that takes bank account information and presents it in a standard way that can be reused throughout applications. The component requires:
|
|
10
|
+
|
|
11
|
+
- lastFour (last four of the account number),
|
|
12
|
+
- accountType (one of CHECKING or SAVINGS),
|
|
13
|
+
- autoPay (boolean, whether an autopay is associated with the account)
|
|
14
|
+
|
|
15
|
+
<div style={{ marginBottom: "2em"}}>
|
|
16
|
+
<Story />
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import FormattedBankAccount from "./FormattedBankAccount";
|
|
2
|
+
|
|
3
|
+
const meta = {
|
|
4
|
+
title: "Atoms/FormattedBankAccount",
|
|
5
|
+
component: FormattedBankAccount,
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: "centered"
|
|
8
|
+
},
|
|
9
|
+
tags: ["!autodocs"],
|
|
10
|
+
args: {
|
|
11
|
+
lastFour: "9456",
|
|
12
|
+
accountType: "CHECKING",
|
|
13
|
+
autoPay: false
|
|
14
|
+
},
|
|
15
|
+
argTypes: {
|
|
16
|
+
lastFour: {
|
|
17
|
+
description: "The last four digits of the bank account number",
|
|
18
|
+
table: {
|
|
19
|
+
type: { summary: "string" },
|
|
20
|
+
defaultValue: { summary: undefined }
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
accountType: {
|
|
24
|
+
description: "The type of bank account - either CHECKING or SAVINGS",
|
|
25
|
+
table: {
|
|
26
|
+
type: { summary: "string" },
|
|
27
|
+
defaultValue: { summary: undefined }
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
autoPay: {
|
|
31
|
+
description: "Whether the bank account is being used for autopay",
|
|
32
|
+
table: {
|
|
33
|
+
type: { summary: "boolean" },
|
|
34
|
+
defaultValue: { summary: undefined }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default meta;
|
|
41
|
+
|
|
42
|
+
export const FormattedCheckingAccount = {};
|
|
43
|
+
|
|
44
|
+
export const FormattedSavingsAccount = {
|
|
45
|
+
args: {
|
|
46
|
+
lastFour: "5139",
|
|
47
|
+
accountType: "SAVINGS"
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const AccountWithAutopay = {
|
|
52
|
+
args: {
|
|
53
|
+
lastFour: "7291",
|
|
54
|
+
accountType: "CHECKING",
|
|
55
|
+
autoPay: true
|
|
56
|
+
}
|
|
57
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CHARADE_GREY,
|
|
1
|
+
import { CHARADE_GREY, SEA_GREEN } from "../../../constants/colors";
|
|
2
2
|
|
|
3
3
|
const textColor = `${CHARADE_GREY}`;
|
|
4
|
-
const autopayTextColor = `${
|
|
4
|
+
const autopayTextColor = `${SEA_GREEN}`;
|
|
5
5
|
|
|
6
6
|
export const fallbackValues = {
|
|
7
7
|
textColor,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { Fragment } from "react";
|
|
2
|
-
import styled from "styled-components";
|
|
3
|
-
import
|
|
1
|
+
import React, { Fragment, useContext } from "react";
|
|
2
|
+
import styled, { ThemeContext } from "styled-components";
|
|
3
|
+
import CardType from "../card-type";
|
|
4
4
|
import Text from "../text";
|
|
5
5
|
import { Box, Stack } from "../layouts";
|
|
6
6
|
import { fallbackValues } from "./FormattedCreditCard.theme";
|
|
@@ -15,27 +15,30 @@ export const CreditCardWrapper = styled.div`
|
|
|
15
15
|
|
|
16
16
|
export const CCIconWrapper = styled.div`
|
|
17
17
|
margin-right: 16px;
|
|
18
|
-
width:
|
|
18
|
+
width: 36px;
|
|
19
19
|
height: auto;
|
|
20
20
|
display: flex;
|
|
21
21
|
`;
|
|
22
22
|
|
|
23
23
|
const FormattedCreditCard = ({
|
|
24
24
|
lastFour,
|
|
25
|
+
type,
|
|
25
26
|
autoPay,
|
|
26
27
|
expireDate,
|
|
27
28
|
expirationStatus,
|
|
28
29
|
themeValues
|
|
29
|
-
}) =>
|
|
30
|
+
}) => {
|
|
31
|
+
const { isMobile } = useContext(ThemeContext);
|
|
32
|
+
return (
|
|
30
33
|
<CreditCardWrapper>
|
|
31
34
|
<CCIconWrapper>
|
|
32
|
-
<
|
|
35
|
+
<CardType type={type} size={isMobile ? "small" : "large"} />
|
|
33
36
|
</CCIconWrapper>
|
|
34
37
|
<Stack childGap="0">
|
|
35
38
|
<Box padding="0">
|
|
36
39
|
<Text
|
|
37
40
|
variant="p"
|
|
38
|
-
padding="0
|
|
41
|
+
padding="0"
|
|
39
42
|
color={themeValues.textColor}
|
|
40
43
|
textAlign="left"
|
|
41
44
|
extraStyles={`display: inline-block;`}
|
|
@@ -52,12 +55,13 @@ const FormattedCreditCard = ({
|
|
|
52
55
|
<Text
|
|
53
56
|
variant="p"
|
|
54
57
|
color={themeValues.autopayTextColor}
|
|
55
|
-
extraStyles={`font-style: italic;`}
|
|
56
|
-
>{`Autopay
|
|
58
|
+
extraStyles={`font-style: italic; font-size: .75rem;`}
|
|
59
|
+
>{`Autopay On`}</Text>
|
|
57
60
|
)}
|
|
58
61
|
</Stack>
|
|
59
62
|
</CreditCardWrapper>
|
|
60
|
-
);
|
|
63
|
+
);
|
|
64
|
+
};
|
|
61
65
|
export default themeComponent(
|
|
62
66
|
FormattedCreditCard,
|
|
63
67
|
"FormattedCreditCard",
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as FormattedCreditCardStories from './FormattedCreditCard.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={FormattedCreditCardStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
The FormattedCreditCard is a simple component that takes credit card information and presents it in a standard way that can be reused throughout applications. The component requires:
|
|
10
|
+
|
|
11
|
+
- lastFour (last four of the account number),
|
|
12
|
+
- autoPay (boolean, whether an autopay is associated with the account)
|
|
13
|
+
- expirationStatus (one of ACTIVE, EXPIRING_SOON, EXPIRED)
|
|
14
|
+
- expireDate (date of card expiration in MM/YY)
|
|
15
|
+
|
|
16
|
+
The expirationStatus of a card is typically managed by the application consuming this component. That status can either be received from an API call, or generated using logic in a utility function. Navigate uses the following utility function to attach a status to credit cards:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
export const getCardExpirationStatus = card => {
|
|
20
|
+
const ACTIVE = "ACTIVE";
|
|
21
|
+
const EXPIRING_SOON = "EXPIRING_SOON";
|
|
22
|
+
const EXPIRED = "EXPIRED";
|
|
23
|
+
|
|
24
|
+
const { expiryMonth, expiryYear } = card;
|
|
25
|
+
const today = dayjs();
|
|
26
|
+
const expiration = dayjs(`20${expiryYear}-${expiryMonth}`);
|
|
27
|
+
const cardExpirationStatus = expiration.diff(today, "months");
|
|
28
|
+
|
|
29
|
+
return cardExpirationStatus >= 1
|
|
30
|
+
? ACTIVE
|
|
31
|
+
: cardExpirationStatus === 0
|
|
32
|
+
? EXPIRING_SOON
|
|
33
|
+
: EXPIRED;
|
|
34
|
+
};
|
|
35
|
+
```
|
|
36
|
+
The text for a card's expiration status and date is generated by the `renderCardStatus` function in the formats.js file of this library.
|
|
37
|
+
|
|
38
|
+
<div style={{ marginBottom: "2em"}}>
|
|
39
|
+
<Story />
|
|
40
|
+
</div>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import FormattedCreditCard from "./FormattedCreditCard";
|
|
2
|
+
|
|
3
|
+
const meta = {
|
|
4
|
+
title: "Atoms/FormattedCreditCard",
|
|
5
|
+
component: FormattedCreditCard,
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: "centered"
|
|
8
|
+
},
|
|
9
|
+
tags: ["!autodocs"],
|
|
10
|
+
args: {
|
|
11
|
+
lastFour: "1003",
|
|
12
|
+
autoPay: false,
|
|
13
|
+
expirationDate: undefined,
|
|
14
|
+
expirationStatus: undefined
|
|
15
|
+
},
|
|
16
|
+
argTypes: {
|
|
17
|
+
lastFour: {
|
|
18
|
+
description: "The last four digits of the credit card number",
|
|
19
|
+
table: {
|
|
20
|
+
type: { summary: "string" },
|
|
21
|
+
defaultValue: { summary: undefined }
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
autoPay: {
|
|
25
|
+
description: "Whether the bank account is being used for autopay",
|
|
26
|
+
table: {
|
|
27
|
+
type: { summary: "boolean" },
|
|
28
|
+
defaultValue: { summary: undefined }
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
expirationDate: {
|
|
32
|
+
description: "The expiration date of the credit card",
|
|
33
|
+
table: {
|
|
34
|
+
type: { summary: "string" },
|
|
35
|
+
defaultValue: { summary: undefined }
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
expirationStatus: {
|
|
39
|
+
description:
|
|
40
|
+
"Whether a card will expire soon, one of ACTIVE, EXPIRING_SOON, or EXPIRED",
|
|
41
|
+
table: {
|
|
42
|
+
type: { summary: "string" },
|
|
43
|
+
defaultValue: { summary: undefined }
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default meta;
|
|
50
|
+
|
|
51
|
+
export const ActiveCreditCard = {
|
|
52
|
+
args: {
|
|
53
|
+
autoPay: true,
|
|
54
|
+
expireDate: "10/29",
|
|
55
|
+
expirationStatus: "ACTIVE"
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const ExpiringSoonCreditCard = {
|
|
60
|
+
args: {
|
|
61
|
+
lastFour: "2613",
|
|
62
|
+
expireDate: "12/24",
|
|
63
|
+
expirationStatus: "EXPIRING_SOON",
|
|
64
|
+
autoPay: true
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const ExpiredCreditCard = {
|
|
69
|
+
args: {
|
|
70
|
+
lastFour: "8054",
|
|
71
|
+
expireDate: "01/24",
|
|
72
|
+
expirationStatus: "EXPIRED"
|
|
73
|
+
}
|
|
74
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CHARADE_GREY,
|
|
1
|
+
import { CHARADE_GREY, SEA_GREEN } from "../../../constants/colors";
|
|
2
2
|
|
|
3
3
|
const textColor = `${CHARADE_GREY}`;
|
|
4
|
-
const autopayTextColor = `${
|
|
4
|
+
const autopayTextColor = `${SEA_GREEN}`;
|
|
5
5
|
|
|
6
6
|
export const fallbackValues = {
|
|
7
7
|
textColor,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
const AgencyIcon = ({ color = "#292A33", ...props }) => (
|
|
4
|
+
<svg
|
|
5
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
6
|
+
width="20"
|
|
7
|
+
height="21"
|
|
8
|
+
viewBox="0 0 20 21"
|
|
9
|
+
fill="none"
|
|
10
|
+
{...props}
|
|
11
|
+
>
|
|
12
|
+
<g id="Agency / Agency - S">
|
|
13
|
+
<path
|
|
14
|
+
id="Icon - Agency"
|
|
15
|
+
fillRule="evenodd"
|
|
16
|
+
clipRule="evenodd"
|
|
17
|
+
d="M9.5625 4.375H3.875L3.875 16.625H9.5625V7.875V7V4.375ZM10.4375 7.875V16.625H16.125V7.875H10.4375ZM10.4375 7H16.125C16.6082 7 17 7.39175 17 7.875V16.625C17 17.1082 16.6082 17.5 16.125 17.5H10.4375H9.5625H3.875C3.39175 17.5 3 17.1082 3 16.625V4.375C3 3.89175 3.39175 3.5 3.875 3.5H9.5625C10.0457 3.5 10.4375 3.89175 10.4375 4.375V7ZM8.46875 6.5625H4.96875V7.4375H8.46875V6.5625ZM4.96875 8.3125H8.46875V9.1875H4.96875V8.3125ZM8.46875 10.0625H4.96875V10.9375H8.46875V10.0625ZM4.96875 11.8125H8.46875V12.6875H4.96875V11.8125ZM4.96875 13.5625H8.46875V14.4375H4.96875V13.5625ZM11.5312 10.0625H15.0312V10.9375H11.5312V10.0625ZM11.5312 11.8125H15.0312V12.6875H11.5312V11.8125ZM15.0312 13.5625H11.5312V14.4375H15.0312V13.5625Z"
|
|
18
|
+
fill={color}
|
|
19
|
+
/>
|
|
20
|
+
</g>
|
|
21
|
+
</svg>
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export default AgencyIcon;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
const AmExLargeIcon = () => {
|
|
4
|
+
return (
|
|
5
|
+
<svg
|
|
6
|
+
width="36"
|
|
7
|
+
height="24"
|
|
8
|
+
viewBox="0 0 36 24"
|
|
9
|
+
fill="none"
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
role="img"
|
|
12
|
+
aria-label="American Express"
|
|
13
|
+
>
|
|
14
|
+
<g clipPath="url(#clip0_amex_large)">
|
|
15
|
+
<g clipPath="url(#clip1_amex_large)">
|
|
16
|
+
<path
|
|
17
|
+
d="M32.868 21.376L31.204 19.52L29.4761 21.376H26.084H18.788V12.736H15.396L19.62 3.072H23.7161L25.188 6.4V3.072H30.3079L31.204 5.568L32.1 3.072H36.004V1.6C36.004 0.704 35.2999 0 34.404 0H0.0999999C-0.795999 0 -1.5 0.704 -1.5 1.6V22.4C-1.5 23.296 -0.795999 24 0.0999999 24H34.404C35.2999 24 36.004 23.296 36.004 22.4V21.376H32.868Z"
|
|
18
|
+
fill="#0071CE"
|
|
19
|
+
/>
|
|
20
|
+
<path
|
|
21
|
+
d="M33.3161 20.352H36.004L32.484 16.576L36.004 12.864H33.38L31.14 15.296L28.9639 12.864H26.2759L29.86 16.64L26.2759 20.352H28.9L31.14 17.92L33.3161 20.352Z"
|
|
22
|
+
fill="#0071CE"
|
|
23
|
+
/>
|
|
24
|
+
<path
|
|
25
|
+
d="M21.9878 18.624V17.472H26.2118V15.744H21.9878V14.592H26.2759V12.864H19.9398V20.352H26.2759V18.624H21.9878Z"
|
|
26
|
+
fill="#0071CE"
|
|
27
|
+
/>
|
|
28
|
+
<path
|
|
29
|
+
d="M34.02 11.776H35.94V4.224L32.868 4.288L31.204 8.96L29.4761 4.288H26.2759V11.776H28.3241V6.528L30.244 11.776H32.036L34.02 6.528V11.776Z"
|
|
30
|
+
fill="#0071CE"
|
|
31
|
+
/>
|
|
32
|
+
<path
|
|
33
|
+
d="M23.012 4.28796H20.388L17.06 11.776H19.2999L19.94 10.304H23.396L24.036 11.776H26.34L23.012 4.28796ZM20.6439 8.57596L21.6679 6.14396L22.692 8.57596H20.6439Z"
|
|
34
|
+
fill="#0071CE"
|
|
35
|
+
/>
|
|
36
|
+
<path
|
|
37
|
+
d="M34.148 16.3839L36.004 18.432V14.3359L34.148 16.3839Z"
|
|
38
|
+
fill="#0071CE"
|
|
39
|
+
/>
|
|
40
|
+
</g>
|
|
41
|
+
</g>
|
|
42
|
+
<defs>
|
|
43
|
+
<clipPath id="clip0_amex_large">
|
|
44
|
+
<rect width="36" height="24" rx="1.5" fill="white" />
|
|
45
|
+
</clipPath>
|
|
46
|
+
<clipPath id="clip1_amex_large">
|
|
47
|
+
<rect width="36" height="24" fill="white" />
|
|
48
|
+
</clipPath>
|
|
49
|
+
</defs>
|
|
50
|
+
</svg>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default AmExLargeIcon;
|