@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,109 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MATISSE_BLUE,
|
|
3
|
+
ROYAL_BLUE_VIVID,
|
|
4
|
+
WHITE
|
|
5
|
+
} from "../../../constants/colors";
|
|
6
|
+
import { FONT_SIZE } from "../../../constants/style_constants";
|
|
7
|
+
|
|
8
|
+
// Colors
|
|
9
|
+
const heroPrimaryColor = ROYAL_BLUE_VIVID;
|
|
10
|
+
const heroTextColor = WHITE;
|
|
11
|
+
|
|
12
|
+
// Font Sizes
|
|
13
|
+
const headingFontSize = {
|
|
14
|
+
v1: {
|
|
15
|
+
mobile: "3.00rem",
|
|
16
|
+
desktop: "3.50rem"
|
|
17
|
+
},
|
|
18
|
+
v2: {
|
|
19
|
+
mobile: "2.50rem",
|
|
20
|
+
desktop: "3.50rem"
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const subheadingFontSize = {
|
|
24
|
+
v1: {
|
|
25
|
+
mobile: "2.00rem",
|
|
26
|
+
desktop: "2.50rem"
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const descriptionFontSize = {
|
|
31
|
+
v1: {
|
|
32
|
+
mobile: FONT_SIZE.MD,
|
|
33
|
+
desktop: FONT_SIZE.XL
|
|
34
|
+
},
|
|
35
|
+
v2: {
|
|
36
|
+
mobile: FONT_SIZE.LG,
|
|
37
|
+
desktop: FONT_SIZE.XL
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// Line Heights
|
|
42
|
+
const headingLineHeight = {
|
|
43
|
+
v1: {
|
|
44
|
+
mobile: 1.25,
|
|
45
|
+
desktop: 1.15
|
|
46
|
+
},
|
|
47
|
+
v2: {
|
|
48
|
+
mobile: 1.25,
|
|
49
|
+
desktop: 1.15
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const subheadingLineHeight = {
|
|
54
|
+
v1: {
|
|
55
|
+
mobile: 1.5,
|
|
56
|
+
desktop: 1.15
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const descriptionLineHeight = {
|
|
61
|
+
v1: {
|
|
62
|
+
mobile: 1.5,
|
|
63
|
+
desktop: 1.5
|
|
64
|
+
},
|
|
65
|
+
v2: {
|
|
66
|
+
mobile: 1.5,
|
|
67
|
+
desktop: 1.5
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// Alignment
|
|
72
|
+
const textAlign = {
|
|
73
|
+
v1: {
|
|
74
|
+
mobile: "left",
|
|
75
|
+
desktop: "left"
|
|
76
|
+
},
|
|
77
|
+
v2: {
|
|
78
|
+
mobile: "left",
|
|
79
|
+
desktop: "center"
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const justifyContent = {
|
|
84
|
+
v1: {
|
|
85
|
+
mobile: "flex-start",
|
|
86
|
+
desktop: "flex-start"
|
|
87
|
+
},
|
|
88
|
+
v2: {
|
|
89
|
+
mobile: "flex-start",
|
|
90
|
+
desktop: "center"
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export const fallbackValues = {
|
|
95
|
+
// Colors
|
|
96
|
+
heroPrimaryColor,
|
|
97
|
+
heroTextColor,
|
|
98
|
+
// Font sizes
|
|
99
|
+
headingFontSize,
|
|
100
|
+
descriptionFontSize,
|
|
101
|
+
subheadingFontSize,
|
|
102
|
+
// Line heights
|
|
103
|
+
headingLineHeight,
|
|
104
|
+
subheadingLineHeight,
|
|
105
|
+
descriptionLineHeight,
|
|
106
|
+
// Alignment
|
|
107
|
+
textAlign,
|
|
108
|
+
justifyContent
|
|
109
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Modal from "../modal";
|
|
3
|
+
import { Box, Motion, Stack } from "../../atoms/layouts";
|
|
4
|
+
import Paragraph from "../../atoms/paragraph";
|
|
5
|
+
|
|
6
|
+
const IdleModal = ({
|
|
7
|
+
modalOpen,
|
|
8
|
+
toggleModal,
|
|
9
|
+
timeLeftToLogout = 0,
|
|
10
|
+
totalLogoutTime = 30,
|
|
11
|
+
logout,
|
|
12
|
+
cancelLogout,
|
|
13
|
+
useCheckoutContent
|
|
14
|
+
}) => {
|
|
15
|
+
const percent =
|
|
16
|
+
(totalLogoutTime - timeLeftToLogout) * (100 / totalLogoutTime);
|
|
17
|
+
const transition = {
|
|
18
|
+
ease: "easeInOut",
|
|
19
|
+
duration: totalLogoutTime
|
|
20
|
+
};
|
|
21
|
+
const variants = {
|
|
22
|
+
enter: {
|
|
23
|
+
x: "-100%",
|
|
24
|
+
backgroundColor: "#317D4F"
|
|
25
|
+
},
|
|
26
|
+
animate: {
|
|
27
|
+
x: ["-100%", `${percent}%`],
|
|
28
|
+
backgroundColor: ["#317D4F", "#93A441", "#F4CB32", "#E36E43", "#D11053"],
|
|
29
|
+
times: [0, 0.4, 0.5, 0.6, 0.8],
|
|
30
|
+
transition
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const continueText = useCheckoutContent ? "Continue" : "Stay Logged In";
|
|
35
|
+
|
|
36
|
+
const cancelText = useCheckoutContent ? "End Session" : "Log Off";
|
|
37
|
+
|
|
38
|
+
const paragraphText = useCheckoutContent
|
|
39
|
+
? `Are you still there? Your payment will be cancelled in ${timeLeftToLogout} seconds.`
|
|
40
|
+
: `Are you still there? For your security, you will be logged out in ${timeLeftToLogout} seconds.`;
|
|
41
|
+
|
|
42
|
+
const modalBody = (
|
|
43
|
+
<Box padding="0">
|
|
44
|
+
<Stack>
|
|
45
|
+
<Paragraph>{paragraphText}</Paragraph>
|
|
46
|
+
<Motion>
|
|
47
|
+
<Box
|
|
48
|
+
padding="0 0 1px 0"
|
|
49
|
+
minHeight="10px"
|
|
50
|
+
width="100%"
|
|
51
|
+
borderRadius="6px"
|
|
52
|
+
extraStyles="position: relative; overflow: hidden;"
|
|
53
|
+
>
|
|
54
|
+
<Motion
|
|
55
|
+
padding="0 0 1px 0"
|
|
56
|
+
height="10px"
|
|
57
|
+
width="100%"
|
|
58
|
+
borderRadius="6px"
|
|
59
|
+
extraStyles="position: absolute;"
|
|
60
|
+
variants={variants}
|
|
61
|
+
initial="enter"
|
|
62
|
+
animate={modalOpen ? "animate" : "enter"}
|
|
63
|
+
exit="enter"
|
|
64
|
+
/>
|
|
65
|
+
</Box>
|
|
66
|
+
</Motion>
|
|
67
|
+
</Stack>
|
|
68
|
+
</Box>
|
|
69
|
+
);
|
|
70
|
+
const modalExtraProps = {
|
|
71
|
+
modalHeaderText: "Your session is about to expire!",
|
|
72
|
+
modalBodyText: modalBody,
|
|
73
|
+
continueButtonText: continueText,
|
|
74
|
+
cancelButtonText: cancelText,
|
|
75
|
+
continueAction: () => {
|
|
76
|
+
cancelLogout();
|
|
77
|
+
toggleModal(false);
|
|
78
|
+
},
|
|
79
|
+
cancelAction: () => {
|
|
80
|
+
logout();
|
|
81
|
+
toggleModal(false);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
return (
|
|
85
|
+
<Modal
|
|
86
|
+
showModal={() => toggleModal(true)}
|
|
87
|
+
hideModal={() => {
|
|
88
|
+
cancelLogout();
|
|
89
|
+
toggleModal(false);
|
|
90
|
+
}}
|
|
91
|
+
modalOpen={modalOpen}
|
|
92
|
+
defaultWrapper={false}
|
|
93
|
+
underlayClickExits={false}
|
|
94
|
+
{...modalExtraProps}
|
|
95
|
+
>
|
|
96
|
+
<Box padding="0" />
|
|
97
|
+
</Modal>
|
|
98
|
+
);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export default IdleModal;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as IdleModalStories from './IdleModal.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={IdleModalStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
The IdleModal is a molecule used to display an animated progress bar and a message informing a user that they will shortly be logged out of an application due to idleness. The modal is a "dumb" component that requires the countdown timer be managed in the parent component. CB Components has a useful react hook contained in the `idleTimerUtils.js` file that NFE uses to help manage the running of the IdleModal.
|
|
10
|
+
|
|
11
|
+
For detecting user inactivity, an application can either implement its own mouse/keyboard event tracking, or rely on a third party package like react-idle-timer. An implementation example is available in the component's story file.
|
|
12
|
+
|
|
13
|
+
As of August 2024, all three of the applications (NFE, RevM, POS) to use the IdleModal use customized versions that live within the application code. A backlog ticket has been created to unify all existing implementations to the CB Components standard.
|
|
14
|
+
|
|
15
|
+
<Controls />
|
|
16
|
+
|
|
17
|
+
<Story />
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import IdleModal from "./IdleModal";
|
|
3
|
+
import { fn } from "@storybook/test";
|
|
4
|
+
import { ButtonWithAction } from "../../atoms";
|
|
5
|
+
import { Box, Stack } from "../../atoms/layouts";
|
|
6
|
+
import Text from "../../atoms/text";
|
|
7
|
+
import useLogoutTimers from "../../../util/idleTimerUtils";
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: "Molecules/IdleModal",
|
|
11
|
+
component: IdleModal,
|
|
12
|
+
tags: ["!autodocs"],
|
|
13
|
+
parameters: {
|
|
14
|
+
layout: "centered",
|
|
15
|
+
controls: { expanded: true }
|
|
16
|
+
},
|
|
17
|
+
args: {
|
|
18
|
+
modalOpen: undefined,
|
|
19
|
+
toggleModal: fn(),
|
|
20
|
+
timeLeftToLogout: 0,
|
|
21
|
+
totalLogoutTime: 30,
|
|
22
|
+
logout: fn(),
|
|
23
|
+
cancelLogout: fn(),
|
|
24
|
+
useCheckoutContent: undefined
|
|
25
|
+
},
|
|
26
|
+
argTypes: {
|
|
27
|
+
modalOpen: {
|
|
28
|
+
description: "Whether the modal is open",
|
|
29
|
+
table: {
|
|
30
|
+
type: { summary: "boolean" },
|
|
31
|
+
defaultValue: { summary: undefined }
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
toggleModal: {
|
|
35
|
+
description: "Function to toggle the modal open or closed",
|
|
36
|
+
table: {
|
|
37
|
+
type: { summary: "function" },
|
|
38
|
+
defaultValue: { summary: undefined }
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
timeLeftToLogout: {
|
|
42
|
+
description:
|
|
43
|
+
"Amount of time remaining before logout function is called. Should be supplied by parent component using setInterval or other mechanism to decrement a counter.",
|
|
44
|
+
table: {
|
|
45
|
+
type: { summary: "number" },
|
|
46
|
+
defaultValue: { summary: 0 }
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
totalLogoutTime: {
|
|
50
|
+
description:
|
|
51
|
+
"Total amount of time before logout function is called. Used with timeLeftToLogout in order to animate the progress bar.",
|
|
52
|
+
table: {
|
|
53
|
+
type: { summary: "number" },
|
|
54
|
+
defaultValue: { summary: 30 }
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
logout: {
|
|
58
|
+
description:
|
|
59
|
+
"Function to run when timer reaches zero. Typically a redux action dispatcher, but can be a wrapping function that handles the logout sequence itself.",
|
|
60
|
+
table: {
|
|
61
|
+
type: { summary: "function" },
|
|
62
|
+
defaultValue: { summary: undefined }
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
cancelLogout: {
|
|
66
|
+
description:
|
|
67
|
+
"Function to run if user closes or cancels modal early. Typically a redux action dispatcher, but can be a wrapping function.",
|
|
68
|
+
table: {
|
|
69
|
+
type: { summary: "function" },
|
|
70
|
+
defaultValue: { summary: undefined }
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
useCheckoutContent: {
|
|
74
|
+
description:
|
|
75
|
+
"Whether text of modal should reference checkout experience / user's payment.",
|
|
76
|
+
table: {
|
|
77
|
+
type: { summary: "boolean" },
|
|
78
|
+
defaultValue: { summary: undefined }
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const IdleModalComponent = args => {
|
|
85
|
+
const { totalLogoutTime, ...rest } = args;
|
|
86
|
+
const [modalOpen, setModalOpen] = useState(false);
|
|
87
|
+
const [logoutTriggered, setLogoutTriggered] = useState(false);
|
|
88
|
+
const [cancelLogoutTriggered, setCancelLogoutTriggered] = useState(false);
|
|
89
|
+
const [timeLeftToLogout, setTimeLeftToLogout] = useState(totalLogoutTime);
|
|
90
|
+
const [logoutTimerOn, setLogoutTimerOn] = useState(false);
|
|
91
|
+
|
|
92
|
+
const runIdleModal = () => {
|
|
93
|
+
setLogoutTriggered(false);
|
|
94
|
+
setCancelLogoutTriggered(false);
|
|
95
|
+
setModalOpen(true);
|
|
96
|
+
setLogoutTimerOn(true);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const resetLogoutTimer = () => {
|
|
100
|
+
clearInterval(logoutTimers.interval);
|
|
101
|
+
clearTimeout(logoutTimers.timer);
|
|
102
|
+
setTimeLeftToLogout(totalLogoutTime);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const handleLogout = () => {
|
|
106
|
+
setModalOpen(false);
|
|
107
|
+
setLogoutTriggered(true);
|
|
108
|
+
setLogoutTimerOn(false);
|
|
109
|
+
resetLogoutTimer();
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const handleCancelLogout = () => {
|
|
113
|
+
setModalOpen(false);
|
|
114
|
+
setCancelLogoutTriggered(true);
|
|
115
|
+
setLogoutTimerOn(false);
|
|
116
|
+
resetLogoutTimer();
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const logoutTimers = useLogoutTimers({
|
|
120
|
+
logoutTimerOn,
|
|
121
|
+
action: handleLogout,
|
|
122
|
+
timeLeftToLogout,
|
|
123
|
+
handleSetTimeLeft: setTimeLeftToLogout,
|
|
124
|
+
initialTimeLeftToLogout: totalLogoutTime
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
let userStatus = "is logged in";
|
|
128
|
+
|
|
129
|
+
if (logoutTriggered) {
|
|
130
|
+
userStatus = "has logged out";
|
|
131
|
+
}
|
|
132
|
+
if (cancelLogoutTriggered) {
|
|
133
|
+
userStatus = "has cancelled log out";
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return (
|
|
137
|
+
<Box>
|
|
138
|
+
<Stack childGap="10rem">
|
|
139
|
+
<Box>
|
|
140
|
+
<Text>{`User Status: ${userStatus}`}</Text>
|
|
141
|
+
</Box>
|
|
142
|
+
<Box>
|
|
143
|
+
<ButtonWithAction
|
|
144
|
+
action={() => runIdleModal()}
|
|
145
|
+
text="Trigger Idle Modal"
|
|
146
|
+
/>
|
|
147
|
+
</Box>
|
|
148
|
+
<Box>
|
|
149
|
+
<IdleModal
|
|
150
|
+
{...rest}
|
|
151
|
+
totalLogoutTime={totalLogoutTime}
|
|
152
|
+
timeLeftToLogout={timeLeftToLogout}
|
|
153
|
+
modalOpen={modalOpen}
|
|
154
|
+
toggleModal={() => setModalOpen(!modalOpen)}
|
|
155
|
+
logout={() => handleLogout()}
|
|
156
|
+
cancelLogout={() => handleCancelLogout()}
|
|
157
|
+
/>
|
|
158
|
+
</Box>
|
|
159
|
+
</Stack>
|
|
160
|
+
</Box>
|
|
161
|
+
);
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export const BasicIdleModal = {
|
|
165
|
+
render: args => IdleModalComponent(args)
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export const CheckoutIdleModal = {
|
|
169
|
+
args: {
|
|
170
|
+
useCheckoutContent: true
|
|
171
|
+
},
|
|
172
|
+
render: args => IdleModalComponent(args)
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
export const LengthyIdleModal = {
|
|
176
|
+
args: {
|
|
177
|
+
totalLogoutTime: 300
|
|
178
|
+
},
|
|
179
|
+
render: args => IdleModalComponent(args)
|
|
180
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from "react";
|
|
2
|
+
import Expand from "../../../util/expand";
|
|
3
|
+
import { ReduxAction } from "../../../types/common";
|
|
4
|
+
|
|
5
|
+
export interface IdleModalProps {
|
|
6
|
+
modalOpen: boolean;
|
|
7
|
+
toggleModal: (modalOpen: boolean) => void;
|
|
8
|
+
timeLeftToLogout?: number; // in seconds
|
|
9
|
+
totalLogoutTime?: number; // in seconds
|
|
10
|
+
logout: () => ReduxAction;
|
|
11
|
+
cancelLogout: () => ReduxAction;
|
|
12
|
+
useCheckoutContent?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const IdleModal: React.FC<Expand<IdleModalProps> &
|
|
16
|
+
HTMLAttributes<HTMLElement>>;
|
|
@@ -10,6 +10,7 @@ export { default as EmailForm } from "./email-form";
|
|
|
10
10
|
export { default as FooterWithSubfooter } from "./footer-with-subfooter";
|
|
11
11
|
export { default as ForgotPasswordForm } from "./forgot-password-form";
|
|
12
12
|
export { default as HighlightTabRow } from "./highlight-tab-row";
|
|
13
|
+
export { default as IdleModal } from "./idle-modal";
|
|
13
14
|
export { iconsMap as ObligationIcons } from "./obligation/icons";
|
|
14
15
|
export { default as LinkCard } from "./link-card";
|
|
15
16
|
export { default as LoginForm } from "./login-form";
|
|
@@ -28,6 +29,7 @@ export { default as PhoneForm } from "./phone-form";
|
|
|
28
29
|
export { default as Popover } from "./popover";
|
|
29
30
|
export { default as RadioGroup } from "./radio-group";
|
|
30
31
|
export { default as RadioSection } from "./radio-section";
|
|
32
|
+
export { default as RegistrationBanner } from "./registration-banner";
|
|
31
33
|
export { default as RegistrationForm } from "./registration-form";
|
|
32
34
|
export { default as ResetConfirmationForm } from "./reset-confirmation-form";
|
|
33
35
|
export { default as ResetPasswordForm } from "./reset-password-form";
|
|
@@ -41,3 +43,8 @@ export { default as ToastNotification } from "./toast-notification";
|
|
|
41
43
|
export { default as WelcomeModule } from "./welcome-module";
|
|
42
44
|
export { default as WorkflowTile } from "./workflow-tile";
|
|
43
45
|
export { default as PopupMenu } from "./popup-menu";
|
|
46
|
+
export { default as MultipleSelectFilter } from "./multiple-select-filter";
|
|
47
|
+
export { default as ContactCard } from "./contact-card";
|
|
48
|
+
export { default as HeroImage } from "./hero-image";
|
|
49
|
+
export { default as TurnstileWidget } from "./turnstile-widget/TurnstileWidget";
|
|
50
|
+
export { default as Tooltip } from "./tooltip";
|
|
@@ -4,44 +4,44 @@ import { themeComponent } from "../../../util/themeUtils";
|
|
|
4
4
|
import { fallbackValues } from "./LinkCard.theme";
|
|
5
5
|
import { ThemeContext } from "styled-components";
|
|
6
6
|
import * as Styled from "./LinkCard.styled";
|
|
7
|
-
import
|
|
7
|
+
import ExternalLinkIcon from "../../atoms/icons/ExternalLinkIcon";
|
|
8
|
+
import { SPACING } from "../../../constants/style_constants";
|
|
8
9
|
|
|
9
10
|
const LinkCard = ({
|
|
10
11
|
title = "Test Workflow",
|
|
11
12
|
subtitle = "Link your benefit plan",
|
|
13
|
+
subtitlePadding = "0 0 40px",
|
|
12
14
|
showLeft,
|
|
13
15
|
leftContent,
|
|
14
16
|
showRight,
|
|
15
17
|
rightContent,
|
|
16
|
-
onClick,
|
|
17
18
|
extraStyles = "",
|
|
18
19
|
extraHoverStyles = "",
|
|
19
20
|
extraActiveStyles = "",
|
|
20
21
|
themeValues,
|
|
21
22
|
titleVariant = "h3",
|
|
22
|
-
disabled = false
|
|
23
|
+
disabled = false,
|
|
24
|
+
isExternalLink = false,
|
|
25
|
+
href = ""
|
|
23
26
|
}) => {
|
|
24
27
|
const { isMobile } = useContext(ThemeContext);
|
|
25
28
|
const regex = /\W/g;
|
|
26
|
-
const locatorSlug = title
|
|
29
|
+
const locatorSlug = title?.toLowerCase?.()?.replaceAll?.(regex, "-");
|
|
27
30
|
|
|
28
31
|
return (
|
|
29
32
|
<Styled.Container
|
|
33
|
+
as="a"
|
|
34
|
+
role="link"
|
|
35
|
+
href={disabled ? undefined : href}
|
|
36
|
+
tabIndex={disabled ? -1 : 0}
|
|
30
37
|
borderRadius="8px"
|
|
31
38
|
dataQa={`link-card-${locatorSlug}`}
|
|
32
|
-
|
|
33
|
-
maxWidth={isMobile ? "100%" : "288px"}
|
|
34
|
-
minWidth={isMobile ? "240px" : "288px"}
|
|
35
|
-
minHeight="141px"
|
|
36
|
-
padding="24px"
|
|
37
|
-
theme={themeValues}
|
|
39
|
+
themeValues={themeValues}
|
|
38
40
|
extraStyles={extraStyles}
|
|
39
41
|
hoverStyles={extraHoverStyles}
|
|
40
42
|
activeStyles={extraActiveStyles}
|
|
41
|
-
onClick={disabled ? noop : onClick}
|
|
42
43
|
aria-disabled={disabled}
|
|
43
|
-
|
|
44
|
-
role="group"
|
|
44
|
+
disabled={disabled}
|
|
45
45
|
aria-label={`${title}, ${subtitle}`}
|
|
46
46
|
>
|
|
47
47
|
<Stack
|
|
@@ -51,21 +51,32 @@ const LinkCard = ({
|
|
|
51
51
|
style={{ width: "100%" }}
|
|
52
52
|
fullHeight
|
|
53
53
|
>
|
|
54
|
-
<
|
|
54
|
+
<Stack
|
|
55
|
+
direction="row"
|
|
56
|
+
childGap="0.5rem"
|
|
57
|
+
extraStyles={`align-items: center;`}
|
|
58
|
+
>
|
|
55
59
|
<Styled.Title
|
|
56
60
|
variant={titleVariant}
|
|
57
|
-
|
|
61
|
+
themeValues={themeValues}
|
|
58
62
|
margin={0}
|
|
59
|
-
|
|
63
|
+
disabled={disabled}
|
|
60
64
|
>
|
|
61
65
|
{title}
|
|
62
66
|
</Styled.Title>
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
{isExternalLink && (
|
|
68
|
+
<ExternalLinkIcon
|
|
69
|
+
linkColor={themeValues.color}
|
|
70
|
+
text={locatorSlug}
|
|
71
|
+
style={{ height: "1.125rem", width: "1.125rem" }}
|
|
72
|
+
/>
|
|
73
|
+
)}
|
|
74
|
+
</Stack>
|
|
75
|
+
<Box padding={subtitlePadding} width="100%">
|
|
65
76
|
<Styled.Subtitle
|
|
66
77
|
variant="pS"
|
|
67
|
-
|
|
68
|
-
|
|
78
|
+
themeValues={themeValues}
|
|
79
|
+
disabled={disabled}
|
|
69
80
|
>
|
|
70
81
|
{subtitle}
|
|
71
82
|
</Styled.Subtitle>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as LinkCardStories from './LinkCard.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={LinkCardStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
The LinkCard is a variant of the Card component that has been built to display a title, subtitle, and optionally additional content like a badge or icon. When clicked, the onClick function is called. Typically this function is used to navigate the user within the application.
|
|
10
|
+
|
|
11
|
+
Currently, the LinkCard is used in NFE on the /find page to assist users in finding accounts to link to their profile or to make one-time payments on. The LinkCard can take arbitrary child components for both its left and right content, which makes it very flexible and useful for any application where a grid of tiles is needed.
|
|
12
|
+
|
|
13
|
+
<Controls />
|
|
14
|
+
|
|
15
|
+
<div style={{ marginBottom: "2em"}}>
|
|
16
|
+
<Story />
|
|
17
|
+
</div>
|