@telia-ace/knowledge-widget-ui 0.0.1
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/components/dialog-list.d.ts +4 -0
- package/components/dropdown-actions.d.ts +13 -0
- package/components/favorite-button.d.ts +18 -0
- package/components/feedback.d.ts +12 -0
- package/components/guide-list.d.ts +47 -0
- package/components/index.d.ts +11 -0
- package/components/loader.d.ts +13 -0
- package/components/metadata.d.ts +18 -0
- package/components/notification-list.d.ts +20 -0
- package/hooks/index.d.ts +5 -0
- package/hooks/use-arrow-keys.d.ts +3 -0
- package/hooks/use-debounce.d.ts +2 -0
- package/hooks/use-favorites.d.ts +8 -0
- package/hooks/use-hover.d.ts +5 -0
- package/index.d.ts +8 -0
- package/index.js +546 -0
- package/index.mjs +1364 -0
- package/package.json +23 -0
- package/styles.d.ts +12 -0
- package/utils/embedded-link-mapper.d.ts +4 -0
- package/utils/guide-render-instructions.d.ts +8 -0
- package/utils/index.d.ts +1 -0
package/index.js
ADDED
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),s=require("@telia-ace/widget-ui"),$=require("@telia-ace/widget-utilities"),d=require("@emotion/styled"),u=require("react"),y=require("@emotion/react"),C=({title:e="",className:t,id:a,parent:i,connection:o,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:b,title:v}=i;let w=m||o;b!==a&&!m&&(w=void 0),p.routeName=f,p.params=$.createParams({...g,guide:a,connection:w,uriName:a===b?$.formatUrl(v):$.formatUrl(e)});break;case"link":p.href=h,p.target=l;break}return n.jsx(s.Link,{className:$.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})]})})},fe=u.forwardRef(({className:e,dialog:t,...a},i)=>t.length?n.jsx(ge,{className:$.appendClassNames(e,"humany-dialog"),items:t,renderItem:o=>n.jsx("li",{"data-dialog":o.connection,children:n.jsx(C,{...o})},o.connection),...a,ref:i}):null),ge=d(s.List)`
|
|
2
|
+
${s.list}
|
|
3
|
+
a {
|
|
4
|
+
min-width: 150px;
|
|
5
|
+
max-width: 400px;
|
|
6
|
+
display: block;
|
|
7
|
+
white-space: normal;
|
|
8
|
+
${e=>{var t,a;return((t=e.theme.colors)==null?void 0:t.primary)&&s.invertedHoverButton({primaryColor:(a=e.theme.colors)==null?void 0:a.primary,secondaryColor:"#FFFFFF",theme:e.theme})}}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
i {
|
|
12
|
+
margin: 0 ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.small}} 0 0;
|
|
13
|
+
}
|
|
14
|
+
`,pe=({trigger:e,header:t,className:a,animation:i,fullScreen:o,onToggle:r,children:l,ref:h,closeButtonAriaLabel:c,...m})=>n.jsx(s.Drawer,{className:$.appendClassNames(a,"humany-drawer-list"),trigger:e,header:t,animation:i,fullScreen:o,onToggle:r,closeButtonAriaLabel:c,children:n.jsx(xe,{...m,children:l})}),xe=d(s.ItemList)`
|
|
15
|
+
${s.itemList}
|
|
16
|
+
font-family: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.type}};
|
|
17
|
+
padding: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.medium}};
|
|
18
|
+
> ul > li {
|
|
19
|
+
overflow: visible;
|
|
20
|
+
font-weight: 300;
|
|
21
|
+
font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
|
|
22
|
+
}
|
|
23
|
+
`,ye=({items:e,renderItem:t,trigger:a,header:i,children:o})=>n.jsx(s.Dropdown,{className:"humany-dropdown-actions",trigger:a,children:n.jsxs($e,{children:[!!i&&n.jsx(ve,{children:i}),e&&t&&n.jsx(be,{items:e,renderItem:t}),o]})}),$e=d.div`
|
|
24
|
+
background: #fff;
|
|
25
|
+
border: #ccc 1px solid;
|
|
26
|
+
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
|
|
27
|
+
font-family: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.type}};
|
|
28
|
+
font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
|
|
29
|
+
`,ve=d.div`
|
|
30
|
+
padding: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.normal}};
|
|
31
|
+
padding-bottom: 0;
|
|
32
|
+
font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
|
|
33
|
+
font-weight: normal;
|
|
34
|
+
white-space: nowrap;
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
|
|
38
|
+
h1,
|
|
39
|
+
h2,
|
|
40
|
+
h3,
|
|
41
|
+
h4,
|
|
42
|
+
h5,
|
|
43
|
+
h6 {
|
|
44
|
+
margin: 0;
|
|
45
|
+
font-weight: normal;
|
|
46
|
+
padding-bottom: 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
svg,
|
|
50
|
+
i {
|
|
51
|
+
margin-right: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.small}};
|
|
52
|
+
}
|
|
53
|
+
`,be=d(s.List)`
|
|
54
|
+
list-style: none;
|
|
55
|
+
padding: 0;
|
|
56
|
+
margin: 0;
|
|
57
|
+
padding: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.small}} 0;
|
|
58
|
+
|
|
59
|
+
li {
|
|
60
|
+
background: #fff;
|
|
61
|
+
|
|
62
|
+
a {
|
|
63
|
+
display: block;
|
|
64
|
+
font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.small}};
|
|
65
|
+
padding: ${e=>{var t,a;return`${(t=e.theme.sizes)==null?void 0:t.small} ${(a=e.theme.sizes)==null?void 0:a.normal}`}};
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
color: #555;
|
|
68
|
+
text-decoration: none;
|
|
69
|
+
|
|
70
|
+
&:hover {
|
|
71
|
+
background: #f9f9f9;
|
|
72
|
+
color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
`,we=({trigger:e,className:t,children:a,closeButtonAriaLabel:i,...o})=>n.jsx(s.Dropdown,{className:$.appendClassNames(t,"humany-dropdown-list"),closeButtonAriaLabel:i,trigger:e,children:n.jsx(je,{...o,children:a})}),je=d(s.ItemList)`
|
|
77
|
+
${s.itemList}
|
|
78
|
+
font-family: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.type}};
|
|
79
|
+
> div {
|
|
80
|
+
${e=>{var t;return s.headingElement(e)("> h1",y.css`
|
|
81
|
+
font-size: ${(t=e.theme.fonts)==null?void 0:t.normal};
|
|
82
|
+
line-height: 1.2em;
|
|
83
|
+
`)}}
|
|
84
|
+
}
|
|
85
|
+
> ul > li {
|
|
86
|
+
overflow: visible;
|
|
87
|
+
font-weight: 300;
|
|
88
|
+
font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
|
|
89
|
+
|
|
90
|
+
a {
|
|
91
|
+
display: inline-block;
|
|
92
|
+
|
|
93
|
+
@media (hover: hover) {
|
|
94
|
+
&:hover {
|
|
95
|
+
text-decoration: underline;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
`,M=e=>y.css`
|
|
101
|
+
${e["data-loading"]&&"position: relative;"};
|
|
102
|
+
${e["data-loading"]&&"min-height: 150px;"}
|
|
103
|
+
> * {
|
|
104
|
+
transition: 200ms ease-out opacity;
|
|
105
|
+
opacity: ${e["data-loading"]?"0.5":"1"};
|
|
106
|
+
}
|
|
107
|
+
.humany-loader {
|
|
108
|
+
opacity: ${e["data-loading"]?"1":"0"};
|
|
109
|
+
}
|
|
110
|
+
`,ke=d(s.Icon)`
|
|
111
|
+
&& {
|
|
112
|
+
font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.small}};
|
|
113
|
+
}
|
|
114
|
+
width: 1.2em;
|
|
115
|
+
`,Se=d(s.Text)`
|
|
116
|
+
font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.medium}};
|
|
117
|
+
font-weight: normal;
|
|
118
|
+
line-height: 1.2em;
|
|
119
|
+
color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.text}};
|
|
120
|
+
`,E=d(s.Button)`
|
|
121
|
+
display: flex;
|
|
122
|
+
align-items: center;
|
|
123
|
+
|
|
124
|
+
${e=>{var t;return e["data-has-label"]==="true"&&e["data-has-symbol"]==="true"&&`
|
|
125
|
+
svg, i {
|
|
126
|
+
margin: 0 ${(t=e.theme.sizes)==null?void 0:t.small} 0 0;
|
|
127
|
+
}
|
|
128
|
+
`}}
|
|
129
|
+
|
|
130
|
+
&:focus-visible {
|
|
131
|
+
${e=>e["data-has-label"]==="true"&&s.paddedBorderTabStyle}
|
|
132
|
+
|
|
133
|
+
svg, i {
|
|
134
|
+
${e=>e["data-has-label"]==="false"&&e["data-has-symbol"]==="true"&&y.css`
|
|
135
|
+
${s.paddedBorderTabStyle(e)}
|
|
136
|
+
box-sizing: content-box;
|
|
137
|
+
`}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
span {
|
|
142
|
+
flex: 1;
|
|
143
|
+
font-weight: 300;
|
|
144
|
+
}
|
|
145
|
+
`,H=({addFavoriteTooltip:e,removeFavoriteCancelLabel:t,removeFavoriteConfirmLabel:a,removeFavoriteHeader:i,removeFavoriteLabel:o,removeFavoriteTooltip:r,id:l,isFavorite:h,guideTitle:c,buttonLabel:m="",actions:{addFavorite:p,removeFavorite:f}})=>{const g=u.useCallback(()=>{f(l)},[l,f]),b=u.useCallback(()=>{p(l)},[l,p]),v=`${h?r:e}${c?`: "${c}"`:""}`;return h?n.jsx(s.Confirm,{trigger:n.jsxs(F,{className:"humany-favorite-button",title:v,"aria-label":v,"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:i,text:o}):n.jsxs(F,{className:"humany-favorite-button",title:v,"aria-label":v,onClick:b,"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})]})},F=d(E)`
|
|
146
|
+
grid-area: favorite;
|
|
147
|
+
|
|
148
|
+
&:focus-visible {
|
|
149
|
+
svg {
|
|
150
|
+
${e=>{var t,a;return e["data-favorite"]==="true"?`
|
|
151
|
+
fill: transparent;
|
|
152
|
+
|
|
153
|
+
path {
|
|
154
|
+
fill: transparent;
|
|
155
|
+
}
|
|
156
|
+
`:`
|
|
157
|
+
fill: ${(t=e.theme.colors)==null?void 0:t.text};
|
|
158
|
+
|
|
159
|
+
path {
|
|
160
|
+
fill: ${(a=e.theme.colors)==null?void 0:a.text};
|
|
161
|
+
}
|
|
162
|
+
`}}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
${e=>{var t,a,i,o,r,l,h;return((t=e.theme.colors)==null?void 0:t.text)&&y.css`
|
|
167
|
+
svg {
|
|
168
|
+
stroke: ${(a=e.theme.colors)==null?void 0:a.text};
|
|
169
|
+
|
|
170
|
+
path {
|
|
171
|
+
stroke: ${(i=e.theme.colors)==null?void 0:i.text};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
${e["data-favorite"]==="true"&&`
|
|
175
|
+
fill: ${(o=e.theme.colors)==null?void 0:o.text};
|
|
176
|
+
|
|
177
|
+
path {
|
|
178
|
+
fill: ${(r=e.theme.colors)==null?void 0:r.text};
|
|
179
|
+
}
|
|
180
|
+
`};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
&:hover {
|
|
184
|
+
svg {
|
|
185
|
+
${e["data-favorite"]==="true"?`
|
|
186
|
+
fill: transparent;
|
|
187
|
+
|
|
188
|
+
path {
|
|
189
|
+
fill: transparent;
|
|
190
|
+
}
|
|
191
|
+
`:`
|
|
192
|
+
fill: ${(l=e.theme.colors)==null?void 0:l.text};
|
|
193
|
+
|
|
194
|
+
path {
|
|
195
|
+
fill: ${(h=e.theme.colors)==null?void 0:h.text};
|
|
196
|
+
}
|
|
197
|
+
`};
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
`}}
|
|
201
|
+
`,ze=u.forwardRef(({onFeedback:e=()=>{},direction:t="horizontal",className:a,header:i,positive:o,negative:r,selected:l,...h},c)=>n.jsxs(Ne,{className:$.appendClassNames(a,"humany-feedback"),"data-direction":t,...s.convertToStringAttributes(h),ref:c,children:[!!i&&n.jsx(Le,{children:i}),n.jsxs(P,{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:o})]}),n.jsxs(P,{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})]})]})),Le=d(s.StyledText)`
|
|
202
|
+
font-weight: normal;
|
|
203
|
+
margin: 0 0 ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.normal}};
|
|
204
|
+
font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
|
|
205
|
+
display: block;
|
|
206
|
+
`,P=d(s.Button)`
|
|
207
|
+
display: inline-block;
|
|
208
|
+
font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
|
|
209
|
+
font-weight: 300;
|
|
210
|
+
&& {
|
|
211
|
+
margin-right: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.large}};
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
${e=>{var t,a;return e["data-direction"]==="horizontal"&&y.css`
|
|
215
|
+
width: 225px;
|
|
216
|
+
max-width: calc(50% - ${(t=e.theme.sizes)==null?void 0:t.large} - ${(a=e.theme.sizes)==null?void 0:a.small});
|
|
217
|
+
`}}
|
|
218
|
+
|
|
219
|
+
${e=>e["data-direction"]==="vertical"&&y.css`
|
|
220
|
+
min-width: 190px;
|
|
221
|
+
`}
|
|
222
|
+
|
|
223
|
+
${e=>{var t,a;return((t=e.theme.colors)==null?void 0:t.primary)&&s.invertedHoverButton({active:e["data-selected"],primaryColor:(a=e.theme.colors)==null?void 0:a.primary,secondaryColor:"#FFFFFF",theme:e.theme})}}
|
|
224
|
+
|
|
225
|
+
i {
|
|
226
|
+
margin: 0 ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.small}} 0 0;
|
|
227
|
+
}
|
|
228
|
+
`,Ne=d.div`
|
|
229
|
+
${e=>{var t;return e["data-direction"]==="vertical"&&y.css`
|
|
230
|
+
> button {
|
|
231
|
+
width: 100%;
|
|
232
|
+
&:not(:last-child) {
|
|
233
|
+
margin-bottom: ${(t=e.theme.sizes)==null?void 0:t.normal};
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
`}}
|
|
237
|
+
`,Ce=()=>{const[e,t]=u.useState(null),a=s.useKeyPress("ArrowLeft"),i=s.useKeyPress("ArrowRight"),o=s.useKeyPress("ArrowUp"),r=s.useKeyPress("ArrowDown"),l=()=>{t(a?"left":i?"right":o?"up":r?"down":null)};return u.useEffect(l,[a,i,o,r]),e},Te=(e,t)=>{const[a,i]=u.useState(e),o=u.useCallback(()=>setTimeout(()=>{i(e)},t),[t,i,e]);return u.useEffect(()=>{const r=o();return()=>{clearTimeout(r)}},[o]),a},O=()=>{const e=s.useContainer(),[t,a]=u.useState([]),i=e.get("favorites");u.useEffect(()=>{if(i){a(i.get());const{events:c}=e.get("$widget");return c.subscribe("widget:favorites-updated",(p,{updated:f})=>{a([...f])})}},[]);const o=c=>i?i.add(c):Promise.resolve([]),r=c=>i?i.remove(c):Promise.resolve([]),l=()=>i?i.clear():Promise.resolve([]),h=u.useCallback(c=>t.indexOf(c)>-1?r(c):o(c),[t]);return[t,u.useMemo(()=>({addFavorite:o,removeFavorite:r,clearFavorites:l,toggleFavorite:h}),[t])]},Ie=()=>{const[e,t]=u.useState(!1),a=u.useRef(),i=u.useCallback(()=>t(!0),[t]),o=u.useCallback(()=>t(!1),[t]);return s.useEventListener("mouseenter",i,a.current),s.useEventListener("mouseleave",o,a.current),[e,a]},W=({format:e=s.DateFormats.YYYY_MM_DD_HH_MM,className:t="",byLabel:a="",modifiedLabel:i="",publishedLabel:o="",modifiedBy:r="",publishedBy:l="",showModified:h=!1,showPublished:c=!1,modified:m,published:p})=>{const f=c&&p?n.jsx(A,{format:e,timestamp:p}):null,g=h&&m?n.jsx(A,{format:e,timestamp:m}):null;return!f&&!g?null:n.jsxs(N,{className:$.appendClassNames(t,"humany-metadata"),children:[f&&n.jsxs(N,{className:"humany-published",children:[o,f,a&&l&&` ${a.replace("{{editor}}",l)}`]}),g&&n.jsxs(N,{className:"humany-modified",children:[f&&", ",i,g,a&&r&&` ${a.replace("{{editor}}",r)}`]})]})},A=d(s.Timestamp)`
|
|
238
|
+
&:not(:first-child) {
|
|
239
|
+
margin-left: 4px;
|
|
240
|
+
}
|
|
241
|
+
&:not(:last-child) {
|
|
242
|
+
margin-right: 4px;
|
|
243
|
+
}
|
|
244
|
+
`,N=d(s.Text)`
|
|
245
|
+
font-style: italic;
|
|
246
|
+
`,De=({tags:e})=>e.filter(t=>t.symbol).length?n.jsx(Re,{className:"humany-guide-list-tags",items:e,renderItem:({id:t,symbol:a,title:i})=>a&&n.jsx("li",{"data-tag":t,children:n.jsx(Me,{size:18,symbol:a,title:i})},t)}):null,Be=u.forwardRef(({title:e,id:t,route:a,symbolSize:i,collapseUri:o,children:r},l)=>{const{params:h}=s.useRouteData();return n.jsxs(Fe,{ref:l,"data-guide":t,children:[n.jsx(s.TextLink,{"aria-expanded":!0,title:e,"aria-label":e,routeName:a,params:$.createParams({...h,uriName:o||void 0,id:void 0,guide:void 0,accordion:void 0}),text:e,children:n.jsx(s.SymbolBadge,{size:i,symbol:{type:"Svg",content:"caret-up"}})}),r]})}),Fe=d.li`
|
|
247
|
+
> a {
|
|
248
|
+
grid-column: 1/-1;
|
|
249
|
+
font-weight: bold;
|
|
250
|
+
margin: 0 0 ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.normal}} 0;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
> div {
|
|
254
|
+
grid-column: 1/-1;
|
|
255
|
+
}
|
|
256
|
+
`,Pe=u.forwardRef(({expandable:e=!1,routing:t={},paramMappers:a={},symbolSize:i=11,pageRole:o="link",pageCaret:r="down",showTags:l=!1,showFavoriteToggle:h=!1,localPaging:c=!1,onItemClick:m=()=>{},dispatch:p=()=>{},metadata:f={},pageLabel:g,className:b,children:v,items:w,renderItem:k,addFavoriteTooltip:_,removeFavoriteCancelLabel:K,removeFavoriteConfirmLabel:U,removeFavoriteHeader:G,removeFavoriteLabel:V,removeFavoriteTooltip:J,searchResultsEmptyLabel:Q,...T},X)=>{const Z=s.useIsTabbing(),z=u.useRef(),{guide:ee="guide",page:te="index"}=t,{guide:se=({id:x})=>$.createParams({guide:x}),page:I=()=>$.createParams()}=a,[ae,ne]=O(),ie=s.useContainer(),{events:oe}=ie.get("$widget");u.useImperativeHandle(X,()=>z.current);const L=x=>{const{id:j,title:S,tags:de,published:D,modified:B,publishedBy:me,modifiedBy:he}=x;return n.jsxs("li",{"data-guide":j,"has-metadata":(!!(f!=null&&f.showPublished)&&!!D||!!(f!=null&&f.showModified)&&!!B).toString(),children:[n.jsx(s.TextLink,{className:"humany-guide-link",routeName:ee,onClick:ue=>{m(ue,x),oe.dispatch("tracking:guide-list-item-clicked",{guide:x})},params:se(x),text:S,children:n.jsx(s.SymbolBadge,{size:i,symbol:{type:"Svg",content:e?"caret-down":"caret-right"}})}),h&&n.jsx(H,{guideTitle:S,addFavoriteTooltip:_,removeFavoriteCancelLabel:K,removeFavoriteConfirmLabel:U,removeFavoriteHeader:G,removeFavoriteLabel:V,removeFavoriteTooltip:J,isFavorite:ae.indexOf(j)>-1,actions:ne,id:j}),l&&n.jsx(De,{tags:de}),n.jsx(Ee,{...f,indent:e?void 0:i,modified:B,published:D,publishedBy:me,modifiedBy:he})]},j)},re=u.useCallback((x,j,S)=>k?k(x,j,S,L):L(x),[k,L]),le=u.useCallback(x=>{c&&(x.preventDefault(),p("page",I()))},[p,c]);u.useEffect(()=>{var j;const x=(j=z.current)==null?void 0:j.querySelector(".humany-guide-list > ul > li .humany-guide-link");x&&s.getHumanyIsTabbing()&&(x.focus(),s.setHumanyIsTabbing(!1))},[w]);const ce=!!Object.keys(f).filter(x=>typeof f[x]<"u").length;return n.jsxs(Ae,{className:$.appendClassNames(b,"humany-guide-list"),"data-item-count":w.length,items:w,renderItem:re,isTabbing:Z,expandable:e?"true":"false","grid-items":l||h||ce?"true":"false",...s.convertToStringAttributes(T),ref:z,children:[g?n.jsx(s.TextLink,{text:g,title:g,"aria-label":g,routeName:te,role:o,params:I(),onClick:le,children:n.jsx(s.SymbolBadge,{size:i,symbol:{type:"Svg",content:`caret-${r}`}})}):null,v,!T["data-loading"]&&w.length===0&&n.jsx("p",{children:Q})]})}),Ae=d(s.ItemList)`
|
|
257
|
+
${s.itemList}
|
|
258
|
+
padding: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.large}};
|
|
259
|
+
overflow: auto;
|
|
260
|
+
justify-content: flex-start;
|
|
261
|
+
white-space: nowrap;
|
|
262
|
+
font-weight: 300;
|
|
263
|
+
text-decoration: none;
|
|
264
|
+
|
|
265
|
+
> div {
|
|
266
|
+
${e=>s.headingElement(e)("> h1",y.css`
|
|
267
|
+
white-space: pre-wrap;
|
|
268
|
+
`)}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
> ul > li {
|
|
272
|
+
${e=>{var t,a;return e["grid-items"]==="true"&&y.css`
|
|
273
|
+
display: grid;
|
|
274
|
+
grid-template-columns: auto 1fr 1fr;
|
|
275
|
+
gap: 0px 0px;
|
|
276
|
+
grid-template-areas: '. favorite tags';
|
|
277
|
+
align-items: center;
|
|
278
|
+
|
|
279
|
+
> button {
|
|
280
|
+
margin: 0 0 0 ${(t=e.theme.sizes)==null?void 0:t.small};
|
|
281
|
+
|
|
282
|
+
&[data-favorite='false'] {
|
|
283
|
+
${e.isTabbing?"opacity: 0;":"display: none;"};
|
|
284
|
+
&:focus {
|
|
285
|
+
opacity: 1;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
> span {
|
|
291
|
+
font-size: ${(a=e.theme.fonts)==null?void 0:a.small};
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
&:hover {
|
|
295
|
+
button[data-favorite='false'] {
|
|
296
|
+
display: flex;
|
|
297
|
+
justify-self: flex-start;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
&[has-metadata='true'] {
|
|
302
|
+
grid-template-rows: 1fr 1fr;
|
|
303
|
+
grid-template-areas:
|
|
304
|
+
'. favorite tags'
|
|
305
|
+
'metadata metadata metadata';
|
|
306
|
+
}
|
|
307
|
+
`}}
|
|
308
|
+
> a {
|
|
309
|
+
color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
|
|
310
|
+
overflow: hidden;
|
|
311
|
+
text-overflow: ellipsis;
|
|
312
|
+
max-width: 100%;
|
|
313
|
+
display: inline-block;
|
|
314
|
+
|
|
315
|
+
svg {
|
|
316
|
+
margin: 0 calc(${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.small}}*2) 0 0;
|
|
317
|
+
line {
|
|
318
|
+
stroke: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
${e=>{var t;return e.expandable==="true"&&y.css`
|
|
323
|
+
display: flex;
|
|
324
|
+
flex-direction: row-reverse;
|
|
325
|
+
justify-content: flex-end;
|
|
326
|
+
align-items: center;
|
|
327
|
+
|
|
328
|
+
span {
|
|
329
|
+
overflow: hidden;
|
|
330
|
+
text-overflow: ellipsis;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
svg {
|
|
334
|
+
margin: 0 0 0 ${(t=e.theme.sizes)==null?void 0:t.small};
|
|
335
|
+
}
|
|
336
|
+
`}}
|
|
337
|
+
|
|
338
|
+
&:focus-visible {
|
|
339
|
+
${s.borderTabStyle}
|
|
340
|
+
text-decoration: underline;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
@media (hover: hover) {
|
|
344
|
+
&:hover {
|
|
345
|
+
text-decoration: underline;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
> a {
|
|
352
|
+
color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.text}};
|
|
353
|
+
margin: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.normal}} 0 0;
|
|
354
|
+
align-self: flex-start;
|
|
355
|
+
align-items: center;
|
|
356
|
+
display: flex;
|
|
357
|
+
|
|
358
|
+
span {
|
|
359
|
+
text-decoration: underline;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
svg {
|
|
363
|
+
margin: 0 calc(${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.small}}*2) 0 0;
|
|
364
|
+
line {
|
|
365
|
+
stroke: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.text}};
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
&:focus-visible {
|
|
370
|
+
${s.borderTabStyle}
|
|
371
|
+
text-decoration: underline;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
`,Re=d(s.List)`
|
|
375
|
+
${s.list}
|
|
376
|
+
display: flex;
|
|
377
|
+
margin: 0 0 0 auto;
|
|
378
|
+
grid-area: tags;
|
|
379
|
+
|
|
380
|
+
li,
|
|
381
|
+
li:last-child {
|
|
382
|
+
margin: 0 0 0 ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.small}};
|
|
383
|
+
display: flex;
|
|
384
|
+
align-items: center;
|
|
385
|
+
justify-content: space-between;
|
|
386
|
+
}
|
|
387
|
+
`,Me=d(s.SymbolBadge)`
|
|
388
|
+
display: block;
|
|
389
|
+
color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
|
|
390
|
+
${e=>{if(e.symbol.type==="Uri")return`
|
|
391
|
+
width: ${e.size}px;
|
|
392
|
+
height: ${e.size}px;
|
|
393
|
+
`;if(e.symbol.type==="FontAwesome")return`
|
|
394
|
+
font-size: ${e.size}px;
|
|
395
|
+
`}}
|
|
396
|
+
`,Ee=d(W)`
|
|
397
|
+
grid-area: metadata;
|
|
398
|
+
text-overflow: ellipsis;
|
|
399
|
+
overflow: hidden;
|
|
400
|
+
font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.small}};
|
|
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
|
+
`,He=y.keyframes`
|
|
403
|
+
100% {
|
|
404
|
+
transform: rotate(360deg);
|
|
405
|
+
}
|
|
406
|
+
`,Oe=y.keyframes`
|
|
407
|
+
0% {
|
|
408
|
+
stroke-dasharray: 1, 200;
|
|
409
|
+
stroke-dashoffset: 0;
|
|
410
|
+
}
|
|
411
|
+
50% {
|
|
412
|
+
stroke-dasharray: 89, 200;
|
|
413
|
+
stroke-dashoffset: -35px;
|
|
414
|
+
}
|
|
415
|
+
100% {
|
|
416
|
+
stroke-dasharray: 89, 200;
|
|
417
|
+
stroke-dashoffset: -124px;
|
|
418
|
+
}
|
|
419
|
+
`,We=d.svg`
|
|
420
|
+
animation: ${He} 2s linear infinite;
|
|
421
|
+
height: 100%;
|
|
422
|
+
transform-origin: center center;
|
|
423
|
+
width: 100%;
|
|
424
|
+
position: absolute;
|
|
425
|
+
top: 0;
|
|
426
|
+
bottom: 0;
|
|
427
|
+
left: 0;
|
|
428
|
+
right: 0;
|
|
429
|
+
margin: auto;
|
|
430
|
+
transition: 200ms ease-out opacity;
|
|
431
|
+
`,Y=d.div`
|
|
432
|
+
position: absolute;
|
|
433
|
+
top: 0;
|
|
434
|
+
bottom: 0;
|
|
435
|
+
left: 0;
|
|
436
|
+
right: 0;
|
|
437
|
+
height: 100%;
|
|
438
|
+
width: 100%;
|
|
439
|
+
pointer-events: ${e=>e["data-loading"]?"all":"none"};
|
|
440
|
+
display: flex;
|
|
441
|
+
flex-direction: column;
|
|
442
|
+
justify-content: center;
|
|
443
|
+
transition: 200ms ease-out opacity;
|
|
444
|
+
box-sizing: border-box;
|
|
445
|
+
overflow: hidden;
|
|
446
|
+
|
|
447
|
+
.humany-spinner-svg {
|
|
448
|
+
opacity: ${e=>e["data-loading"]?"1":"0"};
|
|
449
|
+
}
|
|
450
|
+
`,Ye=d.div`
|
|
451
|
+
position: relative;
|
|
452
|
+
margin: 0 auto;
|
|
453
|
+
width: 100px;
|
|
454
|
+
&:before {
|
|
455
|
+
content: '';
|
|
456
|
+
display: block;
|
|
457
|
+
padding-top: 100%;
|
|
458
|
+
}
|
|
459
|
+
`,qe=d.circle`
|
|
460
|
+
stroke-dasharray: 1, 200;
|
|
461
|
+
stroke-dashoffset: 0;
|
|
462
|
+
animation: ${Oe} 1.5s ease-in-out infinite;
|
|
463
|
+
stroke-linecap: round;
|
|
464
|
+
stroke: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
|
|
465
|
+
stroke-width: 2px;
|
|
466
|
+
`,q=({loading:e=!1})=>n.jsx(Y,{className:"humany-loader","data-loading":e,children:n.jsx(Ye,{className:"humany-spinner",children:n.jsx(We,{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"})})})}),_e=({className:e,showHeader:t,notificationList:a,loading:i,...o})=>{const[r,l]=u.useState(null),{id:h,title:c,symbol:m,notifications:p=[],defaultHeaderOptions:f={visible:!0}}=a||{};return!p.length&&!i?null:n.jsx(Ue,{...o,"data-loading":i,"data-show-header":typeof t=="boolean"?t:f.visible,className:$.appendClassNames(e,"humany-notification-list"),"data-notification-category":h,header:c,symbol:m,items:p,renderItem:({id:g,title:b,body:v,modified:w,expandable:k})=>n.jsx(Ge,{"data-notification":g,"data-expanded":k?r===g:!0,children:k?n.jsxs(n.Fragment,{children:[n.jsxs(Ke,{title:b,"aria-label":b,"aria-expanded":r===g,onClick:()=>l(r===g?null:g),children:[n.jsx("span",{children:b}),n.jsx(Ve,{size:11,symbol:{type:"Svg",content:`caret-${r===g?"up":"down"}`}})]}),n.jsx(R,{html:v}),w&&n.jsx(Je,{format:s.DateFormats.YYYY_MM_DD,timestamp:w})]}):n.jsx(R,{html:v})},g),children:n.jsx(q,{loading:i})})},Ke=d(s.Button)`
|
|
467
|
+
display: flex;
|
|
468
|
+
justify-content: space-between;
|
|
469
|
+
align-items: center;
|
|
470
|
+
width: 100%;
|
|
471
|
+
text-align: left;
|
|
472
|
+
svg,
|
|
473
|
+
i {
|
|
474
|
+
color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
|
|
475
|
+
}
|
|
476
|
+
span {
|
|
477
|
+
color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.text}};
|
|
478
|
+
font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
|
|
479
|
+
overflow: hidden;
|
|
480
|
+
text-overflow: ellipsis;
|
|
481
|
+
flex: 1;
|
|
482
|
+
white-space: nowrap;
|
|
483
|
+
}
|
|
484
|
+
&:focus-visible {
|
|
485
|
+
${s.borderTabStyle}
|
|
486
|
+
span {
|
|
487
|
+
color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
|
|
488
|
+
text-decoration: underline;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
`,Ue=d(s.ItemList)`
|
|
492
|
+
${M}
|
|
493
|
+
${s.itemList}
|
|
494
|
+
overflow: hidden;
|
|
495
|
+
justify-content: flex-start;
|
|
496
|
+
padding: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.large}};
|
|
497
|
+
${e=>!e["data-show-header"]&&y.css`
|
|
498
|
+
> div {
|
|
499
|
+
${s.headingElement(e)("h1",y.css`
|
|
500
|
+
display: none;
|
|
501
|
+
`)}
|
|
502
|
+
}
|
|
503
|
+
`}
|
|
504
|
+
|
|
505
|
+
@media (hover: hover) {
|
|
506
|
+
button:hover {
|
|
507
|
+
text-decoration: underline;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
`,R=d(s.Paragraph)`
|
|
511
|
+
${s.genericHtml}
|
|
512
|
+
font-weight: 300;
|
|
513
|
+
|
|
514
|
+
p {
|
|
515
|
+
white-space: normal;
|
|
516
|
+
}
|
|
517
|
+
`,Ge=d.li`
|
|
518
|
+
.humany-paragraph {
|
|
519
|
+
display: none;
|
|
520
|
+
&:not(:only-child) {
|
|
521
|
+
${e=>{var t,a,i;return((t=e.theme.sizes)==null?void 0:t.cardinal)&&((a=e.theme.sizes)==null?void 0:a.normal)&&y.css`
|
|
522
|
+
margin: ${(i=e.theme.sizes)==null?void 0:i.normal} 0;
|
|
523
|
+
`}}
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
${e=>e["data-expanded"]&&y.css`
|
|
528
|
+
.humany-paragraph {
|
|
529
|
+
display: block;
|
|
530
|
+
}
|
|
531
|
+
`}
|
|
532
|
+
|
|
533
|
+
> span {
|
|
534
|
+
display: block;
|
|
535
|
+
font-weight: 300;
|
|
536
|
+
color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.accent}};
|
|
537
|
+
}
|
|
538
|
+
`,Ve=d(s.SymbolBadge)`
|
|
539
|
+
margin: 0 0 0 ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.small}};
|
|
540
|
+
line {
|
|
541
|
+
stroke: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
|
|
542
|
+
}
|
|
543
|
+
`,Je=d(s.Timestamp)`
|
|
544
|
+
font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.small}};
|
|
545
|
+
font-weight: 300;
|
|
546
|
+
`,Qe=e=>new RegExp("^#","i").test(e),Xe=e=>({children:t,...a})=>{const{implementation:i,name:o}=e.get("$widget"),{href:r=""}=a;if(Qe(r))return n.jsx(s.AnchorLink,{smooth:!0,to:r,children:t});const l=i.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(i.widgets.get(m)&&!m.startsWith("blob?")&&!m.startsWith(o))return n.jsx(s.WidgetLink,{widgetName:m,children:t})}return n.jsx("a",{...a,children:t})},Ze=(e,t=[])=>({transform:{a:a=>{const{children:i,...o}=a,r=o["data-target"];if(r&&t.length){const h=t.find(({connection:c})=>c===r);if(h)return n.jsx(C,{...h,children:i})}return Xe(e)(a)}}});exports.AccordionListItem=Be;exports.DialogLink=C;exports.DialogList=fe;exports.DrawerList=pe;exports.DropdownActions=ye;exports.DropdownList=we;exports.FavoriteButton=H;exports.Feedback=ze;exports.GuideList=Pe;exports.Loader=q;exports.LoaderWrapper=Y;exports.Metadata=W;exports.NotificationList=_e;exports.SmallCaret=ke;exports.StyledHeaderText=Se;exports.StyledListButton=E;exports.guideRenderInstructions=Ze;exports.loadingOpacity=M;exports.useArrowKeys=Ce;exports.useDebounce=Te;exports.useFavorites=O;exports.useHover=Ie;Object.keys(s).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>s[e]})});
|