@alfadocs/ui-kit 0.50.1 → 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.
Files changed (139) hide show
  1. package/dist/_chunks/{agenda-card-BaSfVfrL.js → agenda-card-Bl-SBiCh.js} +55 -45
  2. package/dist/_chunks/agenda-tray-DA6qj8BL.js +203 -0
  3. package/dist/_chunks/{ai-consent-banner-F2md5JD3.js → ai-consent-banner-DBKV27je.js} +2 -2
  4. package/dist/_chunks/ai-tools-rail-7tC3GT4h.js +340 -0
  5. package/dist/_chunks/{alert-CUTxnym2.js → alert-_mUKLmwA.js} +54 -44
  6. package/dist/_chunks/{audio-recorder-DVJXV7_k.js → audio-recorder-D6OVfNiZ.js} +2 -2
  7. package/dist/_chunks/{booking-DljH0JkS.js → booking-BUV9fspj.js} +2 -2
  8. package/dist/_chunks/{document-scanner-Cxqvq7GR.js → document-scanner-biBS_f6c.js} +2 -2
  9. package/dist/_chunks/dropdown-menu-DwwPovMZ.js +354 -0
  10. package/dist/_chunks/{editable-currency-cell-renderer-Bh48OHRv.js → editable-currency-cell-renderer-D5C5tCfu.js} +3 -3
  11. package/dist/_chunks/{freemium-paywall-BWaLWje-.js → freemium-paywall-gHGA44dW.js} +2 -2
  12. package/dist/_chunks/{header-settings-Bx0Biimh.js → header-settings-D5Z2B_Yz.js} +3 -3
  13. package/dist/_chunks/{marketplace-app-shell-UKSLx9K_.js → marketplace-app-shell-Dmo1S9av.js} +6 -6
  14. package/dist/_chunks/{patient-search-BJOmTmDA.js → patient-search-CArmRKeg.js} +3 -3
  15. package/dist/_chunks/{patient-shell-DUmhXnFq.js → patient-shell-c2YixkQw.js} +4 -4
  16. package/dist/_chunks/{payment-form-xmeCkxas.js → payment-form-DJ9vnzrT.js} +2 -2
  17. package/dist/_chunks/{pdf-viewer-q1D3Uion.js → pdf-viewer-4odMFuFW.js} +2 -2
  18. package/dist/_chunks/{practice-results-Cq1y8JFD.js → practice-results-CtfciF2v.js} +3 -3
  19. package/dist/_chunks/{pregnancy-dating-DT_244bG.js → pregnancy-dating-BA37LSkF.js} +15 -15
  20. package/dist/_chunks/{recaptcha-widget-CFYyLSEX.js → recaptcha-widget-BCNHsgqt.js} +2 -2
  21. package/dist/_chunks/{sidebar-h78cTNLh.js → sidebar-DPEHzxLZ.js} +397 -346
  22. package/dist/_chunks/{sign-document-CZkAf28g.js → sign-document-Bzld9jVM.js} +2 -2
  23. package/dist/_chunks/{task-card-CPyQ5AXC.js → task-card-BwY9jaV1.js} +48 -42
  24. package/dist/_chunks/task-tray-Cb_hK4yb.js +234 -0
  25. package/dist/_chunks/{theme-toggle-ClATnY4Q.js → theme-toggle-DAW7uC0B.js} +3 -3
  26. package/dist/_chunks/use-edge-resize-ZnGG7gyO.js +139 -0
  27. package/dist/_chunks/use-theme-CAuo6EYT.js +159 -0
  28. package/dist/_chunks/{warning-stack-CXfoAT-_.js → warning-stack-Cv4fr5zo.js} +2 -2
  29. package/dist/_chunks/{workflow-map-DzX_LI4y.js → workflow-map-BJDUNYlX.js} +3 -3
  30. package/dist/agent-catalog.json +1 -1
  31. package/dist/components/agenda-card/agenda-card.d.ts +19 -2
  32. package/dist/components/agenda-card/index.js +1 -1
  33. package/dist/components/agenda-tray/agenda-tray.d.ts +24 -1
  34. package/dist/components/agenda-tray/index.js +1 -1
  35. package/dist/components/ai-consent-banner/index.js +1 -1
  36. package/dist/components/ai-tools-rail/ai-tools-rail.d.ts +8 -0
  37. package/dist/components/ai-tools-rail/index.js +1 -1
  38. package/dist/components/alert/index.js +1 -1
  39. package/dist/components/audio-recorder/index.js +1 -1
  40. package/dist/components/booking/index.js +1 -1
  41. package/dist/components/button-group/button-group.d.ts +1 -1
  42. package/dist/components/checkbox-group/checkbox-group.d.ts +1 -1
  43. package/dist/components/data-table/index.js +1 -1
  44. package/dist/components/document-scanner/index.js +1 -1
  45. package/dist/components/dropdown-menu/dropdown-menu.d.ts +2 -0
  46. package/dist/components/dropdown-menu/index.js +1 -1
  47. package/dist/components/form-field/form-field.d.ts +1 -1
  48. package/dist/components/freemium-paywall/index.js +1 -1
  49. package/dist/components/header-settings/index.js +1 -1
  50. package/dist/components/icon-button-group/icon-button-group.d.ts +15 -15
  51. package/dist/components/key-value-pair/key-value-pair.d.ts +1 -1
  52. package/dist/components/patient-search/index.js +1 -1
  53. package/dist/components/payment-form/index.js +1 -1
  54. package/dist/components/pdf-viewer/index.js +1 -1
  55. package/dist/components/practice-results/index.js +1 -1
  56. package/dist/components/pregnancy-dating/index.js +1 -1
  57. package/dist/components/radio-group/radio-group.d.ts +1 -1
  58. package/dist/components/recaptcha-widget/index.js +1 -1
  59. package/dist/components/separator/separator.d.ts +1 -1
  60. package/dist/components/sidebar/index.js +1 -1
  61. package/dist/components/sidebar/sidebar.d.ts +8 -0
  62. package/dist/components/sign-document/index.js +1 -1
  63. package/dist/components/tabs/tabs.d.ts +2 -2
  64. package/dist/components/task-card/index.js +1 -1
  65. package/dist/components/task-card/task-card.d.ts +15 -1
  66. package/dist/components/task-tray/index.js +1 -1
  67. package/dist/components/task-tray/task-tray.d.ts +24 -1
  68. package/dist/components/theme-toggle/index.js +1 -1
  69. package/dist/components/warning-stack/index.js +1 -1
  70. package/dist/components/workflow/index.js +1 -1
  71. package/dist/components/workflow/workflow-map.d.ts +1 -1
  72. package/dist/hooks/index.d.ts +1 -0
  73. package/dist/hooks/index.js +12 -10
  74. package/dist/hooks/use-edge-resize.d.ts +78 -0
  75. package/dist/i18n/locales/ar.d.ts +4 -0
  76. package/dist/i18n/locales/ar.js +7 -3
  77. package/dist/i18n/locales/de.d.ts +4 -0
  78. package/dist/i18n/locales/de.js +7 -3
  79. package/dist/i18n/locales/el.d.ts +4 -0
  80. package/dist/i18n/locales/el.js +7 -3
  81. package/dist/i18n/locales/en.d.ts +4 -0
  82. package/dist/i18n/locales/en.js +7 -3
  83. package/dist/i18n/locales/es.d.ts +4 -0
  84. package/dist/i18n/locales/es.js +7 -3
  85. package/dist/i18n/locales/fr.d.ts +4 -0
  86. package/dist/i18n/locales/fr.js +7 -3
  87. package/dist/i18n/locales/hi.d.ts +4 -0
  88. package/dist/i18n/locales/hi.js +7 -3
  89. package/dist/i18n/locales/it.d.ts +4 -0
  90. package/dist/i18n/locales/it.js +7 -3
  91. package/dist/i18n/locales/ja.d.ts +4 -0
  92. package/dist/i18n/locales/ja.js +7 -3
  93. package/dist/i18n/locales/nl.d.ts +4 -0
  94. package/dist/i18n/locales/nl.js +7 -3
  95. package/dist/i18n/locales/pl.d.ts +4 -0
  96. package/dist/i18n/locales/pl.js +7 -3
  97. package/dist/i18n/locales/pt.d.ts +4 -0
  98. package/dist/i18n/locales/pt.js +7 -3
  99. package/dist/i18n/locales/ro.d.ts +4 -0
  100. package/dist/i18n/locales/ro.js +7 -3
  101. package/dist/i18n/locales/ru.d.ts +4 -0
  102. package/dist/i18n/locales/ru.js +7 -3
  103. package/dist/i18n/locales/sq.d.ts +4 -0
  104. package/dist/i18n/locales/sq.js +7 -3
  105. package/dist/i18n/locales/sv.d.ts +4 -0
  106. package/dist/i18n/locales/sv.js +7 -3
  107. package/dist/i18n/locales/tr.d.ts +4 -0
  108. package/dist/i18n/locales/tr.js +7 -3
  109. package/dist/i18n/locales/zh.d.ts +4 -0
  110. package/dist/i18n/locales/zh.js +7 -3
  111. package/dist/index.js +27 -27
  112. package/dist/locales/ar.json +7 -3
  113. package/dist/locales/de.json +7 -3
  114. package/dist/locales/el.json +7 -3
  115. package/dist/locales/en.json +7 -3
  116. package/dist/locales/es.json +7 -3
  117. package/dist/locales/fr.json +7 -3
  118. package/dist/locales/hi.json +7 -3
  119. package/dist/locales/it.json +7 -3
  120. package/dist/locales/ja.json +7 -3
  121. package/dist/locales/nl.json +7 -3
  122. package/dist/locales/pl.json +7 -3
  123. package/dist/locales/pt.json +7 -3
  124. package/dist/locales/ro.json +7 -3
  125. package/dist/locales/ru.json +7 -3
  126. package/dist/locales/sq.json +7 -3
  127. package/dist/locales/sv.json +7 -3
  128. package/dist/locales/tr.json +7 -3
  129. package/dist/locales/zh.json +7 -3
  130. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  131. package/dist/patterns/patient-shell/index.js +1 -1
  132. package/dist/tokens.css +1 -1
  133. package/package.json +1 -1
  134. package/dist/_chunks/agenda-tray-DQayYmQ0.js +0 -165
  135. package/dist/_chunks/ai-tools-rail-CYLWrRmm.js +0 -280
  136. package/dist/_chunks/circle-arrow-up-CC_85SuH.js +0 -16
  137. package/dist/_chunks/dropdown-menu-CUEXqKis.js +0 -299
  138. package/dist/_chunks/task-tray-B8jFv5FV.js +0 -196
  139. package/dist/_chunks/use-theme-C2dHKUAN.js +0 -145
@@ -1,299 +0,0 @@
1
- import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
- import { forwardRef as d, useContext as O, useRef as G, useEffect as P, useMemo as L, createContext as A } from "react";
3
- import * as n from "@radix-ui/react-dropdown-menu";
4
- import { c as h } from "./index-D2ZczOXr.js";
5
- import { S as E } from "./separator-CYU_bGFn.js";
6
- import { K as g } from "./kbd-D855ZXIW.js";
7
- import { u as K } from "./use-controllable-state-BiY4xTzM.js";
8
- import { C as V } from "./chevron-right-BrpYejk0.js";
9
- import { C as x } from "./check-DPdL_Sm7.js";
10
- import { a as B } from "./use-direction-Dp8h70PP.js";
11
- import { u as H } from "./registry-nPAVE19X.js";
12
- const q = {
13
- id: "dropdown-menu",
14
- capabilities: ["open", "close", "pick"],
15
- state: {
16
- isOpen: {
17
- type: "boolean",
18
- description: "True when the menu is currently open.",
19
- read: (s) => s.getIsOpen()
20
- }
21
- },
22
- actions: {
23
- open: {
24
- safety: "read",
25
- description: "Open the menu.",
26
- invoke: (s) => {
27
- s.open();
28
- }
29
- },
30
- close: {
31
- safety: "read",
32
- description: "Close the menu.",
33
- invoke: (s) => {
34
- s.close();
35
- }
36
- }
37
- },
38
- domHooks: {
39
- root: { attr: "data-component", value: "dropdown-menu" },
40
- instanceId: {
41
- attr: "data-component-id",
42
- sourceProp: "id",
43
- description: "Sourced from the id prop on DropdownMenu.Root."
44
- },
45
- item: {
46
- attr: "data-item-id",
47
- description: "Each menu item emits its value as data-item-id."
48
- }
49
- }
50
- }, b = h(
51
- [
52
- "ds:z-[var(--z-dropdown)]",
53
- "ds:min-w-[8rem]",
54
- "ds:rounded-[var(--radius-md)]",
55
- // Border kept (transparent) so the forced-colors override below can
56
- // repaint a visible edge in HCM. In normal modes the soft drop-shadow
57
- // carries the edge cue; the heavy `--border` (grey-800 since WCAG
58
- // 1.4.11 bump in 67fef8c) made the menu read as a charcoal box.
59
- "ds:border ds:border-transparent",
60
- "ds:bg-[var(--popover)] ds:text-[color:var(--popover-foreground)]",
61
- "ds:shadow-[var(--shadow-lg)]",
62
- "ds:p-[var(--spacing-xs)]",
63
- // Motion — gated on --animation-duration via Tailwind's animate-in
64
- // preset. motion-reduce disables via the no-preference query.
65
- "ds:data-[state=open]:animate-in ds:data-[state=closed]:animate-out",
66
- "ds:data-[state=open]:fade-in ds:data-[state=closed]:fade-out",
67
- "ds:data-[state=open]:zoom-in-95 ds:data-[state=closed]:zoom-out-95",
68
- "ds:motion-reduce:animate-none",
69
- "ds:forced-colors:border-[CanvasText]"
70
- ].join(" ")
71
- ), p = h(
72
- [
73
- "ds:relative ds:flex ds:items-center ds:gap-[var(--spacing-sm)]",
74
- "ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]",
75
- "ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]",
76
- "ds:rounded-[var(--radius-sm)]",
77
- "ds:min-h-[var(--min-target-size)]",
78
- "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--foreground)]",
79
- "ds:cursor-pointer ds:select-none ds:outline-none",
80
- // Highlighted + hover state
81
- "ds:data-[highlighted]:bg-[color:var(--muted)]/40",
82
- "ds:focus-visible:outline-[length:var(--focus-ring-width)]",
83
- "ds:focus-visible:outline-solid ds:focus-visible:outline-[color:var(--ring)]",
84
- "ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
85
- "ds:forced-colors:focus-visible:outline-[CanvasText]",
86
- // Disabled
87
- "ds:data-[disabled]:opacity-50 ds:data-[disabled]:cursor-not-allowed",
88
- "ds:data-[disabled]:pointer-events-none"
89
- ].join(" ")
90
- ), F = h(
91
- [
92
- "ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]",
93
- "ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]",
94
- "type-eyebrow ds:text-[color:var(--muted-foreground)]",
95
- "ds:select-none"
96
- ].join(" ")
97
- ), N = "ds:inline-flex ds:items-center ds:justify-center ds:size-4 ds:shrink-0", w = A(void 0), C = ({
98
- dir: s,
99
- id: a,
100
- open: o,
101
- defaultOpen: t,
102
- onOpenChange: r,
103
- ...m
104
- }) => {
105
- const u = B(), [f, c] = K({
106
- value: o,
107
- defaultValue: t ?? !1,
108
- onChange: r
109
- }), l = f ?? !1, v = G(l);
110
- P(() => {
111
- v.current = l;
112
- }, [l]);
113
- const T = L(
114
- () => ({
115
- getIsOpen: () => v.current,
116
- open: () => c(!0),
117
- close: () => c(!1)
118
- }),
119
- [c]
120
- );
121
- return H(q, T, a), /* @__PURE__ */ e(w.Provider, { value: a, children: /* @__PURE__ */ e(
122
- n.Root,
123
- {
124
- dir: s ?? u,
125
- open: l,
126
- onOpenChange: c,
127
- ...m
128
- }
129
- ) });
130
- };
131
- C.displayName = "DropdownMenu.Root";
132
- const J = n.Trigger, Q = n.Portal, U = n.Group, W = n.RadioGroup, y = d(({ className: s, sideOffset: a = 8, ...o }, t) => {
133
- const r = O(w);
134
- return /* @__PURE__ */ e(n.Portal, { children: /* @__PURE__ */ e(
135
- n.Content,
136
- {
137
- ref: t,
138
- sideOffset: a,
139
- className: b({ className: s }),
140
- "data-component": "dropdown-menu",
141
- "data-component-id": r,
142
- ...o
143
- }
144
- ) });
145
- });
146
- y.displayName = "DropdownMenu.Content";
147
- const R = d(
148
- ({
149
- className: s,
150
- startIcon: a,
151
- endIcon: o,
152
- description: t,
153
- shortcut: r,
154
- children: m,
155
- ...u
156
- }, f) => /* @__PURE__ */ i(
157
- n.Item,
158
- {
159
- ref: f,
160
- className: p({ className: s }),
161
- ...u,
162
- children: [
163
- a ? /* @__PURE__ */ e(
164
- "span",
165
- {
166
- "aria-hidden": "true",
167
- className: "ds:inline-flex ds:size-4 ds:shrink-0 ds:items-center ds:justify-center",
168
- children: a
169
- }
170
- ) : null,
171
- /* @__PURE__ */ i("span", { className: "ds:flex-1 ds:flex ds:flex-col ds:min-w-0", children: [
172
- /* @__PURE__ */ e("span", { className: "ds:truncate", children: m }),
173
- t ? /* @__PURE__ */ e("span", { className: "type-meta ds:text-[color:var(--muted-foreground)] ds:truncate", children: t }) : null
174
- ] }),
175
- r ? /* @__PURE__ */ e("span", { className: "ds:ms-auto", children: /* @__PURE__ */ e(g, { keys: r, size: "sm" }) }) : o ? /* @__PURE__ */ e(
176
- "span",
177
- {
178
- "aria-hidden": "true",
179
- className: "ds:ms-auto ds:inline-flex ds:size-4 ds:shrink-0 ds:items-center ds:justify-center",
180
- children: o
181
- }
182
- ) : null
183
- ]
184
- }
185
- )
186
- );
187
- R.displayName = "DropdownMenu.Item";
188
- const S = d(({ className: s, children: a, ...o }, t) => /* @__PURE__ */ i(
189
- n.CheckboxItem,
190
- {
191
- ref: t,
192
- className: p({ className: s }),
193
- ...o,
194
- children: [
195
- /* @__PURE__ */ e("span", { className: N, children: /* @__PURE__ */ e(n.ItemIndicator, { children: /* @__PURE__ */ e(x, { "aria-hidden": !0, className: "ds:size-4" }) }) }),
196
- /* @__PURE__ */ e("span", { className: "ds:flex-1 ds:truncate", children: a })
197
- ]
198
- }
199
- ));
200
- S.displayName = "DropdownMenu.CheckboxItem";
201
- const X = W, D = d(({ className: s, children: a, ...o }, t) => /* @__PURE__ */ i(
202
- n.RadioItem,
203
- {
204
- ref: t,
205
- className: p({ className: s }),
206
- ...o,
207
- children: [
208
- /* @__PURE__ */ e("span", { className: N, children: /* @__PURE__ */ e(n.ItemIndicator, { children: /* @__PURE__ */ e(
209
- x,
210
- {
211
- "aria-hidden": !0,
212
- className: "ds:size-4 ds:text-[color:var(--accent)]"
213
- }
214
- ) }) }),
215
- /* @__PURE__ */ e("span", { className: "ds:flex-1 ds:truncate", children: a })
216
- ]
217
- }
218
- ));
219
- D.displayName = "DropdownMenu.RadioItem";
220
- const M = d(({ className: s, ...a }, o) => /* @__PURE__ */ e(
221
- n.Label,
222
- {
223
- ref: o,
224
- className: F({ className: s }),
225
- ...a
226
- }
227
- ));
228
- M.displayName = "DropdownMenu.Label";
229
- const z = d(({ className: s, ...a }, o) => /* @__PURE__ */ e(n.Separator, { ref: o, asChild: !0, ...a, children: /* @__PURE__ */ e(
230
- E,
231
- {
232
- className: ["ds:my-[calc(var(--spacing-xs)/2)]", s ?? ""].filter(Boolean).join(" ")
233
- }
234
- ) }));
235
- z.displayName = "DropdownMenu.Separator";
236
- const I = d(
237
- ({ keys: s, separator: a = "none" }, o) => /* @__PURE__ */ e("span", { ref: o, className: "ds:ms-auto ds:ps-[var(--spacing-sm)]", children: /* @__PURE__ */ e(g, { keys: s, separator: a, size: "sm" }) })
238
- );
239
- I.displayName = "DropdownMenu.Shortcut";
240
- const Y = n.Sub, k = d(({ className: s, startIcon: a, children: o, ...t }, r) => /* @__PURE__ */ i(
241
- n.SubTrigger,
242
- {
243
- ref: r,
244
- className: p({ className: s }),
245
- ...t,
246
- children: [
247
- a ? /* @__PURE__ */ e(
248
- "span",
249
- {
250
- "aria-hidden": "true",
251
- className: "ds:inline-flex ds:size-4 ds:shrink-0 ds:items-center ds:justify-center",
252
- children: a
253
- }
254
- ) : null,
255
- /* @__PURE__ */ e("span", { className: "ds:flex-1 ds:truncate", children: o }),
256
- /* @__PURE__ */ e(
257
- V,
258
- {
259
- "aria-hidden": !0,
260
- className: "ds:ms-auto ds:size-4 ds:shrink-0 ds:rtl:-scale-x-100"
261
- }
262
- )
263
- ]
264
- }
265
- ));
266
- k.displayName = "DropdownMenu.SubTrigger";
267
- const j = d(({ className: s, ...a }, o) => /* @__PURE__ */ e(n.Portal, { children: /* @__PURE__ */ e(
268
- n.SubContent,
269
- {
270
- ref: o,
271
- sideOffset: 8,
272
- "data-component": "dropdown-menu-sub-content",
273
- className: b({ className: s }),
274
- ...a
275
- }
276
- ) }));
277
- j.displayName = "DropdownMenu.SubContent";
278
- const re = {
279
- Root: C,
280
- Trigger: J,
281
- Portal: Q,
282
- Content: y,
283
- Group: U,
284
- Item: R,
285
- CheckboxItem: S,
286
- RadioGroup: X,
287
- RadioItem: D,
288
- Label: M,
289
- Separator: z,
290
- Shortcut: I,
291
- Sub: Y,
292
- SubTrigger: k,
293
- SubContent: j
294
- };
295
- export {
296
- re as D,
297
- q as d
298
- };
299
- //# sourceMappingURL=dropdown-menu-CUEXqKis.js.map
@@ -1,196 +0,0 @@
1
- import { jsx as a, jsxs as p } from "react/jsx-runtime";
2
- import { forwardRef as j, useRef as v, useMemo as q, useImperativeHandle as z } from "react";
3
- import { c as M } from "./index-D2ZczOXr.js";
4
- import { useTranslation as S } from "react-i18next";
5
- import { I as C } from "./icon-button-CKEOrN37.js";
6
- import { S as K } from "./skeleton-CZbwyJAA.js";
7
- import { E } from "./empty-state-BLy7tigq.js";
8
- import { T as L } from "./task-card-CPyQ5AXC.js";
9
- import { u as P } from "./registry-nPAVE19X.js";
10
- import { c as H } from "./createLucideIcon-CrFbzy84.js";
11
- import { P as V } from "./plus-CYKNmfuA.js";
12
- /**
13
- * @license lucide-react v1.8.0 - ISC
14
- *
15
- * This source code is licensed under the ISC license.
16
- * See the LICENSE file in the root directory of this source tree.
17
- */
18
- const B = [
19
- ["path", { d: "M13 5h8", key: "a7qcls" }],
20
- ["path", { d: "M13 12h8", key: "h98zly" }],
21
- ["path", { d: "M13 19h8", key: "c3s6r1" }],
22
- ["path", { d: "m3 17 2 2 4-4", key: "1jhpwq" }],
23
- ["rect", { x: "3", y: "4", width: "6", height: "6", rx: "1", key: "cif1o7" }]
24
- ], F = H("list-todo", B), G = {
25
- id: "task-tray",
26
- capabilities: ["select_single", "dismiss"],
27
- state: {
28
- items: {
29
- type: "Array<{ id: string; status: string }>",
30
- descriptionKey: "ui.agent.taskTray.state.items",
31
- description: "Currently-displayed tasks. Ids + status only — never task title / patient.",
32
- read: (e) => e.getItems()
33
- }
34
- },
35
- actions: {
36
- select_item: {
37
- safety: "read",
38
- argsType: "{ id: string }",
39
- descriptionKey: "ui.agent.taskTray.actions.selectItem",
40
- description: "Activate the task with the given id.",
41
- invoke: (e, s) => {
42
- e.selectItem(s.id);
43
- }
44
- },
45
- toggle_done: {
46
- safety: "write",
47
- argsType: "{ id: string }",
48
- descriptionKey: "ui.agent.taskTray.actions.toggleDone",
49
- description: "Request the host to toggle the done state of a task.",
50
- invoke: (e, s) => {
51
- e.toggleDone(s.id);
52
- }
53
- },
54
- dismiss: {
55
- safety: "destructive",
56
- argsType: "{ id: string }",
57
- descriptionKey: "ui.agent.taskTray.actions.dismiss",
58
- description: "Request the host to dismiss / remove the task with the given id.",
59
- invoke: (e, s) => {
60
- e.dismiss(s.id);
61
- }
62
- }
63
- },
64
- domHooks: {
65
- root: {
66
- attr: "data-component",
67
- value: "task-tray",
68
- description: "Marks the TaskTray wrapper."
69
- },
70
- instanceId: {
71
- attr: "data-component-id",
72
- sourceProp: "id",
73
- description: "Sourced from the id prop. Required to address a specific tray from the agent."
74
- },
75
- item: {
76
- attr: "data-task-id",
77
- description: "Stable task id emitted on each rendered TaskCard inside the tray."
78
- }
79
- }
80
- }, J = M(
81
- [
82
- "ds:flex ds:flex-col",
83
- "ds:rounded-[var(--radius-md)] ds:shadow-[var(--shadow-card)]",
84
- "ds:border ds:border-[color:var(--card-border)] ds:[.theme-accessible_&]:border-2",
85
- "ds:bg-[color:var(--card)] ds:text-[color:var(--card-foreground)]",
86
- "ds:overflow-hidden"
87
- ].join(" "),
88
- {
89
- variants: {
90
- size: {
91
- sm: "",
92
- md: ""
93
- }
94
- },
95
- defaultVariants: {
96
- size: "sm"
97
- }
98
- }
99
- ), Q = j(
100
- ({
101
- id: e,
102
- items: s,
103
- title: k,
104
- size: f = "sm",
105
- onOpenTask: i,
106
- onToggleDone: n,
107
- onDismissTask: c,
108
- onAddTask: y,
109
- addLabel: x,
110
- loading: h = !1,
111
- emptyTitle: b,
112
- emptyDescription: w,
113
- className: I,
114
- ...N
115
- }, T) => {
116
- const { t: l } = S(), u = k ?? l("taskTray.title", "Tasks"), R = x ?? l("taskTray.add", "Add task"), A = !h && s.length === 0;
117
- let m;
118
- h ? m = /* @__PURE__ */ a("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)]", children: [0, 1, 2].map((t) => /* @__PURE__ */ a(K, { variant: "rectangular", height: "2.5rem" }, t)) }) : A ? m = /* @__PURE__ */ a("div", { className: "ds:p-[var(--spacing-md)]", children: /* @__PURE__ */ a(
119
- E,
120
- {
121
- variant: "first-use",
122
- size: "sm",
123
- title: b ?? l("taskTray.empty.title", "No tasks yet"),
124
- description: w ?? l("taskTray.empty.description", "New tasks will appear here.")
125
- }
126
- ) }) : m = /* @__PURE__ */ a("ul", { className: "ds:flex ds:list-none ds:flex-col", children: s.map((t) => /* @__PURE__ */ a(
127
- L,
128
- {
129
- item: t,
130
- size: f,
131
- onActivate: i,
132
- "data-task-id": t.id
133
- },
134
- t.id
135
- )) });
136
- const d = v(s);
137
- d.current = s;
138
- const _ = q(
139
- () => ({
140
- getItems: () => d.current.map((t) => ({
141
- id: t.id,
142
- status: t.status ?? "open"
143
- })),
144
- selectItem: (t) => {
145
- const r = d.current.find((o) => o.id === t);
146
- r && (i == null || i(r));
147
- },
148
- toggleDone: (t) => {
149
- const r = d.current.find((o) => o.id === t);
150
- r && (n == null || n(r));
151
- },
152
- dismiss: (t) => {
153
- const r = d.current.find((o) => o.id === t);
154
- r && (c == null || c(r));
155
- }
156
- }),
157
- [i, n, c]
158
- ), g = v(null);
159
- return z(T, () => g.current, []), P(G, _, e), /* @__PURE__ */ p(
160
- "section",
161
- {
162
- ref: g,
163
- "aria-label": u,
164
- "data-component": "task-tray",
165
- "data-component-id": e,
166
- className: J({ size: f, className: I }),
167
- ...N,
168
- children: [
169
- /* @__PURE__ */ p("header", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)]", children: [
170
- /* @__PURE__ */ p("h3", { className: "ds:m-0 ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-title-card", children: [
171
- /* @__PURE__ */ a(F, { "aria-hidden": "true", className: "ds:size-4" }),
172
- u
173
- ] }),
174
- y ? /* @__PURE__ */ a(
175
- C,
176
- {
177
- icon: /* @__PURE__ */ a(V, {}),
178
- intent: "outline",
179
- size: "sm",
180
- "aria-label": R,
181
- onClick: y
182
- }
183
- ) : null
184
- ] }),
185
- m
186
- ]
187
- }
188
- );
189
- }
190
- );
191
- Q.displayName = "TaskTray";
192
- export {
193
- Q as T,
194
- G as t
195
- };
196
- //# sourceMappingURL=task-tray-B8jFv5FV.js.map
@@ -1,145 +0,0 @@
1
- import { useSyncExternalStore as D, useEffect as b, useCallback as p } from "react";
2
- const y = "alfadocs-ui.theme", w = "alfadocs-ui.accessibility", r = {
3
- light: "theme-light",
4
- dark: "theme-dark",
5
- accessible: "theme-accessible"
6
- }, M = "(prefers-color-scheme: dark)", C = "(prefers-contrast: more)";
7
- function g(e) {
8
- if (typeof window > "u") return null;
9
- try {
10
- return window.localStorage.getItem(e);
11
- } catch {
12
- return null;
13
- }
14
- }
15
- function S(e, t) {
16
- if (!(typeof window > "u"))
17
- try {
18
- t === null ? window.localStorage.removeItem(e) : window.localStorage.setItem(e, t);
19
- } catch {
20
- }
21
- }
22
- function L(e) {
23
- return e === "light" || e === "dark" || e === "system";
24
- }
25
- function T(e) {
26
- return e === "default" || e === "accessible" || e === "system";
27
- }
28
- function O() {
29
- const e = g(y), t = g(w), i = typeof window < "u" && typeof window.matchMedia == "function", s = typeof document < "u" ? document.documentElement.classList : null, A = s ? s.contains(r.dark) ? "dark" : s.contains(r.light) ? "light" : null : null, _ = s != null && s.contains(r.accessible) ? "accessible" : null;
30
- return {
31
- theme: L(e) ? e : A ?? "system",
32
- accessibility: T(t) ? t : _ ?? "system",
33
- prefersDark: i ? window.matchMedia(M).matches : !1,
34
- prefersMoreContrast: i ? window.matchMedia(C).matches : !1
35
- };
36
- }
37
- let n = O();
38
- const h = /* @__PURE__ */ new Set();
39
- function c(e) {
40
- e.theme === n.theme && e.accessibility === n.accessibility && e.prefersDark === n.prefersDark && e.prefersMoreContrast === n.prefersMoreContrast || (n = e, h.forEach((t) => t()));
41
- }
42
- function I(e) {
43
- return h.add(e), () => {
44
- h.delete(e);
45
- };
46
- }
47
- function R() {
48
- return n;
49
- }
50
- function V() {
51
- return {
52
- theme: "system",
53
- accessibility: "system",
54
- prefersDark: !1,
55
- prefersMoreContrast: !1
56
- };
57
- }
58
- let d = 0, u = null, f = null, l = null;
59
- function v(e) {
60
- c({ ...n, prefersDark: e.matches });
61
- }
62
- function H(e) {
63
- c({ ...n, prefersMoreContrast: e.matches });
64
- }
65
- function Y(e) {
66
- if (e.key === y) {
67
- const t = L(e.newValue) ? e.newValue : "system";
68
- c({ ...n, theme: t });
69
- } else if (e.key === w) {
70
- const t = T(e.newValue) ? e.newValue : "system";
71
- c({ ...n, accessibility: t });
72
- }
73
- }
74
- function E(e, t) {
75
- return typeof e.addEventListener == "function" ? (e.addEventListener("change", t), () => e.removeEventListener("change", t)) : (e.addListener(t), () => e.removeListener(t));
76
- }
77
- function G() {
78
- return d += 1, d > 1 || typeof window > "u" || (typeof window.matchMedia == "function" && (u = window.matchMedia(M), f = window.matchMedia(C), c({
79
- ...n,
80
- prefersDark: u.matches,
81
- prefersMoreContrast: f.matches
82
- }), o = E(u, v), a = E(f, H)), l = Y, window.addEventListener("storage", l)), m;
83
- }
84
- let o = null, a = null;
85
- function m() {
86
- d -= 1, !(d > 0) && (o == null || o(), a == null || a(), o = null, a = null, u = null, f = null, l && typeof window < "u" && window.removeEventListener("storage", l), l = null);
87
- }
88
- function k(e) {
89
- const t = e.theme === "system" ? e.prefersDark ? "dark" : "light" : e.theme, i = e.accessibility === "system" ? e.prefersMoreContrast : e.accessibility === "accessible";
90
- return t === "dark" && i ? "dark-accessible" : t === "dark" ? "dark" : i ? "light-accessible" : "light";
91
- }
92
- function K(e) {
93
- switch (e) {
94
- case "light":
95
- return [r.light];
96
- case "dark":
97
- return [r.dark];
98
- case "light-accessible":
99
- return [r.light, r.accessible];
100
- case "dark-accessible":
101
- return [r.dark, r.accessible];
102
- }
103
- }
104
- const Q = [
105
- r.light,
106
- r.dark,
107
- r.accessible
108
- ];
109
- function U(e) {
110
- if (typeof document > "u") return;
111
- const t = document.documentElement, i = new Set(K(e));
112
- Q.forEach((s) => {
113
- i.has(s) ? t.classList.add(s) : t.classList.remove(s);
114
- });
115
- }
116
- function N() {
117
- const e = D(I, R, V);
118
- b(() => G(), []), b(() => {
119
- U(k(e));
120
- }, [e]);
121
- const t = p((s) => {
122
- S(y, s === "system" ? null : s), c({ ...n, theme: s });
123
- }, []), i = p((s) => {
124
- S(
125
- w,
126
- s === "system" ? null : s
127
- ), c({ ...n, accessibility: s });
128
- }, []);
129
- return {
130
- theme: e.theme,
131
- accessibility: e.accessibility,
132
- resolvedTheme: k(e),
133
- setTheme: t,
134
- setAccessibility: i
135
- };
136
- }
137
- export {
138
- w as A,
139
- r as T,
140
- y as a,
141
- k as r,
142
- K as t,
143
- N as u
144
- };
145
- //# sourceMappingURL=use-theme-C2dHKUAN.js.map