{"version":3,"file":"chunk-Breadcrumb.mjs","names":["Icon.Icon"],"sources":["../../src/components/Breadcrumb/Breadcrumb.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\n// Ark has no breadcrumb, so this follows the WAI-ARIA breadcrumb pattern with native elements: a labelled `<nav>`\n// landmark around an ordered list, the last item marked `aria-current='page'`.\n\nimport { ark } from '@ark-ui/react/factory';\nimport React, { type ComponentPropsWithRef, forwardRef } from 'react';\n\nimport { mx } from '@dxos/ui-theme';\nimport { type ThemedClassName } from '@dxos/ui-types';\n\nimport { recipes } from '../../recipes.ts';\nimport * as Icon from '../Icon/Icon.tsx';\n\n//\n// Root\n//\n\ntype BreadcrumbRootProps = ThemedClassName<ComponentPropsWithRef<typeof ark.nav>> & {\n  /** Names the landmark, e.g. \"Breadcrumbs\". */\n  'aria-label': string;\n};\n\n/** The `<nav>` landmark holding the trail. */\nconst BreadcrumbRoot = forwardRef<HTMLElement, BreadcrumbRootProps>(({ classNames, ...props }, forwardedRef) => (\n  <ark.nav\n    {...props}\n    data-scope='breadcrumb'\n    data-part='root'\n    className={mx(recipes.breadcrumb(), classNames)}\n    ref={forwardedRef}\n  />\n));\n\nBreadcrumbRoot.displayName = 'Breadcrumb.Root';\n\n//\n// List\n//\n\ntype BreadcrumbListProps = ThemedClassName<ComponentPropsWithRef<typeof ark.ol>>;\n\n/** The ordered trail, one row that scrolls sideways (without a scrollbar) when it overflows. */\nconst BreadcrumbList = forwardRef<HTMLOListElement, BreadcrumbListProps>(({ classNames, ...props }, forwardedRef) => (\n  <ark.ol\n    {...props}\n    data-scope='breadcrumb'\n    data-part='list'\n    className={mx(recipes.breadcrumbList(), classNames)}\n    ref={forwardedRef}\n  />\n));\n\nBreadcrumbList.displayName = 'Breadcrumb.List';\n\n//\n// Item\n//\n\ntype BreadcrumbItemProps = ThemedClassName<ComponentPropsWithRef<typeof ark.li>>;\n\n/** One step of the trail, holding a Link or, last, the Current page. */\nconst BreadcrumbItem = forwardRef<HTMLLIElement, BreadcrumbItemProps>(({ classNames, ...props }, forwardedRef) => (\n  <ark.li\n    {...props}\n    data-scope='breadcrumb'\n    data-part='item'\n    className={mx(recipes.breadcrumbItem(), classNames)}\n    ref={forwardedRef}\n  />\n));\n\nBreadcrumbItem.displayName = 'Breadcrumb.Item';\n\n//\n// Link\n//\n\ntype BreadcrumbLinkProps = ThemedClassName<ComponentPropsWithRef<typeof ark.a>>;\n\n/** An earlier step: an anchor, or with `asChild` a button for in-app navigation. Subdued until hovered. */\nconst BreadcrumbLink = forwardRef<HTMLAnchorElement, BreadcrumbLinkProps>(({ classNames, ...props }, forwardedRef) => (\n  <ark.a\n    {...props}\n    data-scope='breadcrumb'\n    data-part='link'\n    className={mx(recipes.breadcrumbLink(), classNames)}\n    ref={forwardedRef}\n  />\n));\n\nBreadcrumbLink.displayName = 'Breadcrumb.Link';\n\n//\n// Current\n//\n\ntype BreadcrumbCurrentProps = ThemedClassName<ComponentPropsWithRef<typeof ark.span>>;\n\n/** The page the reader is on (`aria-current='page'`); `asChild` puts the mark on the caller's own title element. */\nconst BreadcrumbCurrent = forwardRef<HTMLSpanElement, BreadcrumbCurrentProps>(\n  ({ classNames, ...props }, forwardedRef) => (\n    <ark.span\n      {...props}\n      aria-current='page'\n      data-scope='breadcrumb'\n      data-part='current'\n      className={mx(recipes.breadcrumbCurrent(), classNames)}\n      ref={forwardedRef}\n    />\n  ),\n);\n\nBreadcrumbCurrent.displayName = 'Breadcrumb.Current';\n\n//\n// Separator\n//\n\ntype BreadcrumbSeparatorProps = ThemedClassName<Omit<ComponentPropsWithRef<'li'>, 'children'>> & {\n  /** Replaces the default caret. */\n  icon?: string;\n};\n\n/** A decorative list item between steps, hidden from assistive tech so the list counts only steps. */\nconst BreadcrumbSeparator = forwardRef<HTMLLIElement, BreadcrumbSeparatorProps>(\n  ({ classNames, icon = 'ph--caret-right--regular', ...props }, forwardedRef) => (\n    <li\n      {...props}\n      aria-hidden\n      data-scope='breadcrumb'\n      data-part='separator'\n      className={mx(recipes.breadcrumbSeparator(), classNames)}\n      ref={forwardedRef}\n    >\n      <Icon.Icon icon={icon} />\n    </li>\n  ),\n);\n\nBreadcrumbSeparator.displayName = 'Breadcrumb.Separator';\nexport type {\n  BreadcrumbCurrentProps as CurrentProps,\n  BreadcrumbItemProps as ItemProps,\n  BreadcrumbLinkProps as LinkProps,\n  BreadcrumbListProps as ListProps,\n  BreadcrumbRootProps as RootProps,\n  BreadcrumbSeparatorProps as SeparatorProps,\n};\n\nexport {\n  BreadcrumbCurrent as Current,\n  BreadcrumbItem as Item,\n  BreadcrumbLink as Link,\n  BreadcrumbList as List,\n  BreadcrumbRoot as Root,\n  BreadcrumbSeparator as Separator,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AA4BA,IAAM,iBAAiB,YAA8C,EAAE,YAAY,GAAG,SAAS,iBAC7F,oBAAC,IAAI,KAAL;CACE,GAAI;CACJ,cAAW;CACX,aAAU;CACV,WAAW,GAAG,QAAQ,WAAW,GAAG,UAAU;CAC9C,KAAK;AACN,CAAA,CACF;AAED,eAAe,cAAc;;AAS7B,IAAM,iBAAiB,YAAmD,EAAE,YAAY,GAAG,SAAS,iBAClG,oBAAC,IAAI,IAAL;CACE,GAAI;CACJ,cAAW;CACX,aAAU;CACV,WAAW,GAAG,QAAQ,eAAe,GAAG,UAAU;CAClD,KAAK;AACN,CAAA,CACF;AAED,eAAe,cAAc;;AAS7B,IAAM,iBAAiB,YAAgD,EAAE,YAAY,GAAG,SAAS,iBAC/F,oBAAC,IAAI,IAAL;CACE,GAAI;CACJ,cAAW;CACX,aAAU;CACV,WAAW,GAAG,QAAQ,eAAe,GAAG,UAAU;CAClD,KAAK;AACN,CAAA,CACF;AAED,eAAe,cAAc;;AAS7B,IAAM,iBAAiB,YAAoD,EAAE,YAAY,GAAG,SAAS,iBACnG,oBAAC,IAAI,GAAL;CACE,GAAI;CACJ,cAAW;CACX,aAAU;CACV,WAAW,GAAG,QAAQ,eA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