@alfadocs/ui-kit 0.51.0 → 0.52.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.
@@ -220,6 +220,7 @@ const M = n(
220
220
  );
221
221
  Z.displayName = "Logo";
222
222
  export {
223
+ d as A,
223
224
  Z as L
224
225
  };
225
- //# sourceMappingURL=logo-yituK7sE.js.map
226
+ //# sourceMappingURL=logo-1FuSGx0n.js.map
@@ -0,0 +1,513 @@
1
+ import { jsxs as r, jsx as a, Fragment as M } from "react/jsx-runtime";
2
+ import { forwardRef as b, useState as P } from "react";
3
+ import { useTranslation as T } from "react-i18next";
4
+ import { c as u } from "./index-D2ZczOXr.js";
5
+ import { A as E } from "./app-frame-BYx1gcV7.js";
6
+ import { A as C } from "./avatar-BNQNhoyL.js";
7
+ import { A as D } from "./alert-_mUKLmwA.js";
8
+ import { C as w } from "./card-DPmk26CL.js";
9
+ import { D as m } from "./dropdown-menu-DwwPovMZ.js";
10
+ import { T as F } from "./tab-bar-Xetknddo.js";
11
+ import { a as S, H as q, g as G, f as A, e as J, c as K, d as Q } from "./header-Ce1Br27u.js";
12
+ import { H as U } from "./header-settings-D5Z2B_Yz.js";
13
+ import { S as X } from "./sign-in-with-alfadocs-button-BpAjVmsI.js";
14
+ import { S as Y, a as Z, j as _, k as aa, i as ea, h as z } from "./sidebar-DPEHzxLZ.js";
15
+ import { T as sa } from "./theme-root-BOO73p5t.js";
16
+ import { a as ta } from "./tooltip-DvmfrNvB.js";
17
+ import { u as ra } from "./use-theme-CAuo6EYT.js";
18
+ import { A as na, L as da } from "./logo-1FuSGx0n.js";
19
+ import { A as ia } from "./Alfadocs_Logo_Mark-7o3L3WBI.js";
20
+ import { M as la } from "./maximize-2-Cm9OUQ2m.js";
21
+ import { L as oa } from "./log-out-616hnn2-.js";
22
+ const ca = u("ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]"), ma = u(
23
+ [
24
+ "ds:[font-family:var(--font-serif)]",
25
+ "ds:font-semibold",
26
+ "ds:leading-none",
27
+ "ds:tracking-[0.01em]",
28
+ "ds:whitespace-nowrap",
29
+ // Forced-colors: drop the transparent text-fill and paint the label
30
+ // as solid CanvasText so it never disappears under Windows HCM —
31
+ // a gradient/transparent fill has no meaning there.
32
+ "ds:forced-colors:text-[CanvasText]",
33
+ "ds:forced-colors:[-webkit-text-fill-color:CanvasText]"
34
+ ],
35
+ {
36
+ variants: {
37
+ size: {
38
+ sm: "ds:text-[calc(var(--logo-size-sm)*0.95)]",
39
+ md: "ds:text-[calc(var(--logo-size-md)*0.95)]",
40
+ lg: "ds:text-[calc(var(--logo-size-lg)*0.95)]",
41
+ xl: "ds:text-[calc(var(--logo-size-xl)*0.95)]"
42
+ },
43
+ tone: {
44
+ // Brand gradient filled into the glyphs via background-clip:text.
45
+ // `--gradient-wordmark` rides the theme aliases, so it stays
46
+ // AA-safe and adapts per theme on its own (and flattens to a solid
47
+ // ink in the accessible / forced-colors blocks — see tokens).
48
+ gradient: [
49
+ "ds:italic",
50
+ "ds:bg-[image:var(--gradient-wordmark)]",
51
+ "ds:bg-clip-text",
52
+ "ds:text-transparent",
53
+ "ds:[-webkit-text-fill-color:transparent]"
54
+ ],
55
+ // Monochrome: solid currentColor ink, upright, no gradient — for
56
+ // print, single-colour work, and coloured chrome (e.g. app-shell
57
+ // headers) where the lockup must ride the surrounding ink.
58
+ solid: "ds:text-current"
59
+ }
60
+ },
61
+ defaultVariants: { size: "md", tone: "gradient" }
62
+ }
63
+ ), pa = u("ds:whitespace-nowrap", {
64
+ variants: {
65
+ size: {
66
+ sm: "ds:[--lockup-unit:var(--logo-size-sm)]",
67
+ md: "ds:[--lockup-unit:var(--logo-size-md)]",
68
+ lg: "ds:[--lockup-unit:var(--logo-size-lg)]",
69
+ xl: "ds:[--lockup-unit:var(--logo-size-xl)]"
70
+ }
71
+ },
72
+ defaultVariants: { size: "md" }
73
+ }), g = b(
74
+ ({
75
+ name: s,
76
+ variant: n = "standard",
77
+ monochrome: e = !1,
78
+ tone: t = "auto",
79
+ size: d = "md",
80
+ className: l,
81
+ ...c
82
+ }, o) => {
83
+ if (n === "maker") {
84
+ const i = t === "inherit", p = i ? "" : e ? "ds:text-[color:var(--foreground)]" : "ds:text-[color:var(--primary)]", h = i ? "" : e ? "ds:text-[color:var(--foreground)]" : "ds:text-[color:var(--primary)]", f = i ? "" : "ds:text-[color:var(--muted-foreground)]", v = i ? "" : "ds:text-[color:var(--foreground)]";
85
+ return /* @__PURE__ */ r(
86
+ "span",
87
+ {
88
+ ref: o,
89
+ role: "img",
90
+ "aria-label": `${s} by Alfadocs`.trim(),
91
+ className: pa({ size: d, className: l }),
92
+ "data-component": "product-lockup",
93
+ ...c,
94
+ children: [
95
+ /* @__PURE__ */ a(
96
+ ia,
97
+ {
98
+ "aria-hidden": !0,
99
+ className: `ds:inline-block ds:align-middle ds:me-[var(--spacing-sm)] ds:h-[calc(var(--lockup-unit)*0.88)] ds:w-auto ds:forced-colors:text-[CanvasText] ${p}`
100
+ }
101
+ ),
102
+ /* @__PURE__ */ a(
103
+ "span",
104
+ {
105
+ "aria-hidden": !0,
106
+ className: `ds:align-middle ds:[font-family:var(--font-serif)] ds:font-semibold ds:italic ds:leading-none ds:tracking-[0.01em] ${h} ds:text-[calc(var(--lockup-unit)*0.95)]`,
107
+ children: s
108
+ }
109
+ ),
110
+ /* @__PURE__ */ r(
111
+ "span",
112
+ {
113
+ "aria-hidden": !0,
114
+ className: `ds:align-text-top ds:ms-[var(--spacing-sm)] ds:inline-flex ds:items-baseline ds:gap-[var(--spacing-2xs)] ${f}`,
115
+ children: [
116
+ /* @__PURE__ */ a("span", { className: "ds:text-[calc(var(--lockup-unit)*0.4)] ds:leading-none", children: "by" }),
117
+ /* @__PURE__ */ a(
118
+ na,
119
+ {
120
+ "aria-hidden": !0,
121
+ viewBox: "168 0 637 125",
122
+ className: `ds:h-[calc(var(--lockup-unit)*0.45)] ds:w-auto ds:forced-colors:text-[CanvasText] ${v}`
123
+ }
124
+ )
125
+ ]
126
+ }
127
+ )
128
+ ]
129
+ }
130
+ );
131
+ }
132
+ return /* @__PURE__ */ r(
133
+ "span",
134
+ {
135
+ ref: o,
136
+ role: "img",
137
+ "aria-label": `Alfadocs ${s}`.trim(),
138
+ className: ca({ className: l }),
139
+ "data-component": "product-lockup",
140
+ ...c,
141
+ children: [
142
+ /* @__PURE__ */ a(
143
+ da,
144
+ {
145
+ variant: e ? "monochrome" : "wordmark",
146
+ tone: t,
147
+ size: d,
148
+ decorative: !0
149
+ }
150
+ ),
151
+ /* @__PURE__ */ a(
152
+ "span",
153
+ {
154
+ "aria-hidden": !0,
155
+ className: ma({
156
+ size: d,
157
+ tone: e ? "solid" : "gradient"
158
+ }),
159
+ children: s
160
+ }
161
+ )
162
+ ]
163
+ }
164
+ );
165
+ }
166
+ );
167
+ g.displayName = "ProductLockup";
168
+ function ua(s) {
169
+ return s > 99 ? "99+" : String(s);
170
+ }
171
+ function fa({
172
+ user: s,
173
+ labels: n,
174
+ onSignOut: e,
175
+ onToggleFullscreen: t
176
+ }) {
177
+ const { t: d } = T(), l = n.fullscreen ?? d("patientShell.settings.fullscreen");
178
+ return (
179
+ // Non-modal: an account menu shouldn't inert/aria-hide the whole shell
180
+ // behind it (which leaves the still-focusable chrome inside an
181
+ // aria-hidden region — an `aria-hidden-focus` violation).
182
+ /* @__PURE__ */ r(m.Root, { modal: !1, children: [
183
+ /* @__PURE__ */ a(m.Trigger, { asChild: !0, children: /* @__PURE__ */ a(
184
+ "button",
185
+ {
186
+ type: "button",
187
+ "aria-label": n.accountMenu,
188
+ "data-testid": "marketplace-account-trigger",
189
+ className: "ds:inline-flex ds:items-center ds:justify-center ds:shrink-0 ds:size-10 ds:rounded-[var(--radius-full)] 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]",
190
+ children: /* @__PURE__ */ a("span", { "aria-hidden": "true", children: /* @__PURE__ */ a(C, { name: s.name, src: s.avatarSrc, size: "md" }) })
191
+ }
192
+ ) }),
193
+ /* @__PURE__ */ r(m.Content, { align: "end", collisionPadding: 16, children: [
194
+ /* @__PURE__ */ a(m.Label, { children: /* @__PURE__ */ r("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
195
+ /* @__PURE__ */ a("span", { "aria-hidden": "true", children: /* @__PURE__ */ a(C, { name: s.name, src: s.avatarSrc, size: "sm" }) }),
196
+ /* @__PURE__ */ r("span", { className: "ds:flex ds:flex-col ds:min-w-0", children: [
197
+ /* @__PURE__ */ a("span", { className: "type-label ds:text-[color:var(--foreground)] ds:truncate", children: s.name }),
198
+ s.email ? /* @__PURE__ */ a("span", { className: "type-meta ds:truncate", children: s.email }) : null
199
+ ] })
200
+ ] }) }),
201
+ t ? /* @__PURE__ */ r(M, { children: [
202
+ /* @__PURE__ */ a(m.Separator, {}),
203
+ /* @__PURE__ */ a(
204
+ m.Item,
205
+ {
206
+ startIcon: /* @__PURE__ */ a(la, { "aria-hidden": !0 }),
207
+ onSelect: t,
208
+ "data-testid": "marketplace-fullscreen",
209
+ children: l
210
+ }
211
+ )
212
+ ] }) : null,
213
+ /* @__PURE__ */ a(m.Separator, {}),
214
+ /* @__PURE__ */ a(
215
+ m.Item,
216
+ {
217
+ startIcon: /* @__PURE__ */ a(oa, { "aria-hidden": !0 }),
218
+ onSelect: e,
219
+ "data-testid": "marketplace-sign-out",
220
+ children: n.signOut
221
+ }
222
+ )
223
+ ] })
224
+ ] })
225
+ );
226
+ }
227
+ function ha({
228
+ nav: s,
229
+ renderLink: n
230
+ }) {
231
+ return /* @__PURE__ */ a(Z, { children: s.map((e) => {
232
+ const t = typeof e.badgeCount == "number" && e.badgeCount > 0 ? e.badgeCount : void 0, d = /* @__PURE__ */ r(M, { children: [
233
+ e.icon ? /* @__PURE__ */ a(_, { children: e.icon }) : null,
234
+ /* @__PURE__ */ a(aa, { children: e.label }),
235
+ t !== void 0 ? /* @__PURE__ */ a(ea, { children: ua(t) }) : null
236
+ ] });
237
+ return n ? /* @__PURE__ */ a(z, { asChild: !0, isActive: e.isActive, children: n({
238
+ href: e.href,
239
+ children: d,
240
+ "aria-current": e.isActive ? "page" : void 0
241
+ }) }, e.id) : /* @__PURE__ */ a(
242
+ z,
243
+ {
244
+ href: e.href,
245
+ "aria-label": e.label,
246
+ isActive: e.isActive,
247
+ ...e.onClick ? { onClick: e.onClick } : {},
248
+ children: d
249
+ },
250
+ e.id
251
+ );
252
+ }) });
253
+ }
254
+ const I = u("ds:bg-[color:var(--app-shell-background)]", {
255
+ variants: {
256
+ variant: {
257
+ standalone: "",
258
+ embedded: [
259
+ "ds:flex-1",
260
+ "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
261
+ "ds:pt-[var(--spacing-lg)] ds:pb-[var(--spacing-md)]"
262
+ ].join(" ")
263
+ }
264
+ },
265
+ defaultVariants: { variant: "standalone" }
266
+ });
267
+ function ga({
268
+ nav: s,
269
+ ariaLabel: n,
270
+ renderLink: e
271
+ }) {
272
+ const t = e ? ({
273
+ href: d,
274
+ className: l,
275
+ children: c,
276
+ "aria-current": o
277
+ }) => e({ href: d, className: l, children: c, "aria-current": o }) : void 0;
278
+ return /* @__PURE__ */ a(
279
+ F,
280
+ {
281
+ items: s,
282
+ ariaLabel: n,
283
+ ...t ? { renderLink: t } : {}
284
+ }
285
+ );
286
+ }
287
+ const va = b(
288
+ ({
289
+ productName: s,
290
+ productHref: n = "/",
291
+ nav: e,
292
+ renderLink: t,
293
+ user: d,
294
+ labels: l,
295
+ onSignOut: c,
296
+ onToggleFullscreen: o,
297
+ sidebarState: i,
298
+ mainAriaLabel: p,
299
+ variant: h = "standalone",
300
+ children: f
301
+ }, v) => {
302
+ const { t: x } = T(), B = t ? /* @__PURE__ */ a(S, { asChild: !0, children: t({
303
+ href: n,
304
+ children: /* @__PURE__ */ a(
305
+ g,
306
+ {
307
+ name: s,
308
+ size: "md",
309
+ monochrome: !0,
310
+ variant: "maker"
311
+ }
312
+ )
313
+ }) }) : /* @__PURE__ */ a(
314
+ S,
315
+ {
316
+ href: n,
317
+ logo: /* @__PURE__ */ a(
318
+ g,
319
+ {
320
+ name: s,
321
+ size: "md",
322
+ monochrome: !0,
323
+ variant: "maker"
324
+ }
325
+ )
326
+ }
327
+ ), { theme: L, accessibility: V, resolvedTheme: k } = ra(), H = L !== "system" || V !== "system", $ = k.startsWith("dark") ? "dark" : "light", j = k.endsWith("-accessible"), [O, y] = P(!1), R = /* @__PURE__ */ a(ta, { children: /* @__PURE__ */ a(
328
+ E,
329
+ {
330
+ mainAriaLabel: p,
331
+ mainClassName: I({ variant: "standalone" }),
332
+ header: /* @__PURE__ */ r(q, { children: [
333
+ /* @__PURE__ */ r(G, { children: [
334
+ /* @__PURE__ */ a(A, { href: "#main-content" }),
335
+ /* @__PURE__ */ a(J, { onMenuOpen: () => y(!0) }),
336
+ B
337
+ ] }),
338
+ /* @__PURE__ */ a(K, {}),
339
+ /* @__PURE__ */ r(Q, { children: [
340
+ /* @__PURE__ */ a(U, { size: "sm" }),
341
+ /* @__PURE__ */ a(
342
+ fa,
343
+ {
344
+ user: d,
345
+ labels: l,
346
+ onSignOut: c,
347
+ onToggleFullscreen: o
348
+ }
349
+ )
350
+ ] })
351
+ ] }),
352
+ sidebar: /* @__PURE__ */ a(
353
+ Y,
354
+ {
355
+ ...i !== void 0 ? { state: i } : { defaultState: "expanded" },
356
+ open: O,
357
+ onOpenChange: y,
358
+ "aria-label": x("navigation.sidebar.label"),
359
+ "data-testid": "marketplace-app-shell-sidebar",
360
+ children: /* @__PURE__ */ a(ha, { nav: e, renderLink: t })
361
+ }
362
+ ),
363
+ children: f
364
+ }
365
+ ) }), W = (
366
+ // The shell owns the warm-grey canvas; TabBar's strip is transparent and
367
+ // floats its pill on it, and `<main>` continues the same surface.
368
+ /* @__PURE__ */ r("div", { className: "ds:flex ds:min-h-dvh ds:flex-col ds:bg-[color:var(--app-shell-background)]", children: [
369
+ /* @__PURE__ */ a(A, { href: "#main-content" }),
370
+ /* @__PURE__ */ a(
371
+ ga,
372
+ {
373
+ nav: e,
374
+ ariaLabel: x("navigation.sidebar.label"),
375
+ renderLink: t
376
+ }
377
+ ),
378
+ /* @__PURE__ */ a(
379
+ "main",
380
+ {
381
+ id: "main-content",
382
+ tabIndex: -1,
383
+ "aria-label": p ?? x("navigation.main.label", "Main content"),
384
+ className: I({ variant: "embedded" }),
385
+ children: f
386
+ }
387
+ )
388
+ ] })
389
+ ), N = h === "embedded" ? W : R;
390
+ return H ? /* @__PURE__ */ a(
391
+ sa,
392
+ {
393
+ ref: v,
394
+ theme: $,
395
+ accessible: j,
396
+ className: "ds:contents",
397
+ "data-component": "marketplace-app-shell",
398
+ children: N
399
+ }
400
+ ) : /* @__PURE__ */ a(
401
+ "div",
402
+ {
403
+ ref: v,
404
+ className: "ds:contents",
405
+ "data-component": "marketplace-app-shell",
406
+ children: N
407
+ }
408
+ );
409
+ }
410
+ );
411
+ va.displayName = "MarketplaceAppShell";
412
+ const xa = u(
413
+ "ds:flex ds:min-h-dvh ds:bg-[color:var(--app-shell-background)]",
414
+ {
415
+ variants: {
416
+ layout: {
417
+ card: "",
418
+ split: "ds:flex-col ds:lg:flex-row"
419
+ }
420
+ },
421
+ defaultVariants: { layout: "card" }
422
+ }
423
+ ), ba = u("ds:w-full", {
424
+ variants: {
425
+ layout: {
426
+ card: "ds:max-w-[400px]",
427
+ split: "ds:max-w-[400px] ds:lg:max-w-[480px]"
428
+ }
429
+ },
430
+ defaultVariants: { layout: "card" }
431
+ }), ka = u("", {
432
+ variants: {
433
+ layout: { card: "", split: "ds:lg:hidden" }
434
+ },
435
+ defaultVariants: { layout: "card" }
436
+ }), ya = b(
437
+ ({
438
+ productName: s,
439
+ title: n,
440
+ description: e,
441
+ connectLabel: t,
442
+ status: d = "idle",
443
+ error: l,
444
+ onConnect: c,
445
+ footer: o,
446
+ layout: i = "card",
447
+ brandPanel: p,
448
+ className: h
449
+ }, f) => /* @__PURE__ */ r(
450
+ "div",
451
+ {
452
+ ref: f,
453
+ "data-component": "connect-with-alfadocs",
454
+ className: `${xa({ layout: i })} ${h ?? ""}`,
455
+ children: [
456
+ i === "split" ? (
457
+ // Desktop brand panel (lg+ only): a bold `--primary` surface with the
458
+ // monochrome lockup riding the `--primary-foreground` ink, plus an
459
+ // optional `brandPanel` slot. Decorative — the card carries the real
460
+ // heading + CTA, and shows its own lockup below `lg:`.
461
+ /* @__PURE__ */ r("div", { className: "ds:hidden ds:lg:flex ds:lg:w-[55%] ds:flex-col ds:items-center ds:justify-center ds:gap-[var(--spacing-lg)] ds:bg-[color:var(--primary)] ds:text-[color:var(--primary-foreground)] ds:ps-[var(--spacing-2xl)] ds:pe-[var(--spacing-2xl)] ds:pt-[var(--spacing-2xl)] ds:pb-[var(--spacing-2xl)] ds:text-start", children: [
462
+ /* @__PURE__ */ a(
463
+ g,
464
+ {
465
+ name: s,
466
+ size: "lg",
467
+ monochrome: !0,
468
+ tone: "inherit",
469
+ variant: "maker"
470
+ }
471
+ ),
472
+ p ? /* @__PURE__ */ a("div", { className: "type-body ds:max-w-[28rem] ds:text-start", children: p }) : null
473
+ ] })
474
+ ) : null,
475
+ /* @__PURE__ */ a("div", { className: "ds:flex ds:flex-1 ds:items-center ds:justify-center ds:p-[var(--spacing-lg)]", children: /* @__PURE__ */ a(w, { className: ba({ layout: i }), children: /* @__PURE__ */ r(w.Body, { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-lg)] ds:text-center", children: [
476
+ /* @__PURE__ */ a(
477
+ g,
478
+ {
479
+ name: s,
480
+ size: "lg",
481
+ variant: "maker",
482
+ className: ka({ layout: i })
483
+ }
484
+ ),
485
+ /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
486
+ /* @__PURE__ */ a("h1", { className: "type-title-card", children: n }),
487
+ /* @__PURE__ */ a("p", { className: "type-body-sm ds:text-[color:var(--muted-foreground)]", children: e })
488
+ ] }),
489
+ d === "error" && l ? /* @__PURE__ */ a(D, { variant: "error", className: "ds:w-full ds:text-start", children: l }) : null,
490
+ /* @__PURE__ */ a(
491
+ X,
492
+ {
493
+ intent: "primary",
494
+ className: "ds:w-full",
495
+ loading: d === "connecting",
496
+ onClick: c,
497
+ label: t,
498
+ "data-testid": "connect-with-alfadocs-button"
499
+ }
500
+ ),
501
+ o ? /* @__PURE__ */ a("div", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: o }) : null
502
+ ] }) }) })
503
+ ]
504
+ }
505
+ )
506
+ );
507
+ ya.displayName = "ConnectWithAlfadocs";
508
+ export {
509
+ ya as C,
510
+ va as M,
511
+ g as P
512
+ };
513
+ //# sourceMappingURL=marketplace-app-shell-C4OYAC22.js.map
@@ -0,0 +1,17 @@
1
+ import { c as t } from "./createLucideIcon-CrFbzy84.js";
2
+ /**
3
+ * @license lucide-react v1.8.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */
8
+ const a = [
9
+ ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
10
+ ["path", { d: "m21 3-7 7", key: "1l2asr" }],
11
+ ["path", { d: "m3 21 7-7", key: "tjx5ai" }],
12
+ ["path", { d: "M9 21H3v-6", key: "wtvkvv" }]
13
+ ], i = t("maximize-2", a);
14
+ export {
15
+ i as M
16
+ };
17
+ //# sourceMappingURL=maximize-2-Cm9OUQ2m.js.map
@@ -0,0 +1,162 @@
1
+ import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
+ import { forwardRef as w, useState as C } from "react";
3
+ import { useTranslation as m } from "react-i18next";
4
+ import { A as y } from "./app-frame-BYx1gcV7.js";
5
+ import { I as H } from "./icon-button-CKEOrN37.js";
6
+ import { D as n } from "./dropdown-menu-DwwPovMZ.js";
7
+ import { H as B, g as N, f as T, e as k, a as x, c as M, d as O } from "./header-Ce1Br27u.js";
8
+ import { L as P } from "./logo-1FuSGx0n.js";
9
+ import { S as W, a as R, h as j, j as z, k as D, i as E } from "./sidebar-DPEHzxLZ.js";
10
+ import { T as _ } from "./theme-root-BOO73p5t.js";
11
+ import { a as F } from "./tooltip-DvmfrNvB.js";
12
+ import { u as U } from "./use-theme-CAuo6EYT.js";
13
+ import { S as q } from "./settings-ca2Yi9R8.js";
14
+ import { M as G } from "./maximize-2-Cm9OUQ2m.js";
15
+ import { L as J } from "./log-out-616hnn2-.js";
16
+ function K(r) {
17
+ return r > 99 ? "99+" : String(r);
18
+ }
19
+ function Q(r) {
20
+ if (r.startsWith("/") || r.startsWith("#") || r.startsWith("?"))
21
+ return !0;
22
+ try {
23
+ const t = new URL(r, window.location.origin);
24
+ return t.protocol === "http:" || t.protocol === "https:";
25
+ } catch {
26
+ return !1;
27
+ }
28
+ }
29
+ function V({
30
+ logoutHref: r,
31
+ onToggleFullscreen: t
32
+ }) {
33
+ const { t: a } = m();
34
+ return /* @__PURE__ */ i(n.Root, { children: [
35
+ /* @__PURE__ */ e(n.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
36
+ H,
37
+ {
38
+ icon: /* @__PURE__ */ e(q, { "aria-hidden": "true" }),
39
+ "aria-label": a("patientShell.settings.triggerAria"),
40
+ tooltip: a("patientShell.settings.triggerAria"),
41
+ "data-testid": "patient-shell-settings-trigger"
42
+ }
43
+ ) }),
44
+ /* @__PURE__ */ i(n.Content, { align: "end", children: [
45
+ /* @__PURE__ */ e(
46
+ n.Item,
47
+ {
48
+ startIcon: /* @__PURE__ */ e(G, { "aria-hidden": "true" }),
49
+ onSelect: t,
50
+ "data-testid": "patient-shell-fullscreen",
51
+ children: a("patientShell.settings.fullscreen")
52
+ }
53
+ ),
54
+ /* @__PURE__ */ e(n.Separator, {}),
55
+ /* @__PURE__ */ e(
56
+ n.Item,
57
+ {
58
+ startIcon: /* @__PURE__ */ e(J, { "aria-hidden": "true" }),
59
+ onSelect: () => {
60
+ typeof window > "u" || Q(r) && window.location.assign(r);
61
+ },
62
+ "data-testid": "patient-shell-logout",
63
+ children: a("patientShell.settings.logout")
64
+ }
65
+ )
66
+ ] })
67
+ ] });
68
+ }
69
+ function X({ menuItems: r }) {
70
+ return /* @__PURE__ */ e(R, { children: r.map((t) => {
71
+ const a = typeof t.badgeCount == "number" && t.badgeCount > 0 ? t.badgeCount : void 0;
72
+ return /* @__PURE__ */ i(
73
+ j,
74
+ {
75
+ href: t.href,
76
+ "aria-label": t.label,
77
+ isActive: t.isActive,
78
+ children: [
79
+ t.icon ? /* @__PURE__ */ e(z, { children: t.icon }) : null,
80
+ /* @__PURE__ */ e(D, { children: t.label }),
81
+ a !== void 0 ? /* @__PURE__ */ e(E, { children: K(a) }) : null
82
+ ]
83
+ },
84
+ t.id
85
+ );
86
+ }) });
87
+ }
88
+ const Y = w(
89
+ ({
90
+ menuItems: r,
91
+ logoutHref: t,
92
+ onToggleFullscreen: a,
93
+ brandLogo: p,
94
+ brandHref: u = "/",
95
+ mainAriaLabel: f,
96
+ sidebarState: o,
97
+ children: g,
98
+ // `userName` and `userAvatarSrc` are declared on the public API
99
+ // for forward-compatibility (future profile-pill work) — they are
100
+ // intentionally unused today because the legacy patient chrome
101
+ // carries no profile pill.
102
+ userName: Z,
103
+ userAvatarSrc: $
104
+ }, s) => {
105
+ const { t: l } = m(), { theme: b, accessibility: S, resolvedTheme: d } = U(), v = b !== "system" || S !== "system", I = d.startsWith("dark") ? "dark" : "light", L = d.endsWith("-accessible"), [A, c] = C(!1), h = /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(
106
+ y,
107
+ {
108
+ mainAriaLabel: f,
109
+ mainClassName: "ds:bg-[color:var(--app-shell-background)]",
110
+ header: /* @__PURE__ */ i(B, { children: [
111
+ /* @__PURE__ */ i(N, { children: [
112
+ /* @__PURE__ */ e(T, { href: "#main-content" }),
113
+ /* @__PURE__ */ e(k, { onMenuOpen: () => c(!0) }),
114
+ /* @__PURE__ */ e(
115
+ x,
116
+ {
117
+ logo: p ?? /* @__PURE__ */ e(P, { variant: "monochrome", size: "md", decorative: !0 }),
118
+ href: u,
119
+ "aria-label": l("patientShell.brand.homeAria")
120
+ }
121
+ )
122
+ ] }),
123
+ /* @__PURE__ */ e(M, {}),
124
+ /* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(
125
+ V,
126
+ {
127
+ logoutHref: t,
128
+ onToggleFullscreen: a
129
+ }
130
+ ) })
131
+ ] }),
132
+ sidebar: /* @__PURE__ */ e(
133
+ W,
134
+ {
135
+ ...o !== void 0 ? { state: o } : { defaultState: "expanded" },
136
+ open: A,
137
+ onOpenChange: c,
138
+ "aria-label": l("patientShell.sidebar.panelLabel"),
139
+ "data-testid": "patient-shell-sidebar",
140
+ children: /* @__PURE__ */ e(X, { menuItems: r })
141
+ }
142
+ ),
143
+ children: g
144
+ }
145
+ ) });
146
+ return v ? /* @__PURE__ */ e(
147
+ _,
148
+ {
149
+ ref: s,
150
+ theme: I,
151
+ accessible: L,
152
+ className: "ds:contents",
153
+ children: h
154
+ }
155
+ ) : /* @__PURE__ */ e("div", { ref: s, className: "ds:contents", children: h });
156
+ }
157
+ );
158
+ Y.displayName = "PatientShell";
159
+ export {
160
+ Y as P
161
+ };
162
+ //# sourceMappingURL=patient-shell-Coarf346.js.map