@webority/ui-react 0.161.0 → 0.164.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.
Files changed (97) hide show
  1. package/README.md +2 -2
  2. package/dist/canvas-kit/kit.js +191 -191
  3. package/dist/canvas-kit/manifest.json +72 -14
  4. package/dist/canvas-kit/release.json +6 -6
  5. package/dist/components/AppAccountSwitcher.js +1 -1
  6. package/dist/components/AppAlert.js +1 -1
  7. package/dist/components/AppBreadcrumbs.js +1 -1
  8. package/dist/components/AppButton.js +1 -1
  9. package/dist/components/AppCard.js +1 -1
  10. package/dist/components/AppChartCard.js +1 -1
  11. package/dist/components/AppChoiceChip.js +1 -1
  12. package/dist/components/AppCodeBlock.js +1 -1
  13. package/dist/components/AppCommentThread.js +1 -1
  14. package/dist/components/AppContextMenu.js +1 -1
  15. package/dist/components/AppDataTable.js +1 -1
  16. package/dist/components/AppDrawer.js +1 -1
  17. package/dist/components/AppDropdown.js +1 -1
  18. package/dist/components/AppDueDate.js +1 -1
  19. package/dist/components/AppFileViewer.js +1 -1
  20. package/dist/components/AppFilterBar.js +1 -1
  21. package/dist/components/AppFloatingButton.js +1 -1
  22. package/dist/components/AppHoverCard.js +1 -1
  23. package/dist/components/AppImagePicker.js +1 -1
  24. package/dist/components/AppInlineEdit.js +1 -1
  25. package/dist/components/AppInput.js +1 -1
  26. package/dist/components/AppMarkdown.js +1 -1
  27. package/dist/components/AppModal.js +1 -1
  28. package/dist/components/AppNotificationCenter.js +1 -1
  29. package/dist/components/AppNumberInput.js +1 -1
  30. package/dist/components/AppPageHeader.js +1 -1
  31. package/dist/components/AppPopover.js +1 -1
  32. package/dist/components/AppSearch.js +1 -1
  33. package/dist/components/AppShell.js +1 -1
  34. package/dist/components/AppSparkline.js +1 -1
  35. package/dist/components/AppTextarea.js +1 -1
  36. package/dist/components/AppThemeToggle.js +1 -1
  37. package/dist/components/AppToast.js +1 -1
  38. package/dist/components/AppTooltip.js +1 -1
  39. package/dist/components/AppWhatsNew.js +1 -1
  40. package/dist/components/AppWorkspaceSwitcher.js +1 -1
  41. package/dist/components/warnUnknownProps.js +1 -1
  42. package/dist/guidance.json +5 -5
  43. package/dist/lib/indianGrouping.js +1 -0
  44. package/dist/lib/useOverlayRoot.js +1 -0
  45. package/dist/types/components/AppAccordion.d.ts +1 -1
  46. package/dist/types/components/AppAlert.d.ts +1 -1
  47. package/dist/types/components/AppBreadcrumbs.d.ts +6 -0
  48. package/dist/types/components/AppCard.d.ts +1 -1
  49. package/dist/types/components/AppChip.d.ts +2 -2
  50. package/dist/types/components/AppCodeBlock.d.ts +1 -1
  51. package/dist/types/components/AppCommandPalette.d.ts +2 -2
  52. package/dist/types/components/AppDataTable.d.ts +3 -1
  53. package/dist/types/components/AppDescriptions.d.ts +1 -1
  54. package/dist/types/components/AppDrawer.d.ts +1 -1
  55. package/dist/types/components/AppDropdown.d.ts +7 -7
  56. package/dist/types/components/AppFilePicker.d.ts +1 -1
  57. package/dist/types/components/AppFloatingDock.d.ts +2 -2
  58. package/dist/types/components/AppForm.d.ts +2 -2
  59. package/dist/types/components/AppFormActions.d.ts +1 -1
  60. package/dist/types/components/AppFormSection.d.ts +1 -1
  61. package/dist/types/components/AppIcon.d.ts +2 -2
  62. package/dist/types/components/AppInfoTip.d.ts +1 -1
  63. package/dist/types/components/AppInlineEdit.d.ts +5 -0
  64. package/dist/types/components/AppKpiTile.d.ts +1 -1
  65. package/dist/types/components/AppMeter.d.ts +1 -1
  66. package/dist/types/components/AppModal.d.ts +4 -4
  67. package/dist/types/components/AppNumberInput.d.ts +7 -0
  68. package/dist/types/components/AppPageHeader.d.ts +5 -0
  69. package/dist/types/components/AppPopover.d.ts +3 -3
  70. package/dist/types/components/AppRequiredMark.d.ts +1 -1
  71. package/dist/types/components/AppResourceCard.d.ts +1 -1
  72. package/dist/types/components/AppResult.d.ts +2 -2
  73. package/dist/types/components/AppScrollbar.d.ts +1 -1
  74. package/dist/types/components/AppShell.d.ts +6 -6
  75. package/dist/types/components/AppSparkline.d.ts +3 -0
  76. package/dist/types/components/AppSpinner.d.ts +2 -2
  77. package/dist/types/components/AppSplash.d.ts +2 -2
  78. package/dist/types/components/AppTabs.d.ts +3 -3
  79. package/dist/types/components/AppToast.d.ts +1 -1
  80. package/dist/types/components/AppToolbar.d.ts +5 -5
  81. package/dist/types/components/AppTooltip.d.ts +5 -5
  82. package/dist/types/components/AppWorkspaceSwitcher.d.ts +3 -3
  83. package/dist/types/components/toastStore.d.ts +2 -2
  84. package/dist/types/components/warnUnknownProps.d.ts +3 -3
  85. package/dist/types/index.d.ts +1 -1
  86. package/dist/types/lib/CheckField.d.ts +1 -1
  87. package/dist/types/lib/FieldMessage.d.ts +1 -1
  88. package/dist/types/lib/FileItemRow.d.ts +1 -1
  89. package/dist/types/lib/fileItem.d.ts +3 -3
  90. package/dist/types/lib/indianGrouping.d.ts +2 -0
  91. package/dist/types/lib/useOverlayRoot.d.ts +2 -0
  92. package/dist/ui-react.js +1 -1
  93. package/package.json +11 -11
  94. package/dist/lib/FocusPanel.js +0 -1
  95. package/dist/lib/pageScrollLock.js +0 -1
  96. package/dist/types/lib/FocusPanel.d.ts +0 -11
  97. package/dist/types/lib/pageScrollLock.d.ts +0 -1
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/fillLabel.js";import{linkTarget as n}from"../lib/linkTarget.js";import{navMatchScore as r}from"../lib/navMatch.js";import{SHELL_FOLDED_COOKIE as i,readNavFolded as a,readShellCollapsed as o,writeNavFolded as s,writeShellCollapsed as c}from"../lib/shellCookie.js";import{TargetLink as l}from"../lib/TargetLink.js";import u from"../lib/useElementEntry.js";import{TONES as d}from"../lib/vocabulary.js";import{splitMarkerProps as f}from"../lib/wuiMarker.js";import p from"./AppAvatar.js";import m from"./AppButton.js";import h from"./AppIcon.js";import g from"./AppNavigationMenu.js";import _ from"./assertValidValue.js";import v from"./warnUnknownProps.js";import{initScrollEdges as y,revealActiveNavItem as b}from"@webority/ui-elements/helpers";import{useEffect as x,useId as S,useMemo as C,useRef as w,useState as T}from"react";import{Fragment as E,jsx as D,jsxs as O}from"react/jsx-runtime";var k=()=>import(`@webority/ui-elements/elements/overflow`),A=99,j=4,M=5,N=/^[a-z0-9-]+$/,P=`wui-sidebar-footer`,F=[],I=[`prefix`,`exact`],L=[`comfortable`,`compact`],R=[`neutral`,`primary`],z=[`side`,`top`],B=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],ee=/* @__PURE__ */ new Set([`key`,`label`,`icon`,`iconVariant`,`iconSize`,`href`,`badge`,`badgeTone`,`badgeTitle`,`newUntil`,`trailingIcon`,`active`,`match`,`matchAlso`,`tab`,`tabLabel`,`children`]),V=e=>e>A?`${A}+`:String(e),te=new Intl.DateTimeFormat(`en-CA`,{timeZone:`Asia/Kolkata`}),ne=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:te.format(/* @__PURE__ */ new Date)<=e},re=({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(` `)},ie=({logoLight:e,logoDark:t,markLight:n,markDark:r,brandName:i})=>{let a=i??``,o=[e&&/* @__PURE__ */ D(`img`,{className:`wui-brand-logo wui-brand-light`,src:e,alt:a},`logo-light`),t&&/* @__PURE__ */ D(`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(e=>!!e).map(([t,n,r],i)=>i===0&&!e?/* @__PURE__ */ D(`img`,{className:n,src:r,alt:a},t):/* @__PURE__ */ D(`img`,{className:n,src:r,alt:``,"aria-hidden":`true`},t));return[...o,...s].filter(Boolean)};function H(e){let{marker:t,props:n}=f(`AppShell`,e),{groups:r=[],brand:l,logoLight:u,logoDark:d,markLight:p,markDark:m,brandName:S,brandHref:k,brandLabel:A,sidebarStart:j,sidebarStartCompact:M,sidebarFooter:N,sidebarFooterItems:P=F,topbarStart:I,topbarEnd:ee,footer:V,launcher:te,children:ne,collapsed:H,onCollapsedChange:oe,noSidebar:U=!1,nav:W=`side`,density:G=`comfortable`,itemHeight:se,iconVariant:K=`twotone`,topbarTone:ge=`neutral`,navLabel:ve=`Main navigation`,linkComponent:q,currentPath:ye,rememberCollapsed:be=!1,collapsedCookie:xe=`wui-shell-collapsed`,foldedCookie:Se=i,tabBarLabel:Ce=`Quick navigation`,moreLabel:we=`More`,skipLabel:Te=`Skip to content`,openNavLabel:Ee=`Open navigation`,closeNavLabel:De=`Close navigation`,expandNavLabel:Oe=`Expand navigation`,collapseNavLabel:ke=`Collapse navigation`,newLabel:Ae=`New`,togglePagesLabel:je=`Show or hide {name} pages`,accountMenuLabel:Me=`Account menu for {name}`,roleLabel:Ne=`Role:`,rolesLabel:Pe=`Roles:`,unreadLabel:Fe=`Unread`,markAllReadLabel:Ie=`Mark all read`,viewAllLabel:Le=`View all`,loadingNotificationsText:Re=`Loading…`,noUnreadText:ze=`No unread notifications`,unreadNotificationsText:Be=`{count} unread notifications`,unreadBellLabel:Ve=`{label}, {count} unread`,searchResultsLabel:He=`Search results`,noResultsText:Ue=`No results`,noResultsForText:We=`No results for “{value}”`,resultsCountText:Ge=`{count} results`,resultCountText:Ke=`{count} result`,userMenu:qe,notifications:Je,search:Ye,className:Xe=``,style:Ze,...Qe}=n;if(v(`AppShell`,Qe),_(`AppShell`,`density`,G,L),_(`AppShell`,`topbarTone`,ge,R),_(`AppShell`,`nav`,W,z),_(`AppShell`,`iconVariant`,K,B),A!==void 0&&!k)throw Error(`<AppShell> brandLabel names the brand link, so it needs brandHref.`);if(k){if(!A&&!S)throw Error(`<AppShell> brandHref needs brandLabel or brandName: the collapsed rail hides the logo, so the link would have no accessible name.`);if(!(l||u||d||p||m))throw Error(`<AppShell> brandHref has no brand, logo or mark to link.`)}let $e=(se??0)>0?{...Ze,"--wui-nav-item-height":`${se}px`}:Ze,[et,tt]=T(()=>be&&H===void 0&&typeof document<`u`?o(xe)??!1:!1),[J,Y]=T(!1),[nt,rt]=T(!1),[it,at]=T(!1),ot=w(null),X=H??et,st=e=>k?/* @__PURE__ */ D(ue,{href:k,label:A||S,linkComponent:q,onNavigate:()=>Y(!1),children:e}):e,ct=()=>{let e=!X;H===void 0&&tt(e),be&&c(e,xe),oe?.(e)},lt=r.some(e=>e.collapsible),[ut,dt]=T(()=>lt&&typeof document<`u`?a(Se):/* @__PURE__ */ new Set),ft=e=>{let t=new Set(ut);t.has(e)?t.delete(e):t.add(e),dt(t),s(t,Se)},pt=C(()=>ae(r,P,ye),[r,P,ye]),Z=pt.groups,Q=pt.footer,$=U?null:ce(Z,Q.some(e=>e.active));x(()=>{let e=()=>rt(window.scrollY>4);return e(),window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)},[]),x(()=>{y()},[]),x(()=>{b(ot.current)},[]),x(()=>{let e=ot.current;if(!e)return;let t=()=>at(Z.length>0&&e.scrollHeight>e.clientHeight);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[Z]),x(()=>{if(!J)return;let e=e=>{e.key===`Escape`&&Y(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[J]);let mt=[`app-shell`,X?`collapsed`:``,U?`no-sidebar`:``,W===`top`?`wui-shell-top`:``,J?`mobile-open`:``,Xe].filter(Boolean).join(` `);return/* @__PURE__ */ O(`div`,{className:mt,"data-density":G===`compact`?`compact`:void 0,"data-wui-folded-cookie":lt?Se:void 0,style:$e,...t,...Qe,children:[/* @__PURE__ */ D(`a`,{className:`wui-skip-link`,href:`#main-content`,children:Te}),/* @__PURE__ */ O(`aside`,{className:`app-sidebar`,children:[(l||u||d||p||m)&&/* @__PURE__ */ D(`div`,{className:re({logoLight:u,logoDark:d,markLight:p,markDark:m}),children:st(/* @__PURE__ */ O(E,{children:[ie({logoLight:u,logoDark:d,markLight:p,markDark:m,brandName:S}),l]}))}),j&&/* @__PURE__ */ D(`div`,{className:`app-sidebar-start`,children:j}),M&&/* @__PURE__ */ D(`div`,{className:`app-sidebar-start-compact`,children:M}),/* @__PURE__ */ D(`nav`,{className:`app-sidebar-scroll`,"aria-label":ve,ref:ot,tabIndex:it?0:void 0,children:Z.map((e,t)=>{let n=e.items.map(e=>e.header==null?/* @__PURE__ */ D(pe,{item:e,linkComponent:q,onNavigate:()=>Y(!1),iconVariant:K,newLabel:Ae,togglePagesLabel:je},e.key??e.href??e.label):/* @__PURE__ */ D(`div`,{className:`wui-nav-header`,children:e.header},e.key??e.header));if(!e.collapsible)return/* @__PURE__ */ O(`div`,{className:`app-nav-group`,children:[e.label&&/* @__PURE__ */ D(`div`,{className:`app-nav-group-label`,children:e.label}),n,e.after&&/* @__PURE__ */ D(`div`,{className:`wui-nav-group-after`,children:e.after})]},e.key??e.label??`group-${t}`);let r=!ut.has(e.key??``)||!!fe(e.items),i=`wui-nav-group-${e.key}`;return/* @__PURE__ */ O(`div`,{className:`app-nav-group wui-nav-group-collapsible${r?``:` wui-nav-group-folded`}`,"data-wui-nav-group":e.key,children:[/* @__PURE__ */ O(`button`,{type:`button`,className:`app-nav-group-label wui-nav-group-toggle`,"aria-expanded":r,"aria-controls":i,onClick:()=>ft(e.key??``),children:[/* @__PURE__ */ D(`span`,{className:`wui-nav-group-text`,children:e.label}),/* @__PURE__ */ D(`span`,{className:`wui-nav-group-caret`,children:/* @__PURE__ */ D(h,{name:`chevron-down`,size:16})})]}),/* @__PURE__ */ O(`div`,{className:`wui-nav-group-body`,id:i,children:[n,e.after&&/* @__PURE__ */ D(`div`,{className:`wui-nav-group-after`,children:e.after})]})]},e.key??`group-${t}`)})}),(N||Q.length>0)&&/* @__PURE__ */ O(`div`,{className:`app-sidebar-foot`,children:[Q.length>0&&/* @__PURE__ */ D(`div`,{className:`wui-sidebar-foot-links`,children:Q.map(e=>/* @__PURE__ */ D(pe,{item:e,linkComponent:q,onNavigate:()=>Y(!1),iconVariant:K,newLabel:Ae,togglePagesLabel:je},e.key??e.href??e.label))}),N]}),!U&&/* @__PURE__ */ D(`button`,{type:`button`,className:`app-sidebar-toggle`,onClick:ct,"aria-label":X?Oe:ke,"aria-expanded":!X,children:/* @__PURE__ */ D(h,{name:`chevrons-left`,size:20})})]}),/* @__PURE__ */ O(`div`,{className:`app-main`,children:[/* @__PURE__ */ O(`header`,{className:`app-topbar${nt?` scrolled`:``}`,"data-tone":ge===`primary`?`primary`:void 0,children:[/* @__PURE__ */ O(`div`,{className:`app-topbar-start`,children:[/* @__PURE__ */ D(`button`,{type:`button`,className:`app-topbar-menu`,onClick:()=>Y(!0),"aria-label":Ee,"aria-expanded":J,children:/* @__PURE__ */ D(h,{name:`menu`,size:18})}),W===`top`&&l&&/* @__PURE__ */ D(`div`,{className:`wui-shell-top-brand`,children:st(l)}),W===`top`&&/* @__PURE__ */ D(`div`,{className:`wui-shell-top-nav`,children:/* @__PURE__ */ D(g,{items:le(Z),ariaLabel:ve,linkComponent:q})}),I,Ye&&/* @__PURE__ */ D(_e,{config:Ye,searchResultsLabel:He,noResultsText:Ue,noResultsForText:We,resultsCountText:Ge,resultCountText:Ke,moreLabel:we})]}),/* @__PURE__ */ O(`div`,{className:`app-topbar-end`,children:[ee,Je&&/* @__PURE__ */ D(he,{config:Je,unreadLabel:Fe,markAllReadLabel:Ie,viewAllLabel:Le,loadingNotificationsText:Re,noUnreadText:ze,unreadNotificationsText:Be,unreadBellLabel:Ve}),qe&&/* @__PURE__ */ D(me,{config:qe,linkComponent:q,accountMenuLabel:Me,roleLabel:Ne,rolesLabel:Pe})]})]}),/* @__PURE__ */ D(`main`,{className:`app-content`,id:`main-content`,children:ne}),V&&/* @__PURE__ */ D(`footer`,{className:`app-footer`,children:V})]}),te&&/* @__PURE__ */ D(`div`,{className:`wui-shell-launcher`,children:te}),$&&/* @__PURE__ */ O(`nav`,{className:`wui-tabbar`,"aria-label":Ce,children:[$.tabs.map(e=>/* @__PURE__ */ D(de,{tab:e,linkComponent:q,iconVariant:K},e.key??e.href)),$.hasMore&&/* @__PURE__ */ O(`button`,{type:`button`,className:`wui-tabbar-item${$.moreActive?` active`:``}`,onClick:()=>Y(!0),children:[/* @__PURE__ */ D(`span`,{className:`wui-tabbar-icon`,children:/* @__PURE__ */ D(h,{name:`more`,size:24})}),/* @__PURE__ */ D(`span`,{className:`wui-tabbar-label`,children:we})]})]}),/* @__PURE__ */ D(`button`,{type:`button`,className:`app-scrim`,onClick:()=>Y(!1),"aria-label":De,tabIndex:J?0:-1})]})}function ae(e,t,n){let i=t;for(let e of i){if(e.children?.length)throw Error(`<AppShell> sidebarFooterItems cannot hold children; keep footer links flat.`);if(e.tab)throw Error(`<AppShell> sidebarFooterItems cannot carry tab: true; the phone tab bar is built from groups.`);if(e.header!=null)throw Error(`<AppShell> sidebarFooterItems cannot hold a header row.`)}for(let t of e)t.collapsible&&se(t);let a=(e,t=!1)=>(e??[]).map(e=>Array.isArray(e.children)?{...e,children:a(e.children)}:{...e}).filter(e=>U(e)?t:(e.children?.length??0)>0||!!e.href),o=[...e,{key:P,items:t}].map(e=>({...e,items:W(a(e.items,!0))})).filter(e=>e.items.some(e=>!U(e))),s=[],c=e=>{for(let t of e)U(t)||(s.push(t),t.children&&c(t.children))};for(let e of o)c(e.items);for(let e of s)v(`AppShell items`,oe(e)),_(`AppShell`,`match`,e.match,I),_(`AppShell`,`iconVariant`,e.iconVariant,B),_(`AppShell`,`badgeTone`,e.badgeTone,d);let l=null;if(n!=null&&!s.some(e=>e.active===!0)){let e=-1;for(let t of s){if(t.active!=null||t.children?.length&&!t.href)continue;let i=r(n,t.href,{exact:t.match===`exact`,also:t.matchAlso});if(i<0)continue;let a=t.match===`exact`&&r(n,t.href,{exact:!0})>=0?1/0:i;a>e&&(e=a,l=t)}}for(let e of s)e.active=e.active??e===l;return{groups:o.filter(e=>e.key!==P),footer:o.find(e=>e.key===P)?.items??[]}}function oe(e){return Object.fromEntries(Object.entries(e).filter(([e])=>!ee.has(e)))}var U=e=>e.header!=null;function W(e){return e.filter((t,n)=>{if(!U(t))return!0;let r=e.findIndex((e,t)=>t>n&&U(e));return e.slice(n+1,r<0?void 0:r).length>0})}var G=/* @__PURE__ */ new Set;function se(t){if(t.key!=null&&N.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.`;typeof process<`u`&&process.env.NODE_ENV===`production`||G.has(n)||(G.add(n),e(n))}function ce(e,t){let n=[],r=e=>{for(let t of e)U(t)||(t.children?.length?r(t.children):n.push(t))};for(let t of e)r(t.items);let i=n.filter(e=>e.tab);if(i.length===0)return null;let a=i.length<n.length,o=a?j:M;if(i.length>o)throw Error(`<AppShell>: ${i.length} items carry tab: true, but the phone tab bar holds ${o} (${a?`4 plus More, because other items exist`:`5 when every item is a tab`}). Flag fewer items.`);return{tabs:i,hasMore:a,moreActive:t||n.some(e=>!e.tab&&e.active)}}function le(e){let t=e=>{if(e.label===void 0)throw Error(`<AppShell> a navigation row has no label; every row but a header needs one.`);return e.label},n=e=>e.key??e.href??t(e),r=(e,r)=>({key:n(e),label:t(e),to:r,current:!!e.active}),i=e=>e.flatMap(e=>U(e)?[]:[...e.href?[{...r(e,e.href),icon:e.icon}]:[],...i(e.children??[])]),a=[];for(let o of e.flatMap(e=>e.items)){if(U(o))continue;let e=i(o.children??[]);if(e.length>0){let i=o.href?[{...r(o,o.href),icon:o.icon}]:[];a.push({key:n(o),label:t(o),links:[...i,...e]})}else o.href&&a.push(r(o,o.href))}return a}function ue({href:e,label:t,linkComponent:r,onNavigate:i,children:a}){return/* @__PURE__ */ D(l,{link:n(r,{to:e}),className:`wui-brand-link`,"aria-label":t,onClick:i,children:a})}function de({tab:e,linkComponent:t,iconVariant:r}){let i=`wui-tabbar-item${e.active?` active`:``}`,a=/* @__PURE__ */ O(E,{children:[e.icon&&/* @__PURE__ */ D(`span`,{className:`wui-tabbar-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ D(h,{name:e.icon,size:24,variant:e.iconVariant??r}):e.icon}),/* @__PURE__ */ D(`span`,{className:`wui-tabbar-label`,children:e.tabLabel??e.label}),e.badge!=null&&/* @__PURE__ */ D(`span`,{className:`wui-tabbar-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge})]}),o=e.active?`page`:void 0;return/* @__PURE__ */ D(l,{link:n(t,{to:e.href}),className:i,"aria-current":o,children:a})}function fe(e){for(let t of e){if(t.active)return t;let e=t.children?.length?fe(t.children):void 0;if(e)return e}}function pe({item:e,linkComponent:r,onNavigate:i,depth:a=0,iconVariant:o,newLabel:s,togglePagesLabel:c}){let u=a>0,d=a>1?` wui-nav-depth-${Math.min(a,6)}`:``,f=Array.isArray(e.children)&&e.children.length>0,p=f?fe(e.children??[]):void 0,m=!!p,g=p?p.key??p.href??p.label:null,[_,v]=T(m);x(()=>{g!=null&&v(!0)},[g]);let y=typeof e.label==`string`?e.label:void 0,b=!u&&e.icon&&/* @__PURE__ */ D(`span`,{className:`app-nav-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ D(h,{name:e.icon,size:e.iconSize??22,variant:e.iconVariant??o}):e.icon}),S=e.badge!=null&&/* @__PURE__ */ D(`span`,{className:`app-nav-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge}),C=ne(e.newUntil)&&/* @__PURE__ */ D(`span`,{className:`wui-nav-new`,children:s}),w=/* @__PURE__ */ O(E,{children:[b,/* @__PURE__ */ D(`span`,{className:`app-nav-text`,children:e.label}),C,S,e.trailingIcon&&/* @__PURE__ */ D(`span`,{className:`app-nav-trailing`,children:typeof e.trailingIcon==`string`?/* @__PURE__ */ D(h,{name:e.trailingIcon,size:16}):e.trailingIcon})]}),k=e.active?`page`:void 0;if(f){let f=/* @__PURE__ */ D(`div`,{className:`app-nav-sub${_?` expanded`:``}`,inert:!_,"aria-hidden":!_||void 0,children:/* @__PURE__ */ D(`div`,{className:`app-nav-sub-inner`,children:(e.children??[]).map(e=>/* @__PURE__ */ D(pe,{item:e,linkComponent:r,onNavigate:i,depth:a+1,iconVariant:o,newLabel:s,togglePagesLabel:c},e.key??e.href))})});if(e.href){let a=/* @__PURE__ */ D(l,{link:n(r,{to:e.href}),className:`wui-nav-split-link`,"aria-current":k,onClick:i,children:w});return/* @__PURE__ */ O(E,{children:[/* @__PURE__ */ O(`div`,{className:`app-nav-item has-children wui-nav-split${u?` app-nav-subitem`:``}${m||e.active?` active`:``}${d}`,"data-label":y,children:[a,/* @__PURE__ */ D(`button`,{type:`button`,className:`app-nav-caret wui-nav-split-toggle`,"aria-expanded":_,"aria-label":t(c,{name:y??``}),onClick:()=>v(e=>!e),children:/* @__PURE__ */ D(h,{name:`chevron-right`,size:16})})]}),f]})}return/* @__PURE__ */ O(E,{children:[/* @__PURE__ */ O(`button`,{type:`button`,className:`app-nav-item${u?` app-nav-subitem`:``} has-children${m?` active`:``}${d}`,"aria-expanded":_,"data-label":y,onClick:()=>v(e=>!e),children:[b,/* @__PURE__ */ D(`span`,{className:`app-nav-text`,children:e.label}),C,S,/* @__PURE__ */ D(`span`,{className:`app-nav-caret`,children:/* @__PURE__ */ D(h,{name:`chevron-right`,size:16})})]}),f]})}let A=`app-nav-item${u?` app-nav-subitem`:``}${e.active?` active`:``}${d}`;return/* @__PURE__ */ D(l,{link:n(r,{to:e.href}),className:A,"aria-current":k,"data-label":y,onClick:i,children:w})}function K(){let[e,t]=T(!1),n=w(null);return x(()=>{if(!e)return;let r=e=>{n.current?.contains(e.target instanceof Node?e.target:null)||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 me({config:e,linkComponent:r,accountMenuLabel:i,roleLabel:a,rolesLabel:o}){let s=S(),{open:c,setOpen:u,ref:d}=K(),{name:f,role:g,roles:v=[],noTriggerRole:y=!1,photo:b,profileHref:x,profileLabel:C=`My profile`,onLogout:w,logoutAction:T,logoutLabel:k=`Sign out`,head:A,section:j,logoutVariant:M=`item`,items:N=[]}=e;if(_(`AppShell`,`userMenu.logoutVariant`,M,[`item`,`button`]),!f)throw Error(`<AppShell> userMenu.name is required; the trigger and the avatar are named from it.`);let P=v.map(e=>(e??``).trim()).filter(Boolean),F=()=>u(!1),I=(e,t,i,a)=>/* @__PURE__ */ D(l,{link:n(r,{to:e}),className:`dropdown-item`,onClick:a,children:t},i),L=/* @__PURE__ */ D(h,{name:`log-out`,size:18}),R=/* @__PURE__ */ O(E,{children:[L,k]});return/* @__PURE__ */ O(`div`,{className:`dropdown wui-usermenu`,ref:d,children:[/* @__PURE__ */ O(`button`,{type:`button`,id:s,className:`wui-usermenu-trigger`,"aria-expanded":c,"aria-label":t(i,{name:f}),onClick:()=>u(e=>!e),children:[/* @__PURE__ */ D(p,{name:f,src:b,tone:`auto`}),/* @__PURE__ */ O(`span`,{className:`wui-usermenu-text`,children:[/* @__PURE__ */ D(`span`,{className:`wui-usermenu-name`,children:f}),g&&!y&&/* @__PURE__ */ D(`span`,{className:`wui-usermenu-role`,children:g})]}),/* @__PURE__ */ D(h,{name:`chevron-down`,size:14,className:`wui-usermenu-caret`})]}),/* @__PURE__ */ O(`div`,{className:`dropdown-menu dropdown-menu-end wui-usermenu-menu${c?` show`:``}`,"aria-labelledby":s,"data-bs-popper":c?`static`:void 0,children:[/* @__PURE__ */ O(`div`,{className:`wui-usermenu-head`,children:[/* @__PURE__ */ D(p,{name:f,src:b,size:`lg`,tone:`auto`}),/* @__PURE__ */ O(`div`,{className:`wui-usermenu-who`,children:[/* @__PURE__ */ D(`div`,{className:`wui-usermenu-name`,children:f}),g&&/* @__PURE__ */ D(`div`,{className:`wui-usermenu-role`,children:g}),P.length>0&&/* @__PURE__ */ O(`div`,{className:`wui-usermenu-roles`,children:[/* @__PURE__ */ D(`span`,{className:`wui-usermenu-roles-label`,children:P.length===1?a:o}),` ${P.join(`, `)}`]}),A?/* @__PURE__ */ D(`div`,{className:`wui-usermenu-extra`,children:A}):null]})]}),j?/* @__PURE__ */ D(`div`,{className:`wui-usermenu-section`,children:j}):null,x&&I(x,/* @__PURE__ */ O(E,{children:[/* @__PURE__ */ D(h,{name:`user`,size:18}),C]}),void 0,F),N.map(e=>{if(e.divider)return/* @__PURE__ */ D(`hr`,{className:`dropdown-divider`},e.key);let t=/* @__PURE__ */ O(E,{children:[e.icon&&/* @__PURE__ */ D(h,{name:e.icon,size:18}),e.label]}),n=()=>{e.onClick?.(),F()};return e.href?I(e.href,t,e.key,n):/* @__PURE__ */ D(`button`,{type:`button`,className:`dropdown-item`,onClick:n,children:t},e.key)}),M===`button`?(T||w)&&/* @__PURE__ */ D(`div`,{className:`wui-usermenu-foot`,children:T?/* @__PURE__ */ D(`form`,{method:`post`,action:T,className:`wui-usermenu-logout`,children:/* @__PURE__ */ D(m,{type:`submit`,tone:`danger`,variant:`soft`,block:!0,leftIcon:L,children:k})}):/* @__PURE__ */ D(m,{type:`button`,tone:`danger`,variant:`soft`,block:!0,leftIcon:L,onClick:()=>{F(),w?.()},children:k})}):T?/* @__PURE__ */ D(`form`,{method:`post`,action:T,className:`wui-usermenu-logout`,children:/* @__PURE__ */ D(`button`,{type:`submit`,className:`dropdown-item danger`,children:R})}):w&&/* @__PURE__ */ D(`button`,{type:`button`,className:`dropdown-item danger`,onClick:()=>{F(),w()},children:R})]})]})}function he({config:e,unreadLabel:n,markAllReadLabel:r,viewAllLabel:i,loadingNotificationsText:a,noUnreadText:o,unreadNotificationsText:s,unreadBellLabel:c}){let l=S(),{open:u,setOpen:d,ref:f}=K(),{unread:p=0,items:m,loading:g=!1,onOpen:_,onMarkAllRead:v,viewAllHref:y,label:b=`Notifications`,emptyText:C=`You are all caught up.`}=e,[k,A]=T(``),j=w(p);x(()=>{j.current!==p&&(j.current=p,A(p===0?o:t(s,{count:V(p)})))},[p,o,s]);let M=null;return m?.length?M=/* @__PURE__ */ D(`div`,{className:`wui-bell-items`,children:m.map((e,t)=>{let r=`wui-bell-item${e.read?` wui-bell-item-read`:``}`,i=/* @__PURE__ */ O(E,{children:[/* @__PURE__ */ D(`span`,{className:`wui-bell-dot`,"aria-hidden":`true`}),e.icon&&/* @__PURE__ */ D(`span`,{className:`wui-bell-icon`,children:/* @__PURE__ */ D(h,{name:e.icon,size:18})}),/* @__PURE__ */ O(`span`,{className:`wui-bell-body`,children:[!e.read&&/* @__PURE__ */ O(`span`,{className:`visually-hidden`,children:[n,`: `]}),/* @__PURE__ */ D(`span`,{className:`wui-bell-item-title`,children:e.title}),e.time&&/* @__PURE__ */ D(`span`,{className:`wui-bell-when`,children:e.time})]})]});return e.href?/* @__PURE__ */ D(`a`,{className:r,href:e.href,"data-id":e.id,children:i},e.id??t):/* @__PURE__ */ D(`div`,{className:r,"data-id":e.id,children:i},e.id??t)})}):g?M=/* @__PURE__ */ D(`div`,{className:`wui-bell-state`,children:a}):m&&(M=/* @__PURE__ */ D(`div`,{className:`wui-bell-state`,children:C})),/* @__PURE__ */ O(`div`,{className:`dropdown wui-bell`,ref:f,children:[/* @__PURE__ */ O(`button`,{type:`button`,id:l,className:`topbar-icon-btn wui-bell-trigger`,"aria-expanded":u,"aria-label":p===0?b:t(c,{label:b,count:V(p)}),onClick:()=>{let e=!u;d(e),e&&_?.()},children:[/* @__PURE__ */ D(h,{name:`notification`,size:20}),/* @__PURE__ */ D(`span`,{className:`wui-bell-count`,"aria-hidden":`true`,hidden:p===0,children:V(p)})]}),/* @__PURE__ */ D(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:k}),/* @__PURE__ */ O(`div`,{className:`dropdown-menu dropdown-menu-end wui-bell-menu${u?` show`:``}`,"aria-labelledby":l,"data-bs-popper":u?`static`:void 0,children:[/* @__PURE__ */ O(`div`,{className:`wui-bell-head`,children:[/* @__PURE__ */ D(`span`,{className:`wui-bell-title`,children:b}),v&&/* @__PURE__ */ D(`button`,{type:`button`,className:`wui-bell-markall`,onClick:v,children:r})]}),/* @__PURE__ */ D(`div`,{className:`wui-bell-list`,"aria-busy":g||void 0,children:M}),y&&/* @__PURE__ */ D(`a`,{className:`wui-bell-foot`,href:y,children:i})]})]})}var ge=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function _e({config:e,searchResultsLabel:n,noResultsText:r,noResultsForText:i,resultsCountText:a,resultCountText:o,moreLabel:s}){u(`wui-overflow`,k);let c=S(),{value:l=``,onChange:d,results:f=null,loading:p=!1,onSelect:m,onSubmit:g,onFocus:_,placeholder:v=`Search`}=e,[y,b]=T(!1),[E,A]=T(!1),[j,M]=T({results:null,index:-1}),N=j.results===f?j.index:-1,P=e=>M({results:f,index:e}),F=w(null),I=w(null),L=w([]),R=C(()=>(f??[]).flatMap(e=>e.hits??[]),[f]),z=f!=null&&!E,B=R.length;x(()=>{let e=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||ge(e.target instanceof HTMLElement?e.target:null)||(e.preventDefault(),b(!0),I.current?.focus())},t=e=>{F.current?.contains(e.target instanceof Node?e.target:null)||(A(!0),b(!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(!z||B===0)return;e.preventDefault(),P((N+(e.key===`ArrowDown`?1:-1)+B)%B)}else e.key===`Enter`?z&&N>=0&&L.current[N]?(e.preventDefault(),L.current[N].click()):g&&l.trim()!==``&&(e.preventDefault(),g(l.trim())):e.key===`Escape`&&(z?(e.preventDefault(),A(!0)):y&&(e.preventDefault(),b(!1)))},V=-1;return L.current=[],/* @__PURE__ */ D(`wui-overflow`,{class:`wui-topsearch-host`,label:s,children:/* @__PURE__ */ D(`div`,{"data-wui-overflow-list":!0,className:`wui-topsearch-row`,children:/* @__PURE__ */ O(`div`,{className:`wui-topsearch${y?` is-open`:``}${p?` is-loading`:``}`,ref:F,"data-overflow-label":v,children:[/* @__PURE__ */ D(`button`,{type:`button`,className:`topbar-icon-btn wui-topsearch-open`,"aria-label":v,"aria-expanded":y,"aria-controls":`${c}-panel`,onClick:()=>{let e=!y;b(e),e&&I.current?.focus()},children:/* @__PURE__ */ D(h,{name:`search`,size:20})}),/* @__PURE__ */ O(`div`,{className:`wui-topsearch-panel`,id:`${c}-panel`,children:[/* @__PURE__ */ O(`div`,{className:`search-wrap`,children:[/* @__PURE__ */ D(h,{name:`search`,size:18,className:`search-icon`}),/* @__PURE__ */ D(`input`,{ref:I,type:`search`,className:`form-control input search-input`,id:`${c}-input`,placeholder:v,"aria-label":v,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":z,"aria-controls":`${c}-list`,"aria-activedescendant":z&&N>=0?`${c}-opt-${N}`:void 0,autoComplete:`off`,value:l,onChange:e=>{A(!1),d?.(e.target.value)},onKeyDown:ee,onFocus:_})]}),/* @__PURE__ */ D(`div`,{className:`wui-topsearch-results`,id:`${c}-list`,role:`listbox`,"aria-label":n,hidden:!z,children:z&&/* @__PURE__ */ O(`div`,{className:`wui-topsearch-groups`,role:`presentation`,children:[B===0&&/* @__PURE__ */ D(`div`,{className:`wui-topsearch-empty`,role:`option`,"aria-disabled":`true`,"aria-selected":`false`,children:t(i,{value:l})}),f.filter(e=>e.hits?.length).map((e,t)=>/* @__PURE__ */ O(`div`,{className:`wui-topsearch-group`,role:`group`,"aria-label":e.label??``,children:[e.label&&/* @__PURE__ */ D(`div`,{className:`wui-topsearch-group-label`,role:`presentation`,children:e.label}),e.hits.map(e=>{V+=1;let t=V;return/* @__PURE__ */ O(`a`,{className:`wui-topsearch-hit${t===N?` is-active`:``}`,role:`option`,"aria-selected":t===N,id:`${c}-opt-${t}`,href:e.href,ref:e=>{L.current[t]=e},onClick:t=>m?.(e,t),children:[e.icon&&/* @__PURE__ */ D(`span`,{className:`wui-topsearch-hit-icon`,children:/* @__PURE__ */ D(h,{name:e.icon,size:18})}),/* @__PURE__ */ O(`span`,{className:`wui-topsearch-hit-text`,children:[/* @__PURE__ */ D(`span`,{className:`wui-topsearch-hit-title`,children:e.title}),e.subtitle&&/* @__PURE__ */ D(`span`,{className:`wui-topsearch-hit-sub`,children:e.subtitle})]})]},`${e.href}-${t}`)})]},e.label??t))]})})]}),/* @__PURE__ */ D(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:z?B===0?r:t(B===1?o:a,{count:B}):``})]})})})}export{H as default};
1
+ import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/fillLabel.js";import{linkTarget as n}from"../lib/linkTarget.js";import{navMatchScore as r}from"../lib/navMatch.js";import{SHELL_FOLDED_COOKIE as i,readNavFolded as a,readShellCollapsed as o,writeNavFolded as s,writeShellCollapsed as c}from"../lib/shellCookie.js";import{TargetLink as l}from"../lib/TargetLink.js";import u from"../lib/useElementEntry.js";import{TONES as d}from"../lib/vocabulary.js";import{splitMarkerProps as f}from"../lib/wuiMarker.js";import p from"./AppAvatar.js";import m from"./AppButton.js";import h from"./AppIcon.js";import g from"./AppNavigationMenu.js";import _ from"./assertValidValue.js";import v from"./warnUnknownProps.js";import{initScrollEdges as y,isImeSafeEnter as b,revealActiveNavItem as x,setPopoverOpen as S}from"@webority/ui-elements/helpers";import{useEffect as C,useId as w,useMemo as T,useRef as E,useState as D}from"react";import{Fragment as O,jsx as k,jsxs as A}from"react/jsx-runtime";var j=()=>import(`@webority/ui-elements/elements/overflow`),M=()=>import(`@webority/ui-elements/elements/dropdown`),N=99,P=4,F=5,I=/^[a-z0-9-]+$/,L=`wui-sidebar-footer`,R=[],z=[`prefix`,`exact`],B=[`comfortable`,`compact`],V=[`neutral`,`primary`],ee=[`default`,`brand`],te=[`side`,`top`],ne=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],re=/* @__PURE__ */ new Set([`key`,`label`,`icon`,`iconVariant`,`iconSize`,`href`,`badge`,`badgeTone`,`badgeTitle`,`newUntil`,`trailingIcon`,`active`,`match`,`matchAlso`,`tab`,`tabLabel`,`children`]),H=e=>e>N?`${N}+`:String(e),U=new Intl.DateTimeFormat(`en-CA`,{timeZone:`Asia/Kolkata`}),ie=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:U.format(/* @__PURE__ */ new Date)<=e},ae=({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(` `)},oe=({logoLight:e,logoDark:t,markLight:n,markDark:r,brandName:i})=>{let a=i??``,o=[e&&/* @__PURE__ */ k(`img`,{className:`wui-brand-logo wui-brand-light`,src:e,alt:a},`logo-light`),t&&/* @__PURE__ */ k(`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(e=>!!e).map(([t,n,r],i)=>i===0&&!e?/* @__PURE__ */ k(`img`,{className:n,src:r,alt:a},t):/* @__PURE__ */ k(`img`,{className:n,src:r,alt:``,"aria-hidden":`true`},t));return[...o,...s].filter(Boolean)};function W(e){let{marker:t,props:n}=f(`AppShell`,e),{groups:r=[],brand:l,logoLight:u,logoDark:d,markLight:p,markDark:m,brandName:b,brandHref:w,brandLabel:j,sidebarStart:M,sidebarStartCompact:N,sidebarFooter:P,sidebarFooterItems:F=R,topbarStart:I,topbarEnd:L,footer:z,launcher:re,children:H,collapsed:U,onCollapsedChange:ie,noSidebar:W=!1,nav:G=`side`,density:K=`comfortable`,itemHeight:ce,iconVariant:q=`twotone`,topbarTone:le=`neutral`,tone:J=`default`,navLabel:ve=`Main navigation`,linkComponent:Y,currentPath:be,rememberCollapsed:xe=!1,collapsedCookie:Se=`wui-shell-collapsed`,foldedCookie:Ce=i,tabBarLabel:we=`Quick navigation`,moreLabel:Te=`More`,skipLabel:Ee=`Skip to content`,openNavLabel:De=`Open navigation`,expandNavLabel:Oe=`Expand navigation`,collapseNavLabel:ke=`Collapse navigation`,newLabel:Ae=`New`,togglePagesLabel:je=`Show or hide {name} pages`,accountMenuLabel:Me=`Account menu for {name}`,roleLabel:Ne=`Role:`,rolesLabel:Pe=`Roles:`,unreadLabel:Fe=`Unread`,markAllReadLabel:Ie=`Mark all read`,viewAllLabel:Le=`View all`,loadingNotificationsText:Re=`Loading…`,noUnreadText:ze=`No unread notifications`,unreadNotificationsText:Be=`{count} unread notifications`,unreadBellLabel:Ve=`{label}, {count} unread`,searchResultsLabel:He=`Search results`,noResultsText:Ue=`No results`,noResultsForText:We=`No results for “{value}”`,resultsCountText:Ge=`{count} results`,resultCountText:Ke=`{count} result`,userMenu:qe,notifications:Je,search:Ye,className:Xe=``,style:Ze,...Qe}=n;if(v(`AppShell`,Qe),_(`AppShell`,`density`,K,B),_(`AppShell`,`topbarTone`,le,V),_(`AppShell`,`tone`,J,ee),_(`AppShell`,`nav`,G,te),_(`AppShell`,`iconVariant`,q,ne),j!==void 0&&!w)throw Error(`<AppShell> brandLabel names the brand link, so it needs brandHref.`);if(w){if(!j&&!b)throw Error(`<AppShell> brandHref needs brandLabel or brandName: the collapsed rail hides the logo, so the link would have no accessible name.`);if(!(l||u||d||p||m))throw Error(`<AppShell> brandHref has no brand, logo or mark to link.`)}let $e=(ce??0)>0?{...Ze,"--wui-nav-item-height":`${ce}px`}:Ze,[et,tt]=D(()=>xe&&U===void 0&&typeof document<`u`?o(Se)??!1:!1),[X,Z]=D(!1),nt=E(null),[rt,it]=D(!1),[at,ot]=D(!1),st=E(null),Q=U??et,ct=e=>w?/* @__PURE__ */ k(fe,{href:w,label:j||b,linkComponent:Y,onNavigate:()=>Z(!1),children:e}):e,lt=()=>{let e=!Q;U===void 0&&tt(e),xe&&c(e,Se),ie?.(e)},ut=r.some(e=>e.collapsible),[dt,ft]=D(()=>ut&&typeof document<`u`?a(Ce):/* @__PURE__ */ new Set),pt=e=>{let t=new Set(dt);t.has(e)?t.delete(e):t.add(e),ft(t),s(t,Ce)},mt=T(()=>se(r,F,be),[r,F,be]),$=mt.groups,ht=mt.footer,gt=W?null:ue($,ht.some(e=>e.active));C(()=>{let e=()=>it(window.scrollY>4);return e(),window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)},[]),C(()=>{y()},[]),C(()=>{x(st.current)},[]),C(()=>{let e=st.current;if(!e)return;let t=()=>ot($.length>0&&e.scrollHeight>e.clientHeight);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[$]),C(()=>{let e=nt.current;if(!e)return;let t=window.matchMedia(`(max-width: 991.98px)`),n=()=>{t.matches?e.setAttribute(`popover`,`auto`):(e.removeAttribute(`popover`),Z(!1))},r=e=>Z(`newState`in e&&e.newState===`open`);return n(),t.addEventListener(`change`,n),e.addEventListener(`toggle`,r),()=>{t.removeEventListener(`change`,n),e.removeEventListener(`toggle`,r)}},[]),C(()=>{let e=nt.current;e?.hasAttribute(`popover`)&&S(e,X)},[X]);let _t=[`app-shell`,Q?`collapsed`:``,W?`no-sidebar`:``,G===`top`?`wui-shell-top`:``,X?`mobile-open`:``,Xe].filter(Boolean).join(` `);return/* @__PURE__ */ A(`div`,{className:_t,"data-density":K===`compact`?`compact`:void 0,"data-shell-tone":J===`brand`?`brand`:void 0,"data-wui-folded-cookie":ut?Ce:void 0,style:$e,...t,...Qe,children:[/* @__PURE__ */ k(`a`,{className:`wui-skip-link`,href:`#main-content`,children:Ee}),/* @__PURE__ */ A(`aside`,{className:`app-sidebar`,ref:nt,children:[(l||u||d||p||m)&&/* @__PURE__ */ k(`div`,{className:ae({logoLight:u,logoDark:d,markLight:p,markDark:m}),children:ct(/* @__PURE__ */ A(O,{children:[oe({logoLight:u,logoDark:d,markLight:p,markDark:m,brandName:b}),l]}))}),M&&/* @__PURE__ */ k(`div`,{className:`app-sidebar-start`,children:M}),N&&/* @__PURE__ */ k(`div`,{className:`app-sidebar-start-compact`,children:N}),/* @__PURE__ */ k(`nav`,{className:`app-sidebar-scroll`,"aria-label":ve,ref:st,tabIndex:at?0:void 0,children:$.map((e,t)=>{let n=e.items.map(e=>e.header==null?/* @__PURE__ */ k(he,{item:e,linkComponent:Y,onNavigate:()=>Z(!1),iconVariant:q,newLabel:Ae,togglePagesLabel:je},e.key??e.href??e.label):/* @__PURE__ */ k(`div`,{className:`wui-nav-header`,children:e.header},e.key??e.header));if(!e.collapsible)return/* @__PURE__ */ A(`div`,{className:`app-nav-group`,children:[e.label&&/* @__PURE__ */ k(`div`,{className:`app-nav-group-label`,children:e.label}),n,e.after&&/* @__PURE__ */ k(`div`,{className:`wui-nav-group-after`,children:e.after})]},e.key??e.label??`group-${t}`);let r=!dt.has(e.key??``)||!!me(e.items),i=`wui-nav-group-${e.key}`;return/* @__PURE__ */ A(`div`,{className:`app-nav-group wui-nav-group-collapsible${r?``:` wui-nav-group-folded`}`,"data-wui-nav-group":e.key,children:[/* @__PURE__ */ A(`button`,{type:`button`,className:`app-nav-group-label wui-nav-group-toggle`,"aria-expanded":r,"aria-controls":i,onClick:()=>pt(e.key??``),children:[/* @__PURE__ */ k(`span`,{className:`wui-nav-group-text`,children:e.label}),/* @__PURE__ */ k(`span`,{className:`wui-nav-group-caret`,children:/* @__PURE__ */ k(h,{name:`chevron-down`,size:16})})]}),/* @__PURE__ */ A(`div`,{className:`wui-nav-group-body`,id:i,children:[n,e.after&&/* @__PURE__ */ k(`div`,{className:`wui-nav-group-after`,children:e.after})]})]},e.key??`group-${t}`)})}),(P||ht.length>0)&&/* @__PURE__ */ A(`div`,{className:`app-sidebar-foot`,children:[ht.length>0&&/* @__PURE__ */ k(`div`,{className:`wui-sidebar-foot-links`,children:ht.map(e=>/* @__PURE__ */ k(he,{item:e,linkComponent:Y,onNavigate:()=>Z(!1),iconVariant:q,newLabel:Ae,togglePagesLabel:je},e.key??e.href??e.label))}),P]}),!W&&/* @__PURE__ */ k(`button`,{type:`button`,className:`app-sidebar-toggle`,onClick:lt,"aria-label":Q?Oe:ke,"aria-expanded":!Q,children:/* @__PURE__ */ k(h,{name:`chevrons-left`,size:20})})]}),/* @__PURE__ */ A(`div`,{className:`app-main`,children:[/* @__PURE__ */ A(`header`,{className:`app-topbar${rt?` wui-scrolled`:``}`,"data-tone":le===`primary`?`primary`:void 0,children:[/* @__PURE__ */ A(`div`,{className:`app-topbar-start`,children:[/* @__PURE__ */ k(`button`,{type:`button`,className:`app-topbar-menu`,onClick:()=>Z(!0),"aria-label":De,"aria-expanded":X,children:/* @__PURE__ */ k(h,{name:`menu`,size:18})}),G===`top`&&l&&/* @__PURE__ */ k(`div`,{className:`wui-shell-top-brand`,children:ct(l)}),G===`top`&&/* @__PURE__ */ k(`div`,{className:`wui-shell-top-nav`,children:/* @__PURE__ */ k(g,{items:de($),ariaLabel:ve,linkComponent:Y})}),I,Ye&&/* @__PURE__ */ k(ye,{config:Ye,searchResultsLabel:He,noResultsText:Ue,noResultsForText:We,resultsCountText:Ge,resultCountText:Ke,moreLabel:Te})]}),/* @__PURE__ */ A(`div`,{className:`app-topbar-end`,children:[L,Je&&/* @__PURE__ */ k(_e,{config:Je,unreadLabel:Fe,markAllReadLabel:Ie,viewAllLabel:Le,loadingNotificationsText:Re,noUnreadText:ze,unreadNotificationsText:Be,unreadBellLabel:Ve}),qe&&/* @__PURE__ */ k(ge,{config:qe,linkComponent:Y,accountMenuLabel:Me,roleLabel:Ne,rolesLabel:Pe})]})]}),/* @__PURE__ */ k(`main`,{className:`app-content`,id:`main-content`,children:H}),z&&/* @__PURE__ */ k(`footer`,{className:`app-footer`,children:z})]}),re&&/* @__PURE__ */ k(`div`,{className:`wui-shell-launcher`,children:re}),gt&&/* @__PURE__ */ A(`nav`,{className:`wui-tabbar`,"aria-label":we,children:[gt.tabs.map(e=>/* @__PURE__ */ k(pe,{tab:e,linkComponent:Y,iconVariant:q},e.key??e.href)),gt.hasMore&&/* @__PURE__ */ A(`button`,{type:`button`,className:`wui-tabbar-item${gt.moreActive?` active`:``}`,onClick:()=>Z(!0),children:[/* @__PURE__ */ k(`span`,{className:`wui-tabbar-icon`,children:/* @__PURE__ */ k(h,{name:`more`,size:24})}),/* @__PURE__ */ k(`span`,{className:`wui-tabbar-label`,children:Te})]})]})]})}function se(e,t,n){let i=t;for(let e of i){if(e.children?.length)throw Error(`<AppShell> sidebarFooterItems cannot hold children; keep footer links flat.`);if(e.tab)throw Error(`<AppShell> sidebarFooterItems cannot carry tab: true; the phone tab bar is built from groups.`);if(e.header!=null)throw Error(`<AppShell> sidebarFooterItems cannot hold a header row.`)}for(let t of e)t.collapsible&&le(t);let a=(e,t=!1)=>(e??[]).map(e=>Array.isArray(e.children)?{...e,children:a(e.children)}:{...e}).filter(e=>K(e)?t:(e.children?.length??0)>0||!!e.href),o=[...e,{key:L,items:t}].map(e=>({...e,items:ce(a(e.items,!0))})).filter(e=>e.items.some(e=>!K(e))),s=[],c=e=>{for(let t of e)K(t)||(s.push(t),t.children&&c(t.children))};for(let e of o)c(e.items);for(let e of s)v(`AppShell items`,G(e)),_(`AppShell`,`match`,e.match,z),_(`AppShell`,`iconVariant`,e.iconVariant,ne),_(`AppShell`,`badgeTone`,e.badgeTone,d);let l=null;if(n!=null&&!s.some(e=>e.active===!0)){let e=-1;for(let t of s){if(t.active!=null||t.children?.length&&!t.href)continue;let i=r(n,t.href,{exact:t.match===`exact`,also:t.matchAlso});if(i<0)continue;let a=t.match===`exact`&&r(n,t.href,{exact:!0})>=0?1/0:i;a>e&&(e=a,l=t)}}for(let e of s)e.active=e.active??e===l;return{groups:o.filter(e=>e.key!==L),footer:o.find(e=>e.key===L)?.items??[]}}function G(e){return Object.fromEntries(Object.entries(e).filter(([e])=>!re.has(e)))}var K=e=>e.header!=null;function ce(e){return e.filter((t,n)=>{if(!K(t))return!0;let r=e.findIndex((e,t)=>t>n&&K(e));return e.slice(n+1,r<0?void 0:r).length>0})}var q=/* @__PURE__ */ new Set;function le(t){if(t.key!=null&&I.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.`;typeof process<`u`&&process.env.NODE_ENV===`production`||q.has(n)||(q.add(n),e(n))}function ue(e,t){let n=[],r=e=>{for(let t of e)K(t)||(t.children?.length?r(t.children):n.push(t))};for(let t of e)r(t.items);let i=n.filter(e=>e.tab);if(i.length===0)return null;let a=i.length<n.length,o=a?P:F;if(i.length>o)throw Error(`<AppShell>: ${i.length} items carry tab: true, but the phone tab bar holds ${o} (${a?`4 plus More, because other items exist`:`5 when every item is a tab`}). Flag fewer items.`);return{tabs:i,hasMore:a,moreActive:t||n.some(e=>!e.tab&&e.active)}}function de(e){let t=e=>{if(e.label===void 0)throw Error(`<AppShell> a navigation row has no label; every row but a header needs one.`);return e.label},n=e=>e.key??e.href??t(e),r=(e,r)=>({key:n(e),label:t(e),to:r,current:!!e.active}),i=e=>e.flatMap(e=>K(e)?[]:[...e.href?[{...r(e,e.href),icon:e.icon}]:[],...i(e.children??[])]),a=[];for(let o of e.flatMap(e=>e.items)){if(K(o))continue;let e=i(o.children??[]);if(e.length>0){let i=o.href?[{...r(o,o.href),icon:o.icon}]:[];a.push({key:n(o),label:t(o),links:[...i,...e]})}else o.href&&a.push(r(o,o.href))}return a}function fe({href:e,label:t,linkComponent:r,onNavigate:i,children:a}){return/* @__PURE__ */ k(l,{link:n(r,{to:e}),className:`wui-brand-link`,"aria-label":t,onClick:i,children:a})}function pe({tab:e,linkComponent:t,iconVariant:r}){let i=`wui-tabbar-item${e.active?` active`:``}`,a=/* @__PURE__ */ A(O,{children:[e.icon&&/* @__PURE__ */ k(`span`,{className:`wui-tabbar-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ k(h,{name:e.icon,size:24,variant:e.iconVariant??r}):e.icon}),/* @__PURE__ */ k(`span`,{className:`wui-tabbar-label`,children:e.tabLabel??e.label}),e.badge!=null&&/* @__PURE__ */ k(`span`,{className:`wui-tabbar-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge})]}),o=e.active?`page`:void 0;return/* @__PURE__ */ k(l,{link:n(t,{to:e.href}),className:i,"aria-current":o,children:a})}function me(e){for(let t of e){if(t.active)return t;let e=t.children?.length?me(t.children):void 0;if(e)return e}}function he({item:e,linkComponent:r,onNavigate:i,depth:a=0,iconVariant:o,newLabel:s,togglePagesLabel:c}){let u=a>0,d=a>1?` wui-nav-depth-${Math.min(a,6)}`:``,f=Array.isArray(e.children)&&e.children.length>0,p=f?me(e.children??[]):void 0,m=!!p,g=p?p.key??p.href??p.label:null,[_,v]=D(m);C(()=>{g!=null&&v(!0)},[g]);let y=typeof e.label==`string`?e.label:void 0,b=!u&&e.icon&&/* @__PURE__ */ k(`span`,{className:`app-nav-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ k(h,{name:e.icon,size:e.iconSize??22,variant:e.iconVariant??o}):e.icon}),x=e.badge!=null&&/* @__PURE__ */ k(`span`,{className:`app-nav-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge}),S=ie(e.newUntil)&&/* @__PURE__ */ k(`span`,{className:`wui-nav-new`,children:s}),w=/* @__PURE__ */ A(O,{children:[b,/* @__PURE__ */ k(`span`,{className:`app-nav-text`,children:e.label}),S,x,e.trailingIcon&&/* @__PURE__ */ k(`span`,{className:`app-nav-trailing`,children:typeof e.trailingIcon==`string`?/* @__PURE__ */ k(h,{name:e.trailingIcon,size:16}):e.trailingIcon})]}),T=e.active?`page`:void 0;if(f){let f=/* @__PURE__ */ k(`div`,{className:`app-nav-sub${_?` expanded`:``}`,inert:!_,"aria-hidden":!_||void 0,children:/* @__PURE__ */ k(`div`,{className:`app-nav-sub-inner`,children:(e.children??[]).map(e=>/* @__PURE__ */ k(he,{item:e,linkComponent:r,onNavigate:i,depth:a+1,iconVariant:o,newLabel:s,togglePagesLabel:c},e.key??e.href))})});if(e.href){let a=/* @__PURE__ */ k(l,{link:n(r,{to:e.href}),className:`wui-nav-split-link`,"aria-current":T,onClick:i,children:w});return/* @__PURE__ */ A(O,{children:[/* @__PURE__ */ A(`div`,{className:`app-nav-item has-children wui-nav-split${u?` app-nav-subitem`:``}${m||e.active?` active`:``}${d}`,"data-label":y,children:[a,/* @__PURE__ */ k(`button`,{type:`button`,className:`app-nav-caret wui-nav-split-toggle`,"aria-expanded":_,"aria-label":t(c,{name:y??``}),onClick:()=>v(e=>!e),children:/* @__PURE__ */ k(h,{name:`chevron-right`,size:16})})]}),f]})}return/* @__PURE__ */ A(O,{children:[/* @__PURE__ */ A(`button`,{type:`button`,className:`app-nav-item${u?` app-nav-subitem`:``} has-children${m?` active`:``}${d}`,"aria-expanded":_,"data-label":y,onClick:()=>v(e=>!e),children:[b,/* @__PURE__ */ k(`span`,{className:`app-nav-text`,children:e.label}),S,x,/* @__PURE__ */ k(`span`,{className:`app-nav-caret`,children:/* @__PURE__ */ k(h,{name:`chevron-right`,size:16})})]}),f]})}let E=`app-nav-item${u?` app-nav-subitem`:``}${e.active?` active`:``}${d}`;return/* @__PURE__ */ k(l,{link:n(r,{to:e.href}),className:E,"aria-current":T,"data-label":y,onClick:i,children:w})}function J(e){u(`wui-dropdown`,M);let[t,n]=D(!1),r=E(null);return C(()=>{r.current?.toggleAttribute(`open`,t)},[t]),C(()=>{let t=r.current;if(!t)return;let i=r=>{if(r.target!==t||!(`detail`in r)||!r.detail||typeof r.detail!=`object`)return;let i=`open`in r.detail&&r.detail.open===!0;n(i),i&&e?.()};return t.addEventListener(`wui-dropdown-toggle`,i),()=>t.removeEventListener(`wui-dropdown-toggle`,i)},[e]),{open:t,setOpen:n,ref:r}}function ge({config:e,linkComponent:r,accountMenuLabel:i,roleLabel:a,rolesLabel:o}){let s=w(),{open:c,setOpen:u,ref:d}=J(),{name:f,role:g,roles:v=[],noTriggerRole:y=!1,photo:b,profileHref:x,profileLabel:S=`My profile`,onLogout:C,logoutAction:T,logoutLabel:E=`Sign out`,head:D,section:j,logoutVariant:M=`item`,items:N=[]}=e;if(_(`AppShell`,`userMenu.logoutVariant`,M,[`item`,`button`]),!f)throw Error(`<AppShell> userMenu.name is required; the trigger and the avatar are named from it.`);let P=v.map(e=>(e??``).trim()).filter(Boolean),F=()=>u(!1),I=(e,t,i,a)=>/* @__PURE__ */ k(l,{link:n(r,{to:e}),className:`dropdown-item`,onClick:a,children:t},i),L=/* @__PURE__ */ k(h,{name:`log-out`,size:18}),R=/* @__PURE__ */ A(O,{children:[L,E]});return/* @__PURE__ */ A(`wui-dropdown`,{class:`dropdown wui-usermenu`,align:`end`,ref:d,children:[/* @__PURE__ */ A(`button`,{type:`button`,id:s,className:`wui-usermenu-trigger`,"data-wui-dropdown-trigger":!0,"aria-expanded":c,"aria-label":t(i,{name:f}),children:[/* @__PURE__ */ k(p,{name:f,src:b,tone:`auto`}),/* @__PURE__ */ A(`span`,{className:`wui-usermenu-text`,children:[/* @__PURE__ */ k(`span`,{className:`wui-usermenu-name`,children:f}),g&&!y&&/* @__PURE__ */ k(`span`,{className:`wui-usermenu-role`,children:g})]}),/* @__PURE__ */ k(h,{name:`chevron-down`,size:14,className:`wui-usermenu-caret`})]}),/* @__PURE__ */ A(`div`,{"data-wui-dropdown-menu":!0,popover:`auto`,className:`dropdown-menu dropdown-menu-end wui-usermenu-menu${c?` show`:``}`,"aria-labelledby":s,children:[/* @__PURE__ */ A(`div`,{className:`wui-usermenu-head`,children:[/* @__PURE__ */ k(p,{name:f,src:b,size:`lg`,tone:`auto`}),/* @__PURE__ */ A(`div`,{className:`wui-usermenu-who`,children:[/* @__PURE__ */ k(`div`,{className:`wui-usermenu-name`,children:f}),g&&/* @__PURE__ */ k(`div`,{className:`wui-usermenu-role`,children:g}),P.length>0&&/* @__PURE__ */ A(`div`,{className:`wui-usermenu-roles`,children:[/* @__PURE__ */ k(`span`,{className:`wui-usermenu-roles-label`,children:P.length===1?a:o}),` ${P.join(`, `)}`]}),D?/* @__PURE__ */ k(`div`,{className:`wui-usermenu-extra`,children:D}):null]})]}),j?/* @__PURE__ */ k(`div`,{className:`wui-usermenu-section`,children:j}):null,x&&I(x,/* @__PURE__ */ A(O,{children:[/* @__PURE__ */ k(h,{name:`user`,size:18}),S]}),void 0,F),N.map(e=>{if(e.divider)return/* @__PURE__ */ k(`hr`,{className:`dropdown-divider`},e.key);let t=/* @__PURE__ */ A(O,{children:[e.icon&&/* @__PURE__ */ k(h,{name:e.icon,size:18}),e.label]}),n=()=>{e.onClick?.(),F()};return e.href?I(e.href,t,e.key,n):/* @__PURE__ */ k(`button`,{type:`button`,className:`dropdown-item`,onClick:n,children:t},e.key)}),M===`button`?(T||C)&&/* @__PURE__ */ k(`div`,{className:`wui-usermenu-foot`,children:T?/* @__PURE__ */ k(`form`,{method:`post`,action:T,className:`wui-usermenu-logout`,children:/* @__PURE__ */ k(m,{type:`submit`,tone:`danger`,variant:`soft`,block:!0,leftIcon:L,children:E})}):/* @__PURE__ */ k(m,{type:`button`,tone:`danger`,variant:`soft`,block:!0,leftIcon:L,onClick:()=>{F(),C?.()},children:E})}):T?/* @__PURE__ */ k(`form`,{method:`post`,action:T,className:`wui-usermenu-logout`,children:/* @__PURE__ */ k(`button`,{type:`submit`,className:`dropdown-item danger`,children:R})}):C&&/* @__PURE__ */ k(`button`,{type:`button`,className:`dropdown-item danger`,onClick:()=>{F(),C()},children:R})]})]})}function _e({config:e,unreadLabel:n,markAllReadLabel:r,viewAllLabel:i,loadingNotificationsText:a,noUnreadText:o,unreadNotificationsText:s,unreadBellLabel:c}){let l=w(),{open:u,ref:d}=J(e.onOpen),{unread:f=0,items:p,loading:m=!1,onMarkAllRead:g,viewAllHref:_,label:v=`Notifications`,emptyText:y=`You are all caught up.`}=e,[b,x]=D(``),S=E(f);C(()=>{S.current!==f&&(S.current=f,x(f===0?o:t(s,{count:H(f)})))},[f,o,s]);let T=null;return p?.length?T=/* @__PURE__ */ k(`div`,{className:`wui-bell-items`,children:p.map((e,t)=>{let r=`wui-bell-item${e.read?` wui-bell-item-read`:``}`,i=/* @__PURE__ */ A(O,{children:[/* @__PURE__ */ k(`span`,{className:`wui-bell-dot`,"aria-hidden":`true`}),e.icon&&/* @__PURE__ */ k(`span`,{className:`wui-bell-icon`,children:/* @__PURE__ */ k(h,{name:e.icon,size:18})}),/* @__PURE__ */ A(`span`,{className:`wui-bell-body`,children:[!e.read&&/* @__PURE__ */ A(`span`,{className:`visually-hidden`,children:[n,`: `]}),/* @__PURE__ */ k(`span`,{className:`wui-bell-item-title`,children:e.title}),e.time&&/* @__PURE__ */ k(`span`,{className:`wui-bell-when`,children:e.time})]})]});return e.href?/* @__PURE__ */ k(`a`,{className:r,href:e.href,"data-id":e.id,children:i},e.id??t):/* @__PURE__ */ k(`div`,{className:r,"data-id":e.id,children:i},e.id??t)})}):m?T=/* @__PURE__ */ k(`div`,{className:`wui-bell-state`,children:a}):p&&(T=/* @__PURE__ */ k(`div`,{className:`wui-bell-state`,children:y})),/* @__PURE__ */ A(`wui-dropdown`,{class:`dropdown wui-bell`,align:`end`,ref:d,children:[/* @__PURE__ */ A(`button`,{type:`button`,id:l,className:`topbar-icon-btn wui-bell-trigger`,"data-wui-dropdown-trigger":!0,"aria-expanded":u,"aria-label":f===0?v:t(c,{label:v,count:H(f)}),children:[/* @__PURE__ */ k(h,{name:`notification`,size:20}),/* @__PURE__ */ k(`span`,{className:`wui-bell-count`,"aria-hidden":`true`,hidden:f===0,children:H(f)})]}),/* @__PURE__ */ k(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:b}),/* @__PURE__ */ A(`div`,{"data-wui-dropdown-menu":!0,popover:`auto`,className:`dropdown-menu dropdown-menu-end wui-bell-menu${u?` show`:``}`,"aria-labelledby":l,children:[/* @__PURE__ */ A(`div`,{className:`wui-bell-head`,children:[/* @__PURE__ */ k(`span`,{className:`wui-bell-title`,children:v}),g&&/* @__PURE__ */ k(`button`,{type:`button`,className:`wui-bell-markall`,onClick:g,children:r})]}),/* @__PURE__ */ k(`div`,{className:`wui-bell-list`,"aria-busy":m||void 0,children:T}),_&&/* @__PURE__ */ k(`a`,{className:`wui-bell-foot`,href:_,children:i})]})]})}var ve=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function ye({config:e,searchResultsLabel:n,noResultsText:r,noResultsForText:i,resultsCountText:a,resultCountText:o,moreLabel:s}){u(`wui-overflow`,j);let c=w(),{value:l=``,onChange:d,results:f=null,loading:p=!1,onSelect:m,onSubmit:g,onFocus:_,placeholder:v=`Search`}=e,[y,x]=D(!1),[S,O]=D(!1),[M,N]=D({results:null,index:-1}),P=M.results===f?M.index:-1,F=e=>N({results:f,index:e}),I=E(null),L=E(null),R=E([]),z=T(()=>(f??[]).flatMap(e=>e.hits??[]),[f]),B=f!=null&&!S,V=z.length;C(()=>{let e=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||ve(e.target instanceof HTMLElement?e.target:null)||(e.preventDefault(),x(!0),L.current?.focus())},t=e=>{I.current?.contains(e.target instanceof Node?e.target:null)||(O(!0),x(!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(!B||V===0)return;e.preventDefault(),F((P+(e.key===`ArrowDown`?1:-1)+V)%V)}else b(e.nativeEvent)?B&&P>=0&&R.current[P]?(e.preventDefault(),R.current[P].click()):g&&l.trim()!==``&&(e.preventDefault(),g(l.trim())):e.key===`Escape`&&(B?(e.preventDefault(),O(!0)):y&&(e.preventDefault(),x(!1)))},te=-1;return R.current=[],/* @__PURE__ */ k(`wui-overflow`,{class:`wui-topsearch-host`,label:s,children:/* @__PURE__ */ k(`div`,{"data-wui-overflow-list":!0,className:`wui-topsearch-row`,children:/* @__PURE__ */ A(`div`,{className:`wui-topsearch${y?` is-open`:``}${p?` is-loading`:``}`,ref:I,"data-overflow-label":v,children:[/* @__PURE__ */ k(`button`,{type:`button`,className:`topbar-icon-btn wui-topsearch-open`,"aria-label":v,"aria-expanded":y,"aria-controls":`${c}-panel`,onClick:()=>{let e=!y;x(e),e&&L.current?.focus()},children:/* @__PURE__ */ k(h,{name:`search`,size:20})}),/* @__PURE__ */ A(`div`,{className:`wui-topsearch-panel`,id:`${c}-panel`,children:[/* @__PURE__ */ A(`div`,{className:`search-wrap`,children:[/* @__PURE__ */ k(h,{name:`search`,size:18,className:`search-icon`}),/* @__PURE__ */ k(`input`,{ref:L,type:`search`,className:`form-control input search-input`,id:`${c}-input`,placeholder:v,"aria-label":v,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":B,"aria-controls":`${c}-list`,"aria-activedescendant":B&&P>=0?`${c}-opt-${P}`:void 0,autoComplete:`off`,value:l,onChange:e=>{O(!1),d?.(e.target.value)},onKeyDown:ee,onFocus:_})]}),/* @__PURE__ */ k(`div`,{className:`wui-topsearch-results`,id:`${c}-list`,role:`listbox`,"aria-label":n,hidden:!B,children:B&&/* @__PURE__ */ A(`div`,{className:`wui-topsearch-groups`,role:`presentation`,children:[V===0&&/* @__PURE__ */ k(`div`,{className:`wui-topsearch-empty`,role:`option`,"aria-disabled":`true`,"aria-selected":`false`,children:t(i,{value:l})}),f.filter(e=>e.hits?.length).map((e,t)=>/* @__PURE__ */ A(`div`,{className:`wui-topsearch-group`,role:`group`,"aria-label":e.label??``,children:[e.label&&/* @__PURE__ */ k(`div`,{className:`wui-topsearch-group-label`,role:`presentation`,children:e.label}),e.hits.map(e=>{te+=1;let t=te;return/* @__PURE__ */ A(`a`,{className:`wui-topsearch-hit${t===P?` is-active`:``}`,role:`option`,"aria-selected":t===P,id:`${c}-opt-${t}`,href:e.href,ref:e=>{R.current[t]=e},onClick:t=>m?.(e,t),children:[e.icon&&/* @__PURE__ */ k(`span`,{className:`wui-topsearch-hit-icon`,children:/* @__PURE__ */ k(h,{name:e.icon,size:18})}),/* @__PURE__ */ A(`span`,{className:`wui-topsearch-hit-text`,children:[/* @__PURE__ */ k(`span`,{className:`wui-topsearch-hit-title`,children:e.title}),e.subtitle&&/* @__PURE__ */ k(`span`,{className:`wui-topsearch-hit-sub`,children:e.subtitle})]})]},`${e.href}-${t}`)})]},e.label??t))]})})]}),/* @__PURE__ */ k(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:B?V===0?r:t(V===1?o:a,{count:V}):``})]})})})}export{W as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/fillLabel.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./warnUnknownProps.js";import{jsx as i}from"react/jsx-runtime";var a=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},o=!1;function s(t){!o&&a()&&(o=!0,e(`[@webority/ui-react] <AppSparkline> left out ${t} value(s) in \`data\` that are not finite numbers.`))}var c=e=>typeof e==`number`&&Number.isFinite(e);function l(e,t,n){if(e.length<2)return`0,${n/2} ${t},${n/2}`;let r=Math.min(...e),i=Math.max(...e)-r,a=t/(e.length-1);return e.map((e,t)=>{let o=i===0?n/2:n-(e-r)/i*n;return`${t*a},${o}`}).join(` `)}var u=e=>String(Number(e.toFixed(2)));function d(e,n,r){let i=n?t(r.namedTrendLabel,{label:n}):r.trendLabel;return e.length===1?t(r.oneValueText,{name:i,value:u(e[0]??0)}):t(r.rangeText,{name:i,from:u(e[0]??0),to:u(e[e.length-1]??0),count:e.length})}function f(e){let{marker:t,props:a}=n(`AppSparkline`,e),{data:o,label:u,width:f=48,height:p=16,className:m=``,trendLabel:h=`Trend`,namedTrendLabel:g=`{label} trend`,oneValueText:_=`{name} has one value, {value}.`,rangeText:v=`{name} from {from} to {to} across {count} points.`,...y}=a;r(`AppSparkline`,y);let b=Array.isArray(o)?o.filter(c):[];if(Array.isArray(o)&&b.length<o.length&&s(o.length-b.length),b.length===0)return null;let x={trendLabel:h,namedTrendLabel:g,oneValueText:_,rangeText:v};return/* @__PURE__ */ i(`svg`,{className:`wui-sparkline${m?` ${m}`:``}`,width:f,height:p,viewBox:`0 0 ${f} ${p}`,role:`img`,"aria-label":d(b,u,x),...t,...y,children:/* @__PURE__ */ i(`polyline`,{points:l(b,f,p),stroke:`currentColor`,fill:`none`})})}export{f as default};
1
+ import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/fillLabel.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./warnUnknownProps.js";import{jsx as i}from"react/jsx-runtime";var a=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},o=!1;function s(t){!o&&a()&&(o=!0,e(`[@webority/ui-react] <AppSparkline> left out ${t} value(s) in \`data\` that are not finite numbers.`))}var c=e=>typeof e==`number`&&Number.isFinite(e);function l(e,t,n,r){if(e.length<2)return`0,${n/2} ${t},${n/2}`;let i=r===void 0?Math.min(...e):Math.min(r,...e),a=Math.max(...e)-i,o=t/(e.length-1);return e.map((e,t)=>{let r=a===0?n/2:n-(e-i)/a*n;return`${t*o},${r}`}).join(` `)}var u=e=>String(Number(e.toFixed(2)));function d(e,n,r){let i=n?t(r.namedTrendLabel,{label:n}):r.trendLabel;return e.length===1?t(r.oneValueText,{name:i,value:u(e[0]??0)}):t(r.rangeText,{name:i,from:u(e[0]??0),to:u(e[e.length-1]??0),count:e.length})}function f(e){let{marker:t,props:a}=n(`AppSparkline`,e),{data:o,label:u,width:f=48,height:p=16,className:m=``,trendLabel:h=`Trend`,namedTrendLabel:g=`{label} trend`,oneValueText:_=`{name} has one value, {value}.`,rangeText:v=`{name} from {from} to {to} across {count} points.`,yMin:y,...b}=a;r(`AppSparkline`,b);let x=Array.isArray(o)?o.filter(c):[];if(Array.isArray(o)&&x.length<o.length&&s(o.length-x.length),x.length===0)return null;let S={trendLabel:h,namedTrendLabel:g,oneValueText:_,rangeText:v};return/* @__PURE__ */ i(`svg`,{className:`wui-sparkline${m?` ${m}`:``}`,width:f,height:p,viewBox:`0 0 ${f} ${p}`,role:`img`,"aria-label":d(x,u,S),...t,...b,children:/* @__PURE__ */ i(`polyline`,{points:l(x,f,p,y),stroke:`currentColor`,fill:`none`})})}export{f as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/FieldMessage.js";import{FIELD_BUSY_CLASS as n,FIELD_SIZES as r}from"../lib/fieldState.js";import{splitMarkerProps as i}from"../lib/wuiMarker.js";import a from"./AppInfoTip.js";import o from"./AppRequiredMark.js";import s from"./assertValidValue.js";import ee from"./warnUnknownProps.js";import{forwardRef as c,useCallback as l,useEffect as u,useId as d,useLayoutEffect as f,useRef as p,useState as te}from"react";import{Form as m}from"react-bootstrap";import{jsx as h,jsxs as g}from"react/jsx-runtime";var _=e=>e!=null&&e!==``&&e!==!1,v=c(function(c,v){let{marker:y,props:ne}=i(`AppTextarea`,c),{label:b,required:x=!1,optional:S=!1,optionalLabel:C=`(optional)`,error:w,helperText:T,help:E,helpLabel:D=`More information`,id:re,name:ie,rows:ae=4,autoGrow:O=!1,monospace:oe=!1,showCount:k=!1,maxLength:A,disabled:j=!1,readOnly:M=!1,loading:N=!1,size:P=`md`,className:F=``,fieldClassName:I=``,controlOnly:L=!1,value:R,...z}=ne,{onChange:B,...V}=z;if(L){let e=[[`label`,b],[`error`,w],[`helperText`,T],[`fieldClassName`,I],[`showCount`,k],[`help`,E],[`optional`,S]];for(let[t,n]of e)if(_(n))throw Error(`<AppTextarea> controlOnly draws no field, so it takes no ${t}; draw the label or message on the page.`)}ee(`AppTextarea`,z),s(`AppTextarea`,`size`,P,r),u(()=>{S&&x&&typeof process<`u`&&process.env.NODE_ENV!==`production`&&e(`AppTextarea: optional and required together; optional ignored`)},[S,x]);let H=d(),U=re||H,W=[`textarea`,O?`autosize`:``,oe?`wui-mono`:``,w?`error`:``,P===`sm`?`input-sm`:``,P===`lg`?`input-lg`:``,N?n:``,F].filter(Boolean).join(` `),G=w&&U?`${U}-error`:void 0,K=T&&U?`${U}-hint`:void 0,q=G||K,J=p(null),se=e=>{J.current=e,typeof v==`function`?v(e):v&&(v.current=e)},Y=p(void 0),X=l(()=>{let e=J.current;e&&(e.style.height=`auto`,e.style.height=`${e.scrollHeight}px`,Y.current=`${e.value}|${e.clientWidth}`)},[]);f(()=>{let e=J.current;!O||!e?Y.current=void 0:`${String(R??e.value)}|${e.clientWidth}`!==Y.current&&X()});let[Z,Q]=te(()=>String(R??z.defaultValue??``).length);u(()=>{k&&R!==void 0&&Q(String(R??``).length)},[R,k]);let ce=e=>{O&&X(),k&&Q(e.currentTarget.value.length),z.onInput?.(e)},$=/* @__PURE__ */ h(m.Control,{as:`textarea`,id:U,name:ie,rows:ae,className:W,"aria-invalid":w?`true`:`false`,"aria-describedby":q,"aria-busy":N||void 0,required:x,maxLength:A,disabled:j,readOnly:M||N,...L?y:null,...R===void 0?null:{value:R},...V,...B?{onChange:B}:null,ref:se,onInput:ce});return L?$:/* @__PURE__ */ g(m.Group,{...y,className:`field${I?` ${I}`:``}`,children:[b&&/* @__PURE__ */ g(m.Label,{className:`label`,htmlFor:U,children:[b,S&&!x&&/* @__PURE__ */ h(`span`,{className:`label-optional`,children:` ${C}`}),x&&/* @__PURE__ */ h(o,{}),E&&/* @__PURE__ */ h(a,{label:D,children:E})]}),$,/* @__PURE__ */ h(t,{error:w,hint:T,errorId:G,hintId:K}),k&&/* @__PURE__ */ g(`div`,{className:`field-count${A&&Z>=A?` at-limit`:``}`,children:[Z,A?` / ${A}`:``]})]})});export{v as default};
1
+ import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/FieldMessage.js";import{FIELD_BUSY_CLASS as n,FIELD_SIZES as r}from"../lib/fieldState.js";import{splitMarkerProps as i}from"../lib/wuiMarker.js";import a from"./AppInfoTip.js";import o from"./AppRequiredMark.js";import s from"./assertValidValue.js";import ee from"./warnUnknownProps.js";import{forwardRef as c,useCallback as l,useEffect as u,useId as d,useLayoutEffect as f,useRef as p,useState as te}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{Form as g}from"react-bootstrap";var _=e=>e!=null&&e!==``&&e!==!1,v=c(function(c,v){let{marker:y,props:ne}=i(`AppTextarea`,c),{label:b,required:x=!1,optional:S=!1,optionalLabel:C=`(optional)`,error:w,helperText:T,help:E,helpLabel:D=`More information`,id:re,name:ie,rows:ae=4,autoGrow:O=!1,monospace:oe=!1,showCount:k=!1,maxLength:A,disabled:j=!1,readOnly:M=!1,loading:N=!1,size:P=`md`,className:F=``,fieldClassName:I=``,controlOnly:L=!1,value:R,...z}=ne,{onChange:B,...V}=z;if(L){let e=[[`label`,b],[`error`,w],[`helperText`,T],[`fieldClassName`,I],[`showCount`,k],[`help`,E],[`optional`,S]];for(let[t,n]of e)if(_(n))throw Error(`<AppTextarea> controlOnly draws no field, so it takes no ${t}; draw the label or message on the page.`)}ee(`AppTextarea`,z),s(`AppTextarea`,`size`,P,r),u(()=>{S&&x&&typeof process<`u`&&process.env.NODE_ENV!==`production`&&e(`AppTextarea: optional and required together; optional ignored`)},[S,x]);let H=d(),U=re||H,W=[`textarea`,O?`autosize`:``,oe?`wui-mono`:``,w?`error`:``,P===`sm`?`input-sm`:``,P===`lg`?`input-lg`:``,N?n:``,F].filter(Boolean).join(` `),G=w&&U?`${U}-error`:void 0,K=T&&U?`${U}-hint`:void 0,q=G||K,J=p(null),se=e=>{J.current=e,typeof v==`function`?v(e):v&&(v.current=e)},Y=p(void 0),X=l(()=>{let e=J.current;e&&(e.style.height=`auto`,e.style.height=`${e.scrollHeight}px`,Y.current=`${e.value}|${e.clientWidth}`)},[]);f(()=>{let e=J.current;!O||!e?Y.current=void 0:`${String(R??e.value)}|${e.clientWidth}`!==Y.current&&X()});let[Z,Q]=te(()=>String(R??z.defaultValue??``).length);u(()=>{k&&R!==void 0&&Q(String(R??``).length)},[R,k]);let ce=e=>{O&&X(),k&&Q(e.currentTarget.value.length),z.onInput?.(e)},$=/* @__PURE__ */ m(g.Control,{as:`textarea`,id:U,name:ie,rows:ae,className:W,"aria-invalid":w?`true`:`false`,"aria-describedby":q,"aria-busy":N||void 0,required:x,maxLength:A,disabled:j,readOnly:M||N,...L?y:null,...R===void 0?null:{value:R},...V,...B?{onChange:B}:null,ref:se,onInput:ce});return L?$:/* @__PURE__ */ h(g.Group,{...y,className:`field${I?` ${I}`:``}`,children:[b&&/* @__PURE__ */ h(g.Label,{className:`label`,htmlFor:U,children:[b,S&&!x&&/* @__PURE__ */ m(`span`,{className:`label-optional`,children:` ${C}`}),x&&/* @__PURE__ */ m(o,{}),E&&/* @__PURE__ */ m(a,{label:D,children:E})]}),$,/* @__PURE__ */ m(t,{error:w,hint:T,errorId:G,hintId:K}),k&&/* @__PURE__ */ h(`div`,{className:`field-count${A&&Z>=A?` at-limit`:``}`,children:[Z,A?` / ${A}`:``]})]})});export{v as default};
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppActionIcon.js";import n from"./AppSegmented.js";import r from"./assertValidValue.js";import i from"./warnUnknownProps.js";import{DEFAULT_THEME_EFFECT as a,DEFAULT_THEME_STORAGE_KEY as o,THEME_CHANGE_EVENT as s,THEME_EFFECTS as c,THEME_MODES as l,applyTheme as u,nextTheme as d,readStoredTheme as f,resolveTheme as p,storeTheme as m,transitionTheme as h,watchSystemTheme as g}from"@webority/ui-elements/helpers";import{useCallback as _,useEffect as v,useId as y,useRef as b,useState as x}from"react";import{jsx as S}from"react/jsx-runtime";import{flushSync as C}from"react-dom";function w(e){return l.some(t=>t===e)}var T={light:`sun`,dark:`moon`,auto:`monitor`},E={light:`light`,dark:`dark`,auto:`follows your device`},D=[`icon`,`segmented`],O={sm:16,md:20,lg:24,xl:28};function k(l){let{marker:k,props:A}=e(`AppThemeToggle`,l),{variant:j=`icon`,effect:M=a,includeAuto:N=!0,storageKey:P=o,duration:F,label:I=`Theme`,lightLabel:L=`Light`,darkLabel:R=`Dark`,autoLabel:z=`System`,name:B,size:V=`md`,tooltipPlacement:H=`auto`,onChange:U,className:W=``,...G}=A;i(`AppThemeToggle`,G),r(`AppThemeToggle`,`variant`,j,D),r(`AppThemeToggle`,`effect`,M,c),r(`AppThemeToggle`,`size`,V,Object.keys(O));let K=_(e=>e===`auto`&&!N?p(e):e,[N]),[q,J]=x(()=>K(typeof window>`u`?`auto`:f(P))),Y=y(),X=B||Y,Z=b({shown:K,storageKey:P});v(()=>{let e=document.documentElement.getAttribute(`data-theme`);w(e)?J(Z.current.shown(e)):u(f(Z.current.storageKey))},[]),v(()=>{let e=e=>{if(!(e instanceof CustomEvent))throw Error(`wui:theme:change arrived without a CustomEvent`);let t=`detail`in e?e.detail:void 0,n=typeof t==`object`&&t&&`preference`in t?t.preference:void 0;w(n)&&J(K(n))};return document.addEventListener(s,e),()=>document.removeEventListener(s,e)},[K]),v(()=>g(()=>{document.documentElement.getAttribute(`data-theme`)===`auto`&&u(`auto`)}),[]);let Q=_((e,t)=>{let n=t?.getBoundingClientRect?.()??{left:0,top:0,width:0,height:0},r={x:n.left+n.width/2,y:n.top+n.height/2};h(()=>{u(e),m(e,P),C(()=>J(e)),U?.(e)},{effect:M,to:p(e),origin:r,...F===void 0?null:{duration:F}})},[P,M,F,U]);if(j===`segmented`){let e=[{value:`light`,label:L,icon:T.light},{value:`dark`,label:R,icon:T.dark}];return N&&e.push({value:`auto`,label:z,icon:T.auto}),/* @__PURE__ */ S(n,{...k,options:e,value:q,name:X,label:I,size:V===`xl`?`lg`:V,className:[`wui-theme-toggle`,`wui-theme-toggle-segmented`,W].filter(Boolean).join(` `),onChange:e=>{if(!w(e)||e===q)return;let t=document.querySelector(`.segmented-input[name="${CSS.escape(X)}"][value="${e}"]`);Q(e,t?.closest(`.segmented-option`)??t)}})}return/* @__PURE__ */ S(t,{...k,icon:T[q],label:`${I}: ${E[q]}`,size:O[V]??O.md,tooltipPlacement:H,onClick:e=>Q(d(q,{includeAuto:N}),e.currentTarget),className:[`wui-theme-toggle`,W].filter(Boolean).join(` `)})}export{k as default};
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppActionIcon.js";import n from"./AppSegmented.js";import r from"./assertValidValue.js";import i from"./warnUnknownProps.js";import{DEFAULT_THEME_EFFECT as a,DEFAULT_THEME_STORAGE_KEY as o,THEME_CHANGE_EVENT as s,THEME_EFFECTS as c,THEME_MODES as l,applyTheme as u,nextTheme as d,readStoredTheme as f,resolveTheme as p,storeTheme as m,transitionTheme as h,watchSystemTheme as g}from"@webority/ui-elements/helpers";import{useCallback as _,useEffect as v,useId as y,useRef as b,useState as x}from"react";import{flushSync as S}from"react-dom";import{jsx as C}from"react/jsx-runtime";function w(e){return l.some(t=>t===e)}var T={light:`sun`,dark:`moon`,auto:`monitor`},E={light:`light`,dark:`dark`,auto:`follows your device`},D=[`icon`,`segmented`],O={sm:16,md:20,lg:24,xl:28};function k(l){let{marker:k,props:A}=e(`AppThemeToggle`,l),{variant:j=`icon`,effect:M=a,includeAuto:N=!0,storageKey:P=o,duration:F,label:I=`Theme`,lightLabel:L=`Light`,darkLabel:R=`Dark`,autoLabel:z=`System`,name:B,size:V=`md`,tooltipPlacement:H=`auto`,onChange:U,className:W=``,...G}=A;i(`AppThemeToggle`,G),r(`AppThemeToggle`,`variant`,j,D),r(`AppThemeToggle`,`effect`,M,c),r(`AppThemeToggle`,`size`,V,Object.keys(O));let K=_(e=>e===`auto`&&!N?p(e):e,[N]),[q,J]=x(()=>K(typeof window>`u`?`auto`:f(P))),Y=y(),X=B||Y,Z=b({shown:K,storageKey:P});v(()=>{let e=document.documentElement.getAttribute(`data-theme`);w(e)?J(Z.current.shown(e)):u(f(Z.current.storageKey))},[]),v(()=>{let e=e=>{if(!(e instanceof CustomEvent))throw Error(`wui:theme:change arrived without a CustomEvent`);let t=`detail`in e?e.detail:void 0,n=typeof t==`object`&&t&&`preference`in t?t.preference:void 0;w(n)&&J(K(n))};return document.addEventListener(s,e),()=>document.removeEventListener(s,e)},[K]),v(()=>g(()=>{document.documentElement.getAttribute(`data-theme`)===`auto`&&u(`auto`)}),[]);let Q=_((e,t)=>{let n=t?.getBoundingClientRect?.()??{left:0,top:0,width:0,height:0},r={x:n.left+n.width/2,y:n.top+n.height/2};h(()=>{u(e),m(e,P),S(()=>J(e)),U?.(e)},{effect:M,to:p(e),origin:r,...F===void 0?null:{duration:F}})},[P,M,F,U]);if(j===`segmented`){let e=[{value:`light`,label:L,icon:T.light},{value:`dark`,label:R,icon:T.dark}];return N&&e.push({value:`auto`,label:z,icon:T.auto}),/* @__PURE__ */ C(n,{...k,options:e,value:q,name:X,label:I,size:V===`xl`?`lg`:V,className:[`wui-theme-toggle`,`wui-theme-toggle-segmented`,W].filter(Boolean).join(` `),onChange:e=>{if(!w(e)||e===q)return;let t=document.querySelector(`.segmented-input[name="${CSS.escape(X)}"][value="${e}"]`);Q(e,t?.closest(`.segmented-option`)??t)}})}return/* @__PURE__ */ C(t,{...k,icon:T[q],label:`${I}: ${E[q]}`,size:O[V]??O.md,tooltipPlacement:H,onClick:e=>Q(d(q,{includeAuto:N}),e.currentTarget),className:[`wui-theme-toggle`,W].filter(Boolean).join(` `)})}export{k as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppIcon.js";import r from"./assertValidValue.js";import{TOAST_ANIMATIONS as i,TOAST_SHAPES as a,TOAST_SURFACES as o,adoptToast as s,dismissToast as c,subscribeToasts as l}from"./toastStore.js";import u from"./warnUnknownProps.js";import{useEffect as d,useRef as f,useState as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";var g={success:{icon:`check-circle`,assertive:!1},info:{icon:`info`,assertive:!1},warning:{icon:`alert-triangle`,assertive:!0},danger:{icon:`alert-circle`,assertive:!0}},_=e=>Object.keys(g).includes(e),v={"top-start":`top-0 start-0`,"top-center":`top-0 start-50 translate-middle-x`,"top-end":`top-0 end-0`,"middle-center":`top-50 start-50 translate-middle`,"bottom-start":`bottom-0 start-0`,"bottom-center":`bottom-0 start-50 translate-middle-x`,"bottom-end":`bottom-0 end-0`},y=64;function b(n){let{marker:s,props:c}=t(`AppToast`,n),{position:f=`bottom-end`,maxVisible:g=4,animation:_=`rise`,shape:y=`rounded`,surface:b=`auto`,offset:S,className:C=``,...w}=c;u(`AppToast`,w),r(`AppToast`,`position`,f,Object.keys(v)),r(`AppToast`,`animation`,_,i),r(`AppToast`,`shape`,y,a),r(`AppToast`,`surface`,b,o);let[T,E]=p([]);d(()=>l(E),[]);let D=typeof S==`number`&&Number.isFinite(S)&&S>=0;d(()=>{S==null||D||e(`[@webority/ui-react] <AppToast> received offset="${String(S)}", which must be a number of pixels, 0 or more. The default offset is used instead.`)},[S,D]);let{style:O,...k}=w,A={"--wui-toast-offset":`${S}px`},j=D?{...A,...O}:O,M=Math.max(0,T.length-g),N=M?T.slice(M):T,P=v[f]??v[`bottom-end`];return/* @__PURE__ */ h(`div`,{...s,...k,style:j,className:`wui-toast-container toast-container position-fixed ${P} p-3 ${C}`.trim(),children:[M>0&&/* @__PURE__ */ h(`div`,{className:`wui-toast-more`,"aria-hidden":`true`,children:[`+`,M,` more`]}),N.map(e=>/* @__PURE__ */ m(x,{toast:e,defaultAnimation:_,defaultShape:y,defaultSurface:b},e.id))]})}function x({toast:e,defaultAnimation:t=`rise`,defaultShape:r=`rounded`,defaultSurface:i=`auto`}){if(!_(e.variant))throw Error(`<AppToast> has no tone for the variant "${e.variant}".`);let a=g[e.variant],o=e.animation??t,l=e.shape??r,u=e.surface??i,v=(o===`rise`?``:` wui-toast--anim-${o}`)+(l===`rounded`?``:` wui-toast--shape-${l}`)+(u===`inverse`?` wui-toast--surface-inverse`:``),b=e.duration===0,[x,S]=p(0),[C,w]=p(!1),T=f(null),E=()=>c(e.id),D=f(null);d(()=>{if(e.duration===0)return;s(e.id);let t=D.current,n=t==null?``:getComputedStyle(t).animationName;if(t!=null&&(typeof t.getAnimations==`function`?t.getAnimations().length>0:n!==``&&n!==`none`))return;let r=setTimeout(()=>c(e.id),e.duration);return()=>clearTimeout(r)},[e.id,e.duration]);let O=e=>{if(e.button===0){if(!(e.target instanceof Element))throw Error(`<AppToast> received a pointer event whose target is not an element.`);e.target.closest(`button`)||(T.current=e.clientX,w(!0),e.currentTarget.setPointerCapture?.(e.pointerId))}},k=e=>{T.current!==null&&S(e.clientX-T.current)},A=()=>{T.current=null,w(!1),S(0)},j=e=>{if(T.current===null)return;let t=e.clientX-T.current;Math.abs(t)>y?E():A()},M=x?{transform:`translateX(${x}px)`,opacity:Math.max(0,1-Math.abs(x)/200)}:void 0,N=e.message;return/* @__PURE__ */ h(`div`,{className:`toast show wui-toast wui-toast--${e.variant}${v}${C?` wui-toast--dragging`:``}`,role:a.assertive?`alert`:`status`,"aria-live":a.assertive?`assertive`:`polite`,"aria-atomic":`true`,style:M,onPointerDown:O,onPointerMove:k,onPointerUp:j,onPointerCancel:A,children:[/* @__PURE__ */ m(`span`,{className:`wui-toast-icon`,"aria-hidden":`true`,children:/* @__PURE__ */ m(n,{name:a.icon,size:20})}),/* @__PURE__ */ h(`div`,{className:`wui-toast-content`,children:[e.title&&/* @__PURE__ */ m(`div`,{className:`wui-toast-title`,children:e.title}),/* @__PURE__ */ m(`div`,{className:`wui-toast-message`,children:N}),typeof e.progress==`number`&&/* @__PURE__ */ h(`div`,{className:`wui-toast-task`,children:[/* @__PURE__ */ m(`div`,{className:`wui-toast-track`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(e.progress),children:/* @__PURE__ */ m(`div`,{className:`wui-toast-track-fill`,style:{width:`${e.progress}%`}})}),/* @__PURE__ */ h(`span`,{className:`wui-toast-track-pct`,"aria-hidden":`true`,children:[Math.round(e.progress),`%`]})]}),e.action&&/* @__PURE__ */ m(`button`,{type:`button`,className:`wui-toast-action`,onClick:()=>{e.action?.onClick?.(),E()},children:e.action.label})]}),/* @__PURE__ */ m(`button`,{type:`button`,className:`btn-close wui-toast-close`,"aria-label":`Close`,onClick:E}),!b&&/* @__PURE__ */ m(`div`,{ref:D,className:`wui-toast-progress`,style:{animationDuration:`${e.duration}ms`},onAnimationEnd:E})]})}export{b as default};
1
+ import{devWarn as e}from"../lib/devWarn.js";import{useOverlayRoot as t}from"../lib/useOverlayRoot.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppIcon.js";import i from"./assertValidValue.js";import{TOAST_ANIMATIONS as a,TOAST_SHAPES as o,TOAST_SURFACES as s,adoptToast as c,dismissToast as l,subscribeToasts as u}from"./toastStore.js";import d from"./warnUnknownProps.js";import{raisePopover as f}from"@webority/ui-elements/helpers";import{useEffect as p,useRef as m,useState as h}from"react";import{createPortal as g}from"react-dom";import{jsx as _,jsxs as v}from"react/jsx-runtime";var y={success:{icon:`check-circle`,assertive:!1},info:{icon:`info`,assertive:!1},warning:{icon:`alert-triangle`,assertive:!0},danger:{icon:`alert-circle`,assertive:!0}},b=e=>Object.keys(y).includes(e),x={"top-start":`top-0 start-0`,"top-center":`top-0 start-50 translate-middle-x`,"top-end":`top-0 end-0`,"middle-center":`top-50 start-50 translate-middle`,"bottom-start":`bottom-0 start-0`,"bottom-center":`bottom-0 start-50 translate-middle-x`,"bottom-end":`bottom-0 end-0`},S=64;function C(r){let{marker:c,props:l}=n(`AppToast`,r),{position:y=`bottom-end`,maxVisible:b=4,animation:S=`rise`,shape:C=`rounded`,surface:T=`auto`,offset:E,className:D=``,...O}=l;d(`AppToast`,O),i(`AppToast`,`position`,y,Object.keys(x)),i(`AppToast`,`animation`,S,a),i(`AppToast`,`shape`,C,o),i(`AppToast`,`surface`,T,s);let[k,A]=h([]);p(()=>u(A),[]);let j=t(),M=m(null);p(()=>{let e=M.current;j&&e&&k.length!==0&&f(e)},[k,j]);let N=typeof E==`number`&&Number.isFinite(E)&&E>=0;p(()=>{E==null||N||e(`[@webority/ui-react] <AppToast> received offset="${String(E)}", which must be a number of pixels, 0 or more. The default offset is used instead.`)},[E,N]);let{style:P,...F}=O,I={"--wui-toast-offset":`${E}px`},L=N?{...I,...P}:P,R=Math.max(0,k.length-b),z=R?k.slice(R):k,B=x[y]??x[`bottom-end`];return j?g(/* @__PURE__ */ v(`div`,{...c,...F,ref:M,popover:`manual`,style:L,className:`wui-toast-container toast-container position-fixed ${B} p-3 ${D}`.trim(),children:[R>0&&/* @__PURE__ */ v(`div`,{className:`wui-toast-more`,"aria-hidden":`true`,children:[`+`,R,` more`]}),z.map(e=>/* @__PURE__ */ _(w,{toast:e,defaultAnimation:S,defaultShape:C,defaultSurface:T},e.id))]}),j):null}function w({toast:e,defaultAnimation:t=`rise`,defaultShape:n=`rounded`,defaultSurface:i=`auto`}){if(!b(e.variant))throw Error(`<AppToast> has no tone for the variant "${e.variant}".`);let a=y[e.variant],o=e.animation??t,s=e.shape??n,u=e.surface??i,d=(o===`rise`?``:` wui-toast--anim-${o}`)+(s===`rounded`?``:` wui-toast--shape-${s}`)+(u===`inverse`?` wui-toast--surface-inverse`:``),f=e.duration===0,[g,x]=h(0),[C,w]=h(!1),T=m(null),E=()=>l(e.id),D=m(null);p(()=>{if(e.duration===0)return;c(e.id);let t=D.current,n=t==null?``:getComputedStyle(t).animationName;if(t!=null&&(typeof t.getAnimations==`function`?t.getAnimations().length>0:n!==``&&n!==`none`))return;let r=setTimeout(()=>l(e.id),e.duration);return()=>clearTimeout(r)},[e.id,e.duration]);let O=e=>{if(e.button===0){if(!(e.target instanceof Element))throw Error(`<AppToast> received a pointer event whose target is not an element.`);e.target.closest(`button`)||(T.current=e.clientX,w(!0),e.currentTarget.setPointerCapture?.(e.pointerId))}},k=e=>{T.current!==null&&x(e.clientX-T.current)},A=()=>{T.current=null,w(!1),x(0)},j=e=>{if(T.current===null)return;let t=e.clientX-T.current;Math.abs(t)>S?E():A()},M=g?{transform:`translateX(${g}px)`,opacity:Math.max(0,1-Math.abs(g)/200)}:void 0,N=e.message;return/* @__PURE__ */ v(`div`,{className:`toast show wui-toast wui-toast--${e.variant}${d}${C?` wui-toast--dragging`:``}`,role:a.assertive?`alert`:`status`,"aria-live":a.assertive?`assertive`:`polite`,"aria-atomic":`true`,style:M,onPointerDown:O,onPointerMove:k,onPointerUp:j,onPointerCancel:A,children:[/* @__PURE__ */ _(`span`,{className:`wui-toast-icon`,"aria-hidden":`true`,children:/* @__PURE__ */ _(r,{name:a.icon,size:20})}),/* @__PURE__ */ v(`div`,{className:`wui-toast-content`,children:[e.title&&/* @__PURE__ */ _(`div`,{className:`wui-toast-title`,children:e.title}),/* @__PURE__ */ _(`div`,{className:`wui-toast-message`,children:N}),typeof e.progress==`number`&&/* @__PURE__ */ v(`div`,{className:`wui-toast-task`,children:[/* @__PURE__ */ _(`div`,{className:`wui-toast-track`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(e.progress),children:/* @__PURE__ */ _(`div`,{className:`wui-toast-track-fill`,style:{width:`${e.progress}%`}})}),/* @__PURE__ */ v(`span`,{className:`wui-toast-track-pct`,"aria-hidden":`true`,children:[Math.round(e.progress),`%`]})]}),e.action&&/* @__PURE__ */ _(`button`,{type:`button`,className:`wui-toast-action`,onClick:()=>{e.action?.onClick?.(),E()},children:e.action.label})]}),/* @__PURE__ */ _(`button`,{type:`button`,className:`btn-close wui-toast-close`,"aria-label":`Close`,onClick:E}),!f&&/* @__PURE__ */ _(`div`,{ref:D,className:`wui-toast-progress`,style:{animationDuration:`${e.duration}ms`},onAnimationEnd:E})]})}export{C as default};
@@ -1 +1 @@
1
- import{shortcutChip as e}from"../lib/shortcutChip.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./assertValidValue.js";import r from"./warnUnknownProps.js";import{cloneElement as i,useEffect as a,useId as o,useRef as s,useState as c}from"react";import{OverlayTrigger as l,Tooltip as u}from"react-bootstrap";import{jsx as d,jsxs as f}from"react/jsx-runtime";var p=[`neutral`,`primary`,`success`,`warning`,`danger`],m=[`inverse`],h=[`sm`,`md`,`lg`],g={start:`left`,end:`right`,top:`top`,bottom:`bottom`},_=[`auto`,`top`,`bottom`,`start`,`end`],v={modifiers:[{name:`offset`,options:{offset:[0,6]}}]};function y(y){let{marker:b,props:x}=t(`AppTooltip`,y),{content:S,children:C,placement:w=`top`,tone:T=`neutral`,variant:E,size:D=`md`,open:O,shortcut:k,className:A=``,...j}=x;r(`AppTooltip`,j),n(`AppTooltip`,`tone`,T,p),n(`AppTooltip`,`variant`,E,m),n(`AppTooltip`,`size`,D,h),n(`AppTooltip`,`placement`,w,_);let M=o(),[N,P]=c(!1),F=typeof O==`boolean`,I=[`wui-tooltip`,T&&T!==`neutral`?`tone-${T}`:``,E?`wui-tooltip-${E}`:``,D&&D!==`md`?`size-${D}`:``,A].filter(Boolean).join(` `),L=/* @__PURE__ */ f(u,{id:M,className:I,...b,children:[S,e(k,{inTooltip:!0})]}),R=e=>{C.props.onClick?.(e),j.onClick?.(e),P(!1)},z=s(!1),B=e=>{C.props.onFocusCapture?.(e),j.onFocusCapture?.(e),z.current=!e.currentTarget.matches?.(`:focus-visible`),queueMicrotask(()=>{z.current=!1})};return a(()=>{if(F||!N)return;let e=e=>{e.key===`Escape`&&(e.stopPropagation(),P(!1))};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[F,N]),/* @__PURE__ */ d(l,{trigger:[`hover`,`focus`],placement:g[w]??`auto`,popperConfig:v,show:F?O:N,...F?null:{onToggle:e=>{let t=z.current;z.current=!1,e&&t||P(e)}},overlay:L,children:F?i(C,j):i(C,{...j,onClick:R,onFocusCapture:B})})}export{y as default};
1
+ import{shortcutChip as e}from"../lib/shortcutChip.js";import{useOverlayRoot as t}from"../lib/useOverlayRoot.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./assertValidValue.js";import i from"./warnUnknownProps.js";import{TOOLTIP_ATTRIBUTE as a,TOOLTIP_CLASS_ATTRIBUTE as o,TOOLTIP_ID_ATTRIBUTE as s,TOOLTIP_OPEN_ATTRIBUTE as c,TOOLTIP_PLACEMENT_ATTRIBUTE as l,wireTooltips as u}from"@webority/ui-elements/helpers";import{cloneElement as d,useEffect as f,useId as p}from"react";import{createPortal as m}from"react-dom";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";var v=[`neutral`,`primary`,`success`,`warning`,`danger`],y=[`inverse`],b=[`sm`,`md`,`lg`],x=[`auto`,`top`,`bottom`,`start`,`end`];function S(S){let{marker:C,props:w}=n(`AppTooltip`,S),{content:T,children:E,placement:D=`top`,tone:O=`neutral`,variant:k,size:A=`md`,open:j,shortcut:M,className:N=``,...P}=w;i(`AppTooltip`,P),r(`AppTooltip`,`tone`,O,v),r(`AppTooltip`,`variant`,k,y),r(`AppTooltip`,`size`,A,b),r(`AppTooltip`,`placement`,D,x);let F=p(),I=t();f(()=>{u(document)},[]);let L=[`wui-tooltip`,O&&O!==`neutral`?`tone-${O}`:``,k?`wui-tooltip-${k}`:``,A&&A!==`md`?`size-${A}`:``,N].filter(Boolean).join(` `),R=typeof T==`string`&&!M?.trim();f(()=>{if(!R&&!I)throw Error(`<AppTooltip> has no overlay root to mount its bubble in.`)},[R,I]);let z=R?{[a]:T,[l]:D,[o]:L}:{[s]:F};return z[c]=j?``:void 0,/* @__PURE__ */ _(h,{children:[d(E,{...P,...z}),!R&&I?m(/* @__PURE__ */ _(`div`,{id:F,className:`tooltip ${L}`,role:`tooltip`,popover:`manual`,...C,children:[/* @__PURE__ */ g(`div`,{className:`tooltip-arrow`}),/* @__PURE__ */ _(`div`,{className:`tooltip-inner`,children:[T,e(M,{inTooltip:!0})]})]}),I):null]})}export{S as default};
@@ -1 +1 @@
1
- import{linkTarget as e}from"../lib/linkTarget.js";import{TargetLink as t}from"../lib/TargetLink.js";import n from"../lib/useElementEntry.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppIcon.js";import a from"./assertValidValue.js";import o from"./warnUnknownProps.js";import{formatDate as s}from"@webority/ui-elements/helpers";import{useEffect as c,useRef as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";var f=[`dot`,`count`],p=()=>import(`@webority/ui-elements/elements/whats-new`),m=e=>typeof e==`object`&&!!e&&`through`in e&&typeof e.through==`string`;function h(e){n(`wui-whats-new`,p);let{marker:t,props:h}=r(`AppWhatsNew`,e),{entries:_=[],storageKey:v,readThrough:y,indicator:b=`dot`,label:x=`What's new`,unreadLabel:S=`unread`,emptyText:C=`Nothing new yet`,onRead:w,linkComponent:T,className:E=``,...D}=h;o(`AppWhatsNew`,D),a(`AppWhatsNew`,`indicator`,b,f);let O=l(null),k=l(w);return k.current=w,c(()=>{let e=O.current;if(!e)return;let t=e=>{let t=e instanceof CustomEvent?e.detail:void 0;if(!m(t))throw Error(`wui-whats-new-read carried no read-through date`);k.current?.(t.through)};return e.addEventListener(`wui-whats-new-read`,t),()=>e.removeEventListener(`wui-whats-new-read`,t)},[]),/* @__PURE__ */ d(`wui-whats-new`,{ref:O,class:[`wui-whats-new`,E].filter(Boolean).join(` `),"storage-key":v||void 0,"read-through":y||void 0,indicator:b,...t,...D,children:[/* @__PURE__ */ d(`button`,{type:`button`,className:`u-action wui-whats-new-trigger`,"aria-haspopup":`dialog`,children:[/* @__PURE__ */ u(i,{name:`gift`,size:20}),/* @__PURE__ */ u(`span`,{className:`wui-whats-new-name`,children:x}),/* @__PURE__ */ u(`span`,{className:`wui-whats-new-unread`,children:` ${S}`}),/* @__PURE__ */ u(`span`,{className:`wui-whats-new-dot`,"aria-hidden":`true`})]}),/* @__PURE__ */ d(`div`,{className:`wui-whats-new-panel`,role:`dialog`,"aria-label":x,tabIndex:-1,children:[/* @__PURE__ */ u(`h2`,{className:`wui-whats-new-title`,children:x}),_.length>0?/* @__PURE__ */ u(`ol`,{className:`wui-whats-new-list`,children:_.map((e,t)=>/* @__PURE__ */ d(`li`,{className:`wui-whats-new-entry`,children:[/* @__PURE__ */ u(`time`,{className:`wui-whats-new-date`,dateTime:e.date,children:s(e.date)}),/* @__PURE__ */ u(`h3`,{className:`wui-whats-new-entry-title`,children:e.title}),e.body&&/* @__PURE__ */ u(`p`,{className:`wui-whats-new-body`,children:e.body}),e.imageSrc&&/* @__PURE__ */ u(`img`,{className:`wui-whats-new-image`,src:e.imageSrc,alt:e.imageAlt??``,loading:`lazy`}),e.href&&/* @__PURE__ */ u(g,{entry:e,linkComponent:T})]},e.id??`${e.date}-${t}`))}):/* @__PURE__ */ u(`p`,{className:`wui-whats-new-empty`,children:C})]})]})}function g({entry:n,linkComponent:r}){let i=e(r,{href:n.href});return/* @__PURE__ */ u(t,{link:i,className:`wui-whats-new-link`,children:n.linkLabel||`Learn more`})}export{h as default};
1
+ import{linkTarget as e}from"../lib/linkTarget.js";import{TargetLink as t}from"../lib/TargetLink.js";import n from"../lib/useElementEntry.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppIcon.js";import a from"./assertValidValue.js";import o from"./warnUnknownProps.js";import{formatDate as s}from"@webority/ui-elements/helpers";import{useEffect as c,useRef as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";var f=[`dot`,`count`],p=()=>import(`@webority/ui-elements/elements/whats-new`),m=e=>typeof e==`object`&&!!e&&`through`in e&&typeof e.through==`string`;function h(e){n(`wui-whats-new`,p);let{marker:t,props:h}=r(`AppWhatsNew`,e),{entries:_=[],storageKey:v,readThrough:y,indicator:b=`dot`,label:x=`What's new`,unreadLabel:S=`unread`,emptyText:C=`Nothing new yet`,onRead:w,linkComponent:T,className:E=``,...D}=h;o(`AppWhatsNew`,D),a(`AppWhatsNew`,`indicator`,b,f);let O=l(null),k=l(w);return k.current=w,c(()=>{let e=O.current;if(!e)return;let t=e=>{let t=e instanceof CustomEvent?e.detail:void 0;if(!m(t))throw Error(`wui-whats-new-read carried no read-through date`);k.current?.(t.through)};return e.addEventListener(`wui-whats-new-read`,t),()=>e.removeEventListener(`wui-whats-new-read`,t)},[]),/* @__PURE__ */ d(`wui-whats-new`,{ref:O,class:[`wui-whats-new`,E].filter(Boolean).join(` `),"storage-key":v||void 0,"read-through":y||void 0,indicator:b,...t,...D,children:[/* @__PURE__ */ d(`button`,{type:`button`,className:`u-action wui-whats-new-trigger`,"aria-haspopup":`dialog`,children:[/* @__PURE__ */ u(i,{name:`gift`,size:20}),/* @__PURE__ */ u(`span`,{className:`wui-whats-new-name`,children:x}),/* @__PURE__ */ u(`span`,{className:`wui-whats-new-unread`,children:` ${S}`}),/* @__PURE__ */ u(`span`,{className:`wui-whats-new-dot`,"aria-hidden":`true`})]}),/* @__PURE__ */ d(`div`,{className:`wui-whats-new-panel`,popover:`auto`,role:`dialog`,"aria-label":x,tabIndex:-1,children:[/* @__PURE__ */ u(`h2`,{className:`wui-whats-new-title`,children:x}),_.length>0?/* @__PURE__ */ u(`ol`,{className:`wui-whats-new-list`,children:_.map((e,t)=>/* @__PURE__ */ d(`li`,{className:`wui-whats-new-entry`,children:[/* @__PURE__ */ u(`time`,{className:`wui-whats-new-date`,dateTime:e.date,children:s(e.date)}),/* @__PURE__ */ u(`h3`,{className:`wui-whats-new-entry-title`,children:e.title}),e.body&&/* @__PURE__ */ u(`p`,{className:`wui-whats-new-body`,children:e.body}),e.imageSrc&&/* @__PURE__ */ u(`img`,{className:`wui-whats-new-image`,src:e.imageSrc,alt:e.imageAlt??``,loading:`lazy`}),e.href&&/* @__PURE__ */ u(g,{entry:e,linkComponent:T})]},e.id??`${e.date}-${t}`))}):/* @__PURE__ */ u(`p`,{className:`wui-whats-new-empty`,children:C})]})]})}function g({entry:n,linkComponent:r}){let i=e(r,{href:n.href});return/* @__PURE__ */ u(t,{link:i,className:`wui-whats-new-link`,children:n.linkLabel||`Learn more`})}export{h as default};
@@ -1 +1 @@
1
- import{initialsOf as e}from"../lib/initials.js";import{linkTarget as t}from"../lib/linkTarget.js";import{TargetLink as n}from"../lib/TargetLink.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppIcon.js";import a from"./assertValidValue.js";import o from"./warnUnknownProps.js";import{forwardRef as s,useCallback as c,useEffect as l,useMemo as u,useRef as d,useState as f}from"react";import{Dropdown as p}from"react-bootstrap";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";var _=[`sm`,`md`,`lg`],v=/* @__PURE__ */ new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`]);function y(e){let{marker:t,props:n}=r(`AppWorkspaceSwitcher`,e),{tenants:s=[],currentId:m,onSelect:y,menuLabel:C,footerAction:w,linkComponent:T,searchable:E=!1,onCreate:D,canCreate:O=!1,createLabel:k=`Create workspace`,compact:A=!1,size:j=`md`,ariaLabel:M,searchPlaceholder:N=`Search workspaces`,searchLabel:P=`Search workspaces`,noMatchText:F=`No workspaces match.`,...I}=n,{onToggle:L,...R}=I;o(`AppWorkspaceSwitcher`,R),a(`AppWorkspaceSwitcher`,`size`,j,_);let[z,B]=f(``),[V,H]=f(!1),U=d(null),W=c((e,t)=>{H(e),L?.(e,t)},[L]),G=s.find(e=>e.id===m)??s[0],K=u(()=>{let e=z.trim().toLowerCase();return!E||!e?s:s.filter(t=>String(t.name??``).toLowerCase().includes(e))},[s,z,E]);l(()=>{V&&E&&U.current?.focus()},[V,E]),l(()=>{if(!E)return;let e=U.current;if(!e)return;let t=e=>{v.has(e.key)?e.stopPropagation():e.key===`Escape`&&V&&(e.preventDefault(),e.stopPropagation(),W(!1,{source:`keydown`,originalEvent:e}))};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)},[E,V,W]);let q=G?.name??``,J=M??`Workspace ${q}`;return/* @__PURE__ */ g(p,{className:`workspace-switcher${j===`sm`?` workspace-switcher-sm`:``}${j===`lg`?` workspace-switcher-lg`:``}`,show:V,onToggle:W,...t,...R,children:[/* @__PURE__ */ h(p.Toggle,{as:S,compact:A,tenant:G,"aria-label":J}),/* @__PURE__ */ g(p.Menu,{className:`workspace-switcher-menu`,renderOnMount:!0,popperConfig:{strategy:`fixed`},children:[C?/* @__PURE__ */ h(`div`,{className:`workspace-switcher-menu-label`,children:C}):null,E?/* @__PURE__ */ g(`div`,{className:`workspace-switcher-search`,children:[/* @__PURE__ */ h(i,{name:`search`,size:14}),/* @__PURE__ */ h(`input`,{ref:U,type:`search`,className:`workspace-switcher-search-input`,placeholder:N,"aria-label":P,value:z,onChange:e=>B(e.target.value)})]}):null,/* @__PURE__ */ g(`div`,{className:`workspace-switcher-list`,children:[K.map(e=>/* @__PURE__ */ g(p.Item,{as:`button`,type:`button`,className:`workspace-switcher-option${e.id===G?.id?` is-active`:``}`,onClick:()=>y?.(e),children:[/* @__PURE__ */ h(b,{tenant:e}),/* @__PURE__ */ h(`span`,{className:`workspace-switcher-option-name`,children:e.name}),e.badge?/* @__PURE__ */ h(`span`,{className:`workspace-switcher-badge`,children:e.badge}):null,e.id===G?.id?/* @__PURE__ */ h(i,{name:`check`,size:16,className:`workspace-switcher-tick`}):null]},e.id)),K.length===0?/* @__PURE__ */ h(`div`,{className:`workspace-switcher-empty`,children:F}):null]}),O?/* @__PURE__ */ g(p.Item,{as:`button`,type:`button`,className:`workspace-switcher-create`,onClick:()=>D?.(),children:[/* @__PURE__ */ h(i,{name:`plus`,size:16}),k]}):null,w?/* @__PURE__ */ h(`div`,{className:`workspace-switcher-footer`,children:x(w,T)}):null]})]})}function b({tenant:t}){return t?.logoUrl?/* @__PURE__ */ h(`img`,{className:`workspace-switcher-mark`,src:t.logoUrl,alt:``,loading:`lazy`}):/* @__PURE__ */ h(`span`,{className:`workspace-switcher-mark`,children:e(t?.name,1)})}function x(e,r){if(typeof e!=`object`||!e||!(`label`in e))return e;let{label:a,icon:o,href:s}=e,c=/* @__PURE__ */ g(m,{children:[o?/* @__PURE__ */ h(i,{name:o,size:16}):null,a]});return s?/* @__PURE__ */ h(n,{link:t(r,{href:s}),className:`workspace-switcher-footer-action`,children:c}):/* @__PURE__ */ h(`button`,{className:`workspace-switcher-footer-action`,type:`button`,children:c})}var S=s(function({compact:e,tenant:t,"aria-label":n,className:r,...a},o){return/* @__PURE__ */ g(`button`,{ref:o,type:`button`,className:`workspace-switcher-trigger${e?` is-compact`:``}`,"aria-haspopup":`true`,"aria-label":n,...a,children:[/* @__PURE__ */ h(b,{tenant:t}),e?null:/* @__PURE__ */ g(m,{children:[/* @__PURE__ */ h(`span`,{className:`workspace-switcher-trigger-name`,children:t?.name}),/* @__PURE__ */ h(i,{name:`chevrons-up-down`,size:16,className:`workspace-switcher-chevron`})]})]})});export{y as default};
1
+ import{initialsOf as e}from"../lib/initials.js";import{linkTarget as t}from"../lib/linkTarget.js";import{TargetLink as n}from"../lib/TargetLink.js";import r from"../lib/useElementEntry.js";import{splitMarkerProps as i}from"../lib/wuiMarker.js";import a from"./AppIcon.js";import o from"./assertValidValue.js";import s from"./warnUnknownProps.js";import{useCallback as c,useEffect as l,useMemo as u,useRef as d,useState as f}from"react";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";var g=[`sm`,`md`,`lg`],_=()=>import(`@webority/ui-elements/elements/dropdown`),v=/* @__PURE__ */ new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`]);function y(e){let{marker:t,props:n}=i(`AppWorkspaceSwitcher`,e),{tenants:p=[],currentId:y,onSelect:C,menuLabel:w,footerAction:T,linkComponent:E,searchable:D=!1,onCreate:O,canCreate:k=!1,createLabel:A=`Create workspace`,compact:j=!1,size:M=`md`,ariaLabel:N,searchPlaceholder:P=`Search workspaces`,searchLabel:F=`Search workspaces`,noMatchText:I=`No workspaces match.`,...L}=n,{onToggle:R,...z}=L;s(`AppWorkspaceSwitcher`,z),o(`AppWorkspaceSwitcher`,`size`,M,g),r(`wui-dropdown`,_);let[B,V]=f(``),[H,U]=f(!1),W=d(null),G=d(null),K=c((e,t)=>{U(e),R?.(e,t)},[R]),q=p.find(e=>e.id===y)??p[0],J=u(()=>{let e=B.trim().toLowerCase();return!D||!e?p:p.filter(t=>String(t.name??``).toLowerCase().includes(e))},[p,B,D]);l(()=>{H&&D&&W.current?.focus()},[H,D]),l(()=>{let e=G.current;if(!e)return;let t=t=>{if(t.target===e){if(!(t instanceof CustomEvent))throw TypeError(`<wui-dropdown> toggle arrived without its detail.`);K(t.detail.open,{source:t.detail.source})}};return e.addEventListener(`wui-dropdown-toggle`,t),()=>e.removeEventListener(`wui-dropdown-toggle`,t)},[K]),l(()=>{if(!D)return;let e=W.current;if(!e)return;let t=e=>{v.has(e.key)&&e.stopPropagation()};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)},[D]);let Y=q?.name??``,X=N??`Workspace ${Y}`;return/* @__PURE__ */ h(`wui-dropdown`,{ref:G,class:`dropdown workspace-switcher${M===`sm`?` workspace-switcher-sm`:``}${M===`lg`?` workspace-switcher-lg`:``}`,...t,...z,children:[/* @__PURE__ */ m(S,{compact:j,tenant:q,ariaLabel:X}),/* @__PURE__ */ h(`div`,{"data-wui-dropdown-menu":``,popover:`auto`,className:`dropdown-menu workspace-switcher-menu`,children:[w?/* @__PURE__ */ m(`div`,{className:`workspace-switcher-menu-label`,children:w}):null,D?/* @__PURE__ */ h(`div`,{className:`workspace-switcher-search`,children:[/* @__PURE__ */ m(a,{name:`search`,size:14}),/* @__PURE__ */ m(`input`,{ref:W,type:`search`,className:`workspace-switcher-search-input`,placeholder:P,"aria-label":F,value:B,onChange:e=>V(e.target.value)})]}):null,/* @__PURE__ */ h(`div`,{className:`workspace-switcher-list`,children:[J.map(e=>/* @__PURE__ */ h(`button`,{type:`button`,className:`dropdown-item workspace-switcher-option${e.id===q?.id?` is-active`:``}`,onClick:()=>C?.(e),children:[/* @__PURE__ */ m(b,{tenant:e}),/* @__PURE__ */ m(`span`,{className:`workspace-switcher-option-name`,children:e.name}),e.badge?/* @__PURE__ */ m(`span`,{className:`workspace-switcher-badge`,children:e.badge}):null,e.id===q?.id?/* @__PURE__ */ m(a,{name:`check`,size:16,className:`workspace-switcher-tick`}):null]},e.id)),J.length===0?/* @__PURE__ */ m(`div`,{className:`workspace-switcher-empty`,children:I}):null]}),k?/* @__PURE__ */ h(`button`,{type:`button`,className:`dropdown-item workspace-switcher-create`,onClick:()=>O?.(),children:[/* @__PURE__ */ m(a,{name:`plus`,size:16}),A]}):null,T?/* @__PURE__ */ m(`div`,{className:`workspace-switcher-footer`,children:x(T,E)}):null]})]})}function b({tenant:t}){return t?.logoUrl?/* @__PURE__ */ m(`img`,{className:`workspace-switcher-mark`,src:t.logoUrl,alt:``,loading:`lazy`}):/* @__PURE__ */ m(`span`,{className:`workspace-switcher-mark`,children:e(t?.name,1)})}function x(e,r){if(typeof e!=`object`||!e||!(`label`in e))return e;let{label:i,icon:o,href:s}=e,c=/* @__PURE__ */ h(p,{children:[o?/* @__PURE__ */ m(a,{name:o,size:16}):null,i]});return s?/* @__PURE__ */ m(n,{link:t(r,{href:s}),className:`workspace-switcher-footer-action`,children:c}):/* @__PURE__ */ m(`button`,{className:`workspace-switcher-footer-action`,type:`button`,children:c})}function S({compact:e,tenant:t,ariaLabel:n}){return/* @__PURE__ */ h(`button`,{type:`button`,"data-wui-dropdown-trigger":``,className:`workspace-switcher-trigger${e?` is-compact`:``}`,"aria-haspopup":`true`,"aria-expanded":`false`,"aria-label":n,children:[/* @__PURE__ */ m(b,{tenant:t}),e?null:/* @__PURE__ */ h(p,{children:[/* @__PURE__ */ m(`span`,{className:`workspace-switcher-trigger-name`,children:t?.name}),/* @__PURE__ */ m(a,{name:`chevrons-up-down`,size:16,className:`workspace-switcher-chevron`})]})]})}export{y as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";var t=/* @__PURE__ */ new Set(/* @__PURE__ */ `id.title.role.style.className.class.tabIndex.lang.dir.hidden.slot.part.draggable.spellCheck.translate.inert.popover.name.type.value.defaultValue.checked.defaultChecked.placeholder.disabled.readOnly.required.autoFocus.autoComplete.form.formAction.formMethod.formNoValidate.formTarget.min.max.step.minLength.maxLength.pattern.multiple.accept.capture.rows.cols.wrap.list.htmlFor.inputMode.enterKeyHint.href.target.rel.download.ping.referrerPolicy.src.srcSet.alt.width.height.loading.decoding.sizes.crossOrigin.useMap.colSpan.rowSpan.headers.scope.span.key.ref.children.dangerouslySetInnerHTML.suppressHydrationWarning`.split(`.`)),n=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},r=e=>e.startsWith(`data-`)||e.startsWith(`aria-`)||/^on[A-Z]/.test(e),i=/* @__PURE__ */ new Set;function a(a,o){if(n()&&o&&!(`as`in o))for(let n of Object.keys(o)){if(r(n)||t.has(n))continue;let o=`${a}.${n}`;i.has(o)||(i.add(o),e(`[@webority/ui-react] <${a}> received an unknown prop "${n}". It is not part of the component's API and is not a valid HTML attribute, so it will either be dropped or land on the DOM — check the prop name against the component catalogue at https://ui-react.webority.dev.`))}}export{a as default};
1
+ import{devWarn as e}from"../lib/devWarn.js";var t=/* @__PURE__ */ new Set(/* @__PURE__ */ `id.title.role.style.className.class.tabIndex.lang.dir.hidden.slot.part.draggable.spellCheck.translate.inert.popover.name.type.value.defaultValue.checked.defaultChecked.placeholder.disabled.readOnly.required.autoFocus.autoComplete.form.formAction.formMethod.formNoValidate.formTarget.min.max.step.minLength.maxLength.pattern.multiple.accept.capture.rows.cols.wrap.list.htmlFor.inputMode.enterKeyHint.href.target.rel.download.ping.referrerPolicy.src.srcSet.alt.width.height.loading.decoding.sizes.crossOrigin.useMap.colSpan.rowSpan.headers.scope.span.key.ref.children.dangerouslySetInnerHTML.suppressHydrationWarning`.split(`.`)),n=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},r=e=>e.startsWith(`data-`)||e.startsWith(`aria-`)||/^on[A-Z]/.test(e),i=/* @__PURE__ */ new Set;function a(a,o){if(n()&&o&&!(`as`in o))for(let n of Object.keys(o)){if(r(n)||t.has(n))continue;let o=`${a}.${n}`;i.has(o)||(i.add(o),e(`[@webority/ui-react] <${a}> received an unknown prop "${n}". It is not part of the component's API and is not a valid HTML attribute, so it will either be dropped or land on the DOM. Check the prop name against the component catalogue at https://ui-react.webority.dev.`))}}export{a as default};
@@ -2,7 +2,7 @@
2
2
  "format": "webority-guidance/1",
3
3
  "package": {
4
4
  "name": "@webority/ui-react",
5
- "version": "0.161.0"
5
+ "version": "0.164.0"
6
6
  },
7
7
  "components": [
8
8
  {
@@ -3103,9 +3103,9 @@
3103
3103
  "do": [],
3104
3104
  "dont": [],
3105
3105
  "a11y": [
3106
- "The panel has role dialog with aria-modal and is named by ariaLabel, else by the title.",
3106
+ "The panel is a native dialog, named by ariaLabel, else by the title.",
3107
3107
  "The sheet handle is a vertical slider labelled Sheet height, and the close button is labelled Close.",
3108
- "Focus moves in on open, Tab stays inside, Escape leaves it open unless staticBackdrop is false, and focus returns to what opened it."
3108
+ "Focus moves in on open, Tab moves through the drawer, then on to the browser, without wrapping, Escape leaves it open unless staticBackdrop is false, and focus returns to what opened it."
3109
3109
  ]
3110
3110
  }
3111
3111
  },
@@ -5041,8 +5041,8 @@
5041
5041
  }
5042
5042
  ],
5043
5043
  "a11y": [
5044
- "Focus stays inside the dialog: Tab and Shift+Tab wrap between its first and last control.",
5045
- "The page behind an open dialog is made inert, and the dialog is named by a plain-text title or by ariaLabel; a headerless dialog with neither warns in development.",
5044
+ "Focus opens on the first control. Tab moves through the dialog and then to the browser's bar, without wrapping.",
5045
+ "The dialog is named by a plain-text title or by ariaLabel; a headerless dialog with neither warns in development.",
5046
5046
  "An outside click leaves it open by default (staticBackdrop); Escape closes it unless closeOnEscape is false."
5047
5047
  ]
5048
5048
  }
@@ -0,0 +1 @@
1
+ var e=e=>e.length<=3?e:`${e.slice(0,-3).replace(/\B(?=(\d{2})+(?!\d))/g,`,`)},${e.slice(-3)}`,t=t=>{let n=/^(-?)(\d*)(\..*)?$/.exec(t);return n?`${n[1]??``}${e(n[2]??``)}${n[3]??``}`:t};export{e as groupIndianDigits,t as groupIndianText};
@@ -0,0 +1 @@
1
+ import{onOverlayRootChange as e,overlayRoot as t}from"@webority/ui-elements/helpers";import{useSyncExternalStore as n}from"react";var r=t=>e(()=>t());function i(){return n(r,()=>t(),()=>null)}export{i as useOverlayRoot};
@@ -35,7 +35,7 @@ export interface AppAccordionProps extends ComponentPropsWithoutRef<"div"> {
35
35
  className?: string | undefined;
36
36
  }
37
37
  /**
38
- * Collapsible panes — an FAQ list, a set of grouped settings, a "more detail"
38
+ * Collapsible panes: an FAQ list, a set of grouped settings, a "more detail"
39
39
  * disclosure. Renders the theme's `.wui-accordion` markup, the same as the Razor
40
40
  * `<app-accordion>`.
41
41
  *
@@ -57,7 +57,7 @@ export interface AppAlertProps extends Omit<ComponentPropsWithoutRef<"div">, "ti
57
57
  role?: "alert" | "status" | "none" | undefined;
58
58
  }
59
59
  /**
60
- * The shared tinted banner — wraps react-bootstrap <Alert> (same `.alert` /
60
+ * The shared tinted banner wraps react-bootstrap <Alert> (same `.alert` /
61
61
  * `.alert-{variant}` classes Bootstrap + the theme already style). Screens must
62
62
  * use this instead of raw `className="alert alert-…"`.
63
63
  *
@@ -23,6 +23,11 @@ export interface AppBreadcrumbsProps extends ComponentPropsWithoutRef<"nav"> {
23
23
  * @default "Show hidden levels"
24
24
  */
25
25
  moreLabel?: string | undefined;
26
+ /**
27
+ * false keeps the trail on one line; items do not wrap.
28
+ * @default true
29
+ */
30
+ wrap?: boolean | undefined;
26
31
  }
27
32
  /** True inside a bar page header: every crumb is a parent link and none is the current page. */
28
33
  export declare const BreadcrumbTrailContext: Context<boolean>;
@@ -45,5 +50,6 @@ export declare const BreadcrumbTrailContext: Context<boolean>;
45
50
  * @param {string} [props.className]
46
51
  * @param {number} [props.maxItems] Below md, show only the last this many crumbs, with an ellipsis menu holding the rest. A whole number of 1 or more.
47
52
  * @param {string} [props.moreLabel] The accessible name of the ellipsis button. Default "Show hidden levels".
53
+ * @param {boolean} [props.wrap] false keeps the trail on one line; items do not wrap. Default true.
48
54
  */
49
55
  export default function AppBreadcrumbs(props: AppBreadcrumbsProps): ReactElement;
@@ -101,7 +101,7 @@ export interface AppCardProps extends Omit<React.ComponentPropsWithoutRef<"div">
101
101
  closeLabel?: string | undefined;
102
102
  }
103
103
  /**
104
- * The shared surface card — wraps react-bootstrap <Card> and the theme's `.card` chrome.
104
+ * The shared surface card wraps react-bootstrap <Card> and the theme's `.card` chrome.
105
105
  *
106
106
  * Beyond a plain surface it carries visual variants, a tone-tinted accent stripe, a padding
107
107
  * scale, an optional capped/centred width, a header (icon + title + subtitle + actions), a
@@ -45,9 +45,9 @@ export interface AppChipProps extends Omit<ComponentPropsWithoutRef<"span">, "on
45
45
  className?: string | undefined;
46
46
  }
47
47
  /**
48
- * Token / tag chip — a compact labelled token, optionally with a leading icon or
48
+ * Token / tag chip: a compact labelled token, optionally with a leading icon or
49
49
  * avatar and a dismiss button. Distinct from `AppChoiceChip` (a *selectable* pill):
50
- * `AppChip` is a *display / removable* token — the thing a multi-select renders for
50
+ * `AppChip` is a *display / removable* token: the thing a multi-select renders for
51
51
  * each chosen value, a filter tag, or a removable label.
52
52
  *
53
53
  * Behaviour follows the props present:
@@ -6,7 +6,7 @@ export interface AppCodeBlockProps extends React.HTMLAttributes<HTMLElement> {
6
6
  * What to colour; `text` shows it as written.
7
7
  * @default "text"
8
8
  */
9
- language?: "text" | "json" | "js" | "cs" | "sql" | "bash" | "http" | "html" | "css" | undefined;
9
+ language?: "text" | "json" | "js" | "cs" | "sql" | "bash" | "http" | "html" | "razor" | "css" | undefined;
10
10
  /**
11
11
  * Number the lines. The numbers are not copied or selected.
12
12
  * @default false
@@ -113,8 +113,8 @@ export interface AppCommandPaletteProps extends React.HTMLAttributes<HTMLElement
113
113
  * App-wide "search and jump": a top-anchored dialog with a search input over a grouped list
114
114
  * of results. Pair it with `useCommandPaletteShortcut` to open it on Ctrl+K / Cmd+K.
115
115
  *
116
- * The overlay is `AppModal`, so the backdrop, Escape, the focus trap and returning focus to
117
- * whatever was focused before it opened all come from there. The list behaviour (the active
116
+ * The overlay is `AppModal`, so the backdrop, Escape and the close callback come from there; the
117
+ * browser's modal dialog keeps focus inside the palette and returns it on close. The list behaviour (the active
118
118
  * result, ArrowUp / ArrowDown across groups with wrap-around, Enter, the pointer, scrolling the
119
119
  * active result into view) is the shared `<wui-command-palette>` element, the same one the
120
120
  * Razor `<app-command-palette>` uses.
@@ -112,6 +112,8 @@ export interface AppDataTableProps<Row> extends Omit<ComponentPropsWithoutRef<"d
112
112
  flush?: boolean | undefined;
113
113
  /** The inset around the table, in px; the wrapper's 20px is the default and flush wins over it. */
114
114
  pad?: number | undefined;
115
+ /** Lines a ledger name wraps to before it is cut, 1 to 4; the default is 2. A compact or virtual table shows one line. */
116
+ nameLines?: number | undefined;
115
117
  /** The column header band's colour, a CSS colour or a $color token the Canvas renderer resolves. */
116
118
  headerTone?: string | undefined;
117
119
  /**
@@ -190,7 +192,7 @@ export interface AppDataTableProps<Row> extends Omit<ComponentPropsWithoutRef<"d
190
192
  resizableColumns?: boolean | undefined;
191
193
  /** Remembers resized widths in this browser under this name, the same name useTableView takes. */
192
194
  viewKey?: string | undefined;
193
- /** A column key: rows gather under a header row per value of it, in the order each value first appears, each header collapsing its rows and showing their count. */
195
+ /** A column key: rows gather under a header row per value of it, in the order each value first appears, each header collapsing its rows and showing their count. On a server-paged list each page's rows gather the same way, and the count is the rows on that page. */
194
196
  groupBy?: string | undefined;
195
197
  /** A group header's label; without it the value shows as a cell would. */
196
198
  groupLabel?: ((value: unknown, rows: readonly Row[]) => ReactNode) | undefined;
@@ -53,7 +53,7 @@ export interface AppDescriptionsProps extends Omit<React.ComponentPropsWithoutRe
53
53
  className?: string | undefined;
54
54
  }
55
55
  /**
56
- * A labeled key-value grid for displaying record details — like an Ant "Descriptions" or
56
+ * A labeled key-value grid for displaying record details, like an Ant "Descriptions" or
57
57
  * a definition list. Renders a two-column (or single-column on small screens) grid of
58
58
  * label/value pairs.
59
59
  *
@@ -100,7 +100,7 @@ export interface AppDrawerProps {
100
100
  * A panel over the page that is a side drawer from md up and a bottom sheet below it. The sheet
101
101
  * rests on `snapPoints` (percent of the screen height), follows a finger on its handle or header,
102
102
  * flicks to the next point and is dragged down to close; its handle is a vertical slider the arrow
103
- * keys, Home and End also move. Focus moves in on open, Tab stays inside, Escape closes, and
103
+ * keys, Home and End also move. Focus moves in on open, Tab moves through the drawer, then on to the browser, without wrapping, Escape closes, and
104
104
  * focus returns to what opened it. Controlled: set `open` and close it in `onClose`. Distinct from
105
105
  * `AppModal`, which is a centred dialog on every screen. Wraps `<wui-drawer>`, which Razor
106
106
  * `<app-drawer>` renders too. Place it where no ancestor has a transform, since it is fixed to the
@@ -18,8 +18,7 @@ export interface AppDropdownItem {
18
18
  hiddenFrom?: "sm" | "md" | "lg" | "xl" | undefined;
19
19
  }
20
20
  export interface AppDropdownOpenMeta {
21
- source?: string | undefined;
22
- originalEvent?: React.SyntheticEvent | Event | undefined;
21
+ source?: "trigger" | "select" | "dismiss" | "scroll" | "resize" | undefined;
23
22
  }
24
23
  export interface AppDropdownProps extends Omit<React.ComponentPropsWithoutRef<"div">, "onToggle" | "onSelect"> {
25
24
  /** Name of the glyph on the toggle button. A custom trigger replaces it. */
@@ -72,7 +71,8 @@ export interface AppDropdownProps extends Omit<React.ComponentPropsWithoutRef<"d
72
71
  noMatchText?: string | undefined;
73
72
  }
74
73
  /**
75
- * Icon-triggered menu — react-bootstrap Dropdown.
74
+ * Icon-triggered menu over `<wui-dropdown>`, which owns the trigger, the placed menu, the arrow keys and the close on
75
+ * a pick, a scroll that moves the toggle, a window resize and a click outside.
76
76
  *
77
77
  * Decoupled from the router: menu items with a `to` render through `linkComponent`
78
78
  * when provided (e.g. react-router's `Link`), otherwise a plain `<a href>`. The library
@@ -83,12 +83,12 @@ export interface AppDropdownProps extends Omit<React.ComponentPropsWithoutRef<"d
83
83
  *
84
84
  * `children` renders inside the menu INSTEAD of mapping `items`, for a panel that isn't a flat action list (an identity
85
85
  * block, a form, mixed content). `items` and `children` are mutually exclusive; `children`
86
- * wins when both are given. The icon toggle and react-bootstrap's open/close, outside-click,
87
- * focus and Escape behavior are unchanged either way.
86
+ * wins when both are given. The icon toggle and the menu's open, close, focus and Escape behaviour are the same either way.
88
87
  *
89
88
  * `onOpenChange` is called whenever the menu asks to open or close: a toggle click, an outside click, Escape, an item
90
- * pick (react-bootstrap's `source`), and the close on a scroll that moves the toggle or a window
91
- * resize (`source` "scroll" or "resize"). Fires in both modes.
89
+ * pick, and the close on a scroll that moves the toggle or a window resize (`source` "scroll" or "resize").
90
+ * Fires in both modes. The wrapper always answers the request itself: uncontrolled, it keeps the state; controlled, the
91
+ * caller sets `open` from `onOpenChange`.
92
92
  *
93
93
  * `searchable` puts a search box above the rows and filters them by label as the user types; it
94
94
  * takes `items` only, not `children`. `searchPlaceholder` and `noMatchText` set its words and need `searchable`.
@@ -141,7 +141,7 @@ export interface AppFilePickerMultipleProps extends AppFilePickerBaseProps {
141
141
  }
142
142
  export type AppFilePickerProps = AppFilePickerSingleProps | AppFilePickerMultipleProps;
143
143
  /**
144
- * File picker — a drag-and-drop dropzone. In single mode it swaps to a large preview once a
144
+ * File picker: a drag-and-drop dropzone. In single mode it swaps to a large preview once a
145
145
  * file is chosen (hover to change, × to remove). With `multiple`, the dropzone stays put and
146
146
  * picked files stack in a list inside it, below the prompt (image thumbnail or file-type icon +
147
147
  * name/size, each removable). Accepts freshly-picked Files or existing `{ url, name }` values; reports the
@@ -37,12 +37,12 @@ export interface AppFloatingDockProps extends ComponentPropsWithoutRef<"div"> {
37
37
  className?: string | undefined;
38
38
  }
39
39
  /**
40
- * A macOS-style floating dock — a pill of icon links whose items magnify as the pointer
40
+ * A macOS-style floating dock: a pill of icon links whose items magnify as the pointer
41
41
  * approaches them. Marketing / landing-page chrome, not a replacement for `AppShell`
42
42
  * primary navigation.
43
43
  *
44
44
  * Wraps the shared `<wui-dock>` element, which owns the pointer-tracking magnification
45
- * and turns itself off on coarse pointers and under `prefers-reduced-motion` — so the
45
+ * and turns itself off on coarse pointers and under `prefers-reduced-motion`, so the
46
46
  * dock is a plain, fully usable icon row wherever the effect would misbehave. Every item
47
47
  * is a real link (or button) with an accessible name; the visible tooltip is decorative.
48
48
  *
@@ -1,11 +1,11 @@
1
- import { type ComponentPropsWithRef, type FormEvent, type JSX, type ReactNode } from "react";
1
+ import { type ComponentPropsWithRef, type JSX, type ReactNode, type SubmitEvent } from "react";
2
2
  export interface AppFormSubmitContext {
3
3
  /** One key per send; a new one is made only after onSubmit returns true. */
4
4
  idempotencyKey: string;
5
5
  }
6
6
  export interface AppFormProps extends Omit<ComponentPropsWithRef<"form">, "onSubmit" | "className"> {
7
7
  /** Runs once per submit; return true when the send succeeded, false to keep the same idempotency key for a retry. A second submit while one is pending is dropped. */
8
- onSubmit: (event: FormEvent<HTMLFormElement>, context: AppFormSubmitContext) => boolean | Promise<boolean>;
8
+ onSubmit: (event: SubmitEvent<HTMLFormElement>, context: AppFormSubmitContext) => boolean | Promise<boolean>;
9
9
  /**
10
10
  * Extra class names added to the form element.
11
11
  * @default ""
@@ -18,7 +18,7 @@ export interface AppFormActionsProps extends ComponentPropsWithoutRef<"div"> {
18
18
  className?: string | undefined;
19
19
  }
20
20
  /**
21
- * Form action footer — a sticky or inline controls row at a form's end.
21
+ * Form action footer: a sticky or inline controls row at a form's end.
22
22
  *
23
23
  * Typically holds submit/cancel buttons; can be fixed to the viewport bottom
24
24
  * with a top border and surface background. Supports alignment: trailing
@@ -45,7 +45,7 @@ export interface AppFormSectionProps extends Omit<ComponentPropsWithoutRef<"sect
45
45
  className?: string | undefined;
46
46
  }
47
47
  /**
48
- * Form section — a logical group within a form, with an optional title and description.
48
+ * Form section: a logical group within a form, with an optional title and description.
49
49
  *
50
50
  * Wraps a set of related fields with a section heading and intro text. Useful for
51
51
  * breaking large forms into digestible chunks. The body receives the fields; the