@vobs/ui 1.0.0 → 1.2.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 (301) hide show
  1. package/dist/activity-rail.cjs +796 -0
  2. package/dist/activity-rail.cjs.map +1 -0
  3. package/dist/activity-rail.d.cts +20 -0
  4. package/dist/activity-rail.d.ts +20 -0
  5. package/dist/activity-rail.js +794 -0
  6. package/dist/activity-rail.js.map +1 -0
  7. package/dist/alert.cjs +671 -0
  8. package/dist/alert.cjs.map +1 -0
  9. package/dist/alert.d.cts +13 -0
  10. package/dist/alert.d.ts +13 -0
  11. package/dist/alert.js +669 -0
  12. package/dist/alert.js.map +1 -0
  13. package/dist/assets/icons/alert-circle.svg +1 -0
  14. package/dist/assets/icons/alert-triangle.svg +1 -0
  15. package/dist/assets/icons/alert.d27e24.svg +1 -0
  16. package/dist/assets/icons/alert.svg +1 -0
  17. package/dist/assets/icons/apple.svg +1 -0
  18. package/dist/assets/icons/arrow-down.svg +1 -0
  19. package/dist/assets/icons/arrow-expand.svg +1 -0
  20. package/dist/assets/icons/arrow-left.svg +1 -0
  21. package/dist/assets/icons/arrow-minimize.svg +1 -0
  22. package/dist/assets/icons/arrow-right-to-line.svg +1 -0
  23. package/dist/assets/icons/arrow-right.svg +1 -0
  24. package/dist/assets/icons/arrow-up-right.svg +1 -0
  25. package/dist/assets/icons/arrow-up.0c0c0d.svg +1 -0
  26. package/dist/assets/icons/arrow-up.svg +1 -0
  27. package/dist/assets/icons/at.svg +1 -0
  28. package/dist/assets/icons/atom.0c0c0d.svg +1 -0
  29. package/dist/assets/icons/atom.svg +1 -0
  30. package/dist/assets/icons/bar.svg +1 -0
  31. package/dist/assets/icons/bell.svg +1 -0
  32. package/dist/assets/icons/box.svg +1 -0
  33. package/dist/assets/icons/bug.svg +1 -0
  34. package/dist/assets/icons/calendar.svg +1 -0
  35. package/dist/assets/icons/check-circle.33c192.svg +1 -0
  36. package/dist/assets/icons/check-circle.svg +1 -0
  37. package/dist/assets/icons/check.d1d3db.svg +1 -0
  38. package/dist/assets/icons/check.svg +1 -0
  39. package/dist/assets/icons/chevron-down.svg +1 -0
  40. package/dist/assets/icons/chevron-right.svg +1 -0
  41. package/dist/assets/icons/chevron-up.svg +1 -0
  42. package/dist/assets/icons/circle.svg +1 -0
  43. package/dist/assets/icons/clock.svg +1 -0
  44. package/dist/assets/icons/cmd.svg +1 -0
  45. package/dist/assets/icons/code.svg +1 -0
  46. package/dist/assets/icons/columns.svg +1 -0
  47. package/dist/assets/icons/copy.svg +1 -0
  48. package/dist/assets/icons/cpu.svg +1 -0
  49. package/dist/assets/icons/dashboard.0c0c0d.svg +1 -0
  50. package/dist/assets/icons/dashboard.svg +1 -0
  51. package/dist/assets/icons/dollar.svg +1 -0
  52. package/dist/assets/icons/download.svg +1 -0
  53. package/dist/assets/icons/edit.svg +1 -0
  54. package/dist/assets/icons/extensions.svg +1 -0
  55. package/dist/assets/icons/external.svg +1 -0
  56. package/dist/assets/icons/eye.svg +1 -0
  57. package/dist/assets/icons/file-text.svg +1 -0
  58. package/dist/assets/icons/file.svg +1 -0
  59. package/dist/assets/icons/files.svg +1 -0
  60. package/dist/assets/icons/filter.svg +1 -0
  61. package/dist/assets/icons/folder.svg +1 -0
  62. package/dist/assets/icons/gear.svg +1 -0
  63. package/dist/assets/icons/git.svg +1 -0
  64. package/dist/assets/icons/github.svg +1 -0
  65. package/dist/assets/icons/globe.svg +1 -0
  66. package/dist/assets/icons/grid-2x2.svg +1 -0
  67. package/dist/assets/icons/hash.svg +1 -0
  68. package/dist/assets/icons/heart.svg +1 -0
  69. package/dist/assets/icons/help.svg +1 -0
  70. package/dist/assets/icons/home.svg +1 -0
  71. package/dist/assets/icons/image.svg +1 -0
  72. package/dist/assets/icons/info-circle.svg +1 -0
  73. package/dist/assets/icons/info-square.svg +1 -0
  74. package/dist/assets/icons/info.387bff.svg +1 -0
  75. package/dist/assets/icons/info.svg +1 -0
  76. package/dist/assets/icons/key.svg +1 -0
  77. package/dist/assets/icons/layers.svg +1 -0
  78. package/dist/assets/icons/layout.svg +1 -0
  79. package/dist/assets/icons/link.svg +1 -0
  80. package/dist/assets/icons/list.svg +1 -0
  81. package/dist/assets/icons/lock.svg +1 -0
  82. package/dist/assets/icons/log-out.svg +1 -0
  83. package/dist/assets/icons/logo.svg +1 -0
  84. package/dist/assets/icons/mail.svg +1 -0
  85. package/dist/assets/icons/menu.svg +1 -0
  86. package/dist/assets/icons/message-circle.svg +1 -0
  87. package/dist/assets/icons/message-plus.svg +1 -0
  88. package/dist/assets/icons/message-square.svg +1 -0
  89. package/dist/assets/icons/mic.svg +1 -0
  90. package/dist/assets/icons/minus.svg +1 -0
  91. package/dist/assets/icons/moon.svg +1 -0
  92. package/dist/assets/icons/more-h.svg +1 -0
  93. package/dist/assets/icons/mouse.svg +1 -0
  94. package/dist/assets/icons/palette.svg +1 -0
  95. package/dist/assets/icons/panel-bottom.svg +1 -0
  96. package/dist/assets/icons/pause.svg +1 -0
  97. package/dist/assets/icons/play.svg +1 -0
  98. package/dist/assets/icons/plug.svg +1 -0
  99. package/dist/assets/icons/plus.0c0c0d.svg +1 -0
  100. package/dist/assets/icons/plus.svg +1 -0
  101. package/dist/assets/icons/refresh.svg +1 -0
  102. package/dist/assets/icons/ruler.svg +1 -0
  103. package/dist/assets/icons/scroll-text.svg +1 -0
  104. package/dist/assets/icons/search-menu.svg +1 -0
  105. package/dist/assets/icons/search.svg +1 -0
  106. package/dist/assets/icons/send.0c0c0d.svg +1 -0
  107. package/dist/assets/icons/send.svg +1 -0
  108. package/dist/assets/icons/settings.0c0c0d.svg +1 -0
  109. package/dist/assets/icons/settings.svg +1 -0
  110. package/dist/assets/icons/shield.svg +1 -0
  111. package/dist/assets/icons/sidebar-left.svg +1 -0
  112. package/dist/assets/icons/sidebar-right.svg +1 -0
  113. package/dist/assets/icons/sliders.svg +1 -0
  114. package/dist/assets/icons/sparkles.32f08c.svg +1 -0
  115. package/dist/assets/icons/sparkles.svg +1 -0
  116. package/dist/assets/icons/square.svg +1 -0
  117. package/dist/assets/icons/star.svg +1 -0
  118. package/dist/assets/icons/sun.svg +1 -0
  119. package/dist/assets/icons/terminal.svg +1 -0
  120. package/dist/assets/icons/trash.svg +1 -0
  121. package/dist/assets/icons/trending-down.svg +1 -0
  122. package/dist/assets/icons/trending-up.svg +1 -0
  123. package/dist/assets/icons/type.svg +1 -0
  124. package/dist/assets/icons/upload.svg +1 -0
  125. package/dist/assets/icons/user-circle.svg +1 -0
  126. package/dist/assets/icons/user.svg +1 -0
  127. package/dist/assets/icons/users.svg +1 -0
  128. package/dist/assets/icons/wrench.svg +1 -0
  129. package/dist/assets/icons/x-circle.svg +1 -0
  130. package/dist/assets/icons/x.svg +1 -0
  131. package/dist/assets/icons/zap.0c0c0d.svg +1 -0
  132. package/dist/assets/icons/zap.svg +1 -0
  133. package/dist/avatar.cjs +655 -0
  134. package/dist/avatar.cjs.map +1 -0
  135. package/dist/avatar.d.cts +16 -0
  136. package/dist/avatar.d.ts +16 -0
  137. package/dist/avatar.js +653 -0
  138. package/dist/avatar.js.map +1 -0
  139. package/dist/button.cjs +712 -0
  140. package/dist/button.cjs.map +1 -0
  141. package/dist/button.d.cts +21 -0
  142. package/dist/button.d.ts +21 -0
  143. package/dist/button.js +709 -0
  144. package/dist/button.js.map +1 -0
  145. package/dist/card.cjs +669 -0
  146. package/dist/card.cjs.map +1 -0
  147. package/dist/card.d.cts +13 -0
  148. package/dist/card.d.ts +13 -0
  149. package/dist/card.js +666 -0
  150. package/dist/card.js.map +1 -0
  151. package/dist/chat-composer.cjs +810 -0
  152. package/dist/chat-composer.cjs.map +1 -0
  153. package/dist/chat-composer.d.cts +22 -0
  154. package/dist/chat-composer.d.ts +22 -0
  155. package/dist/chat-composer.js +808 -0
  156. package/dist/chat-composer.js.map +1 -0
  157. package/dist/dialog.cjs +779 -0
  158. package/dist/dialog.cjs.map +1 -0
  159. package/dist/dialog.d.cts +23 -0
  160. package/dist/dialog.d.ts +23 -0
  161. package/dist/dialog.js +777 -0
  162. package/dist/dialog.js.map +1 -0
  163. package/dist/drawer.cjs +784 -0
  164. package/dist/drawer.cjs.map +1 -0
  165. package/dist/drawer.d.cts +23 -0
  166. package/dist/drawer.d.ts +23 -0
  167. package/dist/drawer.js +782 -0
  168. package/dist/drawer.js.map +1 -0
  169. package/dist/editor-tabs.cjs +835 -0
  170. package/dist/editor-tabs.cjs.map +1 -0
  171. package/dist/editor-tabs.d.cts +23 -0
  172. package/dist/editor-tabs.d.ts +23 -0
  173. package/dist/editor-tabs.js +833 -0
  174. package/dist/editor-tabs.js.map +1 -0
  175. package/dist/file-tree.cjs +868 -0
  176. package/dist/file-tree.cjs.map +1 -0
  177. package/dist/file-tree.d.cts +27 -0
  178. package/dist/file-tree.d.ts +27 -0
  179. package/dist/file-tree.js +866 -0
  180. package/dist/file-tree.js.map +1 -0
  181. package/dist/forms.cjs +914 -0
  182. package/dist/forms.cjs.map +1 -0
  183. package/dist/forms.d.cts +69 -0
  184. package/dist/forms.d.ts +69 -0
  185. package/dist/forms.js +907 -0
  186. package/dist/forms.js.map +1 -0
  187. package/dist/icon.cjs +750 -0
  188. package/dist/icon.cjs.map +1 -0
  189. package/dist/icon.d.cts +61 -0
  190. package/dist/icon.d.ts +61 -0
  191. package/dist/icon.js +744 -0
  192. package/dist/icon.js.map +1 -0
  193. package/dist/icons.cjs +164 -0
  194. package/dist/icons.cjs.map +1 -0
  195. package/dist/icons.js +162 -0
  196. package/dist/icons.js.map +1 -0
  197. package/dist/index.cjs +3280 -0
  198. package/dist/index.cjs.map +1 -0
  199. package/dist/index.d.cts +30 -0
  200. package/dist/index.d.ts +30 -0
  201. package/dist/index.js +3234 -0
  202. package/dist/index.js.map +1 -0
  203. package/dist/kbd.cjs +671 -0
  204. package/dist/kbd.cjs.map +1 -0
  205. package/dist/kbd.d.cts +16 -0
  206. package/dist/kbd.d.ts +16 -0
  207. package/dist/kbd.js +667 -0
  208. package/dist/kbd.js.map +1 -0
  209. package/dist/menu.cjs +736 -0
  210. package/dist/menu.cjs.map +1 -0
  211. package/dist/menu.d.cts +21 -0
  212. package/dist/menu.d.ts +21 -0
  213. package/dist/menu.js +733 -0
  214. package/dist/menu.js.map +1 -0
  215. package/dist/nav-list.cjs +801 -0
  216. package/dist/nav-list.cjs.map +1 -0
  217. package/dist/nav-list.d.cts +28 -0
  218. package/dist/nav-list.d.ts +28 -0
  219. package/dist/nav-list.js +799 -0
  220. package/dist/nav-list.js.map +1 -0
  221. package/dist/overlay.cjs +344 -0
  222. package/dist/overlay.cjs.map +1 -0
  223. package/dist/overlay.d.cts +36 -0
  224. package/dist/overlay.d.ts +36 -0
  225. package/dist/overlay.js +339 -0
  226. package/dist/overlay.js.map +1 -0
  227. package/dist/page-header.cjs +744 -0
  228. package/dist/page-header.cjs.map +1 -0
  229. package/dist/page-header.d.cts +18 -0
  230. package/dist/page-header.d.ts +18 -0
  231. package/dist/page-header.js +741 -0
  232. package/dist/page-header.js.map +1 -0
  233. package/dist/pagination.cjs +769 -0
  234. package/dist/pagination.cjs.map +1 -0
  235. package/dist/pagination.d.cts +17 -0
  236. package/dist/pagination.d.ts +17 -0
  237. package/dist/pagination.js +767 -0
  238. package/dist/pagination.js.map +1 -0
  239. package/dist/stat-card.cjs +690 -0
  240. package/dist/stat-card.cjs.map +1 -0
  241. package/dist/stat-card.d.cts +18 -0
  242. package/dist/stat-card.d.ts +18 -0
  243. package/dist/stat-card.js +687 -0
  244. package/dist/stat-card.js.map +1 -0
  245. package/dist/status-bar.cjs +730 -0
  246. package/dist/status-bar.cjs.map +1 -0
  247. package/dist/status-bar.d.cts +19 -0
  248. package/dist/status-bar.d.ts +19 -0
  249. package/dist/status-bar.js +728 -0
  250. package/dist/status-bar.js.map +1 -0
  251. package/dist/styles/base.css +240 -0
  252. package/dist/styles/components.css +1234 -0
  253. package/dist/styles/styles.css +5 -0
  254. package/dist/styles/toast.css +57 -0
  255. package/dist/styles/tokens.css +438 -0
  256. package/dist/styles/vui.css +47 -0
  257. package/dist/table.cjs +814 -0
  258. package/dist/table.cjs.map +1 -0
  259. package/dist/table.d.cts +33 -0
  260. package/dist/table.d.ts +33 -0
  261. package/dist/table.js +811 -0
  262. package/dist/table.js.map +1 -0
  263. package/dist/tabs.cjs +764 -0
  264. package/dist/tabs.cjs.map +1 -0
  265. package/dist/tabs.d.cts +18 -0
  266. package/dist/tabs.d.ts +18 -0
  267. package/dist/tabs.js +762 -0
  268. package/dist/tabs.js.map +1 -0
  269. package/dist/tag.cjs +636 -0
  270. package/dist/tag.cjs.map +1 -0
  271. package/dist/tag.d.cts +10 -0
  272. package/dist/tag.d.ts +10 -0
  273. package/dist/tag.js +634 -0
  274. package/dist/tag.js.map +1 -0
  275. package/dist/toast.cjs +1219 -0
  276. package/dist/toast.cjs.map +1 -0
  277. package/dist/toast.d.cts +16 -0
  278. package/dist/toast.d.ts +16 -0
  279. package/dist/toast.js +1217 -0
  280. package/dist/toast.js.map +1 -0
  281. package/dist/types.cjs +4 -0
  282. package/dist/types.cjs.map +1 -0
  283. package/dist/types.d.cts +19 -0
  284. package/dist/types.d.ts +19 -0
  285. package/dist/types.js +3 -0
  286. package/dist/types.js.map +1 -0
  287. package/dist/utils.cjs +727 -0
  288. package/dist/utils.cjs.map +1 -0
  289. package/dist/utils.d.cts +24 -0
  290. package/dist/utils.d.ts +24 -0
  291. package/dist/utils.js +710 -0
  292. package/dist/utils.js.map +1 -0
  293. package/dist/workbench-titlebar.cjs +775 -0
  294. package/dist/workbench-titlebar.cjs.map +1 -0
  295. package/dist/workbench-titlebar.d.cts +19 -0
  296. package/dist/workbench-titlebar.d.ts +19 -0
  297. package/dist/workbench-titlebar.js +773 -0
  298. package/dist/workbench-titlebar.js.map +1 -0
  299. package/package.json +186 -41
  300. package/src/forms.ts +38 -7
  301. package/src/icon.ts +2 -1
package/dist/index.js ADDED
@@ -0,0 +1,3234 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+
4
+ // packages/reactivity/src/debug.ts
5
+ var activeDebugHooks = null;
6
+ var signalNames = /* @__PURE__ */ new WeakMap();
7
+ function hasDebugHooks() {
8
+ return activeDebugHooks !== null;
9
+ }
10
+ __name(hasDebugHooks, "hasDebugHooks");
11
+ function setSignalDebugName(signal, name) {
12
+ signalNames.set(signal, name);
13
+ invokeDebug("signalNamed", signal, name);
14
+ }
15
+ __name(setSignalDebugName, "setSignalDebugName");
16
+ function invokeDebug(name, ...args) {
17
+ return;
18
+ }
19
+ __name(invokeDebug, "invokeDebug");
20
+
21
+ // packages/reactivity/src/owner.ts
22
+ var currentOwner = null;
23
+ var nextOwnerId = 1;
24
+ var ownerNames = /* @__PURE__ */ new WeakMap();
25
+ function createOwner() {
26
+ const parent = currentOwner;
27
+ let disposed = parent?.disposed ?? false;
28
+ const children = [];
29
+ const cleanups = [];
30
+ const errorHandlers = /* @__PURE__ */ new Set();
31
+ const owner = {
32
+ id: `owner-${nextOwnerId++}`,
33
+ parent,
34
+ children,
35
+ depth: (parent?.depth ?? -1) + 1,
36
+ get disposed() {
37
+ return disposed;
38
+ },
39
+ run(fn) {
40
+ if (disposed) throw new Error("Vobs: \u5DF2\u9500\u6BC1\u7684 Owner \u4E0D\u80FD\u7EE7\u7EED\u8FD0\u884C");
41
+ const previous = currentOwner;
42
+ currentOwner = owner;
43
+ try {
44
+ return fn();
45
+ } finally {
46
+ currentOwner = previous;
47
+ }
48
+ },
49
+ addCleanup(cleanup) {
50
+ if (disposed) {
51
+ cleanup();
52
+ return;
53
+ }
54
+ cleanups.push(cleanup);
55
+ },
56
+ onDispose(cleanup) {
57
+ owner.addCleanup(cleanup);
58
+ },
59
+ onError(handler) {
60
+ errorHandlers.add(handler);
61
+ const remove = /* @__PURE__ */ __name(() => errorHandlers.delete(handler), "remove");
62
+ owner.addCleanup(remove);
63
+ return remove;
64
+ },
65
+ handleError(error) {
66
+ for (const handler of [...errorHandlers].reverse()) {
67
+ try {
68
+ handler(error);
69
+ return true;
70
+ } catch (handlerError) {
71
+ return parent?.handleError(handlerError) ?? false;
72
+ }
73
+ }
74
+ return parent?.handleError(error) ?? false;
75
+ },
76
+ dispose() {
77
+ if (disposed) return;
78
+ disposed = true;
79
+ for (const child of [...children]) child.dispose();
80
+ children.length = 0;
81
+ let firstError;
82
+ for (let index = cleanups.length - 1; index >= 0; index--) {
83
+ try {
84
+ cleanups[index]();
85
+ } catch (error) {
86
+ firstError ?? (firstError = error);
87
+ }
88
+ }
89
+ cleanups.length = 0;
90
+ if (parent) {
91
+ const index = parent.children.indexOf(owner);
92
+ if (index >= 0) parent.children.splice(index, 1);
93
+ }
94
+ if (firstError) throw firstError;
95
+ }
96
+ };
97
+ if (parent && !parent.disposed) parent.children.push(owner);
98
+ return owner;
99
+ }
100
+ __name(createOwner, "createOwner");
101
+ function setOwnerDebugName(owner, name) {
102
+ ownerNames.set(owner, name);
103
+ }
104
+ __name(setOwnerDebugName, "setOwnerDebugName");
105
+ function getCurrentOwner() {
106
+ return currentOwner;
107
+ }
108
+ __name(getCurrentOwner, "getCurrentOwner");
109
+ function onDispose(cleanup) {
110
+ const owner = getCurrentOwner();
111
+ if (!owner) throw new Error("Vobs: onDispose \u5FC5\u987B\u5728 Owner \u4F5C\u7528\u57DF\u5185\u8C03\u7528");
112
+ owner.onDispose(cleanup);
113
+ }
114
+ __name(onDispose, "onDispose");
115
+
116
+ // packages/reactivity/src/signal.ts
117
+ var currentSubscriber = null;
118
+ function getCurrentSubscriber() {
119
+ return currentSubscriber;
120
+ }
121
+ __name(getCurrentSubscriber, "getCurrentSubscriber");
122
+ function setCurrentSubscriber(subscriber) {
123
+ currentSubscriber = subscriber;
124
+ }
125
+ __name(setCurrentSubscriber, "setCurrentSubscriber");
126
+ function trackDependency(dependency) {
127
+ if (!currentSubscriber || currentSubscriber.disposed) return;
128
+ !currentSubscriber.dependencies.has(dependency);
129
+ currentSubscriber.dependencies.add(dependency);
130
+ }
131
+ __name(trackDependency, "trackDependency");
132
+ function state(initialValue, debugName) {
133
+ let value = initialValue;
134
+ let disposed = false;
135
+ const subscribers = /* @__PURE__ */ new Set();
136
+ const signalInstance = {
137
+ get value() {
138
+ const subscriber = getCurrentSubscriber();
139
+ if (subscriber && !subscriber.disposed) {
140
+ subscribers.add(subscriber);
141
+ trackDependency(signalInstance);
142
+ }
143
+ return value;
144
+ },
145
+ set value(nextValue) {
146
+ if (disposed || Object.is(value, nextValue)) return;
147
+ value = nextValue;
148
+ for (const subscriber of [...subscribers]) subscriber.notify();
149
+ },
150
+ unsubscribe(subscriber) {
151
+ subscribers.delete(subscriber);
152
+ },
153
+ // 与 `.value =` 赋值同一条路径:判等短路、debug hook、notify 全部一致。
154
+ // 以闭包实现,可安全地作为回调直接传递(无 this 绑定问题)。
155
+ set(next) {
156
+ signalInstance.value = next;
157
+ },
158
+ dispose() {
159
+ if (disposed) return;
160
+ disposed = true;
161
+ subscribers.clear();
162
+ }
163
+ };
164
+ const owner = getCurrentOwner();
165
+ owner?.addCleanup(signalInstance.dispose);
166
+ if (debugName?.trim()) setSignalDebugName(signalInstance, debugName.trim());
167
+ return signalInstance;
168
+ }
169
+ __name(state, "state");
170
+
171
+ // packages/reactivity/src/scheduler.ts
172
+ var _Scheduler = class _Scheduler {
173
+ constructor() {
174
+ this.dirtyEffects = /* @__PURE__ */ new Set();
175
+ this.lowPriorityEffects = /* @__PURE__ */ new Set();
176
+ // flush 不可重入(flushing 标志保证),缓冲数组可在轮次间安全复用,避免每轮分配。
177
+ this.normalBuffer = [];
178
+ this.lowBuffer = [];
179
+ this.flushing = false;
180
+ this.scheduled = false;
181
+ this.batchDepth = 0;
182
+ }
183
+ schedule(effect2) {
184
+ if (effect2.disposed) return;
185
+ this.dirtyEffects.add(effect2);
186
+ this.lowPriorityEffects.delete(effect2);
187
+ this.ensureScheduled();
188
+ }
189
+ /** Queue an effect behind normal updates while preserving deterministic order. */
190
+ scheduleLow(effect2) {
191
+ if (effect2.disposed) return;
192
+ if (!this.dirtyEffects.has(effect2)) this.lowPriorityEffects.add(effect2);
193
+ this.ensureScheduled();
194
+ }
195
+ ensureScheduled() {
196
+ if (this.batchDepth === 0 && !this.flushing && !this.scheduled) {
197
+ this.scheduled = true;
198
+ queueMicrotask(() => {
199
+ this.scheduled = false;
200
+ this.flush();
201
+ });
202
+ }
203
+ }
204
+ remove(effect2) {
205
+ this.dirtyEffects.delete(effect2);
206
+ this.lowPriorityEffects.delete(effect2);
207
+ }
208
+ batch(fn) {
209
+ this.batchDepth++;
210
+ try {
211
+ return fn();
212
+ } finally {
213
+ this.batchDepth--;
214
+ if (this.batchDepth === 0) this.flush();
215
+ }
216
+ }
217
+ flush() {
218
+ if (this.flushing || this.batchDepth > 0) return;
219
+ this.flushing = true;
220
+ let rounds = 0;
221
+ let firstError;
222
+ let hasError = false;
223
+ try {
224
+ while (this.dirtyEffects.size > 0 || this.lowPriorityEffects.size > 0) {
225
+ if (++rounds > 100) {
226
+ this.dirtyEffects.clear();
227
+ this.lowPriorityEffects.clear();
228
+ throw new Error("Vobs: \u54CD\u5E94\u5F0F\u66F4\u65B0\u8D85\u8FC7 100 \u8F6E\uFF0C\u53EF\u80FD\u5B58\u5728\u5FAA\u73AF\u4F9D\u8D56");
229
+ }
230
+ this.collectRunnable(this.dirtyEffects, this.normalBuffer);
231
+ this.collectRunnable(this.lowPriorityEffects, this.lowBuffer);
232
+ sortEffects(this.normalBuffer);
233
+ sortEffects(this.lowBuffer);
234
+ for (const effect2 of this.normalBuffer) {
235
+ try {
236
+ effect2.run();
237
+ } catch (error) {
238
+ if (!hasError) {
239
+ firstError = error;
240
+ hasError = true;
241
+ }
242
+ }
243
+ }
244
+ for (const effect2 of this.lowBuffer) {
245
+ try {
246
+ effect2.run();
247
+ } catch (error) {
248
+ if (!hasError) {
249
+ firstError = error;
250
+ hasError = true;
251
+ }
252
+ }
253
+ }
254
+ this.normalBuffer.length = 0;
255
+ this.lowBuffer.length = 0;
256
+ }
257
+ } finally {
258
+ this.normalBuffer.length = 0;
259
+ this.lowBuffer.length = 0;
260
+ this.flushing = false;
261
+ }
262
+ if (hasError) throw firstError;
263
+ }
264
+ /** 收集未 disposed 的 effect 并清空源集合;run() 期间新调度的 effect 留给下一轮。 */
265
+ collectRunnable(source, target) {
266
+ for (const effect2 of source) {
267
+ if (!effect2.disposed) target.push(effect2);
268
+ }
269
+ source.clear();
270
+ }
271
+ };
272
+ __name(_Scheduler, "Scheduler");
273
+ var Scheduler = _Scheduler;
274
+ function sortEffects(effects) {
275
+ if (effects.length > 1) {
276
+ effects.sort((a, b) => b.depth - a.depth || a.order - b.order);
277
+ }
278
+ }
279
+ __name(sortEffects, "sortEffects");
280
+ var scheduler = new Scheduler();
281
+
282
+ // packages/reactivity/src/effect.ts
283
+ var nextEffectOrder = 1;
284
+ function cleanupDependencies(subscriber) {
285
+ for (const dependency of subscriber.dependencies) {
286
+ dependency.unsubscribe(subscriber);
287
+ }
288
+ subscriber.dependencies.clear();
289
+ }
290
+ __name(cleanupDependencies, "cleanupDependencies");
291
+ function effect(callback) {
292
+ const owner = getCurrentOwner();
293
+ let cleanup;
294
+ let dirty = true;
295
+ let disposed = false;
296
+ const eff = {
297
+ order: nextEffectOrder++,
298
+ depth: owner?.depth ?? 0,
299
+ dependencies: /* @__PURE__ */ new Set(),
300
+ get disposed() {
301
+ return disposed;
302
+ },
303
+ notify() {
304
+ if (disposed || dirty) return;
305
+ dirty = true;
306
+ scheduler.schedule(eff);
307
+ },
308
+ run() {
309
+ if (disposed || !dirty) return;
310
+ dirty = false;
311
+ const previousCleanup = cleanup;
312
+ cleanup = void 0;
313
+ let cleanupError;
314
+ if (previousCleanup) {
315
+ try {
316
+ previousCleanup();
317
+ } catch (error) {
318
+ const handled2 = owner?.handleError(error) ?? false;
319
+ if (!handled2) cleanupError = error;
320
+ }
321
+ }
322
+ cleanupDependencies(eff);
323
+ const previous = getCurrentSubscriber();
324
+ setCurrentSubscriber(eff);
325
+ let thrown;
326
+ let handled = false;
327
+ try {
328
+ const result = owner ? owner.run(callback) : callback();
329
+ cleanup = typeof result === "function" ? result : void 0;
330
+ } catch (error) {
331
+ thrown = error;
332
+ handled = owner?.handleError(error) ?? false;
333
+ if (!handled) throw error;
334
+ } finally {
335
+ setCurrentSubscriber(previous);
336
+ }
337
+ if (cleanupError && !thrown) throw cleanupError;
338
+ },
339
+ scheduleLow() {
340
+ if (disposed || dirty) return;
341
+ dirty = true;
342
+ scheduler.scheduleLow(eff);
343
+ },
344
+ dispose() {
345
+ if (disposed) return;
346
+ disposed = true;
347
+ dirty = false;
348
+ scheduler.remove(eff);
349
+ const previousCleanup = cleanup;
350
+ cleanup = void 0;
351
+ let cleanupError;
352
+ if (previousCleanup) {
353
+ try {
354
+ previousCleanup();
355
+ } catch (error) {
356
+ const handled = owner?.handleError(error) ?? false;
357
+ if (!handled) cleanupError = error;
358
+ }
359
+ }
360
+ cleanupDependencies(eff);
361
+ if (cleanupError) throw cleanupError;
362
+ }
363
+ };
364
+ owner?.addCleanup(eff.dispose);
365
+ eff.run();
366
+ return eff;
367
+ }
368
+ __name(effect, "effect");
369
+
370
+ // packages/runtime/src/debug.ts
371
+ var activeRuntimeDebugHooks = null;
372
+ function getRuntimeDebugHooks() {
373
+ return activeRuntimeDebugHooks;
374
+ }
375
+ __name(getRuntimeDebugHooks, "getRuntimeDebugHooks");
376
+ function invokeRuntimeDebug(name, ...args) {
377
+ return;
378
+ }
379
+ __name(invokeRuntimeDebug, "invokeRuntimeDebug");
380
+ function readDebugValue(read) {
381
+ try {
382
+ return read();
383
+ } catch {
384
+ return "[Uninspectable]";
385
+ }
386
+ }
387
+ __name(readDebugValue, "readDebugValue");
388
+ function describeDebugNode(node) {
389
+ if (!node || typeof node !== "object") return "node";
390
+ const value = node;
391
+ const name = typeof value.tagName === "string" ? value.tagName.toLowerCase() : typeof value.nodeName === "string" ? value.nodeName.toLowerCase() : "node";
392
+ const id = typeof value.id === "string" && value.id ? `#${value.id}` : "";
393
+ const className = typeof value.className === "string" && value.className ? `.${value.className.trim().split(/\s+/).filter(Boolean).join(".")}` : "";
394
+ return `${name}${id}${className}`;
395
+ }
396
+ __name(describeDebugNode, "describeDebugNode");
397
+
398
+ // packages/runtime/src/hmr.ts
399
+ var globalTarget = globalThis;
400
+ var hmrGlobal = globalTarget.__VOBS_HMR__ ?? { modules: /* @__PURE__ */ new Map() };
401
+ globalTarget.__VOBS_HMR__ = hmrGlobal;
402
+ function markHmrInstanceMounted(node, parent) {
403
+ const instance = hmrInstances.get(node);
404
+ if (instance) instance.parent = parent;
405
+ }
406
+ __name(markHmrInstanceMounted, "markHmrInstanceMounted");
407
+ var hmrInstances = /* @__PURE__ */ new WeakMap();
408
+ var nodeOwners = /* @__PURE__ */ new WeakMap();
409
+ var eventBindings = /* @__PURE__ */ new WeakMap();
410
+ function getRenderer() {
411
+ {
412
+ throw new Error("\u6E32\u67D3\u5668\u672A\u521D\u59CB\u5316");
413
+ }
414
+ }
415
+ __name(getRenderer, "getRenderer");
416
+ function createText(content) {
417
+ return getRenderer().createText(content);
418
+ }
419
+ __name(createText, "createText");
420
+ function createElement(tag) {
421
+ return getRenderer().createElement(tag);
422
+ }
423
+ __name(createElement, "createElement");
424
+ function createComment(content) {
425
+ return getRenderer().createComment(content);
426
+ }
427
+ __name(createComment, "createComment");
428
+ function insertBefore(parent, child, anchor) {
429
+ if (isVobsFragment(child)) {
430
+ child.mount(parent, isVobsFragment(anchor) ? anchor.start : anchor);
431
+ return;
432
+ }
433
+ getRenderer().insertBefore(parent, child, isVobsFragment(anchor) ? anchor.start : anchor);
434
+ markHmrInstanceMounted(child, parent);
435
+ }
436
+ __name(insertBefore, "insertBefore");
437
+ function removeChild(parent, child) {
438
+ disposeNodeOwner(child);
439
+ if (isVobsFragment(child)) {
440
+ child.unmount(parent);
441
+ return;
442
+ }
443
+ getRenderer().removeChild(parent, child);
444
+ }
445
+ __name(removeChild, "removeChild");
446
+ function setTextContent(node, content) {
447
+ getRenderer().setTextContent(node, content);
448
+ }
449
+ __name(setTextContent, "setTextContent");
450
+ function setProperty(node, key, value) {
451
+ getRenderer().setProperty(node, key, value);
452
+ }
453
+ __name(setProperty, "setProperty");
454
+ function setAttribute(node, key, value) {
455
+ getRenderer().setAttribute(node, key, value);
456
+ }
457
+ __name(setAttribute, "setAttribute");
458
+ function addEventListener(node, event, handler) {
459
+ const renderer = getRenderer();
460
+ const owner = getCurrentOwner();
461
+ let bindings = eventBindings.get(node);
462
+ if (!bindings) {
463
+ bindings = /* @__PURE__ */ new Map();
464
+ eventBindings.set(node, bindings);
465
+ }
466
+ const previous = bindings.get(event);
467
+ if (previous && previous.original === handler && previous.owner === owner) return;
468
+ if (previous) renderer.removeEventListener(node, event, previous.handler);
469
+ const listener = owner ? (reason) => {
470
+ try {
471
+ owner.run(() => handler(reason));
472
+ } catch (error) {
473
+ const handled = owner.handleError(error);
474
+ invokeRuntimeDebug("error", {
475
+ error,
476
+ owner,
477
+ phase: "event",
478
+ handled,
479
+ recovery: handled ? "handled" : "propagated"
480
+ });
481
+ if (!handled) throw error;
482
+ }
483
+ } : handler;
484
+ const binding = { handler: listener, owner, original: handler };
485
+ bindings.set(event, binding);
486
+ renderer.addEventListener(node, event, listener);
487
+ owner?.onDispose(() => {
488
+ if (bindings?.get(event) !== binding) return;
489
+ bindings.delete(event);
490
+ renderer.removeEventListener(node, event, listener);
491
+ });
492
+ }
493
+ __name(addEventListener, "addEventListener");
494
+ function createBlock(factory) {
495
+ const owner = createOwner();
496
+ setOwnerDebugName(owner, "dynamic");
497
+ let node;
498
+ try {
499
+ node = owner.run(factory);
500
+ } catch (error) {
501
+ owner.dispose();
502
+ throw error;
503
+ }
504
+ if (!node) {
505
+ owner.dispose();
506
+ return null;
507
+ }
508
+ associateNodeOwner(node, owner);
509
+ return node;
510
+ }
511
+ __name(createBlock, "createBlock");
512
+ function associateNodeOwner(node, owner) {
513
+ nodeOwners.set(node, owner);
514
+ }
515
+ __name(associateNodeOwner, "associateNodeOwner");
516
+ function disposeNodeOwner(node) {
517
+ const owner = nodeOwners.get(node);
518
+ if (!owner) return;
519
+ nodeOwners.delete(node);
520
+ owner.dispose();
521
+ }
522
+ __name(disposeNodeOwner, "disposeNodeOwner");
523
+
524
+ // packages/runtime/src/fragment.ts
525
+ function createFragment(factory) {
526
+ const start = createComment("vobs:fragment:start");
527
+ const end = createComment("vobs:fragment:end");
528
+ let parent = null;
529
+ let initialized = false;
530
+ const owner = getCurrentOwner();
531
+ const fragment = {
532
+ kind: "vobs-fragment",
533
+ start,
534
+ end,
535
+ mount(nextParent, anchor) {
536
+ if (parent && parent !== nextParent) {
537
+ throw new Error("Vobs Fragment: \u4E0D\u80FD\u8DE8\u7236\u8282\u70B9\u79FB\u52A8 Fragment");
538
+ }
539
+ if (initialized) {
540
+ moveRange(nextParent, start, end, anchor);
541
+ return;
542
+ }
543
+ const renderer = getRenderer();
544
+ renderer.insertBefore(nextParent, start, anchor);
545
+ renderer.insertBefore(nextParent, end, anchor);
546
+ parent = nextParent;
547
+ initialized = true;
548
+ if (owner) owner.run(() => factory(nextParent, end));
549
+ else factory(nextParent, end);
550
+ },
551
+ unmount(nextParent) {
552
+ if (!initialized || parent !== nextParent) {
553
+ throw new Error("Vobs Fragment: Fragment \u4E0D\u5C5E\u4E8E\u6307\u5B9A\u7236\u8282\u70B9");
554
+ }
555
+ const renderer = getRenderer();
556
+ let current = renderer.nextSibling(start);
557
+ while (current && current !== end) {
558
+ const next = renderer.nextSibling(current);
559
+ renderer.removeChild(nextParent, current);
560
+ current = next;
561
+ }
562
+ renderer.removeChild(nextParent, start);
563
+ renderer.removeChild(nextParent, end);
564
+ parent = null;
565
+ initialized = false;
566
+ }
567
+ };
568
+ return fragment;
569
+ }
570
+ __name(createFragment, "createFragment");
571
+ function isVobsFragment(value) {
572
+ return Boolean(value) && typeof value === "object" && value.kind === "vobs-fragment";
573
+ }
574
+ __name(isVobsFragment, "isVobsFragment");
575
+ function moveRange(parent, start, end, anchor) {
576
+ const renderer = getRenderer();
577
+ const nodes = [start];
578
+ let current = renderer.nextSibling(start);
579
+ while (current) {
580
+ nodes.push(current);
581
+ if (current === end) break;
582
+ current = renderer.nextSibling(current);
583
+ }
584
+ if (nodes[nodes.length - 1] !== end) {
585
+ throw new Error("Vobs Fragment: \u627E\u4E0D\u5230\u7ED3\u675F\u951A\u70B9");
586
+ }
587
+ for (const node of nodes) renderer.insertBefore(parent, node, anchor);
588
+ }
589
+ __name(moveRange, "moveRange");
590
+
591
+ // packages/runtime/src/dynamic.ts
592
+ function insertDynamic(parent, anchor, factory) {
593
+ const marker = createComment("vobs:dynamic");
594
+ insertBefore(parent, marker, anchor);
595
+ let current = null;
596
+ effect(() => {
597
+ const next = createBlock(factory);
598
+ if (next === current) return;
599
+ if (current) removeChild(parent, current);
600
+ current = next;
601
+ if (current) insertBefore(parent, current, marker);
602
+ });
603
+ }
604
+ __name(insertDynamic, "insertDynamic");
605
+ function insertList(parent, anchor, source, renderItem, keyOf) {
606
+ const marker = createComment("vobs:list");
607
+ insertBefore(parent, marker, anchor);
608
+ let entries = [];
609
+ const tracksIndex = renderItem.length >= 2;
610
+ effect(() => {
611
+ const items = source();
612
+ let keys = null;
613
+ if (keyOf) {
614
+ keys = new Array(items.length);
615
+ let allKeyed = items.length > 0;
616
+ for (let index = 0; index < items.length; index++) {
617
+ const key = keyOf(items[index], index);
618
+ if (key == null) {
619
+ allKeyed = false;
620
+ break;
621
+ }
622
+ keys[index] = key;
623
+ }
624
+ if (!allKeyed) keys = null;
625
+ }
626
+ const nextEntries = keys ? reconcileKeyed(items, keys, entries, renderItem) : reconcileIndexed(items, entries, renderItem);
627
+ const refreshed = tracksIndex ? /* @__PURE__ */ new Set() : null;
628
+ for (let index = 0; index < nextEntries.length; index++) {
629
+ const entry = nextEntries[index];
630
+ if (tracksIndex) {
631
+ if (entry.index !== index) {
632
+ refreshListEntry(parent, entry, index, renderItem);
633
+ refreshed.add(entry);
634
+ }
635
+ } else {
636
+ entry.index = index;
637
+ }
638
+ }
639
+ const retained = new Set(nextEntries);
640
+ for (const entry of entries) {
641
+ if (!retained.has(entry)) disposeEntry(parent, entry);
642
+ }
643
+ reorderListEntries(parent, marker, entries, nextEntries, refreshed);
644
+ entries = nextEntries;
645
+ });
646
+ }
647
+ __name(insertList, "insertList");
648
+ function reorderListEntries(parent, marker, previous, nextEntries, forceInsert) {
649
+ const count = nextEntries.length;
650
+ if (count === 0) return;
651
+ if (previous.length === 0) {
652
+ let reference2 = marker;
653
+ for (let index = count - 1; index >= 0; index--) {
654
+ const node = nextEntries[index].node;
655
+ insertBefore(parent, node, reference2);
656
+ reference2 = node;
657
+ }
658
+ return;
659
+ }
660
+ const oldIndexOf = /* @__PURE__ */ new Map();
661
+ for (let index = 0; index < previous.length; index++) oldIndexOf.set(previous[index], index);
662
+ const seq = new Array(count);
663
+ for (let index = 0; index < count; index++) {
664
+ const entry = nextEntries[index];
665
+ seq[index] = forceInsert?.has(entry) ? -1 : oldIndexOf.get(entry) ?? -1;
666
+ }
667
+ const keep = computeKeptByLis(seq);
668
+ let reference = marker;
669
+ for (let index = count - 1; index >= 0; index--) {
670
+ const node = nextEntries[index].node;
671
+ if (keep[index]) {
672
+ reference = node;
673
+ continue;
674
+ }
675
+ insertBefore(parent, node, reference);
676
+ reference = node;
677
+ }
678
+ }
679
+ __name(reorderListEntries, "reorderListEntries");
680
+ function computeKeptByLis(seq) {
681
+ const count = seq.length;
682
+ const keep = new Array(count).fill(false);
683
+ const tailsIndex = [];
684
+ const tailsValue = [];
685
+ const prev = new Array(count).fill(-1);
686
+ for (let i = 0; i < count; i++) {
687
+ const value = seq[i];
688
+ if (value < 0) continue;
689
+ let lo = 0;
690
+ let hi = tailsValue.length;
691
+ while (lo < hi) {
692
+ const mid = lo + hi >> 1;
693
+ if (tailsValue[mid] < value) lo = mid + 1;
694
+ else hi = mid;
695
+ }
696
+ if (lo === tailsValue.length) {
697
+ tailsValue.push(value);
698
+ tailsIndex.push(i);
699
+ } else {
700
+ tailsValue[lo] = value;
701
+ tailsIndex[lo] = i;
702
+ }
703
+ prev[i] = lo > 0 ? tailsIndex[lo - 1] : -1;
704
+ }
705
+ let cursor = tailsIndex.length > 0 ? tailsIndex[tailsIndex.length - 1] : -1;
706
+ while (cursor >= 0) {
707
+ keep[cursor] = true;
708
+ cursor = prev[cursor];
709
+ }
710
+ return keep;
711
+ }
712
+ __name(computeKeptByLis, "computeKeptByLis");
713
+ function reconcileKeyed(items, keys, entries, renderItem) {
714
+ const previous = new Map(entries.map((entry) => [entry.key, entry]));
715
+ const seen = /* @__PURE__ */ new Set();
716
+ const nextEntries = [];
717
+ for (let index = 0; index < items.length; index++) {
718
+ const item = items[index];
719
+ const key = keys[index];
720
+ if (seen.has(key)) {
721
+ console.warn(`Vobs: \u68C0\u6D4B\u5230\u91CD\u590D\u7684\u5217\u8868 key: ${String(key)}`);
722
+ }
723
+ seen.add(key);
724
+ const entry = previous.get(key);
725
+ if (entry) {
726
+ previous.delete(key);
727
+ if (isPrimitiveItem(item) && !Object.is(entry.value, item)) {
728
+ nextEntries.push(createListEntry(item, index, key, renderItem));
729
+ continue;
730
+ }
731
+ entry.item.value = item;
732
+ entry.value = item;
733
+ nextEntries.push(entry);
734
+ continue;
735
+ }
736
+ nextEntries.push(createListEntry(item, index, key, renderItem));
737
+ }
738
+ return nextEntries;
739
+ }
740
+ __name(reconcileKeyed, "reconcileKeyed");
741
+ function reconcileIndexed(items, entries, renderItem) {
742
+ const nextEntries = [];
743
+ for (let index = 0; index < items.length; index++) {
744
+ const item = items[index];
745
+ const entry = entries[index];
746
+ if (entry && isPrimitiveItem(item) && !Object.is(entry.value, item)) {
747
+ nextEntries.push(createListEntry(item, index, index, renderItem));
748
+ continue;
749
+ }
750
+ if (entry) {
751
+ entry.item.value = item;
752
+ entry.value = item;
753
+ nextEntries.push(entry);
754
+ continue;
755
+ }
756
+ nextEntries.push(createListEntry(item, index, index, renderItem));
757
+ }
758
+ return nextEntries;
759
+ }
760
+ __name(reconcileIndexed, "reconcileIndexed");
761
+ function isPrimitiveItem(item) {
762
+ return item === null || typeof item !== "object";
763
+ }
764
+ __name(isPrimitiveItem, "isPrimitiveItem");
765
+ function createListEntry(item, index, key, renderItem) {
766
+ const owner = createOwner();
767
+ let itemSignal;
768
+ let viewOwner;
769
+ let node;
770
+ owner.run(() => {
771
+ itemSignal = state(item);
772
+ viewOwner = createOwner();
773
+ node = viewOwner.run(() => renderItem(toReactiveItem(itemSignal, item), index));
774
+ });
775
+ associateNodeOwner(node, viewOwner);
776
+ return { key, node, owner, viewOwner, item: itemSignal, value: item, index };
777
+ }
778
+ __name(createListEntry, "createListEntry");
779
+ function refreshListEntry(parent, entry, index, renderItem) {
780
+ removeChild(parent, entry.node);
781
+ entry.index = index;
782
+ const previousView = entry.viewOwner;
783
+ entry.owner.run(() => {
784
+ entry.viewOwner = createOwner();
785
+ entry.node = entry.viewOwner.run(() => renderItem(
786
+ toReactiveItem(entry.item, entry.value),
787
+ index
788
+ ));
789
+ });
790
+ previousView.dispose();
791
+ associateNodeOwner(entry.node, entry.viewOwner);
792
+ }
793
+ __name(refreshListEntry, "refreshListEntry");
794
+ function toReactiveItem(item, initialValue) {
795
+ if (typeof initialValue !== "object" || initialValue === null) {
796
+ return initialValue;
797
+ }
798
+ return new Proxy(initialValue, {
799
+ get(_target, property, receiver) {
800
+ return Reflect.get(item.value, property, receiver);
801
+ },
802
+ has(_target, property) {
803
+ return property in item.value;
804
+ },
805
+ ownKeys() {
806
+ return Reflect.ownKeys(item.value);
807
+ },
808
+ getOwnPropertyDescriptor(_target, property) {
809
+ return Object.getOwnPropertyDescriptor(item.value, property);
810
+ }
811
+ });
812
+ }
813
+ __name(toReactiveItem, "toReactiveItem");
814
+ function disposeEntry(parent, entry) {
815
+ removeChild(parent, entry.node);
816
+ entry.owner.dispose();
817
+ }
818
+ __name(disposeEntry, "disposeEntry");
819
+
820
+ // packages/vobs/src/context.ts
821
+ var ownerProviders = /* @__PURE__ */ new WeakMap();
822
+ function inject(key, fallback) {
823
+ const owner = getCurrentOwner();
824
+ const value = owner ? injectFromOwner(owner, key) : void 0;
825
+ return value === void 0 ? fallback : value;
826
+ }
827
+ __name(inject, "inject");
828
+ function injectFromOwner(owner, key) {
829
+ let current = owner;
830
+ while (current) {
831
+ const providers = ownerProviders.get(current);
832
+ if (providers?.has(key)) return providers.get(key);
833
+ current = current.parent;
834
+ }
835
+ return void 0;
836
+ }
837
+ __name(injectFromOwner, "injectFromOwner");
838
+
839
+ // packages/vobs/src/app.ts
840
+ function createInjectionKey(description) {
841
+ return Symbol(description);
842
+ }
843
+ __name(createInjectionKey, "createInjectionKey");
844
+
845
+ // packages/ui/src/utils.ts
846
+ function classNames(...values) {
847
+ return values.flatMap((value) => typeof value === "string" ? value.trim().split(/\s+/u) : []).filter(Boolean).join(" ");
848
+ }
849
+ __name(classNames, "classNames");
850
+ function readProp(props, name, fallback) {
851
+ const value = Reflect.get(props, name);
852
+ return value === void 0 ? fallback : value;
853
+ }
854
+ __name(readProp, "readProp");
855
+ function hasProp(props, name) {
856
+ return name in props;
857
+ }
858
+ __name(hasProp, "hasProp");
859
+ function bindClassList(root, props, readBaseClasses) {
860
+ effect(() => {
861
+ setAttribute(root, "class", classNames(
862
+ ...readBaseClasses(),
863
+ readString(props, "class"),
864
+ readString(props, "className")
865
+ ));
866
+ });
867
+ }
868
+ __name(bindClassList, "bindClassList");
869
+ function bindCommonAttributes(root, props, skip = [], options = {}) {
870
+ const ignored = new Set(skip);
871
+ ignored.add("class");
872
+ ignored.add("className");
873
+ ignored.add("children");
874
+ ignored.add("style");
875
+ effect(() => {
876
+ const next = /* @__PURE__ */ new Map();
877
+ for (const name of Object.keys(props)) {
878
+ if (ignored.has(name) || name.startsWith("on")) continue;
879
+ if (!isCommonAttribute(name)) continue;
880
+ if (options.includeDataAria === false && (name.startsWith("aria-") || name.startsWith("data-"))) continue;
881
+ const value = Reflect.get(props, name);
882
+ const normalized = normalizeAttribute(name, value);
883
+ if (normalized !== void 0) next.set(normalized.name, normalized.value);
884
+ }
885
+ const managed = getManagedAttributes(root);
886
+ for (const name of managed) {
887
+ if (!next.has(name)) removeAttribute(root, name);
888
+ }
889
+ for (const [name, value] of next) setAttribute(root, name, value);
890
+ setManagedAttributes(root, next.keys());
891
+ });
892
+ }
893
+ __name(bindCommonAttributes, "bindCommonAttributes");
894
+ function bindUserStyle(root, props) {
895
+ bindStyle(root, props, () => "");
896
+ }
897
+ __name(bindUserStyle, "bindUserStyle");
898
+ function bindStyle(root, props, createStyle) {
899
+ effect(() => {
900
+ const userStyle = readString(props, "style");
901
+ const internalStyle = createStyle();
902
+ const style = [internalStyle, userStyle].filter(Boolean).join("; ");
903
+ if (style) setAttribute(root, "style", style);
904
+ else removeAttribute(root, "style");
905
+ });
906
+ }
907
+ __name(bindStyle, "bindStyle");
908
+ function bindTextContent(node, read) {
909
+ effect(() => {
910
+ setTextContent(node, String(read() ?? ""));
911
+ });
912
+ }
913
+ __name(bindTextContent, "bindTextContent");
914
+ function bindPropertyValue(node, name, read) {
915
+ effect(() => setProperty(node, name, read()));
916
+ }
917
+ __name(bindPropertyValue, "bindPropertyValue");
918
+ function listen(root, event, props, propName, disabled) {
919
+ addEventListener(root, event, (reason) => {
920
+ if (disabled?.()) return;
921
+ const handler = Reflect.get(props, propName);
922
+ if (typeof handler === "function") handler(reason);
923
+ });
924
+ }
925
+ __name(listen, "listen");
926
+ function mountSlot(parent, props, propName) {
927
+ insertDynamic(parent, null, () => resolveSlot(Reflect.get(props, propName)));
928
+ }
929
+ __name(mountSlot, "mountSlot");
930
+ function resolveSlot(value) {
931
+ const resolved = typeof value === "function" ? value() : value;
932
+ if (resolved === void 0 || resolved === null || resolved === false) return null;
933
+ if (typeof resolved === "string" || typeof resolved === "number") return createText(String(resolved));
934
+ if (Array.isArray(resolved)) {
935
+ const children = resolved;
936
+ return createFragment((parent, anchor) => {
937
+ for (const child of children) {
938
+ const node = resolveSlot(child);
939
+ if (node) insertBefore(parent, node, anchor);
940
+ }
941
+ });
942
+ }
943
+ return resolved;
944
+ }
945
+ __name(resolveSlot, "resolveSlot");
946
+ function setOptionalAttribute(node, name, value) {
947
+ if (value === void 0 || value === null || value === false || value === "") {
948
+ removeAttribute(node, name);
949
+ return;
950
+ }
951
+ setAttribute(node, name, String(value));
952
+ }
953
+ __name(setOptionalAttribute, "setOptionalAttribute");
954
+ function setOptionalProperty(node, name, value) {
955
+ if (value === void 0 || value === null) return;
956
+ setProperty(node, name, value);
957
+ }
958
+ __name(setOptionalProperty, "setOptionalProperty");
959
+ function readString(props, name) {
960
+ const value = Reflect.get(props, name);
961
+ return typeof value === "string" ? value : void 0;
962
+ }
963
+ __name(readString, "readString");
964
+ function isCommonAttribute(name) {
965
+ return name === "id" || name === "title" || name === "role" || name === "tabIndex" || name.startsWith("aria-") || name.startsWith("data-");
966
+ }
967
+ __name(isCommonAttribute, "isCommonAttribute");
968
+ function normalizeAttribute(name, value) {
969
+ if (value === void 0 || value === null) return void 0;
970
+ if (value === false && !name.startsWith("aria-") && !name.startsWith("data-")) return void 0;
971
+ return { name: name === "tabIndex" ? "tabindex" : name, value: String(value) };
972
+ }
973
+ __name(normalizeAttribute, "normalizeAttribute");
974
+ var managedAttributes = /* @__PURE__ */ new WeakMap();
975
+ function getManagedAttributes(node) {
976
+ return managedAttributes.get(node) ?? /* @__PURE__ */ new Set();
977
+ }
978
+ __name(getManagedAttributes, "getManagedAttributes");
979
+ function setManagedAttributes(node, names) {
980
+ managedAttributes.set(node, new Set(names));
981
+ }
982
+ __name(setManagedAttributes, "setManagedAttributes");
983
+ function removeAttribute(node, name) {
984
+ const candidate = node;
985
+ candidate.removeAttribute?.(name);
986
+ }
987
+ __name(removeAttribute, "removeAttribute");
988
+
989
+ // packages/ui/src/button.ts
990
+ function Button(props = {}) {
991
+ const root = createElement("button");
992
+ bindClassList(root, props, () => [
993
+ "vui-btn",
994
+ `vui-btn--${readProp(props, "variant", "primary")}`,
995
+ `vui-btn--${readProp(props, "size", "md")}`,
996
+ readProp(props, "iconOnly", false) ? "vui-btn--icon" : void 0
997
+ ]);
998
+ bindCommonAttributes(root, props, [
999
+ "variant",
1000
+ "size",
1001
+ "type",
1002
+ "disabled",
1003
+ "loading",
1004
+ "iconOnly",
1005
+ "icon",
1006
+ "onClick"
1007
+ ]);
1008
+ effect(() => {
1009
+ const disabled = readProp(props, "disabled", false) || readProp(props, "loading", false);
1010
+ setOptionalProperty(root, "disabled", disabled);
1011
+ setOptionalAttribute(root, "type", readProp(props, "type", "button"));
1012
+ setOptionalAttribute(root, "aria-disabled", disabled ? "true" : void 0);
1013
+ setOptionalAttribute(root, "aria-busy", readProp(props, "loading", false) ? "true" : void 0);
1014
+ });
1015
+ listen(root, "click", props, "onClick", () => readProp(props, "disabled", false) || readProp(props, "loading", false));
1016
+ if (hasProp(props, "icon")) mountSlot(root, props, "icon");
1017
+ if (hasProp(props, "children")) mountSlot(root, props, "children");
1018
+ return root;
1019
+ }
1020
+ __name(Button, "Button");
1021
+ function ButtonGroup(props = {}) {
1022
+ const root = createElement("div");
1023
+ bindClassList(root, props, () => ["vui-btn-group"]);
1024
+ bindCommonAttributes(root, props);
1025
+ if (hasProp(props, "children")) mountSlot(root, props, "children");
1026
+ return root;
1027
+ }
1028
+ __name(ButtonGroup, "ButtonGroup");
1029
+
1030
+ // packages/ui/src/forms.ts
1031
+ function bindSignalProp(props) {
1032
+ const value = readProp(props, "bind", void 0);
1033
+ return value && typeof value === "object" && "value" in value ? value : void 0;
1034
+ }
1035
+ __name(bindSignalProp, "bindSignalProp");
1036
+ function Input(props = {}) {
1037
+ const root = createElement("div");
1038
+ const control = createElement("input");
1039
+ bindClassList(root, props, () => [
1040
+ "vui-input",
1041
+ readProp(props, "type", "text") === "search" ? "vui-search" : void 0
1042
+ ]);
1043
+ bindUserStyle(root, props);
1044
+ bindCommonAttributes(control, props, [
1045
+ "type",
1046
+ "name",
1047
+ "value",
1048
+ "placeholder",
1049
+ "disabled",
1050
+ "readOnly",
1051
+ "required",
1052
+ "icon",
1053
+ "onInput",
1054
+ "onChange",
1055
+ "onBlur"
1056
+ ]);
1057
+ effect(() => {
1058
+ setOptionalAttribute(control, "type", readProp(props, "type", "text"));
1059
+ setOptionalAttribute(control, "name", readProp(props, "name", void 0));
1060
+ setOptionalAttribute(control, "placeholder", readProp(props, "placeholder", void 0));
1061
+ setOptionalProperty(control, "disabled", readProp(props, "disabled", false));
1062
+ setOptionalProperty(control, "readOnly", readProp(props, "readOnly", false));
1063
+ setOptionalProperty(control, "required", readProp(props, "required", false));
1064
+ });
1065
+ const bind = bindSignalProp(props);
1066
+ if (bind) {
1067
+ bindPropertyValue(control, "value", () => String(bind.value ?? ""));
1068
+ listen(control, "input", { onInput: /* @__PURE__ */ __name((event) => {
1069
+ bind.value = event.target.value;
1070
+ }, "onInput") }, "onInput", () => readProp(props, "disabled", false));
1071
+ } else if (hasProp(props, "value")) {
1072
+ bindPropertyValue(control, "value", () => readProp(props, "value", void 0) ?? "");
1073
+ }
1074
+ if (hasProp(props, "icon")) {
1075
+ const icon = createElement("span");
1076
+ setAttribute(icon, "class", "vui-input__icon");
1077
+ mountSlot(icon, props, "icon");
1078
+ insertBefore(root, icon, null);
1079
+ }
1080
+ insertBefore(root, control, null);
1081
+ if (hasProp(props, "children")) mountSlot(root, props, "children");
1082
+ listen(control, "input", props, "onInput", () => readProp(props, "disabled", false));
1083
+ listen(control, "change", props, "onChange", () => readProp(props, "disabled", false));
1084
+ listen(control, "blur", props, "onBlur", () => false);
1085
+ return root;
1086
+ }
1087
+ __name(Input, "Input");
1088
+ function Textarea(props = {}) {
1089
+ const root = createElement("textarea");
1090
+ bindClassList(root, props, () => ["vui-textarea"]);
1091
+ bindCommonAttributes(root, props, [
1092
+ "value",
1093
+ "placeholder",
1094
+ "disabled",
1095
+ "readOnly",
1096
+ "required",
1097
+ "rows",
1098
+ "name",
1099
+ "onInput",
1100
+ "onChange",
1101
+ "onBlur"
1102
+ ]);
1103
+ effect(() => {
1104
+ setOptionalAttribute(root, "name", readProp(props, "name", void 0));
1105
+ setOptionalAttribute(root, "placeholder", readProp(props, "placeholder", void 0));
1106
+ setOptionalProperty(root, "disabled", readProp(props, "disabled", false));
1107
+ setOptionalProperty(root, "readOnly", readProp(props, "readOnly", false));
1108
+ setOptionalProperty(root, "required", readProp(props, "required", false));
1109
+ setOptionalAttribute(root, "rows", readProp(props, "rows", void 0));
1110
+ });
1111
+ const bind = bindSignalProp(props);
1112
+ if (bind) {
1113
+ bindPropertyValue(root, "value", () => String(bind.value ?? ""));
1114
+ listen(root, "input", { onInput: /* @__PURE__ */ __name((event) => {
1115
+ bind.value = event.target.value;
1116
+ }, "onInput") }, "onInput", () => readProp(props, "disabled", false));
1117
+ } else if (hasProp(props, "value")) {
1118
+ bindPropertyValue(root, "value", () => readProp(props, "value", void 0) ?? "");
1119
+ }
1120
+ listen(root, "input", props, "onInput", () => readProp(props, "disabled", false));
1121
+ listen(root, "change", props, "onChange", () => readProp(props, "disabled", false));
1122
+ listen(root, "blur", props, "onBlur", () => false);
1123
+ return root;
1124
+ }
1125
+ __name(Textarea, "Textarea");
1126
+ function Select(props = {}) {
1127
+ const root = createElement("select");
1128
+ bindClassList(root, props, () => ["vui-select"]);
1129
+ bindCommonAttributes(root, props, [
1130
+ "name",
1131
+ "value",
1132
+ "disabled",
1133
+ "required",
1134
+ "multiple",
1135
+ "size",
1136
+ "onChange"
1137
+ ]);
1138
+ effect(() => {
1139
+ setOptionalAttribute(root, "name", readProp(props, "name", void 0));
1140
+ setOptionalProperty(root, "disabled", readProp(props, "disabled", false));
1141
+ setOptionalProperty(root, "required", readProp(props, "required", false));
1142
+ setOptionalProperty(root, "multiple", readProp(props, "multiple", false));
1143
+ setOptionalAttribute(root, "size", readProp(props, "size", void 0));
1144
+ });
1145
+ if (hasProp(props, "children")) mountSlot(root, props, "children");
1146
+ const bind = bindSignalProp(props);
1147
+ if (bind) {
1148
+ bindPropertyValue(root, "value", () => String(bind.value ?? ""));
1149
+ listen(root, "change", { onChange: /* @__PURE__ */ __name((event) => {
1150
+ bind.value = event.target.value;
1151
+ }, "onChange") }, "onChange", () => readProp(props, "disabled", false));
1152
+ } else if (hasProp(props, "value")) {
1153
+ bindPropertyValue(root, "value", () => readProp(props, "value", void 0) ?? "");
1154
+ }
1155
+ listen(root, "change", props, "onChange", () => readProp(props, "disabled", false));
1156
+ return root;
1157
+ }
1158
+ __name(Select, "Select");
1159
+ function Checkbox(props = {}) {
1160
+ return createChoice("checkbox", props);
1161
+ }
1162
+ __name(Checkbox, "Checkbox");
1163
+ function Radio(props = {}) {
1164
+ return createChoice("radio", props);
1165
+ }
1166
+ __name(Radio, "Radio");
1167
+ function createChoice(type, props) {
1168
+ const root = createElement("label");
1169
+ const control = createElement("input");
1170
+ const visual = createElement("span");
1171
+ bindClassList(root, props, () => [`vui-${type}`]);
1172
+ bindUserStyle(root, props);
1173
+ bindCommonAttributes(control, props, [
1174
+ "name",
1175
+ "value",
1176
+ "checked",
1177
+ "disabled",
1178
+ "required",
1179
+ "onChange"
1180
+ ]);
1181
+ setAttribute(visual, "class", type === "checkbox" ? "vui-check__box" : "vui-radio__dot");
1182
+ effect(() => {
1183
+ setOptionalAttribute(control, "type", type);
1184
+ setOptionalAttribute(control, "name", readProp(props, "name", void 0));
1185
+ setOptionalAttribute(control, "value", readProp(props, "value", void 0));
1186
+ setOptionalProperty(control, "disabled", readProp(props, "disabled", false));
1187
+ setOptionalProperty(control, "required", readProp(props, "required", false));
1188
+ });
1189
+ const bind = bindSignalProp(props);
1190
+ if (bind) {
1191
+ bindPropertyValue(control, "checked", () => bind.value);
1192
+ listen(control, "change", { onChange: /* @__PURE__ */ __name((event) => {
1193
+ bind.value = event.target.checked;
1194
+ }, "onChange") }, "onChange", () => readProp(props, "disabled", false));
1195
+ } else if (hasProp(props, "checked")) {
1196
+ bindPropertyValue(control, "checked", () => readProp(props, "checked", false));
1197
+ }
1198
+ insertBefore(root, control, null);
1199
+ insertBefore(root, visual, null);
1200
+ if (hasProp(props, "children")) mountSlot(root, props, "children");
1201
+ listen(control, "change", props, "onChange", () => readProp(props, "disabled", false));
1202
+ return root;
1203
+ }
1204
+ __name(createChoice, "createChoice");
1205
+ function Switch(props = {}) {
1206
+ const root = createElement("label");
1207
+ const control = createElement("input");
1208
+ const thumb = createElement("span");
1209
+ bindClassList(root, props, () => [
1210
+ "vui-switch",
1211
+ readProp(props, "size", "md") === "sm" ? "vui-switch--sm" : void 0
1212
+ ]);
1213
+ bindUserStyle(root, props);
1214
+ bindCommonAttributes(root, props, ["role"]);
1215
+ bindCommonAttributes(control, props, [
1216
+ "checked",
1217
+ "disabled",
1218
+ "readOnly",
1219
+ "name",
1220
+ "value",
1221
+ "onChange"
1222
+ ]);
1223
+ setAttribute(thumb, "class", "vui-switch__thumb");
1224
+ setAttribute(root, "role", "switch");
1225
+ const bind = bindSignalProp(props);
1226
+ effect(() => {
1227
+ setOptionalAttribute(control, "type", "checkbox");
1228
+ setOptionalAttribute(control, "name", readProp(props, "name", void 0));
1229
+ setOptionalAttribute(control, "value", readProp(props, "value", void 0));
1230
+ setOptionalProperty(control, "disabled", readProp(props, "disabled", false));
1231
+ setOptionalProperty(control, "readOnly", readProp(props, "readOnly", false));
1232
+ setOptionalAttribute(root, "aria-checked", (bind ? bind.value : readProp(props, "checked", false)) ? "true" : "false");
1233
+ setOptionalAttribute(root, "aria-disabled", readProp(props, "disabled", false) ? "true" : void 0);
1234
+ });
1235
+ if (bind) {
1236
+ bindPropertyValue(control, "checked", () => bind.value);
1237
+ listen(control, "change", { onChange: /* @__PURE__ */ __name((event) => {
1238
+ bind.value = event.target.checked;
1239
+ }, "onChange") }, "onChange", () => readProp(props, "disabled", false));
1240
+ } else if (hasProp(props, "checked")) {
1241
+ bindPropertyValue(control, "checked", () => readProp(props, "checked", false));
1242
+ }
1243
+ insertBefore(root, control, null);
1244
+ insertBefore(root, thumb, null);
1245
+ if (hasProp(props, "children")) mountSlot(root, props, "children");
1246
+ listen(control, "change", props, "onChange", () => readProp(props, "disabled", false));
1247
+ return root;
1248
+ }
1249
+ __name(Switch, "Switch");
1250
+
1251
+ // packages/ui/src/card.ts
1252
+ function Card(props = {}) {
1253
+ const root = createElement("div");
1254
+ bindClassList(root, props, () => ["vui-card"]);
1255
+ bindCommonAttributes(root, props, ["title", "description"]);
1256
+ bindUserStyle(root, props);
1257
+ if (hasProp(props, "title")) {
1258
+ const title = createElement("div");
1259
+ const text = createText("");
1260
+ setAttribute(title, "class", "vui-card__title");
1261
+ bindTextContent(text, () => readProp(props, "title", ""));
1262
+ insertBefore(title, text, null);
1263
+ insertBefore(root, title, null);
1264
+ }
1265
+ if (hasProp(props, "description")) {
1266
+ const description = createElement("p");
1267
+ const text = createText("");
1268
+ setAttribute(description, "class", "vui-card__desc");
1269
+ bindTextContent(text, () => readProp(props, "description", ""));
1270
+ insertBefore(description, text, null);
1271
+ insertBefore(root, description, null);
1272
+ }
1273
+ if (hasProp(props, "children")) mountSlot(root, props, "children");
1274
+ return root;
1275
+ }
1276
+ __name(Card, "Card");
1277
+ function CardHeader(props = {}) {
1278
+ const root = createElement("div");
1279
+ bindClassList(root, props, () => ["vui-card__header"]);
1280
+ bindCommonAttributes(root, props);
1281
+ bindUserStyle(root, props);
1282
+ if (hasProp(props, "children")) mountSlot(root, props, "children");
1283
+ return root;
1284
+ }
1285
+ __name(CardHeader, "CardHeader");
1286
+
1287
+ // packages/ui/src/tag.ts
1288
+ function Tag(props = {}) {
1289
+ const root = createElement("span");
1290
+ bindClassList(root, props, () => [
1291
+ "vui-tag",
1292
+ readProp(props, "tone", "default") === "default" ? void 0 : `vui-tag--${readProp(props, "tone", "default")}`
1293
+ ]);
1294
+ bindCommonAttributes(root, props, ["tone"]);
1295
+ bindUserStyle(root, props);
1296
+ if (hasProp(props, "children")) mountSlot(root, props, "children");
1297
+ return root;
1298
+ }
1299
+ __name(Tag, "Tag");
1300
+
1301
+ // packages/ui/src/alert.ts
1302
+ function Alert(props = {}) {
1303
+ const root = createElement("div");
1304
+ bindClassList(root, props, () => [
1305
+ "vui-alert",
1306
+ `vui-alert--${readProp(props, "tone", "info")}`
1307
+ ]);
1308
+ bindCommonAttributes(root, props, ["tone", "title", "description", "icon", "role"]);
1309
+ bindUserStyle(root, props);
1310
+ setAttribute(root, "role", "alert");
1311
+ if (hasProp(props, "icon")) {
1312
+ const icon = createElement("span");
1313
+ setAttribute(icon, "class", "vui-alert__icon");
1314
+ mountSlot(icon, props, "icon");
1315
+ insertBefore(root, icon, null);
1316
+ }
1317
+ const content = createElement("div");
1318
+ if (hasProp(props, "title")) {
1319
+ const title = createElement("div");
1320
+ const text = createText("");
1321
+ setAttribute(title, "class", "vui-alert__title");
1322
+ bindTextContent(text, () => readProp(props, "title", ""));
1323
+ insertBefore(title, text, null);
1324
+ insertBefore(content, title, null);
1325
+ }
1326
+ if (hasProp(props, "description")) {
1327
+ const description = createElement("div");
1328
+ const text = createText("");
1329
+ setAttribute(description, "class", "vui-alert__desc");
1330
+ bindTextContent(text, () => readProp(props, "description", ""));
1331
+ insertBefore(description, text, null);
1332
+ insertBefore(content, description, null);
1333
+ }
1334
+ if (hasProp(props, "children")) mountSlot(content, props, "children");
1335
+ insertBefore(root, content, null);
1336
+ return root;
1337
+ }
1338
+ __name(Alert, "Alert");
1339
+
1340
+ // packages/ui/src/tabs.ts
1341
+ function Tabs(props) {
1342
+ const root = createElement("div");
1343
+ const tablist = createElement("div");
1344
+ const panel = createElement("div");
1345
+ const internalValue = state(void 0);
1346
+ bindClassList(root, props, () => ["vui-tabs-root"]);
1347
+ bindCommonAttributes(root, props, ["items", "value", "variant", "onChange"]);
1348
+ setAttribute(tablist, "role", "tablist");
1349
+ effect(() => {
1350
+ const variant = readProp(props, "variant", "default");
1351
+ setAttribute(tablist, "class", `vui-tabs${variant === "filled" ? " vui-tabs--filled" : ""}`);
1352
+ });
1353
+ setAttribute(panel, "class", "vui-tabs__panel");
1354
+ insertDynamic(tablist, null, () => createTabButtons(props, internalValue));
1355
+ insertDynamic(panel, null, () => {
1356
+ const item = activeItem(readProp(props, "items", []), activeId(props, internalValue));
1357
+ return item?.content === void 0 ? null : resolveSlot(item.content);
1358
+ });
1359
+ insertBefore(root, tablist, null);
1360
+ insertBefore(root, panel, null);
1361
+ if (hasProp(props, "children")) mountSlot(root, props, "children");
1362
+ return root;
1363
+ }
1364
+ __name(Tabs, "Tabs");
1365
+ function createTabButtons(props, internalValue) {
1366
+ const items = readProp(props, "items", []);
1367
+ const selected = activeId(props, internalValue);
1368
+ return createFragment((parent, anchor) => {
1369
+ for (const item of items) {
1370
+ const button = createElement("button");
1371
+ const isActive = item.id === selected;
1372
+ setAttribute(button, "class", `vui-tab${isActive ? " is-active" : ""}`);
1373
+ setAttribute(button, "role", "tab");
1374
+ setAttribute(button, "type", "button");
1375
+ setAttribute(button, "aria-selected", isActive ? "true" : "false");
1376
+ setAttribute(button, "data-tab-id", item.id);
1377
+ if (item.disabled === true) {
1378
+ setAttribute(button, "aria-disabled", "true");
1379
+ setProperty(button, "disabled", true);
1380
+ }
1381
+ insertBefore(button, createText(item.label), null);
1382
+ addEventListener(button, "click", () => {
1383
+ if (item.disabled === true) return;
1384
+ if (readProp(props, "value", void 0) === void 0) internalValue.value = item.id;
1385
+ const onChange = readProp(props, "onChange", void 0);
1386
+ if (typeof onChange === "function") onChange(item.id);
1387
+ });
1388
+ insertBefore(parent, button, anchor);
1389
+ }
1390
+ });
1391
+ }
1392
+ __name(createTabButtons, "createTabButtons");
1393
+ function activeId(props, internalValue) {
1394
+ const controlled = readProp(props, "value", void 0);
1395
+ if (controlled !== void 0) return controlled;
1396
+ if (internalValue.value !== void 0) return internalValue.value;
1397
+ return readProp(props, "items", []).find((item) => item.disabled !== true)?.id;
1398
+ }
1399
+ __name(activeId, "activeId");
1400
+ function activeItem(items, id) {
1401
+ return items.find((item) => item.id === id);
1402
+ }
1403
+ __name(activeItem, "activeItem");
1404
+
1405
+ // packages/ui/src/overlay.ts
1406
+ function createPortal(node, adapter, target) {
1407
+ const placeholder = createComment("vui:portal");
1408
+ const owner = getCurrentOwner();
1409
+ if (!owner) throw new Error("Vobs UI: createPortal \u5FC5\u987B\u5728\u7EC4\u4EF6 Owner \u4F5C\u7528\u57DF\u5185\u8C03\u7528");
1410
+ adapter.mount(node, target);
1411
+ const cleanup = /* @__PURE__ */ __name(() => adapter.unmount(node, target), "cleanup");
1412
+ owner.onDispose(cleanup);
1413
+ return placeholder;
1414
+ }
1415
+ __name(createPortal, "createPortal");
1416
+ function createDOMPortalAdapter() {
1417
+ return {
1418
+ mount(node, target) {
1419
+ insertBefore(target, node, null);
1420
+ },
1421
+ unmount(node, target) {
1422
+ removePortalNode(node, target);
1423
+ }
1424
+ };
1425
+ }
1426
+ __name(createDOMPortalAdapter, "createDOMPortalAdapter");
1427
+ function createFocusTrap(root, options = {}) {
1428
+ let isActive = false;
1429
+ let disposed = false;
1430
+ let previouslyFocused = null;
1431
+ const focusable = /* @__PURE__ */ __name(() => [...root.querySelectorAll(FOCUSABLE_SELECTOR)].filter((element) => !element.hasAttribute("disabled") && element.getAttribute("aria-hidden") !== "true"), "focusable");
1432
+ const onKeyDown = /* @__PURE__ */ __name((event) => {
1433
+ if (!isActive || disposed) return;
1434
+ if (event.key === "Escape") {
1435
+ options.onEscape?.(event);
1436
+ return;
1437
+ }
1438
+ if (event.key !== "Tab") return;
1439
+ const elements = focusable();
1440
+ if (elements.length === 0) {
1441
+ event.preventDefault();
1442
+ root.focus();
1443
+ return;
1444
+ }
1445
+ const first = elements[0];
1446
+ const last = elements[elements.length - 1];
1447
+ const current = document.activeElement;
1448
+ if (event.shiftKey && current === first) {
1449
+ event.preventDefault();
1450
+ last.focus();
1451
+ } else if (!event.shiftKey && current === last) {
1452
+ event.preventDefault();
1453
+ first.focus();
1454
+ }
1455
+ }, "onKeyDown");
1456
+ const activate = /* @__PURE__ */ __name(() => {
1457
+ if (disposed || isActive) return;
1458
+ isActive = true;
1459
+ previouslyFocused = document.activeElement;
1460
+ root.addEventListener("keydown", onKeyDown);
1461
+ const initial = resolveInitialFocus(options.initialFocus) ?? focusable()[0] ?? root;
1462
+ if (!root.hasAttribute("tabindex") && initial === root) root.setAttribute("tabindex", "-1");
1463
+ initial.focus();
1464
+ }, "activate");
1465
+ const deactivate = /* @__PURE__ */ __name(() => {
1466
+ if (!isActive) return;
1467
+ isActive = false;
1468
+ root.removeEventListener("keydown", onKeyDown);
1469
+ if (options.restoreFocus !== false && typeof HTMLElement !== "undefined" && previouslyFocused instanceof HTMLElement) previouslyFocused.focus();
1470
+ previouslyFocused = null;
1471
+ }, "deactivate");
1472
+ const handle = {
1473
+ get active() {
1474
+ return isActive;
1475
+ },
1476
+ activate,
1477
+ deactivate,
1478
+ dispose() {
1479
+ if (disposed) return;
1480
+ deactivate();
1481
+ disposed = true;
1482
+ }
1483
+ };
1484
+ if (getCurrentOwner()) onDispose(() => handle.dispose());
1485
+ return handle;
1486
+ }
1487
+ __name(createFocusTrap, "createFocusTrap");
1488
+ function createOverlayManager() {
1489
+ let entries = [];
1490
+ const listeners = /* @__PURE__ */ new Set();
1491
+ const notify = /* @__PURE__ */ __name(() => {
1492
+ const snapshot = entries.slice();
1493
+ for (const listener of listeners) listener(snapshot);
1494
+ }, "notify");
1495
+ return {
1496
+ get entries() {
1497
+ return entries;
1498
+ },
1499
+ open(entry) {
1500
+ entries = [...entries.filter((current) => current.id !== entry.id), entry];
1501
+ notify();
1502
+ },
1503
+ close(id) {
1504
+ const next = entries.filter((entry) => entry.id !== id);
1505
+ if (next.length === entries.length) return;
1506
+ entries = next;
1507
+ notify();
1508
+ },
1509
+ bringToFront(id) {
1510
+ const entry = entries.find((current) => current.id === id);
1511
+ if (!entry || entries[entries.length - 1] === entry) return;
1512
+ entries = [...entries.filter((current) => current !== entry), entry];
1513
+ notify();
1514
+ },
1515
+ subscribe(listener) {
1516
+ listeners.add(listener);
1517
+ listener(entries.slice());
1518
+ return () => listeners.delete(listener);
1519
+ }
1520
+ };
1521
+ }
1522
+ __name(createOverlayManager, "createOverlayManager");
1523
+ function resolveInitialFocus(target) {
1524
+ if (!target) return null;
1525
+ return typeof target === "function" ? target() : target;
1526
+ }
1527
+ __name(resolveInitialFocus, "resolveInitialFocus");
1528
+ function removePortalNode(node, target) {
1529
+ if (isVobsFragment(node)) {
1530
+ let current = node.start.nextSibling;
1531
+ while (current && current !== node.end) {
1532
+ const next = current.nextSibling;
1533
+ target.removeChild(current);
1534
+ current = next;
1535
+ }
1536
+ if (node.start.parentNode === target) target.removeChild(node.start);
1537
+ if (node.end.parentNode === target) target.removeChild(node.end);
1538
+ return;
1539
+ }
1540
+ if (node.parentNode === target) target.removeChild(node);
1541
+ }
1542
+ __name(removePortalNode, "removePortalNode");
1543
+ var FOCUSABLE_SELECTOR = [
1544
+ "a[href]",
1545
+ "area[href]",
1546
+ "button",
1547
+ "input",
1548
+ "select",
1549
+ "textarea",
1550
+ "iframe",
1551
+ "object",
1552
+ "embed",
1553
+ "[contenteditable]",
1554
+ "[tabindex]"
1555
+ ].join(",");
1556
+
1557
+ // packages/ui/src/dialog.ts
1558
+ function Dialog(props = {}) {
1559
+ const root = createElement("div");
1560
+ const surface = createElement("section");
1561
+ const body = createElement("div");
1562
+ bindClassList(root, props, () => ["vui-backdrop"]);
1563
+ bindUserStyle(root, props);
1564
+ bindCommonAttributes(surface, props, [
1565
+ "open",
1566
+ "title",
1567
+ "headerActions",
1568
+ "size",
1569
+ "modal",
1570
+ "closeOnBackdrop",
1571
+ "closeOnEscape",
1572
+ "titleId",
1573
+ "descriptionId",
1574
+ "closeLabel",
1575
+ "onClose",
1576
+ "portal",
1577
+ "portalTarget"
1578
+ ]);
1579
+ setAttribute(root, "role", "presentation");
1580
+ setAttribute(surface, "class", "vui-dialog");
1581
+ setAttribute(surface, "role", "dialog");
1582
+ setAttribute(body, "class", "vui-dialog__body");
1583
+ effect(() => {
1584
+ const open = readProp(props, "open", false);
1585
+ const modal = readProp(props, "modal", true);
1586
+ setOptionalProperty(root, "hidden", !open);
1587
+ setOptionalAttribute(root, "data-state", open ? "open" : "closed");
1588
+ setOptionalAttribute(surface, "aria-modal", modal ? "true" : "false");
1589
+ setOptionalAttribute(surface, "aria-labelledby", readProp(props, "titleId", void 0));
1590
+ setOptionalAttribute(surface, "aria-describedby", readProp(props, "descriptionId", void 0));
1591
+ setOptionalAttribute(surface, "data-size", readProp(props, "size", "md"));
1592
+ });
1593
+ if (hasProp(props, "title") || hasProp(props, "headerActions") || hasProp(props, "onClose")) {
1594
+ const head = createElement("header");
1595
+ setAttribute(head, "class", "vui-dialog__head");
1596
+ if (hasProp(props, "title")) {
1597
+ const title = createElement("div");
1598
+ const text = createText("");
1599
+ setAttribute(title, "class", "vui-dialog__title");
1600
+ bindTextContent(text, () => readProp(props, "title", ""));
1601
+ insertBefore(title, text, null);
1602
+ insertBefore(head, title, null);
1603
+ }
1604
+ if (hasProp(props, "headerActions")) mountSlot(head, props, "headerActions");
1605
+ if (hasProp(props, "onClose")) {
1606
+ const close = createElement("button");
1607
+ setAttribute(close, "class", "vui-dialog__close");
1608
+ setAttribute(close, "type", "button");
1609
+ setAttribute(close, "aria-label", readProp(props, "closeLabel", "Close"));
1610
+ insertBefore(close, createText("x"), null);
1611
+ addEventListener(close, "click", () => emitClose(props, "close-button"));
1612
+ insertBefore(head, close, null);
1613
+ }
1614
+ insertBefore(surface, head, null);
1615
+ }
1616
+ if (hasProp(props, "children")) mountSlot(body, props, "children");
1617
+ insertBefore(surface, body, null);
1618
+ insertBefore(root, surface, null);
1619
+ addEventListener(root, "click", (event) => {
1620
+ if (event.target !== root) return;
1621
+ if (readProp(props, "closeOnBackdrop", true)) emitClose(props, "backdrop");
1622
+ });
1623
+ addEventListener(root, "keydown", (event) => {
1624
+ if (event.key !== "Escape") return;
1625
+ if (readProp(props, "closeOnEscape", true)) emitClose(props, "escape");
1626
+ });
1627
+ const portal = readProp(props, "portal", void 0);
1628
+ return portal ? createPortal(root, portal, readProp(props, "portalTarget", void 0)) : root;
1629
+ }
1630
+ __name(Dialog, "Dialog");
1631
+ function emitClose(props, reason) {
1632
+ if (!readProp(props, "open", false)) return;
1633
+ const handler = readProp(props, "onClose", void 0);
1634
+ if (typeof handler === "function") handler(reason);
1635
+ }
1636
+ __name(emitClose, "emitClose");
1637
+
1638
+ // packages/ui/src/menu.ts
1639
+ function Menu(props = {}) {
1640
+ const root = createElement("div");
1641
+ bindClassList(root, props, () => ["vui-menu"]);
1642
+ bindCommonAttributes(root, props, ["items", "onSelect"]);
1643
+ if (!hasProp(props, "role")) setAttribute(root, "role", "menu");
1644
+ if (hasProp(props, "items")) {
1645
+ insertDynamic(root, null, () => createMenuItems(props));
1646
+ }
1647
+ if (hasProp(props, "children")) mountSlot(root, props, "children");
1648
+ return root;
1649
+ }
1650
+ __name(Menu, "Menu");
1651
+ function MenuDivider(props = {}) {
1652
+ const root = createElement("div");
1653
+ bindClassList(root, props, () => ["vui-menu__divider"]);
1654
+ bindCommonAttributes(root, props);
1655
+ setAttribute(root, "role", "separator");
1656
+ return root;
1657
+ }
1658
+ __name(MenuDivider, "MenuDivider");
1659
+ function createMenuItems(props) {
1660
+ const items = readProp(props, "items", []);
1661
+ return createFragment((parent, anchor) => {
1662
+ for (const item of items) {
1663
+ const node = item.divider === true ? createMenuDividerNode(item) : createMenuItemNode(item, props);
1664
+ insertBefore(parent, node, anchor);
1665
+ }
1666
+ });
1667
+ }
1668
+ __name(createMenuItems, "createMenuItems");
1669
+ function createMenuDividerNode(item) {
1670
+ const divider = createElement("div");
1671
+ setAttribute(divider, "class", "vui-menu__divider");
1672
+ setAttribute(divider, "role", "separator");
1673
+ setOptionalAttribute(divider, "data-menu-item-id", item.id);
1674
+ return divider;
1675
+ }
1676
+ __name(createMenuDividerNode, "createMenuDividerNode");
1677
+ function createMenuItemNode(item, props) {
1678
+ const button = createElement("button");
1679
+ setAttribute(button, "class", `vui-menu__item${item.danger === true ? " vui-menu__item--danger" : ""}`);
1680
+ setAttribute(button, "type", "button");
1681
+ setAttribute(button, "role", "menuitem");
1682
+ setOptionalAttribute(button, "data-menu-item-id", item.id);
1683
+ if (item.disabled === true) {
1684
+ setProperty(button, "disabled", true);
1685
+ setAttribute(button, "aria-disabled", "true");
1686
+ }
1687
+ if (item.icon !== void 0) {
1688
+ const icon = createElement("span");
1689
+ setAttribute(icon, "class", "vui-menu__icon");
1690
+ mountSlot(icon, item, "icon");
1691
+ insertBefore(button, icon, null);
1692
+ }
1693
+ if (item.label !== void 0) {
1694
+ const label = createElement("span");
1695
+ setAttribute(label, "class", "vui-menu__label");
1696
+ insertBefore(label, createText(item.label), null);
1697
+ insertBefore(button, label, null);
1698
+ } else if (item.content !== void 0) {
1699
+ mountSlot(button, item, "content");
1700
+ }
1701
+ if (item.shortcut !== void 0) {
1702
+ const shortcut = createElement("span");
1703
+ setAttribute(shortcut, "class", "vui-menu__shortcut");
1704
+ insertBefore(shortcut, createText(item.shortcut), null);
1705
+ insertBefore(button, shortcut, null);
1706
+ }
1707
+ addEventListener(button, "click", (event) => {
1708
+ if (item.disabled === true || item.id === void 0) return;
1709
+ const handler = readProp(props, "onSelect", void 0);
1710
+ if (typeof handler === "function") handler(item.id, event);
1711
+ });
1712
+ return button;
1713
+ }
1714
+ __name(createMenuItemNode, "createMenuItemNode");
1715
+
1716
+ // packages/ui/src/nav-list.ts
1717
+ function NavList(props = {}) {
1718
+ const root = createElement("nav");
1719
+ const internalValue = state(void 0);
1720
+ bindClassList(root, props, () => ["vui-navlist"]);
1721
+ bindCommonAttributes(root, props, ["groups", "value", "defaultValue", "onChange"]);
1722
+ insertDynamic(root, null, () => createNavGroups(props, internalValue));
1723
+ if (hasProp(props, "children")) mountSlot(root, props, "children");
1724
+ return root;
1725
+ }
1726
+ __name(NavList, "NavList");
1727
+ function createNavGroups(props, internalValue) {
1728
+ const groups = readProp(props, "groups", []);
1729
+ const selected = activeId2(props, groups, internalValue);
1730
+ return createFragment((parent, anchor) => {
1731
+ for (const group of groups) {
1732
+ const groupRoot = createElement("div");
1733
+ setAttribute(groupRoot, "class", "vui-navlist__group");
1734
+ setOptionalAttribute(groupRoot, "data-nav-group-id", group.id);
1735
+ if (group.title !== void 0) {
1736
+ const title = createElement("div");
1737
+ setAttribute(title, "class", "vui-navlist__group-title");
1738
+ insertBefore(title, createText(group.title), null);
1739
+ insertBefore(groupRoot, title, null);
1740
+ }
1741
+ for (const item of group.items) {
1742
+ insertBefore(groupRoot, createNavItem(item, props, selected, internalValue), null);
1743
+ }
1744
+ insertBefore(parent, groupRoot, anchor);
1745
+ }
1746
+ });
1747
+ }
1748
+ __name(createNavGroups, "createNavGroups");
1749
+ function createNavItem(item, props, selected, internalValue) {
1750
+ const active = item.id === selected;
1751
+ const element = createElement(item.href === void 0 ? "button" : "a");
1752
+ setAttribute(element, "class", `vui-navlist__item${active ? " is-active" : ""}`);
1753
+ if (item.href !== void 0) setAttribute(element, "role", "link");
1754
+ setOptionalAttribute(element, "data-nav-id", item.id);
1755
+ if (item.href !== void 0) {
1756
+ setAttribute(element, "href", item.href);
1757
+ setOptionalAttribute(element, "target", item.target);
1758
+ setOptionalAttribute(element, "rel", item.rel);
1759
+ } else {
1760
+ setAttribute(element, "type", "button");
1761
+ }
1762
+ if (active) setAttribute(element, "aria-current", "page");
1763
+ if (item.disabled === true) {
1764
+ setAttribute(element, "aria-disabled", "true");
1765
+ setProperty(element, "tabIndex", -1);
1766
+ if (item.href === void 0) setProperty(element, "disabled", true);
1767
+ }
1768
+ if (item.icon !== void 0) {
1769
+ const icon = createElement("span");
1770
+ setAttribute(icon, "class", "vui-navlist__icon");
1771
+ mountSlot(icon, item, "icon");
1772
+ insertBefore(element, icon, null);
1773
+ }
1774
+ const label = createElement("span");
1775
+ setAttribute(label, "class", "vui-navlist__label");
1776
+ insertBefore(label, createText(item.label), null);
1777
+ insertBefore(element, label, null);
1778
+ if (item.badge !== void 0) {
1779
+ const badge = createElement("span");
1780
+ setAttribute(badge, "class", "vui-navlist__badge");
1781
+ mountSlot(badge, item, "badge");
1782
+ insertBefore(element, badge, null);
1783
+ }
1784
+ addEventListener(element, "click", (event) => {
1785
+ if (item.disabled === true) {
1786
+ event.preventDefault?.();
1787
+ return;
1788
+ }
1789
+ if (readProp(props, "value", void 0) === void 0) internalValue.value = item.id;
1790
+ const handler = readProp(props, "onChange", void 0);
1791
+ if (typeof handler === "function") handler(item.id, event);
1792
+ });
1793
+ return element;
1794
+ }
1795
+ __name(createNavItem, "createNavItem");
1796
+ function activeId2(props, groups, internalValue) {
1797
+ const controlled = readProp(props, "value", void 0);
1798
+ if (controlled !== void 0) return controlled;
1799
+ if (internalValue.value !== void 0) return internalValue.value;
1800
+ const defaultValue = readProp(props, "defaultValue", void 0);
1801
+ if (defaultValue !== void 0) return defaultValue;
1802
+ for (const group of groups) {
1803
+ const active = group.items.find((item) => item.active === true);
1804
+ if (active) return active.id;
1805
+ }
1806
+ return void 0;
1807
+ }
1808
+ __name(activeId2, "activeId");
1809
+
1810
+ // packages/ui/src/pagination.ts
1811
+ function Pagination(props = {}) {
1812
+ const root = createElement("nav");
1813
+ bindClassList(root, props, () => ["vui-pagination"]);
1814
+ bindCommonAttributes(root, props, [
1815
+ "page",
1816
+ "pageCount",
1817
+ "siblingCount",
1818
+ "disabled",
1819
+ "previousLabel",
1820
+ "nextLabel",
1821
+ "previousIcon",
1822
+ "nextIcon",
1823
+ "onChange"
1824
+ ]);
1825
+ if (!hasProp(props, "aria-label")) setAttribute(root, "aria-label", "Pagination");
1826
+ insertDynamic(root, null, () => createPaginationItems(props));
1827
+ if (hasProp(props, "children")) mountSlot(root, props, "children");
1828
+ return root;
1829
+ }
1830
+ __name(Pagination, "Pagination");
1831
+ function createPaginationItems(props) {
1832
+ const pageCount = Math.max(0, Math.floor(readProp(props, "pageCount", 0)));
1833
+ const page = clampPage(readProp(props, "page", 1), pageCount);
1834
+ const siblingCount = Math.max(0, Math.floor(readProp(props, "siblingCount", 1)));
1835
+ const disabled = readProp(props, "disabled", false);
1836
+ const items = pageCount === 0 ? [] : buildPaginationItems(page, pageCount, siblingCount);
1837
+ return createFragment((parent, anchor) => {
1838
+ insertBefore(parent, createPaginationControl(props, "previous", page <= 1 || disabled), anchor);
1839
+ for (const item of items) {
1840
+ if (typeof item === "number") {
1841
+ insertBefore(parent, createPageButton(item, item === page, disabled, props), anchor);
1842
+ } else {
1843
+ insertBefore(parent, createEllipsis(item), anchor);
1844
+ }
1845
+ }
1846
+ insertBefore(parent, createPaginationControl(props, "next", page >= pageCount || pageCount === 0 || disabled), anchor);
1847
+ });
1848
+ }
1849
+ __name(createPaginationItems, "createPaginationItems");
1850
+ function createPaginationControl(props, direction, disabled) {
1851
+ const button = createElement("button");
1852
+ setAttribute(button, "class", "vui-pagination__item");
1853
+ setAttribute(button, "type", "button");
1854
+ setProperty(button, "disabled", disabled);
1855
+ setOptionalAttribute(button, "aria-label", direction === "previous" ? readProp(props, "previousLabel", "Previous") : readProp(props, "nextLabel", "Next"));
1856
+ if (disabled) setAttribute(button, "aria-disabled", "true");
1857
+ const icon = direction === "previous" ? readProp(props, "previousIcon", void 0) : readProp(props, "nextIcon", void 0);
1858
+ const fallback = direction === "previous" ? "<" : ">";
1859
+ const node = icon === void 0 ? createText(fallback) : resolveSlot(icon);
1860
+ if (node) insertBefore(button, node, null);
1861
+ addEventListener(button, "click", () => {
1862
+ if (disabled) return;
1863
+ const current = readProp(props, "page", 1);
1864
+ const nextPage = direction === "previous" ? current - 1 : current + 1;
1865
+ emitPageChange(props, clampPage(nextPage, readProp(props, "pageCount", 0)));
1866
+ });
1867
+ return button;
1868
+ }
1869
+ __name(createPaginationControl, "createPaginationControl");
1870
+ function createPageButton(page, active, disabled, props) {
1871
+ const button = createElement("button");
1872
+ setAttribute(button, "class", `vui-pagination__item${active ? " is-active" : ""}`);
1873
+ setAttribute(button, "type", "button");
1874
+ setProperty(button, "disabled", disabled);
1875
+ setAttribute(button, "aria-label", `Page ${page}`);
1876
+ if (active) setAttribute(button, "aria-current", "page");
1877
+ if (disabled) setAttribute(button, "aria-disabled", "true");
1878
+ insertBefore(button, createText(String(page)), null);
1879
+ addEventListener(button, "click", () => {
1880
+ if (!disabled) emitPageChange(props, page);
1881
+ });
1882
+ return button;
1883
+ }
1884
+ __name(createPageButton, "createPageButton");
1885
+ function createEllipsis(item) {
1886
+ const button = createElement("button");
1887
+ setAttribute(button, "class", "vui-pagination__item");
1888
+ setAttribute(button, "type", "button");
1889
+ setProperty(button, "disabled", true);
1890
+ setAttribute(button, "aria-label", item === "ellipsis-left" ? "Previous pages" : "Next pages");
1891
+ setAttribute(button, "aria-hidden", "true");
1892
+ insertBefore(button, createText("..."), null);
1893
+ return button;
1894
+ }
1895
+ __name(createEllipsis, "createEllipsis");
1896
+ function emitPageChange(props, page) {
1897
+ const handler = readProp(props, "onChange", void 0);
1898
+ if (typeof handler === "function") handler(page);
1899
+ }
1900
+ __name(emitPageChange, "emitPageChange");
1901
+ function clampPage(page, pageCount) {
1902
+ if (pageCount <= 0) return 1;
1903
+ return Math.min(pageCount, Math.max(1, Math.floor(Number.isFinite(page) ? page : 1)));
1904
+ }
1905
+ __name(clampPage, "clampPage");
1906
+ function buildPaginationItems(page, pageCount, siblingCount) {
1907
+ const totalVisible = siblingCount * 2 + 5;
1908
+ if (pageCount <= totalVisible) {
1909
+ return Array.from({ length: pageCount }, (_, index) => index + 1);
1910
+ }
1911
+ const left = Math.max(page - siblingCount, 2);
1912
+ const right = Math.min(page + siblingCount, pageCount - 1);
1913
+ const items = [1];
1914
+ if (left > 2) items.push("ellipsis-left");
1915
+ for (let value = left; value <= right; value++) items.push(value);
1916
+ if (right < pageCount - 1) items.push("ellipsis-right");
1917
+ items.push(pageCount);
1918
+ return items;
1919
+ }
1920
+ __name(buildPaginationItems, "buildPaginationItems");
1921
+
1922
+ // packages/ui/src/avatar.ts
1923
+ function Avatar(props = {}) {
1924
+ const root = createElement("span");
1925
+ bindClassList(root, props, () => [
1926
+ "vui-avatar",
1927
+ readProp(props, "size", "md") === "sm" ? "vui-avatar--sm" : void 0,
1928
+ readProp(props, "size", "md") === "lg" ? "vui-avatar--lg" : void 0,
1929
+ readProp(props, "shape", "circle") === "square" ? "vui-avatar--square" : void 0,
1930
+ readProp(props, "accent", false) ? "vui-avatar--accent" : void 0
1931
+ ]);
1932
+ bindCommonAttributes(root, props, ["src", "alt", "size", "shape", "accent", "fallback"]);
1933
+ bindUserStyle(root, props);
1934
+ insertDynamic(root, null, () => createAvatarContent(props));
1935
+ return root;
1936
+ }
1937
+ __name(Avatar, "Avatar");
1938
+ function createAvatarContent(props) {
1939
+ const src = readProp(props, "src", void 0);
1940
+ if (src) {
1941
+ const image = createElement("img");
1942
+ setAttribute(image, "class", "vui-avatar__image");
1943
+ setAttribute(image, "src", src);
1944
+ setAttribute(image, "alt", readProp(props, "alt", ""));
1945
+ return image;
1946
+ }
1947
+ if (hasProp(props, "fallback")) {
1948
+ const fallback = resolveSlot(Reflect.get(props, "fallback"));
1949
+ if (fallback) return fallback;
1950
+ }
1951
+ if (hasProp(props, "children")) {
1952
+ const children = resolveSlot(Reflect.get(props, "children"));
1953
+ if (children) return children;
1954
+ }
1955
+ return createText("");
1956
+ }
1957
+ __name(createAvatarContent, "createAvatarContent");
1958
+
1959
+ // packages/ui/src/page-header.ts
1960
+ function PageHeader(props = {}) {
1961
+ const root = createElement("header");
1962
+ const main = createElement("div");
1963
+ bindClassList(root, props, () => ["vui-pagehead"]);
1964
+ bindCommonAttributes(root, props, ["title", "subtitle", "actions"]);
1965
+ bindUserStyle(root, props);
1966
+ setAttribute(main, "class", "vui-pagehead__main");
1967
+ if (hasProp(props, "title")) {
1968
+ const title = createElement("h1");
1969
+ const text = createText("");
1970
+ setAttribute(title, "class", "vui-pagehead__title");
1971
+ bindTextContent(text, () => readProp(props, "title", ""));
1972
+ insertBefore(title, text, null);
1973
+ insertBefore(main, title, null);
1974
+ }
1975
+ if (hasProp(props, "subtitle")) {
1976
+ const subtitle = createElement("p");
1977
+ const text = createText("");
1978
+ setAttribute(subtitle, "class", "vui-pagehead__subtitle");
1979
+ bindTextContent(text, () => readProp(props, "subtitle", ""));
1980
+ insertBefore(subtitle, text, null);
1981
+ insertBefore(main, subtitle, null);
1982
+ }
1983
+ if (hasProp(props, "children")) mountSlot(main, props, "children");
1984
+ insertBefore(root, main, null);
1985
+ if (hasProp(props, "actions")) {
1986
+ const actions = createElement("div");
1987
+ setAttribute(actions, "class", "vui-pagehead__actions");
1988
+ mountSlot(actions, props, "actions");
1989
+ insertBefore(root, actions, null);
1990
+ }
1991
+ return root;
1992
+ }
1993
+ __name(PageHeader, "PageHeader");
1994
+ function PageHeaderAction(props = {}) {
1995
+ const root = createElement(props.href === void 0 ? "button" : "a");
1996
+ bindClassList(root, props, () => [
1997
+ "vui-pagehead__btn",
1998
+ readProp(props, "primary", false) ? "is-primary" : void 0
1999
+ ]);
2000
+ bindCommonAttributes(root, props, ["href", "primary", "disabled", "onClick"]);
2001
+ if (props.href === void 0) setAttribute(root, "type", "button");
2002
+ else setAttribute(root, "href", props.href);
2003
+ effect(() => {
2004
+ const disabled = readProp(props, "disabled", false);
2005
+ setOptionalAttribute(root, "aria-disabled", disabled ? "true" : void 0);
2006
+ if (props.href === void 0) setProperty(root, "disabled", disabled);
2007
+ });
2008
+ if (hasProp(props, "children")) mountSlot(root, props, "children");
2009
+ addEventListener(root, "click", (event) => {
2010
+ if (readProp(props, "disabled", false)) {
2011
+ event.preventDefault?.();
2012
+ return;
2013
+ }
2014
+ const handler = readProp(props, "onClick", void 0);
2015
+ if (typeof handler === "function") handler(event);
2016
+ });
2017
+ return root;
2018
+ }
2019
+ __name(PageHeaderAction, "PageHeaderAction");
2020
+
2021
+ // packages/ui/src/table.ts
2022
+ function Table(props = {}) {
2023
+ const root = createElement("table");
2024
+ const head = createElement("thead");
2025
+ const body = createElement("tbody");
2026
+ bindClassList(root, props, () => ["vui-table"]);
2027
+ bindCommonAttributes(root, props, ["columns", "rows", "caption", "empty", "rowKey", "onRowClick"]);
2028
+ bindUserStyle(root, props);
2029
+ if (hasProp(props, "caption")) {
2030
+ const caption = createElement("caption");
2031
+ const text = createText("");
2032
+ bindTextContent(text, () => readProp(props, "caption", ""));
2033
+ insertBefore(caption, text, null);
2034
+ insertBefore(root, caption, null);
2035
+ }
2036
+ insertDynamic(head, null, () => createTableHead(props));
2037
+ insertDynamic(body, null, () => createTableBody(props));
2038
+ insertBefore(root, head, null);
2039
+ insertBefore(root, body, null);
2040
+ return root;
2041
+ }
2042
+ __name(Table, "Table");
2043
+ function TablePanel(props = {}) {
2044
+ const root = createElement("div");
2045
+ bindClassList(root, props, () => ["vui-tablepanel"]);
2046
+ bindCommonAttributes(root, props, ["columns", "rows", "empty", "footer", "rowKey", "onRowClick"]);
2047
+ bindUserStyle(root, props);
2048
+ const table = Table({
2049
+ get columns() {
2050
+ return readProp(props, "columns", []);
2051
+ },
2052
+ get rows() {
2053
+ return readProp(props, "rows", []);
2054
+ },
2055
+ get empty() {
2056
+ return readProp(props, "empty", void 0);
2057
+ },
2058
+ get rowKey() {
2059
+ return readProp(props, "rowKey", void 0);
2060
+ },
2061
+ get onRowClick() {
2062
+ return readProp(props, "onRowClick", void 0);
2063
+ }
2064
+ });
2065
+ insertBefore(root, table, null);
2066
+ if (hasProp(props, "footer")) {
2067
+ const footer = createElement("div");
2068
+ setAttribute(footer, "class", "vui-tablepanel__foot");
2069
+ mountSlot(footer, props, "footer");
2070
+ insertBefore(root, footer, null);
2071
+ }
2072
+ return root;
2073
+ }
2074
+ __name(TablePanel, "TablePanel");
2075
+ function createTableHead(props) {
2076
+ const columns = readProp(props, "columns", []);
2077
+ return createFragment((parent, anchor) => {
2078
+ const row = createElement("tr");
2079
+ for (const column of columns) {
2080
+ const cell = createElement("th");
2081
+ setAttribute(cell, "scope", "col");
2082
+ setAttribute(cell, "data-column-id", column.id);
2083
+ applyAlignment(cell, column.align);
2084
+ insertBefore(cell, createText(column.label), null);
2085
+ insertBefore(row, cell, null);
2086
+ }
2087
+ insertBefore(parent, row, anchor);
2088
+ });
2089
+ }
2090
+ __name(createTableHead, "createTableHead");
2091
+ function createTableBody(props) {
2092
+ const columns = readProp(props, "columns", []);
2093
+ const rows = readProp(props, "rows", []);
2094
+ if (rows.length === 0) return createEmptyRow(props, columns.length);
2095
+ return createFragment((parent, anchor) => {
2096
+ for (let index = 0; index < rows.length; index++) {
2097
+ insertBefore(parent, createTableRow(rows[index], index, columns, props), anchor);
2098
+ }
2099
+ });
2100
+ }
2101
+ __name(createTableBody, "createTableBody");
2102
+ function createTableRow(row, index, columns, props) {
2103
+ const tableRow = createElement("tr");
2104
+ const rowKey = readProp(props, "rowKey", void 0);
2105
+ if (rowKey) setOptionalAttribute(tableRow, "data-row-key", rowKey(row, index));
2106
+ for (const column of columns) {
2107
+ const cell = createElement("td");
2108
+ setAttribute(cell, "data-column-id", column.id);
2109
+ applyAlignment(cell, column.align);
2110
+ insertDynamic(cell, null, () => {
2111
+ const value = column.render ? column.render(row, index) : column.key === void 0 ? void 0 : readRowValue(row, column.key);
2112
+ return resolveSlot(value);
2113
+ });
2114
+ insertBefore(tableRow, cell, null);
2115
+ }
2116
+ const onRowClick = readProp(props, "onRowClick", void 0);
2117
+ if (onRowClick) {
2118
+ setProperty(tableRow, "tabIndex", 0);
2119
+ setAttribute(tableRow, "data-clickable", "true");
2120
+ addEventListener(tableRow, "click", () => onRowClick(row, index));
2121
+ }
2122
+ return tableRow;
2123
+ }
2124
+ __name(createTableRow, "createTableRow");
2125
+ function createEmptyRow(props, columnCount) {
2126
+ const row = createElement("tr");
2127
+ const cell = createElement("td");
2128
+ setAttribute(cell, "colspan", String(Math.max(1, columnCount)));
2129
+ if (hasProp(props, "empty")) {
2130
+ insertDynamic(cell, null, () => resolveSlot(Reflect.get(props, "empty")));
2131
+ } else {
2132
+ insertBefore(cell, createText("No data"), null);
2133
+ }
2134
+ insertBefore(row, cell, null);
2135
+ return row;
2136
+ }
2137
+ __name(createEmptyRow, "createEmptyRow");
2138
+ function applyAlignment(cell, align) {
2139
+ if (align === "end") {
2140
+ setAttribute(cell, "class", "num");
2141
+ setAttribute(cell, "data-align", "end");
2142
+ } else if (align === "center") {
2143
+ setAttribute(cell, "data-align", "center");
2144
+ }
2145
+ }
2146
+ __name(applyAlignment, "applyAlignment");
2147
+ function readRowValue(row, key) {
2148
+ if (row === null || row === void 0) return void 0;
2149
+ return Reflect.get(row, key);
2150
+ }
2151
+ __name(readRowValue, "readRowValue");
2152
+
2153
+ // packages/ui/src/stat-card.ts
2154
+ function StatCard(props = {}) {
2155
+ const root = createElement("div");
2156
+ bindClassList(root, props, () => ["vui-statcard"]);
2157
+ bindCommonAttributes(root, props, [
2158
+ "label",
2159
+ "value",
2160
+ "delta",
2161
+ "deltaDirection",
2162
+ "deltaIcon",
2163
+ "deltaCaption"
2164
+ ]);
2165
+ bindUserStyle(root, props);
2166
+ if (hasProp(props, "label")) {
2167
+ const label = createElement("span");
2168
+ const text = createText("");
2169
+ setAttribute(label, "class", "vui-statcard__label");
2170
+ bindTextContent(text, () => readProp(props, "label", ""));
2171
+ insertBefore(label, text, null);
2172
+ insertBefore(root, label, null);
2173
+ }
2174
+ if (hasProp(props, "value")) {
2175
+ const value = createElement("span");
2176
+ setAttribute(value, "class", "vui-statcard__value");
2177
+ insertDynamic(value, null, () => resolveSlot(Reflect.get(props, "value")));
2178
+ insertBefore(root, value, null);
2179
+ }
2180
+ if (hasProp(props, "delta") || hasProp(props, "deltaIcon") || hasProp(props, "deltaCaption")) {
2181
+ const delta = createElement("span");
2182
+ effect(() => {
2183
+ const direction = readProp(props, "deltaDirection", void 0);
2184
+ setAttribute(delta, "class", `vui-statcard__delta${direction ? ` is-${direction}` : ""}`);
2185
+ });
2186
+ if (hasProp(props, "deltaIcon")) mountSlot(delta, props, "deltaIcon");
2187
+ if (hasProp(props, "delta")) mountSlot(delta, props, "delta");
2188
+ if (hasProp(props, "deltaCaption")) {
2189
+ const caption = createElement("span");
2190
+ setAttribute(caption, "class", "vui-statcard__caption");
2191
+ mountSlot(caption, props, "deltaCaption");
2192
+ insertBefore(delta, caption, null);
2193
+ }
2194
+ insertBefore(root, delta, null);
2195
+ }
2196
+ if (hasProp(props, "children")) mountSlot(root, props, "children");
2197
+ return root;
2198
+ }
2199
+ __name(StatCard, "StatCard");
2200
+ function StatCardGrid(props = {}) {
2201
+ const root = createElement("div");
2202
+ bindClassList(root, props, () => ["vui-statcard__grid"]);
2203
+ bindCommonAttributes(root, props);
2204
+ bindUserStyle(root, props);
2205
+ if (hasProp(props, "children")) mountSlot(root, props, "children");
2206
+ return root;
2207
+ }
2208
+ __name(StatCardGrid, "StatCardGrid");
2209
+
2210
+ // packages/ui/src/kbd.ts
2211
+ function Kbd(props = {}) {
2212
+ const root = createElement("kbd");
2213
+ bindClassList(root, props, () => ["vui-kbd"]);
2214
+ bindCommonAttributes(root, props);
2215
+ bindUserStyle(root, props);
2216
+ if (hasProp(props, "children")) mountSlot(root, props, "children");
2217
+ return root;
2218
+ }
2219
+ __name(Kbd, "Kbd");
2220
+ function KbdCombo(props = {}) {
2221
+ const root = createElement("span");
2222
+ bindClassList(root, props, () => ["vui-kbd__combo"]);
2223
+ bindCommonAttributes(root, props, ["keys", "separator"]);
2224
+ bindUserStyle(root, props);
2225
+ if (hasProp(props, "keys")) insertDynamic(root, null, () => createComboKeys(props));
2226
+ if (hasProp(props, "children")) mountSlot(root, props, "children");
2227
+ return root;
2228
+ }
2229
+ __name(KbdCombo, "KbdCombo");
2230
+ function KbdRow(props = {}) {
2231
+ const root = createElement("div");
2232
+ bindClassList(root, props, () => ["vui-kbd__row"]);
2233
+ bindCommonAttributes(root, props);
2234
+ bindUserStyle(root, props);
2235
+ if (hasProp(props, "children")) mountSlot(root, props, "children");
2236
+ return root;
2237
+ }
2238
+ __name(KbdRow, "KbdRow");
2239
+ function createComboKeys(props) {
2240
+ const keys = readProp(props, "keys", []);
2241
+ const separator = readProp(props, "separator", "+");
2242
+ return createFragment((parent, anchor) => {
2243
+ for (let index = 0; index < keys.length; index++) {
2244
+ if (index > 0) {
2245
+ const plus = createElement("span");
2246
+ setAttribute(plus, "class", "vui-kbd__plus");
2247
+ const separatorNode = resolveSlot(separator);
2248
+ if (separatorNode) insertBefore(plus, separatorNode, null);
2249
+ insertBefore(parent, plus, anchor);
2250
+ }
2251
+ insertBefore(parent, Kbd({ children: keys[index] }), anchor);
2252
+ }
2253
+ });
2254
+ }
2255
+ __name(createComboKeys, "createComboKeys");
2256
+
2257
+ // packages/ui/src/activity-rail.ts
2258
+ function ActivityRail(props = {}) {
2259
+ const root = createElement("nav");
2260
+ const internalValue = state(void 0);
2261
+ bindClassList(root, props, () => ["vui-activityrail"]);
2262
+ bindCommonAttributes(root, props, ["items", "value", "defaultValue", "onChange"]);
2263
+ bindUserStyle(root, props);
2264
+ if (!hasProp(props, "aria-label")) setAttribute(root, "aria-label", "Activity");
2265
+ if (hasProp(props, "items")) insertDynamic(root, null, () => createActivityItems(props, internalValue));
2266
+ if (hasProp(props, "children")) mountSlot(root, props, "children");
2267
+ return root;
2268
+ }
2269
+ __name(ActivityRail, "ActivityRail");
2270
+ function createActivityItems(props, internalValue) {
2271
+ const items = readProp(props, "items", []);
2272
+ const selected = activeId3(props, items, internalValue);
2273
+ return createFragment((parent, anchor) => {
2274
+ for (const item of items) {
2275
+ if (item.divider === true) {
2276
+ const divider = createElement("div");
2277
+ setAttribute(divider, "class", "vui-activityrail__divider");
2278
+ setAttribute(divider, "role", "separator");
2279
+ insertBefore(parent, divider, anchor);
2280
+ continue;
2281
+ }
2282
+ if (item.spacer === true) {
2283
+ const spacer = createElement("span");
2284
+ setAttribute(spacer, "class", "vui-activityrail__spacer");
2285
+ insertBefore(parent, spacer, anchor);
2286
+ continue;
2287
+ }
2288
+ insertBefore(parent, createActivityButton(item, props, selected, internalValue), anchor);
2289
+ }
2290
+ });
2291
+ }
2292
+ __name(createActivityItems, "createActivityItems");
2293
+ function createActivityButton(item, props, selected, internalValue) {
2294
+ const button = createElement("button");
2295
+ const active = item.id !== void 0 && item.id === selected;
2296
+ setAttribute(button, "class", `vui-activityrail__btn${active ? " is-active" : ""}`);
2297
+ setAttribute(button, "type", "button");
2298
+ setOptionalAttribute(button, "aria-label", item.label);
2299
+ setOptionalAttribute(button, "title", item.label);
2300
+ setAttribute(button, "aria-pressed", active ? "true" : "false");
2301
+ if (item.disabled === true) {
2302
+ setProperty(button, "disabled", true);
2303
+ setAttribute(button, "aria-disabled", "true");
2304
+ }
2305
+ if (item.icon !== void 0) {
2306
+ const icon = createElement("span");
2307
+ setAttribute(icon, "class", "vui-activityrail__icon");
2308
+ mountSlot(icon, item, "icon");
2309
+ insertBefore(button, icon, null);
2310
+ } else if (item.label !== void 0) {
2311
+ insertBefore(button, createText(item.label), null);
2312
+ }
2313
+ addEventListener(button, "click", (event) => {
2314
+ if (item.disabled === true || item.id === void 0) return;
2315
+ if (readProp(props, "value", void 0) === void 0) internalValue.value = item.id;
2316
+ const handler = readProp(props, "onChange", void 0);
2317
+ if (typeof handler === "function") handler(item.id, event);
2318
+ });
2319
+ return button;
2320
+ }
2321
+ __name(createActivityButton, "createActivityButton");
2322
+ function activeId3(props, items, internalValue) {
2323
+ const controlled = readProp(props, "value", void 0);
2324
+ if (controlled !== void 0) return controlled;
2325
+ if (internalValue.value !== void 0) return internalValue.value;
2326
+ const defaultValue = readProp(props, "defaultValue", void 0);
2327
+ if (defaultValue !== void 0) return defaultValue;
2328
+ return items.find((item) => item.id !== void 0)?.id;
2329
+ }
2330
+ __name(activeId3, "activeId");
2331
+
2332
+ // packages/ui/src/file-tree.ts
2333
+ function FileTree(props = {}) {
2334
+ const items = readProp(props, "items", []);
2335
+ const internalExpanded = state(initialExpanded(props, items));
2336
+ const root = createElement("div");
2337
+ bindClassList(root, props, () => ["vui-filetree"]);
2338
+ bindCommonAttributes(root, props, [
2339
+ "items",
2340
+ "value",
2341
+ "defaultValue",
2342
+ "expanded",
2343
+ "defaultExpanded",
2344
+ "onSelect",
2345
+ "onToggle"
2346
+ ]);
2347
+ bindUserStyle(root, props);
2348
+ if (!hasProp(props, "role")) setAttribute(root, "role", "tree");
2349
+ if (!hasProp(props, "aria-label")) setAttribute(root, "aria-label", "Files");
2350
+ insertDynamic(root, null, () => createTreeRows(props, internalExpanded));
2351
+ if (hasProp(props, "children")) mountSlot(root, props, "children");
2352
+ return root;
2353
+ }
2354
+ __name(FileTree, "FileTree");
2355
+ function createTreeRows(props, internalExpanded) {
2356
+ const items = readProp(props, "items", []);
2357
+ const expanded = new Set(readProp(props, "expanded", void 0) ?? internalExpanded.value);
2358
+ const visible = flattenVisible(items, expanded);
2359
+ const selected = activeId4(props, items);
2360
+ return createFragment((parent, anchor) => {
2361
+ for (const entry of visible) {
2362
+ insertBefore(parent, createTreeRow(entry, props, internalExpanded, selected, expanded), anchor);
2363
+ }
2364
+ });
2365
+ }
2366
+ __name(createTreeRows, "createTreeRows");
2367
+ function createTreeRow(entry, props, internalExpanded, selected, expanded) {
2368
+ const { item } = entry;
2369
+ const isFolder = item.kind === "folder";
2370
+ const hasChildren = isFolder && Boolean(item.children?.length);
2371
+ const active = item.id === selected;
2372
+ const row = createElement("div");
2373
+ setAttribute(row, "class", `vui-filetree__row${active ? " is-active" : ""}`);
2374
+ setAttribute(row, "role", "treeitem");
2375
+ setAttribute(row, "data-depth", String(entry.depth));
2376
+ setAttribute(row, "data-file-id", item.id);
2377
+ setProperty(row, "tabIndex", item.disabled === true ? -1 : 0);
2378
+ if (active) setAttribute(row, "aria-selected", "true");
2379
+ if (isFolder) setAttribute(row, "aria-expanded", entry.expanded ? "true" : "false");
2380
+ if (item.disabled === true) setAttribute(row, "aria-disabled", "true");
2381
+ const chevron = createElement("span");
2382
+ setAttribute(chevron, "class", `vui-filetree__chevron${hasChildren ? "" : " vui-filetree__chevron--leaf"}`);
2383
+ if (hasChildren) {
2384
+ if (item.chevron !== void 0) mountSlot(chevron, item, "chevron");
2385
+ else insertBefore(chevron, createText(entry.expanded ? "v" : ">"), null);
2386
+ }
2387
+ insertBefore(row, chevron, null);
2388
+ if (item.icon !== void 0) {
2389
+ const icon = createElement("span");
2390
+ setAttribute(icon, `class`, `vui-filetree__icon ${fileIconClass(item)}`.trim());
2391
+ mountSlot(icon, item, "icon");
2392
+ insertBefore(row, icon, null);
2393
+ }
2394
+ const label = createElement("span");
2395
+ setAttribute(label, "class", "vui-filetree__label");
2396
+ setOptionalAttribute(label, "title", item.label);
2397
+ insertBefore(label, createText(item.label), null);
2398
+ insertBefore(row, label, null);
2399
+ addEventListener(row, "click", (event) => {
2400
+ if (item.disabled === true) return;
2401
+ if (isFolder && hasChildren) {
2402
+ const nextExpanded = !expanded.has(item.id);
2403
+ if (readProp(props, "expanded", void 0) === void 0) {
2404
+ const next = new Set(internalExpanded.value);
2405
+ if (nextExpanded) next.add(item.id);
2406
+ else next.delete(item.id);
2407
+ internalExpanded.value = [...next];
2408
+ }
2409
+ const onToggle = readProp(props, "onToggle", void 0);
2410
+ if (typeof onToggle === "function") {
2411
+ onToggle(item.id, nextExpanded, event);
2412
+ }
2413
+ }
2414
+ const onSelect = readProp(props, "onSelect", void 0);
2415
+ if (typeof onSelect === "function") onSelect(item.id, event);
2416
+ });
2417
+ addEventListener(row, "keydown", (event) => {
2418
+ const keyboardEvent = event;
2419
+ if (keyboardEvent.key !== "Enter" && keyboardEvent.key !== " ") return;
2420
+ keyboardEvent.preventDefault?.();
2421
+ row.dispatchEvent?.(new MouseEvent("click", { bubbles: true }));
2422
+ });
2423
+ return row;
2424
+ }
2425
+ __name(createTreeRow, "createTreeRow");
2426
+ function flattenVisible(items, expanded, depth = 0) {
2427
+ const visible = [];
2428
+ for (const item of items) {
2429
+ const folder = item.kind === "folder";
2430
+ const open = folder && expanded.has(item.id);
2431
+ visible.push({ item, depth, expanded: open });
2432
+ if (open && item.children) visible.push(...flattenVisible(item.children, expanded, depth + 1));
2433
+ }
2434
+ return visible;
2435
+ }
2436
+ __name(flattenVisible, "flattenVisible");
2437
+ function initialExpanded(props, items) {
2438
+ const ids = new Set(readProp(props, "defaultExpanded", []));
2439
+ collectExpanded(items, ids);
2440
+ return [...ids];
2441
+ }
2442
+ __name(initialExpanded, "initialExpanded");
2443
+ function collectExpanded(items, ids) {
2444
+ for (const item of items) {
2445
+ if (item.expanded === true) ids.add(item.id);
2446
+ if (item.children) collectExpanded(item.children, ids);
2447
+ }
2448
+ }
2449
+ __name(collectExpanded, "collectExpanded");
2450
+ function activeId4(props, items) {
2451
+ const controlled = readProp(props, "value", void 0);
2452
+ if (controlled !== void 0) return controlled;
2453
+ const defaultValue = readProp(props, "defaultValue", void 0);
2454
+ if (defaultValue !== void 0) return defaultValue;
2455
+ return findActive(items);
2456
+ }
2457
+ __name(activeId4, "activeId");
2458
+ function findActive(items) {
2459
+ for (const item of items) {
2460
+ if (item.active === true) return item.id;
2461
+ if (item.children) {
2462
+ const nested = findActive(item.children);
2463
+ if (nested !== void 0) return nested;
2464
+ }
2465
+ }
2466
+ return void 0;
2467
+ }
2468
+ __name(findActive, "findActive");
2469
+ function fileIconClass(item) {
2470
+ if (item.kind === "folder") return "vui-filetree__icon--folder";
2471
+ const extension = item.label.slice(item.label.lastIndexOf(".") + 1).toLowerCase();
2472
+ if (extension === "ts" || extension === "tsx") return "vui-filetree__icon--ts";
2473
+ if (extension === "css" || extension === "scss") return "vui-filetree__icon--css";
2474
+ if (extension === "json") return "vui-filetree__icon--json";
2475
+ return "";
2476
+ }
2477
+ __name(fileIconClass, "fileIconClass");
2478
+
2479
+ // packages/ui/src/editor-tabs.ts
2480
+ function EditorTabs(props = {}) {
2481
+ const root = createElement("div");
2482
+ const internalValue = state(void 0);
2483
+ bindClassList(root, props, () => ["vui-editortabs"]);
2484
+ bindCommonAttributes(root, props, [
2485
+ "tabs",
2486
+ "value",
2487
+ "defaultValue",
2488
+ "closeIcon",
2489
+ "actions",
2490
+ "onChange",
2491
+ "onClose"
2492
+ ]);
2493
+ bindUserStyle(root, props);
2494
+ insertDynamic(root, null, () => createEditorTabs(props, internalValue));
2495
+ if (hasProp(props, "children")) mountSlot(root, props, "children");
2496
+ return root;
2497
+ }
2498
+ __name(EditorTabs, "EditorTabs");
2499
+ function createEditorTabs(props, internalValue) {
2500
+ const tabs = readProp(props, "tabs", []);
2501
+ const selected = activeId5(props, tabs, internalValue);
2502
+ return createFragment((parent, anchor) => {
2503
+ for (const tab of tabs) {
2504
+ insertBefore(parent, createEditorTab(tab, tabs, selected, props, internalValue), anchor);
2505
+ }
2506
+ const spacer = createElement("span");
2507
+ setAttribute(spacer, "class", "vui-editortabs__spacer");
2508
+ insertBefore(parent, spacer, anchor);
2509
+ if (hasProp(props, "actions")) {
2510
+ const actions = createElement("span");
2511
+ setAttribute(actions, "class", "vui-editortabs__actions");
2512
+ mountSlot(actions, props, "actions");
2513
+ insertBefore(parent, actions, anchor);
2514
+ }
2515
+ });
2516
+ }
2517
+ __name(createEditorTabs, "createEditorTabs");
2518
+ function createEditorTab(tab, tabs, selected, props, internalValue) {
2519
+ const active = tab.id === selected;
2520
+ const root = createElement("span");
2521
+ setAttribute(root, "class", `vui-editortab${active ? " is-active" : ""}`);
2522
+ setAttribute(root, "role", "tab");
2523
+ setAttribute(root, "aria-selected", active ? "true" : "false");
2524
+ setAttribute(root, "tabindex", active ? "0" : "-1");
2525
+ setOptionalAttribute(root, "data-editor-tab-id", tab.id);
2526
+ if (tab.disabled === true) setAttribute(root, "aria-disabled", "true");
2527
+ if (tab.icon !== void 0) {
2528
+ const icon = createElement("span");
2529
+ setAttribute(icon, "class", "ic");
2530
+ mountSlot(icon, tab, "icon");
2531
+ insertBefore(root, icon, null);
2532
+ }
2533
+ const label = createElement("span");
2534
+ setAttribute(label, "class", "vui-editortab__label");
2535
+ insertBefore(label, createText(tab.label), null);
2536
+ insertBefore(root, label, null);
2537
+ if (tab.closeable === true) {
2538
+ const close = createElement("button");
2539
+ setAttribute(close, "class", "close");
2540
+ setAttribute(close, "type", "button");
2541
+ setAttribute(close, "aria-label", `Close ${tab.label}`);
2542
+ const closeIcon = tab.closeIcon ?? readProp(props, "closeIcon", void 0);
2543
+ const icon = closeIcon === void 0 ? createText("x") : resolveSlot(closeIcon);
2544
+ if (icon) insertBefore(close, icon, null);
2545
+ addEventListener(close, "click", (event) => {
2546
+ event.stopPropagation?.();
2547
+ const handler = readProp(props, "onClose", void 0);
2548
+ if (typeof handler === "function") handler(tab.id, event);
2549
+ });
2550
+ insertBefore(root, close, null);
2551
+ }
2552
+ addEventListener(root, "click", (event) => {
2553
+ if (tab.disabled === true) return;
2554
+ selectTab(tab.id, props, internalValue, event);
2555
+ });
2556
+ addEventListener(root, "keydown", (event) => {
2557
+ const keyboardEvent = event;
2558
+ if (keyboardEvent.key === "Enter" || keyboardEvent.key === " ") {
2559
+ keyboardEvent.preventDefault?.();
2560
+ if (tab.disabled !== true) selectTab(tab.id, props, internalValue, keyboardEvent);
2561
+ return;
2562
+ }
2563
+ if (keyboardEvent.key !== "ArrowLeft" && keyboardEvent.key !== "ArrowRight") return;
2564
+ keyboardEvent.preventDefault?.();
2565
+ const direction = keyboardEvent.key === "ArrowLeft" ? -1 : 1;
2566
+ const next = adjacentTab(tabs, tab.id, direction);
2567
+ if (next) selectTab(next.id, props, internalValue, keyboardEvent);
2568
+ });
2569
+ return root;
2570
+ }
2571
+ __name(createEditorTab, "createEditorTab");
2572
+ function selectTab(id, props, internalValue, event) {
2573
+ if (readProp(props, "value", void 0) === void 0) internalValue.value = id;
2574
+ const handler = readProp(props, "onChange", void 0);
2575
+ if (typeof handler === "function") handler(id, event);
2576
+ }
2577
+ __name(selectTab, "selectTab");
2578
+ function adjacentTab(tabs, id, direction) {
2579
+ const start = tabs.findIndex((tab) => tab.id === id);
2580
+ if (start < 0) return void 0;
2581
+ for (let index = start + direction; index >= 0 && index < tabs.length; index += direction) {
2582
+ if (tabs[index].disabled !== true) return tabs[index];
2583
+ }
2584
+ return void 0;
2585
+ }
2586
+ __name(adjacentTab, "adjacentTab");
2587
+ function activeId5(props, tabs, internalValue) {
2588
+ const controlled = readProp(props, "value", void 0);
2589
+ if (controlled !== void 0) return controlled;
2590
+ if (internalValue.value !== void 0) return internalValue.value;
2591
+ const defaultValue = readProp(props, "defaultValue", void 0);
2592
+ if (defaultValue !== void 0) return defaultValue;
2593
+ return tabs.find((tab) => tab.disabled !== true)?.id;
2594
+ }
2595
+ __name(activeId5, "activeId");
2596
+
2597
+ // packages/ui/src/workbench-titlebar.ts
2598
+ function WorkbenchTitlebar(props = {}) {
2599
+ const root = createElement("header");
2600
+ const left = createElement("div");
2601
+ const right = createElement("div");
2602
+ bindClassList(root, props, () => ["vui-wbtitlebar"]);
2603
+ bindCommonAttributes(root, props, [
2604
+ "mode",
2605
+ "modeIcon",
2606
+ "project",
2607
+ "projectIcon",
2608
+ "projectChevron",
2609
+ "actions",
2610
+ "windowControls",
2611
+ "onWindowClose",
2612
+ "onWindowMinimize",
2613
+ "onWindowMaximize",
2614
+ "onProjectClick"
2615
+ ]);
2616
+ bindUserStyle(root, props);
2617
+ setAttribute(left, "class", "vui-wbtitlebar__left");
2618
+ setAttribute(right, "class", "vui-wbtitlebar__right");
2619
+ insertDynamic(left, null, () => createTitlebarLeft(props));
2620
+ if (hasProp(props, "actions")) mountSlot(right, props, "actions");
2621
+ if (hasProp(props, "children")) mountSlot(right, props, "children");
2622
+ insertBefore(root, left, null);
2623
+ insertBefore(root, right, null);
2624
+ return root;
2625
+ }
2626
+ __name(WorkbenchTitlebar, "WorkbenchTitlebar");
2627
+ function createTitlebarLeft(props) {
2628
+ return createFragment((parent, anchor) => {
2629
+ if (readProp(props, "windowControls", true)) {
2630
+ const lights = createElement("div");
2631
+ setAttribute(lights, "class", "vui-wbtitlebar__lights");
2632
+ insertBefore(lights, createWindowLight("close", props, "onWindowClose"), null);
2633
+ insertBefore(lights, createWindowLight("min", props, "onWindowMinimize"), null);
2634
+ insertBefore(lights, createWindowLight("max", props, "onWindowMaximize"), null);
2635
+ insertBefore(parent, lights, anchor);
2636
+ }
2637
+ if (hasProp(props, "mode")) {
2638
+ const mode = createElement("span");
2639
+ setAttribute(mode, "class", "vui-wbtitlebar__mode-chip");
2640
+ if (hasProp(props, "modeIcon")) {
2641
+ const icon = createElement("span");
2642
+ setAttribute(icon, "class", "vui-wbtitlebar__mode-icon");
2643
+ mountSlot(icon, props, "modeIcon");
2644
+ insertBefore(mode, icon, null);
2645
+ }
2646
+ const text = createText("");
2647
+ bindTextContent(text, () => readProp(props, "mode", ""));
2648
+ insertBefore(mode, text, null);
2649
+ insertBefore(parent, mode, anchor);
2650
+ }
2651
+ if (hasProp(props, "project")) insertBefore(parent, createProjectSelector(props), anchor);
2652
+ });
2653
+ }
2654
+ __name(createTitlebarLeft, "createTitlebarLeft");
2655
+ function createWindowLight(kind, props, handlerName) {
2656
+ const light = createElement("button");
2657
+ setAttribute(light, "class", `vui-wbtitlebar__light vui-wbtitlebar__light--${kind}`);
2658
+ setAttribute(light, "type", "button");
2659
+ setAttribute(light, "aria-label", kind === "close" ? "Close window" : kind === "min" ? "Minimize window" : "Maximize window");
2660
+ addEventListener(light, "click", (event) => {
2661
+ const handler = readProp(props, handlerName, void 0);
2662
+ if (typeof handler === "function") handler(event);
2663
+ });
2664
+ return light;
2665
+ }
2666
+ __name(createWindowLight, "createWindowLight");
2667
+ function createProjectSelector(props) {
2668
+ const button = createElement("button");
2669
+ setAttribute(button, "class", "vui-wbtitlebar__project-selector");
2670
+ setAttribute(button, "type", "button");
2671
+ setOptionalAttribute(button, "aria-label", readProp(props, "project", "Project"));
2672
+ if (hasProp(props, "projectIcon")) {
2673
+ const icon = createElement("span");
2674
+ setAttribute(icon, "class", "vui-wbtitlebar__project-icon");
2675
+ mountSlot(icon, props, "projectIcon");
2676
+ insertBefore(button, icon, null);
2677
+ }
2678
+ const project = createText("");
2679
+ bindTextContent(project, () => readProp(props, "project", ""));
2680
+ insertBefore(button, project, null);
2681
+ if (hasProp(props, "projectChevron")) {
2682
+ const chevron = createElement("span");
2683
+ setAttribute(chevron, "class", "vui-wbtitlebar__project-chevron");
2684
+ mountSlot(chevron, props, "projectChevron");
2685
+ insertBefore(button, chevron, null);
2686
+ }
2687
+ addEventListener(button, "click", (event) => {
2688
+ const handler = readProp(props, "onProjectClick", void 0);
2689
+ if (typeof handler === "function") handler(event);
2690
+ });
2691
+ return button;
2692
+ }
2693
+ __name(createProjectSelector, "createProjectSelector");
2694
+
2695
+ // packages/ui/src/status-bar.ts
2696
+ function StatusBar(props = {}) {
2697
+ const root = createElement("footer");
2698
+ bindClassList(root, props, () => ["vui-statusbar"]);
2699
+ bindCommonAttributes(root, props, ["left", "right", "onItemClick"]);
2700
+ bindUserStyle(root, props);
2701
+ setAttribute(root, "role", "status");
2702
+ if (hasProp(props, "left")) insertDynamic(root, null, () => createStatusGroup(props, "left"));
2703
+ if (hasProp(props, "right") || hasProp(props, "children")) {
2704
+ const group = createElement("div");
2705
+ setAttribute(group, "class", "vui-statusbar__group");
2706
+ if (hasProp(props, "right")) insertDynamic(group, null, () => createStatusItems(props, "right"));
2707
+ if (hasProp(props, "children")) mountSlot(group, props, "children");
2708
+ insertBefore(root, group, null);
2709
+ }
2710
+ return root;
2711
+ }
2712
+ __name(StatusBar, "StatusBar");
2713
+ function createStatusGroup(props, side) {
2714
+ const group = createElement("div");
2715
+ setAttribute(group, "class", "vui-statusbar__group");
2716
+ insertDynamic(group, null, () => createStatusItems(props, side));
2717
+ return group;
2718
+ }
2719
+ __name(createStatusGroup, "createStatusGroup");
2720
+ function createStatusItems(props, side) {
2721
+ const items = side === "left" ? readProp(props, "left", []) : readProp(props, "right", []);
2722
+ return createFragment((parent, anchor) => {
2723
+ for (const item of items) insertBefore(parent, createStatusItem(item, props), anchor);
2724
+ });
2725
+ }
2726
+ __name(createStatusItems, "createStatusItems");
2727
+ function createStatusItem(item, props) {
2728
+ const root = createElement("span");
2729
+ setAttribute(root, "class", "vui-statusbar__item");
2730
+ if (item.id !== void 0 && readProp(props, "onItemClick", void 0)) {
2731
+ setAttribute(root, "role", "button");
2732
+ setAttribute(root, "tabindex", item.disabled === true ? "-1" : "0");
2733
+ }
2734
+ if (item.disabled === true) setAttribute(root, "aria-disabled", "true");
2735
+ if (item.icon !== void 0) {
2736
+ const icon = createElement("span");
2737
+ setAttribute(icon, "class", "vui-statusbar__icon");
2738
+ mountSlot(icon, item, "icon");
2739
+ insertBefore(root, icon, null);
2740
+ }
2741
+ if (item.dot !== void 0) {
2742
+ const dot = createElement("span");
2743
+ setAttribute(dot, "class", `vui-statusbar__dot vui-statusbar__dot--${item.dot}`);
2744
+ setAttribute(dot, "aria-hidden", "true");
2745
+ insertBefore(root, dot, null);
2746
+ }
2747
+ if (item.label !== void 0) mountSlot(root, item, "label");
2748
+ const activate = /* @__PURE__ */ __name((event) => {
2749
+ if (item.disabled === true || item.id === void 0) return;
2750
+ const handler = readProp(props, "onItemClick", void 0);
2751
+ if (typeof handler === "function") handler(item.id, event);
2752
+ }, "activate");
2753
+ if (item.id !== void 0) {
2754
+ addEventListener(root, "click", activate);
2755
+ addEventListener(root, "keydown", (event) => {
2756
+ const keyboardEvent = event;
2757
+ if (keyboardEvent.key !== "Enter" && keyboardEvent.key !== " ") return;
2758
+ keyboardEvent.preventDefault?.();
2759
+ activate(keyboardEvent);
2760
+ });
2761
+ }
2762
+ return root;
2763
+ }
2764
+ __name(createStatusItem, "createStatusItem");
2765
+
2766
+ // packages/ui/src/chat-composer.ts
2767
+ function ChatComposer(props = {}) {
2768
+ const root = createElement("div");
2769
+ const input = createElement("textarea");
2770
+ const toolbar = createElement("div");
2771
+ const tools = createElement("div");
2772
+ const actions = createElement("div");
2773
+ bindClassList(root, props, () => ["vui-composer"]);
2774
+ bindUserStyle(root, props);
2775
+ bindCommonAttributes(input, props, [
2776
+ "value",
2777
+ "placeholder",
2778
+ "disabled",
2779
+ "model",
2780
+ "modelIcon",
2781
+ "modelChevron",
2782
+ "tools",
2783
+ "actions",
2784
+ "sendIcon",
2785
+ "sendLabel",
2786
+ "onInput",
2787
+ "onSubmit",
2788
+ "onSend",
2789
+ "onModelClick"
2790
+ ]);
2791
+ setAttribute(input, "class", "vui-composer__input");
2792
+ setAttribute(toolbar, "class", "vui-composer__toolbar");
2793
+ setAttribute(tools, "class", "vui-composer__tools");
2794
+ setAttribute(actions, "class", "vui-composer__actions");
2795
+ effect(() => {
2796
+ setOptionalAttribute(input, "placeholder", readProp(props, "placeholder", void 0));
2797
+ setOptionalProperty(input, "disabled", readProp(props, "disabled", false));
2798
+ setOptionalAttribute(input, "aria-disabled", readProp(props, "disabled", false) ? "true" : void 0);
2799
+ });
2800
+ if (hasProp(props, "value")) {
2801
+ bindPropertyValue(input, "value", () => readProp(props, "value", "") ?? "");
2802
+ }
2803
+ listen(input, "input", props, "onInput", () => readProp(props, "disabled", false));
2804
+ addEventListener(input, "keydown", (event) => {
2805
+ const keyboardEvent = event;
2806
+ if (keyboardEvent.key !== "Enter" || !keyboardEvent.metaKey && !keyboardEvent.ctrlKey) return;
2807
+ keyboardEvent.preventDefault?.();
2808
+ const handler = readProp(props, "onSubmit", void 0);
2809
+ if (typeof handler === "function") handler(currentValue(input, props), keyboardEvent);
2810
+ });
2811
+ if (hasProp(props, "tools")) mountSlot(tools, props, "tools");
2812
+ else if (hasProp(props, "children")) mountSlot(tools, props, "children");
2813
+ if (hasProp(props, "model")) insertBefore(tools, createModelSelector(props), null);
2814
+ if (hasProp(props, "actions")) mountSlot(actions, props, "actions");
2815
+ else insertBefore(actions, createSendButton(input, props), null);
2816
+ insertBefore(root, input, null);
2817
+ insertBefore(toolbar, tools, null);
2818
+ insertBefore(toolbar, actions, null);
2819
+ insertBefore(root, toolbar, null);
2820
+ return root;
2821
+ }
2822
+ __name(ChatComposer, "ChatComposer");
2823
+ function createModelSelector(props) {
2824
+ const button = createElement("button");
2825
+ setAttribute(button, "class", "vui-composer__model");
2826
+ setAttribute(button, "type", "button");
2827
+ if (hasProp(props, "modelIcon")) {
2828
+ const icon = createElement("span");
2829
+ setAttribute(icon, "class", "vui-composer__model-icon");
2830
+ mountSlot(icon, props, "modelIcon");
2831
+ insertBefore(button, icon, null);
2832
+ }
2833
+ const text = createText("");
2834
+ bindTextContent(text, () => readProp(props, "model", ""));
2835
+ insertBefore(button, text, null);
2836
+ if (hasProp(props, "modelChevron")) {
2837
+ const chevron = createElement("span");
2838
+ setAttribute(chevron, "class", "vui-composer__model-chevron");
2839
+ mountSlot(chevron, props, "modelChevron");
2840
+ insertBefore(button, chevron, null);
2841
+ }
2842
+ addEventListener(button, "click", (event) => {
2843
+ const handler = readProp(props, "onModelClick", void 0);
2844
+ if (typeof handler === "function") handler(event);
2845
+ });
2846
+ return button;
2847
+ }
2848
+ __name(createModelSelector, "createModelSelector");
2849
+ function createSendButton(input, props) {
2850
+ const button = createElement("button");
2851
+ setAttribute(button, "class", "vui-composer__send");
2852
+ setAttribute(button, "type", "button");
2853
+ const label = readProp(props, "sendLabel", "Send");
2854
+ setOptionalAttribute(button, "aria-label", label);
2855
+ if (hasProp(props, "sendIcon")) {
2856
+ const icon = createElement("span");
2857
+ setAttribute(icon, "class", "vui-composer__send-icon");
2858
+ mountSlot(icon, props, "sendIcon");
2859
+ insertBefore(button, icon, null);
2860
+ } else {
2861
+ insertBefore(button, createText(label), null);
2862
+ }
2863
+ effect(() => setProperty(button, "disabled", readProp(props, "disabled", false)));
2864
+ addEventListener(button, "click", (event) => {
2865
+ if (readProp(props, "disabled", false)) return;
2866
+ const handler = readProp(props, "onSend", void 0);
2867
+ if (typeof handler === "function") handler(currentValue(input, props), event);
2868
+ });
2869
+ return button;
2870
+ }
2871
+ __name(createSendButton, "createSendButton");
2872
+ function currentValue(input, props) {
2873
+ const value = Reflect.get(input, "value");
2874
+ return typeof value === "string" ? value : readProp(props, "value", "") ?? "";
2875
+ }
2876
+ __name(currentValue, "currentValue");
2877
+
2878
+ // packages/ui/src/drawer.ts
2879
+ function Drawer(props = {}) {
2880
+ const root = createElement("div");
2881
+ const surface = createElement("aside");
2882
+ const body = createElement("div");
2883
+ bindClassList(root, props, () => ["vui-backdrop"]);
2884
+ bindUserStyle(root, props);
2885
+ bindCommonAttributes(surface, props, [
2886
+ "open",
2887
+ "title",
2888
+ "side",
2889
+ "closeOnBackdrop",
2890
+ "closeOnEscape",
2891
+ "modal",
2892
+ "titleId",
2893
+ "descriptionId",
2894
+ "closeLabel",
2895
+ "footer",
2896
+ "onClose",
2897
+ "portal",
2898
+ "portalTarget"
2899
+ ]);
2900
+ setAttribute(root, "role", "presentation");
2901
+ setAttribute(surface, "class", "vui-drawer");
2902
+ setAttribute(surface, "role", "dialog");
2903
+ setAttribute(body, "class", "vui-drawer__body");
2904
+ effect(() => {
2905
+ const open = readProp(props, "open", false);
2906
+ const modal = readProp(props, "modal", true);
2907
+ setOptionalProperty(root, "hidden", !open);
2908
+ setOptionalAttribute(root, "data-state", open ? "open" : "closed");
2909
+ setOptionalAttribute(surface, "aria-modal", modal ? "true" : "false");
2910
+ setOptionalAttribute(surface, "aria-labelledby", readProp(props, "titleId", void 0));
2911
+ setOptionalAttribute(surface, "aria-describedby", readProp(props, "descriptionId", void 0));
2912
+ setOptionalAttribute(surface, "data-side", readProp(props, "side", "right"));
2913
+ });
2914
+ if (hasProp(props, "title") || hasProp(props, "onClose")) {
2915
+ const head = createElement("header");
2916
+ setAttribute(head, "class", "vui-drawer__head");
2917
+ if (hasProp(props, "title")) {
2918
+ const title = createElement("div");
2919
+ const text = createText("");
2920
+ setAttribute(title, "class", "vui-dialog__title");
2921
+ bindTextContent(text, () => readProp(props, "title", ""));
2922
+ insertBefore(title, text, null);
2923
+ insertBefore(head, title, null);
2924
+ }
2925
+ if (hasProp(props, "onClose")) {
2926
+ const close = createElement("button");
2927
+ setAttribute(close, "class", "vui-dialog__close");
2928
+ setAttribute(close, "type", "button");
2929
+ setAttribute(close, "aria-label", readProp(props, "closeLabel", "Close"));
2930
+ insertBefore(close, createText("x"), null);
2931
+ addEventListener(close, "click", () => emitClose2(props, "close-button"));
2932
+ insertBefore(head, close, null);
2933
+ }
2934
+ insertBefore(surface, head, null);
2935
+ }
2936
+ if (hasProp(props, "children")) mountSlot(body, props, "children");
2937
+ insertBefore(surface, body, null);
2938
+ if (hasProp(props, "footer")) {
2939
+ const footer = createElement("footer");
2940
+ setAttribute(footer, "class", "vui-dialog__foot");
2941
+ mountSlot(footer, props, "footer");
2942
+ insertBefore(surface, footer, null);
2943
+ }
2944
+ insertBefore(root, surface, null);
2945
+ addEventListener(root, "click", (event) => {
2946
+ if (event.target !== root) return;
2947
+ if (readProp(props, "closeOnBackdrop", true)) emitClose2(props, "backdrop");
2948
+ });
2949
+ addEventListener(root, "keydown", (event) => {
2950
+ if (event.key !== "Escape") return;
2951
+ if (readProp(props, "closeOnEscape", true)) emitClose2(props, "escape");
2952
+ });
2953
+ const portal = readProp(props, "portal", void 0);
2954
+ return portal ? createPortal(root, portal, readProp(props, "portalTarget", void 0)) : root;
2955
+ }
2956
+ __name(Drawer, "Drawer");
2957
+ function emitClose2(props, reason) {
2958
+ if (!readProp(props, "open", false)) return;
2959
+ const handler = readProp(props, "onClose", void 0);
2960
+ if (typeof handler === "function") handler(reason);
2961
+ }
2962
+ __name(emitClose2, "emitClose");
2963
+
2964
+ // packages/notification/src/index.ts
2965
+ var _NotificationError = class _NotificationError extends Error {
2966
+ constructor(code, message) {
2967
+ super(message);
2968
+ this.name = "NotificationError";
2969
+ this.code = code;
2970
+ }
2971
+ };
2972
+ __name(_NotificationError, "NotificationError");
2973
+ var NotificationError = _NotificationError;
2974
+ var NOTIFICATION_KEY = createInjectionKey("vobs.notification");
2975
+ function useNotification() {
2976
+ const notification = inject(NOTIFICATION_KEY);
2977
+ if (!notification) {
2978
+ throw new NotificationError("NOTIFICATION_CONTEXT_MISSING", "Vobs Notification: \u627E\u4E0D\u5230\u4E0A\u4E0B\u6587\uFF0C\u8BF7\u5B89\u88C5 notificationPlugin");
2979
+ }
2980
+ return notification;
2981
+ }
2982
+ __name(useNotification, "useNotification");
2983
+
2984
+ // packages/icon-core/src/index.ts
2985
+ function createIcon(name, path, viewBox = "0 0 24 24") {
2986
+ return { name, path, viewBox };
2987
+ }
2988
+ __name(createIcon, "createIcon");
2989
+ function createSvgIconNode(source, props = {}, options = {}) {
2990
+ const root = createElement("span");
2991
+ effect(() => {
2992
+ updateSvgIconNode(root, typeof source === "function" ? source() : source, props, options);
2993
+ });
2994
+ return root;
2995
+ }
2996
+ __name(createSvgIconNode, "createSvgIconNode");
2997
+ function updateSvgIconNode(root, definition, props, options) {
2998
+ const size = readProp2(props, "size", void 0);
2999
+ const width = readProp2(props, "width", size);
3000
+ const height = readProp2(props, "height", size);
3001
+ const normalizedWidth = normalizeSvgLength(width);
3002
+ const normalizedHeight = normalizeSvgLength(height);
3003
+ const userClass = [
3004
+ readProp2(props, "class", void 0),
3005
+ readProp2(props, "className", void 0)
3006
+ ].filter(hasText).join(" ");
3007
+ const className = [options.class, options.className, userClass].filter(hasText).join(" ");
3008
+ setAttribute(root, "class", className);
3009
+ const internalStyle = size === void 0 ? "" : `width: ${normalizeCssLength(size)}; height: ${normalizeCssLength(size)}`;
3010
+ const userStyle = readProp2(props, "style", void 0);
3011
+ const style = [internalStyle, userStyle].filter(hasText).join("; ");
3012
+ setOptionalAttribute2(root, "style", style || void 0);
3013
+ const managedAttributes2 = /* @__PURE__ */ new Map();
3014
+ for (const name of Object.keys(props)) {
3015
+ if (name === "class" || name === "className" || name === "style" || name === "children") continue;
3016
+ if (!name.startsWith("aria-") && !name.startsWith("data-") && !["id", "title", "role", "tabIndex"].includes(name)) continue;
3017
+ const value = Reflect.get(props, name);
3018
+ if (value === void 0 || value === null || value === false) continue;
3019
+ managedAttributes2.set(name === "tabIndex" ? "tabindex" : name, String(value));
3020
+ }
3021
+ for (const [name, value] of managedAttributes2) setAttribute(root, name, value);
3022
+ clearStaleAttributes(root, managedAttributes2);
3023
+ const title = readProp2(props, "title", void 0);
3024
+ const ariaLabel = Reflect.get(props, "aria-label");
3025
+ const decorative = readProp2(props, "decorative", title === void 0 && ariaLabel === void 0);
3026
+ setOptionalAttribute2(root, "aria-hidden", decorative ? "true" : void 0);
3027
+ setOptionalAttribute2(root, "aria-label", ariaLabel === void 0 ? title : void 0);
3028
+ setOptionalAttribute2(root, "data-icon-name", options.dataIconName ?? definition?.name);
3029
+ setOptionalAttribute2(root, "color", readProp2(props, "color", void 0));
3030
+ if (!definition) {
3031
+ setProperty(root, "innerHTML", "");
3032
+ return;
3033
+ }
3034
+ const svgAttributes = {
3035
+ xmlns: "http://www.w3.org/2000/svg",
3036
+ viewBox: definition.viewBox ?? "0 0 24 24",
3037
+ ...options.defaultSvgAttributes,
3038
+ ...definition.attributes,
3039
+ ...normalizedWidth === void 0 ? {} : { width: normalizedWidth },
3040
+ ...normalizedHeight === void 0 ? {} : { height: normalizedHeight },
3041
+ ...readProp2(props, "color", void 0) === void 0 ? {} : { color: readProp2(props, "color", void 0) },
3042
+ ...readProp2(props, "stroke", void 0) === void 0 ? {} : { stroke: readProp2(props, "stroke", void 0) },
3043
+ ...readProp2(props, "fill", void 0) === void 0 ? {} : { fill: readProp2(props, "fill", void 0) },
3044
+ ...readProp2(props, "strokeWidth", void 0) === void 0 ? {} : { "stroke-width": readProp2(props, "strokeWidth", void 0) }
3045
+ };
3046
+ const markup = Object.entries(svgAttributes).filter(([, value]) => value !== void 0).map(([name, value]) => `${name}="${escapeXml(String(value))}"`).join(" ");
3047
+ const titleMarkup = title === void 0 ? "" : `<title>${escapeXml(title)}</title>`;
3048
+ setProperty(root, "innerHTML", `<svg ${markup} aria-hidden="true">${titleMarkup}${definition.body}</svg>`);
3049
+ }
3050
+ __name(updateSvgIconNode, "updateSvgIconNode");
3051
+ function readProp2(props, name, fallback) {
3052
+ const value = Reflect.get(props, name);
3053
+ return value === void 0 ? fallback : value;
3054
+ }
3055
+ __name(readProp2, "readProp");
3056
+ function hasText(value) {
3057
+ return value !== void 0 && value.trim() !== "";
3058
+ }
3059
+ __name(hasText, "hasText");
3060
+ function normalizeSvgLength(value) {
3061
+ if (value === void 0) return void 0;
3062
+ return typeof value === "number" ? String(value) : value;
3063
+ }
3064
+ __name(normalizeSvgLength, "normalizeSvgLength");
3065
+ function normalizeCssLength(value) {
3066
+ return typeof value === "number" || /^\d+(?:\.\d+)?$/u.test(value) ? `${value}px` : value;
3067
+ }
3068
+ __name(normalizeCssLength, "normalizeCssLength");
3069
+ function setOptionalAttribute2(node, name, value) {
3070
+ if (value === void 0 || value === null || value === false || value === "") {
3071
+ node.removeAttribute(name);
3072
+ return;
3073
+ }
3074
+ setAttribute(node, name, String(value));
3075
+ }
3076
+ __name(setOptionalAttribute2, "setOptionalAttribute");
3077
+ function clearStaleAttributes(node, next) {
3078
+ const previous = node.__vobsIconAttributes ?? /* @__PURE__ */ new Set();
3079
+ for (const name of previous) {
3080
+ if (!next.has(name)) node.removeAttribute(name);
3081
+ }
3082
+ node.__vobsIconAttributes = new Set(next.keys());
3083
+ }
3084
+ __name(clearStaleAttributes, "clearStaleAttributes");
3085
+ function escapeXml(value) {
3086
+ return value.replace(/&/gu, "&amp;").replace(/</gu, "&lt;").replace(/>/gu, "&gt;").replace(/"/gu, "&quot;");
3087
+ }
3088
+ __name(escapeXml, "escapeXml");
3089
+
3090
+ // packages/ui/src/icon.ts
3091
+ function Icon(props = {}) {
3092
+ const root = createSvgIconNode(() => {
3093
+ const definition = resolveIcon(
3094
+ readProp(props, "icon", void 0) ?? readProp(props, "name", void 0)
3095
+ );
3096
+ if (!definition) {
3097
+ if (hasProp(props, "children")) return void 0;
3098
+ throw new Error("Vobs UI: Icon requires a registered `name` or an `icon` definition");
3099
+ }
3100
+ return iconDefinitionToSvg(definition);
3101
+ }, props, {
3102
+ class: "vui-icon icon",
3103
+ defaultSvgAttributes: {
3104
+ fill: "none",
3105
+ stroke: "currentColor",
3106
+ "stroke-width": 2,
3107
+ "stroke-linecap": "butt",
3108
+ "stroke-linejoin": "miter"
3109
+ }
3110
+ });
3111
+ if (hasProp(props, "children")) mountSlot(root, props, "children");
3112
+ return root;
3113
+ }
3114
+ __name(Icon, "Icon");
3115
+ function iconDefinitionToSvg(definition) {
3116
+ return {
3117
+ name: definition.name,
3118
+ body: definition.path,
3119
+ viewBox: definition.viewBox
3120
+ };
3121
+ }
3122
+ __name(iconDefinitionToSvg, "iconDefinitionToSvg");
3123
+ var VUI_ICON_PATHS = {
3124
+ search: '<circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/>',
3125
+ check: '<polyline points="4 12 10 18 20 6"/>',
3126
+ x: '<line x1="6" y1="6" x2="18" y2="18"/><line x1="18" y1="6" x2="6" y2="18"/>',
3127
+ plus: '<line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/>',
3128
+ minus: '<line x1="5" y1="12" x2="19" y2="12"/>',
3129
+ "chevron-right": '<polyline points="9 6 15 12 9 18"/>',
3130
+ "chevron-down": '<polyline points="6 9 12 15 18 9"/>',
3131
+ "chevron-up": '<polyline points="6 15 12 9 18 15"/>',
3132
+ "chevron-left": '<polyline points="15 6 9 12 15 18"/>',
3133
+ "arrow-left": '<line x1="20" y1="12" x2="4" y2="12"/><polyline points="10 6 4 12 10 18"/>',
3134
+ "arrow-right": '<line x1="4" y1="12" x2="20" y2="12"/><polyline points="14 6 20 12 14 18"/>',
3135
+ "arrow-up": '<line x1="12" y1="20" x2="12" y2="4"/><polyline points="6 10 12 4 18 10"/>',
3136
+ "arrow-down": '<line x1="12" y1="4" x2="12" y2="20"/><polyline points="6 14 12 20 18 14"/>',
3137
+ atom: '<circle cx="12" cy="12" r="2"/><ellipse cx="12" cy="12" rx="10" ry="4"/><ellipse cx="12" cy="12" rx="10" ry="4" transform="rotate(60 12 12)"/><ellipse cx="12" cy="12" rx="10" ry="4" transform="rotate(120 12 12)"/>',
3138
+ globe: '<circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"/>',
3139
+ "arrow-expand": '<polyline points="14 4 20 4 20 10"/><line x1="14" y1="10" x2="20" y2="4"/><polyline points="10 20 4 20 4 14"/><line x1="10" y1="14" x2="4" y2="20"/>',
3140
+ "arrow-minimize": '<polyline points="20 4 14 10 20 10"/><line x1="14" y1="10" x2="14" y2="4"/><polyline points="4 20 10 14 4 14"/><line x1="10" y1="14" x2="10" y2="20"/>',
3141
+ "check-circle": '<circle cx="12" cy="12" r="9"/><polyline points="8 12 11 15 16 9"/>',
3142
+ "alert-circle": '<circle cx="12" cy="12" r="9"/><line x1="12" y1="8" x2="12" y2="13"/><line x1="12" y1="16" x2="12" y2="16.01"/>',
3143
+ "alert-triangle": '<path d="M12 3 22 20 2 20 Z"/><line x1="12" y1="10" x2="12" y2="15"/><line x1="12" y1="18" x2="12" y2="18.01"/>',
3144
+ info: '<circle cx="12" cy="12" r="9"/><line x1="12" y1="11" x2="12" y2="16"/><line x1="12" y1="8" x2="12" y2="8.01"/>',
3145
+ home: '<polygon points="3 11 12 3 21 11 21 21 14 21 14 14 10 14 10 21 3 21 3 11"/>',
3146
+ user: '<path d="M4 21v-1a6 6 0 0 1 6-6h4a6 6 0 0 1 6 6v1"/><circle cx="12" cy="8" r="4"/>',
3147
+ settings: '<circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z"/>',
3148
+ menu: '<line x1="4" y1="6" x2="20" y2="6"/><line x1="4" y1="12" x2="20" y2="12"/><line x1="4" y1="18" x2="20" y2="18"/>',
3149
+ "more-h": '<circle cx="5" cy="12" r="1.5" fill="currentColor"/><circle cx="12" cy="12" r="1.5" fill="currentColor"/><circle cx="19" cy="12" r="1.5" fill="currentColor"/>',
3150
+ calendar: '<rect x="3" y="5" width="18" height="16"/><line x1="3" y1="10" x2="21" y2="10"/><line x1="8" y1="3" x2="8" y2="7"/><line x1="16" y1="3" x2="16" y2="7"/>',
3151
+ filter: '<polygon points="3 4 21 4 14 12 14 20 10 18 10 12 3 4"/>',
3152
+ sort: '<path d="M8 20V4"/><polyline points="4 8 8 4 12 8"/><path d="M16 4v16"/><polyline points="12 16 16 20 20 16"/>',
3153
+ edit: '<path d="M4 20h4l10-10-4-4L4 16v4z"/><path d="M14 6l4 4"/>',
3154
+ trash: '<polyline points="4 6 20 6"/><path d="M6 6v14h12V6"/><path d="M9 6V4h6v2"/><line x1="10" y1="10" x2="10" y2="17"/><line x1="14" y1="10" x2="14" y2="17"/>',
3155
+ download: '<path d="M12 3v12"/><polyline points="7 10 12 15 17 10"/><line x1="3" y1="21" x2="21" y2="21"/>',
3156
+ upload: '<path d="M12 21V6"/><polyline points="7 11 12 6 17 11"/><line x1="3" y1="21" x2="21" y2="21"/>',
3157
+ pause: '<line x1="9" y1="5" x2="9" y2="19"/><line x1="15" y1="5" x2="15" y2="19"/>',
3158
+ play: '<polygon points="8 5 19 12 8 19 8 5"/>',
3159
+ refresh: '<polyline points="21 4 21 10 15 10"/><polyline points="3 20 3 14 9 14"/><path d="M20.5 9A9 9 0 0 0 5 5.5L3 7M3.5 15A9 9 0 0 0 19 18.5L21 17"/>',
3160
+ bell: '<path d="M6 8a6 6 0 0 1 12 0c0 7 3 8 3 8H3s3-1 3-8z"/><path d="M10 21a2 2 0 0 0 4 0"/>',
3161
+ folder: '<path d="M3 6h6l2 3h10v10H3z"/>',
3162
+ code: '<polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/>',
3163
+ sparkles: '<path d="M12 3l1.8 4.2L18 9l-4.2 1.8L12 15l-1.8-4.2L6 9l4.2-1.8L12 3z"/><path d="M19 14l1 2.2 2.2 1-2.2 1L19 20.4l-1-2.2-2.2-1 2.2-1L19 14z"/>',
3164
+ zap: '<polygon points="13 2 4 14 12 14 11 22 20 10 12 10 13 2"/>',
3165
+ sun: '<circle cx="12" cy="12" r="4"/><line x1="12" y1="2" x2="12" y2="5"/><line x1="12" y1="19" x2="12" y2="22"/><line x1="2" y1="12" x2="5" y2="12"/><line x1="19" y1="12" x2="22" y2="12"/><line x1="4.6" y1="4.6" x2="6.7" y2="6.7"/><line x1="17.3" y1="17.3" x2="19.4" y2="19.4"/><line x1="4.6" y1="19.4" x2="6.7" y2="17.3"/><line x1="17.3" y1="6.7" x2="19.4" y2="4.6"/>',
3166
+ moon: '<path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/>',
3167
+ terminal: '<polyline points="4 7 9 12 4 17"/><line x1="12" y1="17" x2="20" y2="17"/>'
3168
+ };
3169
+ var iconRegistry = new Map(
3170
+ Object.entries(VUI_ICON_PATHS).map(([name, path]) => [name, { name, path }])
3171
+ );
3172
+ function registerIcon(icon) {
3173
+ const previous = iconRegistry.get(icon.name);
3174
+ iconRegistry.set(icon.name, icon);
3175
+ return () => {
3176
+ if (previous) iconRegistry.set(icon.name, previous);
3177
+ else iconRegistry.delete(icon.name);
3178
+ };
3179
+ }
3180
+ __name(registerIcon, "registerIcon");
3181
+ function resolveIcon(icon) {
3182
+ return typeof icon === "string" ? iconRegistry.get(icon) : icon;
3183
+ }
3184
+ __name(resolveIcon, "resolveIcon");
3185
+
3186
+ // packages/ui/src/toast.ts
3187
+ function ToastHost(props = {}) {
3188
+ const notification = props.notification ?? useNotification();
3189
+ const root = createElement("ol");
3190
+ bindClassList(root, props, () => [
3191
+ "vui-toast-host",
3192
+ `vui-toast-host--${readProp(props, "position", "top-right")}`
3193
+ ]);
3194
+ bindCommonAttributes(root, props, ["notification", "position", "closeLabel", "portal", "portalTarget"]);
3195
+ bindUserStyle(root, props);
3196
+ setAttribute(root, "aria-label", "Notifications");
3197
+ setAttribute(root, "role", "region");
3198
+ insertList(root, null, () => notification.notifications.value, (entry) => createToast(entry, notification, readProp(props, "closeLabel", "Dismiss notification")), (entry) => entry.id);
3199
+ const portal = readProp(props, "portal", void 0);
3200
+ return portal ? createPortal(root, portal, readProp(props, "portalTarget", void 0)) : root;
3201
+ }
3202
+ __name(ToastHost, "ToastHost");
3203
+ function createToast(notification, context, closeLabel) {
3204
+ const item = createElement("li");
3205
+ const content = createElement("div");
3206
+ const close = createElement("button");
3207
+ setAttribute(item, "class", `vui-toast vui-toast--${notification.type}`);
3208
+ setAttribute(item, "data-notification-id", notification.id);
3209
+ setAttribute(item, "role", notification.type === "error" ? "alert" : "status");
3210
+ setAttribute(content, "class", "vui-toast__content");
3211
+ setAttribute(close, "class", "vui-toast__close");
3212
+ setAttribute(close, "type", "button");
3213
+ setAttribute(close, "aria-label", closeLabel);
3214
+ addEventListener(close, "click", () => context.dismiss(notification.id));
3215
+ if (notification.title) {
3216
+ const title = createElement("div");
3217
+ setAttribute(title, "class", "vui-toast__title");
3218
+ insertBefore(title, createText(notification.title), null);
3219
+ insertBefore(content, title, null);
3220
+ }
3221
+ const message = createElement("div");
3222
+ setAttribute(message, "class", "vui-toast__message");
3223
+ insertBefore(message, createText(notification.content), null);
3224
+ insertBefore(content, message, null);
3225
+ insertBefore(close, Icon({ name: "x", size: 16, decorative: true }), null);
3226
+ insertBefore(item, content, null);
3227
+ insertBefore(item, close, null);
3228
+ return item;
3229
+ }
3230
+ __name(createToast, "createToast");
3231
+
3232
+ export { ActivityRail, Alert, Avatar, Button, ButtonGroup, Card, CardHeader, ChatComposer, Checkbox, Dialog, Drawer, EditorTabs, FileTree, Icon, Input, Kbd, KbdCombo, KbdRow, Menu, MenuDivider, NavList, PageHeader, PageHeaderAction, Pagination, Radio, Select, StatCard, StatCardGrid, StatusBar, Switch, Table, TablePanel, Tabs, Tag, Textarea, ToastHost, VUI_ICON_PATHS, WorkbenchTitlebar, createDOMPortalAdapter, createFocusTrap, createIcon, createOverlayManager, createPortal, registerIcon, resolveIcon };
3233
+ //# sourceMappingURL=index.js.map
3234
+ //# sourceMappingURL=index.js.map