{
  "$schema": "https://uipkge.dev/schema/registry-item.json",
  "name": "customer-reviews",
  "title": "Customer Reviews",
  "type": "registry:block",
  "description": "Dedicated customer reviews section with ratings breakdown, interactive distribution bars, photo gallery with thumbnail overlay, filter chips, sort options, detailed verified buyer cards with attached photos, reactive helpful counter, and review submission form.",
  "categories": [
    "commerce",
    "ecommerce",
    "marketing"
  ],
  "files": [
    {
      "path": "packages/elements-lit/src/blocks/customer-reviews/customer-reviews.ts",
      "content": "import { LitElement, css, html, nothing } from 'lit'\nimport { CheckCircle2, Image as ImageIcon, PenLine, Star, ThumbsUp, X } from 'lucide'\nimport { cn } from '../../lib/utils'\nimport { tailwind } from '../../lib/styles'\nimport { ThemeController } from '../../lib/theme'\nimport { icon } from '../../lib/icon'\n// Side-effect imports: register the composed elements for standalone use\n// (consumers who install only this block still get working primitives).\nimport '../../components/avatar/avatar'\nimport '../../components/badge/badge'\nimport '../../components/button/button'\nimport '../../components/card/card'\nimport '../../components/progress/progress'\nimport '../../components/rating/rating'\nimport '../../components/select/select'\nimport type { UipSelect } from '../../components/select/select'\nimport '../../components/input/input'\nimport type { UipInput } from '../../components/input/input'\nimport '../../components/textarea/textarea'\n\nexport interface ReviewItem {\n  id: string\n  author: string\n  initials: string\n  avatar?: string\n  rating: number\n  date: string\n  title: string\n  body: string\n  variant: string\n  verified: boolean\n  helpfulCount: number\n  isHelpful?: boolean\n  photos?: string[]\n}\n\ninterface RatingBar {\n  stars: number\n  percentage: number\n  count: number\n}\n\ninterface PhotoGalleryItem {\n  id: string\n  url: string\n  alt: string\n  author: string\n}\n\nconst ratingBreakdowns: RatingBar[] = [\n  { stars: 5, percentage: 78, count: 267 },\n  { stars: 4, percentage: 14, count: 48 },\n  { stars: 3, percentage: 5, count: 17 },\n  { stars: 2, percentage: 2, count: 7 },\n  { stars: 1, percentage: 1, count: 3 },\n]\n\nconst customerPhotos: PhotoGalleryItem[] = [\n  {\n    id: 'p1',\n    url: 'https://images.unsplash.com/photo-1546435770-a3e426bf472b?w=400&auto=format&fit=crop&q=80',\n    alt: 'Customer photo of matte navy headphones on wood desk',\n    author: 'Marcus V.',\n  },\n  {\n    id: 'p2',\n    url: 'https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=400&auto=format&fit=crop&q=80',\n    alt: 'Customer photo of headphones studio unboxing',\n    author: 'Elena R.',\n  },\n  {\n    id: 'p3',\n    url: 'https://images.unsplash.com/photo-1484704849700-f032a568e944?w=400&auto=format&fit=crop&q=80',\n    alt: 'Customer photo of cushioned earpads close up',\n    author: 'Devon C.',\n  },\n  {\n    id: 'p4',\n    url: 'https://images.unsplash.com/photo-1583394838336-acd977736f90?w=400&auto=format&fit=crop&q=80',\n    alt: 'Customer photo wearing headphones in coffee shop',\n    author: 'Amara D.',\n  },\n  {\n    id: 'p5',\n    url: 'https://images.unsplash.com/photo-1590658268037-6bf12165a8df?w=400&auto=format&fit=crop&q=80',\n    alt: 'Customer photo of travel case and cable accessories',\n    author: 'Liam G.',\n  },\n  {\n    id: 'p6',\n    url: 'https://images.unsplash.com/photo-1545127398-14699f92334b?w=400&auto=format&fit=crop&q=80',\n    alt: 'Customer photo wearing silver headphones while working',\n    author: 'Sophia M.',\n  },\n]\n\nconst initialReviews: ReviewItem[] = [\n  {\n    id: 'rev-1',\n    author: 'Marcus Vance',\n    initials: 'MV',\n    avatar: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=160&auto=format&fit=crop&q=80',\n    rating: 5,\n    date: '2 days ago',\n    title: 'Exceeded all my expectations — best studio acoustic fidelity',\n    body: 'The soundstage is remarkably wide and bass response is tight without overpowering the mids. Build quality is aerospace-grade, and the memory foam ear cushions remain comfortable even through 8-hour mixing sessions. Multi-device Bluetooth pairing switches directly between MacBook and phone.',\n    variant: 'Color: Matte Navy · Size: L',\n    verified: true,\n    helpfulCount: 24,\n    isHelpful: false,\n    photos: [\n      'https://images.unsplash.com/photo-1546435770-a3e426bf472b?w=400&auto=format&fit=crop&q=80',\n      'https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=400&auto=format&fit=crop&q=80',\n    ],\n  },\n  {\n    id: 'rev-2',\n    author: 'Elena Rostova',\n    initials: 'ER',\n    avatar: 'https://images.unsplash.com/photo-1517841905240-472988babdf9?w=160&auto=format&fit=crop&q=80',\n    rating: 5,\n    date: '1 week ago',\n    title: 'ANC handles subway roar with zero pressure sensation',\n    body: 'Active noise cancellation on these is sublime. Unlike other flagships that create an uncomfortable eardrum suction pressure, this feels completely natural. Battery life easily stretches across 4 days of heavy commuting without a recharge.',\n    variant: 'Color: Silver Frost · Size: M',\n    verified: true,\n    helpfulCount: 19,\n    isHelpful: false,\n    photos: ['https://images.unsplash.com/photo-1583394838336-acd977736f90?w=400&auto=format&fit=crop&q=80'],\n  },\n  {\n    id: 'rev-3',\n    author: 'Devon Chen',\n    initials: 'DC',\n    avatar: 'https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=160&auto=format&fit=crop&q=80',\n    rating: 4,\n    date: '2 weeks ago',\n    title: 'Fantastic sound and ergonomics, case could be slightly slimmer',\n    body: 'Everything about audio reproduction is 10/10. The companion app EQ presets are actually tuned well instead of gimmicky. Only minor critique is the hard-shell travel case is a bit bulky for slim laptop bags, but the protection is undisputed.',\n    variant: 'Color: Matte Navy · Size: L',\n    verified: true,\n    helpfulCount: 12,\n    isHelpful: false,\n    photos: ['https://images.unsplash.com/photo-1484704849700-f032a568e944?w=400&auto=format&fit=crop&q=80'],\n  },\n  {\n    id: 'rev-4',\n    author: 'Amara Diallo',\n    initials: 'AD',\n    avatar: 'https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=160&auto=format&fit=crop&q=80',\n    rating: 5,\n    date: '3 weeks ago',\n    title: 'Crystal-clear microphone quality for all-day client calls',\n    body: 'I purchased these primarily for conference calls in a busy open-plan studio. The beamforming microphones filter out nearby background conversations so callers only hear my voice. Lightweight headband design does not induce fatigue.',\n    variant: 'Color: Space Black · Size: L',\n    verified: true,\n    helpfulCount: 8,\n    isHelpful: false,\n  },\n]\n\nconst extraReviews: ReviewItem[] = [\n  {\n    id: 'rev-5',\n    author: 'Liam Gallagher',\n    initials: 'LG',\n    avatar: 'https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=160&auto=format&fit=crop&q=80',\n    rating: 5,\n    date: '1 month ago',\n    title: 'Premium finish that justifies every single penny',\n    body: 'The anodized aluminum arms and tactile physical dials feel so much better than finicky touch controls in cold weather. Fast USB-C charging gave me 6 hours of playback from a 15-minute coffee break charge.',\n    variant: 'Color: Space Black · Size: L',\n    verified: true,\n    helpfulCount: 15,\n    isHelpful: false,\n    photos: ['https://images.unsplash.com/photo-1590658268037-6bf12165a8df?w=400&auto=format&fit=crop&q=80'],\n  },\n  {\n    id: 'rev-6',\n    author: 'Sophia Martinez',\n    initials: 'SM',\n    avatar: 'https://images.unsplash.com/photo-1544005313-94ddf0286df2?w=160&auto=format&fit=crop&q=80',\n    rating: 4,\n    date: '1 month ago',\n    title: 'Great balanced frequency response for classical and jazz',\n    body: 'Instruments have pinpoint positional separation in spatial mode. The high frequencies are crisp without ever becoming sibilant or harsh at high volume.',\n    variant: 'Color: Silver Frost · Size: M',\n    verified: false,\n    helpfulCount: 6,\n    isHelpful: false,\n  },\n]\n\ntype SortBy = 'recent' | 'highest' | 'lowest' | 'helpful'\n\n/**\n * <uip-customer-reviews> — the registry CustomerReviews block as a web component.\n *\n * Class strings and sample data are React's verbatim. React state becomes\n * { state: true } fields. The block takes no props and fires no events; all\n * interaction (rating filter, photo filter, verified filter, sort select,\n * helpful votes, load-more, review composer, photo lightbox) is internal.\n * The sort dropdown uses <uip-select> with native <option> children.\n */\nexport class UipCustomerReviews extends LitElement {\n  static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true }\n  // :host display can't be a utility class (the host has no template of its own).\n  static styles = [tailwind, css`:host { display: block; }`]\n\n  static properties = {\n    reviews: { state: true },\n    selectedRating: { state: true },\n    withPhotosOnly: { state: true },\n    verifiedOnly: { state: true },\n    sortBy: { state: true },\n    isWritingReview: { state: true },\n    hasLoadedMore: { state: true },\n    activePhotoUrl: { state: true },\n    newRating: { state: true },\n    newAuthor: { state: true },\n    newVariant: { state: true },\n    newTitle: { state: true },\n    newBody: { state: true },\n  }\n\n  private reviews: ReviewItem[] = initialReviews.map((r) => ({ ...r }))\n  private selectedRating: number | null = null\n  private withPhotosOnly = false\n  private verifiedOnly = false\n  private sortBy: SortBy = 'recent'\n  private isWritingReview = false\n  private hasLoadedMore = false\n  private activePhotoUrl: string | null = null\n  private newRating = 5\n  private newAuthor = ''\n  private newVariant = 'Color: Matte Navy · Size: L'\n  private newTitle = ''\n  private newBody = ''\n\n  constructor() {\n    super()\n    new ThemeController(this)\n  }\n\n  connectedCallback() {\n    super.connectedCallback()\n    this.setAttribute('data-uipkge', '')\n    this.setAttribute('data-slot', 'customer-reviews')\n  }\n\n  private toggleRatingFilter(stars: number) {\n    this.selectedRating = this.selectedRating === stars ? null : stars\n  }\n\n  private resetFilters() {\n    this.selectedRating = null\n    this.withPhotosOnly = false\n    this.verifiedOnly = false\n  }\n\n  private toggleHelpful(reviewId: string) {\n    this.reviews = this.reviews.map((rev) => {\n      if (rev.id !== reviewId) return rev\n      const nextIsHelpful = !rev.isHelpful\n      return {\n        ...rev,\n        isHelpful: nextIsHelpful,\n        helpfulCount: nextIsHelpful ? rev.helpfulCount + 1 : rev.helpfulCount - 1,\n      }\n    })\n  }\n\n  private loadMore() {\n    this.reviews = [...this.reviews, ...extraReviews.map((r) => ({ ...r }))]\n    this.hasLoadedMore = true\n  }\n\n  private submitReview() {\n    if (!this.newTitle.trim() || !this.newBody.trim() || this.newRating === 0) return\n    const authorName = this.newAuthor.trim() || 'Anonymous User'\n    const initials = authorName\n      .split(' ')\n      .map((n) => n[0])\n      .join('')\n      .toUpperCase()\n      .slice(0, 2)\n    const created: ReviewItem = {\n      id: `rev-${Date.now()}`,\n      author: authorName,\n      initials,\n      rating: this.newRating,\n      date: 'Just now',\n      title: this.newTitle.trim(),\n      body: this.newBody.trim(),\n      variant: this.newVariant.trim() || 'Color: Matte Navy · Size: L',\n      verified: true,\n      helpfulCount: 0,\n      isHelpful: false,\n    }\n    this.reviews = [created, ...this.reviews]\n    this.newTitle = ''\n    this.newBody = ''\n    this.newAuthor = ''\n    this.newRating = 5\n    this.isWritingReview = false\n  }\n\n  private get filteredReviews(): ReviewItem[] {\n    const result = [...this.reviews]\n    const filtered = result.filter((r) => {\n      if (this.selectedRating !== null && r.rating !== this.selectedRating) return false\n      if (this.withPhotosOnly && !(r.photos && r.photos.length > 0)) return false\n      if (this.verifiedOnly && !r.verified) return false\n      return true\n    })\n    if (this.sortBy === 'highest') filtered.sort((a, b) => b.rating - a.rating)\n    else if (this.sortBy === 'lowest') filtered.sort((a, b) => a.rating - b.rating)\n    else if (this.sortBy === 'helpful') filtered.sort((a, b) => b.helpfulCount - a.helpfulCount)\n    return filtered\n  }\n\n  render() {\n    const filteredReviews = this.filteredReviews\n    return html`\n      <section data-slot=\"customer-reviews\" class=\"w-full space-y-8\">\n        <div class=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n          <div>\n            <h2 class=\"text-foreground text-2xl font-bold tracking-tight sm:text-3xl\">Customer Reviews</h2>\n            <p class=\"text-muted-foreground mt-1 text-sm\">Real feedback from verified purchasers</p>\n          </div>\n          <uip-button\n            aria-label=\"Close review form\"\n            type=\"button\"\n            class=\"h-9 gap-2 text-xs font-medium sm:text-sm\"\n            @click=${() => {\n              this.isWritingReview = !this.isWritingReview\n            }}\n          >\n            ${icon(PenLine, 'pen-line', 'size-4')} Write a Review\n          </uip-button>\n        </div>\n\n        <uip-card class=\"border-border bg-card p-6 shadow-xs\">\n          <div class=\"grid grid-cols-1 gap-6 md:grid-cols-12 md:items-center lg:gap-8\">\n            <div class=\"border-border flex flex-col items-center justify-center space-y-2 border-b pb-6 text-center md:col-span-4 md:items-start md:border-r md:border-b-0 md:pr-6 md:pb-0 md:text-left lg:col-span-3\">\n              <div class=\"flex items-baseline gap-2\">\n                <span class=\"text-foreground text-4xl font-bold tracking-tight\">4.8</span>\n                <span class=\"text-muted-foreground text-sm font-medium\">out of 5</span>\n              </div>\n              <uip-rating value=\"4.8\" readonly half-increments size=\"medium\"></uip-rating>\n              <p class=\"text-muted-foreground text-xs\">Based on 342 reviews</p>\n              <uip-badge variant=\"secondary\" class=\"border-success/20 bg-success/10 text-success mt-1 gap-1.5 font-medium\">\n                ${icon(CheckCircle2, 'circle-check', 'size-3.5')} 96% recommend\n              </uip-badge>\n            </div>\n\n            <div class=\"border-border space-y-2 border-b pb-6 md:col-span-5 md:border-r md:border-b-0 md:pr-6 md:pb-0 lg:col-span-5\">\n              ${ratingBreakdowns.map(\n                (bar) => html`<button\n                  type=\"button\"\n                  class=${cn(\n                    'group hover:bg-muted/60 focus-visible:ring-ring flex w-full items-center gap-3 rounded-md px-2 py-1 text-left text-xs transition-colors focus-visible:ring-2 focus-visible:outline-none',\n                    this.selectedRating === bar.stars && 'bg-muted ring-primary/30 font-semibold ring-1',\n                  )}\n                  @click=${() => this.toggleRatingFilter(bar.stars)}\n                >\n                  <span class=\"text-foreground flex w-12 items-center gap-1 font-medium\">\n                    ${bar.stars} ${icon(Star, 'star', 'fill-warning text-warning size-3')}\n                  </span>\n                  <uip-progress value=${bar.percentage} class=\"h-2 flex-1\"></uip-progress>\n                  <span class=\"text-muted-foreground group-hover:text-foreground w-10 text-right font-mono\">${bar.percentage}%</span>\n                </button>`,\n              )}\n            </div>\n\n            <div class=\"space-y-3 md:col-span-3 lg:col-span-4\">\n              <div class=\"flex items-center justify-between\">\n                <h4 class=\"text-foreground text-sm font-semibold\">Customer Photos (48)</h4>\n                <span class=\"text-muted-foreground text-xs\">Recent</span>\n              </div>\n              <div class=\"grid grid-cols-3 gap-2\">\n                ${customerPhotos.map(\n                  (photo, index) => html`<button\n                    type=\"button\"\n                    class=\"group border-border bg-muted focus-visible:ring-ring relative aspect-square cursor-pointer overflow-hidden rounded-lg border focus-visible:ring-2 focus-visible:outline-none\"\n                    aria-label=${photo.alt}\n                    @click=${() => {\n                      this.activePhotoUrl = photo.url\n                    }}\n                  >\n                    <img\n                      src=${photo.url}\n                      alt=${photo.alt}\n                      class=\"size-full object-cover transition-transform duration-300 group-hover:scale-105\"\n                    />\n                    ${index === 5\n                      ? html`<div\n                          class=\"absolute inset-0 flex items-center justify-center bg-black/60 text-xs font-semibold text-white transition-colors group-hover:bg-black/70\"\n                        >\n                          +43 more\n                        </div>`\n                      : nothing}\n                  </button>`,\n                )}\n              </div>\n            </div>\n          </div>\n        </uip-card>\n\n        ${this.isWritingReview\n          ? html`<uip-card class=\"border-primary/30 bg-card p-6 shadow-sm\">\n              <div class=\"space-y-4\">\n                <div class=\"flex items-center justify-between\">\n                  <h3 class=\"text-foreground text-base font-semibold\">Write Your Review</h3>\n                  <uip-button\n                    aria-label=\"Close review form\"\n                    type=\"button\"\n                    variant=\"ghost\"\n                    size=\"icon\"\n                    class=\"text-muted-foreground hover:text-foreground size-8\"\n                    @click=${() => {\n                      this.isWritingReview = false\n                    }}\n                  >\n                    ${icon(X, 'x', 'size-4')}\n                  </uip-button>\n                </div>\n                <div class=\"space-y-3\">\n                  <div>\n                    <label class=\"text-foreground mb-1.5 block text-xs font-medium\">Overall Rating</label>\n                    <uip-rating\n                      value=${this.newRating}\n                      size=\"medium\"\n                      hover\n                      @value-change=${(e: CustomEvent<{ value: number }>) => {\n                        this.newRating = e.detail.value\n                      }}\n                    ></uip-rating>\n                  </div>\n                  <div class=\"grid gap-3 sm:grid-cols-2\">\n                    <div>\n                      <label class=\"text-foreground mb-1.5 block text-xs font-medium\">Your Name</label>\n                      <uip-input\n                        .value=${this.newAuthor}\n                        type=\"text\"\n                        placeholder=\"e.g. Alex Morgan\"\n                        class=\"text-xs\"\n                        @input=${(e: Event) => {\n                          this.newAuthor = (e.target as UipInput).value ?? ''\n                        }}\n                      ></uip-input>\n                    </div>\n                    <div>\n                      <label class=\"text-foreground mb-1.5 block text-xs font-medium\">Purchased Option</label>\n                      <uip-input\n                        .value=${this.newVariant}\n                        type=\"text\"\n                        placeholder=\"e.g. Color: Space Black · Size: L\"\n                        class=\"text-xs\"\n                        @input=${(e: Event) => {\n                          this.newVariant = (e.target as UipInput).value ?? ''\n                        }}\n                      ></uip-input>\n                    </div>\n                  </div>\n                  <div>\n                    <label class=\"text-foreground mb-1.5 block text-xs font-medium\">Review Headline</label>\n                    <uip-input\n                      .value=${this.newTitle}\n                      type=\"text\"\n                      placeholder=\"Summarize your experience in one sentence\"\n                      class=\"text-xs\"\n                      @input=${(e: Event) => {\n                        this.newTitle = (e.target as UipInput).value ?? ''\n                      }}\n                    ></uip-input>\n                  </div>\n                  <div>\n                    <label class=\"text-foreground mb-1.5 block text-xs font-medium\">Detailed Feedback</label>\n                    <uip-textarea\n                      .value=${this.newBody}\n                      rows=\"3\"\n                      placeholder=\"What did you like or dislike? How does it perform?\"\n                      class=\"text-xs\"\n                      @value-change=${(e: CustomEvent<{ value: string }>) => {\n                        this.newBody = e.detail.value\n                      }}\n                    ></uip-textarea>\n                  </div>\n                  <div class=\"flex items-center justify-end gap-2 pt-2\">\n                    <uip-button\n                      aria-label=\"Close review form\"\n                      type=\"button\"\n                      variant=\"outline\"\n                      size=\"sm\"\n                      class=\"h-8 text-xs\"\n                      @click=${() => {\n                        this.isWritingReview = false\n                      }}\n                    >\n                      Cancel\n                    </uip-button>\n                    <uip-button\n                      type=\"button\"\n                      size=\"sm\"\n                      class=\"h-8 text-xs\"\n                      ?disabled=${!this.newTitle.trim() || !this.newBody.trim() || this.newRating === 0}\n                      @click=${() => this.submitReview()}\n                    >\n                      Submit Review\n                    </uip-button>\n                  </div>\n                </div>\n              </div>\n            </uip-card>`\n          : nothing}\n\n        <div class=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n          <div class=\"flex flex-wrap items-center gap-2\">\n            <uip-button\n              type=\"button\"\n              size=\"sm\"\n              variant=${this.selectedRating === null && !this.withPhotosOnly && !this.verifiedOnly ? 'default' : 'outline'}\n              class=\"h-8 rounded-full text-xs\"\n              @click=${() => this.resetFilters()}\n            >\n              All Ratings\n            </uip-button>\n            <uip-button\n              type=\"button\"\n              size=\"sm\"\n              variant=${this.selectedRating === 5 ? 'default' : 'outline'}\n              class=\"h-8 gap-1 rounded-full text-xs\"\n              @click=${() => this.toggleRatingFilter(5)}\n            >\n              ${icon(Star, 'star', cn('size-3', this.selectedRating === 5 ? 'fill-current' : 'fill-warning text-warning'))}5\n              Stars\n            </uip-button>\n            <uip-button\n              type=\"button\"\n              size=\"sm\"\n              variant=${this.withPhotosOnly ? 'default' : 'outline'}\n              class=\"h-8 gap-1.5 rounded-full text-xs\"\n              @click=${() => {\n                this.withPhotosOnly = !this.withPhotosOnly\n              }}\n            >\n              ${icon(ImageIcon, 'image', 'size-3.5')} With Photos\n            </uip-button>\n            <uip-button\n              type=\"button\"\n              size=\"sm\"\n              variant=${this.verifiedOnly ? 'default' : 'outline'}\n              class=\"h-8 gap-1.5 rounded-full text-xs\"\n              @click=${() => {\n                this.verifiedOnly = !this.verifiedOnly\n              }}\n            >\n              ${icon(CheckCircle2, 'circle-check', 'size-3.5')} Verified Only\n            </uip-button>\n          </div>\n          <div class=\"flex items-center gap-2\">\n            <span class=\"text-muted-foreground text-xs font-medium\">Sort by:</span>\n            <uip-select\n              class=\"w-36 text-xs sm:w-40\"\n              size=\"sm\"\n              .value=${this.sortBy}\n              @change=${(e: Event) => {\n                this.sortBy = (e.target as UipSelect).value as SortBy\n              }}\n            >\n              <option value=\"recent\">Most Recent</option>\n              <option value=\"highest\">Highest Rated</option>\n              <option value=\"lowest\">Lowest Rated</option>\n              <option value=\"helpful\">Most Helpful</option>\n            </uip-select>\n          </div>\n        </div>\n\n        <div class=\"space-y-4\">\n          ${filteredReviews.length === 0\n            ? html`<div class=\"border-border bg-card rounded-xl border p-12 text-center\">\n                <p class=\"text-foreground text-sm font-medium\">No reviews match the selected filters</p>\n                <p class=\"text-muted-foreground mt-1 text-xs\">Try clearing your filters to view all customer feedback</p>\n                <uip-button type=\"button\" variant=\"outline\" size=\"sm\" class=\"mt-4 h-8 text-xs\" @click=${() => this.resetFilters()}>\n                  Reset Filters\n                </uip-button>\n              </div>`\n            : filteredReviews.map(\n                (rev) => html`<uip-card class=\"border-border bg-card p-5 shadow-xs\">\n                  <div class=\"space-y-4\">\n                    <div class=\"flex flex-wrap items-start justify-between gap-3\">\n                      <div class=\"flex items-center gap-3\">\n                        <uip-avatar class=\"border-border size-10 border\">\n                          ${rev.avatar\n                            ? html`<uip-avatar-image src=${rev.avatar} alt=${rev.author}></uip-avatar-image>`\n                            : nothing}\n                          <uip-avatar-fallback class=\"text-xs font-medium\">${rev.initials}</uip-avatar-fallback>\n                        </uip-avatar>\n                        <div class=\"space-y-0.5\">\n                          <div class=\"flex items-center gap-2\">\n                            <span class=\"text-foreground text-sm font-semibold\">${rev.author}</span>\n                            ${rev.verified\n                              ? html`<uip-badge variant=\"secondary\" class=\"text-muted-foreground h-5 gap-1 px-1.5 text-xs font-normal\">\n                                  ${icon(CheckCircle2, 'circle-check', 'text-success size-3')} Verified Buyer\n                                </uip-badge>`\n                              : nothing}\n                          </div>\n                          <time class=\"text-muted-foreground text-xs\">${rev.date}</time>\n                        </div>\n                      </div>\n                      <uip-rating value=${rev.rating} readonly size=\"small\"></uip-rating>\n                    </div>\n                    <div class=\"space-y-2\">\n                      <h5 class=\"text-foreground text-sm font-semibold sm:text-base\">${rev.title}</h5>\n                      <p class=\"text-muted-foreground text-xs leading-relaxed sm:text-sm\">${rev.body}</p>\n                    </div>\n                    ${rev.variant\n                      ? html`<div class=\"bg-muted/60 text-muted-foreground inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium\">\n                          <span>${rev.variant}</span>\n                        </div>`\n                      : nothing}\n                    ${rev.photos && rev.photos.length > 0\n                      ? html`<div class=\"flex flex-wrap gap-2 pt-1\">\n                          ${rev.photos.map(\n                            (photoUrl, pIdx) => html`<button\n                              type=\"button\"\n                              class=\"group border-border bg-muted focus-visible:ring-ring relative size-16 cursor-pointer overflow-hidden rounded-lg border focus-visible:ring-2 focus-visible:outline-none sm:size-20\"\n                              aria-label=${`Review photo ${pIdx + 1} by ${rev.author}`}\n                              @click=${() => {\n                                this.activePhotoUrl = photoUrl\n                              }}\n                            >\n                              <img\n                                src=${photoUrl}\n                                alt=${`Review photo ${pIdx + 1} by ${rev.author}`}\n                                class=\"size-full object-cover transition-transform duration-300 group-hover:scale-105\"\n                              />\n                            </button>`,\n                          )}\n                        </div>`\n                      : nothing}\n                    <div class=\"border-border flex items-center justify-between border-t pt-3\">\n                      <p class=\"text-muted-foreground text-xs\">Was this review helpful?</p>\n                      <uip-button\n                        type=\"button\"\n                        variant=\"outline\"\n                        size=\"sm\"\n                        class=${cn('h-8 gap-1.5 text-xs', rev.isHelpful && 'border-primary/40 bg-primary/10 text-primary font-medium')}\n                        @click=${() => this.toggleHelpful(rev.id)}\n                      >\n                        ${icon(ThumbsUp, 'thumbs-up', cn('size-3.5', rev.isHelpful && 'fill-primary'))} Helpful\n                        (${rev.helpfulCount})\n                      </uip-button>\n                    </div>\n                  </div>\n                </uip-card>`,\n              )}\n        </div>\n\n        <div class=\"border-border flex flex-col items-center justify-between gap-4 border-t pt-6 sm:flex-row\">\n          <p class=\"text-muted-foreground text-xs\">Showing 1-${filteredReviews.length} of 342 reviews</p>\n          ${!this.hasLoadedMore\n            ? html`<uip-button type=\"button\" variant=\"outline\" size=\"sm\" class=\"h-9 px-4 text-xs font-medium\" @click=${() => this.loadMore()}>\n                Load More Reviews\n              </uip-button>`\n            : nothing}\n        </div>\n\n        ${this.activePhotoUrl\n          ? html`<div\n              class=\"fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-4 backdrop-blur-xs\"\n              @click=${() => {\n                this.activePhotoUrl = null\n              }}\n            >\n              <div\n                class=\"border-border bg-card relative max-h-[85vh] max-w-2xl overflow-hidden rounded-xl border p-3 shadow-sm\"\n                @click=${(e: Event) => e.stopPropagation()}\n              >\n                <img\n                  src=${this.activePhotoUrl}\n                  alt=\"Customer review photo preview\"\n                  class=\"max-h-[75vh] w-auto rounded-lg object-contain\"\n                />\n                <div class=\"flex items-center justify-between p-2 pt-3\">\n                  <span class=\"text-muted-foreground text-xs\">Customer Review Photo</span>\n                  <uip-button\n                    type=\"button\"\n                    variant=\"ghost\"\n                    size=\"sm\"\n                    class=\"h-7 text-xs\"\n                    @click=${() => {\n                      this.activePhotoUrl = null\n                    }}\n                  >\n                    Close\n                  </uip-button>\n                </div>\n              </div>\n            </div>`\n          : nothing}\n      </section>\n    `\n  }\n}\n\ncustomElements.get('uip-customer-reviews') || customElements.define('uip-customer-reviews', UipCustomerReviews)\n\ndeclare global {\n  interface HTMLElementTagNameMap {\n    'uip-customer-reviews': UipCustomerReviews\n  }\n}\n",
      "type": "registry:file",
      "target": "src/uip/blocks/customer-reviews/customer-reviews.ts"
    }
  ],
  "dependencies": [
    "lit",
    "lucide"
  ],
  "registryDependencies": [
    "https://uipkge.dev/r/lit/avatar.json",
    "https://uipkge.dev/r/lit/badge.json",
    "https://uipkge.dev/r/lit/button.json",
    "https://uipkge.dev/r/lit/card.json",
    "https://uipkge.dev/r/lit/input.json",
    "https://uipkge.dev/r/lit/lit-core.json",
    "https://uipkge.dev/r/lit/progress.json",
    "https://uipkge.dev/r/lit/rating.json",
    "https://uipkge.dev/r/lit/select.json",
    "https://uipkge.dev/r/lit/textarea.json"
  ]
}
