@alfadocs/ui-kit-debug 1.33.0 → 1.35.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.
Files changed (217) hide show
  1. package/dist/_chunks/appointment-card-Bh_CIlc6.js +431 -0
  2. package/dist/_chunks/appointment-card-Bh_CIlc6.js.map +1 -0
  3. package/dist/_chunks/appointment-timeline-De-Wqdkw.js +449 -0
  4. package/dist/_chunks/appointment-timeline-De-Wqdkw.js.map +1 -0
  5. package/dist/_chunks/{appointment-tray-DCk8gHod.js → appointment-tray-4I9wTAi4.js} +2 -2
  6. package/dist/_chunks/{appointment-tray-DCk8gHod.js.map → appointment-tray-4I9wTAi4.js.map} +1 -1
  7. package/dist/_chunks/{calendar-workspace-BX-zDyVR.js → calendar-workspace-UywR5gUl.js} +7 -7
  8. package/dist/_chunks/{calendar-workspace-BX-zDyVR.js.map → calendar-workspace-UywR5gUl.js.map} +1 -1
  9. package/dist/_chunks/{care-plan-card-CZW476Kg.js → care-plan-card-DHVhBcvs.js} +3 -3
  10. package/dist/_chunks/{care-plan-card-CZW476Kg.js.map → care-plan-card-DHVhBcvs.js.map} +1 -1
  11. package/dist/_chunks/{care-plan-entry-card-BMUYagEw.js → care-plan-entry-card-Dx6IdTcR.js} +2 -2
  12. package/dist/_chunks/{care-plan-entry-card-BMUYagEw.js.map → care-plan-entry-card-Dx6IdTcR.js.map} +1 -1
  13. package/dist/_chunks/{care-plan-header-B5CBE0zu.js → care-plan-header-UTX5ZD74.js} +2 -2
  14. package/dist/_chunks/{care-plan-header-B5CBE0zu.js.map → care-plan-header-UTX5ZD74.js.map} +1 -1
  15. package/dist/_chunks/{clinical-note-card-D2WTV2CO.js → clinical-note-card-CTRzmqvv.js} +83 -81
  16. package/dist/_chunks/clinical-note-card-CTRzmqvv.js.map +1 -0
  17. package/dist/_chunks/{contact-profile-card-BZqi8Hck.js → contact-profile-card-DSI9uumA.js} +17 -16
  18. package/dist/_chunks/{contact-profile-card-BZqi8Hck.js.map → contact-profile-card-DSI9uumA.js.map} +1 -1
  19. package/dist/_chunks/{control-room-rail-iO_BCaq1.js → control-room-rail-5MbhjsxN.js} +2 -2
  20. package/dist/_chunks/{control-room-rail-iO_BCaq1.js.map → control-room-rail-5MbhjsxN.js.map} +1 -1
  21. package/dist/_chunks/{entity-card-DmrgYSEX.js → entity-card-9_62gY7l.js} +4 -4
  22. package/dist/_chunks/{entity-card-DmrgYSEX.js.map → entity-card-9_62gY7l.js.map} +1 -1
  23. package/dist/_chunks/format-price-BkMEbeW3.js +47 -0
  24. package/dist/_chunks/format-price-BkMEbeW3.js.map +1 -0
  25. package/dist/_chunks/{format-price-DNqXPa_q.js → languages-CZqBaPwI.js} +8 -38
  26. package/dist/_chunks/languages-CZqBaPwI.js.map +1 -0
  27. package/dist/_chunks/money.agent-Dw55UxUA.js +116 -0
  28. package/dist/_chunks/money.agent-Dw55UxUA.js.map +1 -0
  29. package/dist/_chunks/notes-panel-BjLt-kiP.js +469 -0
  30. package/dist/_chunks/notes-panel-BjLt-kiP.js.map +1 -0
  31. package/dist/_chunks/{operator-hero-D7-iiFQ9.js → operator-hero-aG_qyn6g.js} +2 -2
  32. package/dist/_chunks/{operator-hero-D7-iiFQ9.js.map → operator-hero-aG_qyn6g.js.map} +1 -1
  33. package/dist/_chunks/{payment-request-card-lmKLwsDs.js → payment-request-card-DvEsWEkC.js} +2 -2
  34. package/dist/_chunks/{payment-request-card-lmKLwsDs.js.map → payment-request-card-DvEsWEkC.js.map} +1 -1
  35. package/dist/_chunks/{practice-results-DjEzPgAK.js → practice-results-kayDEorM.js} +15 -14
  36. package/dist/_chunks/{practice-results-DjEzPgAK.js.map → practice-results-kayDEorM.js.map} +1 -1
  37. package/dist/_chunks/{rich-text-editor-CQ7yZdG3.js → rich-text-editor-CCI-Y3DN.js} +3 -5
  38. package/dist/_chunks/rich-text-editor-CCI-Y3DN.js.map +1 -0
  39. package/dist/_chunks/{task-card-BUgK6yZT.js → task-card-BalrLkSz.js} +41 -40
  40. package/dist/_chunks/task-card-BalrLkSz.js.map +1 -0
  41. package/dist/_chunks/{task-tray-CYG6rj2s.js → task-tray-COo-RlDv.js} +2 -2
  42. package/dist/_chunks/{task-tray-CYG6rj2s.js.map → task-tray-COo-RlDv.js.map} +1 -1
  43. package/dist/_chunks/tasks-panel-DLKpSNoE.js +844 -0
  44. package/dist/_chunks/tasks-panel-DLKpSNoE.js.map +1 -0
  45. package/dist/_chunks/tool-rail-ONaV-Nzz.js +588 -0
  46. package/dist/_chunks/tool-rail-ONaV-Nzz.js.map +1 -0
  47. package/dist/_chunks/use-check-animation--I3cS00X.js +28 -0
  48. package/dist/_chunks/use-check-animation--I3cS00X.js.map +1 -0
  49. package/dist/_chunks/use-list-reflow-Cw43nxw5.js +100 -0
  50. package/dist/_chunks/use-list-reflow-Cw43nxw5.js.map +1 -0
  51. package/dist/agent-catalog.json +15 -1
  52. package/dist/components/_shared/format-price.d.ts +15 -0
  53. package/dist/components/_shared/format-price.d.ts.map +1 -1
  54. package/dist/components/appointment-card/appointment-card.d.ts +36 -1
  55. package/dist/components/appointment-card/appointment-card.d.ts.map +1 -1
  56. package/dist/components/appointment-card/index.js +2 -2
  57. package/dist/components/appointment-timeline/appointment-timeline.d.ts +6 -0
  58. package/dist/components/appointment-timeline/appointment-timeline.d.ts.map +1 -1
  59. package/dist/components/appointment-timeline/index.js +1 -1
  60. package/dist/components/care-plan-card/index.js +1 -1
  61. package/dist/components/care-plan-entry-card/index.js +1 -1
  62. package/dist/components/care-plan-header/index.js +1 -1
  63. package/dist/components/clinical-note-card/clinical-note-card.d.ts +8 -1
  64. package/dist/components/clinical-note-card/clinical-note-card.d.ts.map +1 -1
  65. package/dist/components/clinical-note-card/index.js +1 -1
  66. package/dist/components/command-palette/command-palette.d.ts +7 -7
  67. package/dist/components/contact-profile-card/index.js +1 -1
  68. package/dist/components/control-room-rail/index.js +1 -1
  69. package/dist/components/index.d.ts +1 -0
  70. package/dist/components/index.d.ts.map +1 -1
  71. package/dist/components/money/index.d.ts +4 -0
  72. package/dist/components/money/index.d.ts.map +1 -0
  73. package/dist/components/money/index.js +6 -0
  74. package/dist/components/money/index.js.map +1 -0
  75. package/dist/components/money/money.agent.d.ts +3 -0
  76. package/dist/components/money/money.agent.d.ts.map +1 -0
  77. package/dist/components/money/money.d.ts +38 -0
  78. package/dist/components/money/money.d.ts.map +1 -0
  79. package/dist/components/notes-panel/index.js +1 -1
  80. package/dist/components/notes-panel/notes-panel.d.ts +16 -1
  81. package/dist/components/notes-panel/notes-panel.d.ts.map +1 -1
  82. package/dist/components/operator-hero/index.js +1 -1
  83. package/dist/components/payment-card/index.js +1 -1
  84. package/dist/components/practice-results/index.js +1 -1
  85. package/dist/components/rich-text-editor/help-me-write-overlay.d.ts.map +1 -1
  86. package/dist/components/rich-text-editor/index.js +1 -1
  87. package/dist/components/rich-text-editor/rich-text-editor.d.ts +1 -1
  88. package/dist/components/rich-text-editor/rich-text-editor.d.ts.map +1 -1
  89. package/dist/components/task-card/index.js +1 -1
  90. package/dist/components/task-card/task-card.d.ts +11 -3
  91. package/dist/components/task-card/task-card.d.ts.map +1 -1
  92. package/dist/components/task-tray/index.js +1 -1
  93. package/dist/components/tasks-panel/index.js +1 -1
  94. package/dist/components/tasks-panel/tasks-panel.d.ts +1 -1
  95. package/dist/components/tasks-panel/tasks-panel.d.ts.map +1 -1
  96. package/dist/components/tool-rail/index.js +1 -1
  97. package/dist/components/tool-rail/tool-rail.d.ts.map +1 -1
  98. package/dist/hooks/index.d.ts +3 -0
  99. package/dist/hooks/index.d.ts.map +1 -1
  100. package/dist/hooks/index.js +43 -37
  101. package/dist/hooks/index.js.map +1 -1
  102. package/dist/hooks/use-check-animation.d.ts +53 -0
  103. package/dist/hooks/use-check-animation.d.ts.map +1 -0
  104. package/dist/hooks/use-exit-transition.d.ts +48 -0
  105. package/dist/hooks/use-exit-transition.d.ts.map +1 -0
  106. package/dist/hooks/use-list-reflow.d.ts +47 -0
  107. package/dist/hooks/use-list-reflow.d.ts.map +1 -0
  108. package/dist/host-compat.css +8 -2
  109. package/dist/i18n/locales/ar.d.ts +10 -0
  110. package/dist/i18n/locales/ar.d.ts.map +1 -1
  111. package/dist/i18n/locales/ar.js +12 -2
  112. package/dist/i18n/locales/ar.js.map +1 -1
  113. package/dist/i18n/locales/de.d.ts +10 -0
  114. package/dist/i18n/locales/de.d.ts.map +1 -1
  115. package/dist/i18n/locales/de.js +12 -2
  116. package/dist/i18n/locales/de.js.map +1 -1
  117. package/dist/i18n/locales/el.d.ts +10 -0
  118. package/dist/i18n/locales/el.d.ts.map +1 -1
  119. package/dist/i18n/locales/el.js +12 -2
  120. package/dist/i18n/locales/el.js.map +1 -1
  121. package/dist/i18n/locales/en.d.ts +10 -0
  122. package/dist/i18n/locales/en.d.ts.map +1 -1
  123. package/dist/i18n/locales/en.js +12 -2
  124. package/dist/i18n/locales/en.js.map +1 -1
  125. package/dist/i18n/locales/es.d.ts +10 -0
  126. package/dist/i18n/locales/es.d.ts.map +1 -1
  127. package/dist/i18n/locales/es.js +12 -2
  128. package/dist/i18n/locales/es.js.map +1 -1
  129. package/dist/i18n/locales/fr.d.ts +10 -0
  130. package/dist/i18n/locales/fr.d.ts.map +1 -1
  131. package/dist/i18n/locales/fr.js +12 -2
  132. package/dist/i18n/locales/fr.js.map +1 -1
  133. package/dist/i18n/locales/hi.d.ts +10 -0
  134. package/dist/i18n/locales/hi.d.ts.map +1 -1
  135. package/dist/i18n/locales/hi.js +12 -2
  136. package/dist/i18n/locales/hi.js.map +1 -1
  137. package/dist/i18n/locales/it.d.ts +13 -3
  138. package/dist/i18n/locales/it.d.ts.map +1 -1
  139. package/dist/i18n/locales/it.js +14 -4
  140. package/dist/i18n/locales/it.js.map +1 -1
  141. package/dist/i18n/locales/ja.d.ts +10 -0
  142. package/dist/i18n/locales/ja.d.ts.map +1 -1
  143. package/dist/i18n/locales/ja.js +12 -2
  144. package/dist/i18n/locales/ja.js.map +1 -1
  145. package/dist/i18n/locales/nl.d.ts +10 -0
  146. package/dist/i18n/locales/nl.d.ts.map +1 -1
  147. package/dist/i18n/locales/nl.js +12 -2
  148. package/dist/i18n/locales/nl.js.map +1 -1
  149. package/dist/i18n/locales/pl.d.ts +10 -0
  150. package/dist/i18n/locales/pl.d.ts.map +1 -1
  151. package/dist/i18n/locales/pl.js +12 -2
  152. package/dist/i18n/locales/pl.js.map +1 -1
  153. package/dist/i18n/locales/pt.d.ts +10 -0
  154. package/dist/i18n/locales/pt.d.ts.map +1 -1
  155. package/dist/i18n/locales/pt.js +12 -2
  156. package/dist/i18n/locales/pt.js.map +1 -1
  157. package/dist/i18n/locales/ro.d.ts +10 -0
  158. package/dist/i18n/locales/ro.d.ts.map +1 -1
  159. package/dist/i18n/locales/ro.js +12 -2
  160. package/dist/i18n/locales/ro.js.map +1 -1
  161. package/dist/i18n/locales/ru.d.ts +10 -0
  162. package/dist/i18n/locales/ru.d.ts.map +1 -1
  163. package/dist/i18n/locales/ru.js +12 -2
  164. package/dist/i18n/locales/ru.js.map +1 -1
  165. package/dist/i18n/locales/sq.d.ts +10 -0
  166. package/dist/i18n/locales/sq.d.ts.map +1 -1
  167. package/dist/i18n/locales/sq.js +12 -2
  168. package/dist/i18n/locales/sq.js.map +1 -1
  169. package/dist/i18n/locales/sv.d.ts +10 -0
  170. package/dist/i18n/locales/sv.d.ts.map +1 -1
  171. package/dist/i18n/locales/sv.js +12 -2
  172. package/dist/i18n/locales/sv.js.map +1 -1
  173. package/dist/i18n/locales/tr.d.ts +10 -0
  174. package/dist/i18n/locales/tr.d.ts.map +1 -1
  175. package/dist/i18n/locales/tr.js +12 -2
  176. package/dist/i18n/locales/tr.js.map +1 -1
  177. package/dist/i18n/locales/zh.d.ts +10 -0
  178. package/dist/i18n/locales/zh.d.ts.map +1 -1
  179. package/dist/i18n/locales/zh.js +12 -2
  180. package/dist/i18n/locales/zh.js.map +1 -1
  181. package/dist/index.js +919 -916
  182. package/dist/index.js.map +1 -1
  183. package/dist/locales/ar.json +12 -2
  184. package/dist/locales/de.json +12 -2
  185. package/dist/locales/el.json +12 -2
  186. package/dist/locales/en.json +12 -2
  187. package/dist/locales/es.json +12 -2
  188. package/dist/locales/fr.json +12 -2
  189. package/dist/locales/hi.json +12 -2
  190. package/dist/locales/it.json +14 -4
  191. package/dist/locales/ja.json +12 -2
  192. package/dist/locales/nl.json +12 -2
  193. package/dist/locales/pl.json +12 -2
  194. package/dist/locales/pt.json +12 -2
  195. package/dist/locales/ro.json +12 -2
  196. package/dist/locales/ru.json +12 -2
  197. package/dist/locales/sq.json +12 -2
  198. package/dist/locales/sv.json +12 -2
  199. package/dist/locales/tr.json +12 -2
  200. package/dist/locales/zh.json +12 -2
  201. package/dist/patterns/calendar/index.js +1 -1
  202. package/dist/tokens.css +2 -1
  203. package/package.json +5 -1
  204. package/dist/_chunks/appointment-card-D-oj_ugh.js +0 -296
  205. package/dist/_chunks/appointment-card-D-oj_ugh.js.map +0 -1
  206. package/dist/_chunks/appointment-timeline-CymGHyIP.js +0 -403
  207. package/dist/_chunks/appointment-timeline-CymGHyIP.js.map +0 -1
  208. package/dist/_chunks/clinical-note-card-D2WTV2CO.js.map +0 -1
  209. package/dist/_chunks/format-price-DNqXPa_q.js.map +0 -1
  210. package/dist/_chunks/notes-panel-C4G-mhZ9.js +0 -380
  211. package/dist/_chunks/notes-panel-C4G-mhZ9.js.map +0 -1
  212. package/dist/_chunks/rich-text-editor-CQ7yZdG3.js.map +0 -1
  213. package/dist/_chunks/task-card-BUgK6yZT.js.map +0 -1
  214. package/dist/_chunks/tasks-panel-DQuaVvl5.js +0 -757
  215. package/dist/_chunks/tasks-panel-DQuaVvl5.js.map +0 -1
  216. package/dist/_chunks/tool-rail-8Scslq3X.js +0 -524
  217. package/dist/_chunks/tool-rail-8Scslq3X.js.map +0 -1
@@ -1,524 +0,0 @@
1
- import { jsxs as D, jsx as f } from "react/jsx-runtime";
2
- import { forwardRef as Re, useRef as m, useState as E, useMemo as R, useId as ke, useCallback as F, useEffect as Te, useImperativeHandle as ze, Fragment as _e } from "react";
3
- import { c as w } from "./index-D2ZczOXr.js";
4
- import { useTranslation as Ae } from "react-i18next";
5
- import { I as Se } from "./icon-button-DA2CAGHZ.js";
6
- import { S as De } from "./scroll-area-BZOvUhwQ.js";
7
- import { a as Ee } from "./tooltip-DvmfrNvB.js";
8
- import { u as Ne } from "./use-controllable-state-BiY4xTzM.js";
9
- import { u as Ce } from "./use-edge-resize-ZnGG7gyO.js";
10
- import { u as te } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
11
- import { u as Ve } from "./registry-DvAUVLHh.js";
12
- const Le = {
13
- id: "tool-rail",
14
- capabilities: ["open", "close", "select_single"],
15
- state: {
16
- activeToolId: {
17
- type: "string | null",
18
- descriptionKey: "ui.toolRail.agent.state.activeToolId",
19
- 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.",
20
- read: (o) => o.getActiveToolId()
21
- }
22
- },
23
- actions: {
24
- open: {
25
- // Pure ephemeral panel state (open) — no data loss, no external effect.
26
- safety: "read",
27
- argsType: "{ id: string }",
28
- argsSchema: {
29
- type: "object",
30
- properties: { id: { type: "string" } },
31
- required: ["id"]
32
- },
33
- idempotent: !0,
34
- // descriptionKey shape is intentionally pre-existing — already resolves to
35
- // real multi-locale translations; do not canonicalise.
36
- descriptionKey: "ui.toolRail.agent.actions.open",
37
- description: "Open the given tool's panel.",
38
- examples: [{ args: { id: "inbox" }, note: "Open the inbox tool panel." }],
39
- invoke: (o, a) => {
40
- o.open(a.id);
41
- }
42
- },
43
- close: {
44
- safety: "read",
45
- idempotent: !0,
46
- descriptionKey: "ui.toolRail.agent.actions.close",
47
- description: "Collapse the rail to its strip (no active tool).",
48
- invoke: (o) => {
49
- o.close();
50
- }
51
- },
52
- select_tool: {
53
- safety: "read",
54
- argsType: "{ id: string | null }",
55
- argsSchema: {
56
- type: "object",
57
- properties: { id: { type: ["string", "null"] } },
58
- required: ["id"]
59
- },
60
- idempotent: !0,
61
- descriptionKey: "ui.toolRail.agent.actions.selectTool",
62
- description: "Set the active tool by id (opens its panel), or pass null to collapse.",
63
- invoke: (o, a) => {
64
- o.setActiveTool(a.id);
65
- }
66
- }
67
- },
68
- domHooks: {
69
- root: {
70
- attr: "data-component",
71
- value: "tool-rail",
72
- description: "Marks the ToolRail wrapper."
73
- },
74
- instanceId: {
75
- attr: "data-component-id",
76
- sourceProp: "id",
77
- description: "Sourced from the id prop. Required to address a specific rail from the agent."
78
- },
79
- item: {
80
- attr: "data-tool-id",
81
- description: "Stable tool id emitted on each strip IconButton. The active icon also carries data-active set to its id."
82
- }
83
- }
84
- }, Ke = "ds:[inline-size:3rem]", je = "ds:[inline-size:var(--tool-rail-panel-inline-size,var(--ai-tools-rail-panel-inline-size,22rem))]", ae = "--tool-rail-panel-inline-size", Pe = 288, Me = 880, qe = 352, Be = w(
85
- ["ds:flex ds:shrink-0 ds:h-full", "ds:bg-[var(--background)]"].join(" "),
86
- {
87
- variants: {
88
- side: {
89
- // Strip docks inline-end; the panel mounts inline-start of it
90
- // (flex-row, panel rendered first). Shadow faces the main area —
91
- // no border against main (the rail stays line-free; the only seam
92
- // is the strip↔panel divider on the open panel, see render).
93
- // Accessible (AAA) theme swaps the soft chrome shadow for a solid 1px
94
- // border on the content-facing edge (border-s for end-docked).
95
- end: "ds:flex-row ds:shadow-[var(--shadow-chrome-start)] ds:[.theme-accessible_&]:border-s ds:[.theme-accessible_&]:border-[var(--border)] ds:[.theme-accessible_&]:shadow-none",
96
- // Strip docks inline-start; the panel mounts inline-end of it.
97
- start: "ds:flex-row-reverse ds:shadow-[var(--shadow-chrome-end)] ds:[.theme-accessible_&]:border-e ds:[.theme-accessible_&]:border-[var(--border)] ds:[.theme-accessible_&]:shadow-none"
98
- }
99
- },
100
- defaultVariants: { side: "end" }
101
- }
102
- ), Fe = w(
103
- [
104
- "ds:flex ds:shrink-0 ds:flex-col ds:items-center",
105
- "ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]",
106
- "ds:gap-[var(--spacing-xs)]",
107
- Ke
108
- ].join(" ")
109
- ), Ue = w(
110
- [
111
- "ds:relative ds:flex ds:min-h-0 ds:flex-col ds:h-full",
112
- "ds:bg-[var(--background)]",
113
- je,
114
- // Defensive: the panel doesn't animate its width today, but if a
115
- // consumer adds a transition on the var, suppress it mid-drag.
116
- "ds:data-[resizing]:transition-none"
117
- ].join(" ")
118
- ), He = w(
119
- [
120
- "ds:absolute ds:[inset-block:0] ds:z-[1] ds:select-none ds:touch-none",
121
- "ds:[inline-size:var(--resizable-handle-size)] ds:cursor-col-resize",
122
- "ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
123
- "ds:hover:bg-[var(--accent)] ds:focus-visible:bg-[var(--accent)] ds:data-[resizing]:bg-[var(--accent)]",
124
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
125
- "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
126
- "ds:forced-colors:focus-visible:outline-[CanvasText]",
127
- "ds:before:absolute ds:before:content-['']",
128
- "ds:before:[block-size:100%]",
129
- "ds:before:[inline-size:var(--min-target-size)]",
130
- "ds:before:[inset-block:0]",
131
- "ds:before:[inset-inline:calc(0px_-_(var(--min-target-size)_-_var(--resizable-handle-size))_/_2)]"
132
- ],
133
- {
134
- variants: {
135
- edge: {
136
- "inline-start": "ds:start-0",
137
- "inline-end": "ds:end-0"
138
- }
139
- },
140
- defaultVariants: { edge: "inline-start" }
141
- }
142
- ), $e = w(
143
- [
144
- "ds:absolute ds:-top-[var(--spacing-xs)] ds:-end-[var(--spacing-xs)]",
145
- "ds:inline-flex ds:items-center ds:justify-center",
146
- "ds:min-w-[calc(var(--spacing-md)+var(--spacing-xs))]",
147
- "ds:h-[calc(var(--spacing-md)+var(--spacing-xs))]",
148
- "ds:ps-[calc(var(--spacing-xs)/1.5)] ds:pe-[calc(var(--spacing-xs)/1.5)]",
149
- "ds:rounded-[var(--radius-full)]",
150
- "ds:bg-[color:var(--destructive)] ds:text-[color:var(--destructive-foreground)]",
151
- "ds:text-[length:var(--font-size-xs)] ds:font-semibold ds:leading-none",
152
- "ds:pointer-events-none ds:select-none",
153
- "ds:forced-colors:outline ds:forced-colors:outline-1 ds:forced-colors:outline-[CanvasText]"
154
- ].join(" ")
155
- ), Oe = w(
156
- // `group/rail-tool` lets an affordance overlay (e.g. a pin star) reveal on
157
- // hover / focus-within of the whole slot.
158
- ["ds:group/rail-tool ds:relative", "ds:rounded-[var(--radius-sm)]"],
159
- {
160
- variants: {
161
- dragging: { true: "ds:opacity-60", false: "" },
162
- dropTarget: {
163
- true: "ds:outline-[length:var(--focus-ring-width)] ds:outline-dashed ds:outline-[var(--accent)] ds:outline-offset-[length:var(--focus-ring-offset)]",
164
- false: ""
165
- },
166
- reorderable: {
167
- true: "ds:cursor-grab ds:active:cursor-grabbing",
168
- false: ""
169
- }
170
- },
171
- defaultVariants: {
172
- dragging: !1,
173
- dropTarget: !1,
174
- reorderable: !1
175
- }
176
- }
177
- );
178
- function We(o, a) {
179
- return o > 99 ? a : String(o);
180
- }
181
- const Ze = Re(
182
- ({
183
- id: o,
184
- tools: a,
185
- activeToolId: re,
186
- defaultActiveToolId: ne = null,
187
- onActiveToolChange: ie,
188
- side: k = "end",
189
- railLabel: oe,
190
- resizablePanel: T = !1,
191
- onReorder: z,
192
- formatReorderAnnouncement: N,
193
- renderToolAffordance: C,
194
- renderPanelHeader: U,
195
- dataComponent: le = "tool-rail",
196
- agentAdapter: de = Le,
197
- className: ce
198
- }, ue) => {
199
- var Q;
200
- const { t: p } = Ae(), [fe, v] = Ne({
201
- value: re,
202
- defaultValue: ne,
203
- onChange: ie
204
- }), g = fe ?? null, V = m([]), _ = m(null), [L, K] = E(0), h = m(!1), j = m(!1), b = R(
205
- () => a.findIndex((e) => e.id === g),
206
- [a, g]
207
- ), l = b >= 0 ? a[b] : null, pe = R(
208
- () => a.findIndex((e) => !e.disabled),
209
- [a]
210
- ), H = R(() => {
211
- var s;
212
- const e = (s = a[0]) == null ? void 0 : s.scope;
213
- return e ? a.findIndex((t) => t.scope && t.scope !== e) : -1;
214
- }, [a]), ve = H > 0, d = R(() => {
215
- var t;
216
- const e = a.findIndex((i) => i.reorderable);
217
- if (e < 0) return null;
218
- let s = e;
219
- for (; s + 1 < a.length && ((t = a[s + 1]) != null && t.reorderable); ) s += 1;
220
- return { first: e, last: s };
221
- }, [a]), $ = !!z && d !== null, ge = ke(), [I, P] = E(null), [O, A] = E(null), [be, me] = E(""), M = m(!1), W = F(
222
- (e, s) => {
223
- if (!z || !d) return;
224
- const t = Math.max(
225
- d.first,
226
- Math.min(d.last, s)
227
- );
228
- if (t === e) return;
229
- z(e, t);
230
- const i = a[e];
231
- if (i) {
232
- const n = N ? N({ tool: i, from: e, to: t }) : p("toolRail.reorderAnnounce", {
233
- tool: i.label,
234
- to: t - d.first + 1,
235
- total: d.last - d.first + 1,
236
- defaultValue: "{{tool}} moved to position {{to}} of {{total}}"
237
- });
238
- n && (M.current = !M.current, me(M.current ? n : `${n}​`));
239
- }
240
- },
241
- [z, d, a, p, N]
242
- ), x = b >= 0 ? b : L >= 0 && !((Q = a[L]) != null && Q.disabled) ? L : pe, he = F(
243
- (e, s) => {
244
- const t = a.find((i) => i.id === e);
245
- !t || t.disabled || (h.current = s, v(g === e ? null : e));
246
- },
247
- [a, g, v]
248
- ), ye = F(
249
- (e) => {
250
- var y, r, u;
251
- const s = a.length;
252
- if (s === 0 || e.altKey) return;
253
- let t = null;
254
- if (e.key === "ArrowDown" ? t = (x + 1) % s : e.key === "ArrowUp" ? t = (x - 1 + s) % s : e.key === "Home" ? t = 0 : e.key === "End" && (t = s - 1), t === null) return;
255
- const i = e.key === "ArrowUp" || e.key === "End";
256
- let n = t, c = 0;
257
- for (; c < s && ((y = a[n]) != null && y.disabled); )
258
- n = i ? (n - 1 + s) % s : (n + 1) % s, c += 1;
259
- (r = a[n]) != null && r.disabled || (e.preventDefault(), K(n), (u = V.current[n]) == null || u.focus());
260
- },
261
- [a, x]
262
- ), S = m(null);
263
- Te(() => {
264
- const e = S.current;
265
- if (!e) return;
266
- const s = (t) => {
267
- if (t.key !== "Escape" || b < 0) return;
268
- t.preventDefault();
269
- const i = b;
270
- v(null), K(i), requestAnimationFrame(() => {
271
- var n;
272
- (n = V.current[i]) == null || n.focus();
273
- });
274
- };
275
- return e.addEventListener("keydown", s), () => e.removeEventListener("keydown", s);
276
- }, [b, v]), te(() => {
277
- var e;
278
- l && h.current && ((e = _.current) == null || e.focus()), h.current = !1;
279
- }, [l]);
280
- const Z = k === "end" ? "inline-start" : "inline-end", { separatorProps: X, isResizing: Y, isResized: G } = Ce({
281
- edge: Z,
282
- targetRef: _,
283
- cssProperty: ae,
284
- minSize: Pe,
285
- maxSize: Me,
286
- defaultSize: qe,
287
- disabled: !T
288
- }), J = X["aria-valuenow"];
289
- te(() => {
290
- var e;
291
- !T || !G || !l || (e = _.current) == null || e.style.setProperty(
292
- ae,
293
- `${J}px`
294
- );
295
- }, [l, T, G, J]);
296
- const q = m(g);
297
- q.current = g;
298
- const B = R(
299
- () => ({
300
- getActiveToolId: () => q.current,
301
- setActiveTool: (e) => {
302
- h.current = !1, v(e);
303
- },
304
- open: (e) => {
305
- const s = a.find((t) => t.id === e);
306
- !s || s.disabled || (h.current = !1, v(e));
307
- },
308
- close: () => {
309
- const e = q.current;
310
- h.current = !1, v(null), e != null && requestAnimationFrame(() => {
311
- var s, t;
312
- (t = (s = S.current) == null ? void 0 : s.querySelector(
313
- `[data-tool-id="${CSS.escape(e)}"]`
314
- )) == null || t.focus();
315
- });
316
- }
317
- }),
318
- [a, v]
319
- );
320
- ze(ue, () => B, [B]), Ve(de, B, o);
321
- const we = p("toolRail.badgeCountOverflow", {
322
- defaultValue: "99+"
323
- });
324
- return /* @__PURE__ */ D(
325
- "div",
326
- {
327
- ref: S,
328
- "data-component": le,
329
- "data-component-id": o,
330
- "data-side": k,
331
- className: [Be({ side: k }), ce].filter(Boolean).join(" "),
332
- children: [
333
- $ ? /* @__PURE__ */ f("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: be }) : null,
334
- l ? /* @__PURE__ */ D(
335
- "aside",
336
- {
337
- ref: _,
338
- tabIndex: -1,
339
- "aria-label": p("toolRail.panelLabel", {
340
- tool: l.label,
341
- defaultValue: "{{tool}} panel"
342
- }),
343
- "data-tool-rail-state": "expanded",
344
- "data-active-tool": l.id,
345
- "data-resizing": Y ? "" : void 0,
346
- className: [
347
- Ue(),
348
- // Subtle shadow — not a line — separating the panel from the
349
- // icon strip (the tab row). The panel casts a soft chrome
350
- // shadow toward the strip on its strip-facing edge. `z-[1]`
351
- // lifts it above the adjacent strip (the panel is already
352
- // `relative`) so the shadow paints at the seam instead of being
353
- // covered by the strip's opaque background. Only renders while
354
- // the panel is open (the aside is unmounted when collapsed), so
355
- // it never doubles as a rail↔main seam. In the accessible (AAA)
356
- // theme the soft shadow becomes a solid 1px border on that same
357
- // strip-facing edge.
358
- "ds:z-[1]",
359
- k === "end" ? "ds:shadow-[var(--shadow-chrome-end)] ds:[.theme-accessible_&]:border-e ds:[.theme-accessible_&]:border-[var(--border)] ds:[.theme-accessible_&]:shadow-none" : "ds:shadow-[var(--shadow-chrome-start)] ds:[.theme-accessible_&]:border-s ds:[.theme-accessible_&]:border-[var(--border)] ds:[.theme-accessible_&]:shadow-none",
360
- "ds:focus-visible:outline-none"
361
- ].join(" "),
362
- children: [
363
- U ? U(l, { isActive: !0 }) : null,
364
- l.header ? /* @__PURE__ */ f("div", { className: "ds:shrink-0", children: l.header }) : null,
365
- l.fill ? (
366
- // data-tool-fill: a self-scrolling panel owns its own native
367
- // scroll (it can't use the rail's ScrollArea), so a token rule
368
- // paints its scrollbar to match the 8px overlay. See tokens/index.css.
369
- /* @__PURE__ */ f("div", { "data-tool-fill": "", className: "ds:flex-1 ds:min-h-0", children: l.panel })
370
- ) : /* @__PURE__ */ f(
371
- De,
372
- {
373
- orientation: "vertical",
374
- className: "ds:flex-1 ds:min-h-0",
375
- children: l.panel
376
- }
377
- ),
378
- T ? /* @__PURE__ */ f(
379
- "div",
380
- {
381
- ...X,
382
- "aria-label": p("toolRail.resizePanel", {
383
- defaultValue: "Resize tool panel"
384
- }),
385
- "data-resizing": Y ? "" : void 0,
386
- className: He({ edge: Z })
387
- }
388
- ) : null
389
- ]
390
- }
391
- ) : null,
392
- /* @__PURE__ */ f(Ee, { children: /* @__PURE__ */ f(
393
- "div",
394
- {
395
- role: "toolbar",
396
- "aria-orientation": "vertical",
397
- "aria-label": oe ?? p("toolRail.railLabel", { defaultValue: "Tools" }),
398
- className: Fe(),
399
- onKeyDown: ye,
400
- children: a.map((e, s) => {
401
- const t = e.id === g, i = typeof e.badgeCount == "number" && e.badgeCount > 0, n = i ? p("toolRail.toolWithCount", {
402
- tool: e.label,
403
- count: e.badgeCount,
404
- defaultValue: "{{tool}}, {{count}} updates"
405
- }) : e.label, c = $ && !!e.reorderable && !e.disabled, y = c ? `${ge}-${e.id}` : void 0;
406
- return /* @__PURE__ */ D(_e, { children: [
407
- ve && s === H ? /* @__PURE__ */ f(
408
- "div",
409
- {
410
- role: "separator",
411
- "aria-orientation": "horizontal",
412
- className: "ds:my-[var(--spacing-2xs)] ds:h-px ds:w-[var(--spacing-lg)] ds:shrink-0 ds:bg-[var(--border)] ds:forced-colors:bg-[CanvasText]"
413
- }
414
- ) : null,
415
- /* @__PURE__ */ D(
416
- "div",
417
- {
418
- className: Oe({
419
- dragging: I === s,
420
- dropTarget: O === s && I !== s,
421
- reorderable: c
422
- }),
423
- "data-dragging": I === s ? "" : void 0,
424
- draggable: c || void 0,
425
- onDragStart: c ? (r) => {
426
- P(s), r.dataTransfer.effectAllowed = "move", r.dataTransfer.setData(
427
- "text/plain",
428
- String(s)
429
- );
430
- } : void 0,
431
- onDragOver: c ? (r) => {
432
- I !== null && (r.preventDefault(), r.dataTransfer.dropEffect = "move", O !== s && A(s));
433
- } : void 0,
434
- onDragLeave: c ? () => A((r) => r === s ? null : r) : void 0,
435
- onDrop: c ? (r) => {
436
- r.preventDefault();
437
- const u = I;
438
- A(null), P(null), !(u === null || u === s) && W(u, s);
439
- } : void 0,
440
- onDragEnd: c ? () => {
441
- P(null), A(null);
442
- } : void 0,
443
- children: [
444
- /* @__PURE__ */ f(
445
- Se,
446
- {
447
- ref: (r) => {
448
- V.current[s] = r;
449
- },
450
- icon: e.icon,
451
- tooltip: e.label,
452
- "aria-label": n,
453
- intent: "ghost",
454
- size: "sm",
455
- disabled: e.disabled,
456
- "aria-pressed": t,
457
- "aria-expanded": t,
458
- "data-active": t ? e.id : void 0,
459
- "data-tool-id": e.id,
460
- "aria-describedby": y,
461
- "aria-keyshortcuts": c ? "Alt+ArrowUp Alt+ArrowDown" : void 0,
462
- tabIndex: s === x ? 0 : -1,
463
- onFocus: () => {
464
- e.disabled || K(s);
465
- },
466
- onClick: () => he(e.id, j.current),
467
- onKeyDown: (r) => {
468
- if (r.key === "Enter" || r.key === " ") {
469
- j.current = !0;
470
- return;
471
- }
472
- if (c && r.altKey && d) {
473
- let u = null;
474
- if (r.key === "ArrowUp" ? u = s - 1 : r.key === "ArrowDown" ? u = s + 1 : r.key === "Home" ? u = d.first : r.key === "End" && (u = d.last), u !== null) {
475
- r.preventDefault();
476
- const Ie = Math.max(
477
- d.first,
478
- Math.min(d.last, u)
479
- ), xe = e.id;
480
- W(s, Ie), requestAnimationFrame(() => {
481
- var ee, se;
482
- (se = (ee = S.current) == null ? void 0 : ee.querySelector(
483
- `[data-tool-id="${CSS.escape(xe)}"]`
484
- )) == null || se.focus();
485
- });
486
- }
487
- }
488
- },
489
- onKeyUp: (r) => {
490
- (r.key === "Enter" || r.key === " ") && (j.current = !1);
491
- }
492
- }
493
- ),
494
- i ? /* @__PURE__ */ f("span", { "aria-hidden": "true", className: $e(), children: We(
495
- e.badgeCount,
496
- we
497
- ) }) : null,
498
- C == null ? void 0 : C(e, {
499
- index: s,
500
- isActive: t,
501
- isRovingTarget: s === x
502
- }),
503
- y ? /* @__PURE__ */ f("span", { id: y, className: "ds:sr-only", children: p("toolRail.reorderInstructions", {
504
- tool: e.label,
505
- defaultValue: "Reorder {{tool}}. Press Alt + Up or Alt + Down to move."
506
- }) }) : null
507
- ]
508
- }
509
- )
510
- ] }, e.id);
511
- })
512
- }
513
- ) })
514
- ]
515
- }
516
- );
517
- }
518
- );
519
- Ze.displayName = "ToolRail";
520
- export {
521
- Ze as T,
522
- Le as t
523
- };
524
- //# sourceMappingURL=tool-rail-8Scslq3X.js.map