@mortenbrudvik/waveui 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +302 -49
- package/dist/components/data-display/Avatar.context.cjs.map +1 -1
- package/dist/components/data-display/Avatar.context.mjs.map +1 -1
- package/dist/components/data-display/List.cjs +1 -1
- package/dist/components/data-display/List.cjs.map +1 -1
- package/dist/components/data-display/List.mjs +245 -195
- package/dist/components/data-display/List.mjs.map +1 -1
- package/dist/components/data-display/List.registry.cjs.map +1 -1
- package/dist/components/data-display/List.registry.mjs.map +1 -1
- package/dist/components/layout/Overflow.cjs +1 -1
- package/dist/components/layout/Overflow.cjs.map +1 -1
- package/dist/components/layout/Overflow.mjs +240 -192
- package/dist/components/layout/Overflow.mjs.map +1 -1
- package/dist/components/layout/Overflow.store.cjs +2 -0
- package/dist/components/layout/Overflow.store.cjs.map +1 -0
- package/dist/components/layout/Overflow.store.mjs +209 -0
- package/dist/components/layout/Overflow.store.mjs.map +1 -0
- package/dist/components/navigation/Breadcrumb.cjs +1 -1
- package/dist/components/navigation/Breadcrumb.cjs.map +1 -1
- package/dist/components/navigation/Breadcrumb.mjs +239 -84
- package/dist/components/navigation/Breadcrumb.mjs.map +1 -1
- package/dist/components/overlays/Dialog.slots.cjs +1 -1
- package/dist/components/overlays/Dialog.slots.cjs.map +1 -1
- package/dist/components/overlays/Dialog.slots.mjs +19 -15
- package/dist/components/overlays/Dialog.slots.mjs.map +1 -1
- package/dist/components/overlays/TeachingPopover.cjs +1 -1
- package/dist/components/overlays/TeachingPopover.cjs.map +1 -1
- package/dist/components/overlays/TeachingPopover.context.cjs +2 -0
- package/dist/components/overlays/TeachingPopover.context.cjs.map +1 -0
- package/dist/components/overlays/TeachingPopover.context.mjs +51 -0
- package/dist/components/overlays/TeachingPopover.context.mjs.map +1 -0
- package/dist/components/overlays/TeachingPopover.mjs +15 -185
- package/dist/components/overlays/TeachingPopover.mjs.map +1 -1
- package/dist/components/overlays/TeachingPopover.parts.cjs +2 -0
- package/dist/components/overlays/TeachingPopover.parts.cjs.map +1 -0
- package/dist/components/overlays/TeachingPopover.parts.mjs +398 -0
- package/dist/components/overlays/TeachingPopover.parts.mjs.map +1 -0
- package/dist/components/overlays/TeachingPopover.root.cjs +2 -0
- package/dist/components/overlays/TeachingPopover.root.cjs.map +1 -0
- package/dist/components/overlays/TeachingPopover.root.mjs +150 -0
- package/dist/components/overlays/TeachingPopover.root.mjs.map +1 -0
- package/dist/components/overlays/TeachingPopover.stack.cjs +2 -0
- package/dist/components/overlays/TeachingPopover.stack.cjs.map +1 -0
- package/dist/components/overlays/TeachingPopover.stack.mjs +86 -0
- package/dist/components/overlays/TeachingPopover.stack.mjs.map +1 -0
- package/dist/components/table/DataGrid.cjs +1 -1
- package/dist/components/table/DataGrid.cjs.map +1 -1
- package/dist/components/table/DataGrid.mjs +540 -311
- package/dist/components/table/DataGrid.mjs.map +1 -1
- package/dist/components/table/Table.cjs +1 -1
- package/dist/components/table/Table.cjs.map +1 -1
- package/dist/components/table/Table.mjs +183 -60
- package/dist/components/table/Table.mjs.map +1 -1
- package/dist/components/table/Table.shared.cjs +2 -0
- package/dist/components/table/Table.shared.cjs.map +1 -0
- package/dist/components/table/Table.shared.mjs +65 -0
- package/dist/components/table/Table.shared.mjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1742 -158
- package/dist/index.d.ts +1742 -158
- package/dist/index.mjs +135 -132
- package/dist/lib/breadcrumb.cjs +2 -0
- package/dist/lib/breadcrumb.cjs.map +1 -0
- package/dist/lib/breadcrumb.mjs +26 -0
- package/dist/lib/breadcrumb.mjs.map +1 -0
- package/dist/lib/classNames.cjs +1 -1
- package/dist/lib/classNames.cjs.map +1 -1
- package/dist/lib/classNames.mjs +66 -38
- package/dist/lib/classNames.mjs.map +1 -1
- package/dist/lib/events.cjs +1 -1
- package/dist/lib/events.cjs.map +1 -1
- package/dist/lib/events.mjs +35 -8
- package/dist/lib/events.mjs.map +1 -1
- package/dist/lib/icons.cjs +1 -1
- package/dist/lib/icons.cjs.map +1 -1
- package/dist/lib/icons.mjs +34 -20
- package/dist/lib/icons.mjs.map +1 -1
- package/dist/lib/table.cjs +2 -0
- package/dist/lib/table.cjs.map +1 -0
- package/dist/lib/table.mjs +16 -0
- package/dist/lib/table.mjs.map +1 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/cn.cjs"),n=require("../../lib/children.cjs"),r=require("../../lib/dev.cjs"),i=require("../../lib/slot.cjs"),a=require("../../lib/
|
|
1
|
+
"use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/cn.cjs"),n=require("../../lib/children.cjs"),r=require("../../lib/dev.cjs"),i=require("../../lib/slot.cjs"),a=require("../../lib/composeEventHandlers.cjs"),o=require("../../lib/classNames.cjs"),s=require("../../lib/breadcrumb.cjs"),c=require("../../hooks/useRovingTabIndex.cjs"),l=require("../../hooks/useMergedRefs.cjs"),u=require("../../lib/aria.cjs"),d=require("../../lib/styles.cjs"),f=require("../../lib/icons.cjs"),p=require("../../lib/renderTrigger.cjs"),m=require("../layout/Overflow.cjs"),h=require("../../hooks/useTriggerElement.cjs"),g=require("./Menu.cjs");let _=require("react");_=e.__toESM(_,1);let v=require("react/jsx-runtime");var y=t.cn(`inline-flex cursor-pointer items-center text-primary no-underline not-disabled:not-aria-disabled:hover:underline`,d.focusRing,d.disabledStyles),b=`inline-flex items-center font-semibold text-foreground`,x=t.cn(b,d.focusRing,d.disabledStyles),S=`inline-flex items-center text-foreground`,C=new Set([`rel`,...Object.keys({disabled:!0,type:!0,form:!0,formAction:!0,formEncType:!0,formMethod:!0,formNoValidate:!0,formTarget:!0,name:!0,value:!0,target:!0,download:!0,hrefLang:!0,ping:!0,media:!0,referrerPolicy:!0})]);function w(e){let t={};for(let n of Object.keys(e))C.has(n)||(t[n]=e[n]);return t}var T={small:{text:`text-caption-1`,divider:12},medium:{text:`text-body-1`,divider:12},large:{text:`text-body-2`,divider:16}},E=`a[href], button, [role="link"]`,D=`\0overflow`;function O(e){return n.isElementOfType(e.node,z)&&e.node.props.current===!0}function k(e,t,n){if(t===void 0)return[];let{overflowItems:r}=s.partitionBreadcrumbItems({items:e.map((e,t)=>t),maxDisplayedItems:t,overflowIndex:Math.max(1,n)});if(!r)return[];let i=e.length,a=r.length,o=e.map(O).lastIndexOf(!0),c=Math.max(1,r[0]),l=Math.min(i,c+a);return o>=c&&o<l&&(o+1+a<=i?(c=o+1,l=c+a):o-a>=1?(c=o-a,l=o):o-1>=i-o-1?(c=1,l=o):(c=o+1,l=Math.min(i,c+a))),Array.from({length:Math.max(0,l-c)},(e,t)=>c+t)}function A(e,t){let n=t?.props??{};return[e.disabled,e[`aria-disabled`],n.disabled,n[`aria-disabled`]].some(e=>e===!0||e===`true`)}function j(e,t){if(!e)return null;let n=p.unwrapFragment(t);return _.isValidElement(n)?n:null}function M(e){return typeof e.type==`function`||typeof e.type==`object`&&e.type!==null}function N({linkType:e,linkAs:t,linkDisabled:n,...r}){return(0,v.jsx)(e,{...r,...t===void 0?void 0:{as:t},...n===void 0?void 0:{disabled:n}})}function P(e){let t=e.node;if(!n.isElementOfType(t,z))return{node:null,mappable:!1};let{href:r,icon:i,asChild:o,children:s,onClick:c}=t.props,l=j(o,s),u=l?l.props.children:s,d=A(t.props,l),f=l?.props.href??r;if(l&&M(l)){let{children:t,className:n,style:o,ref:s,id:f,role:p,tabIndex:m,disabled:h,"aria-disabled":_,onClick:y,as:b,...x}=l.props,S=r!==void 0&&!d?{href:r}:void 0;return{node:(0,v.jsx)(g.Menu.ItemLink,{...S,...x,as:N,linkType:l.type,linkAs:b,linkDisabled:h,icon:i,disabled:d,onClick:a.composeEventHandlers(y,c),children:u},e.key),mappable:!0}}return typeof f==`string`?{node:(0,v.jsx)(g.Menu.ItemLink,{href:f,icon:i,disabled:d,onClick:a.composeEventHandlers(l?.props.onClick,c),children:u},e.key),mappable:!0}:{node:(0,v.jsx)(g.Menu.Item,{icon:i,disabled:d||!c,onClick:c,children:u},e.key),mappable:c!==void 0}}function F({entries:e,label:n}){let i=e.map(P),a=i.some(e=>!e.mappable);return _.useEffect(()=>{a&&r.warnOnce(`Breadcrumb:overflow-item`,"Breadcrumb: a hidden item cannot be listed in the overflow menu (it has no `href` or `onClick`, or is not a Breadcrumb.Item): it is shown there disabled, or left out. Give it `href` or `onClick`.")},[a]),(0,v.jsxs)(g.Menu,{children:[(0,v.jsx)(g.Menu.Trigger,{children:(0,v.jsx)(`button`,{type:`button`,"aria-label":n,className:t.cn(o.breadcrumbClassNames.overflowButton,y,`rounded px-1`),children:(0,v.jsx)(`span`,{"aria-hidden":`true`,children:`…`})})}),(0,v.jsx)(g.Menu.Popover,{children:i.map(e=>e.node)})]})}var I=({children:e,maxDisplayedItems:r,overflowIndex:s=1,overflow:u=`none`,overflowLabel:d=`More items`,size:p=`medium`,focusMode:h=`tab`,divider:g,className:_,onKeyDown:y,onFocus:b,ref:x,...S})=>{let C=n.flattenChildren(e),w=u===`auto`,A=w?[]:k(C,r,s),j=[];C.forEach((e,t)=>{A.includes(t)?t===A[0]&&j.push({key:D,node:(0,v.jsx)(F,{entries:A.map(e=>C[e]),label:d})}):j.push(e)});let M=h===`arrow`,{containerProps:N}=c.useRovingTabIndex({itemSelector:E,manageTabIndex:M,tabStop:`last-focused`,orientation:`horizontal`}),P=l.useMergedRefs(M?N.ref:null,x),I=()=>g==null?(0,v.jsx)(f.ChevronRightIcon,{size:T[p].divider,"data-wave-breadcrumb-separator":``,className:t.cn(o.breadcrumbClassNames.divider,`shrink-0 text-muted-foreground wave-rtl:-scale-x-100`)}):i.slotRendersContent(g)?i.renderSlot(g,`span`,t.cn(o.breadcrumbClassNames.divider,`inline-flex shrink-0 items-center text-muted-foreground`),{"aria-hidden":!0,"data-wave-breadcrumb-separator":``}):null,L=(e,n,r)=>(0,v.jsxs)(`li`,{className:t.cn(o.breadcrumbClassNames.listItem,`flex items-center gap-1`),children:[n>0&&I(),e]},r),R=C.map(O).lastIndexOf(!0),z=w?(0,v.jsx)(m.Overflow,{role:`list`,overflowDirection:`start`,buttonPosition:`before-hidden`,overflowButton:(e,t)=>(0,v.jsxs)(`span`,{className:`flex items-center gap-1`,children:[I(),(0,v.jsx)(F,{entries:C.filter(e=>t.includes(e.key)),label:d})]}),className:t.cn(o.breadcrumbClassNames.list,`gap-1`,T[p].text),children:C.map(({key:e,node:t},n)=>(0,v.jsx)(m.OverflowItem,{asChild:!0,itemId:e,pinned:n===0||n===R,children:L(t,n)},e))}):(0,v.jsx)(`ol`,{className:t.cn(o.breadcrumbClassNames.list,`m-0 flex list-none items-center gap-1 p-0`,T[p].text),children:j.map(({key:e,node:t},n)=>L(t,n,e))});return(0,v.jsx)(`nav`,{"aria-label":`Breadcrumb`,"data-size":p,"data-focus-mode":h,"data-overflow":u,...S,ref:P,"data-roving-container":M?``:void 0,onKeyDown:M?a.composeEventHandlers(y,N.onKeyDown):y,onFocus:M?a.composeEventHandlers(b,N.onFocus,{checkDefaultPrevented:!1}):b,className:t.cn(o.breadcrumbClassNames.root,_),children:z})};I.displayName=`Breadcrumb`;function L(e){let t=n.isElementOfType(e,`a`)?{href:void 0,role:`link`,disabled:void 0}:void 0;return _.cloneElement(e,{...t,"aria-disabled":!0,tabIndex:-1,onClick:void 0})}function R({child:e,icon:t,...n}){let r=t?_.cloneElement(e,void 0,t,e.props.children):e,i=h.useTriggerElement(r,n,{componentName:`Breadcrumb.Item`});return(0,v.jsx)(v.Fragment,{children:i})}function z(e){let{href:n,current:a=!1,icon:s,asChild:c=!1,children:l,className:d,onClick:f,ref:p,...m}=e,h=s&&i.slotRendersContent(s)?i.renderSlot(s,`span`,t.cn(o.breadcrumbItemClassNames.icon,`me-1 inline-flex shrink-0`),{"aria-hidden":!0}):null,g=j(c,l),C=g?`child`:a?`current`:n===void 0?f?`button`:`text`:`link`,T=c&&g===null,E=m.disabled===!0&&(C===`text`||C===`current`),D=m[`aria-disabled`],O=A(m,g);if(_.useEffect(()=>{T&&r.warnOnce(`Breadcrumb.Item:asChild`,"Breadcrumb.Item: `asChild` expects a single element child (e.g. a router link); the item was rendered normally instead."),C===`text`&&r.warnOnce(`Breadcrumb.Item:no-href`,"Breadcrumb.Item: a non-current item without `href` or `onClick` renders as plain text, not a link. Pass `href` (or `onClick`, which renders a button) to make it navigable."),E&&r.warnOnce(`Breadcrumb.Item:disabled`,"Breadcrumb.Item: `disabled` applies to link, button and asChild items; it is ignored on a text or current item.")},[T,C,E]),g){let{disabled:e,...r}=m,i=n!==void 0&&!O?{href:n}:void 0;return(0,v.jsx)(R,{...r,...i,ref:p,onClick:u.preventIfDisabled(O,f),"aria-current":a?`page`:void 0,className:t.cn(o.breadcrumbItemClassNames.root,a?x:y,d),icon:h,child:O?L(g):g})}if(C===`current`)return(0,v.jsxs)(`span`,{...w(m),ref:p,"aria-current":`page`,onClick:f,className:t.cn(o.breadcrumbItemClassNames.root,b,d),children:[h,l]});if(C===`link`){let{disabled:e,...r}=m;return(0,v.jsxs)(`a`,{...r,ref:p,href:O?void 0:n,role:O?`link`:r.role,"aria-disabled":O?!0:D,tabIndex:O?-1:r.tabIndex,onClick:u.preventIfDisabled(O,f),className:t.cn(o.breadcrumbItemClassNames.root,y,d),children:[h,l]})}if(C===`button`){let{rel:e,...n}=m;return(0,v.jsxs)(`button`,{type:`button`,...n,ref:p,onClick:f,className:t.cn(o.breadcrumbItemClassNames.root,y,d),children:[h,l]})}return(0,v.jsxs)(`span`,{...w(m),ref:p,className:t.cn(o.breadcrumbItemClassNames.root,S,d),children:[h,l]})}z.displayName=`BreadcrumbItem`;var B=Object.assign(I,{Item:z});exports.Breadcrumb=B,exports.BreadcrumbItem=z;
|
|
2
2
|
//# sourceMappingURL=Breadcrumb.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumb.cjs","names":["cn","focusRing","disabledStyles","flattenChildren","breadcrumbClassNames","ChevronRightIcon","isElementOfType","React","useTriggerElement","_Fragment","slotRendersContent","renderSlot","breadcrumbItemClassNames","preventIfDisabled","require_runtime","require_cn","require_children","require_dev","require_slot","require_classNames","require_aria","require_styles","require_icons","require_useTriggerElement","react","react_jsx_runtime","linkClasses","currentClasses","currentChildClasses","textClasses","controlOnlyAttributes","spanAttributes","attributes","key","rest","BreadcrumbRoot","items","children","className","child","index","disableLinkChild","anchor","BreadcrumbItemChild","itemProps","target","icon","node","BreadcrumbItem","props","renderedIcon","asChild","kind","current","href","onClick","invalidAsChild","ignoredDisabled","ariaDisabled","childProps","linkDisabled","value","_disabled","childRest","childHref","anchorRest","buttonRest","Breadcrumb"],"sources":["../../../src/components/navigation/Breadcrumb.tsx"],"sourcesContent":["import * as React from 'react';\nimport { preventIfDisabled } from '../../lib/aria';\nimport { flattenChildren, isElementOfType } from '../../lib/children';\nimport { cn } from '../../lib/cn';\nimport { breadcrumbClassNames, breadcrumbItemClassNames } from '../../lib/classNames';\nimport type { Slot } from '../../lib/types';\nimport { renderSlot, slotRendersContent } from '../../lib/slot';\nimport { warnOnce } from '../../lib/dev';\nimport { ChevronRightIcon } from '../../lib/icons';\nimport { disabledStyles, focusRing } from '../../lib/styles';\nimport { useTriggerElement } from '../../hooks/useTriggerElement';\n\n/** Properties for the Breadcrumb component. */\nexport interface BreadcrumbProps extends React.HTMLAttributes<HTMLElement> {\n /**\n * Breadcrumb items to render; each one is placed in its own list item. Fragments are opened, so\n * the items of a conditional group (`{isAdmin && <>…</>}`) each get their own list item too.\n */\n children: React.ReactNode;\n /** Ref to the `<nav>` element. */\n ref?: React.Ref<HTMLElement>;\n}\n\n/**\n * The props of Breadcrumb.Item that every branch shares ({@link BreadcrumbItemAnchorProps},\n * {@link BreadcrumbItemButtonProps}, {@link BreadcrumbItemDynamicProps}).\n */\nexport interface BreadcrumbItemOwnProps {\n /**\n * Whether this item represents the current page (`aria-current=\"page\"`, rendered as text).\n * @default false\n */\n current?: boolean;\n /**\n * Slot for an icon displayed before the item text. Rendered with `aria-hidden=\"true\"`. A falsy\n * icon (`''`, `0`) or a list of nothing renders no icon span.\n */\n icon?: Slot<'span'>;\n /**\n * Merge the item's props (classes, `aria-current`, handlers, ref) onto its single child element\n * instead of rendering an element — for router links:\n * `<Breadcrumb.Item asChild><RouterLink to=\"/docs\">Docs</RouterLink></Breadcrumb.Item>`.\n * The icon is rendered inside the child. The item's `href` is passed on as a default (the\n * element's own `href` wins); with a router link, give the link its destination (`to`) instead.\n * `disabled` or `aria-disabled=\"true\"`, on the item or on the element, makes it an unavailable\n * link: `aria-disabled`, out of the tab order, its own `onClick` dropped and the click cancelled\n * (a router link does not navigate); an `<a>` also loses its `href`.\n * @default false\n */\n asChild?: boolean;\n /** Label content of the breadcrumb item (with `asChild`: the link element). */\n children: React.ReactNode;\n}\n\n/**\n * The attributes only a link has (`target`, `download`, `hrefLang`, `ping`, …). Items without\n * `href` declare them as `undefined`, so they are a type error instead of landing on a `<button>`\n * or `<span>`. `rel` cannot be listed (React types it on every element, RDFa); every non-link item\n * drops it at run time instead.\n */\ntype NoAnchorOnlyAttributes = {\n [\n K in Exclude<\n keyof React.AnchorHTMLAttributes<HTMLAnchorElement>,\n keyof React.ButtonHTMLAttributes<HTMLButtonElement>\n >\n ]?: undefined;\n};\n\n/** Breadcrumb.Item rendered as a link (`href` given): anchor attributes. */\nexport interface BreadcrumbItemAnchorProps\n extends\n BreadcrumbItemOwnProps,\n Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof BreadcrumbItemOwnProps> {\n /**\n * URL the breadcrumb item links to; renders an `<a>` (unless `current`). With `asChild` it is a\n * default for the element, whose own `href` wins. Required in this branch, so `href`\n * discriminates the union and handlers without `href` are typed as button handlers.\n */\n href: string;\n /**\n * Makes the link unavailable, as Link's `disabled` does: no `href`, `role=\"link\"`,\n * `aria-disabled=\"true\"`, out of the tab order, and the click is cancelled (`onClick` is not\n * called). `aria-disabled=\"true\"` does the same.\n * @default false\n */\n disabled?: boolean;\n /** Ref to the rendered element (`<a>`, or `<span>` for the current item). */\n ref?: React.Ref<HTMLAnchorElement | HTMLSpanElement>;\n}\n\n/**\n * Breadcrumb.Item without `href`: a `<button type=\"button\">` when `onClick` is given (button\n * attributes; `disabled` gives it the disabled look), plain text otherwise. A `rel` is not\n * rendered on either.\n */\nexport interface BreadcrumbItemButtonProps\n extends\n BreadcrumbItemOwnProps,\n NoAnchorOnlyAttributes,\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof BreadcrumbItemOwnProps> {\n /** Items without a link have no `href`. */\n href?: undefined;\n /** Ref to the rendered element (`<button>`, or `<span>` for text and the current item). */\n ref?: React.Ref<HTMLButtonElement | HTMLSpanElement>;\n}\n\n/**\n * Properties for the BreadcrumbItem sub-component: link props with `href`, button props without.\n *\n * A union type (0.4 had an interface): an interface cannot extend it, so extend one branch\n * (`interface X extends BreadcrumbItemAnchorProps`) or intersect\n * (`type X = BreadcrumbItemProps & { … }`). `React.ComponentProps<typeof Breadcrumb.Item>`\n * resolves to the last overload, {@link BreadcrumbItemDynamicProps}.\n */\nexport type BreadcrumbItemProps = BreadcrumbItemAnchorProps | BreadcrumbItemButtonProps;\n\n/**\n * Breadcrumb.Item with an `href` known only at run time (`string | undefined`): a link when it is\n * a string, otherwise a button (with `onClick`) or text. Handlers receive `HTMLElement` events and\n * only the attributes all kinds share are accepted (the 0.4 prop shape). Resolved after the button\n * and link signatures.\n */\nexport interface BreadcrumbItemDynamicProps\n extends\n BreadcrumbItemOwnProps,\n Omit<React.HTMLAttributes<HTMLElement>, keyof BreadcrumbItemOwnProps> {\n /** URL the breadcrumb item links to when defined. */\n href?: string;\n /**\n * Makes a link or button item unavailable (see {@link BreadcrumbItemAnchorProps} and\n * {@link BreadcrumbItemButtonProps}); ignored, with a development warning, on a text or current\n * item.\n * @default false\n */\n disabled?: boolean;\n /** Ref to the rendered element. */\n ref?: React.Ref<HTMLElement>;\n}\n\n/** The props every item kind shares at runtime (the union narrowed by `href`). */\ntype BreadcrumbEntryProps = BreadcrumbItemOwnProps &\n Omit<React.AllHTMLAttributes<HTMLElement>, keyof BreadcrumbItemOwnProps | 'ref'> & {\n ref?: React.Ref<HTMLElement>;\n };\n\n/**\n * Links, buttons and `asChild` elements. The hover underline is gated (C-TOKENS), and the\n * disabled look covers a `disabled` button and an `aria-disabled` link.\n */\nconst linkClasses = cn(\n 'inline-flex cursor-pointer items-center text-primary no-underline not-disabled:not-aria-disabled:hover:underline',\n focusRing,\n disabledStyles,\n);\nconst currentClasses = 'inline-flex items-center font-semibold text-foreground';\n/** A current `asChild` element is the consumer's link: it takes focus and can be disabled. */\nconst currentChildClasses = cn(currentClasses, focusRing, disabledStyles);\nconst textClasses = 'inline-flex items-center text-foreground';\n\n/**\n * The attributes only a `<button>` or an `<a>` has (`disabled`, `type`, `form*`, `name`, `value`;\n * `target`, `download`, `hrefLang`, `ping`, `media`, `referrerPolicy`). The button props allow\n * `disabled` without `onClick`, and a current item keeps its link attributes, so the `<span>` of\n * the text and current items drops them instead of rendering invalid markup\n * (`<span disabled>`, `<span target=\"_blank\">`). Typed as a record so a key React adds to either\n * element's attributes is a compile error until it is listed here. `rel` is dropped as well: React\n * types it on every element (RDFa), but on a breadcrumb it comes with a link.\n */\ntype ControlOnlyAttribute =\n | Exclude<\n keyof React.ButtonHTMLAttributes<HTMLButtonElement>,\n keyof React.HTMLAttributes<HTMLElement>\n >\n | Exclude<\n keyof React.AnchorHTMLAttributes<HTMLAnchorElement>,\n keyof React.HTMLAttributes<HTMLElement> | 'href'\n >;\n\nconst controlOnlyAttributes: ReadonlySet<string> = /* @__PURE__ */ new Set([\n 'rel',\n ...Object.keys({\n disabled: true,\n type: true,\n form: true,\n formAction: true,\n formEncType: true,\n formMethod: true,\n formNoValidate: true,\n formTarget: true,\n name: true,\n value: true,\n target: true,\n download: true,\n hrefLang: true,\n ping: true,\n media: true,\n referrerPolicy: true,\n } satisfies Record<ControlOnlyAttribute, true>),\n]);\n\n/** The props that are valid on the `<span>` of a text or current item. */\nfunction spanAttributes(rest: Record<string, unknown>): React.HTMLAttributes<HTMLSpanElement> {\n const attributes: Record<string, unknown> = {};\n for (const key of Object.keys(rest)) {\n if (!controlOnlyAttributes.has(key)) attributes[key] = rest[key];\n }\n return attributes as React.HTMLAttributes<HTMLSpanElement>;\n}\n\nconst BreadcrumbRoot = ({ children, className, ref, ...rest }: BreadcrumbProps) => {\n // Fragments are opened (`{isAdmin && <>…</>}`), so every crumb gets its own list item and separator.\n const items = flattenChildren(children);\n\n return (\n <nav\n ref={ref}\n aria-label=\"Breadcrumb\"\n {...rest}\n className={cn(breadcrumbClassNames.root, className)}\n >\n <ol\n className={cn(\n breadcrumbClassNames.list,\n 'm-0 flex list-none items-center gap-1 p-0 text-body-1',\n )}\n >\n {items.map(({ key, node: child }, index) => (\n <li key={key} className={cn(breadcrumbClassNames.listItem, 'flex items-center gap-1')}>\n {index > 0 && (\n <ChevronRightIcon\n data-wave-breadcrumb-separator=\"\"\n className={cn(\n breadcrumbClassNames.divider,\n 'shrink-0 text-muted-foreground wave-rtl:-scale-x-100',\n )}\n />\n )}\n {child}\n </li>\n ))}\n </ol>\n </nav>\n );\n};\nBreadcrumbRoot.displayName = 'Breadcrumb';\n\ninterface BreadcrumbItemChildProps extends React.HTMLAttributes<HTMLElement> {\n /** The item's `href`, a default for the element (the element's own `href` wins). */\n href?: string;\n child: React.ReactElement<{ children?: React.ReactNode }>;\n icon: React.ReactNode;\n ref?: React.Ref<HTMLElement>;\n}\n\n/**\n * Link's disabled contract for an `asChild` element: an `<a>` drops its `href` (it is still\n * announced as a link); any element gets `aria-disabled`, leaves the tab order and loses its own\n * `onClick`. The item's click handler cancels the click, so a router link does not navigate.\n */\nfunction disableLinkChild(\n child: React.ReactElement<{ children?: React.ReactNode }>,\n): React.ReactElement<{ children?: React.ReactNode }> {\n const anchor = isElementOfType(child, 'a')\n ? { href: undefined, role: 'link', disabled: undefined }\n : undefined;\n return React.cloneElement(child as React.ReactElement<Record<string, unknown>>, {\n ...anchor,\n 'aria-disabled': true,\n tabIndex: -1,\n onClick: undefined,\n }) as React.ReactElement<{ children?: React.ReactNode }>;\n}\n\n/**\n * `asChild` rendering: the item's props are merged onto the consumer's element with\n * `useTriggerElement` (the element's own handlers run first and its classes win conflicts; its\n * ref and the item's ref are both attached). The icon is placed inside the element.\n */\nfunction BreadcrumbItemChild({ child, icon, ...itemProps }: BreadcrumbItemChildProps) {\n const target = icon ? React.cloneElement(child, undefined, icon, child.props.children) : child;\n const node = useTriggerElement(target, itemProps, { componentName: 'Breadcrumb.Item' });\n return <>{node}</>;\n}\n\n/**\n * One step of a breadcrumb trail:\n * - `href` → a link (`<a>`, anchor attributes);\n * - `current` → the current page as text (`<span aria-current=\"page\">`);\n * - no `href` with `onClick` → a `<button type=\"button\">` styled as a link;\n * - no `href` and no `onClick` → plain text (`<span>`; development warning for a non-current item);\n * - `asChild` → the props are merged onto the single child element (router links).\n *\n * Typed by overloads, resolved in order: without `href` (button props, button events), with a\n * string `href` (anchor props, anchor events), then an `href` that may be `undefined` at run time\n * ({@link BreadcrumbItemDynamicProps}: `HTMLElement` events).\n *\n * Also exported as `BreadcrumbItem` (import the flat name from React Server Components).\n */\nfunction BreadcrumbItem(props: BreadcrumbItemButtonProps): React.ReactElement;\nfunction BreadcrumbItem(props: BreadcrumbItemAnchorProps): React.ReactElement;\nfunction BreadcrumbItem(props: BreadcrumbItemDynamicProps): React.ReactElement;\nfunction BreadcrumbItem(\n props: BreadcrumbItemProps | BreadcrumbItemDynamicProps,\n): React.ReactElement {\n const {\n href,\n current = false,\n icon,\n asChild = false,\n children,\n className,\n onClick,\n ref,\n ...rest\n } = props as BreadcrumbEntryProps;\n\n // A falsy icon (`icon={name && <Icon />}` with `name` '' or a count of 0) is no icon, as in Nav,\n // Tree and Avatar, and so is a collection whose items render nothing: no empty span and no stray\n // `me-1` margin. The check does not consume a generator: renderSlot still renders its items.\n const renderedIcon =\n icon && slotRendersContent(icon)\n ? renderSlot(icon, 'span', cn(breadcrumbItemClassNames.icon, 'me-1 inline-flex shrink-0'), {\n 'aria-hidden': true,\n })\n : null;\n const child =\n asChild && React.isValidElement<{ children?: React.ReactNode }>(children) ? children : null;\n const kind = child\n ? 'child'\n : current\n ? 'current'\n : href !== undefined\n ? 'link'\n : onClick\n ? 'button'\n : 'text';\n\n const invalidAsChild = asChild && child === null;\n const ignoredDisabled = rest.disabled === true && (kind === 'text' || kind === 'current');\n // Link and asChild items follow Link's disabled contract. `<a disabled>` does not block\n // navigation, and an `aria-disabled` link only looks disabled unless the click is cancelled.\n // With asChild the element is the link, so its own `disabled`/`aria-disabled` count too.\n const ariaDisabled = rest['aria-disabled'];\n const childProps = (child?.props ?? {}) as Record<string, unknown>;\n const linkDisabled = [\n rest.disabled,\n ariaDisabled,\n childProps.disabled,\n childProps['aria-disabled'],\n ].some((value) => value === true || value === 'true');\n React.useEffect(() => {\n if (invalidAsChild) {\n warnOnce(\n 'Breadcrumb.Item:asChild',\n 'Breadcrumb.Item: `asChild` expects a single element child (e.g. a router link); the item was rendered normally instead.',\n );\n }\n if (kind === 'text') {\n warnOnce(\n 'Breadcrumb.Item:no-href',\n 'Breadcrumb.Item: a non-current item without `href` or `onClick` renders as plain text, not a link. Pass `href` (or `onClick`, which renders a button) to make it navigable.',\n );\n }\n if (ignoredDisabled) {\n warnOnce(\n 'Breadcrumb.Item:disabled',\n 'Breadcrumb.Item: `disabled` applies to link, button and asChild items; it is ignored on a text or current item.',\n );\n }\n }, [invalidAsChild, kind, ignoredDisabled]);\n\n if (child) {\n const { disabled: _disabled, ...childRest } = rest;\n // Like the other item props, `href` is a default for the element (its own `href` wins). A\n // disabled link has no destination, so it is not passed then.\n const childHref = href !== undefined && !linkDisabled ? { href } : undefined;\n return (\n <BreadcrumbItemChild\n {...(childRest as React.HTMLAttributes<HTMLElement>)}\n {...childHref}\n ref={ref}\n onClick={preventIfDisabled(linkDisabled, onClick)}\n aria-current={current ? 'page' : undefined}\n className={cn(\n breadcrumbItemClassNames.root,\n current ? currentChildClasses : linkClasses,\n className,\n )}\n icon={renderedIcon}\n child={linkDisabled ? disableLinkChild(child) : child}\n />\n );\n }\n\n if (kind === 'current') {\n return (\n <span\n {...spanAttributes(rest)}\n ref={ref as React.Ref<HTMLSpanElement>}\n aria-current=\"page\"\n onClick={onClick}\n className={cn(breadcrumbItemClassNames.root, currentClasses, className)}\n >\n {renderedIcon}\n {children}\n </span>\n );\n }\n\n if (kind === 'link') {\n const { disabled: _disabled, ...anchorRest } = rest;\n return (\n <a\n {...(anchorRest as React.AnchorHTMLAttributes<HTMLAnchorElement>)}\n ref={ref as React.Ref<HTMLAnchorElement>}\n href={linkDisabled ? undefined : href}\n role={linkDisabled ? 'link' : anchorRest.role}\n aria-disabled={linkDisabled ? true : ariaDisabled}\n tabIndex={linkDisabled ? -1 : anchorRest.tabIndex}\n onClick={preventIfDisabled(linkDisabled, onClick)}\n className={cn(breadcrumbItemClassNames.root, linkClasses, className)}\n >\n {renderedIcon}\n {children}\n </a>\n );\n }\n\n if (kind === 'button') {\n // `rel` only belongs on a link: a button item drops it, like the text and current items.\n const { rel, ...buttonRest } = rest;\n return (\n <button\n type=\"button\"\n {...(buttonRest as React.ButtonHTMLAttributes<HTMLButtonElement>)}\n ref={ref as React.Ref<HTMLButtonElement>}\n onClick={onClick}\n className={cn(breadcrumbItemClassNames.root, linkClasses, className)}\n >\n {renderedIcon}\n {children}\n </button>\n );\n }\n\n return (\n <span\n {...spanAttributes(rest)}\n ref={ref as React.Ref<HTMLSpanElement>}\n className={cn(breadcrumbItemClassNames.root, textClasses, className)}\n >\n {renderedIcon}\n {children}\n </span>\n );\n}\nBreadcrumbItem.displayName = 'BreadcrumbItem';\n\n/**\n * A breadcrumb trail: a `<nav aria-label=\"Breadcrumb\">` landmark with an ordered list. Each child\n * is placed in its own list item (Fragments are opened, so each of their items gets one too); from\n * the second one on, the item begins with a decorative separator chevron that is mirrored in\n * right-to-left layouts.\n *\n * `Breadcrumb.Item` is also exported as `BreadcrumbItem`: React Server Components import the flat\n * name, because dotted access needs a client file.\n *\n * @example\n * <Breadcrumb>\n * <Breadcrumb.Item href=\"/\">Home</Breadcrumb.Item>\n * <Breadcrumb.Item current>Settings</Breadcrumb.Item>\n * </Breadcrumb>\n */\nexport const Breadcrumb = /* @__PURE__ */ Object.assign(BreadcrumbRoot, {\n Item: BreadcrumbItem,\n});\n\nexport { BreadcrumbItem };\n"],"mappings":"ycAsJA,IAAM0B,EAAc1B,EAAAA,GAClB,mHACAC,EAAAA,UACAC,EAAAA,cACF,EACMyB,EAAiB,yDAEjBC,EAAsB5B,EAAAA,GAAG2B,EAAgB1B,EAAAA,UAAWC,EAAAA,cAAc,EAClE2B,EAAc,2CAqBdC,EAA6D,IAAI,IAAI,CACzE,MACA,GAAG,OAAO,KAAK,CACb,SAAU,GACV,KAAM,GACN,KAAM,GACN,WAAY,GACZ,YAAa,GACb,WAAY,GACZ,eAAgB,GAChB,WAAY,GACZ,KAAM,GACN,MAAO,GACP,OAAQ,GACR,SAAU,GACV,SAAU,GACV,KAAM,GACN,MAAO,GACP,eAAgB,EAClB,CAA8C,CAChD,CAAC,EAGD,SAASC,EAAe,EAAsE,CAC5F,IAAMC,EAAsC,CAAC,EAC7C,IAAK,IAAMC,KAAO,OAAO,KAAKC,CAAI,EAC3BJ,EAAsB,IAAIG,CAAG,IAAG,EAAWA,GAAOC,EAAKD,IAE9D,OAAOD,CACT,CAEA,IAAMG,GAAkB,CAAE,WAAU,YAAW,MAAK,GAAGD,KAA4B,CAEjF,IAAME,EAAQjC,EAAAA,gBAAgBkC,CAAQ,EAEtC,OACE,EAAAZ,EAAA,IAAA,CAAC,MAAD,CACO,MACL,aAAW,aACX,GAAIS,EACJ,UAAWlC,EAAAA,GAAGI,EAAAA,qBAAqB,KAAMkC,CAAS,EAElD,UAAA,EAAAb,EAAA,IAAA,CAAC,KAAD,CACE,UAAWzB,EAA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OGY,EACAb,CACG,IAIV,GAAIe,IAAS,OAAQ,CACnB,GAAM,CAAE,SAAUU,EAAW,GAAGG,GAAe/B,EAC/C,OACE,EAAAT,EAAA,KAAA,CAAC,IAAD,CACE,GAAKwC,EACA,MACL,KAAML,EAAe,IAAA,GAAYN,EACjC,KAAMM,EAAe,OAASK,EAAW,KACzC,gBAAeL,EAAe,GAAOF,EACrC,SAAUE,EAAe,GAAKK,EAAW,SACzC,QAASpD,EAAAA,kBAAkB+C,EAAcL,CAAO,EAChD,UAAWvD,EAAAA,GAAGY,EAAAA,yBAAyB,KAAMc,EAAaY,CAAS,EARrE,SAAA,CAUGY,EACAb,CACA,GAEP,CAEA,GAAIe,IAAS,SAAU,CAErB,GAAM,CAAE,MAAK,GAAGc,GAAehC,EAC/B,OACE,EAAAT,EAAA,KAAA,CAAC,SAAD,CACE,KAAK,SACL,GAAKyC,EACA,MACI,UACT,UAAWlE,EAAAA,GAAGY,EAAAA,yBAAyB,KAAMc,EAAaY,CAAS,EALrE,SAAA,CAOGY,EACAb,CACK,GAEZ,CAEA,OACE,EAAAZ,EAAA,KAAA,CAAC,OAAD,CACE,GAAIM,EAAeG,CAAI,EAClB,MACL,UAAWlC,EAAAA,GAAGY,EAAAA,yBAAyB,KAAMiB,EAAaS,CAAS,EAHrE,SAAA,CAKGY,EACAb,CACG,GAEV,CACA,EAAe,YAAc,iBAiB7B,IAAa8B,EAA6B,OAAO,OAAOhC,EAAgB,CACtE,KAAMa,CACR,CAAC"}
|
|
1
|
+
{"version":3,"file":"Breadcrumb.cjs","names":["cn","focusRing","disabledStyles","isElementOfType","partitionBreadcrumbItems","unwrapFragment","React","Menu","composeEventHandlers","breadcrumbClassNames","flattenChildren","useRovingTabIndex","useMergedRefs","ChevronRightIcon","slotRendersContent","renderSlot","Overflow","OverflowItem","useTriggerElement","_Fragment","breadcrumbItemClassNames","preventIfDisabled","require_runtime","require_cn","require_children","require_dev","require_slot","require_composeEventHandlers","require_classNames","require_breadcrumb","require_useRovingTabIndex","require_useMergedRefs","require_aria","require_styles","require_icons","require_renderTrigger","require_Overflow","require_useTriggerElement","require_Menu","react","react_jsx_runtime","linkClasses","currentClasses","currentChildClasses","textClasses","controlOnlyAttributes","spanAttributes","attributes","key","rest","breadcrumbSizes","BREADCRUMB_FOCUS_SELECTOR","OVERFLOW_KEY","isCurrentEntry","entry","BreadcrumbItem","collapsedIndexes","maxDisplayedItems","entries","index","overflowIndex","overflowItems","count","length","current","start","end","offset","isItemDisabled","childProps","child","props","value","asChildElement","asChild","children","isComponentElement","element","OverflowMenuLink","LinkType","linkAs","linkDisabled","overflowMenuItem","item","itemHref","inner","label","disabled","href","_children","_className","_style","_ref","_id","_role","_tabIndex","_ariaDisabled","linkOnClick","linkProps","defaultHref","onClick","BreadcrumbOverflowMenu","items","unlistable","BreadcrumbRoot","auto","overflow","collapsed","trail","collapsedIndex","overflowLabel","arrow","focusMode","mergedRef","containerProps","ref","renderDivider","divider","size","renderListItem","node","currentIndex","list","hiddenIds","onKeyDown","onFocus","className","disableLinkChild","anchor","BreadcrumbItemChild","itemProps","target","icon","renderedIcon","kind","invalidAsChild","ignoredDisabled","ariaDisabled","_disabled","childRest","childHref","anchorRest","buttonRest","Breadcrumb"],"sources":["../../../src/components/navigation/Breadcrumb.tsx"],"sourcesContent":["import * as React from 'react';\nimport { preventIfDisabled } from '../../lib/aria';\nimport { flattenChildren, isElementOfType } from '../../lib/children';\nimport { cn } from '../../lib/cn';\nimport { breadcrumbClassNames, breadcrumbItemClassNames } from '../../lib/classNames';\nimport { partitionBreadcrumbItems } from '../../lib/breadcrumb';\nimport { composeEventHandlers } from '../../lib/composeEventHandlers';\nimport type { CoreSize, FocusMode, Slot } from '../../lib/types';\nimport { renderSlot, slotRendersContent } from '../../lib/slot';\nimport { unwrapFragment } from '../../lib/renderTrigger';\nimport { warnOnce } from '../../lib/dev';\nimport { ChevronRightIcon } from '../../lib/icons';\nimport { disabledStyles, focusRing } from '../../lib/styles';\nimport { useMergedRefs } from '../../hooks/useMergedRefs';\nimport { useRovingTabIndex } from '../../hooks/useRovingTabIndex';\nimport { useTriggerElement } from '../../hooks/useTriggerElement';\nimport { Overflow, OverflowItem } from '../layout/Overflow';\nimport { Menu } from './Menu';\n\n/** Properties for the Breadcrumb component. */\nexport interface BreadcrumbProps extends React.HTMLAttributes<HTMLElement> {\n /**\n * Breadcrumb items to render; each one is placed in its own list item. Fragments are opened, so\n * the items of a conditional group (`{isAdmin && <>…</>}`) each get their own list item too.\n */\n children: React.ReactNode;\n /**\n * The most items the trail shows, the overflow button not counted. A longer trail collapses its\n * middle items, from `overflowIndex`, into a \"…\" button that opens a menu of them (a link item\n * becomes a `Menu.ItemLink`, an `asChild` element of a component (a router link) a\n * `Menu.ItemLink` rendered by that component with the element's own props, its `as` included,\n * a button item a `Menu.Item`). The first item and the last `current` item are never hidden.\n * Without it the whole trail is shown.\n * A value below 1 means 6, as in `partitionBreadcrumbItems`. Ignored with `overflow=\"auto\"`.\n */\n maxDisplayedItems?: number;\n /**\n * The index of the first collapsed item (with `maxDisplayedItems`). It is at least 1, so the\n * first item stays, and at most `maxDisplayedItems - 1`. Ignored with `overflow=\"auto\"`.\n * @default 1\n */\n overflowIndex?: number;\n /**\n * `'auto'` fits the trail to its room: the middle items that do not fit are hidden, from the\n * start of the trail; the first item and the last `current` item never are. A \"…\" list item\n * with its own separator then stands just before the first hidden item (so the trail reads\n * \"Home › … › Parent › Page\"), and its button (`overflowLabel`) opens a menu of the hidden\n * items, in trail order. When even the first and the current item do not fit, the button covers\n * the end of the trail. The room decides alone: `maxDisplayedItems` and `overflowIndex` do not\n * apply. The trail list is then an `Overflow` (a `role=\"list\"` element with the `wave-overflow`\n * class and 4px of padding) that measures with `ResizeObserver`. `'none'` shows the trail as\n * the other props say.\n * @default 'none'\n */\n overflow?: 'none' | 'auto';\n /**\n * Accessible name of the overflow button (with `maxDisplayedItems` or `overflow=\"auto\"`).\n * @default \"More items\"\n */\n overflowLabel?: string;\n /**\n * Text and divider size.\n * @default 'medium'\n */\n size?: CoreSize;\n /**\n * `'tab'`: every link is a Tab stop. `'arrow'`: the trail is one Tab stop (the last focused link\n * or button, at first the first one) and the arrow keys (mirrored in right-to-left layouts),\n * Home and End move between its links and the overflow button.\n * @default 'tab'\n */\n focusMode?: FocusMode;\n /**\n * The separator between items; a decorative `<span>`. `null` or `undefined` keep the chevron\n * (mirrored in right-to-left layouts); `false`, or content that renders nothing, hides the\n * separators. A custom divider is not mirrored.\n */\n divider?: Slot<'span'>;\n /** Ref to the `<nav>` element. */\n ref?: React.Ref<HTMLElement>;\n}\n\n/**\n * The props of Breadcrumb.Item that every branch shares ({@link BreadcrumbItemAnchorProps},\n * {@link BreadcrumbItemButtonProps}, {@link BreadcrumbItemDynamicProps}).\n */\nexport interface BreadcrumbItemOwnProps {\n /**\n * Whether this item represents the current page (`aria-current=\"page\"`, rendered as text).\n * @default false\n */\n current?: boolean;\n /**\n * Slot for an icon displayed before the item text. Rendered with `aria-hidden=\"true\"`. A falsy\n * icon (`''`, `0`) or a list of nothing renders no icon span.\n */\n icon?: Slot<'span'>;\n /**\n * Merge the item's props (classes, `aria-current`, handlers, ref) onto its single child element\n * instead of rendering an element — for router links:\n * `<Breadcrumb.Item asChild><RouterLink to=\"/docs\">Docs</RouterLink></Breadcrumb.Item>`.\n * The icon is rendered inside the child. The item's `href` is passed on as a default (the\n * element's own `href` wins); with a router link, give the link its destination (`to`) instead.\n * `disabled` or `aria-disabled=\"true\"`, on the item or on the element, makes it an unavailable\n * link: `aria-disabled`, out of the tab order, its own `onClick` dropped and the click cancelled\n * (a router link does not navigate); an `<a>` also loses its `href`.\n * @default false\n */\n asChild?: boolean;\n /** Label content of the breadcrumb item (with `asChild`: the link element). */\n children: React.ReactNode;\n}\n\n/**\n * The attributes only a link has (`target`, `download`, `hrefLang`, `ping`, …). Items without\n * `href` declare them as `undefined`, so they are a type error instead of landing on a `<button>`\n * or `<span>`. `rel` cannot be listed (React types it on every element, RDFa); every non-link item\n * drops it at run time instead.\n */\ntype NoAnchorOnlyAttributes = {\n [\n K in Exclude<\n keyof React.AnchorHTMLAttributes<HTMLAnchorElement>,\n keyof React.ButtonHTMLAttributes<HTMLButtonElement>\n >\n ]?: undefined;\n};\n\n/** Breadcrumb.Item rendered as a link (`href` given): anchor attributes. */\nexport interface BreadcrumbItemAnchorProps\n extends\n BreadcrumbItemOwnProps,\n Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof BreadcrumbItemOwnProps> {\n /**\n * URL the breadcrumb item links to; renders an `<a>` (unless `current`). With `asChild` it is a\n * default for the element, whose own `href` wins. Required in this branch, so `href`\n * discriminates the union and handlers without `href` are typed as button handlers.\n */\n href: string;\n /**\n * Makes the link unavailable, as Link's `disabled` does: no `href`, `role=\"link\"`,\n * `aria-disabled=\"true\"`, out of the tab order, and the click is cancelled (`onClick` is not\n * called). `aria-disabled=\"true\"` does the same.\n * @default false\n */\n disabled?: boolean;\n /** Ref to the rendered element (`<a>`, or `<span>` for the current item). */\n ref?: React.Ref<HTMLAnchorElement | HTMLSpanElement>;\n}\n\n/**\n * Breadcrumb.Item without `href`: a `<button type=\"button\">` when `onClick` is given (button\n * attributes; `disabled` gives it the disabled look), plain text otherwise. A `rel` is not\n * rendered on either.\n */\nexport interface BreadcrumbItemButtonProps\n extends\n BreadcrumbItemOwnProps,\n NoAnchorOnlyAttributes,\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof BreadcrumbItemOwnProps> {\n /** Items without a link have no `href`. */\n href?: undefined;\n /** Ref to the rendered element (`<button>`, or `<span>` for text and the current item). */\n ref?: React.Ref<HTMLButtonElement | HTMLSpanElement>;\n}\n\n/**\n * Properties for the BreadcrumbItem sub-component: link props with `href`, button props without.\n *\n * A union type (0.4 had an interface): an interface cannot extend it, so extend one branch\n * (`interface X extends BreadcrumbItemAnchorProps`) or intersect\n * (`type X = BreadcrumbItemProps & { … }`). `React.ComponentProps<typeof Breadcrumb.Item>`\n * resolves to the last overload, {@link BreadcrumbItemDynamicProps}.\n */\nexport type BreadcrumbItemProps = BreadcrumbItemAnchorProps | BreadcrumbItemButtonProps;\n\n/**\n * Breadcrumb.Item with an `href` known only at run time (`string | undefined`): a link when it is\n * a string, otherwise a button (with `onClick`) or text. Handlers receive `HTMLElement` events and\n * only the attributes all kinds share are accepted (the 0.4 prop shape). Resolved after the button\n * and link signatures.\n */\nexport interface BreadcrumbItemDynamicProps\n extends\n BreadcrumbItemOwnProps,\n Omit<React.HTMLAttributes<HTMLElement>, keyof BreadcrumbItemOwnProps> {\n /** URL the breadcrumb item links to when defined. */\n href?: string;\n /**\n * Makes a link or button item unavailable (see {@link BreadcrumbItemAnchorProps} and\n * {@link BreadcrumbItemButtonProps}); ignored, with a development warning, on a text or current\n * item.\n * @default false\n */\n disabled?: boolean;\n /** Ref to the rendered element. */\n ref?: React.Ref<HTMLElement>;\n}\n\n/** The props every item kind shares at runtime (the union narrowed by `href`). */\ntype BreadcrumbEntryProps = BreadcrumbItemOwnProps &\n Omit<React.AllHTMLAttributes<HTMLElement>, keyof BreadcrumbItemOwnProps | 'ref'> & {\n ref?: React.Ref<HTMLElement>;\n };\n\n/**\n * Links, buttons and `asChild` elements. The hover underline is gated (C-TOKENS), and the\n * disabled look covers a `disabled` button and an `aria-disabled` link.\n */\nconst linkClasses = cn(\n 'inline-flex cursor-pointer items-center text-primary no-underline not-disabled:not-aria-disabled:hover:underline',\n focusRing,\n disabledStyles,\n);\nconst currentClasses = 'inline-flex items-center font-semibold text-foreground';\n/** A current `asChild` element is the consumer's link: it takes focus and can be disabled. */\nconst currentChildClasses = cn(currentClasses, focusRing, disabledStyles);\nconst textClasses = 'inline-flex items-center text-foreground';\n\n/**\n * The attributes only a `<button>` or an `<a>` has (`disabled`, `type`, `form*`, `name`, `value`;\n * `target`, `download`, `hrefLang`, `ping`, `media`, `referrerPolicy`). The button props allow\n * `disabled` without `onClick`, and a current item keeps its link attributes, so the `<span>` of\n * the text and current items drops them instead of rendering invalid markup\n * (`<span disabled>`, `<span target=\"_blank\">`). Typed as a record so a key React adds to either\n * element's attributes is a compile error until it is listed here. `rel` is dropped as well: React\n * types it on every element (RDFa), but on a breadcrumb it comes with a link.\n */\ntype ControlOnlyAttribute =\n | Exclude<\n keyof React.ButtonHTMLAttributes<HTMLButtonElement>,\n keyof React.HTMLAttributes<HTMLElement>\n >\n | Exclude<\n keyof React.AnchorHTMLAttributes<HTMLAnchorElement>,\n keyof React.HTMLAttributes<HTMLElement> | 'href'\n >;\n\nconst controlOnlyAttributes: ReadonlySet<string> = /* @__PURE__ */ new Set([\n 'rel',\n ...Object.keys({\n disabled: true,\n type: true,\n form: true,\n formAction: true,\n formEncType: true,\n formMethod: true,\n formNoValidate: true,\n formTarget: true,\n name: true,\n value: true,\n target: true,\n download: true,\n hrefLang: true,\n ping: true,\n media: true,\n referrerPolicy: true,\n } satisfies Record<ControlOnlyAttribute, true>),\n]);\n\n/** The props that are valid on the `<span>` of a text or current item. */\nfunction spanAttributes(rest: Record<string, unknown>): React.HTMLAttributes<HTMLSpanElement> {\n const attributes: Record<string, unknown> = {};\n for (const key of Object.keys(rest)) {\n if (!controlOnlyAttributes.has(key)) attributes[key] = rest[key];\n }\n return attributes as React.HTMLAttributes<HTMLSpanElement>;\n}\n\n/** Text step and divider size (px) of each size; literal classes for Tailwind's scan. */\nconst breadcrumbSizes = {\n small: { text: 'text-caption-1', divider: 12 },\n medium: { text: 'text-body-1', divider: 12 },\n large: { text: 'text-body-2', divider: 16 },\n} as const satisfies Record<CoreSize, { text: string; divider: number }>;\n\n/** The controls of the trail that the arrow keys visit (`focusMode=\"arrow\"`). */\nconst BREADCRUMB_FOCUS_SELECTOR = 'a[href], button, [role=\"link\"]';\n\n/** The key of the list item that holds the overflow button; a flattened child key never matches. */\nconst OVERFLOW_KEY = '\\u0000overflow';\n\ntype BreadcrumbEntry = ReturnType<typeof flattenChildren>[number];\n\n/** The props of a trail item that the overflow menu reads. */\ninterface HiddenItemProps {\n href?: string;\n current?: boolean;\n icon?: Slot<'span'>;\n disabled?: boolean;\n 'aria-disabled'?: boolean | 'true' | 'false';\n asChild?: boolean;\n children?: React.ReactNode;\n onClick?: React.MouseEventHandler<HTMLElement>;\n}\n\nfunction isCurrentEntry(entry: BreadcrumbEntry): boolean {\n return (\n isElementOfType<HiddenItemProps>(entry.node, BreadcrumbItem) &&\n entry.node.props.current === true\n );\n}\n\n/**\n * The indexes of the entries that collapse into the overflow menu: one contiguous run, as long as\n * the partition of `partitionBreadcrumbItems` says, that never holds the first entry or the last\n * current one. A run that would hold the current entry moves past it when it fits there, else ends\n * just before it, else shrinks to the longer side of it.\n */\nfunction collapsedIndexes(\n entries: readonly BreadcrumbEntry[],\n maxDisplayedItems: number | undefined,\n overflowIndex: number,\n): number[] {\n if (maxDisplayedItems === undefined) return [];\n const { overflowItems } = partitionBreadcrumbItems({\n items: entries.map((_, index) => index),\n maxDisplayedItems,\n overflowIndex: Math.max(1, overflowIndex),\n });\n if (!overflowItems) return [];\n const count = entries.length;\n const length = overflowItems.length;\n const current = entries.map(isCurrentEntry).lastIndexOf(true);\n let start = Math.max(1, overflowItems[0]);\n let end = Math.min(count, start + length);\n if (current >= start && current < end) {\n if (current + 1 + length <= count) {\n start = current + 1;\n end = start + length;\n } else if (current - length >= 1) {\n start = current - length;\n end = current;\n } else if (current - 1 >= count - current - 1) {\n start = 1;\n end = current;\n } else {\n start = current + 1;\n end = Math.min(count, start + length);\n }\n }\n return Array.from({ length: Math.max(0, end - start) }, (_, offset) => start + offset);\n}\n\n/**\n * Whether an item is unavailable: `disabled` or `aria-disabled=\"true\"` on the item, or on the\n * element of an `asChild` item. One rule for the visible item and for its entry in the overflow menu.\n */\nfunction isItemDisabled(\n props: { disabled?: unknown; 'aria-disabled'?: unknown },\n child: React.ReactElement | null,\n): boolean {\n const childProps = (child?.props ?? {}) as Record<string, unknown>;\n return [\n props.disabled,\n props['aria-disabled'],\n childProps.disabled,\n childProps['aria-disabled'],\n ].some((value) => value === true || value === 'true');\n}\n\n/** The props of an `asChild` element that the overflow menu reads. */\ninterface HiddenItemChildProps {\n href?: unknown;\n as?: React.ElementType;\n children?: React.ReactNode;\n onClick?: React.MouseEventHandler<HTMLElement>;\n [prop: string]: unknown;\n}\n\n/**\n * The element of an `asChild` item: its single element child, a Fragment around it unwrapped (as\n * `useTriggerElement` does), so the trail and the overflow menu read the same element.\n */\nfunction asChildElement<P>(\n asChild: boolean | undefined,\n children: React.ReactNode,\n): React.ReactElement<P> | null {\n if (!asChild) return null;\n const child = unwrapFragment(children);\n return React.isValidElement<P>(child) ? child : null;\n}\n\n/**\n * Whether an `asChild` element is one of a component (a router link) rather than of a tag such as\n * `<a>`: a function, or an object type (`forwardRef`, `memo`, `lazy`, a client reference).\n */\nfunction isComponentElement(element: React.ReactElement): boolean {\n return (\n typeof element.type === 'function' ||\n (typeof element.type === 'object' && element.type !== null)\n );\n}\n\n/** The props {@link OverflowMenuLink} reads besides those it passes on. */\ninterface OverflowMenuLinkProps {\n /** The component of the `asChild` element. */\n linkType: React.ElementType;\n /** The element's own `as` (a polymorphic link such as `<Link as={RouterLink}>`). */\n linkAs?: React.ElementType;\n /** The element's own `disabled` (WaveUI's Link then renders no `href`, as on the trail). */\n linkDisabled?: unknown;\n [prop: string]: unknown;\n}\n\n/**\n * The element a collapsed link component renders in the overflow menu (the `as` of its\n * `Menu.ItemLink`): the element's component with the menu item's props, and with the element's own\n * `as` and `disabled`, which the menu item's own `as` and `disabled` would otherwise take.\n */\nfunction OverflowMenuLink({\n linkType: LinkType,\n linkAs,\n linkDisabled,\n ...props\n}: OverflowMenuLinkProps) {\n return (\n <LinkType\n {...props}\n {...(linkAs === undefined ? undefined : { as: linkAs })}\n {...(linkDisabled === undefined ? undefined : { disabled: linkDisabled })}\n />\n );\n}\n\n/**\n * The menu item of a collapsed trail item: for an `asChild` element of a component (a router link,\n * with or without a string `href`) a `Menu.ItemLink` rendered by that component with the element's\n * own props, its `as` included; for another link (an `asChild` element with an `href` too; the\n * element's own `href` wins, as on the trail) a `Menu.ItemLink`; a `Menu.Item` for a button. An\n * item with none of these is listed disabled, and an element that is no `Breadcrumb.Item` is left\n * out; both are not `mappable`.\n */\nfunction overflowMenuItem(entry: BreadcrumbEntry): { node: React.ReactNode; mappable: boolean } {\n const item = entry.node;\n if (!isElementOfType<HiddenItemProps>(item, BreadcrumbItem)) {\n return { node: null, mappable: false };\n }\n const { href: itemHref, icon, asChild, children, onClick } = item.props;\n const inner = asChildElement<HiddenItemChildProps>(asChild, children);\n const label = inner ? inner.props.children : children;\n const disabled = isItemDisabled(item.props, inner);\n const href = inner?.props.href ?? itemHref;\n if (inner && isComponentElement(inner)) {\n // A link component (`<RouterLink to>`, `<Link as={RouterLink} to>`, `<NextLink href>`): the\n // entry is rendered by the same component with its own props, so its click navigates the way\n // the trail's does. The menu keeps the item's role, classes, icon, label and disabled state,\n // and the props that belong to the trail element stay there (its id and ref, its tab order).\n // The item's `href` is a default for the element, as on the trail. Its own `onClick` runs\n // before the item's, as on the trail. Its own `disabled` reaches it too, so a disabled\n // WaveUI Link renders no `href` in the menu either.\n const {\n children: _children,\n className: _className,\n style: _style,\n ref: _ref,\n id: _id,\n role: _role,\n tabIndex: _tabIndex,\n disabled: linkDisabled,\n 'aria-disabled': _ariaDisabled,\n onClick: linkOnClick,\n as: linkAs,\n ...linkProps\n } = inner.props;\n const defaultHref = itemHref !== undefined && !disabled ? { href: itemHref } : undefined;\n return {\n node: (\n <Menu.ItemLink\n key={entry.key}\n {...defaultHref}\n {...linkProps}\n as={OverflowMenuLink as React.ElementType}\n linkType={inner.type as React.ElementType}\n linkAs={linkAs}\n linkDisabled={linkDisabled}\n icon={icon}\n disabled={disabled}\n onClick={composeEventHandlers(linkOnClick, onClick)}\n >\n {label}\n </Menu.ItemLink>\n ),\n mappable: true,\n };\n }\n if (typeof href === 'string') {\n return {\n node: (\n <Menu.ItemLink\n key={entry.key}\n href={href}\n icon={icon}\n disabled={disabled}\n onClick={composeEventHandlers(inner?.props.onClick, onClick)}\n >\n {label}\n </Menu.ItemLink>\n ),\n mappable: true,\n };\n }\n return {\n node: (\n <Menu.Item\n key={entry.key}\n icon={icon}\n disabled={disabled || !onClick}\n onClick={onClick as React.MouseEventHandler<HTMLDivElement> | undefined}\n >\n {label}\n </Menu.Item>\n ),\n mappable: onClick !== undefined,\n };\n}\n\n/**\n * The \"…\" button and its menu of the hidden entries (in trail order), for both collapses. Warns\n * once, from an effect, about a hidden entry that cannot be listed.\n */\nfunction BreadcrumbOverflowMenu({\n entries,\n label,\n}: {\n entries: readonly BreadcrumbEntry[];\n label: string;\n}) {\n const items = entries.map(overflowMenuItem);\n const unlistable = items.some((item) => !item.mappable);\n React.useEffect(() => {\n if (unlistable) {\n warnOnce(\n 'Breadcrumb:overflow-item',\n 'Breadcrumb: a hidden item cannot be listed in the overflow menu (it has no `href` or `onClick`, or is not a Breadcrumb.Item): it is shown there disabled, or left out. Give it `href` or `onClick`.',\n );\n }\n }, [unlistable]);\n\n return (\n <Menu>\n <Menu.Trigger>\n <button\n type=\"button\"\n aria-label={label}\n className={cn(breadcrumbClassNames.overflowButton, linkClasses, 'rounded px-1')}\n >\n <span aria-hidden=\"true\">…</span>\n </button>\n </Menu.Trigger>\n <Menu.Popover>{items.map((item) => item.node)}</Menu.Popover>\n </Menu>\n );\n}\n\nconst BreadcrumbRoot = ({\n children,\n maxDisplayedItems,\n overflowIndex = 1,\n overflow = 'none',\n overflowLabel = 'More items',\n size = 'medium',\n focusMode = 'tab',\n divider,\n className,\n onKeyDown,\n onFocus,\n ref,\n ...rest\n}: BreadcrumbProps) => {\n // Fragments are opened (`{isAdmin && <>…</>}`), so every crumb gets its own list item and separator.\n const entries = flattenChildren(children);\n const auto = overflow === 'auto';\n const collapsed = auto ? [] : collapsedIndexes(entries, maxDisplayedItems, overflowIndex);\n\n // The trail in order, the overflow button standing where the first collapsed item was.\n const trail: Array<{ key: string; node: React.ReactNode }> = [];\n entries.forEach((entry, index) => {\n if (!collapsed.includes(index)) {\n trail.push(entry);\n } else if (index === collapsed[0]) {\n trail.push({\n key: OVERFLOW_KEY,\n node: (\n <BreadcrumbOverflowMenu\n entries={collapsed.map((collapsedIndex) => entries[collapsedIndex])}\n label={overflowLabel}\n />\n ),\n });\n }\n });\n\n const arrow = focusMode === 'arrow';\n const { containerProps } = useRovingTabIndex({\n itemSelector: BREADCRUMB_FOCUS_SELECTOR,\n manageTabIndex: arrow,\n tabStop: 'last-focused',\n orientation: 'horizontal',\n });\n const mergedRef = useMergedRefs<HTMLElement>(arrow ? containerProps.ref : null, ref);\n\n // `divider` is an optional indicator: unset keeps the chevron, a value that renders nothing hides it.\n const renderDivider = () =>\n divider == null ? (\n <ChevronRightIcon\n size={breadcrumbSizes[size].divider}\n data-wave-breadcrumb-separator=\"\"\n className={cn(\n breadcrumbClassNames.divider,\n 'shrink-0 text-muted-foreground wave-rtl:-scale-x-100',\n )}\n />\n ) : slotRendersContent(divider) ? (\n renderSlot(\n divider,\n 'span',\n cn(breadcrumbClassNames.divider, 'inline-flex shrink-0 items-center text-muted-foreground'),\n { 'aria-hidden': true, 'data-wave-breadcrumb-separator': '' },\n )\n ) : null;\n\n const renderListItem = (node: React.ReactNode, index: number, key?: string) => (\n <li key={key} className={cn(breadcrumbClassNames.listItem, 'flex items-center gap-1')}>\n {index > 0 && renderDivider()}\n {node}\n </li>\n );\n\n // `overflow=\"auto\"`: the list is an Overflow of `<li>` items. The first and the last current\n // entry are pinned; the others hide from the start of the trail. The \"…\" menu is the Overflow's\n // button: it stands just before the first hidden entry (never first, since that one is pinned),\n // with its own separator, and lists the hidden entries.\n const currentIndex = entries.map(isCurrentEntry).lastIndexOf(true);\n const list = auto ? (\n <Overflow\n role=\"list\"\n overflowDirection=\"start\"\n buttonPosition=\"before-hidden\"\n overflowButton={(_count, hiddenIds) => (\n <span className=\"flex items-center gap-1\">\n {renderDivider()}\n <BreadcrumbOverflowMenu\n entries={entries.filter((entry) => hiddenIds.includes(entry.key))}\n label={overflowLabel}\n />\n </span>\n )}\n className={cn(breadcrumbClassNames.list, 'gap-1', breadcrumbSizes[size].text)}\n >\n {entries.map(({ key, node }, index) => (\n <OverflowItem key={key} asChild itemId={key} pinned={index === 0 || index === currentIndex}>\n {renderListItem(node, index)}\n </OverflowItem>\n ))}\n </Overflow>\n ) : (\n <ol\n className={cn(\n breadcrumbClassNames.list,\n 'm-0 flex list-none items-center gap-1 p-0',\n breadcrumbSizes[size].text,\n )}\n >\n {trail.map(({ key, node }, index) => renderListItem(node, index, key))}\n </ol>\n );\n\n return (\n <nav\n aria-label=\"Breadcrumb\"\n data-size={size}\n data-focus-mode={focusMode}\n data-overflow={overflow}\n {...rest}\n ref={mergedRef}\n data-roving-container={arrow ? '' : undefined}\n onKeyDown={arrow ? composeEventHandlers(onKeyDown, containerProps.onKeyDown) : onKeyDown}\n onFocus={\n arrow\n ? composeEventHandlers(onFocus, containerProps.onFocus, { checkDefaultPrevented: false })\n : onFocus\n }\n className={cn(breadcrumbClassNames.root, className)}\n >\n {list}\n </nav>\n );\n};\nBreadcrumbRoot.displayName = 'Breadcrumb';\n\ninterface BreadcrumbItemChildProps extends React.HTMLAttributes<HTMLElement> {\n /** The item's `href`, a default for the element (the element's own `href` wins). */\n href?: string;\n child: React.ReactElement<{ children?: React.ReactNode }>;\n icon: React.ReactNode;\n ref?: React.Ref<HTMLElement>;\n}\n\n/**\n * Link's disabled contract for an `asChild` element: an `<a>` drops its `href` (it is still\n * announced as a link); any element gets `aria-disabled`, leaves the tab order and loses its own\n * `onClick`. The item's click handler cancels the click, so a router link does not navigate.\n */\nfunction disableLinkChild(\n child: React.ReactElement<{ children?: React.ReactNode }>,\n): React.ReactElement<{ children?: React.ReactNode }> {\n const anchor = isElementOfType(child, 'a')\n ? { href: undefined, role: 'link', disabled: undefined }\n : undefined;\n return React.cloneElement(child as React.ReactElement<Record<string, unknown>>, {\n ...anchor,\n 'aria-disabled': true,\n tabIndex: -1,\n onClick: undefined,\n }) as React.ReactElement<{ children?: React.ReactNode }>;\n}\n\n/**\n * `asChild` rendering: the item's props are merged onto the consumer's element with\n * `useTriggerElement` (the element's own handlers run first and its classes win conflicts; its\n * ref and the item's ref are both attached). The icon is placed inside the element.\n */\nfunction BreadcrumbItemChild({ child, icon, ...itemProps }: BreadcrumbItemChildProps) {\n const target = icon ? React.cloneElement(child, undefined, icon, child.props.children) : child;\n const node = useTriggerElement(target, itemProps, { componentName: 'Breadcrumb.Item' });\n return <>{node}</>;\n}\n\n/**\n * One step of a breadcrumb trail:\n * - `href` → a link (`<a>`, anchor attributes);\n * - `current` → the current page as text (`<span aria-current=\"page\">`);\n * - no `href` with `onClick` → a `<button type=\"button\">` styled as a link;\n * - no `href` and no `onClick` → plain text (`<span>`; development warning for a non-current item);\n * - `asChild` → the props are merged onto the single child element (router links).\n *\n * Typed by overloads, resolved in order: without `href` (button props, button events), with a\n * string `href` (anchor props, anchor events), then an `href` that may be `undefined` at run time\n * ({@link BreadcrumbItemDynamicProps}: `HTMLElement` events).\n *\n * Also exported as `BreadcrumbItem` (import the flat name from React Server Components).\n */\nfunction BreadcrumbItem(props: BreadcrumbItemButtonProps): React.ReactElement;\nfunction BreadcrumbItem(props: BreadcrumbItemAnchorProps): React.ReactElement;\nfunction BreadcrumbItem(props: BreadcrumbItemDynamicProps): React.ReactElement;\nfunction BreadcrumbItem(\n props: BreadcrumbItemProps | BreadcrumbItemDynamicProps,\n): React.ReactElement {\n const {\n href,\n current = false,\n icon,\n asChild = false,\n children,\n className,\n onClick,\n ref,\n ...rest\n } = props as BreadcrumbEntryProps;\n\n // A falsy icon (`icon={name && <Icon />}` with `name` '' or a count of 0) is no icon, as in Nav,\n // Tree and Avatar, and so is a collection whose items render nothing: no empty span and no stray\n // `me-1` margin. The check does not consume a generator: renderSlot still renders its items.\n const renderedIcon =\n icon && slotRendersContent(icon)\n ? renderSlot(icon, 'span', cn(breadcrumbItemClassNames.icon, 'me-1 inline-flex shrink-0'), {\n 'aria-hidden': true,\n })\n : null;\n const child = asChildElement<{ children?: React.ReactNode }>(asChild, children);\n const kind = child\n ? 'child'\n : current\n ? 'current'\n : href !== undefined\n ? 'link'\n : onClick\n ? 'button'\n : 'text';\n\n const invalidAsChild = asChild && child === null;\n const ignoredDisabled = rest.disabled === true && (kind === 'text' || kind === 'current');\n // Link and asChild items follow Link's disabled contract. `<a disabled>` does not block\n // navigation, and an `aria-disabled` link only looks disabled unless the click is cancelled.\n // With asChild the element is the link, so its own `disabled`/`aria-disabled` count too.\n const ariaDisabled = rest['aria-disabled'];\n const linkDisabled = isItemDisabled(rest, child);\n React.useEffect(() => {\n if (invalidAsChild) {\n warnOnce(\n 'Breadcrumb.Item:asChild',\n 'Breadcrumb.Item: `asChild` expects a single element child (e.g. a router link); the item was rendered normally instead.',\n );\n }\n if (kind === 'text') {\n warnOnce(\n 'Breadcrumb.Item:no-href',\n 'Breadcrumb.Item: a non-current item without `href` or `onClick` renders as plain text, not a link. Pass `href` (or `onClick`, which renders a button) to make it navigable.',\n );\n }\n if (ignoredDisabled) {\n warnOnce(\n 'Breadcrumb.Item:disabled',\n 'Breadcrumb.Item: `disabled` applies to link, button and asChild items; it is ignored on a text or current item.',\n );\n }\n }, [invalidAsChild, kind, ignoredDisabled]);\n\n if (child) {\n const { disabled: _disabled, ...childRest } = rest;\n // Like the other item props, `href` is a default for the element (its own `href` wins). A\n // disabled link has no destination, so it is not passed then.\n const childHref = href !== undefined && !linkDisabled ? { href } : undefined;\n return (\n <BreadcrumbItemChild\n {...(childRest as React.HTMLAttributes<HTMLElement>)}\n {...childHref}\n ref={ref}\n onClick={preventIfDisabled(linkDisabled, onClick)}\n aria-current={current ? 'page' : undefined}\n className={cn(\n breadcrumbItemClassNames.root,\n current ? currentChildClasses : linkClasses,\n className,\n )}\n icon={renderedIcon}\n child={linkDisabled ? disableLinkChild(child) : child}\n />\n );\n }\n\n if (kind === 'current') {\n return (\n <span\n {...spanAttributes(rest)}\n ref={ref as React.Ref<HTMLSpanElement>}\n aria-current=\"page\"\n onClick={onClick}\n className={cn(breadcrumbItemClassNames.root, currentClasses, className)}\n >\n {renderedIcon}\n {children}\n </span>\n );\n }\n\n if (kind === 'link') {\n const { disabled: _disabled, ...anchorRest } = rest;\n return (\n <a\n {...(anchorRest as React.AnchorHTMLAttributes<HTMLAnchorElement>)}\n ref={ref as React.Ref<HTMLAnchorElement>}\n href={linkDisabled ? undefined : href}\n role={linkDisabled ? 'link' : anchorRest.role}\n aria-disabled={linkDisabled ? true : ariaDisabled}\n tabIndex={linkDisabled ? -1 : anchorRest.tabIndex}\n onClick={preventIfDisabled(linkDisabled, onClick)}\n className={cn(breadcrumbItemClassNames.root, linkClasses, className)}\n >\n {renderedIcon}\n {children}\n </a>\n );\n }\n\n if (kind === 'button') {\n // `rel` only belongs on a link: a button item drops it, like the text and current items.\n const { rel, ...buttonRest } = rest;\n return (\n <button\n type=\"button\"\n {...(buttonRest as React.ButtonHTMLAttributes<HTMLButtonElement>)}\n ref={ref as React.Ref<HTMLButtonElement>}\n onClick={onClick}\n className={cn(breadcrumbItemClassNames.root, linkClasses, className)}\n >\n {renderedIcon}\n {children}\n </button>\n );\n }\n\n return (\n <span\n {...spanAttributes(rest)}\n ref={ref as React.Ref<HTMLSpanElement>}\n className={cn(breadcrumbItemClassNames.root, textClasses, className)}\n >\n {renderedIcon}\n {children}\n </span>\n );\n}\nBreadcrumbItem.displayName = 'BreadcrumbItem';\n\n/**\n * A breadcrumb trail: a `<nav aria-label=\"Breadcrumb\">` landmark with an ordered list. Each child\n * is placed in its own list item (Fragments are opened, so each of their items gets one too); from\n * the second one on, the item begins with a decorative separator chevron that is mirrored in\n * right-to-left layouts (`divider` replaces or hides it).\n *\n * `maxDisplayedItems` collapses the middle of a long trail into a \"…\" menu button, and\n * `overflow=\"auto\"` collapses it to the room it has instead (a \"…\" menu button stands in for the\n * hidden middle items); `size` sets the text step and `focusMode=\"arrow\"` makes the trail one Tab\n * stop with arrow-key navigation.\n *\n * `Breadcrumb.Item` is also exported as `BreadcrumbItem`: React Server Components import the flat\n * name, because dotted access needs a client file.\n *\n * @example\n * <Breadcrumb>\n * <Breadcrumb.Item href=\"/\">Home</Breadcrumb.Item>\n * <Breadcrumb.Item current>Settings</Breadcrumb.Item>\n * </Breadcrumb>\n */\nexport const Breadcrumb = /* @__PURE__ */ Object.assign(BreadcrumbRoot, {\n Item: BreadcrumbItem,\n});\n\nexport { BreadcrumbItem };\n"],"mappings":"8tBAiNA,IAAMyC,EAAczC,EAAAA,GAClB,mHACAC,EAAAA,UACAC,EAAAA,cACF,EACMwC,EAAiB,yDAEjBC,EAAsB3C,EAAAA,GAAG0C,EAAgBzC,EAAAA,UAAWC,EAAAA,cAAc,EAClE0C,EAAc,2CAqBdC,EAA6D,IAAI,IAAI,CACzE,MACA,GAAG,OAAO,KAAK,CACb,SAAU,GACV,KAAM,GACN,KAAM,GACN,WAAY,GACZ,YAAa,GACb,WAAY,GACZ,eAAgB,GAChB,WAAY,GACZ,KAAM,GACN,MAAO,GACP,OAAQ,GACR,SAAU,GACV,SAAU,GACV,KAAM,GACN,MAAO,GACP,eAAgB,EAClB,CAA8C,CAChD,CAAC,EAGD,SAASC,EAAe,EAAsE,CAC5F,IAAMC,EAAsC,CAAC,EAC7C,IAAK,IAAMC,KAAO,OAAO,KAAKC,CAAI,EAC3BJ,EAAsB,IAAIG,CAAG,IAAG,EAAWA,GAAOC,EAAKD,IAE9D,OAAOD,CACT,CAGA,IAAMG,EAAkB,CACtB,MAAO,CAAE,KAAM,iBAAkB,QAAS,EAAG,EAC7C,OAAQ,CAAE,KAAM,cAAe,QAAS,EAAG,EAC3C,MAAO,CAAE,KAAM,cAAe,QAAS,EAAG,CAC5C,EAGMC,EAA4B,iCAG5BC,EAAe,aAgBrB,SAASC,EAAe,EAAiC,CACvD,OACElD,EAAAA,gBAAiCmD,EAAM,KAAMC,CAAc,GAC3DD,EAAM,KAAK,MAAM,UAAY,EAEjC,CAQA,SAASE,EACP,EACA,EACA,EACU,CACV,GAAIC,IAAsB,IAA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AU,CAErB,GAAM,CAAE,MAAK,GAAGQ,GAAe7F,EAC/B,OACE,EAAAT,EAAA,KAAA,CAAC,SAAD,CACE,KAAK,SACL,GAAKsG,EACA,MACI,UACT,UAAW9I,EAAAA,GAAGoB,EAAAA,yBAAyB,KAAMqB,EAAaqF,CAAS,EALrE,SAAA,CAOGO,EACA1D,CACK,GAEZ,CAEA,OACE,EAAAnC,EAAA,KAAA,CAAC,OAAD,CACE,GAAIM,EAAeG,CAAI,EAClB,MACL,UAAWjD,EAAAA,GAAGoB,EAAAA,yBAAyB,KAAMwB,EAAakF,CAAS,EAHrE,SAAA,CAKGO,EACA1D,CACG,GAEV,CACA,EAAe,YAAc,iBAsB7B,IAAaoE,EAA6B,OAAO,OAAOvC,EAAgB,CACtE,KAAMjD,CACR,CAAC"}
|
|
@@ -3,15 +3,22 @@ import { cn as e } from "../../lib/cn.mjs";
|
|
|
3
3
|
import { flattenChildren as t, isElementOfType as n } from "../../lib/children.mjs";
|
|
4
4
|
import { warnOnce as r } from "../../lib/dev.mjs";
|
|
5
5
|
import { renderSlot as i, slotRendersContent as a } from "../../lib/slot.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
6
|
+
import { composeEventHandlers as o } from "../../lib/composeEventHandlers.mjs";
|
|
7
|
+
import { breadcrumbClassNames as s, breadcrumbItemClassNames as c } from "../../lib/classNames.mjs";
|
|
8
|
+
import { partitionBreadcrumbItems as l } from "../../lib/breadcrumb.mjs";
|
|
9
|
+
import { useRovingTabIndex as u } from "../../hooks/useRovingTabIndex.mjs";
|
|
10
|
+
import { useMergedRefs as d } from "../../hooks/useMergedRefs.mjs";
|
|
11
|
+
import { preventIfDisabled as f } from "../../lib/aria.mjs";
|
|
12
|
+
import { disabledStyles as p, focusRing as m } from "../../lib/styles.mjs";
|
|
13
|
+
import { ChevronRightIcon as h } from "../../lib/icons.mjs";
|
|
14
|
+
import { unwrapFragment as g } from "../../lib/renderTrigger.mjs";
|
|
15
|
+
import { Overflow as _, OverflowItem as v } from "../layout/Overflow.mjs";
|
|
16
|
+
import { useTriggerElement as y } from "../../hooks/useTriggerElement.mjs";
|
|
17
|
+
import { Menu as b } from "./Menu.mjs";
|
|
18
|
+
import * as x from "react";
|
|
19
|
+
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
13
20
|
//#region src/components/navigation/Breadcrumb.tsx
|
|
14
|
-
var
|
|
21
|
+
var T = e("inline-flex cursor-pointer items-center text-primary no-underline not-disabled:not-aria-disabled:hover:underline", m, p), E = "inline-flex items-center font-semibold text-foreground", D = e(E, m, p), O = "inline-flex items-center text-foreground", k = /* @__PURE__ */ new Set(["rel", ...Object.keys({
|
|
15
22
|
disabled: !0,
|
|
16
23
|
type: !0,
|
|
17
24
|
form: !0,
|
|
@@ -29,117 +36,265 @@ var _ = e("inline-flex cursor-pointer items-center text-primary no-underline not
|
|
|
29
36
|
media: !0,
|
|
30
37
|
referrerPolicy: !0
|
|
31
38
|
})]);
|
|
32
|
-
function
|
|
39
|
+
function A(e) {
|
|
33
40
|
let t = {};
|
|
34
|
-
for (let n of Object.keys(e))
|
|
41
|
+
for (let n of Object.keys(e)) k.has(n) || (t[n] = e[n]);
|
|
35
42
|
return t;
|
|
36
43
|
}
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
var j = {
|
|
45
|
+
small: {
|
|
46
|
+
text: "text-caption-1",
|
|
47
|
+
divider: 12
|
|
48
|
+
},
|
|
49
|
+
medium: {
|
|
50
|
+
text: "text-body-1",
|
|
51
|
+
divider: 12
|
|
52
|
+
},
|
|
53
|
+
large: {
|
|
54
|
+
text: "text-body-2",
|
|
55
|
+
divider: 16
|
|
56
|
+
}
|
|
57
|
+
}, M = "a[href], button, [role=\"link\"]", N = "\0overflow";
|
|
58
|
+
function P(e) {
|
|
59
|
+
return n(e.node, G) && e.node.props.current === !0;
|
|
60
|
+
}
|
|
61
|
+
function F(e, t, n) {
|
|
62
|
+
if (t === void 0) return [];
|
|
63
|
+
let { overflowItems: r } = l({
|
|
64
|
+
items: e.map((e, t) => t),
|
|
65
|
+
maxDisplayedItems: t,
|
|
66
|
+
overflowIndex: Math.max(1, n)
|
|
67
|
+
});
|
|
68
|
+
if (!r) return [];
|
|
69
|
+
let i = e.length, a = r.length, o = e.map(P).lastIndexOf(!0), s = Math.max(1, r[0]), c = Math.min(i, s + a);
|
|
70
|
+
return o >= s && o < c && (o + 1 + a <= i ? (s = o + 1, c = s + a) : o - a >= 1 ? (s = o - a, c = o) : o - 1 >= i - o - 1 ? (s = 1, c = o) : (s = o + 1, c = Math.min(i, s + a))), Array.from({ length: Math.max(0, c - s) }, (e, t) => s + t);
|
|
71
|
+
}
|
|
72
|
+
function I(e, t) {
|
|
73
|
+
let n = t?.props ?? {};
|
|
74
|
+
return [
|
|
75
|
+
e.disabled,
|
|
76
|
+
e["aria-disabled"],
|
|
77
|
+
n.disabled,
|
|
78
|
+
n["aria-disabled"]
|
|
79
|
+
].some((e) => e === !0 || e === "true");
|
|
80
|
+
}
|
|
81
|
+
function L(e, t) {
|
|
82
|
+
if (!e) return null;
|
|
83
|
+
let n = g(t);
|
|
84
|
+
return x.isValidElement(n) ? n : null;
|
|
85
|
+
}
|
|
86
|
+
function R(e) {
|
|
87
|
+
return typeof e.type == "function" || typeof e.type == "object" && e.type !== null;
|
|
88
|
+
}
|
|
89
|
+
function z({ linkType: e, linkAs: t, linkDisabled: n, ...r }) {
|
|
90
|
+
return /* @__PURE__ */ C(e, {
|
|
91
|
+
...r,
|
|
92
|
+
...t === void 0 ? void 0 : { as: t },
|
|
93
|
+
...n === void 0 ? void 0 : { disabled: n }
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function B(e) {
|
|
97
|
+
let t = e.node;
|
|
98
|
+
if (!n(t, G)) return {
|
|
99
|
+
node: null,
|
|
100
|
+
mappable: !1
|
|
101
|
+
};
|
|
102
|
+
let { href: r, icon: i, asChild: a, children: s, onClick: c } = t.props, l = L(a, s), u = l ? l.props.children : s, d = I(t.props, l), f = l?.props.href ?? r;
|
|
103
|
+
if (l && R(l)) {
|
|
104
|
+
let { children: t, className: n, style: a, ref: s, id: f, role: p, tabIndex: m, disabled: h, "aria-disabled": g, onClick: _, as: v, ...y } = l.props, x = r !== void 0 && !d ? { href: r } : void 0;
|
|
105
|
+
return {
|
|
106
|
+
node: /* @__PURE__ */ C(b.ItemLink, {
|
|
107
|
+
...x,
|
|
108
|
+
...y,
|
|
109
|
+
as: z,
|
|
110
|
+
linkType: l.type,
|
|
111
|
+
linkAs: v,
|
|
112
|
+
linkDisabled: h,
|
|
113
|
+
icon: i,
|
|
114
|
+
disabled: d,
|
|
115
|
+
onClick: o(_, c),
|
|
116
|
+
children: u
|
|
117
|
+
}, e.key),
|
|
118
|
+
mappable: !0
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
return typeof f == "string" ? {
|
|
122
|
+
node: /* @__PURE__ */ C(b.ItemLink, {
|
|
123
|
+
href: f,
|
|
124
|
+
icon: i,
|
|
125
|
+
disabled: d,
|
|
126
|
+
onClick: o(l?.props.onClick, c),
|
|
127
|
+
children: u
|
|
128
|
+
}, e.key),
|
|
129
|
+
mappable: !0
|
|
130
|
+
} : {
|
|
131
|
+
node: /* @__PURE__ */ C(b.Item, {
|
|
132
|
+
icon: i,
|
|
133
|
+
disabled: d || !c,
|
|
134
|
+
onClick: c,
|
|
135
|
+
children: u
|
|
136
|
+
}, e.key),
|
|
137
|
+
mappable: c !== void 0
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function V({ entries: t, label: n }) {
|
|
141
|
+
let i = t.map(B), a = i.some((e) => !e.mappable);
|
|
142
|
+
return x.useEffect(() => {
|
|
143
|
+
a && r("Breadcrumb:overflow-item", "Breadcrumb: a hidden item cannot be listed in the overflow menu (it has no `href` or `onClick`, or is not a Breadcrumb.Item): it is shown there disabled, or left out. Give it `href` or `onClick`.");
|
|
144
|
+
}, [a]), /* @__PURE__ */ w(b, { children: [/* @__PURE__ */ C(b.Trigger, { children: /* @__PURE__ */ C("button", {
|
|
145
|
+
type: "button",
|
|
146
|
+
"aria-label": n,
|
|
147
|
+
className: e(s.overflowButton, T, "rounded px-1"),
|
|
148
|
+
children: /* @__PURE__ */ C("span", {
|
|
149
|
+
"aria-hidden": "true",
|
|
150
|
+
children: "…"
|
|
53
151
|
})
|
|
152
|
+
}) }), /* @__PURE__ */ C(b.Popover, { children: i.map((e) => e.node) })] });
|
|
153
|
+
}
|
|
154
|
+
var H = ({ children: n, maxDisplayedItems: r, overflowIndex: c = 1, overflow: l = "none", overflowLabel: f = "More items", size: p = "medium", focusMode: m = "tab", divider: g, className: y, onKeyDown: b, onFocus: x, ref: S, ...T }) => {
|
|
155
|
+
let E = t(n), D = l === "auto", O = D ? [] : F(E, r, c), k = [];
|
|
156
|
+
E.forEach((e, t) => {
|
|
157
|
+
O.includes(t) ? t === O[0] && k.push({
|
|
158
|
+
key: N,
|
|
159
|
+
node: /* @__PURE__ */ C(V, {
|
|
160
|
+
entries: O.map((e) => E[e]),
|
|
161
|
+
label: f
|
|
162
|
+
})
|
|
163
|
+
}) : k.push(e);
|
|
164
|
+
});
|
|
165
|
+
let A = m === "arrow", { containerProps: I } = u({
|
|
166
|
+
itemSelector: M,
|
|
167
|
+
manageTabIndex: A,
|
|
168
|
+
tabStop: "last-focused",
|
|
169
|
+
orientation: "horizontal"
|
|
170
|
+
}), L = d(A ? I.ref : null, S), R = () => g == null ? /* @__PURE__ */ C(h, {
|
|
171
|
+
size: j[p].divider,
|
|
172
|
+
"data-wave-breadcrumb-separator": "",
|
|
173
|
+
className: e(s.divider, "shrink-0 text-muted-foreground wave-rtl:-scale-x-100")
|
|
174
|
+
}) : a(g) ? i(g, "span", e(s.divider, "inline-flex shrink-0 items-center text-muted-foreground"), {
|
|
175
|
+
"aria-hidden": !0,
|
|
176
|
+
"data-wave-breadcrumb-separator": ""
|
|
177
|
+
}) : null, z = (t, n, r) => /* @__PURE__ */ w("li", {
|
|
178
|
+
className: e(s.listItem, "flex items-center gap-1"),
|
|
179
|
+
children: [n > 0 && R(), t]
|
|
180
|
+
}, r), B = E.map(P).lastIndexOf(!0), H = D ? /* @__PURE__ */ C(_, {
|
|
181
|
+
role: "list",
|
|
182
|
+
overflowDirection: "start",
|
|
183
|
+
buttonPosition: "before-hidden",
|
|
184
|
+
overflowButton: (e, t) => /* @__PURE__ */ w("span", {
|
|
185
|
+
className: "flex items-center gap-1",
|
|
186
|
+
children: [R(), /* @__PURE__ */ C(V, {
|
|
187
|
+
entries: E.filter((e) => t.includes(e.key)),
|
|
188
|
+
label: f
|
|
189
|
+
})]
|
|
190
|
+
}),
|
|
191
|
+
className: e(s.list, "gap-1", j[p].text),
|
|
192
|
+
children: E.map(({ key: e, node: t }, n) => /* @__PURE__ */ C(v, {
|
|
193
|
+
asChild: !0,
|
|
194
|
+
itemId: e,
|
|
195
|
+
pinned: n === 0 || n === B,
|
|
196
|
+
children: z(t, n)
|
|
197
|
+
}, e))
|
|
198
|
+
}) : /* @__PURE__ */ C("ol", {
|
|
199
|
+
className: e(s.list, "m-0 flex list-none items-center gap-1 p-0", j[p].text),
|
|
200
|
+
children: k.map(({ key: e, node: t }, n) => z(t, n, e))
|
|
201
|
+
});
|
|
202
|
+
return /* @__PURE__ */ C("nav", {
|
|
203
|
+
"aria-label": "Breadcrumb",
|
|
204
|
+
"data-size": p,
|
|
205
|
+
"data-focus-mode": m,
|
|
206
|
+
"data-overflow": l,
|
|
207
|
+
...T,
|
|
208
|
+
ref: L,
|
|
209
|
+
"data-roving-container": A ? "" : void 0,
|
|
210
|
+
onKeyDown: A ? o(b, I.onKeyDown) : b,
|
|
211
|
+
onFocus: A ? o(x, I.onFocus, { checkDefaultPrevented: !1 }) : x,
|
|
212
|
+
className: e(s.root, y),
|
|
213
|
+
children: H
|
|
54
214
|
});
|
|
55
215
|
};
|
|
56
|
-
|
|
57
|
-
function
|
|
216
|
+
H.displayName = "Breadcrumb";
|
|
217
|
+
function U(e) {
|
|
58
218
|
let t = n(e, "a") ? {
|
|
59
219
|
href: void 0,
|
|
60
220
|
role: "link",
|
|
61
221
|
disabled: void 0
|
|
62
222
|
} : void 0;
|
|
63
|
-
return
|
|
223
|
+
return x.cloneElement(e, {
|
|
64
224
|
...t,
|
|
65
225
|
"aria-disabled": !0,
|
|
66
226
|
tabIndex: -1,
|
|
67
227
|
onClick: void 0
|
|
68
228
|
});
|
|
69
229
|
}
|
|
70
|
-
function
|
|
71
|
-
let r = t ?
|
|
72
|
-
return /* @__PURE__ */
|
|
230
|
+
function W({ child: e, icon: t, ...n }) {
|
|
231
|
+
let r = t ? x.cloneElement(e, void 0, t, e.props.children) : e, i = y(r, n, { componentName: "Breadcrumb.Item" });
|
|
232
|
+
return /* @__PURE__ */ C(S, { children: i });
|
|
73
233
|
}
|
|
74
|
-
function
|
|
75
|
-
let { href: n, current: o = !1, icon:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
M.disabled,
|
|
79
|
-
M["aria-disabled"]
|
|
80
|
-
].some((e) => e === !0 || e === "true");
|
|
81
|
-
if (p.useEffect(() => {
|
|
82
|
-
k && r("Breadcrumb.Item:asChild", "Breadcrumb.Item: `asChild` expects a single element child (e.g. a router link); the item was rendered normally instead."), O === "text" && r("Breadcrumb.Item:no-href", "Breadcrumb.Item: a non-current item without `href` or `onClick` renders as plain text, not a link. Pass `href` (or `onClick`, which renders a button) to make it navigable."), A && r("Breadcrumb.Item:disabled", "Breadcrumb.Item: `disabled` applies to link, button and asChild items; it is ignored on a text or current item.");
|
|
234
|
+
function G(t) {
|
|
235
|
+
let { href: n, current: o = !1, icon: s, asChild: l = !1, children: u, className: d, onClick: p, ref: m, ...h } = t, g = s && a(s) ? i(s, "span", e(c.icon, "me-1 inline-flex shrink-0"), { "aria-hidden": !0 }) : null, _ = L(l, u), v = _ ? "child" : o ? "current" : n === void 0 ? p ? "button" : "text" : "link", y = l && _ === null, b = h.disabled === !0 && (v === "text" || v === "current"), S = h["aria-disabled"], k = I(h, _);
|
|
236
|
+
if (x.useEffect(() => {
|
|
237
|
+
y && r("Breadcrumb.Item:asChild", "Breadcrumb.Item: `asChild` expects a single element child (e.g. a router link); the item was rendered normally instead."), v === "text" && r("Breadcrumb.Item:no-href", "Breadcrumb.Item: a non-current item without `href` or `onClick` renders as plain text, not a link. Pass `href` (or `onClick`, which renders a button) to make it navigable."), b && r("Breadcrumb.Item:disabled", "Breadcrumb.Item: `disabled` applies to link, button and asChild items; it is ignored on a text or current item.");
|
|
83
238
|
}, [
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
]),
|
|
88
|
-
let { disabled: t, ...r } =
|
|
89
|
-
return /* @__PURE__ */
|
|
239
|
+
y,
|
|
240
|
+
v,
|
|
241
|
+
b
|
|
242
|
+
]), _) {
|
|
243
|
+
let { disabled: t, ...r } = h, i = n !== void 0 && !k ? { href: n } : void 0;
|
|
244
|
+
return /* @__PURE__ */ C(W, {
|
|
90
245
|
...r,
|
|
91
246
|
...i,
|
|
92
|
-
ref:
|
|
93
|
-
onClick:
|
|
247
|
+
ref: m,
|
|
248
|
+
onClick: f(k, p),
|
|
94
249
|
"aria-current": o ? "page" : void 0,
|
|
95
|
-
className: e(
|
|
96
|
-
icon:
|
|
97
|
-
child:
|
|
250
|
+
className: e(c.root, o ? D : T, d),
|
|
251
|
+
icon: g,
|
|
252
|
+
child: k ? U(_) : _
|
|
98
253
|
});
|
|
99
254
|
}
|
|
100
|
-
if (
|
|
101
|
-
...
|
|
102
|
-
ref:
|
|
255
|
+
if (v === "current") return /* @__PURE__ */ w("span", {
|
|
256
|
+
...A(h),
|
|
257
|
+
ref: m,
|
|
103
258
|
"aria-current": "page",
|
|
104
|
-
onClick:
|
|
105
|
-
className: e(
|
|
106
|
-
children: [
|
|
259
|
+
onClick: p,
|
|
260
|
+
className: e(c.root, E, d),
|
|
261
|
+
children: [g, u]
|
|
107
262
|
});
|
|
108
|
-
if (
|
|
109
|
-
let { disabled: t, ...r } =
|
|
110
|
-
return /* @__PURE__ */
|
|
263
|
+
if (v === "link") {
|
|
264
|
+
let { disabled: t, ...r } = h;
|
|
265
|
+
return /* @__PURE__ */ w("a", {
|
|
111
266
|
...r,
|
|
112
|
-
ref:
|
|
113
|
-
href:
|
|
114
|
-
role:
|
|
115
|
-
"aria-disabled":
|
|
116
|
-
tabIndex:
|
|
117
|
-
onClick:
|
|
118
|
-
className: e(
|
|
119
|
-
children: [
|
|
267
|
+
ref: m,
|
|
268
|
+
href: k ? void 0 : n,
|
|
269
|
+
role: k ? "link" : r.role,
|
|
270
|
+
"aria-disabled": k ? !0 : S,
|
|
271
|
+
tabIndex: k ? -1 : r.tabIndex,
|
|
272
|
+
onClick: f(k, p),
|
|
273
|
+
className: e(c.root, T, d),
|
|
274
|
+
children: [g, u]
|
|
120
275
|
});
|
|
121
276
|
}
|
|
122
|
-
if (
|
|
123
|
-
let { rel: t, ...n } =
|
|
124
|
-
return /* @__PURE__ */
|
|
277
|
+
if (v === "button") {
|
|
278
|
+
let { rel: t, ...n } = h;
|
|
279
|
+
return /* @__PURE__ */ w("button", {
|
|
125
280
|
type: "button",
|
|
126
281
|
...n,
|
|
127
|
-
ref:
|
|
128
|
-
onClick:
|
|
129
|
-
className: e(
|
|
130
|
-
children: [
|
|
282
|
+
ref: m,
|
|
283
|
+
onClick: p,
|
|
284
|
+
className: e(c.root, T, d),
|
|
285
|
+
children: [g, u]
|
|
131
286
|
});
|
|
132
287
|
}
|
|
133
|
-
return /* @__PURE__ */
|
|
134
|
-
...
|
|
135
|
-
ref:
|
|
136
|
-
className: e(
|
|
137
|
-
children: [
|
|
288
|
+
return /* @__PURE__ */ w("span", {
|
|
289
|
+
...A(h),
|
|
290
|
+
ref: m,
|
|
291
|
+
className: e(c.root, O, d),
|
|
292
|
+
children: [g, u]
|
|
138
293
|
});
|
|
139
294
|
}
|
|
140
|
-
|
|
141
|
-
var
|
|
295
|
+
G.displayName = "BreadcrumbItem";
|
|
296
|
+
var K = /* @__PURE__ */ Object.assign(H, { Item: G });
|
|
142
297
|
//#endregion
|
|
143
|
-
export {
|
|
298
|
+
export { K as Breadcrumb, G as BreadcrumbItem };
|
|
144
299
|
|
|
145
300
|
//# sourceMappingURL=Breadcrumb.mjs.map
|