@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.
Files changed (253) hide show
  1. package/dist/client.d.ts +12 -8
  2. package/dist/client.js +7 -4
  3. package/dist/constants/api-endpoints.d.ts +4 -0
  4. package/dist/constants/api-endpoints.js +2 -0
  5. package/dist/core/contact-submissions.repository.d.ts +32 -0
  6. package/dist/core/contact-submissions.repository.js +49 -0
  7. package/dist/core/index.d.ts +2 -0
  8. package/dist/core/index.js +1 -0
  9. package/dist/features/about/components/HowPayoutsWorkView.js +1 -1
  10. package/dist/features/account/components/AddressFilters.d.ts +5 -0
  11. package/dist/features/account/components/AddressFilters.js +20 -0
  12. package/dist/features/account/components/AddressesIndexListing.d.ts +6 -0
  13. package/dist/features/account/components/AddressesIndexListing.js +51 -0
  14. package/dist/features/account/components/UserSidebar.d.ts +7 -3
  15. package/dist/features/account/components/UserSidebar.js +55 -7
  16. package/dist/features/account/hooks/useAddresses.d.ts +7 -0
  17. package/dist/features/account/hooks/useAddresses.js +12 -1
  18. package/dist/features/admin/actions/admin-read-actions.d.ts +12 -0
  19. package/dist/features/admin/actions/admin-read-actions.js +18 -0
  20. package/dist/features/admin/components/AdminBlogView.js +26 -2
  21. package/dist/features/admin/components/AdminCarouselView.js +18 -2
  22. package/dist/features/admin/components/AdminCategoriesView.js +27 -2
  23. package/dist/features/admin/components/AdminContactView.d.ts +4 -0
  24. package/dist/features/admin/components/AdminContactView.js +50 -0
  25. package/dist/features/admin/components/AdminFaqsView.js +19 -2
  26. package/dist/features/admin/components/AdminListingScaffold.d.ts +11 -2
  27. package/dist/features/admin/components/AdminListingScaffold.js +14 -3
  28. package/dist/features/admin/components/AdminNewsletterView.d.ts +4 -0
  29. package/dist/features/admin/components/AdminNewsletterView.js +50 -0
  30. package/dist/features/admin/components/AdminProductsView.js +30 -2
  31. package/dist/features/admin/components/AdminReviewsView.js +26 -2
  32. package/dist/features/admin/components/AdminStoresView.js +17 -2
  33. package/dist/features/admin/components/AdminUsersView.js +27 -2
  34. package/dist/features/admin/components/DataTable.d.ts +2 -1
  35. package/dist/features/admin/components/DataTable.js +18 -4
  36. package/dist/features/admin/components/index.d.ts +6 -0
  37. package/dist/features/admin/components/index.js +3 -0
  38. package/dist/features/admin/hooks/useAdminListingData.d.ts +3 -1
  39. package/dist/features/admin/hooks/useAdminListingData.js +12 -7
  40. package/dist/features/admin/server.d.ts +3 -0
  41. package/dist/features/admin/server.js +2 -0
  42. package/dist/features/auctions/components/AuctionDetailPageView.js +93 -47
  43. package/dist/features/auctions/components/AuctionFilters.d.ts +8 -0
  44. package/dist/features/auctions/components/AuctionFilters.js +12 -0
  45. package/dist/features/auctions/components/AuctionsListView.d.ts +6 -1
  46. package/dist/features/auctions/components/AuctionsListView.js +37 -5
  47. package/dist/features/auctions/schemas/index.d.ts +4 -4
  48. package/dist/features/blog/components/BlogFeaturedCard.d.ts +1 -7
  49. package/dist/features/blog/components/BlogFeaturedCard.js +4 -5
  50. package/dist/features/blog/components/BlogFilters.js +2 -1
  51. package/dist/features/blog/components/BlogIndexListing.js +14 -9
  52. package/dist/features/blog/components/BlogIndexPageView.d.ts +6 -1
  53. package/dist/features/blog/components/BlogIndexPageView.js +10 -2
  54. package/dist/features/blog/components/BlogListView.d.ts +2 -1
  55. package/dist/features/blog/components/BlogListView.js +10 -3
  56. package/dist/features/categories/components/CategoriesIndexListing.d.ts +1 -1
  57. package/dist/features/categories/components/CategoriesIndexListing.js +41 -38
  58. package/dist/features/categories/components/CategoriesIndexPageView.d.ts +6 -1
  59. package/dist/features/categories/components/CategoriesIndexPageView.js +41 -2
  60. package/dist/features/categories/components/CategoryDetailPageView.js +13 -6
  61. package/dist/features/categories/components/CategoryDetailTabs.d.ts +5 -0
  62. package/dist/features/categories/components/CategoryDetailTabs.js +17 -0
  63. package/dist/features/categories/components/CategoryFilters.js +2 -1
  64. package/dist/features/categories/components/CategoryGrid.d.ts +2 -1
  65. package/dist/features/categories/components/CategoryGrid.js +8 -6
  66. package/dist/features/categories/components/CategoryProductsListing.js +22 -11
  67. package/dist/features/categories/components/index.d.ts +2 -0
  68. package/dist/features/categories/components/index.js +1 -0
  69. package/dist/features/categories/hooks/useCategories.d.ts +20 -0
  70. package/dist/features/categories/hooks/useCategories.js +50 -1
  71. package/dist/features/categories/hooks/useCategoryTree.d.ts +17 -0
  72. package/dist/features/categories/hooks/useCategoryTree.js +65 -0
  73. package/dist/features/events/components/AdminEventEditorView.d.ts +6 -0
  74. package/dist/features/events/components/AdminEventEditorView.js +203 -0
  75. package/dist/features/events/components/AdminEventsView.js +28 -2
  76. package/dist/features/events/components/EventCard.js +4 -2
  77. package/dist/features/events/components/EventFilters.js +2 -1
  78. package/dist/features/events/components/EventsIndexListing.js +40 -10
  79. package/dist/features/events/components/EventsListPageView.d.ts +6 -1
  80. package/dist/features/events/components/EventsListPageView.js +40 -7
  81. package/dist/features/events/components/index.d.ts +2 -0
  82. package/dist/features/events/components/index.js +1 -0
  83. package/dist/features/events/hooks/useEvents.js +2 -0
  84. package/dist/features/events/types/index.d.ts +1 -0
  85. package/dist/features/homepage/components/BlogArticlesSection.js +1 -1
  86. package/dist/features/homepage/components/EventsSection.js +1 -1
  87. package/dist/features/homepage/components/FeaturedAuctionsSection.js +1 -1
  88. package/dist/features/homepage/components/FeaturedPreOrdersSection.js +1 -1
  89. package/dist/features/homepage/components/FeaturedProductsSection.js +1 -1
  90. package/dist/features/homepage/components/FeaturedStoresSection.js +1 -1
  91. package/dist/features/homepage/components/HeroCarousel.js +1 -1
  92. package/dist/features/homepage/components/MarketplaceHomepageView.js +27 -17
  93. package/dist/features/homepage/components/SectionCarousel.js +4 -4
  94. package/dist/features/homepage/components/ShopByCategorySection.js +2 -2
  95. package/dist/features/homepage/schemas/firestore.d.ts +1 -1
  96. package/dist/features/homepage/schemas/firestore.js +2 -1
  97. package/dist/features/layout/AppLayoutShell.d.ts +6 -2
  98. package/dist/features/layout/AppLayoutShell.js +7 -3
  99. package/dist/features/pre-orders/components/MarketplacePreorderCard.d.ts +3 -1
  100. package/dist/features/pre-orders/components/MarketplacePreorderCard.js +6 -2
  101. package/dist/features/pre-orders/components/PreOrderDetailPageView.js +80 -12
  102. package/dist/features/pre-orders/components/PreOrderFilters.d.ts +8 -0
  103. package/dist/features/pre-orders/components/PreOrderFilters.js +21 -0
  104. package/dist/features/pre-orders/components/PreOrdersIndexListing.d.ts +2 -1
  105. package/dist/features/pre-orders/components/PreOrdersIndexListing.js +69 -10
  106. package/dist/features/pre-orders/components/PreOrdersListView.d.ts +6 -1
  107. package/dist/features/pre-orders/components/PreOrdersListView.js +26 -7
  108. package/dist/features/pre-orders/components/index.d.ts +2 -0
  109. package/dist/features/pre-orders/components/index.js +1 -0
  110. package/dist/features/products/components/AuctionsIndexListing.d.ts +2 -1
  111. package/dist/features/products/components/AuctionsIndexListing.js +61 -9
  112. package/dist/features/products/components/InteractiveProductCard.d.ts +2 -4
  113. package/dist/features/products/components/InteractiveProductCard.js +2 -2
  114. package/dist/features/products/components/ProductDetailPageView.d.ts +1 -1
  115. package/dist/features/products/components/ProductDetailPageView.js +116 -25
  116. package/dist/features/products/components/ProductFilters.d.ts +6 -11
  117. package/dist/features/products/components/ProductFilters.js +5 -3
  118. package/dist/features/products/components/ProductGrid.d.ts +8 -2
  119. package/dist/features/products/components/ProductGrid.js +20 -5
  120. package/dist/features/products/components/ProductTabsShell.d.ts +3 -11
  121. package/dist/features/products/components/ProductTabsShell.js +14 -14
  122. package/dist/features/products/components/ProductsIndexListing.js +73 -9
  123. package/dist/features/products/components/ProductsIndexPageView.d.ts +6 -1
  124. package/dist/features/products/components/ProductsIndexPageView.js +39 -6
  125. package/dist/features/products/components/RelatedProductsCarousel.d.ts +7 -0
  126. package/dist/features/products/components/RelatedProductsCarousel.js +11 -0
  127. package/dist/features/products/components/index.d.ts +1 -0
  128. package/dist/features/products/components/index.js +1 -0
  129. package/dist/features/products/hooks/useProducts.js +16 -0
  130. package/dist/features/products/repository/products.repository.d.ts +8 -0
  131. package/dist/features/products/repository/products.repository.js +2 -0
  132. package/dist/features/products/schemas/index.d.ts +8 -8
  133. package/dist/features/products/types/index.d.ts +12 -0
  134. package/dist/features/promotions/components/CouponsIndexListing.d.ts +9 -0
  135. package/dist/features/promotions/components/CouponsIndexListing.js +86 -0
  136. package/dist/features/promotions/components/PromotionsView.d.ts +11 -5
  137. package/dist/features/promotions/components/PromotionsView.js +6 -1
  138. package/dist/features/promotions/components/index.d.ts +4 -2
  139. package/dist/features/promotions/components/index.js +2 -1
  140. package/dist/features/reviews/components/ReviewDetailPageView.d.ts +4 -0
  141. package/dist/features/reviews/components/ReviewDetailPageView.js +20 -0
  142. package/dist/features/reviews/components/ReviewDetailShell.d.ts +7 -0
  143. package/dist/features/reviews/components/ReviewDetailShell.js +80 -0
  144. package/dist/features/reviews/components/ReviewFilters.d.ts +3 -3
  145. package/dist/features/reviews/components/ReviewFilters.js +5 -4
  146. package/dist/features/reviews/components/ReviewsIndexListing.d.ts +4 -3
  147. package/dist/features/reviews/components/ReviewsIndexListing.js +35 -51
  148. package/dist/features/reviews/components/ReviewsIndexPageView.d.ts +6 -1
  149. package/dist/features/reviews/components/ReviewsIndexPageView.js +49 -3
  150. package/dist/features/reviews/components/ReviewsList.js +9 -1
  151. package/dist/features/reviews/components/index.d.ts +1 -0
  152. package/dist/features/reviews/hooks/useReviews.js +15 -1
  153. package/dist/features/reviews/types/index.d.ts +6 -1
  154. package/dist/features/seller/components/SellerSidebar.d.ts +8 -4
  155. package/dist/features/seller/components/SellerSidebar.js +6 -4
  156. package/dist/features/seller/components/index.d.ts +30 -0
  157. package/dist/features/seller/components/index.js +17 -0
  158. package/dist/features/seller/hooks/useSellerStore.d.ts +2 -0
  159. package/dist/features/seller/hooks/useSellerStore.js +2 -0
  160. package/dist/features/seller/permission-map.d.ts +4 -2
  161. package/dist/features/seller/permission-map.js +16 -14
  162. package/dist/features/seller/schemas/index.d.ts +2 -2
  163. package/dist/features/stores/api/[storeSlug]/reviews/route.d.ts +1 -1
  164. package/dist/features/stores/api/[storeSlug]/reviews/route.js +24 -19
  165. package/dist/features/stores/components/InteractiveStoreCard.d.ts +0 -5
  166. package/dist/features/stores/components/InteractiveStoreCard.js +9 -9
  167. package/dist/features/stores/components/StoreAuctionsListing.js +27 -9
  168. package/dist/features/stores/components/StoreDetailLayoutView.js +2 -0
  169. package/dist/features/stores/components/StoreFilters.d.ts +5 -0
  170. package/dist/features/stores/components/StoreFilters.js +20 -0
  171. package/dist/features/stores/components/StoreHeader.js +2 -2
  172. package/dist/features/stores/components/StorePreOrdersListing.d.ts +5 -0
  173. package/dist/features/stores/components/StorePreOrdersListing.js +40 -0
  174. package/dist/features/stores/components/StorePreOrdersPageView.d.ts +4 -0
  175. package/dist/features/stores/components/StorePreOrdersPageView.js +21 -0
  176. package/dist/features/stores/components/StoreProductsListing.js +21 -11
  177. package/dist/features/stores/components/StoreReviewsListing.js +2 -7
  178. package/dist/features/stores/components/StoresIndexListing.js +42 -8
  179. package/dist/features/stores/components/StoresIndexPageView.d.ts +6 -1
  180. package/dist/features/stores/components/StoresIndexPageView.js +9 -2
  181. package/dist/features/stores/components/index.d.ts +3 -0
  182. package/dist/features/stores/components/index.js +1 -0
  183. package/dist/features/stores/hooks/useStores.d.ts +7 -1
  184. package/dist/features/stores/hooks/useStores.js +16 -3
  185. package/dist/features/stores/schemas/index.d.ts +2 -2
  186. package/dist/features/stores/types/index.d.ts +3 -0
  187. package/dist/features/wishlist/hooks/useGuestWishlist.d.ts +20 -0
  188. package/dist/features/wishlist/hooks/useGuestWishlist.js +49 -0
  189. package/dist/features/wishlist/hooks/useWishlistCount.d.ts +7 -0
  190. package/dist/features/wishlist/hooks/useWishlistCount.js +31 -0
  191. package/dist/features/wishlist/hooks/useWishlistWithGuest.d.ts +56 -0
  192. package/dist/features/wishlist/hooks/useWishlistWithGuest.js +57 -0
  193. package/dist/features/wishlist/index.d.ts +3 -0
  194. package/dist/features/wishlist/index.js +3 -0
  195. package/dist/features/wishlist/utils/guest-wishlist.d.ts +22 -0
  196. package/dist/features/wishlist/utils/guest-wishlist.js +70 -0
  197. package/dist/index.d.ts +50 -1
  198. package/dist/index.js +63 -1
  199. package/dist/next/routing/route-map.d.ts +70 -36
  200. package/dist/next/routing/route-map.js +30 -22
  201. package/dist/seed/addresses-seed-data.js +62 -261
  202. package/dist/seed/beyblade-seed-data.d.ts +7 -0
  203. package/dist/seed/beyblade-seed-data.js +947 -0
  204. package/dist/seed/bids-seed-data.d.ts +10 -2
  205. package/dist/seed/bids-seed-data.js +220 -1071
  206. package/dist/seed/blog-posts-seed-data.d.ts +2 -2
  207. package/dist/seed/blog-posts-seed-data.js +455 -117
  208. package/dist/seed/cart-seed-data.d.ts +9 -9
  209. package/dist/seed/cart-seed-data.js +73 -74
  210. package/dist/seed/coupons-seed-data.d.ts +3 -4
  211. package/dist/seed/coupons-seed-data.js +3 -509
  212. package/dist/seed/events-seed-data.d.ts +2 -2
  213. package/dist/seed/events-seed-data.js +315 -476
  214. package/dist/seed/faq-seed-data.d.ts +18 -41
  215. package/dist/seed/faq-seed-data.js +1059 -1172
  216. package/dist/seed/hot-wheels-seed-data.d.ts +7 -0
  217. package/dist/seed/hot-wheels-seed-data.js +1365 -0
  218. package/dist/seed/index.d.ts +6 -1
  219. package/dist/seed/index.js +6 -1
  220. package/dist/seed/pokemon-carousel-slides-seed-data.d.ts +4 -2
  221. package/dist/seed/pokemon-carousel-slides-seed-data.js +152 -268
  222. package/dist/seed/pokemon-categories-seed-data.d.ts +18 -21
  223. package/dist/seed/pokemon-categories-seed-data.js +424 -1004
  224. package/dist/seed/pokemon-coupons-seed-data.d.ts +6 -0
  225. package/dist/seed/pokemon-coupons-seed-data.js +465 -0
  226. package/dist/seed/pokemon-homepage-sections-seed-data.d.ts +3 -2
  227. package/dist/seed/pokemon-homepage-sections-seed-data.js +67 -289
  228. package/dist/seed/pokemon-products-seed-data.js +662 -0
  229. package/dist/seed/pokemon-seed-bundle.d.ts +32 -11
  230. package/dist/seed/pokemon-seed-bundle.js +41 -11
  231. package/dist/seed/pokemon-stores-seed-data.d.ts +2 -3
  232. package/dist/seed/pokemon-stores-seed-data.js +56 -31
  233. package/dist/seed/pokemon-users-seed-data.d.ts +2 -2
  234. package/dist/seed/pokemon-users-seed-data.js +245 -261
  235. package/dist/seed/reviews-seed-data.d.ts +17 -2
  236. package/dist/seed/reviews-seed-data.js +519 -483
  237. package/dist/seed/site-settings-seed-data.js +14 -14
  238. package/dist/seed/store-addresses-seed-data.js +68 -50
  239. package/dist/seed/transformers-seed-data.d.ts +7 -0
  240. package/dist/seed/transformers-seed-data.js +510 -0
  241. package/dist/seed/wishlists-seed-data.d.ts +5 -1
  242. package/dist/seed/wishlists-seed-data.js +82 -4
  243. package/dist/server.d.ts +1 -0
  244. package/dist/server.js +2 -0
  245. package/dist/tokens/index.d.ts +6 -0
  246. package/dist/tokens/index.js +2 -0
  247. package/dist/ui/components/BaseListingCard.js +24 -26
  248. package/dist/ui/components/BaseListingCard.style.css +5 -5
  249. package/dist/ui/components/HorizontalScroller.d.ts +1 -1
  250. package/dist/ui/components/HorizontalScroller.js +19 -5
  251. package/dist/ui/components/SideDrawer.style.css +3 -11
  252. package/dist/ui/rich-text/RichText.js +19 -1
  253. package/package.json +1 -1
@@ -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
- UI_LISTING_CARD.root,
20
- isSelected ? UI_LISTING_CARD.selected : "",
21
- isDisabled ? UI_LISTING_CARD.disabled : "",
22
- onClick ? UI_LISTING_CARD.clickable : "",
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(" "), "data-section": "baselistingcard-div-457", children: children }));
15
+ .join(" "), children: children }));
27
16
  }
28
17
  function BaseListingCardHero({ aspect, className = "", children, onMouseEnter, onMouseLeave, }) {
29
18
  const aspectClass = aspect === "square"
30
- ? UI_LISTING_CARD.heroSquare
19
+ ? "aspect-square"
31
20
  : aspect === "4/3" || !aspect
32
- ? UI_LISTING_CARD.heroLandscape
21
+ ? "aspect-[4/3]"
33
22
  : `aspect-[${aspect}]`;
34
- return (_jsx("div", { className: [UI_LISTING_CARD.hero, aspectClass, 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, "data-section": "baselistingcard-div-458", children: children }));
29
+ .join(" "), onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, children: children }));
37
30
  }
38
31
  function BaseListingCardInfo({ className = "", children, }) {
39
- return (_jsx("div", { className: [UI_LISTING_CARD.info, className].filter(Boolean).join(" "), "data-section": "baselistingcard-div-459", children: children }));
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
- UI_LISTING_CARD.checkbox,
47
- selected ? UI_LISTING_CARD.checkboxSelected : "",
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: UI_LISTING_CARD.checkboxIcon, children: "\u2713" }) }));
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
- height: 100%;
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
- min-width: clamp(150px, 18vw, 260px);
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
- min-height: clamp(120px, 14vh, 200px);
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: 50;
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: 50;
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
- /* Position */
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/object) ---------------
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mohasinac/appkit",
3
- "version": "2.3.1",
3
+ "version": "2.3.2",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"