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.
- package/esm/cli/auth/login.d.ts +24 -2
- package/esm/cli/auth/login.d.ts.map +1 -1
- package/esm/cli/auth/login.js +444 -35
- package/esm/cli/commands/build/error-handler.d.ts.map +1 -1
- package/esm/cli/commands/build/error-handler.js +41 -3
- package/esm/cli/commands/build/handler.d.ts.map +1 -1
- package/esm/cli/commands/build/handler.js +1 -1
- package/esm/cli/commands/dev/command.d.ts.map +1 -1
- package/esm/cli/commands/dev/command.js +14 -1
- package/esm/cli/commands/dev/inference-status.d.ts +6 -0
- package/esm/cli/commands/dev/inference-status.d.ts.map +1 -1
- package/esm/cli/commands/dev/inference-status.js +14 -2
- package/esm/cli/commands/generate/command.d.ts.map +1 -1
- package/esm/cli/commands/generate/command.js +61 -0
- package/esm/cli/commands/init/init-command.d.ts.map +1 -1
- package/esm/cli/commands/init/init-command.js +23 -31
- package/esm/cli/commands/install/registry.d.ts.map +1 -1
- package/esm/cli/commands/install/registry.js +6 -9
- package/esm/cli/commands/login/command-help.d.ts.map +1 -1
- package/esm/cli/commands/login/command-help.js +3 -1
- package/esm/cli/commands/pull/command.d.ts +1 -0
- package/esm/cli/commands/pull/command.d.ts.map +1 -1
- package/esm/cli/commands/pull/command.js +49 -6
- package/esm/cli/commands/push/command-help.d.ts.map +1 -1
- package/esm/cli/commands/push/command-help.js +7 -0
- package/esm/cli/commands/push/command.d.ts +23 -12
- package/esm/cli/commands/push/command.d.ts.map +1 -1
- package/esm/cli/commands/push/command.js +461 -44
- package/esm/cli/commands/push/plan.d.ts +35 -0
- package/esm/cli/commands/push/plan.d.ts.map +1 -0
- package/esm/cli/commands/push/plan.js +96 -0
- package/esm/cli/commands/schedule/handler.d.ts +21 -2
- package/esm/cli/commands/schedule/handler.d.ts.map +1 -1
- package/esm/cli/commands/schedule/handler.js +74 -27
- package/esm/cli/commands/schema/command-help.js +1 -1
- package/esm/cli/commands/up/command.js +1 -1
- package/esm/cli/commands/webhook/handler.d.ts.map +1 -1
- package/esm/cli/commands/webhook/handler.js +3 -1
- package/esm/cli/router.d.ts.map +1 -1
- package/esm/cli/router.js +27 -5
- package/esm/cli/shared/args.d.ts +15 -1
- package/esm/cli/shared/args.d.ts.map +1 -1
- package/esm/cli/shared/args.js +56 -3
- package/esm/cli/shared/config.d.ts +11 -2
- package/esm/cli/shared/config.d.ts.map +1 -1
- package/esm/cli/shared/config.js +72 -27
- package/esm/cli/shared/project-creation.js +1 -1
- package/esm/cli/sync/state.d.ts +20 -0
- package/esm/cli/sync/state.d.ts.map +1 -0
- package/esm/cli/sync/state.js +193 -0
- package/esm/deno.js +2 -2
- package/esm/extensions/ext-llm-anthropic/src/anthropic-request-builder.d.ts.map +1 -1
- package/esm/extensions/ext-llm-anthropic/src/anthropic-request-builder.js +852 -21
- package/esm/extensions/ext-observability-sentry/src/policy.d.ts +2 -0
- package/esm/extensions/ext-observability-sentry/src/policy.d.ts.map +1 -1
- package/esm/extensions/ext-observability-sentry/src/policy.js +214 -3
- package/esm/src/agent/conversation/delegation-policy.d.ts +2 -0
- package/esm/src/agent/conversation/delegation-policy.d.ts.map +1 -1
- package/esm/src/agent/conversation/delegation-policy.js +13 -3
- package/esm/src/agent/conversation/hosted-terminal.d.ts.map +1 -1
- package/esm/src/agent/conversation/hosted-terminal.js +6 -2
- package/esm/src/agent/conversation/run-chunk-mirror.d.ts.map +1 -1
- package/esm/src/agent/conversation/run-chunk-mirror.js +14 -2
- package/esm/src/agent/factory.d.ts.map +1 -1
- package/esm/src/agent/factory.js +22 -11
- package/esm/src/agent/hosted/chat-runtime-tool-assembly.d.ts +2 -0
- package/esm/src/agent/hosted/chat-runtime-tool-assembly.d.ts.map +1 -1
- package/esm/src/agent/hosted/chat-runtime-tool-assembly.js +6 -1
- package/esm/src/agent/hosted/child-fork-execution-runner.d.ts +2 -1
- package/esm/src/agent/hosted/child-fork-execution-runner.d.ts.map +1 -1
- package/esm/src/agent/hosted/child-fork-execution-runner.js +6 -3
- package/esm/src/agent/hosted/child-fork-step-message-preparation.d.ts +12 -3
- package/esm/src/agent/hosted/child-fork-step-message-preparation.d.ts.map +1 -1
- package/esm/src/agent/hosted/child-fork-step-message-preparation.js +16 -3
- package/esm/src/agent/hosted/cloud-agent-chat-execution.d.ts +1 -1
- package/esm/src/agent/hosted/cloud-agent-chat-execution.d.ts.map +1 -1
- package/esm/src/agent/hosted/cloud-agent-chat-execution.js +3 -3
- package/esm/src/agent/hosted/cloud-agent-child-tools.d.ts +11 -0
- package/esm/src/agent/hosted/cloud-agent-child-tools.d.ts.map +1 -1
- package/esm/src/agent/hosted/cloud-agent-child-tools.js +2 -3
- package/esm/src/agent/hosted/cloud-agent-config.d.ts +1 -0
- package/esm/src/agent/hosted/cloud-agent-config.d.ts.map +1 -1
- package/esm/src/agent/hosted/cloud-runtime-system-messages.d.ts +16 -1
- package/esm/src/agent/hosted/cloud-runtime-system-messages.d.ts.map +1 -1
- package/esm/src/agent/hosted/cloud-runtime-system-messages.js +13 -3
- package/esm/src/agent/hosted/default-chat-runtime.d.ts +2 -1
- package/esm/src/agent/hosted/default-chat-runtime.d.ts.map +1 -1
- package/esm/src/agent/hosted/default-chat-runtime.js +18 -7
- package/esm/src/agent/hosted/default-invoke-agent-tool.d.ts +2 -1
- package/esm/src/agent/hosted/default-invoke-agent-tool.d.ts.map +1 -1
- package/esm/src/agent/hosted/default-invoke-agent-tool.js +11 -3
- package/esm/src/agent/hosted/default-project-steering-refresh.d.ts +2 -1
- package/esm/src/agent/hosted/default-project-steering-refresh.d.ts.map +1 -1
- package/esm/src/agent/hosted/default-project-steering-refresh.js +4 -1
- package/esm/src/agent/hosted/runtime-state-resolver.d.ts +6 -4
- package/esm/src/agent/hosted/runtime-state-resolver.d.ts.map +1 -1
- package/esm/src/agent/hosted/runtime-state-resolver.js +8 -11
- package/esm/src/agent/index.d.ts +3 -3
- package/esm/src/agent/index.d.ts.map +1 -1
- package/esm/src/agent/project/agent-runtime.d.ts.map +1 -1
- package/esm/src/agent/project/agent-runtime.js +6 -3
- package/esm/src/agent/runtime/agent-definition.d.ts +68 -66
- package/esm/src/agent/runtime/agent-definition.d.ts.map +1 -1
- package/esm/src/agent/runtime/agent-definition.js +15 -2
- package/esm/src/agent/runtime/agent-invocation-contract.d.ts +2 -0
- package/esm/src/agent/runtime/agent-invocation-contract.d.ts.map +1 -1
- package/esm/src/agent/runtime/agent-markdown-adapter.js +1 -1
- package/esm/src/agent/runtime/agent-runtime-step.d.ts +11 -5
- package/esm/src/agent/runtime/agent-runtime-step.d.ts.map +1 -1
- package/esm/src/agent/runtime/agent-runtime-step.js +23 -6
- package/esm/src/agent/runtime/call-context.d.ts +42 -11
- package/esm/src/agent/runtime/call-context.d.ts.map +1 -1
- package/esm/src/agent/runtime/call-context.js +480 -42
- package/esm/src/agent/runtime/chat-stream-handler.d.ts +18 -0
- package/esm/src/agent/runtime/chat-stream-handler.d.ts.map +1 -1
- package/esm/src/agent/runtime/chat-stream-handler.js +38 -18
- package/esm/src/agent/runtime/effective-agent-system.d.ts +13 -4
- package/esm/src/agent/runtime/effective-agent-system.d.ts.map +1 -1
- package/esm/src/agent/runtime/effective-agent-system.js +29 -0
- package/esm/src/agent/runtime/index.d.ts +1 -0
- package/esm/src/agent/runtime/index.d.ts.map +1 -1
- package/esm/src/agent/runtime/index.js +638 -53
- package/esm/src/agent/runtime/load-skill-tool.d.ts +33 -3
- package/esm/src/agent/runtime/load-skill-tool.d.ts.map +1 -1
- package/esm/src/agent/runtime/load-skill-tool.js +152 -21
- package/esm/src/agent/runtime/model-resolution.d.ts +3 -0
- package/esm/src/agent/runtime/model-resolution.d.ts.map +1 -1
- package/esm/src/agent/runtime/model-resolution.js +14 -0
- package/esm/src/agent/runtime/model-transport.d.ts +1 -0
- package/esm/src/agent/runtime/model-transport.d.ts.map +1 -1
- package/esm/src/agent/runtime/model-transport.js +5 -2
- package/esm/src/agent/runtime/run-runtime-context.d.ts +4 -0
- package/esm/src/agent/runtime/run-runtime-context.d.ts.map +1 -1
- package/esm/src/agent/runtime/run-runtime-context.js +9 -3
- package/esm/src/agent/runtime/runtime-tool-config.d.ts +1 -0
- package/esm/src/agent/runtime/runtime-tool-config.d.ts.map +1 -1
- package/esm/src/agent/runtime/skill-prompt.d.ts +3 -0
- package/esm/src/agent/runtime/skill-prompt.d.ts.map +1 -1
- package/esm/src/agent/runtime/skill-prompt.js +113 -25
- package/esm/src/agent/runtime/streamed-assistant-message.d.ts +22 -2
- package/esm/src/agent/runtime/streamed-assistant-message.d.ts.map +1 -1
- package/esm/src/agent/runtime/streamed-assistant-message.js +26 -5
- package/esm/src/agent/runtime/tool-inventory.d.ts.map +1 -1
- package/esm/src/agent/runtime/tool-inventory.js +13 -9
- package/esm/src/agent/runtime/tool-result-continuation.d.ts +4 -2
- package/esm/src/agent/runtime/tool-result-continuation.d.ts.map +1 -1
- package/esm/src/agent/runtime/tool-result-continuation.js +24 -20
- package/esm/src/agent/schemas/agent.schema.d.ts +2 -2
- package/esm/src/agent/service/runtime.js +1 -1
- package/esm/src/agent/streaming/fork-runtime-stream.d.ts +5 -4
- package/esm/src/agent/streaming/fork-runtime-stream.d.ts.map +1 -1
- package/esm/src/agent/types.d.ts +14 -1
- package/esm/src/agent/types.d.ts.map +1 -1
- package/esm/src/chat/chat-ui-message-helpers.d.ts.map +1 -1
- package/esm/src/chat/chat-ui-message-helpers.js +75 -16
- package/esm/src/config/loader.d.ts.map +1 -1
- package/esm/src/config/loader.js +37 -1
- package/esm/src/errors/catalog/build-errors.d.ts.map +1 -1
- package/esm/src/errors/catalog/build-errors.js +14 -0
- package/esm/src/errors/error-registry/build.d.ts +2 -0
- package/esm/src/errors/error-registry/build.d.ts.map +1 -1
- package/esm/src/errors/error-registry/build.js +8 -0
- package/esm/src/errors/error-registry/deploy.d.ts +4 -0
- package/esm/src/errors/error-registry/deploy.d.ts.map +1 -1
- package/esm/src/errors/error-registry/deploy.js +16 -0
- package/esm/src/errors/error-registry.d.ts +3 -0
- package/esm/src/errors/error-registry.d.ts.map +1 -1
- package/esm/src/errors/index.d.ts +2 -1
- package/esm/src/errors/index.d.ts.map +1 -1
- package/esm/src/errors/index.js +4 -3
- package/esm/src/errors/tenant-classification.d.ts +25 -0
- package/esm/src/errors/tenant-classification.d.ts.map +1 -0
- package/esm/src/errors/tenant-classification.js +61 -0
- package/esm/src/extensions/builtin-extensions.d.ts +10 -15
- package/esm/src/extensions/builtin-extensions.d.ts.map +1 -1
- package/esm/src/extensions/builtin-extensions.js +32 -26
- package/esm/src/extensions/deferred-extension.d.ts +4 -4
- package/esm/src/extensions/deferred-extension.js +4 -4
- package/esm/src/extensions/index.d.ts +1 -0
- package/esm/src/extensions/index.d.ts.map +1 -1
- package/esm/src/extensions/index.js +1 -0
- package/esm/src/html/hydration-script-builder/hydration-runtime.generated.js +1 -1
- package/esm/src/integrations/_data.d.ts.map +1 -1
- package/esm/src/integrations/_data.js +6 -0
- package/esm/src/integrations/schema.d.ts +8 -0
- package/esm/src/integrations/schema.d.ts.map +1 -1
- package/esm/src/integrations/schema.js +3 -0
- package/esm/src/integrations/types.d.ts +2 -0
- package/esm/src/integrations/types.d.ts.map +1 -1
- package/esm/src/internal-agents/run-stream.d.ts.map +1 -1
- package/esm/src/internal-agents/run-stream.js +35 -20
- package/esm/src/internal-agents/run-system-prompt.d.ts +7 -2
- package/esm/src/internal-agents/run-system-prompt.d.ts.map +1 -1
- package/esm/src/internal-agents/run-system-prompt.js +19 -13
- package/esm/src/internal-agents/schema.d.ts +2 -0
- package/esm/src/internal-agents/schema.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/loader.js +2 -18
- package/esm/src/modules/react-loader/ssr-module-loader/ssr-dependency-validator.d.ts +11 -0
- package/esm/src/modules/react-loader/ssr-module-loader/ssr-dependency-validator.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/ssr-dependency-validator.js +53 -6
- package/esm/src/observability/application-error-contract.d.ts +4 -0
- package/esm/src/observability/application-error-contract.d.ts.map +1 -1
- package/esm/src/observability/application-errors.d.ts.map +1 -1
- package/esm/src/observability/application-errors.js +64 -3
- package/esm/src/platform/adapters/runtime/deno/http-server.d.ts.map +1 -1
- package/esm/src/platform/adapters/runtime/deno/http-server.js +2 -10
- package/esm/src/platform/adapters/runtime/shared/request-peer.d.ts +14 -0
- package/esm/src/platform/adapters/runtime/shared/request-peer.d.ts.map +1 -1
- package/esm/src/platform/adapters/runtime/shared/request-peer.js +82 -0
- package/esm/src/platform/compat/http/pinned-fetch.d.ts +1 -1
- package/esm/src/provider/runtime-loader/provider-http.d.ts +5 -1
- package/esm/src/provider/runtime-loader/provider-http.d.ts.map +1 -1
- package/esm/src/provider/runtime-loader/provider-http.js +55 -17
- package/esm/src/provider/shared/index.d.ts +1 -0
- package/esm/src/provider/shared/index.d.ts.map +1 -1
- package/esm/src/provider/shared/index.js +2 -0
- package/esm/src/provider/types.d.ts +1 -0
- package/esm/src/provider/types.d.ts.map +1 -1
- package/esm/src/react/components/ui/adapter/builtin/combobox.d.ts +3 -0
- package/esm/src/react/components/ui/adapter/builtin/combobox.d.ts.map +1 -0
- package/esm/src/react/components/ui/adapter/builtin/combobox.js +204 -0
- package/esm/src/react/components/ui/adapter/builtin/dialog.d.ts +3 -0
- package/esm/src/react/components/ui/adapter/builtin/dialog.d.ts.map +1 -0
- package/esm/src/react/components/ui/adapter/builtin/dialog.js +20 -0
- package/esm/src/react/components/ui/adapter/builtin/drawer.d.ts +3 -0
- package/esm/src/react/components/ui/adapter/builtin/drawer.d.ts.map +1 -0
- package/esm/src/react/components/ui/adapter/builtin/drawer.js +21 -0
- package/esm/src/react/components/ui/adapter/builtin/index.d.ts.map +1 -1
- package/esm/src/react/components/ui/adapter/builtin/index.js +10 -0
- package/esm/src/react/components/ui/adapter/builtin/popover.d.ts +3 -0
- package/esm/src/react/components/ui/adapter/builtin/popover.d.ts.map +1 -0
- package/esm/src/react/components/ui/adapter/builtin/popover.js +28 -0
- package/esm/src/react/components/ui/adapter/builtin/tabs.d.ts +3 -0
- package/esm/src/react/components/ui/adapter/builtin/tabs.d.ts.map +1 -0
- package/esm/src/react/components/ui/adapter/builtin/tabs.js +73 -0
- package/esm/src/react/components/ui/adapter/context.d.ts.map +1 -1
- package/esm/src/react/components/ui/adapter/context.js +10 -0
- package/esm/src/react/components/ui/adapter/contract.d.ts +212 -0
- package/esm/src/react/components/ui/adapter/contract.d.ts.map +1 -1
- package/esm/src/react/components/ui/adapter/token-scope.d.ts +24 -0
- package/esm/src/react/components/ui/adapter/token-scope.d.ts.map +1 -0
- package/esm/src/react/components/ui/adapter/token-scope.js +26 -0
- package/esm/src/react/components/ui/alert-dialog.d.ts +101 -0
- package/esm/src/react/components/ui/alert-dialog.d.ts.map +1 -0
- package/esm/src/react/components/ui/alert-dialog.js +181 -0
- package/esm/src/react/components/ui/aspect-ratio.d.ts +18 -0
- package/esm/src/react/components/ui/aspect-ratio.d.ts.map +1 -0
- package/esm/src/react/components/ui/aspect-ratio.js +13 -0
- package/esm/src/react/components/ui/autocomplete.d.ts +67 -0
- package/esm/src/react/components/ui/autocomplete.d.ts.map +1 -0
- package/esm/src/react/components/ui/autocomplete.js +59 -0
- package/esm/src/react/components/ui/breadcrumb.d.ts +86 -0
- package/esm/src/react/components/ui/breadcrumb.d.ts.map +1 -0
- package/esm/src/react/components/ui/breadcrumb.js +67 -0
- package/esm/src/react/components/ui/calendar.d.ts +40 -0
- package/esm/src/react/components/ui/calendar.d.ts.map +1 -0
- package/esm/src/react/components/ui/calendar.js +170 -0
- package/esm/src/react/components/ui/combobox.d.ts +74 -0
- package/esm/src/react/components/ui/combobox.d.ts.map +1 -0
- package/esm/src/react/components/ui/combobox.js +100 -0
- package/esm/src/react/components/ui/context-menu.d.ts +116 -0
- package/esm/src/react/components/ui/context-menu.d.ts.map +1 -0
- package/esm/src/react/components/ui/context-menu.js +168 -0
- package/esm/src/react/components/ui/date-picker.d.ts +69 -0
- package/esm/src/react/components/ui/date-picker.d.ts.map +1 -0
- package/esm/src/react/components/ui/date-picker.js +96 -0
- package/esm/src/react/components/ui/dialog.d.ts +41 -11
- package/esm/src/react/components/ui/dialog.d.ts.map +1 -1
- package/esm/src/react/components/ui/dialog.js +47 -28
- package/esm/src/react/components/ui/drawer.d.ts +31 -8
- package/esm/src/react/components/ui/drawer.d.ts.map +1 -1
- package/esm/src/react/components/ui/drawer.js +33 -22
- package/esm/src/react/components/ui/dropdown-menu.d.ts.map +1 -1
- package/esm/src/react/components/ui/dropdown-menu.js +7 -75
- package/esm/src/react/components/ui/field.d.ts +70 -0
- package/esm/src/react/components/ui/field.d.ts.map +1 -0
- package/esm/src/react/components/ui/field.js +161 -0
- package/esm/src/react/components/ui/file-type.d.ts +9 -8
- package/esm/src/react/components/ui/file-type.d.ts.map +1 -1
- package/esm/src/react/components/ui/file-type.js +8 -8
- package/esm/src/react/components/ui/hover-card.d.ts +82 -0
- package/esm/src/react/components/ui/hover-card.d.ts.map +1 -0
- package/esm/src/react/components/ui/hover-card.js +140 -0
- package/esm/src/react/components/ui/index.d.ts +23 -2
- package/esm/src/react/components/ui/index.d.ts.map +1 -1
- package/esm/src/react/components/ui/index.js +21 -0
- package/esm/src/react/components/ui/input-otp.d.ts +37 -0
- package/esm/src/react/components/ui/input-otp.d.ts.map +1 -0
- package/esm/src/react/components/ui/input-otp.js +42 -0
- package/esm/src/react/components/ui/menu-keyboard.d.ts +8 -0
- package/esm/src/react/components/ui/menu-keyboard.d.ts.map +1 -0
- package/esm/src/react/components/ui/menu-keyboard.js +76 -0
- package/esm/src/react/components/ui/menubar.d.ts +98 -0
- package/esm/src/react/components/ui/menubar.d.ts.map +1 -0
- package/esm/src/react/components/ui/menubar.js +173 -0
- package/esm/src/react/components/ui/meter.d.ts +45 -0
- package/esm/src/react/components/ui/meter.d.ts.map +1 -0
- package/esm/src/react/components/ui/meter.js +59 -0
- package/esm/src/react/components/ui/modal-surface.d.ts +7 -1
- package/esm/src/react/components/ui/modal-surface.d.ts.map +1 -1
- package/esm/src/react/components/ui/modal-surface.js +23 -6
- package/esm/src/react/components/ui/navigation-menu.d.ts +101 -0
- package/esm/src/react/components/ui/navigation-menu.d.ts.map +1 -0
- package/esm/src/react/components/ui/navigation-menu.js +195 -0
- package/esm/src/react/components/ui/number-field.d.ts +46 -0
- package/esm/src/react/components/ui/number-field.d.ts.map +1 -0
- package/esm/src/react/components/ui/number-field.js +121 -0
- package/esm/src/react/components/ui/pagination.d.ts +77 -0
- package/esm/src/react/components/ui/pagination.d.ts.map +1 -0
- package/esm/src/react/components/ui/pagination.js +62 -0
- package/esm/src/react/components/ui/popover.d.ts +42 -13
- package/esm/src/react/components/ui/popover.d.ts.map +1 -1
- package/esm/src/react/components/ui/popover.js +25 -12
- package/esm/src/react/components/ui/scroll-area.d.ts +38 -0
- package/esm/src/react/components/ui/scroll-area.d.ts.map +1 -0
- package/esm/src/react/components/ui/scroll-area.js +35 -0
- package/esm/src/react/components/ui/separator.d.ts +20 -0
- package/esm/src/react/components/ui/separator.d.ts.map +1 -0
- package/esm/src/react/components/ui/separator.js +13 -0
- package/esm/src/react/components/ui/slider.d.ts +44 -0
- package/esm/src/react/components/ui/slider.d.ts.map +1 -0
- package/esm/src/react/components/ui/slider.js +46 -0
- package/esm/src/react/components/ui/status.d.ts +6 -5
- package/esm/src/react/components/ui/status.d.ts.map +1 -1
- package/esm/src/react/components/ui/status.js +4 -4
- package/esm/src/react/components/ui/tabs.d.ts +32 -9
- package/esm/src/react/components/ui/tabs.d.ts.map +1 -1
- package/esm/src/react/components/ui/tabs.js +46 -22
- package/esm/src/react/components/ui/toggle.d.ts +26 -0
- package/esm/src/react/components/ui/toggle.d.ts.map +1 -0
- package/esm/src/react/components/ui/toggle.js +29 -0
- package/esm/src/react/components/ui/use-isomorphic-layout-effect.d.ts +2 -1
- package/esm/src/react/components/ui/use-isomorphic-layout-effect.d.ts.map +1 -1
- package/esm/src/react/components/ui/use-isomorphic-layout-effect.js +6 -3
- package/esm/src/rendering/chunk-optimizer/source-imports.d.ts.map +1 -1
- package/esm/src/rendering/chunk-optimizer/source-imports.js +4 -114
- package/esm/src/rendering/orchestrator/css-candidate-manifest.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/css-candidate-manifest.js +30 -1
- package/esm/src/rendering/orchestrator/module-loader/build-failure.d.ts +10 -0
- package/esm/src/rendering/orchestrator/module-loader/build-failure.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/build-failure.js +50 -3
- package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.d.ts +2 -0
- package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.js +21 -6
- package/esm/src/rendering/orchestrator/module-loader/index.d.ts +2 -1
- package/esm/src/rendering/orchestrator/module-loader/index.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/index.js +190 -7
- package/esm/src/rendering/orchestrator/module-loader/module-persistence.d.ts +4 -0
- package/esm/src/rendering/orchestrator/module-loader/module-persistence.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/module-persistence.js +374 -7
- package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/pipeline.js +12 -1
- package/esm/src/runs/runs-client.d.ts +2 -4
- package/esm/src/runs/runs-client.d.ts.map +1 -1
- package/esm/src/runs/schemas.d.ts +18 -8
- package/esm/src/runs/schemas.d.ts.map +1 -1
- package/esm/src/runs/schemas.js +26 -0
- package/esm/src/runtime/model-call-context.d.ts +6 -1
- package/esm/src/runtime/model-call-context.d.ts.map +1 -1
- package/esm/src/runtime/runtime-bridge.d.ts.map +1 -1
- package/esm/src/runtime/runtime-bridge.js +133 -15
- package/esm/src/schedule/factory.d.ts +8 -2
- package/esm/src/schedule/factory.d.ts.map +1 -1
- package/esm/src/schedule/factory.js +0 -8
- package/esm/src/schedule/index.d.ts +10 -1
- package/esm/src/schedule/index.d.ts.map +1 -1
- package/esm/src/schedule/index.js +9 -0
- package/esm/src/schedule/types.d.ts +30 -11
- package/esm/src/schedule/types.d.ts.map +1 -1
- package/esm/src/schedule/validation.d.ts +17 -0
- package/esm/src/schedule/validation.d.ts.map +1 -1
- package/esm/src/schedule/validation.js +93 -5
- package/esm/src/security/sandbox/worker-pool.d.ts.map +1 -1
- package/esm/src/security/sandbox/worker-pool.js +6 -1
- package/esm/src/server/bootstrap.d.ts.map +1 -1
- package/esm/src/server/bootstrap.js +6 -0
- package/esm/src/server/dev-server/index.d.ts +1 -1
- package/esm/src/server/dev-server/index.d.ts.map +1 -1
- package/esm/src/server/dev-server/server.d.ts +7 -3
- package/esm/src/server/dev-server/server.d.ts.map +1 -1
- package/esm/src/server/dev-server/server.js +12 -3
- package/esm/src/server/dev-server/types.d.ts +7 -1
- package/esm/src/server/dev-server/types.d.ts.map +1 -1
- package/esm/src/server/dev-server.d.ts +1 -1
- package/esm/src/server/dev-server.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.js +2509 -34
- package/esm/src/server/handlers/dev/projects/index.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/projects/index.js +3 -0
- package/esm/src/server/handlers/request/agent-stream.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/agent-stream.handler.js +29 -24
- package/esm/src/server/index.d.ts +3 -3
- package/esm/src/server/index.d.ts.map +1 -1
- package/esm/src/server/index.js +10 -5
- package/esm/src/server/node-handler.d.ts.map +1 -1
- package/esm/src/server/node-handler.js +4 -1
- package/esm/src/server/production-server.d.ts.map +1 -1
- package/esm/src/server/production-server.js +2 -1
- package/esm/src/server/project-env/cache.d.ts +17 -0
- package/esm/src/server/project-env/cache.d.ts.map +1 -1
- package/esm/src/server/project-env/cache.js +78 -2
- package/esm/src/server/project-env/fetcher.d.ts.map +1 -1
- package/esm/src/server/project-env/fetcher.js +24 -14
- package/esm/src/server/project-env/index.d.ts +1 -1
- package/esm/src/server/project-env/index.d.ts.map +1 -1
- package/esm/src/server/project-env/index.js +1 -1
- package/esm/src/server/project-env/internal-authorization.d.ts +7 -0
- package/esm/src/server/project-env/internal-authorization.d.ts.map +1 -0
- package/esm/src/server/project-env/internal-authorization.js +32 -0
- package/esm/src/server/runtime-handler/index.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/index.js +1 -1
- package/esm/src/server/runtime-handler/projects-handler.d.ts +1 -1
- package/esm/src/server/runtime-handler/projects-handler.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/projects-handler.js +4 -2
- package/esm/src/transforms/esm/http-bundler.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-bundler.js +6 -5
- package/esm/src/transforms/esm/http-cache-helpers.d.ts +11 -0
- package/esm/src/transforms/esm/http-cache-helpers.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache-helpers.js +35 -0
- package/esm/src/transforms/esm/http-cache.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache.js +16 -10
- package/esm/src/transforms/esm/specifier-resolver.d.ts.map +1 -1
- package/esm/src/transforms/esm/specifier-resolver.js +87 -7
- package/esm/src/transforms/import-rewriter/strategies/alias-strategy.d.ts +2 -0
- package/esm/src/transforms/import-rewriter/strategies/alias-strategy.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/strategies/alias-strategy.js +11 -6
- package/esm/src/transforms/md/compiler/md-compiler.d.ts.map +1 -1
- package/esm/src/transforms/md/compiler/md-compiler.js +12 -5
- package/esm/src/transforms/mdx/compiler/frontmatter-extractor.d.ts +2 -0
- package/esm/src/transforms/mdx/compiler/frontmatter-extractor.d.ts.map +1 -1
- package/esm/src/transforms/mdx/compiler/frontmatter-extractor.js +33 -1
- package/esm/src/transforms/mdx/compiler/mdx-compiler.d.ts.map +1 -1
- package/esm/src/transforms/mdx/compiler/mdx-compiler.js +46 -7
- package/esm/src/transforms/mdx/esm-module-loader/cache/index.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/cache/index.js +8 -2
- package/esm/src/transforms/mdx/esm-module-loader/cache-format.d.ts +1 -0
- package/esm/src/transforms/mdx/esm-module-loader/cache-format.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/cache-format.js +3 -0
- package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.d.ts +4 -0
- package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.js +44 -8
- package/esm/src/transforms/mdx/esm-module-loader/missing-module.d.ts +2 -0
- package/esm/src/transforms/mdx/esm-module-loader/missing-module.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/missing-module.js +4 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.js +5 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fetcher.d.ts +2 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fetcher.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fetcher.js +50 -11
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/nested-imports.d.ts +24 -12
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/nested-imports.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/nested-imports.js +201 -18
- package/esm/src/transforms/mdx/esm-module-loader/types.d.ts +5 -0
- package/esm/src/transforms/mdx/esm-module-loader/types.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/utils/source-spans.d.ts +22 -2
- package/esm/src/transforms/mdx/esm-module-loader/utils/source-spans.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/utils/source-spans.js +2080 -129
- package/esm/src/transforms/mdx/esm-module-loader/utils/stub-module.d.ts +11 -1
- package/esm/src/transforms/mdx/esm-module-loader/utils/stub-module.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/utils/stub-module.js +32 -15
- package/esm/src/transforms/pipeline/stages/compile.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/compile.js +44 -0
- package/esm/src/transforms/shared/specifier-suffix.d.ts +25 -0
- package/esm/src/transforms/shared/specifier-suffix.d.ts.map +1 -0
- package/esm/src/transforms/shared/specifier-suffix.js +43 -0
- package/esm/src/trigger/index.d.ts +2 -2
- package/esm/src/trigger/index.d.ts.map +1 -1
- package/esm/src/trigger/index.js +1 -1
- package/esm/src/trigger/local-runner.d.ts +2 -2
- package/esm/src/trigger/local-runner.d.ts.map +1 -1
- package/esm/src/trigger/local-runner.js +11 -4
- package/esm/src/trigger/target.d.ts +97 -5
- package/esm/src/trigger/target.d.ts.map +1 -1
- package/esm/src/trigger/target.js +175 -5
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/esm/src/webhook/types.d.ts +21 -6
- package/esm/src/webhook/types.d.ts.map +1 -1
- package/esm/src/webhook/validation.d.ts.map +1 -1
- package/esm/src/webhook/validation.js +27 -39
- package/esm/templates/index.d.ts +1 -1
- package/esm/templates/index.d.ts.map +1 -1
- package/esm/templates/loader.d.ts +6 -6
- package/esm/templates/loader.d.ts.map +1 -1
- package/esm/templates/loader.js +34 -18
- package/esm/templates/manifest.generated.d.ts +3 -0
- package/esm/templates/manifest.generated.d.ts.map +1 -0
- package/esm/templates/manifest.generated.js +2 -0
- package/package.json +8 -8
- package/esm/templates/manifest.d.ts +0 -664
- package/esm/templates/manifest.d.ts.map +0 -1
- package/esm/templates/manifest.js +0 -662
|
@@ -9,8 +9,8 @@ import * as React from "react";
|
|
|
9
9
|
import { cx as cn } from "./cva.js";
|
|
10
10
|
import { getPolymorphicButtonType, Slot } from "./slot.js";
|
|
11
11
|
import { createAnchoredSurfaceParts, } from "./anchored-surface.js";
|
|
12
|
-
import { focusWithoutScroll
|
|
13
|
-
|
|
12
|
+
import { focusWithoutScroll } from "./focus-management.js";
|
|
13
|
+
import { useMenuContentKeyboard } from "./menu-keyboard.js";
|
|
14
14
|
// Per-skin context + machinery -- distinct from Popover's instance so a
|
|
15
15
|
// Popover nested inside a DropdownMenu cannot accidentally close the menu.
|
|
16
16
|
const { Context: _ctx, AnchoredRoot: _Root, AnchoredTrigger: _Trigger, AnchoredContent: _Content } = createAnchoredSurfaceParts();
|
|
@@ -27,79 +27,11 @@ export function DropdownMenuContent({ children, className, align = "start", onKe
|
|
|
27
27
|
if (!ctx) {
|
|
28
28
|
throw new Error("DropdownMenuContent must be used within <DropdownMenu>");
|
|
29
29
|
}
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
event.nativeEvent.keyCode === 229) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
const items = [...event.currentTarget.querySelectorAll("[role='menuitem']:not([aria-disabled='true'])")];
|
|
39
|
-
const activeIndex = items.indexOf(event.currentTarget.ownerDocument.activeElement);
|
|
40
|
-
const focusAt = (index) => {
|
|
41
|
-
const item = items[(index + items.length) % items.length];
|
|
42
|
-
if (item)
|
|
43
|
-
focusWithoutScroll(item);
|
|
44
|
-
};
|
|
45
|
-
switch (event.key) {
|
|
46
|
-
case "ArrowDown":
|
|
47
|
-
event.preventDefault();
|
|
48
|
-
focusAt(activeIndex + 1);
|
|
49
|
-
return;
|
|
50
|
-
case "ArrowUp":
|
|
51
|
-
event.preventDefault();
|
|
52
|
-
focusAt(activeIndex < 0 ? items.length - 1 : activeIndex - 1);
|
|
53
|
-
return;
|
|
54
|
-
case "Home":
|
|
55
|
-
event.preventDefault();
|
|
56
|
-
focusAt(0);
|
|
57
|
-
return;
|
|
58
|
-
case "End":
|
|
59
|
-
event.preventDefault();
|
|
60
|
-
focusAt(items.length - 1);
|
|
61
|
-
return;
|
|
62
|
-
case "Tab": {
|
|
63
|
-
event.preventDefault();
|
|
64
|
-
const trigger = ctx.triggerRef.current;
|
|
65
|
-
const document = event.currentTarget.ownerDocument;
|
|
66
|
-
const candidates = getFocusableElements(document.body).filter((element) => !event.currentTarget.contains(element));
|
|
67
|
-
const triggerIndex = trigger ? candidates.indexOf(trigger) : -1;
|
|
68
|
-
const next = event.shiftKey ? candidates[triggerIndex - 1] : candidates[triggerIndex + 1];
|
|
69
|
-
ctx.setOpen(false);
|
|
70
|
-
queueMicrotask(() => {
|
|
71
|
-
if (next?.isConnected)
|
|
72
|
-
focusWithoutScroll(next);
|
|
73
|
-
else if (trigger?.isConnected)
|
|
74
|
-
focusWithoutScroll(trigger);
|
|
75
|
-
});
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
if (event.key.length !== 1 || event.altKey || event.ctrlKey ||
|
|
80
|
-
event.metaKey) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
const now = Date.now();
|
|
84
|
-
const previous = typeaheadRef.current;
|
|
85
|
-
const buffer = now - previous.lastTypedAt > TYPEAHEAD_RESET_MS
|
|
86
|
-
? event.key
|
|
87
|
-
: previous.buffer + event.key;
|
|
88
|
-
typeaheadRef.current = { buffer, lastTypedAt: now };
|
|
89
|
-
const normalizedBuffer = buffer.normalize("NFKC").toLocaleLowerCase();
|
|
90
|
-
const repeatedCharacter = [...normalizedBuffer].every((character) => character === normalizedBuffer[0]);
|
|
91
|
-
const query = repeatedCharacter ? normalizedBuffer[0] : normalizedBuffer;
|
|
92
|
-
for (let offset = 1; offset <= items.length; offset += 1) {
|
|
93
|
-
const item = items[(activeIndex + offset + items.length) % items.length];
|
|
94
|
-
const text = item?.textContent?.normalize("NFKC").trim()
|
|
95
|
-
.replace(/\s+/g, " ").toLocaleLowerCase();
|
|
96
|
-
if (item && text?.startsWith(query)) {
|
|
97
|
-
event.preventDefault();
|
|
98
|
-
focusWithoutScroll(item);
|
|
99
|
-
break;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
};
|
|
30
|
+
const handleKeyDown = useMenuContentKeyboard({
|
|
31
|
+
onKeyDown,
|
|
32
|
+
setOpen: ctx.setOpen,
|
|
33
|
+
triggerRef: ctx.triggerRef,
|
|
34
|
+
});
|
|
103
35
|
return (React.createElement(_Content, { ...props, role: "menu", "aria-orientation": "vertical", align: align, initialFocus: "[role='menuitem']:not([aria-disabled='true'])", onKeyDown: handleKeyDown, className: cn("min-w-[260px] p-2.5", className) }, children));
|
|
104
36
|
}
|
|
105
37
|
/** Groups related items with a tight inner gap (Studio: `gap-px p-0.5`). */
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Field: a form-field wrapper that wires a label, description, and error to a
|
|
3
|
+
* single control for accessibility. `<Field>` derives a stable base id with
|
|
4
|
+
* `React.useId()` and shares it (plus derived description/error ids and the
|
|
5
|
+
* `invalid` flag) through context, so `<FieldLabel>` targets the control via
|
|
6
|
+
* `htmlFor`, `<FieldControl>` clones its child with the matching `id` +
|
|
7
|
+
* `aria-describedby` + `aria-invalid`, and `<FieldDescription>` / `<FieldError>`
|
|
8
|
+
* expose the referenced ids. Self-contained; skinned with the veryfront theme
|
|
9
|
+
* tokens.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* import { Field, FieldLabel, FieldControl, FieldDescription, FieldError } from "veryfront/ui";
|
|
14
|
+
* import { Input } from "veryfront/ui";
|
|
15
|
+
*
|
|
16
|
+
* <Field invalid>
|
|
17
|
+
* <FieldLabel>Email</FieldLabel>
|
|
18
|
+
* <FieldControl><Input type="email" /></FieldControl>
|
|
19
|
+
* <FieldDescription>Veryfront never shares it.</FieldDescription>
|
|
20
|
+
* <FieldError>Enter a valid email.</FieldError>
|
|
21
|
+
* </Field>;
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @module react/components/ui/field
|
|
25
|
+
*/
|
|
26
|
+
import * as React from "react";
|
|
27
|
+
/** Props accepted by `<Field>`. */
|
|
28
|
+
export interface FieldProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
29
|
+
/** Mark the field invalid: flags the label/control/error via context. @default false */
|
|
30
|
+
invalid?: boolean;
|
|
31
|
+
/** React 19: ref is a regular prop. */
|
|
32
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
33
|
+
}
|
|
34
|
+
/** The field wrapper: derives ids and provides them to its sub-parts. */
|
|
35
|
+
export declare function Field({ invalid, className, children, ref, ...props }: FieldProps): React.ReactElement;
|
|
36
|
+
/** Props accepted by `<FieldLabel>`. */
|
|
37
|
+
export interface FieldLabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
38
|
+
/** React 19: ref is a regular prop. */
|
|
39
|
+
ref?: React.Ref<HTMLLabelElement>;
|
|
40
|
+
}
|
|
41
|
+
/** The field's label: wired to the control with `htmlFor`. */
|
|
42
|
+
export declare function FieldLabel({ className, children, ref, ...props }: FieldLabelProps): React.ReactElement;
|
|
43
|
+
/** Props accepted by `<FieldControl>`. */
|
|
44
|
+
export interface FieldControlProps {
|
|
45
|
+
/** The single form control element to wire: its `id`/`aria-*` are set for you. */
|
|
46
|
+
children: React.ReactElement;
|
|
47
|
+
/** React 19: ref is forwarded onto the cloned child control (not a wrapper node). */
|
|
48
|
+
ref?: React.Ref<HTMLElement>;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Wiring wrapper: renders no node of its own; clones its single child control
|
|
52
|
+
* with the shared `id`, `aria-describedby` (the description, plus the error id
|
|
53
|
+
* when invalid), and `aria-invalid`.
|
|
54
|
+
*/
|
|
55
|
+
export declare function FieldControl({ children, ref }: FieldControlProps): React.ReactElement;
|
|
56
|
+
/** Props accepted by `<FieldDescription>`. */
|
|
57
|
+
export interface FieldDescriptionProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
58
|
+
/** React 19: ref is a regular prop. */
|
|
59
|
+
ref?: React.Ref<HTMLParagraphElement>;
|
|
60
|
+
}
|
|
61
|
+
/** Helper text describing the field: referenced by the control's `aria-describedby`. */
|
|
62
|
+
export declare function FieldDescription({ className, children, id, ref, ...props }: FieldDescriptionProps): React.ReactElement;
|
|
63
|
+
/** Props accepted by `<FieldError>`. */
|
|
64
|
+
export interface FieldErrorProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
65
|
+
/** React 19: ref is a regular prop. */
|
|
66
|
+
ref?: React.Ref<HTMLParagraphElement>;
|
|
67
|
+
}
|
|
68
|
+
/** The field's error message: a live `role="alert"`; renders nothing when empty. */
|
|
69
|
+
export declare function FieldError({ className, children, id, ref, ...props }: FieldErrorProps): React.ReactElement | null;
|
|
70
|
+
//# sourceMappingURL=field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/ui/field.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAmE/B,mCAAmC;AACnC,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACtE,wFAAwF;IACxF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uCAAuC;IACvC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC;AAED,yEAAyE;AACzE,wBAAgB,KAAK,CAAC,EACpB,OAAe,EACf,SAAS,EACT,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACT,EAAE,UAAU,GAAG,KAAK,CAAC,YAAY,CAoDjC;AAED,wCAAwC;AACxC,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC;IAClF,uCAAuC;IACvC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;CACnC;AAED,8DAA8D;AAC9D,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACT,EAAE,eAAe,GAAG,KAAK,CAAC,YAAY,CAiBtC;AAED,0CAA0C;AAC1C,MAAM,WAAW,iBAAiB;IAChC,kFAAkF;IAClF,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B,qFAAqF;IACrF,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,iBAAiB,GAAG,KAAK,CAAC,YAAY,CAuBrF;AAED,8CAA8C;AAC9C,MAAM,WAAW,qBAAsB,SAAQ,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC;IACvF,uCAAuC;IACvC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;CACvC;AAED,wFAAwF;AACxF,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,QAAQ,EACR,EAAE,EACF,GAAG,EACH,GAAG,KAAK,EACT,EAAE,qBAAqB,GAAG,KAAK,CAAC,YAAY,CAiB5C;AAED,wCAAwC;AACxC,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC;IACjF,uCAAuC;IACvC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;CACvC;AAED,oFAAoF;AACpF,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,QAAQ,EACR,EAAE,EACF,GAAG,EACH,GAAG,KAAK,EACT,EAAE,eAAe,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAqB7C"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Field: a form-field wrapper that wires a label, description, and error to a
|
|
3
|
+
* single control for accessibility. `<Field>` derives a stable base id with
|
|
4
|
+
* `React.useId()` and shares it (plus derived description/error ids and the
|
|
5
|
+
* `invalid` flag) through context, so `<FieldLabel>` targets the control via
|
|
6
|
+
* `htmlFor`, `<FieldControl>` clones its child with the matching `id` +
|
|
7
|
+
* `aria-describedby` + `aria-invalid`, and `<FieldDescription>` / `<FieldError>`
|
|
8
|
+
* expose the referenced ids. Self-contained; skinned with the veryfront theme
|
|
9
|
+
* tokens.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* import { Field, FieldLabel, FieldControl, FieldDescription, FieldError } from "veryfront/ui";
|
|
14
|
+
* import { Input } from "veryfront/ui";
|
|
15
|
+
*
|
|
16
|
+
* <Field invalid>
|
|
17
|
+
* <FieldLabel>Email</FieldLabel>
|
|
18
|
+
* <FieldControl><Input type="email" /></FieldControl>
|
|
19
|
+
* <FieldDescription>Veryfront never shares it.</FieldDescription>
|
|
20
|
+
* <FieldError>Enter a valid email.</FieldError>
|
|
21
|
+
* </Field>;
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @module react/components/ui/field
|
|
25
|
+
*/
|
|
26
|
+
import * as React from "react";
|
|
27
|
+
import { composeRefs } from "./slot.js";
|
|
28
|
+
import { cx as cn } from "./cva.js";
|
|
29
|
+
import { useIsomorphicLayoutEffect } from "./use-isomorphic-layout-effect.js";
|
|
30
|
+
/**
|
|
31
|
+
* Walks the element tree looking for a rendered `<FieldDescription>` and a
|
|
32
|
+
* non-empty `<FieldError>`.
|
|
33
|
+
*
|
|
34
|
+
* Presence is resolved synchronously from `children` rather than registered
|
|
35
|
+
* from an effect: `FieldControl` renders before any child effect runs, so an
|
|
36
|
+
* effect-based registry would emit `aria-describedby` a commit too late (and
|
|
37
|
+
* never at all in a non-`act` render).
|
|
38
|
+
*/
|
|
39
|
+
function findFieldParts(children, found = { description: false, error: false }) {
|
|
40
|
+
React.Children.forEach(children, (child) => {
|
|
41
|
+
if (!React.isValidElement(child))
|
|
42
|
+
return;
|
|
43
|
+
if (child.type === FieldDescription) {
|
|
44
|
+
found.description = true;
|
|
45
|
+
const props = child.props;
|
|
46
|
+
if (typeof props.id === "string")
|
|
47
|
+
found.descriptionId ??= props.id;
|
|
48
|
+
}
|
|
49
|
+
else if (child.type === FieldError) {
|
|
50
|
+
const props = child.props;
|
|
51
|
+
if (React.Children.count(props.children) > 0)
|
|
52
|
+
found.error = true;
|
|
53
|
+
if (typeof props.id === "string")
|
|
54
|
+
found.errorId ??= props.id;
|
|
55
|
+
}
|
|
56
|
+
const props = child.props;
|
|
57
|
+
if (props?.children)
|
|
58
|
+
findFieldParts(props.children, found);
|
|
59
|
+
});
|
|
60
|
+
return found;
|
|
61
|
+
}
|
|
62
|
+
const FieldContext = React.createContext(null);
|
|
63
|
+
function useField(part) {
|
|
64
|
+
const ctx = React.useContext(FieldContext);
|
|
65
|
+
if (!ctx)
|
|
66
|
+
throw new Error(`<${part}> must be used within <Field>`);
|
|
67
|
+
return ctx;
|
|
68
|
+
}
|
|
69
|
+
/** The field wrapper: derives ids and provides them to its sub-parts. */
|
|
70
|
+
export function Field({ invalid = false, className, children, ref, ...props }) {
|
|
71
|
+
const base = React.useId();
|
|
72
|
+
const staticParts = findFieldParts(children);
|
|
73
|
+
const [mountedDescriptionIds, setMountedDescriptionIds] = React.useState([]);
|
|
74
|
+
const [mountedErrorIds, setMountedErrorIds] = React.useState([]);
|
|
75
|
+
const descriptionId = staticParts.descriptionId ?? mountedDescriptionIds[0] ??
|
|
76
|
+
`${base}-description`;
|
|
77
|
+
const errorId = staticParts.errorId ?? mountedErrorIds[0] ?? `${base}-error`;
|
|
78
|
+
const registerDescription = React.useCallback((id) => {
|
|
79
|
+
setMountedDescriptionIds((ids) => ids.includes(id) ? ids : [...ids, id]);
|
|
80
|
+
return () => setMountedDescriptionIds((ids) => ids.filter((current) => current !== id));
|
|
81
|
+
}, []);
|
|
82
|
+
const registerError = React.useCallback((id) => {
|
|
83
|
+
setMountedErrorIds((ids) => ids.includes(id) ? ids : [...ids, id]);
|
|
84
|
+
return () => setMountedErrorIds((ids) => ids.filter((current) => current !== id));
|
|
85
|
+
}, []);
|
|
86
|
+
const descriptionPresent = staticParts.description || mountedDescriptionIds.length > 0;
|
|
87
|
+
const errorPresent = staticParts.error || mountedErrorIds.length > 0;
|
|
88
|
+
const ctx = React.useMemo(() => ({
|
|
89
|
+
id: base,
|
|
90
|
+
descriptionId,
|
|
91
|
+
errorId,
|
|
92
|
+
invalid,
|
|
93
|
+
descriptionPresent,
|
|
94
|
+
errorPresent,
|
|
95
|
+
registerDescription,
|
|
96
|
+
registerError,
|
|
97
|
+
}), [
|
|
98
|
+
base,
|
|
99
|
+
descriptionId,
|
|
100
|
+
errorId,
|
|
101
|
+
invalid,
|
|
102
|
+
descriptionPresent,
|
|
103
|
+
errorPresent,
|
|
104
|
+
registerDescription,
|
|
105
|
+
registerError,
|
|
106
|
+
]);
|
|
107
|
+
return (React.createElement(FieldContext.Provider, { value: ctx },
|
|
108
|
+
React.createElement("div", { ref: ref, "data-invalid": invalid || undefined, className: cn("space-y-2", className), ...props }, children)));
|
|
109
|
+
}
|
|
110
|
+
/** The field's label: wired to the control with `htmlFor`. */
|
|
111
|
+
export function FieldLabel({ className, children, ref, ...props }) {
|
|
112
|
+
const ctx = useField("FieldLabel");
|
|
113
|
+
return (React.createElement("label", { ref: ref, htmlFor: ctx.id, "data-invalid": ctx.invalid || undefined, className: cn("text-sm font-medium", ctx.invalid && "text-[var(--destructive)]", className), ...props }, children));
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Wiring wrapper: renders no node of its own; clones its single child control
|
|
117
|
+
* with the shared `id`, `aria-describedby` (the description, plus the error id
|
|
118
|
+
* when invalid), and `aria-invalid`.
|
|
119
|
+
*/
|
|
120
|
+
export function FieldControl({ children, ref }) {
|
|
121
|
+
const ctx = useField("FieldControl");
|
|
122
|
+
const child = React.Children.only(children);
|
|
123
|
+
const childRef = child.props.ref;
|
|
124
|
+
// Reference an id only while its node is actually mounted, otherwise
|
|
125
|
+
// aria-describedby points at nothing and assistive tech resolves no text.
|
|
126
|
+
// The child's own aria-describedby is preserved and merged, not replaced.
|
|
127
|
+
const describedBy = [
|
|
128
|
+
typeof child.props["aria-describedby"] === "string" ? child.props["aria-describedby"] : null,
|
|
129
|
+
ctx.descriptionPresent ? ctx.descriptionId : null,
|
|
130
|
+
ctx.invalid && ctx.errorPresent ? ctx.errorId : null,
|
|
131
|
+
]
|
|
132
|
+
.filter(Boolean)
|
|
133
|
+
.join(" ");
|
|
134
|
+
return React.cloneElement(child, {
|
|
135
|
+
id: ctx.id,
|
|
136
|
+
"aria-describedby": describedBy || undefined,
|
|
137
|
+
"aria-invalid": ctx.invalid || undefined,
|
|
138
|
+
// Compose so a ref set directly on the child control still receives the node.
|
|
139
|
+
ref: ref || childRef ? composeRefs(ref, childRef) : undefined,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
/** Helper text describing the field: referenced by the control's `aria-describedby`. */
|
|
143
|
+
export function FieldDescription({ className, children, id, ref, ...props }) {
|
|
144
|
+
const ctx = useField("FieldDescription");
|
|
145
|
+
const resolvedId = id ?? ctx.descriptionId;
|
|
146
|
+
useIsomorphicLayoutEffect(() => ctx.registerDescription(resolvedId), [
|
|
147
|
+
ctx.registerDescription,
|
|
148
|
+
resolvedId,
|
|
149
|
+
]);
|
|
150
|
+
return (React.createElement("p", { ref: ref, id: resolvedId, className: cn("text-sm text-[var(--muted-foreground)]", className), ...props }, children));
|
|
151
|
+
}
|
|
152
|
+
/** The field's error message: a live `role="alert"`; renders nothing when empty. */
|
|
153
|
+
export function FieldError({ className, children, id, ref, ...props }) {
|
|
154
|
+
const ctx = useField("FieldError");
|
|
155
|
+
const present = React.Children.count(children) > 0;
|
|
156
|
+
const resolvedId = id ?? ctx.errorId;
|
|
157
|
+
useIsomorphicLayoutEffect(() => present ? ctx.registerError(resolvedId) : undefined, [ctx.registerError, present, resolvedId]);
|
|
158
|
+
if (!present)
|
|
159
|
+
return null;
|
|
160
|
+
return (React.createElement("p", { ref: ref, id: resolvedId, role: "alert", "data-invalid": ctx.invalid || undefined, className: cn("text-sm text-[var(--destructive)]", className), ...props }, children));
|
|
161
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* FileType
|
|
2
|
+
* FileType - ported 1:1 from Veryfront Studio. The canonical file-type
|
|
3
3
|
* identity primitive: one distinct hue per extension. This is the single
|
|
4
4
|
* sanctioned place where Tailwind named-colour utilities live (the per-file-
|
|
5
|
-
* type identity palette)
|
|
5
|
+
* type identity palette) - every other primitive uses `[var(--token)]`. Only
|
|
6
6
|
* the `DEFAULT` style and `vf-type`/`vf-weight` classes are remapped to
|
|
7
7
|
* veryfront's vocabulary. Private to the chat module.
|
|
8
8
|
*
|
|
@@ -15,12 +15,13 @@ import * as React from "react";
|
|
|
15
15
|
/** Human label for a file extension, falling back to the media type. */
|
|
16
16
|
export declare function getFileTypeLabel(ext: string, mediaType?: string): string;
|
|
17
17
|
/** Props accepted by `<FileType>` / `<FileTypeThumb>`. */
|
|
18
|
-
export interface FileTypeProps {
|
|
18
|
+
export interface FileTypeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
19
19
|
extension: string;
|
|
20
|
-
|
|
20
|
+
/** React 19: ref is a regular prop, forwarded to the root node. */
|
|
21
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
21
22
|
}
|
|
22
|
-
/** Soft-fill badge
|
|
23
|
-
export declare function FileType({ extension, className }: FileTypeProps): React.ReactElement;
|
|
24
|
-
/** Solid-fill thumbnail
|
|
25
|
-
export declare function FileTypeThumb({ extension, className }: FileTypeProps): React.ReactElement;
|
|
23
|
+
/** Soft-fill badge - rounded square, tinted background, extension label. */
|
|
24
|
+
export declare function FileType({ extension, className, ref, ...props }: FileTypeProps): React.ReactElement;
|
|
25
|
+
/** Solid-fill thumbnail - full-saturation square with white `.ext` text. */
|
|
26
|
+
export declare function FileTypeThumb({ extension, className, ref, ...props }: FileTypeProps): React.ReactElement;
|
|
26
27
|
//# sourceMappingURL=file-type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-type.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/ui/file-type.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA0N/B,wEAAwE;AACxE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAGxE;AAED,0DAA0D;AAC1D,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"file-type.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/ui/file-type.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA0N/B,wEAAwE;AACxE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAGxE;AAED,0DAA0D;AAC1D,MAAM,WAAW,aAAc,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACzE,SAAS,EAAE,MAAM,CAAC;IAClB,mEAAmE;IACnE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC;AAED,4EAA4E;AAC5E,wBAAgB,QAAQ,CACtB,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,GACrD,KAAK,CAAC,YAAY,CAkBpB;AAED,4EAA4E;AAC5E,wBAAgB,aAAa,CAC3B,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,GACrD,KAAK,CAAC,YAAY,CAgBpB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* FileType
|
|
2
|
+
* FileType - ported 1:1 from Veryfront Studio. The canonical file-type
|
|
3
3
|
* identity primitive: one distinct hue per extension. This is the single
|
|
4
4
|
* sanctioned place where Tailwind named-colour utilities live (the per-file-
|
|
5
|
-
* type identity palette)
|
|
5
|
+
* type identity palette) - every other primitive uses `[var(--token)]`. Only
|
|
6
6
|
* the `DEFAULT` style and `vf-type`/`vf-weight` classes are remapped to
|
|
7
7
|
* veryfront's vocabulary. Private to the chat module.
|
|
8
8
|
*
|
|
@@ -219,16 +219,16 @@ export function getFileTypeLabel(ext, mediaType) {
|
|
|
219
219
|
return EXT_STYLES[ext.toLowerCase()]?.label ??
|
|
220
220
|
mediaType?.split("/").pop()?.toUpperCase() ?? "File";
|
|
221
221
|
}
|
|
222
|
-
/** Soft-fill badge
|
|
223
|
-
export function FileType({ extension, className }) {
|
|
222
|
+
/** Soft-fill badge - rounded square, tinted background, extension label. */
|
|
223
|
+
export function FileType({ extension, className, ref, ...props }) {
|
|
224
224
|
const { bg, text } = lookup(extension);
|
|
225
|
-
return (React.createElement("div", { className: cn("size-9 shrink-0 rounded-lg flex items-center justify-center", bg, className)
|
|
225
|
+
return (React.createElement("div", { ref: ref, "data-testid": "file-type-badge", ...props, className: cn("size-9 shrink-0 rounded-lg flex items-center justify-center", bg, className) },
|
|
226
226
|
React.createElement("span", { className: cn("text-xs font-medium leading-none", text) }, extension.toUpperCase())));
|
|
227
227
|
}
|
|
228
|
-
/** Solid-fill thumbnail
|
|
229
|
-
export function FileTypeThumb({ extension, className }) {
|
|
228
|
+
/** Solid-fill thumbnail - full-saturation square with white `.ext` text. */
|
|
229
|
+
export function FileTypeThumb({ extension, className, ref, ...props }) {
|
|
230
230
|
const { solid } = lookup(extension);
|
|
231
|
-
return (React.createElement("div", { className: cn("flex size-10 shrink-0 items-center justify-center rounded-md text-xs font-medium text-white", solid, className)
|
|
231
|
+
return (React.createElement("div", { ref: ref, "data-testid": "file-type-thumb", ...props, className: cn("flex size-10 shrink-0 items-center justify-center rounded-md text-xs font-medium text-white", solid, className) },
|
|
232
232
|
React.createElement("span", null,
|
|
233
233
|
".",
|
|
234
234
|
extension)));
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HoverCard - a non-modal preview surface that opens when the user hovers or
|
|
3
|
+
* focuses a trigger and closes when they leave or blur it. Built on the same
|
|
4
|
+
* `Floating` portal + positioning machinery as Popover (anchored below the
|
|
5
|
+
* trigger, portalled into the nearest `[data-vf-ui]`/`[data-vf-chat]` token
|
|
6
|
+
* scope, dismisses on outside-click / `Escape`), but opens on hover intent
|
|
7
|
+
* instead of click. Ideal for rich previews - a user card on a `@mention`, a
|
|
8
|
+
* repo card on a link. Skinned entirely with veryfront theme tokens.
|
|
9
|
+
*
|
|
10
|
+
* `openDelay` / `closeDelay` gate the hover transitions so brief pointer passes
|
|
11
|
+
* don't flicker the card, and moving the pointer from the trigger onto the card
|
|
12
|
+
* keeps it open. Keyboard users get the card immediately on focus, and it
|
|
13
|
+
* closes on blur.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <HoverCard>
|
|
18
|
+
* <HoverCardTrigger asChild>
|
|
19
|
+
* <a href="/users/koji">@koji</a>
|
|
20
|
+
* </HoverCardTrigger>
|
|
21
|
+
* <HoverCardContent>
|
|
22
|
+
* <div className="flex flex-col gap-1">
|
|
23
|
+
* <span className="font-semibold">Koji</span>
|
|
24
|
+
* <span className="text-[var(--muted-foreground)]">Design systems</span>
|
|
25
|
+
* </div>
|
|
26
|
+
* </HoverCardContent>
|
|
27
|
+
* </HoverCard>
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @module react/components/ui/hover-card
|
|
31
|
+
*/
|
|
32
|
+
import * as React from "react";
|
|
33
|
+
/** Props accepted by `<HoverCard>`. */
|
|
34
|
+
export interface HoverCardProps {
|
|
35
|
+
/** The trigger and content parts to compose. */
|
|
36
|
+
children: React.ReactNode;
|
|
37
|
+
/** Controlled open state (pair with `onOpenChange`). */
|
|
38
|
+
open?: boolean;
|
|
39
|
+
/** Initial open state when uncontrolled. @default false */
|
|
40
|
+
defaultOpen?: boolean;
|
|
41
|
+
/** Fires when the open state changes (hover/focus in, leave/blur out). */
|
|
42
|
+
onOpenChange?: (open: boolean) => void;
|
|
43
|
+
/** Delay in ms before the card opens after pointer enter. @default 700 */
|
|
44
|
+
openDelay?: number;
|
|
45
|
+
/** Delay in ms before the card closes after pointer leave. @default 300 */
|
|
46
|
+
closeDelay?: number;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* HoverCard root - owns open state and the hover/focus timers. Renders no node
|
|
50
|
+
* of its own; the positioning anchor is the trigger element, carried on context.
|
|
51
|
+
*/
|
|
52
|
+
export declare function HoverCard({ children, open, defaultOpen, onOpenChange, openDelay, closeDelay, }: HoverCardProps): React.ReactElement;
|
|
53
|
+
/** Props accepted by `<HoverCardTrigger>`. */
|
|
54
|
+
export interface HoverCardTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
55
|
+
/** Render as a Slot, merging the trigger behaviour onto the child element. */
|
|
56
|
+
asChild?: boolean;
|
|
57
|
+
/** React 19: ref is a regular prop; forwarded to the anchor node. */
|
|
58
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Trigger - carries the positioning-anchor ref and the hover/focus intent.
|
|
62
|
+
* Opens the card on pointer enter (after `openDelay`) or immediately on focus;
|
|
63
|
+
* closes it on pointer leave (after `closeDelay`) or on blur. `asChild` merges
|
|
64
|
+
* the behaviour onto the child element, which must forward `ref` to its DOM node
|
|
65
|
+
* (a child that drops `ref` leaves the card unanchored - `Floating` warns).
|
|
66
|
+
*/
|
|
67
|
+
export declare function HoverCardTrigger({ children, asChild, ref, onMouseEnter, onMouseLeave, onFocus, onBlur, ...props }: HoverCardTriggerProps): React.ReactElement;
|
|
68
|
+
/** Props accepted by `<HoverCardContent>`. */
|
|
69
|
+
export interface HoverCardContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
70
|
+
/** Horizontal alignment relative to the trigger. @default "start" */
|
|
71
|
+
align?: "start" | "end";
|
|
72
|
+
/** Consumer ref for the surface node (forwarded through `Floating`). */
|
|
73
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* HoverCard surface - the portalled floating card, rendered while open. Non-modal
|
|
77
|
+
* (no `role="dialog"`, no focus trap): it's a supplementary preview, so the
|
|
78
|
+
* trigger keeps focus. Keeps itself open while the pointer is over it and closes
|
|
79
|
+
* shortly after the pointer leaves. Base classes mirror Popover's surface.
|
|
80
|
+
*/
|
|
81
|
+
export declare function HoverCardContent({ children, className, align, ref, onMouseEnter, onMouseLeave, ...props }: HoverCardContentProps): React.ReactElement | null;
|
|
82
|
+
//# sourceMappingURL=hover-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hover-card.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/ui/hover-card.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA0B/B,uCAAuC;AACvC,MAAM,WAAW,cAAc;IAC7B,gDAAgD;IAChD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,wDAAwD;IACxD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,2DAA2D;IAC3D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,YAAY,EACZ,SAAe,EACf,UAAgB,GACjB,EAAE,cAAc,GAAG,KAAK,CAAC,YAAY,CAoErC;AAED,8CAA8C;AAC9C,MAAM,WAAW,qBAAsB,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IAC1F,8EAA8E;IAC9E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qEAAqE;IACrE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;CACpC;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,OAAO,EACP,GAAG,EACH,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,MAAM,EACN,GAAG,KAAK,EACT,EAAE,qBAAqB,GAAG,KAAK,CAAC,YAAY,CAgC5C;AAED,8CAA8C;AAC9C,MAAM,WAAW,qBAAsB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACjF,qEAAqE;IACrE,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACxB,wEAAwE;IACxE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,SAAS,EACT,KAAe,EACf,GAAG,EACH,YAAY,EACZ,YAAY,EACZ,GAAG,KAAK,EACT,EAAE,qBAAqB,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CA6BnD"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HoverCard - a non-modal preview surface that opens when the user hovers or
|
|
3
|
+
* focuses a trigger and closes when they leave or blur it. Built on the same
|
|
4
|
+
* `Floating` portal + positioning machinery as Popover (anchored below the
|
|
5
|
+
* trigger, portalled into the nearest `[data-vf-ui]`/`[data-vf-chat]` token
|
|
6
|
+
* scope, dismisses on outside-click / `Escape`), but opens on hover intent
|
|
7
|
+
* instead of click. Ideal for rich previews - a user card on a `@mention`, a
|
|
8
|
+
* repo card on a link. Skinned entirely with veryfront theme tokens.
|
|
9
|
+
*
|
|
10
|
+
* `openDelay` / `closeDelay` gate the hover transitions so brief pointer passes
|
|
11
|
+
* don't flicker the card, and moving the pointer from the trigger onto the card
|
|
12
|
+
* keeps it open. Keyboard users get the card immediately on focus, and it
|
|
13
|
+
* closes on blur.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <HoverCard>
|
|
18
|
+
* <HoverCardTrigger asChild>
|
|
19
|
+
* <a href="/users/koji">@koji</a>
|
|
20
|
+
* </HoverCardTrigger>
|
|
21
|
+
* <HoverCardContent>
|
|
22
|
+
* <div className="flex flex-col gap-1">
|
|
23
|
+
* <span className="font-semibold">Koji</span>
|
|
24
|
+
* <span className="text-[var(--muted-foreground)]">Design systems</span>
|
|
25
|
+
* </div>
|
|
26
|
+
* </HoverCardContent>
|
|
27
|
+
* </HoverCard>
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @module react/components/ui/hover-card
|
|
31
|
+
*/
|
|
32
|
+
import * as React from "react";
|
|
33
|
+
import { cx as cn } from "./cva.js";
|
|
34
|
+
import { composeRefs, Slot } from "./slot.js";
|
|
35
|
+
import { Floating } from "./floating.js";
|
|
36
|
+
import { useDisclosure } from "./disclosure.js";
|
|
37
|
+
const HoverCardContext = React.createContext(null);
|
|
38
|
+
/**
|
|
39
|
+
* HoverCard root - owns open state and the hover/focus timers. Renders no node
|
|
40
|
+
* of its own; the positioning anchor is the trigger element, carried on context.
|
|
41
|
+
*/
|
|
42
|
+
export function HoverCard({ children, open, defaultOpen, onOpenChange, openDelay = 700, closeDelay = 300, }) {
|
|
43
|
+
const { open: isOpen, setOpen } = useDisclosure({ open, defaultOpen, onOpenChange });
|
|
44
|
+
const anchorRef = React.useRef(null);
|
|
45
|
+
const openTimer = React.useRef(null);
|
|
46
|
+
const closeTimer = React.useRef(null);
|
|
47
|
+
// Keep `setOpen` reachable from timer callbacks without re-arming timers when
|
|
48
|
+
// a parent re-render swaps the callback identity.
|
|
49
|
+
const setOpenRef = React.useRef(setOpen);
|
|
50
|
+
setOpenRef.current = setOpen;
|
|
51
|
+
const cancelPending = React.useCallback(() => {
|
|
52
|
+
if (openTimer.current != null) {
|
|
53
|
+
clearTimeout(openTimer.current);
|
|
54
|
+
openTimer.current = null;
|
|
55
|
+
}
|
|
56
|
+
if (closeTimer.current != null) {
|
|
57
|
+
clearTimeout(closeTimer.current);
|
|
58
|
+
closeTimer.current = null;
|
|
59
|
+
}
|
|
60
|
+
}, []);
|
|
61
|
+
const scheduleOpen = React.useCallback(() => {
|
|
62
|
+
cancelPending();
|
|
63
|
+
if (openDelay <= 0) {
|
|
64
|
+
setOpenRef.current(true);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
openTimer.current = setTimeout(() => setOpenRef.current(true), openDelay);
|
|
68
|
+
}, [openDelay, cancelPending]);
|
|
69
|
+
const scheduleClose = React.useCallback(() => {
|
|
70
|
+
cancelPending();
|
|
71
|
+
if (closeDelay <= 0) {
|
|
72
|
+
setOpenRef.current(false);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
closeTimer.current = setTimeout(() => setOpenRef.current(false), closeDelay);
|
|
76
|
+
}, [closeDelay, cancelPending]);
|
|
77
|
+
const openNow = React.useCallback(() => {
|
|
78
|
+
cancelPending();
|
|
79
|
+
setOpenRef.current(true);
|
|
80
|
+
}, [cancelPending]);
|
|
81
|
+
const closeNow = React.useCallback(() => {
|
|
82
|
+
cancelPending();
|
|
83
|
+
setOpenRef.current(false);
|
|
84
|
+
}, [cancelPending]);
|
|
85
|
+
// Clear any dangling timer on unmount so a delayed open/close can't fire into
|
|
86
|
+
// an unmounted tree.
|
|
87
|
+
React.useEffect(() => cancelPending, [cancelPending]);
|
|
88
|
+
const ctx = React.useMemo(() => ({
|
|
89
|
+
open: isOpen,
|
|
90
|
+
anchorRef,
|
|
91
|
+
scheduleOpen,
|
|
92
|
+
scheduleClose,
|
|
93
|
+
cancelPending,
|
|
94
|
+
openNow,
|
|
95
|
+
closeNow,
|
|
96
|
+
}), [isOpen, scheduleOpen, scheduleClose, cancelPending, openNow, closeNow]);
|
|
97
|
+
return React.createElement(HoverCardContext.Provider, { value: ctx }, children);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Trigger - carries the positioning-anchor ref and the hover/focus intent.
|
|
101
|
+
* Opens the card on pointer enter (after `openDelay`) or immediately on focus;
|
|
102
|
+
* closes it on pointer leave (after `closeDelay`) or on blur. `asChild` merges
|
|
103
|
+
* the behaviour onto the child element, which must forward `ref` to its DOM node
|
|
104
|
+
* (a child that drops `ref` leaves the card unanchored - `Floating` warns).
|
|
105
|
+
*/
|
|
106
|
+
export function HoverCardTrigger({ children, asChild, ref, onMouseEnter, onMouseLeave, onFocus, onBlur, ...props }) {
|
|
107
|
+
const ctx = React.useContext(HoverCardContext);
|
|
108
|
+
const Comp = asChild ? Slot : "button";
|
|
109
|
+
return (React.createElement(Comp, { ...(asChild ? {} : { type: "button" }), ref: composeRefs(ctx?.anchorRef, ref), "data-state": ctx?.open ? "open" : "closed", onMouseEnter: (e) => {
|
|
110
|
+
onMouseEnter?.(e);
|
|
111
|
+
ctx?.scheduleOpen();
|
|
112
|
+
}, onMouseLeave: (e) => {
|
|
113
|
+
onMouseLeave?.(e);
|
|
114
|
+
ctx?.scheduleClose();
|
|
115
|
+
}, onFocus: (e) => {
|
|
116
|
+
onFocus?.(e);
|
|
117
|
+
ctx?.openNow();
|
|
118
|
+
}, onBlur: (e) => {
|
|
119
|
+
onBlur?.(e);
|
|
120
|
+
ctx?.closeNow();
|
|
121
|
+
}, ...props }, children));
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* HoverCard surface - the portalled floating card, rendered while open. Non-modal
|
|
125
|
+
* (no `role="dialog"`, no focus trap): it's a supplementary preview, so the
|
|
126
|
+
* trigger keeps focus. Keeps itself open while the pointer is over it and closes
|
|
127
|
+
* shortly after the pointer leaves. Base classes mirror Popover's surface.
|
|
128
|
+
*/
|
|
129
|
+
export function HoverCardContent({ children, className, align = "start", ref, onMouseEnter, onMouseLeave, ...props }) {
|
|
130
|
+
const ctx = React.useContext(HoverCardContext);
|
|
131
|
+
if (!ctx)
|
|
132
|
+
return null;
|
|
133
|
+
return (React.createElement(Floating, { anchorRef: ctx.anchorRef, open: ctx.open, align: align, onDismiss: ctx.closeNow, contentRef: ref, "data-state": ctx.open ? "open" : "closed", onMouseEnter: (e) => {
|
|
134
|
+
onMouseEnter?.(e);
|
|
135
|
+
ctx.cancelPending();
|
|
136
|
+
}, onMouseLeave: (e) => {
|
|
137
|
+
onMouseLeave?.(e);
|
|
138
|
+
ctx.scheduleClose();
|
|
139
|
+
}, className: cn("z-50 w-64 overflow-hidden rounded-lg border border-[var(--separator)]", "bg-[var(--popover)] p-4 text-sm text-[var(--popover-foreground)] shadow-sm outline-none", className), ...props }, children));
|
|
140
|
+
}
|