From cbf03d111c1c3b8a0ef908e95fad4bf788cc907c Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 24 Aug 2026 19:28:46 +0000 Subject: [PATCH] docs(components,plugins): replace the undeclared `ActionConfig` annotation where the built types determine the answer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `ActionConfig` is named by 16 references across 15 `content/docs/components` pages and is exported by nothing: `@object-ui/types` has no such member (TS2724, "Did you mean 'AIConfig'?") and no `packages/*/src` file declares it. Each site was resolved individually against the BUILT `packages/*/dist/*.d.ts` — never against source — rather than by picking one replacement name. Six sites name a prop the shipped schema type really declares, so those six are corrected to the type it declares. The other ten do not resolve to anything and are left for a ruling; none of the sixteen resolves to `ActionSchema` or `UIActionSchema`. Two one-file defects surfaced by the same probe are fixed here: * `feedback/sonner.mdx` declared `action` twice in one interface (TS2300 / TS2687 / TS2717). The first was the discriminant, misspelt: the shipped `SonnerSchema` declares `type: 'sonner'`, and the variant union the page called `type?` is the shipped `variant?`, which is also the key the renderer reads (`renderers/feedback/sonner.tsx:22-25`). * `plugins/plugin-dashboard.mdx` shipped a block that has never parsed (TS1109 — `widgets: [...]` is a spread with no operand). It also imported `DashboardSchema` and `MetricCardSchema` from `@object-ui/plugin-dashboard`, neither of which that package exports. Rewritten against the real surface: `DashboardComponentSchema` / `DashboardWidgetSchema` from `@object-ui/types`. No `FRAGMENT_MARKER` was added — these are genuinely TypeScript. Declared fragments stay at 111, unmoved. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_019b5UBNMtTzKbVtZZGvFuxe --- content/docs/components/basic/pagination.mdx | 2 +- content/docs/components/disclosure/toggle-group.mdx | 2 +- content/docs/components/feedback/sonner.mdx | 4 ++-- content/docs/components/form/button.mdx | 2 +- content/docs/components/form/form.mdx | 2 +- content/docs/components/form/input-otp.mdx | 4 ++-- content/docs/plugins/plugin-dashboard.mdx | 13 ++++++++++--- 7 files changed, 18 insertions(+), 11 deletions(-) diff --git a/content/docs/components/basic/pagination.mdx b/content/docs/components/basic/pagination.mdx index abf3e30c9c..512d100694 100644 --- a/content/docs/components/basic/pagination.mdx +++ b/content/docs/components/basic/pagination.mdx @@ -24,7 +24,7 @@ interface PaginationSchema { totalItems?: number; // Total number of items // Events - onPageChange?: string | ActionConfig; + onPageChange?: (page: number) => void; // Styling className?: string; diff --git a/content/docs/components/disclosure/toggle-group.mdx b/content/docs/components/disclosure/toggle-group.mdx index 57067efd80..022427bffa 100644 --- a/content/docs/components/disclosure/toggle-group.mdx +++ b/content/docs/components/disclosure/toggle-group.mdx @@ -38,7 +38,7 @@ interface ToggleGroupSchema { size?: 'sm' | 'default' | 'lg'; // Events - onValueChange?: string | ActionConfig; + onValueChange?: (value: string | string[]) => void; // States disabled?: boolean; diff --git a/content/docs/components/feedback/sonner.mdx b/content/docs/components/feedback/sonner.mdx index 2101f9c4fb..d3867eebab 100644 --- a/content/docs/components/feedback/sonner.mdx +++ b/content/docs/components/feedback/sonner.mdx @@ -28,10 +28,10 @@ The Sonner component provides beautiful toast notifications with a rich API. ```plaintext interface SonnerSchema { - action: 'sonner'; + type: 'sonner'; message: string; // Toast message description?: string; // Additional description - type?: 'default' | 'success' | 'error' | 'warning' | 'info'; + variant?: 'default' | 'success' | 'error' | 'warning' | 'info'; duration?: number; // Auto-close duration (ms) // Action diff --git a/content/docs/components/form/button.mdx b/content/docs/components/form/button.mdx index 0c020a0141..ec33db2324 100644 --- a/content/docs/components/form/button.mdx +++ b/content/docs/components/form/button.mdx @@ -61,7 +61,7 @@ interface ButtonSchema { loading?: boolean; // Actions - onClick?: string | ActionConfig; // Action on click + onClick?: () => void | Promise; // Click handler href?: string; // Link URL (renders as link) // Styling diff --git a/content/docs/components/form/form.mdx b/content/docs/components/form/form.mdx index f2601e8061..77c4ef4e70 100644 --- a/content/docs/components/form/form.mdx +++ b/content/docs/components/form/form.mdx @@ -47,7 +47,7 @@ interface FormSchema { }; // Events - onSubmit?: string | ActionConfig; + onSubmit?: (data: Record) => void | Promise; // Layout columns?: number; // Grid layout diff --git a/content/docs/components/form/input-otp.mdx b/content/docs/components/form/input-otp.mdx index e576139619..5a2ac21f51 100644 --- a/content/docs/components/form/input-otp.mdx +++ b/content/docs/components/form/input-otp.mdx @@ -32,8 +32,8 @@ interface InputOTPSchema { separator?: boolean; // Show visual separator // Events - onChange?: string | ActionConfig; - onComplete?: string | ActionConfig; + onChange?: (value: string) => void; + onComplete?: (value: string) => void; // States disabled?: boolean; diff --git a/content/docs/plugins/plugin-dashboard.mdx b/content/docs/plugins/plugin-dashboard.mdx index 3c6da6eeff..2699c25533 100644 --- a/content/docs/plugins/plugin-dashboard.mdx +++ b/content/docs/plugins/plugin-dashboard.mdx @@ -329,12 +329,19 @@ from widget `options`. In particular, on a dataset-bound gauge: ## TypeScript Support ```plaintext -import type { DashboardSchema, MetricCardSchema } from '@object-ui/plugin-dashboard'; +import type { DashboardComponentSchema, DashboardWidgetSchema } from '@object-ui/types'; -const dashboard: DashboardSchema = { +const widget: DashboardWidgetSchema = { + id: 'revenue', + title: 'Revenue', + type: 'metric-card', + layout: { x: 0, y: 0, w: 1, h: 1 }, +}; + +const dashboard: DashboardComponentSchema = { type: 'dashboard', columns: 3, - widgets: [...] + widgets: [widget], }; ```