@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,18 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as AddressFormStories from './AddressForm.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={AddressFormStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
Renders all the fields needed to collect a full address.
|
|
10
|
+
|
|
11
|
+
- Uses the [StateProvinceDropdown](?path=/docs/atoms-stateprovincedropdown--docs) component connected with the value from [CountryDropdown](?path=/docs/atoms-countrydropdown--docs) to filter states/provinces.
|
|
12
|
+
- Zip codes automatically formatted via [FormInput](?path=/docs/atoms-form-layouts-forminput--docs) `formatter` prop.
|
|
13
|
+
- Optional "Save address to wallet" [Checkbox](?path=/docs/atoms-checkbox--docs) via the `showWalletCheckbox` prop.
|
|
14
|
+
- Expands to fit the width of it's containing element
|
|
15
|
+
|
|
16
|
+
<Story />
|
|
17
|
+
|
|
18
|
+
<Controls />
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import AddressForm from "./AddressForm";
|
|
3
|
+
import { connect, Provider } from "react-redux";
|
|
4
|
+
import { createStore } from "redux";
|
|
5
|
+
import {
|
|
6
|
+
createFormState,
|
|
7
|
+
required,
|
|
8
|
+
onlyIntegers,
|
|
9
|
+
hasLength,
|
|
10
|
+
validateWhen,
|
|
11
|
+
matchesRegex
|
|
12
|
+
} from "redux-freeform";
|
|
13
|
+
import { noop } from "../../../util/general";
|
|
14
|
+
import { fn } from "@storybook/test";
|
|
15
|
+
|
|
16
|
+
const formConfig = {
|
|
17
|
+
street1: {
|
|
18
|
+
validators: [required()]
|
|
19
|
+
},
|
|
20
|
+
street2: {
|
|
21
|
+
validators: []
|
|
22
|
+
},
|
|
23
|
+
city: {
|
|
24
|
+
validators: [required()]
|
|
25
|
+
},
|
|
26
|
+
stateProvince: {
|
|
27
|
+
validators: [required()]
|
|
28
|
+
},
|
|
29
|
+
country: {
|
|
30
|
+
defaultValue: "US",
|
|
31
|
+
validators: [required()]
|
|
32
|
+
},
|
|
33
|
+
zip: {
|
|
34
|
+
validators: [
|
|
35
|
+
required(),
|
|
36
|
+
validateWhen(
|
|
37
|
+
validateWhen(hasLength(5, 5), hasLength(0, 5)),
|
|
38
|
+
matchesRegex("US"),
|
|
39
|
+
"country"
|
|
40
|
+
),
|
|
41
|
+
validateWhen(
|
|
42
|
+
validateWhen(hasLength(9, 9), hasLength(6, 9)),
|
|
43
|
+
matchesRegex("US"),
|
|
44
|
+
"country"
|
|
45
|
+
)
|
|
46
|
+
],
|
|
47
|
+
constraints: [
|
|
48
|
+
validateWhen(onlyIntegers(), matchesRegex("US"), "country"),
|
|
49
|
+
validateWhen(hasLength(0, 9), matchesRegex("US"), "country")
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const { mapStateToProps, mapDispatchToProps, reducer } = createFormState(
|
|
55
|
+
formConfig
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const store = createStore(
|
|
59
|
+
reducer,
|
|
60
|
+
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
const FormWrapper = props => <AddressForm {...props} />;
|
|
64
|
+
|
|
65
|
+
const ConnectedAddressForm = connect(
|
|
66
|
+
mapStateToProps,
|
|
67
|
+
mapDispatchToProps
|
|
68
|
+
)(FormWrapper);
|
|
69
|
+
|
|
70
|
+
export default {
|
|
71
|
+
title: "Molecules/AddressForm",
|
|
72
|
+
component: ConnectedAddressForm,
|
|
73
|
+
tags: ["!autodocs"],
|
|
74
|
+
parameters: {
|
|
75
|
+
layout: "centered",
|
|
76
|
+
controls: { expanded: true }
|
|
77
|
+
},
|
|
78
|
+
args: {
|
|
79
|
+
variant: "default",
|
|
80
|
+
fields: undefined,
|
|
81
|
+
actions: undefined,
|
|
82
|
+
clearOnDismount: undefined,
|
|
83
|
+
showErrors: undefined,
|
|
84
|
+
handleSubmit: noop,
|
|
85
|
+
showWalletCheckbox: undefined,
|
|
86
|
+
saveToWallet: undefined,
|
|
87
|
+
walletCheckboxMarked: undefined,
|
|
88
|
+
dataQa: null
|
|
89
|
+
},
|
|
90
|
+
argTypes: {
|
|
91
|
+
actions: {
|
|
92
|
+
description:
|
|
93
|
+
"Field actions, usually generated with [redux-freeform](https://github.com/CityBaseInc/redux-freeform).",
|
|
94
|
+
control: { type: "object" },
|
|
95
|
+
table: {
|
|
96
|
+
type: { summary: "object" },
|
|
97
|
+
defaultValue: { summary: undefined }
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
fields: {
|
|
101
|
+
description:
|
|
102
|
+
"Field data, usually generated with [redux-freeform](https://github.com/CityBaseInc/redux-freeform).",
|
|
103
|
+
control: { type: "object" },
|
|
104
|
+
table: {
|
|
105
|
+
type: { summary: "object" },
|
|
106
|
+
defaultValue: { summary: undefined }
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
showErrors: {
|
|
110
|
+
description:
|
|
111
|
+
"Show form field errors. Passed to the [FormInput](?path=/docs/atoms-form-layouts-forminput--docs), [CountryDropdown](?path=/docs/atoms-countrydropdown--docs), and [StateProvinceDropdown](?path=/docs/atoms-stateprovincedropdown--docs) fields.",
|
|
112
|
+
control: { type: "boolean" },
|
|
113
|
+
table: {
|
|
114
|
+
type: { summary: "boolean" },
|
|
115
|
+
defaultValue: { summary: undefined }
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
clearOnDismount: {
|
|
119
|
+
description:
|
|
120
|
+
"If `true`, `actions.form.clear()` will be called when the component unmounts.",
|
|
121
|
+
control: { type: "boolean" },
|
|
122
|
+
table: {
|
|
123
|
+
type: { summary: "boolean" },
|
|
124
|
+
defaultValue: { summary: undefined }
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
variant: {
|
|
128
|
+
description:
|
|
129
|
+
"Passed down to the `Box` component that wraps this component via the `FormContainer` component.",
|
|
130
|
+
control: { type: "text" },
|
|
131
|
+
table: {
|
|
132
|
+
type: { summary: "string" },
|
|
133
|
+
defaultValue: { summary: "default" }
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
handleSubmit: {
|
|
137
|
+
description:
|
|
138
|
+
"Function called when the `Enter` key is pressed on any of the text inputs (`onKeyDown`), and the `StateProvinceDropdown` field. The React event form the will be passed as a parameter.",
|
|
139
|
+
control: { type: "object" },
|
|
140
|
+
table: {
|
|
141
|
+
type: { summary: "function" },
|
|
142
|
+
defaultValue: { summary: undefined }
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
showWalletCheckbox: {
|
|
146
|
+
description: "Shows the `Save address to wallet` checkbox if `true`.",
|
|
147
|
+
control: { type: "boolean" },
|
|
148
|
+
table: {
|
|
149
|
+
type: { summary: "boolean" },
|
|
150
|
+
defaultValue: { summary: undefined }
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
saveToWallet: {
|
|
154
|
+
description:
|
|
155
|
+
"Callback function for the `onChange` event of the `Save address to wallet` checkbox.",
|
|
156
|
+
control: { type: "object" },
|
|
157
|
+
table: {
|
|
158
|
+
type: { summary: "function" },
|
|
159
|
+
defaultValue: { summary: undefined }
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
walletCheckboxMarked: {
|
|
163
|
+
description:
|
|
164
|
+
"Sets the `Save address to wallet` checkbox to `checked` when true.",
|
|
165
|
+
control: { type: "boolean" },
|
|
166
|
+
table: {
|
|
167
|
+
type: { summary: "boolean" },
|
|
168
|
+
defaultValue: { summary: undefined }
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
dataQa: {
|
|
172
|
+
description:
|
|
173
|
+
"Value for the `data-qa` attribute on the `FormContainer` wrapping element.",
|
|
174
|
+
control: { type: "text" },
|
|
175
|
+
table: {
|
|
176
|
+
type: { summary: "string" },
|
|
177
|
+
defaultValue: { summary: null }
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
decorators: [
|
|
182
|
+
Story => (
|
|
183
|
+
<Provider store={store}>
|
|
184
|
+
<Story />
|
|
185
|
+
</Provider>
|
|
186
|
+
)
|
|
187
|
+
]
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
export const Basic = args => <ConnectedAddressForm {...args} />;
|
|
191
|
+
|
|
192
|
+
export const ShowErrors = {
|
|
193
|
+
args: {
|
|
194
|
+
showErrors: true
|
|
195
|
+
},
|
|
196
|
+
render: args => <ConnectedAddressForm {...args} />
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
export const HandleSubmit = {
|
|
200
|
+
args: {
|
|
201
|
+
handleSubmit: fn()
|
|
202
|
+
},
|
|
203
|
+
render: args => <ConnectedAddressForm {...args} />
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
const AddressFormWithWalletState = props => {
|
|
207
|
+
const [checked, setChecked] = useState(true);
|
|
208
|
+
|
|
209
|
+
return (
|
|
210
|
+
<ConnectedAddressForm
|
|
211
|
+
{...props}
|
|
212
|
+
showWalletCheckbox={props.showWalletCheckbox}
|
|
213
|
+
walletCheckboxMarked={checked}
|
|
214
|
+
saveToWallet={() => setChecked(!checked)}
|
|
215
|
+
/>
|
|
216
|
+
);
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
export const WalletCheckbox = {
|
|
220
|
+
args: {
|
|
221
|
+
showWalletCheckbox: true
|
|
222
|
+
},
|
|
223
|
+
render: args => <AddressFormWithWalletState {...args} />
|
|
224
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as BannerStories from './Banner.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={BannerStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
Banner is a themeable component that renders a heading and sub-heading alongside an image. It supports custom padding and content spacing for both mobile and desktop, as well as minimum width and height values.
|
|
10
|
+
|
|
11
|
+
## The `Image` Prop
|
|
12
|
+
|
|
13
|
+
The `image` prop is required, and must be valid a React component, typically a component that renders an SVG.
|
|
14
|
+
|
|
15
|
+
The Banner component forces a width of `176px` for SVG elements on mobile screens.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
<div style={{ margin: "2em 0"}}>
|
|
20
|
+
<Story />
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<Controls />
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import Banner from "./Banner";
|
|
2
|
+
import { WalletBannerIcon } from "../../atoms/icons";
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Molecules/Banner",
|
|
6
|
+
component: Banner,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: "centered"
|
|
9
|
+
},
|
|
10
|
+
tags: ["!autodocs"],
|
|
11
|
+
args: {
|
|
12
|
+
heading: "This is a banner heading!",
|
|
13
|
+
subHeading: "Sub heading!",
|
|
14
|
+
image: WalletBannerIcon,
|
|
15
|
+
padding: "0.5rem 1.5rem",
|
|
16
|
+
mobilePadding: "0.5rem 1rem",
|
|
17
|
+
minWidth: "100%",
|
|
18
|
+
minHeight: "auto",
|
|
19
|
+
contentSpacing: "3rem",
|
|
20
|
+
mobileContentSpacing: "0.5rem"
|
|
21
|
+
},
|
|
22
|
+
argTypes: {
|
|
23
|
+
heading: {
|
|
24
|
+
description: "Banner heading",
|
|
25
|
+
table: {
|
|
26
|
+
type: { summary: "string" },
|
|
27
|
+
defaultValue: { summary: undefined }
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
subHeading: {
|
|
31
|
+
description: "Banner sub-heading",
|
|
32
|
+
table: {
|
|
33
|
+
type: { summary: "string" },
|
|
34
|
+
defaultValue: { summary: undefined }
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
image: {
|
|
38
|
+
description: "Image displayed on the right side of the banner",
|
|
39
|
+
table: {
|
|
40
|
+
type: { summary: "React Component" },
|
|
41
|
+
defaultValue: { summary: undefined }
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
padding: {
|
|
45
|
+
description: "Padding around the banner content (desktop)",
|
|
46
|
+
table: {
|
|
47
|
+
type: { summary: "string" },
|
|
48
|
+
defaultValue: { summary: "0.5rem 1.5rem" }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
mobilePadding: {
|
|
52
|
+
description: "Padding around the banner content (mobile)",
|
|
53
|
+
table: {
|
|
54
|
+
type: { summary: "string" },
|
|
55
|
+
defaultValue: { summary: "0.5rem 1rem" }
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
minWidth: {
|
|
59
|
+
description:
|
|
60
|
+
"Minimum width of the banner, must be a valid value for the `min-width` property.",
|
|
61
|
+
table: {
|
|
62
|
+
type: { summary: "string" },
|
|
63
|
+
defaultValue: { summary: "100%" }
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
minHeight: {
|
|
67
|
+
description:
|
|
68
|
+
"Minimum height of the banner, must be a valid value for the `min-height` property.",
|
|
69
|
+
table: {
|
|
70
|
+
type: { summary: "string" },
|
|
71
|
+
defaultValue: { summary: "auto" }
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
contentSpacing: {
|
|
75
|
+
description:
|
|
76
|
+
"Space between the headers and image, must be a valid CSS measurement value with a unit",
|
|
77
|
+
table: {
|
|
78
|
+
type: { summary: "string" },
|
|
79
|
+
defaultValue: { summary: "3rem" }
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
mobileContentSpacing: {
|
|
83
|
+
description:
|
|
84
|
+
"Space between the headers and image (mobile), must be a valid CSS measurement value with a unit",
|
|
85
|
+
table: {
|
|
86
|
+
type: { summary: "string" },
|
|
87
|
+
defaultValue: { summary: "0.5rem" }
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export default meta;
|
|
94
|
+
|
|
95
|
+
export const Basic = {};
|
|
96
|
+
|
|
97
|
+
export const CustomPadding = {
|
|
98
|
+
args: {
|
|
99
|
+
padding: "2rem 4rem"
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const CustomSpacing = {
|
|
104
|
+
args: {
|
|
105
|
+
contentSpacing: "8rem"
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export const MinWidth = {
|
|
110
|
+
args: {
|
|
111
|
+
minWidth: "1000px"
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export const MinHeight = {
|
|
116
|
+
args: {
|
|
117
|
+
minHeight: "500px"
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export const CustomImageComponent = {
|
|
122
|
+
args: {
|
|
123
|
+
image: () => "🎉"
|
|
124
|
+
}
|
|
125
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as ChangePasswordFormStories from './ChangePasswordForm.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={ChangePasswordFormStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
Renders a form for users to update their password. Built with [FormInput](?path=/docs/atoms-form-layouts-forminput--docs), and [PasswordRequirements](?path=/docs/atoms-passwordrequirements--docs).
|
|
10
|
+
|
|
11
|
+
When the [`revenueManagement`](?path=/story/molecules-changepasswordform--revenue-management) prop is set to `true`, the form will include a user block with their full name & initials, and "Save" & "Cancel" buttons.
|
|
12
|
+
|
|
13
|
+
<Story />
|
|
14
|
+
|
|
15
|
+
<Controls />
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import ChangePasswordForm from "./ChangePasswordForm";
|
|
3
|
+
import { connect, Provider } from "react-redux";
|
|
4
|
+
import { createStore } from "redux";
|
|
5
|
+
import {
|
|
6
|
+
createFormState,
|
|
7
|
+
required,
|
|
8
|
+
hasLength,
|
|
9
|
+
hasNumber,
|
|
10
|
+
hasLowercaseLetter,
|
|
11
|
+
hasUppercaseLetter,
|
|
12
|
+
hasSpecialCharacter,
|
|
13
|
+
matchesField
|
|
14
|
+
} from "redux-freeform";
|
|
15
|
+
import { noop } from "../../../util/general";
|
|
16
|
+
import { fn } from "@storybook/test";
|
|
17
|
+
|
|
18
|
+
const formConfig = {
|
|
19
|
+
currentPassword: {
|
|
20
|
+
validators: [required()]
|
|
21
|
+
},
|
|
22
|
+
newPassword: {
|
|
23
|
+
validators: [
|
|
24
|
+
required(),
|
|
25
|
+
hasLength(8, 100),
|
|
26
|
+
hasNumber(),
|
|
27
|
+
hasLowercaseLetter(),
|
|
28
|
+
hasUppercaseLetter(),
|
|
29
|
+
hasSpecialCharacter()
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
confirmNewPassword: {
|
|
33
|
+
validators: [required(), matchesField("newPassword")]
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const { mapStateToProps, mapDispatchToProps, reducer } = createFormState(
|
|
38
|
+
formConfig
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const store = createStore(
|
|
42
|
+
reducer,
|
|
43
|
+
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const FormWrapper = props => <ChangePasswordForm {...props} />;
|
|
47
|
+
|
|
48
|
+
const ConnectedChangePasswordForm = connect(
|
|
49
|
+
mapStateToProps,
|
|
50
|
+
mapDispatchToProps
|
|
51
|
+
)(FormWrapper);
|
|
52
|
+
|
|
53
|
+
export default {
|
|
54
|
+
title: "Molecules/ChangePasswordForm",
|
|
55
|
+
component: ConnectedChangePasswordForm,
|
|
56
|
+
tags: ["!autodocs"],
|
|
57
|
+
parameters: {
|
|
58
|
+
layout: "centered",
|
|
59
|
+
controls: { expanded: true }
|
|
60
|
+
},
|
|
61
|
+
args: {
|
|
62
|
+
clearOnDismount: undefined,
|
|
63
|
+
fields: undefined,
|
|
64
|
+
actions: undefined,
|
|
65
|
+
handleSubmit: noop,
|
|
66
|
+
showErrors: undefined,
|
|
67
|
+
isMobile: undefined,
|
|
68
|
+
revenueManagement: undefined,
|
|
69
|
+
closeForm: undefined,
|
|
70
|
+
firstName: undefined,
|
|
71
|
+
lastName: undefined
|
|
72
|
+
},
|
|
73
|
+
argTypes: {
|
|
74
|
+
actions: {
|
|
75
|
+
description:
|
|
76
|
+
"Field actions, usually generated with [redux-freeform](https://github.com/CityBaseInc/redux-freeform).",
|
|
77
|
+
control: { type: "object" },
|
|
78
|
+
table: {
|
|
79
|
+
type: { summary: "object" },
|
|
80
|
+
defaultValue: { summary: undefined }
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
fields: {
|
|
84
|
+
description:
|
|
85
|
+
"Field data, usually generated with [redux-freeform](https://github.com/CityBaseInc/redux-freeform).",
|
|
86
|
+
control: { type: "object" },
|
|
87
|
+
table: {
|
|
88
|
+
type: { summary: "object" },
|
|
89
|
+
defaultValue: { summary: undefined }
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
clearOnDismount: {
|
|
93
|
+
description:
|
|
94
|
+
"If `true`, `actions.form.clear()` will be called when the component unmounts.",
|
|
95
|
+
control: { type: "boolean" },
|
|
96
|
+
table: {
|
|
97
|
+
type: { summary: "boolean" },
|
|
98
|
+
defaultValue: { summary: undefined }
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
handleSubmit: {
|
|
102
|
+
description:
|
|
103
|
+
"Function called when the `Enter` key is pressed on any of the text inputs (`onKeyDown`). The React event form the will be passed as a parameter.",
|
|
104
|
+
control: { type: "object" },
|
|
105
|
+
table: {
|
|
106
|
+
type: { summary: "function" },
|
|
107
|
+
defaultValue: { summary: undefined }
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
isMobile: {
|
|
111
|
+
description:
|
|
112
|
+
"Reduces the padding of the `PasswordRequirements` component for mobile desvices (typically screen size <768px).",
|
|
113
|
+
control: { type: "boolean" },
|
|
114
|
+
table: {
|
|
115
|
+
type: { summary: "boolean" },
|
|
116
|
+
defaultValue: { summary: undefined }
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
showErrors: {
|
|
120
|
+
description:
|
|
121
|
+
"Passed to the [FormInput](?path=/docs/atoms-form-layouts-forminput--docs) fields.",
|
|
122
|
+
control: { type: "boolean" },
|
|
123
|
+
table: {
|
|
124
|
+
type: { summary: "boolean" },
|
|
125
|
+
defaultValue: { summary: undefined }
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
revenueManagement: {
|
|
129
|
+
description:
|
|
130
|
+
"Renders the user's name from the `firstName` and `lastName` props, and `Cancel` & `Save` buttons. The `Save` button uses the `handleSubmit` prop as it's action.",
|
|
131
|
+
control: { type: "boolean" },
|
|
132
|
+
table: {
|
|
133
|
+
type: { summary: "boolean" },
|
|
134
|
+
defaultValue: { summary: undefined }
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
closeForm: {
|
|
138
|
+
description:
|
|
139
|
+
"Action for the `Cancel` button for the `revenueManagement` version of the form",
|
|
140
|
+
control: { type: "boolean" },
|
|
141
|
+
table: {
|
|
142
|
+
type: { summary: "boolean" },
|
|
143
|
+
defaultValue: { summary: undefined }
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
firstName: {
|
|
147
|
+
description:
|
|
148
|
+
"First name of the user, used only with `revenueManagement` set to `true.`",
|
|
149
|
+
control: { type: "text" },
|
|
150
|
+
table: {
|
|
151
|
+
type: { summary: "string" },
|
|
152
|
+
defaultValue: { summary: undefined }
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
lastName: {
|
|
156
|
+
description:
|
|
157
|
+
"Last name of the user, used only with `revenueManagement` set to `true.`",
|
|
158
|
+
control: { type: "text" },
|
|
159
|
+
table: {
|
|
160
|
+
type: { summary: "string" },
|
|
161
|
+
defaultValue: { summary: undefined }
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
decorators: [
|
|
166
|
+
Story => (
|
|
167
|
+
<Provider store={store}>
|
|
168
|
+
<Story />
|
|
169
|
+
</Provider>
|
|
170
|
+
)
|
|
171
|
+
]
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
export const Basic = args => <ConnectedChangePasswordForm {...args} />;
|
|
175
|
+
|
|
176
|
+
export const ShowErrors = {
|
|
177
|
+
args: {
|
|
178
|
+
showErrors: true
|
|
179
|
+
},
|
|
180
|
+
render: args => <ConnectedChangePasswordForm {...args} />
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
export const HandleSubmit = {
|
|
184
|
+
args: {
|
|
185
|
+
handleSubmit: fn()
|
|
186
|
+
},
|
|
187
|
+
render: args => <ConnectedChangePasswordForm {...args} />
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
export const IsMobile = {
|
|
191
|
+
args: {
|
|
192
|
+
isMobile: true
|
|
193
|
+
},
|
|
194
|
+
render: args => <ConnectedChangePasswordForm {...args} />
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
export const RevenueManagement = {
|
|
198
|
+
args: {
|
|
199
|
+
revenueManagement: true,
|
|
200
|
+
firstName: "Cole",
|
|
201
|
+
lastName: "Slaw",
|
|
202
|
+
closeForm: fn(),
|
|
203
|
+
handleSubmit: fn()
|
|
204
|
+
},
|
|
205
|
+
render: args => <ConnectedChangePasswordForm {...args} />
|
|
206
|
+
};
|
|
@@ -37,7 +37,7 @@ const CollapsibleSection = ({
|
|
|
37
37
|
const numChildren = typeof children === "Array" ? children.length : 1;
|
|
38
38
|
const label =
|
|
39
39
|
name !== "" ? name : !customTitle ? title : "collapsible section";
|
|
40
|
-
const id = `${label?.replaceAll(" ", "-")?.toLowerCase()}-${index}`;
|
|
40
|
+
const id = `${label?.replaceAll?.(" ", "-")?.toLowerCase()}-${index}`;
|
|
41
41
|
|
|
42
42
|
const wrapper = {
|
|
43
43
|
open: {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as CollapsibleSectionStories from './CollapsibleSection.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={CollapsibleSectionStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
The CollapsibleSection component behaves like a typical accordion, expanding and collapsing respectively when triggered by user interaction. It also includes [accessibility attributes for accordions](https://www.w3.org/WAI/ARIA/apg/patterns/accordion/).
|
|
10
|
+
|
|
11
|
+
<Controls />
|
|
12
|
+
|
|
13
|
+
<div style={{ marginBottom: "2em"}}>
|
|
14
|
+
<Story />
|
|
15
|
+
</div>
|