@webority/ui-react 0.146.2 → 0.147.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 +262 -137
- package/dist/canvas-kit/manifest.json +33 -20
- package/dist/canvas-kit/release.json +6 -6
- package/dist/components/AppChip.js +1 -1
- package/dist/components/AppKpiTile.js +1 -1
- package/dist/components/AppShell.js +1 -1
- package/dist/guidance.json +1 -1
- package/dist/markdown-core/dist/inline.js +1 -1
- package/dist/markdown-core/dist/parse.js +3 -3
- package/dist/types/components/AppChip.d.ts +6 -0
- package/dist/types/components/AppKpiTile.d.ts +2 -2
- package/dist/types/components/AppShell.d.ts +5 -2
- package/dist/types/lib/sectionShell.d.ts +1 -1
- package/package.json +7 -7
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"kind": "WeborityWeb",
|
|
3
3
|
"library": {
|
|
4
4
|
"name": "@webority/ui-react",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.147.0"
|
|
6
6
|
},
|
|
7
7
|
"rendererProtocolVersion": 13,
|
|
8
8
|
"platform": "Web",
|
|
@@ -3839,6 +3839,12 @@
|
|
|
3839
3839
|
"description": "Extra classes on the element.",
|
|
3840
3840
|
"default": ""
|
|
3841
3841
|
},
|
|
3842
|
+
{
|
|
3843
|
+
"name": "count",
|
|
3844
|
+
"type": "node",
|
|
3845
|
+
"required": false,
|
|
3846
|
+
"description": "A count shown after the label, such as a filter's result count."
|
|
3847
|
+
},
|
|
3842
3848
|
{
|
|
3843
3849
|
"name": "disabled",
|
|
3844
3850
|
"type": "boolean",
|
|
@@ -3864,6 +3870,12 @@
|
|
|
3864
3870
|
"required": false,
|
|
3865
3871
|
"description": "aria-label for the dismiss button."
|
|
3866
3872
|
},
|
|
3873
|
+
{
|
|
3874
|
+
"name": "selected",
|
|
3875
|
+
"type": "boolean",
|
|
3876
|
+
"required": false,
|
|
3877
|
+
"description": "With onClick, true marks the chip as the chosen filter (its button carries aria-pressed). Needs onClick; a chip that is not clickable refuses it."
|
|
3878
|
+
},
|
|
3867
3879
|
{
|
|
3868
3880
|
"name": "size",
|
|
3869
3881
|
"type": "enum",
|
|
@@ -12892,7 +12904,7 @@
|
|
|
12892
12904
|
],
|
|
12893
12905
|
"required": false,
|
|
12894
12906
|
"description": "The icon style of a named icon; a node icon is drawn as given.",
|
|
12895
|
-
"default": "
|
|
12907
|
+
"default": "twotone"
|
|
12896
12908
|
},
|
|
12897
12909
|
{
|
|
12898
12910
|
"name": "inline",
|
|
@@ -21374,7 +21386,8 @@
|
|
|
21374
21386
|
"twotone"
|
|
21375
21387
|
],
|
|
21376
21388
|
"required": false,
|
|
21377
|
-
"description": "The iconsax style of every sidebar icon. A row's own iconVariant overrides it; bulk is the filled look. Unset, icons draw in the
|
|
21389
|
+
"description": "The iconsax style of every sidebar icon. A row's own iconVariant overrides it; bulk is the filled look. Unset, icons draw in the twotone style.",
|
|
21390
|
+
"default": "twotone"
|
|
21378
21391
|
},
|
|
21379
21392
|
{
|
|
21380
21393
|
"name": "itemHeight",
|
|
@@ -28219,19 +28232,19 @@
|
|
|
28219
28232
|
},
|
|
28220
28233
|
"border": {
|
|
28221
28234
|
"light": "#ebedf3",
|
|
28222
|
-
"dark": "#
|
|
28235
|
+
"dark": "#3d4554"
|
|
28223
28236
|
},
|
|
28224
28237
|
"border-strong": {
|
|
28225
28238
|
"light": "#c4cada",
|
|
28226
|
-
"dark": "#
|
|
28239
|
+
"dark": "#515b6e"
|
|
28227
28240
|
},
|
|
28228
28241
|
"border-subtle": {
|
|
28229
28242
|
"light": "#f4f6f8",
|
|
28230
|
-
"dark": "#
|
|
28243
|
+
"dark": "#3d455480"
|
|
28231
28244
|
},
|
|
28232
28245
|
"chart-1": {
|
|
28233
28246
|
"light": "#4f46e5",
|
|
28234
|
-
"dark": "#
|
|
28247
|
+
"dark": "#aeaaf5"
|
|
28235
28248
|
},
|
|
28236
28249
|
"chart-2": {
|
|
28237
28250
|
"light": "#eb6834",
|
|
@@ -28263,7 +28276,7 @@
|
|
|
28263
28276
|
},
|
|
28264
28277
|
"chart-axis": {
|
|
28265
28278
|
"light": "#c4cada",
|
|
28266
|
-
"dark": "#
|
|
28279
|
+
"dark": "#515b6e"
|
|
28267
28280
|
},
|
|
28268
28281
|
"chart-diverging-high": {
|
|
28269
28282
|
"light": "#2a78d6",
|
|
@@ -28279,7 +28292,7 @@
|
|
|
28279
28292
|
},
|
|
28280
28293
|
"chart-grid": {
|
|
28281
28294
|
"light": "#ebedf3",
|
|
28282
|
-
"dark": "#
|
|
28295
|
+
"dark": "#3d4554"
|
|
28283
28296
|
},
|
|
28284
28297
|
"chart-label": {
|
|
28285
28298
|
"light": "#626a82",
|
|
@@ -28355,23 +28368,23 @@
|
|
|
28355
28368
|
},
|
|
28356
28369
|
"field-border": {
|
|
28357
28370
|
"light": "#dfe2ea",
|
|
28358
|
-
"dark": "#
|
|
28371
|
+
"dark": "#3d4554"
|
|
28359
28372
|
},
|
|
28360
28373
|
"field-border-focus": {
|
|
28361
28374
|
"light": "#a5b4fc",
|
|
28362
|
-
"dark": "#
|
|
28375
|
+
"dark": "#aeaaf5"
|
|
28363
28376
|
},
|
|
28364
28377
|
"field-border-hover": {
|
|
28365
28378
|
"light": "#c4cada",
|
|
28366
|
-
"dark": "#
|
|
28379
|
+
"dark": "#515b6e"
|
|
28367
28380
|
},
|
|
28368
28381
|
"focus-ring": {
|
|
28369
28382
|
"light": "#4f46e5",
|
|
28370
|
-
"dark": "#
|
|
28383
|
+
"dark": "#aeaaf5"
|
|
28371
28384
|
},
|
|
28372
28385
|
"focus-ring-soft": {
|
|
28373
28386
|
"light": "#4f46e540",
|
|
28374
|
-
"dark": "#
|
|
28387
|
+
"dark": "#aeaaf540"
|
|
28375
28388
|
},
|
|
28376
28389
|
"info": {
|
|
28377
28390
|
"light": "#056ee9",
|
|
@@ -28403,7 +28416,7 @@
|
|
|
28403
28416
|
},
|
|
28404
28417
|
"link": {
|
|
28405
28418
|
"light": "#4f46e5",
|
|
28406
|
-
"dark": "#
|
|
28419
|
+
"dark": "#aeaaf5"
|
|
28407
28420
|
},
|
|
28408
28421
|
"neutral": {
|
|
28409
28422
|
"light": "#07143714",
|
|
@@ -28487,11 +28500,11 @@
|
|
|
28487
28500
|
},
|
|
28488
28501
|
"primary": {
|
|
28489
28502
|
"light": "#4f46e5",
|
|
28490
|
-
"dark": "#
|
|
28503
|
+
"dark": "#aeaaf5"
|
|
28491
28504
|
},
|
|
28492
28505
|
"primary-hover": {
|
|
28493
28506
|
"light": "#4338ca",
|
|
28494
|
-
"dark": "#
|
|
28507
|
+
"dark": "#c3c0f8"
|
|
28495
28508
|
},
|
|
28496
28509
|
"primary-soft": {
|
|
28497
28510
|
"light": "#e0e7ff",
|
|
@@ -28499,15 +28512,15 @@
|
|
|
28499
28512
|
},
|
|
28500
28513
|
"primary-text": {
|
|
28501
28514
|
"light": "#4f46e5",
|
|
28502
|
-
"dark": "#
|
|
28515
|
+
"dark": "#aeaaf5"
|
|
28503
28516
|
},
|
|
28504
28517
|
"primary-wash": {
|
|
28505
28518
|
"light": "#4f46e514",
|
|
28506
|
-
"dark": "#
|
|
28519
|
+
"dark": "#aeaaf514"
|
|
28507
28520
|
},
|
|
28508
28521
|
"primary-wash-strong": {
|
|
28509
28522
|
"light": "#4f46e533",
|
|
28510
|
-
"dark": "#
|
|
28523
|
+
"dark": "#aeaaf533"
|
|
28511
28524
|
},
|
|
28512
28525
|
"progress-label": {
|
|
28513
28526
|
"light": "#ffffff",
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webority-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.147.0",
|
|
4
4
|
"platform": "Web",
|
|
5
5
|
"kitModuleVersion": 2,
|
|
6
6
|
"rendererProtocolVersion": 13,
|
|
7
7
|
"library": {
|
|
8
8
|
"name": "@webority/ui-react",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.147.0"
|
|
10
10
|
},
|
|
11
11
|
"files": {
|
|
12
12
|
"manifest.json": {
|
|
13
|
-
"sha256": "
|
|
14
|
-
"bytes":
|
|
13
|
+
"sha256": "589881477f87c4e6140e57f74f1b366fef5d7dc8f52d8b7798e3200814f16fc8",
|
|
14
|
+
"bytes": 984118
|
|
15
15
|
},
|
|
16
16
|
"kit.js": {
|
|
17
|
-
"sha256": "
|
|
18
|
-
"bytes":
|
|
17
|
+
"sha256": "38a9487fa56d34c667467ca1921eea81dc67a5a993a62d3a7a59b01d128ecfcd",
|
|
18
|
+
"bytes": 11180593
|
|
19
19
|
},
|
|
20
20
|
"kit.css": {
|
|
21
21
|
"sha256": "13b14f71fb6ea024945f95cba617b4f1d49f44a65ba7c7ed05d2354805539ef6",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{TONES as e}from"../lib/vocabulary.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppIcon.js";import r from"./assertValidValue.js";import i from"./warnUnknownProps.js";import{Fragment as a,jsx as o,jsxs as s}from"react/jsx-runtime";var c=[`soft`,`outline`,`solid`],l=[`sm`,`md`];function u(u){let{marker:d,props:f}=t(`AppChip`,u),{label:p,children:m,tone:h=`neutral`,variant:g=`soft`,size:_=`md`,leadingIcon:v,avatar:y,onRemove:b,onClick:x,disabled:
|
|
1
|
+
import{TONES as e}from"../lib/vocabulary.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppIcon.js";import r from"./assertValidValue.js";import i from"./warnUnknownProps.js";import{Fragment as a,jsx as o,jsxs as s}from"react/jsx-runtime";var c=[`soft`,`outline`,`solid`],l=[`sm`,`md`];function u(u){let{marker:d,props:f}=t(`AppChip`,u),{label:p,children:m,tone:h=`neutral`,variant:g=`soft`,size:_=`md`,leadingIcon:v,avatar:y,onRemove:b,onClick:x,selected:S,count:C,disabled:w=!1,removeLabel:T,className:E=``,...D}=f;if(i(`AppChip`,D),r(`AppChip`,`tone`,h,e),r(`AppChip`,`variant`,g,c),r(`AppChip`,`size`,_,l),S!=null&&!x)throw RangeError(`[@webority/ui-react] <AppChip> received selected without onClick. Only a clickable chip can be the chosen filter: pass onClick, or omit selected.`);let O=p??m,k=C==null?null:/* @__PURE__ */ o(`span`,{className:`wui-chip-count`,children:C}),A={},j={};for(let[e,t]of Object.entries(D))x&&(e.startsWith(`aria-`)||e.startsWith(`data-`))?A[e]=t:j[e]=t;let M=[`chip`,h&&h!==`neutral`?h:``,g===`outline`?`chip-outline`:g===`solid`?`chip-solid`:``,_===`sm`?`chip-sm`:``,x?`chip-clickable`:``,b?`chip-removable`:``,w?`is-disabled`:``,E].filter(Boolean).join(` `),N=y?/* @__PURE__ */ o(`span`,{className:`chip-avatar`,children:typeof y==`string`?/* @__PURE__ */ o(`img`,{src:y,alt:``}):y}):v?/* @__PURE__ */ o(`span`,{className:`chip-ic`,children:/* @__PURE__ */ o(n,{name:v,size:_===`sm`?12:14})}):null,P=x?/* @__PURE__ */ s(`button`,{type:`button`,className:`chip-body`,"aria-pressed":S??void 0,...A,onClick:x,disabled:w,children:[N,/* @__PURE__ */ o(`span`,{className:`chip-label`,children:O}),k]}):/* @__PURE__ */ s(a,{children:[N,/* @__PURE__ */ o(`span`,{className:`chip-label`,children:O}),k]});return/* @__PURE__ */ s(`span`,{className:M,...d,...j,children:[P,b&&/* @__PURE__ */ o(`button`,{type:`button`,className:`chip-remove`,onClick:b,disabled:w,"aria-label":T||(typeof O==`string`?`Remove ${O}`:`Remove`),children:/* @__PURE__ */ o(n,{name:`x`,size:_===`sm`?12:14})})]})}export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{TONES as e}from"../lib/vocabulary.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppIcon.js";import r from"./AppSparkline.js";import i from"./assertValidValue.js";import a from"./renderIconProp.js";import o from"./warnUnknownProps.js";import{isValidElement as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";var u=[`plain`,`filled`,`accent`,`spotlight`],d=[`sm`,`md`,`lg`],f=e,p=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],m=[`up`,`down`,`flat`],h=e.filter(e=>[`success`,`danger`,`neutral`].includes(e)),g={success:` wui-kpi-delta--success`,danger:` wui-kpi-delta--danger`,neutral:` wui-kpi-delta--neutral`};function _(e){return e==null||typeof e==`boolean`?``:typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(_).join(``):s(e)?_(e.props?.children):``}function v(e){let t=_(e).trim();return t.startsWith(`+`)?`up`:t.startsWith(`-`)||t.startsWith(`−`)?`down`:`flat`}function y(e){let{marker:s,props:_}=t(`AppKpiTile`,e),{label:y,value:b,caption:x,icon:S,iconTone:C,iconVariant:w
|
|
1
|
+
import{TONES as e}from"../lib/vocabulary.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppIcon.js";import r from"./AppSparkline.js";import i from"./assertValidValue.js";import a from"./renderIconProp.js";import o from"./warnUnknownProps.js";import{isValidElement as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";var u=[`plain`,`filled`,`accent`,`spotlight`],d=[`sm`,`md`,`lg`],f=e,p=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],m=[`up`,`down`,`flat`],h=e.filter(e=>[`success`,`danger`,`neutral`].includes(e)),g={success:` wui-kpi-delta--success`,danger:` wui-kpi-delta--danger`,neutral:` wui-kpi-delta--neutral`};function _(e){return e==null||typeof e==`boolean`?``:typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(_).join(``):s(e)?_(e.props?.children):``}function v(e){let t=_(e).trim();return t.startsWith(`+`)?`up`:t.startsWith(`-`)||t.startsWith(`−`)?`down`:`flat`}function y(e){let{marker:s,props:_}=t(`AppKpiTile`,e),{label:y,value:b,caption:x,icon:S,iconTone:C,iconVariant:w=`twotone`,delta:T,deltaDirection:E,deltaTone:D,sparkline:O,variant:k=`plain`,size:A=`md`,valueSize:j,inline:M=!1,attention:N=!1,href:P,linkComponent:F,className:I=``,style:L,iconClassName:R=``,labelClassName:z=``,valueClassName:B=``,captionClassName:V=``,deltaClassName:H=``,sparklineClassName:U=``,...W}=_;o(`AppKpiTile`,W),i(`AppKpiTile`,`variant`,k,u),i(`AppKpiTile`,`size`,A,d),i(`AppKpiTile`,`iconTone`,C,f),i(`AppKpiTile`,`iconVariant`,w,p),i(`AppKpiTile`,`deltaDirection`,E,m),i(`AppKpiTile`,`deltaTone`,D,h);let G=`kpi${M?` kpi-inline`:``}${k===`filled`?` kpi-filled`:k===`accent`?` kpi-accent`:k===`spotlight`?` kpi-spotlight`:``}${A===`lg`?` kpi-lg`:A===`sm`?` kpi-sm`:``}${N?` kpi-attention`:``}${I?` ${I}`:``}`,K=typeof j==`number`&&j>0?{...L,"--wui-kpi-value-size":`${j}px`}:L,q=E??v(T),J=q===`up`?`arrow-up`:q===`down`?`arrow-down`:null,Y=Object.hasOwn(g,D??``)?g[D]:``,X=P==null?`div`:F||`a`,Z=P==null?{}:F?{to:P}:{href:P};return/* @__PURE__ */ l(X,{className:G,style:K,...s,...W,...Z,children:[S&&/* @__PURE__ */ c(`span`,{className:`kpi-icon${C?` kpi-icon-${C}`:``}${R?` ${R}`:``}`,children:a(S,{size:20,variant:w})}),/* @__PURE__ */ c(`div`,{className:`kpi-label${z?` ${z}`:``}`,children:y}),/* @__PURE__ */ c(`div`,{className:`kpi-value${B?` ${B}`:``}`,children:b}),x&&/* @__PURE__ */ c(`div`,{className:`kpi-caption${V?` ${V}`:``}`,children:x}),T&&/* @__PURE__ */ l(`div`,{className:`kpi-delta${q===`flat`?``:` ${q}`}${Y}${H?` ${H}`:``}`,children:[J&&/* @__PURE__ */ c(n,{name:J,size:13}),T]}),O&&O.length>0&&/* @__PURE__ */ c(r,{data:O,className:`kpi-sparkline${U?` ${U}`:``}`})]})}export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/fillLabel.js";import{navMatchScore as n}from"../lib/navMatch.js";import{SHELL_FOLDED_COOKIE as r,readNavFolded as i,readShellCollapsed as a,writeNavFolded as o,writeShellCollapsed as s}from"../lib/shellCookie.js";import{splitMarkerProps as c}from"../lib/wuiMarker.js";import l from"./AppAvatar.js";import u from"./AppButton.js";import d from"./AppIcon.js";import f from"./AppNavigationMenu.js";import p from"./assertValidValue.js";import m from"./warnUnknownProps.js";import{initScrollEdges as h,revealActiveNavItem as g}from"@webority/ui-elements/helpers";import{useEffect as _,useId as v,useMemo as y,useRef as b,useState as x}from"react";import{Fragment as S,jsx as C,jsxs as w}from"react/jsx-runtime";var T=99,E=4,D=5,O=/^[a-z0-9-]+$/,k=[`prefix`,`exact`],A=[`comfortable`,`compact`],j=[`neutral`,`primary`],M=[`side`,`top`],N=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],P=/* @__PURE__ */ new Set([`key`,`label`,`icon`,`iconVariant`,`iconSize`,`href`,`badge`,`badgeTone`,`badgeTitle`,`newUntil`,`trailingIcon`,`active`,`match`,`matchAlso`,`tab`,`tabLabel`,`children`]),F=e=>e>T?`${T}+`:String(e),I=new Intl.DateTimeFormat(`en-CA`,{timeZone:`Asia/Kolkata`}),L=e=>{if(typeof e!=`string`||!/^\d{4}-\d{2}-\d{2}$/.test(e))return!1;let t=/* @__PURE__ */ new Date(`${e}T00:00:00Z`);return Number.isNaN(t.getTime())||t.toISOString().slice(0,10)!==e?!1:I.format(/* @__PURE__ */ new Date)<=e},ee=({logoLight:e,logoDark:t,markLight:n,markDark:r})=>{let i=!!(n||r);return[`app-sidebar-brand`,i&&`wui-brand-has-mark`,i&&!e&&!t&&`wui-brand-mark-only`,(t||r)&&`wui-brand-themed`].filter(Boolean).join(` `)},R=({logoLight:e,logoDark:t,markLight:n,markDark:r,brandName:i})=>{let a=i??``,o=[e&&/* @__PURE__ */ C(`img`,{className:`wui-brand-logo wui-brand-light`,src:e,alt:a},`logo-light`),t&&/* @__PURE__ */ C(`img`,{className:`wui-brand-logo wui-brand-dark`,src:t,alt:``,"aria-hidden":`true`},`logo-dark`)],s=[n&&[`mark-light`,`wui-brand-mark wui-brand-light`,n],r&&[`mark-dark`,`wui-brand-mark wui-brand-dark`,r]].filter(Boolean).map(([t,n,r],i)=>i===0&&!e?/* @__PURE__ */ C(`img`,{className:n,src:r,alt:a},t):/* @__PURE__ */ C(`img`,{className:n,src:r,alt:``,"aria-hidden":`true`},t));return[...o,...s].filter(Boolean)};function z(e){let{marker:t,props:n}=c(`AppShell`,e),{groups:l=[],brand:u,logoLight:v,logoDark:S,markLight:T,markDark:E,brandName:D,sidebarStart:O,sidebarStartCompact:k,sidebarFooter:P,topbarStart:F,topbarEnd:I,footer:L,launcher:z,children:ne,collapsed:B,onCollapsedChange:re,noSidebar:V=!1,nav:H=`side`,density:W=`comfortable`,itemHeight:G,iconVariant:K,topbarTone:de=`neutral`,navLabel:fe=`Main navigation`,linkComponent:q,currentPath:pe,rememberCollapsed:me=!1,collapsedCookie:he=`wui-shell-collapsed`,foldedCookie:J=r,tabBarLabel:ge=`Quick navigation`,moreLabel:_e=`More`,skipLabel:ve=`Skip to content`,openNavLabel:ye=`Open navigation`,closeNavLabel:be=`Close navigation`,expandNavLabel:xe=`Expand navigation`,collapseNavLabel:Se=`Collapse navigation`,newLabel:Ce=`New`,togglePagesLabel:we=`Show or hide {name} pages`,accountMenuLabel:Te=`Account menu for {name}`,roleLabel:Ee=`Role:`,rolesLabel:De=`Roles:`,unreadLabel:Oe=`Unread`,markAllReadLabel:ke=`Mark all read`,viewAllLabel:Ae=`View all`,loadingNotificationsText:je=`Loading…`,noUnreadText:Me=`No unread notifications`,unreadNotificationsText:Ne=`{count} unread notifications`,unreadBellLabel:Pe=`{label}, {count} unread`,searchResultsLabel:Fe=`Search results`,noResultsText:Ie=`No results`,noResultsForText:Le=`No results for “{value}”`,resultsCountText:Re=`{count} results`,resultCountText:ze=`{count} result`,userMenu:Be,notifications:Ve,search:He,className:Ue=``,style:We,...Ge}=n;m(`AppShell`,Ge),p(`AppShell`,`density`,W,A),p(`AppShell`,`topbarTone`,de,j),p(`AppShell`,`nav`,H,M),p(`AppShell`,`iconVariant`,K,N);let Ke=G>0?{...We,"--wui-nav-item-height":`${G}px`}:We,[qe,Je]=x(()=>me&&B===void 0&&typeof document<`u`?a(he)??!1:!1),[Y,X]=x(!1),[Ye,Xe]=x(!1),[Ze,Qe]=x(!1),$e=b(null),et=b(null),tt=b(null),Z=B??qe,nt=()=>{let e=!Z;B===void 0&&Je(e),me&&s(e,he),re?.(e)},rt=l.some(e=>e.collapsible),[it,at]=x(()=>rt&&typeof document<`u`?i(J):/* @__PURE__ */ new Set),ot=e=>{let t=new Set(it);t.has(e)?t.delete(e):t.add(e),at(t),o(t,J)},Q=y(()=>te(l,pe),[l,pe]),$=V?null:ie(Q);_(()=>{let e=()=>Xe(window.scrollY>4);return e(),window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)},[]),_(()=>{h()},[]),_(()=>{g($e.current)},[]),_(()=>{let e=$e.current;if(!e)return;let t=()=>Qe(e.scrollHeight>e.clientHeight);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[Q]);let st=!!L;_(()=>{let e=tt.current,t=et.current;if(!st||!e||!t)return;let n=()=>t.style.setProperty(`--app-footer-h`,`${e.offsetHeight}px`);n();let r=typeof ResizeObserver>`u`?null:new ResizeObserver(n);return r?.observe(e),()=>{r?.disconnect(),t.style.removeProperty(`--app-footer-h`)}},[st]),_(()=>{if(!Y)return;let e=e=>{e.key===`Escape`&&X(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[Y]);let ct=[`app-shell`,Z?`collapsed`:``,V?`no-sidebar`:``,H===`top`?`wui-shell-top`:``,Y?`mobile-open`:``,Ue].filter(Boolean).join(` `);return/* @__PURE__ */ w(`div`,{ref:et,className:ct,"data-density":W===`compact`?`compact`:void 0,"data-wui-folded-cookie":rt?J:void 0,style:Ke,...t,...Ge,children:[/* @__PURE__ */ C(`a`,{className:`wui-skip-link`,href:`#main-content`,children:ve}),/* @__PURE__ */ w(`aside`,{className:`app-sidebar`,children:[(u||v||S||T||E)&&/* @__PURE__ */ w(`div`,{className:ee({logoLight:v,logoDark:S,markLight:T,markDark:E}),children:[R({logoLight:v,logoDark:S,markLight:T,markDark:E,brandName:D}),u]}),O&&/* @__PURE__ */ C(`div`,{className:`app-sidebar-start`,children:O}),k&&/* @__PURE__ */ C(`div`,{className:`app-sidebar-start-compact`,children:k}),/* @__PURE__ */ C(`nav`,{className:`app-sidebar-scroll`,"aria-label":fe,ref:$e,tabIndex:Ze?0:void 0,children:Q.map((e,t)=>{let n=e.items.map(e=>e.header==null?/* @__PURE__ */ C(se,{item:e,linkComponent:q,onNavigate:()=>X(!1),iconVariant:K,newLabel:Ce,togglePagesLabel:we},e.key??e.href??e.label):/* @__PURE__ */ C(`div`,{className:`wui-nav-header`,children:e.header},e.key??e.header));if(!e.collapsible)return/* @__PURE__ */ w(`div`,{className:`app-nav-group`,children:[e.label&&/* @__PURE__ */ C(`div`,{className:`app-nav-group-label`,children:e.label}),n,e.after&&/* @__PURE__ */ C(`div`,{className:`wui-nav-group-after`,children:e.after})]},e.key??e.label??`group-${t}`);let r=!it.has(e.key)||!!U(e.items),i=`wui-nav-group-${e.key}`;return/* @__PURE__ */ w(`div`,{className:`app-nav-group wui-nav-group-collapsible${r?``:` wui-nav-group-folded`}`,"data-wui-nav-group":e.key,children:[/* @__PURE__ */ w(`button`,{type:`button`,className:`app-nav-group-label wui-nav-group-toggle`,"aria-expanded":r,"aria-controls":i,onClick:()=>ot(e.key),children:[/* @__PURE__ */ C(`span`,{className:`wui-nav-group-text`,children:e.label}),/* @__PURE__ */ C(`span`,{className:`wui-nav-group-caret`,children:/* @__PURE__ */ C(d,{name:`chevron-down`,size:16})})]}),/* @__PURE__ */ w(`div`,{className:`wui-nav-group-body`,id:i,children:[n,e.after&&/* @__PURE__ */ C(`div`,{className:`wui-nav-group-after`,children:e.after})]})]},e.key??`group-${t}`)})}),P&&/* @__PURE__ */ C(`div`,{className:`app-sidebar-foot`,children:P}),!V&&/* @__PURE__ */ C(`button`,{type:`button`,className:`app-sidebar-toggle`,onClick:nt,"aria-label":Z?xe:Se,"aria-expanded":!Z,children:/* @__PURE__ */ C(d,{name:`chevrons-left`,size:20})})]}),/* @__PURE__ */ w(`div`,{className:`app-main`,children:[/* @__PURE__ */ w(`header`,{className:`app-topbar${Ye?` scrolled`:``}`,"data-tone":de===`primary`?`primary`:void 0,children:[/* @__PURE__ */ w(`div`,{className:`app-topbar-start`,children:[/* @__PURE__ */ C(`button`,{type:`button`,className:`app-topbar-menu`,onClick:()=>X(!0),"aria-label":ye,"aria-expanded":Y,children:/* @__PURE__ */ C(d,{name:`menu`,size:18})}),H===`top`&&u&&/* @__PURE__ */ C(`div`,{className:`wui-shell-top-brand`,children:u}),H===`top`&&/* @__PURE__ */ C(`div`,{className:`wui-shell-top-nav`,children:/* @__PURE__ */ C(f,{items:ae(Q),ariaLabel:fe,linkComponent:q})}),F,He&&/* @__PURE__ */ C(ue,{config:He,searchResultsLabel:Fe,noResultsText:Ie,noResultsForText:Le,resultsCountText:Re,resultCountText:ze})]}),/* @__PURE__ */ w(`div`,{className:`app-topbar-end`,children:[I,Ve&&/* @__PURE__ */ C(le,{config:Ve,unreadLabel:Oe,markAllReadLabel:ke,viewAllLabel:Ae,loadingNotificationsText:je,noUnreadText:Me,unreadNotificationsText:Ne,unreadBellLabel:Pe}),Be&&/* @__PURE__ */ C(ce,{config:Be,linkComponent:q,accountMenuLabel:Te,roleLabel:Ee,rolesLabel:De})]})]}),/* @__PURE__ */ C(`main`,{className:`app-content`,id:`main-content`,children:ne}),L&&/* @__PURE__ */ C(`footer`,{className:`app-footer`,ref:tt,children:L})]}),z&&/* @__PURE__ */ C(`div`,{className:`wui-shell-launcher`,children:z}),$&&/* @__PURE__ */ w(`nav`,{className:`wui-tabbar`,"aria-label":ge,children:[$.tabs.map(e=>/* @__PURE__ */ C(oe,{tab:e,linkComponent:q,iconVariant:K},e.key??e.href)),$.hasMore&&/* @__PURE__ */ w(`button`,{type:`button`,className:`wui-tabbar-item${$.moreActive?` active`:``}`,onClick:()=>X(!0),children:[/* @__PURE__ */ C(`span`,{className:`wui-tabbar-icon`,children:/* @__PURE__ */ C(d,{name:`more`,size:24})}),/* @__PURE__ */ C(`span`,{className:`wui-tabbar-label`,children:_e})]})]}),/* @__PURE__ */ C(`button`,{type:`button`,className:`app-scrim`,onClick:()=>X(!1),"aria-label":be,tabIndex:Y?0:-1})]})}function te(e,t){for(let t of e)t.collapsible&&H(t);let r=(e,t=!1)=>(e??[]).map(e=>Array.isArray(e.children)?{...e,children:r(e.children)}:{...e}).filter(e=>B(e)?t:(e.children?.length??0)>0||!!e.href),i=e.map(e=>({...e,items:re(r(e.items,!0))})).filter(e=>e.items.some(e=>!B(e))),a=[],o=e=>{for(let t of e)B(t)||(a.push(t),t.children&&o(t.children))};for(let e of i)o(e.items);for(let e of a)m(`AppShell items`,ne(e)),p(`AppShell`,`match`,e.match,k),p(`AppShell`,`iconVariant`,e.iconVariant,N);let s=null;if(t!=null&&!a.some(e=>e.active===!0)){let e=-1;for(let r of a){if(r.active!=null||r.children?.length&&!r.href)continue;let i=n(t,r.href,{exact:r.match===`exact`,also:r.matchAlso});if(i<0)continue;let a=r.match===`exact`&&n(t,r.href,{exact:!0})>=0?1/0:i;a>e&&(e=a,s=r)}}for(let e of a)e.active=e.active??e===s;return i}function ne(e){return Object.fromEntries(Object.entries(e).filter(([e])=>!P.has(e)))}var B=e=>e.header!=null;function re(e){return e.filter((t,n)=>{if(!B(t))return!0;let r=e.findIndex((e,t)=>t>n&&B(e));return e.slice(n+1,r<0?void 0:r).length>0})}var V=/* @__PURE__ */ new Set;function H(t){if(t.key!=null&&O.test(t.key))return;let n=t.key==null?`<AppShell> a collapsible group needs a key so its folded state can be remembered.`:`<AppShell> collapsible group key "${t.key}" must use lower-case letters, digits and hyphens.`,r=!0;try{r=process.env.NODE_ENV!==`production`}catch{r=!0}r&&!V.has(n)&&(V.add(n),e(n))}function ie(e){let t=[],n=e=>{for(let r of e)B(r)||(r.children?.length?n(r.children):t.push(r))};for(let t of e)n(t.items);let r=t.filter(e=>e.tab);if(r.length===0)return null;let i=r.length<t.length,a=i?E:D;if(r.length>a)throw Error(`<AppShell>: ${r.length} items carry tab: true, but the phone tab bar holds ${a} (${i?`4 plus More, because other items exist`:`5 when every item is a tab`}). Flag fewer items.`);return{tabs:r,hasMore:i,moreActive:t.some(e=>!e.tab&&e.active)}}function ae(e){let t=e=>({key:e.key??e.href??e.label,label:e.label,to:e.href,current:!!e.active}),n=e=>e.flatMap(e=>B(e)?[]:[...e.href?[{...t(e),icon:e.icon}]:[],...n(e.children??[])]),r=[];for(let i of e.flatMap(e=>e.items)){if(B(i))continue;let e=n(i.children??[]);if(e.length>0){let n=i.href?[{...t(i),icon:i.icon}]:[];r.push({key:t(i).key,label:i.label,links:[...n,...e]})}else i.href&&r.push(t(i))}return r}function oe({tab:e,linkComponent:t,iconVariant:n}){let r=`wui-tabbar-item${e.active?` active`:``}`,i=/* @__PURE__ */ w(S,{children:[e.icon&&/* @__PURE__ */ C(`span`,{className:`wui-tabbar-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ C(d,{name:e.icon,size:24,variant:e.iconVariant??n}):e.icon}),/* @__PURE__ */ C(`span`,{className:`wui-tabbar-label`,children:e.tabLabel??e.label}),e.badge!=null&&/* @__PURE__ */ C(`span`,{className:`wui-tabbar-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge})]}),a=e.active?`page`:void 0;return t?/* @__PURE__ */ C(t,{className:r,to:e.href,"aria-current":a,children:i}):/* @__PURE__ */ C(`a`,{className:r,href:e.href,"aria-current":a,children:i})}function U(e){for(let t of e){if(t.active)return t;let e=t.children?.length?U(t.children):void 0;if(e)return e}}function se({item:e,linkComponent:n,onNavigate:r,depth:i=0,iconVariant:a,newLabel:o,togglePagesLabel:s}){let c=i>0,l=i>1?` wui-nav-depth-${Math.min(i,6)}`:``,u=Array.isArray(e.children)&&e.children.length>0,f=u?U(e.children):void 0,p=!!f,m=f?f.key??f.href??f.label:null,[h,g]=x(p);_(()=>{m!=null&&g(!0)},[m]);let v=typeof e.label==`string`?e.label:void 0,y=!c&&e.icon&&/* @__PURE__ */ C(`span`,{className:`app-nav-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ C(d,{name:e.icon,size:e.iconSize??22,variant:e.iconVariant??a}):e.icon}),b=e.badge!=null&&/* @__PURE__ */ C(`span`,{className:`app-nav-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge}),T=L(e.newUntil)&&/* @__PURE__ */ C(`span`,{className:`wui-nav-new`,children:o}),E=/* @__PURE__ */ w(S,{children:[y,/* @__PURE__ */ C(`span`,{className:`app-nav-text`,children:e.label}),T,b,e.trailingIcon&&/* @__PURE__ */ C(`span`,{className:`app-nav-trailing`,children:typeof e.trailingIcon==`string`?/* @__PURE__ */ C(d,{name:e.trailingIcon,size:16}):e.trailingIcon})]}),D=e.active?`page`:void 0;if(u){let u=/* @__PURE__ */ C(`div`,{className:`app-nav-sub${h?` expanded`:``}`,inert:!h,"aria-hidden":!h||void 0,children:/* @__PURE__ */ C(`div`,{className:`app-nav-sub-inner`,children:e.children.map(e=>/* @__PURE__ */ C(se,{item:e,linkComponent:n,onNavigate:r,depth:i+1,iconVariant:a,newLabel:o,togglePagesLabel:s},e.key??e.href))})});if(e.href){let i=n?/* @__PURE__ */ C(n,{className:`wui-nav-split-link`,to:e.href,"aria-current":D,onClick:r,children:E}):/* @__PURE__ */ C(`a`,{className:`wui-nav-split-link`,href:e.href,"aria-current":D,onClick:r,children:E});return/* @__PURE__ */ w(S,{children:[/* @__PURE__ */ w(`div`,{className:`app-nav-item has-children wui-nav-split${c?` app-nav-subitem`:``}${p||e.active?` active`:``}${l}`,"data-label":v,children:[i,/* @__PURE__ */ C(`button`,{type:`button`,className:`app-nav-caret wui-nav-split-toggle`,"aria-expanded":h,"aria-label":t(s,{name:v??``}),onClick:()=>g(e=>!e),children:/* @__PURE__ */ C(d,{name:`chevron-right`,size:16})})]}),u]})}return/* @__PURE__ */ w(S,{children:[/* @__PURE__ */ w(`button`,{type:`button`,className:`app-nav-item${c?` app-nav-subitem`:``} has-children${p?` active`:``}${l}`,"aria-expanded":h,"data-label":v,onClick:()=>g(e=>!e),children:[y,/* @__PURE__ */ C(`span`,{className:`app-nav-text`,children:e.label}),T,b,/* @__PURE__ */ C(`span`,{className:`app-nav-caret`,children:/* @__PURE__ */ C(d,{name:`chevron-right`,size:16})})]}),u]})}let O=`app-nav-item${c?` app-nav-subitem`:``}${e.active?` active`:``}${l}`;return n?/* @__PURE__ */ C(n,{className:O,to:e.href,"aria-current":D,"data-label":v,onClick:r,children:E}):/* @__PURE__ */ C(`a`,{className:O,href:e.href,"aria-current":D,"data-label":v,onClick:r,children:E})}function W(){let[e,t]=x(!1),n=b(null);return _(()=>{if(!e)return;let r=e=>{n.current?.contains(e.target)||t(!1)},i=e=>{e.key===`Escape`&&(t(!1),n.current?.querySelector(`button`)?.focus())};return document.addEventListener(`mousedown`,r),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`mousedown`,r),document.removeEventListener(`keydown`,i)}},[e]),{open:e,setOpen:t,ref:n}}function ce({config:e,linkComponent:n,accountMenuLabel:r,roleLabel:i,rolesLabel:a}){let o=v(),{open:s,setOpen:c,ref:f}=W(),{name:m,role:h,roles:g=[],photo:_,profileHref:y,profileLabel:b=`My profile`,onLogout:x,logoutAction:T,logoutLabel:E=`Sign out`,head:D,section:O,logoutVariant:k=`item`,items:A=[]}=e;if(p(`AppShell`,`userMenu.logoutVariant`,k,[`item`,`button`]),!m)throw Error(`<AppShell> userMenu.name is required; the trigger and the avatar are named from it.`);let j=g.map(e=>(e??``).trim()).filter(Boolean),M=()=>c(!1),N=(e,t,r,i)=>n?/* @__PURE__ */ C(n,{className:`dropdown-item`,to:e,onClick:i,children:t},r):/* @__PURE__ */ C(`a`,{className:`dropdown-item`,href:e,onClick:i,children:t},r),P=/* @__PURE__ */ C(d,{name:`log-out`,size:18}),F=/* @__PURE__ */ w(S,{children:[P,E]});return/* @__PURE__ */ w(`div`,{className:`dropdown wui-usermenu`,ref:f,children:[/* @__PURE__ */ w(`button`,{type:`button`,id:o,className:`wui-usermenu-trigger`,"aria-expanded":s,"aria-label":t(r,{name:m}),onClick:()=>c(e=>!e),children:[/* @__PURE__ */ C(l,{name:m,src:_,tone:`auto`}),/* @__PURE__ */ w(`span`,{className:`wui-usermenu-text`,children:[/* @__PURE__ */ C(`span`,{className:`wui-usermenu-name`,children:m}),h&&/* @__PURE__ */ C(`span`,{className:`wui-usermenu-role`,children:h})]}),/* @__PURE__ */ C(d,{name:`chevron-down`,size:14,className:`wui-usermenu-caret`})]}),/* @__PURE__ */ w(`div`,{className:`dropdown-menu dropdown-menu-end wui-usermenu-menu${s?` show`:``}`,"aria-labelledby":o,"data-bs-popper":s?`static`:void 0,children:[/* @__PURE__ */ w(`div`,{className:`wui-usermenu-head`,children:[/* @__PURE__ */ C(l,{name:m,src:_,size:`lg`,tone:`auto`}),/* @__PURE__ */ w(`div`,{className:`wui-usermenu-who`,children:[/* @__PURE__ */ C(`div`,{className:`wui-usermenu-name`,children:m}),h&&/* @__PURE__ */ C(`div`,{className:`wui-usermenu-role`,children:h}),j.length>0&&/* @__PURE__ */ w(`div`,{className:`wui-usermenu-roles`,children:[/* @__PURE__ */ C(`span`,{className:`wui-usermenu-roles-label`,children:j.length===1?i:a}),` ${j.join(`, `)}`]}),D?/* @__PURE__ */ C(`div`,{className:`wui-usermenu-extra`,children:D}):null]})]}),O?/* @__PURE__ */ C(`div`,{className:`wui-usermenu-section`,children:O}):null,y&&N(y,/* @__PURE__ */ w(S,{children:[/* @__PURE__ */ C(d,{name:`user`,size:18}),b]}),void 0,M),A.map(e=>{if(e.divider)return/* @__PURE__ */ C(`hr`,{className:`dropdown-divider`},e.key);let t=/* @__PURE__ */ w(S,{children:[e.icon&&/* @__PURE__ */ C(d,{name:e.icon,size:18}),e.label]}),n=()=>{e.onClick?.(),M()};return e.href?N(e.href,t,e.key,n):/* @__PURE__ */ C(`button`,{type:`button`,className:`dropdown-item`,onClick:n,children:t},e.key)}),k===`button`?(T||x)&&/* @__PURE__ */ C(`div`,{className:`wui-usermenu-foot`,children:T?/* @__PURE__ */ C(`form`,{method:`post`,action:T,className:`wui-usermenu-logout`,children:/* @__PURE__ */ C(u,{type:`submit`,tone:`danger`,variant:`soft`,block:!0,leftIcon:P,children:E})}):/* @__PURE__ */ C(u,{type:`button`,tone:`danger`,variant:`soft`,block:!0,leftIcon:P,onClick:()=>{M(),x()},children:E})}):T?/* @__PURE__ */ C(`form`,{method:`post`,action:T,className:`wui-usermenu-logout`,children:/* @__PURE__ */ C(`button`,{type:`submit`,className:`dropdown-item danger`,children:F})}):x&&/* @__PURE__ */ C(`button`,{type:`button`,className:`dropdown-item danger`,onClick:()=>{M(),x()},children:F})]})]})}function le({config:e,unreadLabel:n,markAllReadLabel:r,viewAllLabel:i,loadingNotificationsText:a,noUnreadText:o,unreadNotificationsText:s,unreadBellLabel:c}){let l=v(),{open:u,setOpen:f,ref:p}=W(),{unread:m=0,items:h,loading:g=!1,onOpen:y,onMarkAllRead:T,viewAllHref:E,label:D=`Notifications`,emptyText:O=`You are all caught up.`}=e,[k,A]=x(``),j=b(m);_(()=>{j.current!==m&&(j.current=m,A(m===0?o:t(s,{count:F(m)})))},[m,o,s]);let M=null;return h?.length?M=/* @__PURE__ */ C(`div`,{className:`wui-bell-items`,children:h.map((e,t)=>{let r=`wui-bell-item${e.read?` wui-bell-item-read`:``}`,i=/* @__PURE__ */ w(S,{children:[/* @__PURE__ */ C(`span`,{className:`wui-bell-dot`,"aria-hidden":`true`}),e.icon&&/* @__PURE__ */ C(`span`,{className:`wui-bell-icon`,children:/* @__PURE__ */ C(d,{name:e.icon,size:18})}),/* @__PURE__ */ w(`span`,{className:`wui-bell-body`,children:[!e.read&&/* @__PURE__ */ w(`span`,{className:`visually-hidden`,children:[n,`: `]}),/* @__PURE__ */ C(`span`,{className:`wui-bell-item-title`,children:e.title}),e.time&&/* @__PURE__ */ C(`span`,{className:`wui-bell-when`,children:e.time})]})]});return e.href?/* @__PURE__ */ C(`a`,{className:r,href:e.href,"data-id":e.id,children:i},e.id??t):/* @__PURE__ */ C(`div`,{className:r,"data-id":e.id,children:i},e.id??t)})}):g?M=/* @__PURE__ */ C(`div`,{className:`wui-bell-state`,children:a}):h&&(M=/* @__PURE__ */ C(`div`,{className:`wui-bell-state`,children:O})),/* @__PURE__ */ w(`div`,{className:`dropdown wui-bell`,ref:p,children:[/* @__PURE__ */ w(`button`,{type:`button`,id:l,className:`topbar-icon-btn wui-bell-trigger`,"aria-expanded":u,"aria-label":m===0?D:t(c,{label:D,count:F(m)}),onClick:()=>{let e=!u;f(e),e&&y?.()},children:[/* @__PURE__ */ C(d,{name:`notification`,size:20}),/* @__PURE__ */ C(`span`,{className:`wui-bell-count`,"aria-hidden":`true`,hidden:m===0,children:F(m)})]}),/* @__PURE__ */ C(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:k}),/* @__PURE__ */ w(`div`,{className:`dropdown-menu dropdown-menu-end wui-bell-menu${u?` show`:``}`,"aria-labelledby":l,"data-bs-popper":u?`static`:void 0,children:[/* @__PURE__ */ w(`div`,{className:`wui-bell-head`,children:[/* @__PURE__ */ C(`span`,{className:`wui-bell-title`,children:D}),T&&/* @__PURE__ */ C(`button`,{type:`button`,className:`wui-bell-markall`,onClick:T,children:r})]}),/* @__PURE__ */ C(`div`,{className:`wui-bell-list`,"aria-busy":g||void 0,children:M}),E&&/* @__PURE__ */ C(`a`,{className:`wui-bell-foot`,href:E,children:i})]})]})}var G=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function ue({config:e,searchResultsLabel:n,noResultsText:r,noResultsForText:i,resultsCountText:a,resultCountText:o}){let s=v(),{value:c=``,onChange:l,results:u=null,loading:f=!1,onSelect:p,onSubmit:m,onFocus:h,placeholder:g=`Search`}=e,[S,T]=x(!1),[E,D]=x(!1),[O,k]=x({results:null,index:-1}),A=O.results===u?O.index:-1,j=e=>k({results:u,index:e}),M=b(null),N=b(null),P=b([]),F=y(()=>(u??[]).flatMap(e=>e.hits??[]),[u]),I=u!=null&&!E,L=F.length;_(()=>{let e=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||G(e.target)||(e.preventDefault(),T(!0),N.current?.focus())},t=e=>{M.current?.contains(e.target)||(D(!0),T(!1))};return document.addEventListener(`keydown`,e),document.addEventListener(`pointerdown`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`pointerdown`,t)}},[]);let ee=e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(!I||L===0)return;e.preventDefault(),j((A+(e.key===`ArrowDown`?1:-1)+L)%L)}else e.key===`Enter`?I&&A>=0&&P.current[A]?(e.preventDefault(),P.current[A].click()):m&&c.trim()!==``&&(e.preventDefault(),m(c.trim())):e.key===`Escape`&&(I?(e.preventDefault(),D(!0)):S&&(e.preventDefault(),T(!1)))},R=-1;return P.current=[],/* @__PURE__ */ w(`div`,{className:`wui-topsearch${S?` is-open`:``}${f?` is-loading`:``}`,ref:M,children:[/* @__PURE__ */ C(`button`,{type:`button`,className:`topbar-icon-btn wui-topsearch-open`,"aria-label":g,"aria-expanded":S,"aria-controls":`${s}-panel`,onClick:()=>{let e=!S;T(e),e&&N.current?.focus()},children:/* @__PURE__ */ C(d,{name:`search`,size:20})}),/* @__PURE__ */ w(`div`,{className:`wui-topsearch-panel`,id:`${s}-panel`,children:[/* @__PURE__ */ w(`div`,{className:`search-wrap`,children:[/* @__PURE__ */ C(d,{name:`search`,size:18,className:`search-icon`}),/* @__PURE__ */ C(`input`,{ref:N,type:`search`,className:`form-control input search-input`,id:`${s}-input`,placeholder:g,"aria-label":g,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":I,"aria-controls":`${s}-list`,"aria-activedescendant":I&&A>=0?`${s}-opt-${A}`:void 0,autoComplete:`off`,value:c,onChange:e=>{D(!1),l?.(e.target.value)},onKeyDown:ee,onFocus:h})]}),/* @__PURE__ */ C(`div`,{className:`wui-topsearch-results`,id:`${s}-list`,role:`listbox`,"aria-label":n,hidden:!I,children:I&&/* @__PURE__ */ w(`div`,{className:`wui-topsearch-groups`,role:`presentation`,children:[L===0&&/* @__PURE__ */ C(`div`,{className:`wui-topsearch-empty`,role:`option`,"aria-disabled":`true`,"aria-selected":`false`,children:t(i,{value:c})}),u.filter(e=>e.hits?.length).map((e,t)=>/* @__PURE__ */ w(`div`,{className:`wui-topsearch-group`,role:`group`,"aria-label":e.label??``,children:[e.label&&/* @__PURE__ */ C(`div`,{className:`wui-topsearch-group-label`,role:`presentation`,children:e.label}),e.hits.map(e=>{R+=1;let t=R;return/* @__PURE__ */ w(`a`,{className:`wui-topsearch-hit${t===A?` is-active`:``}`,role:`option`,"aria-selected":t===A,id:`${s}-opt-${t}`,href:e.href,ref:e=>{P.current[t]=e},onClick:t=>p?.(e,t),children:[e.icon&&/* @__PURE__ */ C(`span`,{className:`wui-topsearch-hit-icon`,children:/* @__PURE__ */ C(d,{name:e.icon,size:18})}),/* @__PURE__ */ w(`span`,{className:`wui-topsearch-hit-text`,children:[/* @__PURE__ */ C(`span`,{className:`wui-topsearch-hit-title`,children:e.title}),e.subtitle&&/* @__PURE__ */ C(`span`,{className:`wui-topsearch-hit-sub`,children:e.subtitle})]})]},`${e.href}-${t}`)})]},e.label??t))]})})]}),/* @__PURE__ */ C(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:I?L===0?r:t(L===1?o:a,{count:L}):``})]})}export{z as default};
|
|
1
|
+
import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/fillLabel.js";import{navMatchScore as n}from"../lib/navMatch.js";import{SHELL_FOLDED_COOKIE as r,readNavFolded as i,readShellCollapsed as a,writeNavFolded as o,writeShellCollapsed as s}from"../lib/shellCookie.js";import{splitMarkerProps as c}from"../lib/wuiMarker.js";import l from"./AppAvatar.js";import u from"./AppButton.js";import d from"./AppIcon.js";import f from"./AppNavigationMenu.js";import p from"./assertValidValue.js";import m from"./warnUnknownProps.js";import{initScrollEdges as h,revealActiveNavItem as g}from"@webority/ui-elements/helpers";import{useEffect as _,useId as v,useMemo as y,useRef as b,useState as x}from"react";import{Fragment as S,jsx as C,jsxs as w}from"react/jsx-runtime";var T=99,E=4,D=5,O=/^[a-z0-9-]+$/,k=[`prefix`,`exact`],A=[`comfortable`,`compact`],j=[`neutral`,`primary`],M=[`side`,`top`],N=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],P=/* @__PURE__ */ new Set([`key`,`label`,`icon`,`iconVariant`,`iconSize`,`href`,`badge`,`badgeTone`,`badgeTitle`,`newUntil`,`trailingIcon`,`active`,`match`,`matchAlso`,`tab`,`tabLabel`,`children`]),F=e=>e>T?`${T}+`:String(e),I=new Intl.DateTimeFormat(`en-CA`,{timeZone:`Asia/Kolkata`}),L=e=>{if(typeof e!=`string`||!/^\d{4}-\d{2}-\d{2}$/.test(e))return!1;let t=/* @__PURE__ */ new Date(`${e}T00:00:00Z`);return Number.isNaN(t.getTime())||t.toISOString().slice(0,10)!==e?!1:I.format(/* @__PURE__ */ new Date)<=e},ee=({logoLight:e,logoDark:t,markLight:n,markDark:r})=>{let i=!!(n||r);return[`app-sidebar-brand`,i&&`wui-brand-has-mark`,i&&!e&&!t&&`wui-brand-mark-only`,(t||r)&&`wui-brand-themed`].filter(Boolean).join(` `)},R=({logoLight:e,logoDark:t,markLight:n,markDark:r,brandName:i})=>{let a=i??``,o=[e&&/* @__PURE__ */ C(`img`,{className:`wui-brand-logo wui-brand-light`,src:e,alt:a},`logo-light`),t&&/* @__PURE__ */ C(`img`,{className:`wui-brand-logo wui-brand-dark`,src:t,alt:``,"aria-hidden":`true`},`logo-dark`)],s=[n&&[`mark-light`,`wui-brand-mark wui-brand-light`,n],r&&[`mark-dark`,`wui-brand-mark wui-brand-dark`,r]].filter(Boolean).map(([t,n,r],i)=>i===0&&!e?/* @__PURE__ */ C(`img`,{className:n,src:r,alt:a},t):/* @__PURE__ */ C(`img`,{className:n,src:r,alt:``,"aria-hidden":`true`},t));return[...o,...s].filter(Boolean)};function z(e){let{marker:t,props:n}=c(`AppShell`,e),{groups:l=[],brand:u,logoLight:v,logoDark:S,markLight:T,markDark:E,brandName:D,sidebarStart:O,sidebarStartCompact:k,sidebarFooter:P,topbarStart:F,topbarEnd:I,footer:L,launcher:z,children:ne,collapsed:B,onCollapsedChange:re,noSidebar:V=!1,nav:H=`side`,density:W=`comfortable`,itemHeight:G,iconVariant:K=`twotone`,topbarTone:de=`neutral`,navLabel:fe=`Main navigation`,linkComponent:q,currentPath:pe,rememberCollapsed:me=!1,collapsedCookie:he=`wui-shell-collapsed`,foldedCookie:J=r,tabBarLabel:ge=`Quick navigation`,moreLabel:_e=`More`,skipLabel:ve=`Skip to content`,openNavLabel:ye=`Open navigation`,closeNavLabel:be=`Close navigation`,expandNavLabel:xe=`Expand navigation`,collapseNavLabel:Se=`Collapse navigation`,newLabel:Ce=`New`,togglePagesLabel:we=`Show or hide {name} pages`,accountMenuLabel:Te=`Account menu for {name}`,roleLabel:Ee=`Role:`,rolesLabel:De=`Roles:`,unreadLabel:Oe=`Unread`,markAllReadLabel:ke=`Mark all read`,viewAllLabel:Ae=`View all`,loadingNotificationsText:je=`Loading…`,noUnreadText:Me=`No unread notifications`,unreadNotificationsText:Ne=`{count} unread notifications`,unreadBellLabel:Pe=`{label}, {count} unread`,searchResultsLabel:Fe=`Search results`,noResultsText:Ie=`No results`,noResultsForText:Le=`No results for “{value}”`,resultsCountText:Re=`{count} results`,resultCountText:ze=`{count} result`,userMenu:Be,notifications:Ve,search:He,className:Ue=``,style:We,...Ge}=n;m(`AppShell`,Ge),p(`AppShell`,`density`,W,A),p(`AppShell`,`topbarTone`,de,j),p(`AppShell`,`nav`,H,M),p(`AppShell`,`iconVariant`,K,N);let Ke=G>0?{...We,"--wui-nav-item-height":`${G}px`}:We,[qe,Je]=x(()=>me&&B===void 0&&typeof document<`u`?a(he)??!1:!1),[Y,X]=x(!1),[Ye,Xe]=x(!1),[Ze,Qe]=x(!1),$e=b(null),et=b(null),tt=b(null),Z=B??qe,nt=()=>{let e=!Z;B===void 0&&Je(e),me&&s(e,he),re?.(e)},rt=l.some(e=>e.collapsible),[it,at]=x(()=>rt&&typeof document<`u`?i(J):/* @__PURE__ */ new Set),ot=e=>{let t=new Set(it);t.has(e)?t.delete(e):t.add(e),at(t),o(t,J)},Q=y(()=>te(l,pe),[l,pe]),$=V?null:ie(Q);_(()=>{let e=()=>Xe(window.scrollY>4);return e(),window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)},[]),_(()=>{h()},[]),_(()=>{g($e.current)},[]),_(()=>{let e=$e.current;if(!e)return;let t=()=>Qe(e.scrollHeight>e.clientHeight);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[Q]);let st=!!L;_(()=>{let e=tt.current,t=et.current;if(!st||!e||!t)return;let n=()=>t.style.setProperty(`--app-footer-h`,`${e.offsetHeight}px`);n();let r=typeof ResizeObserver>`u`?null:new ResizeObserver(n);return r?.observe(e),()=>{r?.disconnect(),t.style.removeProperty(`--app-footer-h`)}},[st]),_(()=>{if(!Y)return;let e=e=>{e.key===`Escape`&&X(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[Y]);let ct=[`app-shell`,Z?`collapsed`:``,V?`no-sidebar`:``,H===`top`?`wui-shell-top`:``,Y?`mobile-open`:``,Ue].filter(Boolean).join(` `);return/* @__PURE__ */ w(`div`,{ref:et,className:ct,"data-density":W===`compact`?`compact`:void 0,"data-wui-folded-cookie":rt?J:void 0,style:Ke,...t,...Ge,children:[/* @__PURE__ */ C(`a`,{className:`wui-skip-link`,href:`#main-content`,children:ve}),/* @__PURE__ */ w(`aside`,{className:`app-sidebar`,children:[(u||v||S||T||E)&&/* @__PURE__ */ w(`div`,{className:ee({logoLight:v,logoDark:S,markLight:T,markDark:E}),children:[R({logoLight:v,logoDark:S,markLight:T,markDark:E,brandName:D}),u]}),O&&/* @__PURE__ */ C(`div`,{className:`app-sidebar-start`,children:O}),k&&/* @__PURE__ */ C(`div`,{className:`app-sidebar-start-compact`,children:k}),/* @__PURE__ */ C(`nav`,{className:`app-sidebar-scroll`,"aria-label":fe,ref:$e,tabIndex:Ze?0:void 0,children:Q.map((e,t)=>{let n=e.items.map(e=>e.header==null?/* @__PURE__ */ C(se,{item:e,linkComponent:q,onNavigate:()=>X(!1),iconVariant:K,newLabel:Ce,togglePagesLabel:we},e.key??e.href??e.label):/* @__PURE__ */ C(`div`,{className:`wui-nav-header`,children:e.header},e.key??e.header));if(!e.collapsible)return/* @__PURE__ */ w(`div`,{className:`app-nav-group`,children:[e.label&&/* @__PURE__ */ C(`div`,{className:`app-nav-group-label`,children:e.label}),n,e.after&&/* @__PURE__ */ C(`div`,{className:`wui-nav-group-after`,children:e.after})]},e.key??e.label??`group-${t}`);let r=!it.has(e.key)||!!U(e.items),i=`wui-nav-group-${e.key}`;return/* @__PURE__ */ w(`div`,{className:`app-nav-group wui-nav-group-collapsible${r?``:` wui-nav-group-folded`}`,"data-wui-nav-group":e.key,children:[/* @__PURE__ */ w(`button`,{type:`button`,className:`app-nav-group-label wui-nav-group-toggle`,"aria-expanded":r,"aria-controls":i,onClick:()=>ot(e.key),children:[/* @__PURE__ */ C(`span`,{className:`wui-nav-group-text`,children:e.label}),/* @__PURE__ */ C(`span`,{className:`wui-nav-group-caret`,children:/* @__PURE__ */ C(d,{name:`chevron-down`,size:16})})]}),/* @__PURE__ */ w(`div`,{className:`wui-nav-group-body`,id:i,children:[n,e.after&&/* @__PURE__ */ C(`div`,{className:`wui-nav-group-after`,children:e.after})]})]},e.key??`group-${t}`)})}),P&&/* @__PURE__ */ C(`div`,{className:`app-sidebar-foot`,children:P}),!V&&/* @__PURE__ */ C(`button`,{type:`button`,className:`app-sidebar-toggle`,onClick:nt,"aria-label":Z?xe:Se,"aria-expanded":!Z,children:/* @__PURE__ */ C(d,{name:`chevrons-left`,size:20})})]}),/* @__PURE__ */ w(`div`,{className:`app-main`,children:[/* @__PURE__ */ w(`header`,{className:`app-topbar${Ye?` scrolled`:``}`,"data-tone":de===`primary`?`primary`:void 0,children:[/* @__PURE__ */ w(`div`,{className:`app-topbar-start`,children:[/* @__PURE__ */ C(`button`,{type:`button`,className:`app-topbar-menu`,onClick:()=>X(!0),"aria-label":ye,"aria-expanded":Y,children:/* @__PURE__ */ C(d,{name:`menu`,size:18})}),H===`top`&&u&&/* @__PURE__ */ C(`div`,{className:`wui-shell-top-brand`,children:u}),H===`top`&&/* @__PURE__ */ C(`div`,{className:`wui-shell-top-nav`,children:/* @__PURE__ */ C(f,{items:ae(Q),ariaLabel:fe,linkComponent:q})}),F,He&&/* @__PURE__ */ C(ue,{config:He,searchResultsLabel:Fe,noResultsText:Ie,noResultsForText:Le,resultsCountText:Re,resultCountText:ze})]}),/* @__PURE__ */ w(`div`,{className:`app-topbar-end`,children:[I,Ve&&/* @__PURE__ */ C(le,{config:Ve,unreadLabel:Oe,markAllReadLabel:ke,viewAllLabel:Ae,loadingNotificationsText:je,noUnreadText:Me,unreadNotificationsText:Ne,unreadBellLabel:Pe}),Be&&/* @__PURE__ */ C(ce,{config:Be,linkComponent:q,accountMenuLabel:Te,roleLabel:Ee,rolesLabel:De})]})]}),/* @__PURE__ */ C(`main`,{className:`app-content`,id:`main-content`,children:ne}),L&&/* @__PURE__ */ C(`footer`,{className:`app-footer`,ref:tt,children:L})]}),z&&/* @__PURE__ */ C(`div`,{className:`wui-shell-launcher`,children:z}),$&&/* @__PURE__ */ w(`nav`,{className:`wui-tabbar`,"aria-label":ge,children:[$.tabs.map(e=>/* @__PURE__ */ C(oe,{tab:e,linkComponent:q,iconVariant:K},e.key??e.href)),$.hasMore&&/* @__PURE__ */ w(`button`,{type:`button`,className:`wui-tabbar-item${$.moreActive?` active`:``}`,onClick:()=>X(!0),children:[/* @__PURE__ */ C(`span`,{className:`wui-tabbar-icon`,children:/* @__PURE__ */ C(d,{name:`more`,size:24})}),/* @__PURE__ */ C(`span`,{className:`wui-tabbar-label`,children:_e})]})]}),/* @__PURE__ */ C(`button`,{type:`button`,className:`app-scrim`,onClick:()=>X(!1),"aria-label":be,tabIndex:Y?0:-1})]})}function te(e,t){for(let t of e)t.collapsible&&H(t);let r=(e,t=!1)=>(e??[]).map(e=>Array.isArray(e.children)?{...e,children:r(e.children)}:{...e}).filter(e=>B(e)?t:(e.children?.length??0)>0||!!e.href),i=e.map(e=>({...e,items:re(r(e.items,!0))})).filter(e=>e.items.some(e=>!B(e))),a=[],o=e=>{for(let t of e)B(t)||(a.push(t),t.children&&o(t.children))};for(let e of i)o(e.items);for(let e of a)m(`AppShell items`,ne(e)),p(`AppShell`,`match`,e.match,k),p(`AppShell`,`iconVariant`,e.iconVariant,N);let s=null;if(t!=null&&!a.some(e=>e.active===!0)){let e=-1;for(let r of a){if(r.active!=null||r.children?.length&&!r.href)continue;let i=n(t,r.href,{exact:r.match===`exact`,also:r.matchAlso});if(i<0)continue;let a=r.match===`exact`&&n(t,r.href,{exact:!0})>=0?1/0:i;a>e&&(e=a,s=r)}}for(let e of a)e.active=e.active??e===s;return i}function ne(e){return Object.fromEntries(Object.entries(e).filter(([e])=>!P.has(e)))}var B=e=>e.header!=null;function re(e){return e.filter((t,n)=>{if(!B(t))return!0;let r=e.findIndex((e,t)=>t>n&&B(e));return e.slice(n+1,r<0?void 0:r).length>0})}var V=/* @__PURE__ */ new Set;function H(t){if(t.key!=null&&O.test(t.key))return;let n=t.key==null?`<AppShell> a collapsible group needs a key so its folded state can be remembered.`:`<AppShell> collapsible group key "${t.key}" must use lower-case letters, digits and hyphens.`,r=!0;try{r=process.env.NODE_ENV!==`production`}catch{r=!0}r&&!V.has(n)&&(V.add(n),e(n))}function ie(e){let t=[],n=e=>{for(let r of e)B(r)||(r.children?.length?n(r.children):t.push(r))};for(let t of e)n(t.items);let r=t.filter(e=>e.tab);if(r.length===0)return null;let i=r.length<t.length,a=i?E:D;if(r.length>a)throw Error(`<AppShell>: ${r.length} items carry tab: true, but the phone tab bar holds ${a} (${i?`4 plus More, because other items exist`:`5 when every item is a tab`}). Flag fewer items.`);return{tabs:r,hasMore:i,moreActive:t.some(e=>!e.tab&&e.active)}}function ae(e){let t=e=>({key:e.key??e.href??e.label,label:e.label,to:e.href,current:!!e.active}),n=e=>e.flatMap(e=>B(e)?[]:[...e.href?[{...t(e),icon:e.icon}]:[],...n(e.children??[])]),r=[];for(let i of e.flatMap(e=>e.items)){if(B(i))continue;let e=n(i.children??[]);if(e.length>0){let n=i.href?[{...t(i),icon:i.icon}]:[];r.push({key:t(i).key,label:i.label,links:[...n,...e]})}else i.href&&r.push(t(i))}return r}function oe({tab:e,linkComponent:t,iconVariant:n}){let r=`wui-tabbar-item${e.active?` active`:``}`,i=/* @__PURE__ */ w(S,{children:[e.icon&&/* @__PURE__ */ C(`span`,{className:`wui-tabbar-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ C(d,{name:e.icon,size:24,variant:e.iconVariant??n}):e.icon}),/* @__PURE__ */ C(`span`,{className:`wui-tabbar-label`,children:e.tabLabel??e.label}),e.badge!=null&&/* @__PURE__ */ C(`span`,{className:`wui-tabbar-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge})]}),a=e.active?`page`:void 0;return t?/* @__PURE__ */ C(t,{className:r,to:e.href,"aria-current":a,children:i}):/* @__PURE__ */ C(`a`,{className:r,href:e.href,"aria-current":a,children:i})}function U(e){for(let t of e){if(t.active)return t;let e=t.children?.length?U(t.children):void 0;if(e)return e}}function se({item:e,linkComponent:n,onNavigate:r,depth:i=0,iconVariant:a,newLabel:o,togglePagesLabel:s}){let c=i>0,l=i>1?` wui-nav-depth-${Math.min(i,6)}`:``,u=Array.isArray(e.children)&&e.children.length>0,f=u?U(e.children):void 0,p=!!f,m=f?f.key??f.href??f.label:null,[h,g]=x(p);_(()=>{m!=null&&g(!0)},[m]);let v=typeof e.label==`string`?e.label:void 0,y=!c&&e.icon&&/* @__PURE__ */ C(`span`,{className:`app-nav-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ C(d,{name:e.icon,size:e.iconSize??22,variant:e.iconVariant??a}):e.icon}),b=e.badge!=null&&/* @__PURE__ */ C(`span`,{className:`app-nav-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge}),T=L(e.newUntil)&&/* @__PURE__ */ C(`span`,{className:`wui-nav-new`,children:o}),E=/* @__PURE__ */ w(S,{children:[y,/* @__PURE__ */ C(`span`,{className:`app-nav-text`,children:e.label}),T,b,e.trailingIcon&&/* @__PURE__ */ C(`span`,{className:`app-nav-trailing`,children:typeof e.trailingIcon==`string`?/* @__PURE__ */ C(d,{name:e.trailingIcon,size:16}):e.trailingIcon})]}),D=e.active?`page`:void 0;if(u){let u=/* @__PURE__ */ C(`div`,{className:`app-nav-sub${h?` expanded`:``}`,inert:!h,"aria-hidden":!h||void 0,children:/* @__PURE__ */ C(`div`,{className:`app-nav-sub-inner`,children:e.children.map(e=>/* @__PURE__ */ C(se,{item:e,linkComponent:n,onNavigate:r,depth:i+1,iconVariant:a,newLabel:o,togglePagesLabel:s},e.key??e.href))})});if(e.href){let i=n?/* @__PURE__ */ C(n,{className:`wui-nav-split-link`,to:e.href,"aria-current":D,onClick:r,children:E}):/* @__PURE__ */ C(`a`,{className:`wui-nav-split-link`,href:e.href,"aria-current":D,onClick:r,children:E});return/* @__PURE__ */ w(S,{children:[/* @__PURE__ */ w(`div`,{className:`app-nav-item has-children wui-nav-split${c?` app-nav-subitem`:``}${p||e.active?` active`:``}${l}`,"data-label":v,children:[i,/* @__PURE__ */ C(`button`,{type:`button`,className:`app-nav-caret wui-nav-split-toggle`,"aria-expanded":h,"aria-label":t(s,{name:v??``}),onClick:()=>g(e=>!e),children:/* @__PURE__ */ C(d,{name:`chevron-right`,size:16})})]}),u]})}return/* @__PURE__ */ w(S,{children:[/* @__PURE__ */ w(`button`,{type:`button`,className:`app-nav-item${c?` app-nav-subitem`:``} has-children${p?` active`:``}${l}`,"aria-expanded":h,"data-label":v,onClick:()=>g(e=>!e),children:[y,/* @__PURE__ */ C(`span`,{className:`app-nav-text`,children:e.label}),T,b,/* @__PURE__ */ C(`span`,{className:`app-nav-caret`,children:/* @__PURE__ */ C(d,{name:`chevron-right`,size:16})})]}),u]})}let O=`app-nav-item${c?` app-nav-subitem`:``}${e.active?` active`:``}${l}`;return n?/* @__PURE__ */ C(n,{className:O,to:e.href,"aria-current":D,"data-label":v,onClick:r,children:E}):/* @__PURE__ */ C(`a`,{className:O,href:e.href,"aria-current":D,"data-label":v,onClick:r,children:E})}function W(){let[e,t]=x(!1),n=b(null);return _(()=>{if(!e)return;let r=e=>{n.current?.contains(e.target)||t(!1)},i=e=>{e.key===`Escape`&&(t(!1),n.current?.querySelector(`button`)?.focus())};return document.addEventListener(`mousedown`,r),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`mousedown`,r),document.removeEventListener(`keydown`,i)}},[e]),{open:e,setOpen:t,ref:n}}function ce({config:e,linkComponent:n,accountMenuLabel:r,roleLabel:i,rolesLabel:a}){let o=v(),{open:s,setOpen:c,ref:f}=W(),{name:m,role:h,roles:g=[],photo:_,profileHref:y,profileLabel:b=`My profile`,onLogout:x,logoutAction:T,logoutLabel:E=`Sign out`,head:D,section:O,logoutVariant:k=`item`,items:A=[]}=e;if(p(`AppShell`,`userMenu.logoutVariant`,k,[`item`,`button`]),!m)throw Error(`<AppShell> userMenu.name is required; the trigger and the avatar are named from it.`);let j=g.map(e=>(e??``).trim()).filter(Boolean),M=()=>c(!1),N=(e,t,r,i)=>n?/* @__PURE__ */ C(n,{className:`dropdown-item`,to:e,onClick:i,children:t},r):/* @__PURE__ */ C(`a`,{className:`dropdown-item`,href:e,onClick:i,children:t},r),P=/* @__PURE__ */ C(d,{name:`log-out`,size:18}),F=/* @__PURE__ */ w(S,{children:[P,E]});return/* @__PURE__ */ w(`div`,{className:`dropdown wui-usermenu`,ref:f,children:[/* @__PURE__ */ w(`button`,{type:`button`,id:o,className:`wui-usermenu-trigger`,"aria-expanded":s,"aria-label":t(r,{name:m}),onClick:()=>c(e=>!e),children:[/* @__PURE__ */ C(l,{name:m,src:_,tone:`auto`}),/* @__PURE__ */ w(`span`,{className:`wui-usermenu-text`,children:[/* @__PURE__ */ C(`span`,{className:`wui-usermenu-name`,children:m}),h&&/* @__PURE__ */ C(`span`,{className:`wui-usermenu-role`,children:h})]}),/* @__PURE__ */ C(d,{name:`chevron-down`,size:14,className:`wui-usermenu-caret`})]}),/* @__PURE__ */ w(`div`,{className:`dropdown-menu dropdown-menu-end wui-usermenu-menu${s?` show`:``}`,"aria-labelledby":o,"data-bs-popper":s?`static`:void 0,children:[/* @__PURE__ */ w(`div`,{className:`wui-usermenu-head`,children:[/* @__PURE__ */ C(l,{name:m,src:_,size:`lg`,tone:`auto`}),/* @__PURE__ */ w(`div`,{className:`wui-usermenu-who`,children:[/* @__PURE__ */ C(`div`,{className:`wui-usermenu-name`,children:m}),h&&/* @__PURE__ */ C(`div`,{className:`wui-usermenu-role`,children:h}),j.length>0&&/* @__PURE__ */ w(`div`,{className:`wui-usermenu-roles`,children:[/* @__PURE__ */ C(`span`,{className:`wui-usermenu-roles-label`,children:j.length===1?i:a}),` ${j.join(`, `)}`]}),D?/* @__PURE__ */ C(`div`,{className:`wui-usermenu-extra`,children:D}):null]})]}),O?/* @__PURE__ */ C(`div`,{className:`wui-usermenu-section`,children:O}):null,y&&N(y,/* @__PURE__ */ w(S,{children:[/* @__PURE__ */ C(d,{name:`user`,size:18}),b]}),void 0,M),A.map(e=>{if(e.divider)return/* @__PURE__ */ C(`hr`,{className:`dropdown-divider`},e.key);let t=/* @__PURE__ */ w(S,{children:[e.icon&&/* @__PURE__ */ C(d,{name:e.icon,size:18}),e.label]}),n=()=>{e.onClick?.(),M()};return e.href?N(e.href,t,e.key,n):/* @__PURE__ */ C(`button`,{type:`button`,className:`dropdown-item`,onClick:n,children:t},e.key)}),k===`button`?(T||x)&&/* @__PURE__ */ C(`div`,{className:`wui-usermenu-foot`,children:T?/* @__PURE__ */ C(`form`,{method:`post`,action:T,className:`wui-usermenu-logout`,children:/* @__PURE__ */ C(u,{type:`submit`,tone:`danger`,variant:`soft`,block:!0,leftIcon:P,children:E})}):/* @__PURE__ */ C(u,{type:`button`,tone:`danger`,variant:`soft`,block:!0,leftIcon:P,onClick:()=>{M(),x()},children:E})}):T?/* @__PURE__ */ C(`form`,{method:`post`,action:T,className:`wui-usermenu-logout`,children:/* @__PURE__ */ C(`button`,{type:`submit`,className:`dropdown-item danger`,children:F})}):x&&/* @__PURE__ */ C(`button`,{type:`button`,className:`dropdown-item danger`,onClick:()=>{M(),x()},children:F})]})]})}function le({config:e,unreadLabel:n,markAllReadLabel:r,viewAllLabel:i,loadingNotificationsText:a,noUnreadText:o,unreadNotificationsText:s,unreadBellLabel:c}){let l=v(),{open:u,setOpen:f,ref:p}=W(),{unread:m=0,items:h,loading:g=!1,onOpen:y,onMarkAllRead:T,viewAllHref:E,label:D=`Notifications`,emptyText:O=`You are all caught up.`}=e,[k,A]=x(``),j=b(m);_(()=>{j.current!==m&&(j.current=m,A(m===0?o:t(s,{count:F(m)})))},[m,o,s]);let M=null;return h?.length?M=/* @__PURE__ */ C(`div`,{className:`wui-bell-items`,children:h.map((e,t)=>{let r=`wui-bell-item${e.read?` wui-bell-item-read`:``}`,i=/* @__PURE__ */ w(S,{children:[/* @__PURE__ */ C(`span`,{className:`wui-bell-dot`,"aria-hidden":`true`}),e.icon&&/* @__PURE__ */ C(`span`,{className:`wui-bell-icon`,children:/* @__PURE__ */ C(d,{name:e.icon,size:18})}),/* @__PURE__ */ w(`span`,{className:`wui-bell-body`,children:[!e.read&&/* @__PURE__ */ w(`span`,{className:`visually-hidden`,children:[n,`: `]}),/* @__PURE__ */ C(`span`,{className:`wui-bell-item-title`,children:e.title}),e.time&&/* @__PURE__ */ C(`span`,{className:`wui-bell-when`,children:e.time})]})]});return e.href?/* @__PURE__ */ C(`a`,{className:r,href:e.href,"data-id":e.id,children:i},e.id??t):/* @__PURE__ */ C(`div`,{className:r,"data-id":e.id,children:i},e.id??t)})}):g?M=/* @__PURE__ */ C(`div`,{className:`wui-bell-state`,children:a}):h&&(M=/* @__PURE__ */ C(`div`,{className:`wui-bell-state`,children:O})),/* @__PURE__ */ w(`div`,{className:`dropdown wui-bell`,ref:p,children:[/* @__PURE__ */ w(`button`,{type:`button`,id:l,className:`topbar-icon-btn wui-bell-trigger`,"aria-expanded":u,"aria-label":m===0?D:t(c,{label:D,count:F(m)}),onClick:()=>{let e=!u;f(e),e&&y?.()},children:[/* @__PURE__ */ C(d,{name:`notification`,size:20}),/* @__PURE__ */ C(`span`,{className:`wui-bell-count`,"aria-hidden":`true`,hidden:m===0,children:F(m)})]}),/* @__PURE__ */ C(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:k}),/* @__PURE__ */ w(`div`,{className:`dropdown-menu dropdown-menu-end wui-bell-menu${u?` show`:``}`,"aria-labelledby":l,"data-bs-popper":u?`static`:void 0,children:[/* @__PURE__ */ w(`div`,{className:`wui-bell-head`,children:[/* @__PURE__ */ C(`span`,{className:`wui-bell-title`,children:D}),T&&/* @__PURE__ */ C(`button`,{type:`button`,className:`wui-bell-markall`,onClick:T,children:r})]}),/* @__PURE__ */ C(`div`,{className:`wui-bell-list`,"aria-busy":g||void 0,children:M}),E&&/* @__PURE__ */ C(`a`,{className:`wui-bell-foot`,href:E,children:i})]})]})}var G=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function ue({config:e,searchResultsLabel:n,noResultsText:r,noResultsForText:i,resultsCountText:a,resultCountText:o}){let s=v(),{value:c=``,onChange:l,results:u=null,loading:f=!1,onSelect:p,onSubmit:m,onFocus:h,placeholder:g=`Search`}=e,[S,T]=x(!1),[E,D]=x(!1),[O,k]=x({results:null,index:-1}),A=O.results===u?O.index:-1,j=e=>k({results:u,index:e}),M=b(null),N=b(null),P=b([]),F=y(()=>(u??[]).flatMap(e=>e.hits??[]),[u]),I=u!=null&&!E,L=F.length;_(()=>{let e=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||G(e.target)||(e.preventDefault(),T(!0),N.current?.focus())},t=e=>{M.current?.contains(e.target)||(D(!0),T(!1))};return document.addEventListener(`keydown`,e),document.addEventListener(`pointerdown`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`pointerdown`,t)}},[]);let ee=e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(!I||L===0)return;e.preventDefault(),j((A+(e.key===`ArrowDown`?1:-1)+L)%L)}else e.key===`Enter`?I&&A>=0&&P.current[A]?(e.preventDefault(),P.current[A].click()):m&&c.trim()!==``&&(e.preventDefault(),m(c.trim())):e.key===`Escape`&&(I?(e.preventDefault(),D(!0)):S&&(e.preventDefault(),T(!1)))},R=-1;return P.current=[],/* @__PURE__ */ w(`div`,{className:`wui-topsearch${S?` is-open`:``}${f?` is-loading`:``}`,ref:M,children:[/* @__PURE__ */ C(`button`,{type:`button`,className:`topbar-icon-btn wui-topsearch-open`,"aria-label":g,"aria-expanded":S,"aria-controls":`${s}-panel`,onClick:()=>{let e=!S;T(e),e&&N.current?.focus()},children:/* @__PURE__ */ C(d,{name:`search`,size:20})}),/* @__PURE__ */ w(`div`,{className:`wui-topsearch-panel`,id:`${s}-panel`,children:[/* @__PURE__ */ w(`div`,{className:`search-wrap`,children:[/* @__PURE__ */ C(d,{name:`search`,size:18,className:`search-icon`}),/* @__PURE__ */ C(`input`,{ref:N,type:`search`,className:`form-control input search-input`,id:`${s}-input`,placeholder:g,"aria-label":g,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":I,"aria-controls":`${s}-list`,"aria-activedescendant":I&&A>=0?`${s}-opt-${A}`:void 0,autoComplete:`off`,value:c,onChange:e=>{D(!1),l?.(e.target.value)},onKeyDown:ee,onFocus:h})]}),/* @__PURE__ */ C(`div`,{className:`wui-topsearch-results`,id:`${s}-list`,role:`listbox`,"aria-label":n,hidden:!I,children:I&&/* @__PURE__ */ w(`div`,{className:`wui-topsearch-groups`,role:`presentation`,children:[L===0&&/* @__PURE__ */ C(`div`,{className:`wui-topsearch-empty`,role:`option`,"aria-disabled":`true`,"aria-selected":`false`,children:t(i,{value:c})}),u.filter(e=>e.hits?.length).map((e,t)=>/* @__PURE__ */ w(`div`,{className:`wui-topsearch-group`,role:`group`,"aria-label":e.label??``,children:[e.label&&/* @__PURE__ */ C(`div`,{className:`wui-topsearch-group-label`,role:`presentation`,children:e.label}),e.hits.map(e=>{R+=1;let t=R;return/* @__PURE__ */ w(`a`,{className:`wui-topsearch-hit${t===A?` is-active`:``}`,role:`option`,"aria-selected":t===A,id:`${s}-opt-${t}`,href:e.href,ref:e=>{P.current[t]=e},onClick:t=>p?.(e,t),children:[e.icon&&/* @__PURE__ */ C(`span`,{className:`wui-topsearch-hit-icon`,children:/* @__PURE__ */ C(d,{name:e.icon,size:18})}),/* @__PURE__ */ w(`span`,{className:`wui-topsearch-hit-text`,children:[/* @__PURE__ */ C(`span`,{className:`wui-topsearch-hit-title`,children:e.title}),e.subtitle&&/* @__PURE__ */ C(`span`,{className:`wui-topsearch-hit-sub`,children:e.subtitle})]})]},`${e.href}-${t}`)})]},e.label??t))]})})]}),/* @__PURE__ */ C(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:I?L===0?r:t(L===1?o:a,{count:L}):``})]})}export{z as default};
|
package/dist/guidance.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CITATION_RUN as e}from"./citations.js";var t=/* @__PURE__ */ new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`),n=/\[([^\]\n]+)\]\(((?:[^()\s]|\([^()\s]*\))+)\)/y,r=/!\[([^\]\n]*)\]\(((?:[^()\s]|\([^()\s]*\))+)\)/y,i=new RegExp(e.source,`y`),a=e=>/[\p{L}\p{N}]/u.test(e);function o(e,t){let n=0;for(let r=t-1;r>=0&&e.charAt(r)===`\\`;--r)n+=1;return n%2==1}function s(e,t,n){let r=n.length===1;for(let i=e.indexOf(n,t);i!==-1;i=e.indexOf(n,i+1)){let s=i>t&&!/\s/.test(e.charAt(t))&&!/\s/.test(e.charAt(i-1)),c=r&&(e.charAt(i+1)===n||e.charAt(i-1)===n),l=n===`_`&&a(e.charAt(i+n.length));if(s&&!c&&!l&&!o(e,i))return i}return-1}function c(e,o){let l=o?.isCitation,u=[],d=``,f=()=>{d&&=(u.push({type:`text`,text:d}),``)},p=0;for(;p<e.length;){let m=e.charAt(p),h=e.charAt(p+1);if(m===`\\`&&t.has(h)){d+=h,p+=2;continue}if(m==="`"){let t=e.indexOf("`",p+1);if(t>p+1){f(),u.push({type:`code`,text:e.slice(p+1,t)}),p=t+1;continue}}let g=m+h;if(g===`**`||g===`__`||g===`~~`){let t=s(e,p+2,g);if(t!==-1&&!(g===`__`&&a(e.charAt(p-1)))){f();let n=c(e.slice(p+2,t),o);g===`~~`?u.push({type:`strike`,children:n}):u.push({type:`strong`,children:n}),p=t+2;continue}d+=g,p+=2}else{if(m===`*`||m===`_`){let t=s(e,p+1,m);if(t!==-1&&!(m===`_`&&a(e.charAt(p-1)))){f(),u.push({type:`em`,children:c(e.slice(p+1,t),o)}),p=t+1;continue}}if(m===`[`){n.lastIndex=p;let t=n.exec(e);if(t){f(),u.push({type:`link`,href:
|
|
1
|
+
import{CITATION_RUN as e}from"./citations.js";var t=/* @__PURE__ */ new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`),n=/\[([^\]\n]+)\]\(((?:[^()\s]|\([^()\s]*\))+)\)/y,r=/!\[([^\]\n]*)\]\(((?:[^()\s]|\([^()\s]*\))+)\)/y,i=new RegExp(e.source,`y`),a=e=>/[\p{L}\p{N}]/u.test(e);function o(e,t){let n=0;for(let r=t-1;r>=0&&e.charAt(r)===`\\`;--r)n+=1;return n%2==1}function s(e,t,n){let r=n.length===1;for(let i=e.indexOf(n,t);i!==-1;i=e.indexOf(n,i+1)){let s=i>t&&!/\s/.test(e.charAt(t))&&!/\s/.test(e.charAt(i-1)),c=r&&(e.charAt(i+1)===n||e.charAt(i-1)===n),l=n===`_`&&a(e.charAt(i+n.length));if(s&&!c&&!l&&!o(e,i))return i}return-1}function c(e,o){let l=o?.isCitation,u=[],d=``,f=()=>{d&&=(u.push({type:`text`,text:d}),``)},p=0;for(;p<e.length;){let m=e.charAt(p),h=e.charAt(p+1);if(m===`\\`&&t.has(h)){d+=h,p+=2;continue}if(m==="`"){let t=e.indexOf("`",p+1);if(t>p+1){f(),u.push({type:`code`,text:e.slice(p+1,t)}),p=t+1;continue}}let g=m+h;if(g===`**`||g===`__`||g===`~~`){let t=s(e,p+2,g);if(t!==-1&&!(g===`__`&&a(e.charAt(p-1)))){f();let n=c(e.slice(p+2,t),o);g===`~~`?u.push({type:`strike`,children:n}):u.push({type:`strong`,children:n}),p=t+2;continue}d+=g,p+=2}else{if(m===`*`||m===`_`){let t=s(e,p+1,m);if(t!==-1&&!(m===`_`&&a(e.charAt(p-1)))){f(),u.push({type:`em`,children:c(e.slice(p+1,t),o)}),p=t+1;continue}}if(m===`[`){n.lastIndex=p;let t=n.exec(e);if(t){let e=t[1],n=t[2];if(e===void 0||n===void 0)throw Error(`The link pattern always captures its label and href`);f(),u.push({type:`link`,href:n,children:c(e)}),p+=t[0].length;continue}if(l){i.lastIndex=p;let t=i.exec(e);if(t){let e=t[1];if(e===void 0)throw Error(`The citation pattern always captures its inner text`);if(l(e)){f(),u.push({type:`citation`,text:e}),p+=t[0].length;continue}}}}if(m===`!`){r.lastIndex=p;let t=r.exec(e);if(t){let e=t[1];if(e===void 0)throw Error(`The image pattern always captures its alt text`);f(),u.push({type:`image`,children:c(e)}),p+=t[0].length;continue}}d+=m,p+=1}}return f(),u.map((e,t)=>({...e,key:t}))}export{c as parseInline};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var e=/^\s*```/,t=/^\s*```\s*(\S*)/,n=/^\s{0,3}(#{1,6})\s+(.*?)(?:\s+#+)?\s*$/,r=/^\s*([-*_])(\s*\1){2,}\s*$/,i=/^(\s*)[-*+]\s+(.*)$/,a=/^(\s*)(\d{1,9})[.)]\s+(.*)$/,o=/^\s*>\s?(.*)$/,s=/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)*\|?\s*$/,c=e=>e.includes(`|`);function l(e){let t=e.trim();return t.startsWith(`|`)&&(t=t.slice(1)),t.endsWith(`|`)&&(t=t.slice(0,-1)),t.split(`|`).map(e=>e.trim())}function u(e,t){
|
|
1
|
+
var e=/^\s*```/,t=/^\s*```\s*(\S*)/,n=/^\s{0,3}(#{1,6})\s+(.*?)(?:\s+#+)?\s*$/,r=/^\s*([-*_])(\s*\1){2,}\s*$/,i=/^(\s*)[-*+]\s+(.*)$/,a=/^(\s*)(\d{1,9})[.)]\s+(.*)$/,o=/^\s*>\s?(.*)$/,s=/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)*\|?\s*$/,c=e=>e.includes(`|`);function l(e){let t=e.trim();return t.startsWith(`|`)&&(t=t.slice(1)),t.endsWith(`|`)&&(t=t.slice(0,-1)),t.split(`|`).map(e=>e.trim())}function u(e,t){let n=e[t];if(n===void 0)throw Error(`startsTable was called past the last source line`);let r=e[t+1];return r!==void 0&&c(n)&&r.includes(`|`)&&s.test(r)}function d(t,s){let c=t[s];if(c===void 0)throw Error(`startsBlock was called past the last source line`);return e.test(c)||o.test(c)||i.test(c)||a.test(c)||n.test(c)||r.test(c)||u(t,s)}function f(e){let t=e.replace(/\t/g,` `).length;return Math.min(Math.floor(t/2),4)}function p(e){let t=a.exec(e);if(t){let e=t[1],n=t[2],r=t[3];if(e===void 0||n===void 0||r===void 0)throw Error(`The ordered list pattern always captures its indent, number and text`);return{text:r,depth:f(e),ordered:!0,number:Number(n)}}let n=i.exec(e);if(n){let e=n[1],t=n[2];if(e===void 0||t===void 0)throw Error(`The bullet list pattern always captures its indent and text`);return{text:t,depth:f(e),ordered:!1,number:0}}return null}function m(i){let a=(i??``).replace(/\r\n?/g,`
|
|
2
2
|
`).split(`
|
|
3
|
-
`),s=[],f=0;for(;f<a.length;){let i=a[f];if(!i.trim()){f+=1;continue}if(e.test(i)){let n=t.exec(i)?.[1]||null,r=[];for(f+=1;f<a.length
|
|
4
|
-
`),language:n});continue}if(u(a,f)){let e=l(i),t=[];for(f+=2;f<a.length
|
|
3
|
+
`),s=[],f=0;for(;f<a.length;){let i=a[f];if(i===void 0)throw Error(`parseMarkdown read past the last source line`);if(!i.trim()){f+=1;continue}if(e.test(i)){let n=t.exec(i)?.[1]||null,r=[];for(f+=1;f<a.length;){let t=a[f];if(t===void 0)throw Error(`parseMarkdown read past the last source line`);if(e.test(t))break;r.push(t),f+=1}f+=1,s.push({type:`code`,text:r.join(`
|
|
4
|
+
`),language:n});continue}if(u(a,f)){let e=l(i),t=[];for(f+=2;f<a.length;){let e=a[f];if(e===void 0)throw Error(`parseMarkdown read past the last source line`);if(!e.trim()||!c(e))break;t.push(l(e)),f+=1}s.push({type:`table`,header:e,rows:t});continue}if(r.test(i)){s.push({type:`rule`}),f+=1;continue}let m=n.exec(i);if(m){let e=m[1],t=m[2];if(e===void 0||t===void 0)throw Error(`The heading pattern always captures its hashes and text`);s.push({type:`heading`,level:e.length,text:t}),f+=1;continue}if(o.test(i)){let e=[];for(;f<a.length;){let t=a[f];if(t===void 0)throw Error(`parseMarkdown read past the last source line`);let n=o.exec(t);if(!n)break;let r=n[1];if(r===void 0)throw Error(`The quote pattern always captures its text`);e.push(r),f+=1}s.push({type:`quote`,lines:e});continue}let h=p(i);if(h){let e=[];for(;f<a.length;){let t=a[f];if(t===void 0)throw Error(`parseMarkdown read past the last source line`);if(!t.trim())break;let n=p(t);if(n){if(n.depth===0&&n.ordered!==h.ordered)break;e.push(n)}else if(d(a,f))break;else{let n=e[e.length-1];if(n===void 0)throw Error(`A list continuation line follows a list with no item`);n.text+=` ${t.trim()}`}f+=1}s.push({type:`list`,ordered:h.ordered,start:h.ordered?h.number:1,items:e});continue}let g=[i];for(f+=1;f<a.length;){let e=a[f];if(e===void 0)throw Error(`parseMarkdown read past the last source line`);if(!e.trim()||d(a,f))break;g.push(e),f+=1}s.push({type:`paragraph`,lines:g})}return s.map((e,t)=>({...e,key:t}))}export{m as parseMarkdown};
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
* @param {string|import('react').ReactNode} [props.avatar]
|
|
20
20
|
* @param {() => void} [props.onRemove] Present → shows the dismiss ✕.
|
|
21
21
|
* @param {() => void} [props.onClick] Present → the chip body is clickable.
|
|
22
|
+
* @param {boolean} [props.selected] With onClick: true marks the chip as the chosen filter (aria-pressed). Needs onClick.
|
|
23
|
+
* @param {number|import('react').ReactNode} [props.count] A count shown after the label, such as a filter's result count.
|
|
22
24
|
* @param {boolean} [props.disabled]
|
|
23
25
|
* @param {string} [props.removeLabel]
|
|
24
26
|
* @param {string} [props.className]
|
|
@@ -48,6 +50,10 @@ export default function AppChip(props: {
|
|
|
48
50
|
avatar?: string | import('react').ReactNode;
|
|
49
51
|
onRemove?: () => void;
|
|
50
52
|
onClick?: () => void;
|
|
53
|
+
/** With onClick, true marks the chip as the chosen filter (its button carries aria-pressed). Needs onClick; a chip that is not clickable refuses it. */
|
|
54
|
+
selected?: boolean;
|
|
55
|
+
/** A count shown after the label, such as a filter's result count. */
|
|
56
|
+
count?: number | import('react').ReactNode;
|
|
51
57
|
/**
|
|
52
58
|
* Dims the chip and stops it from being pressed.
|
|
53
59
|
* @default false
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @param {import('react').ReactNode} [props.caption]
|
|
9
9
|
* @param {string|import('react').ReactNode} [props.icon]
|
|
10
10
|
* @param {'primary'|'success'|'warning'|'danger'|'info'|'neutral'} [props.iconTone]
|
|
11
|
-
* @param {'linear'|'outline'|'bold'|'bulk'|'broken'|'twotone'} [props.iconVariant]
|
|
11
|
+
* @param {'linear'|'outline'|'bold'|'bulk'|'broken'|'twotone'} [props.iconVariant='twotone']
|
|
12
12
|
* @param {import('react').ReactNode} [props.delta]
|
|
13
13
|
* @param {'up'|'down'|'flat'} [props.deltaDirection]
|
|
14
14
|
* @param {'success'|'danger'|'neutral'} [props.deltaTone]
|
|
@@ -43,7 +43,7 @@ export default function AppKpiTile(props: {
|
|
|
43
43
|
iconTone?: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'neutral';
|
|
44
44
|
/**
|
|
45
45
|
* The icon style of a named icon; a node icon is drawn as given.
|
|
46
|
-
* @default "
|
|
46
|
+
* @default "twotone"
|
|
47
47
|
*/
|
|
48
48
|
iconVariant?: 'linear' | 'outline' | 'bold' | 'bulk' | 'broken' | 'twotone';
|
|
49
49
|
/** The change text, such as 12% vs last month. */
|
|
@@ -235,7 +235,7 @@ export type SearchShape = {
|
|
|
235
235
|
* @param {'side'|'top'} [props.nav] 'top': from lg up the groups' items ride in the top bar after brand through the navigation menu and no sidebar is drawn; below lg the drawer and the phone tab bar stay.
|
|
236
236
|
* @param {'comfortable'|'compact'} [props.density]
|
|
237
237
|
* @param {number} [props.itemHeight]
|
|
238
|
-
* @param {'linear'|'outline'|'bold'|'bulk'|'broken'|'twotone'} [props.iconVariant]
|
|
238
|
+
* @param {'linear'|'outline'|'bold'|'bulk'|'broken'|'twotone'} [props.iconVariant='twotone']
|
|
239
239
|
* @param {'neutral'|'primary'} [props.topbarTone]
|
|
240
240
|
* @param {string} [props.navLabel]
|
|
241
241
|
* @param {string} [props.currentPath]
|
|
@@ -330,7 +330,10 @@ export default function AppShell(props: {
|
|
|
330
330
|
density?: 'comfortable' | 'compact';
|
|
331
331
|
/** The height of every sidebar row in px, in place of the density's row height. Unset, the rows keep the density's height. A value above zero applies on every pointer, touch included. */
|
|
332
332
|
itemHeight?: number;
|
|
333
|
-
/**
|
|
333
|
+
/**
|
|
334
|
+
* The iconsax style of every sidebar icon. A row's own iconVariant overrides it; bulk is the filled look. Unset, icons draw in the twotone style.
|
|
335
|
+
* @default "twotone"
|
|
336
|
+
*/
|
|
334
337
|
iconVariant?: 'linear' | 'outline' | 'bold' | 'bulk' | 'broken' | 'twotone';
|
|
335
338
|
/**
|
|
336
339
|
* The top bar's colour. Primary paints the bar in the primary colour, with the ink that reads on it. The search field keeps its own surface.
|
|
@@ -5,7 +5,7 @@ export declare const SECTION_TITLE_FONTS: string[];
|
|
|
5
5
|
/** The heading tag for the section title: `as` when it is a heading, otherwise the section's default. */
|
|
6
6
|
export declare function sectionHeading(as: any, fallback: any): any;
|
|
7
7
|
/** The level under a section title, for an item's title (h2 gives h3; h6 stays h6). */
|
|
8
|
-
export declare function itemHeading(heading: any): string;
|
|
8
|
+
export declare function itemHeading(heading: any): string | undefined;
|
|
9
9
|
/**
|
|
10
10
|
* The `<img>` the kit writes itself (logos, avatars), byte-in-step with Razor's SectionMarkup.Image.
|
|
11
11
|
* Width and height are always set so the browser reserves the box before the file arrives.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.147.0",
|
|
4
4
|
"description": "Webority shared React component library — App* primitives on react-bootstrap + the @webority/theme design system.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
},
|
|
30
30
|
"sideEffects": false,
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@webority/markdown-core": "0.
|
|
33
|
-
"@webority/theme": "0.
|
|
34
|
-
"@webority/ui-elements": "0.
|
|
35
|
-
"@webority/web-core": "0.
|
|
32
|
+
"@webority/markdown-core": "0.147.0",
|
|
33
|
+
"@webority/theme": "0.147.0",
|
|
34
|
+
"@webority/ui-elements": "0.147.0",
|
|
35
|
+
"@webority/web-core": "0.147.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@webority/analytics": "^0.36.0",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"@vitejs/plugin-react": "^6.0.1",
|
|
51
51
|
"@vitest/coverage-v8": "5.0.1",
|
|
52
52
|
"@webority/analytics": "0.36.1",
|
|
53
|
-
"@webority/canvas-kit": "0.
|
|
54
|
-
"@webority/tokens": "0.
|
|
53
|
+
"@webority/canvas-kit": "0.147.0",
|
|
54
|
+
"@webority/tokens": "0.147.0",
|
|
55
55
|
"bootstrap": "5.3.3",
|
|
56
56
|
"jsdom": "30.1.1",
|
|
57
57
|
"react": "^19.2.6",
|