diff --git a/static/app/components/breadcrumbList/breadcrumbDividerCombo.tsx b/static/app/components/breadcrumbList/breadcrumbDividerCombo.tsx new file mode 100644 index 000000000000..dfe9a35bf72f --- /dev/null +++ b/static/app/components/breadcrumbList/breadcrumbDividerCombo.tsx @@ -0,0 +1,37 @@ +import type {Responsive} from '@sentry/scraps/layout'; +import {Container, Flex} from '@sentry/scraps/layout'; + +import {IconSlashForward} from 'sentry/icons'; + +interface BreadcrumbDividerComboProps { + children: React.ReactNode; + /** Controls visibility — use responsive values for container-query toggling. */ + display?: Responsive<'flex' | 'none'>; +} + +/** + * Internal wrapper that pairs a breadcrumb item with a trailing slash divider. + * Not exported — only BreadcrumbList should use this to ensure consistent structure. + * + * The visibility toggle lives on a `Container`, not the inner `Flex`: `Flex` + * defaults every unspecified breakpoint/axis slot to `flex`, which emits an + * always-matching `@media (min-width: 0px)` rule that shadows the container + * query and pins the element visible. `Container` skips unspecified slots, so + * the `@container` query actually drives the collapse. + */ +export function BreadcrumbDividerCombo({children, display}: BreadcrumbDividerComboProps) { + return ( + // flexShrink={999} makes parent crumbs give up width first, so the current + // page (a much lower shrink) truncates last. These wrappers keep the default + // min-width:auto (no min-width:0) so they can't collapse past the crumb's own + // floor — set on the item's outer Flex — down to 0 when the row is very tight. + + + {children} + + + + + + ); +} diff --git a/static/app/components/breadcrumbList/breadcrumbList.mdx b/static/app/components/breadcrumbList/breadcrumbList.mdx new file mode 100644 index 000000000000..3dcfece30a25 --- /dev/null +++ b/static/app/components/breadcrumbList/breadcrumbList.mdx @@ -0,0 +1,246 @@ +--- +title: BreadcrumbList +description: A typed, accessible breadcrumb trail that collapses parent links into an overflow menu in narrow containers. +category: navigation +source: 'sentry/components/breadcrumbList' +resources: + js: https://github.com/getsentry/sentry/blob/master/static/app/components/breadcrumbList/breadcrumbList.tsx + figma: https://www.figma.com/design/a638AEl7pFxj29zMODCiOB/Specs--Page-Frame-v1?node-id=1198-17420 +--- + +import {LeadingGraphic} from '@sentry/scraps/leadingGraphic'; + +import {BreadcrumbList} from 'sentry/components/breadcrumbList'; +import {IconSettings, IconStar} from 'sentry/icons'; +import * as Storybook from 'sentry/stories'; + +export const documentation = + import('!!type-loader!sentry/components/breadcrumbList/breadcrumbList'); + +`BreadcrumbList` renders a horizontal breadcrumb trail as inline content. It is designed to sit inside the page's heading (e.g. the TopBar title `

`), which owns the landmark and heading semantics — so the trail itself renders no `