diff --git a/.changeset/overlay-slot-requiredness-7106.md b/.changeset/overlay-slot-requiredness-7106.md new file mode 100644 index 000000000..ff0088abf --- /dev/null +++ b/.changeset/overlay-slot-requiredness-7106.md @@ -0,0 +1,8 @@ +--- +--- + +Docs-only fix: `alert-dialog.mdx` and `sheet.mdx` published `trigger`/`content` +node slots as required; the shipped `AlertDialogSchema`/`SheetSchema` +declarations (and their Zod mirrors) already declare them optional. No +declaration changes; test-only update to the fixture pin that records this +class of divergence. diff --git a/content/docs/components/overlay/alert-dialog.mdx b/content/docs/components/overlay/alert-dialog.mdx index 619abefd5..b22a57d5f 100644 --- a/content/docs/components/overlay/alert-dialog.mdx +++ b/content/docs/components/overlay/alert-dialog.mdx @@ -27,7 +27,7 @@ interface AlertDialogSchema { description?: string; // Dialog description // Trigger - trigger: SchemaNode | SchemaNode[]; // Component that triggers the dialog + trigger?: SchemaNode | SchemaNode[]; // Component that triggers the dialog // Body and footer content?: SchemaNode | SchemaNode[]; // Rendered between the header and the footer diff --git a/content/docs/components/overlay/sheet.mdx b/content/docs/components/overlay/sheet.mdx index 92bf60c26..1e449e17a 100644 --- a/content/docs/components/overlay/sheet.mdx +++ b/content/docs/components/overlay/sheet.mdx @@ -23,10 +23,10 @@ The Sheet component displays content in a panel that slides in from the edge of ```plaintext interface SheetSchema { type: 'sheet'; - trigger: SchemaNode | SchemaNode[]; // Trigger component + trigger?: SchemaNode | SchemaNode[]; // Trigger component title?: string; // Sheet title description?: string; // Sheet description - content: SchemaNode | SchemaNode[]; // Sheet content + content?: SchemaNode | SchemaNode[]; // Sheet content side?: 'left' | 'right' | 'top' | 'bottom'; className?: string; } diff --git a/packages/types/src/__tests__/overlay-node-slot-doc-types-7082.test.ts b/packages/types/src/__tests__/overlay-node-slot-doc-types-7082.test.ts index 6561449e5..a5c0a50cc 100644 --- a/packages/types/src/__tests__/overlay-node-slot-doc-types-7082.test.ts +++ b/packages/types/src/__tests__/overlay-node-slot-doc-types-7082.test.ts @@ -71,11 +71,14 @@ * pins those rows). `EmptySchema.action` keeps its row and its pin. The day it * is declared, this file goes red and the page is owed a row. * - * Likewise the requiredness of `AlertDialogSchema.trigger`, `SheetSchema.trigger` - * and `SheetSchema.content`: all three are declared OPTIONAL and published - * REQUIRED. That is objectui#7073's defect class, not this card's, and it is - * fenced out of the diff -- but pinned here so it cannot be lost, and so a fix - * on either side turns this file red rather than passing unnoticed. + * The requiredness of `AlertDialogSchema.trigger`, `SheetSchema.trigger` and + * `SheetSchema.content` was the exception left after that: all three were + * declared OPTIONAL and published REQUIRED, objectui#7073's defect class + * rather than this card's, so it was fenced out of the diff and pinned + * instead so a fix on either side would turn this file red rather than + * passing unnoticed. objectui#7106 closed it: all three pages now spell `?`, + * joining `ContextMenuSchema.trigger` -- the row #7073 had already corrected + * -- as agreement rather than divergence. */ import { describe, expect, it } from 'vitest'; @@ -326,19 +329,15 @@ describe('rows a docs-only edit cannot honestly resolve, recorded rather than re }); }); -describe('requiredness divergences left to the objectui#7073 class, pinned so they cannot be lost', () => { +describe('requiredness: the objectui#7073 class, closed -- all four rows agree on both faces (objectui#7106)', () => { it.each([ + ['ContextMenuSchema', 'trigger'], ['AlertDialogSchema', 'trigger'], ['SheetSchema', 'trigger'], ['SheetSchema', 'content'], - ])('%s.%s is declared optional and still published required', (owner, key) => { + ])('%s.%s is declared optional and published optional', (owner, key) => { expect(declRow(owner, key)?.optional).toBe(true); - expect(docRow(owner, key)?.optional).toBe(false); - }); - - it('`ContextMenuSchema.trigger` is the one already corrected, by #7073 -- the control', () => { - expect(declRow('ContextMenuSchema', 'trigger')?.optional).toBe(true); - expect(docRow('ContextMenuSchema', 'trigger')?.optional).toBe(true); + expect(docRow(owner, key)?.optional).toBe(true); }); });