@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,41 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as CardStories from './Card.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={CardStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
The Card component is a generic wrapper to create "cards" of information. A Card can contain a header, title, body text, images, and custom controls. Providing strings for header/title/body text as props results in default styling, but the component is very flexible and can be customized to display virtually any information.
|
|
10
|
+
|
|
11
|
+
Cards can take these properties to display content:
|
|
12
|
+
|
|
13
|
+
- headerText (optional)
|
|
14
|
+
- titleText (optional)
|
|
15
|
+
- text (optional)
|
|
16
|
+
- imgSrc (optional)
|
|
17
|
+
- Image (optional)
|
|
18
|
+
- children
|
|
19
|
+
|
|
20
|
+
In addition to the content props, Cards also offer certain props for controlling the style and display of provided information:
|
|
21
|
+
|
|
22
|
+
- headerAs (optional, default "h2")
|
|
23
|
+
- headerVariant (optional, default "small")
|
|
24
|
+
- imgHeight (optional, default "150px")
|
|
25
|
+
- imgObjectFit (optional, default "none")
|
|
26
|
+
- imgAltText (required for proper accessibility)
|
|
27
|
+
- titleVariant (optional, default "small")
|
|
28
|
+
- padding (optioonal, default "24px")
|
|
29
|
+
- width (optional min-width, default "276px")
|
|
30
|
+
|
|
31
|
+
By default, the width prop is the Card's _minimum_ width. The card will scale to match its width to the width of its parent container. If you wish to cap the Card's with, use the extraStyles prop like so:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
<Card extraStyles={`& { max-width: 450px };`} />
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
When using a Card to display an image there are two options. Either provide a URL string using the imgSrc prop, or provide a React Component using the Image prop. These are mutually exclusive options -- an image provided using the Image prop will only be displayed if imgSrc is undefined.
|
|
38
|
+
|
|
39
|
+
<div style={{ marginBottom: "2em"}}>
|
|
40
|
+
<Story />
|
|
41
|
+
</div>
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MANATEE_GREY } from "../../../constants/colors";
|
|
3
|
+
import { Box, Stack, Cluster } from "../layouts";
|
|
4
|
+
import Card from "./Card";
|
|
5
|
+
import ButtonWithAction from "../button-with-action/ButtonWithAction";
|
|
6
|
+
import ButtonWithLink from "../button-with-link/ButtonWithLink";
|
|
7
|
+
import Badge from "../badge/Badge";
|
|
8
|
+
import AutopayOnIcon from "../icons/AutopayOnIcon";
|
|
9
|
+
import FormattedCreditCard from "../formatted-credit-card/FormattedCreditCard";
|
|
10
|
+
import FormattedAddress from "../formatted-address/FormattedAddress";
|
|
11
|
+
import Detail from "../detail/Detail";
|
|
12
|
+
import WalletBannerIcon from "../icons/WalletBannerIcon";
|
|
13
|
+
import { fn } from "@storybook/test";
|
|
14
|
+
import { noop } from "../../../util/general";
|
|
15
|
+
|
|
16
|
+
const meta = {
|
|
17
|
+
title: "Atoms/Card",
|
|
18
|
+
component: Card,
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: "centered"
|
|
21
|
+
},
|
|
22
|
+
tags: ["!autodocs"],
|
|
23
|
+
args: {
|
|
24
|
+
borderRadius: "4px",
|
|
25
|
+
hasContentBackgroundColor: undefined,
|
|
26
|
+
headerAs: "h2",
|
|
27
|
+
headerText: "Register a Dog",
|
|
28
|
+
headerVariant: "small",
|
|
29
|
+
imgSrc: undefined,
|
|
30
|
+
Image: undefined,
|
|
31
|
+
imgHeight: "150px",
|
|
32
|
+
imgObjectFit: "none",
|
|
33
|
+
imgAltText: undefined,
|
|
34
|
+
onQuitClick: fn(),
|
|
35
|
+
padding: "24px",
|
|
36
|
+
showQuitLink: undefined,
|
|
37
|
+
text: undefined,
|
|
38
|
+
titleAs: "h2",
|
|
39
|
+
titleText: undefined,
|
|
40
|
+
titleVariant: "small",
|
|
41
|
+
width: "276px",
|
|
42
|
+
extraStyles: undefined,
|
|
43
|
+
children: undefined
|
|
44
|
+
},
|
|
45
|
+
argTypes: {
|
|
46
|
+
borderRadius: {
|
|
47
|
+
description: "The radius value for the Card's border",
|
|
48
|
+
table: {
|
|
49
|
+
type: { summary: "string" },
|
|
50
|
+
defaultValue: { summary: "4px" }
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
hasContentBackgroundColor: {
|
|
54
|
+
description: "Whether or not the content should have a background color",
|
|
55
|
+
table: {
|
|
56
|
+
type: { summary: "boolean" },
|
|
57
|
+
defaultValue: { summary: false }
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
headerAs: {
|
|
61
|
+
description: "The HTML element to use for the Card's header",
|
|
62
|
+
table: {
|
|
63
|
+
type: { summary: "string" },
|
|
64
|
+
defaultValue: { summary: "h2" }
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
headerText: {
|
|
68
|
+
description: "The text used in the Card's header",
|
|
69
|
+
table: {
|
|
70
|
+
type: { summary: "string" },
|
|
71
|
+
defaultValue: { summary: undefined }
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
headerVariant: {
|
|
75
|
+
description:
|
|
76
|
+
"The variant used for the embedded <Title /> component. Independent of specified HTML element, sets font size and line height.",
|
|
77
|
+
table: {
|
|
78
|
+
type: { summary: "string" },
|
|
79
|
+
defaultValue: { summary: "small" }
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
imgSrc: {
|
|
83
|
+
description: "URL to use for Card image",
|
|
84
|
+
table: {
|
|
85
|
+
type: { summary: "string" },
|
|
86
|
+
defaultValue: { summary: undefined }
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
Image: {
|
|
90
|
+
description: "React Image component to use for Card's image",
|
|
91
|
+
table: {
|
|
92
|
+
type: { summary: "React Component" },
|
|
93
|
+
defaultValue: { summary: undefined }
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
imgObjectFit: {
|
|
97
|
+
description: "CSS value for the object-fit property",
|
|
98
|
+
table: {
|
|
99
|
+
type: { summary: "string" },
|
|
100
|
+
defaultValue: { summary: "none" }
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
imgAltText: {
|
|
104
|
+
description: "Alt text to include with image",
|
|
105
|
+
table: {
|
|
106
|
+
type: { summary: "string" },
|
|
107
|
+
defaultValue: { summary: undefined }
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
padding: {
|
|
111
|
+
descripton: "Card's inner padding value",
|
|
112
|
+
table: {
|
|
113
|
+
type: { summary: "string" },
|
|
114
|
+
defaultValue: { summary: "24px" }
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
textAs: {
|
|
118
|
+
description:
|
|
119
|
+
"The HTML element to use for the Card's <Paragraph /> Component. This may need to be something other than 'p' when text is being rendered as children.",
|
|
120
|
+
table: {
|
|
121
|
+
type: { summary: "string" },
|
|
122
|
+
defaultValue: { summary: "p" }
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
text: {
|
|
126
|
+
description: "Body text of the card",
|
|
127
|
+
table: {
|
|
128
|
+
type: { summary: "string" },
|
|
129
|
+
defaultValue: { summary: undefined }
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
titleText: {
|
|
133
|
+
description: "Text for the title of the card",
|
|
134
|
+
table: {
|
|
135
|
+
type: { summary: "string" },
|
|
136
|
+
defaultValue: { summary: undefined }
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
titleAs: {
|
|
140
|
+
description: "The HTML element to use for the Card's title",
|
|
141
|
+
table: {
|
|
142
|
+
type: { summary: "string" },
|
|
143
|
+
defaultValue: { summary: "h2" }
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
titleVariant: {
|
|
147
|
+
description:
|
|
148
|
+
"Variant for the <Title /> component used in the Card's title text",
|
|
149
|
+
table: {
|
|
150
|
+
type: { summary: "string" },
|
|
151
|
+
defaultValue: { summary: "small" }
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
width: {
|
|
155
|
+
description: "The width of the Card in px",
|
|
156
|
+
table: {
|
|
157
|
+
type: { summary: "string" },
|
|
158
|
+
defaultValue: { summary: "276px" }
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
extraStyles: {
|
|
162
|
+
description: "Supplemental CSS",
|
|
163
|
+
table: {
|
|
164
|
+
type: { summary: "string" },
|
|
165
|
+
defaultValue: { summary: undefined }
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
children: {
|
|
169
|
+
description:
|
|
170
|
+
"Custom react components to display below the Card's text like buttons, links, or tags",
|
|
171
|
+
table: {
|
|
172
|
+
type: { summary: "React Component" },
|
|
173
|
+
defaultValue: { summary: undefined }
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
onQuitClick: {
|
|
177
|
+
description:
|
|
178
|
+
"Function called when the quit/dismiss card button is used. The consuming application will handle the render logic based on this.",
|
|
179
|
+
control: { type: "object" },
|
|
180
|
+
table: {
|
|
181
|
+
type: { summary: "function" },
|
|
182
|
+
defaultValue: { summary: noop }
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
showQuitLink: {
|
|
186
|
+
description: "Whether or not the Card is dismissable",
|
|
187
|
+
table: {
|
|
188
|
+
type: { summary: "boolean" },
|
|
189
|
+
defaultValue: { summary: false }
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
export default meta;
|
|
196
|
+
|
|
197
|
+
export const BasicCard = {
|
|
198
|
+
args: {
|
|
199
|
+
titleText: "Pay Dog Registration Fee",
|
|
200
|
+
text:
|
|
201
|
+
"Cityville requires new dog owners to register their pet with Cityville Animal Control. The fee for a new dog is $150, payable by credit or debit card.",
|
|
202
|
+
extraStyles: `& { max-width: 450px }; & > div > div > div { flex-direction: column; margin: 0;};`
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
export const BasicCardWithChildren = {
|
|
207
|
+
args: {
|
|
208
|
+
titleText: "Pay Dog Registration Fee",
|
|
209
|
+
text:
|
|
210
|
+
"Cityville requires new dog owners to register their pet with Cityville Animal Control. The fee for a new dog is $150, payable by credit or debit card.",
|
|
211
|
+
children: (
|
|
212
|
+
<Box
|
|
213
|
+
padding="16px 24px 16px 16px"
|
|
214
|
+
border={`1px solid ${MANATEE_GREY}`}
|
|
215
|
+
borderWidthOverride="1px 0 0 0"
|
|
216
|
+
>
|
|
217
|
+
<Cluster justify="space-between" align="center">
|
|
218
|
+
<ButtonWithAction text="Register" variant="secondary" />
|
|
219
|
+
<Badge variant="info" label="Animal Control" id="basic-card-badge" />
|
|
220
|
+
</Cluster>
|
|
221
|
+
</Box>
|
|
222
|
+
),
|
|
223
|
+
extraStyles: `& { max-width: 450px }; & > div > div > div { flex-direction: column; margin: 0;}; #basic-card-badge { align-self: unset; }`
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
export const BasicImageCard = {
|
|
228
|
+
args: {
|
|
229
|
+
headerText: "Join Cityville Wallet",
|
|
230
|
+
titleText: "Sign up for Cityville Wallet Today!",
|
|
231
|
+
text:
|
|
232
|
+
"Cityville Wallet makes it convenient to save your payment methods, billing addresses, and contact information. Use Cityville Wallet to enable one-click payment of all of your accounts today!",
|
|
233
|
+
Image: () => <WalletBannerIcon />,
|
|
234
|
+
imgAltText: "Cityville Wallet icon",
|
|
235
|
+
padding: "16px",
|
|
236
|
+
width: "800px",
|
|
237
|
+
extraStyles: `& div { margin: 0;}; & { max-width: 800px; }`
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
export const ImageCard = {
|
|
242
|
+
args: {
|
|
243
|
+
headerText: "Purchase Transit Card",
|
|
244
|
+
imgSrc:
|
|
245
|
+
"https://upload.wikimedia.org/wikipedia/commons/thumb/a/ad/Chicago_Transit_Authority_Logo.svg/300px-Chicago_Transit_Authority_Logo.svg.png",
|
|
246
|
+
imgObjectFit: "contain",
|
|
247
|
+
imgAltText: "Chicago Transit Authority Portal",
|
|
248
|
+
padding: "16px",
|
|
249
|
+
children: (
|
|
250
|
+
<Box
|
|
251
|
+
padding="16px 24px 16px 16px"
|
|
252
|
+
border={`1px solid ${MANATEE_GREY}`}
|
|
253
|
+
borderWidthOverride="1px 0 0 0"
|
|
254
|
+
>
|
|
255
|
+
<Cluster justify="space-between" align="center">
|
|
256
|
+
<ButtonWithAction text="Buy Card" variant="secondary" />
|
|
257
|
+
<Badge id="image-card-badge" variant="info" label="Transportation" />
|
|
258
|
+
</Cluster>
|
|
259
|
+
</Box>
|
|
260
|
+
),
|
|
261
|
+
width: "375px",
|
|
262
|
+
extraStyles: `& { max-width: 375px }; & > div > div > div { flex-direction: column; margin: 0;}; #image-card-badge { align-self: unset; }`
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
const cardExpireMonth = new Date().getMonth() + 2;
|
|
267
|
+
const cardExpireYear = new Date().getFullYear();
|
|
268
|
+
const formattedMonth = cardExpireMonth === 13 ? 1 : cardExpireMonth;
|
|
269
|
+
const formattedYear =
|
|
270
|
+
cardExpireMonth === 13 ? cardExpireYear + 1 : cardExpireYear;
|
|
271
|
+
|
|
272
|
+
export const CustomContentCard = {
|
|
273
|
+
args: {
|
|
274
|
+
headerText: undefined,
|
|
275
|
+
children: (
|
|
276
|
+
<Box padding="0">
|
|
277
|
+
<Stack childGap="0">
|
|
278
|
+
<Box
|
|
279
|
+
padding="1rem"
|
|
280
|
+
border={`1px solid ${MANATEE_GREY}`}
|
|
281
|
+
borderWidthOverride="0 0 1px 0"
|
|
282
|
+
>
|
|
283
|
+
<Cluster justify="flext-start" align="center" childGap="1rem">
|
|
284
|
+
<Badge
|
|
285
|
+
variant="success"
|
|
286
|
+
label="Autopay On"
|
|
287
|
+
Icon={() => <AutopayOnIcon />}
|
|
288
|
+
/>
|
|
289
|
+
<Badge variant="warn" label="Expiring Soon" />
|
|
290
|
+
</Cluster>
|
|
291
|
+
</Box>
|
|
292
|
+
<Box
|
|
293
|
+
padding="1rem"
|
|
294
|
+
border={`1px solid ${MANATEE_GREY}`}
|
|
295
|
+
borderWidthOverride="0 0 1px 0"
|
|
296
|
+
>
|
|
297
|
+
<Stack childGap="1rem">
|
|
298
|
+
<Detail as="h3" weight="600">
|
|
299
|
+
Payment Method:
|
|
300
|
+
</Detail>
|
|
301
|
+
<FormattedCreditCard
|
|
302
|
+
expireDate={`${formattedMonth}/${formattedYear}`}
|
|
303
|
+
expirationStatus="EXPIRING SOON"
|
|
304
|
+
lastFour="9872"
|
|
305
|
+
/>
|
|
306
|
+
</Stack>
|
|
307
|
+
</Box>
|
|
308
|
+
<Box padding="1rem">
|
|
309
|
+
<Stack childGap="1rem">
|
|
310
|
+
<Detail as="h3" weight="600">
|
|
311
|
+
Billing Address:
|
|
312
|
+
</Detail>
|
|
313
|
+
<FormattedAddress
|
|
314
|
+
street1="1600 Pensylvania Avenue NW"
|
|
315
|
+
street2="Floor 2"
|
|
316
|
+
city="Washington"
|
|
317
|
+
stateProvince="D.C."
|
|
318
|
+
zip="20500"
|
|
319
|
+
/>
|
|
320
|
+
</Stack>
|
|
321
|
+
</Box>
|
|
322
|
+
</Stack>
|
|
323
|
+
</Box>
|
|
324
|
+
)
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
export const DismissableCard = {
|
|
329
|
+
args: {
|
|
330
|
+
children: (
|
|
331
|
+
<Box padding="0 24px 24px">
|
|
332
|
+
<ButtonWithLink
|
|
333
|
+
extraStyles="border-radius: 4px; margin: 0; flex-basis: 100%; flex-grow: 1;"
|
|
334
|
+
url="your-destination-page"
|
|
335
|
+
text="Start here by searching for your ambulance bill"
|
|
336
|
+
newTab={true}
|
|
337
|
+
/>
|
|
338
|
+
</Box>
|
|
339
|
+
),
|
|
340
|
+
hasContentBackgroundColor: true,
|
|
341
|
+
headerText: undefined,
|
|
342
|
+
showQuitLink: true,
|
|
343
|
+
titleAs: "h2",
|
|
344
|
+
titleText: "Looking for your ambulance bill?",
|
|
345
|
+
text: (
|
|
346
|
+
<>
|
|
347
|
+
<ol style={{ margin: 0, paddingLeft: 24 }}>
|
|
348
|
+
<li>Click the button below</li>
|
|
349
|
+
<li>
|
|
350
|
+
Search using your ambulance run number and click “Link Account”
|
|
351
|
+
</li>
|
|
352
|
+
<li>
|
|
353
|
+
Your ambulance bill will be displayed on your Active Accounts page
|
|
354
|
+
</li>
|
|
355
|
+
</ol>
|
|
356
|
+
</>
|
|
357
|
+
),
|
|
358
|
+
textAs: "div"
|
|
359
|
+
}
|
|
360
|
+
};
|
|
@@ -5,9 +5,11 @@ const imageBackgroundColor = INFO_BLUE;
|
|
|
5
5
|
|
|
6
6
|
const headerBackgroundColor = STORM_GREY;
|
|
7
7
|
const headerColor = WHITE;
|
|
8
|
+
const contentBackgroundColor = INFO_BLUE;
|
|
8
9
|
|
|
9
10
|
export const fallbackValues = {
|
|
10
11
|
backgroundColor,
|
|
12
|
+
contentBackgroundColor,
|
|
11
13
|
imageBackgroundColor,
|
|
12
14
|
headerBackgroundColor,
|
|
13
15
|
headerColor
|
|
@@ -10,10 +10,16 @@ import Cover from "../layouts/Cover";
|
|
|
10
10
|
import Paragraph from "../paragraph";
|
|
11
11
|
import Stack from "../layouts/Stack";
|
|
12
12
|
import Title from "../title";
|
|
13
|
+
import IconQuitLarge from "../../atoms/icons/IconQuitLarge";
|
|
14
|
+
import { Cluster } from "../layouts";
|
|
13
15
|
|
|
14
16
|
export const CardText = ({
|
|
17
|
+
showQuitLink,
|
|
18
|
+
onQuitClick,
|
|
19
|
+
titleAs,
|
|
15
20
|
padding,
|
|
16
21
|
text,
|
|
22
|
+
textAs = "p",
|
|
17
23
|
titleText,
|
|
18
24
|
titleVariant = "small",
|
|
19
25
|
themeValues
|
|
@@ -22,17 +28,39 @@ export const CardText = ({
|
|
|
22
28
|
<Box padding={padding}>
|
|
23
29
|
<Cover>
|
|
24
30
|
<Stack>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
<Cluster
|
|
32
|
+
justify="space-between"
|
|
33
|
+
align="center"
|
|
34
|
+
overflow={true}
|
|
35
|
+
nowrap
|
|
36
|
+
>
|
|
37
|
+
{titleText && (
|
|
38
|
+
<Title
|
|
39
|
+
as={titleAs}
|
|
40
|
+
variant={titleVariant}
|
|
41
|
+
color={themeValues.titleColor}
|
|
42
|
+
weight={themeValues.titleWeight}
|
|
43
|
+
>
|
|
44
|
+
{titleText}
|
|
45
|
+
</Title>
|
|
46
|
+
)}
|
|
47
|
+
{showQuitLink && (
|
|
48
|
+
<Box
|
|
49
|
+
padding="0"
|
|
50
|
+
onClick={onQuitClick}
|
|
51
|
+
onKeyDown={e => e.key === "Enter" && onQuitClick()}
|
|
52
|
+
role="button"
|
|
53
|
+
tabIndex={0}
|
|
54
|
+
aria-label={`Close Card: ${titleText}`}
|
|
55
|
+
extraStyles="cursor: pointer;"
|
|
56
|
+
>
|
|
57
|
+
<IconQuitLarge />
|
|
58
|
+
</Box>
|
|
59
|
+
)}
|
|
60
|
+
</Cluster>
|
|
61
|
+
<Paragraph as={textAs} color={themeValues.textColor}>
|
|
62
|
+
{text}
|
|
63
|
+
</Paragraph>
|
|
36
64
|
</Stack>
|
|
37
65
|
</Cover>
|
|
38
66
|
</Box>
|
|
@@ -2,8 +2,10 @@ import React from "react";
|
|
|
2
2
|
import Expand from "../../../util/expand";
|
|
3
3
|
|
|
4
4
|
export interface CardProps {
|
|
5
|
-
text?: string;
|
|
5
|
+
text?: string | React.ReactNode;
|
|
6
|
+
textAs?: string;
|
|
6
7
|
titleText?: string;
|
|
8
|
+
titleAs?: string;
|
|
7
9
|
titleVariant?: string;
|
|
8
10
|
extraStyles?: string;
|
|
9
11
|
imgSrc?: string;
|
|
@@ -21,12 +23,17 @@ export interface CardProps {
|
|
|
21
23
|
| "revert"
|
|
22
24
|
| "revert-layer"
|
|
23
25
|
| "unset";
|
|
26
|
+
hasContentBackgroundColor?: string;
|
|
24
27
|
headerAs?: string;
|
|
25
28
|
headerText?: string;
|
|
26
29
|
headerVariant?: string;
|
|
27
30
|
borderRadius?: string;
|
|
28
31
|
width?: string;
|
|
29
32
|
padding?: string;
|
|
33
|
+
showQuitLink?: boolean;
|
|
34
|
+
onQuitClick?: (
|
|
35
|
+
event: React.MouseEvent<HTMLElement> | React.TouchEvent<HTMLElement>
|
|
36
|
+
) => void;
|
|
30
37
|
}
|
|
31
38
|
|
|
32
39
|
export const Card: React.FC<Expand<CardProps> &
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import VisaSmallIcon from "../icons/VisaSmallIcon";
|
|
3
|
+
import AmExSmallIcon from "../icons/AmExSmallIcon";
|
|
4
|
+
import DiscoverSmallIcon from "../icons/DiscoverSmallIcon";
|
|
5
|
+
import MasterCardSmallIcon from "../icons/MasterCardSmallIcon";
|
|
6
|
+
import GenericSmallIcon from "../icons/GenericSmallIcon";
|
|
7
|
+
import VisaLargeIcon from "../icons/VisaLargeIcon";
|
|
8
|
+
import AmExLargeIcon from "../icons/AmExLargeIcon";
|
|
9
|
+
import DiscoverLargeIcon from "../icons/DiscoverLargeIcon";
|
|
10
|
+
import MasterCardLargeIcon from "../icons/MasterCardLargeIcon";
|
|
11
|
+
import GenericCardLarge from "../icons/GenericCardLarge";
|
|
12
|
+
|
|
13
|
+
const cardBrands = {
|
|
14
|
+
visa: { label: "Visa", small: VisaSmallIcon, large: VisaLargeIcon },
|
|
15
|
+
master_card: {
|
|
16
|
+
label: "Mastercard",
|
|
17
|
+
small: MasterCardSmallIcon,
|
|
18
|
+
large: MasterCardLargeIcon
|
|
19
|
+
},
|
|
20
|
+
discover: {
|
|
21
|
+
label: "Discover",
|
|
22
|
+
small: DiscoverSmallIcon,
|
|
23
|
+
large: DiscoverLargeIcon
|
|
24
|
+
},
|
|
25
|
+
amex: {
|
|
26
|
+
label: "American Express",
|
|
27
|
+
small: AmExSmallIcon,
|
|
28
|
+
large: AmExLargeIcon
|
|
29
|
+
},
|
|
30
|
+
default: {
|
|
31
|
+
label: "Credit card",
|
|
32
|
+
small: GenericSmallIcon,
|
|
33
|
+
large: GenericCardLarge
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const normalizeType = type => {
|
|
38
|
+
if (!type) return undefined;
|
|
39
|
+
const lower = type.toLowerCase();
|
|
40
|
+
if (lower === "mastercard") return "master_card";
|
|
41
|
+
return lower;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const CardType = ({ type, size = "small" }) => {
|
|
45
|
+
const normalizedType = normalizeType(type);
|
|
46
|
+
const { label, [size]: IconComponent } =
|
|
47
|
+
cardBrands[normalizedType] || cardBrands.default;
|
|
48
|
+
return (
|
|
49
|
+
<span>
|
|
50
|
+
<IconComponent />
|
|
51
|
+
</span>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default CardType;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import CardType from "./CardType";
|
|
3
|
+
import { Box, Stack, Cluster } from "../layouts";
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Atoms/CardType",
|
|
7
|
+
component: CardType,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: "centered"
|
|
10
|
+
},
|
|
11
|
+
tags: ["!autodocs"],
|
|
12
|
+
args: {
|
|
13
|
+
type: "visa",
|
|
14
|
+
size: "small"
|
|
15
|
+
},
|
|
16
|
+
argTypes: {
|
|
17
|
+
type: {
|
|
18
|
+
description: "The card network type",
|
|
19
|
+
control: "select",
|
|
20
|
+
options: ["visa", "master_card", "discover", "amex", "unknown"],
|
|
21
|
+
table: {
|
|
22
|
+
type: { summary: "string" },
|
|
23
|
+
defaultValue: { summary: undefined }
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
size: {
|
|
27
|
+
description: "The size of the card icon",
|
|
28
|
+
control: "radio",
|
|
29
|
+
options: ["small", "large"],
|
|
30
|
+
table: {
|
|
31
|
+
type: { summary: "string" },
|
|
32
|
+
defaultValue: { summary: "small" }
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default meta;
|
|
39
|
+
|
|
40
|
+
const Label = ({ children }) => (
|
|
41
|
+
<span style={{ fontFamily: "sans-serif", fontSize: "0.875rem" }}>
|
|
42
|
+
{children}
|
|
43
|
+
</span>
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
export const AllCardTypes = {
|
|
47
|
+
render: () => {
|
|
48
|
+
const types = ["visa", "master_card", "discover", "amex"];
|
|
49
|
+
return (
|
|
50
|
+
<Box padding="1rem">
|
|
51
|
+
<Stack childGap="2rem">
|
|
52
|
+
<Label>Small</Label>
|
|
53
|
+
<Cluster justify="flex-start" align="center" childGap="1.5rem">
|
|
54
|
+
{types.map(type => (
|
|
55
|
+
<Stack key={type} childGap="0.5rem" align="center">
|
|
56
|
+
<CardType type={type} size="small" />
|
|
57
|
+
<Label>{type}</Label>
|
|
58
|
+
</Stack>
|
|
59
|
+
))}
|
|
60
|
+
<Stack childGap="0.5rem" align="center">
|
|
61
|
+
<CardType size="small" />
|
|
62
|
+
<Label>generic (fallback)</Label>
|
|
63
|
+
</Stack>
|
|
64
|
+
</Cluster>
|
|
65
|
+
<Label>Large</Label>
|
|
66
|
+
<Cluster justify="flex-start" align="center" childGap="1.5rem">
|
|
67
|
+
{types.map(type => (
|
|
68
|
+
<Stack key={type} childGap="0.5rem" align="center">
|
|
69
|
+
<CardType type={type} size="large" />
|
|
70
|
+
<Label>{type}</Label>
|
|
71
|
+
</Stack>
|
|
72
|
+
))}
|
|
73
|
+
<Stack childGap="0.5rem" align="center">
|
|
74
|
+
<CardType size="large" />
|
|
75
|
+
<Label>generic (fallback)</Label>
|
|
76
|
+
</Stack>
|
|
77
|
+
</Cluster>
|
|
78
|
+
</Stack>
|
|
79
|
+
</Box>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const Interactive = {
|
|
85
|
+
render: args => <CardType {...args} />
|
|
86
|
+
};
|