@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.
- package/dist/_chunks/{reviews-panel-jPYgYvxG.js → reviews-panel-CtrwZOUS.js} +215 -205
- package/dist/_chunks/reviews-panel-CtrwZOUS.js.map +1 -0
- package/dist/_chunks/stat-group-CC4-O-Fj.js +97 -0
- package/dist/_chunks/stat-group-CC4-O-Fj.js.map +1 -0
- package/dist/agent-catalog.json +1 -1
- package/dist/components/reviews-panel/index.js +1 -1
- package/dist/components/reviews-panel/reviews-panel.d.ts +13 -0
- package/dist/components/reviews-panel/reviews-panel.d.ts.map +1 -1
- package/dist/components/stat-group/index.js +1 -1
- package/dist/components/stat-group/stat-group.d.ts.map +1 -1
- package/dist/core.css +1 -1
- package/dist/index.js +2 -2
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/reviews-panel-jPYgYvxG.js.map +0 -1
- package/dist/_chunks/stat-group-DSNnzkbW.js +0 -107
- package/dist/_chunks/stat-group-DSNnzkbW.js.map +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { u as
|
|
6
|
-
import { R as
|
|
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
|
|
9
|
-
import { D as
|
|
10
|
-
import { E as
|
|
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
|
|
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
|
|
15
|
-
import { C as
|
|
16
|
-
const
|
|
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,
|
|
59
|
-
e.setFilter(
|
|
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
|
|
76
|
+
function U(e) {
|
|
77
77
|
return Math.min(5, Math.max(1, Math.floor(e)));
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
const
|
|
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
|
|
88
|
-
return
|
|
87
|
+
for (const p of e) l[U(p.overallScore)] += 1;
|
|
88
|
+
return l;
|
|
89
89
|
}
|
|
90
|
-
const
|
|
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
|
|
123
|
+
function ce({
|
|
124
124
|
filter: e,
|
|
125
|
-
histogram:
|
|
126
|
-
totalCount:
|
|
127
|
-
onChange:
|
|
125
|
+
histogram: l,
|
|
126
|
+
totalCount: p,
|
|
127
|
+
onChange: s
|
|
128
128
|
}) {
|
|
129
|
-
const { t: f } =
|
|
129
|
+
const { t: f } = M("ui"), y = H(), [k, v] = E(
|
|
130
130
|
() => Math.max(0, w.indexOf(e))
|
|
131
131
|
);
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
|
|
132
|
+
X(() => {
|
|
133
|
+
const a = w.indexOf(e);
|
|
134
|
+
a >= 0 && v(a);
|
|
135
135
|
}, [e]);
|
|
136
|
-
const u = F(/* @__PURE__ */ new Map()),
|
|
137
|
-
var
|
|
138
|
-
(
|
|
139
|
-
}, []),
|
|
140
|
-
(
|
|
141
|
-
switch (
|
|
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
|
-
|
|
145
|
-
const
|
|
146
|
-
|
|
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
|
-
|
|
152
|
-
const
|
|
153
|
-
|
|
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
|
-
|
|
157
|
+
a.preventDefault(), v(0), m(0), s(w[0]);
|
|
158
158
|
break;
|
|
159
159
|
}
|
|
160
160
|
case "End": {
|
|
161
|
-
|
|
162
|
-
const
|
|
163
|
-
|
|
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
|
-
|
|
168
|
+
a.preventDefault(), s(w[i]);
|
|
169
169
|
break;
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
},
|
|
173
|
-
[
|
|
173
|
+
[g, m, s]
|
|
174
174
|
);
|
|
175
|
-
return /* @__PURE__ */
|
|
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((
|
|
191
|
-
const
|
|
192
|
-
return /* @__PURE__ */
|
|
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: (
|
|
196
|
-
|
|
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":
|
|
201
|
-
"aria-label":
|
|
200
|
+
"aria-checked": b,
|
|
201
|
+
"aria-label": z,
|
|
202
202
|
tabIndex: V ? 0 : -1,
|
|
203
203
|
onClick: () => {
|
|
204
|
-
|
|
204
|
+
v(i), s(a);
|
|
205
205
|
},
|
|
206
|
-
onFocus: () =>
|
|
207
|
-
onKeyDown: (
|
|
208
|
-
"data-filter-bucket": String(
|
|
209
|
-
className:
|
|
210
|
-
state:
|
|
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:
|
|
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
|
-
|
|
235
|
+
b ? "ds:text-[color:var(--primary-foreground)]" : "ds:text-[var(--muted-foreground)]"
|
|
236
236
|
].join(" "),
|
|
237
|
-
children:
|
|
237
|
+
children: x
|
|
238
238
|
}
|
|
239
239
|
)
|
|
240
240
|
]
|
|
241
241
|
},
|
|
242
|
-
String(
|
|
242
|
+
String(a)
|
|
243
243
|
);
|
|
244
244
|
})
|
|
245
245
|
}
|
|
246
246
|
)
|
|
247
247
|
] });
|
|
248
248
|
}
|
|
249
|
-
function
|
|
250
|
-
var
|
|
251
|
-
const { t:
|
|
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
|
|
255
|
-
return Number.isNaN(
|
|
256
|
-
|
|
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,
|
|
262
|
-
|
|
261
|
+
}, [e.authoredAt, l]), N = e.pseudonym ?? s("reviewsPanel.anonymous"), a = /* @__PURE__ */ r(
|
|
262
|
+
Z,
|
|
263
263
|
{
|
|
264
|
-
open:
|
|
265
|
-
onOpenChange:
|
|
264
|
+
open: m ? k : !1,
|
|
265
|
+
onOpenChange: m ? v : void 0,
|
|
266
266
|
children: [
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
-
/* @__PURE__ */ t("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children:
|
|
269
|
-
|
|
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:
|
|
272
|
+
id: f,
|
|
273
273
|
type: "button",
|
|
274
274
|
"data-review-trigger": !0,
|
|
275
|
-
"aria-controls":
|
|
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
|
-
|
|
278
|
+
s(k ? "reviewsPanel.card.collapse" : "reviewsPanel.card.expand"),
|
|
279
279
|
/* @__PURE__ */ t(
|
|
280
|
-
|
|
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
|
-
|
|
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
|
-
|
|
294
|
-
|
|
295
|
-
((
|
|
296
|
-
/* @__PURE__ */ t(
|
|
297
|
-
/* @__PURE__ */ t(
|
|
298
|
-
|
|
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
|
-
((
|
|
306
|
-
/* @__PURE__ */ t(
|
|
307
|
-
/* @__PURE__ */ t(
|
|
308
|
-
|
|
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
|
-
((
|
|
316
|
-
/* @__PURE__ */ t(
|
|
317
|
-
/* @__PURE__ */ t(
|
|
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__ */
|
|
320
|
-
/* @__PURE__ */ t(
|
|
321
|
-
/* @__PURE__ */ t(
|
|
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__ */
|
|
324
|
-
/* @__PURE__ */ t(
|
|
325
|
-
/* @__PURE__ */ t(
|
|
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__ */
|
|
328
|
-
/* @__PURE__ */ t(
|
|
329
|
-
/* @__PURE__ */ t(
|
|
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__ */
|
|
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:
|
|
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__ */
|
|
348
|
-
/* @__PURE__ */ t(A.Header, { children: /* @__PURE__ */
|
|
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:
|
|
355
|
+
children: N
|
|
355
356
|
}
|
|
356
357
|
),
|
|
357
|
-
/* @__PURE__ */ t(
|
|
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
|
-
|
|
369
|
+
a
|
|
368
370
|
] });
|
|
369
371
|
}
|
|
370
|
-
function
|
|
371
|
-
return /* @__PURE__ */
|
|
372
|
-
/* @__PURE__ */
|
|
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 }, (
|
|
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-${
|
|
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 }, (
|
|
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
|
|
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
|
-
),
|
|
415
|
+
), pe = Q(
|
|
414
416
|
({
|
|
415
417
|
reviews: e,
|
|
416
|
-
aggregate:
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
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
|
-
[
|
|
434
|
-
),
|
|
435
|
-
() =>
|
|
436
|
-
[
|
|
437
|
-
), R = C(() =>
|
|
438
|
-
|
|
439
|
-
const
|
|
440
|
-
|
|
441
|
-
const
|
|
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: () =>
|
|
444
|
-
setFilter: (
|
|
445
|
-
getVisibleCount: () =>
|
|
446
|
+
getFilter: () => O.current,
|
|
447
|
+
setFilter: (h) => S(h),
|
|
448
|
+
getVisibleCount: () => K.current
|
|
446
449
|
}),
|
|
447
|
-
[
|
|
450
|
+
[S]
|
|
448
451
|
), D = F(null);
|
|
449
|
-
|
|
450
|
-
const
|
|
451
|
-
if (
|
|
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":
|
|
459
|
+
"aria-label": j,
|
|
457
460
|
"aria-busy": "true",
|
|
458
|
-
id:
|
|
461
|
+
id: u,
|
|
459
462
|
"data-component": "reviews-panel",
|
|
460
|
-
"data-component-id":
|
|
461
|
-
"data-filter":
|
|
463
|
+
"data-component-id": u,
|
|
464
|
+
"data-filter": I,
|
|
462
465
|
"data-state": "loading",
|
|
463
|
-
className:
|
|
464
|
-
...
|
|
465
|
-
children: /* @__PURE__ */ t("div", { className: "ds:p-[var(--spacing-md)]", children: /* @__PURE__ */ t(
|
|
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 (
|
|
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":
|
|
474
|
-
id:
|
|
476
|
+
"aria-label": j,
|
|
477
|
+
id: u,
|
|
475
478
|
"data-component": "reviews-panel",
|
|
476
|
-
"data-component-id":
|
|
477
|
-
"data-filter":
|
|
479
|
+
"data-component-id": u,
|
|
480
|
+
"data-filter": I,
|
|
478
481
|
"data-state": "empty",
|
|
479
|
-
className:
|
|
480
|
-
...
|
|
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
|
-
|
|
485
|
+
se,
|
|
483
486
|
{
|
|
484
487
|
variant: "no-results",
|
|
485
|
-
title:
|
|
486
|
-
description:
|
|
488
|
+
title: d("reviewsPanel.empty.title"),
|
|
489
|
+
description: d("reviewsPanel.empty.description")
|
|
487
490
|
}
|
|
488
491
|
) })
|
|
489
492
|
}
|
|
490
493
|
);
|
|
491
|
-
const
|
|
492
|
-
return /* @__PURE__ */
|
|
494
|
+
const J = !g;
|
|
495
|
+
return /* @__PURE__ */ r(
|
|
493
496
|
"section",
|
|
494
497
|
{
|
|
495
498
|
ref: D,
|
|
496
|
-
"aria-label":
|
|
497
|
-
id:
|
|
499
|
+
"aria-label": j,
|
|
500
|
+
id: u,
|
|
498
501
|
"data-component": "reviews-panel",
|
|
499
|
-
"data-component-id":
|
|
500
|
-
"data-filter":
|
|
501
|
-
className:
|
|
502
|
-
...
|
|
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:
|
|
508
|
-
icon: /* @__PURE__ */ t(
|
|
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__ */
|
|
513
|
-
|
|
515
|
+
actions: /* @__PURE__ */ r(_, { children: [
|
|
516
|
+
k,
|
|
514
517
|
/* @__PURE__ */ t(
|
|
515
|
-
|
|
518
|
+
P,
|
|
516
519
|
{
|
|
517
|
-
value:
|
|
518
|
-
reviews: { count:
|
|
520
|
+
value: l.averageScore,
|
|
521
|
+
reviews: { count: l.count },
|
|
519
522
|
size: "md"
|
|
520
523
|
}
|
|
521
524
|
)
|
|
522
525
|
] }),
|
|
523
|
-
filters:
|
|
524
|
-
|
|
526
|
+
filters: J ? /* @__PURE__ */ t(
|
|
527
|
+
ce,
|
|
525
528
|
{
|
|
526
|
-
filter:
|
|
527
|
-
histogram:
|
|
528
|
-
totalCount:
|
|
529
|
-
onChange:
|
|
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__ */
|
|
535
|
-
|
|
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__ */
|
|
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:
|
|
549
|
-
stars:
|
|
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
|
-
|
|
552
|
-
|
|
554
|
+
c !== "all" ? /* @__PURE__ */ t(
|
|
555
|
+
ae,
|
|
553
556
|
{
|
|
554
557
|
intent: "secondary",
|
|
555
558
|
size: "sm",
|
|
556
|
-
onClick: () =>
|
|
557
|
-
children:
|
|
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":
|
|
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((
|
|
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
|
-
|
|
587
|
+
pe.displayName = "ReviewsPanel";
|
|
578
588
|
export {
|
|
579
|
-
|
|
580
|
-
|
|
589
|
+
pe as R,
|
|
590
|
+
le as r
|
|
581
591
|
};
|
|
582
|
-
//# sourceMappingURL=reviews-panel-
|
|
592
|
+
//# sourceMappingURL=reviews-panel-CtrwZOUS.js.map
|