veryfront 0.1.1237 → 0.1.1239

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 (493) hide show
  1. package/esm/cli/auth/login.d.ts +24 -2
  2. package/esm/cli/auth/login.d.ts.map +1 -1
  3. package/esm/cli/auth/login.js +444 -35
  4. package/esm/cli/commands/build/error-handler.d.ts.map +1 -1
  5. package/esm/cli/commands/build/error-handler.js +41 -3
  6. package/esm/cli/commands/build/handler.d.ts.map +1 -1
  7. package/esm/cli/commands/build/handler.js +1 -1
  8. package/esm/cli/commands/dev/command.d.ts.map +1 -1
  9. package/esm/cli/commands/dev/command.js +14 -1
  10. package/esm/cli/commands/dev/inference-status.d.ts +6 -0
  11. package/esm/cli/commands/dev/inference-status.d.ts.map +1 -1
  12. package/esm/cli/commands/dev/inference-status.js +14 -2
  13. package/esm/cli/commands/generate/command.d.ts.map +1 -1
  14. package/esm/cli/commands/generate/command.js +61 -0
  15. package/esm/cli/commands/init/init-command.d.ts.map +1 -1
  16. package/esm/cli/commands/init/init-command.js +23 -31
  17. package/esm/cli/commands/install/registry.d.ts.map +1 -1
  18. package/esm/cli/commands/install/registry.js +6 -9
  19. package/esm/cli/commands/login/command-help.d.ts.map +1 -1
  20. package/esm/cli/commands/login/command-help.js +3 -1
  21. package/esm/cli/commands/pull/command.d.ts +1 -0
  22. package/esm/cli/commands/pull/command.d.ts.map +1 -1
  23. package/esm/cli/commands/pull/command.js +49 -6
  24. package/esm/cli/commands/push/command-help.d.ts.map +1 -1
  25. package/esm/cli/commands/push/command-help.js +7 -0
  26. package/esm/cli/commands/push/command.d.ts +23 -12
  27. package/esm/cli/commands/push/command.d.ts.map +1 -1
  28. package/esm/cli/commands/push/command.js +461 -44
  29. package/esm/cli/commands/push/plan.d.ts +35 -0
  30. package/esm/cli/commands/push/plan.d.ts.map +1 -0
  31. package/esm/cli/commands/push/plan.js +96 -0
  32. package/esm/cli/commands/schedule/handler.d.ts +21 -2
  33. package/esm/cli/commands/schedule/handler.d.ts.map +1 -1
  34. package/esm/cli/commands/schedule/handler.js +74 -27
  35. package/esm/cli/commands/schema/command-help.js +1 -1
  36. package/esm/cli/commands/up/command.js +1 -1
  37. package/esm/cli/commands/webhook/handler.d.ts.map +1 -1
  38. package/esm/cli/commands/webhook/handler.js +3 -1
  39. package/esm/cli/router.d.ts.map +1 -1
  40. package/esm/cli/router.js +27 -5
  41. package/esm/cli/shared/args.d.ts +15 -1
  42. package/esm/cli/shared/args.d.ts.map +1 -1
  43. package/esm/cli/shared/args.js +56 -3
  44. package/esm/cli/shared/config.d.ts +11 -2
  45. package/esm/cli/shared/config.d.ts.map +1 -1
  46. package/esm/cli/shared/config.js +72 -27
  47. package/esm/cli/shared/project-creation.js +1 -1
  48. package/esm/cli/sync/state.d.ts +20 -0
  49. package/esm/cli/sync/state.d.ts.map +1 -0
  50. package/esm/cli/sync/state.js +193 -0
  51. package/esm/deno.js +2 -2
  52. package/esm/extensions/ext-llm-anthropic/src/anthropic-request-builder.d.ts.map +1 -1
  53. package/esm/extensions/ext-llm-anthropic/src/anthropic-request-builder.js +852 -21
  54. package/esm/extensions/ext-observability-sentry/src/policy.d.ts +2 -0
  55. package/esm/extensions/ext-observability-sentry/src/policy.d.ts.map +1 -1
  56. package/esm/extensions/ext-observability-sentry/src/policy.js +214 -3
  57. package/esm/src/agent/conversation/delegation-policy.d.ts +2 -0
  58. package/esm/src/agent/conversation/delegation-policy.d.ts.map +1 -1
  59. package/esm/src/agent/conversation/delegation-policy.js +13 -3
  60. package/esm/src/agent/conversation/hosted-terminal.d.ts.map +1 -1
  61. package/esm/src/agent/conversation/hosted-terminal.js +6 -2
  62. package/esm/src/agent/conversation/run-chunk-mirror.d.ts.map +1 -1
  63. package/esm/src/agent/conversation/run-chunk-mirror.js +14 -2
  64. package/esm/src/agent/factory.d.ts.map +1 -1
  65. package/esm/src/agent/factory.js +22 -11
  66. package/esm/src/agent/hosted/chat-runtime-tool-assembly.d.ts +2 -0
  67. package/esm/src/agent/hosted/chat-runtime-tool-assembly.d.ts.map +1 -1
  68. package/esm/src/agent/hosted/chat-runtime-tool-assembly.js +6 -1
  69. package/esm/src/agent/hosted/child-fork-execution-runner.d.ts +2 -1
  70. package/esm/src/agent/hosted/child-fork-execution-runner.d.ts.map +1 -1
  71. package/esm/src/agent/hosted/child-fork-execution-runner.js +6 -3
  72. package/esm/src/agent/hosted/child-fork-step-message-preparation.d.ts +12 -3
  73. package/esm/src/agent/hosted/child-fork-step-message-preparation.d.ts.map +1 -1
  74. package/esm/src/agent/hosted/child-fork-step-message-preparation.js +16 -3
  75. package/esm/src/agent/hosted/cloud-agent-chat-execution.d.ts +1 -1
  76. package/esm/src/agent/hosted/cloud-agent-chat-execution.d.ts.map +1 -1
  77. package/esm/src/agent/hosted/cloud-agent-chat-execution.js +3 -3
  78. package/esm/src/agent/hosted/cloud-agent-child-tools.d.ts +11 -0
  79. package/esm/src/agent/hosted/cloud-agent-child-tools.d.ts.map +1 -1
  80. package/esm/src/agent/hosted/cloud-agent-child-tools.js +2 -3
  81. package/esm/src/agent/hosted/cloud-agent-config.d.ts +1 -0
  82. package/esm/src/agent/hosted/cloud-agent-config.d.ts.map +1 -1
  83. package/esm/src/agent/hosted/cloud-runtime-system-messages.d.ts +16 -1
  84. package/esm/src/agent/hosted/cloud-runtime-system-messages.d.ts.map +1 -1
  85. package/esm/src/agent/hosted/cloud-runtime-system-messages.js +13 -3
  86. package/esm/src/agent/hosted/default-chat-runtime.d.ts +2 -1
  87. package/esm/src/agent/hosted/default-chat-runtime.d.ts.map +1 -1
  88. package/esm/src/agent/hosted/default-chat-runtime.js +18 -7
  89. package/esm/src/agent/hosted/default-invoke-agent-tool.d.ts +2 -1
  90. package/esm/src/agent/hosted/default-invoke-agent-tool.d.ts.map +1 -1
  91. package/esm/src/agent/hosted/default-invoke-agent-tool.js +11 -3
  92. package/esm/src/agent/hosted/default-project-steering-refresh.d.ts +2 -1
  93. package/esm/src/agent/hosted/default-project-steering-refresh.d.ts.map +1 -1
  94. package/esm/src/agent/hosted/default-project-steering-refresh.js +4 -1
  95. package/esm/src/agent/hosted/runtime-state-resolver.d.ts +6 -4
  96. package/esm/src/agent/hosted/runtime-state-resolver.d.ts.map +1 -1
  97. package/esm/src/agent/hosted/runtime-state-resolver.js +8 -11
  98. package/esm/src/agent/index.d.ts +3 -3
  99. package/esm/src/agent/index.d.ts.map +1 -1
  100. package/esm/src/agent/project/agent-runtime.d.ts.map +1 -1
  101. package/esm/src/agent/project/agent-runtime.js +6 -3
  102. package/esm/src/agent/runtime/agent-definition.d.ts +68 -66
  103. package/esm/src/agent/runtime/agent-definition.d.ts.map +1 -1
  104. package/esm/src/agent/runtime/agent-definition.js +15 -2
  105. package/esm/src/agent/runtime/agent-invocation-contract.d.ts +2 -0
  106. package/esm/src/agent/runtime/agent-invocation-contract.d.ts.map +1 -1
  107. package/esm/src/agent/runtime/agent-markdown-adapter.js +1 -1
  108. package/esm/src/agent/runtime/agent-runtime-step.d.ts +11 -5
  109. package/esm/src/agent/runtime/agent-runtime-step.d.ts.map +1 -1
  110. package/esm/src/agent/runtime/agent-runtime-step.js +23 -6
  111. package/esm/src/agent/runtime/call-context.d.ts +42 -11
  112. package/esm/src/agent/runtime/call-context.d.ts.map +1 -1
  113. package/esm/src/agent/runtime/call-context.js +480 -42
  114. package/esm/src/agent/runtime/chat-stream-handler.d.ts +18 -0
  115. package/esm/src/agent/runtime/chat-stream-handler.d.ts.map +1 -1
  116. package/esm/src/agent/runtime/chat-stream-handler.js +38 -18
  117. package/esm/src/agent/runtime/effective-agent-system.d.ts +13 -4
  118. package/esm/src/agent/runtime/effective-agent-system.d.ts.map +1 -1
  119. package/esm/src/agent/runtime/effective-agent-system.js +29 -0
  120. package/esm/src/agent/runtime/index.d.ts +1 -0
  121. package/esm/src/agent/runtime/index.d.ts.map +1 -1
  122. package/esm/src/agent/runtime/index.js +638 -53
  123. package/esm/src/agent/runtime/load-skill-tool.d.ts +33 -3
  124. package/esm/src/agent/runtime/load-skill-tool.d.ts.map +1 -1
  125. package/esm/src/agent/runtime/load-skill-tool.js +152 -21
  126. package/esm/src/agent/runtime/model-resolution.d.ts +3 -0
  127. package/esm/src/agent/runtime/model-resolution.d.ts.map +1 -1
  128. package/esm/src/agent/runtime/model-resolution.js +14 -0
  129. package/esm/src/agent/runtime/model-transport.d.ts +1 -0
  130. package/esm/src/agent/runtime/model-transport.d.ts.map +1 -1
  131. package/esm/src/agent/runtime/model-transport.js +5 -2
  132. package/esm/src/agent/runtime/run-runtime-context.d.ts +4 -0
  133. package/esm/src/agent/runtime/run-runtime-context.d.ts.map +1 -1
  134. package/esm/src/agent/runtime/run-runtime-context.js +9 -3
  135. package/esm/src/agent/runtime/runtime-tool-config.d.ts +1 -0
  136. package/esm/src/agent/runtime/runtime-tool-config.d.ts.map +1 -1
  137. package/esm/src/agent/runtime/skill-prompt.d.ts +3 -0
  138. package/esm/src/agent/runtime/skill-prompt.d.ts.map +1 -1
  139. package/esm/src/agent/runtime/skill-prompt.js +113 -25
  140. package/esm/src/agent/runtime/streamed-assistant-message.d.ts +22 -2
  141. package/esm/src/agent/runtime/streamed-assistant-message.d.ts.map +1 -1
  142. package/esm/src/agent/runtime/streamed-assistant-message.js +26 -5
  143. package/esm/src/agent/runtime/tool-inventory.d.ts.map +1 -1
  144. package/esm/src/agent/runtime/tool-inventory.js +13 -9
  145. package/esm/src/agent/runtime/tool-result-continuation.d.ts +4 -2
  146. package/esm/src/agent/runtime/tool-result-continuation.d.ts.map +1 -1
  147. package/esm/src/agent/runtime/tool-result-continuation.js +24 -20
  148. package/esm/src/agent/schemas/agent.schema.d.ts +2 -2
  149. package/esm/src/agent/service/runtime.js +1 -1
  150. package/esm/src/agent/streaming/fork-runtime-stream.d.ts +5 -4
  151. package/esm/src/agent/streaming/fork-runtime-stream.d.ts.map +1 -1
  152. package/esm/src/agent/types.d.ts +14 -1
  153. package/esm/src/agent/types.d.ts.map +1 -1
  154. package/esm/src/chat/chat-ui-message-helpers.d.ts.map +1 -1
  155. package/esm/src/chat/chat-ui-message-helpers.js +75 -16
  156. package/esm/src/config/loader.d.ts.map +1 -1
  157. package/esm/src/config/loader.js +37 -1
  158. package/esm/src/errors/catalog/build-errors.d.ts.map +1 -1
  159. package/esm/src/errors/catalog/build-errors.js +14 -0
  160. package/esm/src/errors/error-registry/build.d.ts +2 -0
  161. package/esm/src/errors/error-registry/build.d.ts.map +1 -1
  162. package/esm/src/errors/error-registry/build.js +8 -0
  163. package/esm/src/errors/error-registry/deploy.d.ts +4 -0
  164. package/esm/src/errors/error-registry/deploy.d.ts.map +1 -1
  165. package/esm/src/errors/error-registry/deploy.js +16 -0
  166. package/esm/src/errors/error-registry.d.ts +3 -0
  167. package/esm/src/errors/error-registry.d.ts.map +1 -1
  168. package/esm/src/errors/index.d.ts +2 -1
  169. package/esm/src/errors/index.d.ts.map +1 -1
  170. package/esm/src/errors/index.js +4 -3
  171. package/esm/src/errors/tenant-classification.d.ts +25 -0
  172. package/esm/src/errors/tenant-classification.d.ts.map +1 -0
  173. package/esm/src/errors/tenant-classification.js +61 -0
  174. package/esm/src/extensions/builtin-extensions.d.ts +10 -15
  175. package/esm/src/extensions/builtin-extensions.d.ts.map +1 -1
  176. package/esm/src/extensions/builtin-extensions.js +32 -26
  177. package/esm/src/extensions/deferred-extension.d.ts +4 -4
  178. package/esm/src/extensions/deferred-extension.js +4 -4
  179. package/esm/src/extensions/index.d.ts +1 -0
  180. package/esm/src/extensions/index.d.ts.map +1 -1
  181. package/esm/src/extensions/index.js +1 -0
  182. package/esm/src/html/hydration-script-builder/hydration-runtime.generated.js +1 -1
  183. package/esm/src/integrations/_data.d.ts.map +1 -1
  184. package/esm/src/integrations/_data.js +6 -0
  185. package/esm/src/integrations/schema.d.ts +8 -0
  186. package/esm/src/integrations/schema.d.ts.map +1 -1
  187. package/esm/src/integrations/schema.js +3 -0
  188. package/esm/src/integrations/types.d.ts +2 -0
  189. package/esm/src/integrations/types.d.ts.map +1 -1
  190. package/esm/src/internal-agents/run-stream.d.ts.map +1 -1
  191. package/esm/src/internal-agents/run-stream.js +35 -20
  192. package/esm/src/internal-agents/run-system-prompt.d.ts +7 -2
  193. package/esm/src/internal-agents/run-system-prompt.d.ts.map +1 -1
  194. package/esm/src/internal-agents/run-system-prompt.js +19 -13
  195. package/esm/src/internal-agents/schema.d.ts +2 -0
  196. package/esm/src/internal-agents/schema.d.ts.map +1 -1
  197. package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts.map +1 -1
  198. package/esm/src/modules/react-loader/ssr-module-loader/loader.js +2 -18
  199. package/esm/src/modules/react-loader/ssr-module-loader/ssr-dependency-validator.d.ts +11 -0
  200. package/esm/src/modules/react-loader/ssr-module-loader/ssr-dependency-validator.d.ts.map +1 -1
  201. package/esm/src/modules/react-loader/ssr-module-loader/ssr-dependency-validator.js +53 -6
  202. package/esm/src/observability/application-error-contract.d.ts +4 -0
  203. package/esm/src/observability/application-error-contract.d.ts.map +1 -1
  204. package/esm/src/observability/application-errors.d.ts.map +1 -1
  205. package/esm/src/observability/application-errors.js +64 -3
  206. package/esm/src/platform/adapters/runtime/deno/http-server.d.ts.map +1 -1
  207. package/esm/src/platform/adapters/runtime/deno/http-server.js +2 -10
  208. package/esm/src/platform/adapters/runtime/shared/request-peer.d.ts +14 -0
  209. package/esm/src/platform/adapters/runtime/shared/request-peer.d.ts.map +1 -1
  210. package/esm/src/platform/adapters/runtime/shared/request-peer.js +82 -0
  211. package/esm/src/platform/compat/http/pinned-fetch.d.ts +1 -1
  212. package/esm/src/provider/runtime-loader/provider-http.d.ts +5 -1
  213. package/esm/src/provider/runtime-loader/provider-http.d.ts.map +1 -1
  214. package/esm/src/provider/runtime-loader/provider-http.js +55 -17
  215. package/esm/src/provider/shared/index.d.ts +1 -0
  216. package/esm/src/provider/shared/index.d.ts.map +1 -1
  217. package/esm/src/provider/shared/index.js +2 -0
  218. package/esm/src/provider/types.d.ts +1 -0
  219. package/esm/src/provider/types.d.ts.map +1 -1
  220. package/esm/src/react/components/ui/adapter/builtin/combobox.d.ts +3 -0
  221. package/esm/src/react/components/ui/adapter/builtin/combobox.d.ts.map +1 -0
  222. package/esm/src/react/components/ui/adapter/builtin/combobox.js +204 -0
  223. package/esm/src/react/components/ui/adapter/builtin/dialog.d.ts +3 -0
  224. package/esm/src/react/components/ui/adapter/builtin/dialog.d.ts.map +1 -0
  225. package/esm/src/react/components/ui/adapter/builtin/dialog.js +20 -0
  226. package/esm/src/react/components/ui/adapter/builtin/drawer.d.ts +3 -0
  227. package/esm/src/react/components/ui/adapter/builtin/drawer.d.ts.map +1 -0
  228. package/esm/src/react/components/ui/adapter/builtin/drawer.js +21 -0
  229. package/esm/src/react/components/ui/adapter/builtin/index.d.ts.map +1 -1
  230. package/esm/src/react/components/ui/adapter/builtin/index.js +10 -0
  231. package/esm/src/react/components/ui/adapter/builtin/popover.d.ts +3 -0
  232. package/esm/src/react/components/ui/adapter/builtin/popover.d.ts.map +1 -0
  233. package/esm/src/react/components/ui/adapter/builtin/popover.js +28 -0
  234. package/esm/src/react/components/ui/adapter/builtin/tabs.d.ts +3 -0
  235. package/esm/src/react/components/ui/adapter/builtin/tabs.d.ts.map +1 -0
  236. package/esm/src/react/components/ui/adapter/builtin/tabs.js +73 -0
  237. package/esm/src/react/components/ui/adapter/context.d.ts.map +1 -1
  238. package/esm/src/react/components/ui/adapter/context.js +10 -0
  239. package/esm/src/react/components/ui/adapter/contract.d.ts +212 -0
  240. package/esm/src/react/components/ui/adapter/contract.d.ts.map +1 -1
  241. package/esm/src/react/components/ui/adapter/token-scope.d.ts +24 -0
  242. package/esm/src/react/components/ui/adapter/token-scope.d.ts.map +1 -0
  243. package/esm/src/react/components/ui/adapter/token-scope.js +26 -0
  244. package/esm/src/react/components/ui/alert-dialog.d.ts +101 -0
  245. package/esm/src/react/components/ui/alert-dialog.d.ts.map +1 -0
  246. package/esm/src/react/components/ui/alert-dialog.js +181 -0
  247. package/esm/src/react/components/ui/aspect-ratio.d.ts +18 -0
  248. package/esm/src/react/components/ui/aspect-ratio.d.ts.map +1 -0
  249. package/esm/src/react/components/ui/aspect-ratio.js +13 -0
  250. package/esm/src/react/components/ui/autocomplete.d.ts +67 -0
  251. package/esm/src/react/components/ui/autocomplete.d.ts.map +1 -0
  252. package/esm/src/react/components/ui/autocomplete.js +59 -0
  253. package/esm/src/react/components/ui/breadcrumb.d.ts +86 -0
  254. package/esm/src/react/components/ui/breadcrumb.d.ts.map +1 -0
  255. package/esm/src/react/components/ui/breadcrumb.js +67 -0
  256. package/esm/src/react/components/ui/calendar.d.ts +40 -0
  257. package/esm/src/react/components/ui/calendar.d.ts.map +1 -0
  258. package/esm/src/react/components/ui/calendar.js +170 -0
  259. package/esm/src/react/components/ui/combobox.d.ts +74 -0
  260. package/esm/src/react/components/ui/combobox.d.ts.map +1 -0
  261. package/esm/src/react/components/ui/combobox.js +100 -0
  262. package/esm/src/react/components/ui/context-menu.d.ts +116 -0
  263. package/esm/src/react/components/ui/context-menu.d.ts.map +1 -0
  264. package/esm/src/react/components/ui/context-menu.js +168 -0
  265. package/esm/src/react/components/ui/date-picker.d.ts +69 -0
  266. package/esm/src/react/components/ui/date-picker.d.ts.map +1 -0
  267. package/esm/src/react/components/ui/date-picker.js +96 -0
  268. package/esm/src/react/components/ui/dialog.d.ts +41 -11
  269. package/esm/src/react/components/ui/dialog.d.ts.map +1 -1
  270. package/esm/src/react/components/ui/dialog.js +47 -28
  271. package/esm/src/react/components/ui/drawer.d.ts +31 -8
  272. package/esm/src/react/components/ui/drawer.d.ts.map +1 -1
  273. package/esm/src/react/components/ui/drawer.js +33 -22
  274. package/esm/src/react/components/ui/dropdown-menu.d.ts.map +1 -1
  275. package/esm/src/react/components/ui/dropdown-menu.js +7 -75
  276. package/esm/src/react/components/ui/field.d.ts +70 -0
  277. package/esm/src/react/components/ui/field.d.ts.map +1 -0
  278. package/esm/src/react/components/ui/field.js +161 -0
  279. package/esm/src/react/components/ui/file-type.d.ts +9 -8
  280. package/esm/src/react/components/ui/file-type.d.ts.map +1 -1
  281. package/esm/src/react/components/ui/file-type.js +8 -8
  282. package/esm/src/react/components/ui/hover-card.d.ts +82 -0
  283. package/esm/src/react/components/ui/hover-card.d.ts.map +1 -0
  284. package/esm/src/react/components/ui/hover-card.js +140 -0
  285. package/esm/src/react/components/ui/index.d.ts +23 -2
  286. package/esm/src/react/components/ui/index.d.ts.map +1 -1
  287. package/esm/src/react/components/ui/index.js +21 -0
  288. package/esm/src/react/components/ui/input-otp.d.ts +37 -0
  289. package/esm/src/react/components/ui/input-otp.d.ts.map +1 -0
  290. package/esm/src/react/components/ui/input-otp.js +42 -0
  291. package/esm/src/react/components/ui/menu-keyboard.d.ts +8 -0
  292. package/esm/src/react/components/ui/menu-keyboard.d.ts.map +1 -0
  293. package/esm/src/react/components/ui/menu-keyboard.js +76 -0
  294. package/esm/src/react/components/ui/menubar.d.ts +98 -0
  295. package/esm/src/react/components/ui/menubar.d.ts.map +1 -0
  296. package/esm/src/react/components/ui/menubar.js +173 -0
  297. package/esm/src/react/components/ui/meter.d.ts +45 -0
  298. package/esm/src/react/components/ui/meter.d.ts.map +1 -0
  299. package/esm/src/react/components/ui/meter.js +59 -0
  300. package/esm/src/react/components/ui/modal-surface.d.ts +7 -1
  301. package/esm/src/react/components/ui/modal-surface.d.ts.map +1 -1
  302. package/esm/src/react/components/ui/modal-surface.js +23 -6
  303. package/esm/src/react/components/ui/navigation-menu.d.ts +101 -0
  304. package/esm/src/react/components/ui/navigation-menu.d.ts.map +1 -0
  305. package/esm/src/react/components/ui/navigation-menu.js +195 -0
  306. package/esm/src/react/components/ui/number-field.d.ts +46 -0
  307. package/esm/src/react/components/ui/number-field.d.ts.map +1 -0
  308. package/esm/src/react/components/ui/number-field.js +121 -0
  309. package/esm/src/react/components/ui/pagination.d.ts +77 -0
  310. package/esm/src/react/components/ui/pagination.d.ts.map +1 -0
  311. package/esm/src/react/components/ui/pagination.js +62 -0
  312. package/esm/src/react/components/ui/popover.d.ts +42 -13
  313. package/esm/src/react/components/ui/popover.d.ts.map +1 -1
  314. package/esm/src/react/components/ui/popover.js +25 -12
  315. package/esm/src/react/components/ui/scroll-area.d.ts +38 -0
  316. package/esm/src/react/components/ui/scroll-area.d.ts.map +1 -0
  317. package/esm/src/react/components/ui/scroll-area.js +35 -0
  318. package/esm/src/react/components/ui/separator.d.ts +20 -0
  319. package/esm/src/react/components/ui/separator.d.ts.map +1 -0
  320. package/esm/src/react/components/ui/separator.js +13 -0
  321. package/esm/src/react/components/ui/slider.d.ts +44 -0
  322. package/esm/src/react/components/ui/slider.d.ts.map +1 -0
  323. package/esm/src/react/components/ui/slider.js +46 -0
  324. package/esm/src/react/components/ui/status.d.ts +6 -5
  325. package/esm/src/react/components/ui/status.d.ts.map +1 -1
  326. package/esm/src/react/components/ui/status.js +4 -4
  327. package/esm/src/react/components/ui/tabs.d.ts +32 -9
  328. package/esm/src/react/components/ui/tabs.d.ts.map +1 -1
  329. package/esm/src/react/components/ui/tabs.js +46 -22
  330. package/esm/src/react/components/ui/toggle.d.ts +26 -0
  331. package/esm/src/react/components/ui/toggle.d.ts.map +1 -0
  332. package/esm/src/react/components/ui/toggle.js +29 -0
  333. package/esm/src/react/components/ui/use-isomorphic-layout-effect.d.ts +2 -1
  334. package/esm/src/react/components/ui/use-isomorphic-layout-effect.d.ts.map +1 -1
  335. package/esm/src/react/components/ui/use-isomorphic-layout-effect.js +6 -3
  336. package/esm/src/rendering/chunk-optimizer/source-imports.d.ts.map +1 -1
  337. package/esm/src/rendering/chunk-optimizer/source-imports.js +4 -114
  338. package/esm/src/rendering/orchestrator/css-candidate-manifest.d.ts.map +1 -1
  339. package/esm/src/rendering/orchestrator/css-candidate-manifest.js +30 -1
  340. package/esm/src/rendering/orchestrator/module-loader/build-failure.d.ts +10 -0
  341. package/esm/src/rendering/orchestrator/module-loader/build-failure.d.ts.map +1 -1
  342. package/esm/src/rendering/orchestrator/module-loader/build-failure.js +50 -3
  343. package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.d.ts +2 -0
  344. package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.d.ts.map +1 -1
  345. package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.js +21 -6
  346. package/esm/src/rendering/orchestrator/module-loader/index.d.ts +2 -1
  347. package/esm/src/rendering/orchestrator/module-loader/index.d.ts.map +1 -1
  348. package/esm/src/rendering/orchestrator/module-loader/index.js +190 -7
  349. package/esm/src/rendering/orchestrator/module-loader/module-persistence.d.ts +4 -0
  350. package/esm/src/rendering/orchestrator/module-loader/module-persistence.d.ts.map +1 -1
  351. package/esm/src/rendering/orchestrator/module-loader/module-persistence.js +374 -7
  352. package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
  353. package/esm/src/rendering/orchestrator/pipeline.js +12 -1
  354. package/esm/src/runs/runs-client.d.ts +2 -4
  355. package/esm/src/runs/runs-client.d.ts.map +1 -1
  356. package/esm/src/runs/schemas.d.ts +18 -8
  357. package/esm/src/runs/schemas.d.ts.map +1 -1
  358. package/esm/src/runs/schemas.js +26 -0
  359. package/esm/src/runtime/model-call-context.d.ts +6 -1
  360. package/esm/src/runtime/model-call-context.d.ts.map +1 -1
  361. package/esm/src/runtime/runtime-bridge.d.ts.map +1 -1
  362. package/esm/src/runtime/runtime-bridge.js +133 -15
  363. package/esm/src/schedule/factory.d.ts +8 -2
  364. package/esm/src/schedule/factory.d.ts.map +1 -1
  365. package/esm/src/schedule/factory.js +0 -8
  366. package/esm/src/schedule/index.d.ts +10 -1
  367. package/esm/src/schedule/index.d.ts.map +1 -1
  368. package/esm/src/schedule/index.js +9 -0
  369. package/esm/src/schedule/types.d.ts +30 -11
  370. package/esm/src/schedule/types.d.ts.map +1 -1
  371. package/esm/src/schedule/validation.d.ts +17 -0
  372. package/esm/src/schedule/validation.d.ts.map +1 -1
  373. package/esm/src/schedule/validation.js +93 -5
  374. package/esm/src/security/sandbox/worker-pool.d.ts.map +1 -1
  375. package/esm/src/security/sandbox/worker-pool.js +6 -1
  376. package/esm/src/server/bootstrap.d.ts.map +1 -1
  377. package/esm/src/server/bootstrap.js +6 -0
  378. package/esm/src/server/dev-server/index.d.ts +1 -1
  379. package/esm/src/server/dev-server/index.d.ts.map +1 -1
  380. package/esm/src/server/dev-server/server.d.ts +7 -3
  381. package/esm/src/server/dev-server/server.d.ts.map +1 -1
  382. package/esm/src/server/dev-server/server.js +12 -3
  383. package/esm/src/server/dev-server/types.d.ts +7 -1
  384. package/esm/src/server/dev-server/types.d.ts.map +1 -1
  385. package/esm/src/server/dev-server.d.ts +1 -1
  386. package/esm/src/server/dev-server.d.ts.map +1 -1
  387. package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
  388. package/esm/src/server/handlers/dev/framework-candidates.generated.js +2509 -34
  389. package/esm/src/server/handlers/dev/projects/index.d.ts.map +1 -1
  390. package/esm/src/server/handlers/dev/projects/index.js +3 -0
  391. package/esm/src/server/handlers/request/agent-stream.handler.d.ts.map +1 -1
  392. package/esm/src/server/handlers/request/agent-stream.handler.js +29 -24
  393. package/esm/src/server/index.d.ts +3 -3
  394. package/esm/src/server/index.d.ts.map +1 -1
  395. package/esm/src/server/index.js +10 -5
  396. package/esm/src/server/node-handler.d.ts.map +1 -1
  397. package/esm/src/server/node-handler.js +4 -1
  398. package/esm/src/server/production-server.d.ts.map +1 -1
  399. package/esm/src/server/production-server.js +2 -1
  400. package/esm/src/server/project-env/cache.d.ts +17 -0
  401. package/esm/src/server/project-env/cache.d.ts.map +1 -1
  402. package/esm/src/server/project-env/cache.js +78 -2
  403. package/esm/src/server/project-env/fetcher.d.ts.map +1 -1
  404. package/esm/src/server/project-env/fetcher.js +24 -14
  405. package/esm/src/server/project-env/index.d.ts +1 -1
  406. package/esm/src/server/project-env/index.d.ts.map +1 -1
  407. package/esm/src/server/project-env/index.js +1 -1
  408. package/esm/src/server/project-env/internal-authorization.d.ts +7 -0
  409. package/esm/src/server/project-env/internal-authorization.d.ts.map +1 -0
  410. package/esm/src/server/project-env/internal-authorization.js +32 -0
  411. package/esm/src/server/runtime-handler/index.d.ts.map +1 -1
  412. package/esm/src/server/runtime-handler/index.js +1 -1
  413. package/esm/src/server/runtime-handler/projects-handler.d.ts +1 -1
  414. package/esm/src/server/runtime-handler/projects-handler.d.ts.map +1 -1
  415. package/esm/src/server/runtime-handler/projects-handler.js +4 -2
  416. package/esm/src/transforms/esm/http-bundler.d.ts.map +1 -1
  417. package/esm/src/transforms/esm/http-bundler.js +6 -5
  418. package/esm/src/transforms/esm/http-cache-helpers.d.ts +11 -0
  419. package/esm/src/transforms/esm/http-cache-helpers.d.ts.map +1 -1
  420. package/esm/src/transforms/esm/http-cache-helpers.js +35 -0
  421. package/esm/src/transforms/esm/http-cache.d.ts.map +1 -1
  422. package/esm/src/transforms/esm/http-cache.js +16 -10
  423. package/esm/src/transforms/esm/specifier-resolver.d.ts.map +1 -1
  424. package/esm/src/transforms/esm/specifier-resolver.js +87 -7
  425. package/esm/src/transforms/import-rewriter/strategies/alias-strategy.d.ts +2 -0
  426. package/esm/src/transforms/import-rewriter/strategies/alias-strategy.d.ts.map +1 -1
  427. package/esm/src/transforms/import-rewriter/strategies/alias-strategy.js +11 -6
  428. package/esm/src/transforms/md/compiler/md-compiler.d.ts.map +1 -1
  429. package/esm/src/transforms/md/compiler/md-compiler.js +12 -5
  430. package/esm/src/transforms/mdx/compiler/frontmatter-extractor.d.ts +2 -0
  431. package/esm/src/transforms/mdx/compiler/frontmatter-extractor.d.ts.map +1 -1
  432. package/esm/src/transforms/mdx/compiler/frontmatter-extractor.js +33 -1
  433. package/esm/src/transforms/mdx/compiler/mdx-compiler.d.ts.map +1 -1
  434. package/esm/src/transforms/mdx/compiler/mdx-compiler.js +46 -7
  435. package/esm/src/transforms/mdx/esm-module-loader/cache/index.d.ts.map +1 -1
  436. package/esm/src/transforms/mdx/esm-module-loader/cache/index.js +8 -2
  437. package/esm/src/transforms/mdx/esm-module-loader/cache-format.d.ts +1 -0
  438. package/esm/src/transforms/mdx/esm-module-loader/cache-format.d.ts.map +1 -1
  439. package/esm/src/transforms/mdx/esm-module-loader/cache-format.js +3 -0
  440. package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.d.ts +4 -0
  441. package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.d.ts.map +1 -1
  442. package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.js +44 -8
  443. package/esm/src/transforms/mdx/esm-module-loader/missing-module.d.ts +2 -0
  444. package/esm/src/transforms/mdx/esm-module-loader/missing-module.d.ts.map +1 -1
  445. package/esm/src/transforms/mdx/esm-module-loader/missing-module.js +4 -0
  446. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.d.ts.map +1 -1
  447. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.js +5 -1
  448. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fetcher.d.ts +2 -0
  449. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fetcher.d.ts.map +1 -1
  450. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fetcher.js +50 -11
  451. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/nested-imports.d.ts +24 -12
  452. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/nested-imports.d.ts.map +1 -1
  453. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/nested-imports.js +201 -18
  454. package/esm/src/transforms/mdx/esm-module-loader/types.d.ts +5 -0
  455. package/esm/src/transforms/mdx/esm-module-loader/types.d.ts.map +1 -1
  456. package/esm/src/transforms/mdx/esm-module-loader/utils/source-spans.d.ts +22 -2
  457. package/esm/src/transforms/mdx/esm-module-loader/utils/source-spans.d.ts.map +1 -1
  458. package/esm/src/transforms/mdx/esm-module-loader/utils/source-spans.js +2080 -129
  459. package/esm/src/transforms/mdx/esm-module-loader/utils/stub-module.d.ts +11 -1
  460. package/esm/src/transforms/mdx/esm-module-loader/utils/stub-module.d.ts.map +1 -1
  461. package/esm/src/transforms/mdx/esm-module-loader/utils/stub-module.js +32 -15
  462. package/esm/src/transforms/pipeline/stages/compile.d.ts.map +1 -1
  463. package/esm/src/transforms/pipeline/stages/compile.js +44 -0
  464. package/esm/src/transforms/shared/specifier-suffix.d.ts +25 -0
  465. package/esm/src/transforms/shared/specifier-suffix.d.ts.map +1 -0
  466. package/esm/src/transforms/shared/specifier-suffix.js +43 -0
  467. package/esm/src/trigger/index.d.ts +2 -2
  468. package/esm/src/trigger/index.d.ts.map +1 -1
  469. package/esm/src/trigger/index.js +1 -1
  470. package/esm/src/trigger/local-runner.d.ts +2 -2
  471. package/esm/src/trigger/local-runner.d.ts.map +1 -1
  472. package/esm/src/trigger/local-runner.js +11 -4
  473. package/esm/src/trigger/target.d.ts +97 -5
  474. package/esm/src/trigger/target.d.ts.map +1 -1
  475. package/esm/src/trigger/target.js +175 -5
  476. package/esm/src/utils/version-constant.d.ts +1 -1
  477. package/esm/src/utils/version-constant.js +1 -1
  478. package/esm/src/webhook/types.d.ts +21 -6
  479. package/esm/src/webhook/types.d.ts.map +1 -1
  480. package/esm/src/webhook/validation.d.ts.map +1 -1
  481. package/esm/src/webhook/validation.js +27 -39
  482. package/esm/templates/index.d.ts +1 -1
  483. package/esm/templates/index.d.ts.map +1 -1
  484. package/esm/templates/loader.d.ts +6 -6
  485. package/esm/templates/loader.d.ts.map +1 -1
  486. package/esm/templates/loader.js +34 -18
  487. package/esm/templates/manifest.generated.d.ts +3 -0
  488. package/esm/templates/manifest.generated.d.ts.map +1 -0
  489. package/esm/templates/manifest.generated.js +2 -0
  490. package/package.json +8 -8
  491. package/esm/templates/manifest.d.ts +0 -664
  492. package/esm/templates/manifest.d.ts.map +0 -1
  493. package/esm/templates/manifest.js +0 -662
@@ -0,0 +1,170 @@
1
+ /**
2
+ * Calendar: a dependency-free single-month date grid. Renders a header row
3
+ * (previous-month button, "Month YYYY" caption, and next-month button), a
4
+ * weekday header, and a `role="grid"` table of days. One day participates in
5
+ * the tab order. Arrow keys move by day or week, Home and End move to week
6
+ * boundaries, and Page Up and Page Down move by month. The selected day is
7
+ * controlled via `value`; selecting a day fires `onChange`. The displayed month
8
+ * is tracked internally (seeded from `defaultMonth ?? value ?? today`) and moved
9
+ * by the previous and next buttons. Self-contained: no `react-day-picker`, no
10
+ * floating engine; skinned with the veryfront theme tokens.
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * import { Calendar } from "veryfront/ui";
15
+ *
16
+ * function Example() {
17
+ * const [day, setDay] = React.useState<Date>();
18
+ * return <Calendar value={day} onChange={setDay} />;
19
+ * }
20
+ * ```
21
+ *
22
+ * @module react/components/ui/calendar
23
+ */
24
+ import * as React from "react";
25
+ import { cx as cn } from "./cva.js";
26
+ const MONTHS = [
27
+ "January",
28
+ "February",
29
+ "March",
30
+ "April",
31
+ "May",
32
+ "June",
33
+ "July",
34
+ "August",
35
+ "September",
36
+ "October",
37
+ "November",
38
+ "December",
39
+ ];
40
+ // Sunday-first weekday labels; rotated when weekStartsOn === 1.
41
+ const WEEKDAYS = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
42
+ /** First day of the month `d` falls in, at local midnight. */
43
+ function startOfMonth(d) {
44
+ return new Date(d.getFullYear(), d.getMonth(), 1);
45
+ }
46
+ /** True when `a` and `b` are the same calendar day. */
47
+ function isSameDay(a, b) {
48
+ return (a.getFullYear() === b.getFullYear() &&
49
+ a.getMonth() === b.getMonth() &&
50
+ a.getDate() === b.getDate());
51
+ }
52
+ /** True when `a` and `b` fall in the same calendar month. */
53
+ function isSameMonth(a, b) {
54
+ return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth();
55
+ }
56
+ /** Return the local calendar day `offset` days from `date`. */
57
+ function addDays(date, offset) {
58
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate() + offset);
59
+ }
60
+ /** Move by whole months, clamping the day to the target month's final day. */
61
+ function addMonths(date, offset) {
62
+ const target = new Date(date.getFullYear(), date.getMonth() + offset, 1);
63
+ const lastDay = new Date(target.getFullYear(), target.getMonth() + 1, 0).getDate();
64
+ return new Date(target.getFullYear(), target.getMonth(), Math.min(date.getDate(), lastDay));
65
+ }
66
+ /** Chunk the flat cell list into rows of seven. */
67
+ function toWeeks(cells) {
68
+ const weeks = [];
69
+ for (let i = 0; i < cells.length; i += 7)
70
+ weeks.push(cells.slice(i, i + 7));
71
+ return weeks;
72
+ }
73
+ /** A dependency-free single-month date grid. */
74
+ export function Calendar({ value, onChange, defaultMonth, weekStartsOn = 0, className, ref, ...props }) {
75
+ const [displayed, setDisplayed] = React.useState(() => startOfMonth(defaultMonth ?? value ?? new Date()));
76
+ const [activeDate, setActiveDate] = React.useState(() => {
77
+ const initialMonth = startOfMonth(defaultMonth ?? value ?? new Date());
78
+ const today = new Date();
79
+ if (value != null && isSameMonth(value, initialMonth))
80
+ return value;
81
+ if (isSameMonth(today, initialMonth))
82
+ return today;
83
+ return initialMonth;
84
+ });
85
+ const activeButtonRef = React.useRef(null);
86
+ const shouldFocusActiveRef = React.useRef(false);
87
+ React.useEffect(() => {
88
+ if (!shouldFocusActiveRef.current)
89
+ return;
90
+ shouldFocusActiveRef.current = false;
91
+ activeButtonRef.current?.focus();
92
+ }, [activeDate, displayed]);
93
+ const today = new Date();
94
+ const year = displayed.getFullYear();
95
+ const month = displayed.getMonth();
96
+ const caption = `${MONTHS[month]} ${year}`;
97
+ const weekdays = weekStartsOn === 1 ? [...WEEKDAYS.slice(1), WEEKDAYS[0]] : WEEKDAYS;
98
+ const daysInMonth = new Date(year, month + 1, 0).getDate();
99
+ const leading = (new Date(year, month, 1).getDay() - weekStartsOn + 7) % 7;
100
+ const cells = [];
101
+ for (let i = 0; i < leading; i++)
102
+ cells.push(null);
103
+ for (let d = 1; d <= daysInMonth; d++)
104
+ cells.push(d);
105
+ while (cells.length % 7 !== 0)
106
+ cells.push(null);
107
+ const weeks = toWeeks(cells);
108
+ const select = (day) => onChange?.(new Date(year, month, day));
109
+ const moveFocus = (date) => {
110
+ shouldFocusActiveRef.current = true;
111
+ if (!isSameMonth(date, displayed))
112
+ setDisplayed(startOfMonth(date));
113
+ setActiveDate(date);
114
+ };
115
+ const changeDisplayedMonth = (offset) => {
116
+ const date = addMonths(activeDate, offset);
117
+ setDisplayed(startOfMonth(date));
118
+ setActiveDate(date);
119
+ };
120
+ const goPrev = () => changeDisplayedMonth(-1);
121
+ const goNext = () => changeDisplayedMonth(1);
122
+ const handleDayKeyDown = (event, date) => {
123
+ const dayOfWeek = (date.getDay() - weekStartsOn + 7) % 7;
124
+ const nextDate = event.key === "ArrowLeft"
125
+ ? addDays(date, -1)
126
+ : event.key === "ArrowRight"
127
+ ? addDays(date, 1)
128
+ : event.key === "ArrowUp"
129
+ ? addDays(date, -7)
130
+ : event.key === "ArrowDown"
131
+ ? addDays(date, 7)
132
+ : event.key === "Home"
133
+ ? addDays(date, -dayOfWeek)
134
+ : event.key === "End"
135
+ ? addDays(date, 6 - dayOfWeek)
136
+ : event.key === "PageUp"
137
+ ? addMonths(date, -1)
138
+ : event.key === "PageDown"
139
+ ? addMonths(date, 1)
140
+ : null;
141
+ if (nextDate == null)
142
+ return;
143
+ event.preventDefault();
144
+ moveFocus(nextDate);
145
+ };
146
+ return (React.createElement("div", { ref: ref, "data-month": caption, className: cn("w-fit select-none rounded-lg border border-[var(--border)] bg-[var(--background)] p-3 text-[var(--foreground)]", className), ...props },
147
+ React.createElement("div", { className: "mb-2 flex items-center justify-between" },
148
+ React.createElement("button", { type: "button", "aria-label": "Previous month", onClick: goPrev, className: "inline-flex size-7 items-center justify-center rounded-md text-[var(--muted-foreground)] hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]" }, "\u2039"),
149
+ React.createElement("div", { "aria-live": "polite", className: "text-sm font-medium text-[var(--foreground)]" }, caption),
150
+ React.createElement("button", { type: "button", "aria-label": "Next month", onClick: goNext, className: "inline-flex size-7 items-center justify-center rounded-md text-[var(--muted-foreground)] hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]" }, "\u203A")),
151
+ React.createElement("table", { role: "grid", "aria-label": caption, className: "border-collapse" },
152
+ React.createElement("thead", null,
153
+ React.createElement("tr", { role: "row", className: "flex" }, weekdays.map((label, i) => (React.createElement("th", { key: i, scope: "col", className: "inline-flex size-9 items-center justify-center text-xs font-normal text-[var(--muted-foreground)]" }, label))))),
154
+ React.createElement("tbody", null, weeks.map((week, wi) => (React.createElement("tr", { key: wi, role: "row", className: "flex" }, week.map((day, di) => {
155
+ if (day == null) {
156
+ return React.createElement("td", { key: di, role: "gridcell", className: "size-9" });
157
+ }
158
+ const date = new Date(year, month, day);
159
+ const selected = value != null && isSameDay(value, date);
160
+ const isToday = isSameDay(today, date);
161
+ const active = isSameDay(activeDate, date);
162
+ return (
163
+ // aria-selected belongs on the gridcell: ARIA defines it for
164
+ // gridcell/option/row/tab, not for role="button". The button
165
+ // carries aria-pressed for its own state instead.
166
+ React.createElement("td", { key: di, role: "gridcell", "aria-selected": selected, "data-selected": selected ? "true" : undefined, className: "p-0" },
167
+ React.createElement("button", { ref: active ? activeButtonRef : undefined, type: "button", tabIndex: active ? 0 : -1, "aria-pressed": selected, "data-today": isToday ? "true" : undefined, onFocus: () => setActiveDate(date), onKeyDown: (event) => handleDayKeyDown(event, date), onClick: () => select(day), className: cn("inline-flex size-9 items-center justify-center rounded-md text-sm text-[var(--foreground)]", "hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)]", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]", isToday && "ring-1 ring-[var(--ring)]", selected &&
168
+ "bg-[var(--primary)] text-[var(--primary-foreground)] hover:bg-[var(--primary)] hover:text-[var(--primary-foreground)]") }, day)));
169
+ }))))))));
170
+ }
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Combobox - a text input that filters a dropdown `listbox` as you type, then
3
+ * commits a selection. The look is ours (theme tokens); the mechanics (query,
4
+ * filtering, `aria-activedescendant` keyboard nav, open/dismiss, portalling)
5
+ * come from the active adapter's `combobox` slot - the zero-dependency
6
+ * {@link builtinCombobox} by default, swappable to cmdk / Base UI / etc. via
7
+ * `UIAdapterProvider`.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * import { Combobox, ComboboxInput, ComboboxContent, ComboboxItem } from "veryfront/ui";
12
+ *
13
+ * <Combobox onValueChange={setFramework}>
14
+ * <ComboboxInput placeholder="Search framework…" />
15
+ * <ComboboxContent>
16
+ * <ComboboxItem value="next">Next.js</ComboboxItem>
17
+ * <ComboboxItem value="remix">Remix</ComboboxItem>
18
+ * <ComboboxItem value="astro">Astro</ComboboxItem>
19
+ * </ComboboxContent>
20
+ * </Combobox>;
21
+ * ```
22
+ *
23
+ * @module react/components/ui/combobox
24
+ */
25
+ import * as React from "react";
26
+ /** Props accepted by `<Combobox>` (the root; owns query/open/value state). */
27
+ export interface ComboboxProps {
28
+ /** `ComboboxInput` + `ComboboxContent` parts to compose. */
29
+ children: React.ReactNode;
30
+ /** Controlled selected value (pair with `onValueChange`). */
31
+ value?: string;
32
+ /** Initial selected value when uncontrolled. */
33
+ defaultValue?: string;
34
+ /** Fires with the newly-selected value. */
35
+ onValueChange?: (value: string) => void;
36
+ /** Controlled open state of the listbox (pair with `onOpenChange`). */
37
+ open?: boolean;
38
+ /** Initial open state when uncontrolled. */
39
+ defaultOpen?: boolean;
40
+ /** Fires when the listbox opens or closes. */
41
+ onOpenChange?: (open: boolean) => void;
42
+ /** Initial input text. */
43
+ defaultInputValue?: string;
44
+ }
45
+ /** Combobox root - renders no node of its own (state + context only). */
46
+ export declare function Combobox(props: ComboboxProps): React.ReactElement;
47
+ /** Props accepted by `<ComboboxInput>`. */
48
+ export interface ComboboxInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
49
+ /** React 19: ref is a regular prop. */
50
+ ref?: React.Ref<HTMLInputElement>;
51
+ }
52
+ /** The `role="combobox"` text input that drives filtering. */
53
+ export declare function ComboboxInput({ className, ...props }: ComboboxInputProps): React.ReactElement;
54
+ /** Props accepted by `<ComboboxContent>`. */
55
+ export interface ComboboxContentProps extends React.HTMLAttributes<HTMLDivElement> {
56
+ /** React 19: ref is a regular prop. */
57
+ ref?: React.Ref<HTMLDivElement>;
58
+ }
59
+ /** The floating `role="listbox"` surface, shown while filtering. */
60
+ export declare function ComboboxContent({ className, children, ...props }: ComboboxContentProps): React.ReactElement | null;
61
+ /** Props accepted by `<ComboboxItem>`. */
62
+ export interface ComboboxItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onSelect"> {
63
+ /** The value this option commits when chosen. */
64
+ value: string;
65
+ /** Text used for filtering and the input after selection. Defaults to plain child text, then value. */
66
+ textValue?: string;
67
+ /** Disable selection and dim the option. */
68
+ disabled?: boolean;
69
+ /** React 19: ref is a regular prop. */
70
+ ref?: React.Ref<HTMLDivElement>;
71
+ }
72
+ /** A selectable, filterable option. Hides itself when it doesn't match the query. */
73
+ export declare function ComboboxItem({ value, textValue, disabled, className, children, onClick, ref, ...props }: ComboboxItemProps): React.ReactElement | null;
74
+ //# sourceMappingURL=combobox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/ui/combobox.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,8EAA8E;AAC9E,MAAM,WAAW,aAAa;IAC5B,4DAA4D;IAC5D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,uEAAuE;IACvE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,4CAA4C;IAC5C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,8CAA8C;IAC9C,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,0BAA0B;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,yEAAyE;AACzE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,KAAK,CAAC,YAAY,CAIjE;AA6CD,2CAA2C;AAC3C,MAAM,WAAW,kBAAmB,SAAQ,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC;IACrF,uCAAuC;IACvC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;CACnC;AAED,8DAA8D;AAC9D,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,GAAG,KAAK,CAAC,YAAY,CAc7F;AAED,6CAA6C;AAC7C,MAAM,WAAW,oBAAqB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAChF,uCAAuC;IACvC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC;AAED,oEAAoE;AACpE,wBAAgB,eAAe,CAC7B,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,GACtD,KAAK,CAAC,YAAY,GAAG,IAAI,CAc3B;AAED,0CAA0C;AAC1C,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC/F,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,uGAAuG;IACvG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uCAAuC;IACvC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC;AAED,qFAAqF;AACrF,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,SAAS,EACT,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,OAAO,EACP,GAAG,EACH,GAAG,KAAK,EACT,EAAE,iBAAiB,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAwC/C"}
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Combobox - a text input that filters a dropdown `listbox` as you type, then
3
+ * commits a selection. The look is ours (theme tokens); the mechanics (query,
4
+ * filtering, `aria-activedescendant` keyboard nav, open/dismiss, portalling)
5
+ * come from the active adapter's `combobox` slot - the zero-dependency
6
+ * {@link builtinCombobox} by default, swappable to cmdk / Base UI / etc. via
7
+ * `UIAdapterProvider`.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * import { Combobox, ComboboxInput, ComboboxContent, ComboboxItem } from "veryfront/ui";
12
+ *
13
+ * <Combobox onValueChange={setFramework}>
14
+ * <ComboboxInput placeholder="Search framework…" />
15
+ * <ComboboxContent>
16
+ * <ComboboxItem value="next">Next.js</ComboboxItem>
17
+ * <ComboboxItem value="remix">Remix</ComboboxItem>
18
+ * <ComboboxItem value="astro">Astro</ComboboxItem>
19
+ * </ComboboxContent>
20
+ * </Combobox>;
21
+ * ```
22
+ *
23
+ * @module react/components/ui/combobox
24
+ */
25
+ import * as React from "react";
26
+ import { cx as cn } from "./cva.js";
27
+ import { useAdapter } from "./adapter/context.js";
28
+ /** Combobox root - renders no node of its own (state + context only). */
29
+ export function Combobox(props) {
30
+ const { combobox } = useAdapter();
31
+ const optionLabels = React.useMemo(() => collectOptionLabels(props.children), [props.children]);
32
+ return React.createElement(combobox.Root, { ...props, optionLabels: optionLabels });
33
+ }
34
+ function collectOptionLabels(children, labels = []) {
35
+ React.Children.forEach(children, (child) => {
36
+ if (!React.isValidElement(child))
37
+ return;
38
+ if (child.type === ComboboxItem) {
39
+ const { value, textValue, children: itemChildren } = child.props;
40
+ labels.push({ value, text: resolveOptionText(value, textValue, itemChildren) });
41
+ return;
42
+ }
43
+ const nestedChildren = child.props.children;
44
+ if (nestedChildren !== undefined)
45
+ collectOptionLabels(nestedChildren, labels);
46
+ });
47
+ return labels;
48
+ }
49
+ function resolveOptionText(value, textValue, children) {
50
+ return textValue ?? collectPlainText(children) ?? value;
51
+ }
52
+ function collectPlainText(children) {
53
+ let text = "";
54
+ let hasText = false;
55
+ React.Children.forEach(children, (child) => {
56
+ if (typeof child === "string" || typeof child === "number") {
57
+ text += String(child);
58
+ hasText = true;
59
+ return;
60
+ }
61
+ if (!React.isValidElement(child))
62
+ return;
63
+ const nested = collectPlainText(child.props.children);
64
+ if (nested === undefined)
65
+ return;
66
+ text += nested;
67
+ hasText = true;
68
+ });
69
+ return hasText ? text : undefined;
70
+ }
71
+ /** The `role="combobox"` text input that drives filtering. */
72
+ export function ComboboxInput({ className, ...props }) {
73
+ const { combobox } = useAdapter();
74
+ return (React.createElement(combobox.Input, { className: cn("h-[38px] w-full rounded-md px-3 text-base", "bg-[var(--input-bg)] text-[var(--foreground)] border border-[var(--outline-border)]", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--edge-medium)]", "disabled:cursor-not-allowed disabled:opacity-50", className), ...props }));
75
+ }
76
+ /** The floating `role="listbox"` surface, shown while filtering. */
77
+ export function ComboboxContent({ className, children, ...props }) {
78
+ const { combobox } = useAdapter();
79
+ return (React.createElement(combobox.Content, { className: cn("z-50 max-h-64 min-w-[220px] overflow-auto rounded-lg", "bg-[var(--popover)] text-[var(--foreground)] shadow-sm outline-none", className), ...props }, children));
80
+ }
81
+ /** A selectable, filterable option. Hides itself when it doesn't match the query. */
82
+ export function ComboboxItem({ value, textValue, disabled, className, children, onClick, ref, ...props }) {
83
+ const { combobox } = useAdapter();
84
+ const ctx = combobox.useCombobox();
85
+ const id = React.useId();
86
+ const text = resolveOptionText(value, textValue, children);
87
+ React.useEffect(() => {
88
+ ctx.registerOption(id, value, text, disabled);
89
+ return () => ctx.unregisterOption(id);
90
+ }, [ctx, disabled, id, value, text]);
91
+ if (!ctx.matches(text))
92
+ return null;
93
+ const active = ctx.activeId === id;
94
+ const selected = ctx.value === value;
95
+ return (React.createElement("div", { ref: ref, id: id, role: "option", "aria-selected": selected, "aria-disabled": disabled || undefined, "data-active": active ? "" : undefined, "data-disabled": disabled ? "" : undefined, onClick: (event) => {
96
+ onClick?.(event);
97
+ if (!event.defaultPrevented && !disabled)
98
+ ctx.select(value, text);
99
+ }, className: cn("flex cursor-pointer items-center rounded-md px-2.5 py-1.5 text-base", "data-[active]:bg-[var(--accent)] aria-selected:font-medium", "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props }, children ?? text));
100
+ }
@@ -0,0 +1,116 @@
1
+ /**
2
+ * ContextMenu - a menu opened by right-click (the native `contextmenu` event) at
3
+ * the pointer position, rather than by clicking a trigger button. It shares the
4
+ * exact item / surface look of {@link ./dropdown-menu.tsx DropdownMenu} (classes
5
+ * ported 1:1 from Studio, token names remapped to veryfront's `[var(--token)]`
6
+ * vocabulary) and reuses the shared {@link ./floating.tsx Floating} portal +
7
+ * fixed-positioning helper for dismissal (outside-click / `Escape`), scroll
8
+ * following, viewport clamping, and portalling into the `[data-vf-ui]` token
9
+ * scope. The only behavioural difference from DropdownMenu is the trigger: it
10
+ * captures `onContextMenu`, calls `preventDefault()`, and opens the surface at
11
+ * the pointer's `clientX` / `clientY` via a zero-size virtual anchor.
12
+ *
13
+ * A11y work (roving focus, typeahead, focus trap) is tracked in
14
+ * anchored-surface.tsx and shared with the other menu surfaces.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * <ContextMenu>
19
+ * <ContextMenuTrigger className="rounded-md border border-[var(--edge-medium)] p-8">
20
+ * Right-click here
21
+ * </ContextMenuTrigger>
22
+ * <ContextMenuContent>
23
+ * <ContextMenuLabel>Actions</ContextMenuLabel>
24
+ * <ContextMenuGroup>
25
+ * <ContextMenuItem onSelect={() => console.log("cut")}>Cut</ContextMenuItem>
26
+ * <ContextMenuItem onSelect={() => console.log("copy")}>Copy</ContextMenuItem>
27
+ * </ContextMenuGroup>
28
+ * <ContextMenuSeparator />
29
+ * <ContextMenuItem onSelect={() => console.log("delete")}>Delete</ContextMenuItem>
30
+ * </ContextMenuContent>
31
+ * </ContextMenu>
32
+ * ```
33
+ *
34
+ * @module react/components/ui/context-menu
35
+ */
36
+ import * as React from "react";
37
+ import { type PolymorphicButtonAttributes } from "./slot.js";
38
+ import { type DisclosureOptions } from "./disclosure.js";
39
+ /** Props accepted by `<ContextMenu>`. */
40
+ export interface ContextMenuProps extends DisclosureOptions {
41
+ /** The trigger and content parts to compose. */
42
+ children: React.ReactNode;
43
+ }
44
+ /**
45
+ * ContextMenu root - owns open state and the pointer position. Renders a
46
+ * zero-size, `position: fixed` virtual anchor (kept inside the token scope so
47
+ * the portalled surface resolves `var(--…)`), which `Floating` measures to place
48
+ * the surface at the last right-click.
49
+ */
50
+ export declare function ContextMenu({ children, open, defaultOpen, onOpenChange }: ContextMenuProps): React.ReactElement;
51
+ /** Props accepted by `<ContextMenuTrigger>`. */
52
+ export interface ContextMenuTriggerProps extends React.HTMLAttributes<HTMLDivElement> {
53
+ /** Merge the trigger behaviour onto your own element instead of a wrapper `div`. */
54
+ asChild?: boolean;
55
+ /** React 19: ref is a regular prop, forwarded to the trigger node. */
56
+ ref?: React.Ref<HTMLDivElement>;
57
+ }
58
+ /** Literal slotted trigger contract with an element-specific ref and events. */
59
+ export type ContextMenuSlottedTriggerProps<T extends HTMLElement = HTMLElement> = Omit<React.HTMLAttributes<T>, "children" | "ref"> & {
60
+ asChild: true;
61
+ children: React.ReactElement;
62
+ ref?: React.Ref<T>;
63
+ };
64
+ /**
65
+ * Trigger - the region a right-click opens the menu over. Captures
66
+ * `onContextMenu`, calls `preventDefault()` (suppressing the browser's native
67
+ * menu), and opens the surface at the pointer coordinates. `asChild` merges onto
68
+ * the child element, which must forward `ref` to its DOM node.
69
+ */
70
+ export declare function ContextMenuTrigger<T extends HTMLElement = HTMLElement>(props: ContextMenuSlottedTriggerProps<T>): React.ReactElement;
71
+ export declare function ContextMenuTrigger(props: ContextMenuTriggerProps): React.ReactElement;
72
+ /** Props accepted by `<ContextMenuContent>`. */
73
+ export interface ContextMenuContentProps extends React.HTMLAttributes<HTMLDivElement> {
74
+ /** Horizontal edge of the surface aligned to the pointer. @default "start" */
75
+ align?: "start" | "end";
76
+ /** Consumer ref for the surface node (forwarded through `Floating`). */
77
+ ref?: React.Ref<HTMLDivElement>;
78
+ }
79
+ /** Menu surface - portalled to the pointer position while open. No border (Studio). */
80
+ export declare function ContextMenuContent({ children, className, align, onKeyDown, ref, ...props }: ContextMenuContentProps): React.ReactElement | null;
81
+ /** Groups related items with a tight inner gap (Studio: `gap-px p-0.5`). */
82
+ export declare function ContextMenuGroup({ children, className }: {
83
+ children: React.ReactNode;
84
+ className?: string;
85
+ }): React.ReactElement;
86
+ /** Props accepted by `<ContextMenuItem>`. */
87
+ export interface ContextMenuItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
88
+ /** Called when the item is chosen (also closes the menu). */
89
+ onSelect?: () => void;
90
+ /** `asChild` merges item styling onto your own element. */
91
+ asChild?: boolean;
92
+ /** Consumer ref for the item node. */
93
+ ref?: React.Ref<HTMLButtonElement>;
94
+ }
95
+ /** Literal slotted item contract with element-specific refs and events. */
96
+ export type ContextMenuSlottedItemProps<T extends HTMLElement = HTMLElement> = Omit<PolymorphicButtonAttributes<T>, "children" | "ref" | "onSelect"> & {
97
+ /** Called when the item is chosen (also closes the menu). */
98
+ onSelect?: () => void;
99
+ asChild: true;
100
+ children: React.ReactElement;
101
+ disabled?: boolean;
102
+ ref?: React.Ref<T>;
103
+ };
104
+ /** A selectable menu item. Icons render at `size-3.5` (14px). Closes on select. */
105
+ export declare function ContextMenuItem<T extends HTMLElement = HTMLElement>(props: ContextMenuSlottedItemProps<T>): React.ReactElement;
106
+ export declare function ContextMenuItem(props: ContextMenuItemProps): React.ReactElement;
107
+ /** Full-width divider between groups (Studio: `-mx-2.5 my-2`). */
108
+ export declare function ContextMenuSeparator({ className }: {
109
+ className?: string;
110
+ }): React.ReactElement;
111
+ /** Non-interactive section label - full-strength foreground (Studio). */
112
+ export declare function ContextMenuLabel({ children, className, }: {
113
+ children: React.ReactNode;
114
+ className?: string;
115
+ }): React.ReactElement;
116
+ //# sourceMappingURL=context-menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/ui/context-menu.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAe,KAAK,2BAA2B,EAAQ,MAAM,WAAW,CAAC;AAIhF,OAAO,EAAE,KAAK,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AAkBxE,yCAAyC;AACzC,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,gDAAgD;IAChD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE,gBAAgB,GAC9D,KAAK,CAAC,YAAY,CA8BpB;AAED,gDAAgD;AAChD,MAAM,WAAW,uBAAwB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACnF,oFAAoF;IACpF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sEAAsE;IACtE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC;AAED,gFAAgF;AAChF,MAAM,MAAM,8BAA8B,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAC1E,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,UAAU,GAAG,KAAK,CAAC,GACjD;IACA,OAAO,EAAE,IAAI,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACpB,CAAC;AAEJ;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EACpE,KAAK,EAAE,8BAA8B,CAAC,CAAC,CAAC,GACvC,KAAK,CAAC,YAAY,CAAC;AACtB,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,KAAK,CAAC,YAAY,CAAC;AAkEvF,gDAAgD;AAChD,MAAM,WAAW,uBAAwB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACnF,8EAA8E;IAC9E,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACxB,wEAAwE;IACxE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC;AAED,uFAAuF;AACvF,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,SAAS,EACT,KAAe,EACf,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,uBAAuB,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CA6BrD;AAED,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAC9B,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GACzE,KAAK,CAAC,YAAY,CAMpB;AAED,6CAA6C;AAC7C,MAAM,WAAW,oBAAqB,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IACzF,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sCAAsC;IACtC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;CACpC;AAED,2EAA2E;AAC3E,MAAM,MAAM,2BAA2B,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IACvE,IAAI,CAAC,2BAA2B,CAAC,CAAC,CAAC,EAAE,UAAU,GAAG,KAAK,GAAG,UAAU,CAAC,GACrE;IACA,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,EAAE,IAAI,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACpB,CAAC;AAEJ,mFAAmF;AACnF,wBAAgB,eAAe,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EACjE,KAAK,EAAE,2BAA2B,CAAC,CAAC,CAAC,GACpC,KAAK,CAAC,YAAY,CAAC;AACtB,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,KAAK,CAAC,YAAY,CAAC;AAoEjF,kEAAkE;AAClE,wBAAgB,oBAAoB,CAClC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GACpC,KAAK,CAAC,YAAY,CAEpB;AAED,yEAAyE;AACzE,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,KAAK,CAAC,YAAY,CAWrB"}
@@ -0,0 +1,168 @@
1
+ /**
2
+ * ContextMenu - a menu opened by right-click (the native `contextmenu` event) at
3
+ * the pointer position, rather than by clicking a trigger button. It shares the
4
+ * exact item / surface look of {@link ./dropdown-menu.tsx DropdownMenu} (classes
5
+ * ported 1:1 from Studio, token names remapped to veryfront's `[var(--token)]`
6
+ * vocabulary) and reuses the shared {@link ./floating.tsx Floating} portal +
7
+ * fixed-positioning helper for dismissal (outside-click / `Escape`), scroll
8
+ * following, viewport clamping, and portalling into the `[data-vf-ui]` token
9
+ * scope. The only behavioural difference from DropdownMenu is the trigger: it
10
+ * captures `onContextMenu`, calls `preventDefault()`, and opens the surface at
11
+ * the pointer's `clientX` / `clientY` via a zero-size virtual anchor.
12
+ *
13
+ * A11y work (roving focus, typeahead, focus trap) is tracked in
14
+ * anchored-surface.tsx and shared with the other menu surfaces.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * <ContextMenu>
19
+ * <ContextMenuTrigger className="rounded-md border border-[var(--edge-medium)] p-8">
20
+ * Right-click here
21
+ * </ContextMenuTrigger>
22
+ * <ContextMenuContent>
23
+ * <ContextMenuLabel>Actions</ContextMenuLabel>
24
+ * <ContextMenuGroup>
25
+ * <ContextMenuItem onSelect={() => console.log("cut")}>Cut</ContextMenuItem>
26
+ * <ContextMenuItem onSelect={() => console.log("copy")}>Copy</ContextMenuItem>
27
+ * </ContextMenuGroup>
28
+ * <ContextMenuSeparator />
29
+ * <ContextMenuItem onSelect={() => console.log("delete")}>Delete</ContextMenuItem>
30
+ * </ContextMenuContent>
31
+ * </ContextMenu>
32
+ * ```
33
+ *
34
+ * @module react/components/ui/context-menu
35
+ */
36
+ import * as React from "react";
37
+ import { cx as cn } from "./cva.js";
38
+ import { composeRefs, Slot } from "./slot.js";
39
+ import { Floating } from "./floating.js";
40
+ import { focusWithoutScroll } from "./focus-management.js";
41
+ import { useMenuContentKeyboard } from "./menu-keyboard.js";
42
+ import { useDisclosure } from "./disclosure.js";
43
+ const ContextMenuContext = React.createContext(null);
44
+ /**
45
+ * ContextMenu root - owns open state and the pointer position. Renders a
46
+ * zero-size, `position: fixed` virtual anchor (kept inside the token scope so
47
+ * the portalled surface resolves `var(--…)`), which `Floating` measures to place
48
+ * the surface at the last right-click.
49
+ */
50
+ export function ContextMenu({ children, open, defaultOpen, onOpenChange }) {
51
+ const { open: isOpen, setOpen } = useDisclosure({ open, defaultOpen, onOpenChange });
52
+ const anchorRef = React.useRef(null);
53
+ const triggerRef = React.useRef(null);
54
+ const [pos, setPos] = React.useState({ x: 0, y: 0 });
55
+ const openAt = React.useCallback((x, y) => {
56
+ setPos({ x, y });
57
+ setOpen(true);
58
+ }, [setOpen]);
59
+ const ctx = React.useMemo(() => ({ open: isOpen, setOpen, anchorRef, triggerRef, openAt }), [isOpen, setOpen, openAt]);
60
+ return (React.createElement(ContextMenuContext.Provider, { value: ctx },
61
+ React.createElement("span", { ref: anchorRef, "aria-hidden": "true", style: {
62
+ position: "fixed",
63
+ left: pos.x,
64
+ top: pos.y,
65
+ width: 0,
66
+ height: 0,
67
+ pointerEvents: "none",
68
+ } }),
69
+ children));
70
+ }
71
+ export function ContextMenuTrigger({ asChild, onContextMenu, onKeyDown, children, ref, role, tabIndex, "aria-haspopup": ariaHasPopup, ...props }) {
72
+ const ctx = React.useContext(ContextMenuContext);
73
+ const triggerProps = asChild
74
+ ? { role, tabIndex, "aria-haspopup": ariaHasPopup }
75
+ : { role: role ?? "button", tabIndex: tabIndex ?? 0, "aria-haspopup": ariaHasPopup ?? "menu" };
76
+ const setTriggerRef = React.useCallback((element) => {
77
+ if (ctx)
78
+ ctx.triggerRef.current = element;
79
+ }, [ctx]);
80
+ const composedRef = React.useMemo(() => composeRefs(setTriggerRef, ref), [ref, setTriggerRef]);
81
+ const stateProps = {
82
+ "data-state": ctx?.open ? "open" : "closed",
83
+ onContextMenu: (event) => {
84
+ onContextMenu?.(event);
85
+ if (event.defaultPrevented)
86
+ return;
87
+ event.preventDefault();
88
+ ctx?.openAt(event.clientX, event.clientY);
89
+ },
90
+ onKeyDown: (event) => {
91
+ onKeyDown?.(event);
92
+ if (event.defaultPrevented || !ctx)
93
+ return;
94
+ if (event.key !== "ContextMenu" && !(event.key === "F10" && event.shiftKey))
95
+ return;
96
+ event.preventDefault();
97
+ const rect = event.currentTarget.getBoundingClientRect();
98
+ ctx.openAt(rect.left, rect.bottom);
99
+ },
100
+ };
101
+ if (asChild) {
102
+ return (React.createElement(Slot, { ref: composedRef, ...triggerProps, ...stateProps, ...props }, children));
103
+ }
104
+ return (React.createElement("div", { ref: composedRef, ...triggerProps, ...stateProps, ...props }, children));
105
+ }
106
+ /** Menu surface - portalled to the pointer position while open. No border (Studio). */
107
+ export function ContextMenuContent({ children, className, align = "start", onKeyDown, ref, ...props }) {
108
+ const ctx = React.useContext(ContextMenuContext);
109
+ if (!ctx)
110
+ return null;
111
+ const handleKeyDown = useMenuContentKeyboard({
112
+ onKeyDown,
113
+ setOpen: ctx.setOpen,
114
+ triggerRef: ctx.triggerRef,
115
+ });
116
+ return (React.createElement(Floating, { anchorRef: ctx.anchorRef, open: ctx.open, align: align, onDismiss: () => ctx.setOpen(false), initialFocus: "[role='menuitem']:not([aria-disabled='true'])", returnFocusRef: ctx.triggerRef, contentRef: ref, role: "menu", "aria-orientation": "vertical", onKeyDown: handleKeyDown, className: cn("z-50 min-w-[260px] overflow-hidden rounded-lg bg-[var(--popover)] p-2.5 text-[var(--foreground)] shadow-sm outline-none", className), ...props }, children));
117
+ }
118
+ /** Groups related items with a tight inner gap (Studio: `gap-px p-0.5`). */
119
+ export function ContextMenuGroup({ children, className }) {
120
+ return (React.createElement("div", { role: "group", className: cn("flex flex-col gap-px p-0.5", className) }, children));
121
+ }
122
+ export function ContextMenuItem({ children, className, onSelect, onClick, onKeyDown, disabled, asChild, ref, ...props }) {
123
+ const ctx = React.useContext(ContextMenuContext);
124
+ const closeAndRestoreFocus = React.useCallback(() => {
125
+ ctx?.setOpen(false);
126
+ const trigger = ctx?.triggerRef.current;
127
+ queueMicrotask(() => {
128
+ if (trigger?.isConnected)
129
+ focusWithoutScroll(trigger);
130
+ });
131
+ }, [ctx]);
132
+ const itemProps = {
133
+ role: "menuitem",
134
+ "aria-disabled": disabled || undefined,
135
+ disabled,
136
+ className: cn("relative flex w-full cursor-pointer select-none items-center gap-2.5 rounded-md px-3 h-[36px] text-base font-normal text-left text-[var(--foreground)] outline-none transition-colors", "hover:bg-[var(--tertiary)] focus:bg-[var(--tertiary)] dark:hover:bg-[var(--accent)] dark:focus:bg-[var(--accent)]", "disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-3.5 [&_svg]:shrink-0", className),
137
+ onClick: (event) => {
138
+ if (disabled)
139
+ return;
140
+ onClick?.(event);
141
+ if (event.defaultPrevented)
142
+ return;
143
+ onSelect?.();
144
+ closeAndRestoreFocus();
145
+ },
146
+ onKeyDown: (event) => {
147
+ onKeyDown?.(event);
148
+ if (event.defaultPrevented)
149
+ return;
150
+ if (disabled || (event.key !== "Enter" && event.key !== " "))
151
+ return;
152
+ event.preventDefault();
153
+ event.currentTarget.click();
154
+ },
155
+ };
156
+ if (asChild) {
157
+ return (React.createElement(Slot, { ref: ref, ...itemProps, ...props }, children));
158
+ }
159
+ return (React.createElement("button", { type: "button", ref: ref, ...itemProps, ...props }, children));
160
+ }
161
+ /** Full-width divider between groups (Studio: `-mx-2.5 my-2`). */
162
+ export function ContextMenuSeparator({ className }) {
163
+ return React.createElement("div", { className: cn("-mx-2.5 my-2 h-px bg-[var(--separator)]", className) });
164
+ }
165
+ /** Non-interactive section label - full-strength foreground (Studio). */
166
+ export function ContextMenuLabel({ children, className, }) {
167
+ return (React.createElement("div", { className: cn("px-3 py-1.5 mb-0.5 text-sm font-medium text-[var(--foreground)]", className) }, children));
168
+ }