veryfront 0.1.1238 → 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.js +1 -1
- package/esm/cli/commands/generate/command.d.ts.map +1 -1
- package/esm/cli/commands/generate/command.js +2 -3
- 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 +10 -0
- package/esm/cli/shared/args.d.ts.map +1 -1
- package/esm/cli/shared/args.js +15 -2
- 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/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/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 +55 -2
- 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/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/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 +13 -3
- 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/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
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NavigationMenu: a horizontal site-navigation bar whose items can open a
|
|
3
|
+
* dropdown panel of links. Self-contained (context + `aria-expanded` triggers,
|
|
4
|
+
* no floating engine): the root owns which item's panel is open and only one is
|
|
5
|
+
* open at a time. A `NavigationMenuTrigger` toggles its panel on click and opens
|
|
6
|
+
* it on pointer-enter; its `NavigationMenuContent` renders absolutely under the
|
|
7
|
+
* trigger while open (`data-state="open"`). Plain `NavigationMenuLink` items with
|
|
8
|
+
* no panel are supported for simple top-level links. Skinned with veryfront
|
|
9
|
+
* theme tokens.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* import {
|
|
14
|
+
* NavigationMenu,
|
|
15
|
+
* NavigationMenuContent,
|
|
16
|
+
* NavigationMenuItem,
|
|
17
|
+
* NavigationMenuLink,
|
|
18
|
+
* NavigationMenuList,
|
|
19
|
+
* NavigationMenuTrigger,
|
|
20
|
+
* } from "veryfront/ui";
|
|
21
|
+
*
|
|
22
|
+
* <NavigationMenu>
|
|
23
|
+
* <NavigationMenuList>
|
|
24
|
+
* <NavigationMenuItem value="products">
|
|
25
|
+
* <NavigationMenuTrigger>Products</NavigationMenuTrigger>
|
|
26
|
+
* <NavigationMenuContent>
|
|
27
|
+
* <NavigationMenuLink href="/analytics">Analytics</NavigationMenuLink>
|
|
28
|
+
* <NavigationMenuLink href="/automation">Automation</NavigationMenuLink>
|
|
29
|
+
* </NavigationMenuContent>
|
|
30
|
+
* </NavigationMenuItem>
|
|
31
|
+
* <NavigationMenuItem value="docs">
|
|
32
|
+
* <NavigationMenuLink href="/docs">Docs</NavigationMenuLink>
|
|
33
|
+
* </NavigationMenuItem>
|
|
34
|
+
* </NavigationMenuList>
|
|
35
|
+
* </NavigationMenu>;
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @module react/components/ui/navigation-menu
|
|
39
|
+
*/
|
|
40
|
+
import * as React from "react";
|
|
41
|
+
/** Props accepted by `<NavigationMenu>`. */
|
|
42
|
+
export interface NavigationMenuProps extends React.HTMLAttributes<HTMLElement> {
|
|
43
|
+
/** Accessible name for the navigation landmark. @default "Main" */
|
|
44
|
+
label?: string;
|
|
45
|
+
/** The `NavigationMenuList` (and its items) that make up the nav. */
|
|
46
|
+
children: React.ReactNode;
|
|
47
|
+
/** React 19: ref is a regular prop, points at the `<nav>` landmark. */
|
|
48
|
+
ref?: React.Ref<HTMLElement>;
|
|
49
|
+
}
|
|
50
|
+
/** Navigation root: a `<nav>` landmark that owns which item's panel is open. */
|
|
51
|
+
export declare function NavigationMenu({ label, className, children, ref, onBlur, onKeyDown, ...props }: NavigationMenuProps): React.ReactElement;
|
|
52
|
+
/** Props accepted by `<NavigationMenuList>`. */
|
|
53
|
+
export interface NavigationMenuListProps extends React.HTMLAttributes<HTMLUListElement> {
|
|
54
|
+
/** The `NavigationMenuItem` children of the bar. */
|
|
55
|
+
children: React.ReactNode;
|
|
56
|
+
/** React 19: ref is a regular prop, points at the `<ul>`. */
|
|
57
|
+
ref?: React.Ref<HTMLUListElement>;
|
|
58
|
+
}
|
|
59
|
+
/** The horizontal list container: a flex `<ul>` of items. */
|
|
60
|
+
export declare function NavigationMenuList({ className, children, ref, ...props }: NavigationMenuListProps): React.ReactElement;
|
|
61
|
+
/** Props accepted by `<NavigationMenuItem>`. */
|
|
62
|
+
export interface NavigationMenuItemProps extends React.LiHTMLAttributes<HTMLLIElement> {
|
|
63
|
+
/** Stable identifier linking this item's trigger to its panel and open state. */
|
|
64
|
+
value: string;
|
|
65
|
+
/** The `NavigationMenuTrigger` + `NavigationMenuContent` (or a plain `NavigationMenuLink`). */
|
|
66
|
+
children: React.ReactNode;
|
|
67
|
+
/** React 19: ref is a regular prop, points at the `<li>`. */
|
|
68
|
+
ref?: React.Ref<HTMLLIElement>;
|
|
69
|
+
}
|
|
70
|
+
/** One item in the bar: an `<li>` that provides its value to its trigger/panel. */
|
|
71
|
+
export declare function NavigationMenuItem({ value, className, children, ref, ...props }: NavigationMenuItemProps): React.ReactElement;
|
|
72
|
+
/** Props accepted by `<NavigationMenuTrigger>`. */
|
|
73
|
+
export interface NavigationMenuTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
74
|
+
/** The trigger label (usually a nav word like "Products"). */
|
|
75
|
+
children: React.ReactNode;
|
|
76
|
+
/** React 19: ref is a regular prop, points at the trigger button. */
|
|
77
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
78
|
+
}
|
|
79
|
+
/** The button that toggles its item's panel: `aria-expanded` + `aria-controls`, with a caret. */
|
|
80
|
+
export declare function NavigationMenuTrigger({ className, onClick, onPointerEnter, onPointerLeave, children, ref, ...props }: NavigationMenuTriggerProps): React.ReactElement;
|
|
81
|
+
/** Props accepted by `<NavigationMenuContent>`. */
|
|
82
|
+
export interface NavigationMenuContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
83
|
+
/** The `NavigationMenuLink`s (or other content) for this item's dropdown panel. */
|
|
84
|
+
children: React.ReactNode;
|
|
85
|
+
/** React 19: ref is a regular prop, points at the panel. */
|
|
86
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
87
|
+
}
|
|
88
|
+
/** The dropdown panel for one item: absolutely positioned, rendered only while open. */
|
|
89
|
+
export declare function NavigationMenuContent({ className, children, ref, onPointerEnter, onPointerLeave, ...props }: NavigationMenuContentProps): React.ReactElement | null;
|
|
90
|
+
/** Props accepted by `<NavigationMenuLink>`. */
|
|
91
|
+
export interface NavigationMenuLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
92
|
+
/** Marks this link as the current page (`aria-current="page"` + active styling). @default false */
|
|
93
|
+
active?: boolean;
|
|
94
|
+
/** The link label / content. */
|
|
95
|
+
children: React.ReactNode;
|
|
96
|
+
/** React 19: ref is a regular prop, points at the `<a>`. */
|
|
97
|
+
ref?: React.Ref<HTMLAnchorElement>;
|
|
98
|
+
}
|
|
99
|
+
/** A single navigable link: used inside a panel or as a plain top-level item. */
|
|
100
|
+
export declare function NavigationMenuLink({ active, className, children, ref, ...props }: NavigationMenuLinkProps): React.ReactElement;
|
|
101
|
+
//# sourceMappingURL=navigation-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-menu.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/ui/navigation-menu.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA6C/B,4CAA4C;AAC5C,MAAM,WAAW,mBAAoB,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IAC5E,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,uEAAuE;IACvE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;CAC9B;AAED,gFAAgF;AAChF,wBAAgB,cAAc,CAAC,EAC7B,KAAc,EACd,SAAS,EACT,QAAQ,EACR,GAAG,EACH,MAAM,EACN,SAAS,EACT,GAAG,KAAK,EACT,EAAE,mBAAmB,GAAG,KAAK,CAAC,YAAY,CAyE1C;AAED,gDAAgD;AAChD,MAAM,WAAW,uBAAwB,SAAQ,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC;IACrF,oDAAoD;IACpD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,6DAA6D;IAC7D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;CACnC;AAED,6DAA6D;AAC7D,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACT,EAAE,uBAAuB,GAAG,KAAK,CAAC,YAAY,CAU9C;AAED,gDAAgD;AAChD,MAAM,WAAW,uBAAwB,SAAQ,KAAK,CAAC,gBAAgB,CAAC,aAAa,CAAC;IACpF,iFAAiF;IACjF,KAAK,EAAE,MAAM,CAAC;IACd,+FAA+F;IAC/F,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,6DAA6D;IAC7D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAChC;AAED,mFAAmF;AACnF,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,SAAS,EACT,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACT,EAAE,uBAAuB,GAAG,KAAK,CAAC,YAAY,CAsB9C;AAED,mDAAmD;AACnD,MAAM,WAAW,0BAA2B,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IAC/F,8DAA8D;IAC9D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,qEAAqE;IACrE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;CACpC;AAED,iGAAiG;AACjG,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,OAAO,EACP,cAAc,EACd,cAAc,EACd,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACT,EAAE,0BAA0B,GAAG,KAAK,CAAC,YAAY,CA6DjD;AAED,mDAAmD;AACnD,MAAM,WAAW,0BAA2B,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACtF,mFAAmF;IACnF,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,4DAA4D;IAC5D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC;AAED,wFAAwF;AACxF,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,QAAQ,EACR,GAAG,EACH,cAAc,EACd,cAAc,EACd,GAAG,KAAK,EACT,EAAE,0BAA0B,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAiCxD;AAED,gDAAgD;AAChD,MAAM,WAAW,uBAAwB,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IAC5F,mGAAmG;IACnG,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gCAAgC;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,4DAA4D;IAC5D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;CACpC;AAED,iFAAiF;AACjF,wBAAgB,kBAAkB,CAAC,EACjC,MAAc,EACd,SAAS,EACT,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACT,EAAE,uBAAuB,GAAG,KAAK,CAAC,YAAY,CAqB9C"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NavigationMenu: a horizontal site-navigation bar whose items can open a
|
|
3
|
+
* dropdown panel of links. Self-contained (context + `aria-expanded` triggers,
|
|
4
|
+
* no floating engine): the root owns which item's panel is open and only one is
|
|
5
|
+
* open at a time. A `NavigationMenuTrigger` toggles its panel on click and opens
|
|
6
|
+
* it on pointer-enter; its `NavigationMenuContent` renders absolutely under the
|
|
7
|
+
* trigger while open (`data-state="open"`). Plain `NavigationMenuLink` items with
|
|
8
|
+
* no panel are supported for simple top-level links. Skinned with veryfront
|
|
9
|
+
* theme tokens.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* import {
|
|
14
|
+
* NavigationMenu,
|
|
15
|
+
* NavigationMenuContent,
|
|
16
|
+
* NavigationMenuItem,
|
|
17
|
+
* NavigationMenuLink,
|
|
18
|
+
* NavigationMenuList,
|
|
19
|
+
* NavigationMenuTrigger,
|
|
20
|
+
* } from "veryfront/ui";
|
|
21
|
+
*
|
|
22
|
+
* <NavigationMenu>
|
|
23
|
+
* <NavigationMenuList>
|
|
24
|
+
* <NavigationMenuItem value="products">
|
|
25
|
+
* <NavigationMenuTrigger>Products</NavigationMenuTrigger>
|
|
26
|
+
* <NavigationMenuContent>
|
|
27
|
+
* <NavigationMenuLink href="/analytics">Analytics</NavigationMenuLink>
|
|
28
|
+
* <NavigationMenuLink href="/automation">Automation</NavigationMenuLink>
|
|
29
|
+
* </NavigationMenuContent>
|
|
30
|
+
* </NavigationMenuItem>
|
|
31
|
+
* <NavigationMenuItem value="docs">
|
|
32
|
+
* <NavigationMenuLink href="/docs">Docs</NavigationMenuLink>
|
|
33
|
+
* </NavigationMenuItem>
|
|
34
|
+
* </NavigationMenuList>
|
|
35
|
+
* </NavigationMenu>;
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @module react/components/ui/navigation-menu
|
|
39
|
+
*/
|
|
40
|
+
import * as React from "react";
|
|
41
|
+
import { cx as cn } from "./cva.js";
|
|
42
|
+
import { focusWithoutScroll } from "./focus-management.js";
|
|
43
|
+
import { composeRefs } from "./slot.js";
|
|
44
|
+
const CLOSE_DELAY_MS = 100;
|
|
45
|
+
const NavigationMenuContext = React.createContext(null);
|
|
46
|
+
/** Per-item context carrying the identity that links a trigger to its panel. */
|
|
47
|
+
const NavigationMenuItemContext = React.createContext(null);
|
|
48
|
+
function useNavigationMenuContext(part) {
|
|
49
|
+
const ctx = React.useContext(NavigationMenuContext);
|
|
50
|
+
if (!ctx)
|
|
51
|
+
throw new Error(`<${part}> must be used within <NavigationMenu>`);
|
|
52
|
+
return ctx;
|
|
53
|
+
}
|
|
54
|
+
function useNavigationMenuItem(part) {
|
|
55
|
+
const identity = React.useContext(NavigationMenuItemContext);
|
|
56
|
+
if (identity == null)
|
|
57
|
+
throw new Error(`<${part}> must be used within <NavigationMenuItem>`);
|
|
58
|
+
return identity;
|
|
59
|
+
}
|
|
60
|
+
/** Navigation root: a `<nav>` landmark that owns which item's panel is open. */
|
|
61
|
+
export function NavigationMenu({ label = "Main", className, children, ref, onBlur, onKeyDown, ...props }) {
|
|
62
|
+
const [openItemId, setOpenItemIdState] = React.useState(null);
|
|
63
|
+
const closeTimerRef = React.useRef(null);
|
|
64
|
+
const triggerRefs = React.useRef(new Map());
|
|
65
|
+
const cancelClose = React.useCallback(() => {
|
|
66
|
+
if (closeTimerRef.current != null) {
|
|
67
|
+
clearTimeout(closeTimerRef.current);
|
|
68
|
+
closeTimerRef.current = null;
|
|
69
|
+
}
|
|
70
|
+
}, []);
|
|
71
|
+
const setOpenItemId = React.useCallback((itemId) => {
|
|
72
|
+
cancelClose();
|
|
73
|
+
setOpenItemIdState(itemId);
|
|
74
|
+
}, [cancelClose]);
|
|
75
|
+
const scheduleClose = React.useCallback((itemId) => {
|
|
76
|
+
cancelClose();
|
|
77
|
+
closeTimerRef.current = setTimeout(() => {
|
|
78
|
+
closeTimerRef.current = null;
|
|
79
|
+
setOpenItemIdState((current) => current === itemId ? null : current);
|
|
80
|
+
}, CLOSE_DELAY_MS);
|
|
81
|
+
}, [cancelClose]);
|
|
82
|
+
const registerTrigger = React.useCallback((itemId, element) => {
|
|
83
|
+
if (element)
|
|
84
|
+
triggerRefs.current.set(itemId, element);
|
|
85
|
+
else
|
|
86
|
+
triggerRefs.current.delete(itemId);
|
|
87
|
+
}, []);
|
|
88
|
+
const getTrigger = React.useCallback((itemId) => {
|
|
89
|
+
return triggerRefs.current.get(itemId) ?? null;
|
|
90
|
+
}, []);
|
|
91
|
+
const closeAndRestoreTrigger = React.useCallback(() => {
|
|
92
|
+
const itemId = openItemId;
|
|
93
|
+
if (itemId == null)
|
|
94
|
+
return;
|
|
95
|
+
const trigger = getTrigger(itemId);
|
|
96
|
+
setOpenItemId(null);
|
|
97
|
+
queueMicrotask(() => {
|
|
98
|
+
if (trigger?.isConnected)
|
|
99
|
+
focusWithoutScroll(trigger);
|
|
100
|
+
});
|
|
101
|
+
}, [getTrigger, openItemId, setOpenItemId]);
|
|
102
|
+
React.useEffect(() => cancelClose, [cancelClose]);
|
|
103
|
+
const ctx = React.useMemo(() => ({ openItemId, setOpenItemId, cancelClose, scheduleClose, registerTrigger, getTrigger }), [openItemId, setOpenItemId, cancelClose, scheduleClose, registerTrigger, getTrigger]);
|
|
104
|
+
return (React.createElement(NavigationMenuContext.Provider, { value: ctx },
|
|
105
|
+
React.createElement("nav", { ref: ref, "aria-label": label, "data-state": openItemId == null ? "closed" : "open", className: cn("relative inline-flex max-w-max items-center", className), onBlur: (event) => {
|
|
106
|
+
onBlur?.(event);
|
|
107
|
+
if (event.defaultPrevented)
|
|
108
|
+
return;
|
|
109
|
+
const next = event.relatedTarget;
|
|
110
|
+
if (!(next instanceof HTMLElement) || !event.currentTarget.contains(next)) {
|
|
111
|
+
setOpenItemId(null);
|
|
112
|
+
}
|
|
113
|
+
}, onKeyDown: (event) => {
|
|
114
|
+
onKeyDown?.(event);
|
|
115
|
+
if (event.defaultPrevented)
|
|
116
|
+
return;
|
|
117
|
+
if (event.key !== "Escape" || openItemId == null)
|
|
118
|
+
return;
|
|
119
|
+
event.preventDefault();
|
|
120
|
+
closeAndRestoreTrigger();
|
|
121
|
+
}, ...props }, children)));
|
|
122
|
+
}
|
|
123
|
+
/** The horizontal list container: a flex `<ul>` of items. */
|
|
124
|
+
export function NavigationMenuList({ className, children, ref, ...props }) {
|
|
125
|
+
return (React.createElement("ul", { ref: ref, className: cn("flex flex-1 list-none items-center gap-1", className), ...props }, children));
|
|
126
|
+
}
|
|
127
|
+
/** One item in the bar: an `<li>` that provides its value to its trigger/panel. */
|
|
128
|
+
export function NavigationMenuItem({ value, className, children, ref, ...props }) {
|
|
129
|
+
const ctx = React.useContext(NavigationMenuContext);
|
|
130
|
+
// Identity is per instance, not per `value`. Two items may legitimately carry
|
|
131
|
+
// the same `value`; keying open state on it would open both panels at once
|
|
132
|
+
// and mint duplicate panel ids, making aria-controls ambiguous.
|
|
133
|
+
const reactId = React.useId();
|
|
134
|
+
const itemId = `vf-navigation-menu-${reactId}`;
|
|
135
|
+
const open = ctx?.openItemId === itemId;
|
|
136
|
+
const identity = React.useMemo(() => ({ value, itemId }), [value, itemId]);
|
|
137
|
+
return (React.createElement(NavigationMenuItemContext.Provider, { value: identity },
|
|
138
|
+
React.createElement("li", { ref: ref, "data-value": value, "data-state": open ? "open" : "closed", className: cn("relative", className), ...props }, children)));
|
|
139
|
+
}
|
|
140
|
+
/** The button that toggles its item's panel: `aria-expanded` + `aria-controls`, with a caret. */
|
|
141
|
+
export function NavigationMenuTrigger({ className, onClick, onPointerEnter, onPointerLeave, children, ref, ...props }) {
|
|
142
|
+
const ctx = useNavigationMenuContext("NavigationMenuTrigger");
|
|
143
|
+
const { itemId } = useNavigationMenuItem("NavigationMenuTrigger");
|
|
144
|
+
const open = ctx.openItemId === itemId;
|
|
145
|
+
const panelId = `${itemId}-panel`;
|
|
146
|
+
const triggerRef = React.useCallback((element) => {
|
|
147
|
+
ctx.registerTrigger(itemId, element);
|
|
148
|
+
}, [ctx, itemId]);
|
|
149
|
+
const composedRef = React.useMemo(() => composeRefs(triggerRef, ref), [ref, triggerRef]);
|
|
150
|
+
return (React.createElement("button", { ref: composedRef, type: "button", "aria-expanded": open, "aria-controls": open ? panelId : undefined, "data-state": open ? "open" : "closed", onClick: (event) => {
|
|
151
|
+
onClick?.(event);
|
|
152
|
+
if (!event.defaultPrevented)
|
|
153
|
+
ctx.setOpenItemId(open ? null : itemId);
|
|
154
|
+
}, onPointerEnter: (event) => {
|
|
155
|
+
onPointerEnter?.(event);
|
|
156
|
+
if (!event.defaultPrevented && !event.currentTarget.disabled) {
|
|
157
|
+
ctx.setOpenItemId(itemId);
|
|
158
|
+
}
|
|
159
|
+
}, onPointerLeave: (event) => {
|
|
160
|
+
onPointerLeave?.(event);
|
|
161
|
+
if (!event.defaultPrevented && open)
|
|
162
|
+
ctx.scheduleClose(itemId);
|
|
163
|
+
}, className: cn("inline-flex h-9 select-none items-center gap-1 rounded-md px-3 text-sm font-medium", "text-[var(--foreground)] outline-none transition-colors", "hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)]", "focus-visible:ring-2 focus-visible:ring-[var(--ring)]", "data-[state=open]:bg-[var(--accent)] data-[state=open]:text-[var(--accent-foreground)]", className), ...props },
|
|
164
|
+
children,
|
|
165
|
+
React.createElement("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", className: "h-3 w-3 transition-transform duration-200 data-[state=open]:rotate-180", "data-state": open ? "open" : "closed", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" },
|
|
166
|
+
React.createElement("polyline", { points: "6 9 12 15 18 9" }))));
|
|
167
|
+
}
|
|
168
|
+
/** The dropdown panel for one item: absolutely positioned, rendered only while open. */
|
|
169
|
+
export function NavigationMenuContent({ className, children, ref, onPointerEnter, onPointerLeave, ...props }) {
|
|
170
|
+
const ctx = useNavigationMenuContext("NavigationMenuContent");
|
|
171
|
+
const { itemId } = useNavigationMenuItem("NavigationMenuContent");
|
|
172
|
+
const open = ctx.openItemId === itemId;
|
|
173
|
+
if (!open)
|
|
174
|
+
return null;
|
|
175
|
+
// Deliberately not role="menu". That role declares an application-menu
|
|
176
|
+
// keyboard model (arrows, Home/End, Escape, roving focus) which site
|
|
177
|
+
// navigation does not implement and does not want. A plain disclosure panel
|
|
178
|
+
// of links is the accessible pattern here.
|
|
179
|
+
return (React.createElement("div", { ref: ref, id: `${itemId}-panel`, "data-slot": "navigation-menu-content", "data-state": "open", className: cn("absolute left-0 top-full z-50 mt-1 flex min-w-[12rem] flex-col gap-1 p-1", "rounded-md border border-[var(--border)] bg-[var(--popover)] text-[var(--popover-foreground)] shadow-md", className), onPointerEnter: (event) => {
|
|
180
|
+
onPointerEnter?.(event);
|
|
181
|
+
if (!event.defaultPrevented)
|
|
182
|
+
ctx.cancelClose();
|
|
183
|
+
}, onPointerLeave: (event) => {
|
|
184
|
+
onPointerLeave?.(event);
|
|
185
|
+
if (!event.defaultPrevented)
|
|
186
|
+
ctx.scheduleClose(itemId);
|
|
187
|
+
}, ...props }, children));
|
|
188
|
+
}
|
|
189
|
+
/** A single navigable link: used inside a panel or as a plain top-level item. */
|
|
190
|
+
export function NavigationMenuLink({ active = false, className, children, ref, ...props }) {
|
|
191
|
+
return (
|
|
192
|
+
// No role="menuitem": it is only meaningful inside a real menu/menubar, and
|
|
193
|
+
// a plain top-level link has no menu owner at all. A bare <a> is correct.
|
|
194
|
+
React.createElement("a", { ref: ref, "aria-current": active ? "page" : undefined, "data-active": active ? "" : undefined, className: cn("block select-none rounded-md px-3 py-2 text-sm font-medium no-underline outline-none transition-colors", "text-[var(--foreground)]", "hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)]", "focus-visible:ring-2 focus-visible:ring-[var(--ring)]", "data-[active]:bg-[var(--accent)] data-[active]:text-[var(--accent-foreground)]", className), ...props }, children));
|
|
195
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NumberField - a numeric text input with clamping and keyboard stepping.
|
|
3
|
+
*
|
|
4
|
+
* A single `<input>` that keeps its value within
|
|
5
|
+
* `[min, max]`, rounds to `step`, and steps with ArrowUp/ArrowDown. Controlled
|
|
6
|
+
* via `value`/`onValueChange` or uncontrolled via `defaultValue`. Skinned with
|
|
7
|
+
* the veryfront theme tokens; no adapter or engine required.
|
|
8
|
+
*
|
|
9
|
+
* @example Uncontrolled, clamped 0-10
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { NumberField } from "veryfront/ui";
|
|
12
|
+
*
|
|
13
|
+
* <NumberField defaultValue={1} min={0} max={10} aria-label="Quantity" />;
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @example Controlled
|
|
17
|
+
* ```tsx
|
|
18
|
+
* const [qty, setQty] = React.useState(1);
|
|
19
|
+
* <NumberField value={qty} onValueChange={setQty} min={1} step={1} />;
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @module react/components/ui/number-field
|
|
23
|
+
*/
|
|
24
|
+
import * as React from "react";
|
|
25
|
+
/** Props accepted by `<NumberField>`. */
|
|
26
|
+
export interface NumberFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange"> {
|
|
27
|
+
/** Controlled value (pair with `onValueChange`). `null` means empty. */
|
|
28
|
+
value?: number | null;
|
|
29
|
+
/** Initial value when uncontrolled. */
|
|
30
|
+
defaultValue?: number;
|
|
31
|
+
/** Fires with the next value (`null` when the field is cleared). */
|
|
32
|
+
onValueChange?: (value: number | null) => void;
|
|
33
|
+
/** Smallest allowed value; also the floor for ArrowDown stepping. */
|
|
34
|
+
min?: number;
|
|
35
|
+
/** Largest allowed value; also the ceiling for ArrowUp stepping. */
|
|
36
|
+
max?: number;
|
|
37
|
+
/** Increment applied on ArrowUp/ArrowDown and used to round input. @default 1 */
|
|
38
|
+
step?: number;
|
|
39
|
+
/** React 19: ref is a regular prop. */
|
|
40
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
41
|
+
}
|
|
42
|
+
/** Quantize a value to the nearest positive step, using `min` as the step base. */
|
|
43
|
+
export declare function quantizeNumberFieldValue(value: number, step: number, min?: number): number;
|
|
44
|
+
/** Render a numeric input that clamps to `[min, max]` and steps by `step`. */
|
|
45
|
+
export declare function NumberField({ value, defaultValue, onValueChange, min, max, step, className, disabled, inputMode, onKeyDown, onBlur, ref, ...props }: NumberFieldProps): React.ReactElement;
|
|
46
|
+
//# sourceMappingURL=number-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number-field.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/ui/number-field.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,yCAAyC;AACzC,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,OAAO,GAAG,cAAc,GAAG,UAAU,CAAC;IAChG,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,uCAAuC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/C,qEAAqE;IACrE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;CACnC;AAeD,mFAAmF;AACnF,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAM1F;AAWD,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,YAAY,EACZ,aAAa,EACb,GAAG,EACH,GAAG,EACH,IAAQ,EACR,SAAS,EACT,QAAQ,EACR,SAAS,EACT,SAAS,EACT,MAAM,EACN,GAAG,EACH,GAAG,KAAK,EACT,EAAE,gBAAgB,GAAG,KAAK,CAAC,YAAY,CA8FvC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NumberField - a numeric text input with clamping and keyboard stepping.
|
|
3
|
+
*
|
|
4
|
+
* A single `<input>` that keeps its value within
|
|
5
|
+
* `[min, max]`, rounds to `step`, and steps with ArrowUp/ArrowDown. Controlled
|
|
6
|
+
* via `value`/`onValueChange` or uncontrolled via `defaultValue`. Skinned with
|
|
7
|
+
* the veryfront theme tokens; no adapter or engine required.
|
|
8
|
+
*
|
|
9
|
+
* @example Uncontrolled, clamped 0-10
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { NumberField } from "veryfront/ui";
|
|
12
|
+
*
|
|
13
|
+
* <NumberField defaultValue={1} min={0} max={10} aria-label="Quantity" />;
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @example Controlled
|
|
17
|
+
* ```tsx
|
|
18
|
+
* const [qty, setQty] = React.useState(1);
|
|
19
|
+
* <NumberField value={qty} onValueChange={setQty} min={1} step={1} />;
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @module react/components/ui/number-field
|
|
23
|
+
*/
|
|
24
|
+
import * as React from "react";
|
|
25
|
+
import { cx as cn } from "./cva.js";
|
|
26
|
+
const COMPLETE_NUMBER_PATTERN = /^[+-]?(?:\d+|\d*\.\d+)(?:[eE][+-]?\d+)?$/;
|
|
27
|
+
const NUMERIC_PREFIX_PATTERN = /^[+-]?(?:(?:\d+\.?\d*)|(?:\.\d*))?(?:[eE][+-]?\d*)?$/;
|
|
28
|
+
function clamp(n, min, max) {
|
|
29
|
+
if (min != null && n < min)
|
|
30
|
+
return min;
|
|
31
|
+
if (max != null && n > max)
|
|
32
|
+
return max;
|
|
33
|
+
return n;
|
|
34
|
+
}
|
|
35
|
+
function decimalPlaces(value) {
|
|
36
|
+
const [coefficient, exponentText] = value.toString().toLowerCase().split("e");
|
|
37
|
+
const fractionLength = coefficient?.split(".")[1]?.length ?? 0;
|
|
38
|
+
const exponent = Number(exponentText ?? 0);
|
|
39
|
+
return Math.max(0, fractionLength - exponent);
|
|
40
|
+
}
|
|
41
|
+
/** Quantize a value to the nearest positive step, using `min` as the step base. */
|
|
42
|
+
export function quantizeNumberFieldValue(value, step, min) {
|
|
43
|
+
if (!Number.isFinite(step) || step <= 0)
|
|
44
|
+
return value;
|
|
45
|
+
const base = min ?? 0;
|
|
46
|
+
const quantized = base + Math.round((value - base) / step) * step;
|
|
47
|
+
const precision = Math.min(12, Math.max(decimalPlaces(base), decimalPlaces(step)));
|
|
48
|
+
return Number(quantized.toFixed(precision));
|
|
49
|
+
}
|
|
50
|
+
function normalizeNumberFieldValue(value, step, min, max) {
|
|
51
|
+
return clamp(quantizeNumberFieldValue(value, step, min), min, max);
|
|
52
|
+
}
|
|
53
|
+
/** Render a numeric input that clamps to `[min, max]` and steps by `step`. */
|
|
54
|
+
export function NumberField({ value, defaultValue, onValueChange, min, max, step = 1, className, disabled, inputMode, onKeyDown, onBlur, ref, ...props }) {
|
|
55
|
+
const isControlled = value !== undefined;
|
|
56
|
+
const [internal, setInternal] = React.useState(() => defaultValue == null ? null : normalizeNumberFieldValue(defaultValue, step, min, max));
|
|
57
|
+
const [draft, setDraft] = React.useState(null);
|
|
58
|
+
const current = isControlled ? value : internal;
|
|
59
|
+
const controlledValueRef = React.useRef(value);
|
|
60
|
+
const resolvedInputMode = inputMode ?? (Number.isInteger(step) ? "numeric" : "decimal");
|
|
61
|
+
React.useEffect(() => {
|
|
62
|
+
if (isControlled && !Object.is(controlledValueRef.current, value))
|
|
63
|
+
setDraft(null);
|
|
64
|
+
controlledValueRef.current = value;
|
|
65
|
+
}, [isControlled, value]);
|
|
66
|
+
const commit = (next) => {
|
|
67
|
+
if (!isControlled)
|
|
68
|
+
setInternal(next);
|
|
69
|
+
onValueChange?.(next);
|
|
70
|
+
};
|
|
71
|
+
const handleChange = (event) => {
|
|
72
|
+
const raw = event.target.value.trim();
|
|
73
|
+
if (raw === "") {
|
|
74
|
+
setDraft(null);
|
|
75
|
+
return commit(null);
|
|
76
|
+
}
|
|
77
|
+
if (NUMERIC_PREFIX_PATTERN.test(raw) && !COMPLETE_NUMBER_PATTERN.test(raw)) {
|
|
78
|
+
setDraft(event.target.value);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const parsed = Number(raw);
|
|
82
|
+
if (Number.isNaN(parsed))
|
|
83
|
+
return;
|
|
84
|
+
setDraft(null);
|
|
85
|
+
commit(normalizeNumberFieldValue(parsed, step, min, max));
|
|
86
|
+
};
|
|
87
|
+
const handleBlur = (event) => {
|
|
88
|
+
onBlur?.(event);
|
|
89
|
+
if (event.defaultPrevented || draft == null)
|
|
90
|
+
return;
|
|
91
|
+
const parsed = Number(draft.trim());
|
|
92
|
+
setDraft(null);
|
|
93
|
+
if (!Number.isNaN(parsed)) {
|
|
94
|
+
commit(normalizeNumberFieldValue(parsed, step, min, max));
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
const nudge = (direction) => {
|
|
98
|
+
const parsedDraft = draft == null ? Number.NaN : Number(draft.trim());
|
|
99
|
+
const draftBase = Number.isNaN(parsedDraft)
|
|
100
|
+
? null
|
|
101
|
+
: normalizeNumberFieldValue(parsedDraft, step, min, max);
|
|
102
|
+
const base = draftBase ?? current ??
|
|
103
|
+
(direction === 1 ? (min ?? 0) - step : (max ?? 0) + step);
|
|
104
|
+
setDraft(null);
|
|
105
|
+
commit(clamp(base + direction * step, min, max));
|
|
106
|
+
};
|
|
107
|
+
const handleKeyDown = (event) => {
|
|
108
|
+
onKeyDown?.(event);
|
|
109
|
+
if (event.defaultPrevented || disabled)
|
|
110
|
+
return;
|
|
111
|
+
if (event.key === "ArrowUp") {
|
|
112
|
+
event.preventDefault();
|
|
113
|
+
nudge(1);
|
|
114
|
+
}
|
|
115
|
+
else if (event.key === "ArrowDown") {
|
|
116
|
+
event.preventDefault();
|
|
117
|
+
nudge(-1);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
return (React.createElement("input", { ref: ref, inputMode: resolvedInputMode, role: "spinbutton", "aria-valuenow": current ?? undefined, "aria-valuemin": min, "aria-valuemax": max, disabled: disabled, value: draft ?? current ?? "", onChange: handleChange, onBlur: handleBlur, onKeyDown: handleKeyDown, "data-disabled": disabled ? "" : undefined, className: cn("h-[38px] w-full rounded-md px-3 text-base tabular-nums", "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 }));
|
|
121
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pagination: a non-interactive compound for paging navigation. Structure is
|
|
3
|
+
* modelled on shadcn's pagination (a landmark `<nav>` wrapping a `<ul>` of
|
|
4
|
+
* `<li>` links) and restyled with the veryfront theme tokens. The active page is
|
|
5
|
+
* a {@link PaginationLink} with `isActive` (→ `aria-current="page"`);
|
|
6
|
+
* {@link PaginationPrevious}/{@link PaginationNext} are labelled link variants and
|
|
7
|
+
* {@link PaginationEllipsis} marks a gap in the page sequence.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <Pagination>
|
|
12
|
+
* <PaginationContent>
|
|
13
|
+
* <PaginationItem><PaginationPrevious href="?page=1" /></PaginationItem>
|
|
14
|
+
* <PaginationItem><PaginationLink href="?page=1">1</PaginationLink></PaginationItem>
|
|
15
|
+
* <PaginationItem><PaginationLink href="?page=2" isActive>2</PaginationLink></PaginationItem>
|
|
16
|
+
* <PaginationItem><PaginationLink href="?page=3">3</PaginationLink></PaginationItem>
|
|
17
|
+
* <PaginationItem><PaginationEllipsis /></PaginationItem>
|
|
18
|
+
* <PaginationItem><PaginationNext href="?page=3" /></PaginationItem>
|
|
19
|
+
* </PaginationContent>
|
|
20
|
+
* </Pagination>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @module react/components/ui/pagination
|
|
24
|
+
*/
|
|
25
|
+
import * as React from "react";
|
|
26
|
+
/** Props accepted by `<Pagination>`. */
|
|
27
|
+
export interface PaginationProps extends React.HTMLAttributes<HTMLElement> {
|
|
28
|
+
/** React 19: ref is a regular prop. */
|
|
29
|
+
ref?: React.Ref<HTMLElement>;
|
|
30
|
+
}
|
|
31
|
+
/** The paging landmark: a centered `role="navigation"` region. */
|
|
32
|
+
export declare function Pagination({ className, ref, ...props }: PaginationProps): React.ReactElement;
|
|
33
|
+
/** Props accepted by `<PaginationContent>`. */
|
|
34
|
+
export interface PaginationContentProps extends React.HTMLAttributes<HTMLUListElement> {
|
|
35
|
+
/** React 19: ref is a regular prop. */
|
|
36
|
+
ref?: React.Ref<HTMLUListElement>;
|
|
37
|
+
}
|
|
38
|
+
/** The list of page items: a horizontal `<ul>`. */
|
|
39
|
+
export declare function PaginationContent({ className, ref, ...props }: PaginationContentProps): React.ReactElement;
|
|
40
|
+
/** Props accepted by `<PaginationItem>`. */
|
|
41
|
+
export interface PaginationItemProps extends React.HTMLAttributes<HTMLLIElement> {
|
|
42
|
+
/** React 19: ref is a regular prop. */
|
|
43
|
+
ref?: React.Ref<HTMLLIElement>;
|
|
44
|
+
}
|
|
45
|
+
/** A single page slot: an `<li>` wrapping a link or ellipsis. */
|
|
46
|
+
export declare function PaginationItem({ className, ref, ...props }: PaginationItemProps): React.ReactElement;
|
|
47
|
+
/** Props accepted by `<PaginationLink>`. */
|
|
48
|
+
export interface PaginationLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
49
|
+
/** Marks this link as the current page: sets `aria-current="page"` and active styling. @default false */
|
|
50
|
+
isActive?: boolean;
|
|
51
|
+
/** React 19: ref is a regular prop. */
|
|
52
|
+
ref?: React.Ref<HTMLAnchorElement>;
|
|
53
|
+
}
|
|
54
|
+
/** A page link: highlighted when `isActive`, otherwise hover-highlighted. */
|
|
55
|
+
export declare function PaginationLink({ className, isActive, ref, ...props }: PaginationLinkProps): React.ReactElement;
|
|
56
|
+
/** Props accepted by `<PaginationPrevious>`. */
|
|
57
|
+
export interface PaginationPreviousProps extends PaginationLinkProps {
|
|
58
|
+
/** React 19: ref is a regular prop. */
|
|
59
|
+
ref?: React.Ref<HTMLAnchorElement>;
|
|
60
|
+
}
|
|
61
|
+
/** A "‹ Previous" link: a labelled {@link PaginationLink} variant. */
|
|
62
|
+
export declare function PaginationPrevious({ className, children, ref, ...props }: PaginationPreviousProps): React.ReactElement;
|
|
63
|
+
/** Props accepted by `<PaginationNext>`. */
|
|
64
|
+
export interface PaginationNextProps extends PaginationLinkProps {
|
|
65
|
+
/** React 19: ref is a regular prop. */
|
|
66
|
+
ref?: React.Ref<HTMLAnchorElement>;
|
|
67
|
+
}
|
|
68
|
+
/** A "Next ›" link: a labelled {@link PaginationLink} variant. */
|
|
69
|
+
export declare function PaginationNext({ className, children, ref, ...props }: PaginationNextProps): React.ReactElement;
|
|
70
|
+
/** Props accepted by `<PaginationEllipsis>`. */
|
|
71
|
+
export interface PaginationEllipsisProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
72
|
+
/** React 19: ref is a regular prop. */
|
|
73
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
74
|
+
}
|
|
75
|
+
/** A non-interactive gap marker between page ranges. */
|
|
76
|
+
export declare function PaginationEllipsis({ className, ref, ...props }: PaginationEllipsisProps): React.ReactElement;
|
|
77
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/ui/pagination.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,wCAAwC;AACxC,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IACxE,uCAAuC;IACvC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;CAC9B;AAED,kEAAkE;AAClE,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,GAAG,KAAK,CAAC,YAAY,CAW5F;AAED,+CAA+C;AAC/C,MAAM,WAAW,sBAAuB,SAAQ,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC;IACpF,uCAAuC;IACvC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;CACnC;AAED,mDAAmD;AACnD,wBAAgB,iBAAiB,CAC/B,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,sBAAsB,GACnD,KAAK,CAAC,YAAY,CASpB;AAED,4CAA4C;AAC5C,MAAM,WAAW,mBAAoB,SAAQ,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC;IAC9E,uCAAuC;IACvC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAChC;AAED,iEAAiE;AACjE,wBAAgB,cAAc,CAC5B,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,GAChD,KAAK,CAAC,YAAY,CAEpB;AAED,4CAA4C;AAC5C,MAAM,WAAW,mBAAoB,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IACxF,yGAAyG;IACzG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uCAAuC;IACvC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;CACpC;AAED,6EAA6E;AAC7E,wBAAgB,cAAc,CAC5B,EAAE,SAAS,EAAE,QAAgB,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,GAClE,KAAK,CAAC,YAAY,CAmBpB;AAED,gDAAgD;AAChD,MAAM,WAAW,uBAAwB,SAAQ,mBAAmB;IAClE,uCAAuC;IACvC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;CACpC;AAED,sEAAsE;AACtE,wBAAgB,kBAAkB,CAChC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,uBAAuB,GAC9D,KAAK,CAAC,YAAY,CAiBpB;AAED,4CAA4C;AAC5C,MAAM,WAAW,mBAAoB,SAAQ,mBAAmB;IAC9D,uCAAuC;IACvC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;CACpC;AAED,kEAAkE;AAClE,wBAAgB,cAAc,CAC5B,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,GAC1D,KAAK,CAAC,YAAY,CAiBpB;AAED,gDAAgD;AAChD,MAAM,WAAW,uBAAwB,SAAQ,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;IACpF,uCAAuC;IACvC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAClC;AAED,wDAAwD;AACxD,wBAAgB,kBAAkB,CAChC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,uBAAuB,GACpD,KAAK,CAAC,YAAY,CAgBpB"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pagination: a non-interactive compound for paging navigation. Structure is
|
|
3
|
+
* modelled on shadcn's pagination (a landmark `<nav>` wrapping a `<ul>` of
|
|
4
|
+
* `<li>` links) and restyled with the veryfront theme tokens. The active page is
|
|
5
|
+
* a {@link PaginationLink} with `isActive` (→ `aria-current="page"`);
|
|
6
|
+
* {@link PaginationPrevious}/{@link PaginationNext} are labelled link variants and
|
|
7
|
+
* {@link PaginationEllipsis} marks a gap in the page sequence.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <Pagination>
|
|
12
|
+
* <PaginationContent>
|
|
13
|
+
* <PaginationItem><PaginationPrevious href="?page=1" /></PaginationItem>
|
|
14
|
+
* <PaginationItem><PaginationLink href="?page=1">1</PaginationLink></PaginationItem>
|
|
15
|
+
* <PaginationItem><PaginationLink href="?page=2" isActive>2</PaginationLink></PaginationItem>
|
|
16
|
+
* <PaginationItem><PaginationLink href="?page=3">3</PaginationLink></PaginationItem>
|
|
17
|
+
* <PaginationItem><PaginationEllipsis /></PaginationItem>
|
|
18
|
+
* <PaginationItem><PaginationNext href="?page=3" /></PaginationItem>
|
|
19
|
+
* </PaginationContent>
|
|
20
|
+
* </Pagination>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @module react/components/ui/pagination
|
|
24
|
+
*/
|
|
25
|
+
import * as React from "react";
|
|
26
|
+
import { cx as cn } from "./cva.js";
|
|
27
|
+
/** The paging landmark: a centered `role="navigation"` region. */
|
|
28
|
+
export function Pagination({ className, ref, ...props }) {
|
|
29
|
+
return (React.createElement("nav", { ref: ref, role: "navigation", "aria-label": "pagination", "data-slot": "pagination", className: cn("mx-auto flex w-full justify-center", className), ...props }));
|
|
30
|
+
}
|
|
31
|
+
/** The list of page items: a horizontal `<ul>`. */
|
|
32
|
+
export function PaginationContent({ className, ref, ...props }) {
|
|
33
|
+
return (React.createElement("ul", { ref: ref, "data-slot": "pagination-content", className: cn("flex items-center gap-1", className), ...props }));
|
|
34
|
+
}
|
|
35
|
+
/** A single page slot: an `<li>` wrapping a link or ellipsis. */
|
|
36
|
+
export function PaginationItem({ className, ref, ...props }) {
|
|
37
|
+
return React.createElement("li", { ref: ref, "data-slot": "pagination-item", className: className, ...props });
|
|
38
|
+
}
|
|
39
|
+
/** A page link: highlighted when `isActive`, otherwise hover-highlighted. */
|
|
40
|
+
export function PaginationLink({ className, isActive = false, ref, ...props }) {
|
|
41
|
+
return (React.createElement("a", { ref: ref, "aria-current": isActive ? "page" : undefined, "data-slot": "pagination-link", "data-active": isActive ? "" : undefined, className: cn("inline-flex h-9 min-w-9 items-center justify-center gap-1 rounded-md px-2 text-sm font-medium", "transition-[background-color,color] duration-150 ease-in", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--background)]", isActive
|
|
42
|
+
? "bg-[var(--accent)] text-[var(--accent-foreground)]"
|
|
43
|
+
: "text-[var(--foreground)] hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)]", className), ...props }));
|
|
44
|
+
}
|
|
45
|
+
/** A "‹ Previous" link: a labelled {@link PaginationLink} variant. */
|
|
46
|
+
export function PaginationPrevious({ className, children, ref, ...props }) {
|
|
47
|
+
return (React.createElement(PaginationLink, { ref: ref, "aria-label": "Go to previous page", "data-slot": "pagination-previous", className: cn("px-2.5", className), ...props }, children ?? (React.createElement(React.Fragment, null,
|
|
48
|
+
React.createElement("span", { "aria-hidden": true }, "\u2039"),
|
|
49
|
+
React.createElement("span", null, "Previous")))));
|
|
50
|
+
}
|
|
51
|
+
/** A "Next ›" link: a labelled {@link PaginationLink} variant. */
|
|
52
|
+
export function PaginationNext({ className, children, ref, ...props }) {
|
|
53
|
+
return (React.createElement(PaginationLink, { ref: ref, "aria-label": "Go to next page", "data-slot": "pagination-next", className: cn("px-2.5", className), ...props }, children ?? (React.createElement(React.Fragment, null,
|
|
54
|
+
React.createElement("span", null, "Next"),
|
|
55
|
+
React.createElement("span", { "aria-hidden": true }, "\u203A")))));
|
|
56
|
+
}
|
|
57
|
+
/** A non-interactive gap marker between page ranges. */
|
|
58
|
+
export function PaginationEllipsis({ className, ref, ...props }) {
|
|
59
|
+
return (React.createElement("span", { ref: ref, role: "presentation", "data-slot": "pagination-ellipsis", className: cn("flex h-9 w-9 items-center justify-center text-sm text-[var(--muted-foreground)]", className), ...props },
|
|
60
|
+
React.createElement("span", { "aria-hidden": true }, "\u2026"),
|
|
61
|
+
React.createElement("span", { className: "sr-only" }, "More pages")));
|
|
62
|
+
}
|