@alfadocs/ui-kit 0.50.0 → 0.51.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-BaSfVfrL.js → agenda-card-Bl-SBiCh.js} +55 -45
- package/dist/_chunks/agenda-tray-DA6qj8BL.js +203 -0
- package/dist/_chunks/{ai-consent-banner-F2md5JD3.js → ai-consent-banner-DBKV27je.js} +2 -2
- package/dist/_chunks/ai-tools-rail-7tC3GT4h.js +340 -0
- package/dist/_chunks/{alert-CUTxnym2.js → alert-_mUKLmwA.js} +54 -44
- package/dist/_chunks/{audio-recorder-DVJXV7_k.js → audio-recorder-D6OVfNiZ.js} +2 -2
- package/dist/_chunks/{bishop-score-2MzAz8NE.js → bishop-score-CMQxsdy4.js} +2 -2
- package/dist/_chunks/{bmi-calculator-DdylQzT6.js → bmi-calculator-DuUneHuZ.js} +2 -2
- package/dist/_chunks/{booking-DljH0JkS.js → booking-BUV9fspj.js} +2 -2
- package/dist/_chunks/{cycle-calculator-oOkj5wlB.js → cycle-calculator-vTtZZAmn.js} +2 -2
- package/dist/_chunks/{document-scanner-Cxqvq7GR.js → document-scanner-biBS_f6c.js} +2 -2
- package/dist/_chunks/dropdown-menu-DwwPovMZ.js +354 -0
- package/dist/_chunks/{due-date-calculator-DykajWzh.js → due-date-calculator-CUm5KJbf.js} +2 -2
- package/dist/_chunks/{editable-currency-cell-renderer-Bh48OHRv.js → editable-currency-cell-renderer-D5C5tCfu.js} +3 -3
- package/dist/_chunks/{fetal-weight-Da-B4P4k.js → fetal-weight-Xf8-ZoDy.js} +2 -2
- package/dist/_chunks/{freemium-paywall-BWaLWje-.js → freemium-paywall-gHGA44dW.js} +2 -2
- package/dist/_chunks/{gestational-age-calculator-Bc55hq6t.js → gestational-age-calculator-830KJql3.js} +2 -2
- package/dist/_chunks/{hcg-doubling-DAnpbale.js → hcg-doubling-kVOpDfny.js} +2 -2
- package/dist/_chunks/{header-settings-Bx0Biimh.js → header-settings-D5Z2B_Yz.js} +3 -3
- package/dist/_chunks/insert-result-njqBthzT.js +742 -0
- package/dist/_chunks/{marketplace-app-shell-UKSLx9K_.js → marketplace-app-shell-Dmo1S9av.js} +6 -6
- package/dist/_chunks/{patient-search-BJOmTmDA.js → patient-search-CArmRKeg.js} +3 -3
- package/dist/_chunks/{patient-shell-DUmhXnFq.js → patient-shell-c2YixkQw.js} +4 -4
- package/dist/_chunks/{payment-form-xmeCkxas.js → payment-form-DJ9vnzrT.js} +2 -2
- package/dist/_chunks/{pdf-viewer-q1D3Uion.js → pdf-viewer-4odMFuFW.js} +2 -2
- package/dist/_chunks/{practice-results-Cq1y8JFD.js → practice-results-CtfciF2v.js} +3 -3
- package/dist/_chunks/{pregnancy-dating-48Gfvod1.js → pregnancy-dating-BA37LSkF.js} +16 -16
- package/dist/_chunks/{pregnancy-weight-gain-CCGrvarh.js → pregnancy-weight-gain-BMRBeA8V.js} +2 -2
- package/dist/_chunks/{recaptcha-widget-CFYyLSEX.js → recaptcha-widget-BCNHsgqt.js} +2 -2
- package/dist/_chunks/{sidebar-h78cTNLh.js → sidebar-DPEHzxLZ.js} +397 -346
- package/dist/_chunks/{sign-document-CZkAf28g.js → sign-document-Bzld9jVM.js} +2 -2
- package/dist/_chunks/{task-card-CPyQ5AXC.js → task-card-BwY9jaV1.js} +48 -42
- package/dist/_chunks/task-tray-Cb_hK4yb.js +234 -0
- package/dist/_chunks/{theme-toggle-ClATnY4Q.js → theme-toggle-DAW7uC0B.js} +3 -3
- package/dist/_chunks/{unit-converter-jWp3Z85y.js → unit-converter-BQ6lEYvd.js} +2 -2
- package/dist/_chunks/use-edge-resize-ZnGG7gyO.js +139 -0
- package/dist/_chunks/use-theme-CAuo6EYT.js +159 -0
- package/dist/_chunks/{warning-stack-CXfoAT-_.js → warning-stack-Cv4fr5zo.js} +2 -2
- package/dist/_chunks/{workflow-map-DzX_LI4y.js → workflow-map-BJDUNYlX.js} +3 -3
- package/dist/agent-catalog.json +1 -1
- package/dist/components/agenda-card/agenda-card.d.ts +19 -2
- package/dist/components/agenda-card/index.js +1 -1
- package/dist/components/agenda-tray/agenda-tray.d.ts +24 -1
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/ai-consent-banner/index.js +1 -1
- package/dist/components/ai-tools-rail/ai-tools-rail.d.ts +8 -0
- package/dist/components/ai-tools-rail/index.js +1 -1
- package/dist/components/alert/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/bishop-score/index.js +1 -1
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/button-group/button-group.d.ts +1 -1
- package/dist/components/checkbox-group/checkbox-group.d.ts +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/document-scanner/index.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +2 -0
- package/dist/components/dropdown-menu/index.js +1 -1
- package/dist/components/due-date-calculator/index.js +1 -1
- package/dist/components/fetal-weight/index.js +1 -1
- package/dist/components/form-field/form-field.d.ts +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/hcg-doubling/index.js +1 -1
- package/dist/components/header-settings/index.js +1 -1
- package/dist/components/icon-button-group/icon-button-group.d.ts +15 -15
- package/dist/components/key-value-pair/key-value-pair.d.ts +1 -1
- package/dist/components/patient-search/index.js +1 -1
- package/dist/components/payment-form/index.js +1 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/index.js +1 -1
- package/dist/components/radio-group/radio-group.d.ts +1 -1
- package/dist/components/recaptcha-widget/index.js +1 -1
- package/dist/components/separator/separator.d.ts +1 -1
- package/dist/components/sidebar/index.js +1 -1
- package/dist/components/sidebar/sidebar.d.ts +8 -0
- package/dist/components/sign-document/index.js +1 -1
- package/dist/components/tabs/tabs.d.ts +2 -2
- package/dist/components/task-card/index.js +1 -1
- package/dist/components/task-card/task-card.d.ts +15 -1
- package/dist/components/task-tray/index.js +1 -1
- package/dist/components/task-tray/task-tray.d.ts +24 -1
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/warning-stack/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/components/workflow/workflow-map.d.ts +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +12 -10
- package/dist/hooks/use-edge-resize.d.ts +78 -0
- package/dist/i18n/locales/ar.d.ts +4 -0
- package/dist/i18n/locales/ar.js +7 -3
- package/dist/i18n/locales/de.d.ts +4 -0
- package/dist/i18n/locales/de.js +7 -3
- package/dist/i18n/locales/el.d.ts +4 -0
- package/dist/i18n/locales/el.js +7 -3
- package/dist/i18n/locales/en.d.ts +4 -0
- package/dist/i18n/locales/en.js +7 -3
- package/dist/i18n/locales/es.d.ts +4 -0
- package/dist/i18n/locales/es.js +7 -3
- package/dist/i18n/locales/fr.d.ts +4 -0
- package/dist/i18n/locales/fr.js +7 -3
- package/dist/i18n/locales/hi.d.ts +4 -0
- package/dist/i18n/locales/hi.js +7 -3
- package/dist/i18n/locales/it.d.ts +4 -0
- package/dist/i18n/locales/it.js +7 -3
- package/dist/i18n/locales/ja.d.ts +4 -0
- package/dist/i18n/locales/ja.js +7 -3
- package/dist/i18n/locales/nl.d.ts +4 -0
- package/dist/i18n/locales/nl.js +7 -3
- package/dist/i18n/locales/pl.d.ts +4 -0
- package/dist/i18n/locales/pl.js +7 -3
- package/dist/i18n/locales/pt.d.ts +4 -0
- package/dist/i18n/locales/pt.js +7 -3
- package/dist/i18n/locales/ro.d.ts +4 -0
- package/dist/i18n/locales/ro.js +7 -3
- package/dist/i18n/locales/ru.d.ts +4 -0
- package/dist/i18n/locales/ru.js +7 -3
- package/dist/i18n/locales/sq.d.ts +4 -0
- package/dist/i18n/locales/sq.js +7 -3
- package/dist/i18n/locales/sv.d.ts +4 -0
- package/dist/i18n/locales/sv.js +7 -3
- package/dist/i18n/locales/tr.d.ts +4 -0
- package/dist/i18n/locales/tr.js +7 -3
- package/dist/i18n/locales/zh.d.ts +4 -0
- package/dist/i18n/locales/zh.js +7 -3
- package/dist/index.js +37 -37
- package/dist/locales/ar.json +7 -3
- package/dist/locales/de.json +7 -3
- package/dist/locales/el.json +7 -3
- package/dist/locales/en.json +7 -3
- package/dist/locales/es.json +7 -3
- package/dist/locales/fr.json +7 -3
- package/dist/locales/hi.json +7 -3
- package/dist/locales/it.json +7 -3
- package/dist/locales/ja.json +7 -3
- package/dist/locales/nl.json +7 -3
- package/dist/locales/pl.json +7 -3
- package/dist/locales/pt.json +7 -3
- package/dist/locales/ro.json +7 -3
- package/dist/locales/ru.json +7 -3
- package/dist/locales/sq.json +7 -3
- package/dist/locales/sv.json +7 -3
- package/dist/locales/tr.json +7 -3
- package/dist/locales/zh.json +7 -3
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/agenda-tray-DQayYmQ0.js +0 -165
- package/dist/_chunks/ai-tools-rail-CYLWrRmm.js +0 -280
- package/dist/_chunks/circle-arrow-up-CC_85SuH.js +0 -16
- package/dist/_chunks/dropdown-menu-CUEXqKis.js +0 -299
- package/dist/_chunks/insert-result-DNdi_JYW.js +0 -683
- package/dist/_chunks/task-tray-B8jFv5FV.js +0 -196
- package/dist/_chunks/use-theme-C2dHKUAN.js +0 -145
package/package.json
CHANGED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import { jsx as a, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as k, useRef as y, useImperativeHandle as S, useMemo as j } from "react";
|
|
3
|
-
import { c as z } from "./index-D2ZczOXr.js";
|
|
4
|
-
import { useTranslation as E } from "react-i18next";
|
|
5
|
-
import { I as P } from "./icon-button-CKEOrN37.js";
|
|
6
|
-
import { S as _ } from "./skeleton-CZbwyJAA.js";
|
|
7
|
-
import { E as H } from "./empty-state-BLy7tigq.js";
|
|
8
|
-
import { A as K } from "./agenda-card-BaSfVfrL.js";
|
|
9
|
-
import { u as M } from "./registry-nPAVE19X.js";
|
|
10
|
-
import { C as V } from "./calendar-days-C4BmpCZg.js";
|
|
11
|
-
import { P as q } from "./plus-CYKNmfuA.js";
|
|
12
|
-
const B = {
|
|
13
|
-
id: "agenda-tray",
|
|
14
|
-
capabilities: ["select_single"],
|
|
15
|
-
state: {
|
|
16
|
-
items: {
|
|
17
|
-
type: "Array<{ id: string; status: string }>",
|
|
18
|
-
descriptionKey: "ui.agent.agendaTray.state.items",
|
|
19
|
-
description: "Currently-displayed appointments. Ids + status only — never patient identity.",
|
|
20
|
-
read: (s) => s.getItems()
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
actions: {
|
|
24
|
-
select_item: {
|
|
25
|
-
safety: "read",
|
|
26
|
-
argsType: "{ id: string }",
|
|
27
|
-
descriptionKey: "ui.agent.agendaTray.actions.selectItem",
|
|
28
|
-
description: "Activate the appointment with the given id.",
|
|
29
|
-
invoke: (s, t) => {
|
|
30
|
-
s.selectItem(t.id);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
domHooks: {
|
|
35
|
-
root: {
|
|
36
|
-
attr: "data-component",
|
|
37
|
-
value: "agenda-tray",
|
|
38
|
-
description: "Marks the AgendaTray wrapper."
|
|
39
|
-
},
|
|
40
|
-
instanceId: {
|
|
41
|
-
attr: "data-component-id",
|
|
42
|
-
sourceProp: "id",
|
|
43
|
-
description: "Sourced from the id prop. Required to address a specific tray from the agent."
|
|
44
|
-
},
|
|
45
|
-
item: {
|
|
46
|
-
attr: "data-appointment-id",
|
|
47
|
-
description: "Stable appointment id emitted on each rendered AgendaCard inside the tray."
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}, D = z(
|
|
51
|
-
[
|
|
52
|
-
"ds:flex ds:flex-col",
|
|
53
|
-
"ds:rounded-[var(--radius-md)] ds:shadow-[var(--shadow-card)]",
|
|
54
|
-
"ds:border ds:border-[color:var(--card-border)] ds:[.theme-accessible_&]:border-2",
|
|
55
|
-
"ds:bg-[color:var(--card)] ds:text-[color:var(--card-foreground)]",
|
|
56
|
-
"ds:overflow-hidden"
|
|
57
|
-
].join(" "),
|
|
58
|
-
{
|
|
59
|
-
variants: {
|
|
60
|
-
size: {
|
|
61
|
-
sm: "",
|
|
62
|
-
md: ""
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
defaultVariants: {
|
|
66
|
-
size: "sm"
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
), L = k(
|
|
70
|
-
({
|
|
71
|
-
id: s,
|
|
72
|
-
items: t,
|
|
73
|
-
title: h,
|
|
74
|
-
caption: c,
|
|
75
|
-
size: l = "sm",
|
|
76
|
-
onOpenAppointment: r,
|
|
77
|
-
onAddAppointment: m,
|
|
78
|
-
addLabel: v,
|
|
79
|
-
loading: p = !1,
|
|
80
|
-
emptyTitle: x,
|
|
81
|
-
emptyDescription: b,
|
|
82
|
-
className: T,
|
|
83
|
-
...N
|
|
84
|
-
}, w) => {
|
|
85
|
-
const { t: d } = E(), g = h ?? d("agendaTray.title", "Today's appointments"), I = v ?? d("agendaTray.add", "Add appointment"), A = !p && t.length === 0;
|
|
86
|
-
let i;
|
|
87
|
-
p ? i = /* @__PURE__ */ a("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)]", children: [0, 1, 2].map((e) => /* @__PURE__ */ a(_, { variant: "rectangular", height: "2.5rem" }, e)) }) : A ? i = /* @__PURE__ */ a("div", { className: "ds:p-[var(--spacing-md)]", children: /* @__PURE__ */ a(
|
|
88
|
-
H,
|
|
89
|
-
{
|
|
90
|
-
variant: "first-use",
|
|
91
|
-
size: "sm",
|
|
92
|
-
title: x ?? d("agendaTray.empty.title", "No appointments"),
|
|
93
|
-
description: b ?? d(
|
|
94
|
-
"agendaTray.empty.description",
|
|
95
|
-
"New appointments will appear here."
|
|
96
|
-
)
|
|
97
|
-
}
|
|
98
|
-
) }) : i = /* @__PURE__ */ a("ul", { className: "ds:flex ds:list-none ds:flex-col", children: t.map((e) => /* @__PURE__ */ a(
|
|
99
|
-
K,
|
|
100
|
-
{
|
|
101
|
-
item: e,
|
|
102
|
-
size: l,
|
|
103
|
-
onActivate: r,
|
|
104
|
-
"data-appointment-id": e.id
|
|
105
|
-
},
|
|
106
|
-
e.id
|
|
107
|
-
)) });
|
|
108
|
-
const o = y(t);
|
|
109
|
-
o.current = t;
|
|
110
|
-
const f = y(null);
|
|
111
|
-
S(w, () => f.current, []);
|
|
112
|
-
const C = j(
|
|
113
|
-
() => ({
|
|
114
|
-
getItems: () => o.current.map((e) => ({
|
|
115
|
-
id: e.id,
|
|
116
|
-
status: e.status ?? "confirmed"
|
|
117
|
-
})),
|
|
118
|
-
selectItem: (e) => {
|
|
119
|
-
const u = o.current.find((R) => R.id === e);
|
|
120
|
-
u && (r == null || r(u));
|
|
121
|
-
}
|
|
122
|
-
}),
|
|
123
|
-
[r]
|
|
124
|
-
);
|
|
125
|
-
return M(B, C, s), /* @__PURE__ */ n(
|
|
126
|
-
"section",
|
|
127
|
-
{
|
|
128
|
-
ref: f,
|
|
129
|
-
"aria-label": g,
|
|
130
|
-
"data-component": "agenda-tray",
|
|
131
|
-
"data-component-id": s,
|
|
132
|
-
className: D({ size: l, className: T }),
|
|
133
|
-
...N,
|
|
134
|
-
children: [
|
|
135
|
-
/* @__PURE__ */ n("header", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)]", children: [
|
|
136
|
-
/* @__PURE__ */ n("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)] ds:min-w-0", children: [
|
|
137
|
-
/* @__PURE__ */ n("h3", { className: "ds:m-0 ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-title-card", children: [
|
|
138
|
-
/* @__PURE__ */ a(V, { "aria-hidden": "true", className: "ds:size-4" }),
|
|
139
|
-
g
|
|
140
|
-
] }),
|
|
141
|
-
c ? /* @__PURE__ */ a("span", { className: "type-eyebrow ds:text-[color:var(--muted-foreground)]", children: c }) : null
|
|
142
|
-
] }),
|
|
143
|
-
m ? /* @__PURE__ */ a(
|
|
144
|
-
P,
|
|
145
|
-
{
|
|
146
|
-
icon: /* @__PURE__ */ a(q, {}),
|
|
147
|
-
intent: "outline",
|
|
148
|
-
size: "sm",
|
|
149
|
-
"aria-label": I,
|
|
150
|
-
onClick: m
|
|
151
|
-
}
|
|
152
|
-
) : null
|
|
153
|
-
] }),
|
|
154
|
-
i
|
|
155
|
-
]
|
|
156
|
-
}
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
);
|
|
160
|
-
L.displayName = "AgendaTray";
|
|
161
|
-
export {
|
|
162
|
-
L as A,
|
|
163
|
-
B as a
|
|
164
|
-
};
|
|
165
|
-
//# sourceMappingURL=agenda-tray-DQayYmQ0.js.map
|
|
@@ -1,280 +0,0 @@
|
|
|
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:var(--ai-tools-rail-panel-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: z,
|
|
119
|
-
className: H
|
|
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 }), H].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": z ?? 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-CYLWrRmm.js.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { c } 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 r = [
|
|
9
|
-
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
10
|
-
["path", { d: "m16 12-4-4-4 4", key: "177agl" }],
|
|
11
|
-
["path", { d: "M12 16V8", key: "1sbj14" }]
|
|
12
|
-
], o = c("circle-arrow-up", r);
|
|
13
|
-
export {
|
|
14
|
-
o as C
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=circle-arrow-up-CC_85SuH.js.map
|