@webority/ui-react 0.176.0 → 0.178.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 +96 -96
- package/dist/canvas-kit/manifest.json +157 -14
- package/dist/canvas-kit/release.json +6 -6
- package/dist/components/AppButton.js +1 -1
- package/dist/components/AppColumnMenu.js +1 -1
- package/dist/components/AppDataTable.js +1 -1
- package/dist/components/AppEntryGrid.js +1 -1
- package/dist/components/AppFilePicker.js +1 -1
- package/dist/components/AppFileViewer.js +1 -1
- package/dist/components/AppInlineEdit.js +1 -1
- package/dist/components/AppMeter.js +1 -1
- package/dist/components/AppModal.js +1 -1
- package/dist/components/AppOrgTree.js +1 -1
- package/dist/components/AppShell.js +1 -1
- package/dist/components/AppSplitView.js +1 -1
- package/dist/components/AppTablePagination.js +1 -1
- package/dist/components/AppTabs.js +1 -1
- package/dist/components/AppTextarea.js +1 -1
- package/dist/guidance.json +2 -8
- package/dist/types/components/AppButton.d.ts +5 -5
- package/dist/types/components/AppCheckbox.d.ts +1 -2
- package/dist/types/components/AppDataTable.d.ts +5 -2
- package/dist/types/components/AppFilePicker.d.ts +2 -2
- package/dist/types/components/AppFileViewer.d.ts +1 -1
- package/dist/types/components/AppIcon.d.ts +1 -1
- package/dist/types/components/AppInlineEdit.d.ts +2 -0
- package/dist/types/components/AppModal.d.ts +3 -0
- package/dist/types/components/AppShell.d.ts +2 -0
- package/dist/types/components/AppTablePagination.d.ts +5 -0
- package/dist/types/components/AppTabs.d.ts +1 -0
- package/dist/types/components/AppTextarea.d.ts +1 -1
- package/dist/web-core/dist/api/idempotencyKey.js +1 -1
- package/dist/web-core/dist/errors/extractApiError.js +1 -1
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../lib/DiscardPrompt.js";import{devWarn as t}from"../lib/devWarn.js";import n from"../lib/useElementEntry.js";import r from"../lib/useWuiText.js";import{splitMarkerProps as ee}from"../lib/wuiMarker.js";import i from"./AppIcon.js";import a from"./assertValidValue.js";import te from"./warnUnknownProps.js";import{useCallback as o,useEffect as s,useRef as c,useState as l}from"react";import{createPortal as
|
|
1
|
+
import e from"../lib/DiscardPrompt.js";import{devWarn as t}from"../lib/devWarn.js";import n from"../lib/useElementEntry.js";import r from"../lib/useWuiText.js";import{splitMarkerProps as ee}from"../lib/wuiMarker.js";import i from"./AppIcon.js";import a from"./assertValidValue.js";import te from"./warnUnknownProps.js";import{useCallback as o,useEffect as s,useRef as c,useState as l}from"react";import{createPortal as ne}from"react-dom";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{MODAL_TEXT as re}from"@webority/ui-elements/text";var ie=[`neutral`,`danger`,`success`,`warning`],ae=[`center`,`top`],oe=[`sans`,`serif`],se=()=>import(`@webority/ui-elements/elements/modal`),f={sm:380,md:440,lg:640,xl:880,wide:1080},ce=`wui-modal-fullscreen`,p=`wui-modal-wide`,le=e=>typeof e==`number`?e:e===`fullscreen`?f.md:f[e],m=!1;function h(){let e=!0;try{e=process.env.NODE_ENV!==`production`}catch{e=!0}e&&!m&&(m=!0,t("[@webority/ui-react] <AppModal hideHeader> has no accessible name: pass `ariaLabel` (or a string `title`)."))}function g(t){n(`wui-modal`,se);let m=r(`modal`,re),{marker:g,props:_}=ee(`AppModal`,t),{open:v,eyebrow:y,title:b,subtitle:x,headerIcon:S,tone:C=`neutral`,dismissible:ue=!0,onClose:w,onBack:T,backLabel:E=m.backLabel,headerActions:D,footer:O,size:k=`md`,phoneSize:A,placement:j=`center`,titleFont:M=`sans`,hideHeader:N=!1,staticBackdrop:de=!0,closeOnEscape:fe=!0,confirmDiscard:P,dirty:F=!1,ariaLabel:I,closeLabel:L=m.closeLabel,className:R=``,children:z,...B}=_;te(`AppModal`,B),a(`AppModal`,`tone`,C,ie),a(`AppModal`,`placement`,j,ae),a(`AppModal`,`titleFont`,M,oe),a(`AppModal`,`size`,typeof k==`string`?k:null,[...Object.keys(f),`fullscreen`]),a(`AppModal`,`phoneSize`,A,[...Object.keys(f),`fullscreen`]);let{style:V,ref:H,onExited:U,"data-wui":W,"data-wui-props":pe,...me}=B,G=W?{"data-wui":W,"data-wui-props":pe}:g,he=G[`data-wui`],ge=G[`data-wui-props`];N&&!I&&typeof b!=`string`&&h();let K=c(null),q=c(null),[_e,J]=l(v),ve=v||_e;s(()=>{v&&J(!0)},[v]);let Y=c(null),[X,Z]=l(!1);s(()=>{v||Z(!1)},[v]),s(()=>{X&&Y.current?.focus()},[X]);let ye=o(e=>{q.current=e,typeof H==`function`?H(e):H&&(H.current=e)},[H]),be=()=>{P&&F?Z(!0):w?.()},Q=c({open:v,requestClose:()=>{},onExited:U});Q.current={open:v,requestClose:be,onExited:U};let xe=o(e=>{if(!e)return;let t=t=>t.target instanceof Element&&t.target.closest(`wui-modal`)===e,n=e=>{t(e)&&(e.preventDefault(),Q.current.requestClose())},r=e=>{if(!t(e))return;Q.current.open||J(!1);let n=q.current;if(!n)throw TypeError(`<wui-modal> closed without its dialog.`);Q.current.onExited?.(n)};return e.addEventListener(`wui-modal-close`,n),e.addEventListener(`wui-modal-closed`,r),()=>{e.removeEventListener(`wui-modal-close`,n),e.removeEventListener(`wui-modal-closed`,r)}},[]),Se=()=>{Z(!1),w?.()},Ce=()=>{Z(!1),(K.current?.querySelector(`input:not([type="hidden"]):not([disabled]),select:not([disabled]),textarea:not([disabled])`))?.focus()},$=k===`fullscreen`,we=le(k),Te=[`modal-content`,`wui-modal`,C===`neutral`?``:`tone-${C}`,R].filter(Boolean).join(` `),Ee=[`modal`,`wui-modal-shell`,$&&ce,k===`wide`&&p,A&&`wui-modal-phone-${A}`].filter(Boolean).join(` `),De=[`modal-dialog`,j!==`top`&&`modal-dialog-centered`,`wui-rb-dialog`].filter(Boolean).join(` `),Oe=$?V:{"--wui-modal-max-width":`${we}px`,...V};return!ve||typeof document>`u`?null:ne(/* @__PURE__ */ u(`wui-modal`,{ref:xe,"data-wui":he,"data-wui-props":ge,open:v?``:void 0,static:de?``:void 0,"no-escape":fe&&!X?void 0:``,"confirm-discard":P||void 0,children:/* @__PURE__ */ u(`dialog`,{...me,ref:ye,className:Ee,"aria-label":I||(typeof b==`string`?b:void 0),style:Oe,children:/* @__PURE__ */ u(`div`,{className:De,children:/* @__PURE__ */ d(`div`,{className:Te,children:[!N&&/* @__PURE__ */ d(`div`,{className:`wui-modal-header`,children:[T&&/* @__PURE__ */ u(`button`,{type:`button`,className:`wui-modal-back`,onClick:T,"aria-label":E,children:/* @__PURE__ */ u(i,{name:`arrow-left`,size:18})}),/* @__PURE__ */ d(`div`,{className:`wui-modal-heading`,children:[S&&/* @__PURE__ */ u(`span`,{className:`wui-modal-headicon`,children:/* @__PURE__ */ u(i,{name:S,size:18})}),/* @__PURE__ */ d(`div`,{className:`wui-modal-headtext`,children:[y&&/* @__PURE__ */ u(`div`,{className:`wui-modal-eyebrow`,children:y}),/* @__PURE__ */ u(`div`,{className:M===`serif`?`wui-modal-title wui-modal-title-serif`:`wui-modal-title`,children:b}),x&&/* @__PURE__ */ u(`div`,{className:`wui-modal-subtitle`,children:x})]})]}),D&&/* @__PURE__ */ u(`div`,{className:`wui-modal-header-actions`,children:D}),ue&&/* @__PURE__ */ u(`button`,{type:`button`,className:`wui-modal-close`,"data-wui-dismiss":``,"aria-label":L,children:/* @__PURE__ */ u(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:/* @__PURE__ */ u(`path`,{d:`M18 6 6 18M6 6l12 12`})})})]}),/* @__PURE__ */ u(`div`,{className:`wui-modal-body`,ref:K,children:z}),(O||X)&&/* @__PURE__ */ d(`div`,{className:X?`wui-modal-footer wui-drawer-discarding`:`wui-modal-footer`,children:[X&&/* @__PURE__ */ u(e,{text:P,confirmRef:Y,onDiscard:Se,onKeep:Ce}),O]})]})})})}),document.body)}export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../lib/useElementEntry.js";import t from"../lib/useWuiText.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppAvatar.js";import i from"./AppIcon.js";import a from"./useWuiControl.js";import o from"./warnUnknownProps.js";import{useEffect as s,useId as c,useMemo as l,useRef as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{ORG_TREE_TEXT as p,fillText as m}from"@webority/ui-elements/text";function h(e){return`selected`in e}var g=()=>import(`@webority/ui-elements/elements/org-tree`);function _(e){let t=/* @__PURE__ */ new Map;for(let n of e){if(t.has(n.id))throw Error(`OrgTree node id "${n.id}" is used twice: every id must be unique.`);t.set(n.id,n)}let n=/* @__PURE__ */ new Map,r=[];for(let i of e){if(!i.parentId){r.push(i);continue}if(!t.has(i.parentId))throw Error(`OrgTree node "${i.id}" names parent "${i.parentId}", which is not in the list.`);let e=n.get(i.parentId);e||(e=[],n.set(i.parentId,e)),e.push(i)}for(let n of e){let r=n.parentId;for(let i=0;r&&i<=e.length;i+=1){if(r===n.id)throw Error(`OrgTree node "${n.id}" is its own ancestor: the reporting lines form a loop.`);r=t.get(r)?.parentId}}return{byId:t,childrenOf:n,roots:r}}function v(e,t){let n=/* @__PURE__ */ new Set;for(let r of e){let e=t.has(r)?r:null;for(;e&&!n.has(e);)n.add(e),e=t.get(e)?.parentId||null}return n}function y(e,t,n,a,o){let s=o.childrenOf.get(e.id)??[],c=s.length>0,l=c&&o.expandDepth!=null&&t>=o.expandDepth,u=o.renderOverlay?.(e),p;return o.highlightChain&&(p=o.highlightChain.has(e.id)?`highlight`:`dim`),/* @__PURE__ */ f(`li`,{className:`wui-org-tree-item`,role:`treeitem`,"data-wui-org-node":e.id,"aria-level":t,"aria-setsize":n,"aria-posinset":a+1,tabIndex:t===1&&a===0?0:-1,"aria-expanded":c?l?`false`:`true`:void 0,"aria-selected":o.selectable?o.selected===e.id?`true`:`false`:void 0,"data-wui-org-state":p,children:[/* @__PURE__ */ f(`div`,{className:`wui-org-tree-node`,children:[/* @__PURE__ */ d(r,{name:e.name,src:e.avatarUrl,size:`md`}),/* @__PURE__ */ f(`div`,{className:`wui-org-tree-text`,children:[/* @__PURE__ */ d(`span`,{className:`wui-org-tree-name`,children:e.name}),e.role?/* @__PURE__ */ d(`span`,{className:`wui-org-tree-role`,children:e.role}):null,e.team?/* @__PURE__ */ d(`span`,{className:`wui-org-tree-team`,children:e.team}):null]}),u==null?null:/* @__PURE__ */ d(`div`,{className:`wui-org-tree-overlay`,children:u}),c?/* @__PURE__ */ f(`button`,{type:`button`,className:`wui-org-tree-toggle`,"data-wui-org-toggle":``,tabIndex:-1,"aria-label":m(l?o.expandLabel:o.collapseLabel,{name:e.name}),children:[/* @__PURE__ */ d(i,{name:`chevron-down`,size:16}),/* @__PURE__ */ d(`span`,{className:`wui-org-tree-count`,children:s.length})]}):null]}),c?/* @__PURE__ */ d(`ul`,{className:`wui-org-tree-children`,role:`group`,hidden:l,children:b(s,t+1,o)}):null]},e.id)}function b(e,t,n){return e.map((r,i)=>y(r,t,e.length,i,n))}function x(r){let i=e(`wui-org-tree`,g),{marker:m,props:y}=n(`AppOrgTree`,r),x=t(`orgTree`,p),{nodes:S,renderOverlay:C,highlightIds:w,selectable:T=!1,selected:E,onSelect:D,expandDepth:O,searchable:k=!0,searchLabel:A=x.searchLabel,resultsText:j=x.resultsText,noResultsText:M=x.noResultsText,expandLabel:N=x.expandLabel,collapseLabel:P=x.collapseLabel,helpText:F=x.helpText,ariaLabel:I=x.ariaLabel,id:L,className:R=``,ref:z,...B}=y;if(!Array.isArray(S))throw Error(`<AppOrgTree> nodes is required: pass the flat list of people.`);o(`AppOrgTree`,B);let V=c(),H=L||`org-tree-${V.replace(/[^a-zA-Z0-9_-]/g,``)}`,U=`${H}-help`,W=l(()=>_(S),[S]),G=l(()=>Array.isArray(w)&&w.length>0?v(w,W.byId):null,[w,W]),{setRef:K,innerRef:q}=a({ready:i,ref:z,on:{"wui-org-tree:select":e=>{if(!(e instanceof CustomEvent))throw Error(`wui-org-tree:select must be a CustomEvent.`);let{id:t}=e.detail,n=e.currentTarget;D?.(t,W.byId.get(t)),n instanceof HTMLElement&&h(n)&&E!==void 0&&n.selected!==E&&(n.selected=E)}}}),J=u(!1);s(()=>{let e=q.current;e&&i&&h(e)&&(E===void 0?(J.current&&(e.selected=null),J.current=!1):(J.current=!0,e.selected!==E&&(e.selected=E)))},[E,q,i]);let Y={childrenOf:W.childrenOf,renderOverlay:C,highlightChain:G,selectable:T,selected:E,expandDepth:O,expandLabel:N,collapseLabel:P};return/* @__PURE__ */ f(`wui-org-tree`,{ref:K,id:H,class:R||void 0,selectable:T||void 0,selected:E??void 0,"search-results-text":j,"search-empty-text":M,"expand-label":N,"collapse-label":P,...m,...B,children:[k?/* @__PURE__ */ d(`div`,{className:`wui-org-tree-toolbar`,children:/* @__PURE__ */ d(`input`,{type:`search`,className:`form-control
|
|
1
|
+
import e from"../lib/useElementEntry.js";import t from"../lib/useWuiText.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppAvatar.js";import i from"./AppIcon.js";import a from"./useWuiControl.js";import o from"./warnUnknownProps.js";import{useEffect as s,useId as c,useMemo as l,useRef as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{ORG_TREE_TEXT as p,fillText as m}from"@webority/ui-elements/text";function h(e){return`selected`in e}var g=()=>import(`@webority/ui-elements/elements/org-tree`);function _(e){let t=/* @__PURE__ */ new Map;for(let n of e){if(t.has(n.id))throw Error(`OrgTree node id "${n.id}" is used twice: every id must be unique.`);t.set(n.id,n)}let n=/* @__PURE__ */ new Map,r=[];for(let i of e){if(!i.parentId){r.push(i);continue}if(!t.has(i.parentId))throw Error(`OrgTree node "${i.id}" names parent "${i.parentId}", which is not in the list.`);let e=n.get(i.parentId);e||(e=[],n.set(i.parentId,e)),e.push(i)}for(let n of e){let r=n.parentId;for(let i=0;r&&i<=e.length;i+=1){if(r===n.id)throw Error(`OrgTree node "${n.id}" is its own ancestor: the reporting lines form a loop.`);r=t.get(r)?.parentId}}return{byId:t,childrenOf:n,roots:r}}function v(e,t){let n=/* @__PURE__ */ new Set;for(let r of e){let e=t.has(r)?r:null;for(;e&&!n.has(e);)n.add(e),e=t.get(e)?.parentId||null}return n}function y(e,t,n,a,o){let s=o.childrenOf.get(e.id)??[],c=s.length>0,l=c&&o.expandDepth!=null&&t>=o.expandDepth,u=o.renderOverlay?.(e),p;return o.highlightChain&&(p=o.highlightChain.has(e.id)?`highlight`:`dim`),/* @__PURE__ */ f(`li`,{className:`wui-org-tree-item`,role:`treeitem`,"data-wui-org-node":e.id,"aria-level":t,"aria-setsize":n,"aria-posinset":a+1,tabIndex:t===1&&a===0?0:-1,"aria-expanded":c?l?`false`:`true`:void 0,"aria-selected":o.selectable?o.selected===e.id?`true`:`false`:void 0,"data-wui-org-state":p,children:[/* @__PURE__ */ f(`div`,{className:`wui-org-tree-node`,children:[/* @__PURE__ */ d(r,{name:e.name,src:e.avatarUrl,size:`md`}),/* @__PURE__ */ f(`div`,{className:`wui-org-tree-text`,children:[/* @__PURE__ */ d(`span`,{className:`wui-org-tree-name`,children:e.name}),e.role?/* @__PURE__ */ d(`span`,{className:`wui-org-tree-role`,children:e.role}):null,e.team?/* @__PURE__ */ d(`span`,{className:`wui-org-tree-team`,children:e.team}):null]}),u==null?null:/* @__PURE__ */ d(`div`,{className:`wui-org-tree-overlay`,children:u}),c?/* @__PURE__ */ f(`button`,{type:`button`,className:`wui-org-tree-toggle`,"data-wui-org-toggle":``,tabIndex:-1,"aria-label":m(l?o.expandLabel:o.collapseLabel,{name:e.name}),children:[/* @__PURE__ */ d(i,{name:`chevron-down`,size:16}),/* @__PURE__ */ d(`span`,{className:`wui-org-tree-count`,children:s.length})]}):null]}),c?/* @__PURE__ */ d(`ul`,{className:`wui-org-tree-children`,role:`group`,hidden:l,children:b(s,t+1,o)}):null]},e.id)}function b(e,t,n){return e.map((r,i)=>y(r,t,e.length,i,n))}function x(r){let i=e(`wui-org-tree`,g),{marker:m,props:y}=n(`AppOrgTree`,r),x=t(`orgTree`,p),{nodes:S,renderOverlay:C,highlightIds:w,selectable:T=!1,selected:E,onSelect:D,expandDepth:O,searchable:k=!0,searchLabel:A=x.searchLabel,resultsText:j=x.resultsText,noResultsText:M=x.noResultsText,expandLabel:N=x.expandLabel,collapseLabel:P=x.collapseLabel,helpText:F=x.helpText,ariaLabel:I=x.ariaLabel,id:L,className:R=``,ref:z,...B}=y;if(!Array.isArray(S))throw Error(`<AppOrgTree> nodes is required: pass the flat list of people.`);o(`AppOrgTree`,B);let V=c(),H=L||`org-tree-${V.replace(/[^a-zA-Z0-9_-]/g,``)}`,U=`${H}-help`,W=l(()=>_(S),[S]),G=l(()=>Array.isArray(w)&&w.length>0?v(w,W.byId):null,[w,W]),{setRef:K,innerRef:q}=a({ready:i,ref:z,on:{"wui-org-tree:select":e=>{if(!(e instanceof CustomEvent))throw Error(`wui-org-tree:select must be a CustomEvent.`);let{id:t}=e.detail,n=e.currentTarget;D?.(t,W.byId.get(t)),n instanceof HTMLElement&&h(n)&&E!==void 0&&n.selected!==E&&(n.selected=E)}}}),J=u(!1);s(()=>{let e=q.current;e&&i&&h(e)&&(E===void 0?(J.current&&(e.selected=null),J.current=!1):(J.current=!0,e.selected!==E&&(e.selected=E)))},[E,q,i]);let Y={childrenOf:W.childrenOf,renderOverlay:C,highlightChain:G,selectable:T,selected:E,expandDepth:O,expandLabel:N,collapseLabel:P};return/* @__PURE__ */ f(`wui-org-tree`,{ref:K,id:H,class:R||void 0,selectable:T||void 0,selected:E??void 0,"search-results-text":j,"search-empty-text":M,"expand-label":N,"collapse-label":P,...m,...B,children:[k?/* @__PURE__ */ d(`div`,{className:`wui-org-tree-toolbar`,children:/* @__PURE__ */ d(`input`,{type:`search`,className:`form-control wui-input-sm wui-org-tree-search`,"data-wui-org-search":``,"aria-label":A,placeholder:A,autoComplete:`off`})}):null,/* @__PURE__ */ d(`div`,{className:`wui-org-tree-canvas`,"data-wui-org-canvas":``,children:/* @__PURE__ */ d(`ul`,{className:`wui-org-tree`,role:`tree`,"aria-label":I,"aria-describedby":U,children:b(W.roots,1,Y)})}),/* @__PURE__ */ d(`p`,{className:`visually-hidden`,id:U,"data-wui-org-help":``,children:F}),/* @__PURE__ */ d(`div`,{className:`visually-hidden`,"data-wui-org-live":``,"aria-live":`polite`,"aria-atomic":`true`})]})}export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{devWarn as e}from"../lib/devWarn.js";import{linkTarget as t}from"../lib/linkTarget.js";import{navMatchScore as n}from"../lib/navMatch.js";import{SHELL_FOLDED_COOKIE as r,readNavFolded as i,readShellCollapsed as a,writeNavFolded as o,writeShellCollapsed as s}from"../lib/shellCookie.js";import{TargetLink as c}from"../lib/TargetLink.js";import l from"../lib/useElementEntry.js";import u from"../lib/useWuiText.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{IST_TIME_ZONE as y,initScrollEdges as b,isImeSafeEnter as x,revealActiveNavItem as S,setPopoverOpen as C}from"@webority/ui-elements/helpers";import{useEffect as w,useId as T,useMemo as E,useRef as D,useState as O}from"react";import{Fragment as k,jsx as A,jsxs as j}from"react/jsx-runtime";import{SHELL_TEXT as ee,fillText as M}from"@webority/ui-elements/text";var N=()=>import(`@webority/ui-elements/elements/overflow`),P=()=>import(`@webority/ui-elements/elements/dropdown`),F=99,I=4,L=5,R=/^[a-z0-9-]+$/,z=`wui-sidebar-footer`,B=[],V=[`prefix`,`exact`],H=[`comfortable`,`compact`],U=[`neutral`,`primary`],te=[`default`,`brand`],ne=[`side`,`top`],re=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],ie=/* @__PURE__ */ new Set([`key`,`label`,`icon`,`iconVariant`,`iconSize`,`href`,`badge`,`badgeTone`,`badgeTitle`,`newUntil`,`trailingIcon`,`active`,`match`,`matchAlso`,`tab`,`tabLabel`,`children`,`header`,`description`]),W=e=>e>F?`${F}+`:String(e),ae=new Intl.DateTimeFormat(`en-CA`,{timeZone:y}),oe=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:ae.format(/* @__PURE__ */ new Date)<=e},se=({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(` `)},ce=({logoLight:e,logoDark:t,markLight:n,markDark:r,brandName:i,logoLightWidth:a,logoLightHeight:o,logoDarkWidth:s,logoDarkHeight:c,markLightWidth:l,markLightHeight:u,markDarkWidth:d,markDarkHeight:f})=>{let p=i??``,m=[e&&/* @__PURE__ */ A(`img`,{className:`wui-brand-logo wui-brand-light`,src:e,alt:p,width:a,height:o},`logo-light`),t&&/* @__PURE__ */ A(`img`,{className:`wui-brand-logo wui-brand-dark`,src:t,alt:``,"aria-hidden":`true`,width:s,height:c},`logo-dark`)],h=[n&&[`mark-light`,`wui-brand-mark wui-brand-light`,n,l,u],r&&[`mark-dark`,`wui-brand-mark wui-brand-dark`,r,d,f]].filter(e=>!!e).map(([t,n,r,i,a],o)=>o===0&&!e?/* @__PURE__ */ A(`img`,{className:n,src:r,alt:p,width:i,height:a},t):/* @__PURE__ */ A(`img`,{className:n,src:r,alt:``,"aria-hidden":`true`,width:i,height:a},t));return[...m,...h].filter(Boolean)};function le(e){let{marker:t,props:n}=f(`AppShell`,e),c=u(`shell`,ee),{groups:l=[],brand:d,logoLight:p,logoDark:m,markLight:y,markDark:x,logoLightWidth:T,logoLightHeight:M,logoDarkWidth:N,logoDarkHeight:P,markLightWidth:F,markLightHeight:I,markDarkWidth:L,markDarkHeight:R,brandName:z,brandHref:V,brandLabel:ie,sidebarStart:W,sidebarStartCompact:ae,sidebarFooter:oe,sidebarFooterItems:le=B,topbarStart:de,topbarEnd:G,footer:fe,launcher:K,children:pe,collapsed:q,onCollapsedChange:ye,noSidebar:Y=!1,nav:Ce=`side`,topNavDetail:we=!1,capBadges:Te=!1,density:Ee=`comfortable`,itemHeight:De,iconVariant:Oe=`twotone`,topbarTone:ke=`neutral`,tone:Ae=`default`,navLabel:je=c.navLabel,linkComponent:X,currentPath:Me,rememberCollapsed:Ne=!1,collapsedCookie:Pe=`wui-shell-collapsed`,foldedCookie:Fe=r,tabBarLabel:Ie=c.tabBarLabel,moreLabel:Le=c.moreLabel,skipLabel:Re=c.skipLabel,openNavLabel:ze=c.openNavLabel,expandNavLabel:Be=c.expandNavLabel,collapseNavLabel:Ve=c.collapseNavLabel,newLabel:He=c.newLabel,togglePagesLabel:Ue=c.togglePagesLabel,accountMenuLabel:We=c.accountMenuLabel,roleLabel:Ge=c.roleLabel,rolesLabel:Ke=c.rolesLabel,unreadLabel:qe=c.unreadLabel,markAllReadLabel:Je=c.markAllReadLabel,viewAllLabel:Ye=c.viewAllLabel,loadingNotificationsText:Xe=c.loadingNotificationsText,noUnreadText:Ze=c.noUnreadText,unreadNotificationsText:Qe=c.unreadNotificationsText,unreadBellLabel:$e=c.unreadBellLabel,searchResultsLabel:et=c.searchResultsLabel,noResultsText:tt=c.noResultsText,noResultsForText:nt=c.noResultsForText,resultsCountText:rt=c.resultsCountText,resultCountText:it=c.resultCountText,userMenu:at,notifications:ot,search:st,className:ct=``,style:lt,...ut}=n;if(v(`AppShell`,ut),_(`AppShell`,`density`,Ee,H),_(`AppShell`,`topbarTone`,ke,U),_(`AppShell`,`tone`,Ae,te),_(`AppShell`,`nav`,Ce,ne),_(`AppShell`,`iconVariant`,Oe,re),ie!==void 0&&!V)throw Error(`<AppShell> brandLabel names the brand link, so it needs brandHref.`);if(V){if(!ie&&!z)throw Error(`<AppShell> brandHref needs brandLabel or brandName: the collapsed rail hides the logo, so the link would have no accessible name.`);if(!(d||p||m||y||x))throw Error(`<AppShell> brandHref has no brand, logo or mark to link.`)}let dt=(De??0)>0?{...lt,"--wui-nav-item-height":`${De}px`}:lt,[ft,pt]=O(()=>Ne&&q===void 0&&typeof document<`u`?a(Pe)??!1:!1),[Z,Q]=O(!1),mt=D(null),[ht,gt]=O(!1),[_t,vt]=O(!1),yt=D(null),bt=q??ft,xt=e=>V?/* @__PURE__ */ A(ge,{href:V,label:ie||z,linkComponent:X,onNavigate:()=>Q(!1),children:e}):e,St=()=>{let e=!bt;q===void 0&&pt(e),Ne&&s(e,Pe),ye?.(e)},Ct=l.some(e=>e.collapsible),[wt,Tt]=O(()=>Ct&&typeof document<`u`?i(Fe):/* @__PURE__ */ new Set),Et=e=>{let t=new Set(wt);t.has(e)?t.delete(e):t.add(e),Tt(t),o(t,Fe)},Dt=E(()=>ue(l,le,Me),[l,le,Me]),$=Dt.groups,Ot=Dt.footer,kt=Y?null:me($,Ot.some(e=>e.active));w(()=>{let e=()=>gt(window.scrollY>4);return e(),window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)},[]),w(()=>{b()},[]),w(()=>{S(yt.current)},[]),w(()=>{let e=yt.current;if(!e)return;let t=()=>vt($.length>0&&e.scrollHeight>e.clientHeight);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[$]),w(()=>{let e=mt.current;if(!e)return;let t=window.matchMedia(`(max-width: 991.98px)`),n=()=>{t.matches?e.setAttribute(`popover`,`auto`):(e.removeAttribute(`popover`),Q(!1))},r=e=>Q(`newState`in e&&e.newState===`open`);return n(),t.addEventListener(`change`,n),e.addEventListener(`toggle`,r),()=>{t.removeEventListener(`change`,n),e.removeEventListener(`toggle`,r)}},[]),w(()=>{let e=mt.current;e?.hasAttribute(`popover`)&&C(e,Z)},[Z]);let At=[`app-shell`,bt?`collapsed`:``,Y?`no-sidebar`:``,Ce===`top`?`wui-shell-top`:``,Z?`mobile-open`:``,ct].filter(Boolean).join(` `);return/* @__PURE__ */ j(`div`,{className:At,"data-density":Ee===`compact`?`compact`:void 0,"data-shell-tone":Ae===`brand`?`brand`:void 0,"data-wui-folded-cookie":Ct?Fe:void 0,style:dt,...t,...ut,children:[/* @__PURE__ */ A(`a`,{className:`wui-skip-link`,href:`#main-content`,children:Re}),/* @__PURE__ */ j(`aside`,{className:`app-sidebar`,ref:mt,children:[(d||p||m||y||x)&&/* @__PURE__ */ A(`div`,{className:se({logoLight:p,logoDark:m,markLight:y,markDark:x}),children:xt(/* @__PURE__ */ j(k,{children:[ce({logoLight:p,logoDark:m,markLight:y,markDark:x,brandName:z,logoLightWidth:T,logoLightHeight:M,logoDarkWidth:N,logoDarkHeight:P,markLightWidth:F,markLightHeight:I,markDarkWidth:L,markDarkHeight:R}),d]}))}),W&&/* @__PURE__ */ A(`div`,{className:`app-sidebar-start`,children:W}),ae&&/* @__PURE__ */ A(`div`,{className:`app-sidebar-start-compact`,children:ae}),/* @__PURE__ */ A(`nav`,{className:`app-sidebar-scroll`,"aria-label":je,ref:yt,tabIndex:_t?0:void 0,children:$.map((e,t)=>{let n=e.items.map(e=>e.header==null?/* @__PURE__ */ A(ve,{item:e,linkComponent:X,onNavigate:()=>Q(!1),iconVariant:Oe,newLabel:He,togglePagesLabel:Ue,capBadges:Te},e.key??e.href??e.label):/* @__PURE__ */ A(`div`,{className:`wui-nav-header`,children:e.header},e.key??e.header));if(!e.collapsible)return/* @__PURE__ */ j(`div`,{className:`app-nav-group`,children:[e.label&&/* @__PURE__ */ A(`div`,{className:`app-nav-group-label`,children:e.label}),n,e.after&&/* @__PURE__ */ A(`div`,{className:`wui-nav-group-after`,children:e.after})]},e.key??e.label??`group-${t}`);let r=!wt.has(e.key??``)||!!J(e.items),i=`wui-nav-group-${e.key}`;return/* @__PURE__ */ j(`div`,{className:`app-nav-group wui-nav-group-collapsible${r?``:` wui-nav-group-folded`}`,"data-wui-nav-group":e.key,children:[/* @__PURE__ */ j(`button`,{type:`button`,className:`app-nav-group-label wui-nav-group-toggle`,"aria-expanded":r,"aria-controls":i,onClick:()=>Et(e.key??``),children:[/* @__PURE__ */ A(`span`,{className:`wui-nav-group-text`,children:e.label}),/* @__PURE__ */ A(`span`,{className:`wui-nav-group-caret`,children:/* @__PURE__ */ A(h,{name:`chevron-down`,size:16})})]}),/* @__PURE__ */ j(`div`,{className:`wui-nav-group-body`,id:i,children:[n,e.after&&/* @__PURE__ */ A(`div`,{className:`wui-nav-group-after`,children:e.after})]})]},e.key??`group-${t}`)})}),(oe||Ot.length>0)&&/* @__PURE__ */ j(`div`,{className:`app-sidebar-foot`,children:[Ot.length>0&&/* @__PURE__ */ A(`div`,{className:`wui-sidebar-foot-links`,children:Ot.map(e=>/* @__PURE__ */ A(ve,{item:e,linkComponent:X,onNavigate:()=>Q(!1),iconVariant:Oe,newLabel:He,togglePagesLabel:Ue,capBadges:Te},e.key??e.href??e.label))}),oe]}),!Y&&/* @__PURE__ */ A(`button`,{type:`button`,className:`app-sidebar-toggle`,onClick:St,"aria-label":bt?Be:Ve,"aria-expanded":!bt,children:/* @__PURE__ */ A(h,{name:`chevrons-left`,size:20})})]}),/* @__PURE__ */ j(`div`,{className:`app-main`,children:[/* @__PURE__ */ j(`header`,{className:`app-topbar${ht?` wui-scrolled`:``}`,"data-tone":ke===`primary`?`primary`:void 0,children:[/* @__PURE__ */ j(`div`,{className:`app-topbar-start`,children:[/* @__PURE__ */ A(`button`,{type:`button`,className:`app-topbar-menu`,onClick:()=>Q(!0),"aria-label":ze,"aria-expanded":Z,children:/* @__PURE__ */ A(h,{name:`menu`,size:18})}),Ce===`top`&&d&&/* @__PURE__ */ A(`div`,{className:`wui-shell-top-brand`,children:xt(d)}),Ce===`top`&&/* @__PURE__ */ A(`div`,{className:`wui-shell-top-nav`,children:/* @__PURE__ */ A(g,{items:he($,we),ariaLabel:je,linkComponent:X})}),de,st&&/* @__PURE__ */ A(Se,{config:st,searchResultsLabel:et,noResultsText:tt,noResultsForText:nt,resultsCountText:rt,resultCountText:it,moreLabel:Le})]}),/* @__PURE__ */ j(`div`,{className:`app-topbar-end`,children:[G,ot&&/* @__PURE__ */ A(xe,{config:ot,unreadLabel:qe,markAllReadLabel:Je,viewAllLabel:Ye,loadingNotificationsText:Xe,noUnreadText:Ze,unreadNotificationsText:Qe,unreadBellLabel:$e}),at&&/* @__PURE__ */ A(be,{config:at,linkComponent:X,accountMenuLabel:We,roleLabel:Ge,rolesLabel:Ke})]})]}),/* @__PURE__ */ A(`main`,{className:`app-content`,id:`main-content`,children:pe}),fe&&/* @__PURE__ */ A(`footer`,{className:`app-footer`,children:fe})]}),K&&/* @__PURE__ */ A(`div`,{className:`wui-shell-launcher`,children:K}),kt&&/* @__PURE__ */ j(`nav`,{className:`wui-tabbar`,"aria-label":Ie,children:[kt.tabs.map(e=>/* @__PURE__ */ A(_e,{tab:e,linkComponent:X,iconVariant:Oe,capBadges:Te},e.key??e.href)),kt.hasMore&&/* @__PURE__ */ j(`button`,{type:`button`,className:`wui-tabbar-item${kt.moreActive?` active`:``}`,onClick:()=>Q(!0),children:[/* @__PURE__ */ A(`span`,{className:`wui-tabbar-icon`,children:/* @__PURE__ */ A(h,{name:`more`,size:24})}),/* @__PURE__ */ A(`span`,{className:`wui-tabbar-label`,children:Le})]})]})]})}function ue(e,t,r){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&&pe(t);let a=(e,t=!1)=>(e??[]).map(e=>Array.isArray(e.children)?{...e,children:a(e.children)}:{...e}).filter(e=>G(e)?t:(e.children?.length??0)>0||!!e.href),o=[...e,{key:z,items:t}].map(e=>({...e,items:fe(a(e.items,!0))})).filter(e=>e.items.some(e=>!G(e))),s=[],c=e=>{for(let t of e)G(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`,de(e)),_(`AppShell`,`match`,e.match,V),_(`AppShell`,`iconVariant`,e.iconVariant,re),_(`AppShell`,`badgeTone`,e.badgeTone,d);let l=null;if(r!=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=n(r,t.href,{exact:t.match===`exact`,also:t.matchAlso});if(i<0)continue;let a=t.match===`exact`&&n(r,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!==z),footer:o.find(e=>e.key===z)?.items??[]}}function de(e){return Object.fromEntries(Object.entries(e).filter(([e])=>!ie.has(e)))}var G=e=>e.header!=null;function fe(e){return e.filter((t,n)=>{if(!G(t))return!0;let r=e.findIndex((e,t)=>t>n&&G(e));return e.slice(n+1,r<0?void 0:r).length>0})}var K=/* @__PURE__ */ new Set;function pe(t){if(t.key!=null&&R.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`||K.has(n)||(K.add(n),e(n))}function me(e,t){let n=[],r=e=>{for(let t of e)G(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?I:L;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 he(e,t){let n=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},r=e=>e.key??e.href??n(e),i=(e,i)=>({key:r(e),label:n(e),to:i,current:!!e.active,...t&&e.description?{description:e.description}:{}}),a=e=>e.flatMap(e=>G(e)?[]:[...e.href?[{...i(e,e.href),icon:e.icon}]:[],...a(e.children??[])]),o=[];for(let s of e)for(let e of s.items){if(G(e))continue;let c=t&&s.label?{group:s.label}:{},l=a(e.children??[]);if(l.length>0){let a=e.href?[{...i(e,e.href),icon:e.icon}]:[],s=t&&(!!e.active||!!J(e.children??[]));o.push({key:r(e),label:n(e),links:[...a,...l],...c,...t?{current:s}:{}})}else e.href&&o.push({...i(e,e.href),...c})}return o}function q(e,t){return t&&typeof e==`number`&&e>F?`${F}+`:e}function ge({href:e,label:n,linkComponent:r,onNavigate:i,children:a}){return/* @__PURE__ */ A(c,{link:t(r,{to:e}),className:`wui-brand-link`,"aria-label":n,onClick:i,children:a})}function _e({tab:e,linkComponent:n,iconVariant:r,capBadges:i}){let a=`wui-tabbar-item${e.active?` active`:``}`,o=/* @__PURE__ */ j(k,{children:[e.icon&&/* @__PURE__ */ A(`span`,{className:`wui-tabbar-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ A(h,{name:e.icon,size:24,variant:e.iconVariant??r}):e.icon}),/* @__PURE__ */ A(`span`,{className:`wui-tabbar-label`,children:e.tabLabel??e.label}),e.badge!=null&&/* @__PURE__ */ A(`span`,{className:`wui-tabbar-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:q(e.badge,i)})]}),s=e.active?`page`:void 0;return/* @__PURE__ */ A(c,{link:t(n,{to:e.href}),className:a,"aria-current":s,children:o})}function J(e){for(let t of e){if(t.active)return t;let e=t.children?.length?J(t.children):void 0;if(e)return e}}function ve({item:e,linkComponent:n,onNavigate:r,depth:i=0,iconVariant:a,newLabel:o,togglePagesLabel:s,capBadges:l}){let u=i>0,d=i>1?` wui-nav-depth-${Math.min(i,6)}`:``,f=Array.isArray(e.children)&&e.children.length>0,p=f?J(e.children??[]):void 0,m=!!p,g=p?p.key??p.href??p.label:null,[_,v]=O(m);w(()=>{g!=null&&v(!0)},[g]);let y=typeof e.label==`string`?e.label:void 0,b=!u&&e.icon&&/* @__PURE__ */ A(`span`,{className:`app-nav-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ A(h,{name:e.icon,size:e.iconSize??22,variant:e.iconVariant??a}):e.icon}),x=e.badge!=null&&/* @__PURE__ */ A(`span`,{className:`app-nav-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:q(e.badge,l)}),S=oe(e.newUntil)&&/* @__PURE__ */ A(`span`,{className:`wui-nav-new`,children:o}),C=/* @__PURE__ */ j(k,{children:[b,/* @__PURE__ */ A(`span`,{className:`app-nav-text`,children:e.label}),S,x,e.trailingIcon&&/* @__PURE__ */ A(`span`,{className:`app-nav-trailing`,children:typeof e.trailingIcon==`string`?/* @__PURE__ */ A(h,{name:e.trailingIcon,size:16}):e.trailingIcon})]}),T=e.active?`page`:void 0;if(f){let f=/* @__PURE__ */ A(`div`,{className:`app-nav-sub${_?` expanded`:``}`,inert:!_,"aria-hidden":!_||void 0,children:/* @__PURE__ */ A(`div`,{className:`app-nav-sub-inner`,children:(e.children??[]).map(e=>/* @__PURE__ */ A(ve,{item:e,linkComponent:n,onNavigate:r,depth:i+1,iconVariant:a,newLabel:o,togglePagesLabel:s,capBadges:l},e.key??e.href))})});if(e.href){let i=/* @__PURE__ */ A(c,{link:t(n,{to:e.href}),className:`wui-nav-split-link`,"aria-current":T,onClick:r,children:C});return/* @__PURE__ */ j(k,{children:[/* @__PURE__ */ j(`div`,{className:`app-nav-item has-children wui-nav-split${u?` app-nav-subitem`:``}${m||e.active?` active`:``}${d}`,"data-label":y,children:[i,/* @__PURE__ */ A(`button`,{type:`button`,className:`app-nav-caret wui-nav-split-toggle`,"aria-expanded":_,"aria-label":M(s,{name:y??``}),onClick:()=>v(e=>!e),children:/* @__PURE__ */ A(h,{name:`chevron-right`,size:16})})]}),f]})}return/* @__PURE__ */ j(k,{children:[/* @__PURE__ */ j(`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__ */ A(`span`,{className:`app-nav-text`,children:e.label}),S,x,/* @__PURE__ */ A(`span`,{className:`app-nav-caret`,children:/* @__PURE__ */ A(h,{name:`chevron-right`,size:16})})]}),f]})}let E=`app-nav-item${u?` app-nav-subitem`:``}${e.active?` active`:``}${d}`;return/* @__PURE__ */ A(c,{link:t(n,{to:e.href}),className:E,"aria-current":T,"data-label":y,onClick:r,children:C})}function ye(e){l(`wui-dropdown`,P);let[t,n]=O(!1),r=D(null);return w(()=>{r.current?.toggleAttribute(`open`,t)},[t]),w(()=>{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 be({config:e,linkComponent:n,accountMenuLabel:r,roleLabel:i,rolesLabel:a}){let o=u(`shell`,ee),s=T(),{open:l,setOpen:d,ref:f}=ye(),{name:g,role:v,roles:y=[],noTriggerRole:b=!1,outlined:x=!1,photo:S,profileHref:C,profileLabel:w=o.profileLabel,onLogout:E,logoutAction:D,logoutLabel:O=o.logoutLabel,head:N,section:P,logoutVariant:F=`item`,items:I=[]}=e;if(_(`AppShell`,`userMenu.logoutVariant`,F,[`item`,`button`]),!g)throw Error(`<AppShell> userMenu.name is required; the trigger and the avatar are named from it.`);let L=y.map(e=>(e??``).trim()).filter(Boolean),R=()=>d(!1),z=(e,r,i,a)=>/* @__PURE__ */ A(c,{link:t(n,{to:e}),className:`dropdown-item`,onClick:a,children:r},i),B=/* @__PURE__ */ A(h,{name:`log-out`,size:18}),V=/* @__PURE__ */ j(k,{children:[B,O]});return/* @__PURE__ */ j(`wui-dropdown`,{class:`dropdown wui-usermenu`,align:`end`,ref:f,children:[/* @__PURE__ */ j(`button`,{type:`button`,id:s,className:x?`wui-usermenu-trigger wui-usermenu-trigger-outlined`:`wui-usermenu-trigger`,"data-wui-dropdown-trigger":!0,"aria-expanded":l,"aria-label":M(r,{name:g}),children:[/* @__PURE__ */ A(p,{name:g,src:S,tone:`auto`}),/* @__PURE__ */ j(`span`,{className:`wui-usermenu-text`,children:[/* @__PURE__ */ A(`span`,{className:`wui-usermenu-name`,children:g}),v&&!b&&/* @__PURE__ */ A(`span`,{className:`wui-usermenu-role`,children:v})]}),/* @__PURE__ */ A(h,{name:`chevron-down`,size:14,className:`wui-usermenu-caret`})]}),/* @__PURE__ */ j(`div`,{"data-wui-dropdown-menu":!0,popover:`auto`,className:`dropdown-menu dropdown-menu-end wui-usermenu-menu${l?` show`:``}`,"aria-labelledby":s,children:[/* @__PURE__ */ j(`div`,{className:`wui-usermenu-head`,children:[/* @__PURE__ */ A(p,{name:g,src:S,size:`lg`,tone:`auto`}),/* @__PURE__ */ j(`div`,{className:`wui-usermenu-who`,children:[/* @__PURE__ */ A(`div`,{className:`wui-usermenu-name`,children:g}),v&&/* @__PURE__ */ A(`div`,{className:`wui-usermenu-role`,children:v}),L.length>0&&/* @__PURE__ */ j(`div`,{className:`wui-usermenu-roles`,children:[/* @__PURE__ */ A(`span`,{className:`wui-usermenu-roles-label`,children:L.length===1?i:a}),` ${L.join(`, `)}`]}),N?/* @__PURE__ */ A(`div`,{className:`wui-usermenu-extra`,children:N}):null]})]}),P?/* @__PURE__ */ A(`div`,{className:`wui-usermenu-section`,children:P}):null,C&&z(C,/* @__PURE__ */ j(k,{children:[/* @__PURE__ */ A(h,{name:`user`,size:18}),w]}),void 0,R),I.map(e=>{if(e.divider)return/* @__PURE__ */ A(`hr`,{className:`dropdown-divider`},e.key);let t=/* @__PURE__ */ j(k,{children:[e.icon&&/* @__PURE__ */ A(h,{name:e.icon,size:18}),e.label]}),n=()=>{e.onClick?.(),R()};return e.href?z(e.href,t,e.key,n):/* @__PURE__ */ A(`button`,{type:`button`,className:`dropdown-item`,onClick:n,children:t},e.key)}),F===`button`?(D||E)&&/* @__PURE__ */ A(`div`,{className:`wui-usermenu-foot`,children:D?/* @__PURE__ */ A(`form`,{method:`post`,action:D,className:`wui-usermenu-logout`,children:/* @__PURE__ */ A(m,{type:`submit`,tone:`danger`,variant:`soft`,block:!0,leftIcon:B,children:O})}):/* @__PURE__ */ A(m,{type:`button`,tone:`danger`,variant:`soft`,block:!0,leftIcon:B,onClick:()=>{R(),E?.()},children:O})}):D?/* @__PURE__ */ A(`form`,{method:`post`,action:D,className:`wui-usermenu-logout`,children:/* @__PURE__ */ A(`button`,{type:`submit`,className:`dropdown-item danger`,children:V})}):E&&/* @__PURE__ */ A(`button`,{type:`button`,className:`dropdown-item danger`,onClick:()=>{R(),E()},children:V})]})]})}function xe({config:e,unreadLabel:t,markAllReadLabel:n,viewAllLabel:r,loadingNotificationsText:i,noUnreadText:a,unreadNotificationsText:o,unreadBellLabel:s}){let c=u(`shell`,ee),l=T(),{open:d,ref:f}=ye(e.onOpen),{unread:p=0,items:m,loading:g=!1,onMarkAllRead:_,viewAllHref:v,label:y=c.label,emptyText:b=c.emptyText}=e,[x,S]=O(``),C=D(p);w(()=>{C.current!==p&&(C.current=p,S(p===0?a:M(o,{count:W(p)})))},[p,a,o]);let E=null;return m?.length?E=/* @__PURE__ */ A(`div`,{className:`wui-bell-items`,children:m.map((e,n)=>{let r=`wui-bell-item${e.read?` wui-bell-item-read`:``}`,i=/* @__PURE__ */ j(k,{children:[/* @__PURE__ */ A(`span`,{className:`wui-bell-dot`,"aria-hidden":`true`}),e.icon&&/* @__PURE__ */ A(`span`,{className:`wui-bell-icon`,children:/* @__PURE__ */ A(h,{name:e.icon,size:18})}),/* @__PURE__ */ j(`span`,{className:`wui-bell-body`,children:[!e.read&&/* @__PURE__ */ j(`span`,{className:`visually-hidden`,children:[t,`: `]}),/* @__PURE__ */ A(`span`,{className:`wui-bell-item-title`,children:e.title}),e.time&&/* @__PURE__ */ A(`span`,{className:`wui-bell-when`,children:e.time})]})]});return e.href?/* @__PURE__ */ A(`a`,{className:r,href:e.href,"data-id":e.id,children:i},e.id??n):/* @__PURE__ */ A(`div`,{className:r,"data-id":e.id,children:i},e.id??n)})}):g?E=/* @__PURE__ */ A(`div`,{className:`wui-bell-state`,children:i}):m&&(E=/* @__PURE__ */ A(`div`,{className:`wui-bell-state`,children:b})),/* @__PURE__ */ j(`wui-dropdown`,{class:`dropdown wui-bell`,align:`end`,ref:f,children:[/* @__PURE__ */ j(`button`,{type:`button`,id:l,className:`topbar-icon-btn wui-bell-trigger`,"data-wui-dropdown-trigger":!0,"aria-expanded":d,"aria-label":p===0?y:M(s,{label:y,count:W(p)}),children:[/* @__PURE__ */ A(h,{name:`notification`,size:20}),/* @__PURE__ */ A(`span`,{className:`wui-bell-count`,"aria-hidden":`true`,hidden:p===0,children:W(p)})]}),/* @__PURE__ */ A(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:x}),/* @__PURE__ */ j(`div`,{"data-wui-dropdown-menu":!0,popover:`auto`,className:`dropdown-menu dropdown-menu-end wui-bell-menu${d?` show`:``}`,"aria-labelledby":l,children:[/* @__PURE__ */ j(`div`,{className:`wui-bell-head`,children:[/* @__PURE__ */ A(`span`,{className:`wui-bell-title`,children:y}),_&&/* @__PURE__ */ A(`button`,{type:`button`,className:`wui-bell-markall`,onClick:_,children:n})]}),/* @__PURE__ */ A(`div`,{className:`wui-bell-list`,"aria-busy":g||void 0,children:E}),v&&/* @__PURE__ */ A(`a`,{className:`wui-bell-foot`,href:v,children:r})]})]})}var Y=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function Se({config:e,searchResultsLabel:t,noResultsText:n,noResultsForText:r,resultsCountText:i,resultCountText:a,moreLabel:o}){l(`wui-overflow`,N);let s=u(`shell`,ee),c=T(),{value:d=``,onChange:f,results:p=null,loading:m=!1,onSelect:g,onSubmit:_,onFocus:v,placeholder:y=s.placeholder}=e,[b,S]=O(!1),[C,k]=O(!1),[P,F]=O({results:null,index:-1}),I=P.results===p?P.index:-1,L=e=>F({results:p,index:e}),R=D(null),z=D(null),B=D([]),V=E(()=>(p??[]).flatMap(e=>e.hits??[]),[p]),H=p!=null&&!C,U=V.length;w(()=>{let e=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||Y(e.target instanceof HTMLElement?e.target:null)||(e.preventDefault(),S(!0),z.current?.focus())},t=e=>{R.current?.contains(e.target instanceof Node?e.target:null)||(k(!0),S(!1))};return document.addEventListener(`keydown`,e),document.addEventListener(`pointerdown`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`pointerdown`,t)}},[]);let te=e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(!H||U===0)return;e.preventDefault(),L((I+(e.key===`ArrowDown`?1:-1)+U)%U)}else x(e.nativeEvent)?H&&I>=0&&B.current[I]?(e.preventDefault(),B.current[I].click()):_&&d.trim()!==``&&(e.preventDefault(),_(d.trim())):e.key===`Escape`&&(H?(e.preventDefault(),k(!0)):b&&(e.preventDefault(),S(!1)))},ne=-1;return B.current=[],/* @__PURE__ */ A(`wui-overflow`,{class:`wui-topsearch-host`,label:o,children:/* @__PURE__ */ A(`div`,{"data-wui-overflow-list":!0,className:`wui-topsearch-row`,children:/* @__PURE__ */ j(`div`,{className:`wui-topsearch${b?` is-open`:``}${m?` is-loading`:``}`,ref:R,"data-overflow-label":y,children:[/* @__PURE__ */ A(`button`,{type:`button`,className:`topbar-icon-btn wui-topsearch-open`,"aria-label":y,"aria-expanded":b,"aria-controls":`${c}-panel`,onClick:()=>{let e=!b;S(e),e&&z.current?.focus()},children:/* @__PURE__ */ A(h,{name:`search`,size:20})}),/* @__PURE__ */ j(`div`,{className:`wui-topsearch-panel`,id:`${c}-panel`,children:[/* @__PURE__ */ j(`div`,{className:`search-wrap`,children:[/* @__PURE__ */ A(h,{name:`search`,size:18,className:`search-icon`}),/* @__PURE__ */ A(`input`,{ref:z,type:`search`,className:`form-control input search-input`,id:`${c}-input`,placeholder:y,"aria-label":y,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":H,"aria-controls":`${c}-list`,"aria-activedescendant":H&&I>=0?`${c}-opt-${I}`:void 0,autoComplete:`off`,value:d,onChange:e=>{k(!1),f?.(e.target.value)},onKeyDown:te,onFocus:v})]}),/* @__PURE__ */ A(`div`,{className:`wui-topsearch-results`,id:`${c}-list`,role:`listbox`,"aria-label":t,hidden:!H,children:H&&/* @__PURE__ */ j(`div`,{className:`wui-topsearch-groups`,role:`presentation`,children:[U===0&&/* @__PURE__ */ A(`div`,{className:`wui-topsearch-empty`,role:`option`,"aria-disabled":`true`,"aria-selected":`false`,children:M(r,{value:d})}),p.filter(e=>e.hits?.length).map((e,t)=>/* @__PURE__ */ j(`div`,{className:`wui-topsearch-group`,role:`group`,"aria-label":e.label??``,children:[e.label&&/* @__PURE__ */ A(`div`,{className:`wui-topsearch-group-label`,role:`presentation`,children:e.label}),e.hits.map(e=>{ne+=1;let t=ne;return/* @__PURE__ */ j(`a`,{className:`wui-topsearch-hit${t===I?` is-active`:``}`,role:`option`,"aria-selected":t===I,id:`${c}-opt-${t}`,href:e.href,ref:e=>{B.current[t]=e},onClick:t=>g?.(e,t),children:[e.icon&&/* @__PURE__ */ A(`span`,{className:`wui-topsearch-hit-icon`,children:/* @__PURE__ */ A(h,{name:e.icon,size:18})}),/* @__PURE__ */ j(`span`,{className:`wui-topsearch-hit-text`,children:[/* @__PURE__ */ A(`span`,{className:`wui-topsearch-hit-title`,children:e.title}),e.subtitle&&/* @__PURE__ */ A(`span`,{className:`wui-topsearch-hit-sub`,children:e.subtitle})]})]},`${e.href}-${t}`)})]},e.label??t))]})})]}),/* @__PURE__ */ A(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:H?U===0?n:M(U===1?a:i,{count:U}):``})]})})})}export{le as default};
|
|
1
|
+
import{devWarn as e}from"../lib/devWarn.js";import{linkTarget as t}from"../lib/linkTarget.js";import{navMatchScore as n}from"../lib/navMatch.js";import{SHELL_FOLDED_COOKIE as r,readNavFolded as i,readShellCollapsed as a,writeNavFolded as o,writeShellCollapsed as s}from"../lib/shellCookie.js";import{TargetLink as c}from"../lib/TargetLink.js";import l from"../lib/useElementEntry.js";import u from"../lib/useWuiText.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{IST_TIME_ZONE as y,initScrollEdges as b,isApplePlatform as x,isCommandChord as S,isImeSafeEnter as C,revealActiveNavItem as w,setPopoverOpen as T}from"@webority/ui-elements/helpers";import{useEffect as E,useId as ee,useMemo as D,useRef as O,useState as k}from"react";import{Fragment as A,jsx as j,jsxs as M}from"react/jsx-runtime";import{SHELL_TEXT as te,fillText as N}from"@webority/ui-elements/text";var ne=()=>import(`@webority/ui-elements/elements/overflow`),P=()=>import(`@webority/ui-elements/elements/dropdown`),F=99,I=4,L=5,R=/^[a-z0-9-]+$/,z=`wui-sidebar-footer`,re=[],B=[`prefix`,`exact`],V=[`comfortable`,`compact`],H=[`neutral`,`primary`],ie=[`default`,`brand`],U=[`side`,`top`],W=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],ae=/* @__PURE__ */ new Set([`key`,`label`,`icon`,`iconVariant`,`iconSize`,`href`,`badge`,`badgeTone`,`badgeTitle`,`newUntil`,`trailingIcon`,`active`,`match`,`matchAlso`,`tab`,`tabLabel`,`children`,`header`,`description`]),G=e=>e>F?`${F}+`:String(e),oe=new Intl.DateTimeFormat(`en-CA`,{timeZone:y}),se=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:oe.format(/* @__PURE__ */ new Date)<=e},ce=({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(` `)},le=({logoLight:e,logoDark:t,markLight:n,markDark:r,brandName:i,logoLightWidth:a,logoLightHeight:o,logoDarkWidth:s,logoDarkHeight:c,markLightWidth:l,markLightHeight:u,markDarkWidth:d,markDarkHeight:f})=>{let p=i??``,m=[e&&/* @__PURE__ */ j(`img`,{className:`wui-brand-logo wui-brand-light`,src:e,alt:p,width:a,height:o},`logo-light`),t&&/* @__PURE__ */ j(`img`,{className:`wui-brand-logo wui-brand-dark`,src:t,alt:``,"aria-hidden":`true`,width:s,height:c},`logo-dark`)],h=[n&&[`mark-light`,`wui-brand-mark wui-brand-light`,n,l,u],r&&[`mark-dark`,`wui-brand-mark wui-brand-dark`,r,d,f]].filter(e=>!!e).map(([t,n,r,i,a],o)=>o===0&&!e?/* @__PURE__ */ j(`img`,{className:n,src:r,alt:p,width:i,height:a},t):/* @__PURE__ */ j(`img`,{className:n,src:r,alt:``,"aria-hidden":`true`,width:i,height:a},t));return[...m,...h].filter(Boolean)};function ue(e){let{marker:t,props:n}=f(`AppShell`,e),c=u(`shell`,te),{groups:l=[],brand:d,logoLight:p,logoDark:m,markLight:y,markDark:x,logoLightWidth:S,logoLightHeight:C,logoDarkWidth:ee,logoDarkHeight:N,markLightWidth:ne,markLightHeight:P,markDarkWidth:F,markDarkHeight:I,brandName:L,brandHref:R,brandLabel:z,sidebarStart:B,sidebarStartCompact:ae,sidebarFooter:G,sidebarFooterItems:oe=re,topbarStart:se,topbarEnd:ue,footer:fe,launcher:K,children:pe,collapsed:q,onCollapsedChange:me,noSidebar:J=!1,nav:Y=`side`,topNavDetail:Ce=!1,capBadges:Te=!1,density:Ee=`comfortable`,itemHeight:De,iconVariant:Oe=`twotone`,topbarTone:ke=`neutral`,tone:Ae=`default`,navLabel:je=c.navLabel,linkComponent:X,currentPath:Me,rememberCollapsed:Ne=!1,collapsedCookie:Pe=`wui-shell-collapsed`,foldedCookie:Fe=r,tabBarLabel:Ie=c.tabBarLabel,moreLabel:Le=c.moreLabel,skipLabel:Re=c.skipLabel,openNavLabel:ze=c.openNavLabel,expandNavLabel:Be=c.expandNavLabel,collapseNavLabel:Ve=c.collapseNavLabel,newLabel:He=c.newLabel,togglePagesLabel:Ue=c.togglePagesLabel,accountMenuLabel:We=c.accountMenuLabel,roleLabel:Ge=c.roleLabel,rolesLabel:Ke=c.rolesLabel,unreadLabel:qe=c.unreadLabel,markAllReadLabel:Je=c.markAllReadLabel,viewAllLabel:Ye=c.viewAllLabel,loadingNotificationsText:Xe=c.loadingNotificationsText,noUnreadText:Ze=c.noUnreadText,unreadNotificationsText:Qe=c.unreadNotificationsText,unreadBellLabel:$e=c.unreadBellLabel,searchResultsLabel:et=c.searchResultsLabel,noResultsText:tt=c.noResultsText,noResultsForText:nt=c.noResultsForText,resultsCountText:rt=c.resultsCountText,resultCountText:it=c.resultCountText,userMenu:at,notifications:ot,search:st,className:ct=``,style:lt,...ut}=n;if(v(`AppShell`,ut),_(`AppShell`,`density`,Ee,V),_(`AppShell`,`topbarTone`,ke,H),_(`AppShell`,`tone`,Ae,ie),_(`AppShell`,`nav`,Y,U),_(`AppShell`,`iconVariant`,Oe,W),z!==void 0&&!R)throw Error(`<AppShell> brandLabel names the brand link, so it needs brandHref.`);if(R){if(!z&&!L)throw Error(`<AppShell> brandHref needs brandLabel or brandName: the collapsed rail hides the logo, so the link would have no accessible name.`);if(!(d||p||m||y||x))throw Error(`<AppShell> brandHref has no brand, logo or mark to link.`)}let dt=(De??0)>0?{...lt,"--wui-nav-item-height":`${De}px`}:lt,[ft,pt]=k(()=>Ne&&q===void 0&&typeof document<`u`?a(Pe)??!1:!1),[Z,Q]=k(!1),mt=O(null),[ht,gt]=k(!1),[_t,vt]=k(!1),yt=O(null),bt=q??ft,xt=e=>R?/* @__PURE__ */ j(_e,{href:R,label:z||L,linkComponent:X,onNavigate:()=>Q(!1),children:e}):e,St=()=>{let e=!bt;q===void 0&&pt(e),Ne&&s(e,Pe),me?.(e)},Ct=l.some(e=>e.collapsible),[wt,Tt]=k(()=>Ct&&typeof document<`u`?i(Fe):/* @__PURE__ */ new Set),Et=e=>{let t=new Set(wt);t.has(e)?t.delete(e):t.add(e),Tt(t),o(t,Fe)},Dt=D(()=>de(l,oe,Me),[l,oe,Me]),$=Dt.groups,Ot=Dt.footer,kt=J?null:he($,Ot.some(e=>e.active));E(()=>{let e=()=>gt(window.scrollY>4);return e(),window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)},[]),E(()=>{b()},[]),E(()=>{w(yt.current)},[]),E(()=>{let e=yt.current;if(!e)return;let t=()=>vt($.length>0&&e.scrollHeight>e.clientHeight);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[$]),E(()=>{let e=mt.current;if(!e)return;let t=window.matchMedia(`(max-width: 991.98px)`),n=()=>{t.matches?e.setAttribute(`popover`,`auto`):(e.removeAttribute(`popover`),Q(!1))},r=e=>Q(`newState`in e&&e.newState===`open`);return n(),t.addEventListener(`change`,n),e.addEventListener(`toggle`,r),()=>{t.removeEventListener(`change`,n),e.removeEventListener(`toggle`,r)}},[]),E(()=>{let e=mt.current;e?.hasAttribute(`popover`)&&T(e,Z)},[Z]);let At=[`app-shell`,bt?`collapsed`:``,J?`no-sidebar`:``,Y===`top`?`wui-shell-top`:``,Z?`mobile-open`:``,ct].filter(Boolean).join(` `);return/* @__PURE__ */ M(`div`,{className:At,"data-density":Ee===`compact`?`compact`:void 0,"data-shell-tone":Ae===`brand`?`brand`:void 0,"data-wui-folded-cookie":Ct?Fe:void 0,style:dt,...t,...ut,children:[/* @__PURE__ */ j(`a`,{className:`wui-skip-link`,href:`#main-content`,children:Re}),/* @__PURE__ */ M(`aside`,{className:`app-sidebar`,ref:mt,children:[(d||p||m||y||x)&&/* @__PURE__ */ j(`div`,{className:ce({logoLight:p,logoDark:m,markLight:y,markDark:x}),children:xt(/* @__PURE__ */ M(A,{children:[le({logoLight:p,logoDark:m,markLight:y,markDark:x,brandName:L,logoLightWidth:S,logoLightHeight:C,logoDarkWidth:ee,logoDarkHeight:N,markLightWidth:ne,markLightHeight:P,markDarkWidth:F,markDarkHeight:I}),d]}))}),B&&/* @__PURE__ */ j(`div`,{className:`app-sidebar-start`,children:B}),ae&&/* @__PURE__ */ j(`div`,{className:`app-sidebar-start-compact`,children:ae}),/* @__PURE__ */ j(`nav`,{className:`app-sidebar-scroll`,"aria-label":je,ref:yt,tabIndex:_t?0:void 0,children:$.map((e,t)=>{let n=e.items.map(e=>e.header==null?/* @__PURE__ */ j(be,{item:e,linkComponent:X,onNavigate:()=>Q(!1),iconVariant:Oe,newLabel:He,togglePagesLabel:Ue,capBadges:Te},e.key??e.href??e.label):/* @__PURE__ */ j(`div`,{className:`wui-nav-header`,children:e.header},e.key??e.header));if(!e.collapsible)return/* @__PURE__ */ M(`div`,{className:`app-nav-group`,children:[e.label&&/* @__PURE__ */ j(`div`,{className:`app-nav-group-label`,children:e.label}),n,e.after&&/* @__PURE__ */ j(`div`,{className:`wui-nav-group-after`,children:e.after})]},e.key??e.label??`group-${t}`);let r=!wt.has(e.key??``)||!!ye(e.items),i=`wui-nav-group-${e.key}`;return/* @__PURE__ */ M(`div`,{className:`app-nav-group wui-nav-group-collapsible${r?``:` wui-nav-group-folded`}`,"data-wui-nav-group":e.key,children:[/* @__PURE__ */ M(`button`,{type:`button`,className:`app-nav-group-label wui-nav-group-toggle`,"aria-expanded":r,"aria-controls":i,onClick:()=>Et(e.key??``),children:[/* @__PURE__ */ j(`span`,{className:`wui-nav-group-text`,children:e.label}),/* @__PURE__ */ j(`span`,{className:`wui-nav-group-caret`,children:/* @__PURE__ */ j(h,{name:`chevron-down`,size:16})})]}),/* @__PURE__ */ M(`div`,{className:`wui-nav-group-body`,id:i,children:[n,e.after&&/* @__PURE__ */ j(`div`,{className:`wui-nav-group-after`,children:e.after})]})]},e.key??`group-${t}`)})}),(G||Ot.length>0)&&/* @__PURE__ */ M(`div`,{className:`app-sidebar-foot`,children:[Ot.length>0&&/* @__PURE__ */ j(`div`,{className:`wui-sidebar-foot-links`,children:Ot.map(e=>/* @__PURE__ */ j(be,{item:e,linkComponent:X,onNavigate:()=>Q(!1),iconVariant:Oe,newLabel:He,togglePagesLabel:Ue,capBadges:Te},e.key??e.href??e.label))}),G]}),!J&&/* @__PURE__ */ j(`button`,{type:`button`,className:`app-sidebar-toggle`,onClick:St,"aria-label":bt?Be:Ve,"aria-expanded":!bt,children:/* @__PURE__ */ j(h,{name:`chevrons-left`,size:20})})]}),/* @__PURE__ */ M(`div`,{className:`app-main`,children:[/* @__PURE__ */ M(`header`,{className:`app-topbar${ht?` wui-scrolled`:``}`,"data-tone":ke===`primary`?`primary`:void 0,children:[/* @__PURE__ */ M(`div`,{className:`app-topbar-start`,children:[/* @__PURE__ */ j(`button`,{type:`button`,className:`app-topbar-menu`,onClick:()=>Q(!0),"aria-label":ze,"aria-expanded":Z,children:/* @__PURE__ */ j(h,{name:`menu`,size:18})}),Y===`top`&&d&&/* @__PURE__ */ j(`div`,{className:`wui-shell-top-brand`,children:xt(d)}),Y===`top`&&/* @__PURE__ */ j(`div`,{className:`wui-shell-top-nav`,children:/* @__PURE__ */ j(g,{items:ge($,Ce),ariaLabel:je,linkComponent:X})}),se,st&&/* @__PURE__ */ j(we,{config:st,searchResultsLabel:et,noResultsText:tt,noResultsForText:nt,resultsCountText:rt,resultCountText:it,moreLabel:Le})]}),/* @__PURE__ */ M(`div`,{className:`app-topbar-end`,children:[ue,ot&&/* @__PURE__ */ j(Se,{config:ot,unreadLabel:qe,markAllReadLabel:Je,viewAllLabel:Ye,loadingNotificationsText:Xe,noUnreadText:Ze,unreadNotificationsText:Qe,unreadBellLabel:$e}),at&&/* @__PURE__ */ j(xe,{config:at,linkComponent:X,accountMenuLabel:We,roleLabel:Ge,rolesLabel:Ke})]})]}),/* @__PURE__ */ j(`main`,{className:`app-content`,id:`main-content`,children:pe}),fe&&/* @__PURE__ */ j(`footer`,{className:`app-footer`,children:fe})]}),K&&/* @__PURE__ */ j(`div`,{className:`wui-shell-launcher`,children:K}),kt&&/* @__PURE__ */ M(`nav`,{className:`wui-tabbar`,"aria-label":Ie,"data-wui-cap-badges":Te||void 0,children:[kt.tabs.map(e=>/* @__PURE__ */ j(ve,{tab:e,linkComponent:X,iconVariant:Oe,capBadges:Te},e.key??e.href)),kt.hasMore&&/* @__PURE__ */ M(`button`,{type:`button`,className:`wui-tabbar-item${kt.moreActive?` active`:``}`,onClick:()=>Q(!0),children:[/* @__PURE__ */ j(`span`,{className:`wui-tabbar-icon`,children:/* @__PURE__ */ j(h,{name:`more`,size:24})}),/* @__PURE__ */ j(`span`,{className:`wui-tabbar-label`,children:Le})]})]})]})}function de(e,t,r){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&&me(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:z,items:t}].map(e=>({...e,items:pe(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`,fe(e)),_(`AppShell`,`match`,e.match,B),_(`AppShell`,`iconVariant`,e.iconVariant,W),_(`AppShell`,`badgeTone`,e.badgeTone,d);let l=null;if(r!=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=n(r,t.href,{exact:t.match===`exact`,also:t.matchAlso});if(i<0)continue;let a=t.match===`exact`&&n(r,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!==z),footer:o.find(e=>e.key===z)?.items??[]}}function fe(e){return Object.fromEntries(Object.entries(e).filter(([e])=>!ae.has(e)))}var K=e=>e.header!=null;function pe(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 me(t){if(t.key!=null&&R.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 he(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?I:L;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 ge(e,t){let n=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},r=e=>e.key??e.href??n(e),i=(e,i)=>({key:r(e),label:n(e),to:i,current:!!e.active,...t&&e.description?{description:e.description}:{}}),a=e=>e.flatMap(e=>K(e)?[]:[...e.href?[{...i(e,e.href),icon:e.icon}]:[],...a(e.children??[])]),o=[];for(let s of e)for(let e of s.items){if(K(e))continue;let c=t&&s.label?{group:s.label}:{},l=a(e.children??[]);if(l.length>0){let a=e.href?[{...i(e,e.href),icon:e.icon}]:[],s=t&&(!!e.active||!!ye(e.children??[]));o.push({key:r(e),label:n(e),links:[...a,...l],...c,...t?{current:s}:{}})}else e.href&&o.push({...i(e,e.href),...c})}return o}function J(e,t){return t&&typeof e==`number`&&e>F?`${F}+`:e}function _e({href:e,label:n,linkComponent:r,onNavigate:i,children:a}){return/* @__PURE__ */ j(c,{link:t(r,{to:e}),className:`wui-brand-link`,"aria-label":n,onClick:i,children:a})}function ve({tab:e,linkComponent:n,iconVariant:r,capBadges:i}){let a=`wui-tabbar-item${e.active?` active`:``}`,o=/* @__PURE__ */ M(A,{children:[e.icon&&/* @__PURE__ */ j(`span`,{className:`wui-tabbar-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ j(h,{name:e.icon,size:24,variant:e.iconVariant??r}):e.icon}),/* @__PURE__ */ j(`span`,{className:`wui-tabbar-label`,children:e.tabLabel??e.label}),e.badge!=null&&/* @__PURE__ */ j(`span`,{className:`wui-tabbar-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:J(e.badge,i)}),e.badge!=null&&e.badgeTitle&&/* @__PURE__ */ j(`span`,{className:`visually-hidden`,children:e.badgeTitle})]}),s=e.active?`page`:void 0;return/* @__PURE__ */ j(c,{link:t(n,{to:e.href}),className:a,"aria-current":s,children:o})}function ye(e){for(let t of e){if(t.active)return t;let e=t.children?.length?ye(t.children):void 0;if(e)return e}}function be({item:e,linkComponent:n,onNavigate:r,depth:i=0,iconVariant:a,newLabel:o,togglePagesLabel:s,capBadges:l}){let u=i>0,d=i>1?` wui-nav-depth-${Math.min(i,6)}`:``,f=Array.isArray(e.children)&&e.children.length>0,p=f?ye(e.children??[]):void 0,m=!!p,g=p?p.key??p.href??p.label:null,[_,v]=k(m);E(()=>{g!=null&&v(!0)},[g]);let y=typeof e.label==`string`?e.label:void 0,b=!u&&e.icon&&/* @__PURE__ */ j(`span`,{className:`app-nav-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ j(h,{name:e.icon,size:e.iconSize??22,variant:e.iconVariant??a}):e.icon}),x=e.badge!=null&&/* @__PURE__ */ j(`span`,{className:`app-nav-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:J(e.badge,l)}),S=se(e.newUntil)&&/* @__PURE__ */ j(`span`,{className:`wui-nav-new`,children:o}),C=/* @__PURE__ */ M(A,{children:[b,/* @__PURE__ */ j(`span`,{className:`app-nav-text`,children:e.label}),S,x,e.trailingIcon&&/* @__PURE__ */ j(`span`,{className:`app-nav-trailing`,children:typeof e.trailingIcon==`string`?/* @__PURE__ */ j(h,{name:e.trailingIcon,size:16}):e.trailingIcon})]}),w=e.active?`page`:void 0;if(f){let f=/* @__PURE__ */ j(`div`,{className:`app-nav-sub${_?` expanded`:``}`,inert:!_,"aria-hidden":!_||void 0,children:/* @__PURE__ */ j(`div`,{className:`app-nav-sub-inner`,children:(e.children??[]).map(e=>/* @__PURE__ */ j(be,{item:e,linkComponent:n,onNavigate:r,depth:i+1,iconVariant:a,newLabel:o,togglePagesLabel:s,capBadges:l},e.key??e.href))})});if(e.href){let i=/* @__PURE__ */ j(c,{link:t(n,{to:e.href}),className:`wui-nav-split-link`,"aria-current":w,onClick:r,children:C});return/* @__PURE__ */ M(A,{children:[/* @__PURE__ */ M(`div`,{className:`app-nav-item has-children wui-nav-split${u?` app-nav-subitem`:``}${m||e.active?` active`:``}${d}`,"data-label":y,children:[i,/* @__PURE__ */ j(`button`,{type:`button`,className:`app-nav-caret wui-nav-split-toggle`,"aria-expanded":_,"aria-label":N(s,{name:y??``}),onClick:()=>v(e=>!e),children:/* @__PURE__ */ j(h,{name:`chevron-right`,size:16})})]}),f]})}return/* @__PURE__ */ M(A,{children:[/* @__PURE__ */ M(`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__ */ j(`span`,{className:`app-nav-text`,children:e.label}),S,x,/* @__PURE__ */ j(`span`,{className:`app-nav-caret`,children:/* @__PURE__ */ j(h,{name:`chevron-right`,size:16})})]}),f]})}let T=`app-nav-item${u?` app-nav-subitem`:``}${e.active?` active`:``}${d}`;return/* @__PURE__ */ j(c,{link:t(n,{to:e.href}),className:T,"aria-current":w,"data-label":y,onClick:r,children:C})}function Y(e){l(`wui-dropdown`,P);let[t,n]=k(!1),r=O(null);return E(()=>{r.current?.toggleAttribute(`open`,t)},[t]),E(()=>{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 xe({config:e,linkComponent:n,accountMenuLabel:r,roleLabel:i,rolesLabel:a}){let o=u(`shell`,te),s=ee(),{open:l,setOpen:d,ref:f}=Y(),{name:g,role:v,roles:y=[],noTriggerRole:b=!1,outlined:x=!1,photo:S,profileHref:C,profileLabel:w=o.profileLabel,onLogout:T,logoutAction:E,logoutLabel:D=o.logoutLabel,head:O,section:k,logoutVariant:ne=`item`,items:P=[]}=e;if(_(`AppShell`,`userMenu.logoutVariant`,ne,[`item`,`button`]),!g)throw Error(`<AppShell> userMenu.name is required; the trigger and the avatar are named from it.`);let F=y.map(e=>(e??``).trim()).filter(Boolean),I=()=>d(!1),L=(e,r,i,a)=>/* @__PURE__ */ j(c,{link:t(n,{to:e}),className:`dropdown-item`,onClick:a,children:r},i),R=/* @__PURE__ */ j(h,{name:`log-out`,size:18}),z=/* @__PURE__ */ M(A,{children:[R,D]});return/* @__PURE__ */ M(`wui-dropdown`,{class:`dropdown wui-usermenu`,align:`end`,ref:f,children:[/* @__PURE__ */ M(`button`,{type:`button`,id:s,className:x?`wui-usermenu-trigger wui-usermenu-trigger-outlined`:`wui-usermenu-trigger`,"data-wui-dropdown-trigger":!0,"aria-expanded":l,"aria-label":N(r,{name:g}),children:[/* @__PURE__ */ j(p,{name:g,src:S,tone:`auto`}),/* @__PURE__ */ M(`span`,{className:`wui-usermenu-text`,children:[/* @__PURE__ */ j(`span`,{className:`wui-usermenu-name`,children:g}),v&&!b&&/* @__PURE__ */ j(`span`,{className:`wui-usermenu-role`,children:v})]}),/* @__PURE__ */ j(h,{name:`chevron-down`,size:14,className:`wui-usermenu-caret`})]}),/* @__PURE__ */ M(`div`,{"data-wui-dropdown-menu":!0,popover:`auto`,className:`dropdown-menu dropdown-menu-end wui-usermenu-menu${l?` show`:``}`,"aria-labelledby":s,children:[/* @__PURE__ */ M(`div`,{className:`wui-usermenu-head`,children:[/* @__PURE__ */ j(p,{name:g,src:S,size:`lg`,tone:`auto`}),/* @__PURE__ */ M(`div`,{className:`wui-usermenu-who`,children:[/* @__PURE__ */ j(`div`,{className:`wui-usermenu-name`,children:g}),v&&/* @__PURE__ */ j(`div`,{className:`wui-usermenu-role`,children:v}),F.length>0&&/* @__PURE__ */ M(`div`,{className:`wui-usermenu-roles`,children:[/* @__PURE__ */ j(`span`,{className:`wui-usermenu-roles-label`,children:F.length===1?i:a}),` ${F.join(`, `)}`]}),O?/* @__PURE__ */ j(`div`,{className:`wui-usermenu-extra`,children:O}):null]})]}),k?/* @__PURE__ */ j(`div`,{className:`wui-usermenu-section`,children:k}):null,C&&L(C,/* @__PURE__ */ M(A,{children:[/* @__PURE__ */ j(h,{name:`user`,size:18}),w]}),void 0,I),P.map(e=>{if(e.divider)return/* @__PURE__ */ j(`hr`,{className:`dropdown-divider`},e.key);let t=/* @__PURE__ */ M(A,{children:[e.icon&&/* @__PURE__ */ j(h,{name:e.icon,size:18}),e.label]}),n=()=>{e.onClick?.(),I()};return e.href?L(e.href,t,e.key,n):/* @__PURE__ */ j(`button`,{type:`button`,className:`dropdown-item`,onClick:n,children:t},e.key)}),ne===`button`?(E||T)&&/* @__PURE__ */ j(`div`,{className:`wui-usermenu-foot`,children:E?/* @__PURE__ */ j(`form`,{method:`post`,action:E,className:`wui-usermenu-logout`,children:/* @__PURE__ */ M(m,{type:`submit`,tone:`danger`,variant:`soft`,block:!0,children:[/* @__PURE__ */ j(`span`,{className:`d-inline-flex me-2`,children:R}),D]})}):/* @__PURE__ */ M(m,{type:`button`,tone:`danger`,variant:`soft`,block:!0,onClick:()=>{I(),T?.()},children:[/* @__PURE__ */ j(`span`,{className:`d-inline-flex me-2`,children:R}),D]})}):E?/* @__PURE__ */ j(`form`,{method:`post`,action:E,className:`wui-usermenu-logout`,children:/* @__PURE__ */ j(`button`,{type:`submit`,className:`dropdown-item danger`,children:z})}):T&&/* @__PURE__ */ j(`button`,{type:`button`,className:`dropdown-item danger`,onClick:()=>{I(),T()},children:z})]})]})}function Se({config:e,unreadLabel:t,markAllReadLabel:n,viewAllLabel:r,loadingNotificationsText:i,noUnreadText:a,unreadNotificationsText:o,unreadBellLabel:s}){let c=u(`shell`,te),l=ee(),{open:d,ref:f}=Y(e.onOpen),{unread:p=0,items:m,loading:g=!1,onMarkAllRead:_,viewAllHref:v,label:y=c.label,emptyText:b=c.emptyText}=e,[x,S]=k(``),C=O(p);E(()=>{C.current!==p&&(C.current=p,S(p===0?a:N(o,{count:G(p)})))},[p,a,o]);let w=null;return m?.length?w=/* @__PURE__ */ j(`div`,{className:`wui-bell-items`,children:m.map((e,n)=>{let r=`wui-bell-item${e.read?` wui-bell-item-read`:``}`,i=/* @__PURE__ */ M(A,{children:[/* @__PURE__ */ j(`span`,{className:`wui-bell-dot`,"aria-hidden":`true`}),e.icon&&/* @__PURE__ */ j(`span`,{className:`wui-bell-icon`,children:/* @__PURE__ */ j(h,{name:e.icon,size:18})}),/* @__PURE__ */ M(`span`,{className:`wui-bell-body`,children:[!e.read&&/* @__PURE__ */ M(`span`,{className:`visually-hidden`,children:[t,`: `]}),/* @__PURE__ */ j(`span`,{className:`wui-bell-item-title`,children:e.title}),e.time&&/* @__PURE__ */ j(`span`,{className:`wui-bell-when`,children:e.time})]})]});return e.href?/* @__PURE__ */ j(`a`,{className:r,href:e.href,"data-id":e.id,children:i},e.id??n):/* @__PURE__ */ j(`div`,{className:r,"data-id":e.id,children:i},e.id??n)})}):g?w=/* @__PURE__ */ j(`div`,{className:`wui-bell-state`,children:i}):m&&(w=/* @__PURE__ */ j(`div`,{className:`wui-bell-state`,children:b})),/* @__PURE__ */ M(`wui-dropdown`,{class:`dropdown wui-bell`,align:`end`,ref:f,children:[/* @__PURE__ */ M(`button`,{type:`button`,id:l,className:`topbar-icon-btn wui-bell-trigger`,"data-wui-dropdown-trigger":!0,"aria-expanded":d,"aria-label":p===0?y:N(s,{label:y,count:G(p)}),children:[/* @__PURE__ */ j(h,{name:`notification`,size:20}),/* @__PURE__ */ j(`span`,{className:`wui-bell-count`,"aria-hidden":`true`,hidden:p===0,children:G(p)})]}),/* @__PURE__ */ j(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:x}),/* @__PURE__ */ M(`div`,{"data-wui-dropdown-menu":!0,popover:`auto`,className:`dropdown-menu dropdown-menu-end wui-bell-menu${d?` show`:``}`,"aria-labelledby":l,children:[/* @__PURE__ */ M(`div`,{className:`wui-bell-head`,children:[/* @__PURE__ */ j(`span`,{className:`wui-bell-title`,children:y}),_&&/* @__PURE__ */ j(`button`,{type:`button`,className:`wui-bell-markall`,onClick:_,children:n})]}),/* @__PURE__ */ j(`div`,{className:`wui-bell-list`,"aria-busy":g||void 0,children:w}),v&&/* @__PURE__ */ j(`a`,{className:`wui-bell-foot`,href:v,children:r})]})]})}var Ce=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function we({config:e,searchResultsLabel:t,noResultsText:n,noResultsForText:r,resultsCountText:i,resultCountText:a,moreLabel:o}){l(`wui-overflow`,ne);let s=u(`shell`,te),c=ee(),{value:d=``,onChange:f,results:p=null,loading:m=!1,onSelect:g,onSubmit:_,onFocus:v,placeholder:y=s.placeholder,shortcutKey:b}=e;if(b!==void 0&&!/^[a-z]$/.test(b))throw Error(`<AppShell>: search shortcutKey must be one letter, a to z; got "${b}".`);let w=b?.toUpperCase(),T=w===void 0?``:` (${x()?`⌘${w}`:`Ctrl+${w}`})`;E(()=>{if(b===void 0)return;let e=e=>{S(e,b)&&(e.preventDefault(),P(!0),V.current?.focus(),V.current?.select())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[b]);let[A,P]=k(!1),[F,I]=k(!1),[L,R]=k({results:null,index:-1}),z=L.results===p?L.index:-1,re=e=>R({results:p,index:e}),B=O(null),V=O(null),H=O([]),ie=D(()=>(p??[]).flatMap(e=>e.hits??[]),[p]),U=p!=null&&!F,W=ie.length;E(()=>{let e=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||Ce(e.target instanceof HTMLElement?e.target:null)||(e.preventDefault(),P(!0),V.current?.focus())},t=e=>{B.current?.contains(e.target instanceof Node?e.target:null)||(I(!0),P(!1))};return document.addEventListener(`keydown`,e),document.addEventListener(`pointerdown`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`pointerdown`,t)}},[]);let ae=e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(!U||W===0)return;e.preventDefault(),re((z+(e.key===`ArrowDown`?1:-1)+W)%W)}else C(e.nativeEvent)?U&&z>=0&&H.current[z]?(e.preventDefault(),H.current[z].click()):_&&d.trim()!==``&&(e.preventDefault(),_(d.trim())):e.key===`Escape`&&(U?(e.preventDefault(),I(!0)):A&&(e.preventDefault(),P(!1)))},G=-1;return H.current=[],/* @__PURE__ */ j(`wui-overflow`,{class:`wui-topsearch-host`,label:o,children:/* @__PURE__ */ j(`div`,{"data-wui-overflow-list":!0,className:`wui-topsearch-row`,children:/* @__PURE__ */ M(`div`,{className:`wui-topsearch${A?` is-open`:``}${m?` is-loading`:``}`,ref:B,"data-overflow-label":y,children:[/* @__PURE__ */ j(`button`,{type:`button`,className:`topbar-icon-btn wui-topsearch-open`,"aria-label":y,"aria-expanded":A,"aria-controls":`${c}-panel`,onClick:()=>{let e=!A;P(e),e&&V.current?.focus()},children:/* @__PURE__ */ j(h,{name:`search`,size:20})}),/* @__PURE__ */ M(`div`,{className:`wui-topsearch-panel`,id:`${c}-panel`,children:[/* @__PURE__ */ M(`div`,{className:`search-wrap`,children:[/* @__PURE__ */ j(h,{name:`search`,size:18,className:`search-icon`}),/* @__PURE__ */ j(`input`,{ref:V,type:`search`,className:`form-control input search-input`,id:`${c}-input`,placeholder:y+T,"aria-label":y,"aria-keyshortcuts":w===void 0?void 0:`Control+${w} Meta+${w}`,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":U,"aria-controls":`${c}-list`,"aria-activedescendant":U&&z>=0?`${c}-opt-${z}`:void 0,autoComplete:`off`,value:d,onChange:e=>{I(!1),f?.(e.target.value)},onKeyDown:ae,onFocus:v})]}),/* @__PURE__ */ j(`div`,{className:`wui-topsearch-results`,id:`${c}-list`,role:`listbox`,"aria-label":t,hidden:!U,children:U&&/* @__PURE__ */ M(`div`,{className:`wui-topsearch-groups`,role:`presentation`,children:[W===0&&/* @__PURE__ */ j(`div`,{className:`wui-topsearch-empty`,role:`option`,"aria-disabled":`true`,"aria-selected":`false`,children:N(r,{value:d})}),p.filter(e=>e.hits?.length).map((e,t)=>/* @__PURE__ */ M(`div`,{className:`wui-topsearch-group`,role:`group`,"aria-label":e.label??``,children:[e.label&&/* @__PURE__ */ j(`div`,{className:`wui-topsearch-group-label`,role:`presentation`,children:e.label}),e.hits.map(e=>{G+=1;let t=G;return/* @__PURE__ */ M(`a`,{className:`wui-topsearch-hit${t===z?` is-active`:``}`,role:`option`,"aria-selected":t===z,id:`${c}-opt-${t}`,href:e.href,ref:e=>{H.current[t]=e},onClick:t=>g?.(e,t),children:[e.icon&&/* @__PURE__ */ j(`span`,{className:`wui-topsearch-hit-icon`,children:/* @__PURE__ */ j(h,{name:e.icon,size:18})}),/* @__PURE__ */ M(`span`,{className:`wui-topsearch-hit-text`,children:[/* @__PURE__ */ j(`span`,{className:`wui-topsearch-hit-title`,children:e.title}),e.subtitle&&/* @__PURE__ */ j(`span`,{className:`wui-topsearch-hit-sub`,children:e.subtitle})]})]},`${e.href}-${t}`)})]},e.label??t))]})})]}),/* @__PURE__ */ j(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:U?W===0?n:N(W===1?a:i,{count:W}):``})]})})})}export{ue 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/useWuiText.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppRecordPager.js";import a from"./AppShortcutLegend.js";import o from"./assertValidValue.js";import s from"./warnUnknownProps.js";import{listKeys as c,selectKey as l,shortcutKey as ee}from"@webority/ui-elements/helpers";import{useEffect as te,useMemo as u,useRef as d}from"react";import{Fragment as ne,jsx as f,jsxs as p}from"react/jsx-runtime";import{KBD_TEXT as m,SPLIT_VIEW_TEXT as re,fillText as h}from"@webority/ui-elements/text";var g={sm:576,md:768,lg:992,xl:1200,xxl:1400},ie=Object.keys(g),_=[3,4,5,6,7,8],ae=Array.from({length:6},(e,t)=>`skeleton-placeholder-${t}`),v=`.wui-split-items > .wui-split-item > .wui-split-link`,y=(e,t)=>e!=null&&String(e)===String(t),oe=e=>{let t=window.matchMedia?.(`(min-width: ${g[e]}px)`);return!t||t.matches},se=(e,t)=>typeof e==`string`||typeof e==`number`?String(e):t;function b(b){let{marker:ce,props:le}=r(`AppSplitView`,b),x=n(`splitView`,re),S=n(`kbd`,m),{items:C=[],currentKey:w,onSelect:T,selectable:E=!1,selectedKeys:D,onToggle:ue,onToggleAll:de,bulkActions:fe,header:O,chips:k,pane:pe,paneHeader:A,pager:me=!0,shortcuts:j,shortcutsEnabled:M=!0,empty:N=x.empty,loading:P=!1,listWidth:F=5,stackBelow:I=`xl`,linkComponent:L,loadingLabel:R=x.loadingLabel,itemsLabel:z=x.itemsLabel,selectItemLabel:he=x.selectItemLabel,selectAllLabel:B=x.selectAllLabel,readingPaneLabel:ge=x.readingPaneLabel,previousItemLabel:_e=x.previousItemLabel,nextItemLabel:ve=x.nextItemLabel,openLabel:ye=x.openLabel,moveLabel:be=x.moveLabel,selectedLabel:xe=x.selectedLabel,untitledItemLabel:Se=x.untitledItemLabel,className:Ce=``,...V}=le,H=u(()=>new Set(D),[D]);s(`AppSplitView`,V),o(`AppSplitView`,`stackBelow`,I,ie),o(`AppSplitView`,`listWidth`,F,_);let U=g[I]?I:`xl`,we=_.includes(F)?F:5,W=d(null),Te=w!=null,G=E?H?.size??0:0,K=G>0,q=E&&C.length>0&&C.every(e=>H?.has(e.key)),Ee=E&&!q&&C.some(e=>H?.has(e.key)),De=e=>{e&&(e.indeterminate=Ee)},J=d(w);te(()=>{J.current!==w&&(J.current=w,w!=null&&W.current?.querySelector(`.wui-split-link[aria-current="true"]`)?.scrollIntoView?.({block:`nearest`}))},[w]);let Y=(e,t)=>{t.button>0||t.ctrlKey||t.metaKey||t.shiftKey||t.altKey||T&&(!e.href||oe(U))&&(t.preventDefault(),T(e.key))},X=e=>{let t=[...W.current?.querySelectorAll(v)??[]];t[t.findIndex(e=>e.getAttribute(`aria-current`)===`true`)+e]?.click()},Oe=[`wui-split-view`,Te?`wui-split-reading`:``,Ce].filter(Boolean).join(` `),ke=E?[...c(),l()]:c(),Ae=/* @__PURE__ */ new Set([`J`,`K`,`Enter`,`?`,...E?[`X`]:[]]),je=[...ke,...(j??[]).filter(e=>!Ae.has(ee(e.key))).map(e=>({key:e.key,label:e.label,onPress:()=>e.onPress?.(w)}))],Z=C.findIndex(e=>y(w,e.key)),Q=me&&!P&&C.length>0?/* @__PURE__ */ f(i,{"data-split-pager":``,index:Z>=0?Z+1:void 0,total:C.length,onPrev:()=>X(-1),onNext:()=>X(1),prevLabel:_e,nextLabel:ve}):null,Me=n=>{let r=y(w,n.key),i=E&&!!H?.has(n.key),a=n.badge!==void 0&&n.badge!==null&&n.badge!==``,o=e(L,{href:n.href}),s=/* @__PURE__ */ p(ne,{children:[/* @__PURE__ */ p(`span`,{className:`wui-split-item-main`,children:[/* @__PURE__ */ f(`span`,{className:`wui-split-item-title`,children:n.title}),n.meta!==void 0&&n.meta!==null&&/* @__PURE__ */ f(`span`,{className:`wui-split-item-meta`,children:n.meta})]}),(n.trailing||a)&&/* @__PURE__ */ p(`span`,{className:`wui-split-item-end`,children:[n.trailing,a&&/* @__PURE__ */ f(`span`,{className:`wui-split-badge`,children:n.badge})]})]});return/* @__PURE__ */ p(`li`,{className:[`wui-split-item`,r?`is-active`:``,i?`is-selected`:``].filter(Boolean).join(` `),"data-key":n.key,children:[E&&/* @__PURE__ */ f(`input`,{type:`checkbox`,className:`
|
|
1
|
+
import{linkTarget as e}from"../lib/linkTarget.js";import{TargetLink as t}from"../lib/TargetLink.js";import n from"../lib/useWuiText.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppRecordPager.js";import a from"./AppShortcutLegend.js";import o from"./assertValidValue.js";import s from"./warnUnknownProps.js";import{listKeys as c,selectKey as l,shortcutKey as ee}from"@webority/ui-elements/helpers";import{useEffect as te,useMemo as u,useRef as d}from"react";import{Fragment as ne,jsx as f,jsxs as p}from"react/jsx-runtime";import{KBD_TEXT as m,SPLIT_VIEW_TEXT as re,fillText as h}from"@webority/ui-elements/text";var g={sm:576,md:768,lg:992,xl:1200,xxl:1400},ie=Object.keys(g),_=[3,4,5,6,7,8],ae=Array.from({length:6},(e,t)=>`skeleton-placeholder-${t}`),v=`.wui-split-items > .wui-split-item > .wui-split-link`,y=(e,t)=>e!=null&&String(e)===String(t),oe=e=>{let t=window.matchMedia?.(`(min-width: ${g[e]}px)`);return!t||t.matches},se=(e,t)=>typeof e==`string`||typeof e==`number`?String(e):t;function b(b){let{marker:ce,props:le}=r(`AppSplitView`,b),x=n(`splitView`,re),S=n(`kbd`,m),{items:C=[],currentKey:w,onSelect:T,selectable:E=!1,selectedKeys:D,onToggle:ue,onToggleAll:de,bulkActions:fe,header:O,chips:k,pane:pe,paneHeader:A,pager:me=!0,shortcuts:j,shortcutsEnabled:M=!0,empty:N=x.empty,loading:P=!1,listWidth:F=5,stackBelow:I=`xl`,linkComponent:L,loadingLabel:R=x.loadingLabel,itemsLabel:z=x.itemsLabel,selectItemLabel:he=x.selectItemLabel,selectAllLabel:B=x.selectAllLabel,readingPaneLabel:ge=x.readingPaneLabel,previousItemLabel:_e=x.previousItemLabel,nextItemLabel:ve=x.nextItemLabel,openLabel:ye=x.openLabel,moveLabel:be=x.moveLabel,selectedLabel:xe=x.selectedLabel,untitledItemLabel:Se=x.untitledItemLabel,className:Ce=``,...V}=le,H=u(()=>new Set(D),[D]);s(`AppSplitView`,V),o(`AppSplitView`,`stackBelow`,I,ie),o(`AppSplitView`,`listWidth`,F,_);let U=g[I]?I:`xl`,we=_.includes(F)?F:5,W=d(null),Te=w!=null,G=E?H?.size??0:0,K=G>0,q=E&&C.length>0&&C.every(e=>H?.has(e.key)),Ee=E&&!q&&C.some(e=>H?.has(e.key)),De=e=>{e&&(e.indeterminate=Ee)},J=d(w);te(()=>{J.current!==w&&(J.current=w,w!=null&&W.current?.querySelector(`.wui-split-link[aria-current="true"]`)?.scrollIntoView?.({block:`nearest`}))},[w]);let Y=(e,t)=>{t.button>0||t.ctrlKey||t.metaKey||t.shiftKey||t.altKey||T&&(!e.href||oe(U))&&(t.preventDefault(),T(e.key))},X=e=>{let t=[...W.current?.querySelectorAll(v)??[]];t[t.findIndex(e=>e.getAttribute(`aria-current`)===`true`)+e]?.click()},Oe=[`wui-split-view`,Te?`wui-split-reading`:``,Ce].filter(Boolean).join(` `),ke=E?[...c(),l()]:c(),Ae=/* @__PURE__ */ new Set([`J`,`K`,`Enter`,`?`,...E?[`X`]:[]]),je=[...ke,...(j??[]).filter(e=>!Ae.has(ee(e.key))).map(e=>({key:e.key,label:e.label,onPress:()=>e.onPress?.(w)}))],Z=C.findIndex(e=>y(w,e.key)),Q=me&&!P&&C.length>0?/* @__PURE__ */ f(i,{"data-split-pager":``,index:Z>=0?Z+1:void 0,total:C.length,onPrev:()=>X(-1),onNext:()=>X(1),prevLabel:_e,nextLabel:ve}):null,Me=n=>{let r=y(w,n.key),i=E&&!!H?.has(n.key),a=n.badge!==void 0&&n.badge!==null&&n.badge!==``,o=e(L,{href:n.href}),s=/* @__PURE__ */ p(ne,{children:[/* @__PURE__ */ p(`span`,{className:`wui-split-item-main`,children:[/* @__PURE__ */ f(`span`,{className:`wui-split-item-title`,children:n.title}),n.meta!==void 0&&n.meta!==null&&/* @__PURE__ */ f(`span`,{className:`wui-split-item-meta`,children:n.meta})]}),(n.trailing||a)&&/* @__PURE__ */ p(`span`,{className:`wui-split-item-end`,children:[n.trailing,a&&/* @__PURE__ */ f(`span`,{className:`wui-split-badge`,children:n.badge})]})]});return/* @__PURE__ */ p(`li`,{className:[`wui-split-item`,r?`is-active`:``,i?`is-selected`:``].filter(Boolean).join(` `),"data-key":n.key,children:[E&&/* @__PURE__ */ f(`input`,{type:`checkbox`,className:`form-check-input wui-split-check`,checked:i,onChange:()=>ue?.(n.key),"aria-label":h(he,{title:se(n.title,Se)})}),n.href?/* @__PURE__ */ f(t,{link:o,className:`wui-split-link`,"aria-current":r?`true`:void 0,onClick:e=>Y(n,e),children:s}):/* @__PURE__ */ f(`button`,{type:`button`,className:`wui-split-link`,"aria-current":r?`true`:void 0,onClick:e=>Y(n,e),children:s})]},n.key)},$;return $=P?/* @__PURE__ */ p(`div`,{className:`wui-split-items`,"aria-busy":`true`,tabIndex:0,children:[/* @__PURE__ */ f(`span`,{className:`visually-hidden`,children:R}),ae.map(e=>/* @__PURE__ */ p(`div`,{className:`wui-split-skeleton`,"aria-hidden":`true`,children:[/* @__PURE__ */ f(`span`,{className:`skeleton wui-split-skeleton-title`}),/* @__PURE__ */ f(`span`,{className:`skeleton wui-split-skeleton-meta`})]},e))]}):C.length?/* @__PURE__ */ f(`ul`,{className:`wui-split-items`,"aria-label":z,children:C.map(Me)}):/* @__PURE__ */ f(`div`,{className:`wui-split-empty`,children:N}),/* @__PURE__ */ p(`div`,{ref:W,className:Oe,"data-stack-below":U,"data-list-width":we,"data-shortcut-scope":M?``:void 0,...ce,...V,children:[/* @__PURE__ */ p(`div`,{className:`wui-split-list`,children:[(O||E)&&/* @__PURE__ */ p(`div`,{className:`wui-split-head`,children:[E&&/* @__PURE__ */ f(`input`,{ref:De,type:`checkbox`,className:`form-check-input wui-split-all`,checked:q,onChange:e=>de?.(e.target.checked),"aria-label":B}),/* @__PURE__ */ f(`div`,{className:`wui-split-head-main`,hidden:K,children:O}),E&&/* @__PURE__ */ p(`div`,{className:`wui-split-head-bulk`,hidden:!K,children:[/* @__PURE__ */ f(`span`,{className:`wui-split-count`,"aria-live":`polite`,children:h(xe,{count:G})}),fe]})]}),k&&/* @__PURE__ */ f(`div`,{className:`wui-split-chips`,children:k}),$,M&&/* @__PURE__ */ p(`div`,{className:`wui-split-legend`,children:[/* @__PURE__ */ p(`span`,{children:[/* @__PURE__ */ f(`kbd`,{className:`wui-kbd`,children:`J`}),` `,/* @__PURE__ */ f(`kbd`,{className:`wui-kbd`,children:`K`}),` ${be}`]}),/* @__PURE__ */ p(`span`,{children:[/* @__PURE__ */ f(`kbd`,{className:`wui-kbd`,children:S.enterLabel}),` ${ye}`]}),/* @__PURE__ */ f(a,{items:v,shortcuts:je})]})]}),/* @__PURE__ */ p(`div`,{className:`wui-split-pane`,children:[(A||Q)&&/* @__PURE__ */ p(`div`,{className:`wui-split-pane-head`,children:[A,Q]}),/* @__PURE__ */ f(`section`,{className:`wui-split-pane-body`,"aria-label":ge,tabIndex:0,children:pe})]})]})}export{b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{pageWindow as e}from"../lib/pageWindow.js";import t from"../lib/useWuiText.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppIcon.js";import i from"./AppSelect.js";import a from"./assertValidValue.js";import o from"./warnUnknownProps.js";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{TABLE_PAGINATION_TEXT as l,fillText as u}from"@webority/ui-elements/text";var d=[`numbered`,`prev-next`],f=[`sm`,`md`],p=[`footer`,`standalone`],m=[5,10,25,50];function h(e,t,n,r){let i=Math.min((t-1)*n+1,r),a=Math.min(t*n,r);return u(e,{first:i,last:a,total:r})}function g(g){let{marker:_,props:v}=n(`AppTablePagination`,g),y=t(`tablePagination`,l),{page:b,totalPages:x,total:S,hasNext:C,pageSize:w,onPageChange:T,onPageSizeChange:E,pageSizes:D=m,mode:O=`numbered`,showPageSize:k=!0,siblings:A=2,summary:j=!1,size:M=`md`,variant:N=`footer`,ariaLabel:P=y.ariaLabel,rowsPerPageLabel:F=y.rowsPerPageLabel,pageSizeLabel:I=y.pageSizeLabel,previousLabel:L=y.previousLabel,nextLabel:R=y.nextLabel,pageLabel:z=y.pageLabel,rangeText:B=y.rangeText,className:
|
|
1
|
+
import{pageWindow as e}from"../lib/pageWindow.js";import t from"../lib/useWuiText.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppIcon.js";import i from"./AppSelect.js";import a from"./assertValidValue.js";import o from"./warnUnknownProps.js";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{TABLE_PAGINATION_TEXT as l,fillText as u}from"@webority/ui-elements/text";var d=[`numbered`,`prev-next`],f=[`sm`,`md`],p=[`footer`,`standalone`],m=[5,10,25,50];function h(e,t,n,r){let i=Math.min((t-1)*n+1,r),a=Math.min(t*n,r);return u(e,{first:i,last:a,total:r})}function g(g){let{marker:_,props:v}=n(`AppTablePagination`,g),y=t(`tablePagination`,l),{page:b,totalPages:x,total:S,hasNext:C,pageSize:w,onPageChange:T,onPageSizeChange:E,pageSizes:D=m,mode:O=`numbered`,showPageSize:k=!0,siblings:A=2,summary:j=!1,size:M=`md`,variant:N=`footer`,ariaLabel:P=y.ariaLabel,rowsPerPageLabel:F=y.rowsPerPageLabel,pageSizeLabel:I=y.pageSizeLabel,previousLabel:L=y.previousLabel,nextLabel:R=y.nextLabel,pageLabel:z=y.pageLabel,rangeText:B=y.rangeText,summaryText:V=y.summaryText,className:H=``,...U}=v;o(`AppTablePagination`,U),a(`AppTablePagination`,`mode`,O,d),a(`AppTablePagination`,`size`,M,f),a(`AppTablePagination`,`variant`,N,p);let W=Number(w)||0,G=Number(S)||0;if(C!==void 0&&(x!==void 0||G>0))throw Error(`AppTablePagination hasNext is for an unknown total: leave total and totalPages unset.`);let K=C!==void 0,q=!K&&(x===void 0?G<=0:x<=0),J=Math.max(1,x??Math.ceil(G/(W>0?W:10))),Y=K?Math.max(1,Number(b)||1):Math.min(Math.max(1,Number(b)||1),J),X=W>0&&!!E&&k!==!1,Z=j===!0&&G>0&&W>0;if(q||!K&&J<=1&&!X)return null;let Q=W>0&&!D.includes(W)?[...D,W].sort((e,t)=>e-t):D,$=!K&&O===`numbered`,ee=$?e(Y,J,{siblingCount:A}):null,te=[`table-pagination`,N===`standalone`&&`wui-table-pagination-standalone`,M===`sm`&&`wui-table-pagination-sm`,H].filter(Boolean).join(` `);return/* @__PURE__ */ c(`nav`,{className:te,"aria-label":P,..._,...U,children:[Z&&/* @__PURE__ */ s(`span`,{className:`wui-pager-summary`,children:h(V,Y,W,G)}),X&&/* @__PURE__ */ s(`span`,{className:`tpg-rows`,children:/* @__PURE__ */ s(i,{density:`compact`,size:`sm`,"aria-label":F,value:String(W),onChange:e=>E?.(Number(e)),options:Q.map(e=>({value:String(e),label:u(I,{count:e})}))})}),!$&&!K&&/* @__PURE__ */ s(`span`,{className:`tpg-range`,children:u(B,{page:Y,pages:J})}),/* @__PURE__ */ c(`div`,{className:`tpg-nav`,children:[/* @__PURE__ */ s(`button`,{type:`button`,className:`tpg-arrow`,onClick:()=>T?.(Math.max(1,Y-1)),disabled:Y<=1,"aria-label":L,children:/* @__PURE__ */ s(r,{name:`arrow-left`,size:18})}),ee?.map(e=>typeof e==`number`?/* @__PURE__ */ s(`button`,{type:`button`,className:`tpg-page${e===Y?` is-active`:``}`,onClick:()=>T?.(e),"aria-current":e===Y?`page`:void 0,"aria-label":u(z,{page:e}),children:e},e):/* @__PURE__ */ s(`span`,{className:`tpg-ellipsis`,"aria-hidden":`true`,children:`…`},e)),/* @__PURE__ */ s(`button`,{type:`button`,className:`tpg-arrow`,onClick:()=>T?.(K?Y+1:Math.min(J,Y+1)),disabled:K?!C:Y>=J,"aria-label":R,children:/* @__PURE__ */ s(r,{name:`arrow-right`,size:18})})]})]})}export{g 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 r from"../lib/useWuiText.js";import{TONES as i}from"../lib/vocabulary.js";import{splitMarkerProps as a}from"../lib/wuiMarker.js";import o from"./AppIcon.js";import s from"./AppTooltip.js";import c from"./assertValidValue.js";import l from"./renderIconProp.js";import u from"./warnUnknownProps.js";import{formatNumber as ee}from"@webority/ui-elements/helpers";import{cloneElement as te,useCallback as d,useEffect as f,useLayoutEffect as p,useRef as m,useState as ne}from"react";import{Fragment as re,jsx as h,jsxs as g}from"react/jsx-runtime";import{TABS_TEXT as ie}from"@webority/ui-elements/text";var _=[`underline`,`pills`],v=[`horizontal`,`vertical`],y=[`sm`,`md`,`lg`],ae={sm:16,md:18,lg:20},oe=[`automatic`,`manual`],se=[`scroll`,`menu`],ce=i.filter(e=>e!==`primary`&&e!==`neutral`),le=()=>import(`@webority/ui-elements/elements/overflow`),b=1,ue=28,de=.7;function x(i){let{marker:x,props:fe}=a(`AppTabs`,i),S=r(`tabs`,ie),{tabs:C,value:w,onChange:T,linkComponent:E,variant:D=`underline`,orientation:O=`horizontal`,size:k=`md`,fitted:pe=!1,overflow:A=`scroll`,moreLabel:me=S.moreLabel,maxVisible:he,activation:j=`automatic`,ariaLabel:M,className:N=``,style:P,...F}=fe;n(`wui-overflow`,le),u(`AppTabs`,F),c(`AppTabs`,`variant`,D,_),c(`AppTabs`,`orientation`,O,v),c(`AppTabs`,`size`,k,y),c(`AppTabs`,`activation`,j,oe),c(`AppTabs`,`overflow`,A,se);for(let e of C)c(`AppTabs`,`tabs[].tone`,e.tone,ce);let I=m(null),L=m(null),R=O===`vertical`,z=(A===`menu`||he!=null)&&!R,B=ae[k],[V,H]=ne(w);f(()=>{H(w)},[w]);let ge=C.find(e=>!e.disabled)?.key,_e=C.some(e=>e.key===V&&!e.disabled)?V:void 0,ve=C.some(e=>e.key===w&&!e.disabled)?w:void 0,ye=_e??ve??ge,be=e=>{I.current?.querySelector(`[data-key="${CSS.escape(String(e))}"]`)?.focus()},U=d(()=>{let e=I.current,t=L.current;if(!e||!t||R||z)return;let n=e.scrollWidth-e.clientWidth;t.classList.toggle(`is-overflow-start`,e.scrollLeft>b),t.classList.toggle(`is-overflow-end`,n>b&&e.scrollLeft<n-b)},[R,z]),W=d(()=>{let e=I.current;if(!e)return;let t=e.querySelector(`.app-tab.active`);t?(R?(e.style.setProperty(`--wui-tab-y`,`${t.offsetTop}px`),e.style.setProperty(`--wui-tab-h`,`${t.offsetHeight}px`)):(e.style.setProperty(`--wui-tab-x`,`${t.offsetLeft}px`),e.style.setProperty(`--wui-tab-w`,`${t.offsetWidth}px`)),e.toggleAttribute(`data-active-danger`,!!C.find(e=>e.key===w)?.danger)):e.style.setProperty(R?`--wui-tab-h`:`--wui-tab-w`,`0px`),e.setAttribute(`data-wui-tabs`,``),U()},[R,C,w,U]),G=e=>!z||!I.current?.querySelector(`[data-key="${CSS.escape(String(e))}"][data-wui-overflow-hidden]`),K=d(e=>{let t=I.current;if(!t||R)return;let n=t.querySelector(`.app-tab[data-key="${CSS.escape(e)}"]`);if(!n)return;let r=ue,i=n.offsetLeft,a=i+n.offsetWidth;i-r<t.scrollLeft?t.scrollLeft=Math.max(0,i-r):a+r>t.scrollLeft+t.clientWidth&&(t.scrollLeft=a+r-t.clientWidth)},[R]);p(()=>{W()},[W]),p(()=>{K(w)},[w,K]);let q=m(W);f(()=>{q.current=W},[W]),f(()=>{if(!document.fonts)return;let e=!0;return document.fonts.ready.then(()=>{e&&q.current()}),()=>{e=!1}},[]);let J=m(null),Y=d(e=>{if(typeof ResizeObserver>`u`)return;let t=J.current??{ro:new ResizeObserver(()=>q.current()),count:0};return J.current=t,t.ro.observe(e),t.count+=1,()=>{t.ro.unobserve(e),--t.count,t.count===0&&(t.ro.disconnect(),J.current===t&&(J.current=null))}},[]),X=d(e=>{I.current=e;let t=e?Y(e):void 0;return()=>{I.current=null,t?.()}},[Y]),Z=d(e=>{L.current=e;let t=e?Y(e):void 0;return()=>{L.current=null,t?.()}},[Y]);f(()=>{let e=L.current;if(!z||!e)return;let t=()=>q.current();return e.addEventListener(`wui-overflow-change`,t),()=>e.removeEventListener(`wui-overflow-change`,t)},[z]);function xe(e){let t=e.target instanceof HTMLElement?e.target.dataset.key:void 0;if(t==null)return;let n=C.findIndex(e=>e.key===t);if(n<0)return;let r=C.length,i=(e,t)=>{for(let n=1;n<=r;n++){let i=C[((e+t*n)%r+r)%r];if(i&&!i.disabled&&G(i.key))return i}return null},a=getComputedStyle(e.currentTarget).direction===`rtl`,o=R?`ArrowDown`:a?`ArrowLeft`:`ArrowRight`,s=R?`ArrowUp`:a?`ArrowRight`:`ArrowLeft`,c=null;if(e.key===o?c=i(n,1):e.key===s?c=i(n,-1):e.key===`Home`?c=C.find(e=>!e.disabled&&G(e.key))??null:e.key===`End`&&(c=[...C].reverse().find(e=>!e.disabled&&G(e.key))??null),!c)return;e.preventDefault(),H(c.key),be(c.key);let l=c.href!=null||c.to!=null;j===`automatic`&&!l&&T?.(c.key)}let Q=e=>{let t=I.current;t&&t.scrollBy({left:e*t.clientWidth*de})},Se=[`app-tabs`,D===`pills`?`app-tabs-pills`:``,R?`app-tabs-vertical`:``,k===`sm`?`app-tabs-sm`:``,k===`lg`?`app-tabs-lg`:``,pe?`app-tabs-fitted`:``,N].filter(Boolean).join(` `),$=/* @__PURE__ */ g(`div`,{ref:X,role:`tablist`,"aria-orientation":R?`vertical`:void 0,"aria-label":M,className:Se,style:P,"data-wui-overflow-list":z?``:void 0,...F,onKeyDown:xe,onScroll:U,children:[C.map(n=>{let r=n.key===w,i=n.href!=null||n.to!=null,a={role:`tab`,"data-key":n.key,"aria-selected":r,tabIndex:n.key===ye?0:-1,className:`app-tab${r?` active`:``}${n.danger?` danger`:``}${i&&n.disabled?` disabled`:``}`},o=/* @__PURE__ */ g(re,{children:[n.image?/* @__PURE__ */ h(`img`,{className:`app-tab-img`,src:n.image,alt:n.imageAlt??``,width:B,height:B}):l(n.icon,{size:16,className:`app-tab-icon`}),/* @__PURE__ */ h(`span`,{className:`wui-tab-label`,children:n.label}),(n.countLabel||n.count!=null)&&/* @__PURE__ */ h(`span`,{className:`app-tab-count${n.tone?` ${n.tone}`:``}`,children:n.countLabel||ee(n.count,{decimals:0})})]}),c;if(i){let r=n.disabled||n.to==null||E==null||E===`a`?e(void 0,{href:n.disabled?void 0:n.href??n.to}):e(E,{to:n.to}),i=n.rel??(n.target===`_blank`?`noopener noreferrer`:void 0),s=n.disabled?{"aria-disabled":!0}:{target:n.target,rel:i},l=e=>{n.disabled?e.preventDefault():e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(H(n.key),T?.(n.key))};c=/* @__PURE__ */ h(t,{link:r,...a,...s,onClick:l,children:o},n.key)}else c=/* @__PURE__ */ h(`button`,{type:`button`,...a,disabled:n.disabled,onClick:()=>{n.disabled||(H(n.key),T?.(n.key))},children:o},n.key);return n.tooltip?/* @__PURE__ */ h(s,{content:n.tooltip,children:c},n.key):c}),/* @__PURE__ */ h(`span`,{className:`app-tab-indicator`,"aria-hidden":`true`,"data-wui-overflow-skip":``})]});return R?te($,x):z?/* @__PURE__ */ h(`wui-overflow`,{...x,ref:Z,class:`app-tabs-wrap`,label:me,children:$}):/* @__PURE__ */ g(`div`,{...x,ref:Z,className:`app-tabs-wrap`,children:[/* @__PURE__ */ h(`button`,{type:`button`,className:`app-tabs-scroll-btn prev`,"aria-label":S.scrollTabsBackwardLabel,tabIndex:-1,onClick:()=>Q(-1),children:/* @__PURE__ */ h(o,{name:`chevron-left`,size:16})}),$,/* @__PURE__ */ h(`button`,{type:`button`,className:`app-tabs-scroll-btn next`,"aria-label":S.scrollTabsForwardLabel,tabIndex:-1,onClick:()=>Q(1),children:/* @__PURE__ */ h(o,{name:`chevron-right`,size:16})})]})}export{x 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 r from"../lib/useWuiText.js";import{TONES as i}from"../lib/vocabulary.js";import{splitMarkerProps as a}from"../lib/wuiMarker.js";import o from"./AppIcon.js";import s from"./AppTooltip.js";import c from"./assertValidValue.js";import l from"./renderIconProp.js";import u from"./warnUnknownProps.js";import{formatNumber as ee}from"@webority/ui-elements/helpers";import{cloneElement as te,useCallback as d,useEffect as f,useLayoutEffect as p,useRef as m,useState as ne}from"react";import{Fragment as re,jsx as h,jsxs as g}from"react/jsx-runtime";import{TABS_TEXT as ie}from"@webority/ui-elements/text";var _=[`underline`,`pills`],v=[`horizontal`,`vertical`],y=[`sm`,`md`,`lg`],ae={sm:16,md:18,lg:20},oe=[`automatic`,`manual`],se=[`scroll`,`menu`],ce=i.filter(e=>e!==`primary`&&e!==`neutral`),le=()=>import(`@webority/ui-elements/elements/overflow`),b=1,ue=28,de=.7;function x(i){let{marker:x,props:fe}=a(`AppTabs`,i),S=r(`tabs`,ie),{tabs:C,value:w,onChange:T,linkComponent:E,variant:D=`underline`,orientation:O=`horizontal`,size:k=`md`,fitted:pe=!1,overflow:A=`scroll`,moreLabel:me=S.moreLabel,maxVisible:he,activation:j=`automatic`,ariaLabel:M,className:N=``,style:P,...F}=fe;n(`wui-overflow`,le),u(`AppTabs`,F),c(`AppTabs`,`variant`,D,_),c(`AppTabs`,`orientation`,O,v),c(`AppTabs`,`size`,k,y),c(`AppTabs`,`activation`,j,oe),c(`AppTabs`,`overflow`,A,se);for(let e of C)if(c(`AppTabs`,`tabs[].tone`,e.tone,ce),e.countPending&&(e.count!=null||e.countLabel))throw Error(`<AppTabs> tab "${e.key}" sets countPending with count or countLabel: a pending badge is empty, so it takes neither.`);let I=m(null),L=m(null),R=O===`vertical`,z=(A===`menu`||he!=null)&&!R,B=ae[k],[V,H]=ne(w);f(()=>{H(w)},[w]);let ge=C.find(e=>!e.disabled)?.key,_e=C.some(e=>e.key===V&&!e.disabled)?V:void 0,ve=C.some(e=>e.key===w&&!e.disabled)?w:void 0,ye=_e??ve??ge,be=e=>{I.current?.querySelector(`[data-key="${CSS.escape(String(e))}"]`)?.focus()},U=d(()=>{let e=I.current,t=L.current;if(!e||!t||R||z)return;let n=e.scrollWidth-e.clientWidth;t.classList.toggle(`is-overflow-start`,e.scrollLeft>b),t.classList.toggle(`is-overflow-end`,n>b&&e.scrollLeft<n-b)},[R,z]),W=d(()=>{let e=I.current;if(!e)return;let t=e.querySelector(`.app-tab.active`);t?(R?(e.style.setProperty(`--wui-tab-y`,`${t.offsetTop}px`),e.style.setProperty(`--wui-tab-h`,`${t.offsetHeight}px`)):(e.style.setProperty(`--wui-tab-x`,`${t.offsetLeft}px`),e.style.setProperty(`--wui-tab-w`,`${t.offsetWidth}px`)),e.toggleAttribute(`data-active-danger`,!!C.find(e=>e.key===w)?.danger)):e.style.setProperty(R?`--wui-tab-h`:`--wui-tab-w`,`0px`),e.setAttribute(`data-wui-tabs`,``),U()},[R,C,w,U]),G=e=>!z||!I.current?.querySelector(`[data-key="${CSS.escape(String(e))}"][data-wui-overflow-hidden]`),K=d(e=>{let t=I.current;if(!t||R)return;let n=t.querySelector(`.app-tab[data-key="${CSS.escape(e)}"]`);if(!n)return;let r=ue,i=n.offsetLeft,a=i+n.offsetWidth;i-r<t.scrollLeft?t.scrollLeft=Math.max(0,i-r):a+r>t.scrollLeft+t.clientWidth&&(t.scrollLeft=a+r-t.clientWidth)},[R]);p(()=>{W()},[W]),p(()=>{K(w)},[w,K]);let q=m(W);f(()=>{q.current=W},[W]),f(()=>{if(!document.fonts)return;let e=!0;return document.fonts.ready.then(()=>{e&&q.current()}),()=>{e=!1}},[]);let J=m(null),Y=d(e=>{if(typeof ResizeObserver>`u`)return;let t=J.current??{ro:new ResizeObserver(()=>q.current()),count:0};return J.current=t,t.ro.observe(e),t.count+=1,()=>{t.ro.unobserve(e),--t.count,t.count===0&&(t.ro.disconnect(),J.current===t&&(J.current=null))}},[]),X=d(e=>{I.current=e;let t=e?Y(e):void 0;return()=>{I.current=null,t?.()}},[Y]),Z=d(e=>{L.current=e;let t=e?Y(e):void 0;return()=>{L.current=null,t?.()}},[Y]);f(()=>{let e=L.current;if(!z||!e)return;let t=()=>q.current();return e.addEventListener(`wui-overflow-change`,t),()=>e.removeEventListener(`wui-overflow-change`,t)},[z]);function xe(e){let t=e.target instanceof HTMLElement?e.target.dataset.key:void 0;if(t==null)return;let n=C.findIndex(e=>e.key===t);if(n<0)return;let r=C.length,i=(e,t)=>{for(let n=1;n<=r;n++){let i=C[((e+t*n)%r+r)%r];if(i&&!i.disabled&&G(i.key))return i}return null},a=getComputedStyle(e.currentTarget).direction===`rtl`,o=R?`ArrowDown`:a?`ArrowLeft`:`ArrowRight`,s=R?`ArrowUp`:a?`ArrowRight`:`ArrowLeft`,c=null;if(e.key===o?c=i(n,1):e.key===s?c=i(n,-1):e.key===`Home`?c=C.find(e=>!e.disabled&&G(e.key))??null:e.key===`End`&&(c=[...C].reverse().find(e=>!e.disabled&&G(e.key))??null),!c)return;e.preventDefault(),H(c.key),be(c.key);let l=c.href!=null||c.to!=null;j===`automatic`&&!l&&T?.(c.key)}let Q=e=>{let t=I.current;t&&t.scrollBy({left:e*t.clientWidth*de})},Se=[`app-tabs`,D===`pills`?`app-tabs-pills`:``,R?`app-tabs-vertical`:``,k===`sm`?`app-tabs-sm`:``,k===`lg`?`app-tabs-lg`:``,pe?`app-tabs-fitted`:``,N].filter(Boolean).join(` `),$=/* @__PURE__ */ g(`div`,{ref:X,role:`tablist`,"aria-orientation":R?`vertical`:void 0,"aria-label":M,className:Se,style:P,"data-wui-overflow-list":z?``:void 0,...F,onKeyDown:xe,onScroll:U,children:[C.map(n=>{let r=n.key===w,i=n.href!=null||n.to!=null,a={role:`tab`,"data-key":n.key,"aria-selected":r,tabIndex:n.key===ye?0:-1,className:`app-tab${r?` active`:``}${n.danger?` danger`:``}${i&&n.disabled?` disabled`:``}`},o=/* @__PURE__ */ g(re,{children:[n.image?/* @__PURE__ */ h(`img`,{className:`app-tab-img`,src:n.image,alt:n.imageAlt??``,width:B,height:B}):l(n.icon,{size:16,className:`app-tab-icon`}),/* @__PURE__ */ h(`span`,{className:`wui-tab-label`,children:n.label}),n.countPending?/* @__PURE__ */ h(`span`,{className:`app-tab-count${n.tone?` ${n.tone}`:``}`,"data-count-pending":``}):(n.countLabel||n.count!=null)&&/* @__PURE__ */ h(`span`,{className:`app-tab-count${n.tone?` ${n.tone}`:``}`,children:n.countLabel||ee(n.count,{decimals:0})})]}),c;if(i){let r=n.disabled||n.to==null||E==null||E===`a`?e(void 0,{href:n.disabled?void 0:n.href??n.to}):e(E,{to:n.to}),i=n.rel??(n.target===`_blank`?`noopener noreferrer`:void 0),s=n.disabled?{"aria-disabled":!0}:{target:n.target,rel:i},l=e=>{n.disabled?e.preventDefault():e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(H(n.key),T?.(n.key))};c=/* @__PURE__ */ h(t,{link:r,...a,...s,onClick:l,children:o},n.key)}else c=/* @__PURE__ */ h(`button`,{type:`button`,...a,disabled:n.disabled,onClick:()=>{n.disabled||(H(n.key),T?.(n.key))},children:o},n.key);return n.tooltip?/* @__PURE__ */ h(s,{content:n.tooltip,children:c},n.key):c}),/* @__PURE__ */ h(`span`,{className:`app-tab-indicator`,"aria-hidden":`true`,"data-wui-overflow-skip":``})]});return R?te($,x):z?/* @__PURE__ */ h(`wui-overflow`,{...x,ref:Z,class:`app-tabs-wrap`,label:me,children:$}):/* @__PURE__ */ g(`div`,{...x,ref:Z,className:`app-tabs-wrap`,children:[/* @__PURE__ */ h(`button`,{type:`button`,className:`app-tabs-scroll-btn prev`,"aria-label":S.scrollTabsBackwardLabel,tabIndex:-1,onClick:()=>Q(-1),children:/* @__PURE__ */ h(o,{name:`chevron-left`,size:16})}),$,/* @__PURE__ */ h(`button`,{type:`button`,className:`app-tabs-scroll-btn next`,"aria-label":S.scrollTabsForwardLabel,tabIndex:-1,onClick:()=>Q(1),children:/* @__PURE__ */ h(o,{name:`chevron-right`,size:16})})]})}export{x 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{useFieldError as i}from"../lib/formFields.js";import ee from"../lib/useWuiText.js";import{splitMarkerProps as a}from"../lib/wuiMarker.js";import o from"./AppInfoTip.js";import s from"./AppRequiredMark.js";import te from"./assertValidValue.js";import ne from"./warnUnknownProps.js";import{useCallback as re,useEffect as c,useId as l,useLayoutEffect as u,useRef as d,useState as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{TEXTAREA_TEXT as h}from"@webority/ui-elements/text";import{Form as g}from"react-bootstrap";var _=e=>e!=null&&e!==``&&e!==!1;function v({ref:v,...ie}){let{marker:y,props:b}=a(`AppTextarea`,ie),x=ee(`textarea`,h),{label:S,required:C=!1,optional:w=!1,optionalLabel:T=x.optionalLabel,error:ae,helperText:E,help:D,helpLabel:oe=x.helpLabel,id:se,name:O,rows:ce=4,autoGrow:k=!1,monospace:A=!1,showCount:j=!1,maxLength:M,disabled:N=!1,readOnly:P=!1,loading:F=!1,size:I=`md`,className:L=``,fieldClassName:R=``,controlOnly:z=!1,value:B,...V}=b,H=i(O),U=ae??H,{onChange:W,...le}=V;if(z){let e=[[`label`,S],[`error`,U],[`helperText`,E],[`fieldClassName`,R],[`showCount`,j],[`help`,D],[`optional`,w]];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.`)}ne(`AppTextarea`,V),te(`AppTextarea`,`size`,I,r),c(()=>{w&&C&&typeof process<`u`&&process.env.NODE_ENV!==`production`&&e(`AppTextarea: optional and required together; optional ignored`)},[w,C]);let ue=l(),G=se||ue,de=[
|
|
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{useFieldError as i}from"../lib/formFields.js";import ee from"../lib/useWuiText.js";import{splitMarkerProps as a}from"../lib/wuiMarker.js";import o from"./AppInfoTip.js";import s from"./AppRequiredMark.js";import te from"./assertValidValue.js";import ne from"./warnUnknownProps.js";import{useCallback as re,useEffect as c,useId as l,useLayoutEffect as u,useRef as d,useState as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{TEXTAREA_TEXT as h}from"@webority/ui-elements/text";import{Form as g}from"react-bootstrap";var _=e=>e!=null&&e!==``&&e!==!1;function v({ref:v,...ie}){let{marker:y,props:b}=a(`AppTextarea`,ie),x=ee(`textarea`,h),{label:S,required:C=!1,optional:w=!1,optionalLabel:T=x.optionalLabel,error:ae,helperText:E,help:D,helpLabel:oe=x.helpLabel,id:se,name:O,rows:ce=4,autoGrow:k=!1,monospace:A=!1,showCount:j=!1,maxLength:M,disabled:N=!1,readOnly:P=!1,loading:F=!1,size:I=`md`,className:L=``,fieldClassName:R=``,controlOnly:z=!1,value:B,...V}=b,H=i(O),U=ae??H,{onChange:W,...le}=V;if(z){let e=[[`label`,S],[`error`,U],[`helperText`,E],[`fieldClassName`,R],[`showCount`,j],[`help`,D],[`optional`,w]];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.`)}ne(`AppTextarea`,V),te(`AppTextarea`,`size`,I,r),c(()=>{w&&C&&typeof process<`u`&&process.env.NODE_ENV!==`production`&&e(`AppTextarea: optional and required together; optional ignored`)},[w,C]);let ue=l(),G=se||ue,de=[k?`autosize`:``,A?`wui-mono`:``,U?`error`:``,I===`sm`?`wui-input-sm`:``,I===`lg`?`wui-input-lg`:``,I===`xl`?`wui-input-xl`:``,F?n:``,L].filter(Boolean).join(` `),K=U&&G?`${G}-error`:void 0,q=E&&G?`${G}-hint`:void 0,fe=K||q,J=d(null),pe=e=>{J.current=e,typeof v==`function`?v(e):v&&(v.current=e)},Y=d(void 0),X=re(()=>{let e=J.current;e&&(e.style.height=`auto`,e.style.height=`${e.scrollHeight}px`,Y.current=`${e.value}|${e.clientWidth}`)},[]);u(()=>{let e=J.current;!k||!e?Y.current=void 0:`${String(B??e.value)}|${e.clientWidth}`!==Y.current&&X()});let[Z,Q]=f(()=>String(B??V.defaultValue??``).length);c(()=>{j&&B!==void 0&&Q(String(B??``).length)},[B,j]);let me=e=>{k&&X(),j&&Q(e.currentTarget.value.length),V.onInput?.(e)},$=/* @__PURE__ */ p(g.Control,{as:`textarea`,id:G,name:O,rows:ce,className:de,"aria-invalid":U?`true`:`false`,"aria-describedby":fe,"aria-busy":F||void 0,required:C,maxLength:M,disabled:N,readOnly:P||F,...z?y:null,...B===void 0?null:{value:B},...le,...W?{onChange:W}:null,ref:pe,onInput:me});return z?$:/* @__PURE__ */ m(g.Group,{...y,className:`field${R?` ${R}`:``}`,children:[S&&/* @__PURE__ */ m(g.Label,{className:`label`,htmlFor:G,children:[S,w&&!C&&/* @__PURE__ */ p(`span`,{className:`label-optional`,children:` ${T}`}),C&&/* @__PURE__ */ p(s,{}),D&&/* @__PURE__ */ p(o,{label:oe,children:D})]}),$,/* @__PURE__ */ p(t,{error:U,hint:E,errorId:K,hintId:q}),j&&/* @__PURE__ */ m(`div`,{className:`field-count${M&&Z>=M?` at-limit`:``}`,children:[Z,M?` / ${M}`:``]})]})}export{v as default};
|
package/dist/guidance.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"format": "webority-guidance/1",
|
|
3
3
|
"package": {
|
|
4
4
|
"name": "@webority/ui-react",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.178.0"
|
|
6
6
|
},
|
|
7
7
|
"components": [
|
|
8
8
|
{
|
|
@@ -976,13 +976,7 @@
|
|
|
976
976
|
{
|
|
977
977
|
"component": "AppButton",
|
|
978
978
|
"props": {
|
|
979
|
-
"leftIcon":
|
|
980
|
-
"component": "AppIcon",
|
|
981
|
-
"props": {
|
|
982
|
-
"name": "plus",
|
|
983
|
-
"size": 16
|
|
984
|
-
}
|
|
985
|
-
}
|
|
979
|
+
"leftIcon": "plus"
|
|
986
980
|
},
|
|
987
981
|
"children": "Add member"
|
|
988
982
|
}
|
|
@@ -33,10 +33,10 @@ export interface AppButtonProps extends Omit<ComponentPropsWithRef<"button">, "c
|
|
|
33
33
|
* @default false
|
|
34
34
|
*/
|
|
35
35
|
block?: boolean | undefined;
|
|
36
|
-
/** An icon name,
|
|
37
|
-
leftIcon?: string |
|
|
38
|
-
/** An icon name,
|
|
39
|
-
rightIcon?: string |
|
|
36
|
+
/** An icon name, drawn in the icon set. */
|
|
37
|
+
leftIcon?: string | undefined;
|
|
38
|
+
/** An icon name, drawn in the icon set. */
|
|
39
|
+
rightIcon?: string | undefined;
|
|
40
40
|
/** Render as a button-styled link (an <a href>) instead of a <button>; matches Razor <app-button href>. */
|
|
41
41
|
href?: string | undefined;
|
|
42
42
|
/**
|
|
@@ -66,7 +66,7 @@ export interface AppButtonProps extends Omit<ComponentPropsWithRef<"button">, "c
|
|
|
66
66
|
*/
|
|
67
67
|
shape?: "rounded" | "pill" | "sharp" | undefined;
|
|
68
68
|
/**
|
|
69
|
-
* The iconsax style of a named leftIcon / rightIcon
|
|
69
|
+
* The iconsax style of a named leftIcon / rightIcon.
|
|
70
70
|
* @default "linear"
|
|
71
71
|
*/
|
|
72
72
|
iconVariant?: IconVariant | undefined;
|
|
@@ -56,8 +56,7 @@ export interface AppCheckboxProps extends Omit<ComponentPropsWithoutRef<"input">
|
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* Shared checkbox on Bootstrap `.form-check` markup (Razor <app-checkbox> matches).
|
|
59
|
-
* Theme restyles `.form-check-input` as the one selection glyph
|
|
60
|
-
* uses the `.wui-check` alias of the same skin.
|
|
59
|
+
* Theme restyles `.form-check-input` as the one selection glyph, table row-select included.
|
|
61
60
|
*
|
|
62
61
|
* The label is bound with id/htmlFor rather than react-bootstrap's `label` prop:
|
|
63
62
|
* that rendered a <label> with no `for`, so clicking the text did nothing.
|
|
@@ -29,6 +29,7 @@ export interface AppDataTablePagination {
|
|
|
29
29
|
pageSizes?: number[] | undefined;
|
|
30
30
|
mode?: "numbered" | "prev-next" | undefined;
|
|
31
31
|
summary?: boolean | undefined;
|
|
32
|
+
summaryText?: string | undefined;
|
|
32
33
|
}
|
|
33
34
|
export interface AppDataTableColumn<Row> {
|
|
34
35
|
key: string;
|
|
@@ -43,6 +44,8 @@ export interface AppDataTableColumn<Row> {
|
|
|
43
44
|
/** Draws the cell as the row's header, a th with scope row. Default off. */
|
|
44
45
|
rowHeader?: boolean | undefined;
|
|
45
46
|
cellClassName?: string | undefined;
|
|
47
|
+
/** Added to the header cell and every body cell of the column, for CSS that targets one column. */
|
|
48
|
+
columnClassName?: string | undefined;
|
|
46
49
|
cellStyle?: CSSProperties | undefined;
|
|
47
50
|
hideable?: boolean | undefined;
|
|
48
51
|
pin?: AppDataTablePin | undefined;
|
|
@@ -181,8 +184,8 @@ export interface AppDataTableProps<Row> extends Omit<ComponentPropsWithoutRef<"d
|
|
|
181
184
|
/** Keys of hideable columns to leave out, from useTableView. A column that is not hideable always shows. */
|
|
182
185
|
hiddenColumns?: string[] | undefined;
|
|
183
186
|
/**
|
|
184
|
-
*
|
|
185
|
-
* @default
|
|
187
|
+
* Stacks on phones by default: below 768px each row is a card, the first column on top, then label and value lines from the column labels, actions at the bottom. A virtual table defaults to false. Set false to keep the scrolling table.
|
|
188
|
+
* @default true
|
|
186
189
|
*/
|
|
187
190
|
stackOnMobile?: boolean | undefined;
|
|
188
191
|
/**
|
|
@@ -98,7 +98,7 @@ interface AppFilePickerBaseProps extends Omit<ComponentPropsWithoutRef<"input">,
|
|
|
98
98
|
*/
|
|
99
99
|
readOnly?: boolean | undefined;
|
|
100
100
|
/**
|
|
101
|
-
* The control height: sm, md or lg. The button form takes it too
|
|
101
|
+
* The control height: sm, md or lg, md when unset. The button form takes it too.
|
|
102
102
|
* @default "md"
|
|
103
103
|
*/
|
|
104
104
|
size?: "sm" | "md" | "lg" | undefined;
|
|
@@ -177,7 +177,7 @@ export type AppFilePickerProps = AppFilePickerSingleProps | AppFilePickerMultipl
|
|
|
177
177
|
* @param [props.helperText]
|
|
178
178
|
* @param [props.loading]
|
|
179
179
|
* @param [props.readOnly] Shows the value but blocks picking, dropping, changing and removing. The control takes aria-readonly.
|
|
180
|
-
* @param [props.size] The control height: sm, md or lg. The button form takes it too
|
|
180
|
+
* @param [props.size] The control height: sm, md or lg, md when unset. The button form takes it too.
|
|
181
181
|
* @param [props.disabled] Locks the picker and keeps it out of the form post.
|
|
182
182
|
* @param [props.help] The content of the info-tip beside the label.
|
|
183
183
|
* @param [props.helpLabel] The accessible name of the info-tip button.
|
|
@@ -90,7 +90,7 @@ export interface AppFileViewerProps extends Omit<ComponentPropsWithoutRef<"div">
|
|
|
90
90
|
* @param [props.onLoad] Called once the file shows, with its kind and page count.
|
|
91
91
|
* @param [props.onError] Called when the file cannot be opened.
|
|
92
92
|
* @param [props.className]
|
|
93
|
-
* @param [props.style] Inline style; lands on the element with `className`. Set a height here to size the viewer
|
|
93
|
+
* @param [props.style] Inline style; lands on the element with `className`. Set a height here to size the viewer.
|
|
94
94
|
* @param [ref] The `<wui-file-viewer>` element. For a video or audio file,
|
|
95
95
|
* `ref.current.seekTo(seconds)` moves the player to that point, kept within the file's length, and returns
|
|
96
96
|
* true; with no video or audio open (another kind of file, or before `onLoad`) it does nothing and returns
|
|
@@ -45,6 +45,6 @@ export interface AppIconProps extends Omit<ComponentPropsWithoutRef<"svg">, "cla
|
|
|
45
45
|
*
|
|
46
46
|
* The glyph bodies are GENERATED (iconGlyphs.g.ts) from one source shared with the Razor
|
|
47
47
|
* RCL and the wui elements, so every surface draws the identical icon. Add or change an
|
|
48
|
-
* icon in scripts/icon-map.json and run `node scripts/gen-icons.
|
|
48
|
+
* icon in scripts/icon-map.json and run `node scripts/gen-icons.mts`.
|
|
49
49
|
*/
|
|
50
50
|
export default function AppIcon(props: AppIconProps): ReactNode;
|
|
@@ -21,6 +21,8 @@ export interface AppInlineEditProps {
|
|
|
21
21
|
value: string | number;
|
|
22
22
|
label: string;
|
|
23
23
|
}[] | undefined;
|
|
24
|
+
/** A select's choices, fetched as a JSON array of { value, label } on the first open. Only with type select, and instead of options. */
|
|
25
|
+
loadUrl?: string | undefined;
|
|
24
26
|
/** What the value is, such as Owner: its accessible name and what screen readers announce, as in Owner saved. */
|
|
25
27
|
label: string;
|
|
26
28
|
/** Shown, muted, when there is no value, and in the empty control. Without it an empty value shows a hyphen. */
|
|
@@ -4,6 +4,7 @@ type AppModalTone = "neutral" | "danger" | "success" | "warning";
|
|
|
4
4
|
type AppModalPlacement = "center" | "top";
|
|
5
5
|
type AppModalSizePreset = "sm" | "md" | "lg" | "xl" | "wide";
|
|
6
6
|
type AppModalSize = AppModalSizePreset | "fullscreen" | number;
|
|
7
|
+
type AppModalPhoneSize = AppModalSizePreset | "fullscreen";
|
|
7
8
|
export interface AppModalProps extends Omit<ComponentPropsWithoutRef<"dialog">, "title"> {
|
|
8
9
|
/** Whether the dialog is shown. */
|
|
9
10
|
open: boolean;
|
|
@@ -45,6 +46,8 @@ export interface AppModalProps extends Omit<ComponentPropsWithoutRef<"dialog">,
|
|
|
45
46
|
* @default "md"
|
|
46
47
|
*/
|
|
47
48
|
size?: AppModalSize | undefined;
|
|
49
|
+
/** The card width below 576px, in place of size, which applies from 576px up. fullscreen covers the whole viewport on a phone. Unset, size applies at every width. */
|
|
50
|
+
phoneSize?: AppModalPhoneSize | undefined;
|
|
48
51
|
/**
|
|
49
52
|
* Vertical placement of the card: centred, or pinned near the top of the viewport.
|
|
50
53
|
* @default "center"
|
|
@@ -139,6 +139,8 @@ export interface SearchShape {
|
|
|
139
139
|
onFocus?: ((event: React.FocusEvent<HTMLInputElement>) => void) | undefined;
|
|
140
140
|
/** Default "Search"; also the field's accessible name. */
|
|
141
141
|
placeholder?: string | undefined;
|
|
142
|
+
/** One letter (a to z): Ctrl or Cmd with it focuses the field and the placeholder names the chord. */
|
|
143
|
+
shortcutKey?: string | undefined;
|
|
142
144
|
}
|
|
143
145
|
export interface AppShellProps extends Omit<React.ComponentPropsWithoutRef<"div">, "children" | "className" | "style"> {
|
|
144
146
|
/**
|
|
@@ -34,6 +34,11 @@ export interface AppTablePaginationProps extends ComponentPropsWithoutRef<"nav">
|
|
|
34
34
|
* @default false
|
|
35
35
|
*/
|
|
36
36
|
summary?: boolean | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Replaces the built-in English text, for other languages. The tokens {first}, {last} and {total} are the first and last rows on the page and the row total. It shows with summary.
|
|
39
|
+
* @default "Showing {first} to {last} of {total}"
|
|
40
|
+
*/
|
|
41
|
+
summaryText?: string | undefined;
|
|
37
42
|
/**
|
|
38
43
|
* sm draws 28px page and arrow buttons with 12px text.
|
|
39
44
|
* @default "md"
|
|
@@ -72,7 +72,7 @@ export interface AppTextareaProps extends ComponentPropsWithoutRef<"textarea"> {
|
|
|
72
72
|
/**
|
|
73
73
|
* The shared multi-line field: the textarea counterpart to AppInput. Wraps react-bootstrap
|
|
74
74
|
* Form.Group / Form.Label / Form.Control (as="textarea"), keeping the `.field`/`.label`/
|
|
75
|
-
* `.
|
|
75
|
+
* `.form-control` classes so the look is unchanged. Forwards `ref` for react-hook-form and
|
|
76
76
|
* controlled use alike.
|
|
77
77
|
*/
|
|
78
78
|
declare function AppTextarea({ ref, ...props }: AppTextareaProps): JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=()=>globalThis.crypto,t=()=>{let t=/* @__PURE__ */ new Uint8Array(16),n=e();if(typeof n?.getRandomValues
|
|
1
|
+
var e=()=>globalThis.crypto,t=()=>{let t=/* @__PURE__ */ new Uint8Array(16),n=e();if(typeof n?.getRandomValues!=`function`)throw Error(`newIdempotencyKey needs crypto.randomUUID or crypto.getRandomValues, and this runtime has neither.`);return n.getRandomValues(t),t},n=e=>{let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20,32)}`},r=()=>{let r=e();return typeof r?.randomUUID==`function`?r.randomUUID():n(Array.from(t(),(e,t)=>t===6?e&15|64:t===8?e&63|128:e))};export{r as newIdempotencyKey};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{isOfflineFailure as e}from"./requestPlatform.js";var t=`You appear to be offline. Check your connection and try again.`,n=`We
|
|
1
|
+
import{isOfflineFailure as e}from"./requestPlatform.js";var t=`You appear to be offline. Check your connection and try again.`,n=`We could not reach the server. Check your network or firewall and try again.`,r=`That took too long to respond. Check your connection and try again.`,i=`Something went wrong. Please try again.`,a=`A network check stopped this request. Try again, or report it if it keeps happening.`,o=`request_canceled`,s=`contract_error`,c=`timeout`,l=`network`,u=`offline`,d=`network_check`,f=300,p=`internal_error`,m=e=>`Request failed (${e})`,h={401:{code:`unauthorized`,sentence:`Please sign in to continue.`},403:{code:`forbidden`,sentence:`You do not have access to this.`}},g=e=>typeof e==`object`&&!!e&&!Array.isArray(e),_=e=>typeof e==`string`&&e.trim().length>0?e:null,v=(e,t)=>{let n=h[e];if(n===void 0||t===null||t.code!==n.code)return null;let r=_(t.detail);return r===null||r===n.sentence?n.sentence:null},y=e=>/^\s*</.test(e)||e.includes(`
|
|
2
2
|
at `)||/(Exception|StackTrace):/.test(e)||/\b(System|Microsoft)\.[A-Za-z]+\.[A-Za-z]/.test(e),b=(e,t)=>{let n=_(e);return n!==null&&!y(n)&&!(t&&n.length>f)?n:null},x=e=>e.replace(/^\$\.?/,``).split(`.`).map(e=>e.charAt(0).toLowerCase()+e.slice(1)).join(`.`),S=e=>{if(Array.isArray(e)){for(let t of e){let e=_(t);if(e!==null)return e}return null}return _(e)},C=(e,t,n)=>{let r=x(t);r===``?e.form??=n:r in e.fields||(e.fields[r]=n)},w=e=>{let t={fields:{},form:null};if(Array.isArray(e)){for(let n of e){if(!g(n))continue;let e=_(n.message);e!==null&&C(t,typeof n.field==`string`?n.field:``,e)}return t}if(!g(e))return t;for(let[n,r]of Object.entries(e)){let e=S(r);e!==null&&C(t,n,e)}return t},T=e=>g(e)&&typeof e.message==`string`&&typeof e.status==`number`&&typeof e.offline==`boolean`&&g(e.fieldErrors)&&g(e.extensions),E=e=>({code:null,fieldErrors:{},status:0,offline:!1,traceId:null,diagnostic:null,extensions:{},...e}),D=/* @__PURE__ */ new Set([`type`,`title`,`status`,`detail`,`instance`,`code`,`errors`,`traceId`]),O=e=>e===null?{}:Object.fromEntries(Object.entries(e).filter(([e])=>!D.has(e))),k=e=>{let t=g(e.config)?e.config.headers:void 0;if(!g(t))return null;let n=typeof t.get==`function`?t.get(`traceparent`):t.traceparent??t.Traceparent;return(typeof n==`string`?/^00-([0-9a-f]{32})-[0-9a-f]{16}-[0-9a-f]{2}$/.exec(n):null)?.[1]??null},A=e=>{let t=e?.headers;return g(t)?(typeof t.get==`function`?t.get(`cf-mitigated`):t[`cf-mitigated`])===`challenge`:!1},j=a=>{let s=_(a.code),d=_(a.name),f=_(a.message),p=k(a);return d===`CanceledError`||s===`ERR_CANCELED`?E({code:o,message:i,traceId:p,diagnostic:f}):s===`ECONNABORTED`||s===`ETIMEDOUT`?E({code:c,message:r,offline:!0,traceId:p,diagnostic:f}):d===`RequestOfflineError`||s===`ERR_NETWORK`||f===`Network Error`||f===`Network request failed`?e(a)?E({code:u,message:t,offline:!0,traceId:p,diagnostic:f}):E({code:l,message:n,offline:!0,traceId:p,diagnostic:f}):E({message:i,traceId:p,diagnostic:f})};function M(e){if(T(e))return e;if(typeof e==`string`)return E({message:b(e,!0)??`Something went wrong. Please try again.`,diagnostic:e||null});if(!g(e))return E({message:i,diagnostic:e==null?null:String(e)});if(e.isContractError===!0)return E({code:s,message:b(e.message,!0)??`Something went wrong. Please try again.`,diagnostic:_(e.message)});let t=g(e.response)?e.response:null,n=typeof t?.status==`number`?t.status:typeof e.status==`number`?e.status:0,r=t?t.data:e.body;if(n===0&&r==null)return j(e);if(n===403&&A(t))return E({code:d,message:a,status:n,traceId:k(e),diagnostic:_(e.message)});let o=g(r)?r:null,{fields:c,form:l}=w(o?.errors),u=_(o?.code),f=n>=500||u===null,h=_(o?.traceId)??k(e),y=_(o?.detail)??_(o?.title)??_(r)??_(e.message),x;x=n>=500?(u!==null&&u!==p?b(o?.detail,!0):null)??`Something went wrong on our side. Please try again in a moment.`:v(n,o)??b(Object.values(c)[0],f)??b(l,f)??b(o?.detail,f)??b(o?.title,f)??b(r,f)??(n?m(n):`Something went wrong. Please try again.`);let S=g(e.config)?e.config:null,C=S===null?null:_(S.url),D=S!==null&&`_accountId`in S?_(S._accountId):null;return E({code:u,message:x,fieldErrors:c,status:n,traceId:h,diagnostic:y,extensions:O(o),...C===null?{}:{requestUrl:C},...D===null?{}:{accountId:D}})}export{s as CONTRACT_ERROR_CODE,d as NETWORK_CHECK_CODE,a as NETWORK_CHECK_MESSAGE,l as NETWORK_CODE,u as OFFLINE_CODE,t as OFFLINE_MESSAGE,o as REQUEST_CANCELED_CODE,c as TIMEOUT_CODE,r as TIMEOUT_MESSAGE,i as UNEXPECTED_MESSAGE,n as UNREACHABLE_MESSAGE,M as extractApiError,T as isApiError,x as toFieldPath};
|