@magento/venia-ui 9.3.0-alpha.1 → 9.4.0-alpha.1
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/i18n/en_US.json +1 -1
- package/lib/RootComponents/CMS/cms.module.css +1 -1
- package/lib/RootComponents/Category/NoProductsFound/noProductsFound.module.css +18 -19
- package/lib/RootComponents/Category/category.module.css +50 -70
- package/lib/components/Accordion/accordion.module.css +4 -2
- package/lib/components/Accordion/section.module.css +24 -16
- package/lib/components/AccountChip/accountChip.module.css +5 -5
- package/lib/components/AccountInformationPage/accountInformationPage.module.css +22 -35
- package/lib/components/AccountInformationPage/editForm.module.css +13 -12
- package/lib/components/AccountInformationPage/editModal.module.css +1 -1
- package/lib/components/AccountMenu/accountMenu.module.css +34 -31
- package/lib/components/AccountMenu/accountMenuItems.module.css +20 -15
- package/lib/components/AddToCartDialog/addToCartDialog.module.css +27 -25
- package/lib/components/AddressBookPage/addEditDialog.module.css +10 -14
- package/lib/components/AddressBookPage/addressBookPage.module.css +30 -41
- package/lib/components/AddressBookPage/addressCard.module.css +61 -59
- package/lib/components/AuthBar/authBar.module.css +13 -12
- package/lib/components/AuthModal/authModal.module.css +5 -3
- package/lib/components/Breadcrumbs/breadcrumbs.module.css +12 -19
- package/lib/components/Button/button.module.css +95 -59
- package/lib/components/ButtonGroup/button.module.css +30 -28
- package/lib/components/ButtonGroup/buttonGroup.module.css +4 -4
- package/lib/components/CartPage/GiftCards/giftCard.module.css +3 -3
- package/lib/components/CartPage/GiftCards/giftCards.module.css +44 -41
- package/lib/components/CartPage/PriceAdjustments/CouponCode/couponCode.module.css +26 -18
- package/lib/components/CartPage/PriceAdjustments/ShippingMethods/__tests__/__snapshots__/shippingRadios.spec.js.snap +4 -0
- package/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingForm.module.css +7 -6
- package/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingMethods.module.css +9 -18
- package/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadio.module.css +1 -1
- package/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadios.module.css +5 -18
- package/lib/components/CartPage/PriceAdjustments/__tests__/__snapshots__/giftCardSection.ee.spec.js.snap +1 -1
- package/lib/components/CartPage/PriceAdjustments/__tests__/__snapshots__/giftOptionsSection.ce.spec.js.snap +1 -1
- package/lib/components/CartPage/PriceAdjustments/__tests__/__snapshots__/giftOptionsSection.ee.spec.js.snap +3 -3
- package/lib/components/CartPage/PriceAdjustments/__tests__/giftCardSection.ce.spec.js +1 -1
- package/lib/components/CartPage/PriceAdjustments/__tests__/giftCardSection.ee.spec.js +1 -1
- package/lib/components/CartPage/PriceAdjustments/__tests__/giftOptionsSection.ce.spec.js +1 -1
- package/lib/components/CartPage/PriceAdjustments/__tests__/giftOptionsSection.ee.spec.js +1 -1
- package/lib/components/CartPage/PriceAdjustments/giftCardSection.ce.js +2 -2
- package/lib/components/CartPage/PriceAdjustments/giftOptionsSection.ce.js +2 -2
- package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/giftCardSummary.ce.spec.js.snap +1 -1
- package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/giftCardSummary.ee.spec.js.snap +4 -4
- package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/giftOptionsSummary.ce.spec.js.snap +1 -1
- package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/giftOptionsSummary.ee.spec.js.snap +4 -4
- package/lib/components/CartPage/PriceSummary/__tests__/giftCardSummary.ce.spec.js +1 -1
- package/lib/components/CartPage/PriceSummary/__tests__/giftCardSummary.ee.spec.js +1 -1
- package/lib/components/CartPage/PriceSummary/__tests__/giftOptionsSummary.ce.spec.js +1 -1
- package/lib/components/CartPage/PriceSummary/__tests__/giftOptionsSummary.ee.spec.js +1 -1
- package/lib/components/CartPage/PriceSummary/giftOptionsSummary.ce.js +2 -2
- package/lib/components/CartPage/PriceSummary/priceSummary.module.css +16 -16
- package/lib/components/CartPage/ProductListing/EditModal/productDetail.module.css +16 -13
- package/lib/components/CartPage/ProductListing/EditModal/productForm.js +2 -2
- package/lib/components/CartPage/ProductListing/EditModal/productForm.module.css +28 -22
- package/lib/components/CartPage/ProductListing/__tests__/__snapshots__/product.spec.js.snap +4 -0
- package/lib/components/CartPage/ProductListing/__tests__/quantity.spec.js +3 -3
- package/lib/components/CartPage/ProductListing/errorMessage.module.css +11 -7
- package/lib/components/CartPage/ProductListing/product.module.css +67 -59
- package/lib/components/CartPage/ProductListing/productListing.module.css +6 -5
- package/lib/components/CartPage/ProductListing/quantity.js +8 -92
- package/lib/components/CartPage/cartPage.module.css +18 -22
- package/lib/components/CategoryList/categoryList.module.css +8 -7
- package/lib/components/CategoryList/categoryTile.module.css +14 -11
- package/lib/components/CategoryTree/categoryLeaf.module.css +19 -16
- package/lib/components/CategoryTree/categoryTree.module.css +2 -2
- package/lib/components/Checkbox/checkbox.module.css +33 -30
- package/lib/components/Checkout/Receipt/receipt.module.css +28 -23
- package/lib/components/Checkout/addressForm.module.css +20 -20
- package/lib/components/Checkout/braintreeDropin.module.css +1 -1
- package/lib/components/Checkout/checkoutButton.module.css +2 -1
- package/lib/components/Checkout/flow.module.css +34 -30
- package/lib/components/Checkout/form.module.css +13 -9
- package/lib/components/Checkout/label.module.css +6 -6
- package/lib/components/Checkout/paymentsForm.module.css +23 -21
- package/lib/components/Checkout/section.module.css +30 -31
- package/lib/components/Checkout/shippingForm.module.css +1 -1
- package/lib/components/CheckoutPage/AddressBook/addressBook.module.css +52 -61
- package/lib/components/CheckoutPage/AddressBook/addressCard.module.css +43 -47
- package/lib/components/CheckoutPage/BillingAddress/billingAddress.module.css +14 -28
- package/lib/components/CheckoutPage/GuestSignIn/guestSignIn.module.css +28 -26
- package/lib/components/CheckoutPage/ItemsReview/item.js +1 -1
- package/lib/components/CheckoutPage/ItemsReview/item.module.css +29 -18
- package/lib/components/CheckoutPage/ItemsReview/itemsReview.module.css +8 -5
- package/lib/components/CheckoutPage/ItemsReview/showAllButton.module.css +15 -11
- package/lib/components/CheckoutPage/OrderConfirmationPage/createAccount.module.css +12 -26
- package/lib/components/CheckoutPage/OrderConfirmationPage/orderConfirmationPage.module.css +29 -37
- package/lib/components/CheckoutPage/OrderSummary/orderSummary.module.css +12 -17
- package/lib/components/CheckoutPage/PaymentInformation/braintreeDropin.module.css +5 -2
- package/lib/components/CheckoutPage/PaymentInformation/braintreeSummary.module.css +30 -50
- package/lib/components/CheckoutPage/PaymentInformation/creditCard.module.css +20 -34
- package/lib/components/CheckoutPage/PaymentInformation/editCard.module.css +3 -2
- package/lib/components/CheckoutPage/PaymentInformation/paymentInformation.module.css +12 -13
- package/lib/components/CheckoutPage/PaymentInformation/paymentMethods.module.css +17 -14
- package/lib/components/CheckoutPage/PaymentInformation/summary.module.css +9 -9
- package/lib/components/CheckoutPage/ShippingInformation/AddressForm/customerForm.module.css +15 -13
- package/lib/components/CheckoutPage/ShippingInformation/AddressForm/guestForm.module.css +14 -12
- package/lib/components/CheckoutPage/ShippingInformation/card.module.css +7 -7
- package/lib/components/CheckoutPage/ShippingInformation/editModal.module.css +66 -49
- package/lib/components/CheckoutPage/ShippingInformation/shippingInformation.module.css +37 -26
- package/lib/components/CheckoutPage/ShippingMethod/__tests__/__snapshots__/shippingMethod.spec.js.snap +2 -0
- package/lib/components/CheckoutPage/ShippingMethod/__tests__/__snapshots__/updateModal.spec.js.snap +2 -0
- package/lib/components/CheckoutPage/ShippingMethod/completedView.module.css +23 -26
- package/lib/components/CheckoutPage/ShippingMethod/shippingMethod.module.css +17 -15
- package/lib/components/CheckoutPage/ShippingMethod/shippingRadios.module.css +13 -24
- package/lib/components/CheckoutPage/ShippingMethod/updateModal.module.css +1 -1
- package/lib/components/CheckoutPage/checkoutPage.module.css +85 -79
- package/lib/components/CmsBlock/cmsBlock.module.css +3 -1
- package/lib/components/CmsDynamicBlock/__tests__/__snapshots__/cmsDynamicBlock.ce.spec.js.snap +1 -1
- package/lib/components/CmsDynamicBlock/__tests__/__snapshots__/cmsDynamicBlock.ee.spec.js.snap +8 -8
- package/lib/components/CmsDynamicBlock/__tests__/cmsDynamicBlock.ce.spec.js +1 -1
- package/lib/components/CmsDynamicBlock/__tests__/cmsDynamicBlock.ee.spec.js +1 -1
- package/lib/components/CmsDynamicBlock/cmsDynamicBlock.ce.js +2 -2
- package/lib/components/CommunicationsPage/communicationsPage.module.css +14 -20
- package/lib/components/ContactPage/contactPage.module.css +1 -1
- package/lib/components/CreateAccount/createAccount.module.css +24 -27
- package/lib/components/CreateAccountPage/createAccountPage.module.css +13 -12
- package/lib/components/Dialog/__stories__/dialog.module.css +3 -2
- package/lib/components/Dialog/dialog.module.css +98 -99
- package/lib/components/ErrorMessage/errorMessage.module.css +4 -4
- package/lib/components/ErrorView/errorView.module.css +21 -24
- package/lib/components/Field/field.module.css +32 -35
- package/lib/components/Field/fieldIcons.module.css +18 -13
- package/lib/components/Field/message.module.css +11 -7
- package/lib/components/FilterModal/CurrentFilters/currentFilter.js +4 -2
- package/lib/components/FilterModal/CurrentFilters/currentFilter.module.css +14 -11
- package/lib/components/FilterModal/CurrentFilters/currentFilters.module.css +10 -5
- package/lib/components/FilterModal/FilterList/__tests__/filterItemRadio.spec.js +134 -0
- package/lib/components/FilterModal/FilterList/filterItemRadio.js +76 -0
- package/lib/components/FilterModal/FilterList/filterItemRadio.module.css +0 -0
- package/lib/components/FilterModal/FilterList/filterItemRadioGroup.js +86 -0
- package/lib/components/FilterModal/FilterList/filterList.js +65 -41
- package/lib/components/FilterModal/FilterList/filterList.module.css +8 -10
- package/lib/components/FilterModal/__tests__/filterModal.spec.js +58 -3
- package/lib/components/FilterModal/filterBlock.js +4 -0
- package/lib/components/FilterModal/filterBlock.module.css +15 -12
- package/lib/components/FilterModal/filterFooter.module.css +8 -8
- package/lib/components/FilterModal/filterModal.js +4 -2
- package/lib/components/FilterModal/filterModal.module.css +49 -28
- package/lib/components/FilterModal/filterSearch.module.css +1 -1
- package/lib/components/FilterModalOpenButton/filterModalOpenButton.module.css +3 -6
- package/lib/components/FilterSidebar/__tests__/filterSidebar.spec.js +9 -2
- package/lib/components/FilterSidebar/filterSidebar.js +4 -1
- package/lib/components/FilterSidebar/filterSidebar.module.css +33 -25
- package/lib/components/Footer/footer.module.css +89 -109
- package/lib/components/ForgotPassword/ForgotPasswordForm/forgotPasswordForm.module.css +11 -11
- package/lib/components/ForgotPassword/FormSubmissionSuccessful/formSubmissionSuccessful.module.css +7 -7
- package/lib/components/ForgotPassword/forgotPassword.module.css +9 -8
- package/lib/components/ForgotPasswordPage/forgotPasswordPage.module.css +13 -12
- package/lib/components/Gallery/__tests__/__snapshots__/gallery.spec.js.snap +2 -2
- package/lib/components/Gallery/__tests__/__snapshots__/item.spec.js.snap +1 -1
- package/lib/components/Gallery/__tests__/gallery.spec.js +2 -2
- package/lib/components/Gallery/__tests__/item.spec.js +1 -1
- package/lib/components/Gallery/addToCartButton.module.css +15 -25
- package/lib/components/Gallery/gallery.module.css +7 -7
- package/lib/components/Gallery/item.js +4 -4
- package/lib/components/Gallery/item.module.css +31 -27
- package/lib/components/Header/accountTrigger.module.css +9 -14
- package/lib/components/Header/cartTrigger.module.css +30 -37
- package/lib/components/Header/currencySwitcher.module.css +67 -50
- package/lib/components/Header/header.js +5 -1
- package/lib/components/Header/header.module.css +26 -36
- package/lib/components/Header/navTrigger.module.css +4 -7
- package/lib/components/Header/onlineIndicator.module.css +11 -9
- package/lib/components/Header/searchTrigger.module.css +8 -13
- package/lib/components/Header/storeSwitcher.module.css +61 -52
- package/lib/components/Header/switcherItem.module.css +12 -11
- package/lib/components/HomePage/homePage.module.css +9 -8
- package/lib/components/Icon/icon.module.css +9 -8
- package/lib/components/Image/__stories__/image.module.css +4 -4
- package/lib/components/Image/image.module.css +16 -9
- package/lib/components/LegacyMiniCart/body.module.css +2 -2
- package/lib/components/LegacyMiniCart/cartOptions.module.css +29 -23
- package/lib/components/LegacyMiniCart/emptyMiniCartBody.module.css +9 -9
- package/lib/components/LegacyMiniCart/footer.module.css +10 -6
- package/lib/components/LegacyMiniCart/header.module.css +20 -19
- package/lib/components/LegacyMiniCart/kebab.module.css +19 -28
- package/lib/components/LegacyMiniCart/mask.module.css +2 -1
- package/lib/components/LegacyMiniCart/miniCart.js +3 -0
- package/lib/components/LegacyMiniCart/miniCart.module.css +22 -15
- package/lib/components/LegacyMiniCart/product.module.css +36 -32
- package/lib/components/LegacyMiniCart/productList.module.css +6 -4
- package/lib/components/LegacyMiniCart/productOptions.module.css +9 -9
- package/lib/components/LegacyMiniCart/section.js +2 -0
- package/lib/components/LegacyMiniCart/section.module.css +28 -16
- package/lib/components/LegacyMiniCart/totalsSummary.module.css +11 -10
- package/lib/components/LinkButton/linkButton.module.css +8 -9
- package/lib/components/LoadingIndicator/indicator.module.css +20 -18
- package/lib/components/LoadingIndicator/spinner.module.css +1 -10
- package/lib/components/Main/main.module.css +7 -6
- package/lib/components/Mask/mask.module.css +19 -14
- package/lib/components/MegaMenu/__tests__/__snapshots__/MegaMenu.spec.js.snap +1 -1
- package/lib/components/MegaMenu/__tests__/__snapshots__/Submenu.spec.js.snap +1 -1
- package/lib/components/MegaMenu/megaMenuItem.module.css +9 -7
- package/lib/components/MegaMenu/submenu.js +1 -1
- package/lib/components/MegaMenu/submenu.module.css +22 -16
- package/lib/components/MegaMenu/submenuColumn.module.css +11 -9
- package/lib/components/MiniCart/ProductList/item.module.css +16 -13
- package/lib/components/MiniCart/ProductList/productList.module.css +2 -2
- package/lib/components/MiniCart/miniCart.module.css +81 -67
- package/lib/components/MyAccount/ResetPassword/resetPassword.module.css +25 -26
- package/lib/components/MyAccount/accountLink.module.css +17 -15
- package/lib/components/MyAccount/myAccount.module.css +3 -3
- package/lib/components/Navigation/navHeader.module.css +7 -6
- package/lib/components/Navigation/navigation.module.css +82 -68
- package/lib/components/Newsletter/newsletter.module.css +59 -64
- package/lib/components/OrderHistoryPage/OrderDetails/billingInformation.module.css +4 -4
- package/lib/components/OrderHistoryPage/OrderDetails/item.module.css +21 -25
- package/lib/components/OrderHistoryPage/OrderDetails/items.module.css +8 -12
- package/lib/components/OrderHistoryPage/OrderDetails/orderDetails.module.css +20 -26
- package/lib/components/OrderHistoryPage/OrderDetails/orderTotal.module.css +30 -31
- package/lib/components/OrderHistoryPage/OrderDetails/paymentMethod.module.css +4 -4
- package/lib/components/OrderHistoryPage/OrderDetails/shippingInformation.module.css +4 -4
- package/lib/components/OrderHistoryPage/OrderDetails/shippingMethod.module.css +7 -6
- package/lib/components/OrderHistoryPage/collapsedImageGallery.module.css +10 -9
- package/lib/components/OrderHistoryPage/orderHistoryPage.module.css +37 -41
- package/lib/components/OrderHistoryPage/orderProgressBar.module.css +5 -5
- package/lib/components/OrderHistoryPage/orderRow.module.css +113 -78
- package/lib/components/PageLoadingIndicator/pageLoadingIndicator.module.css +18 -17
- package/lib/components/Pagination/pagination.module.css +11 -8
- package/lib/components/Pagination/tile.module.css +11 -8
- package/lib/components/Password/password.module.css +13 -11
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/__tests__/__snapshots__/multiSelect.spec.js.snap +10 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/multiselect.js +7 -2
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/multiselect.module.css +11 -2
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/select.module.css +1 -1
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/text.module.css +1 -1
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/textarea.js +10 -4
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/attributeType.js +6 -0
- package/lib/components/ProductFullDetail/CustomAttributes/__tests__/__snapshots__/customAttributes.spec.js.snap +0 -3
- package/lib/components/ProductFullDetail/CustomAttributes/customAttributes.js +6 -10
- package/lib/components/ProductFullDetail/CustomAttributes/customAttributes.module.css +0 -5
- package/lib/components/ProductFullDetail/__tests__/__snapshots__/productFullDetail.spec.js.snap +312 -117
- package/lib/components/ProductFullDetail/__tests__/productFullDetail.spec.js +1 -3
- package/lib/components/ProductFullDetail/productFullDetail.js +77 -11
- package/lib/components/ProductFullDetail/productFullDetail.module.css +85 -77
- package/lib/components/ProductImageCarousel/carousel.module.css +50 -52
- package/lib/components/ProductImageCarousel/thumbnail.module.css +25 -22
- package/lib/components/ProductOptions/option.module.css +17 -13
- package/lib/components/ProductOptions/swatch.module.css +10 -4
- package/lib/components/ProductOptions/tile.module.css +14 -7
- package/lib/components/ProductOptions/tileList.module.css +3 -3
- package/lib/components/ProductQuantity/quantity.js +3 -0
- package/lib/components/ProductQuantity/quantity.module.css +2 -2
- package/lib/components/ProductSort/productSort.module.css +44 -45
- package/lib/components/ProductSort/productSort.shimmer.module.css +1 -5
- package/lib/components/ProductSort/sortItem.module.css +14 -13
- package/lib/components/QuantityStepper/index.js +1 -0
- package/lib/components/QuantityStepper/quantityStepper.js +94 -0
- package/lib/components/QuantityStepper/quantityStepper.module.css +80 -0
- package/lib/components/RadioGroup/__tests__/__snapshots__/radioGroup.spec.js.snap +16 -0
- package/lib/components/RadioGroup/radio.js +14 -2
- package/lib/components/RadioGroup/radio.module.css +41 -37
- package/lib/components/RadioGroup/radioGroup.module.css +10 -14
- package/lib/components/RichContent/plainHtmlRenderer.js +2 -1
- package/lib/components/RichContent/richContent.module.css +13 -1
- package/lib/components/RichText/richText.module.css +7 -3
- package/lib/components/SavedPaymentsPage/creditCard.module.css +49 -37
- package/lib/components/SavedPaymentsPage/savedPaymentsPage.module.css +35 -40
- package/lib/components/ScrollAnchor/scrollAnchor.module.css +4 -2
- package/lib/components/SearchBar/__tests__/suggestedProduct.spec.js +8 -0
- package/lib/components/SearchBar/autocomplete.js +8 -0
- package/lib/components/SearchBar/autocomplete.module.css +39 -37
- package/lib/components/SearchBar/searchBar.module.css +30 -22
- package/lib/components/SearchBar/suggestedCategories.module.css +7 -4
- package/lib/components/SearchBar/suggestedProduct.js +15 -5
- package/lib/components/SearchBar/suggestedProduct.module.css +12 -12
- package/lib/components/SearchBar/suggestedProducts.module.css +7 -4
- package/lib/components/SearchBar/suggestions.module.css +4 -4
- package/lib/components/SearchPage/searchPage.module.css +42 -49
- package/lib/components/Select/select.module.css +9 -8
- package/lib/components/Shimmer/shimmer.module.css +31 -17
- package/lib/components/SignIn/signIn.module.css +40 -33
- package/lib/components/SignInPage/signInPage.module.css +13 -12
- package/lib/components/SortedByContainer/sortedByContainer.module.css +7 -11
- package/lib/components/StockStatusMessage/stockStatusMessage.module.css +10 -6
- package/lib/components/TextArea/textArea.module.css +16 -10
- package/lib/components/TextInput/textInput.module.css +11 -2
- package/lib/components/ToastContainer/toast.module.css +51 -42
- package/lib/components/ToastContainer/toastContainer.module.css +10 -22
- package/lib/components/Wishlist/AddToListButton/addToListButton.module.css +6 -5
- package/lib/components/Wishlist/WishlistDialog/CreateWishlistForm/createWishlistForm.module.css +4 -4
- package/lib/components/Wishlist/WishlistDialog/WishlistLineItem/wishlistLineItem.module.css +7 -6
- package/lib/components/Wishlist/WishlistDialog/wishlistDialog.module.css +14 -9
- package/lib/components/WishlistPage/actionMenu.js +2 -2
- package/lib/components/WishlistPage/createWishlist.module.css +31 -26
- package/lib/components/WishlistPage/wishlist.module.css +54 -49
- package/lib/components/WishlistPage/wishlistConfirmRemoveProductDialog.module.css +7 -7
- package/lib/components/WishlistPage/wishlistEditFavoritesListDialog.module.css +4 -4
- package/lib/components/WishlistPage/wishlistItem.module.css +36 -37
- package/lib/components/WishlistPage/wishlistItems.module.css +5 -7
- package/lib/components/WishlistPage/wishlistMoreActionsDialog.module.css +11 -9
- package/lib/components/WishlistPage/wishlistPage.module.css +24 -24
- package/lib/components/clickable.module.css +7 -7
- package/lib/index.module.css +40 -11
- package/lib/targets/__tests__/venia-ui-targets.spec.js +27 -2
- package/lib/tokens.module.css +62 -57
- package/package.json +5 -5
- package/lib/components/CartPage/ProductListing/quantity.module.css +0 -76
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createTestInstance } from '@magento/peregrine';
|
|
3
|
+
import { mockRadio } from '../../../RadioGroup/radio';
|
|
4
|
+
import FilterItemRadio from '../filterItemRadio';
|
|
5
|
+
|
|
6
|
+
const mockOnApply = jest.fn();
|
|
7
|
+
|
|
8
|
+
jest.mock('../../../RadioGroup/radio', () => {
|
|
9
|
+
const mockedRadio = jest.fn(({ onChange }) => {
|
|
10
|
+
onChange({
|
|
11
|
+
target: {
|
|
12
|
+
value: 'foo'
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
return null;
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
__esModule: true,
|
|
20
|
+
default: mockedRadio,
|
|
21
|
+
mockRadio: mockedRadio
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
let inputProps = {};
|
|
26
|
+
|
|
27
|
+
const Component = () => {
|
|
28
|
+
return <FilterItemRadio {...inputProps} />;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const givenDefaultValues = () => {
|
|
32
|
+
inputProps = {
|
|
33
|
+
filterApi: {
|
|
34
|
+
toggleItem: jest.fn(),
|
|
35
|
+
removeGroup: jest.fn()
|
|
36
|
+
},
|
|
37
|
+
labels: new WeakMap(),
|
|
38
|
+
group: 'Foo',
|
|
39
|
+
item: {
|
|
40
|
+
title: 'Bar',
|
|
41
|
+
value: 'bar',
|
|
42
|
+
label: 'Bar: bar'
|
|
43
|
+
},
|
|
44
|
+
onApply: null
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const givenOnApply = () => {
|
|
49
|
+
inputProps = {
|
|
50
|
+
filterApi: {
|
|
51
|
+
toggleItem: jest.fn(),
|
|
52
|
+
removeGroup: jest.fn()
|
|
53
|
+
},
|
|
54
|
+
labels: new WeakMap(),
|
|
55
|
+
group: 'Foo',
|
|
56
|
+
item: {
|
|
57
|
+
title: 'Bar',
|
|
58
|
+
value: 'bar',
|
|
59
|
+
label: 'Bar: bar'
|
|
60
|
+
},
|
|
61
|
+
onApply: mockOnApply
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const givenSelectedItem = () => {
|
|
66
|
+
const item = {
|
|
67
|
+
title: 'Foo',
|
|
68
|
+
value: 'foo',
|
|
69
|
+
label: 'Foo: foo'
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
inputProps = {
|
|
73
|
+
filterApi: {
|
|
74
|
+
toggleItem: jest.fn(),
|
|
75
|
+
removeGroup: jest.fn()
|
|
76
|
+
},
|
|
77
|
+
labels: new WeakMap(),
|
|
78
|
+
group: 'Foo',
|
|
79
|
+
item: item,
|
|
80
|
+
onApply: mockOnApply
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
describe('#FilterItemRadio', () => {
|
|
85
|
+
beforeEach(() => {
|
|
86
|
+
mockRadio.mockClear();
|
|
87
|
+
mockOnApply.mockClear();
|
|
88
|
+
|
|
89
|
+
givenDefaultValues();
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it('passes props to Radio', () => {
|
|
93
|
+
createTestInstance(<Component />);
|
|
94
|
+
|
|
95
|
+
expect(mockRadio).toHaveBeenCalledWith(
|
|
96
|
+
expect.objectContaining({
|
|
97
|
+
onChange: expect.any(Function)
|
|
98
|
+
}),
|
|
99
|
+
{}
|
|
100
|
+
);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('handles no onApply function being passed', () => {
|
|
104
|
+
createTestInstance(<Component />);
|
|
105
|
+
|
|
106
|
+
expect(inputProps.filterApi.removeGroup).toHaveBeenCalledWith({
|
|
107
|
+
group: inputProps.group
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it('calls onApply when passed', () => {
|
|
112
|
+
givenOnApply();
|
|
113
|
+
createTestInstance(<Component />);
|
|
114
|
+
|
|
115
|
+
expect(inputProps.filterApi.removeGroup).toHaveBeenCalledWith({
|
|
116
|
+
group: inputProps.group
|
|
117
|
+
});
|
|
118
|
+
expect(mockOnApply).toHaveBeenCalled();
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it('determines the item is selected', () => {
|
|
122
|
+
givenSelectedItem();
|
|
123
|
+
createTestInstance(<Component />);
|
|
124
|
+
|
|
125
|
+
expect(inputProps.filterApi.removeGroup).toHaveBeenCalledWith({
|
|
126
|
+
group: inputProps.group
|
|
127
|
+
});
|
|
128
|
+
expect(inputProps.filterApi.toggleItem).toHaveBeenCalledWith({
|
|
129
|
+
group: inputProps.group,
|
|
130
|
+
item: inputProps.item
|
|
131
|
+
});
|
|
132
|
+
expect(mockOnApply).toHaveBeenCalled();
|
|
133
|
+
});
|
|
134
|
+
});
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import { func, number, oneOfType, shape, string, instanceOf } from 'prop-types';
|
|
3
|
+
import Radio from '../../RadioGroup/radio';
|
|
4
|
+
import defaultClasses from './filterItemRadio.module.css';
|
|
5
|
+
import { useStyle } from '../../../classify';
|
|
6
|
+
import { useIntl } from 'react-intl';
|
|
7
|
+
|
|
8
|
+
const FilterItemRadio = props => {
|
|
9
|
+
const { filterApi, group, item, onApply, labels } = props;
|
|
10
|
+
const { removeGroup, toggleItem } = filterApi;
|
|
11
|
+
const { title, value } = item;
|
|
12
|
+
const classes = useStyle(defaultClasses);
|
|
13
|
+
const { formatMessage } = useIntl();
|
|
14
|
+
|
|
15
|
+
const label = item.label ? item.label : item.title;
|
|
16
|
+
|
|
17
|
+
const ariaLabel = formatMessage(
|
|
18
|
+
{
|
|
19
|
+
id: 'filterModal.item.applyFilter',
|
|
20
|
+
defaultMessage: 'Apply filter "{optionName}".'
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
optionName: label
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
const handleOnchange = useCallback(
|
|
28
|
+
e => {
|
|
29
|
+
removeGroup({ group });
|
|
30
|
+
if (e.target.value === item.value) {
|
|
31
|
+
toggleItem({ group, item });
|
|
32
|
+
}
|
|
33
|
+
if (typeof onApply === 'function') {
|
|
34
|
+
onApply(group, item);
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
[group, item, onApply, removeGroup, toggleItem]
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
const element = (
|
|
41
|
+
<Radio
|
|
42
|
+
classes={classes}
|
|
43
|
+
id={`item-${group}-${value}`}
|
|
44
|
+
label={title}
|
|
45
|
+
value={value}
|
|
46
|
+
onChange={handleOnchange}
|
|
47
|
+
data-cy="FilterDefault-radio"
|
|
48
|
+
ariaLabel={ariaLabel}
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
labels.set(element, label);
|
|
53
|
+
|
|
54
|
+
return element;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
FilterItemRadio.defaultProps = {
|
|
58
|
+
onApply: null
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
FilterItemRadio.propTypes = {
|
|
62
|
+
filterApi: shape({
|
|
63
|
+
toggleItem: func.isRequired,
|
|
64
|
+
removeGroup: func.isRequired
|
|
65
|
+
}).isRequired,
|
|
66
|
+
group: string.isRequired,
|
|
67
|
+
item: shape({
|
|
68
|
+
title: string.isRequired,
|
|
69
|
+
value: oneOfType([number, string]).isRequired,
|
|
70
|
+
label: string
|
|
71
|
+
}).isRequired,
|
|
72
|
+
onApply: func,
|
|
73
|
+
labels: instanceOf(Map).isRequired
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export default FilterItemRadio;
|
|
File without changes
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import React, { useMemo, useEffect } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
arrayOf,
|
|
4
|
+
func,
|
|
5
|
+
number,
|
|
6
|
+
oneOfType,
|
|
7
|
+
shape,
|
|
8
|
+
string,
|
|
9
|
+
instanceOf
|
|
10
|
+
} from 'prop-types';
|
|
11
|
+
import setValidator from '@magento/peregrine/lib/validators/set';
|
|
12
|
+
import RadioGroup from '../../RadioGroup';
|
|
13
|
+
import FilterItemRadio from './filterItemRadio';
|
|
14
|
+
import { useFieldApi } from 'informed';
|
|
15
|
+
import useFieldState from '@magento/peregrine/lib/hooks/hook-wrappers/useInformedFieldStateWrapper';
|
|
16
|
+
|
|
17
|
+
const FilterItemRadioGroup = props => {
|
|
18
|
+
const { filterApi, filterState, group, items, onApply, labels } = props;
|
|
19
|
+
|
|
20
|
+
const radioItems = useMemo(() => {
|
|
21
|
+
return items.map(item => {
|
|
22
|
+
const code = `item-${group}-${item.value}`;
|
|
23
|
+
return (
|
|
24
|
+
<FilterItemRadio
|
|
25
|
+
key={code}
|
|
26
|
+
filterApi={filterApi}
|
|
27
|
+
filterState={filterState}
|
|
28
|
+
group={group}
|
|
29
|
+
item={item}
|
|
30
|
+
onApply={onApply}
|
|
31
|
+
labels={labels}
|
|
32
|
+
/>
|
|
33
|
+
);
|
|
34
|
+
});
|
|
35
|
+
}, [filterApi, filterState, group, items, labels, onApply]);
|
|
36
|
+
|
|
37
|
+
const fieldValue = useMemo(() => {
|
|
38
|
+
if (filterState) {
|
|
39
|
+
for (const item of items) {
|
|
40
|
+
if (filterState.has(item)) {
|
|
41
|
+
return item.value;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return null;
|
|
47
|
+
}, [filterState, items]);
|
|
48
|
+
const field = `item-${group}`;
|
|
49
|
+
const fieldApi = useFieldApi(field);
|
|
50
|
+
const fieldState = useFieldState(field);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (field && fieldValue === null) {
|
|
53
|
+
fieldApi.reset();
|
|
54
|
+
} else if (field && fieldValue !== fieldState.value) {
|
|
55
|
+
fieldApi.setValue(fieldValue);
|
|
56
|
+
}
|
|
57
|
+
}, [field, fieldApi, fieldState.value, fieldValue]);
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<RadioGroup field={field} data-cy="FilterDefault-radioGroup">
|
|
61
|
+
{radioItems}
|
|
62
|
+
</RadioGroup>
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
FilterItemRadioGroup.defaultProps = {
|
|
67
|
+
onApply: null
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
FilterItemRadioGroup.propTypes = {
|
|
71
|
+
filterApi: shape({
|
|
72
|
+
toggleItem: func.isRequired
|
|
73
|
+
}).isRequired,
|
|
74
|
+
filterState: setValidator,
|
|
75
|
+
group: string.isRequired,
|
|
76
|
+
items: arrayOf(
|
|
77
|
+
shape({
|
|
78
|
+
title: string.isRequired,
|
|
79
|
+
value: oneOfType([number, string]).isRequired
|
|
80
|
+
})
|
|
81
|
+
).isRequired,
|
|
82
|
+
onApply: func,
|
|
83
|
+
labels: instanceOf(Map).isRequired
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export default FilterItemRadioGroup;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { Fragment, useMemo } from 'react';
|
|
2
|
-
import { array,
|
|
2
|
+
import { array, func, number, shape, string } from 'prop-types';
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
4
|
import setValidator from '@magento/peregrine/lib/validators/set';
|
|
5
5
|
import { useFilterList } from '@magento/peregrine/lib/talons/FilterModal';
|
|
@@ -7,6 +7,7 @@ import { useFilterList } from '@magento/peregrine/lib/talons/FilterModal';
|
|
|
7
7
|
import { useStyle } from '../../../classify';
|
|
8
8
|
import FilterItem from './filterItem';
|
|
9
9
|
import defaultClasses from './filterList.module.css';
|
|
10
|
+
import FilterItemRadioGroup from './filterItemRadioGroup';
|
|
10
11
|
|
|
11
12
|
const labels = new WeakMap();
|
|
12
13
|
|
|
@@ -14,6 +15,8 @@ const FilterList = props => {
|
|
|
14
15
|
const {
|
|
15
16
|
filterApi,
|
|
16
17
|
filterState,
|
|
18
|
+
filterFrontendInput,
|
|
19
|
+
name,
|
|
17
20
|
group,
|
|
18
21
|
itemCountToShow,
|
|
19
22
|
items,
|
|
@@ -26,50 +29,70 @@ const FilterList = props => {
|
|
|
26
29
|
|
|
27
30
|
// memoize item creation
|
|
28
31
|
// search value is not referenced, so this array is stable
|
|
29
|
-
const itemElements = useMemo(
|
|
30
|
-
()
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
const itemElements = useMemo(() => {
|
|
33
|
+
if (filterFrontendInput === 'boolean') {
|
|
34
|
+
const key = `item-${group}`;
|
|
35
|
+
return (
|
|
36
|
+
<li
|
|
37
|
+
key={key}
|
|
38
|
+
className={classes.item}
|
|
39
|
+
data-cy="FilterList-item"
|
|
40
|
+
>
|
|
41
|
+
<FilterItemRadioGroup
|
|
42
|
+
filterApi={filterApi}
|
|
43
|
+
filterState={filterState}
|
|
44
|
+
group={group}
|
|
45
|
+
name={name}
|
|
46
|
+
items={items}
|
|
47
|
+
onApply={onApply}
|
|
48
|
+
labels={labels}
|
|
49
|
+
/>
|
|
50
|
+
</li>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
34
53
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
54
|
+
return items.map((item, index) => {
|
|
55
|
+
const { title, value } = item;
|
|
56
|
+
const key = `item-${group}-${value}`;
|
|
38
57
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
key={key}
|
|
43
|
-
className={classes.item}
|
|
44
|
-
data-cy="FilterList-item"
|
|
45
|
-
>
|
|
46
|
-
<FilterItem
|
|
47
|
-
filterApi={filterApi}
|
|
48
|
-
filterState={filterState}
|
|
49
|
-
group={group}
|
|
50
|
-
item={item}
|
|
51
|
-
onApply={onApply}
|
|
52
|
-
/>
|
|
53
|
-
</li>
|
|
54
|
-
);
|
|
58
|
+
if (!isListExpanded && index >= itemCountToShow) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
55
61
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
62
|
+
// create an element for each item
|
|
63
|
+
const element = (
|
|
64
|
+
<li
|
|
65
|
+
key={key}
|
|
66
|
+
className={classes.item}
|
|
67
|
+
data-cy="FilterList-item"
|
|
68
|
+
>
|
|
69
|
+
<FilterItem
|
|
70
|
+
filterApi={filterApi}
|
|
71
|
+
filterState={filterState}
|
|
72
|
+
group={group}
|
|
73
|
+
item={item}
|
|
74
|
+
onApply={onApply}
|
|
75
|
+
/>
|
|
76
|
+
</li>
|
|
77
|
+
);
|
|
59
78
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
79
|
+
// associate each element with its normalized title
|
|
80
|
+
// titles are not unique, so use the element as the key
|
|
81
|
+
labels.set(element, title.toUpperCase());
|
|
82
|
+
return element;
|
|
83
|
+
});
|
|
84
|
+
}, [
|
|
85
|
+
classes,
|
|
86
|
+
filterApi,
|
|
87
|
+
filterState,
|
|
88
|
+
filterFrontendInput,
|
|
89
|
+
name,
|
|
90
|
+
group,
|
|
91
|
+
items,
|
|
92
|
+
isListExpanded,
|
|
93
|
+
itemCountToShow,
|
|
94
|
+
onApply
|
|
95
|
+
]);
|
|
73
96
|
|
|
74
97
|
const showMoreLessItem = useMemo(() => {
|
|
75
98
|
if (items.length <= itemCountToShow) {
|
|
@@ -128,6 +151,7 @@ FilterList.propTypes = {
|
|
|
128
151
|
}),
|
|
129
152
|
filterApi: shape({}),
|
|
130
153
|
filterState: setValidator,
|
|
154
|
+
name: string,
|
|
131
155
|
group: string,
|
|
132
156
|
items: array,
|
|
133
157
|
onApply: func,
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
.items {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
composes: gap-3 from global;
|
|
3
|
+
composes: grid from global;
|
|
4
|
+
composes: -ml-1.5 from global;
|
|
5
|
+
composes: pb-md from global;
|
|
4
6
|
grid-template-columns: 100%;
|
|
5
|
-
margin-left: -0.375rem;
|
|
6
|
-
padding-bottom: 2rem;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.showMoreLessItem {
|
|
10
|
-
|
|
10
|
+
composes: pl-1 from global;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.showMoreLessButton {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
14
|
+
composes: text-sm from global;
|
|
15
|
+
composes: underline from global;
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
text-decoration: none;
|
|
17
|
+
composes: hover_no-underline from global;
|
|
20
18
|
}
|
|
@@ -41,6 +41,22 @@ const mockFilters = [
|
|
|
41
41
|
value: 1
|
|
42
42
|
}
|
|
43
43
|
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
attribute_code: 'boolean_filter',
|
|
47
|
+
label: 'Boolean Filter',
|
|
48
|
+
options: [
|
|
49
|
+
{
|
|
50
|
+
__typename: 'AggregationOption',
|
|
51
|
+
label: '0',
|
|
52
|
+
value: '0'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
__typename: 'AggregationOption',
|
|
56
|
+
label: '1',
|
|
57
|
+
value: '1'
|
|
58
|
+
}
|
|
59
|
+
]
|
|
44
60
|
}
|
|
45
61
|
];
|
|
46
62
|
|
|
@@ -62,9 +78,30 @@ jest.mock('react-aria', () => ({
|
|
|
62
78
|
})
|
|
63
79
|
}));
|
|
64
80
|
|
|
81
|
+
// TODO: Get all frontend input type from gql if other filter input types are needed
|
|
82
|
+
// See: https://github.com/magento-commerce/magento2-pwa/pull/26
|
|
83
|
+
const isBooleanFilter = options => {
|
|
84
|
+
return (
|
|
85
|
+
options.length === 2 &&
|
|
86
|
+
JSON.stringify(options[0]) ===
|
|
87
|
+
JSON.stringify({
|
|
88
|
+
__typename: 'AggregationOption',
|
|
89
|
+
label: '0',
|
|
90
|
+
value: '0'
|
|
91
|
+
}) &&
|
|
92
|
+
JSON.stringify(options[1]) ===
|
|
93
|
+
JSON.stringify({
|
|
94
|
+
__typename: 'AggregationOption',
|
|
95
|
+
label: '1',
|
|
96
|
+
value: '1'
|
|
97
|
+
})
|
|
98
|
+
);
|
|
99
|
+
};
|
|
100
|
+
|
|
65
101
|
jest.mock('@magento/peregrine/lib/talons/FilterModal', () => ({
|
|
66
102
|
useFilterModal: jest.fn(({ filters }) => {
|
|
67
103
|
const names = new Map();
|
|
104
|
+
const filterFrontendInput = new Map();
|
|
68
105
|
const itemsByGroup = new Map();
|
|
69
106
|
|
|
70
107
|
for (const filter of filters) {
|
|
@@ -73,9 +110,26 @@ jest.mock('@magento/peregrine/lib/talons/FilterModal', () => ({
|
|
|
73
110
|
// add filter name
|
|
74
111
|
names.set(group, name);
|
|
75
112
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
113
|
+
if (isBooleanFilter(options)) {
|
|
114
|
+
filterFrontendInput.set(group, 'boolean');
|
|
115
|
+
// add items
|
|
116
|
+
items.push({
|
|
117
|
+
title: 'No',
|
|
118
|
+
value: '0',
|
|
119
|
+
label: name + ': ' + 'No'
|
|
120
|
+
});
|
|
121
|
+
items.push({
|
|
122
|
+
title: 'Yes',
|
|
123
|
+
value: '1',
|
|
124
|
+
label: name + ': ' + 'Yes'
|
|
125
|
+
});
|
|
126
|
+
} else {
|
|
127
|
+
filterFrontendInput.set(group, null);
|
|
128
|
+
|
|
129
|
+
// add items
|
|
130
|
+
for (const { label, value } of options) {
|
|
131
|
+
items.push({ title: label, value });
|
|
132
|
+
}
|
|
79
133
|
}
|
|
80
134
|
itemsByGroup.set(group, items);
|
|
81
135
|
}
|
|
@@ -84,6 +138,7 @@ jest.mock('@magento/peregrine/lib/talons/FilterModal', () => ({
|
|
|
84
138
|
filterApi: null,
|
|
85
139
|
filterItems: itemsByGroup,
|
|
86
140
|
filterNames: names,
|
|
141
|
+
filterFrontendInput,
|
|
87
142
|
filterState: mockFilterState,
|
|
88
143
|
handleApply: jest.fn(),
|
|
89
144
|
handleClose: jest.fn(),
|
|
@@ -16,6 +16,7 @@ const FilterBlock = props => {
|
|
|
16
16
|
const {
|
|
17
17
|
filterApi,
|
|
18
18
|
filterState,
|
|
19
|
+
filterFrontendInput,
|
|
19
20
|
group,
|
|
20
21
|
items,
|
|
21
22
|
name,
|
|
@@ -68,6 +69,8 @@ const FilterBlock = props => {
|
|
|
68
69
|
<FilterList
|
|
69
70
|
filterApi={filterApi}
|
|
70
71
|
filterState={filterState}
|
|
72
|
+
name={name}
|
|
73
|
+
filterFrontendInput={filterFrontendInput}
|
|
71
74
|
group={group}
|
|
72
75
|
items={items}
|
|
73
76
|
onApply={onApply}
|
|
@@ -112,6 +115,7 @@ FilterBlock.propTypes = {
|
|
|
112
115
|
root: string,
|
|
113
116
|
trigger: string
|
|
114
117
|
}),
|
|
118
|
+
filterFrontendInput: string,
|
|
115
119
|
filterApi: shape({}).isRequired,
|
|
116
120
|
filterState: setValidator,
|
|
117
121
|
group: string.isRequired,
|
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
.root {
|
|
2
|
-
border-
|
|
3
|
-
border-
|
|
4
|
-
border-
|
|
5
|
-
|
|
2
|
+
composes: border-solid from global;
|
|
3
|
+
composes: border-subtle from global;
|
|
4
|
+
composes: border-t-2 from global;
|
|
5
|
+
composes: border-r-0 from global;
|
|
6
|
+
composes: border-b-0 from global;
|
|
7
|
+
composes: border-l-0 from global;
|
|
8
|
+
composes: grid from global;
|
|
6
9
|
}
|
|
7
10
|
|
|
8
11
|
.header {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
grid-
|
|
12
|
-
|
|
13
|
-
min-
|
|
12
|
+
composes: grid from global;
|
|
13
|
+
composes: grid-cols-autoLast from global;
|
|
14
|
+
composes: grid-flow-col from global;
|
|
15
|
+
composes: items-center from global;
|
|
16
|
+
composes: min-h-[3.125rem] from global;
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
.name {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
text-align: left;
|
|
20
|
+
composes: leading-normal from global;
|
|
21
|
+
composes: text-left from global;
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
.list {
|
|
23
25
|
}
|
|
24
26
|
|
|
27
|
+
/* TODO @TW: cannot compose */
|
|
25
28
|
.list:empty {
|
|
26
29
|
display: none;
|
|
27
30
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
.root {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
composes: bg-white from global;
|
|
3
|
+
composes: content-center from global;
|
|
4
|
+
composes: gap-y-1 from global;
|
|
5
|
+
composes: grid from global;
|
|
6
|
+
composes: h-[7rem] from global;
|
|
7
|
+
composes: items-center from global;
|
|
8
|
+
composes: justify-items-center from global;
|
|
9
|
+
composes: relative from global;
|
|
10
10
|
}
|
|
@@ -27,6 +27,7 @@ const FilterModal = props => {
|
|
|
27
27
|
filterApi,
|
|
28
28
|
filterItems,
|
|
29
29
|
filterNames,
|
|
30
|
+
filterFrontendInput,
|
|
30
31
|
filterState,
|
|
31
32
|
handleApply,
|
|
32
33
|
handleClose,
|
|
@@ -43,19 +44,20 @@ const FilterModal = props => {
|
|
|
43
44
|
Array.from(filterItems, ([group, items]) => {
|
|
44
45
|
const blockState = filterState.get(group);
|
|
45
46
|
const groupName = filterNames.get(group);
|
|
46
|
-
|
|
47
|
+
const frontendInput = filterFrontendInput.get(group);
|
|
47
48
|
return (
|
|
48
49
|
<FilterBlock
|
|
49
50
|
key={group}
|
|
50
51
|
filterApi={filterApi}
|
|
51
52
|
filterState={blockState}
|
|
53
|
+
filterFrontendInput={frontendInput}
|
|
52
54
|
group={group}
|
|
53
55
|
items={items}
|
|
54
56
|
name={groupName}
|
|
55
57
|
/>
|
|
56
58
|
);
|
|
57
59
|
}),
|
|
58
|
-
[filterApi, filterItems, filterNames, filterState]
|
|
60
|
+
[filterApi, filterItems, filterNames, filterState, filterFrontendInput]
|
|
59
61
|
);
|
|
60
62
|
|
|
61
63
|
const filtersAriaLabel = formatMessage({
|