@mohasinac/appkit 2.3.1 → 2.3.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/dist/client.d.ts +12 -8
- package/dist/client.js +7 -4
- package/dist/constants/api-endpoints.d.ts +4 -0
- package/dist/constants/api-endpoints.js +2 -0
- package/dist/core/contact-submissions.repository.d.ts +32 -0
- package/dist/core/contact-submissions.repository.js +49 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +1 -0
- package/dist/features/about/components/HowPayoutsWorkView.js +1 -1
- package/dist/features/account/components/AddressFilters.d.ts +5 -0
- package/dist/features/account/components/AddressFilters.js +20 -0
- package/dist/features/account/components/AddressesIndexListing.d.ts +6 -0
- package/dist/features/account/components/AddressesIndexListing.js +51 -0
- package/dist/features/account/components/UserSidebar.d.ts +7 -3
- package/dist/features/account/components/UserSidebar.js +55 -7
- package/dist/features/account/hooks/useAddresses.d.ts +7 -0
- package/dist/features/account/hooks/useAddresses.js +12 -1
- package/dist/features/admin/actions/admin-read-actions.d.ts +12 -0
- package/dist/features/admin/actions/admin-read-actions.js +18 -0
- package/dist/features/admin/components/AdminBlogView.js +26 -2
- package/dist/features/admin/components/AdminCarouselView.js +18 -2
- package/dist/features/admin/components/AdminCategoriesView.js +27 -2
- package/dist/features/admin/components/AdminContactView.d.ts +4 -0
- package/dist/features/admin/components/AdminContactView.js +50 -0
- package/dist/features/admin/components/AdminFaqsView.js +19 -2
- package/dist/features/admin/components/AdminListingScaffold.d.ts +11 -2
- package/dist/features/admin/components/AdminListingScaffold.js +14 -3
- package/dist/features/admin/components/AdminNewsletterView.d.ts +4 -0
- package/dist/features/admin/components/AdminNewsletterView.js +50 -0
- package/dist/features/admin/components/AdminProductsView.js +30 -2
- package/dist/features/admin/components/AdminReviewsView.js +26 -2
- package/dist/features/admin/components/AdminStoresView.js +17 -2
- package/dist/features/admin/components/AdminUsersView.js +27 -2
- package/dist/features/admin/components/DataTable.d.ts +2 -1
- package/dist/features/admin/components/DataTable.js +18 -4
- package/dist/features/admin/components/index.d.ts +6 -0
- package/dist/features/admin/components/index.js +3 -0
- package/dist/features/admin/hooks/useAdminListingData.d.ts +3 -1
- package/dist/features/admin/hooks/useAdminListingData.js +12 -7
- package/dist/features/admin/server.d.ts +3 -0
- package/dist/features/admin/server.js +2 -0
- package/dist/features/auctions/components/AuctionDetailPageView.js +93 -47
- package/dist/features/auctions/components/AuctionFilters.d.ts +8 -0
- package/dist/features/auctions/components/AuctionFilters.js +12 -0
- package/dist/features/auctions/components/AuctionsListView.d.ts +6 -1
- package/dist/features/auctions/components/AuctionsListView.js +37 -5
- package/dist/features/auctions/schemas/index.d.ts +4 -4
- package/dist/features/blog/components/BlogFeaturedCard.d.ts +1 -7
- package/dist/features/blog/components/BlogFeaturedCard.js +4 -5
- package/dist/features/blog/components/BlogFilters.js +2 -1
- package/dist/features/blog/components/BlogIndexListing.js +14 -9
- package/dist/features/blog/components/BlogIndexPageView.d.ts +6 -1
- package/dist/features/blog/components/BlogIndexPageView.js +10 -2
- package/dist/features/blog/components/BlogListView.d.ts +2 -1
- package/dist/features/blog/components/BlogListView.js +10 -3
- package/dist/features/categories/components/CategoriesIndexListing.d.ts +1 -1
- package/dist/features/categories/components/CategoriesIndexListing.js +41 -38
- package/dist/features/categories/components/CategoriesIndexPageView.d.ts +6 -1
- package/dist/features/categories/components/CategoriesIndexPageView.js +41 -2
- package/dist/features/categories/components/CategoryDetailPageView.js +13 -6
- package/dist/features/categories/components/CategoryDetailTabs.d.ts +5 -0
- package/dist/features/categories/components/CategoryDetailTabs.js +17 -0
- package/dist/features/categories/components/CategoryFilters.js +2 -1
- package/dist/features/categories/components/CategoryGrid.d.ts +2 -1
- package/dist/features/categories/components/CategoryGrid.js +8 -6
- package/dist/features/categories/components/CategoryProductsListing.js +22 -11
- package/dist/features/categories/components/index.d.ts +2 -0
- package/dist/features/categories/components/index.js +1 -0
- package/dist/features/categories/hooks/useCategories.d.ts +20 -0
- package/dist/features/categories/hooks/useCategories.js +50 -1
- package/dist/features/categories/hooks/useCategoryTree.d.ts +17 -0
- package/dist/features/categories/hooks/useCategoryTree.js +65 -0
- package/dist/features/events/components/AdminEventEditorView.d.ts +6 -0
- package/dist/features/events/components/AdminEventEditorView.js +203 -0
- package/dist/features/events/components/AdminEventsView.js +28 -2
- package/dist/features/events/components/EventCard.js +4 -2
- package/dist/features/events/components/EventFilters.js +2 -1
- package/dist/features/events/components/EventsIndexListing.js +40 -10
- package/dist/features/events/components/EventsListPageView.d.ts +6 -1
- package/dist/features/events/components/EventsListPageView.js +40 -7
- package/dist/features/events/components/index.d.ts +2 -0
- package/dist/features/events/components/index.js +1 -0
- package/dist/features/events/hooks/useEvents.js +2 -0
- package/dist/features/events/types/index.d.ts +1 -0
- package/dist/features/homepage/components/BlogArticlesSection.js +1 -1
- package/dist/features/homepage/components/EventsSection.js +1 -1
- package/dist/features/homepage/components/FeaturedAuctionsSection.js +1 -1
- package/dist/features/homepage/components/FeaturedPreOrdersSection.js +1 -1
- package/dist/features/homepage/components/FeaturedProductsSection.js +1 -1
- package/dist/features/homepage/components/FeaturedStoresSection.js +1 -1
- package/dist/features/homepage/components/HeroCarousel.js +1 -1
- package/dist/features/homepage/components/MarketplaceHomepageView.js +27 -17
- package/dist/features/homepage/components/SectionCarousel.js +4 -4
- package/dist/features/homepage/components/ShopByCategorySection.js +2 -2
- package/dist/features/homepage/schemas/firestore.d.ts +1 -1
- package/dist/features/homepage/schemas/firestore.js +2 -1
- package/dist/features/layout/AppLayoutShell.d.ts +6 -2
- package/dist/features/layout/AppLayoutShell.js +7 -3
- package/dist/features/pre-orders/components/MarketplacePreorderCard.d.ts +3 -1
- package/dist/features/pre-orders/components/MarketplacePreorderCard.js +6 -2
- package/dist/features/pre-orders/components/PreOrderDetailPageView.js +80 -12
- package/dist/features/pre-orders/components/PreOrderFilters.d.ts +8 -0
- package/dist/features/pre-orders/components/PreOrderFilters.js +21 -0
- package/dist/features/pre-orders/components/PreOrdersIndexListing.d.ts +2 -1
- package/dist/features/pre-orders/components/PreOrdersIndexListing.js +69 -10
- package/dist/features/pre-orders/components/PreOrdersListView.d.ts +6 -1
- package/dist/features/pre-orders/components/PreOrdersListView.js +26 -7
- package/dist/features/pre-orders/components/index.d.ts +2 -0
- package/dist/features/pre-orders/components/index.js +1 -0
- package/dist/features/products/components/AuctionsIndexListing.d.ts +2 -1
- package/dist/features/products/components/AuctionsIndexListing.js +61 -9
- package/dist/features/products/components/InteractiveProductCard.d.ts +2 -4
- package/dist/features/products/components/InteractiveProductCard.js +2 -2
- package/dist/features/products/components/ProductDetailPageView.d.ts +1 -1
- package/dist/features/products/components/ProductDetailPageView.js +116 -25
- package/dist/features/products/components/ProductFilters.d.ts +6 -11
- package/dist/features/products/components/ProductFilters.js +5 -3
- package/dist/features/products/components/ProductGrid.d.ts +8 -2
- package/dist/features/products/components/ProductGrid.js +20 -5
- package/dist/features/products/components/ProductTabsShell.d.ts +3 -11
- package/dist/features/products/components/ProductTabsShell.js +14 -14
- package/dist/features/products/components/ProductsIndexListing.js +73 -9
- package/dist/features/products/components/ProductsIndexPageView.d.ts +6 -1
- package/dist/features/products/components/ProductsIndexPageView.js +39 -6
- package/dist/features/products/components/RelatedProductsCarousel.d.ts +7 -0
- package/dist/features/products/components/RelatedProductsCarousel.js +11 -0
- package/dist/features/products/components/index.d.ts +1 -0
- package/dist/features/products/components/index.js +1 -0
- package/dist/features/products/hooks/useProducts.js +16 -0
- package/dist/features/products/repository/products.repository.d.ts +8 -0
- package/dist/features/products/repository/products.repository.js +2 -0
- package/dist/features/products/schemas/index.d.ts +8 -8
- package/dist/features/products/types/index.d.ts +12 -0
- package/dist/features/promotions/components/CouponsIndexListing.d.ts +9 -0
- package/dist/features/promotions/components/CouponsIndexListing.js +86 -0
- package/dist/features/promotions/components/PromotionsView.d.ts +11 -5
- package/dist/features/promotions/components/PromotionsView.js +6 -1
- package/dist/features/promotions/components/index.d.ts +4 -2
- package/dist/features/promotions/components/index.js +2 -1
- package/dist/features/reviews/components/ReviewDetailPageView.d.ts +4 -0
- package/dist/features/reviews/components/ReviewDetailPageView.js +20 -0
- package/dist/features/reviews/components/ReviewDetailShell.d.ts +7 -0
- package/dist/features/reviews/components/ReviewDetailShell.js +80 -0
- package/dist/features/reviews/components/ReviewFilters.d.ts +3 -3
- package/dist/features/reviews/components/ReviewFilters.js +5 -4
- package/dist/features/reviews/components/ReviewsIndexListing.d.ts +4 -3
- package/dist/features/reviews/components/ReviewsIndexListing.js +35 -51
- package/dist/features/reviews/components/ReviewsIndexPageView.d.ts +6 -1
- package/dist/features/reviews/components/ReviewsIndexPageView.js +49 -3
- package/dist/features/reviews/components/ReviewsList.js +9 -1
- package/dist/features/reviews/components/index.d.ts +1 -0
- package/dist/features/reviews/hooks/useReviews.js +15 -1
- package/dist/features/reviews/types/index.d.ts +6 -1
- package/dist/features/seller/components/SellerSidebar.d.ts +8 -4
- package/dist/features/seller/components/SellerSidebar.js +6 -4
- package/dist/features/seller/components/index.d.ts +30 -0
- package/dist/features/seller/components/index.js +17 -0
- package/dist/features/seller/hooks/useSellerStore.d.ts +2 -0
- package/dist/features/seller/hooks/useSellerStore.js +2 -0
- package/dist/features/seller/permission-map.d.ts +4 -2
- package/dist/features/seller/permission-map.js +16 -14
- package/dist/features/seller/schemas/index.d.ts +2 -2
- package/dist/features/stores/api/[storeSlug]/reviews/route.d.ts +1 -1
- package/dist/features/stores/api/[storeSlug]/reviews/route.js +24 -19
- package/dist/features/stores/components/InteractiveStoreCard.d.ts +0 -5
- package/dist/features/stores/components/InteractiveStoreCard.js +9 -9
- package/dist/features/stores/components/StoreAuctionsListing.js +27 -9
- package/dist/features/stores/components/StoreDetailLayoutView.js +2 -0
- package/dist/features/stores/components/StoreFilters.d.ts +5 -0
- package/dist/features/stores/components/StoreFilters.js +20 -0
- package/dist/features/stores/components/StoreHeader.js +2 -2
- package/dist/features/stores/components/StorePreOrdersListing.d.ts +5 -0
- package/dist/features/stores/components/StorePreOrdersListing.js +40 -0
- package/dist/features/stores/components/StorePreOrdersPageView.d.ts +4 -0
- package/dist/features/stores/components/StorePreOrdersPageView.js +21 -0
- package/dist/features/stores/components/StoreProductsListing.js +21 -11
- package/dist/features/stores/components/StoreReviewsListing.js +2 -7
- package/dist/features/stores/components/StoresIndexListing.js +42 -8
- package/dist/features/stores/components/StoresIndexPageView.d.ts +6 -1
- package/dist/features/stores/components/StoresIndexPageView.js +9 -2
- package/dist/features/stores/components/index.d.ts +3 -0
- package/dist/features/stores/components/index.js +1 -0
- package/dist/features/stores/hooks/useStores.d.ts +7 -1
- package/dist/features/stores/hooks/useStores.js +16 -3
- package/dist/features/stores/schemas/index.d.ts +2 -2
- package/dist/features/stores/types/index.d.ts +3 -0
- package/dist/features/wishlist/hooks/useGuestWishlist.d.ts +20 -0
- package/dist/features/wishlist/hooks/useGuestWishlist.js +49 -0
- package/dist/features/wishlist/hooks/useWishlistCount.d.ts +7 -0
- package/dist/features/wishlist/hooks/useWishlistCount.js +31 -0
- package/dist/features/wishlist/hooks/useWishlistWithGuest.d.ts +56 -0
- package/dist/features/wishlist/hooks/useWishlistWithGuest.js +57 -0
- package/dist/features/wishlist/index.d.ts +3 -0
- package/dist/features/wishlist/index.js +3 -0
- package/dist/features/wishlist/utils/guest-wishlist.d.ts +22 -0
- package/dist/features/wishlist/utils/guest-wishlist.js +70 -0
- package/dist/index.d.ts +50 -1
- package/dist/index.js +63 -1
- package/dist/next/routing/route-map.d.ts +70 -36
- package/dist/next/routing/route-map.js +30 -22
- package/dist/seed/addresses-seed-data.js +62 -261
- package/dist/seed/beyblade-seed-data.d.ts +7 -0
- package/dist/seed/beyblade-seed-data.js +947 -0
- package/dist/seed/bids-seed-data.d.ts +10 -2
- package/dist/seed/bids-seed-data.js +220 -1071
- package/dist/seed/blog-posts-seed-data.d.ts +2 -2
- package/dist/seed/blog-posts-seed-data.js +455 -117
- package/dist/seed/cart-seed-data.d.ts +9 -9
- package/dist/seed/cart-seed-data.js +73 -74
- package/dist/seed/coupons-seed-data.d.ts +3 -4
- package/dist/seed/coupons-seed-data.js +3 -509
- package/dist/seed/events-seed-data.d.ts +2 -2
- package/dist/seed/events-seed-data.js +315 -476
- package/dist/seed/faq-seed-data.d.ts +18 -41
- package/dist/seed/faq-seed-data.js +1059 -1172
- package/dist/seed/hot-wheels-seed-data.d.ts +7 -0
- package/dist/seed/hot-wheels-seed-data.js +1365 -0
- package/dist/seed/index.d.ts +6 -1
- package/dist/seed/index.js +6 -1
- package/dist/seed/pokemon-carousel-slides-seed-data.d.ts +4 -2
- package/dist/seed/pokemon-carousel-slides-seed-data.js +152 -268
- package/dist/seed/pokemon-categories-seed-data.d.ts +18 -21
- package/dist/seed/pokemon-categories-seed-data.js +424 -1004
- package/dist/seed/pokemon-coupons-seed-data.d.ts +6 -0
- package/dist/seed/pokemon-coupons-seed-data.js +465 -0
- package/dist/seed/pokemon-homepage-sections-seed-data.d.ts +3 -2
- package/dist/seed/pokemon-homepage-sections-seed-data.js +67 -289
- package/dist/seed/pokemon-products-seed-data.js +662 -0
- package/dist/seed/pokemon-seed-bundle.d.ts +32 -11
- package/dist/seed/pokemon-seed-bundle.js +41 -11
- package/dist/seed/pokemon-stores-seed-data.d.ts +2 -3
- package/dist/seed/pokemon-stores-seed-data.js +56 -31
- package/dist/seed/pokemon-users-seed-data.d.ts +2 -2
- package/dist/seed/pokemon-users-seed-data.js +245 -261
- package/dist/seed/reviews-seed-data.d.ts +17 -2
- package/dist/seed/reviews-seed-data.js +519 -483
- package/dist/seed/site-settings-seed-data.js +14 -14
- package/dist/seed/store-addresses-seed-data.js +68 -50
- package/dist/seed/transformers-seed-data.d.ts +7 -0
- package/dist/seed/transformers-seed-data.js +510 -0
- package/dist/seed/wishlists-seed-data.d.ts +5 -1
- package/dist/seed/wishlists-seed-data.js +82 -4
- package/dist/server.d.ts +1 -0
- package/dist/server.js +2 -0
- package/dist/tokens/index.d.ts +6 -0
- package/dist/tokens/index.js +2 -0
- package/dist/ui/components/BaseListingCard.js +24 -26
- package/dist/ui/components/BaseListingCard.style.css +5 -5
- package/dist/ui/components/HorizontalScroller.d.ts +1 -1
- package/dist/ui/components/HorizontalScroller.js +19 -5
- package/dist/ui/components/SideDrawer.style.css +3 -11
- package/dist/ui/rich-text/RichText.js +19 -1
- package/package.json +1 -1
package/dist/tokens/index.js
CHANGED
|
@@ -814,6 +814,8 @@ export const THEME_CONSTANTS = {
|
|
|
814
814
|
perView: {
|
|
815
815
|
/** Default: 1 on mobile, 2 on sm, 3 on md+ */
|
|
816
816
|
default: { base: 1, sm: 2, md: 3 },
|
|
817
|
+
/** Standard: 1 on mobile, 3 on md, 4 on lg+ — the canonical homepage carousel preset */
|
|
818
|
+
standard: { base: 1, md: 3, lg: 4 },
|
|
817
819
|
/** Cards: 1 on mobile, 2 on sm, 3 on md, 4 on lg+ */
|
|
818
820
|
cards: { base: 1, sm: 2, md: 3, lg: 4 },
|
|
819
821
|
/** Compact cards: 2 on mobile, 3 on sm, 4 on md, 5 on xl+ */
|
|
@@ -1,55 +1,53 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Button } from "./Button";
|
|
3
3
|
import { Span } from "./Typography";
|
|
4
|
-
const UI_LISTING_CARD = {
|
|
5
|
-
root: "appkit-listing-card",
|
|
6
|
-
selected: "appkit-listing-card--selected",
|
|
7
|
-
disabled: "appkit-listing-card--disabled",
|
|
8
|
-
clickable: "appkit-listing-card--clickable",
|
|
9
|
-
hero: "appkit-listing-card__hero",
|
|
10
|
-
heroSquare: "appkit-listing-card__hero--square",
|
|
11
|
-
heroLandscape: "appkit-listing-card__hero--landscape",
|
|
12
|
-
info: "appkit-listing-card__info",
|
|
13
|
-
checkbox: "appkit-listing-card__checkbox",
|
|
14
|
-
checkboxSelected: "appkit-listing-card__checkbox--selected",
|
|
15
|
-
checkboxIcon: "appkit-listing-card__checkbox-icon",
|
|
16
|
-
};
|
|
17
4
|
function BaseListingCardRoot({ className = "", isSelected, isDisabled, onClick, children, }) {
|
|
18
5
|
return (_jsx("div", { onClick: onClick, className: [
|
|
19
|
-
|
|
20
|
-
isSelected
|
|
21
|
-
|
|
22
|
-
|
|
6
|
+
"relative flex flex-col w-full min-w-0 overflow-hidden rounded-xl border bg-white dark:bg-zinc-900 transition-shadow",
|
|
7
|
+
isSelected
|
|
8
|
+
? "border-primary outline outline-2 outline-primary shadow-sm"
|
|
9
|
+
: "border-zinc-200 dark:border-zinc-700 shadow-sm hover:shadow-md",
|
|
10
|
+
isDisabled ? "opacity-60" : "",
|
|
11
|
+
onClick ? "cursor-pointer" : "",
|
|
23
12
|
className,
|
|
24
13
|
]
|
|
25
14
|
.filter(Boolean)
|
|
26
|
-
.join(" "),
|
|
15
|
+
.join(" "), children: children }));
|
|
27
16
|
}
|
|
28
17
|
function BaseListingCardHero({ aspect, className = "", children, onMouseEnter, onMouseLeave, }) {
|
|
29
18
|
const aspectClass = aspect === "square"
|
|
30
|
-
?
|
|
19
|
+
? "aspect-square"
|
|
31
20
|
: aspect === "4/3" || !aspect
|
|
32
|
-
?
|
|
21
|
+
? "aspect-[4/3]"
|
|
33
22
|
: `aspect-[${aspect}]`;
|
|
34
|
-
return (_jsx("div", { className: [
|
|
23
|
+
return (_jsx("div", { className: [
|
|
24
|
+
"relative overflow-hidden bg-zinc-100 dark:bg-zinc-800 flex-shrink-0",
|
|
25
|
+
aspectClass,
|
|
26
|
+
className,
|
|
27
|
+
]
|
|
35
28
|
.filter(Boolean)
|
|
36
|
-
.join(" "), onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave,
|
|
29
|
+
.join(" "), onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, children: children }));
|
|
37
30
|
}
|
|
38
31
|
function BaseListingCardInfo({ className = "", children, }) {
|
|
39
|
-
return (_jsx("div", { className: [
|
|
32
|
+
return (_jsx("div", { className: [
|
|
33
|
+
"p-3 flex flex-col flex-1 gap-1.5",
|
|
34
|
+
className,
|
|
35
|
+
]
|
|
36
|
+
.filter(Boolean)
|
|
37
|
+
.join(" "), children: children }));
|
|
40
38
|
}
|
|
41
39
|
function BaseListingCardCheckbox({ selected, onSelect, label, position = "top-2 left-2", className = "", }) {
|
|
42
40
|
return (_jsx(Button, { type: "button", "aria-label": label ?? (selected ? "Deselect" : "Select"), onClick: (e) => {
|
|
43
41
|
e.stopPropagation();
|
|
44
42
|
onSelect?.(e);
|
|
45
43
|
}, className: [
|
|
46
|
-
|
|
47
|
-
selected ?
|
|
44
|
+
"absolute z-10 h-5 w-5 rounded border-2 flex items-center justify-center bg-white/90",
|
|
45
|
+
selected ? "bg-primary border-primary" : "border-zinc-300",
|
|
48
46
|
position,
|
|
49
47
|
className,
|
|
50
48
|
]
|
|
51
49
|
.filter(Boolean)
|
|
52
|
-
.join(" "), children: selected && _jsx(Span, { className:
|
|
50
|
+
.join(" "), children: selected && _jsx(Span, { className: "text-white text-xs leading-none", children: "\u2713" }) }));
|
|
53
51
|
}
|
|
54
52
|
export const BaseListingCard = Object.assign(BaseListingCardRoot, {
|
|
55
53
|
Hero: BaseListingCardHero,
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
position: relative;
|
|
5
5
|
display: flex;
|
|
6
6
|
flex-direction: column;
|
|
7
|
-
|
|
7
|
+
width: 100%;
|
|
8
|
+
min-width: 0;
|
|
8
9
|
border-radius: 0.75rem;
|
|
9
10
|
border: 1px solid #e5e7eb;
|
|
10
11
|
overflow: hidden;
|
|
11
12
|
transition: box-shadow 0.2s ease;
|
|
12
|
-
|
|
13
|
-
min-height: clamp(220px, 26vh, 360px);
|
|
13
|
+
background-color: #ffffff;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
:is(.dark) .appkit-listing-card {
|
|
@@ -39,8 +39,7 @@
|
|
|
39
39
|
position: relative;
|
|
40
40
|
overflow: hidden;
|
|
41
41
|
background-color: #f3f4f6;
|
|
42
|
-
|
|
43
|
-
max-height: clamp(160px, 24vh, 280px);
|
|
42
|
+
flex-shrink: 0;
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
:is(.dark) .appkit-listing-card__hero {
|
|
@@ -56,6 +55,7 @@
|
|
|
56
55
|
display: flex;
|
|
57
56
|
flex-direction: column;
|
|
58
57
|
flex: 1;
|
|
58
|
+
gap: 0.375rem;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/* Checkbox overlay */
|
|
@@ -30,4 +30,4 @@ export interface HorizontalScrollerProps<T = unknown> {
|
|
|
30
30
|
pauseOnHover?: boolean;
|
|
31
31
|
itemClassName?: string;
|
|
32
32
|
}
|
|
33
|
-
export declare function HorizontalScroller<T = unknown>({ children, className, gap, snapToItems, showArrows, arrowSize, showScrollbar, showFadeEdges, scrollContainerRef: externalRef, onScroll, items, renderItem, keyExtractor, perView, rows, autoScroll, autoScrollInterval, minItemWidth, itemClassName, }: HorizontalScrollerProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare function HorizontalScroller<T = unknown>({ children, className, gap, snapToItems, showArrows, arrowSize, showScrollbar, showFadeEdges, scrollContainerRef: externalRef, onScroll, items, renderItem, keyExtractor, perView, rows, autoScroll, autoScrollInterval, minItemWidth, pauseOnHover, itemClassName, }: HorizontalScrollerProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -21,8 +21,9 @@ function resolvePerView(perView, containerWidth) {
|
|
|
21
21
|
}
|
|
22
22
|
return 1;
|
|
23
23
|
}
|
|
24
|
-
export function HorizontalScroller({ children, className = "", gap = 16, snapToItems, showArrows, arrowSize = "md", showScrollbar, showFadeEdges, scrollContainerRef: externalRef, onScroll, items, renderItem, keyExtractor, perView, rows = 1, autoScroll, autoScrollInterval = 3500, minItemWidth, itemClassName = "", }) {
|
|
24
|
+
export function HorizontalScroller({ children, className = "", gap = 16, snapToItems, showArrows, arrowSize = "md", showScrollbar, showFadeEdges, scrollContainerRef: externalRef, onScroll, items, renderItem, keyExtractor, perView, rows = 1, autoScroll, autoScrollInterval = 3500, minItemWidth, pauseOnHover = false, itemClassName = "", }) {
|
|
25
25
|
const [itemWidth, setItemWidth] = useState(undefined);
|
|
26
|
+
const [isPaused, setIsPaused] = useState(false);
|
|
26
27
|
const internalRef = useRef(null);
|
|
27
28
|
const containerRef = (externalRef ??
|
|
28
29
|
internalRef);
|
|
@@ -34,12 +35,22 @@ export function HorizontalScroller({ children, className = "", gap = 16, snapToI
|
|
|
34
35
|
const width = el.clientWidth;
|
|
35
36
|
el.scrollBy({ left: direction * width * 0.8, behavior: "smooth" });
|
|
36
37
|
}, [containerRef]);
|
|
38
|
+
const handleKeyDown = useCallback((e) => {
|
|
39
|
+
if (e.key === "ArrowRight") {
|
|
40
|
+
e.preventDefault();
|
|
41
|
+
scrollBy(1);
|
|
42
|
+
}
|
|
43
|
+
else if (e.key === "ArrowLeft") {
|
|
44
|
+
e.preventDefault();
|
|
45
|
+
scrollBy(-1);
|
|
46
|
+
}
|
|
47
|
+
}, [scrollBy]);
|
|
37
48
|
useEffect(() => {
|
|
38
|
-
if (!autoScroll)
|
|
49
|
+
if (!autoScroll || isPaused)
|
|
39
50
|
return;
|
|
40
51
|
autoScrollTimer.current = setInterval(() => scrollBy(1), autoScrollInterval);
|
|
41
52
|
return () => clearInterval(autoScrollTimer.current);
|
|
42
|
-
}, [autoScroll, autoScrollInterval, scrollBy]);
|
|
53
|
+
}, [autoScroll, isPaused, autoScrollInterval, scrollBy]);
|
|
43
54
|
useEffect(() => {
|
|
44
55
|
if (!perView)
|
|
45
56
|
return;
|
|
@@ -109,10 +120,13 @@ export function HorizontalScroller({ children, className = "", gap = 16, snapToI
|
|
|
109
120
|
: minItemWidth
|
|
110
121
|
? { minWidth: minItemWidth }
|
|
111
122
|
: undefined, children: renderItem(item, i) }, keyExtractor ? keyExtractor(item, i) : i))))) : children;
|
|
123
|
+
const hoverHandlers = pauseOnHover
|
|
124
|
+
? { onMouseEnter: () => setIsPaused(true), onMouseLeave: () => setIsPaused(false) }
|
|
125
|
+
: {};
|
|
112
126
|
if (showArrows) {
|
|
113
127
|
return (_jsxs("div", { className: ["appkit-hscroller appkit-hscroller--with-arrows", className]
|
|
114
128
|
.filter(Boolean)
|
|
115
|
-
.join(" "), "data-section": "horizontalscroller-div-511", children: [showFadeEdges && (_jsxs(_Fragment, { children: [_jsx("div", { className: "appkit-hscroller__fade appkit-hscroller__fade--left" }), _jsx("div", { className: "appkit-hscroller__fade appkit-hscroller__fade--right" })] })), _jsx("button", { type: "button", onClick: () => scrollBy(-1), "aria-label": "Previous", className: `appkit-hscroller__arrow appkit-hscroller__arrow--prev appkit-hscroller__arrow--${arrowSize}`, children: _jsx(ChevronLeft, { className: "w-4 h-4" }) }), _jsx("div", { ref: containerRef, onScroll: onScroll, className: scrollerCls, style: { gap: `${gap}px`, paddingLeft: 36, paddingRight: 36 }, "data-section": "horizontalscroller-div-512", children: content }), _jsx("button", { type: "button", onClick: () => scrollBy(1), "aria-label": "Next", className: `appkit-hscroller__arrow appkit-hscroller__arrow--next appkit-hscroller__arrow--${arrowSize}`, children: _jsx(ChevronRight, { className: "w-4 h-4" }) })] }));
|
|
129
|
+
.join(" "), tabIndex: 0, onKeyDown: handleKeyDown, ...hoverHandlers, "data-section": "horizontalscroller-div-511", children: [showFadeEdges && (_jsxs(_Fragment, { children: [_jsx("div", { className: "appkit-hscroller__fade appkit-hscroller__fade--left" }), _jsx("div", { className: "appkit-hscroller__fade appkit-hscroller__fade--right" })] })), _jsx("button", { type: "button", onClick: () => scrollBy(-1), "aria-label": "Previous", className: `appkit-hscroller__arrow appkit-hscroller__arrow--prev appkit-hscroller__arrow--${arrowSize}`, children: _jsx(ChevronLeft, { className: "w-4 h-4" }) }), _jsx("div", { ref: containerRef, onScroll: onScroll, className: scrollerCls, style: { gap: `${gap}px`, paddingLeft: 36, paddingRight: 36 }, "data-section": "horizontalscroller-div-512", children: content }), _jsx("button", { type: "button", onClick: () => scrollBy(1), "aria-label": "Next", className: `appkit-hscroller__arrow appkit-hscroller__arrow--next appkit-hscroller__arrow--${arrowSize}`, children: _jsx(ChevronRight, { className: "w-4 h-4" }) })] }));
|
|
116
130
|
}
|
|
117
|
-
return (_jsxs("div", { className: ["appkit-hscroller", className].filter(Boolean).join(" "), "data-section": "horizontalscroller-div-513", children: [showFadeEdges && (_jsxs(_Fragment, { children: [_jsx("div", { className: "appkit-hscroller__fade appkit-hscroller__fade--left" }), _jsx("div", { className: "appkit-hscroller__fade appkit-hscroller__fade--right" })] })), _jsx("div", { ref: containerRef, onScroll: onScroll, className: scrollerCls, style: { gap: `${gap}px` }, "data-section": "horizontalscroller-div-514", children: content })] }));
|
|
131
|
+
return (_jsxs("div", { className: ["appkit-hscroller", className].filter(Boolean).join(" "), tabIndex: 0, onKeyDown: handleKeyDown, ...hoverHandlers, "data-section": "horizontalscroller-div-513", children: [showFadeEdges && (_jsxs(_Fragment, { children: [_jsx("div", { className: "appkit-hscroller__fade appkit-hscroller__fade--left" }), _jsx("div", { className: "appkit-hscroller__fade appkit-hscroller__fade--right" })] })), _jsx("div", { ref: containerRef, onScroll: onScroll, className: scrollerCls, style: { gap: `${gap}px` }, "data-section": "horizontalscroller-div-514", children: content })] }));
|
|
118
132
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
.appkit-side-drawer__backdrop {
|
|
4
4
|
position: fixed;
|
|
5
5
|
inset: 0;
|
|
6
|
-
z-index:
|
|
6
|
+
z-index: 40;
|
|
7
7
|
background: rgba(0, 0, 0, 0.5);
|
|
8
8
|
backdrop-filter: blur(4px);
|
|
9
9
|
transition: opacity 0.2s ease;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
position: fixed;
|
|
14
14
|
top: 0;
|
|
15
15
|
bottom: 0;
|
|
16
|
-
z-index:
|
|
16
|
+
z-index: 40;
|
|
17
17
|
background: white;
|
|
18
18
|
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
|
|
19
19
|
display: flex;
|
|
@@ -25,18 +25,10 @@
|
|
|
25
25
|
background: #0f172a;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
/*
|
|
28
|
+
/* Full-viewport width on all breakpoints — navbars (z-50) render over this */
|
|
29
29
|
.appkit-side-drawer--left { left: 0; width: 100%; }
|
|
30
30
|
.appkit-side-drawer--right { right: 0; width: 100%; }
|
|
31
31
|
|
|
32
|
-
@media (min-width: 640px) {
|
|
33
|
-
.appkit-side-drawer--left { width: 100%; }
|
|
34
|
-
}
|
|
35
|
-
@media (min-width: 768px) {
|
|
36
|
-
.appkit-side-drawer--left { width: 420px; }
|
|
37
|
-
.appkit-side-drawer--right { width: 60%; }
|
|
38
|
-
}
|
|
39
|
-
|
|
40
32
|
/* Header */
|
|
41
33
|
.appkit-side-drawer__header {
|
|
42
34
|
padding: 1.5rem;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { Div } from "../components/Div";
|
|
5
|
-
// --- Allowed HTML tags (safe subset — no script/iframe
|
|
5
|
+
// --- Allowed HTML tags (safe subset — no script/object; iframe allowed for YouTube only) -------
|
|
6
6
|
const ALLOWED_TAGS = new Set([
|
|
7
7
|
"p",
|
|
8
8
|
"br",
|
|
@@ -44,6 +44,7 @@ const ALLOWED_TAGS = new Set([
|
|
|
44
44
|
"div",
|
|
45
45
|
"section",
|
|
46
46
|
"article",
|
|
47
|
+
"iframe",
|
|
47
48
|
]);
|
|
48
49
|
/** Attributes allowed per tag. "*" means allowed on any tag. */
|
|
49
50
|
const ALLOWED_ATTRS = {
|
|
@@ -53,6 +54,7 @@ const ALLOWED_ATTRS = {
|
|
|
53
54
|
td: ["colspan", "rowspan"],
|
|
54
55
|
th: ["colspan", "rowspan", "scope"],
|
|
55
56
|
ol: ["type", "start"],
|
|
57
|
+
iframe: ["src", "width", "height", "frameborder", "allowfullscreen", "allow", "title", "loading"],
|
|
56
58
|
};
|
|
57
59
|
// --- Simple client-side sanitiser --------------------------------------------
|
|
58
60
|
// We avoid a third-party sanitizer dependency to keep this module lightweight.
|
|
@@ -97,6 +99,22 @@ function sanitiseHtml(dirty) {
|
|
|
97
99
|
child.removeAttribute("src");
|
|
98
100
|
}
|
|
99
101
|
}
|
|
102
|
+
if (tag === "iframe") {
|
|
103
|
+
const src = child.getAttribute("src") ?? "";
|
|
104
|
+
const isYoutube = /^https:\/\/(www\.)?(youtube\.com\/embed\/|youtube-nocookie\.com\/embed\/)/.test(src.trim());
|
|
105
|
+
if (!isYoutube) {
|
|
106
|
+
node.replaceChild(document.createTextNode(""), child);
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
// Wrap in responsive 16:9 container if parent isn't already one
|
|
110
|
+
const wrapper = document.createElement("div");
|
|
111
|
+
wrapper.className = "relative aspect-video w-full overflow-hidden rounded-lg my-4";
|
|
112
|
+
child.setAttribute("class", "absolute inset-0 h-full w-full");
|
|
113
|
+
child.setAttribute("loading", "lazy");
|
|
114
|
+
node.replaceChild(wrapper, child);
|
|
115
|
+
wrapper.appendChild(child);
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
100
118
|
walk(child);
|
|
101
119
|
}
|
|
102
120
|
}
|