@alfadocs/ui-kit 0.25.2 → 0.30.1
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/booking-Bw9eOU4k.js +2292 -0
- package/dist/_chunks/{calendar-9eOXumpH.js → calendar-WWNx448i.js} +10 -9
- package/dist/_chunks/{contact-card-CeEfEAxh.js → contact-card-DYbp--s-.js} +2 -2
- package/dist/_chunks/{header-B8V_sNPy.js → header-CkMb1TZS.js} +23 -23
- package/dist/_chunks/heart-pulse-CvuyFKHB.js +21 -0
- package/dist/_chunks/{link-DmM5IevO.js → link-DrD_cRUg.js} +50 -45
- package/dist/_chunks/parseISO-Dk4xa7q6.js +120 -0
- package/dist/_chunks/patient-search-DuSoGG2t.js +1113 -0
- package/dist/_chunks/{patient-shell-Bq8CjRYF.js → patient-shell-CAXYzbRw.js} +2 -2
- package/dist/_chunks/public-footer.agent-DivkKdG4.js +537 -0
- package/dist/_chunks/reviews-panel-CFttsfuC.js +513 -0
- package/dist/_chunks/slot-grid-B2zprPcv.js +387 -0
- package/dist/_chunks/stethoscope-DT5qCW8Y.js +18 -0
- package/dist/agent-catalog.json +117 -22
- package/dist/components/booking/booking-types.d.ts +167 -0
- package/dist/components/booking/booking.agent.d.ts +1 -1
- package/dist/components/booking/booking.d.ts +4 -89
- package/dist/components/booking/cascade.d.ts +96 -0
- package/dist/components/booking/details-form.d.ts +39 -0
- package/dist/components/booking/index.d.ts +2 -1
- package/dist/components/booking/index.js +5 -3
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/checkbox/checkbox.d.ts +6 -2
- package/dist/components/contact-card/index.js +1 -1
- package/dist/components/header/index.js +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/link/index.js +1 -1
- package/dist/components/link/link.d.ts +7 -0
- package/dist/components/patient-search/index.d.ts +4 -0
- package/dist/components/patient-search/index.js +6 -0
- package/dist/components/patient-search/patient-search.agent.d.ts +4 -0
- package/dist/components/patient-search/patient-search.d.ts +112 -0
- package/dist/components/public-footer/index.d.ts +6 -0
- package/dist/components/public-footer/index.js +10 -0
- package/dist/components/public-footer/legal-urls.d.ts +18 -0
- package/dist/components/public-footer/public-footer.agent.d.ts +4 -0
- package/dist/components/public-footer/public-footer.d.ts +58 -0
- package/dist/components/public-footer/socials.d.ts +9 -0
- package/dist/components/reviews-panel/index.d.ts +4 -0
- package/dist/components/reviews-panel/index.js +6 -0
- package/dist/components/reviews-panel/reviews-panel.agent.d.ts +4 -0
- package/dist/components/reviews-panel/reviews-panel.d.ts +76 -0
- package/dist/components/slot-grid/index.js +1 -1
- package/dist/i18n/config.js +3994 -38
- package/dist/i18n/locales/ar.d.ts +221 -0
- package/dist/i18n/locales/de.d.ts +221 -0
- package/dist/i18n/locales/el.d.ts +221 -0
- package/dist/i18n/locales/es.d.ts +221 -0
- package/dist/i18n/locales/fr.d.ts +221 -0
- package/dist/i18n/locales/hi.d.ts +221 -0
- package/dist/i18n/locales/ja.d.ts +221 -0
- package/dist/i18n/locales/nl.d.ts +221 -0
- package/dist/i18n/locales/pl.d.ts +221 -0
- package/dist/i18n/locales/pt.d.ts +221 -0
- package/dist/i18n/locales/ro.d.ts +221 -0
- package/dist/i18n/locales/ru.d.ts +221 -0
- package/dist/i18n/locales/sq.d.ts +221 -0
- package/dist/i18n/locales/sv.d.ts +221 -0
- package/dist/i18n/locales/tr.d.ts +221 -0
- package/dist/i18n/locales/zh.d.ts +221 -0
- package/dist/i18n/resources.d.ts +442 -0
- package/dist/index.js +351 -336
- package/dist/locales/ar.json +222 -1
- package/dist/locales/de.json +222 -1
- package/dist/locales/el.json +222 -1
- package/dist/locales/en.json +222 -1
- package/dist/locales/es.json +222 -1
- package/dist/locales/fr.json +222 -1
- package/dist/locales/hi.json +222 -1
- package/dist/locales/it.json +222 -1
- package/dist/locales/ja.json +222 -1
- package/dist/locales/nl.json +222 -1
- package/dist/locales/pl.json +222 -1
- package/dist/locales/pt.json +222 -1
- package/dist/locales/ro.json +222 -1
- package/dist/locales/ru.json +222 -1
- package/dist/locales/sq.json +222 -1
- package/dist/locales/sv.json +222 -1
- package/dist/locales/tr.json +222 -1
- package/dist/locales/zh.json +222 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +17 -1
- package/dist/_chunks/booking-CXngC-1u.js +0 -1743
- package/dist/_chunks/slot-grid-DoodeQGZ.js +0 -502
- package/dist/_chunks/stethoscope-B8kpbtjh.js +0 -35
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
import { jsx as s, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as q, useState as _, useCallback as L, useMemo as V, useRef as F, useImperativeHandle as G, useId as B, useEffect as J } from "react";
|
|
3
|
+
import { c as K } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as E } from "react-i18next";
|
|
5
|
+
import { u as Q } from "./registry-C9nwlNyL.js";
|
|
6
|
+
import { R as N } from "./rating-BRD7O74e.js";
|
|
7
|
+
import { C as T } from "./card-DKTMLVrw.js";
|
|
8
|
+
import { C as W, b as X, a as Y } from "./collapsible-hHiyZp0b.js";
|
|
9
|
+
import { D as d } from "./description-list-yl3y3QKg.js";
|
|
10
|
+
import { E as Z } from "./empty-state-BLy7tigq.js";
|
|
11
|
+
import { S as C } from "./skeleton-CZbwyJAA.js";
|
|
12
|
+
import { B as ee } from "./button-DD_0Xdmr.js";
|
|
13
|
+
import { C as se } from "./chevron-down-BX_NP2Yh.js";
|
|
14
|
+
const ae = {
|
|
15
|
+
id: "reviews-panel",
|
|
16
|
+
capabilities: ["filter"],
|
|
17
|
+
state: {
|
|
18
|
+
filter: {
|
|
19
|
+
type: "string",
|
|
20
|
+
descriptionKey: "ui.agent.reviewsPanel.state.filter",
|
|
21
|
+
description: 'Active star-bucket filter — `"all"` or an integer 1..5. Reads the controlled `filter` prop.',
|
|
22
|
+
read: (e) => e.getFilter()
|
|
23
|
+
},
|
|
24
|
+
visibleCount: {
|
|
25
|
+
type: "number",
|
|
26
|
+
descriptionKey: "ui.agent.reviewsPanel.state.visibleCount",
|
|
27
|
+
description: "Number of reviews currently rendered after the filter is applied.",
|
|
28
|
+
read: (e) => e.getVisibleCount()
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
actions: {
|
|
32
|
+
set_filter: {
|
|
33
|
+
safety: "read",
|
|
34
|
+
argsType: '{ filter: "all" | 1 | 2 | 3 | 4 | 5 }',
|
|
35
|
+
descriptionKey: "ui.agent.reviewsPanel.actions.setFilter",
|
|
36
|
+
description: 'Narrow the visible review list to a star bucket, or `"all"` to clear the filter.',
|
|
37
|
+
invoke: (e, l) => {
|
|
38
|
+
e.setFilter(l.filter);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
domHooks: {
|
|
43
|
+
root: {
|
|
44
|
+
attr: "data-component",
|
|
45
|
+
value: "reviews-panel",
|
|
46
|
+
description: "Marks the ReviewsPanel root region."
|
|
47
|
+
},
|
|
48
|
+
instanceId: {
|
|
49
|
+
attr: "data-component-id",
|
|
50
|
+
sourceProp: "id",
|
|
51
|
+
description: "Sourced from the id prop."
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}, b = ["all", 5, 4, 3, 2, 1];
|
|
55
|
+
function $(e) {
|
|
56
|
+
return Math.min(5, Math.max(1, Math.floor(e)));
|
|
57
|
+
}
|
|
58
|
+
function te(e) {
|
|
59
|
+
const l = {
|
|
60
|
+
1: 0,
|
|
61
|
+
2: 0,
|
|
62
|
+
3: 0,
|
|
63
|
+
4: 0,
|
|
64
|
+
5: 0
|
|
65
|
+
};
|
|
66
|
+
for (const r of e) l[$(r.overallScore)] += 1;
|
|
67
|
+
return l;
|
|
68
|
+
}
|
|
69
|
+
const re = K(
|
|
70
|
+
[
|
|
71
|
+
"ds:relative ds:flex ds:w-full ds:items-center ds:justify-between",
|
|
72
|
+
"ds:gap-[var(--spacing-sm)]",
|
|
73
|
+
"ds:min-h-[var(--min-target-size)]",
|
|
74
|
+
"ds:rounded-[var(--radius-md)]",
|
|
75
|
+
"ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]",
|
|
76
|
+
"ds:pt-[var(--spacing-2xs)] ds:pb-[var(--spacing-2xs)]",
|
|
77
|
+
"ds:text-start",
|
|
78
|
+
"ds:transition-[background-color,color]",
|
|
79
|
+
"ds:duration-[var(--animation-duration)]",
|
|
80
|
+
"ds:motion-reduce:transition-none",
|
|
81
|
+
"ds:focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
82
|
+
"ds:focus-visible:outline-solid",
|
|
83
|
+
"ds:focus-visible:outline-[var(--ring)]",
|
|
84
|
+
"ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
85
|
+
"ds:forced-colors:focus-visible:outline-[CanvasText]",
|
|
86
|
+
"ds:cursor-pointer"
|
|
87
|
+
].join(" "),
|
|
88
|
+
{
|
|
89
|
+
variants: {
|
|
90
|
+
state: {
|
|
91
|
+
idle: "ds:hover:bg-[var(--muted)]/30 ds:text-[var(--foreground)]",
|
|
92
|
+
selected: [
|
|
93
|
+
"ds:bg-[var(--primary)]",
|
|
94
|
+
"ds:text-[var(--primary-foreground)]",
|
|
95
|
+
"ds:font-[var(--font-weight-semibold)]"
|
|
96
|
+
].join(" ")
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
defaultVariants: { state: "idle" }
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
function ne({
|
|
103
|
+
filter: e,
|
|
104
|
+
histogram: l,
|
|
105
|
+
totalCount: r,
|
|
106
|
+
onChange: c
|
|
107
|
+
}) {
|
|
108
|
+
const { t: g } = E(), x = B(), [S, o] = _(
|
|
109
|
+
() => Math.max(0, b.indexOf(e))
|
|
110
|
+
);
|
|
111
|
+
J(() => {
|
|
112
|
+
const n = b.indexOf(e);
|
|
113
|
+
n >= 0 && o(n);
|
|
114
|
+
}, [e]);
|
|
115
|
+
const m = F(/* @__PURE__ */ new Map()), p = L((n) => {
|
|
116
|
+
var a;
|
|
117
|
+
(a = m.current.get(n)) == null || a.focus();
|
|
118
|
+
}, []), h = b.length, y = L(
|
|
119
|
+
(n, a) => {
|
|
120
|
+
switch (n.key) {
|
|
121
|
+
case "ArrowDown":
|
|
122
|
+
case "ArrowRight": {
|
|
123
|
+
n.preventDefault();
|
|
124
|
+
const i = (a + 1) % h;
|
|
125
|
+
o(i), p(i), c(b[i]);
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
case "ArrowUp":
|
|
129
|
+
case "ArrowLeft": {
|
|
130
|
+
n.preventDefault();
|
|
131
|
+
const i = (a - 1 + h) % h;
|
|
132
|
+
o(i), p(i), c(b[i]);
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
case "Home": {
|
|
136
|
+
n.preventDefault(), o(0), p(0), c(b[0]);
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
case "End": {
|
|
140
|
+
n.preventDefault();
|
|
141
|
+
const i = h - 1;
|
|
142
|
+
o(i), p(i), c(b[i]);
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
case "Enter":
|
|
146
|
+
case " ": {
|
|
147
|
+
n.preventDefault(), c(b[a]);
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
[h, p, c]
|
|
153
|
+
);
|
|
154
|
+
return /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
155
|
+
/* @__PURE__ */ s(
|
|
156
|
+
"h3",
|
|
157
|
+
{
|
|
158
|
+
id: x,
|
|
159
|
+
className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0",
|
|
160
|
+
children: g("reviewsPanel.filterTitle")
|
|
161
|
+
}
|
|
162
|
+
),
|
|
163
|
+
/* @__PURE__ */ s(
|
|
164
|
+
"div",
|
|
165
|
+
{
|
|
166
|
+
role: "radiogroup",
|
|
167
|
+
"aria-labelledby": x,
|
|
168
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]",
|
|
169
|
+
children: b.map((n, a) => {
|
|
170
|
+
const i = n === "all", w = i ? 0 : n, f = i ? r : l[w], R = n === e, u = S === a, k = i ? g("reviewsPanel.filter.allLabel", { count: f }) : g("reviewsPanel.filter.starsLabel", { stars: w, count: f });
|
|
171
|
+
return /* @__PURE__ */ t(
|
|
172
|
+
"button",
|
|
173
|
+
{
|
|
174
|
+
ref: (P) => {
|
|
175
|
+
P ? m.current.set(a, P) : m.current.delete(a);
|
|
176
|
+
},
|
|
177
|
+
type: "button",
|
|
178
|
+
role: "radio",
|
|
179
|
+
"aria-checked": R,
|
|
180
|
+
"aria-label": k,
|
|
181
|
+
tabIndex: u ? 0 : -1,
|
|
182
|
+
onClick: () => {
|
|
183
|
+
o(a), c(n);
|
|
184
|
+
},
|
|
185
|
+
onFocus: () => o(a),
|
|
186
|
+
onKeyDown: (P) => y(P, a),
|
|
187
|
+
"data-filter-bucket": String(n),
|
|
188
|
+
className: re({
|
|
189
|
+
state: R ? "selected" : "idle"
|
|
190
|
+
}),
|
|
191
|
+
children: [
|
|
192
|
+
/* @__PURE__ */ s(
|
|
193
|
+
"span",
|
|
194
|
+
{
|
|
195
|
+
"aria-hidden": "true",
|
|
196
|
+
className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
197
|
+
children: i ? /* @__PURE__ */ s("span", { className: "type-label", children: g("reviewsPanel.filter.allShort") }) : /* @__PURE__ */ s(N, { value: w, size: "sm", decorative: !0 })
|
|
198
|
+
}
|
|
199
|
+
),
|
|
200
|
+
/* @__PURE__ */ s(
|
|
201
|
+
"span",
|
|
202
|
+
{
|
|
203
|
+
"aria-hidden": "true",
|
|
204
|
+
className: "type-meta ds:text-[var(--muted-foreground)]",
|
|
205
|
+
children: f
|
|
206
|
+
}
|
|
207
|
+
)
|
|
208
|
+
]
|
|
209
|
+
},
|
|
210
|
+
String(n)
|
|
211
|
+
);
|
|
212
|
+
})
|
|
213
|
+
}
|
|
214
|
+
)
|
|
215
|
+
] });
|
|
216
|
+
}
|
|
217
|
+
function ie({ review: e, locale: l }) {
|
|
218
|
+
var n, a, i, w;
|
|
219
|
+
const { t: r } = E(), c = B(), g = B(), [x, S] = _(!1), o = !!(e.breakdown && Object.values(e.breakdown).some((f) => f != null)), m = !!e.reply || o || !!e.futureVisit || !!e.recommendation, p = V(() => {
|
|
220
|
+
if (!e.authoredAt) return "";
|
|
221
|
+
try {
|
|
222
|
+
const f = new Date(e.authoredAt);
|
|
223
|
+
return Number.isNaN(f.getTime()) ? e.authoredAt : new Intl.DateTimeFormat(l, { dateStyle: "medium" }).format(
|
|
224
|
+
f
|
|
225
|
+
);
|
|
226
|
+
} catch {
|
|
227
|
+
return e.authoredAt;
|
|
228
|
+
}
|
|
229
|
+
}, [e.authoredAt, l]), h = e.pseudonym ?? r("reviewsPanel.anonymous"), y = /* @__PURE__ */ t(
|
|
230
|
+
W,
|
|
231
|
+
{
|
|
232
|
+
open: m ? x : !1,
|
|
233
|
+
onOpenChange: m ? S : void 0,
|
|
234
|
+
children: [
|
|
235
|
+
/* @__PURE__ */ t(T.Footer, { children: [
|
|
236
|
+
/* @__PURE__ */ s("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children: p }),
|
|
237
|
+
m ? /* @__PURE__ */ s(X, { asChild: !0, children: /* @__PURE__ */ t(
|
|
238
|
+
"button",
|
|
239
|
+
{
|
|
240
|
+
id: c,
|
|
241
|
+
type: "button",
|
|
242
|
+
"data-review-trigger": !0,
|
|
243
|
+
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(--primary)] 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]",
|
|
244
|
+
children: [
|
|
245
|
+
r(x ? "reviewsPanel.card.collapse" : "reviewsPanel.card.expand"),
|
|
246
|
+
/* @__PURE__ */ s(
|
|
247
|
+
se,
|
|
248
|
+
{
|
|
249
|
+
"aria-hidden": "true",
|
|
250
|
+
className: [
|
|
251
|
+
"ds:size-4 ds:transition-transform ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
252
|
+
x ? "ds:rotate-180" : ""
|
|
253
|
+
].filter(Boolean).join(" ")
|
|
254
|
+
}
|
|
255
|
+
)
|
|
256
|
+
]
|
|
257
|
+
}
|
|
258
|
+
) }) : null
|
|
259
|
+
] }),
|
|
260
|
+
m ? /* @__PURE__ */ s(Y, { id: g, "aria-labelledby": c, children: /* @__PURE__ */ t("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: [
|
|
261
|
+
o || e.futureVisit || e.recommendation ? /* @__PURE__ */ t(d, { layout: "inline", density: "compact", children: [
|
|
262
|
+
((n = e.breakdown) == null ? void 0 : n.appointmentScore) != null ? /* @__PURE__ */ t(d.Row, { children: [
|
|
263
|
+
/* @__PURE__ */ s(d.Term, { children: r("reviewsPanel.breakdown.appointment") }),
|
|
264
|
+
/* @__PURE__ */ s(d.Detail, { children: /* @__PURE__ */ s(
|
|
265
|
+
N,
|
|
266
|
+
{
|
|
267
|
+
value: e.breakdown.appointmentScore,
|
|
268
|
+
size: "sm"
|
|
269
|
+
}
|
|
270
|
+
) })
|
|
271
|
+
] }) : null,
|
|
272
|
+
((a = e.breakdown) == null ? void 0 : a.communicationScore) != null ? /* @__PURE__ */ t(d.Row, { children: [
|
|
273
|
+
/* @__PURE__ */ s(d.Term, { children: r("reviewsPanel.breakdown.communication") }),
|
|
274
|
+
/* @__PURE__ */ s(d.Detail, { children: /* @__PURE__ */ s(
|
|
275
|
+
N,
|
|
276
|
+
{
|
|
277
|
+
value: e.breakdown.communicationScore,
|
|
278
|
+
size: "sm"
|
|
279
|
+
}
|
|
280
|
+
) })
|
|
281
|
+
] }) : null,
|
|
282
|
+
((i = e.breakdown) == null ? void 0 : i.staffScore) != null ? /* @__PURE__ */ t(d.Row, { children: [
|
|
283
|
+
/* @__PURE__ */ s(d.Term, { children: r("reviewsPanel.breakdown.staff") }),
|
|
284
|
+
/* @__PURE__ */ s(d.Detail, { children: /* @__PURE__ */ s(N, { value: e.breakdown.staffScore, size: "sm" }) })
|
|
285
|
+
] }) : null,
|
|
286
|
+
((w = e.breakdown) == null ? void 0 : w.overallScore) != null ? /* @__PURE__ */ t(d.Row, { children: [
|
|
287
|
+
/* @__PURE__ */ s(d.Term, { children: r("reviewsPanel.breakdown.overall") }),
|
|
288
|
+
/* @__PURE__ */ s(d.Detail, { children: /* @__PURE__ */ s(N, { value: e.breakdown.overallScore, size: "sm" }) })
|
|
289
|
+
] }) : null,
|
|
290
|
+
e.futureVisit ? /* @__PURE__ */ t(d.Row, { children: [
|
|
291
|
+
/* @__PURE__ */ s(d.Term, { children: r("reviewsPanel.breakdown.futureVisit") }),
|
|
292
|
+
/* @__PURE__ */ s(d.Detail, { children: r(`reviewsPanel.answer.${e.futureVisit}`) })
|
|
293
|
+
] }) : null,
|
|
294
|
+
e.recommendation ? /* @__PURE__ */ t(d.Row, { children: [
|
|
295
|
+
/* @__PURE__ */ s(d.Term, { children: r("reviewsPanel.breakdown.recommendation") }),
|
|
296
|
+
/* @__PURE__ */ s(d.Detail, { children: r(`reviewsPanel.answer.${e.recommendation}`) })
|
|
297
|
+
] }) : null
|
|
298
|
+
] }) : null,
|
|
299
|
+
e.reply ? /* @__PURE__ */ t("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: [
|
|
300
|
+
/* @__PURE__ */ s("p", { className: "type-label ds:m-0 ds:mb-[var(--spacing-2xs)] ds:text-[var(--muted-foreground)] ds:font-[var(--font-weight-semibold)]", children: r("reviewsPanel.replyTitle") }),
|
|
301
|
+
/* @__PURE__ */ s("p", { className: "type-body-sm ds:m-0 ds:text-[var(--foreground)] ds:[white-space:pre-line]", children: e.reply })
|
|
302
|
+
] }) : null
|
|
303
|
+
] }) }) : null
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
);
|
|
307
|
+
return /* @__PURE__ */ t(T, { variant: "default", className: "ds:shadow-[var(--shadow-sm)]", children: [
|
|
308
|
+
/* @__PURE__ */ s(T.Header, { children: /* @__PURE__ */ t("div", { className: "ds:flex ds:items-start ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
|
|
309
|
+
/* @__PURE__ */ s("h4", { className: "type-title-item ds:m-0 ds:text-[var(--foreground)]", children: h }),
|
|
310
|
+
/* @__PURE__ */ s(N, { value: e.overallScore, size: "sm" })
|
|
311
|
+
] }) }),
|
|
312
|
+
e.comment ? /* @__PURE__ */ s(T.Body, { children: /* @__PURE__ */ s("p", { className: "type-body ds:m-0 ds:text-[var(--foreground)] ds:line-clamp-2", children: e.comment }) }) : null,
|
|
313
|
+
y
|
|
314
|
+
] });
|
|
315
|
+
}
|
|
316
|
+
function le({ hideFilter: e }) {
|
|
317
|
+
return /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
318
|
+
/* @__PURE__ */ t("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
|
|
319
|
+
/* @__PURE__ */ s(C, { variant: "text", width: "40%" }),
|
|
320
|
+
/* @__PURE__ */ s(C, { variant: "text", width: "20%" })
|
|
321
|
+
] }),
|
|
322
|
+
/* @__PURE__ */ t(
|
|
323
|
+
"div",
|
|
324
|
+
{
|
|
325
|
+
className: e ? "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]" : "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:md:grid-cols-[minmax(0,30%)_minmax(0,1fr)]",
|
|
326
|
+
children: [
|
|
327
|
+
e ? null : /* @__PURE__ */ s("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: Array.from({ length: 6 }, (l, r) => /* @__PURE__ */ s(C, { variant: "rounded", height: "2.5rem" }, `rp-fs-${r}`)) }),
|
|
328
|
+
/* @__PURE__ */ s("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: Array.from({ length: 3 }, (l, r) => /* @__PURE__ */ s(C, { variant: "rounded", height: "6rem" }, `rp-rs-${r}`)) })
|
|
329
|
+
]
|
|
330
|
+
}
|
|
331
|
+
)
|
|
332
|
+
] });
|
|
333
|
+
}
|
|
334
|
+
const j = K(
|
|
335
|
+
"ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-md)] ds:text-[var(--foreground)]"
|
|
336
|
+
), de = q(
|
|
337
|
+
({
|
|
338
|
+
reviews: e,
|
|
339
|
+
aggregate: l,
|
|
340
|
+
filter: r,
|
|
341
|
+
onFilterChange: c,
|
|
342
|
+
introSlot: g,
|
|
343
|
+
headerActionSlot: x,
|
|
344
|
+
"aria-label": S,
|
|
345
|
+
id: o,
|
|
346
|
+
className: m,
|
|
347
|
+
hideFilter: p = !1,
|
|
348
|
+
loading: h = !1,
|
|
349
|
+
...y
|
|
350
|
+
}, n) => {
|
|
351
|
+
const { t: a, i18n: i } = E(), w = i.language ?? "en", [f, R] = _("all"), u = r ?? f, k = L(
|
|
352
|
+
(v) => {
|
|
353
|
+
r === void 0 && R(v), c == null || c(v);
|
|
354
|
+
},
|
|
355
|
+
[r, c]
|
|
356
|
+
), P = V(
|
|
357
|
+
() => l.histogram ?? te(e),
|
|
358
|
+
[l.histogram, e]
|
|
359
|
+
), D = V(() => u === "all" ? e : e.filter((v) => $(v.overallScore) === u), [e, u]), H = F(u);
|
|
360
|
+
H.current = u;
|
|
361
|
+
const M = F(D.length);
|
|
362
|
+
M.current = D.length;
|
|
363
|
+
const U = V(
|
|
364
|
+
() => ({
|
|
365
|
+
getFilter: () => H.current,
|
|
366
|
+
setFilter: (v) => k(v),
|
|
367
|
+
getVisibleCount: () => M.current
|
|
368
|
+
}),
|
|
369
|
+
[k]
|
|
370
|
+
), A = F(null);
|
|
371
|
+
G(n, () => A.current, []), Q(ae, U, o);
|
|
372
|
+
const I = S ?? a("reviewsPanel.regionLabel"), z = String(u);
|
|
373
|
+
if (h)
|
|
374
|
+
return /* @__PURE__ */ s(
|
|
375
|
+
"section",
|
|
376
|
+
{
|
|
377
|
+
ref: A,
|
|
378
|
+
"aria-label": I,
|
|
379
|
+
"aria-busy": "true",
|
|
380
|
+
id: o,
|
|
381
|
+
"data-component": "reviews-panel",
|
|
382
|
+
"data-component-id": o,
|
|
383
|
+
"data-filter": z,
|
|
384
|
+
"data-state": "loading",
|
|
385
|
+
className: j({ className: m }),
|
|
386
|
+
...y,
|
|
387
|
+
children: /* @__PURE__ */ s(le, { hideFilter: p })
|
|
388
|
+
}
|
|
389
|
+
);
|
|
390
|
+
if (l.count === 0 && e.length === 0)
|
|
391
|
+
return /* @__PURE__ */ s(
|
|
392
|
+
"section",
|
|
393
|
+
{
|
|
394
|
+
ref: A,
|
|
395
|
+
"aria-label": I,
|
|
396
|
+
id: o,
|
|
397
|
+
"data-component": "reviews-panel",
|
|
398
|
+
"data-component-id": o,
|
|
399
|
+
"data-filter": z,
|
|
400
|
+
"data-state": "empty",
|
|
401
|
+
className: j({ className: m }),
|
|
402
|
+
...y,
|
|
403
|
+
children: /* @__PURE__ */ s(
|
|
404
|
+
Z,
|
|
405
|
+
{
|
|
406
|
+
variant: "no-results",
|
|
407
|
+
title: a("reviewsPanel.empty.title"),
|
|
408
|
+
description: a("reviewsPanel.empty.description")
|
|
409
|
+
}
|
|
410
|
+
)
|
|
411
|
+
}
|
|
412
|
+
);
|
|
413
|
+
const O = !p;
|
|
414
|
+
return /* @__PURE__ */ t(
|
|
415
|
+
"section",
|
|
416
|
+
{
|
|
417
|
+
ref: A,
|
|
418
|
+
"aria-label": I,
|
|
419
|
+
id: o,
|
|
420
|
+
"data-component": "reviews-panel",
|
|
421
|
+
"data-component-id": o,
|
|
422
|
+
"data-filter": z,
|
|
423
|
+
className: j({ className: m }),
|
|
424
|
+
...y,
|
|
425
|
+
children: [
|
|
426
|
+
/* @__PURE__ */ t("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
|
|
427
|
+
/* @__PURE__ */ s("h2", { className: "type-title-section ds:m-0 ds:text-[var(--foreground)]", children: a("reviewsPanel.title") }),
|
|
428
|
+
/* @__PURE__ */ t("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-md)]", children: [
|
|
429
|
+
x,
|
|
430
|
+
/* @__PURE__ */ s(
|
|
431
|
+
N,
|
|
432
|
+
{
|
|
433
|
+
value: l.averageScore,
|
|
434
|
+
reviews: { count: l.count },
|
|
435
|
+
size: "md"
|
|
436
|
+
}
|
|
437
|
+
)
|
|
438
|
+
] })
|
|
439
|
+
] }),
|
|
440
|
+
/* @__PURE__ */ t(
|
|
441
|
+
"div",
|
|
442
|
+
{
|
|
443
|
+
className: O ? "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:md:grid-cols-[minmax(0,30%)_minmax(0,1fr)]" : "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
444
|
+
children: [
|
|
445
|
+
O ? /* @__PURE__ */ s(
|
|
446
|
+
ne,
|
|
447
|
+
{
|
|
448
|
+
filter: u,
|
|
449
|
+
histogram: P,
|
|
450
|
+
totalCount: l.count,
|
|
451
|
+
onChange: k
|
|
452
|
+
}
|
|
453
|
+
) : null,
|
|
454
|
+
/* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:min-w-0", children: [
|
|
455
|
+
g ? (
|
|
456
|
+
// Plain div, not <aside>: axe's
|
|
457
|
+
// `landmark-complementary-is-top-level` rule fires when an
|
|
458
|
+
// `<aside>` lands inside another landmark (this panel's
|
|
459
|
+
// <section role="region">), and the consumer's introSlot
|
|
460
|
+
// already supplies its own semantics (e.g. an Alert with
|
|
461
|
+
// role="status").
|
|
462
|
+
/* @__PURE__ */ s("div", { className: "ds:rounded-[var(--radius-md)] ds:bg-[color-mix(in_srgb,var(--info)_8%,transparent)] ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]", children: g })
|
|
463
|
+
) : null,
|
|
464
|
+
D.length === 0 ? (
|
|
465
|
+
// `role="status"` already implies `aria-live="polite"` —
|
|
466
|
+
// declaring both would queue two announcements when the
|
|
467
|
+
// filter changes (the radio's aria-checked flip + this
|
|
468
|
+
// container's text). Keeping `role` only.
|
|
469
|
+
/* @__PURE__ */ t(
|
|
470
|
+
"div",
|
|
471
|
+
{
|
|
472
|
+
role: "status",
|
|
473
|
+
"data-state": "no-match",
|
|
474
|
+
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",
|
|
475
|
+
children: [
|
|
476
|
+
/* @__PURE__ */ s("p", { className: "type-body ds:m-0 ds:text-[var(--muted-foreground)]", children: u === "all" ? a("reviewsPanel.empty.title") : a("reviewsPanel.empty.filterDescription", {
|
|
477
|
+
stars: u
|
|
478
|
+
}) }),
|
|
479
|
+
u !== "all" ? /* @__PURE__ */ s(
|
|
480
|
+
ee,
|
|
481
|
+
{
|
|
482
|
+
intent: "secondary",
|
|
483
|
+
size: "sm",
|
|
484
|
+
onClick: () => k("all"),
|
|
485
|
+
children: a("reviewsPanel.empty.resetFilter")
|
|
486
|
+
}
|
|
487
|
+
) : null
|
|
488
|
+
]
|
|
489
|
+
}
|
|
490
|
+
)
|
|
491
|
+
) : /* @__PURE__ */ s(
|
|
492
|
+
"ol",
|
|
493
|
+
{
|
|
494
|
+
"aria-label": a("reviewsPanel.listLabel"),
|
|
495
|
+
className: "ds:list-none ds:m-0 ds:p-0 ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
496
|
+
children: D.map((v) => /* @__PURE__ */ s("li", { "data-review-id": v.id, children: /* @__PURE__ */ s(ie, { review: v, locale: w }) }, v.id))
|
|
497
|
+
}
|
|
498
|
+
)
|
|
499
|
+
] })
|
|
500
|
+
]
|
|
501
|
+
}
|
|
502
|
+
)
|
|
503
|
+
]
|
|
504
|
+
}
|
|
505
|
+
);
|
|
506
|
+
}
|
|
507
|
+
);
|
|
508
|
+
de.displayName = "ReviewsPanel";
|
|
509
|
+
export {
|
|
510
|
+
de as R,
|
|
511
|
+
ae as r
|
|
512
|
+
};
|
|
513
|
+
//# sourceMappingURL=reviews-panel-CFttsfuC.js.map
|