@webority/ui-react 0.126.2 → 0.128.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas-kit/kit.js +2182 -2058
- package/dist/canvas-kit/manifest.json +42 -1
- package/dist/canvas-kit/release.json +6 -6
- package/dist/components/AppPhoneNumberInput.js +1 -1
- package/dist/components/AppProgress.js +1 -1
- package/dist/components/AppShell.js +1 -1
- package/dist/guidance.json +1 -1
- package/dist/types/components/AppPhoneNumberInput.d.ts +2 -0
- package/dist/types/components/AppProgress.d.ts +2 -2
- package/dist/types/components/AppShell.d.ts +18 -0
- package/package.json +8 -8
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"kind": "WeborityWeb",
|
|
3
3
|
"library": {
|
|
4
4
|
"name": "@webority/ui-react",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.128.0"
|
|
6
6
|
},
|
|
7
7
|
"rendererProtocolVersion": 13,
|
|
8
8
|
"platform": "Web",
|
|
@@ -14241,6 +14241,12 @@
|
|
|
14241
14241
|
"description": "The label above the field.",
|
|
14242
14242
|
"default": "Phone number"
|
|
14243
14243
|
},
|
|
14244
|
+
{
|
|
14245
|
+
"name": "lockedCountry",
|
|
14246
|
+
"type": "string",
|
|
14247
|
+
"required": false,
|
|
14248
|
+
"description": "ISO alpha-2 code. The dial code is a static prefix with no picker, and the value always carries this country."
|
|
14249
|
+
},
|
|
14244
14250
|
{
|
|
14245
14251
|
"name": "name",
|
|
14246
14252
|
"type": "string",
|
|
@@ -14841,6 +14847,7 @@
|
|
|
14841
14847
|
"danger",
|
|
14842
14848
|
"info",
|
|
14843
14849
|
"neutral",
|
|
14850
|
+
"primary",
|
|
14844
14851
|
"success",
|
|
14845
14852
|
"warning"
|
|
14846
14853
|
],
|
|
@@ -19108,6 +19115,17 @@
|
|
|
19108
19115
|
"description": "Label of the tab bar button that opens the drawer.",
|
|
19109
19116
|
"default": "More"
|
|
19110
19117
|
},
|
|
19118
|
+
{
|
|
19119
|
+
"name": "nav",
|
|
19120
|
+
"type": "enum",
|
|
19121
|
+
"enum": [
|
|
19122
|
+
"side",
|
|
19123
|
+
"top"
|
|
19124
|
+
],
|
|
19125
|
+
"required": false,
|
|
19126
|
+
"description": "Where the primary navigation sits: a sidebar, or from lg up the top bar.",
|
|
19127
|
+
"default": "side"
|
|
19128
|
+
},
|
|
19111
19129
|
{
|
|
19112
19130
|
"name": "navLabel",
|
|
19113
19131
|
"type": "string",
|
|
@@ -19336,6 +19354,12 @@
|
|
|
19336
19354
|
"name": "userMenu",
|
|
19337
19355
|
"type": "object",
|
|
19338
19356
|
"fields": [
|
|
19357
|
+
{
|
|
19358
|
+
"name": "head",
|
|
19359
|
+
"type": "node",
|
|
19360
|
+
"required": false,
|
|
19361
|
+
"description": "Under the name, role and roles lines, such as an email or an account id."
|
|
19362
|
+
},
|
|
19339
19363
|
{
|
|
19340
19364
|
"name": "items",
|
|
19341
19365
|
"type": "array",
|
|
@@ -19386,6 +19410,17 @@
|
|
|
19386
19410
|
"required": false,
|
|
19387
19411
|
"description": "The sign-out item's label. Defaults to Sign out."
|
|
19388
19412
|
},
|
|
19413
|
+
{
|
|
19414
|
+
"name": "logoutVariant",
|
|
19415
|
+
"type": "enum",
|
|
19416
|
+
"enum": [
|
|
19417
|
+
"button",
|
|
19418
|
+
"item"
|
|
19419
|
+
],
|
|
19420
|
+
"required": false,
|
|
19421
|
+
"description": "item draws sign-out as a danger row; button draws a full-width secondary-danger button in its own foot.",
|
|
19422
|
+
"default": "item"
|
|
19423
|
+
},
|
|
19389
19424
|
{
|
|
19390
19425
|
"name": "name",
|
|
19391
19426
|
"type": "string",
|
|
@@ -19421,6 +19456,12 @@
|
|
|
19421
19456
|
"type": "array",
|
|
19422
19457
|
"required": false,
|
|
19423
19458
|
"description": "Portal role display names, shown under the job title as Role or Roles. Razor takes one comma-separated string."
|
|
19459
|
+
},
|
|
19460
|
+
{
|
|
19461
|
+
"name": "section",
|
|
19462
|
+
"type": "node",
|
|
19463
|
+
"required": false,
|
|
19464
|
+
"description": "Between the head and the items, such as an account or workspace switcher."
|
|
19424
19465
|
}
|
|
19425
19466
|
],
|
|
19426
19467
|
"required": false,
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webority-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.128.0",
|
|
4
4
|
"platform": "Web",
|
|
5
5
|
"kitModuleVersion": 2,
|
|
6
6
|
"rendererProtocolVersion": 13,
|
|
7
7
|
"library": {
|
|
8
8
|
"name": "@webority/ui-react",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.128.0"
|
|
10
10
|
},
|
|
11
11
|
"files": {
|
|
12
12
|
"manifest.json": {
|
|
13
|
-
"sha256": "
|
|
14
|
-
"bytes":
|
|
13
|
+
"sha256": "23166d1a187dabddb0d719f05977e577152fff7da7b8046272a69d6679e85ca6",
|
|
14
|
+
"bytes": 868170
|
|
15
15
|
},
|
|
16
16
|
"kit.js": {
|
|
17
|
-
"sha256": "
|
|
18
|
-
"bytes":
|
|
17
|
+
"sha256": "0f22750cc3d1137b8adeb8070ce62140ca6eb5ed723151d55df078f0383a1af9",
|
|
18
|
+
"bytes": 10998717
|
|
19
19
|
},
|
|
20
20
|
"kit.css": {
|
|
21
21
|
"sha256": "13b14f71fb6ea024945f95cba617b4f1d49f44a65ba7c7ed05d2354805539ef6",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../lib/FieldMessage.js";import{loadFlagStyles as t}from"../lib/flagStyles.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppRequiredMark.js";import i from"./useWuiControl.js";import a from"./warnInvalidValue.js";import o from"./warnUnknownProps.js";import{forwardRef as s,useEffect as c,useId as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import"@webority/ui-elements/elements/phone";var f=[`sm`,`md`,`lg`],p=s(function(s,p){let{marker:m,props:h}=n(`AppPhoneNumberInput`,s),{value:g,onChange:_,country:v,disabled:
|
|
1
|
+
import e from"../lib/FieldMessage.js";import{loadFlagStyles as t}from"../lib/flagStyles.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppRequiredMark.js";import i from"./useWuiControl.js";import a from"./warnInvalidValue.js";import o from"./warnUnknownProps.js";import{forwardRef as s,useEffect as c,useId as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import"@webority/ui-elements/elements/phone";var f=[`sm`,`md`,`lg`],p=s(function(s,p){let{marker:m,props:h}=n(`AppPhoneNumberInput`,s),{value:g,onChange:_,country:v,lockedCountry:y,disabled:b=!1,name:x,id:S,label:C=`Phone number`,placeholder:w,required:T=!1,optional:E=!1,hint:D,error:O,showFlag:k=!0,showDialCode:A=!0,size:j=`md`,fieldClassName:M=``,...N}=h;o(`AppPhoneNumberInput`,N),a(`AppPhoneNumberInput`,`size`,j,f),c(()=>{k&&t()},[k]);let P=l(),F=S||P,I=O&&F?`${F}-error`:void 0,L=!O&&D&&F?`${F}-hint`:void 0,{setRef:R}=i({ref:p,value:g??``,onChange:_,events:[`input`,`change`]});return/* @__PURE__ */ d(`div`,{...m,className:`field app-phone-number-input${j===`sm`?` phone-sm`:``}${j===`lg`?` phone-lg`:``}${M?` ${M}`:``}`,children:[C&&/* @__PURE__ */ d(`label`,{className:`label`,htmlFor:F,children:[C,E&&!T&&/* @__PURE__ */ u(`span`,{className:`label-optional`,children:` (optional)`}),T&&/* @__PURE__ */ u(r,{})]}),/* @__PURE__ */ u(`wui-phone`,{ref:R,id:F,name:x,"aria-label":typeof C==`string`?C:void 0,"aria-describedby":I||L,"aria-invalid":O?`true`:void 0,country:y||v,"locked-country":y||void 0,placeholder:w,required:T?``:void 0,disabled:b?``:void 0,"hide-flag":k?void 0:``,"hide-dial":A?void 0:``,"external-error":``,...N}),/* @__PURE__ */ u(e,{error:O,hint:D,errorId:I,hintId:L})]})});export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{cloneElement as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";var o=[`sm`,`md`],s=[`info`,`success`,`warning`,`danger`,`neutral`];function c(e,t){if(!(t>0))return 0;let n=Math.min(100,Math.max(0,e/t*100));return Number(n.toFixed(2))}function l(l){let{marker:u,props:d}=e(`AppProgress`,l),{value:f=0,max:p=100,tone:m=`info`,size:h=`md`,label:g,showLabel:_=!1,striped:v=!1,animated:y=!1,indeterminate:b=!1,className:x=``,...S}=d;n(`AppProgress`,S),t(`AppProgress`,`tone`,m,s),t(`AppProgress`,`size`,h,o);let C=s.includes(m)?m:`info`,w=c(f,p),T=!b&&_&&!!g,E=`progress${h===`sm`?` progress-sm`:``}${!T&&x?` ${x}`:``}`,D=[`progress-bar`,`wui-progress-${C}`,v||y?`progress-bar-striped`:``,y?`progress-bar-animated`:``,b?`wui-progress-indeterminate`:``].filter(Boolean).join(` `),O=/* @__PURE__ */ i(`div`,{className:E,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":p,...b?{}:{"aria-valuenow":f},"aria-label":g||void 0,...S,children:/* @__PURE__ */ i(`div`,{className:D,style:b?void 0:{width:`${w}%`}})});return T?/* @__PURE__ */ a(`div`,{...u,className:`wui-progress-labelled${x?` ${x}`:``}`,children:[/* @__PURE__ */ i(`div`,{className:`wui-progress-label`,"aria-hidden":`true`,children:g}),O]}):r(O,u)}export{l as default};
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{cloneElement as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";var o=[`sm`,`md`],s=[`primary`,`info`,`success`,`warning`,`danger`,`neutral`];function c(e,t){if(!(t>0))return 0;let n=Math.min(100,Math.max(0,e/t*100));return Number(n.toFixed(2))}function l(l){let{marker:u,props:d}=e(`AppProgress`,l),{value:f=0,max:p=100,tone:m=`info`,size:h=`md`,label:g,showLabel:_=!1,striped:v=!1,animated:y=!1,indeterminate:b=!1,className:x=``,...S}=d;n(`AppProgress`,S),t(`AppProgress`,`tone`,m,s),t(`AppProgress`,`size`,h,o);let C=s.includes(m)?m:`info`,w=c(f,p),T=!b&&_&&!!g,E=`progress${h===`sm`?` progress-sm`:``}${!T&&x?` ${x}`:``}`,D=[`progress-bar`,`wui-progress-${C}`,v||y?`progress-bar-striped`:``,y?`progress-bar-animated`:``,b?`wui-progress-indeterminate`:``].filter(Boolean).join(` `),O=/* @__PURE__ */ i(`div`,{className:E,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":p,...b?{}:{"aria-valuenow":f},"aria-label":g||void 0,...S,children:/* @__PURE__ */ i(`div`,{className:D,style:b?void 0:{width:`${w}%`}})});return T?/* @__PURE__ */ a(`div`,{...u,className:`wui-progress-labelled${x?` ${x}`:``}`,children:[/* @__PURE__ */ i(`div`,{className:`wui-progress-label`,"aria-hidden":`true`,children:g}),O]}):r(O,u)}export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{devWarn as e}from"../lib/devWarn.js";import{navMatchScore as t}from"../lib/navMatch.js";import{SHELL_FOLDED_COOKIE as n,readNavFolded as r,readShellCollapsed as i,writeNavFolded as a,writeShellCollapsed as o}from"../lib/shellCookie.js";import{splitMarkerProps as s}from"../lib/wuiMarker.js";import c from"./AppAvatar.js";import l from"./AppIcon.js";import u from"./warnInvalidValue.js";import d from"./warnUnknownProps.js";import{initScrollEdges as f}from"@webority/ui-elements/helpers";import{useEffect as p,useId as m,useMemo as h,useRef as g,useState as _}from"react";import{Fragment as v,jsx as y,jsxs as b}from"react/jsx-runtime";var x=99,S=4,C=5,w=/^[a-z0-9-]+$/,T=[`prefix`,`exact`],E=[`comfortable`,`compact`],D=[`default`,`primary`],O=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],k=/* @__PURE__ */ new Set([`key`,`label`,`icon`,`iconVariant`,`iconSize`,`href`,`badge`,`badgeTone`,`badgeTitle`,`newUntil`,`trailingIcon`,`active`,`match`,`matchAlso`,`tab`,`tabLabel`,`children`]),A=e=>e>x?`${x}+`:String(e),j=new Intl.DateTimeFormat(`en-CA`,{timeZone:`Asia/Kolkata`}),M=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:j.format(/* @__PURE__ */ new Date)<=e};function ee(e){let{marker:t,props:c}=s(`AppShell`,e),{groups:m=[],brand:v,sidebarStart:x,sidebarStartCompact:S,sidebarFooter:C,topbarStart:w,topbarEnd:T,footer:k,launcher:A,children:j,collapsed:M,onCollapsedChange:ee,noSidebar:N=!1,density:P=`comfortable`,itemHeight:F,iconVariant:I,topbarTone:L=`default`,navLabel:z=`Main navigation`,linkComponent:B,currentPath:ce,rememberCollapsed:V=!1,collapsedCookie:H=`wui-shell-collapsed`,foldedCookie:U=n,tabBarLabel:le=`Quick navigation`,moreLabel:ue=`More`,userMenu:W,notifications:G,search:K,className:de=``,style:fe,...q}=c;d(`AppShell`,q),u(`AppShell`,`density`,P,E),u(`AppShell`,`topbarTone`,L,D),u(`AppShell`,`iconVariant`,I,O);let pe=F>0?{...fe,"--wui-nav-item-height":`${F}px`}:fe,[me,he]=_(()=>V&&M===void 0&&typeof document<`u`?i(H)??!1:!1),[J,Y]=_(!1),[ge,_e]=_(!1),[ve,ye]=_(!1),X=g(null),be=g(null),xe=g(null),Z=M??me,Se=()=>{let e=!Z;M===void 0&&he(e),V&&o(e,H),ee?.(e)},Ce=m.some(e=>e.collapsible),[we,Te]=_(()=>Ce&&typeof document<`u`?r(U):/* @__PURE__ */ new Set),Ee=e=>{let t=new Set(we);t.has(e)?t.delete(e):t.add(e),Te(t),a(t,U)},Q=h(()=>te(m,ce),[m,ce]),$=N?null:ne(Q);p(()=>{let e=()=>_e(window.scrollY>4);return e(),window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)},[]),p(()=>{f()},[]),p(()=>{let e=X.current,t=e?.querySelector(`.app-nav-item[aria-current="page"]`);if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();n.top<r.top?e.scrollTop-=r.top-n.top:n.bottom>r.bottom&&(e.scrollTop+=n.bottom-r.bottom)},[]),p(()=>{let e=X.current;if(!e)return;let t=()=>ye(e.scrollHeight>e.clientHeight);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[Q]);let De=!!k;p(()=>{let e=xe.current,t=be.current;if(!De||!e||!t)return;let n=()=>t.style.setProperty(`--app-footer-h`,`${e.offsetHeight}px`);n();let r=typeof ResizeObserver>`u`?null:new ResizeObserver(n);return r?.observe(e),()=>{r?.disconnect(),t.style.removeProperty(`--app-footer-h`)}},[De]),p(()=>{if(!J)return;let e=e=>{e.key===`Escape`&&Y(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[J]);let Oe=[`app-shell`,Z?`collapsed`:``,N?`no-sidebar`:``,J?`mobile-open`:``,de].filter(Boolean).join(` `);return/* @__PURE__ */ b(`div`,{ref:be,className:Oe,"data-density":P===`compact`?`compact`:void 0,"data-wui-folded-cookie":Ce?U:void 0,style:pe,...t,...q,children:[/* @__PURE__ */ y(`a`,{className:`wui-skip-link`,href:`#main-content`,children:`Skip to content`}),/* @__PURE__ */ b(`aside`,{className:`app-sidebar`,children:[v&&/* @__PURE__ */ y(`div`,{className:`app-sidebar-brand`,children:v}),x&&/* @__PURE__ */ y(`div`,{className:`app-sidebar-start`,children:x}),S&&/* @__PURE__ */ y(`div`,{className:`app-sidebar-start-compact`,children:S}),/* @__PURE__ */ y(`nav`,{className:`app-sidebar-scroll`,"aria-label":z,ref:X,tabIndex:ve?0:void 0,children:Q.map((e,t)=>{let n=e.items.map(e=>e.header==null?/* @__PURE__ */ y(ie,{item:e,linkComponent:B,onNavigate:()=>Y(!1),iconVariant:I},e.key??e.href??e.label):/* @__PURE__ */ y(`div`,{className:`wui-nav-header`,children:e.header},e.key??e.header));if(!e.collapsible)return/* @__PURE__ */ b(`div`,{className:`app-nav-group`,children:[e.label&&/* @__PURE__ */ y(`div`,{className:`app-nav-group-label`,children:e.label}),n,e.after&&/* @__PURE__ */ y(`div`,{className:`wui-nav-group-after`,children:e.after})]},e.key??e.label??`group-${t}`);let r=!we.has(e.key)||!!R(e.items),i=`wui-nav-group-${e.key}`;return/* @__PURE__ */ b(`div`,{className:`app-nav-group wui-nav-group-collapsible${r?``:` wui-nav-group-folded`}`,"data-wui-nav-group":e.key,children:[/* @__PURE__ */ b(`button`,{type:`button`,className:`app-nav-group-label wui-nav-group-toggle`,"aria-expanded":r,"aria-controls":i,onClick:()=>Ee(e.key),children:[/* @__PURE__ */ y(`span`,{className:`wui-nav-group-text`,children:e.label}),/* @__PURE__ */ y(`span`,{className:`wui-nav-group-caret`,children:/* @__PURE__ */ y(l,{name:`chevron-down`,size:16})})]}),/* @__PURE__ */ b(`div`,{className:`wui-nav-group-body`,id:i,children:[n,e.after&&/* @__PURE__ */ y(`div`,{className:`wui-nav-group-after`,children:e.after})]})]},e.key??`group-${t}`)})}),C&&/* @__PURE__ */ y(`div`,{className:`app-sidebar-foot`,children:C}),!N&&/* @__PURE__ */ y(`button`,{type:`button`,className:`app-sidebar-toggle`,onClick:Se,"aria-label":Z?`Expand navigation`:`Collapse navigation`,"aria-expanded":!Z,children:/* @__PURE__ */ y(l,{name:`chevrons-left`,size:20})})]}),/* @__PURE__ */ b(`div`,{className:`app-main`,children:[/* @__PURE__ */ b(`header`,{className:`app-topbar${ge?` scrolled`:``}`,"data-tone":L===`primary`?`primary`:void 0,children:[/* @__PURE__ */ b(`div`,{className:`app-topbar-start`,children:[/* @__PURE__ */ y(`button`,{type:`button`,className:`app-topbar-menu`,onClick:()=>Y(!0),"aria-label":`Open navigation`,"aria-expanded":J,children:/* @__PURE__ */ y(l,{name:`menu`,size:18})}),w,K&&/* @__PURE__ */ y(se,{config:K})]}),/* @__PURE__ */ b(`div`,{className:`app-topbar-end`,children:[T,G&&/* @__PURE__ */ y(oe,{config:G}),W&&/* @__PURE__ */ y(ae,{config:W,linkComponent:B})]})]}),/* @__PURE__ */ y(`main`,{className:`app-content`,id:`main-content`,children:j}),k&&/* @__PURE__ */ y(`footer`,{className:`app-footer`,ref:xe,children:k})]}),A&&/* @__PURE__ */ y(`div`,{className:`wui-shell-launcher`,children:A}),$&&/* @__PURE__ */ b(`nav`,{className:`wui-tabbar`,"aria-label":le,children:[$.tabs.map(e=>/* @__PURE__ */ y(re,{tab:e,linkComponent:B,iconVariant:I},e.key??e.href)),$.hasMore&&/* @__PURE__ */ b(`button`,{type:`button`,className:`wui-tabbar-item${$.moreActive?` active`:``}`,onClick:()=>Y(!0),children:[/* @__PURE__ */ y(`span`,{className:`wui-tabbar-icon`,children:/* @__PURE__ */ y(l,{name:`more`,size:24})}),/* @__PURE__ */ y(`span`,{className:`wui-tabbar-label`,children:ue})]})]}),/* @__PURE__ */ y(`button`,{type:`button`,className:`app-scrim`,onClick:()=>Y(!1),"aria-label":`Close navigation`,tabIndex:J?0:-1})]})}function te(e,n){for(let t of e)t.collapsible&&L(t);let r=(e,t=!1)=>(e??[]).map(e=>Array.isArray(e.children)?{...e,children:r(e.children)}:{...e}).filter(e=>P(e)?t:(e.children?.length??0)>0||!!e.href),i=e.map(e=>({...e,items:F(r(e.items,!0))})).filter(e=>e.items.some(e=>!P(e))),a=[],o=e=>{for(let t of e)P(t)||(a.push(t),t.children&&o(t.children))};for(let e of i)o(e.items);for(let e of a)d(`AppShell items`,N(e)),u(`AppShell`,`match`,e.match,T),u(`AppShell`,`iconVariant`,e.iconVariant,O);let s=null;if(n!=null&&!a.some(e=>e.active===!0)){let e=-1;for(let r of a){if(r.active!=null||r.children?.length&&!r.href)continue;let i=t(n,r.href,{exact:r.match===`exact`,also:r.matchAlso});if(i<0)continue;let a=r.match===`exact`&&t(n,r.href,{exact:!0})>=0?1/0:i;a>e&&(e=a,s=r)}}for(let e of a)e.active=e.active??e===s;return i}function N(e){return Object.fromEntries(Object.entries(e).filter(([e])=>!k.has(e)))}var P=e=>e.header!=null;function F(e){return e.filter((t,n)=>{if(!P(t))return!0;let r=e.findIndex((e,t)=>t>n&&P(e));return e.slice(n+1,r<0?void 0:r).length>0})}var I=/* @__PURE__ */ new Set;function L(t){if(t.key!=null&&w.test(t.key))return;let n=t.key==null?`<AppShell> a collapsible group needs a key so its folded state can be remembered.`:`<AppShell> collapsible group key "${t.key}" must use lower-case letters, digits and hyphens.`,r=!0;try{r=process.env.NODE_ENV!==`production`}catch{r=!0}r&&!I.has(n)&&(I.add(n),e(n))}function ne(e){let t=[],n=e=>{for(let r of e)P(r)||(r.children?.length?n(r.children):t.push(r))};for(let t of e)n(t.items);let r=t.filter(e=>e.tab);if(r.length===0)return null;let i=r.length<t.length,a=i?S:C;if(r.length>a)throw Error(`<AppShell>: ${r.length} items carry tab: true, but the phone tab bar holds ${a} (${i?`4 plus More, because other items exist`:`5 when every item is a tab`}). Flag fewer items.`);return{tabs:r,hasMore:i,moreActive:t.some(e=>!e.tab&&e.active)}}function re({tab:e,linkComponent:t,iconVariant:n}){let r=`wui-tabbar-item${e.active?` active`:``}`,i=/* @__PURE__ */ b(v,{children:[e.icon&&/* @__PURE__ */ y(`span`,{className:`wui-tabbar-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ y(l,{name:e.icon,size:24,variant:e.iconVariant??n}):e.icon}),/* @__PURE__ */ y(`span`,{className:`wui-tabbar-label`,children:e.tabLabel??e.label}),e.badge!=null&&/* @__PURE__ */ y(`span`,{className:`wui-tabbar-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge})]}),a=e.active?`page`:void 0;return t?/* @__PURE__ */ y(t,{className:r,to:e.href,"aria-current":a,children:i}):/* @__PURE__ */ y(`a`,{className:r,href:e.href,"aria-current":a,children:i})}function R(e){for(let t of e){if(t.active)return t;let e=t.children?.length?R(t.children):void 0;if(e)return e}}function ie({item:e,linkComponent:t,onNavigate:n,depth:r=0,iconVariant:i}){let a=r>0,o=r>1?` wui-nav-depth-${Math.min(r,6)}`:``,s=Array.isArray(e.children)&&e.children.length>0,c=s?R(e.children):void 0,u=!!c,d=c?c.key??c.href??c.label:null,[f,m]=_(u);p(()=>{d!=null&&m(!0)},[d]);let h=typeof e.label==`string`?e.label:void 0,g=!a&&e.icon&&/* @__PURE__ */ y(`span`,{className:`app-nav-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ y(l,{name:e.icon,size:e.iconSize??22,variant:e.iconVariant??i}):e.icon}),x=e.badge!=null&&/* @__PURE__ */ y(`span`,{className:`app-nav-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge}),S=M(e.newUntil)&&/* @__PURE__ */ y(`span`,{className:`wui-nav-new`,children:`New`}),C=/* @__PURE__ */ b(v,{children:[g,/* @__PURE__ */ y(`span`,{className:`app-nav-text`,children:e.label}),S,x,e.trailingIcon&&/* @__PURE__ */ y(`span`,{className:`app-nav-trailing`,children:typeof e.trailingIcon==`string`?/* @__PURE__ */ y(l,{name:e.trailingIcon,size:16}):e.trailingIcon})]}),w=e.active?`page`:void 0;if(s){let s=/* @__PURE__ */ y(`div`,{className:`app-nav-sub${f?` expanded`:``}`,inert:!f,"aria-hidden":!f||void 0,children:/* @__PURE__ */ y(`div`,{className:`app-nav-sub-inner`,children:e.children.map(e=>/* @__PURE__ */ y(ie,{item:e,linkComponent:t,onNavigate:n,depth:r+1,iconVariant:i},e.key??e.href))})});if(e.href){let r=t?/* @__PURE__ */ y(t,{className:`wui-nav-split-link`,to:e.href,"aria-current":w,onClick:n,children:C}):/* @__PURE__ */ y(`a`,{className:`wui-nav-split-link`,href:e.href,"aria-current":w,onClick:n,children:C});return/* @__PURE__ */ b(v,{children:[/* @__PURE__ */ b(`div`,{className:`app-nav-item has-children wui-nav-split${a?` app-nav-subitem`:``}${u||e.active?` active`:``}${o}`,"data-label":h,children:[r,/* @__PURE__ */ y(`button`,{type:`button`,className:`app-nav-caret wui-nav-split-toggle`,"aria-expanded":f,"aria-label":`Show or hide ${h??``} pages`,onClick:()=>m(e=>!e),children:/* @__PURE__ */ y(l,{name:`chevron-right`,size:16})})]}),s]})}return/* @__PURE__ */ b(v,{children:[/* @__PURE__ */ b(`button`,{type:`button`,className:`app-nav-item${a?` app-nav-subitem`:``} has-children${u?` active`:``}${o}`,"aria-expanded":f,"data-label":h,onClick:()=>m(e=>!e),children:[g,/* @__PURE__ */ y(`span`,{className:`app-nav-text`,children:e.label}),S,x,/* @__PURE__ */ y(`span`,{className:`app-nav-caret`,children:/* @__PURE__ */ y(l,{name:`chevron-right`,size:16})})]}),s]})}let T=`app-nav-item${a?` app-nav-subitem`:``}${e.active?` active`:``}${o}`;return t?/* @__PURE__ */ y(t,{className:T,to:e.href,"aria-current":w,"data-label":h,onClick:n,children:C}):/* @__PURE__ */ y(`a`,{className:T,href:e.href,"aria-current":w,"data-label":h,onClick:n,children:C})}function z(){let[e,t]=_(!1),n=g(null);return p(()=>{if(!e)return;let r=e=>{n.current?.contains(e.target)||t(!1)},i=e=>{e.key===`Escape`&&(t(!1),n.current?.querySelector(`button`)?.focus())};return document.addEventListener(`mousedown`,r),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`mousedown`,r),document.removeEventListener(`keydown`,i)}},[e]),{open:e,setOpen:t,ref:n}}function ae({config:e,linkComponent:t}){let n=m(),{open:r,setOpen:i,ref:a}=z(),{name:o,role:s,roles:u=[],photo:d,profileHref:f,profileLabel:p=`My profile`,onLogout:h,logoutAction:g,logoutLabel:_=`Sign out`,items:x=[]}=e;if(!o)throw Error(`<AppShell> userMenu.name is required; the trigger and the avatar are named from it.`);let S=u.map(e=>(e??``).trim()).filter(Boolean),C=()=>i(!1),w=(e,n,r,i)=>t?/* @__PURE__ */ y(t,{className:`dropdown-item`,to:e,onClick:i,children:n},r):/* @__PURE__ */ y(`a`,{className:`dropdown-item`,href:e,onClick:i,children:n},r),T=/* @__PURE__ */ b(v,{children:[/* @__PURE__ */ y(l,{name:`log-out`,size:18}),_]});return/* @__PURE__ */ b(`div`,{className:`dropdown wui-usermenu`,ref:a,children:[/* @__PURE__ */ b(`button`,{type:`button`,id:n,className:`wui-usermenu-trigger`,"aria-expanded":r,"aria-label":`Account menu for ${o}`,onClick:()=>i(e=>!e),children:[/* @__PURE__ */ y(c,{name:o,src:d,tone:`auto`}),/* @__PURE__ */ b(`span`,{className:`wui-usermenu-text`,children:[/* @__PURE__ */ y(`span`,{className:`wui-usermenu-name`,children:o}),s&&/* @__PURE__ */ y(`span`,{className:`wui-usermenu-role`,children:s})]}),/* @__PURE__ */ y(l,{name:`chevron-down`,size:14,className:`wui-usermenu-caret`})]}),/* @__PURE__ */ b(`div`,{className:`dropdown-menu dropdown-menu-end wui-usermenu-menu${r?` show`:``}`,"aria-labelledby":n,"data-bs-popper":r?`static`:void 0,children:[/* @__PURE__ */ b(`div`,{className:`wui-usermenu-head`,children:[/* @__PURE__ */ y(c,{name:o,src:d,size:`lg`,tone:`auto`}),/* @__PURE__ */ b(`div`,{className:`wui-usermenu-who`,children:[/* @__PURE__ */ y(`div`,{className:`wui-usermenu-name`,children:o}),s&&/* @__PURE__ */ y(`div`,{className:`wui-usermenu-role`,children:s}),S.length>0&&/* @__PURE__ */ b(`div`,{className:`wui-usermenu-roles`,children:[/* @__PURE__ */ y(`span`,{className:`wui-usermenu-roles-label`,children:S.length===1?`Role:`:`Roles:`}),` ${S.join(`, `)}`]})]})]}),f&&w(f,/* @__PURE__ */ b(v,{children:[/* @__PURE__ */ y(l,{name:`user`,size:18}),p]}),void 0,C),x.map(e=>{if(e.divider)return/* @__PURE__ */ y(`hr`,{className:`dropdown-divider`},e.key);let t=/* @__PURE__ */ b(v,{children:[e.icon&&/* @__PURE__ */ y(l,{name:e.icon,size:18}),e.label]}),n=()=>{e.onClick?.(),C()};return e.href?w(e.href,t,e.key,n):/* @__PURE__ */ y(`button`,{type:`button`,className:`dropdown-item`,onClick:n,children:t},e.key)}),g?/* @__PURE__ */ y(`form`,{method:`post`,action:g,className:`wui-usermenu-logout`,children:/* @__PURE__ */ y(`button`,{type:`submit`,className:`dropdown-item danger`,children:T})}):h&&/* @__PURE__ */ y(`button`,{type:`button`,className:`dropdown-item danger`,onClick:()=>{C(),h()},children:T})]})]})}function oe({config:e}){let t=m(),{open:n,setOpen:r,ref:i}=z(),{unread:a=0,items:o,loading:s=!1,onOpen:c,onMarkAllRead:u,viewAllHref:d,label:f=`Notifications`,emptyText:h=`You are all caught up.`}=e,[x,S]=_(``),C=g(a);p(()=>{C.current!==a&&(C.current=a,S(a===0?`No unread notifications`:`${A(a)} unread notifications`))},[a]);let w=null;return o?.length?w=/* @__PURE__ */ y(`div`,{className:`wui-bell-items`,children:o.map((e,t)=>{let n=`wui-bell-item${e.read?` wui-bell-item-read`:``}`,r=/* @__PURE__ */ b(v,{children:[/* @__PURE__ */ y(`span`,{className:`wui-bell-dot`,"aria-hidden":`true`}),e.icon&&/* @__PURE__ */ y(`span`,{className:`wui-bell-icon`,children:/* @__PURE__ */ y(l,{name:e.icon,size:18})}),/* @__PURE__ */ b(`span`,{className:`wui-bell-body`,children:[!e.read&&/* @__PURE__ */ y(`span`,{className:`visually-hidden`,children:`Unread: `}),/* @__PURE__ */ y(`span`,{className:`wui-bell-item-title`,children:e.title}),e.time&&/* @__PURE__ */ y(`span`,{className:`wui-bell-when`,children:e.time})]})]});return e.href?/* @__PURE__ */ y(`a`,{className:n,href:e.href,"data-id":e.id,children:r},e.id??t):/* @__PURE__ */ y(`div`,{className:n,"data-id":e.id,children:r},e.id??t)})}):s?w=/* @__PURE__ */ y(`div`,{className:`wui-bell-state`,children:`Loading…`}):o&&(w=/* @__PURE__ */ y(`div`,{className:`wui-bell-state`,children:h})),/* @__PURE__ */ b(`div`,{className:`dropdown wui-bell`,ref:i,children:[/* @__PURE__ */ b(`button`,{type:`button`,id:t,className:`topbar-icon-btn wui-bell-trigger`,"aria-expanded":n,"aria-label":a===0?f:`${f}, ${A(a)} unread`,onClick:()=>{let e=!n;r(e),e&&c?.()},children:[/* @__PURE__ */ y(l,{name:`notification`,size:20}),/* @__PURE__ */ y(`span`,{className:`wui-bell-count`,"aria-hidden":`true`,hidden:a===0,children:A(a)})]}),/* @__PURE__ */ y(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:x}),/* @__PURE__ */ b(`div`,{className:`dropdown-menu dropdown-menu-end wui-bell-menu${n?` show`:``}`,"aria-labelledby":t,"data-bs-popper":n?`static`:void 0,children:[/* @__PURE__ */ b(`div`,{className:`wui-bell-head`,children:[/* @__PURE__ */ y(`span`,{className:`wui-bell-title`,children:f}),u&&/* @__PURE__ */ y(`button`,{type:`button`,className:`wui-bell-markall`,onClick:u,children:`Mark all read`})]}),/* @__PURE__ */ y(`div`,{className:`wui-bell-list`,"aria-busy":s||void 0,children:w}),d&&/* @__PURE__ */ y(`a`,{className:`wui-bell-foot`,href:d,children:`View all`})]})]})}var B=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function se({config:e}){let t=m(),{value:n=``,onChange:r,results:i=null,loading:a=!1,onSelect:o,onSubmit:s,placeholder:c=`Search`}=e,[u,d]=_(!1),[f,v]=_(!1),[x,S]=_({results:null,index:-1}),C=x.results===i?x.index:-1,w=e=>S({results:i,index:e}),T=g(null),E=g(null),D=g([]),O=h(()=>(i??[]).flatMap(e=>e.hits??[]),[i]),k=i!=null&&!f,A=O.length;p(()=>{let e=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||B(e.target)||(e.preventDefault(),d(!0),E.current?.focus())},t=e=>{T.current?.contains(e.target)||(v(!0),d(!1))};return document.addEventListener(`keydown`,e),document.addEventListener(`pointerdown`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`pointerdown`,t)}},[]);let j=e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(!k||A===0)return;e.preventDefault(),w((C+(e.key===`ArrowDown`?1:-1)+A)%A)}else e.key===`Enter`?k&&C>=0&&D.current[C]?(e.preventDefault(),D.current[C].click()):s&&n.trim()!==``&&(e.preventDefault(),s(n.trim())):e.key===`Escape`&&(k?(e.preventDefault(),v(!0)):u&&(e.preventDefault(),d(!1)))},M=-1;return D.current=[],/* @__PURE__ */ b(`div`,{className:`wui-topsearch${u?` is-open`:``}${a?` is-loading`:``}`,ref:T,children:[/* @__PURE__ */ y(`button`,{type:`button`,className:`topbar-icon-btn wui-topsearch-open`,"aria-label":c,"aria-expanded":u,"aria-controls":`${t}-panel`,onClick:()=>{let e=!u;d(e),e&&E.current?.focus()},children:/* @__PURE__ */ y(l,{name:`search`,size:20})}),/* @__PURE__ */ b(`div`,{className:`wui-topsearch-panel`,id:`${t}-panel`,children:[/* @__PURE__ */ b(`div`,{className:`search-wrap`,children:[/* @__PURE__ */ y(l,{name:`search`,size:18,className:`search-icon`}),/* @__PURE__ */ y(`input`,{ref:E,type:`search`,className:`form-control input search-input`,id:`${t}-input`,placeholder:c,"aria-label":c,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":k,"aria-controls":`${t}-list`,"aria-activedescendant":k&&C>=0?`${t}-opt-${C}`:void 0,autoComplete:`off`,value:n,onChange:e=>{v(!1),r?.(e.target.value)},onKeyDown:j})]}),/* @__PURE__ */ y(`div`,{className:`wui-topsearch-results`,id:`${t}-list`,role:`listbox`,"aria-label":`Search results`,hidden:!k,children:k&&/* @__PURE__ */ b(`div`,{className:`wui-topsearch-groups`,role:`presentation`,children:[A===0&&/* @__PURE__ */ b(`div`,{className:`wui-topsearch-empty`,role:`option`,"aria-disabled":`true`,"aria-selected":`false`,children:[`No results for “`,n,`”`]}),i.filter(e=>e.hits?.length).map((e,n)=>/* @__PURE__ */ b(`div`,{className:`wui-topsearch-group`,role:`group`,"aria-label":e.label??``,children:[e.label&&/* @__PURE__ */ y(`div`,{className:`wui-topsearch-group-label`,role:`presentation`,children:e.label}),e.hits.map(e=>{M+=1;let n=M;return/* @__PURE__ */ b(`a`,{className:`wui-topsearch-hit${n===C?` is-active`:``}`,role:`option`,"aria-selected":n===C,id:`${t}-opt-${n}`,href:e.href,ref:e=>{D.current[n]=e},onClick:t=>o?.(e,t),children:[e.icon&&/* @__PURE__ */ y(`span`,{className:`wui-topsearch-hit-icon`,children:/* @__PURE__ */ y(l,{name:e.icon,size:18})}),/* @__PURE__ */ b(`span`,{className:`wui-topsearch-hit-text`,children:[/* @__PURE__ */ y(`span`,{className:`wui-topsearch-hit-title`,children:e.title}),e.subtitle&&/* @__PURE__ */ y(`span`,{className:`wui-topsearch-hit-sub`,children:e.subtitle})]})]},`${e.href}-${n}`)})]},e.label??n))]})})]}),/* @__PURE__ */ y(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:k?A===0?`No results`:`${A} ${A===1?`result`:`results`}`:``})]})}export{ee as default};
|
|
1
|
+
import{devWarn as e}from"../lib/devWarn.js";import{navMatchScore as t}from"../lib/navMatch.js";import{SHELL_FOLDED_COOKIE as n,readNavFolded as r,readShellCollapsed as i,writeNavFolded as a,writeShellCollapsed as o}from"../lib/shellCookie.js";import{splitMarkerProps as s}from"../lib/wuiMarker.js";import c from"./AppAvatar.js";import l from"./AppButton.js";import u from"./AppIcon.js";import d from"./AppNavigationMenu.js";import f from"./warnInvalidValue.js";import p from"./warnUnknownProps.js";import{initScrollEdges as m}from"@webority/ui-elements/helpers";import{useEffect as h,useId as g,useMemo as _,useRef as v,useState as y}from"react";import{Fragment as b,jsx as x,jsxs as S}from"react/jsx-runtime";var C=99,w=4,T=5,E=/^[a-z0-9-]+$/,D=[`prefix`,`exact`],O=[`comfortable`,`compact`],k=[`default`,`primary`],A=[`side`,`top`],j=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],M=/* @__PURE__ */ new Set([`key`,`label`,`icon`,`iconVariant`,`iconSize`,`href`,`badge`,`badgeTone`,`badgeTitle`,`newUntil`,`trailingIcon`,`active`,`match`,`matchAlso`,`tab`,`tabLabel`,`children`]),N=e=>e>C?`${C}+`:String(e),P=new Intl.DateTimeFormat(`en-CA`,{timeZone:`Asia/Kolkata`}),ee=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:P.format(/* @__PURE__ */ new Date)<=e};function F(e){let{marker:t,props:c}=s(`AppShell`,e),{groups:l=[],brand:g,sidebarStart:b,sidebarStartCompact:C,sidebarFooter:w,topbarStart:T,topbarEnd:E,footer:D,launcher:M,children:N,collapsed:P,onCollapsedChange:ee,noSidebar:F=!1,nav:I=`side`,density:L=`comfortable`,itemHeight:R,iconVariant:z,topbarTone:B=`default`,navLabel:H=`Main navigation`,linkComponent:U,currentPath:W,rememberCollapsed:G=!1,collapsedCookie:le=`wui-shell-collapsed`,foldedCookie:K=n,tabBarLabel:ue=`Quick navigation`,moreLabel:de=`More`,userMenu:fe,notifications:pe,search:me,className:he=``,style:ge,..._e}=c;p(`AppShell`,_e),f(`AppShell`,`density`,L,O),f(`AppShell`,`topbarTone`,B,k),f(`AppShell`,`nav`,I,A),f(`AppShell`,`iconVariant`,z,j);let ve=R>0?{...ge,"--wui-nav-item-height":`${R}px`}:ge,[ye,be]=y(()=>G&&P===void 0&&typeof document<`u`?i(le)??!1:!1),[q,J]=y(!1),[xe,Se]=y(!1),[Ce,we]=y(!1),Y=v(null),Te=v(null),Ee=v(null),X=P??ye,De=()=>{let e=!X;P===void 0&&be(e),G&&o(e,le),ee?.(e)},Oe=l.some(e=>e.collapsible),[ke,Ae]=y(()=>Oe&&typeof document<`u`?r(K):/* @__PURE__ */ new Set),je=e=>{let t=new Set(ke);t.has(e)?t.delete(e):t.add(e),Ae(t),a(t,K)},Z=_(()=>te(l,W),[l,W]),Q=F?null:ne(Z);h(()=>{let e=()=>Se(window.scrollY>4);return e(),window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)},[]),h(()=>{m()},[]),h(()=>{let e=Y.current,t=e?.querySelector(`.app-nav-item[aria-current="page"]`);if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();n.top<r.top?e.scrollTop-=r.top-n.top:n.bottom>r.bottom&&(e.scrollTop+=n.bottom-r.bottom)},[]),h(()=>{let e=Y.current;if(!e)return;let t=()=>we(e.scrollHeight>e.clientHeight);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[Z]);let $=!!D;h(()=>{let e=Ee.current,t=Te.current;if(!$||!e||!t)return;let n=()=>t.style.setProperty(`--app-footer-h`,`${e.offsetHeight}px`);n();let r=typeof ResizeObserver>`u`?null:new ResizeObserver(n);return r?.observe(e),()=>{r?.disconnect(),t.style.removeProperty(`--app-footer-h`)}},[$]),h(()=>{if(!q)return;let e=e=>{e.key===`Escape`&&J(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[q]);let Me=[`app-shell`,X?`collapsed`:``,F?`no-sidebar`:``,I===`top`?`wui-shell-top`:``,q?`mobile-open`:``,he].filter(Boolean).join(` `);return/* @__PURE__ */ S(`div`,{ref:Te,className:Me,"data-density":L===`compact`?`compact`:void 0,"data-wui-folded-cookie":Oe?K:void 0,style:ve,...t,..._e,children:[/* @__PURE__ */ x(`a`,{className:`wui-skip-link`,href:`#main-content`,children:`Skip to content`}),/* @__PURE__ */ S(`aside`,{className:`app-sidebar`,children:[g&&/* @__PURE__ */ x(`div`,{className:`app-sidebar-brand`,children:g}),b&&/* @__PURE__ */ x(`div`,{className:`app-sidebar-start`,children:b}),C&&/* @__PURE__ */ x(`div`,{className:`app-sidebar-start-compact`,children:C}),/* @__PURE__ */ x(`nav`,{className:`app-sidebar-scroll`,"aria-label":H,ref:Y,tabIndex:Ce?0:void 0,children:Z.map((e,t)=>{let n=e.items.map(e=>e.header==null?/* @__PURE__ */ x(ae,{item:e,linkComponent:U,onNavigate:()=>J(!1),iconVariant:z},e.key??e.href??e.label):/* @__PURE__ */ x(`div`,{className:`wui-nav-header`,children:e.header},e.key??e.header));if(!e.collapsible)return/* @__PURE__ */ S(`div`,{className:`app-nav-group`,children:[e.label&&/* @__PURE__ */ x(`div`,{className:`app-nav-group-label`,children:e.label}),n,e.after&&/* @__PURE__ */ x(`div`,{className:`wui-nav-group-after`,children:e.after})]},e.key??e.label??`group-${t}`);let r=!ke.has(e.key)||!!V(e.items),i=`wui-nav-group-${e.key}`;return/* @__PURE__ */ S(`div`,{className:`app-nav-group wui-nav-group-collapsible${r?``:` wui-nav-group-folded`}`,"data-wui-nav-group":e.key,children:[/* @__PURE__ */ S(`button`,{type:`button`,className:`app-nav-group-label wui-nav-group-toggle`,"aria-expanded":r,"aria-controls":i,onClick:()=>je(e.key),children:[/* @__PURE__ */ x(`span`,{className:`wui-nav-group-text`,children:e.label}),/* @__PURE__ */ x(`span`,{className:`wui-nav-group-caret`,children:/* @__PURE__ */ x(u,{name:`chevron-down`,size:16})})]}),/* @__PURE__ */ S(`div`,{className:`wui-nav-group-body`,id:i,children:[n,e.after&&/* @__PURE__ */ x(`div`,{className:`wui-nav-group-after`,children:e.after})]})]},e.key??`group-${t}`)})}),w&&/* @__PURE__ */ x(`div`,{className:`app-sidebar-foot`,children:w}),!F&&/* @__PURE__ */ x(`button`,{type:`button`,className:`app-sidebar-toggle`,onClick:De,"aria-label":X?`Expand navigation`:`Collapse navigation`,"aria-expanded":!X,children:/* @__PURE__ */ x(u,{name:`chevrons-left`,size:20})})]}),/* @__PURE__ */ S(`div`,{className:`app-main`,children:[/* @__PURE__ */ S(`header`,{className:`app-topbar${xe?` scrolled`:``}`,"data-tone":B===`primary`?`primary`:void 0,children:[/* @__PURE__ */ S(`div`,{className:`app-topbar-start`,children:[/* @__PURE__ */ x(`button`,{type:`button`,className:`app-topbar-menu`,onClick:()=>J(!0),"aria-label":`Open navigation`,"aria-expanded":q,children:/* @__PURE__ */ x(u,{name:`menu`,size:18})}),I===`top`&&g&&/* @__PURE__ */ x(`div`,{className:`wui-shell-top-brand`,children:g}),I===`top`&&/* @__PURE__ */ x(`div`,{className:`wui-shell-top-nav`,children:/* @__PURE__ */ x(d,{items:re(Z),ariaLabel:H,linkComponent:U})}),T,me&&/* @__PURE__ */ x(ce,{config:me})]}),/* @__PURE__ */ S(`div`,{className:`app-topbar-end`,children:[E,pe&&/* @__PURE__ */ x(se,{config:pe}),fe&&/* @__PURE__ */ x(oe,{config:fe,linkComponent:U})]})]}),/* @__PURE__ */ x(`main`,{className:`app-content`,id:`main-content`,children:N}),D&&/* @__PURE__ */ x(`footer`,{className:`app-footer`,ref:Ee,children:D})]}),M&&/* @__PURE__ */ x(`div`,{className:`wui-shell-launcher`,children:M}),Q&&/* @__PURE__ */ S(`nav`,{className:`wui-tabbar`,"aria-label":ue,children:[Q.tabs.map(e=>/* @__PURE__ */ x(ie,{tab:e,linkComponent:U,iconVariant:z},e.key??e.href)),Q.hasMore&&/* @__PURE__ */ S(`button`,{type:`button`,className:`wui-tabbar-item${Q.moreActive?` active`:``}`,onClick:()=>J(!0),children:[/* @__PURE__ */ x(`span`,{className:`wui-tabbar-icon`,children:/* @__PURE__ */ x(u,{name:`more`,size:24})}),/* @__PURE__ */ x(`span`,{className:`wui-tabbar-label`,children:de})]})]}),/* @__PURE__ */ x(`button`,{type:`button`,className:`app-scrim`,onClick:()=>J(!1),"aria-label":`Close navigation`,tabIndex:q?0:-1})]})}function te(e,n){for(let t of e)t.collapsible&&B(t);let r=(e,t=!1)=>(e??[]).map(e=>Array.isArray(e.children)?{...e,children:r(e.children)}:{...e}).filter(e=>L(e)?t:(e.children?.length??0)>0||!!e.href),i=e.map(e=>({...e,items:R(r(e.items,!0))})).filter(e=>e.items.some(e=>!L(e))),a=[],o=e=>{for(let t of e)L(t)||(a.push(t),t.children&&o(t.children))};for(let e of i)o(e.items);for(let e of a)p(`AppShell items`,I(e)),f(`AppShell`,`match`,e.match,D),f(`AppShell`,`iconVariant`,e.iconVariant,j);let s=null;if(n!=null&&!a.some(e=>e.active===!0)){let e=-1;for(let r of a){if(r.active!=null||r.children?.length&&!r.href)continue;let i=t(n,r.href,{exact:r.match===`exact`,also:r.matchAlso});if(i<0)continue;let a=r.match===`exact`&&t(n,r.href,{exact:!0})>=0?1/0:i;a>e&&(e=a,s=r)}}for(let e of a)e.active=e.active??e===s;return i}function I(e){return Object.fromEntries(Object.entries(e).filter(([e])=>!M.has(e)))}var L=e=>e.header!=null;function R(e){return e.filter((t,n)=>{if(!L(t))return!0;let r=e.findIndex((e,t)=>t>n&&L(e));return e.slice(n+1,r<0?void 0:r).length>0})}var z=/* @__PURE__ */ new Set;function B(t){if(t.key!=null&&E.test(t.key))return;let n=t.key==null?`<AppShell> a collapsible group needs a key so its folded state can be remembered.`:`<AppShell> collapsible group key "${t.key}" must use lower-case letters, digits and hyphens.`,r=!0;try{r=process.env.NODE_ENV!==`production`}catch{r=!0}r&&!z.has(n)&&(z.add(n),e(n))}function ne(e){let t=[],n=e=>{for(let r of e)L(r)||(r.children?.length?n(r.children):t.push(r))};for(let t of e)n(t.items);let r=t.filter(e=>e.tab);if(r.length===0)return null;let i=r.length<t.length,a=i?w:T;if(r.length>a)throw Error(`<AppShell>: ${r.length} items carry tab: true, but the phone tab bar holds ${a} (${i?`4 plus More, because other items exist`:`5 when every item is a tab`}). Flag fewer items.`);return{tabs:r,hasMore:i,moreActive:t.some(e=>!e.tab&&e.active)}}function re(e){let t=e=>({key:e.key??e.href??e.label,label:e.label,to:e.href,current:!!e.active}),n=e=>e.flatMap(e=>L(e)?[]:[...e.href?[{...t(e),icon:e.icon}]:[],...n(e.children??[])]),r=[];for(let i of e.flatMap(e=>e.items)){if(L(i))continue;let e=n(i.children??[]);if(e.length>0){let n=i.href?[{...t(i),icon:i.icon}]:[];r.push({key:t(i).key,label:i.label,links:[...n,...e]})}else i.href&&r.push(t(i))}return r}function ie({tab:e,linkComponent:t,iconVariant:n}){let r=`wui-tabbar-item${e.active?` active`:``}`,i=/* @__PURE__ */ S(b,{children:[e.icon&&/* @__PURE__ */ x(`span`,{className:`wui-tabbar-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ x(u,{name:e.icon,size:24,variant:e.iconVariant??n}):e.icon}),/* @__PURE__ */ x(`span`,{className:`wui-tabbar-label`,children:e.tabLabel??e.label}),e.badge!=null&&/* @__PURE__ */ x(`span`,{className:`wui-tabbar-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge})]}),a=e.active?`page`:void 0;return t?/* @__PURE__ */ x(t,{className:r,to:e.href,"aria-current":a,children:i}):/* @__PURE__ */ x(`a`,{className:r,href:e.href,"aria-current":a,children:i})}function V(e){for(let t of e){if(t.active)return t;let e=t.children?.length?V(t.children):void 0;if(e)return e}}function ae({item:e,linkComponent:t,onNavigate:n,depth:r=0,iconVariant:i}){let a=r>0,o=r>1?` wui-nav-depth-${Math.min(r,6)}`:``,s=Array.isArray(e.children)&&e.children.length>0,c=s?V(e.children):void 0,l=!!c,d=c?c.key??c.href??c.label:null,[f,p]=y(l);h(()=>{d!=null&&p(!0)},[d]);let m=typeof e.label==`string`?e.label:void 0,g=!a&&e.icon&&/* @__PURE__ */ x(`span`,{className:`app-nav-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ x(u,{name:e.icon,size:e.iconSize??22,variant:e.iconVariant??i}):e.icon}),_=e.badge!=null&&/* @__PURE__ */ x(`span`,{className:`app-nav-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge}),v=ee(e.newUntil)&&/* @__PURE__ */ x(`span`,{className:`wui-nav-new`,children:`New`}),C=/* @__PURE__ */ S(b,{children:[g,/* @__PURE__ */ x(`span`,{className:`app-nav-text`,children:e.label}),v,_,e.trailingIcon&&/* @__PURE__ */ x(`span`,{className:`app-nav-trailing`,children:typeof e.trailingIcon==`string`?/* @__PURE__ */ x(u,{name:e.trailingIcon,size:16}):e.trailingIcon})]}),w=e.active?`page`:void 0;if(s){let s=/* @__PURE__ */ x(`div`,{className:`app-nav-sub${f?` expanded`:``}`,inert:!f,"aria-hidden":!f||void 0,children:/* @__PURE__ */ x(`div`,{className:`app-nav-sub-inner`,children:e.children.map(e=>/* @__PURE__ */ x(ae,{item:e,linkComponent:t,onNavigate:n,depth:r+1,iconVariant:i},e.key??e.href))})});if(e.href){let r=t?/* @__PURE__ */ x(t,{className:`wui-nav-split-link`,to:e.href,"aria-current":w,onClick:n,children:C}):/* @__PURE__ */ x(`a`,{className:`wui-nav-split-link`,href:e.href,"aria-current":w,onClick:n,children:C});return/* @__PURE__ */ S(b,{children:[/* @__PURE__ */ S(`div`,{className:`app-nav-item has-children wui-nav-split${a?` app-nav-subitem`:``}${l||e.active?` active`:``}${o}`,"data-label":m,children:[r,/* @__PURE__ */ x(`button`,{type:`button`,className:`app-nav-caret wui-nav-split-toggle`,"aria-expanded":f,"aria-label":`Show or hide ${m??``} pages`,onClick:()=>p(e=>!e),children:/* @__PURE__ */ x(u,{name:`chevron-right`,size:16})})]}),s]})}return/* @__PURE__ */ S(b,{children:[/* @__PURE__ */ S(`button`,{type:`button`,className:`app-nav-item${a?` app-nav-subitem`:``} has-children${l?` active`:``}${o}`,"aria-expanded":f,"data-label":m,onClick:()=>p(e=>!e),children:[g,/* @__PURE__ */ x(`span`,{className:`app-nav-text`,children:e.label}),v,_,/* @__PURE__ */ x(`span`,{className:`app-nav-caret`,children:/* @__PURE__ */ x(u,{name:`chevron-right`,size:16})})]}),s]})}let T=`app-nav-item${a?` app-nav-subitem`:``}${e.active?` active`:``}${o}`;return t?/* @__PURE__ */ x(t,{className:T,to:e.href,"aria-current":w,"data-label":m,onClick:n,children:C}):/* @__PURE__ */ x(`a`,{className:T,href:e.href,"aria-current":w,"data-label":m,onClick:n,children:C})}function H(){let[e,t]=y(!1),n=v(null);return h(()=>{if(!e)return;let r=e=>{n.current?.contains(e.target)||t(!1)},i=e=>{e.key===`Escape`&&(t(!1),n.current?.querySelector(`button`)?.focus())};return document.addEventListener(`mousedown`,r),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`mousedown`,r),document.removeEventListener(`keydown`,i)}},[e]),{open:e,setOpen:t,ref:n}}function oe({config:e,linkComponent:t}){let n=g(),{open:r,setOpen:i,ref:a}=H(),{name:o,role:s,roles:d=[],photo:p,profileHref:m,profileLabel:h=`My profile`,onLogout:_,logoutAction:v,logoutLabel:y=`Sign out`,head:C,section:w,logoutVariant:T=`item`,items:E=[]}=e;if(f(`AppShell`,`userMenu.logoutVariant`,T,[`item`,`button`]),!o)throw Error(`<AppShell> userMenu.name is required; the trigger and the avatar are named from it.`);let D=d.map(e=>(e??``).trim()).filter(Boolean),O=()=>i(!1),k=(e,n,r,i)=>t?/* @__PURE__ */ x(t,{className:`dropdown-item`,to:e,onClick:i,children:n},r):/* @__PURE__ */ x(`a`,{className:`dropdown-item`,href:e,onClick:i,children:n},r),A=/* @__PURE__ */ x(u,{name:`log-out`,size:18}),j=/* @__PURE__ */ S(b,{children:[A,y]});return/* @__PURE__ */ S(`div`,{className:`dropdown wui-usermenu`,ref:a,children:[/* @__PURE__ */ S(`button`,{type:`button`,id:n,className:`wui-usermenu-trigger`,"aria-expanded":r,"aria-label":`Account menu for ${o}`,onClick:()=>i(e=>!e),children:[/* @__PURE__ */ x(c,{name:o,src:p,tone:`auto`}),/* @__PURE__ */ S(`span`,{className:`wui-usermenu-text`,children:[/* @__PURE__ */ x(`span`,{className:`wui-usermenu-name`,children:o}),s&&/* @__PURE__ */ x(`span`,{className:`wui-usermenu-role`,children:s})]}),/* @__PURE__ */ x(u,{name:`chevron-down`,size:14,className:`wui-usermenu-caret`})]}),/* @__PURE__ */ S(`div`,{className:`dropdown-menu dropdown-menu-end wui-usermenu-menu${r?` show`:``}`,"aria-labelledby":n,"data-bs-popper":r?`static`:void 0,children:[/* @__PURE__ */ S(`div`,{className:`wui-usermenu-head`,children:[/* @__PURE__ */ x(c,{name:o,src:p,size:`lg`,tone:`auto`}),/* @__PURE__ */ S(`div`,{className:`wui-usermenu-who`,children:[/* @__PURE__ */ x(`div`,{className:`wui-usermenu-name`,children:o}),s&&/* @__PURE__ */ x(`div`,{className:`wui-usermenu-role`,children:s}),D.length>0&&/* @__PURE__ */ S(`div`,{className:`wui-usermenu-roles`,children:[/* @__PURE__ */ x(`span`,{className:`wui-usermenu-roles-label`,children:D.length===1?`Role:`:`Roles:`}),` ${D.join(`, `)}`]}),C?/* @__PURE__ */ x(`div`,{className:`wui-usermenu-extra`,children:C}):null]})]}),w?/* @__PURE__ */ x(`div`,{className:`wui-usermenu-section`,children:w}):null,m&&k(m,/* @__PURE__ */ S(b,{children:[/* @__PURE__ */ x(u,{name:`user`,size:18}),h]}),void 0,O),E.map(e=>{if(e.divider)return/* @__PURE__ */ x(`hr`,{className:`dropdown-divider`},e.key);let t=/* @__PURE__ */ S(b,{children:[e.icon&&/* @__PURE__ */ x(u,{name:e.icon,size:18}),e.label]}),n=()=>{e.onClick?.(),O()};return e.href?k(e.href,t,e.key,n):/* @__PURE__ */ x(`button`,{type:`button`,className:`dropdown-item`,onClick:n,children:t},e.key)}),T===`button`?(v||_)&&/* @__PURE__ */ x(`div`,{className:`wui-usermenu-foot`,children:v?/* @__PURE__ */ x(`form`,{method:`post`,action:v,className:`wui-usermenu-logout`,children:/* @__PURE__ */ x(l,{type:`submit`,variant:`secondary-danger`,block:!0,leftIcon:A,children:y})}):/* @__PURE__ */ x(l,{type:`button`,variant:`secondary-danger`,block:!0,leftIcon:A,onClick:()=>{O(),_()},children:y})}):v?/* @__PURE__ */ x(`form`,{method:`post`,action:v,className:`wui-usermenu-logout`,children:/* @__PURE__ */ x(`button`,{type:`submit`,className:`dropdown-item danger`,children:j})}):_&&/* @__PURE__ */ x(`button`,{type:`button`,className:`dropdown-item danger`,onClick:()=>{O(),_()},children:j})]})]})}function se({config:e}){let t=g(),{open:n,setOpen:r,ref:i}=H(),{unread:a=0,items:o,loading:s=!1,onOpen:c,onMarkAllRead:l,viewAllHref:d,label:f=`Notifications`,emptyText:p=`You are all caught up.`}=e,[m,_]=y(``),C=v(a);h(()=>{C.current!==a&&(C.current=a,_(a===0?`No unread notifications`:`${N(a)} unread notifications`))},[a]);let w=null;return o?.length?w=/* @__PURE__ */ x(`div`,{className:`wui-bell-items`,children:o.map((e,t)=>{let n=`wui-bell-item${e.read?` wui-bell-item-read`:``}`,r=/* @__PURE__ */ S(b,{children:[/* @__PURE__ */ x(`span`,{className:`wui-bell-dot`,"aria-hidden":`true`}),e.icon&&/* @__PURE__ */ x(`span`,{className:`wui-bell-icon`,children:/* @__PURE__ */ x(u,{name:e.icon,size:18})}),/* @__PURE__ */ S(`span`,{className:`wui-bell-body`,children:[!e.read&&/* @__PURE__ */ x(`span`,{className:`visually-hidden`,children:`Unread: `}),/* @__PURE__ */ x(`span`,{className:`wui-bell-item-title`,children:e.title}),e.time&&/* @__PURE__ */ x(`span`,{className:`wui-bell-when`,children:e.time})]})]});return e.href?/* @__PURE__ */ x(`a`,{className:n,href:e.href,"data-id":e.id,children:r},e.id??t):/* @__PURE__ */ x(`div`,{className:n,"data-id":e.id,children:r},e.id??t)})}):s?w=/* @__PURE__ */ x(`div`,{className:`wui-bell-state`,children:`Loading…`}):o&&(w=/* @__PURE__ */ x(`div`,{className:`wui-bell-state`,children:p})),/* @__PURE__ */ S(`div`,{className:`dropdown wui-bell`,ref:i,children:[/* @__PURE__ */ S(`button`,{type:`button`,id:t,className:`topbar-icon-btn wui-bell-trigger`,"aria-expanded":n,"aria-label":a===0?f:`${f}, ${N(a)} unread`,onClick:()=>{let e=!n;r(e),e&&c?.()},children:[/* @__PURE__ */ x(u,{name:`notification`,size:20}),/* @__PURE__ */ x(`span`,{className:`wui-bell-count`,"aria-hidden":`true`,hidden:a===0,children:N(a)})]}),/* @__PURE__ */ x(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:m}),/* @__PURE__ */ S(`div`,{className:`dropdown-menu dropdown-menu-end wui-bell-menu${n?` show`:``}`,"aria-labelledby":t,"data-bs-popper":n?`static`:void 0,children:[/* @__PURE__ */ S(`div`,{className:`wui-bell-head`,children:[/* @__PURE__ */ x(`span`,{className:`wui-bell-title`,children:f}),l&&/* @__PURE__ */ x(`button`,{type:`button`,className:`wui-bell-markall`,onClick:l,children:`Mark all read`})]}),/* @__PURE__ */ x(`div`,{className:`wui-bell-list`,"aria-busy":s||void 0,children:w}),d&&/* @__PURE__ */ x(`a`,{className:`wui-bell-foot`,href:d,children:`View all`})]})]})}var U=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function ce({config:e}){let t=g(),{value:n=``,onChange:r,results:i=null,loading:a=!1,onSelect:o,onSubmit:s,placeholder:c=`Search`}=e,[l,d]=y(!1),[f,p]=y(!1),[m,b]=y({results:null,index:-1}),C=m.results===i?m.index:-1,w=e=>b({results:i,index:e}),T=v(null),E=v(null),D=v([]),O=_(()=>(i??[]).flatMap(e=>e.hits??[]),[i]),k=i!=null&&!f,A=O.length;h(()=>{let e=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||U(e.target)||(e.preventDefault(),d(!0),E.current?.focus())},t=e=>{T.current?.contains(e.target)||(p(!0),d(!1))};return document.addEventListener(`keydown`,e),document.addEventListener(`pointerdown`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`pointerdown`,t)}},[]);let j=e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(!k||A===0)return;e.preventDefault(),w((C+(e.key===`ArrowDown`?1:-1)+A)%A)}else e.key===`Enter`?k&&C>=0&&D.current[C]?(e.preventDefault(),D.current[C].click()):s&&n.trim()!==``&&(e.preventDefault(),s(n.trim())):e.key===`Escape`&&(k?(e.preventDefault(),p(!0)):l&&(e.preventDefault(),d(!1)))},M=-1;return D.current=[],/* @__PURE__ */ S(`div`,{className:`wui-topsearch${l?` is-open`:``}${a?` is-loading`:``}`,ref:T,children:[/* @__PURE__ */ x(`button`,{type:`button`,className:`topbar-icon-btn wui-topsearch-open`,"aria-label":c,"aria-expanded":l,"aria-controls":`${t}-panel`,onClick:()=>{let e=!l;d(e),e&&E.current?.focus()},children:/* @__PURE__ */ x(u,{name:`search`,size:20})}),/* @__PURE__ */ S(`div`,{className:`wui-topsearch-panel`,id:`${t}-panel`,children:[/* @__PURE__ */ S(`div`,{className:`search-wrap`,children:[/* @__PURE__ */ x(u,{name:`search`,size:18,className:`search-icon`}),/* @__PURE__ */ x(`input`,{ref:E,type:`search`,className:`form-control input search-input`,id:`${t}-input`,placeholder:c,"aria-label":c,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":k,"aria-controls":`${t}-list`,"aria-activedescendant":k&&C>=0?`${t}-opt-${C}`:void 0,autoComplete:`off`,value:n,onChange:e=>{p(!1),r?.(e.target.value)},onKeyDown:j})]}),/* @__PURE__ */ x(`div`,{className:`wui-topsearch-results`,id:`${t}-list`,role:`listbox`,"aria-label":`Search results`,hidden:!k,children:k&&/* @__PURE__ */ S(`div`,{className:`wui-topsearch-groups`,role:`presentation`,children:[A===0&&/* @__PURE__ */ S(`div`,{className:`wui-topsearch-empty`,role:`option`,"aria-disabled":`true`,"aria-selected":`false`,children:[`No results for “`,n,`”`]}),i.filter(e=>e.hits?.length).map((e,n)=>/* @__PURE__ */ S(`div`,{className:`wui-topsearch-group`,role:`group`,"aria-label":e.label??``,children:[e.label&&/* @__PURE__ */ x(`div`,{className:`wui-topsearch-group-label`,role:`presentation`,children:e.label}),e.hits.map(e=>{M+=1;let n=M;return/* @__PURE__ */ S(`a`,{className:`wui-topsearch-hit${n===C?` is-active`:``}`,role:`option`,"aria-selected":n===C,id:`${t}-opt-${n}`,href:e.href,ref:e=>{D.current[n]=e},onClick:t=>o?.(e,t),children:[e.icon&&/* @__PURE__ */ x(`span`,{className:`wui-topsearch-hit-icon`,children:/* @__PURE__ */ x(u,{name:e.icon,size:18})}),/* @__PURE__ */ S(`span`,{className:`wui-topsearch-hit-text`,children:[/* @__PURE__ */ x(`span`,{className:`wui-topsearch-hit-title`,children:e.title}),e.subtitle&&/* @__PURE__ */ x(`span`,{className:`wui-topsearch-hit-sub`,children:e.subtitle})]})]},`${e.href}-${n}`)})]},e.label??n))]})})]}),/* @__PURE__ */ x(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:k?A===0?`No results`:`${A} ${A===1?`result`:`results`}`:``})]})}export{F as default};
|
package/dist/guidance.json
CHANGED
|
@@ -5,6 +5,8 @@ declare const AppPhoneNumberInput: import("react").ForwardRefExoticComponent<{
|
|
|
5
5
|
onChange?: (value: string) => void;
|
|
6
6
|
/** The ISO country code to start on. Left unset, the control starts on the viewer's own country. */
|
|
7
7
|
country?: string;
|
|
8
|
+
/** ISO alpha-2 code. The dial code is a static prefix with no picker, and the value always carries this country. */
|
|
9
|
+
lockedCountry?: string;
|
|
8
10
|
/**
|
|
9
11
|
* Turns the field off.
|
|
10
12
|
* @default false
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @param {object} props
|
|
7
7
|
* @param {number} [props.value]
|
|
8
8
|
* @param {number} [props.max]
|
|
9
|
-
* @param {'info'|'success'|'warning'|'danger'|'neutral'} [props.tone]
|
|
9
|
+
* @param {'primary'|'info'|'success'|'warning'|'danger'|'neutral'} [props.tone]
|
|
10
10
|
* @param {'sm'|'md'} [props.size]
|
|
11
11
|
* @param {string} [props.label]
|
|
12
12
|
* @param {boolean} [props.showLabel]
|
|
@@ -30,7 +30,7 @@ export default function AppProgress(props: {
|
|
|
30
30
|
* The fill colour.
|
|
31
31
|
* @default "info"
|
|
32
32
|
*/
|
|
33
|
-
tone?: 'info' | 'success' | 'warning' | 'danger' | 'neutral';
|
|
33
|
+
tone?: 'primary' | 'info' | 'success' | 'warning' | 'danger' | 'neutral';
|
|
34
34
|
/**
|
|
35
35
|
* The bar thickness. sm is a thin 4px bar for inline or table use.
|
|
36
36
|
* @default "md"
|
|
@@ -105,6 +105,18 @@ export type UserMenuShape = {
|
|
|
105
105
|
* Default "Sign out".
|
|
106
106
|
*/
|
|
107
107
|
logoutLabel?: string;
|
|
108
|
+
/**
|
|
109
|
+
* Under the name, role and roles lines (an email, an account id, a role badge).
|
|
110
|
+
*/
|
|
111
|
+
head?: import('react').ReactNode;
|
|
112
|
+
/**
|
|
113
|
+
* Between the head and the items: an account or workspace switcher.
|
|
114
|
+
*/
|
|
115
|
+
section?: import('react').ReactNode;
|
|
116
|
+
/**
|
|
117
|
+
* 'item' (default) is a danger row; 'button' is a full-width secondary-danger button in its own foot.
|
|
118
|
+
*/
|
|
119
|
+
logoutVariant?: 'item' | 'button';
|
|
108
120
|
items?: {
|
|
109
121
|
key: string;
|
|
110
122
|
label?: string;
|
|
@@ -211,6 +223,7 @@ export type SearchShape = {
|
|
|
211
223
|
* @param {boolean} [props.collapsed]
|
|
212
224
|
* @param {(collapsed: boolean) => void} [props.onCollapsedChange]
|
|
213
225
|
* @param {boolean} [props.noSidebar]
|
|
226
|
+
* @param {'side'|'top'} [props.nav] 'top': from lg up the groups' items ride in the top bar after brand through the navigation menu and no sidebar is drawn; below lg the drawer and the phone tab bar stay.
|
|
214
227
|
* @param {'comfortable'|'compact'} [props.density]
|
|
215
228
|
* @param {number} [props.itemHeight]
|
|
216
229
|
* @param {'linear'|'outline'|'bold'|'bulk'|'broken'|'twotone'} [props.iconVariant]
|
|
@@ -264,6 +277,11 @@ export default function AppShell(props: {
|
|
|
264
277
|
* @default false
|
|
265
278
|
*/
|
|
266
279
|
noSidebar?: boolean;
|
|
280
|
+
/**
|
|
281
|
+
* Where the primary navigation sits: a sidebar, or from lg up the top bar.
|
|
282
|
+
* @default "side"
|
|
283
|
+
*/
|
|
284
|
+
nav?: 'side' | 'top';
|
|
267
285
|
/**
|
|
268
286
|
* Compact sets the content's top padding to 12px.
|
|
269
287
|
* @default "comfortable"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.128.0",
|
|
4
4
|
"description": "Webority shared React component library — App* primitives on react-bootstrap + the @webority/theme design system.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
},
|
|
30
30
|
"sideEffects": false,
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@webority/markdown-core": "0.
|
|
33
|
-
"@webority/theme": "0.
|
|
34
|
-
"@webority/ui-elements": "0.
|
|
32
|
+
"@webority/markdown-core": "0.128.0",
|
|
33
|
+
"@webority/theme": "0.128.0",
|
|
34
|
+
"@webority/ui-elements": "0.128.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@webority/analytics": "^0.
|
|
37
|
+
"@webority/analytics": "^0.33.0",
|
|
38
38
|
"bootstrap": "5.3.3",
|
|
39
39
|
"react": "^19.0.0",
|
|
40
40
|
"react-bootstrap": "^2.10.0",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"@types/react": "^19.2.17",
|
|
49
49
|
"@vitejs/plugin-react": "^6.0.1",
|
|
50
50
|
"@vitest/coverage-v8": "5.0.1",
|
|
51
|
-
"@webority/analytics": "0.
|
|
52
|
-
"@webority/canvas-kit": "0.
|
|
53
|
-
"@webority/tokens": "0.
|
|
51
|
+
"@webority/analytics": "0.33.0",
|
|
52
|
+
"@webority/canvas-kit": "0.128.0",
|
|
53
|
+
"@webority/tokens": "0.128.0",
|
|
54
54
|
"bootstrap": "5.3.3",
|
|
55
55
|
"jsdom": "30.1.1",
|
|
56
56
|
"react": "^19.2.6",
|