From 1cbd7bbf1cc02a058832a1da2abb151096f15ed4 Mon Sep 17 00:00:00 2001 From: Armagan Ersoz Date: Wed, 29 Nov 2023 15:34:31 +1000 Subject: [PATCH 1/2] deprecate title prop and throw warning --- src/ActionList/Group.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ActionList/Group.tsx b/src/ActionList/Group.tsx index 97a39107306..501f1c6e222 100644 --- a/src/ActionList/Group.tsx +++ b/src/ActionList/Group.tsx @@ -19,7 +19,7 @@ export type ActionListGroupProps = { */ variant?: 'subtle' | 'filled' /** - * Primary text which names a `Group`. + * @deprecated('Use `ActionList.GroupHeading` instead') */ title?: string /** @@ -71,6 +71,11 @@ export const Group: React.FC> = ({ groupHeadingId = id } + warning( + title, + 'title prop is deprecated in ActionList.Group. Please use ActionList.GroupHeading instead for improved semantics', + ) + return ( Date: Wed, 29 Nov 2023 18:05:31 +1000 Subject: [PATCH 2/2] only warn for list role use --- src/ActionList/Group.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ActionList/Group.tsx b/src/ActionList/Group.tsx index 501f1c6e222..627fe7e8497 100644 --- a/src/ActionList/Group.tsx +++ b/src/ActionList/Group.tsx @@ -72,7 +72,7 @@ export const Group: React.FC> = ({ } warning( - title, + title && listRole === undefined, 'title prop is deprecated in ActionList.Group. Please use ActionList.GroupHeading instead for improved semantics', )