From 53083cf48ff53dd45b7622b8ff217db60b18bebb Mon Sep 17 00:00:00 2001 From: Gethin Webster Date: Fri, 27 Mar 2026 10:28:01 +0100 Subject: [PATCH] fix: Fix list `renderItem` typings --- .../snapshot-tests/__snapshots__/documenter.test.ts.snap | 8 ++++---- src/list/interfaces.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/__tests__/snapshot-tests/__snapshots__/documenter.test.ts.snap b/src/__tests__/snapshot-tests/__snapshots__/documenter.test.ts.snap index 9e92f77915..f7bf1c4438 100644 --- a/src/__tests__/snapshot-tests/__snapshots__/documenter.test.ts.snap +++ b/src/__tests__/snapshot-tests/__snapshots__/documenter.test.ts.snap @@ -16821,23 +16821,23 @@ exports[`Components definition for list matches the snapshot: list 1`] = ` * \`content\` (React.ReactNode) - The content of the item. * \`secondaryContent\` (React.ReactNode) - (Optional) Secondary content, for example item description. * \`icon\` (React.ReactNode) - (Optional) An icon, displayed at the start. -* \`action\` (React.ReactNode) - (Optional) Action button(s). +* \`actions\` (React.ReactNode) - (Optional) Action button(s). * \`announcementLabel\` (string) - (Optional) An announcement label for the item, used when sorting. By default, the \`content\` is used: a custom label should be provided if \`content\` is not a string.", "inlineType": { - "name": "(item: T) => { id: string; content: React.ReactNode; secondaryContent?: React.ReactNode; icon?: React.ReactNode; action?: React.ReactNode; announcementLabel?: string | undefined; }", + "name": "(item: T) => { id: string; content: React.ReactNode; secondaryContent?: React.ReactNode; icon?: React.ReactNode; actions?: React.ReactNode; announcementLabel?: string | undefined; }", "parameters": [ { "name": "item", "type": "T", }, ], - "returnType": "{ id: string; content: React.ReactNode; secondaryContent?: React.ReactNode; icon?: React.ReactNode; action?: React.ReactNode; announcementLabel?: string | undefined; }", + "returnType": "{ id: string; content: React.ReactNode; secondaryContent?: React.ReactNode; icon?: React.ReactNode; actions?: React.ReactNode; announcementLabel?: string | undefined; }", "type": "function", }, "name": "renderItem", "optional": false, - "type": "(item: T) => { id: string; content: React.ReactNode; secondaryContent?: React.ReactNode; icon?: React.ReactNode; action?: React.ReactNode; announcementLabel?: string | undefined; }", + "type": "(item: T) => { id: string; content: React.ReactNode; secondaryContent?: React.ReactNode; icon?: React.ReactNode; actions?: React.ReactNode; announcementLabel?: string | undefined; }", }, { "description": "Makes the list sortable by enabling drag and drop functionality.", diff --git a/src/list/interfaces.ts b/src/list/interfaces.ts index b08860e623..af5f6c03aa 100644 --- a/src/list/interfaces.ts +++ b/src/list/interfaces.ts @@ -18,7 +18,7 @@ export interface ListProps { * * `content` (React.ReactNode) - The content of the item. * * `secondaryContent` (React.ReactNode) - (Optional) Secondary content, for example item description. * * `icon` (React.ReactNode) - (Optional) An icon, displayed at the start. - * * `action` (React.ReactNode) - (Optional) Action button(s). + * * `actions` (React.ReactNode) - (Optional) Action button(s). * * `announcementLabel` (string) - (Optional) An announcement label for the item, used when sorting. * By default, the `content` is used: a custom label should be provided if `content` is not a string. */ @@ -27,7 +27,7 @@ export interface ListProps { content: ReactNode; secondaryContent?: ReactNode; icon?: ReactNode; - action?: ReactNode; + actions?: ReactNode; announcementLabel?: string; };