@pradip1995/segment-animation-shop-grid 0.1.4 → 0.1.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pradip1995/segment-animation-shop-grid",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -1,6 +1,6 @@
1
1
  .animation-shop-grid {
2
2
  width: 100%;
3
- padding: 0 1.5rem 4rem 1.5rem;
3
+ padding: 0 0 3rem 0;
4
4
  background-color: var(--page-bg, #ffffff);
5
5
  color: var(--text-color, #111111);
6
6
  font-family: inherit;
@@ -9,7 +9,7 @@
9
9
 
10
10
  @media (min-width: 1024px) {
11
11
  .animation-shop-grid {
12
- padding: 0 3rem 6rem 3rem;
12
+ padding: 0 0 6rem 0;
13
13
  }
14
14
  }
15
15
 
@@ -382,6 +382,15 @@ export default function AnimationShopGrid(props: {
382
382
  useEffect(() => {
383
383
  const sidebar = document.querySelector(".store-page__sidebar") as HTMLElement | null
384
384
  const mainCol = document.querySelector(".store-page__main") as HTMLElement | null
385
+ const isDesktop = typeof window !== "undefined" && window.matchMedia("(min-width: 1024px)").matches
386
+
387
+ if (!isDesktop) {
388
+ // Mobile uses segment-mobile-filters — never force sidebar display
389
+ if (sidebar) sidebar.style.display = ""
390
+ if (mainCol) mainCol.classList.remove("w-full", "col-span-full")
391
+ return
392
+ }
393
+
385
394
  if (sidebar) {
386
395
  sidebar.style.display = showFilters ? "" : "none"
387
396
  }
@@ -394,6 +403,10 @@ export default function AnimationShopGrid(props: {
394
403
  }
395
404
  }, [showFilters])
396
405
 
406
+ function handleFilterToggle() {
407
+ setShowFilters((v) => !v)
408
+ }
409
+
397
410
  return (
398
411
  <section className="animation-shop-grid flex-1 min-w-0 pt-0" aria-label="Product results">
399
412
  {/* Simplified, Clean Hero Header */}
@@ -420,13 +433,13 @@ export default function AnimationShopGrid(props: {
420
433
  </p>
421
434
  </motion.header>
422
435
 
423
- {/* Filter Toolbar with Hide Filters Option */}
424
- <div className="w-full flex flex-wrap items-center justify-between gap-3 mb-5 py-2.5 px-4 bg-white border border-gray-200/80 rounded-md shadow-2xs">
425
- <div className="flex items-center gap-3">
436
+ {/* Filter Toolbar */}
437
+ <div className="animation-shop-grid__toolbar w-full flex flex-wrap items-center justify-between gap-2 sm:gap-3 mb-4 sm:mb-5 py-2 sm:py-2.5 px-2.5 sm:px-4 bg-white border border-gray-200/80 rounded-md shadow-2xs">
438
+ <div className="flex items-center gap-2 sm:gap-3 min-w-0">
426
439
  <button
427
440
  type="button"
428
- onClick={() => setShowFilters(!showFilters)}
429
- className="inline-flex items-center gap-2 text-xs font-semibold uppercase tracking-wider text-gray-800 hover:text-black transition-colors py-1 px-2.5 bg-gray-50 hover:bg-gray-100 border border-gray-200 rounded cursor-pointer"
441
+ onClick={handleFilterToggle}
442
+ className="hidden lg:inline-flex items-center gap-2 text-xs font-semibold uppercase tracking-wider text-gray-800 hover:text-black transition-colors py-1.5 px-2.5 bg-gray-50 hover:bg-gray-100 border border-gray-200 rounded cursor-pointer"
430
443
  >
431
444
  <svg className="w-3.5 h-3.5 fill-none stroke-current stroke-[1.8]" viewBox="0 0 24 24">
432
445
  <path strokeLinecap="round" strokeLinejoin="round" d="M10.5 6h9m-9 12h9m-15-6h15M3 6h3m-3 12h3m3-6h3" />
@@ -435,7 +448,7 @@ export default function AnimationShopGrid(props: {
435
448
  </button>
436
449
 
437
450
  {appliedFilters.length > 0 ? (
438
- <div className="hidden sm:flex items-center gap-2">
451
+ <div className="hidden sm:flex items-center gap-2 flex-wrap">
439
452
  <span className="text-[11px] font-bold text-gray-400 uppercase tracking-wider">Active:</span>
440
453
  {appliedFilters.map((filter) => (
441
454
  <LocalizedLink
@@ -452,17 +465,17 @@ export default function AnimationShopGrid(props: {
452
465
  ) : null}
453
466
  </div>
454
467
 
455
- <div className="flex items-center gap-3 ml-auto">
456
- <span className="text-xs text-gray-500 font-medium tracking-wide">
457
- {showingCount} of {totalCount} {totalCount === 1 ? "Product" : "Products"}
468
+ <div className="flex items-center gap-2 sm:gap-3 ml-auto shrink-0">
469
+ <span className="text-[11px] sm:text-xs text-gray-500 font-medium tracking-wide">
470
+ {showingCount} of {totalCount}
458
471
  </span>
459
472
  {appliedFilters.length > 0 ? (
460
473
  <LocalizedLink
461
474
  href={buildClearAllFiltersHref(storeSearchParams)}
462
- className="text-xs font-bold text-red-600 hover:text-red-700 uppercase tracking-wider underline ml-2"
475
+ className="text-[11px] sm:text-xs font-bold text-red-600 hover:text-red-700 uppercase tracking-wider underline"
463
476
  countryCode={countryCode}
464
477
  >
465
- Clear All
478
+ Clear
466
479
  </LocalizedLink>
467
480
  ) : null}
468
481
  </div>