@alfadocs/ui-kit 0.46.0 → 0.48.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/{agenda-card-CFyWSX7Z.js → agenda-card-BaSfVfrL.js} +25 -29
- package/dist/_chunks/{agenda-tray-Dyj9ChHC.js → agenda-tray-DQayYmQ0.js} +50 -67
- package/dist/_chunks/ai-consent-banner-DO5ingMq.js +169 -0
- package/dist/_chunks/ai-tools-rail-CxYG04cw.js +280 -0
- package/dist/_chunks/alia-sidebar-DlvyXgVC.js +1126 -0
- package/dist/_chunks/anamnesis-card-CmkBVAln.js +156 -0
- package/dist/_chunks/appointment-tray-BwDHhWWC.js +419 -0
- package/dist/_chunks/{audio-recorder-C1rhKhSN.js → audio-recorder-DC-v9YFW.js} +81 -91
- package/dist/_chunks/{bmi-calculator-CQqXTVNL.js → bmi-calculator-DdylQzT6.js} +2 -2
- package/dist/_chunks/{booking-DlDVuWMd.js → booking-WV2GSru5.js} +291 -303
- package/dist/_chunks/{calculator-dialog-D-nfvteH.js → calculator-dialog-CFk4I91b.js} +2 -2
- package/dist/_chunks/calendar-days-C4BmpCZg.js +23 -0
- package/dist/_chunks/{calendar-YHFknAGv.js → calendar-oYWOCrnf.js} +195 -210
- package/dist/_chunks/care-plan-card-QmNpGggC.js +252 -0
- package/dist/_chunks/care-plan-entry-card-Cnra7vUc.js +318 -0
- package/dist/_chunks/{chat-input-CQe7nR_v.js → chat-input-CFwc7JxL.js} +2 -1
- package/dist/_chunks/{chat-message-ASgGtj-L.js → chat-message-Dm8U2RY1.js} +81 -74
- package/dist/_chunks/clinical-note-card-BYo437dU.js +333 -0
- package/dist/_chunks/code-block-HoddNOKJ.js +106 -0
- package/dist/_chunks/{contact-profile-card-DHyuAPXM.js → contact-profile-card-DvvVfAA2.js} +102 -115
- package/dist/_chunks/{cycle-calculator-KxA8dqDf.js → cycle-calculator-DYvGm_m1.js} +2 -2
- package/dist/_chunks/{dialog-BTpZV6It.js → dialog-DMGnSelc.js} +55 -55
- package/dist/_chunks/download-CDF1sbL9.js +16 -0
- package/dist/_chunks/{due-date-calculator-mFxpHLml.js → due-date-calculator-BXd3ANj7.js} +2 -2
- package/dist/_chunks/{editable-currency-cell-renderer-BEBUQl9P.js → editable-currency-cell-renderer-CLil9B29.js} +283 -293
- package/dist/_chunks/entity-card-COhmqHly.js +69 -0
- package/dist/_chunks/{gestational-age-calculator-gWI_uRA1.js → gestational-age-calculator-Crj6FgZw.js} +2 -2
- package/dist/_chunks/{insert-result-C5ABnzDl.js → insert-result-DNdi_JYW.js} +140 -168
- package/dist/_chunks/is-safe-url-DkETxeHz.js +7 -0
- package/dist/_chunks/languages-DsVf_WzT.js +19 -0
- package/dist/_chunks/layers-pzGcbLPj.js +34 -0
- package/dist/_chunks/{message-card-DSPw5ghw.js → message-card-Dvl1TgaN.js} +15 -19
- package/dist/_chunks/{message-tray-hSQff9u4.js → message-tray-Dl6GQaaV.js} +2 -2
- package/dist/_chunks/mic-B4Gog3Gi.js +16 -0
- package/dist/_chunks/operator-hero-CM8949Hd.js +198 -0
- package/dist/_chunks/patient-summary-card-BnTqxcTr.js +443 -0
- package/dist/_chunks/payment-request-card-B_lyobd0.js +478 -0
- package/dist/_chunks/{pdf-viewer-CWEXTlwq.js → pdf-viewer-G8SU6Azw.js} +3 -3
- package/dist/_chunks/pencil-CfQX-0Qc.js +21 -0
- package/dist/_chunks/periodontal-chart-card-BYs9hax1.js +455 -0
- package/dist/_chunks/phone-Bi5yUm4I.js +20 -0
- package/dist/_chunks/{practice-results-DDi-kvaD.js → practice-results-BFL_mcDW.js} +3 -2
- package/dist/_chunks/{pregnancy-weight-gain-BtEHaSqy.js → pregnancy-weight-gain-C7dK89jE.js} +2 -2
- package/dist/_chunks/scan-line-lGioFwLC.js +18 -0
- package/dist/_chunks/shield-check-BjCGH_Sr.js +21 -0
- package/dist/_chunks/{sign-document-BCyLpFHJ.js → sign-document-DPI2pY9V.js} +2 -2
- package/dist/_chunks/{streaming-text-GH07yIYh.js → streaming-text-CfhDqtIT.js} +49 -45
- package/dist/_chunks/{transaction-chip-B8ujzowA.js → transaction-chip-BZCa6XDn.js} +8 -6
- package/dist/_chunks/{unit-converter-u3CwNDpP.js → unit-converter-jWp3Z85y.js} +2 -2
- package/dist/_chunks/user-cog-BS_qc8nA.js +24 -0
- package/dist/_chunks/video-BAeICxCT.js +21 -0
- package/dist/_chunks/{workflow-map-BFNpzTiw.js → workflow-map-ZXw-zsZ8.js} +186 -219
- package/dist/agent-catalog.json +324 -1
- package/dist/components/_shared/code-block.d.ts +39 -0
- package/dist/components/_shared/entity-card/entity-card.d.ts +40 -0
- package/dist/components/_shared/entity-card/index.d.ts +3 -0
- package/dist/components/_shared/index.d.ts +2 -0
- package/dist/components/_shared/is-safe-url.d.ts +13 -0
- package/dist/components/agenda-card/agenda-card.d.ts +1 -2
- package/dist/components/agenda-card/index.d.ts +2 -1
- package/dist/components/agenda-card/index.js +6 -5
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/ai-consent-banner/ai-consent-banner.agent.d.ts +4 -0
- package/dist/components/ai-consent-banner/ai-consent-banner.d.ts +45 -0
- package/dist/components/ai-consent-banner/index.d.ts +4 -0
- package/dist/components/ai-consent-banner/index.js +6 -0
- package/dist/components/ai-tools-rail/ai-tools-rail.agent.d.ts +4 -0
- package/dist/components/ai-tools-rail/ai-tools-rail.d.ts +60 -0
- package/dist/components/ai-tools-rail/index.d.ts +4 -0
- package/dist/components/ai-tools-rail/index.js +6 -0
- package/dist/components/anamnesis-card/anamnesis-card.d.ts +68 -0
- package/dist/components/anamnesis-card/index.d.ts +3 -0
- package/dist/components/anamnesis-card/index.js +5 -0
- package/dist/components/appointment-card/appointment-card.agent.d.ts +3 -0
- package/dist/components/appointment-card/appointment-card.d.ts +93 -0
- package/dist/components/appointment-card/appointment-tray.agent.d.ts +4 -0
- package/dist/components/appointment-card/appointment-tray.d.ts +48 -0
- package/dist/components/appointment-card/index.d.ts +8 -0
- package/dist/components/appointment-card/index.js +10 -0
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/calculator-dialog/index.js +1 -1
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/card/card.d.ts +1 -1
- package/dist/components/care-plan-card/care-plan-card.agent.d.ts +4 -0
- package/dist/components/care-plan-card/care-plan-card.d.ts +102 -0
- package/dist/components/care-plan-card/index.d.ts +4 -0
- package/dist/components/care-plan-card/index.js +6 -0
- package/dist/components/care-plan-entry-card/care-plan-entry-card.agent.d.ts +4 -0
- package/dist/components/care-plan-entry-card/care-plan-entry-card.d.ts +110 -0
- package/dist/components/care-plan-entry-card/index.d.ts +4 -0
- package/dist/components/care-plan-entry-card/index.js +6 -0
- package/dist/components/chat-input/index.js +1 -1
- package/dist/components/chat-message/chat-message.d.ts +13 -0
- package/dist/components/chat-message/index.js +1 -1
- package/dist/components/clinical-note-card/clinical-note-card.agent.d.ts +4 -0
- package/dist/components/clinical-note-card/clinical-note-card.d.ts +98 -0
- package/dist/components/clinical-note-card/index.d.ts +4 -0
- package/dist/components/clinical-note-card/index.js +6 -0
- package/dist/components/contact-profile-card/index.js +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/dialog/dialog.d.ts +7 -0
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/due-date-calculator/index.js +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/index.d.ts +10 -0
- package/dist/components/message-card/index.js +5 -4
- package/dist/components/message-card/message-card.d.ts +1 -2
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/operator-hero/index.js +1 -1
- package/dist/components/operator-hero/operator-hero.d.ts +9 -0
- package/dist/components/patient-summary-card/index.d.ts +4 -0
- package/dist/components/patient-summary-card/index.js +6 -0
- package/dist/components/patient-summary-card/patient-summary-card.agent.d.ts +4 -0
- package/dist/components/patient-summary-card/patient-summary-card.d.ts +120 -0
- package/dist/components/payment-card/index.d.ts +7 -0
- package/dist/components/payment-card/index.js +8 -0
- package/dist/components/payment-card/payment-card.agent.d.ts +4 -0
- package/dist/components/payment-card/payment-card.d.ts +71 -0
- package/dist/components/payment-card/payment-request-card.agent.d.ts +4 -0
- package/dist/components/payment-card/payment-request-card.d.ts +43 -0
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/periodontal-chart-card/index.d.ts +4 -0
- package/dist/components/periodontal-chart-card/index.js +7 -0
- package/dist/components/periodontal-chart-card/periodontal-chart-card.agent.d.ts +4 -0
- package/dist/components/periodontal-chart-card/periodontal-chart-card.d.ts +74 -0
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/index.js +1 -1
- package/dist/components/public-header/public-header.d.ts +1 -1
- package/dist/components/sign-document/index.js +1 -1
- package/dist/components/stat/stat.d.ts +1 -1
- package/dist/components/streaming-text/index.js +1 -1
- package/dist/components/transaction-chip/index.js +1 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +366 -0
- package/dist/i18n/locales/ar.js +367 -1
- package/dist/i18n/locales/de.d.ts +366 -0
- package/dist/i18n/locales/de.js +367 -1
- package/dist/i18n/locales/el.d.ts +366 -0
- package/dist/i18n/locales/el.js +367 -1
- package/dist/i18n/locales/en.d.ts +366 -0
- package/dist/i18n/locales/en.js +367 -1
- package/dist/i18n/locales/es.d.ts +366 -0
- package/dist/i18n/locales/es.js +367 -1
- package/dist/i18n/locales/fr.d.ts +366 -0
- package/dist/i18n/locales/fr.js +367 -1
- package/dist/i18n/locales/hi.d.ts +366 -0
- package/dist/i18n/locales/hi.js +367 -1
- package/dist/i18n/locales/it.d.ts +366 -0
- package/dist/i18n/locales/it.js +367 -1
- package/dist/i18n/locales/ja.d.ts +366 -0
- package/dist/i18n/locales/ja.js +367 -1
- package/dist/i18n/locales/nl.d.ts +366 -0
- package/dist/i18n/locales/nl.js +367 -1
- package/dist/i18n/locales/pl.d.ts +366 -0
- package/dist/i18n/locales/pl.js +367 -1
- package/dist/i18n/locales/pt.d.ts +366 -0
- package/dist/i18n/locales/pt.js +367 -1
- package/dist/i18n/locales/ro.d.ts +366 -0
- package/dist/i18n/locales/ro.js +367 -1
- package/dist/i18n/locales/ru.d.ts +366 -0
- package/dist/i18n/locales/ru.js +367 -1
- package/dist/i18n/locales/sq.d.ts +366 -0
- package/dist/i18n/locales/sq.js +367 -1
- package/dist/i18n/locales/sv.d.ts +366 -0
- package/dist/i18n/locales/sv.js +367 -1
- package/dist/i18n/locales/tr.d.ts +366 -0
- package/dist/i18n/locales/tr.js +367 -1
- package/dist/i18n/locales/zh.d.ts +366 -0
- package/dist/i18n/locales/zh.js +367 -1
- package/dist/index.js +527 -491
- package/dist/locales/ar.json +367 -1
- package/dist/locales/de.json +367 -1
- package/dist/locales/el.json +367 -1
- package/dist/locales/en.json +367 -1
- package/dist/locales/es.json +367 -1
- package/dist/locales/fr.json +367 -1
- package/dist/locales/hi.json +367 -1
- package/dist/locales/it.json +367 -1
- package/dist/locales/ja.json +367 -1
- package/dist/locales/nl.json +367 -1
- package/dist/locales/pl.json +367 -1
- package/dist/locales/pt.json +367 -1
- package/dist/locales/ro.json +367 -1
- package/dist/locales/ru.json +367 -1
- package/dist/locales/sq.json +367 -1
- package/dist/locales/sv.json +367 -1
- package/dist/locales/tr.json +367 -1
- package/dist/locales/zh.json +367 -1
- package/dist/patterns/alia-assistant/alia-types.d.ts +76 -0
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +42 -1
- package/dist/_chunks/alia-sidebar-Be8FhKYd.js +0 -837
- package/dist/_chunks/operator-hero-7LiiP7zi.js +0 -171
- package/dist/_chunks/shield-check-C73ma9Cs.js +0 -36
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { jsxs as j, jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as M, useRef as v, useState as O, useMemo as k, useCallback as D, useEffect as G, useImperativeHandle as J } from "react";
|
|
3
|
+
import { c as b } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as Q } from "react-i18next";
|
|
5
|
+
import { I as X } from "./icon-button-CKEOrN37.js";
|
|
6
|
+
import { S as Y } from "./scroll-area-BWqCkEGz.js";
|
|
7
|
+
import { a as Z } from "./tooltip-DvmfrNvB.js";
|
|
8
|
+
import { u as $ } from "./use-controllable-state-BiY4xTzM.js";
|
|
9
|
+
import { u as ee } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
10
|
+
import { u as ae } from "./registry-nPAVE19X.js";
|
|
11
|
+
const te = {
|
|
12
|
+
id: "ai-tools-rail",
|
|
13
|
+
capabilities: ["open", "close", "select_single"],
|
|
14
|
+
state: {
|
|
15
|
+
activeToolId: {
|
|
16
|
+
type: "string | null",
|
|
17
|
+
descriptionKey: "ui.aiToolsRail.agent.state.activeToolId",
|
|
18
|
+
description: "Id of the tool whose panel is currently open, or null when the rail is collapsed to its strip. No panel content is ever exposed.",
|
|
19
|
+
read: (n) => n.getActiveToolId()
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
actions: {
|
|
23
|
+
open: {
|
|
24
|
+
safety: "read",
|
|
25
|
+
argsType: "{ id: string }",
|
|
26
|
+
descriptionKey: "ui.aiToolsRail.agent.actions.open",
|
|
27
|
+
description: "Open the given tool's panel.",
|
|
28
|
+
invoke: (n, a) => {
|
|
29
|
+
n.open(a.id);
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
close: {
|
|
33
|
+
safety: "read",
|
|
34
|
+
descriptionKey: "ui.aiToolsRail.agent.actions.close",
|
|
35
|
+
description: "Collapse the rail to its strip (no active tool).",
|
|
36
|
+
invoke: (n) => {
|
|
37
|
+
n.close();
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
select_tool: {
|
|
41
|
+
safety: "read",
|
|
42
|
+
argsType: "{ id: string | null }",
|
|
43
|
+
descriptionKey: "ui.aiToolsRail.agent.actions.selectTool",
|
|
44
|
+
description: "Set the active tool by id (opens its panel), or pass null to collapse.",
|
|
45
|
+
invoke: (n, a) => {
|
|
46
|
+
n.setActiveTool(a.id);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
domHooks: {
|
|
51
|
+
root: {
|
|
52
|
+
attr: "data-component",
|
|
53
|
+
value: "ai-tools-rail",
|
|
54
|
+
description: "Marks the AiToolsRail wrapper."
|
|
55
|
+
},
|
|
56
|
+
instanceId: {
|
|
57
|
+
attr: "data-component-id",
|
|
58
|
+
sourceProp: "id",
|
|
59
|
+
description: "Sourced from the id prop. Required to address a specific rail from the agent."
|
|
60
|
+
},
|
|
61
|
+
item: {
|
|
62
|
+
attr: "data-tool-id",
|
|
63
|
+
description: "Stable tool id emitted on each strip IconButton. The active icon also carries data-active set to its id."
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}, se = "ds:[inline-size:3rem]", ne = "ds:[inline-size:22rem]", ie = b(
|
|
67
|
+
["ds:flex ds:shrink-0 ds:h-full", "ds:bg-[var(--background)]"].join(" "),
|
|
68
|
+
{
|
|
69
|
+
variants: {
|
|
70
|
+
side: {
|
|
71
|
+
// Strip docks inline-end; the panel mounts inline-start of it
|
|
72
|
+
// (flex-row, panel rendered first). Shadow faces the main area.
|
|
73
|
+
end: "ds:flex-row ds:shadow-[var(--shadow-chrome-start)]",
|
|
74
|
+
// Strip docks inline-start; the panel mounts inline-end of it.
|
|
75
|
+
start: "ds:flex-row-reverse ds:shadow-[var(--shadow-chrome-end)]"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
defaultVariants: { side: "end" }
|
|
79
|
+
}
|
|
80
|
+
), oe = b(
|
|
81
|
+
[
|
|
82
|
+
"ds:flex ds:shrink-0 ds:flex-col ds:items-center",
|
|
83
|
+
"ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]",
|
|
84
|
+
"ds:gap-[var(--spacing-xs)]",
|
|
85
|
+
se
|
|
86
|
+
].join(" ")
|
|
87
|
+
), re = b(
|
|
88
|
+
[
|
|
89
|
+
"ds:flex ds:min-h-0 ds:flex-col ds:h-full",
|
|
90
|
+
"ds:bg-[var(--background)]",
|
|
91
|
+
ne
|
|
92
|
+
].join(" ")
|
|
93
|
+
), le = b(
|
|
94
|
+
[
|
|
95
|
+
"ds:absolute ds:-top-[var(--spacing-xs)] ds:-end-[var(--spacing-xs)]",
|
|
96
|
+
"ds:inline-flex ds:items-center ds:justify-center",
|
|
97
|
+
"ds:min-w-[calc(var(--spacing-md)+var(--spacing-xs))]",
|
|
98
|
+
"ds:h-[calc(var(--spacing-md)+var(--spacing-xs))]",
|
|
99
|
+
"ds:ps-[calc(var(--spacing-xs)/1.5)] ds:pe-[calc(var(--spacing-xs)/1.5)]",
|
|
100
|
+
"ds:rounded-[var(--radius-full)]",
|
|
101
|
+
"ds:bg-[color:var(--destructive)] ds:text-[color:var(--destructive-foreground)]",
|
|
102
|
+
"ds:text-[length:var(--font-size-xs)] ds:font-semibold ds:leading-none",
|
|
103
|
+
"ds:pointer-events-none ds:select-none",
|
|
104
|
+
"ds:forced-colors:outline ds:forced-colors:outline-1 ds:forced-colors:outline-[CanvasText]"
|
|
105
|
+
].join(" ")
|
|
106
|
+
);
|
|
107
|
+
function de(n, a) {
|
|
108
|
+
return n > 99 ? a : String(n);
|
|
109
|
+
}
|
|
110
|
+
const ce = M(
|
|
111
|
+
({
|
|
112
|
+
id: n,
|
|
113
|
+
tools: a,
|
|
114
|
+
activeToolId: S,
|
|
115
|
+
defaultActiveToolId: L = null,
|
|
116
|
+
onActiveToolChange: B,
|
|
117
|
+
side: R = "end",
|
|
118
|
+
railLabel: H,
|
|
119
|
+
className: z
|
|
120
|
+
}, _) => {
|
|
121
|
+
var E;
|
|
122
|
+
const { t: m } = Q(), [F, l] = $({
|
|
123
|
+
value: S,
|
|
124
|
+
defaultValue: L,
|
|
125
|
+
onChange: B
|
|
126
|
+
}), d = F ?? null, h = v([]), I = v(null), [y, x] = O(0), u = v(!1), T = v(!1), c = k(
|
|
127
|
+
() => a.findIndex((e) => e.id === d),
|
|
128
|
+
[a, d]
|
|
129
|
+
), p = c >= 0 ? a[c] : null, P = k(
|
|
130
|
+
() => a.findIndex((e) => !e.disabled),
|
|
131
|
+
[a]
|
|
132
|
+
), g = c >= 0 ? c : y >= 0 && !((E = a[y]) != null && E.disabled) ? y : P, U = D(
|
|
133
|
+
(e, t) => {
|
|
134
|
+
const s = a.find((r) => r.id === e);
|
|
135
|
+
!s || s.disabled || (u.current = t, l(d === e ? null : e));
|
|
136
|
+
},
|
|
137
|
+
[a, d, l]
|
|
138
|
+
), W = D(
|
|
139
|
+
(e) => {
|
|
140
|
+
var K, N, V;
|
|
141
|
+
const t = a.length;
|
|
142
|
+
if (t === 0) return;
|
|
143
|
+
let s = null;
|
|
144
|
+
if (e.key === "ArrowDown" ? s = (g + 1) % t : e.key === "ArrowUp" ? s = (g - 1 + t) % t : e.key === "Home" ? s = 0 : e.key === "End" && (s = t - 1), s === null) return;
|
|
145
|
+
const r = e.key === "ArrowUp" || e.key === "End";
|
|
146
|
+
let i = s, o = 0;
|
|
147
|
+
for (; o < t && ((K = a[i]) != null && K.disabled); )
|
|
148
|
+
i = r ? (i - 1 + t) % t : (i + 1) % t, o += 1;
|
|
149
|
+
(N = a[i]) != null && N.disabled || (e.preventDefault(), x(i), (V = h.current[i]) == null || V.focus());
|
|
150
|
+
},
|
|
151
|
+
[a, g]
|
|
152
|
+
), A = v(null);
|
|
153
|
+
G(() => {
|
|
154
|
+
const e = A.current;
|
|
155
|
+
if (!e) return;
|
|
156
|
+
const t = (s) => {
|
|
157
|
+
if (s.key !== "Escape" || c < 0) return;
|
|
158
|
+
s.preventDefault();
|
|
159
|
+
const r = c;
|
|
160
|
+
l(null), x(r), requestAnimationFrame(() => {
|
|
161
|
+
var i;
|
|
162
|
+
(i = h.current[r]) == null || i.focus();
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
return e.addEventListener("keydown", t), () => e.removeEventListener("keydown", t);
|
|
166
|
+
}, [c, l]), ee(() => {
|
|
167
|
+
var e;
|
|
168
|
+
p && u.current && ((e = I.current) == null || e.focus()), u.current = !1;
|
|
169
|
+
}, [p]);
|
|
170
|
+
const C = v(d);
|
|
171
|
+
C.current = d;
|
|
172
|
+
const w = k(
|
|
173
|
+
() => ({
|
|
174
|
+
getActiveToolId: () => C.current,
|
|
175
|
+
setActiveTool: (e) => {
|
|
176
|
+
u.current = !1, l(e);
|
|
177
|
+
},
|
|
178
|
+
open: (e) => {
|
|
179
|
+
const t = a.find((s) => s.id === e);
|
|
180
|
+
!t || t.disabled || (u.current = !1, l(e));
|
|
181
|
+
},
|
|
182
|
+
close: () => {
|
|
183
|
+
u.current = !1, l(null);
|
|
184
|
+
}
|
|
185
|
+
}),
|
|
186
|
+
[a, l]
|
|
187
|
+
);
|
|
188
|
+
J(_, () => w, [w]), ae(te, w, n);
|
|
189
|
+
const q = m("aiToolsRail.badgeCountOverflow", {
|
|
190
|
+
defaultValue: "99+"
|
|
191
|
+
});
|
|
192
|
+
return /* @__PURE__ */ j(
|
|
193
|
+
"div",
|
|
194
|
+
{
|
|
195
|
+
ref: A,
|
|
196
|
+
"data-component": "ai-tools-rail",
|
|
197
|
+
"data-component-id": n,
|
|
198
|
+
"data-side": R,
|
|
199
|
+
className: [ie({ side: R }), z].filter(Boolean).join(" "),
|
|
200
|
+
children: [
|
|
201
|
+
p ? /* @__PURE__ */ f(
|
|
202
|
+
"aside",
|
|
203
|
+
{
|
|
204
|
+
ref: I,
|
|
205
|
+
tabIndex: -1,
|
|
206
|
+
"aria-label": m("aiToolsRail.panelLabel", {
|
|
207
|
+
tool: p.label,
|
|
208
|
+
defaultValue: "{{tool}} panel"
|
|
209
|
+
}),
|
|
210
|
+
"data-ai-tools-rail-state": "expanded",
|
|
211
|
+
"data-active-tool": p.id,
|
|
212
|
+
className: [re(), "ds:focus-visible:outline-none"].join(
|
|
213
|
+
" "
|
|
214
|
+
),
|
|
215
|
+
children: /* @__PURE__ */ f(Y, { orientation: "vertical", className: "ds:flex-1 ds:min-h-0", children: p.panel })
|
|
216
|
+
}
|
|
217
|
+
) : null,
|
|
218
|
+
/* @__PURE__ */ f(Z, { children: /* @__PURE__ */ f(
|
|
219
|
+
"div",
|
|
220
|
+
{
|
|
221
|
+
role: "toolbar",
|
|
222
|
+
"aria-orientation": "vertical",
|
|
223
|
+
"aria-label": H ?? m("aiToolsRail.railLabel", { defaultValue: "AI tools" }),
|
|
224
|
+
className: oe(),
|
|
225
|
+
onKeyDown: W,
|
|
226
|
+
children: a.map((e, t) => {
|
|
227
|
+
const s = e.id === d, r = typeof e.badgeCount == "number" && e.badgeCount > 0, i = r ? m("aiToolsRail.toolWithCount", {
|
|
228
|
+
tool: e.label,
|
|
229
|
+
count: e.badgeCount,
|
|
230
|
+
defaultValue: "{{tool}}, {{count}} updates"
|
|
231
|
+
}) : e.label;
|
|
232
|
+
return /* @__PURE__ */ j("div", { className: "ds:relative", children: [
|
|
233
|
+
/* @__PURE__ */ f(
|
|
234
|
+
X,
|
|
235
|
+
{
|
|
236
|
+
ref: (o) => {
|
|
237
|
+
h.current[t] = o;
|
|
238
|
+
},
|
|
239
|
+
icon: e.icon,
|
|
240
|
+
tooltip: e.label,
|
|
241
|
+
"aria-label": i,
|
|
242
|
+
intent: "ghost",
|
|
243
|
+
size: "sm",
|
|
244
|
+
disabled: e.disabled,
|
|
245
|
+
"aria-pressed": s,
|
|
246
|
+
"aria-expanded": s,
|
|
247
|
+
"data-active": s ? e.id : void 0,
|
|
248
|
+
"data-tool-id": e.id,
|
|
249
|
+
tabIndex: t === g ? 0 : -1,
|
|
250
|
+
onFocus: () => {
|
|
251
|
+
e.disabled || x(t);
|
|
252
|
+
},
|
|
253
|
+
onClick: () => U(e.id, T.current),
|
|
254
|
+
onKeyDown: (o) => {
|
|
255
|
+
(o.key === "Enter" || o.key === " ") && (T.current = !0);
|
|
256
|
+
},
|
|
257
|
+
onKeyUp: (o) => {
|
|
258
|
+
(o.key === "Enter" || o.key === " ") && (T.current = !1);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
),
|
|
262
|
+
r ? /* @__PURE__ */ f("span", { "aria-hidden": "true", className: le(), children: de(
|
|
263
|
+
e.badgeCount,
|
|
264
|
+
q
|
|
265
|
+
) }) : null
|
|
266
|
+
] }, e.id);
|
|
267
|
+
})
|
|
268
|
+
}
|
|
269
|
+
) })
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
);
|
|
275
|
+
ce.displayName = "AiToolsRail";
|
|
276
|
+
export {
|
|
277
|
+
ce as A,
|
|
278
|
+
te as a
|
|
279
|
+
};
|
|
280
|
+
//# sourceMappingURL=ai-tools-rail-CxYG04cw.js.map
|