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