@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thecb/components",
|
|
3
|
-
"version": "12.0.0-beta.
|
|
3
|
+
"version": "12.0.0-beta.2",
|
|
4
4
|
"description": "Common lib for CityBase react components",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
24
|
"dist",
|
|
25
|
-
"src"
|
|
25
|
+
"src",
|
|
26
|
+
"ai-docs"
|
|
26
27
|
],
|
|
27
28
|
"homepage": "https://github.com/CityBaseInc/cb-components#readme",
|
|
28
29
|
"devDependencies": {
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
"@babel/register": "^7.6.2",
|
|
34
35
|
"@chromatic-com/storybook": "^1.4.0",
|
|
35
36
|
"@rollup/plugin-json": "^4.0.3",
|
|
37
|
+
"@storybook/addon-a11y": "7",
|
|
36
38
|
"@storybook/addon-essentials": "^8.1.1",
|
|
37
39
|
"@storybook/addon-interactions": "^8.1.1",
|
|
38
40
|
"@storybook/addon-links": "^8.1.1",
|
|
@@ -43,7 +45,9 @@
|
|
|
43
45
|
"@storybook/react": "^8.1.1",
|
|
44
46
|
"@storybook/react-vite": "^8.1.1",
|
|
45
47
|
"@storybook/test": "^8.1.1",
|
|
48
|
+
"@storybook/test-runner": "0.18.0",
|
|
46
49
|
"@vitejs/plugin-react": "^4.2.1",
|
|
50
|
+
"axe-playwright": "^2.0.2",
|
|
47
51
|
"babel-core": "^6.26.3",
|
|
48
52
|
"babel-loader": "^8.1.0",
|
|
49
53
|
"babel-preset-env": "^1.7.0",
|
|
@@ -70,18 +74,23 @@
|
|
|
70
74
|
"rollup-plugin-ts": "^3.0.2",
|
|
71
75
|
"rollup-plugin-visualizer": "^4.0.4",
|
|
72
76
|
"storybook": "^8.1.1",
|
|
77
|
+
"storybook-addon-remix-react-router": "^3.0.0",
|
|
73
78
|
"styled-components": "^5.3.5",
|
|
74
79
|
"styled-theming": "^2.2.0",
|
|
75
80
|
"typescript": "^4.8.2",
|
|
76
81
|
"vite": "^5.2.11"
|
|
77
82
|
},
|
|
78
83
|
"peerDependencies": {
|
|
79
|
-
"react": "^16.13.1",
|
|
80
|
-
"react-dom": "^16.13.1",
|
|
84
|
+
"react": "^16.13.1 || ^17.0.0",
|
|
85
|
+
"react-dom": "^16.13.1 || ^17.0.0",
|
|
81
86
|
"react-router-dom": "^6.3.0",
|
|
82
87
|
"styled-components": "^5.1.1",
|
|
83
88
|
"styled-theming": "^2.2.0"
|
|
84
89
|
},
|
|
90
|
+
"resolutions": {
|
|
91
|
+
"jackspeak": "2.1.1",
|
|
92
|
+
"strip-ansi": "6.0.1"
|
|
93
|
+
},
|
|
85
94
|
"husky": {
|
|
86
95
|
"hooks": {
|
|
87
96
|
"pre-commit": "pretty-quick --staged"
|
|
@@ -92,12 +101,12 @@
|
|
|
92
101
|
"@types/styled-components": "^5.1.34",
|
|
93
102
|
"core-js": "^3.22.5",
|
|
94
103
|
"formatted-input": "^1.0.0",
|
|
95
|
-
"framer-motion": "
|
|
104
|
+
"framer-motion": "7.0.0",
|
|
96
105
|
"numeral": "^2.0.6",
|
|
97
106
|
"polished": "^4.0.3",
|
|
98
107
|
"ramda": "^0.27.0",
|
|
99
108
|
"react-aria-modal": "^4.0.0",
|
|
100
|
-
"
|
|
101
|
-
|
|
102
|
-
|
|
109
|
+
"redux-freeform": "6.2.1"
|
|
110
|
+
},
|
|
111
|
+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
103
112
|
}
|
|
@@ -73,7 +73,16 @@ const Alert = ({
|
|
|
73
73
|
</Box>
|
|
74
74
|
<Cluster justify="flex-end" align="flex-start">
|
|
75
75
|
{showQuitLink && (
|
|
76
|
-
<Box
|
|
76
|
+
<Box
|
|
77
|
+
padding="0"
|
|
78
|
+
minHeight="100%"
|
|
79
|
+
onClick={onLinkClick}
|
|
80
|
+
onKeyDown={e => e.key === "Enter" && onLinkClick()}
|
|
81
|
+
role="button"
|
|
82
|
+
tabIndex={0}
|
|
83
|
+
aria-label={`Close Alert: ${heading}`}
|
|
84
|
+
extraStyles="cursor: pointer;"
|
|
85
|
+
>
|
|
77
86
|
<IconQuit />
|
|
78
87
|
</Box>
|
|
79
88
|
)}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as AlertStories from './Alert.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={AlertStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
The Alert component is a fully accesible element to provide notifications to a user. Its features include:
|
|
10
|
+
|
|
11
|
+
- Multiple types: info, warn, error, success
|
|
12
|
+
- Ability to allow user to dismiss the alert
|
|
13
|
+
- Default support of heading text, body text, and customizable children elements
|
|
14
|
+
- Highly customizable content via textOverride
|
|
15
|
+
- Accessibility props for aria-role, aria-atomic, and aria-live
|
|
16
|
+
|
|
17
|
+
<div style={{ marginBottom: "2em"}}>
|
|
18
|
+
<Story />
|
|
19
|
+
</div>
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { CLOUDBURST_BLUE } from "../../../constants/colors";
|
|
3
|
+
import Badge from "../badge/Badge";
|
|
4
|
+
import ToggleSwitch from "../toggle-switch/ToggleSwitch";
|
|
5
|
+
import { Cluster, Box, Stack } from "../layouts";
|
|
6
|
+
import Text from "../text/Text";
|
|
7
|
+
import Alert from "./Alert";
|
|
8
|
+
import { fn } from "@storybook/test";
|
|
9
|
+
|
|
10
|
+
const meta = {
|
|
11
|
+
title: "Atoms/Alert",
|
|
12
|
+
component: Alert,
|
|
13
|
+
parameters: {
|
|
14
|
+
layout: "centered"
|
|
15
|
+
},
|
|
16
|
+
tags: ["!autodocs"],
|
|
17
|
+
args: {
|
|
18
|
+
heading: "This is an alert!",
|
|
19
|
+
text:
|
|
20
|
+
"We display this message when we want to alert the user to some sort of event or error, such as when an API request has completed or failed.",
|
|
21
|
+
textOverride: null,
|
|
22
|
+
variant: "info",
|
|
23
|
+
children: null,
|
|
24
|
+
height: null,
|
|
25
|
+
onLinkClick: fn(),
|
|
26
|
+
padding: "0.5rem",
|
|
27
|
+
showQuitLink: true,
|
|
28
|
+
extraStyles: null,
|
|
29
|
+
maxContentWidth: null,
|
|
30
|
+
noBorder: false,
|
|
31
|
+
enableBoxShadow: false,
|
|
32
|
+
enableSmallText: false,
|
|
33
|
+
innerContentPadding: "1rem",
|
|
34
|
+
iconPadding: "0 0 0 1rem",
|
|
35
|
+
contentFullHeight: false,
|
|
36
|
+
ariaRole: null,
|
|
37
|
+
ariaAtomic: true,
|
|
38
|
+
ariaLive: "polite"
|
|
39
|
+
},
|
|
40
|
+
argTypes: {
|
|
41
|
+
heading: {
|
|
42
|
+
description: "Text that appears in the alert heading",
|
|
43
|
+
table: {
|
|
44
|
+
type: { summary: "string" },
|
|
45
|
+
defaultValue: { summary: undefined }
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
text: {
|
|
49
|
+
description: "Text that appears in the alert body",
|
|
50
|
+
table: {
|
|
51
|
+
type: { summary: "string" },
|
|
52
|
+
defaultValue: { summary: undefined }
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
textOverride: {
|
|
56
|
+
description:
|
|
57
|
+
"A JSX component that replaces the content otherwise specified with the Heading, Text, and Children props.",
|
|
58
|
+
table: {
|
|
59
|
+
type: { summary: "React Component" },
|
|
60
|
+
defaultValue: { summary: undefined }
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
variant: {
|
|
64
|
+
description: "The type of the alert",
|
|
65
|
+
table: {
|
|
66
|
+
type: { summary: "string" },
|
|
67
|
+
defaultValue: { summary: "info" }
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
children: {
|
|
71
|
+
description: "A react component to display below the body text",
|
|
72
|
+
table: {
|
|
73
|
+
type: { summary: "React Component" },
|
|
74
|
+
defaultValue: { summary: undefined }
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
showQuitLink: {
|
|
78
|
+
description: "Whether or not the alert is dismissable",
|
|
79
|
+
table: {
|
|
80
|
+
type: { summary: "boolean" },
|
|
81
|
+
defaultValue: { summary: true }
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export default meta;
|
|
88
|
+
|
|
89
|
+
export const Info = {
|
|
90
|
+
args: {
|
|
91
|
+
heading: "This is an info alert!"
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export const Warn = {
|
|
96
|
+
args: {
|
|
97
|
+
variant: "warn",
|
|
98
|
+
heading: "This is a warning alert!"
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const Error = {
|
|
103
|
+
args: {
|
|
104
|
+
variant: "error",
|
|
105
|
+
heading: "This is an error alert!"
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export const Success = {
|
|
110
|
+
args: {
|
|
111
|
+
variant: "success",
|
|
112
|
+
heading: "This is a success alert!"
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const FancyAlert = props => {
|
|
117
|
+
const [toggleOn, setToggleOn] = useState(true);
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<Alert
|
|
121
|
+
{...props}
|
|
122
|
+
textOverride={
|
|
123
|
+
<Box padding="1rem" border={`1px dotted ${CLOUDBURST_BLUE}`}>
|
|
124
|
+
<Stack childGap="1.5rem" fullHeight>
|
|
125
|
+
<Text variant="pL" weight="600">
|
|
126
|
+
{`Alerts can be very fancy if you want!`}
|
|
127
|
+
</Text>
|
|
128
|
+
<Text variant="p" weight="400">
|
|
129
|
+
{`This particular alert uses the textOverride prop to supply a custom content component with unique text elements and a toggle switch. It also has a box shadow and the quit option to dismiss the alert has been disabled.`}
|
|
130
|
+
</Text>
|
|
131
|
+
<Cluster justify="space-between" align="center">
|
|
132
|
+
<ToggleSwitch
|
|
133
|
+
label="toggle!"
|
|
134
|
+
isOn={toggleOn}
|
|
135
|
+
onToggle={() => setToggleOn(!toggleOn)}
|
|
136
|
+
></ToggleSwitch>
|
|
137
|
+
<Badge variant="warn" label="Oh No!"></Badge>
|
|
138
|
+
</Cluster>
|
|
139
|
+
</Stack>
|
|
140
|
+
</Box>
|
|
141
|
+
}
|
|
142
|
+
enableBoxShadow={true}
|
|
143
|
+
showQuitLink={false}
|
|
144
|
+
/>
|
|
145
|
+
);
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export const CustomAlert = {
|
|
149
|
+
render: args => <FancyAlert {...args} />
|
|
150
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import styled from "styled-components";
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import styled, { ThemeContext } from "styled-components";
|
|
3
3
|
import Box from "../layouts/Box";
|
|
4
4
|
import Text from "../../atoms/text/";
|
|
5
5
|
import { themeComponent } from "../../../util/themeUtils";
|
|
@@ -15,31 +15,45 @@ const StyledBadgeContainer = styled(Box)`
|
|
|
15
15
|
`;
|
|
16
16
|
|
|
17
17
|
const StyledBadge = styled(Text)`
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
font-style: normal;
|
|
21
|
-
font-weight: 400;
|
|
22
|
-
line-height: 150%; /* 15px */
|
|
23
|
-
letter-spacing: 0.2px;
|
|
18
|
+
line-height: 150%;
|
|
19
|
+
letter-spacing: ${props => (props.isMobile ? "0.2px" : "0.24px")};
|
|
24
20
|
white-space: nowrap;
|
|
25
|
-
|
|
26
|
-
@media screen and (min-width: 1049px) {
|
|
27
|
-
font-size: 12px;
|
|
28
|
-
line-height: 150%; /* 18px */
|
|
29
|
-
letter-spacing: 0.24px;
|
|
30
|
-
}
|
|
31
21
|
`;
|
|
32
22
|
|
|
33
|
-
const Badge = ({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
23
|
+
const Badge = ({
|
|
24
|
+
label,
|
|
25
|
+
Icon,
|
|
26
|
+
themeValues,
|
|
27
|
+
iconOnLeft = true,
|
|
28
|
+
id,
|
|
29
|
+
extraStyles
|
|
30
|
+
}) => {
|
|
31
|
+
const { isMobile } = useContext(ThemeContext);
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<StyledBadgeContainer
|
|
35
|
+
background={themeValues.background}
|
|
36
|
+
id={id}
|
|
37
|
+
extraStyles={extraStyles}
|
|
38
|
+
>
|
|
39
|
+
{iconOnLeft && Icon && (
|
|
40
|
+
<Icon color={themeValues.color} fill={themeValues.color} />
|
|
41
|
+
)}
|
|
42
|
+
<StyledBadge
|
|
43
|
+
color={themeValues.color}
|
|
44
|
+
weight={themeValues.fontWeight}
|
|
45
|
+
fontSize={
|
|
46
|
+
isMobile ? themeValues.fontSizeMobile : themeValues.fontSizeDesktop
|
|
47
|
+
}
|
|
48
|
+
isMobile={isMobile}
|
|
49
|
+
>
|
|
50
|
+
{label}
|
|
51
|
+
</StyledBadge>
|
|
52
|
+
{!iconOnLeft && Icon && (
|
|
53
|
+
<Icon color={themeValues.color} fill={themeValues.color} />
|
|
54
|
+
)}
|
|
55
|
+
</StyledBadgeContainer>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
44
58
|
|
|
45
59
|
export default themeComponent(Badge, "Badge", fallbackValues, "success");
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as BadgeStories from './Badge.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={BadgeStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
The Badge component is a small component used to provide information in the form of an icon and text string to users at a glance. Badges can be used in tables, as tags, in UI controls, or anywhere display of bite-sized information is needed.
|
|
10
|
+
|
|
11
|
+
All themes use the same badge variants (and colors) as displayed here, but custom badges can be added to theme patterns in FCS if desired.
|
|
12
|
+
|
|
13
|
+
Badges have these properties:
|
|
14
|
+
|
|
15
|
+
- label (required)
|
|
16
|
+
- Icon (optional)
|
|
17
|
+
- variant (optional, default is "success")
|
|
18
|
+
- iconOnLeft (optional, default is "true")
|
|
19
|
+
|
|
20
|
+
Badge theme variants control *only* the background color of the badge and the color of its text. Icon color is either passed in as a prop to the Icon component (ideal), or controlled by the Icon themeing.
|
|
21
|
+
|
|
22
|
+
Note: if using the second approach, it is possible for the color of badge text and icon to diverge, possibly in undersible ways, unless special variants are added to the Icon themes in the FCS theme patterns. See the "Payment History" badge - try changing the theme in storybook - for an example of this.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
<div style={{ marginBottom: "2em"}}>
|
|
26
|
+
<Story />
|
|
27
|
+
</div>
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
MANATEE_GREY,
|
|
4
|
+
ROYAL_BLUE_VIVID,
|
|
5
|
+
ZEST_ORANGE,
|
|
6
|
+
CORNFLOWER_BLUE
|
|
7
|
+
} from "../../../constants/colors";
|
|
8
|
+
import Badge from "./Badge";
|
|
9
|
+
import { Box, Stack, Cluster } from "../layouts";
|
|
10
|
+
import AutopayIcon from "../icons/AutopayIcon";
|
|
11
|
+
import MultiCartIcon from "../icons/MultiCartIcon";
|
|
12
|
+
import RefundIconSmall from "../icons/RefundIconSmall";
|
|
13
|
+
import { TrashIconV2 } from "../icons";
|
|
14
|
+
import HistoryIconSmall from "../icons/HistoryIconSmall";
|
|
15
|
+
|
|
16
|
+
const meta = {
|
|
17
|
+
title: "Atoms/Badge",
|
|
18
|
+
component: Badge,
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: "centered"
|
|
21
|
+
},
|
|
22
|
+
tags: ["!autodocs"],
|
|
23
|
+
args: {
|
|
24
|
+
label: undefined,
|
|
25
|
+
Icon: undefined,
|
|
26
|
+
iconOnLeft: true,
|
|
27
|
+
variant: "success"
|
|
28
|
+
},
|
|
29
|
+
argTypes: {
|
|
30
|
+
label: {
|
|
31
|
+
description: "The text displayed inside the badge",
|
|
32
|
+
table: {
|
|
33
|
+
type: { summary: "string" },
|
|
34
|
+
defaultValue: { summary: undefined }
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
Icon: {
|
|
38
|
+
description: "An icon component to display on the badge",
|
|
39
|
+
table: {
|
|
40
|
+
type: { summary: "React Component" },
|
|
41
|
+
defaultValue: { summary: undefined }
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
iconOnLeft: {
|
|
45
|
+
description: "Position of the icon on the badge",
|
|
46
|
+
table: {
|
|
47
|
+
type: { summary: "boolean" },
|
|
48
|
+
defaultValue: { summary: true }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
variant: {
|
|
52
|
+
description: "The style of the badge",
|
|
53
|
+
table: {
|
|
54
|
+
type: { summary: "string" },
|
|
55
|
+
defaultValue: { summary: "success" }
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export default meta;
|
|
62
|
+
|
|
63
|
+
const SuccessBadge = props => {
|
|
64
|
+
return <Badge {...props} label={"Autopay On"} Icon={AutopayIcon} />;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const DisabledBadge = props => {
|
|
68
|
+
return (
|
|
69
|
+
<Badge
|
|
70
|
+
{...props}
|
|
71
|
+
label={"Enable Autopay"}
|
|
72
|
+
Icon={() => AutopayIcon({ fill: MANATEE_GREY })}
|
|
73
|
+
variant="disabled"
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const PrimaryBadge = props => {
|
|
79
|
+
return (
|
|
80
|
+
<Badge
|
|
81
|
+
{...props}
|
|
82
|
+
label={"Item in Cart"}
|
|
83
|
+
Icon={() => MultiCartIcon({ iconFill: ROYAL_BLUE_VIVID })}
|
|
84
|
+
variant="primary"
|
|
85
|
+
/>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const PrimaryHeadlineBadge = props => {
|
|
90
|
+
return <Badge {...props} label={"Kiosk"} variant="primaryHeadline" />;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const SecondaryBadge = props => {
|
|
94
|
+
return (
|
|
95
|
+
<Badge
|
|
96
|
+
{...props}
|
|
97
|
+
label={"Item in Cart"}
|
|
98
|
+
Icon={() => MultiCartIcon({ iconFill: CORNFLOWER_BLUE })}
|
|
99
|
+
variant="secondary"
|
|
100
|
+
/>
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const SecondaryHeadlineBadge = props => {
|
|
105
|
+
return <Badge {...props} label={"Online"} variant="secondaryHeadline" />;
|
|
106
|
+
};
|
|
107
|
+
const InfoBadge = props => {
|
|
108
|
+
return (
|
|
109
|
+
<Badge
|
|
110
|
+
{...props}
|
|
111
|
+
label={"Payment History"}
|
|
112
|
+
Icon={HistoryIconSmall}
|
|
113
|
+
variant="info"
|
|
114
|
+
/>
|
|
115
|
+
);
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const WarnBadge = props => {
|
|
119
|
+
return (
|
|
120
|
+
<Badge
|
|
121
|
+
{...props}
|
|
122
|
+
label={"Refund Payment"}
|
|
123
|
+
Icon={() => RefundIconSmall({ color: ZEST_ORANGE })}
|
|
124
|
+
variant="warn"
|
|
125
|
+
/>
|
|
126
|
+
);
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const RightIconBadge = props => {
|
|
130
|
+
return (
|
|
131
|
+
<Badge
|
|
132
|
+
{...props}
|
|
133
|
+
label={"Delete Record"}
|
|
134
|
+
Icon={TrashIconV2}
|
|
135
|
+
variant="warn"
|
|
136
|
+
iconOnLeft={false}
|
|
137
|
+
/>
|
|
138
|
+
);
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const NoIconBadge = props => {
|
|
142
|
+
return <Badge {...props} label={"Paid Off"} variant="success" />;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export const Badges = {
|
|
146
|
+
render: args => {
|
|
147
|
+
return (
|
|
148
|
+
<Box padding="1rem">
|
|
149
|
+
<Stack childGap="2rem">
|
|
150
|
+
<Cluster justify="flex-start" align="center" childGap="1.5rem">
|
|
151
|
+
<SuccessBadge {...args} />
|
|
152
|
+
<DisabledBadge {...args} />
|
|
153
|
+
<PrimaryBadge {...args} />
|
|
154
|
+
<PrimaryHeadlineBadge {...args} />
|
|
155
|
+
<SecondaryBadge {...args} />
|
|
156
|
+
<SecondaryHeadlineBadge {...args} />
|
|
157
|
+
<WarnBadge {...args} />
|
|
158
|
+
</Cluster>
|
|
159
|
+
<Cluster justify="flex-start" align="center" childGap="1.5rem">
|
|
160
|
+
<InfoBadge {...args} />
|
|
161
|
+
<RightIconBadge {...args} />
|
|
162
|
+
<NoIconBadge {...args} />
|
|
163
|
+
</Cluster>
|
|
164
|
+
</Stack>
|
|
165
|
+
</Box>
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
};
|
|
@@ -10,11 +10,20 @@ import {
|
|
|
10
10
|
SEA_GREEN,
|
|
11
11
|
ZEST_ORANGE
|
|
12
12
|
} from "../../../constants/colors";
|
|
13
|
+
import {
|
|
14
|
+
FONT_SIZE,
|
|
15
|
+
FONT_WEIGHT_REGULAR,
|
|
16
|
+
FONT_WEIGHT_SEMIBOLD
|
|
17
|
+
} from "../../../constants/style_constants";
|
|
18
|
+
import { fallbackValues as textTheme } from "../text/Text.theme";
|
|
13
19
|
|
|
14
20
|
const background = {
|
|
15
21
|
info: `${INFO_BLUE}`,
|
|
16
22
|
warn: `${HALF_COLONIAL_WHITE}`,
|
|
17
23
|
primary: `${CORNFLOWER_BLUE}`,
|
|
24
|
+
primaryHeadline: `${CORNFLOWER_BLUE}`,
|
|
25
|
+
secondary: `${ROYAL_BLUE_VIVID}`,
|
|
26
|
+
secondaryHeadline: `${ROYAL_BLUE_VIVID}`,
|
|
18
27
|
success: `${HINT_GREEN}`,
|
|
19
28
|
disabled: `${GRECIAN_GREY}`
|
|
20
29
|
};
|
|
@@ -23,11 +32,50 @@ const color = {
|
|
|
23
32
|
info: `${MATISSE_BLUE}`,
|
|
24
33
|
warn: `${ZEST_ORANGE}`,
|
|
25
34
|
primary: `${ROYAL_BLUE_VIVID}`,
|
|
35
|
+
primaryHeadline: `${ROYAL_BLUE_VIVID}`,
|
|
36
|
+
secondary: `${CORNFLOWER_BLUE}`,
|
|
37
|
+
secondaryHeadline: `${CORNFLOWER_BLUE}`,
|
|
26
38
|
success: `${SEA_GREEN}`,
|
|
27
39
|
disabled: `${MANATEE_GREY}`
|
|
28
40
|
};
|
|
29
41
|
|
|
42
|
+
const fontWeight = {
|
|
43
|
+
info: FONT_WEIGHT_REGULAR,
|
|
44
|
+
warn: FONT_WEIGHT_REGULAR,
|
|
45
|
+
primary: FONT_WEIGHT_REGULAR,
|
|
46
|
+
primaryHeadline: FONT_WEIGHT_SEMIBOLD,
|
|
47
|
+
secondary: FONT_WEIGHT_REGULAR,
|
|
48
|
+
secondaryHeadline: FONT_WEIGHT_SEMIBOLD,
|
|
49
|
+
success: FONT_WEIGHT_REGULAR,
|
|
50
|
+
disabled: FONT_WEIGHT_REGULAR
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const fontSizeMobile = {
|
|
54
|
+
info: textTheme.fontSize.pXXS,
|
|
55
|
+
warn: textTheme.fontSize.pXXS,
|
|
56
|
+
primary: textTheme.fontSize.pXXS,
|
|
57
|
+
primaryHeadline: textTheme.fontSize.pXS,
|
|
58
|
+
secondary: textTheme.fontSize.pXXS,
|
|
59
|
+
secondaryHeadline: textTheme.fontSize.pXS,
|
|
60
|
+
success: textTheme.fontSize.pXXS,
|
|
61
|
+
disabled: textTheme.fontSize.pXXS
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const fontSizeDesktop = {
|
|
65
|
+
info: textTheme.fontSize.pXS,
|
|
66
|
+
warn: textTheme.fontSize.pXS,
|
|
67
|
+
primary: textTheme.fontSize.pXS,
|
|
68
|
+
primaryHeadline: textTheme.fontSize.pS,
|
|
69
|
+
secondary: textTheme.fontSize.pXS,
|
|
70
|
+
secondaryHeadline: textTheme.fontSize.pS,
|
|
71
|
+
success: textTheme.fontSize.pXS,
|
|
72
|
+
disabled: textTheme.fontSize.pXS
|
|
73
|
+
};
|
|
74
|
+
|
|
30
75
|
export const fallbackValues = {
|
|
31
76
|
background,
|
|
32
|
-
color
|
|
77
|
+
color,
|
|
78
|
+
fontWeight,
|
|
79
|
+
fontSizeMobile,
|
|
80
|
+
fontSizeDesktop
|
|
33
81
|
};
|
|
@@ -5,6 +5,17 @@ export interface BadgeProps {
|
|
|
5
5
|
label: string;
|
|
6
6
|
Icon?: JSX.Element;
|
|
7
7
|
iconOnLeft?: boolean;
|
|
8
|
+
variant?:
|
|
9
|
+
| "info"
|
|
10
|
+
| "warn"
|
|
11
|
+
| "primary"
|
|
12
|
+
| "primaryHeadline"
|
|
13
|
+
| "secondary"
|
|
14
|
+
| "secondaryHeadline"
|
|
15
|
+
| "success"
|
|
16
|
+
| "disabled";
|
|
17
|
+
id?: string;
|
|
18
|
+
extraStyles?: string;
|
|
8
19
|
}
|
|
9
20
|
|
|
10
21
|
export const Badge: React.FC<Expand<BadgeProps> & HTMLAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as BreadcrumbStories from './Breadcrumb.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={BreadcrumbStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
Breadcrumb is a themeable component that generates a horizontal navigation with links separated by chevron icons.
|
|
10
|
+
|
|
11
|
+
The component only takes on prop: `breadcrumbsList`, which must be an array of objects with the following properties:
|
|
12
|
+
|
|
13
|
+
- `linkText`: string for the link's text
|
|
14
|
+
- `linkDestination`: string or react-router path for the link's URL
|
|
15
|
+
- `isActive`: boolean, changes the style and cursor of the link to represent the current page
|
|
16
|
+
|
|
17
|
+
Breadcrumb uses the InternalLink component for each crumb, which uses the Link component from react-router-dom.
|
|
18
|
+
|
|
19
|
+
<Story />
|
|
20
|
+
|
|
21
|
+
<Controls />
|