@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,47 @@
|
|
|
1
|
+
import Breadcrumb from "./Breadcrumb";
|
|
2
|
+
|
|
3
|
+
const meta = {
|
|
4
|
+
title: "Atoms/Breadcrumb",
|
|
5
|
+
component: Breadcrumb,
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: "centered",
|
|
8
|
+
controls: { expanded: true }
|
|
9
|
+
},
|
|
10
|
+
tags: ["!autodocs"],
|
|
11
|
+
args: {
|
|
12
|
+
breadcrumbsList: []
|
|
13
|
+
},
|
|
14
|
+
argTypes: {
|
|
15
|
+
breadcrumbsList: {
|
|
16
|
+
control: { type: "array" },
|
|
17
|
+
table: {
|
|
18
|
+
type: { summary: "array" },
|
|
19
|
+
defaultValue: { summary: [] }
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default meta;
|
|
26
|
+
|
|
27
|
+
export const Basic = {
|
|
28
|
+
args: {
|
|
29
|
+
breadcrumbsList: [
|
|
30
|
+
{
|
|
31
|
+
linkText: "Home",
|
|
32
|
+
linkDestination: "/",
|
|
33
|
+
isActive: false
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
linkText: "Page",
|
|
37
|
+
linkDestination: "/page",
|
|
38
|
+
isActive: false
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
linkText: "Another Page",
|
|
42
|
+
linkDestination: "/another-page",
|
|
43
|
+
isActive: true
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
};
|
|
@@ -1,32 +1,14 @@
|
|
|
1
1
|
import React, { useContext, forwardRef } from "react";
|
|
2
2
|
import styled, { ThemeContext } from "styled-components";
|
|
3
|
-
import posed from "react-pose";
|
|
4
|
-
import { linear } from "@popmotion/easing";
|
|
5
3
|
import Text from "../text";
|
|
6
|
-
import { Box, Center } from "../layouts";
|
|
4
|
+
import { Box, Center, Motion } from "../layouts";
|
|
7
5
|
import { fallbackValues } from "./ButtonWithAction.theme";
|
|
8
6
|
|
|
9
7
|
import SpinnerIcon from "../../../deprecated/spinner";
|
|
10
8
|
import { noop } from "../../../util/general";
|
|
11
9
|
import { createThemeValues } from "../../../util/themeUtils";
|
|
12
10
|
|
|
13
|
-
const
|
|
14
|
-
fixed: {
|
|
15
|
-
rotate: "0deg"
|
|
16
|
-
},
|
|
17
|
-
rotate: {
|
|
18
|
-
rotate: "360deg",
|
|
19
|
-
transition: {
|
|
20
|
-
rotate: {
|
|
21
|
-
ease: linear,
|
|
22
|
-
duration: 1000,
|
|
23
|
-
loop: Infinity
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const SpinnerContainer = styled.div`
|
|
11
|
+
const SpinnerContainer = styled(Motion)`
|
|
30
12
|
width: 100%;
|
|
31
13
|
display: flex;
|
|
32
14
|
flex-direction: row;
|
|
@@ -34,13 +16,9 @@ const SpinnerContainer = styled.div`
|
|
|
34
16
|
justify-content: center;
|
|
35
17
|
`;
|
|
36
18
|
|
|
37
|
-
const SpinnerIconWrapper = styled(rotate)``;
|
|
38
|
-
|
|
39
19
|
const Spinner = ({ color, isMobile }) => (
|
|
40
20
|
<SpinnerContainer>
|
|
41
|
-
<
|
|
42
|
-
<SpinnerIcon color={color} isMobile={isMobile} />
|
|
43
|
-
</SpinnerIconWrapper>
|
|
21
|
+
<SpinnerIcon color={color} isMobile={isMobile} />
|
|
44
22
|
</SpinnerContainer>
|
|
45
23
|
);
|
|
46
24
|
|
|
@@ -82,16 +60,12 @@ const ButtonWithAction = forwardRef(
|
|
|
82
60
|
ref
|
|
83
61
|
) => {
|
|
84
62
|
const themeContext = useContext(ThemeContext);
|
|
85
|
-
console.log("theme context is", themeContext);
|
|
86
|
-
console.log("fallback values are", fallbackValues);
|
|
87
|
-
console.log("variant is", variant);
|
|
88
63
|
const themeValues = createThemeValues(
|
|
89
64
|
themeContext,
|
|
90
65
|
fallbackValues,
|
|
91
66
|
"Button",
|
|
92
67
|
variant
|
|
93
68
|
);
|
|
94
|
-
console.log("theme values are", themeValues);
|
|
95
69
|
const { isMobile } = themeContext;
|
|
96
70
|
|
|
97
71
|
const hoverStyles = `
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Button } from "../../../stories/Button";
|
|
2
1
|
import ButtonWithAction from "./ButtonWithAction";
|
|
3
2
|
import { fn } from "@storybook/test";
|
|
4
3
|
|
|
@@ -108,3 +107,17 @@ export const WhiteSecondary = {
|
|
|
108
107
|
...Primary.args,
|
|
109
108
|
variant: "whiteSecondary"
|
|
110
109
|
};
|
|
110
|
+
|
|
111
|
+
export const GreenPrimary = {
|
|
112
|
+
args: {
|
|
113
|
+
...Primary.args,
|
|
114
|
+
variant: "greenPrimary"
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const GreenSecondary = {
|
|
119
|
+
args: {
|
|
120
|
+
...Primary.args,
|
|
121
|
+
variant: "greenSecondary"
|
|
122
|
+
}
|
|
123
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { colors, styleConstants } from "../../../constants";
|
|
2
|
+
import { adjustHexColor } from "../../../util/general";
|
|
2
3
|
|
|
3
4
|
const {
|
|
4
5
|
WHITE,
|
|
@@ -6,9 +7,13 @@ const {
|
|
|
6
7
|
SAPPHIRE_BLUE,
|
|
7
8
|
PEACOCK_BLUE,
|
|
8
9
|
MANATEE_GREY,
|
|
9
|
-
|
|
10
|
+
LUCKY_POINT,
|
|
11
|
+
HINT_GREEN,
|
|
12
|
+
SEA_GREEN,
|
|
10
13
|
RASPBERRY,
|
|
11
|
-
ERROR_COLOR
|
|
14
|
+
ERROR_COLOR,
|
|
15
|
+
LUCKY_POINT_DARK,
|
|
16
|
+
HAWKES_BLUE
|
|
12
17
|
} = colors;
|
|
13
18
|
|
|
14
19
|
const { LINK_TEXT_DECORATION } = styleConstants;
|
|
@@ -24,8 +29,10 @@ const disabledBorderColor = {
|
|
|
24
29
|
tertiary: TRANSPARENT,
|
|
25
30
|
danger: MANATEE_GREY,
|
|
26
31
|
dangerSecondary: MANATEE_GREY,
|
|
32
|
+
whitePrimary: MANATEE_GREY,
|
|
27
33
|
whiteSecondary: MANATEE_GREY,
|
|
28
|
-
|
|
34
|
+
greenPrimary: SEA_GREEN,
|
|
35
|
+
greenSecondary: SEA_GREEN
|
|
29
36
|
};
|
|
30
37
|
|
|
31
38
|
const disabledColor = {
|
|
@@ -39,8 +46,10 @@ const disabledColor = {
|
|
|
39
46
|
tertiary: MANATEE_GREY,
|
|
40
47
|
danger: WHITE,
|
|
41
48
|
dangerSecondary: MANATEE_GREY,
|
|
49
|
+
whitePrimary: MANATEE_GREY,
|
|
42
50
|
whiteSecondary: MANATEE_GREY,
|
|
43
|
-
|
|
51
|
+
greenPrimary: WHITE,
|
|
52
|
+
greenSecondary: SEA_GREEN
|
|
44
53
|
};
|
|
45
54
|
|
|
46
55
|
const disabledBackgroundColor = {
|
|
@@ -54,8 +63,10 @@ const disabledBackgroundColor = {
|
|
|
54
63
|
tertiary: TRANSPARENT,
|
|
55
64
|
danger: MANATEE_GREY,
|
|
56
65
|
dangerSecondary: TRANSPARENT,
|
|
66
|
+
whitePrimary: TRANSPARENT,
|
|
57
67
|
whiteSecondary: TRANSPARENT,
|
|
58
|
-
|
|
68
|
+
greenPrimary: SEA_GREEN,
|
|
69
|
+
greenSecondary: TRANSPARENT
|
|
59
70
|
};
|
|
60
71
|
|
|
61
72
|
const padding = {
|
|
@@ -69,23 +80,27 @@ const padding = {
|
|
|
69
80
|
ghost: "0.65rem 0",
|
|
70
81
|
danger: "0.75rem 1.5rem",
|
|
71
82
|
dangerSecondary: "0.75rem 1.5rem",
|
|
83
|
+
whitePrimary: "1.125rem 0.75rem",
|
|
72
84
|
whiteSecondary: "0.75rem 2rem",
|
|
73
|
-
|
|
85
|
+
greenPrimary: "0.75rem 1.5rem",
|
|
86
|
+
greenSecondary: "0.75rem 1.5rem"
|
|
74
87
|
};
|
|
75
88
|
|
|
76
89
|
const color = {
|
|
77
90
|
primary: WHITE,
|
|
78
|
-
secondary:
|
|
79
|
-
back:
|
|
91
|
+
secondary: LUCKY_POINT,
|
|
92
|
+
back: LUCKY_POINT,
|
|
80
93
|
smallPrimary: WHITE,
|
|
81
|
-
smallSecondary:
|
|
82
|
-
smallGhost:
|
|
83
|
-
ghost:
|
|
84
|
-
tertiary:
|
|
94
|
+
smallSecondary: LUCKY_POINT,
|
|
95
|
+
smallGhost: LUCKY_POINT,
|
|
96
|
+
ghost: LUCKY_POINT,
|
|
97
|
+
tertiary: LUCKY_POINT,
|
|
85
98
|
danger: WHITE,
|
|
86
99
|
dangerSecondary: ERROR_COLOR,
|
|
100
|
+
whitePrimary: WHITE,
|
|
87
101
|
whiteSecondary: WHITE,
|
|
88
|
-
|
|
102
|
+
greenPrimary: WHITE,
|
|
103
|
+
greenSecondary: SEA_GREEN
|
|
89
104
|
};
|
|
90
105
|
|
|
91
106
|
const fontSizeVariant = {
|
|
@@ -100,7 +115,9 @@ const fontSizeVariant = {
|
|
|
100
115
|
danger: "pS",
|
|
101
116
|
dangerSecondary: "pS",
|
|
102
117
|
whiteSecondary: "pS",
|
|
103
|
-
whitePrimary: "pS"
|
|
118
|
+
whitePrimary: "pS",
|
|
119
|
+
greenPrimary: "pS",
|
|
120
|
+
greenSecondary: "pS"
|
|
104
121
|
};
|
|
105
122
|
|
|
106
123
|
const fontWeight = {
|
|
@@ -115,7 +132,9 @@ const fontWeight = {
|
|
|
115
132
|
danger: "600",
|
|
116
133
|
dangerSecondary: "600",
|
|
117
134
|
whiteSecondary: "600",
|
|
118
|
-
whitePrimary: "600"
|
|
135
|
+
whitePrimary: "600",
|
|
136
|
+
greenPrimary: "600",
|
|
137
|
+
greenSecondary: "600"
|
|
119
138
|
};
|
|
120
139
|
|
|
121
140
|
const height = {
|
|
@@ -129,8 +148,10 @@ const height = {
|
|
|
129
148
|
tertiary: "3rem",
|
|
130
149
|
danger: "3rem",
|
|
131
150
|
dangerSecondary: "3rem",
|
|
151
|
+
whitePrimary: "auto",
|
|
132
152
|
whiteSecondary: "3rem",
|
|
133
|
-
|
|
153
|
+
greenPrimary: "3rem",
|
|
154
|
+
greenSecondary: "3rem"
|
|
134
155
|
};
|
|
135
156
|
|
|
136
157
|
const minWidth = {
|
|
@@ -144,8 +165,10 @@ const minWidth = {
|
|
|
144
165
|
tertiary: "130px",
|
|
145
166
|
danger: "130px",
|
|
146
167
|
dangerSecondary: "157px",
|
|
168
|
+
whitePrimary: "130px",
|
|
147
169
|
whiteSecondary: "160px",
|
|
148
|
-
|
|
170
|
+
greenPrimary: "130px",
|
|
171
|
+
greenSecondary: "130px"
|
|
149
172
|
};
|
|
150
173
|
|
|
151
174
|
const textDecoration = {
|
|
@@ -159,118 +182,134 @@ const textDecoration = {
|
|
|
159
182
|
tertiary: "none",
|
|
160
183
|
danger: "none",
|
|
161
184
|
dangerSecondary: "none",
|
|
185
|
+
whitePrimary: "none",
|
|
162
186
|
whiteSecondary: "none",
|
|
163
|
-
|
|
187
|
+
greenPrimary: "none",
|
|
188
|
+
greenSecondary: "none"
|
|
164
189
|
};
|
|
165
190
|
|
|
166
191
|
const backgroundColor = {
|
|
167
|
-
primary:
|
|
192
|
+
primary: LUCKY_POINT,
|
|
168
193
|
secondary: TRANSPARENT,
|
|
169
194
|
back: TRANSPARENT,
|
|
170
|
-
smallPrimary:
|
|
195
|
+
smallPrimary: LUCKY_POINT,
|
|
171
196
|
smallSecondary: TRANSPARENT,
|
|
172
197
|
smallGhost: TRANSPARENT,
|
|
173
198
|
ghost: TRANSPARENT,
|
|
174
199
|
tertiary: TRANSPARENT,
|
|
175
200
|
danger: RASPBERRY,
|
|
176
201
|
dangerSecondary: TRANSPARENT,
|
|
202
|
+
whitePrimary: TRANSPARENT,
|
|
177
203
|
whiteSecondary: TRANSPARENT,
|
|
178
|
-
|
|
204
|
+
greenPrimary: SEA_GREEN,
|
|
205
|
+
greenSecondary: TRANSPARENT
|
|
179
206
|
};
|
|
180
207
|
|
|
181
208
|
const border = {
|
|
182
|
-
primary: "2px solid " +
|
|
183
|
-
secondary: "2px solid " +
|
|
184
|
-
back: "2px solid " +
|
|
185
|
-
smallPrimary: "2px solid " +
|
|
186
|
-
smallSecondary: "2px solid " +
|
|
209
|
+
primary: "2px solid " + LUCKY_POINT,
|
|
210
|
+
secondary: "2px solid " + LUCKY_POINT,
|
|
211
|
+
back: "2px solid " + LUCKY_POINT,
|
|
212
|
+
smallPrimary: "2px solid " + LUCKY_POINT,
|
|
213
|
+
smallSecondary: "2px solid " + LUCKY_POINT,
|
|
187
214
|
smallGhost: "none",
|
|
188
215
|
ghost: "none",
|
|
189
216
|
tertiary: "none",
|
|
190
217
|
danger: "2px solid " + RASPBERRY,
|
|
191
218
|
dangerSecondary: "2px solid " + ERROR_COLOR,
|
|
219
|
+
whitePrimary: "2px solid " + TRANSPARENT,
|
|
192
220
|
whiteSecondary: "2px solid " + WHITE,
|
|
193
|
-
|
|
221
|
+
greenPrimary: "2px solid " + SEA_GREEN,
|
|
222
|
+
greenSecondary: "2px solid " + SEA_GREEN
|
|
194
223
|
};
|
|
195
224
|
|
|
196
225
|
const hoverBackgroundColor = {
|
|
197
|
-
primary:
|
|
198
|
-
secondary:
|
|
226
|
+
primary: LUCKY_POINT_DARK,
|
|
227
|
+
secondary: HAWKES_BLUE,
|
|
199
228
|
back: TRANSPARENT,
|
|
200
|
-
smallPrimary:
|
|
201
|
-
smallSecondary:
|
|
229
|
+
smallPrimary: LUCKY_POINT_DARK,
|
|
230
|
+
smallSecondary: HAWKES_BLUE,
|
|
202
231
|
smallGhost: TRANSPARENT,
|
|
203
232
|
ghost: TRANSPARENT,
|
|
204
233
|
tertiary: TRANSPARENT,
|
|
205
234
|
danger: "#BA002C",
|
|
206
235
|
dangerSecondary: "#FAE7EE",
|
|
236
|
+
whitePrimary: TRANSPARENT,
|
|
207
237
|
whiteSecondary: TRANSPARENT,
|
|
208
|
-
|
|
238
|
+
greenPrimary: adjustHexColor(SEA_GREEN, 10, "darken"),
|
|
239
|
+
greenSecondary: HINT_GREEN
|
|
209
240
|
};
|
|
210
241
|
|
|
211
242
|
const hoverBorderColor = {
|
|
212
|
-
primary:
|
|
213
|
-
secondary:
|
|
243
|
+
primary: LUCKY_POINT_DARK,
|
|
244
|
+
secondary: LUCKY_POINT,
|
|
214
245
|
back: "#DCEAF1",
|
|
215
|
-
smallPrimary:
|
|
216
|
-
smallSecondary:
|
|
246
|
+
smallPrimary: LUCKY_POINT_DARK,
|
|
247
|
+
smallSecondary: LUCKY_POINT,
|
|
217
248
|
smallGhost: TRANSPARENT,
|
|
218
249
|
ghost: TRANSPARENT,
|
|
219
250
|
tertiary: TRANSPARENT,
|
|
220
251
|
danger: "#BA002C",
|
|
221
252
|
dangerSecondary: "#B10541",
|
|
253
|
+
whitePrimary: "2px solid " + TRANSPARENT,
|
|
222
254
|
whiteSecondary: "2px solid " + TRANSPARENT,
|
|
223
|
-
|
|
255
|
+
greenPrimary: SEA_GREEN,
|
|
256
|
+
greenSecondary: SEA_GREEN
|
|
224
257
|
};
|
|
225
258
|
|
|
226
259
|
const hoverColor = {
|
|
227
260
|
primary: WHITE,
|
|
228
|
-
secondary:
|
|
229
|
-
back:
|
|
261
|
+
secondary: LUCKY_POINT,
|
|
262
|
+
back: LUCKY_POINT,
|
|
230
263
|
smallPrimary: WHITE,
|
|
231
|
-
smallSecondary:
|
|
232
|
-
smallGhost:
|
|
233
|
-
ghost:
|
|
234
|
-
tertiary:
|
|
264
|
+
smallSecondary: LUCKY_POINT,
|
|
265
|
+
smallGhost: LUCKY_POINT,
|
|
266
|
+
ghost: LUCKY_POINT,
|
|
267
|
+
tertiary: LUCKY_POINT,
|
|
235
268
|
danger: WHITE,
|
|
236
269
|
dangerSecondary: "#B10541",
|
|
270
|
+
whitePrimary: WHITE,
|
|
237
271
|
whiteSecondary: WHITE,
|
|
238
|
-
|
|
272
|
+
greenPrimary: WHITE,
|
|
273
|
+
greenSecondary: SEA_GREEN
|
|
239
274
|
};
|
|
240
275
|
|
|
241
276
|
const activeBackgroundColor = {
|
|
242
|
-
primary:
|
|
243
|
-
secondary: "
|
|
277
|
+
primary: LUCKY_POINT_DARK,
|
|
278
|
+
secondary: adjustHexColor(HAWKES_BLUE, 10, "darken"),
|
|
244
279
|
back: TRANSPARENT,
|
|
245
|
-
smallPrimary:
|
|
246
|
-
smallSecondary: "
|
|
280
|
+
smallPrimary: LUCKY_POINT_DARK,
|
|
281
|
+
smallSecondary: adjustHexColor(HAWKES_BLUE, 10, "darken"),
|
|
247
282
|
smallGhost: TRANSPARENT,
|
|
248
283
|
ghost: TRANSPARENT,
|
|
249
284
|
tertiary: TRANSPARENT,
|
|
250
285
|
danger: "#870000",
|
|
251
286
|
dangerSecondary: "#FAE7EE",
|
|
287
|
+
whitePrimary: TRANSPARENT,
|
|
252
288
|
whiteSecondary: TRANSPARENT,
|
|
253
|
-
|
|
289
|
+
greenPrimary: adjustHexColor(SEA_GREEN, 20, "darken"),
|
|
290
|
+
greenSecondary: adjustHexColor(HINT_GREEN, 5, "darken")
|
|
254
291
|
};
|
|
255
292
|
|
|
256
293
|
const activeBorderColor = {
|
|
257
|
-
primary:
|
|
258
|
-
secondary:
|
|
294
|
+
primary: adjustHexColor(LUCKY_POINT_DARK, 10, "darken"),
|
|
295
|
+
secondary: LUCKY_POINT,
|
|
259
296
|
back: PEACOCK_BLUE,
|
|
260
|
-
smallPrimary:
|
|
261
|
-
smallSecondary:
|
|
297
|
+
smallPrimary: adjustHexColor(LUCKY_POINT_DARK, 10, "darken"),
|
|
298
|
+
smallSecondary: LUCKY_POINT,
|
|
262
299
|
smallGhost: TRANSPARENT,
|
|
263
300
|
ghost: TRANSPARENT,
|
|
264
301
|
tertiary: TRANSPARENT,
|
|
265
302
|
danger: "#870000",
|
|
266
303
|
dangerSecondary: "#910029",
|
|
304
|
+
whitePrimary: "2px solid " + TRANSPARENT,
|
|
267
305
|
whiteSecondary: "2px solid " + TRANSPARENT,
|
|
268
|
-
|
|
306
|
+
greenPrimary: SEA_GREEN,
|
|
307
|
+
greenSecondary: SEA_GREEN
|
|
269
308
|
};
|
|
270
309
|
|
|
271
310
|
const activeColor = {
|
|
272
311
|
primary: WHITE,
|
|
273
|
-
secondary:
|
|
312
|
+
secondary: LUCKY_POINT,
|
|
274
313
|
back: PEACOCK_BLUE,
|
|
275
314
|
smallPrimary: WHITE,
|
|
276
315
|
smallSecondary: PEACOCK_BLUE,
|
|
@@ -279,8 +318,10 @@ const activeColor = {
|
|
|
279
318
|
tertiary: PEACOCK_BLUE,
|
|
280
319
|
danger: WHITE,
|
|
281
320
|
dangerSecondary: "#910029",
|
|
321
|
+
whitePrimary: WHITE,
|
|
282
322
|
whiteSecondary: WHITE,
|
|
283
|
-
|
|
323
|
+
greenPrimary: WHITE,
|
|
324
|
+
greenSecondary: SEA_GREEN
|
|
284
325
|
};
|
|
285
326
|
|
|
286
327
|
export const fallbackValues = {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as ButtonWithLinkStories from './ButtonWithLink.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={ButtonWithLinkStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
`ButtonWithLink` wraps a [ButtonWithAction](?path=/docs/atoms-buttonwithaction--docs) component with either a `ExternalLink` or `InternalLink` component, unless the `disabled` prop is `true`, then it returns just the disabled `ButtonWithAction`.
|
|
10
|
+
|
|
11
|
+
Any additional props not specified in the component params will be passed down to the underlying `ButtonWithAction` component, including the `text` prop, which will be used as the text for the button.
|
|
12
|
+
|
|
13
|
+
The underlying `ButtonWithAction` component is themeable, and the variant can be changed by passing a valid `variant` value to `ButtonWithLink`.
|
|
14
|
+
|
|
15
|
+
`extraStyles` will be passed down to the `ButtonWithAction`, while `linkExtraStyles` are passed to the `ExternalLink` or `InternalLink` component.
|
|
16
|
+
|
|
17
|
+
`fileLink` forces the use of the `ExternalLink` component, even if the value of `url` is not an full external link with a valid URL prefix like `http://`.
|
|
18
|
+
|
|
19
|
+
<Story />
|
|
20
|
+
|
|
21
|
+
<Controls />
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import ButtonWithLink from "./ButtonWithLink";
|
|
2
|
+
|
|
3
|
+
const meta = {
|
|
4
|
+
title: "Atoms/ButtonWithLink",
|
|
5
|
+
component: ButtonWithLink,
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: "centered",
|
|
8
|
+
controls: { expanded: true }
|
|
9
|
+
},
|
|
10
|
+
tags: ["!autodocs"],
|
|
11
|
+
args: {
|
|
12
|
+
url: "/",
|
|
13
|
+
disabled: false,
|
|
14
|
+
fileLink: false,
|
|
15
|
+
extraStyles: "",
|
|
16
|
+
linkExtraStyles: "",
|
|
17
|
+
newTab: false,
|
|
18
|
+
dataQa: undefined,
|
|
19
|
+
text: "Test Button",
|
|
20
|
+
variant: "primary"
|
|
21
|
+
},
|
|
22
|
+
argTypes: {
|
|
23
|
+
url: {
|
|
24
|
+
description: "URL for the button, can be interal or external",
|
|
25
|
+
control: { type: "text" },
|
|
26
|
+
table: {
|
|
27
|
+
type: { summary: "string" },
|
|
28
|
+
defaultValue: { summary: "/" }
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
disabled: {
|
|
32
|
+
description: "Whether or not the button is disabled",
|
|
33
|
+
control: { type: "boolean" },
|
|
34
|
+
table: {
|
|
35
|
+
type: { summary: "boolean" },
|
|
36
|
+
defaultValue: { summary: false }
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
fileLink: {
|
|
40
|
+
description:
|
|
41
|
+
"Forces `ExternalLink` to be used even if `url` is an internal value",
|
|
42
|
+
control: { type: "boolean" },
|
|
43
|
+
table: {
|
|
44
|
+
type: { summary: "boolean" },
|
|
45
|
+
defaultValue: { summary: false }
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
extraStyles: {
|
|
49
|
+
description: "Styles for the underlying `ButtonWithAction` component",
|
|
50
|
+
control: { type: "text" },
|
|
51
|
+
table: {
|
|
52
|
+
type: { summary: "string" },
|
|
53
|
+
defaultValue: { summary: "" }
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
linkExtraStyles: {
|
|
57
|
+
description:
|
|
58
|
+
"Styles for the underlying `ExternalLink` or `InternalLink` component",
|
|
59
|
+
control: { type: "text" },
|
|
60
|
+
table: {
|
|
61
|
+
type: { summary: "string" },
|
|
62
|
+
defaultValue: { summary: "" }
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
newTab: {
|
|
66
|
+
description: "Whether or not the link will open in a new tab/window",
|
|
67
|
+
control: { type: "boolean" },
|
|
68
|
+
table: {
|
|
69
|
+
type: { summary: "boolean" },
|
|
70
|
+
defaultValue: { summary: false }
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
dataQa: {
|
|
74
|
+
description: "`data-qa` value for the underlying link",
|
|
75
|
+
control: { type: "text" },
|
|
76
|
+
table: {
|
|
77
|
+
type: { summary: "string" },
|
|
78
|
+
defaultValue: { summary: undefined }
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
text: {
|
|
82
|
+
description: "The button's text",
|
|
83
|
+
control: { type: "text" },
|
|
84
|
+
table: {
|
|
85
|
+
type: { summary: "string" },
|
|
86
|
+
defaultValue: { summary: undefined }
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
variant: {
|
|
90
|
+
description: "The button's style variant",
|
|
91
|
+
control: { type: "text" },
|
|
92
|
+
table: {
|
|
93
|
+
type: { summary: "string" },
|
|
94
|
+
defaultValue: { summary: undefined }
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export default meta;
|
|
101
|
+
|
|
102
|
+
export const Basic = {
|
|
103
|
+
args: {
|
|
104
|
+
url: "http://example.com"
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export const SecondaryVariant = {
|
|
109
|
+
args: {
|
|
110
|
+
url: "http://example.com",
|
|
111
|
+
variant: "secondary"
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export const Disabled = {
|
|
116
|
+
args: {
|
|
117
|
+
url: "http://example.com",
|
|
118
|
+
disabled: true
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export const ExtraStyles = {
|
|
123
|
+
args: {
|
|
124
|
+
url: "http://example.com",
|
|
125
|
+
extraStyles: "border-radius: 50%"
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export const LinkExtraStyles = {
|
|
130
|
+
args: {
|
|
131
|
+
url: "http://example.com",
|
|
132
|
+
linkExtraStyles: "opacity: 50%;"
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export const FileLink = {
|
|
137
|
+
args: {
|
|
138
|
+
url: "test.pdf",
|
|
139
|
+
fileLink: true
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export const NewTab = {
|
|
144
|
+
args: {
|
|
145
|
+
url: "http://example.com",
|
|
146
|
+
newTab: true
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export const DataQA = {
|
|
151
|
+
args: {
|
|
152
|
+
url: "http://example.com",
|
|
153
|
+
dataQa: "important-link"
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
export const InternalLink = {
|
|
158
|
+
args: {
|
|
159
|
+
url: "/example"
|
|
160
|
+
}
|
|
161
|
+
};
|
|
@@ -14,6 +14,7 @@ import Stack from "../layouts/Stack";
|
|
|
14
14
|
import CardImage from "./CardImage.styled";
|
|
15
15
|
import CardText from "./CardText";
|
|
16
16
|
import CardHeader from "./CardHeader";
|
|
17
|
+
import { noop } from "../../../util/general";
|
|
17
18
|
|
|
18
19
|
const Card = ({
|
|
19
20
|
borderRadius = "4px",
|
|
@@ -26,8 +27,13 @@ const Card = ({
|
|
|
26
27
|
imgHeight = "150px",
|
|
27
28
|
imgObjectFit = "none",
|
|
28
29
|
imgAltText,
|
|
30
|
+
hasContentBackgroundColor = false,
|
|
31
|
+
onQuitClick = noop,
|
|
29
32
|
padding = "24px",
|
|
33
|
+
showQuitLink = false,
|
|
30
34
|
text,
|
|
35
|
+
textAs = "p",
|
|
36
|
+
titleAs = "h2",
|
|
31
37
|
titleText,
|
|
32
38
|
titleVariant = "small",
|
|
33
39
|
themeValues,
|
|
@@ -87,12 +93,27 @@ const Card = ({
|
|
|
87
93
|
alt={imgAltText}
|
|
88
94
|
/>
|
|
89
95
|
)}
|
|
90
|
-
<Box
|
|
96
|
+
<Box
|
|
97
|
+
padding="0"
|
|
98
|
+
width="100%"
|
|
99
|
+
extraStyles={`
|
|
100
|
+
flex-basis: 100%;
|
|
101
|
+
background-color: ${
|
|
102
|
+
hasContentBackgroundColor
|
|
103
|
+
? themeValues.contentBackgroundColor
|
|
104
|
+
: ""
|
|
105
|
+
};
|
|
106
|
+
`}
|
|
107
|
+
>
|
|
91
108
|
{text && (
|
|
92
109
|
<CardText
|
|
110
|
+
onQuitClick={onQuitClick}
|
|
93
111
|
padding={padding}
|
|
112
|
+
showQuitLink={showQuitLink}
|
|
113
|
+
titleAs={titleAs}
|
|
94
114
|
titleText={titleText}
|
|
95
115
|
text={text}
|
|
116
|
+
textAs={textAs}
|
|
96
117
|
titleVariant={titleVariant}
|
|
97
118
|
/>
|
|
98
119
|
)}
|