@mattilsynet/design 0.4.0 → 0.5.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.
Files changed (76) hide show
  1. package/mtds/alert/alert.d.ts +3 -1
  2. package/mtds/alert/alert.js.map +1 -1
  3. package/mtds/alert/alert.stories.d.ts +1 -1
  4. package/mtds/avatar/avatar.stories.d.ts +1 -1
  5. package/mtds/badge/badge.d.ts +6 -2
  6. package/mtds/badge/badge.js.map +1 -1
  7. package/mtds/badge/badge.stories.d.ts +1 -1
  8. package/mtds/breadcrumbs/breadcrumbs.js +18 -23
  9. package/mtds/breadcrumbs/breadcrumbs.js.map +1 -1
  10. package/mtds/breadcrumbs/breadcrumbs.stories.d.ts +1 -1
  11. package/mtds/button/button.d.ts +4 -0
  12. package/mtds/button/button.js.map +1 -1
  13. package/mtds/button/button.stories.d.ts +1 -1
  14. package/mtds/card/card.stories.d.ts +1 -2
  15. package/mtds/chip/chip.d.ts +10 -2
  16. package/mtds/chip/chip.js +7 -6
  17. package/mtds/chip/chip.js.map +1 -1
  18. package/mtds/chip/chip.stories.d.ts +2 -1
  19. package/mtds/dialog/dialog.d.ts +2 -0
  20. package/mtds/dialog/dialog.js.map +1 -1
  21. package/mtds/divider/divider.d.ts +6 -2
  22. package/mtds/divider/divider.js.map +1 -1
  23. package/mtds/errorsummary/errorsummary.js +15 -18
  24. package/mtds/errorsummary/errorsummary.js.map +1 -1
  25. package/mtds/errorsummary/errorsummary.stories.d.ts +1 -1
  26. package/mtds/field/field-observer.js +33 -30
  27. package/mtds/field/field-observer.js.map +1 -1
  28. package/mtds/field/field.stories.d.ts +1 -1
  29. package/mtds/fieldset/fieldset-observer.js +9 -10
  30. package/mtds/fieldset/fieldset-observer.js.map +1 -1
  31. package/mtds/heading/heading.d.ts +3 -1
  32. package/mtds/heading/heading.js.map +1 -1
  33. package/mtds/heading/heading.stories.d.ts +1 -1
  34. package/mtds/index.d.ts +2 -1
  35. package/mtds/index.iife.js +2 -2
  36. package/mtds/index.iife.js.map +1 -1
  37. package/mtds/index.js +18 -17
  38. package/mtds/index.js.map +1 -1
  39. package/mtds/input/input.stories.d.ts +1 -1
  40. package/mtds/layout/layout-observer.js +12 -15
  41. package/mtds/layout/layout-observer.js.map +1 -1
  42. package/mtds/layout/layout.d.ts +15 -6
  43. package/mtds/layout/layout.js.map +1 -1
  44. package/mtds/layout/layout.stories.d.ts +1 -1
  45. package/mtds/logo/logo-observer.d.ts +2 -0
  46. package/mtds/logo/logo-observer.js +23 -0
  47. package/mtds/logo/logo-observer.js.map +1 -0
  48. package/mtds/logo/logo.d.ts +1 -0
  49. package/mtds/logo/logo.js.map +1 -1
  50. package/mtds/logo/logo.stories.d.ts +9 -2
  51. package/mtds/popover/popover-observer.js +16 -12
  52. package/mtds/popover/popover-observer.js.map +1 -1
  53. package/mtds/popover/popover.d.ts +3 -1
  54. package/mtds/popover/popover.js.map +1 -1
  55. package/mtds/react-types.d.ts +9 -1
  56. package/mtds/skeleton/skeleton.d.ts +4 -3
  57. package/mtds/skeleton/skeleton.js.map +1 -1
  58. package/mtds/spinner/spinner.d.ts +6 -2
  59. package/mtds/spinner/spinner.js.map +1 -1
  60. package/mtds/spinner/spinner.stories.d.ts +1 -1
  61. package/mtds/styles.css +1 -1
  62. package/mtds/styles.json +33 -32
  63. package/mtds/styles.module.css.js +58 -56
  64. package/mtds/styles.module.css.js.map +1 -1
  65. package/mtds/table/table-observer.js +19 -16
  66. package/mtds/table/table-observer.js.map +1 -1
  67. package/mtds/table/table.d.ts +12 -2
  68. package/mtds/table/table.js.map +1 -1
  69. package/mtds/table/table.stories.d.ts +1 -1
  70. package/mtds/tag/tag.d.ts +6 -2
  71. package/mtds/tag/tag.js.map +1 -1
  72. package/mtds/tag/tag.stories.d.ts +1 -1
  73. package/mtds/tooltip/tooltip-observer.js +21 -21
  74. package/mtds/tooltip/tooltip-observer.js.map +1 -1
  75. package/mtds/tooltip/tooltip.stories.d.ts +1 -1
  76. package/package.json +12 -12
package/mtds/index.d.ts CHANGED
@@ -5,6 +5,7 @@ badge: string;
5
5
  breadcrumbs: string;
6
6
  button: string;
7
7
  card: string;
8
+ group: string;
8
9
  chip: string;
9
10
  details: string;
10
11
  dialog: string;
@@ -15,7 +16,7 @@ affixes: string;
15
16
  count: string;
16
17
  fieldset: string;
17
18
  heading: string;
18
- stack: string;
19
+ typostack: string;
19
20
  input: string;
20
21
  grid: string;
21
22
  flex: string;
@@ -1,5 +1,5 @@
1
- var mtds=function(g){"use strict";const B="_alert_1mpud_1 _ds-alert_194o1_1",R="_avatar_1mpud_1 _ds-avatar_194o1_1",H="_badge_1mpud_1",N="_breadcrumbs_1mpud_1 _ds-breadcrumbs_194o1_1",U="_button_1mpud_1 _ds-button_194o1_1",V="_card_1mpud_1",Y="_chip_1mpud_1 _ds-chip_194o1_1",W="_details_1mpud_1 _ds-details_194o1_1",F="_dialog_1mpud_1 _ds-dialog_194o1_1",j="_divider_1mpud_1",q="_errorsummary_1mpud_1 _ds-error-summary_194o1_1",G="_field_1mpud_1 _ds-field_194o1_1",X="_affixes_1mpud_1 _ds-field-affixes_194o1_1",z="_count_1mpud_1",K="_fieldset_1mpud_1 _ds-fieldset_194o1_1",Q="_heading_1mpud_1 _ds-heading_194o1_1",J="_stack_1mpud_1",Z="_input_1mpud_1 _ds-input_194o1_1",tt="_grid_1mpud_1",et="_flex_1mpud_1",ot="_app_1mpud_1",nt="_link_1mpud_1",st="_logo_1mpud_1 _ds-focus_194o1_1",it="_pagination_1mpud_1 _ds-pagination_194o1_1",ct="_popover_1mpud_1",at="_skeleton_1mpud_1 _ds-skeleton_194o1_1",dt="_spinner_1mpud_1",lt="_table_1mpud_1 _ds-table_194o1_1",rt="__scrollShadow_1mpud_1",ut="_tabs_1mpud_1 _ds-tabs_194o1_1",ft="_tag_1mpud_1 _ds-tag_194o1_1",_t="__tooltip_1mpud_1",pt="_validation_1mpud_1 _ds-validation-message_194o1_1",mt="_body_1mpud_143",u={alert:B,avatar:R,badge:H,breadcrumbs:N,button:U,card:V,chip:Y,details:W,dialog:F,divider:j,errorsummary:q,field:G,affixes:X,count:z,fieldset:K,heading:Q,stack:J,input:Z,grid:tt,flex:et,app:ot,link:nt,logo:st,pagination:it,popover:ct,skeleton:at,spinner:dt,table:lt,_scrollShadow:rt,tabs:ut,tag:ft,_tooltip:_t,validation:pt,body:mt},Wt=Object.freeze(Object.defineProperty({__proto__:null,_scrollShadow:rt,_tooltip:_t,affixes:X,alert:B,app:ot,avatar:R,badge:H,body:mt,breadcrumbs:N,button:U,card:V,chip:Y,count:z,default:u,details:W,dialog:F,divider:j,errorsummary:q,field:G,fieldset:K,flex:et,grid:tt,heading:Q,input:Z,link:nt,logo:st,pagination:it,popover:ct,skeleton:at,spinner:dt,stack:J,table:lt,tabs:ut,tag:ft,validation:pt},Symbol.toStringTag,{value:"Module"})),Ft=(t,e,o)=>{const n=(o-1)/2,s=Math.max(Math.min(t-Math.floor(n),e-o+1),1),c=Math.min(Math.max(t+Math.ceil(n),o),e),i=Array.from({length:c+1-s},(p,b)=>b+s);return o>4&&s>1&&i.splice(0,2,1,0),o>3&&c<e&&i.splice(-2,2,0,e),i},jt=({current:t=1,total:e=10,show:o=7})=>({prev:t>1?t-1:0,next:t<e?t+1:0,pages:Ft(t,e,o).map((n,s)=>({current:n===t&&"page",key:`key-${n}-${s}`,page:n}))}),w=typeof window<"u"&&typeof document<"u",a={capture:!0,passive:!0};function d(t,e,o){return o===void 0?t.getAttribute(e)??null:(o===null?t.removeAttribute(e):t.getAttribute(e)!==o&&t.setAttribute(e,o),null)}let qt=0;const Gt=`${Date.now().toString(36)}${Math.random().toString(36).slice(2,5)}`;function L(t){return t.id||(t.id=`${Gt}${++qt}`),t.id}const bt=(t,e,o)=>{for(const n of o[0].split(","))o[0]=n,e[`${t}EventListener`](...o)},l=(t,...e)=>bt("add",t,e),v=(t,...e)=>bt("remove",t,e),M=new Map,f=w?document.createElement("div"):null;f&&d(f,"style","position:absolute;padding:1px;top:0;left:0px"),w&&l(window,"load,resize,scroll",()=>{for(const[t,e]of M)e()},a);const y={top:0,right:1,bottom:2,left:3};function E(t,e,o){var Yt;if(!e||!e.isConnected||!t.isConnected)return M.delete(t);if(f!=null&&f.isConnected||document.body.append(f||""),!M.has(t)){const De=y[o]??y.bottom;return(Yt=M.set(t,()=>E(t,e,De)).get(t))==null?void 0:Yt()}const{offsetWidth:n,offsetHeight:s}=t,{offsetWidth:c,offsetHeight:i}=e,{width:p,height:b,left:D,top:x}=e.getBoundingClientRect(),h=Math.round(D-(c-p)/2),T=Math.round(x-(i-b)/2),Me=h-n>0,Ae=c+c+n<window.innerWidth,ke=T-s>0,$e=T+i+s<window.innerHeight,Ce=o===y.bottom&&Ae||!Me,Ie=o===y.bottom&&$e||!ke,Oe=Math.min(Math.max(10,h-(n-c)/2),window.innerWidth-n-10),Pe=Math.min(Math.max(10,T-(s-i)/2),window.innerHeight-s-10),Vt=o===y.top||o===y.bottom;t.style.left=`${Math.round(Vt?Oe:Ce?h+c:h-n)}px`,t.style.top=`${Math.round(Vt?Ie?T+i:T-s:Pe)}px`,f==null||f.style.setProperty("translate",`${Math.round(window.scrollX+h+c+n+30)} ${Math.round(window.scrollY+T+i+s+30)}px`)}function Xt(t){let e=0;const o=()=>setTimeout(n,200),n=()=>{t([],s),e=0},s=new MutationObserver(()=>{e||(e=requestAnimationFrame(o))});return s}const A=new WeakMap,zt=t=>{var o;const e=A.get(t);if(!e||!t.isConnected)(o=e==null?void 0:e.observer)==null||o.disconnect(),A.delete(t);else for(const[,n]of e.collections)n()},S=(t,e,o)=>{const n=t.getElementsByClassName(e);let s=A.get(t);s||(s={collections:new Map,observer:Xt(()=>zt(t))},s.observer.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]}),A.set(t,s)),o?s.collections.set(e,()=>o(n)):s.collections.delete(e)},C=t=>t instanceof HTMLElement&&"validity"in t&&!(t instanceof HTMLButtonElement),Kt=u._tooltip.split(" "),ht="aria-describedby",gt="Escape",k="aria-labelledby",Qt="--mtds-tooltip-position",Jt=100,$="mtds-tooltip";let _=null,vt=Number.NEGATIVE_INFINITY,yt=0,r=null;function I({target:t,type:e,key:o}){if(e==="keydown"&&o!==gt)return;const n=vt+Jt-Date.now();clearTimeout(yt),yt=setTimeout(Zt,Math.max(n,0),o===gt?null:t)}function Zt(t){var c;if(vt=Date.now(),!r||t===r)return;let e=((c=t==null?void 0:t.closest)==null?void 0:c.call(t,"[data-tooltip]"))||null;if(e===_)return;const o=(e==null?void 0:e.getAttribute("data-tooltip"))||"",n=(e==null?void 0:e.getAttribute("data-tooltip-position"))||window.getComputedStyle(e||document.body).getPropertyValue(Qt)||"top",s=!!(e!=null&&e.innerText.trim())||(e==null?void 0:e.hasAttribute(k))||(e==null?void 0:e.hasAttribute("aria-label"));(!o||o==="false"||o==="true"||n==="none")&&(e=null),e&&(r.textContent=o),_==null||_.removeAttribute(_.getAttribute(k)===$?k:ht),E(r,!1),_=e,_==null||_.setAttribute(s?ht:k,$),r.togglePopover(!!e),E(r,e,n)}w&&!document.getElementById($)&&(r=document.body.appendChild(document.createElement("div")),r.classList.add(...Kt),r.id=$,d(r,"popover","manual"),l(document,"blur,focus,mouseout,mouseover",I,a),l(window,"keydown",I,a),l(window,"blur",I,a));var St=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",Tt;St&&/^Mac/i.test(((Tt=navigator.userAgentData)==null?void 0:Tt.platform)||navigator.platform);var te=":host(:not([hidden])) { display: block }",Et=typeof HTMLElement>"u"?class{}:HTMLElement;function m(t,e,o){var n;return o===void 0?(n=t.getAttribute(e))!=null?n:null:(o===null?t.removeAttribute(e):t.getAttribute(e)!==o&&t.setAttribute(e,o),null)}var wt=(t,e,o)=>{for(const n of o[0].split(","))o[0]=n,Element.prototype[`${t}EventListener`].apply(e,o)},Lt=(t,...e)=>wt("add",t,e),Mt=(t,...e)=>wt("remove",t,e),ee=t=>{const e="key"in t&&(t.key===" "||t.key==="Enter");return e&&t.preventDefault(),e&&t.target instanceof HTMLElement&&t.target.click(),e},oe=t=>{var e;const o=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return o instanceof Document||o instanceof ShadowRoot?o:document},O=(t,e,o)=>{const n=document.createElement(t);if(e&&(n.textContent=e),o)for(const[s,c]of Object.entries(o))m(n,s,c);return n},At={define:(t,e)=>!St||window.customElements.get(t)||window.customElements.define(t,e)},ne=class extends Et{constructor(){super(),this._content=null,this.attachShadow({mode:"open"}).append(O("slot",null,{name:"summary"}),O("slot",null,{part:"details-content"}),O("style",`${te}
1
+ var mtds=function(y){"use strict";const R="_alert_2k15c_1 _ds-alert_194o1_1",H="_avatar_2k15c_1 _ds-avatar_194o1_1",V="_badge_2k15c_1",U="_breadcrumbs_2k15c_1 _ds-breadcrumbs_194o1_1",Y="_button_2k15c_1 _ds-button_194o1_1",F="_card_2k15c_1",W="_group_2k15c_1",j="_chip_2k15c_1 _ds-chip_194o1_1",q="_details_2k15c_1 _ds-details_194o1_1",G="_dialog_2k15c_1 _ds-dialog_194o1_1",X="_divider_2k15c_1",z="_errorsummary_2k15c_1 _ds-error-summary_194o1_1",K="_field_2k15c_1 _ds-field_194o1_1",Q="_affixes_2k15c_1 _ds-field-affixes_194o1_1",J="_count_2k15c_1",Z="_fieldset_2k15c_1 _ds-fieldset_194o1_1",tt="_heading_2k15c_1 _ds-heading_194o1_1",et="_typostack_2k15c_1",ot="_input_2k15c_1 _ds-input_194o1_1",nt="_grid_2k15c_1",st="_flex_2k15c_1",it="_app_2k15c_1",ct="_link_2k15c_1",at="_logo_2k15c_1",lt="_pagination_2k15c_1 _ds-pagination_194o1_1",rt="_popover_2k15c_1",dt="_skeleton_2k15c_1 _ds-skeleton_194o1_1",ut="_spinner_2k15c_1",ft="_table_2k15c_1 _ds-table_194o1_1",_t="__scrollShadow_2k15c_1",pt="_tabs_2k15c_1 _ds-tabs_194o1_1",mt="_tag_2k15c_1 _ds-tag_194o1_1",ht="__tooltip_2k15c_1",bt="_validation_2k15c_1 _ds-validation-message_194o1_1",gt="_body_2k15c_141",d={alert:R,avatar:H,badge:V,breadcrumbs:U,button:Y,card:F,group:W,chip:j,details:q,dialog:G,divider:X,errorsummary:z,field:K,affixes:Q,count:J,fieldset:Z,heading:tt,typostack:et,input:ot,grid:nt,flex:st,app:it,link:ct,logo:at,pagination:lt,popover:rt,skeleton:dt,spinner:ut,table:ft,_scrollShadow:_t,tabs:pt,tag:mt,_tooltip:ht,validation:bt,body:gt},Gt=Object.freeze(Object.defineProperty({__proto__:null,_scrollShadow:_t,_tooltip:ht,affixes:Q,alert:R,app:it,avatar:H,badge:V,body:gt,breadcrumbs:U,button:Y,card:F,chip:j,count:J,default:d,details:q,dialog:G,divider:X,errorsummary:z,field:K,fieldset:Z,flex:st,grid:nt,group:W,heading:tt,input:ot,link:ct,logo:at,pagination:lt,popover:rt,skeleton:dt,spinner:ut,table:ft,tabs:pt,tag:mt,typostack:et,validation:bt},Symbol.toStringTag,{value:"Module"})),Xt=(t,e,o)=>{const n=(o-1)/2,s=Math.max(Math.min(t-Math.floor(n),e-o+1),1),c=Math.min(Math.max(t+Math.ceil(n),o),e),i=Array.from({length:c+1-s},(r,_)=>_+s);return o>4&&s>1&&i.splice(0,2,1,0),o>3&&c<e&&i.splice(-2,2,0,e),i},zt=({current:t=1,total:e=10,show:o=7})=>({prev:t>1?t-1:0,next:t<e?t+1:0,pages:Xt(t,e,o).map((n,s)=>({current:n===t&&"page",key:`key-${n}-${s}`,page:n}))}),T=typeof window<"u"&&typeof document<"u",l={capture:!0,passive:!0};function a(t,e,o){return o===void 0?t.getAttribute(e)??null:(o===null?t.removeAttribute(e):t.getAttribute(e)!==o&&t.setAttribute(e,o),null)}let Kt=0;const Qt=`${Date.now().toString(36)}${Math.random().toString(36).slice(2,5)}`;function L(t){return t.id||(t.id=`${Qt}${++Kt}`),t.id}const vt=(t,e,o)=>{for(const n of o[0].split(","))o[0]=n,e[`${t}EventListener`](...o)},u=(t,...e)=>vt("add",t,e),k=(t,...e)=>vt("remove",t,e),C=new Map,p=T?document.createElement("div"):null;p&&a(p,"style","position:absolute;padding:1px;top:0;left:0px"),T&&u(window,"load,resize,scroll",()=>{for(const[t,e]of C)e()},l);const w={top:0,right:1,bottom:2,left:3};function E(t,e,o){var qt;if(!e||!e.isConnected||!t.isConnected)return C.delete(t);if(p!=null&&p.isConnected||document.body.append(p||""),!C.has(t)){const Ve=w[o]??w.bottom;return(qt=C.set(t,()=>E(t,e,Ve)).get(t))==null?void 0:qt()}const{offsetWidth:n,offsetHeight:s}=t,{offsetWidth:c,offsetHeight:i}=e,{width:r,height:_,left:S,top:$}=e.getBoundingClientRect(),h=Math.round(S-(c-r)/2),g=Math.round($-(i-_)/2),Oe=h-n>0,xe=c+c+n<window.innerWidth,De=g-s>0,Pe=g+i+s<window.innerHeight,Be=o===w.bottom&&xe||!Oe,Ne=o===w.bottom&&Pe||!De,Re=Math.min(Math.max(10,h-(n-c)/2),window.innerWidth-n-10),He=Math.min(Math.max(10,g-(s-i)/2),window.innerHeight-s-10),jt=o===w.top||o===w.bottom;t.style.left=`${Math.round(jt?Re:Be?h+c:h-n)}px`,t.style.top=`${Math.round(jt?Ne?g+i:g-s:He)}px`,p==null||p.style.setProperty("translate",`${Math.round(window.scrollX+h+c+n+30)} ${Math.round(window.scrollY+g+i+s+30)}px`)}function Jt(t){let e=0;const o=()=>setTimeout(n,200),n=()=>{t([],s),e=0},s=new MutationObserver(()=>{e||(e=requestAnimationFrame(o))});return s}const M=new WeakMap,Zt=t=>{var o;const e=M.get(t);if(!e||!t.isConnected)(o=e==null?void 0:e.observer)==null||o.disconnect(),M.delete(t);else for(const[,n]of e.collections)n()},b=(t,e,o)=>{const n=t.getElementsByClassName(e);let s=M.get(t);s||(s={collections:new Map,observer:Jt(()=>Zt(t))},s.observer.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]}),M.set(t,s)),o?s.collections.set(e,()=>o(n)):s.collections.delete(e)},O=t=>t instanceof HTMLElement&&"validity"in t&&!(t instanceof HTMLButtonElement),te=d._tooltip.split(" "),yt="aria-describedby",kt="Escape",I="aria-labelledby",ee="--mtds-tooltip-position",oe=300,A="mtds-tooltip";let m=null,wt=Number.NEGATIVE_INFINITY,St=0,f=null;function x({target:t,type:e,key:o}){if(e==="keydown"&&o!==kt)return;const n=wt+oe-Date.now();clearTimeout(St),St=setTimeout(ne,Math.max(n,0),o===kt?null:t)}function ne(t){var r;if(wt=Date.now(),!f||t===f)return;let e=((r=t==null?void 0:t.closest)==null?void 0:r.call(t,"[data-tooltip]"))||null;if(e===m)return;const o=e&&a(e,"data-tooltip")||"",n=e&&a(e,"data-tooltip-position")||window.getComputedStyle(e||document.body).getPropertyValue(ee)||"top";(!o||o==="false"||o==="true"||n==="none")&&(e=null),e&&(f.textContent=o);const c=m&&a(m,I)===A,i=!!(e!=null&&e.innerText.trim())||(e==null?void 0:e.hasAttribute(I))||(e==null?void 0:e.hasAttribute("aria-label"));m==null||m.removeAttribute(c?I:yt),E(f,!1),m=e,m&&a(m,i?yt:I,A),f.togglePopover(!!e),E(f,e,n)}T&&!document.getElementById(A)&&(f=document.body.appendChild(document.createElement("div")),f.classList.add(...te),f.id=A,a(f,"popover","manual"),u(document,"blur,focus,mouseout,mouseover",x,l),u(window,"keydown",x,l),u(window,"blur",x,l));var Tt=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",Et;Tt&&/^Mac/i.test(((Et=navigator.userAgentData)==null?void 0:Et.platform)||navigator.platform);var se=":host(:not([hidden])) { display: block }",$t=typeof HTMLElement>"u"?class{}:HTMLElement;function v(t,e,o){var n;return o===void 0?(n=t.getAttribute(e))!=null?n:null:(o===null?t.removeAttribute(e):t.getAttribute(e)!==o&&t.setAttribute(e,o),null)}var Lt=(t,e,o)=>{for(const n of o[0].split(","))o[0]=n,Element.prototype[`${t}EventListener`].apply(e,o)},Ct=(t,...e)=>Lt("add",t,e),Mt=(t,...e)=>Lt("remove",t,e),ie=t=>{const e="key"in t&&(t.key===" "||t.key==="Enter");return e&&t.preventDefault(),e&&t.target instanceof HTMLElement&&t.target.click(),e},ce=t=>{var e;const o=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return o instanceof Document||o instanceof ShadowRoot?o:document},D=(t,e,o)=>{const n=document.createElement(t);if(e&&(n.textContent=e),o)for(const[s,c]of Object.entries(o))v(n,s,c);return n},It={define:(t,e)=>!Tt||window.customElements.get(t)||window.customElements.define(t,e)},ae=class extends $t{constructor(){super(),this._content=null,this.attachShadow({mode:"open"}).append(D("slot",null,{name:"summary"}),D("slot",null,{part:"details-content"}),D("style",`${se}
2
2
  ::slotted(u-summary) { cursor: pointer; display: list-item; counter-increment: list-item 0; list-style: disclosure-closed inside }
3
3
  ::slotted(u-summary[aria-expanded="true"]) { list-style-type: disclosure-open }
4
- :host > [part="details-content"]:not([hidden=""]) { display: block }`))}static get observedAttributes(){return["open"]}connectedCallback(){var t;this._content=(t=this.shadowRoot)==null?void 0:t.children[1],Lt(this._content,"beforematch",this),Lt(this,"click,keydown",this),this.attributeChangedCallback()}disconnectedCallback(){this._content&&Mt(this._content,"beforematch",this),Mt(this,"click,keydown",this),this._content=null}attributeChangedCallback(t,e,o){const n="onbeforematch"in this?"until-found":!0,s=this.open;for(const c of this.children)c.nodeName==="U-SUMMARY"&&m(c,"aria-expanded",`${s}`);if(this._content&&(m(this._content,"aria-hidden",`${!s}`),this._content.hidden=s?!1:n),s&&this.name){const c=oe(this).querySelectorAll(`${this.nodeName}[name="${this.name}"]`);for(const i of c)i!==this&&(i.open=!1)}t==="open"&&e===null!=(o===null)&&this.dispatchEvent(new Event("toggle"))}handleEvent(t){const e=this.querySelector(":scope > u-summary"),o=e==null?void 0:e.contains(t.target);t.defaultPrevented||(t.type==="beforematch"&&(this.open=!0),o&&t.type==="keydown"&&ee(t),o&&t.type==="click"&&(this.open=!this.open))}get open(){return this.hasAttribute("open")}set open(t){m(this,"open",t?"":null)}get name(){return m(this,"name")||""}set name(t){m(this,"name",t)}},se=class extends Et{connectedCallback(){m(this,"role","button"),this.slot="summary",this.tabIndex=0}};At.define("u-details",ne),At.define("u-summary",se);const kt=({clientX:t,clientY:e,target:o})=>{var n;if(o instanceof HTMLDialogElement&&d(o,"data-closedby")==="any"){const{top:s,right:c,bottom:i,left:p}=o.getBoundingClientRect();s<=e&&e<=i&&p<=t&&t<=c||o.close()}else o instanceof Element&&o.closest('button[data-command="close"]')&&((n=o==null?void 0:o.closest("dialog"))==null||n.close())};function ie(t){l(t,"click",kt,a)}function ce(t){v(t,"click",kt,a)}const P=u.field.split(" ")[0],ae="--mtds-text-count-over",de="--mtds-text-count-under",$t=u.validation.split(" "),le=$t[0];function re(t){for(const e of t){const o=[],n=[];let s=null,c=!0;for(const i of e.getElementsByTagName("*"))i instanceof HTMLLabelElement?o.push(i):C(i)?s=i:i.classList.contains(le)?(c=i.getAttribute("data-color")==="success",n.unshift(L(i))):i instanceof HTMLParagraphElement&&n.push(L(i));if(s){for(const i of o)i.htmlFor=L(s);It(s),d(s,"aria-describedby",n.join(" ")),d(s,"aria-invalid",`${!c}`)}}}function Ct({target:t}){C(t)&&It(t)}function It(t){var n,s;const e=t==null?void 0:t.nextElementSibling,o=e==null?void 0:e.getAttribute("data-count");if(e&&o){const c=Number(o)-t.value.length,i=c<0,p=e.getAttribute("aria-live")==="polite",b=window.getComputedStyle(e||t),D=((n=b.getPropertyValue(ae))==null?void 0:n.slice(1,-1))||"",x=((s=b.getPropertyValue(de))==null?void 0:s.slice(1,-1))||"";if(p!==i){d(e,"aria-live",i?"polite":"off");for(const h of $t)e.classList.toggle(h,i)}e.textContent=(i?D:x).replace("%d",`${Math.abs(c)}`)}}function Ot(t){var e,o;(o=(e=t.target)==null?void 0:e.closest)!=null&&o.call(e,`.${P}`)&&t.preventDefault()}function ue(t){S(t,P,re),l(t,"input",Ct,a),l(t,"invalid",Ot,!0)}function fe(t){S(t,P,!1),v(t,"input",Ct,a),v(t,"invalid",Ot,!0)}const Pt=u.fieldset.split(" ")[0],_e=u.validation.split(" ")[0];function pe(t){for(const e of t){const o=[];let n="";for(const s of e.getElementsByTagName("*"))s.classList.contains(_e)?n=L(s):C(s)&&o.push(s);if(n)for(const s of o)d(s,"aria-describedby",n),d(s,"aria-invalid","true")}}const me=t=>S(t,Pt,pe),be=t=>S(t,Pt,!1),Dt=u.app.split(" ")[0],he=`.${Dt} > header + :not(main) > button:empty:first-child`,xt=({target:t})=>{const e=(t==null?void 0:t.nodeName)==="BUTTON"&&(t==null?void 0:t.closest(he));if(!e)return;const o=e.closest(`.${Dt} > *`),n=()=>o==null?void 0:o.setAttribute("data-expanded",`${(o==null?void 0:o.getAttribute("data-expanded"))==="false"}`);document.startViewTransition?document.startViewTransition(()=>n()):n()};function ge(t){l(t,"click",xt,a)}function ve(t){v(t,"click",xt,a)}function ye(t){l(t,"toggle",Rt,a),l(t,"click",Ht)}function Se(t){v(t,"toggle",Rt,a),v(t,"click",Ht)}const Bt=u.popover.split(" ")[0];function Rt({target:t,newState:e}){var o;if(t instanceof HTMLElement&&t.classList.contains(Bt)){const n=(o=t.getRootNode())==null?void 0:o.querySelector(`[popovertarget="${t.id}"]`);e==="closed"?E(t,!1):n&&E(t,n,t.getAttribute("data-position")||"bottom")}}function Ht({target:t}){var o,n;const e=(o=t==null?void 0:t.closest)==null?void 0:o.call(t,"a");if(e){const s=e.getRootNode(),c=((n=s.getElementById)==null?void 0:n.call(s,d(e,"popovertarget")||""))||e.closest(`.${Bt}`),i=d(e,"popovertargetaction")||"toggle";c==null||c.togglePopover(i==="show"||(i==="hide"?!1:void 0))}}const Nt=u.table.split(" ")[0];function Te(t){var e,o;for(const n of t)if(n instanceof HTMLTableElement){const s=Array.from(((o=(e=n.tHead)==null?void 0:e.rows[0])==null?void 0:o.cells)||[],c=>{var i;return(i=c.innerText)==null?void 0:i.trim()});for(const c of n.tBodies)for(const i of c.rows)for(const p of i.cells)d(p,"data-th",s[p.cellIndex]||":empty")}}const Ee=t=>S(t,Nt,Te),we=t=>S(t,Nt,!1);if(w){const t=document.readyState==="loading",e=()=>Ut(document.body);t?document.addEventListener("DOMContentLoaded",e):e()}function Ut(t){ie(t),ue(t),me(t),ge(t),ye(t),Ee(t)}function Le(t){ce(t),fe(t),be(t),ve(t),Se(t),we(t)}return g.observe=Ut,g.pagination=jt,g.styles=Wt,g.unobserve=Le,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}),g}({});
4
+ :host > [part="details-content"]:not([hidden=""]) { display: block }`))}static get observedAttributes(){return["open"]}connectedCallback(){var t;this._content=(t=this.shadowRoot)==null?void 0:t.children[1],Ct(this._content,"beforematch",this),Ct(this,"click,keydown",this),this.attributeChangedCallback()}disconnectedCallback(){this._content&&Mt(this._content,"beforematch",this),Mt(this,"click,keydown",this),this._content=null}attributeChangedCallback(t,e,o){const n="onbeforematch"in this?"until-found":!0,s=this.open;for(const c of this.children)c.nodeName==="U-SUMMARY"&&v(c,"aria-expanded",`${s}`);if(this._content&&(v(this._content,"aria-hidden",`${!s}`),this._content.hidden=s?!1:n),s&&this.name){const c=ce(this).querySelectorAll(`${this.nodeName}[name="${this.name}"]`);for(const i of c)i!==this&&(i.open=!1)}t==="open"&&e===null!=(o===null)&&this.dispatchEvent(new Event("toggle"))}handleEvent(t){const e=this.querySelector(":scope > u-summary"),o=e==null?void 0:e.contains(t.target);t.defaultPrevented||(t.type==="beforematch"&&(this.open=!0),o&&t.type==="keydown"&&ie(t),o&&t.type==="click"&&(this.open=!this.open))}get open(){return this.hasAttribute("open")}set open(t){v(this,"open",t?"":null)}get name(){return v(this,"name")||""}set name(t){v(this,"name",t)}},le=class extends $t{connectedCallback(){v(this,"role","button"),this.slot="summary",this.tabIndex=0}};It.define("u-details",ae),It.define("u-summary",le);const At=({clientX:t,clientY:e,target:o})=>{var n;if(o instanceof HTMLDialogElement&&a(o,"data-closedby")==="any"){const{top:s,right:c,bottom:i,left:r}=o.getBoundingClientRect();s<=e&&e<=i&&r<=t&&t<=c||o.close()}else o instanceof Element&&o.closest('button[data-command="close"]')&&((n=o==null?void 0:o.closest("dialog"))==null||n.close())};function re(t){u(t,"click",At,l)}function de(t){k(t,"click",At,l)}const P=d.field.split(" ")[0],ue="--mtds-text-count-over",fe="--mtds-text-count-under",Ot=d.validation.split(" "),_e=Ot[0];function pe(t){for(const e of t){const o=[],n=[];let s=null,c=!0;for(const i of e.getElementsByTagName("*"))i instanceof HTMLLabelElement?o.push(i):O(i)?s=i:i.classList.contains(_e)?(c=a(i,"data-color")==="success",n.unshift(L(i))):i instanceof HTMLParagraphElement&&n.push(L(i));if(s){for(const i of o)i.htmlFor=L(s);Dt(s),a(s,"aria-describedby",n.join(" ")),a(s,"aria-invalid",`${!c}`)}}}function xt({target:t}){O(t)&&Dt(t)}function Dt(t){var n,s;const e=t==null?void 0:t.nextElementSibling,o=e&&a(e,"data-count");if(e&&o){const c=Number(o)-t.value.length,i=c<0,r=a(e,"aria-live")==="polite",_=window.getComputedStyle(e||t),S=((n=_.getPropertyValue(ue))==null?void 0:n.slice(1,-1))||"",$=((s=_.getPropertyValue(fe))==null?void 0:s.slice(1,-1))||"";if(r!==i){a(e,"aria-live",i?"polite":"off");for(const h of Ot)e.classList.toggle(h,i)}e.textContent=(i?S:$).replace("%d",`${Math.abs(c)}`)}}function Pt(t){var e,o;(o=(e=t.target)==null?void 0:e.closest)!=null&&o.call(e,`.${P}`)&&t.preventDefault()}function me(t){b(t,P,pe),u(t,"input",xt,l),u(t,"invalid",Pt,!0)}function he(t){b(t,P,!1),k(t,"input",xt,l),k(t,"invalid",Pt,!0)}const Bt=d.fieldset.split(" ")[0],be=d.validation.split(" ")[0];function ge(t){for(const e of t){const o=[];let n=null;for(const s of e.getElementsByTagName("*"))s.classList.contains(be)?n=L(s):O(s)&&o.push(s);for(const s of o)a(s,"aria-describedby",n),a(s,"aria-invalid",`${!!n}`)}}const ve=t=>b(t,Bt,ge),ye=t=>b(t,Bt,!1),Nt=d.app.split(" ")[0],ke=`.${Nt} > header + :not(main) > button:empty:first-child`,Rt=({target:t})=>{const e=(t==null?void 0:t.nodeName)==="BUTTON"&&(t==null?void 0:t.closest(ke));if(!e)return;const o=e.closest(`.${Nt} > *`),n=()=>o&&a(o,"data-expanded",`${a(o,"data-expanded")==="false"}`);document.startViewTransition?document.startViewTransition(()=>n()):n()};function we(t){u(t,"click",Rt,l)}function Se(t){k(t,"click",Rt,l)}const B=d.logo.split(" ")[0];let N;function Ht(t){var i,r,_;const e=(i=t[0])==null?void 0:i.firstElementChild;if(!e)return;if(!N){const{head:S}=((r=window.top)==null?void 0:r.document)||document,$=S.getElementsByTagName("link[rel~='icon']"),h=document.createElement("link");for(const g of $)g.remove();N=S.appendChild(Object.assign(h,{rel:"icon"}))}const o=(_=e.parentElement)==null?void 0:_.hasAttribute("data-color"),n=window.getComputedStyle(e),s=n.getPropertyValue("color"),c=n.getPropertyValue("background-color");N.href=`data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 55 55'><rect fill='${o?"none":c}' width='51' height='51' x='2' y='2' stroke='${s}' stroke-dasharray='0.09 6.38' stroke-linecap='round' stroke-opacity='${o?.6:0}' stroke-width='2.3' rx='25.5'/><g transform="translate(7.5 7.5)">${encodeURIComponent(e.outerHTML.replace(/(fill|width|height|xmlns)=\S+/gi,"").replace("<svg",`<svg width="40" height="40" fill="${s}"`))}</g></svg>`}T&&setTimeout(()=>Ht(document.getElementsByClassName(B)),300);const Te=t=>b(t,B,Ht),Ee=t=>b(t,B,!1),Vt=d.popover.split(" ")[0];function $e(t){u(t,"toggle",Ut,l),u(t,"click",Yt)}function Le(t){k(t,"toggle",Ut,l),k(t,"click",Yt)}function Ut({target:t,newState:e}){var o;if(t instanceof HTMLElement&&t.classList.contains(Vt)){const n=(o=t.getRootNode())==null?void 0:o.querySelector(`[popovertarget="${t.id}"]`);e==="closed"?E(t,!1):n&&E(t,n,a(t,"data-position")||"bottom")}}function Yt({target:t}){var o,n;const e=(o=t==null?void 0:t.closest)==null?void 0:o.call(t,"a");if(e){const s=e.getRootNode(),c=((n=s.getElementById)==null?void 0:n.call(s,a(e,"popovertarget")||""))||e.closest(`.${Vt}`),i=a(e,"popovertargetaction")||"toggle";c==null||c.togglePopover(i==="show"||(i==="hide"?!1:void 0))}}const Ft=d.table.split(" ")[0];function Ce(t){for(const e of t){const o=[];a(e,"role","table"),e.caption&&a(e.caption,"role","caption");for(const n of[e.tHead,e.tFoot,...e.tBodies])if(n){a(n,"role","rowgroup");const s=n.nodeName==="TBODY";for(const c of n.rows){a(c,"role","row");for(const i of c.cells)s?a(i,"data-th",o[i.cellIndex]||":empty"):o.push(i.innerText.trim()),i.nodeName==="TD"?a(i,"role","cell"):(a(i,"role",s?"rowheader":"columnheader"),a(i,"scope",s?"row":"col"))}}}}const Me=t=>b(t,Ft,Ce),Ie=t=>b(t,Ft,!1);if(T){const t=document.readyState==="loading",e=()=>Wt(document.body);t?document.addEventListener("DOMContentLoaded",e):e()}function Wt(t){re(t),me(t),ve(t),we(t),Te(t),$e(t),Me(t)}function Ae(t){de(t),he(t),ye(t),Se(t),Ee(t),Le(t),Ie(t)}return y.observe=Wt,y.pagination=zt,y.styles=Gt,y.unobserve=Ae,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),y}({});
5
5
  //# sourceMappingURL=index.iife.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.iife.js","sources":["../designsystem/pagination/pagination-helper.ts","../designsystem/utils.ts","../designsystem/tooltip/tooltip-observer.ts","../node_modules/@u-elements/u-details/dist/u-details.js","../designsystem/dialog/dialog-observer.ts","../designsystem/field/field-observer.ts","../designsystem/fieldset/fieldset-observer.ts","../designsystem/layout/layout-observer.ts","../designsystem/popover/popover-observer.ts","../designsystem/table/table-observer.ts","../designsystem/index.ts"],"sourcesContent":["const getSteps = (now: number, max: number, show: number) => {\n const offset = (show - 1) / 2;\n const start = Math.max(Math.min(now - Math.floor(offset), max - show + 1), 1);\n const end = Math.min(Math.max(now + Math.ceil(offset), show), max);\n const pages = Array.from({ length: end + 1 - start }, (_, i) => i + start);\n\n if (show > 4 && start > 1) pages.splice(0, 2, 1, 0);\n if (show > 3 && end < max) pages.splice(-2, 2, 0, max);\n return pages;\n};\n\nexport const pagination = ({ current = 1, total = 10, show = 7 }) => ({\n prev: current > 1 ? current - 1 : 0,\n next: current < total ? current + 1 : 0,\n pages: getSteps(current, total, show).map((page, index) => ({\n current: page === current && (\"page\" as const),\n key: `key-${page}-${index}`,\n page,\n })),\n});\n","export const IS_BROWSER = typeof window !== 'undefined' && typeof document !== 'undefined';\nexport const QUICK_EVENT = { capture: true, passive: true };\n\n/**\n * attr\n * @description Utility to quickly get, set and remove attributes\n * @param el The Element to use as EventTarget\n * @param name The attribute name to get, set or remove, or a object to set multiple attributes\n * @param value A valid attribute value or null to remove attribute\n */\nexport function attr(\n\tel: Element,\n\tname: string,\n\tvalue?: string | null,\n): string | null {\n\tif (value === undefined) return el.getAttribute(name) ?? null; // Fallback to null only if el is undefined\n\tif (value === null) el.removeAttribute(name);\n\telse if (el.getAttribute(name) !== value) el.setAttribute(name, value);\n\treturn null;\n}\n\n/**\n * useId\n * @return A generated unique ID\n */\nlet id = 0;\nconst UUID = `${Date.now().toString(36)}${Math.random().toString(36).slice(2, 5)}`;\nexport function useId (el: Element) {\n if (!el.id) el.id = `${UUID}${++id}`;\n\treturn el.id;\n};\n\n// Internal helper for on / off\nconst events = (\n\taction: \"add\" | \"remove\",\n\telement: Node | Window,\n\trest: Parameters<typeof Element.prototype.addEventListener>,\n): void => {\n\tfor (const type of rest[0].split(\",\")) {\n\t\trest[0] = type;\n\t\telement[`${action}EventListener`](...rest);\n\t}\n};\n\n/**\n * on\n * @param element The Element to use as EventTarget\n * @param types A comma separated string of event types\n * @param listener An event listener function or listener object\n */\nexport const on = (\n\telement: Node | Window,\n\t...rest: Parameters<typeof Element.prototype.addEventListener>\n): void => events(\"add\", element, rest);\n\n/**\n * off\n * @param element The Element to use as EventTarget\n * @param types A comma separated string of event types\n * @param listener An event listener function or listener object\n */\nexport const off = (\n\telement: Node | Window,\n\t...rest: Parameters<typeof Element.prototype.removeEventListener>\n): void => events(\"remove\", element, rest);\n\n\nconst TARGETS = new Map<Element, () => void>(); // Store current open poppers and their update functions\nconst SCROLLER = IS_BROWSER ? document.createElement('div') : null // Used to ensure we have scrollability under\nif (SCROLLER) attr(SCROLLER, 'style', 'position:absolute;padding:1px;top:0;left:0px');\n\nif (IS_BROWSER){\n\ton(window, 'load,resize,scroll', () => {\n\t\tfor (const [_, update] of TARGETS) update();\n\t}, QUICK_EVENT);}\n\t\n/**\n * anchorPosition\n * @param target The Element to position\n * @param anchor The Element to use as anchor\n */\nconst POSITION = { top: 0, right: 1, bottom: 2, left: 3 }; // Speed up by using a const map\n\nexport function anchorPosition (target: HTMLElement, anchor: HTMLElement | null | false, position?: string | number) {\n\tif (!anchor || !anchor.isConnected || !target.isConnected) return TARGETS.delete(target); // Stop watchning if anchor is removed from DOM\n\tif (!SCROLLER?.isConnected) document.body.append(SCROLLER || ''); // Ensure we have t´he scroller\n\tif (!TARGETS.has(target)) { // Setup new target or update position\n\t\tconst place = POSITION[position as keyof typeof POSITION] ?? POSITION.bottom; // Use CSS property to store position for more flexibility\n\t\treturn TARGETS.set(target, () => anchorPosition(target, anchor, place)).get(target)?.(); // Start watching if not already watching\n\t}\n\n const { offsetWidth: targetW, offsetHeight: targetH } = target;\n const { offsetWidth: anchorW, offsetHeight: anchorH } = anchor;\n const { width, height, left, top } = anchor.getBoundingClientRect();\n\tconst anchorX = Math.round(left - (anchorW - width) / 2); // Correct for CSS transform scale\n const anchorY = Math.round(top - (anchorH - height) / 2); // Correct for CSS transform scale\n\n\tconst hasSpaceLeft = anchorX - targetW > 0\n\tconst hasSpaceRight = anchorW + anchorW + targetW < window.innerWidth;\n\tconst hasSpaceOver = anchorY - targetH > 0\n\tconst hasSpaceUnder = anchorY + anchorH + targetH < window.innerHeight;\n\tconst positionRight = (position === POSITION.bottom && hasSpaceRight) || !hasSpaceLeft // Always position right when no hasSpaceLeft, as no OS scrolls further up than 0\n\tconst positionUnder = (position === POSITION.bottom && hasSpaceUnder) || !hasSpaceOver // Always position under when no hasSpaceOver, as no OS scrolls further up than 0\n\tconst centerX = Math.min(Math.max(10, anchorX - (targetW - anchorW) / 2), window.innerWidth - targetW - 10);\n\tconst centerY = Math.min(Math.max(10, anchorY - (targetH - anchorH) / 2), window.innerHeight - targetH - 10);\n\tconst isVertical = position === POSITION.top || position === POSITION.bottom;\n\n\ttarget.style.left = `${Math.round(isVertical ? centerX : (positionRight ? anchorX + anchorW : anchorX - targetW))}px`\n target.style.top = `${Math.round(isVertical ? (positionUnder ? anchorY + anchorH : anchorY - targetH) : centerY)}px`\n SCROLLER?.style.setProperty('translate', `${Math.round(window.scrollX + anchorX + anchorW + targetW + 30)} ${Math.round(window.scrollY + anchorY + anchorH + targetH + 30)}px`);\n}\n\n/**\n * Speed up MutationObserver by debouncing and only running when page is visible\n * @return new MutaionObserver\n */\nexport function createOptimizedMutationObserver(callback: MutationCallback) {\n let queue = 0;\n\n\tconst onFrame = () => setTimeout(onTimer, 200); // Use both requestAnimationFrame and setTimeout to debounce and only run when visible\n\tconst onTimer = () => {\n\t\tcallback([], observer);\n\t\tqueue = 0;\n\t};\n const observer = new MutationObserver(() => {\n if (!queue) queue = requestAnimationFrame(onFrame);\n });\n\n return observer;\n}\n\ntype Mutator = { observer: MutationObserver, collections: Map<string, () => void> };\nconst MUTATORS = new WeakMap<Element, Mutator>();\nconst MUTATORS_CALLBACK = (element: Element) => {\n\tconst mutator = MUTATORS.get(element);\n\n\tif (!mutator || !element.isConnected) {\n\t\tmutator?.observer?.disconnect();\n\t\tMUTATORS.delete(element);\n\t} else for(const [, callback] of mutator.collections) callback();\n};\n\n/**\n * onMutation\n * @description Utility to quickly observe mutations on a specific class name\n * @param element The Element to use as EventTarget\n * @param className The class name to observe\n * @param callback The callback to run when mutations are detected or false to stop observing\n */\nexport const onMutation = (\n\telement: Element,\n\tclassName: string,\n\tcallback: ((collection: HTMLCollection) => void) | false\n) => {\n\tconst collection = element.getElementsByClassName(className);\n\tlet mutator = MUTATORS.get(element);\n\n\tif (!mutator) {\n\t\tmutator = { collections: new Map(), observer: createOptimizedMutationObserver(() => MUTATORS_CALLBACK(element)) };\n\t\tmutator.observer.observe(element, { childList: true, subtree: true, attributes: true, attributeFilter: ['class'] });\n\t\tMUTATORS.set(element, mutator);\n\t}\n\tif (callback) mutator.collections.set(className, () => callback(collection));\n\telse mutator.collections.delete(className);\n}\n\nexport const isInputLike = (el: unknown): el is HTMLInputElement =>\n\tel instanceof HTMLElement && 'validity' in el && !(el instanceof HTMLButtonElement);\n\n// Make React support popover=\"\"target attribute\n// https://github.com/facebook/react/issues/27479\ntype Popover = \"\" | \"auto\" | \"manual\" | undefined;\ndeclare global {\n\tnamespace React.JSX {\n\t\tinterface IntrinsicAttributes {\n\t\t\tpopovertargetaction?: string;\n\t\t\tpopovertarget?: string;\n\t\t\tpopover?: Popover;\n\t\t}\n\t}\n\tnamespace React {\n\t\tinterface HTMLAttributes<T> {\n\t\t\tpopovertargetaction?: string;\n\t\t\tpopovertarget?: string;\n\t\t\tpopover?: Popover;\n\t\t}\n\t}\n}","import styles from \"../styles.module.css\";\nimport { IS_BROWSER, QUICK_EVENT, anchorPosition, attr, on } from \"../utils\";\n\nconst CSS_TOOLTIP = styles._tooltip.split(\" \");\nconst DESCRIBEDBY = \"aria-describedby\";\nconst ESC = \"Escape\";\nconst LABELLEDBY = \"aria-labelledby\";\nconst POSITION_CSS_PROPERTY = \"--mtds-tooltip-position\";\nconst THROTTLE_DELAY = 100;\nconst TOOLTIP_ID = \"mtds-tooltip\";\n\nlet ANCHOR: HTMLElement | null = null;\nlet LAST_CALL = Number.NEGATIVE_INFINITY;\nlet THROTTLE: number | ReturnType<typeof setTimeout> = 0;\nlet TOOLTIP: HTMLElement | null = null;\n\nfunction handleMove({ target, type, key }: Event & { key?: string }) {\n if (type === \"keydown\" && key !== ESC) return; // Allow ESC dismiss to follow https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/\n const wait = LAST_CALL + THROTTLE_DELAY - Date.now();\n clearTimeout(THROTTLE);\n THROTTLE = setTimeout(\n handleMoveThrottled,\n Math.max(wait, 0),\n key === ESC ? null : target\n );\n}\n\n// Using a throttled function to avoid performance issues\nfunction handleMoveThrottled(target: Element | null) {\n LAST_CALL = Date.now();\n\n if (!TOOLTIP || target === TOOLTIP) return; // Allow tooltip to be hovered, following https://www.w3.org/TR/WCAG21/#content-on-hover-or-focus\n let anchor = target?.closest?.<HTMLElement>(\"[data-tooltip]\") || null;\n\n // No need to update\n if (anchor === ANCHOR) return;\n\n const content = anchor?.getAttribute(\"data-tooltip\") || \"\";\n const position =\n anchor?.getAttribute(\"data-tooltip-position\") ||\n window\n .getComputedStyle(anchor || document.body)\n .getPropertyValue(POSITION_CSS_PROPERTY) ||\n \"top\";\n const hasLabel =\n Boolean(anchor?.innerText.trim()) ||\n anchor?.hasAttribute(LABELLEDBY) ||\n anchor?.hasAttribute(\"aria-label\");\n\n if (\n !content ||\n content === \"false\" ||\n content === \"true\" ||\n position === \"none\"\n )\n anchor = null; // Do not show tooltip if boolish value\n if (anchor) TOOLTIP.textContent = content; // Only update content if new anchor\n\n ANCHOR?.removeAttribute(\n ANCHOR.getAttribute(LABELLEDBY) === TOOLTIP_ID ? LABELLEDBY : DESCRIBEDBY\n ); // Unlink previous anchor\n anchorPosition(TOOLTIP, false); // Reset anchor position\n\n ANCHOR = anchor; // Store new anchor - might be null if no new anchor\n ANCHOR?.setAttribute(hasLabel ? DESCRIBEDBY : LABELLEDBY, TOOLTIP_ID); // Use tooltip as description if allready has label\n TOOLTIP.togglePopover(!!anchor);\n anchorPosition(TOOLTIP, anchor, position);\n}\n\n// Initialize if in browser and not already initialized\nif (IS_BROWSER && !document.getElementById(TOOLTIP_ID)) {\n TOOLTIP = document.body.appendChild(document.createElement(\"div\"));\n TOOLTIP.classList.add(...CSS_TOOLTIP);\n TOOLTIP.id = TOOLTIP_ID;\n attr(TOOLTIP, \"popover\", \"manual\");\n on(document, \"blur,focus,mouseout,mouseover\", handleMove, QUICK_EVENT);\n on(window, \"keydown\", handleMove, QUICK_EVENT);\n on(window, \"blur\", handleMove, QUICK_EVENT);\n}\n","// ../utils.ts\nvar IS_BROWSER = typeof window !== \"undefined\" && typeof window.document !== \"undefined\" && typeof window.navigator !== \"undefined\";\nvar _a;\nIS_BROWSER && // @ts-expect-error Typescript has not implemented userAgentData yet https://stackoverflow.com/a/71392474\n/^Mac/i.test(((_a = navigator.userAgentData) == null ? void 0 : _a.platform) || navigator.platform);\nvar DISPLAY_BLOCK = \":host(:not([hidden])) { display: block }\";\nvar UHTMLElement = typeof HTMLElement === \"undefined\" ? class {\n} : HTMLElement;\nfunction attr(el, name, value) {\n var _a2;\n if (value === void 0) return (_a2 = el.getAttribute(name)) != null ? _a2 : null;\n if (value === null) el.removeAttribute(name);\n else if (el.getAttribute(name) !== value) el.setAttribute(name, value);\n return null;\n}\nvar events = (action, element, rest) => {\n for (const type of rest[0].split(\",\")) {\n rest[0] = type;\n Element.prototype[`${action}EventListener`].apply(element, rest);\n }\n};\nvar on = (element, ...rest) => events(\"add\", element, rest);\nvar off = (element, ...rest) => events(\"remove\", element, rest);\nvar asButton = (event) => {\n const isClick = \"key\" in event && (event.key === \" \" || event.key === \"Enter\");\n if (isClick) event.preventDefault();\n if (isClick && event.target instanceof HTMLElement) event.target.click();\n return isClick;\n};\nvar getRoot = (node) => {\n var _a2;\n const root = ((_a2 = node.getRootNode) == null ? void 0 : _a2.call(node)) || node.ownerDocument;\n return root instanceof Document || root instanceof ShadowRoot ? root : document;\n};\nvar createElement = (tagName, text, attrs) => {\n const el = document.createElement(tagName);\n if (text) el.textContent = text;\n if (attrs) for (const [key, val] of Object.entries(attrs)) attr(el, key, val);\n return el;\n};\nvar customElements = {\n define: (name, instance) => !IS_BROWSER || window.customElements.get(name) || window.customElements.define(name, instance)\n};\n\n// u-details.ts\nvar UHTMLDetailsElement = class extends UHTMLElement {\n constructor() {\n super();\n // Using underscore instead of private fields for backwards compatibility\n this._content = null;\n this.attachShadow({ mode: \"open\" }).append(\n createElement(\"slot\", null, { name: \"summary\" }),\n createElement(\"slot\", null, { part: \"details-content\" }),\n createElement(\n \"style\",\n `${DISPLAY_BLOCK}\n ::slotted(u-summary) { cursor: pointer; display: list-item; counter-increment: list-item 0; list-style: disclosure-closed inside }\n ::slotted(u-summary[aria-expanded=\"true\"]) { list-style-type: disclosure-open }\n\t\t\t\t:host > [part=\"details-content\"]:not([hidden=\"\"]) { display: block }`\n )\n );\n }\n // Using ES2015 syntax for backwards compatibility\n static get observedAttributes() {\n return [\"open\"];\n }\n connectedCallback() {\n var _a2;\n this._content = (_a2 = this.shadowRoot) == null ? void 0 : _a2.children[1];\n on(this._content, \"beforematch\", this);\n on(this, \"click,keydown\", this);\n this.attributeChangedCallback();\n }\n disconnectedCallback() {\n if (this._content) off(this._content, \"beforematch\", this);\n off(this, \"click,keydown\", this);\n this._content = null;\n }\n attributeChangedCallback(prop, prev, next) {\n const hide = \"onbeforematch\" in this ? \"until-found\" : true;\n const open = this.open;\n for (const el of this.children)\n if (el.nodeName === \"U-SUMMARY\") attr(el, \"aria-expanded\", `${open}`);\n if (this._content) {\n attr(this._content, \"aria-hidden\", `${!open}`);\n this._content.hidden = open ? false : hide;\n }\n if (open && this.name) {\n const uDetailsList = getRoot(this).querySelectorAll(\n `${this.nodeName}[name=\"${this.name}\"]`\n );\n for (const uDetails of uDetailsList)\n if (uDetails !== this) uDetails.open = false;\n }\n if (prop === \"open\" && prev === null !== (next === null))\n this.dispatchEvent(new Event(\"toggle\"));\n }\n handleEvent(event) {\n const summary = this.querySelector(\":scope > u-summary\");\n const isSummary = summary == null ? void 0 : summary.contains(event.target);\n if (event.defaultPrevented) return;\n if (event.type === \"beforematch\") this.open = true;\n if (isSummary && event.type === \"keydown\") asButton(event);\n if (isSummary && event.type === \"click\") this.open = !this.open;\n }\n get open() {\n return this.hasAttribute(\"open\");\n }\n set open(value) {\n attr(this, \"open\", value ? \"\" : null);\n }\n get name() {\n return attr(this, \"name\") || \"\";\n }\n set name(value) {\n attr(this, \"name\", value);\n }\n};\nvar UHTMLSummaryElement = class extends UHTMLElement {\n connectedCallback() {\n attr(this, \"role\", \"button\");\n this.slot = \"summary\";\n this.tabIndex = 0;\n }\n};\ncustomElements.define(\"u-details\", UHTMLDetailsElement);\ncustomElements.define(\"u-summary\", UHTMLSummaryElement);\n\nexport { UHTMLDetailsElement, UHTMLSummaryElement };\n","import { QUICK_EVENT, attr, off, on } from '../utils';\n\nconst handleClick = ({ clientX: x, clientY: y, target: el }: MouseEvent) => {\n if (el instanceof HTMLDialogElement && attr(el, 'data-closedby') === 'any') {\n const { top, right, bottom, left } = el.getBoundingClientRect();\n const isInside = top <= y && y <= bottom && left <= x && x <= right;\n \n if (!isInside) el.close();\n } else if (el instanceof Element && el.closest('button[data-command=\"close\"]')) {\n el?.closest('dialog')?.close();\n }\n};\n\nexport function observe(el: Element) {\n on(el, 'click', handleClick as EventListener, QUICK_EVENT);\n}\n\nexport function unobserve(el: Element) {\n off(el, 'click', handleClick as EventListener, QUICK_EVENT);\n}","import styles from '../styles.module.css';\nimport { QUICK_EVENT, attr, isInputLike, off, on, onMutation, useId } from '../utils';\n\nconst CSS_FIELD = styles.field.split(' ')[0];\nconst CSS_PROPERTY_OVER = '--mtds-text-count-over';\nconst CSS_PROPERTY_UNDER = '--mtds-text-count-under';\nconst CSS_VALIDATIONS = styles.validation.split(' ');\nconst CSS_VALIDATION = CSS_VALIDATIONS[0];\n\nfunction renderAria(fields: HTMLCollectionOf<Element>) {\n for(const field of fields) {\n const labels: HTMLLabelElement[] = [];\n const descs: string[] = [];\n let input: HTMLInputElement | null = null;\n let valid = true;\n\n for (const el of field.getElementsByTagName('*')) {\n if (el instanceof HTMLLabelElement) labels.push(el);\n else if (isInputLike(el)) input = el;\n else if (el.classList.contains(CSS_VALIDATION)) { // Must be before instanceof HTMLParagraphElement since validation can also be a <p>\n valid = el.getAttribute('data-color') === 'success';\n descs.unshift(useId(el));\n } else if (el instanceof HTMLParagraphElement) descs.push(useId(el));\n }\n\n if (input) {\n for (const label of labels) label.htmlFor = useId(input);\n renderCounter(input);\n attr(input, 'aria-describedby', descs.join(' '));\n attr(input, 'aria-invalid', `${!valid}`);\n }\n }\n}\nfunction handleInput({ target }: Event) {\n if (isInputLike(target)) renderCounter(target);\n}\n\nfunction renderCounter(input: HTMLInputElement) {\n const el = input?.nextElementSibling;\n const limit = el?.getAttribute('data-count');\n \n if (el && limit) {\n const remainder = Number(limit) - input.value.length;\n const nextInvalid = remainder < 0;\n const prevInvalid = el.getAttribute('aria-live') === 'polite';\n const style = window.getComputedStyle(el || input);\n const over = style.getPropertyValue(CSS_PROPERTY_OVER)?.slice(1, -1) || ''; // slice to trim quotes\n const under = style.getPropertyValue(CSS_PROPERTY_UNDER)?.slice(1, -1) || ''; // slice to trim quotes\n\n if (prevInvalid !== nextInvalid) {\n attr(el, 'aria-live', nextInvalid ? 'polite' : 'off');\n for (const css of CSS_VALIDATIONS) el.classList.toggle(css, nextInvalid);\n }\n el.textContent = (nextInvalid ? over : under).replace('%d', `${Math.abs(remainder)}`);\n }\n}\n\n// Prevent browsers from showing default validation bubbles\nfunction handleInvalid(event: Event) {\n if ((event.target as Element)?.closest?.(`.${CSS_FIELD}`)) event.preventDefault();\n}\n\nexport function observe (el: Element) {\n onMutation(el, CSS_FIELD, renderAria);\n on(el, 'input', handleInput, QUICK_EVENT);\n on(el, 'invalid', handleInvalid, true); // Use capture as invalid does noe buttle\n}\n\nexport function unobserve (el: Element) {\n onMutation(el, CSS_FIELD, false);\n off(el, 'input', handleInput, QUICK_EVENT);\n off(el, 'invalid', handleInvalid, true);\n}\n","import styles from '../styles.module.css';\nimport { attr, isInputLike, onMutation, useId } from '../utils';\nconst CSS_FIELDSET = styles.fieldset.split(' ')[0];\nconst CSS_VALIDATION = styles.validation.split(' ')[0];\n\nfunction process(fieldsets: HTMLCollectionOf<Element>) {\n for(const fieldset of fieldsets) {\n const inputs: HTMLInputElement[] = [];\n let validationId = '';\n\n for (const el of fieldset.getElementsByTagName('*')) {\n if (el.classList.contains(CSS_VALIDATION)) validationId = useId(el);\n else if (isInputLike(el)) inputs.push(el);\n }\n\n if (validationId) \n for(const input of inputs) {\n attr(input, 'aria-describedby', validationId);\n attr(input, 'aria-invalid', 'true');\n }\n }\n}\n\nexport const observe = (el: Element) => onMutation(el, CSS_FIELDSET, process);\nexport const unobserve = (el: Element) => onMutation(el, CSS_FIELDSET, false);\n","import styles from '../styles.module.css';\nimport { QUICK_EVENT, off, on } from '../utils';\n\nconst CSS_APP = styles.app.split(' ')[0];\nconst CSS_TOGGLE = `.${CSS_APP} > header + :not(main) > button:empty:first-child`;\n\nconst handleToggleClick = ({ target: el }: Event) => {\n const btn = (el as Element)?.nodeName === 'BUTTON' && (el as Element)?.closest(CSS_TOGGLE);\n\n if (!btn) return;\n\n const nav = btn.closest(`.${CSS_APP} > *`);\n const toggle = () =>\n nav?.setAttribute(\n \"data-expanded\",\n `${nav?.getAttribute(\"data-expanded\") === \"false\"}`,\n );\n\n if (!document.startViewTransition) toggle();\n else document.startViewTransition(() => toggle());\n};\n\nexport function observe(el: Element) {\n on(el, 'click', handleToggleClick, QUICK_EVENT);\n}\n\nexport function unobserve(el: Element) {\n off(el, 'click', handleToggleClick, QUICK_EVENT);\n}\n","import styles from '../styles.module.css';\nimport { QUICK_EVENT, anchorPosition, attr, off, on } from '../utils';\n\nexport function observe(el: Node) {\n on(el, 'toggle', handleToggle, QUICK_EVENT); // Use capture since toggle does not bubble\n on(el, 'click', handleLinkClick); // Allow `<a>` to use `popovertarget` as well\n}\nexport function unobserve(el: Node) {\n off(el, 'toggle', handleToggle, QUICK_EVENT); // Use capture since toggle does not bubble\n off(el, 'click', handleLinkClick);\n}\n\nconst CSS_POPOVER = styles.popover.split(' ')[0];\n\nfunction handleToggle ({ target: el, newState }: Event & { newState?: string }){\n if (el instanceof HTMLElement && el.classList.contains(CSS_POPOVER)) {\n const anchor = (el.getRootNode() as ShadowRoot)?.querySelector<HTMLElement>(`[popovertarget=\"${el.id}\"]`);\n \n if (newState === 'closed') anchorPosition(el, false);\n else if (anchor) anchorPosition(el, anchor, el.getAttribute('data-position') || 'bottom');\n }\n}\n\n// Polyfill popovertarget for <a> (not supported by native)\n// and automatically assume popovertarget is the closest parent popover\n// but respect the popovertarget and popovertargetaction attribute\nfunction handleLinkClick ({ target }: Event){\n const link = (target as Element )?.closest?.('a');\n if (link) {\n const root = link.getRootNode() as ShadowRoot;\n const target = root.getElementById?.(attr(link, 'popovertarget') || '') || link.closest(`.${CSS_POPOVER}`);\n const action = attr(link, 'popovertargetaction') || 'toggle';\n\n target?.togglePopover(action === 'show' || (action === 'hide' ? false : undefined));\n }\n}","import styles from '../styles.module.css';\nimport { attr, onMutation } from '../utils';\nconst CSS_TABLE = styles.table.split(' ')[0];\n\nfunction process(tables: HTMLCollectionOf<Element>) {\n for(const table of tables) if (table instanceof HTMLTableElement) {\n const ths = Array.from(table.tHead?.rows[0]?.cells || [], (el) => el.innerText?.trim()); // Using innerText to only include visible text\n for (const tbody of table.tBodies) {\n for (const row of tbody.rows) {\n for (const cell of row.cells) {\n attr(cell, 'data-th', ths[cell.cellIndex] || ':empty');\n }\n }\n }\n }\n}\n\nexport const observe = (el: Element) => onMutation(el, CSS_TABLE, process);\nexport const unobserve = (el: Element) => onMutation(el, CSS_TABLE, false);\n","export * as styles from \"./styles.module.css\";\nexport { pagination } from \"./pagination/pagination-helper\";\nimport \"./tooltip/tooltip-observer\"; // Load data-tooltip behaviour\nimport \"@u-elements/u-details\"; // Polyfill for <details> element\nimport * as dialog from \"./dialog/dialog-observer\";\nimport * as field from \"./field/field-observer\";\nimport * as fieldset from \"./fieldset/fieldset-observer\";\nimport * as layout from \"./layout/layout-observer\";\nimport * as popover from \"./popover/popover-observer\";\nimport * as table from \"./table/table-observer\";\nimport { IS_BROWSER } from \"./utils\";\n\n// Automatic observe on browser\nif (IS_BROWSER) {\n const isLoading = document.readyState === \"loading\"; // Check if the page is still loading - might happen if the script is in <head>\n const onLoaded = () => observe(document.body);\n\n if (isLoading) document.addEventListener(\"DOMContentLoaded\", onLoaded);\n else onLoaded();\n}\n\nexport function observe(el: Element) {\n dialog.observe(el);\n field.observe(el);\n fieldset.observe(el);\n layout.observe(el);\n popover.observe(el);\n table.observe(el);\n}\n\nexport function unobserve(el: Element) {\n dialog.unobserve(el);\n field.unobserve(el);\n fieldset.unobserve(el);\n layout.unobserve(el);\n popover.unobserve(el);\n table.unobserve(el);\n}\n"],"names":["getSteps","now","max","show","offset","start","end","pages","_","i","pagination","current","total","page","index","IS_BROWSER","QUICK_EVENT","attr","el","name","value","id","UUID","useId","events","action","element","rest","type","on","off","TARGETS","SCROLLER","update","POSITION","anchorPosition","target","anchor","position","place","_a","targetW","targetH","anchorW","anchorH","width","height","left","top","anchorX","anchorY","hasSpaceLeft","hasSpaceRight","hasSpaceOver","hasSpaceUnder","positionRight","positionUnder","centerX","centerY","isVertical","createOptimizedMutationObserver","callback","queue","onFrame","onTimer","observer","MUTATORS","MUTATORS_CALLBACK","mutator","onMutation","className","collection","isInputLike","CSS_TOOLTIP","styles","DESCRIBEDBY","ESC","LABELLEDBY","POSITION_CSS_PROPERTY","THROTTLE_DELAY","TOOLTIP_ID","ANCHOR","LAST_CALL","THROTTLE","TOOLTIP","handleMove","key","wait","handleMoveThrottled","content","hasLabel","DISPLAY_BLOCK","UHTMLElement","_a2","asButton","event","isClick","getRoot","node","root","createElement","tagName","text","attrs","val","customElements","instance","UHTMLDetailsElement","prop","prev","next","hide","open","uDetailsList","uDetails","summary","isSummary","UHTMLSummaryElement","handleClick","x","y","right","bottom","observe","unobserve","CSS_FIELD","CSS_PROPERTY_OVER","CSS_PROPERTY_UNDER","CSS_VALIDATIONS","CSS_VALIDATION","renderAria","fields","field","labels","descs","input","valid","label","renderCounter","handleInput","limit","remainder","nextInvalid","prevInvalid","style","over","under","_b","css","handleInvalid","CSS_FIELDSET","process","fieldsets","fieldset","inputs","validationId","CSS_APP","CSS_TOGGLE","handleToggleClick","btn","nav","toggle","handleToggle","handleLinkClick","CSS_POPOVER","newState","link","CSS_TABLE","tables","table","ths","tbody","row","cell","isLoading","onLoaded","dialog.observe","field.observe","fieldset.observe","layout.observe","popover.observe","table.observe","dialog.unobserve","field.unobserve","fieldset.unobserve","layout.unobserve","popover.unobserve","table.unobserve"],"mappings":"s4DAAMA,GAAW,CAACC,EAAaC,EAAaC,IAAiB,CACrD,MAAAC,GAAUD,EAAO,GAAK,EACtBE,EAAQ,KAAK,IAAI,KAAK,IAAIJ,EAAM,KAAK,MAAMG,CAAM,EAAGF,EAAMC,EAAO,CAAC,EAAG,CAAC,EACtEG,EAAM,KAAK,IAAI,KAAK,IAAIL,EAAM,KAAK,KAAKG,CAAM,EAAGD,CAAI,EAAGD,CAAG,EAC3DK,EAAQ,MAAM,KAAK,CAAE,OAAQD,EAAM,EAAID,CAAS,EAAA,CAACG,EAAGC,IAAMA,EAAIJ,CAAK,EAErE,OAAAF,EAAO,GAAKE,EAAQ,KAAS,OAAO,EAAG,EAAG,EAAG,CAAC,EAC9CF,EAAO,GAAKG,EAAMJ,KAAW,OAAO,GAAI,EAAG,EAAGA,CAAG,EAC9CK,CACT,EAEaG,GAAa,CAAC,CAAE,QAAAC,EAAU,EAAG,MAAAC,EAAQ,GAAI,KAAAT,EAAO,MAAS,CACpE,KAAMQ,EAAU,EAAIA,EAAU,EAAI,EAClC,KAAMA,EAAUC,EAAQD,EAAU,EAAI,EACtC,MAAOX,GAASW,EAASC,EAAOT,CAAI,EAAE,IAAI,CAACU,EAAMC,KAAW,CAC1D,QAASD,IAASF,GAAY,OAC9B,IAAK,OAAOE,CAAI,IAAIC,CAAK,GACzB,KAAAD,CAAA,EACA,CACJ,GCnBaE,EAAa,OAAO,OAAW,KAAe,OAAO,SAAa,IAClEC,EAAc,CAAE,QAAS,GAAM,QAAS,EA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K,CAAE,EAClBmK,GAAcnK,CAAE,CAClB,CAEO,SAAS0G,GAAU1G,EAAa,CACrCoK,GAAiBpK,CAAE,EACnBqK,GAAgBrK,CAAE,EAClBsK,GAAmBtK,CAAE,EACrBuK,GAAiBvK,CAAE,EACnBwK,GAAkBxK,CAAE,EACpByK,GAAgBzK,CAAE,CACpB","x_google_ignoreList":[3]}
1
+ {"version":3,"file":"index.iife.js","sources":["../designsystem/pagination/pagination-helper.ts","../designsystem/utils.ts","../designsystem/tooltip/tooltip-observer.ts","../node_modules/@u-elements/u-details/dist/u-details.js","../designsystem/dialog/dialog-observer.ts","../designsystem/field/field-observer.ts","../designsystem/fieldset/fieldset-observer.ts","../designsystem/layout/layout-observer.ts","../designsystem/logo/logo-observer.ts","../designsystem/popover/popover-observer.ts","../designsystem/table/table-observer.ts","../designsystem/index.ts"],"sourcesContent":["const getSteps = (now: number, max: number, show: number) => {\n const offset = (show - 1) / 2;\n const start = Math.max(Math.min(now - Math.floor(offset), max - show + 1), 1);\n const end = Math.min(Math.max(now + Math.ceil(offset), show), max);\n const pages = Array.from({ length: end + 1 - start }, (_, i) => i + start);\n\n if (show > 4 && start > 1) pages.splice(0, 2, 1, 0);\n if (show > 3 && end < max) pages.splice(-2, 2, 0, max);\n return pages;\n};\n\nexport const pagination = ({ current = 1, total = 10, show = 7 }) => ({\n prev: current > 1 ? current - 1 : 0,\n next: current < total ? current + 1 : 0,\n pages: getSteps(current, total, show).map((page, index) => ({\n current: page === current && (\"page\" as const),\n key: `key-${page}-${index}`,\n page,\n })),\n});\n","export const IS_BROWSER = typeof window !== 'undefined' && typeof document !== 'undefined';\nexport const QUICK_EVENT = { capture: true, passive: true };\n\n/**\n * attr\n * @description Utility to quickly get, set and remove attributes\n * @param el The Element to use as EventTarget\n * @param name The attribute name to get, set or remove, or a object to set multiple attributes\n * @param value A valid attribute value or null to remove attribute\n */\nexport function attr(\n\tel: Element,\n\tname: string,\n\tvalue?: string | null,\n): string | null {\n\tif (value === undefined) return el.getAttribute(name) ?? null; // Fallback to null only if el is undefined\n\tif (value === null) el.removeAttribute(name);\n\telse if (el.getAttribute(name) !== value) el.setAttribute(name, value);\n\treturn null;\n}\n\n/**\n * useId\n * @return A generated unique ID\n */\nlet id = 0;\nconst UUID = `${Date.now().toString(36)}${Math.random().toString(36).slice(2, 5)}`;\nexport function useId (el: Element) {\n if (!el.id) el.id = `${UUID}${++id}`;\n\treturn el.id;\n};\n\n// Internal helper for on / off\nconst events = (\n\taction: \"add\" | \"remove\",\n\telement: Node | Window,\n\trest: Parameters<typeof Element.prototype.addEventListener>,\n): void => {\n\tfor (const type of rest[0].split(\",\")) {\n\t\trest[0] = type;\n\t\telement[`${action}EventListener`](...rest);\n\t}\n};\n\n/**\n * on\n * @param element The Element to use as EventTarget\n * @param types A comma separated string of event types\n * @param listener An event listener function or listener object\n */\nexport const on = (\n\telement: Node | Window,\n\t...rest: Parameters<typeof Element.prototype.addEventListener>\n): void => events(\"add\", element, rest);\n\n/**\n * off\n * @param element The Element to use as EventTarget\n * @param types A comma separated string of event types\n * @param listener An event listener function or listener object\n */\nexport const off = (\n\telement: Node | Window,\n\t...rest: Parameters<typeof Element.prototype.removeEventListener>\n): void => events(\"remove\", element, rest);\n\n\nconst TARGETS = new Map<Element, () => void>(); // Store current open poppers and their update functions\nconst SCROLLER = IS_BROWSER ? document.createElement('div') : null // Used to ensure we have scrollability under\nif (SCROLLER) attr(SCROLLER, 'style', 'position:absolute;padding:1px;top:0;left:0px');\n\nif (IS_BROWSER){\n\ton(window, 'load,resize,scroll', () => {\n\t\tfor (const [_, update] of TARGETS) update();\n\t}, QUICK_EVENT);}\n\t\n/**\n * anchorPosition\n * @param target The Element to position\n * @param anchor The Element to use as anchor\n */\nconst POSITION = { top: 0, right: 1, bottom: 2, left: 3 }; // Speed up by using a const map\n\nexport function anchorPosition (target: HTMLElement, anchor: HTMLElement | null | false, position?: string | number) {\n\tif (!anchor || !anchor.isConnected || !target.isConnected) return TARGETS.delete(target); // Stop watchning if anchor is removed from DOM\n\tif (!SCROLLER?.isConnected) document.body.append(SCROLLER || ''); // Ensure we have t´he scroller\n\tif (!TARGETS.has(target)) { // Setup new target or update position\n\t\tconst place = POSITION[position as keyof typeof POSITION] ?? POSITION.bottom; // Use CSS property to store position for more flexibility\n\t\treturn TARGETS.set(target, () => anchorPosition(target, anchor, place)).get(target)?.(); // Start watching if not already watching\n\t}\n\n const { offsetWidth: targetW, offsetHeight: targetH } = target;\n const { offsetWidth: anchorW, offsetHeight: anchorH } = anchor;\n const { width, height, left, top } = anchor.getBoundingClientRect();\n\tconst anchorX = Math.round(left - (anchorW - width) / 2); // Correct for CSS transform scale\n const anchorY = Math.round(top - (anchorH - height) / 2); // Correct for CSS transform scale\n\n\tconst hasSpaceLeft = anchorX - targetW > 0\n\tconst hasSpaceRight = anchorW + anchorW + targetW < window.innerWidth;\n\tconst hasSpaceOver = anchorY - targetH > 0\n\tconst hasSpaceUnder = anchorY + anchorH + targetH < window.innerHeight;\n\tconst positionRight = (position === POSITION.bottom && hasSpaceRight) || !hasSpaceLeft // Always position right when no hasSpaceLeft, as no OS scrolls further up than 0\n\tconst positionUnder = (position === POSITION.bottom && hasSpaceUnder) || !hasSpaceOver // Always position under when no hasSpaceOver, as no OS scrolls further up than 0\n\tconst centerX = Math.min(Math.max(10, anchorX - (targetW - anchorW) / 2), window.innerWidth - targetW - 10);\n\tconst centerY = Math.min(Math.max(10, anchorY - (targetH - anchorH) / 2), window.innerHeight - targetH - 10);\n\tconst isVertical = position === POSITION.top || position === POSITION.bottom;\n\n\ttarget.style.left = `${Math.round(isVertical ? centerX : (positionRight ? anchorX + anchorW : anchorX - targetW))}px`\n target.style.top = `${Math.round(isVertical ? (positionUnder ? anchorY + anchorH : anchorY - targetH) : centerY)}px`\n SCROLLER?.style.setProperty('translate', `${Math.round(window.scrollX + anchorX + anchorW + targetW + 30)} ${Math.round(window.scrollY + anchorY + anchorH + targetH + 30)}px`);\n}\n\n/**\n * Speed up MutationObserver by debouncing and only running when page is visible\n * @return new MutaionObserver\n */\nexport function createOptimizedMutationObserver(callback: MutationCallback) {\n let queue = 0;\n\n\tconst onFrame = () => setTimeout(onTimer, 200); // Use both requestAnimationFrame and setTimeout to debounce and only run when visible\n\tconst onTimer = () => {\n\t\tcallback([], observer);\n\t\tqueue = 0;\n\t};\n const observer = new MutationObserver(() => {\n if (!queue) queue = requestAnimationFrame(onFrame);\n });\n\n return observer;\n}\n\ntype Mutator = { observer: MutationObserver, collections: Map<string, () => void> };\nconst MUTATORS = new WeakMap<Element, Mutator>();\nconst MUTATORS_CALLBACK = (element: Element) => {\n\tconst mutator = MUTATORS.get(element);\n\n\tif (!mutator || !element.isConnected) {\n\t\tmutator?.observer?.disconnect();\n\t\tMUTATORS.delete(element);\n\t} else for(const [, callback] of mutator.collections) callback();\n};\n\n/**\n * onMutation\n * @description Utility to quickly observe mutations on a specific class name\n * @param element The Element to use as EventTarget\n * @param className The class name to observe\n * @param callback The callback to run when mutations are detected or false to stop observing\n */\nexport const onMutation = (\n\telement: Element,\n\tclassName: string,\n\tcallback: ((collection: HTMLCollection) => void) | false\n) => {\n\tconst collection = element.getElementsByClassName(className);\n\tlet mutator = MUTATORS.get(element);\n\n\tif (!mutator) {\n\t\tmutator = { collections: new Map(), observer: createOptimizedMutationObserver(() => MUTATORS_CALLBACK(element)) };\n\t\tmutator.observer.observe(element, { childList: true, subtree: true, attributes: true, attributeFilter: ['class'] });\n\t\tMUTATORS.set(element, mutator);\n\t}\n\tif (callback) mutator.collections.set(className, () => callback(collection));\n\telse mutator.collections.delete(className);\n}\n\nexport const isInputLike = (el: unknown): el is HTMLInputElement =>\n\tel instanceof HTMLElement && 'validity' in el && !(el instanceof HTMLButtonElement);\n\n// Make React support popover=\"\"target attribute\n// https://github.com/facebook/react/issues/27479\ntype Popover = \"\" | \"auto\" | \"manual\" | undefined;\ndeclare global {\n\tnamespace React.JSX {\n\t\tinterface IntrinsicAttributes {\n\t\t\tpopovertargetaction?: string;\n\t\t\tpopovertarget?: string;\n\t\t\tpopover?: Popover;\n\t\t}\n\t}\n\tnamespace React {\n\t\tinterface HTMLAttributes<T> {\n\t\t\tpopovertargetaction?: string;\n\t\t\tpopovertarget?: string;\n\t\t\tpopover?: Popover;\n\t\t}\n\t}\n}","import styles from \"../styles.module.css\";\nimport { IS_BROWSER, QUICK_EVENT, anchorPosition, attr, on } from \"../utils\";\n\nconst CSS_TOOLTIP = styles._tooltip.split(\" \");\nconst DESCRIBEDBY = \"aria-describedby\";\nconst ESC = \"Escape\";\nconst LABELLEDBY = \"aria-labelledby\";\nconst POSITION_CSS_PROPERTY = \"--mtds-tooltip-position\";\nconst THROTTLE_DELAY = 300;\nconst TOOLTIP_ID = \"mtds-tooltip\";\n\nlet ANCHOR: HTMLElement | null = null;\nlet LAST_CALL = Number.NEGATIVE_INFINITY;\nlet THROTTLE: number | ReturnType<typeof setTimeout> = 0;\nlet TOOLTIP: HTMLElement | null = null;\n\nfunction handleMove({ target, type, key }: Event & { key?: string }) {\n if (type === \"keydown\" && key !== ESC) return; // Allow ESC dismiss to follow https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/\n const wait = LAST_CALL + THROTTLE_DELAY - Date.now();\n clearTimeout(THROTTLE);\n THROTTLE = setTimeout(\n handleMoveThrottled,\n Math.max(wait, 0),\n key === ESC ? null : target\n );\n}\n\n// Using a throttled function to avoid performance issues\nfunction handleMoveThrottled(target: Element | null) {\n LAST_CALL = Date.now();\n\n if (!TOOLTIP || target === TOOLTIP) return; // Allow tooltip to be hovered, following https://www.w3.org/TR/WCAG21/#content-on-hover-or-focus\n let anchor = target?.closest?.<HTMLElement>(\"[data-tooltip]\") || null;\n\n // No need to update\n if (anchor === ANCHOR) return;\n\n const content = (anchor && attr(anchor, \"data-tooltip\")) || \"\";\n const position =\n (anchor && attr(anchor, \"data-tooltip-position\")) ||\n window\n .getComputedStyle(anchor || document.body)\n .getPropertyValue(POSITION_CSS_PROPERTY) ||\n \"top\";\n\n const isHidden =\n !content ||\n content === \"false\" ||\n content === \"true\" ||\n position === \"none\";\n\n if (isHidden) anchor = null; // Do not show tooltip if boolish value\n if (anchor) TOOLTIP.textContent = content; // Only update content if new anchor\n\n const hadLabel = ANCHOR && attr(ANCHOR, LABELLEDBY) === TOOLTIP_ID;\n const hasLabel =\n Boolean(anchor?.innerText.trim()) ||\n anchor?.hasAttribute(LABELLEDBY) ||\n anchor?.hasAttribute(\"aria-label\");\n\n ANCHOR?.removeAttribute(hadLabel ? LABELLEDBY : DESCRIBEDBY); // Unlink previous anchor\n anchorPosition(TOOLTIP, false); // Reset anchor position\n\n ANCHOR = anchor; // Store new anchor - might be null if no new anchor\n if (ANCHOR) attr(ANCHOR, hasLabel ? DESCRIBEDBY : LABELLEDBY, TOOLTIP_ID); // Use tooltip as description if allready has label\n TOOLTIP.togglePopover(!!anchor);\n anchorPosition(TOOLTIP, anchor, position);\n}\n\n// Initialize if in browser and not already initialized\nif (IS_BROWSER && !document.getElementById(TOOLTIP_ID)) {\n TOOLTIP = document.body.appendChild(document.createElement(\"div\"));\n TOOLTIP.classList.add(...CSS_TOOLTIP);\n TOOLTIP.id = TOOLTIP_ID;\n attr(TOOLTIP, \"popover\", \"manual\");\n on(document, \"blur,focus,mouseout,mouseover\", handleMove, QUICK_EVENT);\n on(window, \"keydown\", handleMove, QUICK_EVENT);\n on(window, \"blur\", handleMove, QUICK_EVENT);\n}\n","// ../utils.ts\nvar IS_BROWSER = typeof window !== \"undefined\" && typeof window.document !== \"undefined\" && typeof window.navigator !== \"undefined\";\nvar _a;\nIS_BROWSER && // @ts-expect-error Typescript has not implemented userAgentData yet https://stackoverflow.com/a/71392474\n/^Mac/i.test(((_a = navigator.userAgentData) == null ? void 0 : _a.platform) || navigator.platform);\nvar DISPLAY_BLOCK = \":host(:not([hidden])) { display: block }\";\nvar UHTMLElement = typeof HTMLElement === \"undefined\" ? class {\n} : HTMLElement;\nfunction attr(el, name, value) {\n var _a2;\n if (value === void 0) return (_a2 = el.getAttribute(name)) != null ? _a2 : null;\n if (value === null) el.removeAttribute(name);\n else if (el.getAttribute(name) !== value) el.setAttribute(name, value);\n return null;\n}\nvar events = (action, element, rest) => {\n for (const type of rest[0].split(\",\")) {\n rest[0] = type;\n Element.prototype[`${action}EventListener`].apply(element, rest);\n }\n};\nvar on = (element, ...rest) => events(\"add\", element, rest);\nvar off = (element, ...rest) => events(\"remove\", element, rest);\nvar asButton = (event) => {\n const isClick = \"key\" in event && (event.key === \" \" || event.key === \"Enter\");\n if (isClick) event.preventDefault();\n if (isClick && event.target instanceof HTMLElement) event.target.click();\n return isClick;\n};\nvar getRoot = (node) => {\n var _a2;\n const root = ((_a2 = node.getRootNode) == null ? void 0 : _a2.call(node)) || node.ownerDocument;\n return root instanceof Document || root instanceof ShadowRoot ? root : document;\n};\nvar createElement = (tagName, text, attrs) => {\n const el = document.createElement(tagName);\n if (text) el.textContent = text;\n if (attrs) for (const [key, val] of Object.entries(attrs)) attr(el, key, val);\n return el;\n};\nvar customElements = {\n define: (name, instance) => !IS_BROWSER || window.customElements.get(name) || window.customElements.define(name, instance)\n};\n\n// u-details.ts\nvar UHTMLDetailsElement = class extends UHTMLElement {\n constructor() {\n super();\n // Using underscore instead of private fields for backwards compatibility\n this._content = null;\n this.attachShadow({ mode: \"open\" }).append(\n createElement(\"slot\", null, { name: \"summary\" }),\n createElement(\"slot\", null, { part: \"details-content\" }),\n createElement(\n \"style\",\n `${DISPLAY_BLOCK}\n ::slotted(u-summary) { cursor: pointer; display: list-item; counter-increment: list-item 0; list-style: disclosure-closed inside }\n ::slotted(u-summary[aria-expanded=\"true\"]) { list-style-type: disclosure-open }\n\t\t\t\t:host > [part=\"details-content\"]:not([hidden=\"\"]) { display: block }`\n )\n );\n }\n // Using ES2015 syntax for backwards compatibility\n static get observedAttributes() {\n return [\"open\"];\n }\n connectedCallback() {\n var _a2;\n this._content = (_a2 = this.shadowRoot) == null ? void 0 : _a2.children[1];\n on(this._content, \"beforematch\", this);\n on(this, \"click,keydown\", this);\n this.attributeChangedCallback();\n }\n disconnectedCallback() {\n if (this._content) off(this._content, \"beforematch\", this);\n off(this, \"click,keydown\", this);\n this._content = null;\n }\n attributeChangedCallback(prop, prev, next) {\n const hide = \"onbeforematch\" in this ? \"until-found\" : true;\n const open = this.open;\n for (const el of this.children)\n if (el.nodeName === \"U-SUMMARY\") attr(el, \"aria-expanded\", `${open}`);\n if (this._content) {\n attr(this._content, \"aria-hidden\", `${!open}`);\n this._content.hidden = open ? false : hide;\n }\n if (open && this.name) {\n const uDetailsList = getRoot(this).querySelectorAll(\n `${this.nodeName}[name=\"${this.name}\"]`\n );\n for (const uDetails of uDetailsList)\n if (uDetails !== this) uDetails.open = false;\n }\n if (prop === \"open\" && prev === null !== (next === null))\n this.dispatchEvent(new Event(\"toggle\"));\n }\n handleEvent(event) {\n const summary = this.querySelector(\":scope > u-summary\");\n const isSummary = summary == null ? void 0 : summary.contains(event.target);\n if (event.defaultPrevented) return;\n if (event.type === \"beforematch\") this.open = true;\n if (isSummary && event.type === \"keydown\") asButton(event);\n if (isSummary && event.type === \"click\") this.open = !this.open;\n }\n get open() {\n return this.hasAttribute(\"open\");\n }\n set open(value) {\n attr(this, \"open\", value ? \"\" : null);\n }\n get name() {\n return attr(this, \"name\") || \"\";\n }\n set name(value) {\n attr(this, \"name\", value);\n }\n};\nvar UHTMLSummaryElement = class extends UHTMLElement {\n connectedCallback() {\n attr(this, \"role\", \"button\");\n this.slot = \"summary\";\n this.tabIndex = 0;\n }\n};\ncustomElements.define(\"u-details\", UHTMLDetailsElement);\ncustomElements.define(\"u-summary\", UHTMLSummaryElement);\n\nexport { UHTMLDetailsElement, UHTMLSummaryElement };\n","import { QUICK_EVENT, attr, off, on } from '../utils';\n\nconst handleClick = ({ clientX: x, clientY: y, target: el }: MouseEvent) => {\n if (el instanceof HTMLDialogElement && attr(el, 'data-closedby') === 'any') {\n const { top, right, bottom, left } = el.getBoundingClientRect();\n const isInside = top <= y && y <= bottom && left <= x && x <= right;\n \n if (!isInside) el.close();\n } else if (el instanceof Element && el.closest('button[data-command=\"close\"]')) {\n el?.closest('dialog')?.close();\n }\n};\n\nexport function observe(el: Element) {\n on(el, 'click', handleClick as EventListener, QUICK_EVENT);\n}\n\nexport function unobserve(el: Element) {\n off(el, 'click', handleClick as EventListener, QUICK_EVENT);\n}","import styles from \"../styles.module.css\";\nimport {\n QUICK_EVENT,\n attr,\n isInputLike,\n off,\n on,\n onMutation,\n useId,\n} from \"../utils\";\n\nconst CSS_FIELD = styles.field.split(\" \")[0];\nconst CSS_PROPERTY_OVER = \"--mtds-text-count-over\";\nconst CSS_PROPERTY_UNDER = \"--mtds-text-count-under\";\nconst CSS_VALIDATIONS = styles.validation.split(\" \");\nconst CSS_VALIDATION = CSS_VALIDATIONS[0];\n\nfunction renderAria(fields: HTMLCollectionOf<Element>) {\n for (const field of fields) {\n const labels: HTMLLabelElement[] = [];\n const descs: string[] = [];\n let input: HTMLInputElement | null = null;\n let valid = true;\n\n for (const el of field.getElementsByTagName(\"*\")) {\n if (el instanceof HTMLLabelElement) labels.push(el);\n else if (isInputLike(el)) input = el;\n else if (el.classList.contains(CSS_VALIDATION)) {\n // Must be before instanceof HTMLParagraphElement since validation can also be a <p>\n valid = attr(el, \"data-color\") === \"success\";\n descs.unshift(useId(el));\n } else if (el instanceof HTMLParagraphElement) descs.push(useId(el));\n }\n\n if (input) {\n for (const label of labels) label.htmlFor = useId(input);\n renderCounter(input);\n attr(input, \"aria-describedby\", descs.join(\" \"));\n attr(input, \"aria-invalid\", `${!valid}`);\n }\n }\n}\nfunction handleInput({ target }: Event) {\n if (isInputLike(target)) renderCounter(target);\n}\n\nfunction renderCounter(input: HTMLInputElement) {\n const el = input?.nextElementSibling;\n const limit = el && attr(el, \"data-count\");\n\n if (el && limit) {\n const remainder = Number(limit) - input.value.length;\n const nextInvalid = remainder < 0;\n const prevInvalid = attr(el, \"aria-live\") === \"polite\";\n const style = window.getComputedStyle(el || input);\n const over = style.getPropertyValue(CSS_PROPERTY_OVER)?.slice(1, -1) || \"\"; // slice to trim quotes\n const under =\n style.getPropertyValue(CSS_PROPERTY_UNDER)?.slice(1, -1) || \"\"; // slice to trim quotes\n\n if (prevInvalid !== nextInvalid) {\n attr(el, \"aria-live\", nextInvalid ? \"polite\" : \"off\");\n for (const css of CSS_VALIDATIONS) el.classList.toggle(css, nextInvalid);\n }\n el.textContent = (nextInvalid ? over : under).replace(\n \"%d\",\n `${Math.abs(remainder)}`\n );\n }\n}\n\n// Prevent browsers from showing default validation bubbles\nfunction handleInvalid(event: Event) {\n if ((event.target as Element)?.closest?.(`.${CSS_FIELD}`))\n event.preventDefault();\n}\n\nexport function observe(el: Element) {\n onMutation(el, CSS_FIELD, renderAria);\n on(el, \"input\", handleInput, QUICK_EVENT);\n on(el, \"invalid\", handleInvalid, true); // Use capture as invalid does noe buttle\n}\n\nexport function unobserve(el: Element) {\n onMutation(el, CSS_FIELD, false);\n off(el, \"input\", handleInput, QUICK_EVENT);\n off(el, \"invalid\", handleInvalid, true);\n}\n","import styles from \"../styles.module.css\";\nimport { attr, isInputLike, onMutation, useId } from \"../utils\";\nconst CSS_FIELDSET = styles.fieldset.split(\" \")[0];\nconst CSS_VALIDATION = styles.validation.split(\" \")[0];\n\nfunction process(fieldsets: HTMLCollectionOf<Element>) {\n for (const fieldset of fieldsets) {\n const inputs: HTMLInputElement[] = [];\n let validationId: string | null = null;\n\n for (const el of fieldset.getElementsByTagName(\"*\")) {\n if (el.classList.contains(CSS_VALIDATION)) validationId = useId(el);\n else if (isInputLike(el)) inputs.push(el);\n }\n\n for (const input of inputs) {\n attr(input, \"aria-describedby\", validationId);\n attr(input, \"aria-invalid\", `${!!validationId}`);\n }\n }\n}\n\nexport const observe = (el: Element) => onMutation(el, CSS_FIELDSET, process);\nexport const unobserve = (el: Element) => onMutation(el, CSS_FIELDSET, false);\n","import styles from \"../styles.module.css\";\nimport { QUICK_EVENT, attr, off, on } from \"../utils\";\n\nconst CSS_APP = styles.app.split(\" \")[0];\nconst CSS_TOGGLE = `.${CSS_APP} > header + :not(main) > button:empty:first-child`;\n\nconst handleToggleClick = ({ target: el }: Event) => {\n const btn =\n (el as Element)?.nodeName === \"BUTTON\" &&\n (el as Element)?.closest(CSS_TOGGLE);\n\n if (!btn) return;\n\n const nav = btn.closest(`.${CSS_APP} > *`);\n const toggle = () =>\n nav &&\n attr(nav, \"data-expanded\", `${attr(nav, \"data-expanded\") === \"false\"}`);\n\n if (!document.startViewTransition) toggle();\n else document.startViewTransition(() => toggle());\n};\n\nexport function observe(el: Element) {\n on(el, \"click\", handleToggleClick, QUICK_EVENT);\n}\n\nexport function unobserve(el: Element) {\n off(el, \"click\", handleToggleClick, QUICK_EVENT);\n}\n","import styles from \"../styles.module.css\";\nimport { IS_BROWSER, onMutation } from \"../utils\";\nconst CSS_LOGO = styles.logo.split(\" \")[0];\nlet FAVICON: HTMLLinkElement;\n\nfunction process(logos: HTMLCollectionOf<Element>) {\n const svg = logos[0]?.firstElementChild;\n\n if (!svg) return;\n if (!FAVICON) {\n const { head } = window.top?.document || document;\n const oldIcon = head.getElementsByTagName(\"link[rel~='icon']\");\n const newIcon = document.createElement(\"link\");\n\n for (const icon of oldIcon) icon.remove();\n FAVICON = head.appendChild(Object.assign(newIcon, { rel: \"icon\" }));\n }\n\n const isDot = svg.parentElement?.hasAttribute(\"data-color\");\n const style = window.getComputedStyle(svg);\n const text = style.getPropertyValue(\"color\");\n const back = style.getPropertyValue(\"background-color\");\n\n FAVICON.href = `data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 55 55'><rect fill='${isDot ? \"none\" : back}' width='51' height='51' x='2' y='2' stroke='${text}' stroke-dasharray='0.09 6.38' stroke-linecap='round' stroke-opacity='${isDot ? 0.6 : 0}' stroke-width='2.3' rx='25.5'/><g transform=\"translate(7.5 7.5)\">${encodeURIComponent(svg.outerHTML.replace(/(fill|width|height|xmlns)=\\S+/gi, \"\").replace(\"<svg\", `<svg width=\"40\" height=\"40\" fill=\"${text}\"`))}</g></svg>`;\n}\n\n// Force a update even if not active tab\nif (IS_BROWSER)\n setTimeout(() => process(document.getElementsByClassName(CSS_LOGO)), 300);\n\nexport const observe = (el: Element) => onMutation(el, CSS_LOGO, process);\nexport const unobserve = (el: Element) => onMutation(el, CSS_LOGO, false);\n","import styles from \"../styles.module.css\";\nimport { QUICK_EVENT, anchorPosition, attr, off, on } from \"../utils\";\n\nconst CSS_POPOVER = styles.popover.split(\" \")[0];\n\nexport function observe(el: Node) {\n on(el, \"toggle\", handleToggle, QUICK_EVENT); // Use capture since toggle does not bubble\n on(el, \"click\", handleLinkClick); // Allow `<a>` to use `popovertarget` as well\n}\nexport function unobserve(el: Node) {\n off(el, \"toggle\", handleToggle, QUICK_EVENT); // Use capture since toggle does not bubble\n off(el, \"click\", handleLinkClick);\n}\n\nfunction handleToggle({ target: el, newState }: Event & { newState?: string }) {\n if (el instanceof HTMLElement && el.classList.contains(CSS_POPOVER)) {\n const anchor = (el.getRootNode() as ShadowRoot)?.querySelector<HTMLElement>(\n `[popovertarget=\"${el.id}\"]`\n );\n\n if (newState === \"closed\") anchorPosition(el, false);\n else if (anchor)\n anchorPosition(el, anchor, attr(el, \"data-position\") || \"bottom\");\n }\n}\n\n// Polyfill popovertarget for <a> (not supported by native)\n// and automatically assume popovertarget is the closest parent popover\n// but respect the popovertarget and popovertargetaction attribute\nfunction handleLinkClick({ target }: Event) {\n const link = (target as Element)?.closest?.(\"a\");\n if (link) {\n const root = link.getRootNode() as ShadowRoot;\n const target =\n root.getElementById?.(attr(link, \"popovertarget\") || \"\") ||\n link.closest(`.${CSS_POPOVER}`);\n const action = attr(link, \"popovertargetaction\") || \"toggle\";\n\n target?.togglePopover(\n action === \"show\" || (action === \"hide\" ? false : undefined)\n );\n }\n}\n","import styles from \"../styles.module.css\";\nimport { attr, onMutation } from \"../utils\";\nconst CSS_TABLE = styles.table.split(\" \")[0];\n\nfunction process(tables: HTMLCollectionOf<Element>) {\n for (const table of tables as HTMLCollectionOf<HTMLTableElement>) {\n const ths: string[] = []; // Add data-th=\"\" to each cell to support data-mobile designs\n\n attr(table, \"role\", \"table\"); // Add helping role=\"\" to ensure screen readers understand the table regardless of CSS display\n if (table.caption) attr(table.caption, \"role\", \"caption\");\n for (const group of [table.tHead, table.tFoot, ...table.tBodies])\n if (group) {\n attr(group, \"role\", \"rowgroup\");\n const isTbody = group.nodeName === \"TBODY\";\n\n for (const row of group.rows) {\n attr(row, \"role\", \"row\");\n for (const cell of row.cells) {\n if (isTbody) attr(cell, \"data-th\", ths[cell.cellIndex] || \":empty\");\n else ths.push(cell.innerText.trim()); // Using innerText to only include visible text\n if (cell.nodeName === \"TD\") attr(cell, \"role\", \"cell\");\n else {\n attr(cell, \"role\", isTbody ? \"rowheader\" : \"columnheader\");\n attr(cell, \"scope\", isTbody ? \"row\" : \"col\");\n }\n }\n }\n }\n }\n}\n\nexport const observe = (el: Element) => onMutation(el, CSS_TABLE, process);\nexport const unobserve = (el: Element) => onMutation(el, CSS_TABLE, false);\n","export * as styles from \"./styles.module.css\";\nexport { pagination } from \"./pagination/pagination-helper\";\nimport \"./tooltip/tooltip-observer\"; // Load data-tooltip behaviour\nimport \"@u-elements/u-details\"; // Polyfill for <details> element\nimport * as dialog from \"./dialog/dialog-observer\";\nimport * as field from \"./field/field-observer\";\nimport * as fieldset from \"./fieldset/fieldset-observer\";\nimport * as layout from \"./layout/layout-observer\";\nimport * as logo from \"./logo/logo-observer\";\nimport * as popover from \"./popover/popover-observer\";\nimport * as table from \"./table/table-observer\";\nimport { IS_BROWSER } from \"./utils\";\n\n// Automatic observe on browser\nif (IS_BROWSER) {\n const isLoading = document.readyState === \"loading\"; // Check if the page is still loading - might happen if the script is in <head>\n const onLoaded = () => observe(document.body);\n\n if (isLoading) document.addEventListener(\"DOMContentLoaded\", onLoaded);\n else onLoaded();\n}\n\nexport function observe(el: Element) {\n dialog.observe(el);\n field.observe(el);\n fieldset.observe(el);\n layout.observe(el);\n logo.observe(el);\n popover.observe(el);\n table.observe(el);\n}\n\nexport function unobserve(el: Element) {\n dialog.unobserve(el);\n field.unobserve(el);\n fieldset.unobserve(el);\n layout.unobserve(el);\n logo.unobserve(el);\n popover.unobserve(el);\n table.unobserve(el);\n}\n"],"names":["getSteps","now","max","show","offset","start","end","pages","_","i","pagination","current","total","page","index","IS_BROWSER","QUICK_EVENT","attr","el","name","value","id","UUID","useId","events","action","element","rest","type","on","off","TARGETS","SCROLLER","update","POSITION","anchorPosition","target","anchor","position","place","_a","targetW","targetH","anchorW","anchorH","width","height","left","top","anchorX","anchorY","hasSpaceLeft","hasSpaceRight","hasSpaceOver","hasSpaceUnder","positionRight","positionUnder","centerX","centerY","isVertical","createOptimizedMutationObserver","callback","queue","onFrame","onTimer","observer","MUTATORS","MUTATORS_CALLBACK","mutator","onMutation","className","collection","isInputLike","CSS_TOOLTIP","styles","DESCRIBEDBY","ESC","LABELLEDBY","POSITION_CSS_PROPERTY","THROTTLE_DELAY","TOOLTIP_ID","ANCHOR","LAST_CALL","THROTTLE","TOOLTIP","handleMove","key","wait","handleMoveThrottled","content","hadLabel","hasLabel","DISPLAY_BLOCK","UHTMLElement","_a2","asButton","event","isClick","getRoot","node","root","createElement","tagName","text","attrs","val","customElements","instance","UHTMLDetailsElement","prop","prev","next","hide","open","uDetailsList","uDetails","summary","isSummary","UHTMLSummaryElement","handleClick","x","y","right","bottom","observe","unobserve","CSS_FIELD","CSS_PROPERTY_OVER","CSS_PROPERTY_UNDER","CSS_VALIDATIONS","CSS_VALIDATION","renderAria","fields","field","labels","descs","input","valid","label","renderCounter","handleInput","limit","remainder","nextInvalid","prevInvalid","style","over","under","_b","css","handleInvalid","CSS_FIELDSET","process","fieldsets","fieldset","inputs","validationId","CSS_APP","CSS_TOGGLE","handleToggleClick","btn","nav","toggle","CSS_LOGO","FAVICON","logos","svg","head","oldIcon","newIcon","icon","isDot","_c","back","CSS_POPOVER","handleToggle","handleLinkClick","newState","link","CSS_TABLE","tables","table","ths","group","isTbody","row","cell","isLoading","onLoaded","dialog.observe","field.observe","fieldset.observe","layout.observe","logo.observe","popover.observe","table.observe","dialog.unobserve","field.unobserve","fieldset.unobserve","layout.unobserve","logo.unobserve","popover.unobserve","table.unobserve"],"mappings":"46DAAMA,GAAW,CAACC,EAAaC,EAAaC,IAAiB,CACrD,MAAAC,GAAUD,EAAO,GAAK,EACtBE,EAAQ,KAAK,IAAI,KAAK,IAAIJ,EAAM,KAAK,MAAMG,CAAM,EAAGF,EAAMC,EAAO,CAAC,EAAG,CAAC,EACtEG,EAAM,KAAK,IAAI,KAAK,IAAIL,EAAM,KAAK,KAAKG,CAAM,EAAGD,CAAI,EAAGD,CAAG,EAC3DK,EAAQ,MAAM,KAAK,CAAE,OAAQD,EAAM,EAAID,CAAS,EAAA,CAACG,EAAGC,IAAMA,EAAIJ,CAAK,EAErE,OAAAF,EAAO,GAAKE,EAAQ,KAAS,OAAO,EAAG,EAAG,EAAG,CAAC,EAC9CF,EAAO,GAAKG,EAAMJ,KAAW,OAAO,GAAI,EAAG,EAAGA,CAAG,EAC9CK,CACT,EAEaG,GAAa,CAAC,CAAE,QAAAC,EAAU,EAAG,MAAAC,EAAQ,GAAI,KAAAT,EAAO,MAAS,CACpE,KAAMQ,EAAU,EAAIA,EAAU,EAAI,EAClC,KAAMA,EAAUC,EAAQD,EAAU,EAAI,EACtC,MAAOX,GAASW,EAASC,EAAOT,CAAI,EAAE,IAAI,CAACU,EAAMC,KAAW,CAC1D,QAASD,IAASF,GAAY,OAC9B,IAAK,OAAOE,CAAI,IAAIC,CAAK,GACzB,KAAAD,CAAA,EACA,CACJ,GCnBaE,EAAa,OAAO,OAAW,KAAe,OAAO,SAAa,IAClEC,EAAc,CAAE,QAAS,GAAM,QAAS,EAAK,EAS1C,SAAAC,EACfC,EACAC,EACAC,EACgB,CAChB,OAAIA,IAAU,OAAkBF,EAAG,aAAaC,CAAI,GAAK,MACrDC,IAAU,KAASF,EAAA,gBAAgBC,CAAI,EACl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5K,CAAE,EAChB6K,GAAiB7K,CAAE,EACnB8K,GAAe9K,CAAE,EACjB+K,GAAa/K,CAAE,EACfgL,GAAgBhL,CAAE,EAClBiL,GAAcjL,CAAE,CAClB,CAEO,SAAS2G,GAAU3G,EAAa,CACrCkL,GAAiBlL,CAAE,EACnBmL,GAAgBnL,CAAE,EAClBoL,GAAmBpL,CAAE,EACrBqL,GAAiBrL,CAAE,EACnBsL,GAAetL,CAAE,EACjBuL,GAAkBvL,CAAE,EACpBwL,GAAgBxL,CAAE,CACpB","x_google_ignoreList":[3]}
package/mtds/index.js CHANGED
@@ -1,28 +1,29 @@
1
- import * as c from "./styles.module.css.js";
2
- import { pagination as I } from "./pagination/pagination-helper.js";
1
+ import * as L from "./styles.module.css.js";
2
+ import { pagination as h } from "./pagination/pagination-helper.js";
3
3
  import "./tooltip/tooltip-observer.js";
4
4
  import "./external/@u-elements/u-details/dist/u-details.js";
5
5
  import { observe as r, unobserve as s } from "./dialog/dialog-observer.js";
6
- import { observe as n, unobserve as t } from "./field/field-observer.js";
7
- import { observe as b, unobserve as v } from "./fieldset/fieldset-observer.js";
6
+ import { observe as n, unobserve as b } from "./field/field-observer.js";
7
+ import { observe as v, unobserve as t } from "./fieldset/fieldset-observer.js";
8
8
  import { observe as a, unobserve as m } from "./layout/layout-observer.js";
9
- import { observe as i, unobserve as u } from "./popover/popover-observer.js";
10
- import { observe as d, unobserve as p } from "./table/table-observer.js";
11
- import { IS_BROWSER as f } from "./utils.js";
12
- if (f) {
13
- const o = document.readyState === "loading", e = () => $(document.body);
9
+ import { observe as i, unobserve as u } from "./logo/logo-observer.js";
10
+ import { observe as p, unobserve as d } from "./popover/popover-observer.js";
11
+ import { observe as f, unobserve as $ } from "./table/table-observer.js";
12
+ import { IS_BROWSER as c } from "./utils.js";
13
+ if (c) {
14
+ const o = document.readyState === "loading", e = () => y(document.body);
14
15
  o ? document.addEventListener("DOMContentLoaded", e) : e();
15
16
  }
16
- function $(o) {
17
- r(o), n(o), b(o), a(o), i(o), d(o);
17
+ function y(o) {
18
+ r(o), n(o), v(o), a(o), i(o), p(o), f(o);
18
19
  }
19
- function B(o) {
20
- s(o), t(o), v(o), m(o), u(o), p(o);
20
+ function I(o) {
21
+ s(o), b(o), t(o), m(o), u(o), d(o), $(o);
21
22
  }
22
23
  export {
23
- $ as observe,
24
- I as pagination,
25
- c as styles,
26
- B as unobserve
24
+ y as observe,
25
+ h as pagination,
26
+ L as styles,
27
+ I as unobserve
27
28
  };
28
29
  //# sourceMappingURL=index.js.map
package/mtds/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../designsystem/index.ts"],"sourcesContent":["export * as styles from \"./styles.module.css\";\nexport { pagination } from \"./pagination/pagination-helper\";\nimport \"./tooltip/tooltip-observer\"; // Load data-tooltip behaviour\nimport \"@u-elements/u-details\"; // Polyfill for <details> element\nimport * as dialog from \"./dialog/dialog-observer\";\nimport * as field from \"./field/field-observer\";\nimport * as fieldset from \"./fieldset/fieldset-observer\";\nimport * as layout from \"./layout/layout-observer\";\nimport * as popover from \"./popover/popover-observer\";\nimport * as table from \"./table/table-observer\";\nimport { IS_BROWSER } from \"./utils\";\n\n// Automatic observe on browser\nif (IS_BROWSER) {\n const isLoading = document.readyState === \"loading\"; // Check if the page is still loading - might happen if the script is in <head>\n const onLoaded = () => observe(document.body);\n\n if (isLoading) document.addEventListener(\"DOMContentLoaded\", onLoaded);\n else onLoaded();\n}\n\nexport function observe(el: Element) {\n dialog.observe(el);\n field.observe(el);\n fieldset.observe(el);\n layout.observe(el);\n popover.observe(el);\n table.observe(el);\n}\n\nexport function unobserve(el: Element) {\n dialog.unobserve(el);\n field.unobserve(el);\n fieldset.unobserve(el);\n layout.unobserve(el);\n popover.unobserve(el);\n table.unobserve(el);\n}\n"],"names":["IS_BROWSER","isLoading","onLoaded","observe","el","dialog.observe","field.observe","fieldset.observe","layout.observe","popover.observe","table.observe","unobserve","dialog.unobserve","field.unobserve","fieldset.unobserve","layout.unobserve","popover.unobserve","table.unobserve"],"mappings":";;;;;;;;;;;AAaA,IAAIA,GAAY;AACR,QAAAC,IAAY,SAAS,eAAe,WACpCC,IAAW,MAAMC,EAAQ,SAAS,IAAI;AAE5C,EAAIF,IAAW,SAAS,iBAAiB,oBAAoBC,CAAQ,IACvDA,EAAA;AAChB;AAEO,SAASC,EAAQC,GAAa;AACnCC,EAAAA,EAAeD,CAAE,GACjBE,EAAcF,CAAE,GAChBG,EAAiBH,CAAE,GACnBI,EAAeJ,CAAE,GACjBK,EAAgBL,CAAE,GAClBM,EAAcN,CAAE;AAClB;AAEO,SAASO,EAAUP,GAAa;AACrCQ,EAAAA,EAAiBR,CAAE,GACnBS,EAAgBT,CAAE,GAClBU,EAAmBV,CAAE,GACrBW,EAAiBX,CAAE,GACnBY,EAAkBZ,CAAE,GACpBa,EAAgBb,CAAE;AACpB;"}
1
+ {"version":3,"file":"index.js","sources":["../designsystem/index.ts"],"sourcesContent":["export * as styles from \"./styles.module.css\";\nexport { pagination } from \"./pagination/pagination-helper\";\nimport \"./tooltip/tooltip-observer\"; // Load data-tooltip behaviour\nimport \"@u-elements/u-details\"; // Polyfill for <details> element\nimport * as dialog from \"./dialog/dialog-observer\";\nimport * as field from \"./field/field-observer\";\nimport * as fieldset from \"./fieldset/fieldset-observer\";\nimport * as layout from \"./layout/layout-observer\";\nimport * as logo from \"./logo/logo-observer\";\nimport * as popover from \"./popover/popover-observer\";\nimport * as table from \"./table/table-observer\";\nimport { IS_BROWSER } from \"./utils\";\n\n// Automatic observe on browser\nif (IS_BROWSER) {\n const isLoading = document.readyState === \"loading\"; // Check if the page is still loading - might happen if the script is in <head>\n const onLoaded = () => observe(document.body);\n\n if (isLoading) document.addEventListener(\"DOMContentLoaded\", onLoaded);\n else onLoaded();\n}\n\nexport function observe(el: Element) {\n dialog.observe(el);\n field.observe(el);\n fieldset.observe(el);\n layout.observe(el);\n logo.observe(el);\n popover.observe(el);\n table.observe(el);\n}\n\nexport function unobserve(el: Element) {\n dialog.unobserve(el);\n field.unobserve(el);\n fieldset.unobserve(el);\n layout.unobserve(el);\n logo.unobserve(el);\n popover.unobserve(el);\n table.unobserve(el);\n}\n"],"names":["IS_BROWSER","isLoading","onLoaded","observe","el","dialog.observe","field.observe","fieldset.observe","layout.observe","logo.observe","popover.observe","table.observe","unobserve","dialog.unobserve","field.unobserve","fieldset.unobserve","layout.unobserve","logo.unobserve","popover.unobserve","table.unobserve"],"mappings":";;;;;;;;;;;;AAcA,IAAIA,GAAY;AACR,QAAAC,IAAY,SAAS,eAAe,WACpCC,IAAW,MAAMC,EAAQ,SAAS,IAAI;AAE5C,EAAIF,IAAW,SAAS,iBAAiB,oBAAoBC,CAAQ,IACvDA,EAAA;AAChB;AAEO,SAASC,EAAQC,GAAa;AACnCC,EAAAA,EAAeD,CAAE,GACjBE,EAAcF,CAAE,GAChBG,EAAiBH,CAAE,GACnBI,EAAeJ,CAAE,GACjBK,EAAaL,CAAE,GACfM,EAAgBN,CAAE,GAClBO,EAAcP,CAAE;AAClB;AAEO,SAASQ,EAAUR,GAAa;AACrCS,EAAAA,EAAiBT,CAAE,GACnBU,EAAgBV,CAAE,GAClBW,EAAmBX,CAAE,GACrBY,EAAiBZ,CAAE,GACnBa,EAAeb,CAAE,GACjBc,EAAkBd,CAAE,GACpBe,EAAgBf,CAAE;AACpB;"}
@@ -1,7 +1,7 @@
1
1
  import { StoryObj } from '@storybook/react';
2
2
  declare const meta: {
3
3
  title: string;
4
- decorators: ((Story: import('@storybook/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
4
+ decorators: ((Story: import('@storybook/core/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
5
5
  [x: string]: any;
6
6
  }>) => import("react/jsx-runtime").JSX.Element)[];
7
7
  };
@@ -1,22 +1,19 @@
1
1
  import r from "../styles.module.css.js";
2
- import { on as a, QUICK_EVENT as s, off as d } from "../utils.js";
3
- const i = r.app.split(" ")[0], f = `.${i} > header + :not(main) > button:empty:first-child`, c = ({ target: t }) => {
4
- const e = (t == null ? void 0 : t.nodeName) === "BUTTON" && (t == null ? void 0 : t.closest(f));
5
- if (!e) return;
6
- const o = e.closest(`.${i} > *`), n = () => o == null ? void 0 : o.setAttribute(
7
- "data-expanded",
8
- `${(o == null ? void 0 : o.getAttribute("data-expanded")) === "false"}`
9
- );
10
- document.startViewTransition ? document.startViewTransition(() => n()) : n();
2
+ import { on as d, QUICK_EVENT as a, attr as e, off as f } from "../utils.js";
3
+ const i = r.app.split(" ")[0], m = `.${i} > header + :not(main) > button:empty:first-child`, c = ({ target: t }) => {
4
+ const o = (t == null ? void 0 : t.nodeName) === "BUTTON" && (t == null ? void 0 : t.closest(m));
5
+ if (!o) return;
6
+ const n = o.closest(`.${i} > *`), s = () => n && e(n, "data-expanded", `${e(n, "data-expanded") === "false"}`);
7
+ document.startViewTransition ? document.startViewTransition(() => s()) : s();
11
8
  };
12
- function u(t) {
13
- a(t, "click", c, s);
14
- }
15
9
  function T(t) {
16
- d(t, "click", c, s);
10
+ d(t, "click", c, a);
11
+ }
12
+ function g(t) {
13
+ f(t, "click", c, a);
17
14
  }
18
15
  export {
19
- u as observe,
20
- T as unobserve
16
+ T as observe,
17
+ g as unobserve
21
18
  };
22
19
  //# sourceMappingURL=layout-observer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout-observer.js","sources":["../../designsystem/layout/layout-observer.ts"],"sourcesContent":["import styles from '../styles.module.css';\nimport { QUICK_EVENT, off, on } from '../utils';\n\nconst CSS_APP = styles.app.split(' ')[0];\nconst CSS_TOGGLE = `.${CSS_APP} > header + :not(main) > button:empty:first-child`;\n\nconst handleToggleClick = ({ target: el }: Event) => {\n const btn = (el as Element)?.nodeName === 'BUTTON' && (el as Element)?.closest(CSS_TOGGLE);\n\n if (!btn) return;\n\n const nav = btn.closest(`.${CSS_APP} > *`);\n const toggle = () =>\n nav?.setAttribute(\n \"data-expanded\",\n `${nav?.getAttribute(\"data-expanded\") === \"false\"}`,\n );\n\n if (!document.startViewTransition) toggle();\n else document.startViewTransition(() => toggle());\n};\n\nexport function observe(el: Element) {\n on(el, 'click', handleToggleClick, QUICK_EVENT);\n}\n\nexport function unobserve(el: Element) {\n off(el, 'click', handleToggleClick, QUICK_EVENT);\n}\n"],"names":["CSS_APP","styles","CSS_TOGGLE","handleToggleClick","el","btn","nav","toggle","observe","on","QUICK_EVENT","unobserve","off"],"mappings":";;AAGA,MAAMA,IAAUC,EAAO,IAAI,MAAM,GAAG,EAAE,CAAC,GACjCC,IAAa,IAAIF,CAAO,qDAExBG,IAAoB,CAAC,EAAE,QAAQC,QAAgB;AACnD,QAAMC,KAAOD,KAAA,gBAAAA,EAAgB,cAAa,aAAaA,KAAA,gBAAAA,EAAgB,QAAQF;AAE/E,MAAI,CAACG,EAAK;AAEV,QAAMC,IAAMD,EAAI,QAAQ,IAAIL,CAAO,MAAM,GACnCO,IAAS,MACbD,KAAA,gBAAAA,EAAK;AAAA,IACH;AAAA,IACA,IAAGA,KAAA,gBAAAA,EAAK,aAAa,sBAAqB,OAAO;AAAA;AAGjD,EAAC,SAAS,sBACA,SAAA,oBAAoB,MAAMC,GAAQ,IADNA,EAAA;AAE5C;AAEO,SAASC,EAAQJ,GAAa;AAChC,EAAAK,EAAAL,GAAI,SAASD,GAAmBO,CAAW;AAChD;AAEO,SAASC,EAAUP,GAAa;AACjC,EAAAQ,EAAAR,GAAI,SAASD,GAAmBO,CAAW;AACjD;"}
1
+ {"version":3,"file":"layout-observer.js","sources":["../../designsystem/layout/layout-observer.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport { QUICK_EVENT, attr, off, on } from \"../utils\";\n\nconst CSS_APP = styles.app.split(\" \")[0];\nconst CSS_TOGGLE = `.${CSS_APP} > header + :not(main) > button:empty:first-child`;\n\nconst handleToggleClick = ({ target: el }: Event) => {\n const btn =\n (el as Element)?.nodeName === \"BUTTON\" &&\n (el as Element)?.closest(CSS_TOGGLE);\n\n if (!btn) return;\n\n const nav = btn.closest(`.${CSS_APP} > *`);\n const toggle = () =>\n nav &&\n attr(nav, \"data-expanded\", `${attr(nav, \"data-expanded\") === \"false\"}`);\n\n if (!document.startViewTransition) toggle();\n else document.startViewTransition(() => toggle());\n};\n\nexport function observe(el: Element) {\n on(el, \"click\", handleToggleClick, QUICK_EVENT);\n}\n\nexport function unobserve(el: Element) {\n off(el, \"click\", handleToggleClick, QUICK_EVENT);\n}\n"],"names":["CSS_APP","styles","CSS_TOGGLE","handleToggleClick","el","btn","nav","toggle","attr","observe","on","QUICK_EVENT","unobserve","off"],"mappings":";;AAGA,MAAMA,IAAUC,EAAO,IAAI,MAAM,GAAG,EAAE,CAAC,GACjCC,IAAa,IAAIF,CAAO,qDAExBG,IAAoB,CAAC,EAAE,QAAQC,QAAgB;AACnD,QAAMC,KACHD,KAAA,gBAAAA,EAAgB,cAAa,aAC7BA,KAAA,gBAAAA,EAAgB,QAAQF;AAE3B,MAAI,CAACG,EAAK;AAEV,QAAMC,IAAMD,EAAI,QAAQ,IAAIL,CAAO,MAAM,GACnCO,IAAS,MACbD,KACAE,EAAKF,GAAK,iBAAiB,GAAGE,EAAKF,GAAK,eAAe,MAAM,OAAO,EAAE;AAEpE,EAAC,SAAS,sBACA,SAAA,oBAAoB,MAAMC,GAAQ,IADNA,EAAA;AAE5C;AAEO,SAASE,EAAQL,GAAa;AAChC,EAAAM,EAAAN,GAAI,SAASD,GAAmBQ,CAAW;AAChD;AAEO,SAASC,EAAUR,GAAa;AACjC,EAAAS,EAAAT,GAAI,SAASD,GAAmBQ,CAAW;AACjD;"}
@@ -1,9 +1,18 @@
1
1
  import { JSX } from 'react';
2
2
  import { PolymorphicComponentPropWithRef } from '../react-types';
3
- type LayoutProps<As extends React.ElementType = "div"> = PolymorphicComponentPropWithRef<As>;
4
- type LayoutComponent = <As extends React.ElementType = "div">(props: LayoutProps<As>) => JSX.Element;
5
- export type FlexProps<As extends React.ElementType = "div"> = LayoutProps<As>;
6
- export declare const Flex: LayoutComponent;
7
- export type GridProps<As extends React.ElementType = "div"> = LayoutProps<As>;
8
- export declare const Grid: LayoutComponent;
3
+ type SharedProps = {
4
+ "data-align"?: "stretch" | "start" | "center" | "end";
5
+ "data-center"?: "sm" | "md" | "lg" | "xl" | "2xl";
6
+ "data-gap"?: "none" | "xs" | "sm" | "md" | "lg" | false;
7
+ "data-justify"?: "start" | "center" | "end" | "space-between" | "space-around" | "space-evenly";
8
+ "data-justify-content"?: "start" | "center" | "end" | "space-between" | "space-around" | "space-evenly";
9
+ };
10
+ export type FlexProps<As extends React.ElementType = "div"> = PolymorphicComponentPropWithRef<As, SharedProps>;
11
+ export type GridProps<As extends React.ElementType = "div"> = PolymorphicComponentPropWithRef<As, SharedProps & {
12
+ "data-grid"?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "fit" | "fit-lg" | "fit-md" | "fit-sm" | "fit-xs" | "lg" | "md" | "sm" | "xs" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
13
+ }>;
14
+ type FlexComponent = <As extends React.ElementType = "div">(props: FlexProps<As>) => JSX.Element;
15
+ type GridComponent = <As extends React.ElementType = "div">(props: GridProps<As>) => JSX.Element;
16
+ export declare const Flex: FlexComponent;
17
+ export declare const Grid: GridComponent;
9
18
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"layout.js","sources":["../../designsystem/layout/layout.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { type JSX, forwardRef } from \"react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\n\ntype LayoutProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<As>;\n\ntype LayoutComponent = <As extends React.ElementType = \"div\">(\n\tprops: LayoutProps<As>,\n) => JSX.Element;\n\nexport type FlexProps<As extends React.ElementType = \"div\"> = LayoutProps<As>;\nexport const Flex: LayoutComponent = forwardRef<null>(function Flex<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: LayoutProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn <Tag className={clsx(styles.flex, className)} ref={ref} {...rest} />;\n}) as LayoutComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport type GridProps<As extends React.ElementType = \"div\"> = LayoutProps<As>;\nexport const Grid: LayoutComponent = forwardRef<null>(function Grid<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: LayoutProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn <Tag className={clsx(styles.grid, className)} ref={ref} {...rest} />;\n}) as LayoutComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"names":["Flex","forwardRef","as","className","rest","ref","jsx","clsx","styles","Grid"],"mappings":";;;;AAgBa,MAAAA,IAAwBC,EAAiB,SAEpD,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAK,GAAoBC,GAA0B;AAGjE,SAAA,gBAAAC,EAFKJ,KAAM,OAEN,EAAA,WAAWK,EAAKC,EAAO,MAAML,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAM,CAAA;AAC1E,CAAC,GAGYK,IAAwBR,EAAiB,SAEpD,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAK,GAAoBC,GAA0B;AAGjE,SAAA,gBAAAC,EAFKJ,KAAM,OAEN,EAAA,WAAWK,EAAKC,EAAO,MAAML,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAM,CAAA;AAC1E,CAAC;"}
1
+ {"version":3,"file":"layout.js","sources":["../../designsystem/layout/layout.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { type JSX, forwardRef } from \"react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\n\ntype SharedProps = {\n\t\"data-align\"?: \"stretch\" | \"start\" | \"center\" | \"end\";\n\t\"data-center\"?: \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\n\t\"data-gap\"?: \"none\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | false;\n\t\"data-justify\"?:\n\t\t| \"start\"\n\t\t| \"center\"\n\t\t| \"end\"\n\t\t| \"space-between\"\n\t\t| \"space-around\"\n\t\t| \"space-evenly\";\n\t\"data-justify-content\"?:\n\t\t| \"start\"\n\t\t| \"center\"\n\t\t| \"end\"\n\t\t| \"space-between\"\n\t\t| \"space-around\"\n\t\t| \"space-evenly\";\n};\n\nexport type FlexProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<As, SharedProps>;\n\nexport type GridProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<\n\t\tAs,\n\t\tSharedProps & {\n\t\t\t\"data-grid\"?:\n\t\t\t\t| \"1\"\n\t\t\t\t| \"2\"\n\t\t\t\t| \"3\"\n\t\t\t\t| \"4\"\n\t\t\t\t| \"5\"\n\t\t\t\t| \"6\"\n\t\t\t\t| \"7\"\n\t\t\t\t| \"8\"\n\t\t\t\t| \"9\"\n\t\t\t\t| \"10\"\n\t\t\t\t| \"11\"\n\t\t\t\t| \"12\"\n\t\t\t\t| \"fit\"\n\t\t\t\t| \"fit-lg\"\n\t\t\t\t| \"fit-md\"\n\t\t\t\t| \"fit-sm\"\n\t\t\t\t| \"fit-xs\"\n\t\t\t\t| \"lg\"\n\t\t\t\t| \"md\"\n\t\t\t\t| \"sm\"\n\t\t\t\t| \"xs\"\n\t\t\t\t| 1\n\t\t\t\t| 2\n\t\t\t\t| 3\n\t\t\t\t| 4\n\t\t\t\t| 5\n\t\t\t\t| 6\n\t\t\t\t| 7\n\t\t\t\t| 8\n\t\t\t\t| 9\n\t\t\t\t| 10\n\t\t\t\t| 11\n\t\t\t\t| 12;\n\t\t}\n\t>;\n\ntype FlexComponent = <As extends React.ElementType = \"div\">(\n\tprops: FlexProps<As>,\n) => JSX.Element;\n\ntype GridComponent = <As extends React.ElementType = \"div\">(\n\tprops: GridProps<As>,\n) => JSX.Element;\n\nexport const Flex: FlexComponent = forwardRef<null>(function Flex<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: FlexProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn <Tag className={clsx(styles.flex, className)} ref={ref} {...rest} />;\n}) as FlexComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport const Grid: GridComponent = forwardRef<null>(function Grid<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: GridProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn <Tag className={clsx(styles.grid, className)} ref={ref} {...rest} />;\n}) as GridComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n"],"names":["Flex","forwardRef","as","className","rest","ref","jsx","clsx","styles","Grid"],"mappings":";;;;AAgFa,MAAAA,IAAsBC,EAAiB,SAElD,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAK,GAAkBC,GAA0B;AAG/D,SAAA,gBAAAC,EAFKJ,KAAM,OAEN,EAAA,WAAWK,EAAKC,EAAO,MAAML,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAM,CAAA;AAC1E,CAAC,GAEYK,IAAsBR,EAAiB,SAElD,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAK,GAAkBC,GAA0B;AAG/D,SAAA,gBAAAC,EAFKJ,KAAM,OAEN,EAAA,WAAWK,EAAKC,EAAO,MAAML,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAM,CAAA;AAC1E,CAAC;"}
@@ -4,7 +4,7 @@ declare const meta: {
4
4
  parameters: {
5
5
  layout: string;
6
6
  };
7
- decorators: ((Story: import('@storybook/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
7
+ decorators: ((Story: import('@storybook/core/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
8
8
  [x: string]: any;
9
9
  }>) => import("react/jsx-runtime").JSX.Element)[];
10
10
  };
@@ -0,0 +1,2 @@
1
+ export declare const observe: (el: Element) => void;
2
+ export declare const unobserve: (el: Element) => void;
@@ -0,0 +1,23 @@
1
+ import w from "../styles.module.css.js";
2
+ import { IS_BROWSER as v, onMutation as m } from "../utils.js";
3
+ const n = w.logo.split(" ")[0];
4
+ let o;
5
+ function d(t) {
6
+ var i, c, a;
7
+ const e = (i = t[0]) == null ? void 0 : i.firstElementChild;
8
+ if (!e) return;
9
+ if (!o) {
10
+ const { head: g } = ((c = window.top) == null ? void 0 : c.document) || document, h = g.getElementsByTagName("link[rel~='icon']"), u = document.createElement("link");
11
+ for (const f of h) f.remove();
12
+ o = g.appendChild(Object.assign(u, { rel: "icon" }));
13
+ }
14
+ const s = (a = e.parentElement) == null ? void 0 : a.hasAttribute("data-color"), r = window.getComputedStyle(e), l = r.getPropertyValue("color"), p = r.getPropertyValue("background-color");
15
+ o.href = `data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 55 55'><rect fill='${s ? "none" : p}' width='51' height='51' x='2' y='2' stroke='${l}' stroke-dasharray='0.09 6.38' stroke-linecap='round' stroke-opacity='${s ? 0.6 : 0}' stroke-width='2.3' rx='25.5'/><g transform="translate(7.5 7.5)">${encodeURIComponent(e.outerHTML.replace(/(fill|width|height|xmlns)=\S+/gi, "").replace("<svg", `<svg width="40" height="40" fill="${l}"`))}</g></svg>`;
16
+ }
17
+ v && setTimeout(() => d(document.getElementsByClassName(n)), 300);
18
+ const x = (t) => m(t, n, d), C = (t) => m(t, n, !1);
19
+ export {
20
+ x as observe,
21
+ C as unobserve
22
+ };
23
+ //# sourceMappingURL=logo-observer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logo-observer.js","sources":["../../designsystem/logo/logo-observer.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport { IS_BROWSER, onMutation } from \"../utils\";\nconst CSS_LOGO = styles.logo.split(\" \")[0];\nlet FAVICON: HTMLLinkElement;\n\nfunction process(logos: HTMLCollectionOf<Element>) {\n const svg = logos[0]?.firstElementChild;\n\n if (!svg) return;\n if (!FAVICON) {\n const { head } = window.top?.document || document;\n const oldIcon = head.getElementsByTagName(\"link[rel~='icon']\");\n const newIcon = document.createElement(\"link\");\n\n for (const icon of oldIcon) icon.remove();\n FAVICON = head.appendChild(Object.assign(newIcon, { rel: \"icon\" }));\n }\n\n const isDot = svg.parentElement?.hasAttribute(\"data-color\");\n const style = window.getComputedStyle(svg);\n const text = style.getPropertyValue(\"color\");\n const back = style.getPropertyValue(\"background-color\");\n\n FAVICON.href = `data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 55 55'><rect fill='${isDot ? \"none\" : back}' width='51' height='51' x='2' y='2' stroke='${text}' stroke-dasharray='0.09 6.38' stroke-linecap='round' stroke-opacity='${isDot ? 0.6 : 0}' stroke-width='2.3' rx='25.5'/><g transform=\"translate(7.5 7.5)\">${encodeURIComponent(svg.outerHTML.replace(/(fill|width|height|xmlns)=\\S+/gi, \"\").replace(\"<svg\", `<svg width=\"40\" height=\"40\" fill=\"${text}\"`))}</g></svg>`;\n}\n\n// Force a update even if not active tab\nif (IS_BROWSER)\n setTimeout(() => process(document.getElementsByClassName(CSS_LOGO)), 300);\n\nexport const observe = (el: Element) => onMutation(el, CSS_LOGO, process);\nexport const unobserve = (el: Element) => onMutation(el, CSS_LOGO, false);\n"],"names":["CSS_LOGO","styles","FAVICON","process","logos","svg","_a","head","_b","oldIcon","newIcon","icon","isDot","_c","style","text","back","IS_BROWSER","observe","el","onMutation","unobserve"],"mappings":";;AAEA,MAAMA,IAAWC,EAAO,KAAK,MAAM,GAAG,EAAE,CAAC;AACzC,IAAIC;AAEJ,SAASC,EAAQC,GAAkC;;AAC3C,QAAAC,KAAMC,IAAAF,EAAM,CAAC,MAAP,gBAAAE,EAAU;AAEtB,MAAI,CAACD,EAAK;AACV,MAAI,CAACH,GAAS;AACZ,UAAM,EAAE,MAAAK,EAAS,MAAAC,IAAA,OAAO,QAAP,gBAAAA,EAAY,aAAY,UACnCC,IAAUF,EAAK,qBAAqB,mBAAmB,GACvDG,IAAU,SAAS,cAAc,MAAM;AAElC,eAAAC,KAAQF,EAAS,CAAAE,EAAK,OAAO;AAC9B,IAAAT,IAAAK,EAAK,YAAY,OAAO,OAAOG,GAAS,EAAE,KAAK,OAAO,CAAC,CAAC;AAAA,EAAA;AAGpE,QAAME,KAAQC,IAAAR,EAAI,kBAAJ,gBAAAQ,EAAmB,aAAa,eACxCC,IAAQ,OAAO,iBAAiBT,CAAG,GACnCU,IAAOD,EAAM,iBAAiB,OAAO,GACrCE,IAAOF,EAAM,iBAAiB,kBAAkB;AAE9C,EAAAZ,EAAA,OAAO,8FAA8FU,IAAQ,SAASI,CAAI,gDAAgDD,CAAI,yEAAyEH,IAAQ,MAAM,CAAC,qEAAqE,mBAAmBP,EAAI,UAAU,QAAQ,mCAAmC,EAAE,EAAE,QAAQ,QAAQ,qCAAqCU,CAAI,GAAG,CAAC,CAAC;AACne;AAGIE,KACF,WAAW,MAAMd,EAAQ,SAAS,uBAAuBH,CAAQ,CAAC,GAAG,GAAG;AAEnE,MAAMkB,IAAU,CAACC,MAAgBC,EAAWD,GAAInB,GAAUG,CAAO,GAC3DkB,IAAY,CAACF,MAAgBC,EAAWD,GAAInB,GAAU,EAAK;"}
@@ -1,6 +1,7 @@
1
1
  import { JSX } from 'react';
2
2
  import { PolymorphicComponentPropWithRef } from '../react-types';
3
3
  type LogoBaseProps<Href> = {
4
+ "data-color"?: "orange" | "blue";
4
5
  href?: Href;
5
6
  };
6
7
  export type LogoProps<Href, As extends React.ElementType = Href extends string ? "a" : "span"> = PolymorphicComponentPropWithRef<As, LogoBaseProps<Href>>;