From 6ccaa31f94718abffa45a3a28288621502581133 Mon Sep 17 00:00:00 2001 From: rahulb18 Date: Tue, 16 Dec 2025 22:52:23 +0530 Subject: [PATCH] Fix: Allow undefined for summary and detail in PropSummaryValue type Fixes #27129 This change allows users with exactOptionalPropertyTypes: true to explicitly set summary and detail to undefined in argTypes. Changes: - Updated PropSummaryValue interface in PropDef.ts - Updated InputType table types in story.ts - Updated PropSummaryValue detail in ArgsTable types.ts --- code/addons/docs/src/blocks/components/ArgsTable/types.ts | 2 +- code/core/src/csf/story.ts | 4 ++-- code/core/src/docs-tools/argTypes/docgen/PropDef.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/addons/docs/src/blocks/components/ArgsTable/types.ts b/code/addons/docs/src/blocks/components/ArgsTable/types.ts index c81327d82215..dcd32fbf98c6 100644 --- a/code/addons/docs/src/blocks/components/ArgsTable/types.ts +++ b/code/addons/docs/src/blocks/components/ArgsTable/types.ts @@ -22,7 +22,7 @@ export interface JsDocTags { export interface PropSummaryValue { summary: string; - detail?: string; + detail?: string | undefined; required?: boolean; } diff --git a/code/core/src/csf/story.ts b/code/core/src/csf/story.ts index 0a128a1670a2..6ff038936383 100644 --- a/code/core/src/csf/story.ts +++ b/code/core/src/csf/story.ts @@ -126,13 +126,13 @@ export interface InputType { /** @see https://storybook.js.org/docs/api/arg-types#tablecategory */ category?: string; /** @see https://storybook.js.org/docs/api/arg-types#tabledefaultvalue */ - defaultValue?: { summary?: string; detail?: string }; + defaultValue?: { summary?: string | undefined; detail?: string | undefined }; /** @see https://storybook.js.org/docs/api/arg-types#tabledisable */ disable?: boolean; /** @see https://storybook.js.org/docs/api/arg-types#tablesubcategory */ subcategory?: string; /** @see https://storybook.js.org/docs/api/arg-types#tabletype */ - type?: { summary?: string; detail?: string }; + type?: { summary?: string | undefined; detail?: string | undefined }; }; /** @see https://storybook.js.org/docs/api/arg-types#type */ type?: SBType | SBScalarType['name']; diff --git a/code/core/src/docs-tools/argTypes/docgen/PropDef.ts b/code/core/src/docs-tools/argTypes/docgen/PropDef.ts index 7fcbae1ae466..7c4613debe4a 100644 --- a/code/core/src/docs-tools/argTypes/docgen/PropDef.ts +++ b/code/core/src/docs-tools/argTypes/docgen/PropDef.ts @@ -15,8 +15,8 @@ export interface JsDocTags { } export interface PropSummaryValue { - summary?: string; - detail?: string; + summary?: string | undefined; + detail?: string | undefined; } export type PropType = PropSummaryValue;