@mohasinac/appkit 2.7.49 → 2.7.52
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/dist/_internal/client/features/layout/SidebarCollapseToggle.d.ts +19 -0
- package/dist/_internal/client/features/layout/SidebarCollapseToggle.js +15 -0
- package/dist/_internal/client/features/layout/index.d.ts +2 -0
- package/dist/_internal/client/features/layout/index.js +1 -0
- package/dist/_internal/server/features/checkout/actions.js +25 -2
- package/dist/_internal/server/features/promotions/actions.js +3 -1
- package/dist/_internal/server/jobs/core/__tests__/couponExpiry.test.d.ts +1 -0
- package/dist/_internal/server/jobs/core/__tests__/couponExpiry.test.js +65 -0
- package/dist/_internal/server/jobs/core/__tests__/listingProcessor.test.d.ts +1 -0
- package/dist/_internal/server/jobs/core/__tests__/listingProcessor.test.js +163 -0
- package/dist/_internal/server/jobs/core/__tests__/mediaTmpCleanup.test.d.ts +1 -0
- package/dist/_internal/server/jobs/core/__tests__/mediaTmpCleanup.test.js +115 -0
- package/dist/_internal/server/jobs/core/__tests__/pendingOrderTimeout.test.d.ts +1 -0
- package/dist/_internal/server/jobs/core/__tests__/pendingOrderTimeout.test.js +96 -0
- package/dist/_internal/shared/actions/action-registry.js +149 -0
- package/dist/client.d.ts +45 -6
- package/dist/client.js +27 -4
- package/dist/constants/api-endpoints.d.ts +42 -0
- package/dist/constants/api-endpoints.js +14 -0
- package/dist/features/_guide-cls.d.ts +13 -0
- package/dist/features/_guide-cls.js +14 -0
- package/dist/features/about/components/HelpPageView.js +29 -26
- package/dist/features/account/components/BuyerAccountGuideView.d.ts +1 -0
- package/dist/features/account/components/BuyerAccountGuideView.js +39 -0
- package/dist/features/account/components/BuyerAuctionsGuideView.d.ts +1 -0
- package/dist/features/account/components/BuyerAuctionsGuideView.js +38 -0
- package/dist/features/account/components/BuyerOrdersGuideView.d.ts +1 -0
- package/dist/features/account/components/BuyerOrdersGuideView.js +48 -0
- package/dist/features/account/components/BuyerShoppingGuideView.d.ts +1 -0
- package/dist/features/account/components/BuyerShoppingGuideView.js +38 -0
- package/dist/features/account/components/UserSidebar.js +2 -1
- package/dist/features/admin/components/AdminAnalyticsGuideView.d.ts +1 -0
- package/dist/features/admin/components/AdminAnalyticsGuideView.js +24 -0
- package/dist/features/admin/components/AdminBlogEditorView.js +102 -75
- package/dist/features/admin/components/AdminBundleEditorView.js +20 -14
- package/dist/features/admin/components/AdminBundlesView.d.ts +1 -3
- package/dist/features/admin/components/AdminBundlesView.js +173 -52
- package/dist/features/admin/components/AdminCatalogGuideView.d.ts +1 -0
- package/dist/features/admin/components/AdminCatalogGuideView.js +28 -0
- package/dist/features/admin/components/AdminContentGuideView.d.ts +1 -0
- package/dist/features/admin/components/AdminContentGuideView.js +36 -0
- package/dist/features/admin/components/AdminCouponEditorView.js +1 -1
- package/dist/features/admin/components/AdminGuideHubView.d.ts +5 -0
- package/dist/features/admin/components/AdminGuideHubView.js +79 -0
- package/dist/features/admin/components/AdminOrdersGuideView.d.ts +1 -0
- package/dist/features/admin/components/AdminOrdersGuideView.js +44 -0
- package/dist/features/admin/components/AdminProductsView.js +8 -3
- package/dist/features/admin/components/AdminSidebar.js +2 -1
- package/dist/features/admin/components/AdminSiteConfigGuideView.d.ts +1 -0
- package/dist/features/admin/components/AdminSiteConfigGuideView.js +21 -0
- package/dist/features/admin/components/AdminStoresGuideView.d.ts +1 -0
- package/dist/features/admin/components/AdminStoresGuideView.js +32 -0
- package/dist/features/admin/components/AdminTeamGuideView.d.ts +1 -0
- package/dist/features/admin/components/AdminTeamGuideView.js +33 -0
- package/dist/features/admin/components/AdminTrustGuideView.d.ts +1 -0
- package/dist/features/admin/components/AdminTrustGuideView.js +40 -0
- package/dist/features/admin/components/AdminUsersGuideView.d.ts +1 -0
- package/dist/features/admin/components/AdminUsersGuideView.js +38 -0
- package/dist/features/auth/repository/session.repository.js +16 -1
- package/dist/features/cart/hooks/useAddToCart.d.ts +2 -0
- package/dist/features/cart/hooks/useAddToCart.js +2 -0
- package/dist/features/cart/hooks/useGuestCart.d.ts +2 -0
- package/dist/features/cart/utils/guest-cart.d.ts +7 -0
- package/dist/features/cart/utils/pending-ops.d.ts +6 -0
- package/dist/features/categories/components/CategoryBundlesListing.js +3 -25
- package/dist/features/categories/components/CategoryProductsListing.js +6 -10
- package/dist/features/categories/components/index.d.ts +0 -2
- package/dist/features/categories/components/index.js +0 -1
- package/dist/features/categories/schemas/firestore.d.ts +9 -0
- package/dist/features/events/components/AdminEventEditorView.js +223 -269
- package/dist/features/events/components/EventRaffleWinnerView.d.ts +9 -1
- package/dist/features/events/components/EventRaffleWinnerView.js +3 -3
- package/dist/features/events/components/SpinWheelView.js +3 -3
- package/dist/features/grouped/repository/grouped-listings.repository.d.ts +9 -0
- package/dist/features/grouped/repository/grouped-listings.repository.js +12 -0
- package/dist/features/layout/BottomNavLayout.d.ts +5 -0
- package/dist/features/layout/BottomNavLayout.js +21 -0
- package/dist/features/layout/TitleBar.js +7 -1
- package/dist/features/layout/TitleBarLayout.d.ts +8 -2
- package/dist/features/layout/TitleBarLayout.js +11 -7
- package/dist/features/media/upload/MediaUploadField.js +1 -1
- package/dist/features/orders/schemas/index.d.ts +2 -2
- package/dist/features/pre-orders/components/PreOrdersIndexListing.js +12 -6
- package/dist/features/products/components/AuctionsIndexListing.js +3 -1
- package/dist/features/products/components/MarketplaceBundleCard.d.ts +21 -0
- package/dist/features/products/components/MarketplaceBundleCard.js +56 -0
- package/dist/features/products/components/PrizeDrawDetailPageView.js +1 -1
- package/dist/features/products/components/PrizeDrawEntryActions.d.ts +3 -1
- package/dist/features/products/components/PrizeDrawEntryActions.js +8 -12
- package/dist/features/products/components/ProductDetailActions.d.ts +5 -1
- package/dist/features/products/components/ProductDetailActions.js +3 -1
- package/dist/features/products/components/ProductDetailPageView.d.ts +2 -0
- package/dist/features/products/components/ProductDetailPageView.js +4 -0
- package/dist/features/products/components/ProductGrid.js +3 -3
- package/dist/features/products/components/ProductsIndexListing.js +18 -9
- package/dist/features/products/components/index.d.ts +2 -4
- package/dist/features/products/components/index.js +1 -2
- package/dist/features/promotions/components/CouponCard.d.ts +11 -1
- package/dist/features/promotions/components/CouponCard.js +36 -2
- package/dist/features/promotions/repository/claimed-coupons.repository.d.ts +27 -0
- package/dist/features/promotions/repository/claimed-coupons.repository.js +115 -0
- package/dist/features/promotions/schemas/firestore.d.ts +34 -0
- package/dist/features/promotions/schemas/firestore.js +14 -1
- package/dist/features/reviews/components/index.d.ts +0 -2
- package/dist/features/reviews/components/index.js +0 -1
- package/dist/features/seller/components/BrandInlineSelect.js +23 -3
- package/dist/features/seller/components/CategoryInlineSelect.js +20 -3
- package/dist/features/seller/components/SellerAddressesView.js +3 -2
- package/dist/features/seller/components/SellerAnalyticsAlertsView.d.ts +6 -0
- package/dist/features/seller/components/SellerAnalyticsAlertsView.js +124 -0
- package/dist/features/seller/components/SellerAnalyticsView.d.ts +2 -0
- package/dist/features/seller/components/SellerAnalyticsView.js +17 -9
- package/dist/features/seller/components/SellerBidsView.js +33 -3
- package/dist/features/seller/components/SellerBundlesView.d.ts +5 -0
- package/dist/features/seller/components/SellerBundlesView.js +104 -0
- package/dist/features/seller/components/SellerClassifiedView.d.ts +5 -0
- package/dist/features/seller/components/SellerClassifiedView.js +113 -0
- package/dist/features/seller/components/SellerDashboardView.js +19 -7
- package/dist/features/seller/components/SellerDigitalCodesView.d.ts +5 -0
- package/dist/features/seller/components/SellerDigitalCodesView.js +115 -0
- package/dist/features/seller/components/SellerGoogleReviewsView.d.ts +14 -0
- package/dist/features/seller/components/SellerGoogleReviewsView.js +95 -0
- package/dist/features/seller/components/SellerGroupedListingsView.d.ts +6 -0
- package/dist/features/seller/components/SellerGroupedListingsView.js +112 -0
- package/dist/features/seller/components/SellerLiveView.d.ts +5 -0
- package/dist/features/seller/components/SellerLiveView.js +113 -0
- package/dist/features/seller/components/SellerOrdersView.js +53 -2
- package/dist/features/seller/components/SellerPayoutMethodsView.d.ts +7 -0
- package/dist/features/seller/components/SellerPayoutMethodsView.js +120 -0
- package/dist/features/seller/components/SellerPayoutSettingsView.js +50 -12
- package/dist/features/seller/components/SellerProductShell.d.ts +3 -1
- package/dist/features/seller/components/SellerProductShell.js +35 -11
- package/dist/features/seller/components/SellerProductsCards.d.ts +19 -0
- package/dist/features/seller/components/SellerProductsCards.js +19 -0
- package/dist/features/seller/components/SellerProductsFilterDrawer.d.ts +14 -0
- package/dist/features/seller/components/SellerProductsFilterDrawer.js +22 -0
- package/dist/features/seller/components/SellerProductsView.d.ts +3 -1
- package/dist/features/seller/components/SellerProductsView.js +92 -49
- package/dist/features/seller/components/SellerReviewsView.js +67 -4
- package/dist/features/seller/components/SellerShippingConfigsView.d.ts +7 -0
- package/dist/features/seller/components/SellerShippingConfigsView.js +149 -0
- package/dist/features/seller/components/SellerShippingView.js +37 -10
- package/dist/features/seller/components/SellerSidebar.js +2 -1
- package/dist/features/seller/components/SellerStoreCategoriesView.d.ts +9 -0
- package/dist/features/seller/components/SellerStoreCategoriesView.js +122 -0
- package/dist/features/seller/components/SellerStorefrontView.d.ts +0 -7
- package/dist/features/seller/components/SellerStorefrontView.js +26 -29
- package/dist/features/seller/components/SellerTemplatesView.d.ts +10 -0
- package/dist/features/seller/components/SellerTemplatesView.js +265 -0
- package/dist/features/seller/components/index.d.ts +26 -0
- package/dist/features/seller/components/index.js +13 -0
- package/dist/features/seller/components/seller-products-styles.d.ts +7 -0
- package/dist/features/seller/components/seller-products-styles.js +14 -0
- package/dist/features/shell/FormShell.d.ts +7 -1
- package/dist/features/shell/FormShell.js +5 -2
- package/dist/features/store-extensions/index.d.ts +4 -0
- package/dist/features/store-extensions/index.js +4 -0
- package/dist/features/store-extensions/repository/rbac.repositories.d.ts +23 -0
- package/dist/features/store-extensions/repository/rbac.repositories.js +32 -0
- package/dist/features/store-extensions/repository/store-extensions.repositories.d.ts +91 -0
- package/dist/features/store-extensions/repository/store-extensions.repositories.js +127 -0
- package/dist/features/store-extensions/schemas/firestore.d.ts +244 -0
- package/dist/features/store-extensions/schemas/firestore.js +158 -0
- package/dist/features/store-extensions/schemas/rbac.d.ts +65 -0
- package/dist/features/store-extensions/schemas/rbac.js +43 -0
- package/dist/features/stores/api/[storeSlug]/reviews/route.js +49 -7
- package/dist/features/stores/components/InteractiveStoreCard.js +7 -3
- package/dist/features/stores/components/StoreCapabilitiesGuideView.d.ts +3 -0
- package/dist/features/stores/components/StoreCapabilitiesGuideView.js +101 -0
- package/dist/features/stores/components/StoreFinanceGuideView.d.ts +3 -0
- package/dist/features/stores/components/StoreFinanceGuideView.js +79 -0
- package/dist/features/stores/components/StoreGuideHubView.d.ts +5 -0
- package/dist/features/stores/components/StoreGuideHubView.js +89 -0
- package/dist/features/stores/components/StoreListingsGuideView.d.ts +3 -0
- package/dist/features/stores/components/StoreListingsGuideView.js +151 -0
- package/dist/features/stores/components/StoreOrdersGuideView.d.ts +3 -0
- package/dist/features/stores/components/StoreOrdersGuideView.js +122 -0
- package/dist/features/stores/components/StoreProductsListing.js +6 -10
- package/dist/features/stores/components/StoreReviewsListing.js +100 -23
- package/dist/features/stores/components/StoreSettingsGuideView.d.ts +3 -0
- package/dist/features/stores/components/StoreSettingsGuideView.js +56 -0
- package/dist/features/stores/components/index.d.ts +12 -1
- package/dist/features/stores/components/index.js +6 -1
- package/dist/features/stores/hooks/useStores.d.ts +5 -0
- package/dist/features/stores/hooks/useStores.js +10 -0
- package/dist/features/stores/manifest.js +1 -1
- package/dist/features/stores/schemas/firestore.d.ts +2 -0
- package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +13 -2
- package/dist/index.d.ts +60 -9
- package/dist/index.js +66 -15
- package/dist/next/routing/route-map.d.ts +134 -0
- package/dist/next/routing/route-map.js +59 -0
- package/dist/providers/db-firebase/__tests__/filter-aliases.test.d.ts +1 -0
- package/dist/providers/db-firebase/__tests__/filter-aliases.test.js +93 -0
- package/dist/providers/db-firebase/sieve.d.ts +49 -0
- package/dist/providers/db-firebase/sieve.js +61 -8
- package/dist/react/hooks/useFormStatePreservation.d.ts +17 -0
- package/dist/react/hooks/useFormStatePreservation.js +62 -0
- package/dist/react/hooks/useInlineRowEdit.d.ts +24 -0
- package/dist/react/hooks/useInlineRowEdit.js +68 -0
- package/dist/react/index.d.ts +4 -0
- package/dist/react/index.js +4 -0
- package/dist/repositories/index.d.ts +5 -0
- package/dist/repositories/index.js +7 -0
- package/dist/seed/actions/demo-seed-actions.d.ts +1 -1
- package/dist/seed/claimed-coupons-seed-data.d.ts +13 -0
- package/dist/seed/claimed-coupons-seed-data.js +79 -0
- package/dist/seed/index.d.ts +2 -0
- package/dist/seed/index.js +3 -0
- package/dist/seed/manifest.js +17 -0
- package/dist/seed/store-extensions-seed-data.d.ts +19 -0
- package/dist/seed/store-extensions-seed-data.js +421 -0
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/components/Button.style.css +20 -12
- package/dist/ui/components/ClaimCouponButton.d.ts +28 -0
- package/dist/ui/components/ClaimCouponButton.js +89 -0
- package/dist/ui/components/ListingToolbar.d.ts +8 -1
- package/dist/ui/components/ListingToolbar.js +4 -2
- package/dist/ui/components/QuickCreateModal.d.ts +15 -0
- package/dist/ui/components/QuickCreateModal.js +48 -0
- package/dist/ui/components/QuickCreateModal.style.css +84 -0
- package/dist/ui/components/StickyBottomBar.d.ts +22 -0
- package/dist/ui/components/StickyBottomBar.js +20 -0
- package/dist/ui/components/VacationBanner.d.ts +11 -0
- package/dist/ui/components/VacationBanner.js +16 -0
- package/dist/ui/components/__tests__/BulkActionBar.test.d.ts +1 -0
- package/dist/ui/components/__tests__/BulkActionBar.test.js +96 -0
- package/dist/ui/components/__tests__/ListingToolbar.test.d.ts +1 -0
- package/dist/ui/components/__tests__/ListingToolbar.test.js +125 -0
- package/dist/ui/index.d.ts +9 -1
- package/dist/ui/index.js +4 -0
- package/package.json +8 -2
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render, screen, fireEvent } from "@testing-library/react";
|
|
3
|
+
import { describe, it, expect, vi } from "vitest";
|
|
4
|
+
import { ListingToolbar } from "../ListingToolbar";
|
|
5
|
+
describe("ListingToolbar", () => {
|
|
6
|
+
it("renders the toolbar container", () => {
|
|
7
|
+
render(_jsx(ListingToolbar, {}));
|
|
8
|
+
expect(screen.getByTestId("listing-toolbar")).toBeTruthy();
|
|
9
|
+
});
|
|
10
|
+
it("renders search input when onSearchChange is provided", () => {
|
|
11
|
+
render(_jsx(ListingToolbar, { onSearchChange: vi.fn(), searchValue: "", searchPlaceholder: "Find\u2026" }));
|
|
12
|
+
expect(screen.getByPlaceholderText("Find…")).toBeTruthy();
|
|
13
|
+
});
|
|
14
|
+
it("does not render search input when onSearchChange is absent", () => {
|
|
15
|
+
render(_jsx(ListingToolbar, {}));
|
|
16
|
+
expect(screen.queryByRole("textbox")).toBeNull();
|
|
17
|
+
});
|
|
18
|
+
it("calls onSearchChange when typing in the search input", () => {
|
|
19
|
+
const onChange = vi.fn();
|
|
20
|
+
render(_jsx(ListingToolbar, { onSearchChange: onChange, searchValue: "" }));
|
|
21
|
+
fireEvent.change(screen.getByRole("textbox"), { target: { value: "pokemon" } });
|
|
22
|
+
expect(onChange).toHaveBeenCalledWith("pokemon");
|
|
23
|
+
});
|
|
24
|
+
it("calls onSearchCommit when Enter is pressed in the search input", () => {
|
|
25
|
+
const onCommit = vi.fn();
|
|
26
|
+
render(_jsx(ListingToolbar, { onSearchChange: vi.fn(), onSearchCommit: onCommit, searchValue: "" }));
|
|
27
|
+
fireEvent.keyDown(screen.getByRole("textbox"), { key: "Enter" });
|
|
28
|
+
expect(onCommit).toHaveBeenCalledOnce();
|
|
29
|
+
});
|
|
30
|
+
it("calls onSearchCommit when the search button is clicked", () => {
|
|
31
|
+
const onCommit = vi.fn();
|
|
32
|
+
render(_jsx(ListingToolbar, { onSearchChange: vi.fn(), onSearchCommit: onCommit, searchValue: "" }));
|
|
33
|
+
fireEvent.click(screen.getByRole("button", { name: /search/i }));
|
|
34
|
+
expect(onCommit).toHaveBeenCalledOnce();
|
|
35
|
+
});
|
|
36
|
+
it("renders filters button when onFiltersClick is provided", () => {
|
|
37
|
+
const onClick = vi.fn();
|
|
38
|
+
render(_jsx(ListingToolbar, { onFiltersClick: onClick }));
|
|
39
|
+
const btn = screen.getByRole("button", { name: /filters/i });
|
|
40
|
+
expect(btn).toBeTruthy();
|
|
41
|
+
fireEvent.click(btn);
|
|
42
|
+
expect(onClick).toHaveBeenCalledOnce();
|
|
43
|
+
});
|
|
44
|
+
it("does not render filters button when onFiltersClick is absent", () => {
|
|
45
|
+
render(_jsx(ListingToolbar, {}));
|
|
46
|
+
expect(screen.queryByRole("button", { name: /filters/i })).toBeNull();
|
|
47
|
+
});
|
|
48
|
+
it("shows filter count badge when filterCount > 0", () => {
|
|
49
|
+
render(_jsx(ListingToolbar, { onFiltersClick: vi.fn(), filterCount: 3 }));
|
|
50
|
+
expect(screen.getByText("3")).toBeTruthy();
|
|
51
|
+
});
|
|
52
|
+
it("renders grid and list view buttons when onViewChange is provided", () => {
|
|
53
|
+
render(_jsx(ListingToolbar, { onViewChange: vi.fn(), view: "grid" }));
|
|
54
|
+
expect(screen.getByRole("button", { name: /grid view/i })).toBeTruthy();
|
|
55
|
+
expect(screen.getByRole("button", { name: /list view/i })).toBeTruthy();
|
|
56
|
+
});
|
|
57
|
+
it("does not render view buttons when hideViewToggle is true", () => {
|
|
58
|
+
render(_jsx(ListingToolbar, { onViewChange: vi.fn(), hideViewToggle: true, view: "grid" }));
|
|
59
|
+
expect(screen.queryByRole("button", { name: /grid view/i })).toBeNull();
|
|
60
|
+
});
|
|
61
|
+
it("calls onViewChange with 'list' when list button is clicked", () => {
|
|
62
|
+
const onViewChange = vi.fn();
|
|
63
|
+
render(_jsx(ListingToolbar, { onViewChange: onViewChange, view: "grid" }));
|
|
64
|
+
fireEvent.click(screen.getByRole("button", { name: /list view/i }));
|
|
65
|
+
expect(onViewChange).toHaveBeenCalledWith("list");
|
|
66
|
+
});
|
|
67
|
+
it("renders table view button only when showTableView is true", () => {
|
|
68
|
+
const { rerender } = render(_jsx(ListingToolbar, { onViewChange: vi.fn(), view: "grid" }));
|
|
69
|
+
expect(screen.queryByRole("button", { name: /table view/i })).toBeNull();
|
|
70
|
+
rerender(_jsx(ListingToolbar, { onViewChange: vi.fn(), view: "grid", showTableView: true }));
|
|
71
|
+
expect(screen.getByRole("button", { name: /table view/i })).toBeTruthy();
|
|
72
|
+
});
|
|
73
|
+
it("shows reset-all button only when onResetAll + hasActiveState are both truthy", () => {
|
|
74
|
+
const onReset = vi.fn();
|
|
75
|
+
const { rerender } = render(_jsx(ListingToolbar, { onResetAll: onReset, hasActiveState: false }));
|
|
76
|
+
expect(screen.queryByRole("button", { name: /reset all/i })).toBeNull();
|
|
77
|
+
rerender(_jsx(ListingToolbar, { onResetAll: onReset, hasActiveState: true }));
|
|
78
|
+
expect(screen.getByRole("button", { name: /reset all/i })).toBeTruthy();
|
|
79
|
+
fireEvent.click(screen.getByRole("button", { name: /reset all/i }));
|
|
80
|
+
expect(onReset).toHaveBeenCalledOnce();
|
|
81
|
+
});
|
|
82
|
+
it("renders bulk-mode controls when bulkMode is true", () => {
|
|
83
|
+
render(_jsx(ListingToolbar, { bulkMode: true, bulkSelectedCount: 2, bulkTotalCount: 10, onBulkSelectAll: vi.fn(), onBulkClear: vi.fn() }));
|
|
84
|
+
expect(screen.getByText(/select all/i)).toBeTruthy();
|
|
85
|
+
expect(screen.getByText(/2 selected/i)).toBeTruthy();
|
|
86
|
+
expect(screen.getByText(/clear/i)).toBeTruthy();
|
|
87
|
+
});
|
|
88
|
+
it("calls onBulkSelectAll when Select All is clicked", () => {
|
|
89
|
+
const onSelectAll = vi.fn();
|
|
90
|
+
render(_jsx(ListingToolbar, { bulkMode: true, bulkSelectedCount: 0, bulkTotalCount: 5, onBulkSelectAll: onSelectAll }));
|
|
91
|
+
fireEvent.click(screen.getByText(/select all/i));
|
|
92
|
+
expect(onSelectAll).toHaveBeenCalledOnce();
|
|
93
|
+
});
|
|
94
|
+
it("calls onBulkClear when Clear button is clicked", () => {
|
|
95
|
+
const onClear = vi.fn();
|
|
96
|
+
render(_jsx(ListingToolbar, { bulkMode: true, bulkSelectedCount: 2, bulkTotalCount: 5, onBulkClear: onClear }));
|
|
97
|
+
fireEvent.click(screen.getByText(/clear/i));
|
|
98
|
+
expect(onClear).toHaveBeenCalledOnce();
|
|
99
|
+
});
|
|
100
|
+
it("shows 'Deselect All' label when all items are selected", () => {
|
|
101
|
+
render(_jsx(ListingToolbar, { bulkMode: true, bulkSelectedCount: 5, bulkTotalCount: 5, onBulkSelectAll: vi.fn() }));
|
|
102
|
+
expect(screen.getByText(/deselect all/i)).toBeTruthy();
|
|
103
|
+
});
|
|
104
|
+
it("renders pill toggle buttons from the toggles prop", () => {
|
|
105
|
+
const onToggle = vi.fn();
|
|
106
|
+
const toggles = [
|
|
107
|
+
{ label: "In Stock", active: false, onChange: onToggle },
|
|
108
|
+
{ label: "Featured", active: true, onChange: vi.fn() },
|
|
109
|
+
];
|
|
110
|
+
render(_jsx(ListingToolbar, { toggles: toggles }));
|
|
111
|
+
expect(screen.getByRole("switch", { name: "In Stock" })).toBeTruthy();
|
|
112
|
+
expect(screen.getByRole("switch", { name: "Featured" })).toBeTruthy();
|
|
113
|
+
});
|
|
114
|
+
it("calls toggle onChange with flipped value when a pill toggle is clicked", () => {
|
|
115
|
+
const onChange = vi.fn();
|
|
116
|
+
const toggles = [{ label: "In Stock", active: false, onChange }];
|
|
117
|
+
render(_jsx(ListingToolbar, { toggles: toggles }));
|
|
118
|
+
fireEvent.click(screen.getByRole("switch", { name: "In Stock" }));
|
|
119
|
+
expect(onChange).toHaveBeenCalledWith(true);
|
|
120
|
+
});
|
|
121
|
+
it("uses custom labels from the labels prop", () => {
|
|
122
|
+
render(_jsx(ListingToolbar, { onFiltersClick: vi.fn(), labels: { filters: "Refine" } }));
|
|
123
|
+
expect(screen.getByRole("button", { name: /refine/i })).toBeTruthy();
|
|
124
|
+
});
|
|
125
|
+
});
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -50,6 +50,10 @@ export type { StatusBadgeProps, StatusBadgeStatus, BadgeOrderStatus, BadgePaymen
|
|
|
50
50
|
export { StatusBadge } from "./components/StatusBadge";
|
|
51
51
|
export type { ModalProps } from "./components/Modal";
|
|
52
52
|
export { Modal, ModalFooter } from "./components/Modal";
|
|
53
|
+
export type { QuickCreateModalProps } from "./components/QuickCreateModal";
|
|
54
|
+
export { QuickCreateModal } from "./components/QuickCreateModal";
|
|
55
|
+
export type { VacationBannerProps } from "./components/VacationBanner";
|
|
56
|
+
export { VacationBanner } from "./components/VacationBanner";
|
|
53
57
|
export type { UnsavedChangesModalProps, UnsavedChangesLabels, } from "./components/UnsavedChangesModal";
|
|
54
58
|
export { UnsavedChangesModal } from "./components/UnsavedChangesModal";
|
|
55
59
|
export type { LoginRequiredModalProps } from "./components/LoginRequiredModal";
|
|
@@ -154,7 +158,7 @@ export type { ActiveFilter, ActiveFilterChipsProps, } from "./components/ActiveF
|
|
|
154
158
|
export { ActiveFilterChips } from "./components/ActiveFilterChips";
|
|
155
159
|
export type { SortOption, SortDropdownProps } from "./components/SortDropdown";
|
|
156
160
|
export { SortDropdown } from "./components/SortDropdown";
|
|
157
|
-
export type { ListingToolbarProps, ListingToolbarSortOption, ListingToolbarLabels } from "./components/ListingToolbar";
|
|
161
|
+
export type { ListingToolbarProps, ListingToolbarSortOption, ListingToolbarLabels, ListingToolbarToggle } from "./components/ListingToolbar";
|
|
158
162
|
export { ListingToolbar } from "./components/ListingToolbar";
|
|
159
163
|
export type { TablePaginationProps, TablePaginationLabels, } from "./components/TablePagination";
|
|
160
164
|
export { TablePagination } from "./components/TablePagination";
|
|
@@ -187,6 +191,10 @@ export type { BulkActionBarProps, BulkActionBarLabels, BulkActionItem, } from ".
|
|
|
187
191
|
export { BulkActionBar } from "./components/BulkActionBar";
|
|
188
192
|
export type { BulkActionsBarProps, BulkAction } from "./components/BulkActionsBar";
|
|
189
193
|
export { BulkActionsBar } from "./components/BulkActionsBar";
|
|
194
|
+
export type { StickyBottomBarProps } from "./components/StickyBottomBar";
|
|
195
|
+
export { StickyBottomBar } from "./components/StickyBottomBar";
|
|
196
|
+
export type { ClaimCouponButtonProps } from "./components/ClaimCouponButton";
|
|
197
|
+
export { ClaimCouponButton } from "./components/ClaimCouponButton";
|
|
190
198
|
export type { FlowStep, FlowDiagramProps } from "./components/FlowDiagram";
|
|
191
199
|
export { FlowDiagram } from "./components/FlowDiagram";
|
|
192
200
|
export type { BaseListingCardRootProps, BaseListingCardHeroProps, BaseListingCardInfoProps, BaseListingCardCheckboxProps, } from "./components/BaseListingCard";
|
package/dist/ui/index.js
CHANGED
|
@@ -29,6 +29,8 @@ export { Progress, IndeterminateProgress } from "./components/Progress";
|
|
|
29
29
|
export { Pagination } from "./components/Pagination";
|
|
30
30
|
export { StatusBadge } from "./components/StatusBadge";
|
|
31
31
|
export { Modal, ModalFooter } from "./components/Modal";
|
|
32
|
+
export { QuickCreateModal } from "./components/QuickCreateModal";
|
|
33
|
+
export { VacationBanner } from "./components/VacationBanner";
|
|
32
34
|
export { UnsavedChangesModal } from "./components/UnsavedChangesModal";
|
|
33
35
|
export { LoginRequiredModal } from "./components/LoginRequiredModal";
|
|
34
36
|
export { Drawer } from "./components/Drawer";
|
|
@@ -99,6 +101,8 @@ export { DetailViewShell } from "./components/DetailViewShell";
|
|
|
99
101
|
export { StackedViewShell } from "./components/StackedViewShell";
|
|
100
102
|
export { BulkActionBar } from "./components/BulkActionBar";
|
|
101
103
|
export { BulkActionsBar } from "./components/BulkActionsBar";
|
|
104
|
+
export { StickyBottomBar } from "./components/StickyBottomBar";
|
|
105
|
+
export { ClaimCouponButton } from "./components/ClaimCouponButton";
|
|
102
106
|
export { FlowDiagram } from "./components/FlowDiagram";
|
|
103
107
|
export { BaseListingCard } from "./components/BaseListingCard";
|
|
104
108
|
export { default as ImageGallery } from "./components/ImageGallery";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mohasinac/appkit",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.52",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -149,6 +149,8 @@
|
|
|
149
149
|
"audit": "node scripts/audit-violations.mjs",
|
|
150
150
|
"check:types": "tsc --noEmit",
|
|
151
151
|
"check:audits": "node scripts/audit-violations.mjs && node scripts/verify-entries.mjs && node scripts/verify-css-build.mjs && node scripts/audit-use-client.mjs && node scripts/audit-double-navigation.mjs && node scripts/audit-repository-fields.mjs && node scripts/audit-query-provider.mjs && node scripts/audit-export-paths.mjs",
|
|
152
|
+
"test": "vitest run --passWithNoTests",
|
|
153
|
+
"test:watch": "vitest",
|
|
152
154
|
"check": "npm run check:types && npm run check:audits"
|
|
153
155
|
},
|
|
154
156
|
"dependencies": {
|
|
@@ -190,6 +192,8 @@
|
|
|
190
192
|
},
|
|
191
193
|
"devDependencies": {
|
|
192
194
|
"@tanstack/react-query": "^5.0.0",
|
|
195
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
196
|
+
"@testing-library/react": "^16.3.2",
|
|
193
197
|
"@upstash/ratelimit": "^2.0.8",
|
|
194
198
|
"@upstash/redis": "^1.37.0",
|
|
195
199
|
"concurrently": "^9.2.1",
|
|
@@ -197,6 +201,7 @@
|
|
|
197
201
|
"firebase": "^12.8.0",
|
|
198
202
|
"firebase-admin": "^10.3.0",
|
|
199
203
|
"firebase-functions": "^6.6.0",
|
|
204
|
+
"jsdom": "^29.1.1",
|
|
200
205
|
"lucide-react": "^1.7.0",
|
|
201
206
|
"next": "^15.0.0",
|
|
202
207
|
"next-intl": "^4.9.1",
|
|
@@ -206,6 +211,7 @@
|
|
|
206
211
|
"resend": "^6.10.0",
|
|
207
212
|
"server-only": "^0.0.1",
|
|
208
213
|
"tailwindcss": "^3.4.19",
|
|
209
|
-
"typescript": "^5.9.3"
|
|
214
|
+
"typescript": "^5.9.3",
|
|
215
|
+
"vitest": "^4.1.7"
|
|
210
216
|
}
|
|
211
217
|
}
|