From 70716a2e31554ad531a4b6ae4dc4e5bac4f0ccb9 Mon Sep 17 00:00:00 2001 From: "manuel.carrera" Date: Tue, 12 Sep 2023 14:52:08 -0600 Subject: [PATCH] fix: Remove usebanner hook --- modules/react/banner/lib/hooks/index.ts | 1 - modules/react/banner/lib/hooks/useBanner.tsx | 13 ------------- modules/react/banner/stories/Banner.stories.mdx | 2 +- 3 files changed, 1 insertion(+), 15 deletions(-) delete mode 100644 modules/react/banner/lib/hooks/useBanner.tsx diff --git a/modules/react/banner/lib/hooks/index.ts b/modules/react/banner/lib/hooks/index.ts index 8c8010ddc2..13bc7cf17e 100644 --- a/modules/react/banner/lib/hooks/index.ts +++ b/modules/react/banner/lib/hooks/index.ts @@ -4,5 +4,4 @@ export * from './useThemedPalette'; export * from './useBannerIcon'; export * from './useBannerLabel'; export * from './useBannerActionText'; -export * from './useBanner'; export {getPaletteColors}; diff --git a/modules/react/banner/lib/hooks/useBanner.tsx b/modules/react/banner/lib/hooks/useBanner.tsx deleted file mode 100644 index 305d3f46a7..0000000000 --- a/modules/react/banner/lib/hooks/useBanner.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import {createElemPropsHook} from '@workday/canvas-kit-react/common'; -import {useBannerModel} from './useBannerModel'; - -/** - * Adds the necessary props to a `Banner` component. - * Used by the Banner component - */ -export const useBanner = createElemPropsHook(useBannerModel)(({state}) => { - return { - 'aria-describedby': `label-${state.id}`, - 'aria-labelledby': `action-${state.id}`, - }; -}); diff --git a/modules/react/banner/stories/Banner.stories.mdx b/modules/react/banner/stories/Banner.stories.mdx index 7bc3b2c902..a88e35dc87 100644 --- a/modules/react/banner/stories/Banner.stories.mdx +++ b/modules/react/banner/stories/Banner.stories.mdx @@ -52,7 +52,7 @@ banner. This will change the defualt icon to `exclamationCircleIcon`. ### Icon Banner -When only using an icon in the `Banner`, use our `Tooltip` component to both show a visible text alternative, and assign an `aria-label` string to the child `Banner`. +When only using an icon in the `Banner`, use our `Tooltip` component to both show a visible text alternative, and assign an `aria-label` string to the child `Banner`.