@telia-ace/knowledge-widget-ui 1.1.2 → 1.1.3

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.
@@ -31,6 +31,7 @@ export type Props = {
31
31
  dispatch?: DispatchAction;
32
32
  localPaging?: boolean;
33
33
  expandable?: boolean;
34
+ searchResultsEmptyLabel?: string;
34
35
  onItemClick?: (e: React.MouseEvent, guide: Guide) => void;
35
36
  } & any;
36
37
  export declare const AccordionListItem: React.ForwardRefExoticComponent<{
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),s=require("@telia-ace/widget-ui"),v=require("@telia-ace/widget-utilities"),d=require("@emotion/styled"),u=require("react"),y=require("@emotion/react"),P=({title:e="",className:t,id:a,parent:o,connection:i,type:r,target:l,href:h,children:c,connectionKey:m})=>{const p={},{name:f,params:g}=s.useRouteData();switch(r){case"default":case"guide":const{id:w,title:$}=o;let b=m||i;w!==a&&!m&&(b=void 0),p.routeName=f,p.params=v.createParams({...g,guide:a,connection:b,uriName:a===w?v.formatUrl($):v.formatUrl(e)});break;case"link":p.href=h,p.target=l;break}return n.jsx(s.Link,{className:v.appendClassNames(t,"humany-dialog-link"),...p,children:c||n.jsxs(n.Fragment,{children:[r==="link"&&n.jsx(s.Icon,{faIcon:"link"}),n.jsx("span",{children:e})]})})},he=u.forwardRef(({className:e,dialog:t,...a},o)=>t.length?n.jsx(ue,{className:v.appendClassNames(e,"humany-dialog"),items:t,renderItem:i=>n.jsx("li",{"data-dialog":i.connection,children:n.jsx(P,{...i})},i.connection),...a,ref:o}):null),ue=d(s.List)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),s=require("@telia-ace/widget-ui"),v=require("@telia-ace/widget-utilities"),d=require("@emotion/styled"),u=require("react"),y=require("@emotion/react"),P=({title:e="",className:t,id:a,parent:o,connection:i,type:r,target:l,href:h,children:c,connectionKey:m})=>{const p={},{name:f,params:g}=s.useRouteData();switch(r){case"default":case"guide":const{id:w,title:b}=o;let $=m||i;w!==a&&!m&&($=void 0),p.routeName=f,p.params=v.createParams({...g,guide:a,connection:$,uriName:a===w?v.formatUrl(b):v.formatUrl(e)});break;case"link":p.href=h,p.target=l;break}return n.jsx(s.Link,{className:v.appendClassNames(t,"humany-dialog-link"),...p,children:c||n.jsxs(n.Fragment,{children:[r==="link"&&n.jsx(s.Icon,{faIcon:"link"}),n.jsx("span",{children:e})]})})},ue=u.forwardRef(({className:e,dialog:t,...a},o)=>t.length?n.jsx(fe,{className:v.appendClassNames(e,"humany-dialog"),items:t,renderItem:i=>n.jsx("li",{"data-dialog":i.connection,children:n.jsx(P,{...i})},i.connection),...a,ref:o}):null),fe=d(s.List)`
2
2
  ${s.list}
3
3
  a {
4
4
  min-width: 150px;
@@ -11,7 +11,7 @@
11
11
  i {
12
12
  margin: 0 ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.small}} 0 0;
13
13
  }
14
- `,fe=({trigger:e,header:t,className:a,animation:o,fullScreen:i,onToggle:r,children:l,ref:h,closeButtonAriaLabel:c,...m})=>n.jsx(s.Drawer,{className:v.appendClassNames(a,"humany-drawer-list"),trigger:e,header:t,animation:o,fullScreen:i,onToggle:r,closeButtonAriaLabel:c,children:n.jsx(ge,{...m,children:l})}),ge=d(s.ItemList)`
14
+ `,ge=({trigger:e,header:t,className:a,animation:o,fullScreen:i,onToggle:r,children:l,ref:h,closeButtonAriaLabel:c,...m})=>n.jsx(s.Drawer,{className:v.appendClassNames(a,"humany-drawer-list"),trigger:e,header:t,animation:o,fullScreen:i,onToggle:r,closeButtonAriaLabel:c,children:n.jsx(pe,{...m,children:l})}),pe=d(s.ItemList)`
15
15
  ${s.itemList}
16
16
  font-family: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.type}};
17
17
  padding: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.medium}};
@@ -20,13 +20,13 @@
20
20
  font-weight: 300;
21
21
  font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
22
22
  }
23
- `,pe=({items:e,renderItem:t,trigger:a,header:o,children:i})=>n.jsx(s.Dropdown,{className:"humany-dropdown-actions",trigger:a,children:n.jsxs(xe,{children:[!!o&&n.jsx(ye,{children:o}),e&&t&&n.jsx(ve,{items:e,renderItem:t}),i]})}),xe=d.div`
23
+ `,xe=({items:e,renderItem:t,trigger:a,header:o,children:i})=>n.jsx(s.Dropdown,{className:"humany-dropdown-actions",trigger:a,children:n.jsxs(ye,{children:[!!o&&n.jsx(ve,{children:o}),e&&t&&n.jsx($e,{items:e,renderItem:t}),i]})}),ye=d.div`
24
24
  background: #fff;
25
25
  border: #ccc 1px solid;
26
26
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
27
27
  font-family: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.type}};
28
28
  font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
29
- `,ye=d.div`
29
+ `,ve=d.div`
30
30
  padding: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.normal}};
31
31
  padding-bottom: 0;
32
32
  font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
@@ -50,7 +50,7 @@
50
50
  i {
51
51
  margin-right: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.small}};
52
52
  }
53
- `,ve=d(s.List)`
53
+ `,$e=d(s.List)`
54
54
  list-style: none;
55
55
  padding: 0;
56
56
  margin: 0;
@@ -73,7 +73,7 @@
73
73
  }
74
74
  }
75
75
  }
76
- `,$e=({trigger:e,className:t,children:a,closeButtonAriaLabel:o,...i})=>n.jsx(s.Dropdown,{className:v.appendClassNames(t,"humany-dropdown-list"),closeButtonAriaLabel:o,trigger:e,children:n.jsx(be,{...i,children:a})}),be=d(s.ItemList)`
76
+ `,be=({trigger:e,className:t,children:a,closeButtonAriaLabel:o,...i})=>n.jsx(s.Dropdown,{className:v.appendClassNames(t,"humany-dropdown-list"),closeButtonAriaLabel:o,trigger:e,children:n.jsx(we,{...i,children:a})}),we=d(s.ItemList)`
77
77
  ${s.itemList}
78
78
  font-family: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.type}};
79
79
  > div {
@@ -97,7 +97,7 @@
97
97
  }
98
98
  }
99
99
  }
100
- `,W=e=>y.css`
100
+ `,q=e=>y.css`
101
101
  ${e["data-loading"]&&"position: relative;"};
102
102
  ${e["data-loading"]&&"min-height: 150px;"}
103
103
  > * {
@@ -107,17 +107,17 @@
107
107
  .humany-loader {
108
108
  opacity: ${e["data-loading"]?"1":"0"};
109
109
  }
110
- `,we=d(s.Icon)`
110
+ `,je=d(s.Icon)`
111
111
  && {
112
112
  font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.small}};
113
113
  }
114
114
  width: 1.2em;
115
- `,je=d(s.Text)`
115
+ `,ke=d(s.Text)`
116
116
  font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.medium}};
117
117
  font-weight: normal;
118
118
  line-height: 1.2em;
119
119
  color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.text}};
120
- `,q=d(s.Button)`
120
+ `,Y=d(s.Button)`
121
121
  display: flex;
122
122
  align-items: center;
123
123
 
@@ -142,7 +142,7 @@
142
142
  flex: 1;
143
143
  font-weight: 300;
144
144
  }
145
- `,Y=({addFavoriteTooltip:e,removeFavoriteCancelLabel:t,removeFavoriteConfirmLabel:a,removeFavoriteHeader:o,removeFavoriteLabel:i,removeFavoriteTooltip:r,id:l,isFavorite:h,guideTitle:c,buttonLabel:m="",actions:{addFavorite:p,removeFavorite:f}})=>{const g=u.useCallback(()=>{f(l)},[l,f]),w=u.useCallback(()=>{p(l)},[l,p]),$=`${h?r:e}${c?`: "${c}"`:""}`;return h?n.jsx(s.Confirm,{trigger:n.jsxs(E,{className:"humany-favorite-button",title:$,"aria-label":$,"data-favorite":"true","data-has-label":m?"true":"false","data-has-symbol":"true",children:[n.jsx(s.SymbolBadge,{size:16,symbol:{type:"Svg",content:"star-empty"}}),m&&n.jsx(s.StyledText,{children:m})]}),onConfirm:g,cancelLabel:t,confirmLabel:a,header:o,text:i}):n.jsxs(E,{className:"humany-favorite-button",title:$,"aria-label":$,onClick:w,"data-favorite":"false","data-has-label":m?"true":"false","data-has-symbol":"true",children:[n.jsx(s.SymbolBadge,{size:16,symbol:{type:"Svg",content:"star-empty"}}),m&&n.jsx(s.StyledText,{children:m})]})},E=d(q)`
145
+ `,_=({addFavoriteTooltip:e,removeFavoriteCancelLabel:t,removeFavoriteConfirmLabel:a,removeFavoriteHeader:o,removeFavoriteLabel:i,removeFavoriteTooltip:r,id:l,isFavorite:h,guideTitle:c,buttonLabel:m="",actions:{addFavorite:p,removeFavorite:f}})=>{const g=u.useCallback(()=>{f(l)},[l,f]),w=u.useCallback(()=>{p(l)},[l,p]),b=`${h?r:e}${c?`: "${c}"`:""}`;return h?n.jsx(s.Confirm,{trigger:n.jsxs(M,{className:"humany-favorite-button",title:b,"aria-label":b,"data-favorite":"true","data-has-label":m?"true":"false","data-has-symbol":"true",children:[n.jsx(s.SymbolBadge,{size:16,symbol:{type:"Svg",content:"star-empty"}}),m&&n.jsx(s.StyledText,{children:m})]}),onConfirm:g,cancelLabel:t,confirmLabel:a,header:o,text:i}):n.jsxs(M,{className:"humany-favorite-button",title:b,"aria-label":b,onClick:w,"data-favorite":"false","data-has-label":m?"true":"false","data-has-symbol":"true",children:[n.jsx(s.SymbolBadge,{size:16,symbol:{type:"Svg",content:"star-empty"}}),m&&n.jsx(s.StyledText,{children:m})]})},M=d(Y)`
146
146
  grid-area: favorite;
147
147
 
148
148
  &:focus-visible {
@@ -198,12 +198,12 @@
198
198
  }
199
199
  }
200
200
  `}}
201
- `,ke=u.forwardRef(({onFeedback:e=()=>{},direction:t="horizontal",className:a,header:o,positive:i,negative:r,selected:l,...h},c)=>n.jsxs(ze,{className:v.appendClassNames(a,"humany-feedback"),"data-direction":t,...s.convertToStringAttributes(h),ref:c,children:[!!o&&n.jsx(Se,{children:o}),n.jsxs(M,{className:"humany-feedback-button",disabled:!!l,"data-selected":l==="positive","data-direction":t,onClick:()=>e("positive"),children:[n.jsx(s.Icon,{faIcon:"smile-o"}),n.jsx("span",{children:i})]}),n.jsxs(M,{className:"humany-feedback-button",disabled:!!l,"data-selected":l==="negative","data-direction":t,onClick:()=>e("negative"),children:[n.jsx(s.Icon,{faIcon:"frown-o"}),n.jsx("span",{children:r})]})]})),Se=d(s.StyledText)`
201
+ `,Se=u.forwardRef(({onFeedback:e=()=>{},direction:t="horizontal",className:a,header:o,positive:i,negative:r,selected:l,...h},c)=>n.jsxs(Le,{className:v.appendClassNames(a,"humany-feedback"),"data-direction":t,...s.convertToStringAttributes(h),ref:c,children:[!!o&&n.jsx(ze,{children:o}),n.jsxs(O,{className:"humany-feedback-button",disabled:!!l,"data-selected":l==="positive","data-direction":t,onClick:()=>e("positive"),children:[n.jsx(s.Icon,{faIcon:"smile-o"}),n.jsx("span",{children:i})]}),n.jsxs(O,{className:"humany-feedback-button",disabled:!!l,"data-selected":l==="negative","data-direction":t,onClick:()=>e("negative"),children:[n.jsx(s.Icon,{faIcon:"frown-o"}),n.jsx("span",{children:r})]})]})),ze=d(s.StyledText)`
202
202
  font-weight: normal;
203
203
  margin: 0 0 ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.normal}};
204
204
  font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
205
205
  display: block;
206
- `,M=d(s.Button)`
206
+ `,O=d(s.Button)`
207
207
  display: inline-block;
208
208
  font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
209
209
  font-weight: 300;
@@ -225,7 +225,7 @@
225
225
  i {
226
226
  margin: 0 ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.small}} 0 0;
227
227
  }
228
- `,ze=d.div`
228
+ `,Le=d.div`
229
229
  ${e=>{var t;return e["data-direction"]==="vertical"&&y.css`
230
230
  > button {
231
231
  width: 100%;
@@ -234,7 +234,7 @@
234
234
  }
235
235
  }
236
236
  `}}
237
- `,Le=()=>{const[e,t]=u.useState(null),a=s.useKeyPress("ArrowLeft"),o=s.useKeyPress("ArrowRight"),i=s.useKeyPress("ArrowUp"),r=s.useKeyPress("ArrowDown"),l=()=>{t(a?"left":o?"right":i?"up":r?"down":null)};return u.useEffect(l,[a,o,i,r]),e},Ne=(e,t)=>{const[a,o]=u.useState(e),i=u.useCallback(()=>setTimeout(()=>{o(e)},t),[t,o,e]);return u.useEffect(()=>{const r=i();return()=>{clearTimeout(r)}},[i]),a},_=()=>{const e=s.useContainer(),[t,a]=u.useState([]),o=e.get("favorites");u.useEffect(()=>{if(o){a(o.get());const{events:c}=e.get("$widget");return c.subscribe("widget:favorites-updated",(p,{updated:f})=>{a([...f])})}},[]);const i=c=>o?o.add(c):Promise.resolve([]),r=c=>o?o.remove(c):Promise.resolve([]),l=()=>o?o.clear():Promise.resolve([]),h=u.useCallback(c=>t.indexOf(c)>-1?r(c):i(c),[t]);return[t,u.useMemo(()=>({addFavorite:i,removeFavorite:r,clearFavorites:l,toggleFavorite:h}),[t])]},Ce=()=>{const[e,t]=u.useState(!1),a=u.useRef(),o=u.useCallback(()=>t(!0),[t]),i=u.useCallback(()=>t(!1),[t]);return s.useEventListener("mouseenter",o,a.current),s.useEventListener("mouseleave",i,a.current),[e,a]},K=({format:e=s.DateFormats.YYYY_MM_DD_HH_MM,className:t="",byLabel:a="",modifiedLabel:o="",publishedLabel:i="",modifiedBy:r="",publishedBy:l="",showModified:h=!1,showPublished:c=!1,modified:m,published:p})=>{const f=c&&p?n.jsx(O,{format:e,timestamp:p}):null,g=h&&m?n.jsx(O,{format:e,timestamp:m}):null;return!f&&!g?null:n.jsxs(F,{className:v.appendClassNames(t,"humany-metadata"),children:[f&&n.jsxs(F,{className:"humany-published",children:[i,f,a&&l&&` ${a.replace("{{editor}}",l)}`]}),g&&n.jsxs(F,{className:"humany-modified",children:[f&&", ",o,g,a&&r&&` ${a.replace("{{editor}}",r)}`]})]})},O=d(s.Timestamp)`
237
+ `,Ne=()=>{const[e,t]=u.useState(null),a=s.useKeyPress("ArrowLeft"),o=s.useKeyPress("ArrowRight"),i=s.useKeyPress("ArrowUp"),r=s.useKeyPress("ArrowDown"),l=()=>{t(a?"left":o?"right":i?"up":r?"down":null)};return u.useEffect(l,[a,o,i,r]),e},Ce=(e,t)=>{const[a,o]=u.useState(e),i=u.useCallback(()=>setTimeout(()=>{o(e)},t),[t,o,e]);return u.useEffect(()=>{const r=i();return()=>{clearTimeout(r)}},[i]),a},K=()=>{const e=s.useContainer(),[t,a]=u.useState([]),o=e.get("favorites");u.useEffect(()=>{if(o){a(o.get());const{events:c}=e.get("$widget");return c.subscribe("widget:favorites-updated",(p,{updated:f})=>{a([...f])})}},[]);const i=c=>o?o.add(c):Promise.resolve([]),r=c=>o?o.remove(c):Promise.resolve([]),l=()=>o?o.clear():Promise.resolve([]),h=u.useCallback(c=>t.indexOf(c)>-1?r(c):i(c),[t]);return[t,u.useMemo(()=>({addFavorite:i,removeFavorite:r,clearFavorites:l,toggleFavorite:h}),[t])]},Te=()=>{const[e,t]=u.useState(!1),a=u.useRef(),o=u.useCallback(()=>t(!0),[t]),i=u.useCallback(()=>t(!1),[t]);return s.useEventListener("mouseenter",o,a.current),s.useEventListener("mouseleave",i,a.current),[e,a]},U=({format:e=s.DateFormats.YYYY_MM_DD_HH_MM,className:t="",byLabel:a="",modifiedLabel:o="",publishedLabel:i="",modifiedBy:r="",publishedBy:l="",showModified:h=!1,showPublished:c=!1,modified:m,published:p})=>{const f=c&&p?n.jsx(H,{format:e,timestamp:p}):null,g=h&&m?n.jsx(H,{format:e,timestamp:m}):null;return!f&&!g?null:n.jsxs(F,{className:v.appendClassNames(t,"humany-metadata"),children:[f&&n.jsxs(F,{className:"humany-published",children:[i,f,a&&l&&` ${a.replace("{{editor}}",l)}`]}),g&&n.jsxs(F,{className:"humany-modified",children:[f&&", ",o,g,a&&r&&` ${a.replace("{{editor}}",r)}`]})]})},H=d(s.Timestamp)`
238
238
  &:not(:first-child) {
239
239
  margin-left: 4px;
240
240
  }
@@ -243,7 +243,7 @@
243
243
  }
244
244
  `,F=d(s.Text)`
245
245
  font-style: italic;
246
- `,Te=({tags:e})=>e.filter(t=>t.symbol).length?n.jsx(Pe,{className:"humany-guide-list-tags",items:e,renderItem:({id:t,symbol:a,title:o})=>a&&n.jsx("li",{"data-tag":t,children:n.jsx(Ae,{size:18,symbol:a,title:o})},t)}):null,Ie=u.forwardRef(({title:e,id:t,route:a,symbolSize:o,collapseUri:i,children:r},l)=>{const{params:h}=s.useRouteData();return n.jsxs(De,{ref:l,"data-guide":t,children:[n.jsx(s.TextLink,{title:e,"aria-label":e,routeName:a,params:v.createParams({...h,uriName:i||void 0,id:void 0,guide:void 0,accordion:void 0}),text:e,children:n.jsx(s.SymbolBadge,{size:o,symbol:{type:"Svg",content:"caret-up"}})}),r]})}),De=d.li`
246
+ `,Ie=({tags:e})=>e.filter(t=>t.symbol).length?n.jsx(Ae,{className:"humany-guide-list-tags",items:e,renderItem:({id:t,symbol:a,title:o})=>a&&n.jsx("li",{"data-tag":t,children:n.jsx(Re,{size:18,symbol:a,title:o})},t)}):null,De=u.forwardRef(({title:e,id:t,route:a,symbolSize:o,collapseUri:i,children:r},l)=>{const{params:h}=s.useRouteData();return n.jsxs(Be,{ref:l,"data-guide":t,children:[n.jsx(s.TextLink,{title:e,"aria-label":e,routeName:a,params:v.createParams({...h,uriName:i||void 0,id:void 0,guide:void 0,accordion:void 0}),text:e,children:n.jsx(s.SymbolBadge,{size:o,symbol:{type:"Svg",content:"caret-up"}})}),r]})}),Be=d.li`
247
247
  > a {
248
248
  grid-column: 1/-1;
249
249
  font-weight: bold;
@@ -253,7 +253,7 @@
253
253
  > div {
254
254
  grid-column: 1/-1;
255
255
  }
256
- `,Be=u.forwardRef(({expandable:e=!1,routing:t={},paramMappers:a={},symbolSize:o=11,pageRole:i="link",pageCaret:r="down",showTags:l=!1,showFavoriteToggle:h=!1,localPaging:c=!1,onItemClick:m=()=>{},dispatch:p=()=>{},metadata:f={},pageLabel:g,className:w,children:$,items:b,renderItem:S,addFavoriteTooltip:G,removeFavoriteCancelLabel:J,removeFavoriteConfirmLabel:Q,removeFavoriteHeader:X,removeFavoriteLabel:Z,removeFavoriteTooltip:ee,...te},se)=>{const A=s.useIsTabbing(),L=u.useRef(),N=s.usePrevious(b),{guide:ae="guide",page:ne="index"}=t,{guide:oe=({id:x})=>v.createParams({guide:x}),page:R=()=>v.createParams()}=a,[ie,re]=_();u.useImperativeHandle(se,()=>L.current);const D=x=>{const{id:k,title:j,tags:z,published:T,modified:C,publishedBy:I,modifiedBy:B}=x;return n.jsxs("li",{"data-guide":k,"has-metadata":(!!(f!=null&&f.showPublished)&&!!T||!!(f!=null&&f.showModified)&&!!C).toString(),children:[n.jsx(s.TextLink,{className:"humany-guide-link",title:j,"aria-label":j,routeName:ae,onClick:me=>m(me,x),params:oe(x),text:j,children:n.jsx(s.SymbolBadge,{size:o,symbol:{type:"Svg",content:e?"caret-down":"caret-right"}})}),h&&n.jsx(Y,{guideTitle:j,addFavoriteTooltip:G,removeFavoriteCancelLabel:J,removeFavoriteConfirmLabel:Q,removeFavoriteHeader:X,removeFavoriteLabel:Z,removeFavoriteTooltip:ee,isFavorite:ie.indexOf(k)>-1,actions:re,id:k}),l&&n.jsx(Te,{tags:z}),n.jsx(Re,{...f,indent:e?void 0:o,modified:C,published:T,publishedBy:I,modifiedBy:B})]},k)},le=u.useCallback((x,k,j)=>S?S(x,k,j,D):D(x),[S,D]),ce=u.useCallback(x=>{c&&(x.preventDefault(),p("page",R()))},[p,c]);u.useEffect(()=>{if(N&&N.length<b.length&&L.current){const x=L.current.querySelectorAll(".humany-guide-list > ul > li"),k=x[N.length];if(x.length===b.length&&N.length){const j=x[N.length];if(j){const z=j.querySelector(".humany-guide-link");z&&z.focus()}}else k&&new MutationObserver((z,T)=>{z.forEach(C=>{if(C.addedNodes){const I=Array.from(C.addedNodes).find(B=>B.tagName==="A");I&&v.htmlParentContains(L.current,document.activeElement)&&(A&&I.focus(),T.disconnect())}})}).observe(k,{attributes:!1,characterData:!1,childList:!0,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1})}});const de=!!Object.keys(f).filter(x=>typeof f[x]<"u").length;return n.jsxs(Fe,{className:v.appendClassNames(w,"humany-guide-list"),"data-item-count":b.length,items:b,renderItem:le,isTabbing:A,expandable:e?"true":"false","grid-items":l||h||de?"true":"false",...s.convertToStringAttributes(te),ref:L,children:[g?n.jsx(s.TextLink,{text:g,title:g,"aria-label":g,routeName:ne,role:i,params:R(),onClick:ce,children:n.jsx(s.SymbolBadge,{size:o,symbol:{type:"Svg",content:`caret-${r}`}})}):null,$]})}),Fe=d(s.ItemList)`
256
+ `,Fe=u.forwardRef(({expandable:e=!1,routing:t={},paramMappers:a={},symbolSize:o=11,pageRole:i="link",pageCaret:r="down",showTags:l=!1,showFavoriteToggle:h=!1,localPaging:c=!1,onItemClick:m=()=>{},dispatch:p=()=>{},metadata:f={},pageLabel:g,className:w,children:b,items:$,renderItem:S,addFavoriteTooltip:J,removeFavoriteCancelLabel:Q,removeFavoriteConfirmLabel:X,removeFavoriteHeader:Z,removeFavoriteLabel:ee,removeFavoriteTooltip:te,searchResultsEmptyLabel:se,...A},ae)=>{const R=s.useIsTabbing(),L=u.useRef(),N=s.usePrevious($),{guide:ne="guide",page:oe="index"}=t,{guide:ie=({id:x})=>v.createParams({guide:x}),page:E=()=>v.createParams()}=a,[re,le]=K();u.useImperativeHandle(ae,()=>L.current);const D=x=>{const{id:k,title:j,tags:z,published:T,modified:C,publishedBy:I,modifiedBy:B}=x;return n.jsxs("li",{"data-guide":k,"has-metadata":(!!(f!=null&&f.showPublished)&&!!T||!!(f!=null&&f.showModified)&&!!C).toString(),children:[n.jsx(s.TextLink,{className:"humany-guide-link",title:j,"aria-label":j,routeName:ne,onClick:he=>m(he,x),params:ie(x),text:j,children:n.jsx(s.SymbolBadge,{size:o,symbol:{type:"Svg",content:e?"caret-down":"caret-right"}})}),h&&n.jsx(_,{guideTitle:j,addFavoriteTooltip:J,removeFavoriteCancelLabel:Q,removeFavoriteConfirmLabel:X,removeFavoriteHeader:Z,removeFavoriteLabel:ee,removeFavoriteTooltip:te,isFavorite:re.indexOf(k)>-1,actions:le,id:k}),l&&n.jsx(Ie,{tags:z}),n.jsx(Ee,{...f,indent:e?void 0:o,modified:C,published:T,publishedBy:I,modifiedBy:B})]},k)},ce=u.useCallback((x,k,j)=>S?S(x,k,j,D):D(x),[S,D]),de=u.useCallback(x=>{c&&(x.preventDefault(),p("page",E()))},[p,c]);u.useEffect(()=>{if(N&&N.length<$.length&&L.current){const x=L.current.querySelectorAll(".humany-guide-list > ul > li"),k=x[N.length];if(x.length===$.length&&N.length){const j=x[N.length];if(j){const z=j.querySelector(".humany-guide-link");z&&z.focus()}}else k&&new MutationObserver((z,T)=>{z.forEach(C=>{if(C.addedNodes){const I=Array.from(C.addedNodes).find(B=>B.tagName==="A");I&&v.htmlParentContains(L.current,document.activeElement)&&(R&&I.focus(),T.disconnect())}})}).observe(k,{attributes:!1,characterData:!1,childList:!0,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1})}});const me=!!Object.keys(f).filter(x=>typeof f[x]<"u").length;return n.jsxs(Pe,{className:v.appendClassNames(w,"humany-guide-list"),"data-item-count":$.length,items:$,renderItem:ce,isTabbing:R,expandable:e?"true":"false","grid-items":l||h||me?"true":"false",...s.convertToStringAttributes(A),ref:L,children:[g?n.jsx(s.TextLink,{text:g,title:g,"aria-label":g,routeName:oe,role:i,params:E(),onClick:de,children:n.jsx(s.SymbolBadge,{size:o,symbol:{type:"Svg",content:`caret-${r}`}})}):null,b,!A["data-loading"]&&$.length===0&&n.jsx("p",{children:se})]})}),Pe=d(s.ItemList)`
257
257
  ${s.itemList}
258
258
  padding: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.large}};
259
259
  overflow: auto;
@@ -371,7 +371,7 @@
371
371
  text-decoration: underline;
372
372
  }
373
373
  }
374
- `,Pe=d(s.List)`
374
+ `,Ae=d(s.List)`
375
375
  ${s.list}
376
376
  display: flex;
377
377
  margin: 0 0 0 auto;
@@ -384,7 +384,7 @@
384
384
  align-items: center;
385
385
  justify-content: space-between;
386
386
  }
387
- `,Ae=d(s.SymbolBadge)`
387
+ `,Re=d(s.SymbolBadge)`
388
388
  display: block;
389
389
  color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
390
390
  ${e=>{if(e.symbol.type==="Uri")return`
@@ -393,17 +393,17 @@
393
393
  `;if(e.symbol.type==="FontAwesome")return`
394
394
  font-size: ${e.size}px;
395
395
  `}}
396
- `,Re=d(K)`
396
+ `,Ee=d(U)`
397
397
  grid-area: metadata;
398
398
  text-overflow: ellipsis;
399
399
  overflow: hidden;
400
400
  font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.small}};
401
401
  ${e=>{var t;return typeof e.indent=="number"&&`text-indent: calc(${(t=e.theme.sizes)==null?void 0:t.small} * 2 + ${e.indent}px);`}}
402
- `,Ee=y.keyframes`
402
+ `,Me=y.keyframes`
403
403
  100% {
404
404
  transform: rotate(360deg);
405
405
  }
406
- `,Me=y.keyframes`
406
+ `,Oe=y.keyframes`
407
407
  0% {
408
408
  stroke-dasharray: 1, 200;
409
409
  stroke-dashoffset: 0;
@@ -416,8 +416,8 @@
416
416
  stroke-dasharray: 89, 200;
417
417
  stroke-dashoffset: -124px;
418
418
  }
419
- `,Oe=d.svg`
420
- animation: ${Ee} 2s linear infinite;
419
+ `,He=d.svg`
420
+ animation: ${Me} 2s linear infinite;
421
421
  height: 100%;
422
422
  transform-origin: center center;
423
423
  width: 100%;
@@ -428,7 +428,7 @@
428
428
  right: 0;
429
429
  margin: auto;
430
430
  transition: 200ms ease-out opacity;
431
- `,U=d.div`
431
+ `,V=d.div`
432
432
  position: absolute;
433
433
  top: 0;
434
434
  bottom: 0;
@@ -447,7 +447,7 @@
447
447
  .humany-spinner-svg {
448
448
  opacity: ${e=>e["data-loading"]?"1":"0"};
449
449
  }
450
- `,He=d.div`
450
+ `,We=d.div`
451
451
  position: relative;
452
452
  margin: 0 auto;
453
453
  width: 100px;
@@ -456,14 +456,14 @@
456
456
  display: block;
457
457
  padding-top: 100%;
458
458
  }
459
- `,We=d.circle`
459
+ `,qe=d.circle`
460
460
  stroke-dasharray: 1, 200;
461
461
  stroke-dashoffset: 0;
462
- animation: ${Me} 1.5s ease-in-out infinite;
462
+ animation: ${Oe} 1.5s ease-in-out infinite;
463
463
  stroke-linecap: round;
464
464
  stroke: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
465
465
  stroke-width: 2px;
466
- `,V=({loading:e=!1})=>n.jsx(U,{className:"humany-loader","data-loading":e,children:n.jsx(He,{className:"humany-spinner",children:n.jsx(Oe,{className:"humany-spinner-svg",viewBox:"25 25 50 50",children:n.jsx(We,{cx:"50",cy:"50",r:"20",fill:"none","stroke-width":"2","stroke-miterlimit":"10"})})})}),qe=({className:e,showHeader:t,notificationList:a,loading:o,...i})=>{const[r,l]=u.useState(null),{id:h,title:c,symbol:m,notifications:p=[],defaultHeaderOptions:f={visible:!0}}=a||{};return!p.length&&!o?null:n.jsx(_e,{...i,"data-loading":o,"data-show-header":typeof t=="boolean"?t:f.visible,className:v.appendClassNames(e,"humany-notification-list"),"data-notification-category":h,header:c,symbol:m,items:p,renderItem:({id:g,title:w,body:$,modified:b,expandable:S})=>n.jsx(Ke,{"data-notification":g,"data-expanded":S?r===g:!0,children:S?n.jsxs(n.Fragment,{children:[n.jsxs(Ye,{title:w,"aria-label":w,"aria-expanded":r===g,onClick:()=>l(r===g?null:g),children:[n.jsx("span",{children:w}),n.jsx(Ue,{size:11,symbol:{type:"Svg",content:`caret-${r===g?"up":"down"}`}})]}),n.jsx(H,{html:$}),b&&n.jsx(Ve,{format:s.DateFormats.YYYY_MM_DD,timestamp:b})]}):n.jsx(H,{html:$})},g),children:n.jsx(V,{loading:o})})},Ye=d(s.Button)`
466
+ `,G=({loading:e=!1})=>n.jsx(V,{className:"humany-loader","data-loading":e,children:n.jsx(We,{className:"humany-spinner",children:n.jsx(He,{className:"humany-spinner-svg",viewBox:"25 25 50 50",children:n.jsx(qe,{cx:"50",cy:"50",r:"20",fill:"none","stroke-width":"2","stroke-miterlimit":"10"})})})}),Ye=({className:e,showHeader:t,notificationList:a,loading:o,...i})=>{const[r,l]=u.useState(null),{id:h,title:c,symbol:m,notifications:p=[],defaultHeaderOptions:f={visible:!0}}=a||{};return!p.length&&!o?null:n.jsx(Ke,{...i,"data-loading":o,"data-show-header":typeof t=="boolean"?t:f.visible,className:v.appendClassNames(e,"humany-notification-list"),"data-notification-category":h,header:c,symbol:m,items:p,renderItem:({id:g,title:w,body:b,modified:$,expandable:S})=>n.jsx(Ue,{"data-notification":g,"data-expanded":S?r===g:!0,children:S?n.jsxs(n.Fragment,{children:[n.jsxs(_e,{title:w,"aria-label":w,"aria-expanded":r===g,onClick:()=>l(r===g?null:g),children:[n.jsx("span",{children:w}),n.jsx(Ve,{size:11,symbol:{type:"Svg",content:`caret-${r===g?"up":"down"}`}})]}),n.jsx(W,{html:b}),$&&n.jsx(Ge,{format:s.DateFormats.YYYY_MM_DD,timestamp:$})]}):n.jsx(W,{html:b})},g),children:n.jsx(G,{loading:o})})},_e=d(s.Button)`
467
467
  display: flex;
468
468
  justify-content: space-between;
469
469
  align-items: center;
@@ -488,8 +488,8 @@
488
488
  text-decoration: underline;
489
489
  }
490
490
  }
491
- `,_e=d(s.ItemList)`
492
- ${W}
491
+ `,Ke=d(s.ItemList)`
492
+ ${q}
493
493
  ${s.itemList}
494
494
  overflow: hidden;
495
495
  justify-content: flex-start;
@@ -507,14 +507,14 @@
507
507
  text-decoration: underline;
508
508
  }
509
509
  }
510
- `,H=d(s.Paragraph)`
510
+ `,W=d(s.Paragraph)`
511
511
  ${s.genericHtml}
512
512
  font-weight: 300;
513
513
 
514
514
  p {
515
515
  white-space: normal;
516
516
  }
517
- `,Ke=d.li`
517
+ `,Ue=d.li`
518
518
  .humany-paragraph {
519
519
  display: none;
520
520
  &:not(:only-child) {
@@ -535,12 +535,12 @@
535
535
  font-weight: 300;
536
536
  color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.accent}};
537
537
  }
538
- `,Ue=d(s.SymbolBadge)`
538
+ `,Ve=d(s.SymbolBadge)`
539
539
  margin: 0 0 0 ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.small}};
540
540
  line {
541
541
  stroke: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
542
542
  }
543
- `,Ve=d(s.Timestamp)`
543
+ `,Ge=d(s.Timestamp)`
544
544
  font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.small}};
545
545
  font-weight: 300;
546
- `,Ge=e=>new RegExp("^#","i").test(e),Je=e=>({children:t,...a})=>{const{implementation:o,name:i}=e.get("$widget"),{href:r=""}=a;if(Ge(r))return n.jsx(s.AnchorLink,{smooth:!0,to:r,children:t});const l=o.bindings.map(m=>m.replace(/\./g,"\\.")).join("|"),c=new RegExp(`^((http[s]?:)?//)?(${l})/([^\\s]+)`).exec(r);if(c&&c.length>=4){const m=c[4];if(o.widgets.get(m)&&!m.startsWith("blob?")&&!m.startsWith(i))return n.jsx(s.WidgetLink,{widgetName:m,children:t})}return n.jsx("a",{...a,children:t})},Qe=(e,t=[])=>({transform:{a:a=>{const{children:o,...i}=a,r=i["data-target"];if(r&&t.length){const h=t.find(({connection:c})=>c===r);if(h)return n.jsx(P,{...h,children:o})}return Je(e)(a)}}});exports.AccordionListItem=Ie;exports.DialogLink=P;exports.DialogList=he;exports.DrawerList=fe;exports.DropdownActions=pe;exports.DropdownList=$e;exports.FavoriteButton=Y;exports.Feedback=ke;exports.GuideList=Be;exports.Loader=V;exports.LoaderWrapper=U;exports.Metadata=K;exports.NotificationList=qe;exports.SmallCaret=we;exports.StyledHeaderText=je;exports.StyledListButton=q;exports.guideRenderInstructions=Qe;exports.loadingOpacity=W;exports.useArrowKeys=Le;exports.useDebounce=Ne;exports.useFavorites=_;exports.useHover=Ce;Object.keys(s).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>s[e]})});
546
+ `,Je=e=>new RegExp("^#","i").test(e),Qe=e=>({children:t,...a})=>{const{implementation:o,name:i}=e.get("$widget"),{href:r=""}=a;if(Je(r))return n.jsx(s.AnchorLink,{smooth:!0,to:r,children:t});const l=o.bindings.map(m=>m.replace(/\./g,"\\.")).join("|"),c=new RegExp(`^((http[s]?:)?//)?(${l})/([^\\s]+)`).exec(r);if(c&&c.length>=4){const m=c[4];if(o.widgets.get(m)&&!m.startsWith("blob?")&&!m.startsWith(i))return n.jsx(s.WidgetLink,{widgetName:m,children:t})}return n.jsx("a",{...a,children:t})},Xe=(e,t=[])=>({transform:{a:a=>{const{children:o,...i}=a,r=i["data-target"];if(r&&t.length){const h=t.find(({connection:c})=>c===r);if(h)return n.jsx(P,{...h,children:o})}return Qe(e)(a)}}});exports.AccordionListItem=De;exports.DialogLink=P;exports.DialogList=ue;exports.DrawerList=ge;exports.DropdownActions=xe;exports.DropdownList=be;exports.FavoriteButton=_;exports.Feedback=Se;exports.GuideList=Fe;exports.Loader=G;exports.LoaderWrapper=V;exports.Metadata=U;exports.NotificationList=Ye;exports.SmallCaret=je;exports.StyledHeaderText=ke;exports.StyledListButton=Y;exports.guideRenderInstructions=Xe;exports.loadingOpacity=q;exports.useArrowKeys=Ne;exports.useDebounce=Ce;exports.useFavorites=K;exports.useHover=Te;Object.keys(s).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>s[e]})});