From 623783dce984664aa8696de4184dff85372ba565 Mon Sep 17 00:00:00 2001 From: Michael Taranto Date: Wed, 5 Feb 2025 09:51:07 +1100 Subject: [PATCH] site: Add Tabs `reserveHitArea` docs (#1705) --- .../src/lib/components/Tabs/Tabs.docs.tsx | 57 ++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/packages/braid-design-system/src/lib/components/Tabs/Tabs.docs.tsx b/packages/braid-design-system/src/lib/components/Tabs/Tabs.docs.tsx index 13d7745a8bd..861de4eb988 100644 --- a/packages/braid-design-system/src/lib/components/Tabs/Tabs.docs.tsx +++ b/packages/braid-design-system/src/lib/components/Tabs/Tabs.docs.tsx @@ -18,6 +18,7 @@ import { IconHome, IconProfile, IconRecommended, + Toggle, } from '..'; import { Placeholder } from '../../playroom/components'; import { dataAttributeDocs } from '../private/dataAttribute.docs'; @@ -377,6 +378,60 @@ const docs: ComponentDocs = { , ), }, + { + label: 'Reserve hit area', + description: ( + <> + + By default, a Tab will only occupy the vertical + space from the top of the label to the active underline. This means + the hit area will bleed out into the space above. + + + The bleed can be disabled by setting the{' '} + reserveHitArea prop to true. + + + ), + Example: ({ id, getState, toggleState, setDefaultState }) => + source( + <> + {setDefaultState('reserveHitArea', false)} + + + toggleState('reserveHitArea')} + align="right" + togglePosition="trailing" + /> + + + + + The first tab + The second tab + The third tab + The fourth tab + + + + + + , + ), + }, { label: 'State management', description: ( @@ -399,7 +454,7 @@ const docs: ComponentDocs = { onChange={(index, item) => setState('tab', item)} > - + The first tab The second tab The third tab