@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,217 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import CollapsibleSection from "./CollapsibleSection.js";
|
|
3
|
+
import { fn } from "@storybook/test";
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Molecules/CollapsibleSection",
|
|
7
|
+
component: CollapsibleSection,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: "centered"
|
|
10
|
+
},
|
|
11
|
+
tags: ["!autodocs"],
|
|
12
|
+
args: {
|
|
13
|
+
isOpen: true,
|
|
14
|
+
toggleSection: fn(),
|
|
15
|
+
themeValues: {},
|
|
16
|
+
isMobile: undefined,
|
|
17
|
+
supportsTouch: undefined,
|
|
18
|
+
title: "Example Title",
|
|
19
|
+
customPadding: undefined,
|
|
20
|
+
initiallyOpen: true,
|
|
21
|
+
openHeight: "auto",
|
|
22
|
+
children: <p>The children prop will populate this content.</p>,
|
|
23
|
+
customTitle: false,
|
|
24
|
+
stackTitle: false,
|
|
25
|
+
stackTitleContent: "StackTitleContent Prop Value",
|
|
26
|
+
sectionGap: "0.5rem",
|
|
27
|
+
name: "",
|
|
28
|
+
index: 1,
|
|
29
|
+
extraStyles: ""
|
|
30
|
+
},
|
|
31
|
+
argTypes: {
|
|
32
|
+
isOpen: {
|
|
33
|
+
description:
|
|
34
|
+
"Boolean indicating whether the section is expanded (true) or collapsed (false).",
|
|
35
|
+
control: { type: "boolean" },
|
|
36
|
+
table: {
|
|
37
|
+
type: { summary: "boolean" },
|
|
38
|
+
defaultValue: { summary: `undefined` }
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
toggleSection: {
|
|
42
|
+
description:
|
|
43
|
+
"Function that toggles the expanded versus collapsed state for a given 'CollapsibleSection'",
|
|
44
|
+
table: {
|
|
45
|
+
type: { summary: "object" },
|
|
46
|
+
defaultValue: { summary: `undefined` }
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
isMobile: {
|
|
50
|
+
description:
|
|
51
|
+
"Whether user is on a mobile device (typically screen size smaller than 768px)",
|
|
52
|
+
table: {
|
|
53
|
+
type: { summary: "boolean" },
|
|
54
|
+
defaultValue: { summary: `undefined` }
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
supportsTouch: {
|
|
58
|
+
description: "Whether a device supports touch events",
|
|
59
|
+
table: {
|
|
60
|
+
type: { summary: "boolean" },
|
|
61
|
+
defaultValue: { summary: `undefined` }
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
title: {
|
|
65
|
+
description:
|
|
66
|
+
"The title of the collapsible section, that, when clicked or tapped will toggle the component's expanded/collapsed state",
|
|
67
|
+
table: {
|
|
68
|
+
type: { summary: "string" },
|
|
69
|
+
defaultValue: { summary: `undefined` }
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
customPadding: {
|
|
73
|
+
description:
|
|
74
|
+
"The amount of padding to apply to the title prop's containing `Box` element",
|
|
75
|
+
table: {
|
|
76
|
+
type: { summary: "string" },
|
|
77
|
+
defaultValue: { summary: `undefined` }
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
initiallyOpen: {
|
|
81
|
+
description: "Whether the component should render itself open by default",
|
|
82
|
+
table: {
|
|
83
|
+
type: { summary: "boolean" },
|
|
84
|
+
defaultValue: { summary: true }
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
openHeight: {
|
|
88
|
+
description: "Sets the height of the component when it is expanded",
|
|
89
|
+
table: {
|
|
90
|
+
type: { summary: "string" },
|
|
91
|
+
defaultValue: { summary: "auto" }
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
children: {
|
|
95
|
+
description:
|
|
96
|
+
"Content that will show when the component is expanded and be hidden when the component is collapsed",
|
|
97
|
+
table: {
|
|
98
|
+
type: { summary: "object" },
|
|
99
|
+
defaultValue: { summary: `undefined` }
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
customTitle: {
|
|
103
|
+
description:
|
|
104
|
+
"Renders a differently styled title element when true, and is also used to help compute an appropriate label for the wrapper",
|
|
105
|
+
table: {
|
|
106
|
+
type: { summary: "boolean" },
|
|
107
|
+
defaultValue: { summary: false }
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
stackTitle: {
|
|
111
|
+
description:
|
|
112
|
+
"Whether or not to include an additional title (content provided by StackTitleContent prop) above the CollapsibleSection",
|
|
113
|
+
table: {
|
|
114
|
+
type: { summary: "boolean" },
|
|
115
|
+
defaultValue: { summary: false }
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
stackTitleContent: {
|
|
119
|
+
description:
|
|
120
|
+
"When stackTitle prop is true, this content is used for a header located _above_ the CollapsibleSection",
|
|
121
|
+
table: {
|
|
122
|
+
type: { summary: "string" },
|
|
123
|
+
defaultValue: { summary: `undefined` }
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
sectionGap: {
|
|
127
|
+
description:
|
|
128
|
+
"When the CollapsibleSection is open and not on a mobile screen, this prop determines the wrapping Stack component's 'childGap' prop value.",
|
|
129
|
+
table: {
|
|
130
|
+
type: { summary: "string" },
|
|
131
|
+
defaultValue: { summary: `undefined` }
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
name: {
|
|
135
|
+
description:
|
|
136
|
+
"When it's not empty, 'name' provides the label value for the Box instance with a role of 'heading.'",
|
|
137
|
+
table: {
|
|
138
|
+
type: { summary: "string" },
|
|
139
|
+
defaultValue: { summary: "" }
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
index: {
|
|
143
|
+
description:
|
|
144
|
+
"The index value of the current CollapsibleSection in a list of CollapsibleSections. It is used to create a unique ID string for each component.",
|
|
145
|
+
table: {
|
|
146
|
+
type: { summary: "number" },
|
|
147
|
+
defaultValue: { summary: 1 }
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
extraStyles: {
|
|
151
|
+
description:
|
|
152
|
+
"A string containing additional CSS to apply to the title's Box container (the one with role='button').",
|
|
153
|
+
table: {
|
|
154
|
+
type: { summary: "string" },
|
|
155
|
+
defaultValue: { summary: `undefined` }
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export default meta;
|
|
162
|
+
|
|
163
|
+
export const Basic = {
|
|
164
|
+
args: {
|
|
165
|
+
title: "Basic Title"
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export const ToggleSection = {
|
|
170
|
+
render: args => {
|
|
171
|
+
const [isOpen, setIsOpen] = useState(true);
|
|
172
|
+
return (
|
|
173
|
+
<CollapsibleSection
|
|
174
|
+
{...args}
|
|
175
|
+
title="ToggleSection Title"
|
|
176
|
+
isOpen={isOpen}
|
|
177
|
+
toggleSection={() => setIsOpen(!isOpen)}
|
|
178
|
+
/>
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
export const Mobile = {
|
|
184
|
+
args: {
|
|
185
|
+
title: "Mobile Title",
|
|
186
|
+
isMobile: true
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
export const CustomTitle = {
|
|
191
|
+
args: {
|
|
192
|
+
title: "Custom Title",
|
|
193
|
+
customTitle: true
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
export const CustomPadding = {
|
|
198
|
+
args: {
|
|
199
|
+
title: "CustomPadding Title",
|
|
200
|
+
customPadding: "3rem"
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
export const StackTitleContentAndStackTitle = {
|
|
205
|
+
args: {
|
|
206
|
+
title: "StackTitleContentAndStackTitle Title",
|
|
207
|
+
stackTitle: true,
|
|
208
|
+
stackTitleContent: <h1>Stack Title Content</h1>
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
export const SectionGap = {
|
|
213
|
+
args: {
|
|
214
|
+
title: "SectionGap Title",
|
|
215
|
+
sectionGap: "100px"
|
|
216
|
+
}
|
|
217
|
+
};
|
|
@@ -8,7 +8,7 @@ export interface CollapsibleSectionProps {
|
|
|
8
8
|
) => void;
|
|
9
9
|
isMobile?: boolean;
|
|
10
10
|
supportsTouch?: boolean;
|
|
11
|
-
title?: string;
|
|
11
|
+
title?: string | JSX.Element;
|
|
12
12
|
customPadding?: string;
|
|
13
13
|
initiallyOpen?: boolean;
|
|
14
14
|
openHeight?: string;
|
|
@@ -23,4 +23,4 @@ export interface CollapsibleSectionProps {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export const CollapsibleSection: React.FC<Expand<CollapsibleSectionProps> &
|
|
26
|
-
React.HTMLAttributes<HTMLElement>>;
|
|
26
|
+
Omit<React.HTMLAttributes<HTMLElement>, "title">>; // ommitting title prop to avoid conflicts with component's title prop
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import * as R from "ramda";
|
|
3
|
+
import { Box, Stack } from "../../atoms/layouts";
|
|
4
|
+
import { ExternalLink, InternalLink } from "../../atoms";
|
|
5
|
+
import { ThemeContext } from "styled-components";
|
|
6
|
+
import * as Styled from "./ContactCard.styled";
|
|
7
|
+
import { createIdFromString } from "../../../util/general";
|
|
8
|
+
import {
|
|
9
|
+
FONT_SIZE,
|
|
10
|
+
FONT_WEIGHT_SEMIBOLD
|
|
11
|
+
} from "../../../constants/style_constants";
|
|
12
|
+
import ExternalLinkIcon from "../../atoms/icons/ExternalLinkIcon";
|
|
13
|
+
import SolidDivider from "../../atoms/solid-divider";
|
|
14
|
+
import { ROYAL_BLUE_VIVID, WHITE } from "../../../constants/colors";
|
|
15
|
+
import { createThemeValues } from "../../../util/themeUtils";
|
|
16
|
+
import { TextWrapStyles } from "./ContactCard.styled";
|
|
17
|
+
import { URL_TEST } from "../../../constants/regex_constants";
|
|
18
|
+
|
|
19
|
+
const ContactCard = ({
|
|
20
|
+
title,
|
|
21
|
+
secondTitle = "Helpful Links",
|
|
22
|
+
content = "",
|
|
23
|
+
links = [],
|
|
24
|
+
extraStyles = "",
|
|
25
|
+
titleVariant = "h3",
|
|
26
|
+
ariaLabel = "Contact Information",
|
|
27
|
+
linkVariant = "primary"
|
|
28
|
+
}) => {
|
|
29
|
+
const themeContext = useContext(ThemeContext);
|
|
30
|
+
const { isMobile } = themeContext;
|
|
31
|
+
const linkFallbackValues = { externalLinkColor: ROYAL_BLUE_VIVID };
|
|
32
|
+
const linkThemeValues = createThemeValues(
|
|
33
|
+
themeContext,
|
|
34
|
+
linkFallbackValues,
|
|
35
|
+
"Link",
|
|
36
|
+
linkVariant
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<Styled.Container
|
|
41
|
+
borderRadius="8px"
|
|
42
|
+
background={WHITE}
|
|
43
|
+
boxShadow="0px 2px 4px rgba(0, 0, 0, 0.25)"
|
|
44
|
+
dataQa={createIdFromString(title, "contact-card")}
|
|
45
|
+
maxWidth="100%"
|
|
46
|
+
minWidth={isMobile ? "240px" : "208px"}
|
|
47
|
+
minHeight="141px"
|
|
48
|
+
padding="1.5rem"
|
|
49
|
+
extraStyles={extraStyles}
|
|
50
|
+
role="complementary"
|
|
51
|
+
aria-label={ariaLabel}
|
|
52
|
+
>
|
|
53
|
+
<Stack
|
|
54
|
+
childGap="8px"
|
|
55
|
+
bottomItem={3}
|
|
56
|
+
justify="space-between"
|
|
57
|
+
style={{ width: "100%" }}
|
|
58
|
+
fullHeight
|
|
59
|
+
>
|
|
60
|
+
<Box padding={0} width="100%">
|
|
61
|
+
<Styled.Title
|
|
62
|
+
variant={titleVariant}
|
|
63
|
+
margin={0}
|
|
64
|
+
fontSize={FONT_SIZE.MD}
|
|
65
|
+
weight={FONT_WEIGHT_SEMIBOLD}
|
|
66
|
+
>
|
|
67
|
+
{title}
|
|
68
|
+
</Styled.Title>
|
|
69
|
+
</Box>
|
|
70
|
+
<Box padding={"0"} width="100%">
|
|
71
|
+
<Styled.Content>{content}</Styled.Content>
|
|
72
|
+
</Box>
|
|
73
|
+
</Stack>
|
|
74
|
+
{links.length > 0 && (
|
|
75
|
+
<>
|
|
76
|
+
<SolidDivider aria-hidden={true} />
|
|
77
|
+
<Stack
|
|
78
|
+
childGap={"8px"}
|
|
79
|
+
bottomItem={3}
|
|
80
|
+
justify="space-between"
|
|
81
|
+
style={{ width: "100%" }}
|
|
82
|
+
fullHeight
|
|
83
|
+
>
|
|
84
|
+
<Styled.Title
|
|
85
|
+
variant={titleVariant}
|
|
86
|
+
margin={0}
|
|
87
|
+
fontSize={FONT_SIZE.MD}
|
|
88
|
+
weight={FONT_WEIGHT_SEMIBOLD}
|
|
89
|
+
>
|
|
90
|
+
{secondTitle}
|
|
91
|
+
</Styled.Title>
|
|
92
|
+
<Stack
|
|
93
|
+
childGap={"4px"}
|
|
94
|
+
justify="space-between"
|
|
95
|
+
extraStyles={`width: 100%;`}
|
|
96
|
+
fullHeight
|
|
97
|
+
>
|
|
98
|
+
{links.map(link => {
|
|
99
|
+
const linkID = createIdFromString(
|
|
100
|
+
link.text,
|
|
101
|
+
"contact-card-link"
|
|
102
|
+
);
|
|
103
|
+
return (
|
|
104
|
+
<React.Fragment key={linkID}>
|
|
105
|
+
{R.test(URL_TEST, link.link) ? (
|
|
106
|
+
<ExternalLink
|
|
107
|
+
dataQa={linkID}
|
|
108
|
+
href={link.link}
|
|
109
|
+
newTab={true}
|
|
110
|
+
isUnderlined={false}
|
|
111
|
+
extraStyles={`
|
|
112
|
+
flex-direction: row;
|
|
113
|
+
align-items: center;
|
|
114
|
+
align-content: flex-start;
|
|
115
|
+
justify-content: space-between;
|
|
116
|
+
word-break: break-word;
|
|
117
|
+
${TextWrapStyles}
|
|
118
|
+
`}
|
|
119
|
+
size={FONT_SIZE.SM}
|
|
120
|
+
lineHeight="1.313rem"
|
|
121
|
+
>
|
|
122
|
+
{link.text}
|
|
123
|
+
<ExternalLinkIcon
|
|
124
|
+
linkColor={linkThemeValues.externalLinkColor}
|
|
125
|
+
text={link.text}
|
|
126
|
+
ariaLabel="(Opens in a new tab)"
|
|
127
|
+
/>
|
|
128
|
+
</ExternalLink>
|
|
129
|
+
) : (
|
|
130
|
+
<InternalLink
|
|
131
|
+
to={link.link}
|
|
132
|
+
dataQa={linkID}
|
|
133
|
+
fontSize={FONT_SIZE.SM}
|
|
134
|
+
color={linkThemeValues.externalLinkColor}
|
|
135
|
+
isUnderlined={false}
|
|
136
|
+
active={false}
|
|
137
|
+
lineheight="1.313rem"
|
|
138
|
+
extraStyles={`
|
|
139
|
+
word-break: break-word;
|
|
140
|
+
${TextWrapStyles}
|
|
141
|
+
`}
|
|
142
|
+
>
|
|
143
|
+
{link.text}
|
|
144
|
+
</InternalLink>
|
|
145
|
+
)}
|
|
146
|
+
</React.Fragment>
|
|
147
|
+
);
|
|
148
|
+
})}
|
|
149
|
+
</Stack>
|
|
150
|
+
</Stack>
|
|
151
|
+
</>
|
|
152
|
+
)}
|
|
153
|
+
</Styled.Container>
|
|
154
|
+
);
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
export default ContactCard;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import ContactCard from "./ContactCard";
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Molecules/ContactCard",
|
|
6
|
+
component: ContactCard,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: "centered"
|
|
9
|
+
},
|
|
10
|
+
tags: ["!autodocs"],
|
|
11
|
+
args: {
|
|
12
|
+
title: "City Hall Payment Center",
|
|
13
|
+
extraStyles: "",
|
|
14
|
+
titleVariant: "h3"
|
|
15
|
+
},
|
|
16
|
+
argTypes: {
|
|
17
|
+
title: {
|
|
18
|
+
description: "Text to display in the ContactCard's heading area",
|
|
19
|
+
table: {
|
|
20
|
+
type: { summary: "string" },
|
|
21
|
+
defaultValue: { summary: "City Hall Payment Center" }
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
content: {
|
|
25
|
+
description: "Text to display in the ContactCard's content area",
|
|
26
|
+
table: {
|
|
27
|
+
type: { summary: "string" },
|
|
28
|
+
defaultValue: { summary: "" }
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
links: {
|
|
32
|
+
description: "Array of links to display in the ContactCard",
|
|
33
|
+
table: {
|
|
34
|
+
type: { summary: "array" },
|
|
35
|
+
defaultValue: { summary: "[]" }
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
extraStyles: {
|
|
39
|
+
description: "Extra styles to apply to the ContactCard",
|
|
40
|
+
table: {
|
|
41
|
+
type: { summary: "string" },
|
|
42
|
+
defaultValue: { summary: undefined }
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
titleVariant: {
|
|
46
|
+
description: "HTML element to use for heading element, default is h3",
|
|
47
|
+
table: {
|
|
48
|
+
type: { summary: "string" },
|
|
49
|
+
defaultValue: { summary: "h3" }
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default meta;
|
|
56
|
+
|
|
57
|
+
export const BasicContactCard = {
|
|
58
|
+
args: {
|
|
59
|
+
title: "City Hall Payment Center",
|
|
60
|
+
content:
|
|
61
|
+
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod",
|
|
62
|
+
links: [
|
|
63
|
+
{
|
|
64
|
+
text: "Wallet Login",
|
|
65
|
+
link: "/login"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
text: "Cityville Home",
|
|
69
|
+
link: "https://cityville-demos.uat.cityba.se/"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
text: "Contact Us",
|
|
73
|
+
link: "https://eunasolutions.com/contact-us/"
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
render: args => {
|
|
78
|
+
return <ContactCard {...args} key="contact-card-basic" extraStyles={``} />;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
import Heading from "../../atoms/heading";
|
|
3
|
+
import { Box } from "../../atoms/layouts";
|
|
4
|
+
import { FONT_SIZE } from "../../../constants/style_constants";
|
|
5
|
+
|
|
6
|
+
export const TextWrapStyles = css`
|
|
7
|
+
word-wrap: break-word;
|
|
8
|
+
overflow-wrap: break-word;
|
|
9
|
+
white-space: normal;
|
|
10
|
+
max-width: 100%;
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
export const Container = styled(Box)`
|
|
14
|
+
height: fit-content;
|
|
15
|
+
display: flex;
|
|
16
|
+
padding: 1rem;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
align-items: flex-start;
|
|
19
|
+
gap: 1.5rem;
|
|
20
|
+
border-radius: 8px;
|
|
21
|
+
${({ extraStyles }) => extraStyles}
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
export const Title = styled(Heading)`
|
|
25
|
+
${TextWrapStyles}
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
export const Content = styled(Box)`
|
|
29
|
+
word-break: break-word;
|
|
30
|
+
padding: 0;
|
|
31
|
+
font-size: ${FONT_SIZE.SM};
|
|
32
|
+
line-height: 1.313rem;
|
|
33
|
+
letter-spacing: 0.14px;
|
|
34
|
+
${TextWrapStyles}
|
|
35
|
+
|
|
36
|
+
p {
|
|
37
|
+
margin: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
p,
|
|
41
|
+
span {
|
|
42
|
+
line-height: 1.313rem;
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from "react";
|
|
2
|
+
import Expand from "../../../util/expand";
|
|
3
|
+
|
|
4
|
+
export interface ContactCardProps {
|
|
5
|
+
title?: string; // title 1
|
|
6
|
+
secondTitle?: string; // title 2
|
|
7
|
+
content?: any; // content
|
|
8
|
+
links?: any; // list of links
|
|
9
|
+
extraStyles?: string; // extra styles
|
|
10
|
+
titleVariant?: string; // title variant
|
|
11
|
+
ariaLabel?: string; // aria label
|
|
12
|
+
linkVariant?: string; // link variant
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const ContactCard: React.FC<Expand<ContactCardProps> &
|
|
16
|
+
HTMLAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as EditNameFormStories from './EditNameForm.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={EditNameFormStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
Renders input fields to collect a person's first name and last name.
|
|
10
|
+
|
|
11
|
+
<Story />
|
|
12
|
+
|
|
13
|
+
<Controls />
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import EditNameForm from "./EditNameForm";
|
|
3
|
+
import { connect, Provider } from "react-redux";
|
|
4
|
+
import { createStore } from "redux";
|
|
5
|
+
import { createFormState, required } from "redux-freeform";
|
|
6
|
+
import { noop } from "../../../util/general";
|
|
7
|
+
import { fn } from "@storybook/test";
|
|
8
|
+
|
|
9
|
+
const formConfig = {
|
|
10
|
+
firstName: {
|
|
11
|
+
validators: [required()]
|
|
12
|
+
},
|
|
13
|
+
lastName: {
|
|
14
|
+
validators: [required()]
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const { mapStateToProps, mapDispatchToProps, reducer } = createFormState(
|
|
19
|
+
formConfig
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const store = createStore(
|
|
23
|
+
reducer,
|
|
24
|
+
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
const FormWrapper = props => <EditNameForm {...props} />;
|
|
28
|
+
|
|
29
|
+
const ConnectedEditNameForm = connect(
|
|
30
|
+
mapStateToProps,
|
|
31
|
+
mapDispatchToProps
|
|
32
|
+
)(FormWrapper);
|
|
33
|
+
|
|
34
|
+
export default {
|
|
35
|
+
title: "Molecules/EditNameForm",
|
|
36
|
+
component: ConnectedEditNameForm,
|
|
37
|
+
tags: ["!autodocs"],
|
|
38
|
+
parameters: {
|
|
39
|
+
layout: "centered"
|
|
40
|
+
},
|
|
41
|
+
args: {
|
|
42
|
+
fields: undefined,
|
|
43
|
+
actions: undefined,
|
|
44
|
+
clearOnDismount: undefined,
|
|
45
|
+
showErrors: undefined,
|
|
46
|
+
handleSubmit: noop
|
|
47
|
+
},
|
|
48
|
+
argTypes: {
|
|
49
|
+
fields: {
|
|
50
|
+
description:
|
|
51
|
+
"Field data, usually generated with [redux-freeform](https://github.com/CityBaseInc/redux-freeform).",
|
|
52
|
+
control: { type: "object" },
|
|
53
|
+
table: {
|
|
54
|
+
type: { summary: "object" },
|
|
55
|
+
defaultValue: { summary: undefined }
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
actions: {
|
|
59
|
+
description:
|
|
60
|
+
"Field actions, usually generated with [redux-freeform](https://github.com/CityBaseInc/redux-freeform).",
|
|
61
|
+
control: { type: "object" },
|
|
62
|
+
table: {
|
|
63
|
+
type: { summary: "object" },
|
|
64
|
+
defaultValue: { summary: undefined }
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
clearOnDismount: {
|
|
68
|
+
description:
|
|
69
|
+
"If `true`, `actions.form.clear()` will be called when the component unmounts.",
|
|
70
|
+
control: { type: "boolean" },
|
|
71
|
+
table: {
|
|
72
|
+
type: { summary: "boolean" },
|
|
73
|
+
defaultValue: { summary: undefined }
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
showErrors: {
|
|
77
|
+
description: "Show form field errors.",
|
|
78
|
+
control: { type: "boolean" },
|
|
79
|
+
table: {
|
|
80
|
+
type: { summary: "boolean" },
|
|
81
|
+
defaultValue: { summary: undefined }
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
handleSubmit: {
|
|
85
|
+
description:
|
|
86
|
+
"Function called when the `Enter` key is pressed on any of the text inputs (via `onKeyDown` prop passed to `FormInput` component).",
|
|
87
|
+
control: { type: "object" },
|
|
88
|
+
table: {
|
|
89
|
+
type: { summary: "function" },
|
|
90
|
+
defaultValue: { summary: noop }
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
decorators: [
|
|
95
|
+
Story => (
|
|
96
|
+
<Provider store={store}>
|
|
97
|
+
<Story />
|
|
98
|
+
</Provider>
|
|
99
|
+
)
|
|
100
|
+
]
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const Basic = args => <ConnectedEditNameForm {...args} />;
|
|
104
|
+
|
|
105
|
+
export const ShowErrors = {
|
|
106
|
+
args: {
|
|
107
|
+
showErrors: true
|
|
108
|
+
},
|
|
109
|
+
render: args => <ConnectedEditNameForm {...args} />
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export const HandleSubmit = {
|
|
113
|
+
args: {
|
|
114
|
+
handleSubmit: fn()
|
|
115
|
+
},
|
|
116
|
+
render: args => <ConnectedEditNameForm {...args} />
|
|
117
|
+
};
|
|
@@ -23,6 +23,7 @@ const EditableList = ({
|
|
|
23
23
|
titleWeight = "400",
|
|
24
24
|
canAdd = true,
|
|
25
25
|
addItem,
|
|
26
|
+
addItemDestination,
|
|
26
27
|
removeItem,
|
|
27
28
|
editItem,
|
|
28
29
|
itemName,
|
|
@@ -100,7 +101,9 @@ const EditableList = ({
|
|
|
100
101
|
disabled={expiredItem === EXPIRED}
|
|
101
102
|
>
|
|
102
103
|
<Text variant="p" color={CHARADE_GREY}>
|
|
103
|
-
{renderItem
|
|
104
|
+
{!!renderItem &&
|
|
105
|
+
typeof renderItem === "function" &&
|
|
106
|
+
renderItem(item)}
|
|
104
107
|
</Text>
|
|
105
108
|
<EditableListItemControls>
|
|
106
109
|
{item.isPrimary && (
|
|
@@ -166,6 +169,8 @@ const EditableList = ({
|
|
|
166
169
|
<Box padding={items.length === 0 ? "0" : "1rem 0 0"}>
|
|
167
170
|
<Placeholder
|
|
168
171
|
text={addText}
|
|
172
|
+
isLink={!!addItemDestination}
|
|
173
|
+
destination={addItemDestination}
|
|
169
174
|
action={addItem}
|
|
170
175
|
dataQa={"Add " + qaPrefix}
|
|
171
176
|
aria-label={addText}
|