diff --git a/packages/ui/src/components/Tabs/Tabs.stories.tsx b/packages/ui/src/components/Tabs/Tabs.stories.tsx index fcc919f294..55cdf7c446 100644 --- a/packages/ui/src/components/Tabs/Tabs.stories.tsx +++ b/packages/ui/src/components/Tabs/Tabs.stories.tsx @@ -125,10 +125,10 @@ export const WithMockedURLTab3 = meta.story({ - + Current URL is mocked to be: /tab3 - + Notice how the "Tab 3 With long title" tab is selected (highlighted) because it matches the current path. @@ -157,14 +157,14 @@ export const WithMockedURLNoMatch = meta.story({ - + Current URL is mocked to be: /some-other-page - + No tab is selected because the current path doesn't match any tab's href. - + Tabs without href (like "Tab 1", "Tab 2", "Tab 3 With long title") fall back to React Aria's internal state. @@ -195,14 +195,14 @@ export const ExactMatchingDefault = meta.story({ - + Current URL: /mentorship/events - + Using default exact matching, only the "Events" tab is active because it exactly matches the URL. - + The "Mentorship" tab is NOT active even though the URL contains "/mentorship". @@ -231,18 +231,18 @@ export const PrefixMatchingForNestedRoutes = meta.story({ - + Current URL: /mentorship/events - + The "Mentorship" tab uses prefix matching and IS active because "/mentorship/events" starts with "/mentorship". - + The "Events" tab uses exact matching and is also active because it exactly matches. - + The "Catalog" tab uses prefix matching but is NOT active because the URL doesn't start with "/catalog". @@ -313,22 +313,22 @@ export const MixedMatchingStrategies = meta.story({ - + Current URL: /dashboard/analytics/reports - + • "Overview" tab: exact matching, NOT active (doesn't exactly match "/dashboard") - + • "Analytics" tab: prefix matching, IS active (URL starts with "/dashboard/analytics") - + • "Settings" tab: prefix matching, NOT active (URL doesn't start with "/dashboard/settings") - + • "Help" tab: exact matching, NOT active (doesn't exactly match "/help") @@ -357,20 +357,20 @@ export const PrefixMatchingEdgeCases = meta.story({ - + Current URL: /foobar - + • "Foo" tab (prefix): NOT active - prevents "/foo" from matching "/foobar" - + • "Foobar" tab (exact): IS active - exactly matches "/foobar" - + • "Foo (exact)" tab: NOT active - doesn't exactly match "/foobar" - + This shows that prefix matching properly requires a "/" separator to prevent false matches. @@ -399,20 +399,20 @@ export const PrefixMatchingWithSlash = meta.story({ - + Current URL: /foo/bar - + • "Foo" tab (prefix): IS active - "/foo/bar" starts with "/foo/" - + • "Foobar" tab (exact): NOT active - doesn't exactly match "/foobar" - + • "Bar" tab (prefix): NOT active - "/foo/bar" doesn't start with "/bar" - + This demonstrates proper prefix matching with the "/" separator. @@ -440,12 +440,14 @@ export const RootPathMatching = meta.story({ - + Current URL: / - • "Home" tab (exact): IS active - exactly matches "/" - • "Home (prefix)" tab: IS active - "/" matches "/" - + + • "Home" tab (exact): IS active - exactly matches "/" + + • "Home (prefix)" tab: IS active - "/" matches "/" + • "Catalog" tab (prefix): NOT active - "/" doesn't start with "/catalog" @@ -533,10 +535,12 @@ export const AutoSelectionOfTabs = meta.story({ {/* With hrefs */} - - {' '} - Case 2: With hrefs By default no selection is shown - because the URL doesn't match any tab's href.{' '} + + Case 2: With hrefs + + + By default no selection is shown because the URL doesn't match any + tab's href.