@alfadocs/ui-kit-debug 1.105.0 → 1.107.0

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.
@@ -1,19 +1,19 @@
1
- import { jsx as t, jsxs as n, Fragment as K } from "react/jsx-runtime";
2
- import { forwardRef as J, useState as H, useCallback as L, useMemo as C, useRef as F, useImperativeHandle as Q, useId as B, useEffect as W } from "react";
3
- import { c as _ } from "./index-D2ZczOXr.js";
4
- import { useTranslation as E } from "react-i18next";
5
- import { u as X } from "./registry-DvAUVLHh.js";
6
- import { R as k } from "./rating-CGYpg5dj.js";
1
+ import { jsx as t, jsxs as r, Fragment as _ } from "react/jsx-runtime";
2
+ import { forwardRef as Q, useState as E, useCallback as B, useMemo as C, useRef as F, useImperativeHandle as W, useId as H, useEffect as X } from "react";
3
+ import { c as $ } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as M } from "react-i18next";
5
+ import { u as Y } from "./registry-DvAUVLHh.js";
6
+ import { R as P } from "./rating-CGYpg5dj.js";
7
7
  import { C as A } from "./card-C85_Ndhb.js";
8
- import { C as Y, b as Z, a as ee } from "./collapsible-DVPM46bq.js";
9
- import { D as l } from "./description-list-BxzDN9o2.js";
10
- import { E as te } from "./empty-state-DwJ5YNzz.js";
8
+ import { C as Z, b as ee, a as te } from "./collapsible-DVPM46bq.js";
9
+ import { D as o } from "./description-list-BxzDN9o2.js";
10
+ import { E as se } from "./empty-state-DwJ5YNzz.js";
11
11
  import { S as T } from "./skeleton-tTWJpvAq.js";
12
- import { B as se } from "./button-DohK_Ak_.js";
12
+ import { B as ae } from "./button-DohK_Ak_.js";
13
13
  import { P as re } from "./panel-header-CbtlTe85.js";
14
- import { S as ae } from "./star-Bf9L2Uot.js";
15
- import { C as ne } from "./chevron-down-DWE7GSq9.js";
16
- const ie = {
14
+ import { S as ne } from "./star-Bf9L2Uot.js";
15
+ import { C as ie } from "./chevron-down-DWE7GSq9.js";
16
+ const le = {
17
17
  id: "reviews-panel",
18
18
  capabilities: ["filter"],
19
19
  state: {
@@ -55,8 +55,8 @@ const ie = {
55
55
  { args: { filter: 5 }, note: "Show only 5-star reviews." },
56
56
  { args: { filter: "all" }, note: "Clear the star filter." }
57
57
  ],
58
- invoke: (e, i) => {
59
- e.setFilter(i.filter);
58
+ invoke: (e, l) => {
59
+ e.setFilter(l.filter);
60
60
  }
61
61
  }
62
62
  },
@@ -73,21 +73,21 @@ const ie = {
73
73
  }
74
74
  }
75
75
  }, w = ["all", 5, 4, 3, 2, 1];
76
- function $(e) {
76
+ function U(e) {
77
77
  return Math.min(5, Math.max(1, Math.floor(e)));
78
78
  }
79
- function le(e) {
80
- const i = {
79
+ function oe(e) {
80
+ const l = {
81
81
  1: 0,
82
82
  2: 0,
83
83
  3: 0,
84
84
  4: 0,
85
85
  5: 0
86
86
  };
87
- for (const a of e) i[$(a.overallScore)] += 1;
88
- return i;
87
+ for (const p of e) l[U(p.overallScore)] += 1;
88
+ return l;
89
89
  }
90
- const oe = _(
90
+ const de = $(
91
91
  [
92
92
  "ds:relative ds:inline-flex ds:items-center ds:justify-center",
93
93
  "ds:gap-[var(--spacing-xs)]",
@@ -120,59 +120,59 @@ const oe = _(
120
120
  defaultVariants: { state: "idle" }
121
121
  }
122
122
  );
123
- function de({
123
+ function ce({
124
124
  filter: e,
125
- histogram: i,
126
- totalCount: a,
127
- onChange: c
125
+ histogram: l,
126
+ totalCount: p,
127
+ onChange: s
128
128
  }) {
129
- const { t: f } = E("ui"), y = B(), [N, o] = H(
129
+ const { t: f } = M("ui"), y = H(), [k, v] = E(
130
130
  () => Math.max(0, w.indexOf(e))
131
131
  );
132
- W(() => {
133
- const r = w.indexOf(e);
134
- r >= 0 && o(r);
132
+ X(() => {
133
+ const a = w.indexOf(e);
134
+ a >= 0 && v(a);
135
135
  }, [e]);
136
- const u = F(/* @__PURE__ */ new Map()), v = L((r) => {
137
- var d;
138
- (d = u.current.get(r)) == null || d.focus();
139
- }, []), p = w.length, P = L(
140
- (r, d) => {
141
- switch (r.key) {
136
+ const u = F(/* @__PURE__ */ new Map()), m = B((a) => {
137
+ var i;
138
+ (i = u.current.get(a)) == null || i.focus();
139
+ }, []), g = w.length, N = B(
140
+ (a, i) => {
141
+ switch (a.key) {
142
142
  case "ArrowDown":
143
143
  case "ArrowRight": {
144
- r.preventDefault();
145
- const s = (d + 1) % p;
146
- o(s), v(s), c(w[s]);
144
+ a.preventDefault();
145
+ const n = (i + 1) % g;
146
+ v(n), m(n), s(w[n]);
147
147
  break;
148
148
  }
149
149
  case "ArrowUp":
150
150
  case "ArrowLeft": {
151
- r.preventDefault();
152
- const s = (d - 1 + p) % p;
153
- o(s), v(s), c(w[s]);
151
+ a.preventDefault();
152
+ const n = (i - 1 + g) % g;
153
+ v(n), m(n), s(w[n]);
154
154
  break;
155
155
  }
156
156
  case "Home": {
157
- r.preventDefault(), o(0), v(0), c(w[0]);
157
+ a.preventDefault(), v(0), m(0), s(w[0]);
158
158
  break;
159
159
  }
160
160
  case "End": {
161
- r.preventDefault();
162
- const s = p - 1;
163
- o(s), v(s), c(w[s]);
161
+ a.preventDefault();
162
+ const n = g - 1;
163
+ v(n), m(n), s(w[n]);
164
164
  break;
165
165
  }
166
166
  case "Enter":
167
167
  case " ": {
168
- r.preventDefault(), c(w[d]);
168
+ a.preventDefault(), s(w[i]);
169
169
  break;
170
170
  }
171
171
  }
172
172
  },
173
- [p, v, c]
173
+ [g, m, s]
174
174
  );
175
- return /* @__PURE__ */ n(K, { children: [
175
+ return /* @__PURE__ */ r(_, { children: [
176
176
  /* @__PURE__ */ t(
177
177
  "h3",
178
178
  {
@@ -187,27 +187,27 @@ function de({
187
187
  role: "radiogroup",
188
188
  "aria-labelledby": y,
189
189
  className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-2xs)]",
190
- children: w.map((r, d) => {
191
- const s = r === "all", x = s ? 0 : r, h = s ? a : i[x], S = r === e, V = N === d, m = s ? f("reviewsPanel.filter.allLabel", { count: h }) : f("reviewsPanel.filter.starsLabel", { stars: x, count: h });
192
- return /* @__PURE__ */ n(
190
+ children: w.map((a, i) => {
191
+ const n = a === "all", d = n ? 0 : a, x = n ? p : l[d], b = a === e, V = k === i, z = n ? f("reviewsPanel.filter.allLabel", { count: x }) : f("reviewsPanel.filter.starsLabel", { stars: d, count: x });
192
+ return /* @__PURE__ */ r(
193
193
  "button",
194
194
  {
195
- ref: (b) => {
196
- b ? u.current.set(d, b) : u.current.delete(d);
195
+ ref: (c) => {
196
+ c ? u.current.set(i, c) : u.current.delete(i);
197
197
  },
198
198
  type: "button",
199
199
  role: "radio",
200
- "aria-checked": S,
201
- "aria-label": m,
200
+ "aria-checked": b,
201
+ "aria-label": z,
202
202
  tabIndex: V ? 0 : -1,
203
203
  onClick: () => {
204
- o(d), c(r);
204
+ v(i), s(a);
205
205
  },
206
- onFocus: () => o(d),
207
- onKeyDown: (b) => P(b, d),
208
- "data-filter-bucket": String(r),
209
- className: oe({
210
- state: S ? "selected" : "idle"
206
+ onFocus: () => v(i),
207
+ onKeyDown: (c) => N(c, i),
208
+ "data-filter-bucket": String(a),
209
+ className: de({
210
+ state: b ? "selected" : "idle"
211
211
  }),
212
212
  children: [
213
213
  /* @__PURE__ */ t(
@@ -215,7 +215,7 @@ function de({
215
215
  {
216
216
  "aria-hidden": "true",
217
217
  className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
218
- children: s ? /* @__PURE__ */ t("span", { className: "type-label", children: f("reviewsPanel.filter.allShort") }) : /* @__PURE__ */ t(k, { value: x, size: "sm", decorative: !0 })
218
+ children: n ? /* @__PURE__ */ t("span", { className: "type-label", children: f("reviewsPanel.filter.allShort") }) : /* @__PURE__ */ t(P, { value: d, size: "sm", decorative: !0 })
219
219
  }
220
220
  ),
221
221
  /* @__PURE__ */ t(
@@ -232,57 +232,57 @@ function de({
232
232
  // text on the violet pill (~3:1, AA-fail). Match the
233
233
  // row's foreground when selected; slight opacity
234
234
  // keeps the count secondary to the label.
235
- S ? "ds:text-[color:var(--primary-foreground)]" : "ds:text-[var(--muted-foreground)]"
235
+ b ? "ds:text-[color:var(--primary-foreground)]" : "ds:text-[var(--muted-foreground)]"
236
236
  ].join(" "),
237
- children: h
237
+ children: x
238
238
  }
239
239
  )
240
240
  ]
241
241
  },
242
- String(r)
242
+ String(a)
243
243
  );
244
244
  })
245
245
  }
246
246
  )
247
247
  ] });
248
248
  }
249
- function ce({ review: e, locale: i }) {
250
- var r, d, s, x;
251
- const { t: a } = E("ui"), c = B(), f = B(), [y, N] = H(!1), o = !!(e.breakdown && Object.values(e.breakdown).some((h) => h != null)), u = !!e.reply || o || !!e.futureVisit || !!e.recommendation, v = C(() => {
249
+ function ue({ review: e, locale: l, textLang: p }) {
250
+ var i, n, d, x;
251
+ const { t: s } = M("ui"), f = H(), y = H(), [k, v] = E(!1), u = !!(e.breakdown && Object.values(e.breakdown).some((b) => b != null)), m = !!e.reply || u || !!e.futureVisit || !!e.recommendation, g = C(() => {
252
252
  if (!e.authoredAt) return "";
253
253
  try {
254
- const h = new Date(e.authoredAt);
255
- return Number.isNaN(h.getTime()) ? e.authoredAt : new Intl.DateTimeFormat(i, { dateStyle: "medium" }).format(
256
- h
254
+ const b = new Date(e.authoredAt);
255
+ return Number.isNaN(b.getTime()) ? e.authoredAt : new Intl.DateTimeFormat(l, { dateStyle: "medium" }).format(
256
+ b
257
257
  );
258
258
  } catch {
259
259
  return e.authoredAt;
260
260
  }
261
- }, [e.authoredAt, i]), p = e.pseudonym ?? a("reviewsPanel.anonymous"), P = /* @__PURE__ */ n(
262
- Y,
261
+ }, [e.authoredAt, l]), N = e.pseudonym ?? s("reviewsPanel.anonymous"), a = /* @__PURE__ */ r(
262
+ Z,
263
263
  {
264
- open: u ? y : !1,
265
- onOpenChange: u ? N : void 0,
264
+ open: m ? k : !1,
265
+ onOpenChange: m ? v : void 0,
266
266
  children: [
267
- /* @__PURE__ */ n(A.Footer, { children: [
268
- /* @__PURE__ */ t("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children: v }),
269
- u ? /* @__PURE__ */ t(Z, { asChild: !0, children: /* @__PURE__ */ n(
267
+ /* @__PURE__ */ r(A.Footer, { children: [
268
+ /* @__PURE__ */ t("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children: g }),
269
+ m ? /* @__PURE__ */ t(ee, { asChild: !0, children: /* @__PURE__ */ r(
270
270
  "button",
271
271
  {
272
- id: c,
272
+ id: f,
273
273
  type: "button",
274
274
  "data-review-trigger": !0,
275
- "aria-controls": f,
275
+ "aria-controls": y,
276
276
  className: "ds:ms-auto ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)] ds:rounded-[var(--radius-sm)] ds:ps-[var(--spacing-2xs)] ds:pe-[var(--spacing-2xs)] ds:pt-[var(--spacing-2xs)] ds:pb-[var(--spacing-2xs)] ds:bg-transparent ds:border-0 ds:text-[length:var(--font-size-sm)] ds:text-[var(--review-details-foreground)] ds:min-w-[var(--min-target-size)] ds:min-h-[var(--min-target-size)] ds:hover:underline ds:cursor-pointer ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)] ds:forced-colors:focus-visible:outline-[CanvasText]",
277
277
  children: [
278
- a(y ? "reviewsPanel.card.collapse" : "reviewsPanel.card.expand"),
278
+ s(k ? "reviewsPanel.card.collapse" : "reviewsPanel.card.expand"),
279
279
  /* @__PURE__ */ t(
280
- ne,
280
+ ie,
281
281
  {
282
282
  "aria-hidden": "true",
283
283
  className: [
284
284
  "ds:size-4 ds:transition-transform ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
285
- y ? "ds:rotate-180" : ""
285
+ k ? "ds:rotate-180" : ""
286
286
  ].filter(Boolean).join(" ")
287
287
  }
288
288
  )
@@ -290,50 +290,51 @@ function ce({ review: e, locale: i }) {
290
290
  }
291
291
  ) }) : null
292
292
  ] }),
293
- u ? /* @__PURE__ */ t(ee, { id: f, "aria-labelledby": c, children: /* @__PURE__ */ n("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:pb-[var(--spacing-md)]", children: [
294
- o || e.futureVisit || e.recommendation ? /* @__PURE__ */ n(l, { layout: "inline", density: "compact", children: [
295
- ((r = e.breakdown) == null ? void 0 : r.appointmentScore) != null ? /* @__PURE__ */ n(l.Row, { children: [
296
- /* @__PURE__ */ t(l.Term, { children: a("reviewsPanel.breakdown.appointment") }),
297
- /* @__PURE__ */ t(l.Detail, { children: /* @__PURE__ */ t(
298
- k,
293
+ m ? /* @__PURE__ */ t(te, { id: y, "aria-labelledby": f, children: /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:pb-[var(--spacing-md)]", children: [
294
+ u || e.futureVisit || e.recommendation ? /* @__PURE__ */ r(o, { layout: "inline", density: "compact", children: [
295
+ ((i = e.breakdown) == null ? void 0 : i.appointmentScore) != null ? /* @__PURE__ */ r(o.Row, { children: [
296
+ /* @__PURE__ */ t(o.Term, { children: s("reviewsPanel.breakdown.appointment") }),
297
+ /* @__PURE__ */ t(o.Detail, { children: /* @__PURE__ */ t(
298
+ P,
299
299
  {
300
300
  value: e.breakdown.appointmentScore,
301
301
  size: "sm"
302
302
  }
303
303
  ) })
304
304
  ] }) : null,
305
- ((d = e.breakdown) == null ? void 0 : d.communicationScore) != null ? /* @__PURE__ */ n(l.Row, { children: [
306
- /* @__PURE__ */ t(l.Term, { children: a("reviewsPanel.breakdown.communication") }),
307
- /* @__PURE__ */ t(l.Detail, { children: /* @__PURE__ */ t(
308
- k,
305
+ ((n = e.breakdown) == null ? void 0 : n.communicationScore) != null ? /* @__PURE__ */ r(o.Row, { children: [
306
+ /* @__PURE__ */ t(o.Term, { children: s("reviewsPanel.breakdown.communication") }),
307
+ /* @__PURE__ */ t(o.Detail, { children: /* @__PURE__ */ t(
308
+ P,
309
309
  {
310
310
  value: e.breakdown.communicationScore,
311
311
  size: "sm"
312
312
  }
313
313
  ) })
314
314
  ] }) : null,
315
- ((s = e.breakdown) == null ? void 0 : s.staffScore) != null ? /* @__PURE__ */ n(l.Row, { children: [
316
- /* @__PURE__ */ t(l.Term, { children: a("reviewsPanel.breakdown.staff") }),
317
- /* @__PURE__ */ t(l.Detail, { children: /* @__PURE__ */ t(k, { value: e.breakdown.staffScore, size: "sm" }) })
315
+ ((d = e.breakdown) == null ? void 0 : d.staffScore) != null ? /* @__PURE__ */ r(o.Row, { children: [
316
+ /* @__PURE__ */ t(o.Term, { children: s("reviewsPanel.breakdown.staff") }),
317
+ /* @__PURE__ */ t(o.Detail, { children: /* @__PURE__ */ t(P, { value: e.breakdown.staffScore, size: "sm" }) })
318
318
  ] }) : null,
319
- ((x = e.breakdown) == null ? void 0 : x.overallScore) != null ? /* @__PURE__ */ n(l.Row, { children: [
320
- /* @__PURE__ */ t(l.Term, { children: a("reviewsPanel.breakdown.overall") }),
321
- /* @__PURE__ */ t(l.Detail, { children: /* @__PURE__ */ t(k, { value: e.breakdown.overallScore, size: "sm" }) })
319
+ ((x = e.breakdown) == null ? void 0 : x.overallScore) != null ? /* @__PURE__ */ r(o.Row, { children: [
320
+ /* @__PURE__ */ t(o.Term, { children: s("reviewsPanel.breakdown.overall") }),
321
+ /* @__PURE__ */ t(o.Detail, { children: /* @__PURE__ */ t(P, { value: e.breakdown.overallScore, size: "sm" }) })
322
322
  ] }) : null,
323
- e.futureVisit ? /* @__PURE__ */ n(l.Row, { children: [
324
- /* @__PURE__ */ t(l.Term, { children: a("reviewsPanel.breakdown.futureVisit") }),
325
- /* @__PURE__ */ t(l.Detail, { children: a(`reviewsPanel.answer.${e.futureVisit}`) })
323
+ e.futureVisit ? /* @__PURE__ */ r(o.Row, { children: [
324
+ /* @__PURE__ */ t(o.Term, { children: s("reviewsPanel.breakdown.futureVisit") }),
325
+ /* @__PURE__ */ t(o.Detail, { children: s(`reviewsPanel.answer.${e.futureVisit}`) })
326
326
  ] }) : null,
327
- e.recommendation ? /* @__PURE__ */ n(l.Row, { children: [
328
- /* @__PURE__ */ t(l.Term, { children: a("reviewsPanel.breakdown.recommendation") }),
329
- /* @__PURE__ */ t(l.Detail, { children: a(`reviewsPanel.answer.${e.recommendation}`) })
327
+ e.recommendation ? /* @__PURE__ */ r(o.Row, { children: [
328
+ /* @__PURE__ */ t(o.Term, { children: s("reviewsPanel.breakdown.recommendation") }),
329
+ /* @__PURE__ */ t(o.Detail, { children: s(`reviewsPanel.answer.${e.recommendation}`) })
330
330
  ] }) : null
331
331
  ] }) : null,
332
- e.reply ? /* @__PURE__ */ n("div", { className: "ds:rounded-[var(--radius-sm)] ds:bg-[var(--muted)]/40 ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]", children: [
333
- /* @__PURE__ */ t("p", { className: "type-label ds:m-0 ds:mb-[var(--spacing-2xs)] ds:text-[var(--muted-foreground)] ds:font-[var(--font-weight-semibold)]", children: a("reviewsPanel.replyTitle") }),
332
+ e.reply ? /* @__PURE__ */ r("div", { className: "ds:rounded-[var(--radius-sm)] ds:bg-[var(--muted)]/40 ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]", children: [
333
+ /* @__PURE__ */ t("p", { className: "type-label ds:m-0 ds:mb-[var(--spacing-2xs)] ds:text-[var(--muted-foreground)] ds:font-[var(--font-weight-semibold)]", children: s("reviewsPanel.replyTitle") }),
334
334
  /* @__PURE__ */ t(
335
335
  "p",
336
336
  {
337
+ lang: p,
337
338
  dir: "auto",
338
339
  className: "type-body-sm ds:m-0 ds:text-[var(--foreground)] ds:[white-space:pre-line]",
339
340
  children: e.reply
@@ -344,48 +345,49 @@ function ce({ review: e, locale: i }) {
344
345
  ]
345
346
  }
346
347
  );
347
- return /* @__PURE__ */ n(A, { variant: "default", className: "ds:shadow-[var(--shadow-sm)]", children: [
348
- /* @__PURE__ */ t(A.Header, { children: /* @__PURE__ */ n("div", { className: "ds:flex ds:items-start ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
348
+ return /* @__PURE__ */ r(A, { variant: "default", className: "ds:shadow-[var(--shadow-sm)]", children: [
349
+ /* @__PURE__ */ t(A.Header, { children: /* @__PURE__ */ r("div", { className: "ds:flex ds:items-start ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
349
350
  /* @__PURE__ */ t(
350
351
  "h4",
351
352
  {
352
353
  dir: e.pseudonym ? "auto" : void 0,
353
354
  className: "type-title-item ds:m-0 ds:text-[var(--foreground)]",
354
- children: p
355
+ children: N
355
356
  }
356
357
  ),
357
- /* @__PURE__ */ t(k, { value: e.overallScore, size: "sm" })
358
+ /* @__PURE__ */ t(P, { value: e.overallScore, size: "sm" })
358
359
  ] }) }),
359
360
  e.comment ? /* @__PURE__ */ t(A.Body, { children: /* @__PURE__ */ t(
360
361
  "p",
361
362
  {
363
+ lang: p,
362
364
  dir: "auto",
363
365
  className: "type-body ds:m-0 ds:text-[var(--foreground)] ds:line-clamp-2",
364
366
  children: e.comment
365
367
  }
366
368
  ) }) : null,
367
- P
369
+ a
368
370
  ] });
369
371
  }
370
- function ue({ hideFilter: e }) {
371
- return /* @__PURE__ */ n("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
372
- /* @__PURE__ */ n("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
372
+ function me({ hideFilter: e }) {
373
+ return /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
374
+ /* @__PURE__ */ r("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
373
375
  /* @__PURE__ */ t(T, { variant: "text", width: "40%" }),
374
376
  /* @__PURE__ */ t(T, { variant: "text", width: "20%" })
375
377
  ] }),
376
- e ? null : /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-xs)]", children: Array.from({ length: 6 }, (i, a) => /* @__PURE__ */ t(
378
+ e ? null : /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-xs)]", children: Array.from({ length: 6 }, (l, p) => /* @__PURE__ */ t(
377
379
  T,
378
380
  {
379
381
  variant: "rounded",
380
382
  width: "4rem",
381
383
  height: "2.5rem"
382
384
  },
383
- `rp-fs-${a}`
385
+ `rp-fs-${p}`
384
386
  )) }),
385
- /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: Array.from({ length: 3 }, (i, a) => /* @__PURE__ */ t(T, { variant: "rounded", height: "6rem" }, `rp-rs-${a}`)) })
387
+ /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: Array.from({ length: 3 }, (l, p) => /* @__PURE__ */ t(T, { variant: "rounded", height: "6rem" }, `rp-rs-${p}`)) })
386
388
  ] });
387
389
  }
388
- const I = _(
390
+ const L = $(
389
391
  // No root padding: the shared `PanelHeader` owns the header's edge
390
392
  // padding (px/pt/pb) and the body wrapper below owns the content
391
393
  // padding, so the header divider can span flush to the panel edge.
@@ -410,151 +412,152 @@ const I = _(
410
412
  },
411
413
  defaultVariants: { surface: "flat" }
412
414
  }
413
- ), me = J(
415
+ ), pe = Q(
414
416
  ({
415
417
  reviews: e,
416
- aggregate: i,
417
- filter: a,
418
- onFilterChange: c,
419
- introSlot: f,
420
- headerActionSlot: y,
421
- "aria-label": N,
422
- id: o,
423
- className: u,
424
- hideFilter: v = !1,
425
- surface: p = "flat",
426
- loading: P = !1,
427
- ...r
428
- }, d) => {
429
- const { t: s, i18n: x } = E("ui"), h = x.language ?? "en", [S, V] = H("all"), m = a ?? S, b = L(
430
- (g) => {
431
- a === void 0 && V(g), c == null || c(g);
418
+ aggregate: l,
419
+ contentLang: p,
420
+ filter: s,
421
+ onFilterChange: f,
422
+ introSlot: y,
423
+ headerActionSlot: k,
424
+ "aria-label": v,
425
+ id: u,
426
+ className: m,
427
+ hideFilter: g = !1,
428
+ surface: N = "flat",
429
+ loading: a = !1,
430
+ ...i
431
+ }, n) => {
432
+ const { t: d, i18n: x } = M("ui"), b = x.language ?? "en", [V, z] = E("all"), c = s ?? V, S = B(
433
+ (h) => {
434
+ s === void 0 && z(h), f == null || f(h);
432
435
  },
433
- [a, c]
434
- ), U = C(
435
- () => i.histogram ?? le(e),
436
- [i.histogram, e]
437
- ), R = C(() => m === "all" ? e : e.filter((g) => $(g.overallScore) === m), [e, m]), M = F(m);
438
- M.current = m;
439
- const O = F(R.length);
440
- O.current = R.length;
441
- const q = C(
436
+ [s, f]
437
+ ), q = C(
438
+ () => l.histogram ?? oe(e),
439
+ [l.histogram, e]
440
+ ), R = C(() => c === "all" ? e : e.filter((h) => U(h.overallScore) === c), [e, c]), O = F(c);
441
+ O.current = c;
442
+ const K = F(R.length);
443
+ K.current = R.length;
444
+ const G = C(
442
445
  () => ({
443
- getFilter: () => M.current,
444
- setFilter: (g) => b(g),
445
- getVisibleCount: () => O.current
446
+ getFilter: () => O.current,
447
+ setFilter: (h) => S(h),
448
+ getVisibleCount: () => K.current
446
449
  }),
447
- [b]
450
+ [S]
448
451
  ), D = F(null);
449
- Q(d, () => D.current, []), X(ie, q, o);
450
- const z = N ?? s("reviewsPanel.regionLabel"), j = String(m);
451
- if (P)
452
+ W(n, () => D.current, []), Y(le, G, u);
453
+ const j = v ?? d("reviewsPanel.regionLabel"), I = String(c);
454
+ if (a)
452
455
  return /* @__PURE__ */ t(
453
456
  "section",
454
457
  {
455
458
  ref: D,
456
- "aria-label": z,
459
+ "aria-label": j,
457
460
  "aria-busy": "true",
458
- id: o,
461
+ id: u,
459
462
  "data-component": "reviews-panel",
460
- "data-component-id": o,
461
- "data-filter": j,
463
+ "data-component-id": u,
464
+ "data-filter": I,
462
465
  "data-state": "loading",
463
- className: I({ surface: p, className: u }),
464
- ...r,
465
- children: /* @__PURE__ */ t("div", { className: "ds:p-[var(--spacing-md)]", children: /* @__PURE__ */ t(ue, { hideFilter: v }) })
466
+ className: L({ surface: N, className: m }),
467
+ ...i,
468
+ children: /* @__PURE__ */ t("div", { className: "ds:p-[var(--spacing-md)]", children: /* @__PURE__ */ t(me, { hideFilter: g }) })
466
469
  }
467
470
  );
468
- if (i.count === 0 && e.length === 0)
471
+ if (l.count === 0 && e.length === 0)
469
472
  return /* @__PURE__ */ t(
470
473
  "section",
471
474
  {
472
475
  ref: D,
473
- "aria-label": z,
474
- id: o,
476
+ "aria-label": j,
477
+ id: u,
475
478
  "data-component": "reviews-panel",
476
- "data-component-id": o,
477
- "data-filter": j,
479
+ "data-component-id": u,
480
+ "data-filter": I,
478
481
  "data-state": "empty",
479
- className: I({ surface: p, className: u }),
480
- ...r,
482
+ className: L({ surface: N, className: m }),
483
+ ...i,
481
484
  children: /* @__PURE__ */ t("div", { className: "ds:p-[var(--spacing-md)]", children: /* @__PURE__ */ t(
482
- te,
485
+ se,
483
486
  {
484
487
  variant: "no-results",
485
- title: s("reviewsPanel.empty.title"),
486
- description: s("reviewsPanel.empty.description")
488
+ title: d("reviewsPanel.empty.title"),
489
+ description: d("reviewsPanel.empty.description")
487
490
  }
488
491
  ) })
489
492
  }
490
493
  );
491
- const G = !v;
492
- return /* @__PURE__ */ n(
494
+ const J = !g;
495
+ return /* @__PURE__ */ r(
493
496
  "section",
494
497
  {
495
498
  ref: D,
496
- "aria-label": z,
497
- id: o,
499
+ "aria-label": j,
500
+ id: u,
498
501
  "data-component": "reviews-panel",
499
- "data-component-id": o,
500
- "data-filter": j,
501
- className: I({ surface: p, className: u }),
502
- ...r,
502
+ "data-component-id": u,
503
+ "data-filter": I,
504
+ className: L({ surface: N, className: m }),
505
+ ...i,
503
506
  children: [
504
507
  /* @__PURE__ */ t(
505
508
  re,
506
509
  {
507
- title: s("reviewsPanel.title"),
508
- icon: /* @__PURE__ */ t(ae, { "aria-hidden": "true" }),
510
+ title: d("reviewsPanel.title"),
511
+ icon: /* @__PURE__ */ t(ne, { "aria-hidden": "true" }),
509
512
  titleScale: "section",
510
513
  sticky: !0,
511
514
  wrapActions: !0,
512
- actions: /* @__PURE__ */ n(K, { children: [
513
- y,
515
+ actions: /* @__PURE__ */ r(_, { children: [
516
+ k,
514
517
  /* @__PURE__ */ t(
515
- k,
518
+ P,
516
519
  {
517
- value: i.averageScore,
518
- reviews: { count: i.count },
520
+ value: l.averageScore,
521
+ reviews: { count: l.count },
519
522
  size: "md"
520
523
  }
521
524
  )
522
525
  ] }),
523
- filters: G ? /* @__PURE__ */ t(
524
- de,
526
+ filters: J ? /* @__PURE__ */ t(
527
+ ce,
525
528
  {
526
- filter: m,
527
- histogram: U,
528
- totalCount: i.count,
529
- onChange: b
529
+ filter: c,
530
+ histogram: q,
531
+ totalCount: l.count,
532
+ onChange: S
530
533
  }
531
534
  ) : void 0
532
535
  }
533
536
  ),
534
- /* @__PURE__ */ n("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:min-w-0 ds:p-[var(--spacing-md)]", children: [
535
- f || null,
537
+ /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:min-w-0 ds:p-[var(--spacing-md)]", children: [
538
+ y || null,
536
539
  R.length === 0 ? (
537
540
  // `role="status"` already implies `aria-live="polite"` —
538
541
  // declaring both would queue two announcements when the
539
542
  // filter changes (the radio's aria-checked flip + this
540
543
  // container's text). Keeping `role` only.
541
- /* @__PURE__ */ n(
544
+ /* @__PURE__ */ r(
542
545
  "div",
543
546
  {
544
547
  role: "status",
545
548
  "data-state": "no-match",
546
549
  className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-sm)] ds:rounded-[var(--radius-md)] ds:border ds:border-dashed ds:border-[var(--border)] ds:p-[var(--spacing-lg)] ds:text-center",
547
550
  children: [
548
- /* @__PURE__ */ t("p", { className: "type-body ds:m-0 ds:text-[var(--muted-foreground)]", children: m === "all" ? s("reviewsPanel.empty.title") : s("reviewsPanel.empty.filterDescription", {
549
- stars: m
551
+ /* @__PURE__ */ t("p", { className: "type-body ds:m-0 ds:text-[var(--muted-foreground)]", children: c === "all" ? d("reviewsPanel.empty.title") : d("reviewsPanel.empty.filterDescription", {
552
+ stars: c
550
553
  }) }),
551
- m !== "all" ? /* @__PURE__ */ t(
552
- se,
554
+ c !== "all" ? /* @__PURE__ */ t(
555
+ ae,
553
556
  {
554
557
  intent: "secondary",
555
558
  size: "sm",
556
- onClick: () => b("all"),
557
- children: s("reviewsPanel.empty.resetFilter")
559
+ onClick: () => S("all"),
560
+ children: d("reviewsPanel.empty.resetFilter")
558
561
  }
559
562
  ) : null
560
563
  ]
@@ -563,9 +566,16 @@ const I = _(
563
566
  ) : /* @__PURE__ */ t(
564
567
  "ol",
565
568
  {
566
- "aria-label": s("reviewsPanel.listLabel"),
569
+ "aria-label": d("reviewsPanel.listLabel"),
567
570
  className: "ds:list-none ds:m-0 ds:p-0 ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
568
- children: R.map((g) => /* @__PURE__ */ t("li", { "data-review-id": g.id, children: /* @__PURE__ */ t(ce, { review: g, locale: h }) }, g.id))
571
+ children: R.map((h) => /* @__PURE__ */ t("li", { "data-review-id": h.id, children: /* @__PURE__ */ t(
572
+ ue,
573
+ {
574
+ review: h,
575
+ locale: b,
576
+ textLang: h.contentLang ?? p
577
+ }
578
+ ) }, h.id))
569
579
  }
570
580
  )
571
581
  ] })
@@ -574,9 +584,9 @@ const I = _(
574
584
  );
575
585
  }
576
586
  );
577
- me.displayName = "ReviewsPanel";
587
+ pe.displayName = "ReviewsPanel";
578
588
  export {
579
- me as R,
580
- ie as r
589
+ pe as R,
590
+ le as r
581
591
  };
582
- //# sourceMappingURL=reviews-panel-jPYgYvxG.js.map
592
+ //# sourceMappingURL=reviews-panel-CtrwZOUS.js.map