@webority/ui-react 0.146.2 → 0.148.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/dist/canvas-kit/kit.js +21514 -21184
- package/dist/canvas-kit/manifest.json +127 -27
- package/dist/canvas-kit/release.json +6 -6
- package/dist/components/AppChip.js +1 -1
- package/dist/components/AppCommentThread.js +1 -1
- package/dist/components/AppDropdown.js +1 -1
- package/dist/components/AppKpiTile.js +1 -1
- package/dist/components/AppSelect.js +1 -1
- package/dist/components/AppShell.js +1 -1
- package/dist/components/AppTimeline.js +1 -1
- package/dist/guidance.json +1 -1
- package/dist/markdown-core/dist/inline.js +1 -1
- package/dist/markdown-core/dist/parse.js +3 -3
- package/dist/types/components/AppChip.d.ts +6 -0
- package/dist/types/components/AppCommentThread.d.ts +8 -2
- package/dist/types/components/AppDropdown.d.ts +5 -4
- package/dist/types/components/AppKpiTile.d.ts +2 -2
- package/dist/types/components/AppSelect.d.ts +12 -0
- package/dist/types/components/AppShell.d.ts +11 -2
- package/dist/types/components/AppTimeline.d.ts +6 -0
- package/dist/types/lib/sectionShell.d.ts +1 -1
- package/package.json +14 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/fillLabel.js";import{navMatchScore as n}from"../lib/navMatch.js";import{SHELL_FOLDED_COOKIE as r,readNavFolded as i,readShellCollapsed as a,writeNavFolded as o,writeShellCollapsed as s}from"../lib/shellCookie.js";import{splitMarkerProps as c}from"../lib/wuiMarker.js";import l from"./AppAvatar.js";import u from"./AppButton.js";import d from"./AppIcon.js";import f from"./AppNavigationMenu.js";import p from"./assertValidValue.js";import m from"./warnUnknownProps.js";import{initScrollEdges as h,revealActiveNavItem as g}from"@webority/ui-elements/helpers";import{useEffect as _,useId as v,useMemo as y,useRef as b,useState as x}from"react";import{Fragment as S,jsx as C,jsxs as w}from"react/jsx-runtime";var T=99,E=4,D=5,O=/^[a-z0-9-]+$/,k=[`prefix`,`exact`],A=[`comfortable`,`compact`],j=[`neutral`,`primary`],M=[`side`,`top`],N=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],P=/* @__PURE__ */ new Set([`key`,`label`,`icon`,`iconVariant`,`iconSize`,`href`,`badge`,`badgeTone`,`badgeTitle`,`newUntil`,`trailingIcon`,`active`,`match`,`matchAlso`,`tab`,`tabLabel`,`children`]),F=e=>e>T?`${T}+`:String(e),I=new Intl.DateTimeFormat(`en-CA`,{timeZone:`Asia/Kolkata`}),L=e=>{if(typeof e!=`string`||!/^\d{4}-\d{2}-\d{2}$/.test(e))return!1;let t=/* @__PURE__ */ new Date(`${e}T00:00:00Z`);return Number.isNaN(t.getTime())||t.toISOString().slice(0,10)!==e?!1:I.format(/* @__PURE__ */ new Date)<=e},ee=({logoLight:e,logoDark:t,markLight:n,markDark:r})=>{let i=!!(n||r);return[`app-sidebar-brand`,i&&`wui-brand-has-mark`,i&&!e&&!t&&`wui-brand-mark-only`,(t||r)&&`wui-brand-themed`].filter(Boolean).join(` `)},R=({logoLight:e,logoDark:t,markLight:n,markDark:r,brandName:i})=>{let a=i??``,o=[e&&/* @__PURE__ */ C(`img`,{className:`wui-brand-logo wui-brand-light`,src:e,alt:a},`logo-light`),t&&/* @__PURE__ */ C(`img`,{className:`wui-brand-logo wui-brand-dark`,src:t,alt:``,"aria-hidden":`true`},`logo-dark`)],s=[n&&[`mark-light`,`wui-brand-mark wui-brand-light`,n],r&&[`mark-dark`,`wui-brand-mark wui-brand-dark`,r]].filter(Boolean).map(([t,n,r],i)=>i===0&&!e?/* @__PURE__ */ C(`img`,{className:n,src:r,alt:a},t):/* @__PURE__ */ C(`img`,{className:n,src:r,alt:``,"aria-hidden":`true`},t));return[...o,...s].filter(Boolean)};function z(e){let{marker:t,props:n}=c(`AppShell`,e),{groups:l=[],brand:u,logoLight:v,logoDark:S,markLight:T,markDark:E,brandName:D,sidebarStart:O,sidebarStartCompact:k,sidebarFooter:P,topbarStart:F,topbarEnd:I,footer:L,launcher:z,children:ne,collapsed:B,onCollapsedChange:re,noSidebar:V=!1,nav:H=`side`,density:W=`comfortable`,itemHeight:G,iconVariant:K,topbarTone:de=`neutral`,navLabel:fe=`Main navigation`,linkComponent:q,currentPath:pe,rememberCollapsed:me=!1,collapsedCookie:he=`wui-shell-collapsed`,foldedCookie:J=r,tabBarLabel:ge=`Quick navigation`,moreLabel:_e=`More`,skipLabel:ve=`Skip to content`,openNavLabel:ye=`Open navigation`,closeNavLabel:be=`Close navigation`,expandNavLabel:xe=`Expand navigation`,collapseNavLabel:Se=`Collapse navigation`,newLabel:Ce=`New`,togglePagesLabel:we=`Show or hide {name} pages`,accountMenuLabel:Te=`Account menu for {name}`,roleLabel:Ee=`Role:`,rolesLabel:De=`Roles:`,unreadLabel:Oe=`Unread`,markAllReadLabel:ke=`Mark all read`,viewAllLabel:Ae=`View all`,loadingNotificationsText:je=`Loading…`,noUnreadText:Me=`No unread notifications`,unreadNotificationsText:Ne=`{count} unread notifications`,unreadBellLabel:Pe=`{label}, {count} unread`,searchResultsLabel:Fe=`Search results`,noResultsText:Ie=`No results`,noResultsForText:Le=`No results for “{value}”`,resultsCountText:Re=`{count} results`,resultCountText:ze=`{count} result`,userMenu:Be,notifications:Ve,search:He,className:Ue=``,style:We,...Ge}=n;m(`AppShell`,Ge),p(`AppShell`,`density`,W,A),p(`AppShell`,`topbarTone`,de,j),p(`AppShell`,`nav`,H,M),p(`AppShell`,`iconVariant`,K,N);let Ke=G>0?{...We,"--wui-nav-item-height":`${G}px`}:We,[qe,Je]=x(()=>me&&B===void 0&&typeof document<`u`?a(he)??!1:!1),[Y,X]=x(!1),[Ye,Xe]=x(!1),[Ze,Qe]=x(!1),$e=b(null),et=b(null),tt=b(null),Z=B??qe,nt=()=>{let e=!Z;B===void 0&&Je(e),me&&s(e,he),re?.(e)},rt=l.some(e=>e.collapsible),[it,at]=x(()=>rt&&typeof document<`u`?i(J):/* @__PURE__ */ new Set),ot=e=>{let t=new Set(it);t.has(e)?t.delete(e):t.add(e),at(t),o(t,J)},Q=y(()=>te(l,pe),[l,pe]),$=V?null:ie(Q);_(()=>{let e=()=>Xe(window.scrollY>4);return e(),window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)},[]),_(()=>{h()},[]),_(()=>{g($e.current)},[]),_(()=>{let e=$e.current;if(!e)return;let t=()=>Qe(e.scrollHeight>e.clientHeight);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[Q]);let st=!!L;_(()=>{let e=tt.current,t=et.current;if(!st||!e||!t)return;let n=()=>t.style.setProperty(`--app-footer-h`,`${e.offsetHeight}px`);n();let r=typeof ResizeObserver>`u`?null:new ResizeObserver(n);return r?.observe(e),()=>{r?.disconnect(),t.style.removeProperty(`--app-footer-h`)}},[st]),_(()=>{if(!Y)return;let e=e=>{e.key===`Escape`&&X(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[Y]);let ct=[`app-shell`,Z?`collapsed`:``,V?`no-sidebar`:``,H===`top`?`wui-shell-top`:``,Y?`mobile-open`:``,Ue].filter(Boolean).join(` `);return/* @__PURE__ */ w(`div`,{ref:et,className:ct,"data-density":W===`compact`?`compact`:void 0,"data-wui-folded-cookie":rt?J:void 0,style:Ke,...t,...Ge,children:[/* @__PURE__ */ C(`a`,{className:`wui-skip-link`,href:`#main-content`,children:ve}),/* @__PURE__ */ w(`aside`,{className:`app-sidebar`,children:[(u||v||S||T||E)&&/* @__PURE__ */ w(`div`,{className:ee({logoLight:v,logoDark:S,markLight:T,markDark:E}),children:[R({logoLight:v,logoDark:S,markLight:T,markDark:E,brandName:D}),u]}),O&&/* @__PURE__ */ C(`div`,{className:`app-sidebar-start`,children:O}),k&&/* @__PURE__ */ C(`div`,{className:`app-sidebar-start-compact`,children:k}),/* @__PURE__ */ C(`nav`,{className:`app-sidebar-scroll`,"aria-label":fe,ref:$e,tabIndex:Ze?0:void 0,children:Q.map((e,t)=>{let n=e.items.map(e=>e.header==null?/* @__PURE__ */ C(se,{item:e,linkComponent:q,onNavigate:()=>X(!1),iconVariant:K,newLabel:Ce,togglePagesLabel:we},e.key??e.href??e.label):/* @__PURE__ */ C(`div`,{className:`wui-nav-header`,children:e.header},e.key??e.header));if(!e.collapsible)return/* @__PURE__ */ w(`div`,{className:`app-nav-group`,children:[e.label&&/* @__PURE__ */ C(`div`,{className:`app-nav-group-label`,children:e.label}),n,e.after&&/* @__PURE__ */ C(`div`,{className:`wui-nav-group-after`,children:e.after})]},e.key??e.label??`group-${t}`);let r=!it.has(e.key)||!!U(e.items),i=`wui-nav-group-${e.key}`;return/* @__PURE__ */ w(`div`,{className:`app-nav-group wui-nav-group-collapsible${r?``:` wui-nav-group-folded`}`,"data-wui-nav-group":e.key,children:[/* @__PURE__ */ w(`button`,{type:`button`,className:`app-nav-group-label wui-nav-group-toggle`,"aria-expanded":r,"aria-controls":i,onClick:()=>ot(e.key),children:[/* @__PURE__ */ C(`span`,{className:`wui-nav-group-text`,children:e.label}),/* @__PURE__ */ C(`span`,{className:`wui-nav-group-caret`,children:/* @__PURE__ */ C(d,{name:`chevron-down`,size:16})})]}),/* @__PURE__ */ w(`div`,{className:`wui-nav-group-body`,id:i,children:[n,e.after&&/* @__PURE__ */ C(`div`,{className:`wui-nav-group-after`,children:e.after})]})]},e.key??`group-${t}`)})}),P&&/* @__PURE__ */ C(`div`,{className:`app-sidebar-foot`,children:P}),!V&&/* @__PURE__ */ C(`button`,{type:`button`,className:`app-sidebar-toggle`,onClick:nt,"aria-label":Z?xe:Se,"aria-expanded":!Z,children:/* @__PURE__ */ C(d,{name:`chevrons-left`,size:20})})]}),/* @__PURE__ */ w(`div`,{className:`app-main`,children:[/* @__PURE__ */ w(`header`,{className:`app-topbar${Ye?` scrolled`:``}`,"data-tone":de===`primary`?`primary`:void 0,children:[/* @__PURE__ */ w(`div`,{className:`app-topbar-start`,children:[/* @__PURE__ */ C(`button`,{type:`button`,className:`app-topbar-menu`,onClick:()=>X(!0),"aria-label":ye,"aria-expanded":Y,children:/* @__PURE__ */ C(d,{name:`menu`,size:18})}),H===`top`&&u&&/* @__PURE__ */ C(`div`,{className:`wui-shell-top-brand`,children:u}),H===`top`&&/* @__PURE__ */ C(`div`,{className:`wui-shell-top-nav`,children:/* @__PURE__ */ C(f,{items:ae(Q),ariaLabel:fe,linkComponent:q})}),F,He&&/* @__PURE__ */ C(ue,{config:He,searchResultsLabel:Fe,noResultsText:Ie,noResultsForText:Le,resultsCountText:Re,resultCountText:ze})]}),/* @__PURE__ */ w(`div`,{className:`app-topbar-end`,children:[I,Ve&&/* @__PURE__ */ C(le,{config:Ve,unreadLabel:Oe,markAllReadLabel:ke,viewAllLabel:Ae,loadingNotificationsText:je,noUnreadText:Me,unreadNotificationsText:Ne,unreadBellLabel:Pe}),Be&&/* @__PURE__ */ C(ce,{config:Be,linkComponent:q,accountMenuLabel:Te,roleLabel:Ee,rolesLabel:De})]})]}),/* @__PURE__ */ C(`main`,{className:`app-content`,id:`main-content`,children:ne}),L&&/* @__PURE__ */ C(`footer`,{className:`app-footer`,ref:tt,children:L})]}),z&&/* @__PURE__ */ C(`div`,{className:`wui-shell-launcher`,children:z}),$&&/* @__PURE__ */ w(`nav`,{className:`wui-tabbar`,"aria-label":ge,children:[$.tabs.map(e=>/* @__PURE__ */ C(oe,{tab:e,linkComponent:q,iconVariant:K},e.key??e.href)),$.hasMore&&/* @__PURE__ */ w(`button`,{type:`button`,className:`wui-tabbar-item${$.moreActive?` active`:``}`,onClick:()=>X(!0),children:[/* @__PURE__ */ C(`span`,{className:`wui-tabbar-icon`,children:/* @__PURE__ */ C(d,{name:`more`,size:24})}),/* @__PURE__ */ C(`span`,{className:`wui-tabbar-label`,children:_e})]})]}),/* @__PURE__ */ C(`button`,{type:`button`,className:`app-scrim`,onClick:()=>X(!1),"aria-label":be,tabIndex:Y?0:-1})]})}function te(e,t){for(let t of e)t.collapsible&&H(t);let r=(e,t=!1)=>(e??[]).map(e=>Array.isArray(e.children)?{...e,children:r(e.children)}:{...e}).filter(e=>B(e)?t:(e.children?.length??0)>0||!!e.href),i=e.map(e=>({...e,items:re(r(e.items,!0))})).filter(e=>e.items.some(e=>!B(e))),a=[],o=e=>{for(let t of e)B(t)||(a.push(t),t.children&&o(t.children))};for(let e of i)o(e.items);for(let e of a)m(`AppShell items`,ne(e)),p(`AppShell`,`match`,e.match,k),p(`AppShell`,`iconVariant`,e.iconVariant,N);let s=null;if(t!=null&&!a.some(e=>e.active===!0)){let e=-1;for(let r of a){if(r.active!=null||r.children?.length&&!r.href)continue;let i=n(t,r.href,{exact:r.match===`exact`,also:r.matchAlso});if(i<0)continue;let a=r.match===`exact`&&n(t,r.href,{exact:!0})>=0?1/0:i;a>e&&(e=a,s=r)}}for(let e of a)e.active=e.active??e===s;return i}function ne(e){return Object.fromEntries(Object.entries(e).filter(([e])=>!P.has(e)))}var B=e=>e.header!=null;function re(e){return e.filter((t,n)=>{if(!B(t))return!0;let r=e.findIndex((e,t)=>t>n&&B(e));return e.slice(n+1,r<0?void 0:r).length>0})}var V=/* @__PURE__ */ new Set;function H(t){if(t.key!=null&&O.test(t.key))return;let n=t.key==null?`<AppShell> a collapsible group needs a key so its folded state can be remembered.`:`<AppShell> collapsible group key "${t.key}" must use lower-case letters, digits and hyphens.`,r=!0;try{r=process.env.NODE_ENV!==`production`}catch{r=!0}r&&!V.has(n)&&(V.add(n),e(n))}function ie(e){let t=[],n=e=>{for(let r of e)B(r)||(r.children?.length?n(r.children):t.push(r))};for(let t of e)n(t.items);let r=t.filter(e=>e.tab);if(r.length===0)return null;let i=r.length<t.length,a=i?E:D;if(r.length>a)throw Error(`<AppShell>: ${r.length} items carry tab: true, but the phone tab bar holds ${a} (${i?`4 plus More, because other items exist`:`5 when every item is a tab`}). Flag fewer items.`);return{tabs:r,hasMore:i,moreActive:t.some(e=>!e.tab&&e.active)}}function ae(e){let t=e=>({key:e.key??e.href??e.label,label:e.label,to:e.href,current:!!e.active}),n=e=>e.flatMap(e=>B(e)?[]:[...e.href?[{...t(e),icon:e.icon}]:[],...n(e.children??[])]),r=[];for(let i of e.flatMap(e=>e.items)){if(B(i))continue;let e=n(i.children??[]);if(e.length>0){let n=i.href?[{...t(i),icon:i.icon}]:[];r.push({key:t(i).key,label:i.label,links:[...n,...e]})}else i.href&&r.push(t(i))}return r}function oe({tab:e,linkComponent:t,iconVariant:n}){let r=`wui-tabbar-item${e.active?` active`:``}`,i=/* @__PURE__ */ w(S,{children:[e.icon&&/* @__PURE__ */ C(`span`,{className:`wui-tabbar-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ C(d,{name:e.icon,size:24,variant:e.iconVariant??n}):e.icon}),/* @__PURE__ */ C(`span`,{className:`wui-tabbar-label`,children:e.tabLabel??e.label}),e.badge!=null&&/* @__PURE__ */ C(`span`,{className:`wui-tabbar-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge})]}),a=e.active?`page`:void 0;return t?/* @__PURE__ */ C(t,{className:r,to:e.href,"aria-current":a,children:i}):/* @__PURE__ */ C(`a`,{className:r,href:e.href,"aria-current":a,children:i})}function U(e){for(let t of e){if(t.active)return t;let e=t.children?.length?U(t.children):void 0;if(e)return e}}function se({item:e,linkComponent:n,onNavigate:r,depth:i=0,iconVariant:a,newLabel:o,togglePagesLabel:s}){let c=i>0,l=i>1?` wui-nav-depth-${Math.min(i,6)}`:``,u=Array.isArray(e.children)&&e.children.length>0,f=u?U(e.children):void 0,p=!!f,m=f?f.key??f.href??f.label:null,[h,g]=x(p);_(()=>{m!=null&&g(!0)},[m]);let v=typeof e.label==`string`?e.label:void 0,y=!c&&e.icon&&/* @__PURE__ */ C(`span`,{className:`app-nav-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ C(d,{name:e.icon,size:e.iconSize??22,variant:e.iconVariant??a}):e.icon}),b=e.badge!=null&&/* @__PURE__ */ C(`span`,{className:`app-nav-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge}),T=L(e.newUntil)&&/* @__PURE__ */ C(`span`,{className:`wui-nav-new`,children:o}),E=/* @__PURE__ */ w(S,{children:[y,/* @__PURE__ */ C(`span`,{className:`app-nav-text`,children:e.label}),T,b,e.trailingIcon&&/* @__PURE__ */ C(`span`,{className:`app-nav-trailing`,children:typeof e.trailingIcon==`string`?/* @__PURE__ */ C(d,{name:e.trailingIcon,size:16}):e.trailingIcon})]}),D=e.active?`page`:void 0;if(u){let u=/* @__PURE__ */ C(`div`,{className:`app-nav-sub${h?` expanded`:``}`,inert:!h,"aria-hidden":!h||void 0,children:/* @__PURE__ */ C(`div`,{className:`app-nav-sub-inner`,children:e.children.map(e=>/* @__PURE__ */ C(se,{item:e,linkComponent:n,onNavigate:r,depth:i+1,iconVariant:a,newLabel:o,togglePagesLabel:s},e.key??e.href))})});if(e.href){let i=n?/* @__PURE__ */ C(n,{className:`wui-nav-split-link`,to:e.href,"aria-current":D,onClick:r,children:E}):/* @__PURE__ */ C(`a`,{className:`wui-nav-split-link`,href:e.href,"aria-current":D,onClick:r,children:E});return/* @__PURE__ */ w(S,{children:[/* @__PURE__ */ w(`div`,{className:`app-nav-item has-children wui-nav-split${c?` app-nav-subitem`:``}${p||e.active?` active`:``}${l}`,"data-label":v,children:[i,/* @__PURE__ */ C(`button`,{type:`button`,className:`app-nav-caret wui-nav-split-toggle`,"aria-expanded":h,"aria-label":t(s,{name:v??``}),onClick:()=>g(e=>!e),children:/* @__PURE__ */ C(d,{name:`chevron-right`,size:16})})]}),u]})}return/* @__PURE__ */ w(S,{children:[/* @__PURE__ */ w(`button`,{type:`button`,className:`app-nav-item${c?` app-nav-subitem`:``} has-children${p?` active`:``}${l}`,"aria-expanded":h,"data-label":v,onClick:()=>g(e=>!e),children:[y,/* @__PURE__ */ C(`span`,{className:`app-nav-text`,children:e.label}),T,b,/* @__PURE__ */ C(`span`,{className:`app-nav-caret`,children:/* @__PURE__ */ C(d,{name:`chevron-right`,size:16})})]}),u]})}let O=`app-nav-item${c?` app-nav-subitem`:``}${e.active?` active`:``}${l}`;return n?/* @__PURE__ */ C(n,{className:O,to:e.href,"aria-current":D,"data-label":v,onClick:r,children:E}):/* @__PURE__ */ C(`a`,{className:O,href:e.href,"aria-current":D,"data-label":v,onClick:r,children:E})}function W(){let[e,t]=x(!1),n=b(null);return _(()=>{if(!e)return;let r=e=>{n.current?.contains(e.target)||t(!1)},i=e=>{e.key===`Escape`&&(t(!1),n.current?.querySelector(`button`)?.focus())};return document.addEventListener(`mousedown`,r),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`mousedown`,r),document.removeEventListener(`keydown`,i)}},[e]),{open:e,setOpen:t,ref:n}}function ce({config:e,linkComponent:n,accountMenuLabel:r,roleLabel:i,rolesLabel:a}){let o=v(),{open:s,setOpen:c,ref:f}=W(),{name:m,role:h,roles:g=[],photo:_,profileHref:y,profileLabel:b=`My profile`,onLogout:x,logoutAction:T,logoutLabel:E=`Sign out`,head:D,section:O,logoutVariant:k=`item`,items:A=[]}=e;if(p(`AppShell`,`userMenu.logoutVariant`,k,[`item`,`button`]),!m)throw Error(`<AppShell> userMenu.name is required; the trigger and the avatar are named from it.`);let j=g.map(e=>(e??``).trim()).filter(Boolean),M=()=>c(!1),N=(e,t,r,i)=>n?/* @__PURE__ */ C(n,{className:`dropdown-item`,to:e,onClick:i,children:t},r):/* @__PURE__ */ C(`a`,{className:`dropdown-item`,href:e,onClick:i,children:t},r),P=/* @__PURE__ */ C(d,{name:`log-out`,size:18}),F=/* @__PURE__ */ w(S,{children:[P,E]});return/* @__PURE__ */ w(`div`,{className:`dropdown wui-usermenu`,ref:f,children:[/* @__PURE__ */ w(`button`,{type:`button`,id:o,className:`wui-usermenu-trigger`,"aria-expanded":s,"aria-label":t(r,{name:m}),onClick:()=>c(e=>!e),children:[/* @__PURE__ */ C(l,{name:m,src:_,tone:`auto`}),/* @__PURE__ */ w(`span`,{className:`wui-usermenu-text`,children:[/* @__PURE__ */ C(`span`,{className:`wui-usermenu-name`,children:m}),h&&/* @__PURE__ */ C(`span`,{className:`wui-usermenu-role`,children:h})]}),/* @__PURE__ */ C(d,{name:`chevron-down`,size:14,className:`wui-usermenu-caret`})]}),/* @__PURE__ */ w(`div`,{className:`dropdown-menu dropdown-menu-end wui-usermenu-menu${s?` show`:``}`,"aria-labelledby":o,"data-bs-popper":s?`static`:void 0,children:[/* @__PURE__ */ w(`div`,{className:`wui-usermenu-head`,children:[/* @__PURE__ */ C(l,{name:m,src:_,size:`lg`,tone:`auto`}),/* @__PURE__ */ w(`div`,{className:`wui-usermenu-who`,children:[/* @__PURE__ */ C(`div`,{className:`wui-usermenu-name`,children:m}),h&&/* @__PURE__ */ C(`div`,{className:`wui-usermenu-role`,children:h}),j.length>0&&/* @__PURE__ */ w(`div`,{className:`wui-usermenu-roles`,children:[/* @__PURE__ */ C(`span`,{className:`wui-usermenu-roles-label`,children:j.length===1?i:a}),` ${j.join(`, `)}`]}),D?/* @__PURE__ */ C(`div`,{className:`wui-usermenu-extra`,children:D}):null]})]}),O?/* @__PURE__ */ C(`div`,{className:`wui-usermenu-section`,children:O}):null,y&&N(y,/* @__PURE__ */ w(S,{children:[/* @__PURE__ */ C(d,{name:`user`,size:18}),b]}),void 0,M),A.map(e=>{if(e.divider)return/* @__PURE__ */ C(`hr`,{className:`dropdown-divider`},e.key);let t=/* @__PURE__ */ w(S,{children:[e.icon&&/* @__PURE__ */ C(d,{name:e.icon,size:18}),e.label]}),n=()=>{e.onClick?.(),M()};return e.href?N(e.href,t,e.key,n):/* @__PURE__ */ C(`button`,{type:`button`,className:`dropdown-item`,onClick:n,children:t},e.key)}),k===`button`?(T||x)&&/* @__PURE__ */ C(`div`,{className:`wui-usermenu-foot`,children:T?/* @__PURE__ */ C(`form`,{method:`post`,action:T,className:`wui-usermenu-logout`,children:/* @__PURE__ */ C(u,{type:`submit`,tone:`danger`,variant:`soft`,block:!0,leftIcon:P,children:E})}):/* @__PURE__ */ C(u,{type:`button`,tone:`danger`,variant:`soft`,block:!0,leftIcon:P,onClick:()=>{M(),x()},children:E})}):T?/* @__PURE__ */ C(`form`,{method:`post`,action:T,className:`wui-usermenu-logout`,children:/* @__PURE__ */ C(`button`,{type:`submit`,className:`dropdown-item danger`,children:F})}):x&&/* @__PURE__ */ C(`button`,{type:`button`,className:`dropdown-item danger`,onClick:()=>{M(),x()},children:F})]})]})}function le({config:e,unreadLabel:n,markAllReadLabel:r,viewAllLabel:i,loadingNotificationsText:a,noUnreadText:o,unreadNotificationsText:s,unreadBellLabel:c}){let l=v(),{open:u,setOpen:f,ref:p}=W(),{unread:m=0,items:h,loading:g=!1,onOpen:y,onMarkAllRead:T,viewAllHref:E,label:D=`Notifications`,emptyText:O=`You are all caught up.`}=e,[k,A]=x(``),j=b(m);_(()=>{j.current!==m&&(j.current=m,A(m===0?o:t(s,{count:F(m)})))},[m,o,s]);let M=null;return h?.length?M=/* @__PURE__ */ C(`div`,{className:`wui-bell-items`,children:h.map((e,t)=>{let r=`wui-bell-item${e.read?` wui-bell-item-read`:``}`,i=/* @__PURE__ */ w(S,{children:[/* @__PURE__ */ C(`span`,{className:`wui-bell-dot`,"aria-hidden":`true`}),e.icon&&/* @__PURE__ */ C(`span`,{className:`wui-bell-icon`,children:/* @__PURE__ */ C(d,{name:e.icon,size:18})}),/* @__PURE__ */ w(`span`,{className:`wui-bell-body`,children:[!e.read&&/* @__PURE__ */ w(`span`,{className:`visually-hidden`,children:[n,`: `]}),/* @__PURE__ */ C(`span`,{className:`wui-bell-item-title`,children:e.title}),e.time&&/* @__PURE__ */ C(`span`,{className:`wui-bell-when`,children:e.time})]})]});return e.href?/* @__PURE__ */ C(`a`,{className:r,href:e.href,"data-id":e.id,children:i},e.id??t):/* @__PURE__ */ C(`div`,{className:r,"data-id":e.id,children:i},e.id??t)})}):g?M=/* @__PURE__ */ C(`div`,{className:`wui-bell-state`,children:a}):h&&(M=/* @__PURE__ */ C(`div`,{className:`wui-bell-state`,children:O})),/* @__PURE__ */ w(`div`,{className:`dropdown wui-bell`,ref:p,children:[/* @__PURE__ */ w(`button`,{type:`button`,id:l,className:`topbar-icon-btn wui-bell-trigger`,"aria-expanded":u,"aria-label":m===0?D:t(c,{label:D,count:F(m)}),onClick:()=>{let e=!u;f(e),e&&y?.()},children:[/* @__PURE__ */ C(d,{name:`notification`,size:20}),/* @__PURE__ */ C(`span`,{className:`wui-bell-count`,"aria-hidden":`true`,hidden:m===0,children:F(m)})]}),/* @__PURE__ */ C(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:k}),/* @__PURE__ */ w(`div`,{className:`dropdown-menu dropdown-menu-end wui-bell-menu${u?` show`:``}`,"aria-labelledby":l,"data-bs-popper":u?`static`:void 0,children:[/* @__PURE__ */ w(`div`,{className:`wui-bell-head`,children:[/* @__PURE__ */ C(`span`,{className:`wui-bell-title`,children:D}),T&&/* @__PURE__ */ C(`button`,{type:`button`,className:`wui-bell-markall`,onClick:T,children:r})]}),/* @__PURE__ */ C(`div`,{className:`wui-bell-list`,"aria-busy":g||void 0,children:M}),E&&/* @__PURE__ */ C(`a`,{className:`wui-bell-foot`,href:E,children:i})]})]})}var G=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function ue({config:e,searchResultsLabel:n,noResultsText:r,noResultsForText:i,resultsCountText:a,resultCountText:o}){let s=v(),{value:c=``,onChange:l,results:u=null,loading:f=!1,onSelect:p,onSubmit:m,onFocus:h,placeholder:g=`Search`}=e,[S,T]=x(!1),[E,D]=x(!1),[O,k]=x({results:null,index:-1}),A=O.results===u?O.index:-1,j=e=>k({results:u,index:e}),M=b(null),N=b(null),P=b([]),F=y(()=>(u??[]).flatMap(e=>e.hits??[]),[u]),I=u!=null&&!E,L=F.length;_(()=>{let e=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||G(e.target)||(e.preventDefault(),T(!0),N.current?.focus())},t=e=>{M.current?.contains(e.target)||(D(!0),T(!1))};return document.addEventListener(`keydown`,e),document.addEventListener(`pointerdown`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`pointerdown`,t)}},[]);let ee=e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(!I||L===0)return;e.preventDefault(),j((A+(e.key===`ArrowDown`?1:-1)+L)%L)}else e.key===`Enter`?I&&A>=0&&P.current[A]?(e.preventDefault(),P.current[A].click()):m&&c.trim()!==``&&(e.preventDefault(),m(c.trim())):e.key===`Escape`&&(I?(e.preventDefault(),D(!0)):S&&(e.preventDefault(),T(!1)))},R=-1;return P.current=[],/* @__PURE__ */ w(`div`,{className:`wui-topsearch${S?` is-open`:``}${f?` is-loading`:``}`,ref:M,children:[/* @__PURE__ */ C(`button`,{type:`button`,className:`topbar-icon-btn wui-topsearch-open`,"aria-label":g,"aria-expanded":S,"aria-controls":`${s}-panel`,onClick:()=>{let e=!S;T(e),e&&N.current?.focus()},children:/* @__PURE__ */ C(d,{name:`search`,size:20})}),/* @__PURE__ */ w(`div`,{className:`wui-topsearch-panel`,id:`${s}-panel`,children:[/* @__PURE__ */ w(`div`,{className:`search-wrap`,children:[/* @__PURE__ */ C(d,{name:`search`,size:18,className:`search-icon`}),/* @__PURE__ */ C(`input`,{ref:N,type:`search`,className:`form-control input search-input`,id:`${s}-input`,placeholder:g,"aria-label":g,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":I,"aria-controls":`${s}-list`,"aria-activedescendant":I&&A>=0?`${s}-opt-${A}`:void 0,autoComplete:`off`,value:c,onChange:e=>{D(!1),l?.(e.target.value)},onKeyDown:ee,onFocus:h})]}),/* @__PURE__ */ C(`div`,{className:`wui-topsearch-results`,id:`${s}-list`,role:`listbox`,"aria-label":n,hidden:!I,children:I&&/* @__PURE__ */ w(`div`,{className:`wui-topsearch-groups`,role:`presentation`,children:[L===0&&/* @__PURE__ */ C(`div`,{className:`wui-topsearch-empty`,role:`option`,"aria-disabled":`true`,"aria-selected":`false`,children:t(i,{value:c})}),u.filter(e=>e.hits?.length).map((e,t)=>/* @__PURE__ */ w(`div`,{className:`wui-topsearch-group`,role:`group`,"aria-label":e.label??``,children:[e.label&&/* @__PURE__ */ C(`div`,{className:`wui-topsearch-group-label`,role:`presentation`,children:e.label}),e.hits.map(e=>{R+=1;let t=R;return/* @__PURE__ */ w(`a`,{className:`wui-topsearch-hit${t===A?` is-active`:``}`,role:`option`,"aria-selected":t===A,id:`${s}-opt-${t}`,href:e.href,ref:e=>{P.current[t]=e},onClick:t=>p?.(e,t),children:[e.icon&&/* @__PURE__ */ C(`span`,{className:`wui-topsearch-hit-icon`,children:/* @__PURE__ */ C(d,{name:e.icon,size:18})}),/* @__PURE__ */ w(`span`,{className:`wui-topsearch-hit-text`,children:[/* @__PURE__ */ C(`span`,{className:`wui-topsearch-hit-title`,children:e.title}),e.subtitle&&/* @__PURE__ */ C(`span`,{className:`wui-topsearch-hit-sub`,children:e.subtitle})]})]},`${e.href}-${t}`)})]},e.label??t))]})})]}),/* @__PURE__ */ C(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:I?L===0?r:t(L===1?o:a,{count:L}):``})]})}export{z as default};
|
|
1
|
+
import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/fillLabel.js";import{navMatchScore as n}from"../lib/navMatch.js";import{SHELL_FOLDED_COOKIE as r,readNavFolded as i,readShellCollapsed as a,writeNavFolded as o,writeShellCollapsed as s}from"../lib/shellCookie.js";import{splitMarkerProps as c}from"../lib/wuiMarker.js";import l from"./AppAvatar.js";import u from"./AppButton.js";import d from"./AppIcon.js";import f from"./AppNavigationMenu.js";import p from"./assertValidValue.js";import m from"./warnUnknownProps.js";import{initScrollEdges as h,revealActiveNavItem as g}from"@webority/ui-elements/helpers";import{useEffect as _,useId as v,useMemo as y,useRef as b,useState as x}from"react";import{Fragment as S,jsx as C,jsxs as w}from"react/jsx-runtime";var T=99,E=4,D=5,O=/^[a-z0-9-]+$/,k=[`prefix`,`exact`],A=[`comfortable`,`compact`],j=[`neutral`,`primary`],M=[`side`,`top`],N=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],P=/* @__PURE__ */ new Set([`key`,`label`,`icon`,`iconVariant`,`iconSize`,`href`,`badge`,`badgeTone`,`badgeTitle`,`newUntil`,`trailingIcon`,`active`,`match`,`matchAlso`,`tab`,`tabLabel`,`children`]),F=e=>e>T?`${T}+`:String(e),I=new Intl.DateTimeFormat(`en-CA`,{timeZone:`Asia/Kolkata`}),L=e=>{if(typeof e!=`string`||!/^\d{4}-\d{2}-\d{2}$/.test(e))return!1;let t=/* @__PURE__ */ new Date(`${e}T00:00:00Z`);return Number.isNaN(t.getTime())||t.toISOString().slice(0,10)!==e?!1:I.format(/* @__PURE__ */ new Date)<=e},ee=({logoLight:e,logoDark:t,markLight:n,markDark:r})=>{let i=!!(n||r);return[`app-sidebar-brand`,i&&`wui-brand-has-mark`,i&&!e&&!t&&`wui-brand-mark-only`,(t||r)&&`wui-brand-themed`].filter(Boolean).join(` `)},R=({logoLight:e,logoDark:t,markLight:n,markDark:r,brandName:i})=>{let a=i??``,o=[e&&/* @__PURE__ */ C(`img`,{className:`wui-brand-logo wui-brand-light`,src:e,alt:a},`logo-light`),t&&/* @__PURE__ */ C(`img`,{className:`wui-brand-logo wui-brand-dark`,src:t,alt:``,"aria-hidden":`true`},`logo-dark`)],s=[n&&[`mark-light`,`wui-brand-mark wui-brand-light`,n],r&&[`mark-dark`,`wui-brand-mark wui-brand-dark`,r]].filter(Boolean).map(([t,n,r],i)=>i===0&&!e?/* @__PURE__ */ C(`img`,{className:n,src:r,alt:a},t):/* @__PURE__ */ C(`img`,{className:n,src:r,alt:``,"aria-hidden":`true`},t));return[...o,...s].filter(Boolean)};function te(e){let{marker:t,props:n}=c(`AppShell`,e),{groups:l=[],brand:u,logoLight:v,logoDark:T,markLight:E,markDark:D,brandName:O,brandHref:k,brandLabel:P,sidebarStart:F,sidebarStartCompact:I,sidebarFooter:L,topbarStart:te,topbarEnd:re,footer:z,launcher:B,children:V,collapsed:H,onCollapsedChange:W,noSidebar:G=!1,nav:K=`side`,density:fe=`comfortable`,itemHeight:pe,iconVariant:q=`twotone`,topbarTone:me=`neutral`,navLabel:he=`Main navigation`,linkComponent:J,currentPath:ge,rememberCollapsed:_e=!1,collapsedCookie:ve=`wui-shell-collapsed`,foldedCookie:ye=r,tabBarLabel:be=`Quick navigation`,moreLabel:xe=`More`,skipLabel:Se=`Skip to content`,openNavLabel:Ce=`Open navigation`,closeNavLabel:we=`Close navigation`,expandNavLabel:Te=`Expand navigation`,collapseNavLabel:Ee=`Collapse navigation`,newLabel:De=`New`,togglePagesLabel:Oe=`Show or hide {name} pages`,accountMenuLabel:ke=`Account menu for {name}`,roleLabel:Ae=`Role:`,rolesLabel:je=`Roles:`,unreadLabel:Me=`Unread`,markAllReadLabel:Ne=`Mark all read`,viewAllLabel:Pe=`View all`,loadingNotificationsText:Fe=`Loading…`,noUnreadText:Ie=`No unread notifications`,unreadNotificationsText:Le=`{count} unread notifications`,unreadBellLabel:Re=`{label}, {count} unread`,searchResultsLabel:ze=`Search results`,noResultsText:Be=`No results`,noResultsForText:Ve=`No results for “{value}”`,resultsCountText:He=`{count} results`,resultCountText:Ue=`{count} result`,userMenu:We,notifications:Ge,search:Ke,className:qe=``,style:Je,...Ye}=n;if(m(`AppShell`,Ye),p(`AppShell`,`density`,fe,A),p(`AppShell`,`topbarTone`,me,j),p(`AppShell`,`nav`,K,M),p(`AppShell`,`iconVariant`,q,N),P!==void 0&&!k)throw Error(`<AppShell> brandLabel names the brand link, so it needs brandHref.`);if(k){if(!P&&!O)throw Error(`<AppShell> brandHref needs brandLabel or brandName: the collapsed rail hides the logo, so the link would have no accessible name.`);if(!(u||v||T||E||D))throw Error(`<AppShell> brandHref has no brand, logo or mark to link.`)}let Xe=pe>0?{...Je,"--wui-nav-item-height":`${pe}px`}:Je,[Ze,Qe]=x(()=>_e&&H===void 0&&typeof document<`u`?a(ve)??!1:!1),[Y,X]=x(!1),[$e,et]=x(!1),[tt,nt]=x(!1),rt=b(null),it=b(null),at=b(null),Z=H??Ze,ot=e=>k?/* @__PURE__ */ C(oe,{href:k,label:P||O,linkComponent:J,onNavigate:()=>X(!1),children:e}):e,st=()=>{let e=!Z;H===void 0&&Qe(e),_e&&s(e,ve),W?.(e)},ct=l.some(e=>e.collapsible),[lt,ut]=x(()=>ct&&typeof document<`u`?i(ye):/* @__PURE__ */ new Set),dt=e=>{let t=new Set(lt);t.has(e)?t.delete(e):t.add(e),ut(t),o(t,ye)},Q=y(()=>ne(l,ge),[l,ge]),$=G?null:ie(Q);_(()=>{let e=()=>et(window.scrollY>4);return e(),window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)},[]),_(()=>{h()},[]),_(()=>{g(rt.current)},[]),_(()=>{let e=rt.current;if(!e)return;let t=()=>nt(e.scrollHeight>e.clientHeight);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[Q]);let ft=!!z;_(()=>{let e=at.current,t=it.current;if(!ft||!e||!t)return;let n=()=>t.style.setProperty(`--app-footer-h`,`${e.offsetHeight}px`);n();let r=typeof ResizeObserver>`u`?null:new ResizeObserver(n);return r?.observe(e),()=>{r?.disconnect(),t.style.removeProperty(`--app-footer-h`)}},[ft]),_(()=>{if(!Y)return;let e=e=>{e.key===`Escape`&&X(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[Y]);let pt=[`app-shell`,Z?`collapsed`:``,G?`no-sidebar`:``,K===`top`?`wui-shell-top`:``,Y?`mobile-open`:``,qe].filter(Boolean).join(` `);return/* @__PURE__ */ w(`div`,{ref:it,className:pt,"data-density":fe===`compact`?`compact`:void 0,"data-wui-folded-cookie":ct?ye:void 0,style:Xe,...t,...Ye,children:[/* @__PURE__ */ C(`a`,{className:`wui-skip-link`,href:`#main-content`,children:Se}),/* @__PURE__ */ w(`aside`,{className:`app-sidebar`,children:[(u||v||T||E||D)&&/* @__PURE__ */ C(`div`,{className:ee({logoLight:v,logoDark:T,markLight:E,markDark:D}),children:ot(/* @__PURE__ */ w(S,{children:[R({logoLight:v,logoDark:T,markLight:E,markDark:D,brandName:O}),u]}))}),F&&/* @__PURE__ */ C(`div`,{className:`app-sidebar-start`,children:F}),I&&/* @__PURE__ */ C(`div`,{className:`app-sidebar-start-compact`,children:I}),/* @__PURE__ */ C(`nav`,{className:`app-sidebar-scroll`,"aria-label":he,ref:rt,tabIndex:tt?0:void 0,children:Q.map((e,t)=>{let n=e.items.map(e=>e.header==null?/* @__PURE__ */ C(ce,{item:e,linkComponent:J,onNavigate:()=>X(!1),iconVariant:q,newLabel:De,togglePagesLabel:Oe},e.key??e.href??e.label):/* @__PURE__ */ C(`div`,{className:`wui-nav-header`,children:e.header},e.key??e.header));if(!e.collapsible)return/* @__PURE__ */ w(`div`,{className:`app-nav-group`,children:[e.label&&/* @__PURE__ */ C(`div`,{className:`app-nav-group-label`,children:e.label}),n,e.after&&/* @__PURE__ */ C(`div`,{className:`wui-nav-group-after`,children:e.after})]},e.key??e.label??`group-${t}`);let r=!lt.has(e.key)||!!U(e.items),i=`wui-nav-group-${e.key}`;return/* @__PURE__ */ w(`div`,{className:`app-nav-group wui-nav-group-collapsible${r?``:` wui-nav-group-folded`}`,"data-wui-nav-group":e.key,children:[/* @__PURE__ */ w(`button`,{type:`button`,className:`app-nav-group-label wui-nav-group-toggle`,"aria-expanded":r,"aria-controls":i,onClick:()=>dt(e.key),children:[/* @__PURE__ */ C(`span`,{className:`wui-nav-group-text`,children:e.label}),/* @__PURE__ */ C(`span`,{className:`wui-nav-group-caret`,children:/* @__PURE__ */ C(d,{name:`chevron-down`,size:16})})]}),/* @__PURE__ */ w(`div`,{className:`wui-nav-group-body`,id:i,children:[n,e.after&&/* @__PURE__ */ C(`div`,{className:`wui-nav-group-after`,children:e.after})]})]},e.key??`group-${t}`)})}),L&&/* @__PURE__ */ C(`div`,{className:`app-sidebar-foot`,children:L}),!G&&/* @__PURE__ */ C(`button`,{type:`button`,className:`app-sidebar-toggle`,onClick:st,"aria-label":Z?Te:Ee,"aria-expanded":!Z,children:/* @__PURE__ */ C(d,{name:`chevrons-left`,size:20})})]}),/* @__PURE__ */ w(`div`,{className:`app-main`,children:[/* @__PURE__ */ w(`header`,{className:`app-topbar${$e?` scrolled`:``}`,"data-tone":me===`primary`?`primary`:void 0,children:[/* @__PURE__ */ w(`div`,{className:`app-topbar-start`,children:[/* @__PURE__ */ C(`button`,{type:`button`,className:`app-topbar-menu`,onClick:()=>X(!0),"aria-label":Ce,"aria-expanded":Y,children:/* @__PURE__ */ C(d,{name:`menu`,size:18})}),K===`top`&&u&&/* @__PURE__ */ C(`div`,{className:`wui-shell-top-brand`,children:ot(u)}),K===`top`&&/* @__PURE__ */ C(`div`,{className:`wui-shell-top-nav`,children:/* @__PURE__ */ C(f,{items:ae(Q),ariaLabel:he,linkComponent:J})}),te,Ke&&/* @__PURE__ */ C(de,{config:Ke,searchResultsLabel:ze,noResultsText:Be,noResultsForText:Ve,resultsCountText:He,resultCountText:Ue})]}),/* @__PURE__ */ w(`div`,{className:`app-topbar-end`,children:[re,Ge&&/* @__PURE__ */ C(ue,{config:Ge,unreadLabel:Me,markAllReadLabel:Ne,viewAllLabel:Pe,loadingNotificationsText:Fe,noUnreadText:Ie,unreadNotificationsText:Le,unreadBellLabel:Re}),We&&/* @__PURE__ */ C(le,{config:We,linkComponent:J,accountMenuLabel:ke,roleLabel:Ae,rolesLabel:je})]})]}),/* @__PURE__ */ C(`main`,{className:`app-content`,id:`main-content`,children:V}),z&&/* @__PURE__ */ C(`footer`,{className:`app-footer`,ref:at,children:z})]}),B&&/* @__PURE__ */ C(`div`,{className:`wui-shell-launcher`,children:B}),$&&/* @__PURE__ */ w(`nav`,{className:`wui-tabbar`,"aria-label":be,children:[$.tabs.map(e=>/* @__PURE__ */ C(se,{tab:e,linkComponent:J,iconVariant:q},e.key??e.href)),$.hasMore&&/* @__PURE__ */ w(`button`,{type:`button`,className:`wui-tabbar-item${$.moreActive?` active`:``}`,onClick:()=>X(!0),children:[/* @__PURE__ */ C(`span`,{className:`wui-tabbar-icon`,children:/* @__PURE__ */ C(d,{name:`more`,size:24})}),/* @__PURE__ */ C(`span`,{className:`wui-tabbar-label`,children:xe})]})]}),/* @__PURE__ */ C(`button`,{type:`button`,className:`app-scrim`,onClick:()=>X(!1),"aria-label":we,tabIndex:Y?0:-1})]})}function ne(e,t){for(let t of e)t.collapsible&&H(t);let r=(e,t=!1)=>(e??[]).map(e=>Array.isArray(e.children)?{...e,children:r(e.children)}:{...e}).filter(e=>z(e)?t:(e.children?.length??0)>0||!!e.href),i=e.map(e=>({...e,items:B(r(e.items,!0))})).filter(e=>e.items.some(e=>!z(e))),a=[],o=e=>{for(let t of e)z(t)||(a.push(t),t.children&&o(t.children))};for(let e of i)o(e.items);for(let e of a)m(`AppShell items`,re(e)),p(`AppShell`,`match`,e.match,k),p(`AppShell`,`iconVariant`,e.iconVariant,N);let s=null;if(t!=null&&!a.some(e=>e.active===!0)){let e=-1;for(let r of a){if(r.active!=null||r.children?.length&&!r.href)continue;let i=n(t,r.href,{exact:r.match===`exact`,also:r.matchAlso});if(i<0)continue;let a=r.match===`exact`&&n(t,r.href,{exact:!0})>=0?1/0:i;a>e&&(e=a,s=r)}}for(let e of a)e.active=e.active??e===s;return i}function re(e){return Object.fromEntries(Object.entries(e).filter(([e])=>!P.has(e)))}var z=e=>e.header!=null;function B(e){return e.filter((t,n)=>{if(!z(t))return!0;let r=e.findIndex((e,t)=>t>n&&z(e));return e.slice(n+1,r<0?void 0:r).length>0})}var V=/* @__PURE__ */ new Set;function H(t){if(t.key!=null&&O.test(t.key))return;let n=t.key==null?`<AppShell> a collapsible group needs a key so its folded state can be remembered.`:`<AppShell> collapsible group key "${t.key}" must use lower-case letters, digits and hyphens.`,r=!0;try{r=process.env.NODE_ENV!==`production`}catch{r=!0}r&&!V.has(n)&&(V.add(n),e(n))}function ie(e){let t=[],n=e=>{for(let r of e)z(r)||(r.children?.length?n(r.children):t.push(r))};for(let t of e)n(t.items);let r=t.filter(e=>e.tab);if(r.length===0)return null;let i=r.length<t.length,a=i?E:D;if(r.length>a)throw Error(`<AppShell>: ${r.length} items carry tab: true, but the phone tab bar holds ${a} (${i?`4 plus More, because other items exist`:`5 when every item is a tab`}). Flag fewer items.`);return{tabs:r,hasMore:i,moreActive:t.some(e=>!e.tab&&e.active)}}function ae(e){let t=e=>({key:e.key??e.href??e.label,label:e.label,to:e.href,current:!!e.active}),n=e=>e.flatMap(e=>z(e)?[]:[...e.href?[{...t(e),icon:e.icon}]:[],...n(e.children??[])]),r=[];for(let i of e.flatMap(e=>e.items)){if(z(i))continue;let e=n(i.children??[]);if(e.length>0){let n=i.href?[{...t(i),icon:i.icon}]:[];r.push({key:t(i).key,label:i.label,links:[...n,...e]})}else i.href&&r.push(t(i))}return r}function oe({href:e,label:t,linkComponent:n,onNavigate:r,children:i}){return n?/* @__PURE__ */ C(n,{className:`wui-brand-link`,to:e,"aria-label":t,onClick:r,children:i}):/* @__PURE__ */ C(`a`,{className:`wui-brand-link`,href:e,"aria-label":t,onClick:r,children:i})}function se({tab:e,linkComponent:t,iconVariant:n}){let r=`wui-tabbar-item${e.active?` active`:``}`,i=/* @__PURE__ */ w(S,{children:[e.icon&&/* @__PURE__ */ C(`span`,{className:`wui-tabbar-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ C(d,{name:e.icon,size:24,variant:e.iconVariant??n}):e.icon}),/* @__PURE__ */ C(`span`,{className:`wui-tabbar-label`,children:e.tabLabel??e.label}),e.badge!=null&&/* @__PURE__ */ C(`span`,{className:`wui-tabbar-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge})]}),a=e.active?`page`:void 0;return t?/* @__PURE__ */ C(t,{className:r,to:e.href,"aria-current":a,children:i}):/* @__PURE__ */ C(`a`,{className:r,href:e.href,"aria-current":a,children:i})}function U(e){for(let t of e){if(t.active)return t;let e=t.children?.length?U(t.children):void 0;if(e)return e}}function ce({item:e,linkComponent:n,onNavigate:r,depth:i=0,iconVariant:a,newLabel:o,togglePagesLabel:s}){let c=i>0,l=i>1?` wui-nav-depth-${Math.min(i,6)}`:``,u=Array.isArray(e.children)&&e.children.length>0,f=u?U(e.children):void 0,p=!!f,m=f?f.key??f.href??f.label:null,[h,g]=x(p);_(()=>{m!=null&&g(!0)},[m]);let v=typeof e.label==`string`?e.label:void 0,y=!c&&e.icon&&/* @__PURE__ */ C(`span`,{className:`app-nav-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ C(d,{name:e.icon,size:e.iconSize??22,variant:e.iconVariant??a}):e.icon}),b=e.badge!=null&&/* @__PURE__ */ C(`span`,{className:`app-nav-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge}),T=L(e.newUntil)&&/* @__PURE__ */ C(`span`,{className:`wui-nav-new`,children:o}),E=/* @__PURE__ */ w(S,{children:[y,/* @__PURE__ */ C(`span`,{className:`app-nav-text`,children:e.label}),T,b,e.trailingIcon&&/* @__PURE__ */ C(`span`,{className:`app-nav-trailing`,children:typeof e.trailingIcon==`string`?/* @__PURE__ */ C(d,{name:e.trailingIcon,size:16}):e.trailingIcon})]}),D=e.active?`page`:void 0;if(u){let u=/* @__PURE__ */ C(`div`,{className:`app-nav-sub${h?` expanded`:``}`,inert:!h,"aria-hidden":!h||void 0,children:/* @__PURE__ */ C(`div`,{className:`app-nav-sub-inner`,children:e.children.map(e=>/* @__PURE__ */ C(ce,{item:e,linkComponent:n,onNavigate:r,depth:i+1,iconVariant:a,newLabel:o,togglePagesLabel:s},e.key??e.href))})});if(e.href){let i=n?/* @__PURE__ */ C(n,{className:`wui-nav-split-link`,to:e.href,"aria-current":D,onClick:r,children:E}):/* @__PURE__ */ C(`a`,{className:`wui-nav-split-link`,href:e.href,"aria-current":D,onClick:r,children:E});return/* @__PURE__ */ w(S,{children:[/* @__PURE__ */ w(`div`,{className:`app-nav-item has-children wui-nav-split${c?` app-nav-subitem`:``}${p||e.active?` active`:``}${l}`,"data-label":v,children:[i,/* @__PURE__ */ C(`button`,{type:`button`,className:`app-nav-caret wui-nav-split-toggle`,"aria-expanded":h,"aria-label":t(s,{name:v??``}),onClick:()=>g(e=>!e),children:/* @__PURE__ */ C(d,{name:`chevron-right`,size:16})})]}),u]})}return/* @__PURE__ */ w(S,{children:[/* @__PURE__ */ w(`button`,{type:`button`,className:`app-nav-item${c?` app-nav-subitem`:``} has-children${p?` active`:``}${l}`,"aria-expanded":h,"data-label":v,onClick:()=>g(e=>!e),children:[y,/* @__PURE__ */ C(`span`,{className:`app-nav-text`,children:e.label}),T,b,/* @__PURE__ */ C(`span`,{className:`app-nav-caret`,children:/* @__PURE__ */ C(d,{name:`chevron-right`,size:16})})]}),u]})}let O=`app-nav-item${c?` app-nav-subitem`:``}${e.active?` active`:``}${l}`;return n?/* @__PURE__ */ C(n,{className:O,to:e.href,"aria-current":D,"data-label":v,onClick:r,children:E}):/* @__PURE__ */ C(`a`,{className:O,href:e.href,"aria-current":D,"data-label":v,onClick:r,children:E})}function W(){let[e,t]=x(!1),n=b(null);return _(()=>{if(!e)return;let r=e=>{n.current?.contains(e.target)||t(!1)},i=e=>{e.key===`Escape`&&(t(!1),n.current?.querySelector(`button`)?.focus())};return document.addEventListener(`mousedown`,r),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`mousedown`,r),document.removeEventListener(`keydown`,i)}},[e]),{open:e,setOpen:t,ref:n}}function le({config:e,linkComponent:n,accountMenuLabel:r,roleLabel:i,rolesLabel:a}){let o=v(),{open:s,setOpen:c,ref:f}=W(),{name:m,role:h,roles:g=[],photo:_,profileHref:y,profileLabel:b=`My profile`,onLogout:x,logoutAction:T,logoutLabel:E=`Sign out`,head:D,section:O,logoutVariant:k=`item`,items:A=[]}=e;if(p(`AppShell`,`userMenu.logoutVariant`,k,[`item`,`button`]),!m)throw Error(`<AppShell> userMenu.name is required; the trigger and the avatar are named from it.`);let j=g.map(e=>(e??``).trim()).filter(Boolean),M=()=>c(!1),N=(e,t,r,i)=>n?/* @__PURE__ */ C(n,{className:`dropdown-item`,to:e,onClick:i,children:t},r):/* @__PURE__ */ C(`a`,{className:`dropdown-item`,href:e,onClick:i,children:t},r),P=/* @__PURE__ */ C(d,{name:`log-out`,size:18}),F=/* @__PURE__ */ w(S,{children:[P,E]});return/* @__PURE__ */ w(`div`,{className:`dropdown wui-usermenu`,ref:f,children:[/* @__PURE__ */ w(`button`,{type:`button`,id:o,className:`wui-usermenu-trigger`,"aria-expanded":s,"aria-label":t(r,{name:m}),onClick:()=>c(e=>!e),children:[/* @__PURE__ */ C(l,{name:m,src:_,tone:`auto`}),/* @__PURE__ */ w(`span`,{className:`wui-usermenu-text`,children:[/* @__PURE__ */ C(`span`,{className:`wui-usermenu-name`,children:m}),h&&/* @__PURE__ */ C(`span`,{className:`wui-usermenu-role`,children:h})]}),/* @__PURE__ */ C(d,{name:`chevron-down`,size:14,className:`wui-usermenu-caret`})]}),/* @__PURE__ */ w(`div`,{className:`dropdown-menu dropdown-menu-end wui-usermenu-menu${s?` show`:``}`,"aria-labelledby":o,"data-bs-popper":s?`static`:void 0,children:[/* @__PURE__ */ w(`div`,{className:`wui-usermenu-head`,children:[/* @__PURE__ */ C(l,{name:m,src:_,size:`lg`,tone:`auto`}),/* @__PURE__ */ w(`div`,{className:`wui-usermenu-who`,children:[/* @__PURE__ */ C(`div`,{className:`wui-usermenu-name`,children:m}),h&&/* @__PURE__ */ C(`div`,{className:`wui-usermenu-role`,children:h}),j.length>0&&/* @__PURE__ */ w(`div`,{className:`wui-usermenu-roles`,children:[/* @__PURE__ */ C(`span`,{className:`wui-usermenu-roles-label`,children:j.length===1?i:a}),` ${j.join(`, `)}`]}),D?/* @__PURE__ */ C(`div`,{className:`wui-usermenu-extra`,children:D}):null]})]}),O?/* @__PURE__ */ C(`div`,{className:`wui-usermenu-section`,children:O}):null,y&&N(y,/* @__PURE__ */ w(S,{children:[/* @__PURE__ */ C(d,{name:`user`,size:18}),b]}),void 0,M),A.map(e=>{if(e.divider)return/* @__PURE__ */ C(`hr`,{className:`dropdown-divider`},e.key);let t=/* @__PURE__ */ w(S,{children:[e.icon&&/* @__PURE__ */ C(d,{name:e.icon,size:18}),e.label]}),n=()=>{e.onClick?.(),M()};return e.href?N(e.href,t,e.key,n):/* @__PURE__ */ C(`button`,{type:`button`,className:`dropdown-item`,onClick:n,children:t},e.key)}),k===`button`?(T||x)&&/* @__PURE__ */ C(`div`,{className:`wui-usermenu-foot`,children:T?/* @__PURE__ */ C(`form`,{method:`post`,action:T,className:`wui-usermenu-logout`,children:/* @__PURE__ */ C(u,{type:`submit`,tone:`danger`,variant:`soft`,block:!0,leftIcon:P,children:E})}):/* @__PURE__ */ C(u,{type:`button`,tone:`danger`,variant:`soft`,block:!0,leftIcon:P,onClick:()=>{M(),x()},children:E})}):T?/* @__PURE__ */ C(`form`,{method:`post`,action:T,className:`wui-usermenu-logout`,children:/* @__PURE__ */ C(`button`,{type:`submit`,className:`dropdown-item danger`,children:F})}):x&&/* @__PURE__ */ C(`button`,{type:`button`,className:`dropdown-item danger`,onClick:()=>{M(),x()},children:F})]})]})}function ue({config:e,unreadLabel:n,markAllReadLabel:r,viewAllLabel:i,loadingNotificationsText:a,noUnreadText:o,unreadNotificationsText:s,unreadBellLabel:c}){let l=v(),{open:u,setOpen:f,ref:p}=W(),{unread:m=0,items:h,loading:g=!1,onOpen:y,onMarkAllRead:T,viewAllHref:E,label:D=`Notifications`,emptyText:O=`You are all caught up.`}=e,[k,A]=x(``),j=b(m);_(()=>{j.current!==m&&(j.current=m,A(m===0?o:t(s,{count:F(m)})))},[m,o,s]);let M=null;return h?.length?M=/* @__PURE__ */ C(`div`,{className:`wui-bell-items`,children:h.map((e,t)=>{let r=`wui-bell-item${e.read?` wui-bell-item-read`:``}`,i=/* @__PURE__ */ w(S,{children:[/* @__PURE__ */ C(`span`,{className:`wui-bell-dot`,"aria-hidden":`true`}),e.icon&&/* @__PURE__ */ C(`span`,{className:`wui-bell-icon`,children:/* @__PURE__ */ C(d,{name:e.icon,size:18})}),/* @__PURE__ */ w(`span`,{className:`wui-bell-body`,children:[!e.read&&/* @__PURE__ */ w(`span`,{className:`visually-hidden`,children:[n,`: `]}),/* @__PURE__ */ C(`span`,{className:`wui-bell-item-title`,children:e.title}),e.time&&/* @__PURE__ */ C(`span`,{className:`wui-bell-when`,children:e.time})]})]});return e.href?/* @__PURE__ */ C(`a`,{className:r,href:e.href,"data-id":e.id,children:i},e.id??t):/* @__PURE__ */ C(`div`,{className:r,"data-id":e.id,children:i},e.id??t)})}):g?M=/* @__PURE__ */ C(`div`,{className:`wui-bell-state`,children:a}):h&&(M=/* @__PURE__ */ C(`div`,{className:`wui-bell-state`,children:O})),/* @__PURE__ */ w(`div`,{className:`dropdown wui-bell`,ref:p,children:[/* @__PURE__ */ w(`button`,{type:`button`,id:l,className:`topbar-icon-btn wui-bell-trigger`,"aria-expanded":u,"aria-label":m===0?D:t(c,{label:D,count:F(m)}),onClick:()=>{let e=!u;f(e),e&&y?.()},children:[/* @__PURE__ */ C(d,{name:`notification`,size:20}),/* @__PURE__ */ C(`span`,{className:`wui-bell-count`,"aria-hidden":`true`,hidden:m===0,children:F(m)})]}),/* @__PURE__ */ C(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:k}),/* @__PURE__ */ w(`div`,{className:`dropdown-menu dropdown-menu-end wui-bell-menu${u?` show`:``}`,"aria-labelledby":l,"data-bs-popper":u?`static`:void 0,children:[/* @__PURE__ */ w(`div`,{className:`wui-bell-head`,children:[/* @__PURE__ */ C(`span`,{className:`wui-bell-title`,children:D}),T&&/* @__PURE__ */ C(`button`,{type:`button`,className:`wui-bell-markall`,onClick:T,children:r})]}),/* @__PURE__ */ C(`div`,{className:`wui-bell-list`,"aria-busy":g||void 0,children:M}),E&&/* @__PURE__ */ C(`a`,{className:`wui-bell-foot`,href:E,children:i})]})]})}var G=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function de({config:e,searchResultsLabel:n,noResultsText:r,noResultsForText:i,resultsCountText:a,resultCountText:o}){let s=v(),{value:c=``,onChange:l,results:u=null,loading:f=!1,onSelect:p,onSubmit:m,onFocus:h,placeholder:g=`Search`}=e,[S,T]=x(!1),[E,D]=x(!1),[O,k]=x({results:null,index:-1}),A=O.results===u?O.index:-1,j=e=>k({results:u,index:e}),M=b(null),N=b(null),P=b([]),F=y(()=>(u??[]).flatMap(e=>e.hits??[]),[u]),I=u!=null&&!E,L=F.length;_(()=>{let e=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||G(e.target)||(e.preventDefault(),T(!0),N.current?.focus())},t=e=>{M.current?.contains(e.target)||(D(!0),T(!1))};return document.addEventListener(`keydown`,e),document.addEventListener(`pointerdown`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`pointerdown`,t)}},[]);let ee=e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(!I||L===0)return;e.preventDefault(),j((A+(e.key===`ArrowDown`?1:-1)+L)%L)}else e.key===`Enter`?I&&A>=0&&P.current[A]?(e.preventDefault(),P.current[A].click()):m&&c.trim()!==``&&(e.preventDefault(),m(c.trim())):e.key===`Escape`&&(I?(e.preventDefault(),D(!0)):S&&(e.preventDefault(),T(!1)))},R=-1;return P.current=[],/* @__PURE__ */ w(`div`,{className:`wui-topsearch${S?` is-open`:``}${f?` is-loading`:``}`,ref:M,children:[/* @__PURE__ */ C(`button`,{type:`button`,className:`topbar-icon-btn wui-topsearch-open`,"aria-label":g,"aria-expanded":S,"aria-controls":`${s}-panel`,onClick:()=>{let e=!S;T(e),e&&N.current?.focus()},children:/* @__PURE__ */ C(d,{name:`search`,size:20})}),/* @__PURE__ */ w(`div`,{className:`wui-topsearch-panel`,id:`${s}-panel`,children:[/* @__PURE__ */ w(`div`,{className:`search-wrap`,children:[/* @__PURE__ */ C(d,{name:`search`,size:18,className:`search-icon`}),/* @__PURE__ */ C(`input`,{ref:N,type:`search`,className:`form-control input search-input`,id:`${s}-input`,placeholder:g,"aria-label":g,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":I,"aria-controls":`${s}-list`,"aria-activedescendant":I&&A>=0?`${s}-opt-${A}`:void 0,autoComplete:`off`,value:c,onChange:e=>{D(!1),l?.(e.target.value)},onKeyDown:ee,onFocus:h})]}),/* @__PURE__ */ C(`div`,{className:`wui-topsearch-results`,id:`${s}-list`,role:`listbox`,"aria-label":n,hidden:!I,children:I&&/* @__PURE__ */ w(`div`,{className:`wui-topsearch-groups`,role:`presentation`,children:[L===0&&/* @__PURE__ */ C(`div`,{className:`wui-topsearch-empty`,role:`option`,"aria-disabled":`true`,"aria-selected":`false`,children:t(i,{value:c})}),u.filter(e=>e.hits?.length).map((e,t)=>/* @__PURE__ */ w(`div`,{className:`wui-topsearch-group`,role:`group`,"aria-label":e.label??``,children:[e.label&&/* @__PURE__ */ C(`div`,{className:`wui-topsearch-group-label`,role:`presentation`,children:e.label}),e.hits.map(e=>{R+=1;let t=R;return/* @__PURE__ */ w(`a`,{className:`wui-topsearch-hit${t===A?` is-active`:``}`,role:`option`,"aria-selected":t===A,id:`${s}-opt-${t}`,href:e.href,ref:e=>{P.current[t]=e},onClick:t=>p?.(e,t),children:[e.icon&&/* @__PURE__ */ C(`span`,{className:`wui-topsearch-hit-icon`,children:/* @__PURE__ */ C(d,{name:e.icon,size:18})}),/* @__PURE__ */ w(`span`,{className:`wui-topsearch-hit-text`,children:[/* @__PURE__ */ C(`span`,{className:`wui-topsearch-hit-title`,children:e.title}),e.subtitle&&/* @__PURE__ */ C(`span`,{className:`wui-topsearch-hit-sub`,children:e.subtitle})]})]},`${e.href}-${t}`)})]},e.label??t))]})})]}),/* @__PURE__ */ C(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:I?L===0?r:t(L===1?o:a,{count:L}):``})]})}export{te as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../lib/fillLabel.js";import{linkTarget as t}from"../lib/linkTarget.js";import{TONES as n}from"../lib/vocabulary.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppIcon.js";import a from"./
|
|
1
|
+
import e from"../lib/fillLabel.js";import{linkTarget as t}from"../lib/linkTarget.js";import{TONES as n}from"../lib/vocabulary.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppIcon.js";import a from"./AppMarkdown.js";import o from"./assertValidValue.js";import s from"./warnUnknownProps.js";import{jsx as c,jsxs as l}from"react/jsx-runtime";var u=[`feed`,`progress`,`steps`],d=[`vertical`,`horizontal`],f=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],p=n.filter(e=>e!==`primary`),m=[`sm`,`md`,`lg`],h={done:`check`,current:`clock`,"on-hold":`lock`,rejected:`x`,cancelled:`minus`,skipped:`arrow-right`,upcoming:null},g=e=>typeof e==`string`&&(/^https?:[/][/]/i.test(e)||e.startsWith(`/`)&&e[1]!==`/`&&e[1]!==`\\`)&&![...e].some(e=>e.charCodeAt(0)<=32||e.charCodeAt(0)===127);function _(e){if(e.byHref!=null&&e.byHref!==``){if(!g(e.byHref))throw Error(`<AppTimeline> items[].byHref must be a path starting with one '/', or an http:// or https:// address, with no spaces.`);if(!e.by)throw Error(`<AppTimeline> items[].byHref links the by name, so the item needs by.`)}}var v=(e,n)=>{if(!e.byHref)return e.by;let{Tag:r,linkProps:i}=t(n,{href:e.byHref});return/* @__PURE__ */ c(r,{className:`timeline-by-link`,...i,children:e.by})},y=(e,t)=>t?/* @__PURE__ */ c(a,{value:e.description,headings:`text`}):e.description,b=(e,t)=>t?/* @__PURE__ */ c(`div`,{className:`timeline-note wui-timeline-note--markdown`,children:/* @__PURE__ */ c(a,{value:e.note,headings:`text`})}):/* @__PURE__ */ c(`p`,{className:`timeline-note`,children:e.note});function x(t){let{marker:n,props:a}=r(`AppTimeline`,t),{items:g=[],variant:x=`feed`,orientation:S,iconVariant:C,size:w,linkComponent:T,className:E=``,style:D,stepLabel:O=`Step {number}`,markdown:k=!1,...A}=a;s(`AppTimeline`,A),o(`AppTimeline`,`variant`,x,u),o(`AppTimeline`,`orientation`,S,d),o(`AppTimeline`,`iconVariant`,C,f),o(`AppTimeline`,`size`,typeof w==`string`?w:null,m);for(let e of g){if(k){for(let t of[`description`,`note`])if(e[t]!=null&&typeof e[t]!=`string`)throw TypeError(`<AppTimeline> items[].${t} must be a string when markdown is set, because it is Markdown source.`)}o(`AppTimeline`,`items[].tone`,e.tone,p),_(e),x===`progress`&&o(`AppTimeline`,`items[].status`,e.status,Object.keys(h))}let j=x===`progress`,M=x===`steps`,N=S===`horizontal`,P=C??(M?`bulk`:void 0),F=typeof w==`string`&&m.includes(w)?w:`md`,I=typeof w==`number`&&w>0?w:void 0,L=!I&&F!==`md`?` wui-timeline--${F}`:``,R=`${M?`timeline wui-timeline--steps${S===`vertical`?` wui-timeline--steps-vertical`:``}`:`timeline${j?` timeline--progress`:``}${N?` timeline--horizontal`:``}`}${L}${E?` ${E}`:``}`,z=M?I?Math.round(I*.43):{sm:19,md:24,lg:31}[F]:I?Math.round(I*.54):j?{sm:10,md:13,lg:17}[F]:{sm:10,md:12,lg:17}[F],B=I?{...D,"--wui-timeline-dot":`${I}px`}:D;return/* @__PURE__ */ c(`ol`,{className:R,style:B,...n,...A,children:g.map((t,n)=>{let r=t.tone&&t.tone!==`neutral`?` ${t.tone}`:``;if(M){let a=t.eyebrow??e(O,{number:n+1});return/* @__PURE__ */ l(`li`,{className:`timeline-item${r}`,children:[/* @__PURE__ */ c(`span`,{className:`timeline-dot`,children:t.icon?/* @__PURE__ */ c(i,{name:t.icon,size:z,variant:P}):null}),/* @__PURE__ */ l(`div`,{className:`timeline-body`,children:[a!==``&&/* @__PURE__ */ c(`div`,{className:`wui-timeline-eyebrow`,children:a}),/* @__PURE__ */ c(`div`,{className:`timeline-title`,children:t.title}),t.description&&/* @__PURE__ */ c(`div`,{className:`timeline-desc`,children:y(t,k)})]})]},t.key??`${t.at}-${n}`)}let a=j?t.status:void 0,o=a?` is-${a}`:``,s=j?t.icon??(a?h[a]:void 0):t.icon||`circle`;return/* @__PURE__ */ l(`li`,{className:`timeline-item${o}${r}`,children:[/* @__PURE__ */ c(`span`,{className:`timeline-dot`,children:s?/* @__PURE__ */ c(i,{name:s,size:z,variant:P}):null}),/* @__PURE__ */ l(`div`,{className:`timeline-body`,children:[j?/* @__PURE__ */ l(`div`,{className:`timeline-head`,children:[/* @__PURE__ */ c(`div`,{className:`timeline-title`,children:t.title}),(t.at||t.time)&&/* @__PURE__ */ l(`span`,{className:`timeline-when`,children:[t.at&&/* @__PURE__ */ c(`span`,{className:`timeline-at`,title:t.atTitle||void 0,children:t.at}),t.time&&/* @__PURE__ */ c(`span`,{className:`timeline-time`,children:t.time})]})]}):/* @__PURE__ */ c(`div`,{className:`timeline-title`,children:t.title}),t.description&&/* @__PURE__ */ c(`div`,{className:`timeline-desc`,children:y(t,k)}),!j&&(t.at||t.time||t.by)&&/* @__PURE__ */ l(`div`,{className:`timeline-meta`,children:[(t.at||t.time)&&/* @__PURE__ */ l(`span`,{className:`timeline-when`,children:[t.at&&/* @__PURE__ */ c(`span`,{className:`timeline-at`,title:t.atTitle||void 0,children:t.at}),t.time&&/* @__PURE__ */ c(`span`,{className:`timeline-time`,children:t.time})]}),t.by&&/* @__PURE__ */ c(`span`,{className:`timeline-by`,children:v(t,T)})]}),j&&t.by&&/* @__PURE__ */ c(`div`,{className:`timeline-meta`,children:/* @__PURE__ */ c(`span`,{className:`timeline-by`,children:v(t,T)})}),t.note&&b(t,k)]})]},t.key??`${t.at}-${n}`)})})}export{x as default};
|
package/dist/guidance.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CITATION_RUN as e}from"./citations.js";var t=/* @__PURE__ */ new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`),n=/\[([^\]\n]+)\]\(((?:[^()\s]|\([^()\s]*\))+)\)/y,r=/!\[([^\]\n]*)\]\(((?:[^()\s]|\([^()\s]*\))+)\)/y,i=new RegExp(e.source,`y`),a=e=>/[\p{L}\p{N}]/u.test(e);function o(e,t){let n=0;for(let r=t-1;r>=0&&e.charAt(r)===`\\`;--r)n+=1;return n%2==1}function s(e,t,n){let r=n.length===1;for(let i=e.indexOf(n,t);i!==-1;i=e.indexOf(n,i+1)){let s=i>t&&!/\s/.test(e.charAt(t))&&!/\s/.test(e.charAt(i-1)),c=r&&(e.charAt(i+1)===n||e.charAt(i-1)===n),l=n===`_`&&a(e.charAt(i+n.length));if(s&&!c&&!l&&!o(e,i))return i}return-1}function c(e,o){let l=o?.isCitation,u=[],d=``,f=()=>{d&&=(u.push({type:`text`,text:d}),``)},p=0;for(;p<e.length;){let m=e.charAt(p),h=e.charAt(p+1);if(m===`\\`&&t.has(h)){d+=h,p+=2;continue}if(m==="`"){let t=e.indexOf("`",p+1);if(t>p+1){f(),u.push({type:`code`,text:e.slice(p+1,t)}),p=t+1;continue}}let g=m+h;if(g===`**`||g===`__`||g===`~~`){let t=s(e,p+2,g);if(t!==-1&&!(g===`__`&&a(e.charAt(p-1)))){f();let n=c(e.slice(p+2,t),o);g===`~~`?u.push({type:`strike`,children:n}):u.push({type:`strong`,children:n}),p=t+2;continue}d+=g,p+=2}else{if(m===`*`||m===`_`){let t=s(e,p+1,m);if(t!==-1&&!(m===`_`&&a(e.charAt(p-1)))){f(),u.push({type:`em`,children:c(e.slice(p+1,t),o)}),p=t+1;continue}}if(m===`[`){n.lastIndex=p;let t=n.exec(e);if(t){f(),u.push({type:`link`,href:
|
|
1
|
+
import{CITATION_RUN as e}from"./citations.js";var t=/* @__PURE__ */ new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`),n=/\[([^\]\n]+)\]\(((?:[^()\s]|\([^()\s]*\))+)\)/y,r=/!\[([^\]\n]*)\]\(((?:[^()\s]|\([^()\s]*\))+)\)/y,i=new RegExp(e.source,`y`),a=e=>/[\p{L}\p{N}]/u.test(e);function o(e,t){let n=0;for(let r=t-1;r>=0&&e.charAt(r)===`\\`;--r)n+=1;return n%2==1}function s(e,t,n){let r=n.length===1;for(let i=e.indexOf(n,t);i!==-1;i=e.indexOf(n,i+1)){let s=i>t&&!/\s/.test(e.charAt(t))&&!/\s/.test(e.charAt(i-1)),c=r&&(e.charAt(i+1)===n||e.charAt(i-1)===n),l=n===`_`&&a(e.charAt(i+n.length));if(s&&!c&&!l&&!o(e,i))return i}return-1}function c(e,o){let l=o?.isCitation,u=[],d=``,f=()=>{d&&=(u.push({type:`text`,text:d}),``)},p=0;for(;p<e.length;){let m=e.charAt(p),h=e.charAt(p+1);if(m===`\\`&&t.has(h)){d+=h,p+=2;continue}if(m==="`"){let t=e.indexOf("`",p+1);if(t>p+1){f(),u.push({type:`code`,text:e.slice(p+1,t)}),p=t+1;continue}}let g=m+h;if(g===`**`||g===`__`||g===`~~`){let t=s(e,p+2,g);if(t!==-1&&!(g===`__`&&a(e.charAt(p-1)))){f();let n=c(e.slice(p+2,t),o);g===`~~`?u.push({type:`strike`,children:n}):u.push({type:`strong`,children:n}),p=t+2;continue}d+=g,p+=2}else{if(m===`*`||m===`_`){let t=s(e,p+1,m);if(t!==-1&&!(m===`_`&&a(e.charAt(p-1)))){f(),u.push({type:`em`,children:c(e.slice(p+1,t),o)}),p=t+1;continue}}if(m===`[`){n.lastIndex=p;let t=n.exec(e);if(t){let e=t[1],n=t[2];if(e===void 0||n===void 0)throw Error(`The link pattern always captures its label and href`);f(),u.push({type:`link`,href:n,children:c(e)}),p+=t[0].length;continue}if(l){i.lastIndex=p;let t=i.exec(e);if(t){let e=t[1];if(e===void 0)throw Error(`The citation pattern always captures its inner text`);if(l(e)){f(),u.push({type:`citation`,text:e}),p+=t[0].length;continue}}}}if(m===`!`){r.lastIndex=p;let t=r.exec(e);if(t){let e=t[1];if(e===void 0)throw Error(`The image pattern always captures its alt text`);f(),u.push({type:`image`,children:c(e)}),p+=t[0].length;continue}}d+=m,p+=1}}return f(),u.map((e,t)=>({...e,key:t}))}export{c as parseInline};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var e=/^\s*```/,t=/^\s*```\s*(\S*)/,n=/^\s{0,3}(#{1,6})\s+(.*?)(?:\s+#+)?\s*$/,r=/^\s*([-*_])(\s*\1){2,}\s*$/,i=/^(\s*)[-*+]\s+(.*)$/,a=/^(\s*)(\d{1,9})[.)]\s+(.*)$/,o=/^\s*>\s?(.*)$/,s=/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)*\|?\s*$/,c=e=>e.includes(`|`);function l(e){let t=e.trim();return t.startsWith(`|`)&&(t=t.slice(1)),t.endsWith(`|`)&&(t=t.slice(0,-1)),t.split(`|`).map(e=>e.trim())}function u(e,t){
|
|
1
|
+
var e=/^\s*```/,t=/^\s*```\s*(\S*)/,n=/^\s{0,3}(#{1,6})\s+(.*?)(?:\s+#+)?\s*$/,r=/^\s*([-*_])(\s*\1){2,}\s*$/,i=/^(\s*)[-*+]\s+(.*)$/,a=/^(\s*)(\d{1,9})[.)]\s+(.*)$/,o=/^\s*>\s?(.*)$/,s=/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)*\|?\s*$/,c=e=>e.includes(`|`);function l(e){let t=e.trim();return t.startsWith(`|`)&&(t=t.slice(1)),t.endsWith(`|`)&&(t=t.slice(0,-1)),t.split(`|`).map(e=>e.trim())}function u(e,t){let n=e[t];if(n===void 0)throw Error(`startsTable was called past the last source line`);let r=e[t+1];return r!==void 0&&c(n)&&r.includes(`|`)&&s.test(r)}function d(t,s){let c=t[s];if(c===void 0)throw Error(`startsBlock was called past the last source line`);return e.test(c)||o.test(c)||i.test(c)||a.test(c)||n.test(c)||r.test(c)||u(t,s)}function f(e){let t=e.replace(/\t/g,` `).length;return Math.min(Math.floor(t/2),4)}function p(e){let t=a.exec(e);if(t){let e=t[1],n=t[2],r=t[3];if(e===void 0||n===void 0||r===void 0)throw Error(`The ordered list pattern always captures its indent, number and text`);return{text:r,depth:f(e),ordered:!0,number:Number(n)}}let n=i.exec(e);if(n){let e=n[1],t=n[2];if(e===void 0||t===void 0)throw Error(`The bullet list pattern always captures its indent and text`);return{text:t,depth:f(e),ordered:!1,number:0}}return null}function m(i){let a=(i??``).replace(/\r\n?/g,`
|
|
2
2
|
`).split(`
|
|
3
|
-
`),s=[],f=0;for(;f<a.length;){let i=a[f];if(!i.trim()){f+=1;continue}if(e.test(i)){let n=t.exec(i)?.[1]||null,r=[];for(f+=1;f<a.length
|
|
4
|
-
`),language:n});continue}if(u(a,f)){let e=l(i),t=[];for(f+=2;f<a.length
|
|
3
|
+
`),s=[],f=0;for(;f<a.length;){let i=a[f];if(i===void 0)throw Error(`parseMarkdown read past the last source line`);if(!i.trim()){f+=1;continue}if(e.test(i)){let n=t.exec(i)?.[1]||null,r=[];for(f+=1;f<a.length;){let t=a[f];if(t===void 0)throw Error(`parseMarkdown read past the last source line`);if(e.test(t))break;r.push(t),f+=1}f+=1,s.push({type:`code`,text:r.join(`
|
|
4
|
+
`),language:n});continue}if(u(a,f)){let e=l(i),t=[];for(f+=2;f<a.length;){let e=a[f];if(e===void 0)throw Error(`parseMarkdown read past the last source line`);if(!e.trim()||!c(e))break;t.push(l(e)),f+=1}s.push({type:`table`,header:e,rows:t});continue}if(r.test(i)){s.push({type:`rule`}),f+=1;continue}let m=n.exec(i);if(m){let e=m[1],t=m[2];if(e===void 0||t===void 0)throw Error(`The heading pattern always captures its hashes and text`);s.push({type:`heading`,level:e.length,text:t}),f+=1;continue}if(o.test(i)){let e=[];for(;f<a.length;){let t=a[f];if(t===void 0)throw Error(`parseMarkdown read past the last source line`);let n=o.exec(t);if(!n)break;let r=n[1];if(r===void 0)throw Error(`The quote pattern always captures its text`);e.push(r),f+=1}s.push({type:`quote`,lines:e});continue}let h=p(i);if(h){let e=[];for(;f<a.length;){let t=a[f];if(t===void 0)throw Error(`parseMarkdown read past the last source line`);if(!t.trim())break;let n=p(t);if(n){if(n.depth===0&&n.ordered!==h.ordered)break;e.push(n)}else if(d(a,f))break;else{let n=e[e.length-1];if(n===void 0)throw Error(`A list continuation line follows a list with no item`);n.text+=` ${t.trim()}`}f+=1}s.push({type:`list`,ordered:h.ordered,start:h.ordered?h.number:1,items:e});continue}let g=[i];for(f+=1;f<a.length;){let e=a[f];if(e===void 0)throw Error(`parseMarkdown read past the last source line`);if(!e.trim()||d(a,f))break;g.push(e),f+=1}s.push({type:`paragraph`,lines:g})}return s.map((e,t)=>({...e,key:t}))}export{m as parseMarkdown};
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
* @param {string|import('react').ReactNode} [props.avatar]
|
|
20
20
|
* @param {() => void} [props.onRemove] Present → shows the dismiss ✕.
|
|
21
21
|
* @param {() => void} [props.onClick] Present → the chip body is clickable.
|
|
22
|
+
* @param {boolean} [props.selected] With onClick: true marks the chip as the chosen filter (aria-pressed). Needs onClick.
|
|
23
|
+
* @param {number|import('react').ReactNode} [props.count] A count shown after the label, such as a filter's result count.
|
|
22
24
|
* @param {boolean} [props.disabled]
|
|
23
25
|
* @param {string} [props.removeLabel]
|
|
24
26
|
* @param {string} [props.className]
|
|
@@ -48,6 +50,10 @@ export default function AppChip(props: {
|
|
|
48
50
|
avatar?: string | import('react').ReactNode;
|
|
49
51
|
onRemove?: () => void;
|
|
50
52
|
onClick?: () => void;
|
|
53
|
+
/** With onClick, true marks the chip as the chosen filter (its button carries aria-pressed). Needs onClick; a chip that is not clickable refuses it. */
|
|
54
|
+
selected?: boolean;
|
|
55
|
+
/** A count shown after the label, such as a filter's result count. */
|
|
56
|
+
count?: number | import('react').ReactNode;
|
|
51
57
|
/**
|
|
52
58
|
* Dims the chip and stops it from being pressed.
|
|
53
59
|
* @default false
|
|
@@ -69,8 +69,8 @@ export type CommentThreadItem = {
|
|
|
69
69
|
*
|
|
70
70
|
* The comments are yours: each callback persists a change and the thread waits for it, then you
|
|
71
71
|
* pass the updated `comments` back. Throw (or reject) with a message written for the person and it
|
|
72
|
-
* shows where they acted. Bodies are stored mention values (`Thanks @[Asha Rao](u-12)`)
|
|
73
|
-
*
|
|
72
|
+
* shows where they acted. Bodies are stored mention values (`Thanks @[Asha Rao](u-12)`). They render
|
|
73
|
+
* as text by default and as Markdown when `markdown` is set; never as HTML.
|
|
74
74
|
*
|
|
75
75
|
* Wraps the shared `<wui-comment-thread>` element, which owns the boxes, keys and states; Razor
|
|
76
76
|
* `<app-comment-thread>` renders the same markup.
|
|
@@ -111,6 +111,7 @@ export type CommentThreadItem = {
|
|
|
111
111
|
* @param {string} [props.postLabel] The post button's text; without it "Comment".
|
|
112
112
|
* @param {number} [props.composerRows] The composer box's rows; without it 3 stacked and 1 inline.
|
|
113
113
|
* @param {boolean} [props.readOnly]
|
|
114
|
+
* @param {boolean} [props.markdown] Draws each comment body as Markdown through the shared Markdown element, which never renders raw HTML. A mention then reads as plain "@Name" text. Default false: plain text.
|
|
114
115
|
* @param {import('react').ElementType} [props.linkComponent] Router link (e.g. react-router Link) for in-app destinations; it receives `to` instead of `href`. Absolute, `#` and scheme hrefs stay plain anchors. Keeps the library router-agnostic.
|
|
115
116
|
* @param {string} [props.label]
|
|
116
117
|
* @param {string} [props.internalLabel] Default "Internal note".
|
|
@@ -194,6 +195,11 @@ export default function AppCommentThread(props: {
|
|
|
194
195
|
* @default false
|
|
195
196
|
*/
|
|
196
197
|
readOnly?: boolean;
|
|
198
|
+
/**
|
|
199
|
+
* Draws each comment body as Markdown (bold, italics, lists, links, code); raw HTML shows as text and a mention reads as plain @Name. Unset, bodies show as plain text.
|
|
200
|
+
* @default false
|
|
201
|
+
*/
|
|
202
|
+
markdown?: boolean;
|
|
197
203
|
linkComponent?: import('react').ElementType;
|
|
198
204
|
/**
|
|
199
205
|
* The list's accessible name.
|
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
* @param {string} [props.toggleClassName]
|
|
15
15
|
* @param {"neutral"} [props.toggleVariant] A custom trigger that keeps the surrounding font and colour, with a
|
|
16
16
|
* muted fill on hover and while open. Needs `trigger`.
|
|
17
|
-
* @param {"sm"|"md"|"lg"} [props.menuWidth] A fixed menu width (15, 20 or 25rem
|
|
18
|
-
* widening the menu. Unset, the menu
|
|
17
|
+
* @param {"sm"|"md"|"lg"|"fit"} [props.menuWidth] A fixed menu width (15, 20 or 25rem; long rows wrap instead of
|
|
18
|
+
* widening the menu), or fit: no minimum, the menu is as wide as its widest row. Unset, the menu is at least
|
|
19
|
+
* 12rem wide.
|
|
19
20
|
* @param {string} [props.label]
|
|
20
21
|
* @param {"start"|"end"} [props.align]
|
|
21
22
|
* @param {string} [props.ariaLabel]
|
|
@@ -43,8 +44,8 @@ export default function AppDropdown(props: {
|
|
|
43
44
|
toggleClassName?: string;
|
|
44
45
|
/** neutral: a custom trigger that keeps the surrounding font and colour, with a muted fill on hover and while open. Needs trigger. */
|
|
45
46
|
toggleVariant?: "neutral";
|
|
46
|
-
/** A fixed menu width (15, 20 or 25rem
|
|
47
|
-
menuWidth?: "sm" | "md" | "lg";
|
|
47
|
+
/** A fixed menu width (15, 20 or 25rem; long rows wrap instead of widening the menu), or fit: no minimum, the menu is as wide as its widest row. Unset, the menu is at least 12rem wide. */
|
|
48
|
+
menuWidth?: "sm" | "md" | "lg" | "fit";
|
|
48
49
|
/** Tooltip and accessible name fallback for the toggle. */
|
|
49
50
|
label?: string;
|
|
50
51
|
/**
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @param {import('react').ReactNode} [props.caption]
|
|
9
9
|
* @param {string|import('react').ReactNode} [props.icon]
|
|
10
10
|
* @param {'primary'|'success'|'warning'|'danger'|'info'|'neutral'} [props.iconTone]
|
|
11
|
-
* @param {'linear'|'outline'|'bold'|'bulk'|'broken'|'twotone'} [props.iconVariant]
|
|
11
|
+
* @param {'linear'|'outline'|'bold'|'bulk'|'broken'|'twotone'} [props.iconVariant='twotone']
|
|
12
12
|
* @param {import('react').ReactNode} [props.delta]
|
|
13
13
|
* @param {'up'|'down'|'flat'} [props.deltaDirection]
|
|
14
14
|
* @param {'success'|'danger'|'neutral'} [props.deltaTone]
|
|
@@ -43,7 +43,7 @@ export default function AppKpiTile(props: {
|
|
|
43
43
|
iconTone?: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'neutral';
|
|
44
44
|
/**
|
|
45
45
|
* The icon style of a named icon; a node icon is drawn as given.
|
|
46
|
-
* @default "
|
|
46
|
+
* @default "twotone"
|
|
47
47
|
*/
|
|
48
48
|
iconVariant?: 'linear' | 'outline' | 'bold' | 'bulk' | 'broken' | 'twotone';
|
|
49
49
|
/** The change text, such as 12% vs last month. */
|
|
@@ -157,6 +157,18 @@ declare const AppSelect: import("react").ForwardRefExoticComponent<{
|
|
|
157
157
|
* @default "All countries"
|
|
158
158
|
*/
|
|
159
159
|
allCountriesLabel?: string;
|
|
160
|
+
/** Single, search, multiple and country modes: a localStorage key to remember the options a person chooses on this device. The open list shows them first, under a Recent heading, while the search box is empty. Build it per user, for example from the user's public id. Only options still in the list show, so a search that fetches its options per query shows none. Not used in tag mode. */
|
|
161
|
+
recentsKey?: string;
|
|
162
|
+
/**
|
|
163
|
+
* How many recent options to show and keep, 1 to 20.
|
|
164
|
+
* @default 5
|
|
165
|
+
*/
|
|
166
|
+
recentsLimit?: number;
|
|
167
|
+
/**
|
|
168
|
+
* The heading of the recent options.
|
|
169
|
+
* @default "Recent"
|
|
170
|
+
*/
|
|
171
|
+
recentsLabel?: string;
|
|
160
172
|
/** Disables the control. */
|
|
161
173
|
disabled?: boolean;
|
|
162
174
|
/**
|
|
@@ -221,6 +221,8 @@ export type SearchShape = {
|
|
|
221
221
|
* @param {string} [props.markLight] Image URL of the square mark shown on the collapsed rail.
|
|
222
222
|
* @param {string} [props.markDark] Dark-mode twin of `markLight`.
|
|
223
223
|
* @param {string} [props.brandName] The brand name, read by screen readers from the logo, or from the mark when there is no logo.
|
|
224
|
+
* @param {string} [props.brandHref] Makes the logo row a link to this address, through linkComponent when one is passed, and a tap on it closes the phone drawer. The link wraps the logo, mark and brand node, so brand must hold no link of its own. Needs brandLabel or brandName, and a brand, logo or mark to link.
|
|
225
|
+
* @param {string} [props.brandLabel] The brand link's accessible name, such as "Acme home". Used only with brandHref; defaults to brandName.
|
|
224
226
|
* @param {import('react').ReactNode} [props.sidebarStart]
|
|
225
227
|
* @param {import('react').ReactNode} [props.sidebarStartCompact]
|
|
226
228
|
* @param {import('react').ReactNode} [props.sidebarFooter]
|
|
@@ -235,7 +237,7 @@ export type SearchShape = {
|
|
|
235
237
|
* @param {'side'|'top'} [props.nav] 'top': from lg up the groups' items ride in the top bar after brand through the navigation menu and no sidebar is drawn; below lg the drawer and the phone tab bar stay.
|
|
236
238
|
* @param {'comfortable'|'compact'} [props.density]
|
|
237
239
|
* @param {number} [props.itemHeight]
|
|
238
|
-
* @param {'linear'|'outline'|'bold'|'bulk'|'broken'|'twotone'} [props.iconVariant]
|
|
240
|
+
* @param {'linear'|'outline'|'bold'|'bulk'|'broken'|'twotone'} [props.iconVariant='twotone']
|
|
239
241
|
* @param {'neutral'|'primary'} [props.topbarTone]
|
|
240
242
|
* @param {string} [props.navLabel]
|
|
241
243
|
* @param {string} [props.currentPath]
|
|
@@ -295,6 +297,10 @@ export default function AppShell(props: {
|
|
|
295
297
|
markDark?: string;
|
|
296
298
|
/** The brand name, read by screen readers from the logo, or from the mark when there is no logo. */
|
|
297
299
|
brandName?: string;
|
|
300
|
+
/** Makes the logo row a link to this address, through linkComponent when one is passed. The link wraps the logo, mark and brand, so brand must hold no link of its own. Needs brandLabel or brandName. */
|
|
301
|
+
brandHref?: string;
|
|
302
|
+
/** The brand link's accessible name, such as Acme home. Used only with brandHref; defaults to brandName. */
|
|
303
|
+
brandLabel?: string;
|
|
298
304
|
/** Between the brand row and the nav, such as a workspace switcher or an environment badge. Hidden on the collapsed rail. */
|
|
299
305
|
sidebarStart?: import('react').ReactNode;
|
|
300
306
|
/** The same slot for the collapsed rail, typically a compact monogram control. Shown only on the desktop collapsed rail. */
|
|
@@ -330,7 +336,10 @@ export default function AppShell(props: {
|
|
|
330
336
|
density?: 'comfortable' | 'compact';
|
|
331
337
|
/** The height of every sidebar row in px, in place of the density's row height. Unset, the rows keep the density's height. A value above zero applies on every pointer, touch included. */
|
|
332
338
|
itemHeight?: number;
|
|
333
|
-
/**
|
|
339
|
+
/**
|
|
340
|
+
* The iconsax style of every sidebar icon. A row's own iconVariant overrides it; bulk is the filled look. Unset, icons draw in the twotone style.
|
|
341
|
+
* @default "twotone"
|
|
342
|
+
*/
|
|
334
343
|
iconVariant?: 'linear' | 'outline' | 'bold' | 'bulk' | 'broken' | 'twotone';
|
|
335
344
|
/**
|
|
336
345
|
* The top bar's colour. Primary paints the bar in the primary colour, with the ink that reads on it. The search field keeps its own surface.
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
* @param {string} [props.className]
|
|
31
31
|
* @param {import('react').CSSProperties} [props.style]
|
|
32
32
|
* @param {string} [props.stepLabel] Default "Step {number}". The {number} token is the step's position, counted from 1.
|
|
33
|
+
* @param {boolean} [props.markdown] Draws each item's description and note as Markdown (bold, italics, lists, links, code), through the shared Markdown element, which never renders raw HTML. Both must then be strings. Default false: plain text.
|
|
33
34
|
*/
|
|
34
35
|
export default function AppTimeline(props: {
|
|
35
36
|
/**
|
|
@@ -74,4 +75,9 @@ export default function AppTimeline(props: {
|
|
|
74
75
|
* @default "Step {number}"
|
|
75
76
|
*/
|
|
76
77
|
stepLabel?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Draws each item's description and note as Markdown (bold, italics, lists, links, code); raw HTML shows as text. Both must then be strings. Unset, they show as plain text.
|
|
80
|
+
* @default false
|
|
81
|
+
*/
|
|
82
|
+
markdown?: boolean;
|
|
77
83
|
}): import("react").JSX.Element;
|
|
@@ -5,7 +5,7 @@ export declare const SECTION_TITLE_FONTS: string[];
|
|
|
5
5
|
/** The heading tag for the section title: `as` when it is a heading, otherwise the section's default. */
|
|
6
6
|
export declare function sectionHeading(as: any, fallback: any): any;
|
|
7
7
|
/** The level under a section title, for an item's title (h2 gives h3; h6 stays h6). */
|
|
8
|
-
export declare function itemHeading(heading: any): string;
|
|
8
|
+
export declare function itemHeading(heading: any): string | undefined;
|
|
9
9
|
/**
|
|
10
10
|
* The `<img>` the kit writes itself (logos, avatars), byte-in-step with Razor's SectionMarkup.Image.
|
|
11
11
|
* Width and height are always set so the browser reserves the box before the file arrives.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.148.0",
|
|
4
4
|
"description": "Webority shared React component library — App* primitives on react-bootstrap + the @webority/theme design system.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
},
|
|
30
30
|
"sideEffects": false,
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@webority/markdown-core": "0.
|
|
33
|
-
"@webority/theme": "0.
|
|
34
|
-
"@webority/ui-elements": "0.
|
|
35
|
-
"@webority/web-core": "0.
|
|
32
|
+
"@webority/markdown-core": "0.148.0",
|
|
33
|
+
"@webority/theme": "0.148.0",
|
|
34
|
+
"@webority/ui-elements": "0.148.0",
|
|
35
|
+
"@webority/web-core": "0.148.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@webority/analytics": "^0.36.0",
|
|
39
|
-
"bootstrap": "5.3.
|
|
39
|
+
"bootstrap": "5.3.8",
|
|
40
40
|
"react": "^19.0.0",
|
|
41
41
|
"react-bootstrap": "^2.10.0",
|
|
42
42
|
"react-dom": "^19.0.0"
|
|
@@ -48,18 +48,18 @@
|
|
|
48
48
|
"@testing-library/user-event": "^14.6.1",
|
|
49
49
|
"@types/react": "^19.2.17",
|
|
50
50
|
"@vitejs/plugin-react": "^6.0.1",
|
|
51
|
-
"@vitest/coverage-v8": "5.0
|
|
51
|
+
"@vitest/coverage-v8": "5.1.0",
|
|
52
52
|
"@webority/analytics": "0.36.1",
|
|
53
|
-
"@webority/canvas-kit": "0.
|
|
54
|
-
"@webority/tokens": "0.
|
|
55
|
-
"bootstrap": "5.3.
|
|
53
|
+
"@webority/canvas-kit": "0.148.0",
|
|
54
|
+
"@webority/tokens": "0.148.0",
|
|
55
|
+
"bootstrap": "5.3.8",
|
|
56
56
|
"jsdom": "30.1.1",
|
|
57
|
-
"react": "^19.
|
|
57
|
+
"react": "^19.3.1",
|
|
58
58
|
"react-bootstrap": "^2.10.6",
|
|
59
|
-
"react-dom": "^19.
|
|
59
|
+
"react-dom": "^19.3.1",
|
|
60
60
|
"typescript": "^7.0.2",
|
|
61
|
-
"vite": "^8.
|
|
62
|
-
"vitest": "5.0
|
|
61
|
+
"vite": "^8.3.6",
|
|
62
|
+
"vitest": "5.1.0"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"build": "vite build && tsc -p tsconfig.json && node ../../scripts/inject-meta-docs.mjs && node ../canvas-kit/dist/cli.js build --config canvas-kit.json --out dist/canvas-kit && node ../canvas-kit/dist/cli.js guidance --config canvas-kit.json --out dist/guidance.json && node ../../scripts/sync-rcl-assets.mjs analytics",
|