@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,115 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { themeComponent } from "../../../util/themeUtils";
|
|
3
|
+
import { fallbackValues } from "./RegistrationBanner.theme";
|
|
4
|
+
import * as Styled from "./RegistrationBanner.styled";
|
|
5
|
+
import ArrowRightIcon from "../../atoms/icons/ArrowRightIcon";
|
|
6
|
+
import { Box, Cluster } from "../../atoms/layouts";
|
|
7
|
+
import Text from "../../atoms/text";
|
|
8
|
+
import { ThemeContext } from "styled-components";
|
|
9
|
+
import {
|
|
10
|
+
FONT_SIZE,
|
|
11
|
+
FONT_WEIGHT_SEMIBOLD
|
|
12
|
+
} from "../../../constants/style_constants";
|
|
13
|
+
import withWindowSize from "../../withWindowSize";
|
|
14
|
+
import Heading from "../../atoms/heading";
|
|
15
|
+
|
|
16
|
+
const RegistrationBanner = ({
|
|
17
|
+
clientName,
|
|
18
|
+
extraStyles,
|
|
19
|
+
loginLink = "/login",
|
|
20
|
+
registrationLink = "/registration",
|
|
21
|
+
themeValues,
|
|
22
|
+
titleAs,
|
|
23
|
+
titleVariant
|
|
24
|
+
}) => {
|
|
25
|
+
const themeContext = useContext(ThemeContext);
|
|
26
|
+
const { isMobile } = themeContext;
|
|
27
|
+
return (
|
|
28
|
+
<Styled.BannerContainer
|
|
29
|
+
extraStyles={extraStyles}
|
|
30
|
+
themeValues={themeValues}
|
|
31
|
+
isMobile={isMobile}
|
|
32
|
+
aria-label="Registration Banner"
|
|
33
|
+
justify="center"
|
|
34
|
+
>
|
|
35
|
+
<Styled.ContentContainer
|
|
36
|
+
align="center"
|
|
37
|
+
justify="space-between"
|
|
38
|
+
overflow="visible"
|
|
39
|
+
isMobile={isMobile}
|
|
40
|
+
nowrap
|
|
41
|
+
>
|
|
42
|
+
<Box padding="0" textAlign="left">
|
|
43
|
+
<Heading
|
|
44
|
+
as={titleAs}
|
|
45
|
+
color={themeValues.primaryColor}
|
|
46
|
+
fontSize={isMobile ? FONT_SIZE.XL : "1.5rem"}
|
|
47
|
+
variant={titleVariant}
|
|
48
|
+
weight={FONT_WEIGHT_SEMIBOLD}
|
|
49
|
+
>
|
|
50
|
+
Register for a {clientName} Wallet
|
|
51
|
+
</Heading>
|
|
52
|
+
<Text
|
|
53
|
+
extraStyles={`
|
|
54
|
+
display: block;
|
|
55
|
+
padding: ${isMobile ? ".125rem 0 1rem" : "0"}
|
|
56
|
+
`}
|
|
57
|
+
fontSize={isMobile ? FONT_SIZE.MD : FONT_SIZE.LG}
|
|
58
|
+
color={themeValues.secondaryColor}
|
|
59
|
+
>
|
|
60
|
+
Save payment methods and billing information for fast, easy, and
|
|
61
|
+
safe payments with {clientName}
|
|
62
|
+
</Text>
|
|
63
|
+
</Box>
|
|
64
|
+
<Styled.ButtonContainer
|
|
65
|
+
justify="space-between"
|
|
66
|
+
fullHeight
|
|
67
|
+
childGap="0.5rem"
|
|
68
|
+
isMobile={isMobile}
|
|
69
|
+
>
|
|
70
|
+
<Styled.RegisterLink
|
|
71
|
+
variant="secondary"
|
|
72
|
+
color={themeValues.primaryColor}
|
|
73
|
+
contentOverride
|
|
74
|
+
fontWeight={FONT_WEIGHT_SEMIBOLD}
|
|
75
|
+
url={registrationLink}
|
|
76
|
+
>
|
|
77
|
+
<Cluster
|
|
78
|
+
justify="center"
|
|
79
|
+
align="center"
|
|
80
|
+
extraStyles="min-width: 100%"
|
|
81
|
+
>
|
|
82
|
+
<Text
|
|
83
|
+
extraStyles="margin-right: 0.5rem"
|
|
84
|
+
fontSize={isMobile ? FONT_SIZE.MD : FONT_SIZE.LG}
|
|
85
|
+
color={themeValues.primaryColor}
|
|
86
|
+
weight={FONT_WEIGHT_SEMIBOLD}
|
|
87
|
+
>
|
|
88
|
+
Register Now
|
|
89
|
+
</Text>
|
|
90
|
+
<ArrowRightIcon color={themeValues.primaryColor} />
|
|
91
|
+
</Cluster>
|
|
92
|
+
</Styled.RegisterLink>
|
|
93
|
+
<Styled.LoginLink
|
|
94
|
+
text="Log In"
|
|
95
|
+
variant="secondary"
|
|
96
|
+
contentOverride
|
|
97
|
+
url={loginLink}
|
|
98
|
+
>
|
|
99
|
+
<Text
|
|
100
|
+
fontSize={isMobile ? FONT_SIZE.SM : FONT_SIZE.MD}
|
|
101
|
+
color={themeValues.primaryColor}
|
|
102
|
+
weight={FONT_WEIGHT_SEMIBOLD}
|
|
103
|
+
>
|
|
104
|
+
or Log In
|
|
105
|
+
</Text>
|
|
106
|
+
</Styled.LoginLink>
|
|
107
|
+
</Styled.ButtonContainer>
|
|
108
|
+
</Styled.ContentContainer>
|
|
109
|
+
</Styled.BannerContainer>
|
|
110
|
+
);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export default withWindowSize(
|
|
114
|
+
themeComponent(RegistrationBanner, "RegistrationBanner", fallbackValues)
|
|
115
|
+
);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as RegistrationBannerStories from './RegistrationBanner.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={RegistrationBannerStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
Originally used in the PayDot project, `RegistrationBanner` displays a promotional banner for user registration.
|
|
10
|
+
|
|
11
|
+
- Title and Description: A `clientName` prop is passed, which displays within the title and description text.
|
|
12
|
+
- Responsive: Adjusts its layout and font sizes based on whether the user is on a mobile device, using the `isMobile` value from the theme context.
|
|
13
|
+
- Action Links: Provides two main action links - one for registration ("Register Now") and another for logging in ("Log In").
|
|
14
|
+
|
|
15
|
+
<Controls />
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import RegistrationBanner from "./RegistrationBanner";
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Molecules/RegistrationBanner",
|
|
6
|
+
component: RegistrationBanner,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: "centered"
|
|
9
|
+
},
|
|
10
|
+
tags: ["!autodocs"],
|
|
11
|
+
args: {
|
|
12
|
+
clientName: "Cityville",
|
|
13
|
+
extraStyles: "",
|
|
14
|
+
titleAs: "h1",
|
|
15
|
+
titleVariant: "h1",
|
|
16
|
+
registrationLink: "/registration",
|
|
17
|
+
loginLink: "/login"
|
|
18
|
+
},
|
|
19
|
+
argTypes: {
|
|
20
|
+
clientName: {
|
|
21
|
+
description:
|
|
22
|
+
"Name of the client using the RegistrationBanner (e.g. Cityville). This will be displayed in the title and description of the banner.",
|
|
23
|
+
table: {
|
|
24
|
+
type: { summary: "string" },
|
|
25
|
+
defaultValue: {
|
|
26
|
+
summary: "Cityville"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
extraStyles: {
|
|
31
|
+
description: "Additional styles for the RegistrationBanner",
|
|
32
|
+
table: {
|
|
33
|
+
type: { summary: "string" },
|
|
34
|
+
defaultValue: { summary: "" }
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
titleAs: {
|
|
38
|
+
description: "HTML tag to use for the title",
|
|
39
|
+
table: {
|
|
40
|
+
type: { summary: "string" },
|
|
41
|
+
defaultValue: { summary: "h1" }
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
titleVariant: {
|
|
45
|
+
description: "Variant of the title",
|
|
46
|
+
table: {
|
|
47
|
+
type: { summary: "string" },
|
|
48
|
+
defaultValue: { summary: "h1" }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
registrationLink: {
|
|
52
|
+
description: "URL for the registration link",
|
|
53
|
+
table: {
|
|
54
|
+
type: { summary: "string" },
|
|
55
|
+
defaultValue: { summary: "/registration" }
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
loginLink: {
|
|
59
|
+
description: "URL for the login link",
|
|
60
|
+
table: {
|
|
61
|
+
type: { summary: "string" },
|
|
62
|
+
defaultValue: { summary: "/login" }
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export default meta;
|
|
69
|
+
|
|
70
|
+
export const StandardRegistrationBanner = {
|
|
71
|
+
args: {},
|
|
72
|
+
parameters: {
|
|
73
|
+
viewport: {
|
|
74
|
+
defaultViewport: "responsive"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
render: args => {
|
|
78
|
+
return <RegistrationBanner {...args} key="registration-banner-standard" />;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { Box, Cluster, Stack } from "../../atoms/layouts";
|
|
3
|
+
import ButtonWithLink from "../../atoms/button-with-link/ButtonWithLink";
|
|
4
|
+
import { adjustHexColor } from "../../../util/general";
|
|
5
|
+
|
|
6
|
+
export const BannerContainer = styled(Cluster)`
|
|
7
|
+
background: ${({ themeValues }) =>
|
|
8
|
+
adjustHexColor(themeValues.primaryColor, 90, "lighten")};
|
|
9
|
+
padding: 2rem;
|
|
10
|
+
`;
|
|
11
|
+
|
|
12
|
+
export const ContentContainer = styled(Cluster)`
|
|
13
|
+
padding: 0;
|
|
14
|
+
width: ${({ isMobile }) => (isMobile ? "100%" : " 1224px")};
|
|
15
|
+
> div {
|
|
16
|
+
flex-direction: ${({ isMobile }) => (isMobile ? "column" : "row")};
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
export const ButtonContainer = styled(Stack)`
|
|
21
|
+
align-items: center;
|
|
22
|
+
width: ${({ isMobile }) => (isMobile ? "100%" : "222px")};
|
|
23
|
+
padding-left: ${({ isMobile }) => (isMobile ? "0" : "2rem")};
|
|
24
|
+
> * {
|
|
25
|
+
width: inherit;
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
export const RegisterLink = styled(ButtonWithLink)`
|
|
30
|
+
border-radius: 100px;
|
|
31
|
+
margin: 0;
|
|
32
|
+
width: 100%;
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
export const LoginLink = styled(ButtonWithLink)`
|
|
36
|
+
border-radius: 100px;
|
|
37
|
+
padding: 0;
|
|
38
|
+
margin: 0;
|
|
39
|
+
width: 100%;
|
|
40
|
+
min-height: 2rem;
|
|
41
|
+
margin-top: 0px;
|
|
42
|
+
border: none;
|
|
43
|
+
&:hover {
|
|
44
|
+
text-decoration: none;
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Expand from "../../../util/expand";
|
|
3
|
+
|
|
4
|
+
export interface RegistrationBannerProps {
|
|
5
|
+
clientName?: string;
|
|
6
|
+
extraStyles?: string;
|
|
7
|
+
loginLink?: string;
|
|
8
|
+
registrationLink?: string;
|
|
9
|
+
themeValues?: any;
|
|
10
|
+
titleAs?: string;
|
|
11
|
+
titleVariant?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const RegistrationBanner: React.FC<Expand<RegistrationBannerProps> &
|
|
15
|
+
React.HTMLAttributes<HTMLElement>>;
|
|
@@ -36,7 +36,8 @@ const RegistrationForm = ({
|
|
|
36
36
|
};
|
|
37
37
|
const emailErrorMessages = {
|
|
38
38
|
[required.error]: "Email is required",
|
|
39
|
-
[isProbablyEmail.error]:
|
|
39
|
+
[isProbablyEmail.error]:
|
|
40
|
+
"Please enter a valid email address in the format user@example.com"
|
|
40
41
|
};
|
|
41
42
|
const passwordErrorMessages = {
|
|
42
43
|
[required.error]: "Password is required",
|
|
@@ -16,11 +16,11 @@ import {
|
|
|
16
16
|
import { themeComponent } from "../../../util/themeUtils";
|
|
17
17
|
import { fallbackValues } from "./TabSidebar.theme";
|
|
18
18
|
|
|
19
|
-
const TabSidebar = ({ links, isMobile, themeValues }) => (
|
|
19
|
+
const TabSidebar = ({ links, isMobile, themeValues, minHeight = "100%" }) => (
|
|
20
20
|
<Box
|
|
21
21
|
padding="0"
|
|
22
22
|
background={COOL_GREY_05}
|
|
23
|
-
minHeight=
|
|
23
|
+
minHeight={minHeight}
|
|
24
24
|
role="region"
|
|
25
25
|
aria-label="Profile tabs"
|
|
26
26
|
boxShadow={isMobile && `inset 0px -1px 0px 0px rgb(202, 206, 216)`}
|
|
@@ -35,7 +35,9 @@ const TabSidebar = ({ links, isMobile, themeValues }) => (
|
|
|
35
35
|
<InternalLink
|
|
36
36
|
to={route}
|
|
37
37
|
key={`${route}-${index}`}
|
|
38
|
-
|
|
38
|
+
isUnderlined={false}
|
|
39
|
+
hoverUnderline={false}
|
|
40
|
+
extraStyles={`
|
|
39
41
|
&:hover {
|
|
40
42
|
${
|
|
41
43
|
active
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, Fragment } from "react";
|
|
1
|
+
import React, { useState, Fragment, useEffect } from "react";
|
|
2
2
|
import { Stack, Box, Cluster } from "../../atoms/layouts";
|
|
3
3
|
import { themeComponent } from "../../../util/themeUtils";
|
|
4
4
|
import { fallbackValues } from "./Tabs.theme";
|
|
@@ -8,9 +8,25 @@ const HORIZONTAL = "horizontal";
|
|
|
8
8
|
|
|
9
9
|
const Tabs = ({
|
|
10
10
|
tabsConfig,
|
|
11
|
-
tabsDisplayMode
|
|
11
|
+
tabsDisplayMode = HORIZONTAL,
|
|
12
|
+
tabsPadding = "0",
|
|
13
|
+
contentPadding = "0",
|
|
14
|
+
extraStyles = "",
|
|
15
|
+
...props
|
|
12
16
|
}) => {
|
|
13
|
-
const [activeTab, toggleActiveTab] = useState(
|
|
17
|
+
const [activeTab, toggleActiveTab] = useState(
|
|
18
|
+
tabsConfig.tabs[0]?.label || null
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
const currentTabExists = tabsConfig.tabs.some(
|
|
23
|
+
tab => tab.label === activeTab
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
if (!activeTab || !currentTabExists) {
|
|
27
|
+
toggleActiveTab(tabsConfig.tabs[0]?.label || null);
|
|
28
|
+
}
|
|
29
|
+
}, [tabsConfig, activeTab]);
|
|
14
30
|
|
|
15
31
|
const createTabs = (tabConfig, activeTab) => {
|
|
16
32
|
return tabConfig.tabs.map(tab => {
|
|
@@ -25,7 +41,7 @@ const Tabs = ({
|
|
|
25
41
|
});
|
|
26
42
|
};
|
|
27
43
|
|
|
28
|
-
const
|
|
44
|
+
const showHorizontal = (tabsConfig, activeTab) => {
|
|
29
45
|
return (
|
|
30
46
|
<Cluster justify={"space-around"}>
|
|
31
47
|
{createTabs(tabsConfig, activeTab)}
|
|
@@ -38,14 +54,14 @@ const Tabs = ({
|
|
|
38
54
|
};
|
|
39
55
|
|
|
40
56
|
return (
|
|
41
|
-
<Box className="tabs">
|
|
42
|
-
<Box className="tab-list">
|
|
57
|
+
<Box className="tabs" padding="0" extraStyles={extraStyles} {...props}>
|
|
58
|
+
<Box className="tab-list" padding={tabsPadding}>
|
|
43
59
|
{tabsDisplayMode == HORIZONTAL
|
|
44
|
-
?
|
|
60
|
+
? showHorizontal(tabsConfig, activeTab)
|
|
45
61
|
: showVertical(tabsConfig, activeTab)}
|
|
46
62
|
</Box>
|
|
47
|
-
<Box className="tab-content">
|
|
48
|
-
<Box>
|
|
63
|
+
<Box className="tab-content" padding={contentPadding}>
|
|
64
|
+
<Box padding="0">
|
|
49
65
|
{tabsConfig.tabs.map((tab, idx) => {
|
|
50
66
|
if (tab.label !== activeTab) return undefined;
|
|
51
67
|
return <Fragment key={idx}>{tab.content}</Fragment>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as TabsStories from './Tabs.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={TabsStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
Currently used in POS, the Tabs component is a small widget that takes a configuration object and creates a tabbable toggle between arbitrary pieces of content.
|
|
10
|
+
|
|
11
|
+
The example displays a form on one tab and basic text on the other, but there is no limit to the content that can be displayed inside of the tabs. Tabs can be stacked horizontally or vertically on top of the content.
|
|
12
|
+
|
|
13
|
+
<Controls />
|
|
14
|
+
|
|
15
|
+
<div style={{ marginBottom: "2em"}}>
|
|
16
|
+
<Story />
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Box, Center, Cover } from "../../atoms/layouts";
|
|
3
|
+
import Tabs from "./Tabs";
|
|
4
|
+
import { fn } from "@storybook/test";
|
|
5
|
+
import PaymentFormCard from "../payment-form-card";
|
|
6
|
+
import * as PaymentFormCardState from "../payment-form-card/PaymentFormCard.state";
|
|
7
|
+
import { connect, Provider } from "react-redux";
|
|
8
|
+
import { createStore } from "redux";
|
|
9
|
+
|
|
10
|
+
const store = createStore(
|
|
11
|
+
PaymentFormCardState.reducer,
|
|
12
|
+
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
const ConnectedPaymentFormCard = connect(
|
|
16
|
+
PaymentFormCardState.mapStateToProps,
|
|
17
|
+
PaymentFormCardState.mapDispatchToProps
|
|
18
|
+
)(PaymentFormCard);
|
|
19
|
+
|
|
20
|
+
const meta = {
|
|
21
|
+
title: "Molecules/Tabs",
|
|
22
|
+
component: Tabs,
|
|
23
|
+
parameters: {
|
|
24
|
+
layout: "centered"
|
|
25
|
+
},
|
|
26
|
+
tags: ["!autodocs"],
|
|
27
|
+
args: {
|
|
28
|
+
tabsConfig: undefined,
|
|
29
|
+
tabsDisplayMode: undefined
|
|
30
|
+
},
|
|
31
|
+
argTypes: {
|
|
32
|
+
tabsConfig: {
|
|
33
|
+
description:
|
|
34
|
+
"Object containing an array of tabs to show, along with their label, active state, and associated content",
|
|
35
|
+
table: {
|
|
36
|
+
type: { summary: "object" },
|
|
37
|
+
defaultValue: { summary: undefined }
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
tabsDisplayMode: {
|
|
41
|
+
description:
|
|
42
|
+
"Whether to display tabs in horizontal or vertical configuration. Use 'horizontal' for horitzontal config. All other values will result in vertical configuration.",
|
|
43
|
+
table: {
|
|
44
|
+
type: { summary: "string" },
|
|
45
|
+
defaultValue: { summary: undefined }
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
decorators: [
|
|
50
|
+
Story => (
|
|
51
|
+
<Provider store={store}>
|
|
52
|
+
<Story />
|
|
53
|
+
</Provider>
|
|
54
|
+
)
|
|
55
|
+
]
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export default meta;
|
|
59
|
+
|
|
60
|
+
export const HoriztonalTabs = {
|
|
61
|
+
args: {
|
|
62
|
+
tabsConfig: {
|
|
63
|
+
tabs: [
|
|
64
|
+
{
|
|
65
|
+
label: "Credit Card",
|
|
66
|
+
active: true,
|
|
67
|
+
content: (
|
|
68
|
+
<ConnectedPaymentFormCard
|
|
69
|
+
variant="checkout"
|
|
70
|
+
hideTitle
|
|
71
|
+
hideZipCode
|
|
72
|
+
fields={{
|
|
73
|
+
...PaymentFormCardState.mapStateToProps(store.getState())
|
|
74
|
+
}}
|
|
75
|
+
{...PaymentFormCardState.mapDispatchToProps(store.dispatch)}
|
|
76
|
+
fees={{
|
|
77
|
+
label: "Service Fee",
|
|
78
|
+
type: "FLAT",
|
|
79
|
+
value: 0
|
|
80
|
+
}}
|
|
81
|
+
showWalletCheckbox
|
|
82
|
+
saveToWallet={fn()}
|
|
83
|
+
walletCheckboxMarked
|
|
84
|
+
termsContent={"terms"}
|
|
85
|
+
termsTitle={"Terms and Conditions"}
|
|
86
|
+
/>
|
|
87
|
+
)
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
label: "ACH Payment",
|
|
91
|
+
active: true,
|
|
92
|
+
content: (
|
|
93
|
+
<Box minWidth="500px" minHeight="400px">
|
|
94
|
+
<Center>
|
|
95
|
+
<Cover singleChild>ACH Payment Form</Cover>
|
|
96
|
+
</Center>
|
|
97
|
+
</Box>
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
tabsDisplayMode: "horizontal"
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const VerticalTabs = {
|
|
107
|
+
args: {
|
|
108
|
+
tabsConfig: {
|
|
109
|
+
tabs: [
|
|
110
|
+
{
|
|
111
|
+
label: "Credit Card",
|
|
112
|
+
active: true,
|
|
113
|
+
content: (
|
|
114
|
+
<ConnectedPaymentFormCard
|
|
115
|
+
variant="checkout"
|
|
116
|
+
hideTitle
|
|
117
|
+
hideZipCode
|
|
118
|
+
fields={{
|
|
119
|
+
...PaymentFormCardState.mapStateToProps(store.getState())
|
|
120
|
+
}}
|
|
121
|
+
{...PaymentFormCardState.mapDispatchToProps(store.dispatch)}
|
|
122
|
+
fees={{
|
|
123
|
+
label: "Service Fee",
|
|
124
|
+
type: "FLAT",
|
|
125
|
+
value: 0
|
|
126
|
+
}}
|
|
127
|
+
showWalletCheckbox
|
|
128
|
+
saveToWallet={fn()}
|
|
129
|
+
walletCheckboxMarked
|
|
130
|
+
termsContent={"terms"}
|
|
131
|
+
termsTitle={"Terms and Conditions"}
|
|
132
|
+
/>
|
|
133
|
+
)
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
label: "ACH Payment",
|
|
137
|
+
active: true,
|
|
138
|
+
content: (
|
|
139
|
+
<Box minWidth="500px" minHeight="400px">
|
|
140
|
+
<Center>
|
|
141
|
+
<Cover singleChild>ACH Payment Form</Cover>
|
|
142
|
+
</Center>
|
|
143
|
+
</Box>
|
|
144
|
+
)
|
|
145
|
+
}
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Expand from "../../../util/expand";
|
|
3
|
+
|
|
4
|
+
export interface TabConfig {
|
|
5
|
+
label: string;
|
|
6
|
+
content: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface TabsConfigObject {
|
|
10
|
+
tabs: TabConfig[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface TabsProps {
|
|
14
|
+
tabsConfig: TabsConfigObject;
|
|
15
|
+
tabsDisplayMode?: "horizontal" | "vertical";
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export declare const Tabs: React.FC<Expand<TabsProps> &
|
|
19
|
+
React.HTMLAttributes<HTMLElement>>;
|
|
20
|
+
|
|
21
|
+
export default Tabs;
|
|
@@ -54,7 +54,7 @@ const TermsAndConditionsModal = ({
|
|
|
54
54
|
weight={themeValues.fontWeight}
|
|
55
55
|
hoverStyles={themeValues.modalLinkHoverFocus}
|
|
56
56
|
textDecoration={themeValues.modalLinkTextDecoration}
|
|
57
|
-
extraStyles={`display: inline-block; width: fit-content; cursor: pointer
|
|
57
|
+
extraStyles={`display: inline-block; width: fit-content; cursor: pointer; min-height: 24px; line-height: 24px;`}
|
|
58
58
|
role="button" // This should always be a "button" since it opens a modal
|
|
59
59
|
className="modal-trigger"
|
|
60
60
|
>
|