@public-ui/themes 3.1.5 → 3.1.6-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -374,7 +374,7 @@ function requireLoglevel () {
374
374
 
375
375
  requireLoglevel();
376
376
 
377
- const j=(t,e)=>s=>s(t,e),F=(t,e)=>s=>s(t,e,{append:false}),Y=()=>{const t=typeof process<"u"&&process.env?process.env:{},e=t.NODE_ENV==="test",s="VITEST"in t,o="JEST_WORKER_ID"in t,a="PLAYWRIGHT_TEST_BASE_URL"in t,r=t.CI==="true",i=t.TEST==="true"||t.IS_TEST==="true",c=typeof navigator<"u"&&navigator.webdriver===true,y=typeof navigator<"u"&&/playwright|puppeteer|webdriver|selenium|testcafe/i.test(navigator.userAgent);return e||s||o||a||r||i||c||y},n$1={A11yUi:{CSS_STYLE_CACHE:new Map,IS_TEST_ENVIRONMENT:Y(),PERFORMANCE_MEASURES:new Map,STYLING_TASK_QUEUE:new Map,THEMES:new Map,showAverageTimes:()=>{const t={};for(const[s,o]of n$1.A11yUi.PERFORMANCE_MEASURES.entries())t[s]=[o.totalTime/o.count,o.count];const e=Object.entries(t).sort((s,o)=>o[1][0]-s[1][0]);return console.table(Object.fromEntries(e.map(([s,[o,a]])=>[s,{"avg (ms)":parseFloat(o.toFixed(2)),count:a}]))),t}}};const v=new Set,N=new Map,X=/--[^;]+/g,Z=/:/,ee=typeof MutationObserver<"u";let R=()=>{Math.min(25+Math.log2(n$1.A11yUi.STYLING_TASK_QUEUE.size+1)*20,250);};const te=(t,e)=>{let s=e.match(X);if(Array.isArray(s)){s=s.filter(a=>Z.test(a));const o=document.createElement("style");o.innerHTML=`.${t} {${s.join(";")}}`,document.querySelector("head")?.appendChild(o);}v.add(t);},d=(t,e)=>{const s=n$1.A11yUi.THEMES.get(t);if(s instanceof Map){const o=s.get(e);if(o!==void 0)return o}return ""},se=t=>{const e=t.firstChild;if(!(!(e instanceof HTMLStyleElement)||e.dataset.themingFallback!==void 0))for(const s of Array.from(t.childNodes))if(s instanceof HTMLStyleElement&&s.tagName==="STYLE"&&s.dataset.themingFallback===void 0)t.removeChild(s);else break},oe=(t,e)=>{try{if(n$1.A11yUi.Theme?.mode==="ssr")throw new Error("SSR");const s=e.filter(o=>typeof o=="string"&&o.length>0).map(o=>{let a=N.get(o);return a||(a=new CSSStyleSheet,a.replaceSync(o),N.set(o,a)),a});t.adoptedStyleSheets=s;}catch{for(let o=e.length-1;o>=0;o--){const a=e[o];if(typeof a!="string"||a.length===0)continue;const r=e.length-1-o,i=document.createElement("style");switch(i.dataset.themingFallback="",r){case 4:i.dataset.themingBaseA11y="";break;case 3:i.dataset.themingBaseGlobal="";break;case 2:i.dataset.themingBaseComponent="";break;case 1:i.dataset.themingCustomGlobal="";break;case 0:i.dataset.themingCustomComponent="";break;default:i.dataset.themingUnknown="";break}i.innerHTML=a,t.insertBefore(i,t.firstChild);}}},ae=(t,e,s)=>{if(s===false||s?.mode!=="before"&&s?.mode!=="after")return;const o=Array.from(t.childNodes).filter(r=>r instanceof HTMLStyleElement&&r.tagName==="STYLE");let a;try{a=Array.from(t.adoptedStyleSheets);}catch{a=[];}if(!(o.length===0&&a.length===0))if(s.mode==="before"){const r=[...a.map(i=>Array.from(i.cssRules).map(c=>c.cssText).join("")),...o.map(i=>i.innerHTML)];e.unshift(...r);}else o.forEach(r=>e.push(r.innerHTML)),a.forEach(r=>e.push(Array.from(r.cssRules).map(i=>i.cssText).join("")));},ne=(t,e,s)=>{const o=e.name||"default";let a;try{if(t.shadowRoot===null)throw new Error("ShadowRoot is null");a=t.shadowRoot;}catch{a=t;}const r=n$1.A11yUi.CSS_STYLE_CACHE.get(o)?.get(t.tagName);if(r)_(t,a,r,s);else {const i=d(o,"PROPERTIES"),c=d(o,"GLOBAL"),y=d(o,t.tagName);v.has(o)===false&&te(o,c);const u=[i,c,y];if(ae(a,u,e.encroachCss),e.cache===true){let m=n$1.A11yUi.CSS_STYLE_CACHE.get(o);m||(m=new Map,n$1.A11yUi.CSS_STYLE_CACHE.set(o,m)),m.set(t.tagName,u);}_(t,a,u,s);}},_=(t,e,s,o)=>{const a=n$1.A11yUi.Theme?.loglevel==="debug",r=a?performance.now():0;if(se(e),oe(e,s),me(t),requestAnimationFrame(o),a){const i=performance.now()-r,c=n$1.A11yUi.PERFORMANCE_MEASURES.get(t.tagName);c?(c.count+=1,c.totalTime+=i):n$1.A11yUi.PERFORMANCE_MEASURES.set(t.tagName,{count:1,totalTime:i});}},O=t=>{const e=n$1.A11yUi.STYLING_TASK_QUEUE.get(t);if(e){const{resetCss:s,themeDetails:o}=e;ne(t,o,s);}};const ce={attributes:true,attributeFilter:[],childList:false,subtree:false},I=ee?new MutationObserver((t,e)=>{const s=[];for(const o of t){const a=o.target;a.classList.contains("hydrated")&&n$1.A11yUi.STYLING_TASK_QUEUE.has(a)&&(O(a),s.push(a));}for(const o of s)e.observe(o,ce);}):null;I&&(R=()=>{});const me=t=>{n$1.A11yUi.STYLING_TASK_QUEUE.delete(t),R();};class fe{Prefix;Key;Tag;createTheme=(e,s)=>F(e,s);createTranslation=(e,s)=>j(e,s);constructor(e,s,o){this.Prefix=e,this.Key=Object.getOwnPropertyNames(s),this.Tag=Object.getOwnPropertyNames(o);}}
377
+ const j=(t,e)=>s=>s(t,e),F=(t,e)=>s=>s(t,e,{append:false}),Y=()=>{const t=typeof process<"u"&&process.env?process.env:{},e=t.NODE_ENV==="test",s="VITEST"in t,a="JEST_WORKER_ID"in t,o="PLAYWRIGHT_TEST_BASE_URL"in t,r=t.CI==="true",i=t.TEST==="true"||t.IS_TEST==="true",c=typeof navigator<"u"&&navigator.webdriver===true,u=typeof navigator<"u"&&/playwright|puppeteer|webdriver|selenium|testcafe/i.test(navigator.userAgent);return e||s||a||o||r||i||c||u},n$1={A11yUi:{CSS_STYLE_CACHE:new Map,IS_TEST_ENVIRONMENT:Y(),PERFORMANCE_MEASURES:new Map,STYLING_TASK_QUEUE:new Map,THEMES:new Map,showAverageTimes:()=>{const t={};for(const[s,a]of n$1.A11yUi.PERFORMANCE_MEASURES.entries())t[s]=[a.totalTime/a.count,a.count];const e=Object.entries(t).sort((s,a)=>a[1][0]-s[1][0]);return console.table(Object.fromEntries(e.map(([s,[a,o]])=>[s,{"avg (ms)":parseFloat(a.toFixed(2)),count:o}]))),t}}};const v=new Set,N=new Map,ee=/--[^;]+/g,te=/:/,se=typeof MutationObserver<"u";let R=()=>{Math.min(25+Math.log2(n$1.A11yUi.STYLING_TASK_QUEUE.size+1)*20,250);};const ae=(t,e)=>{let s=e.match(ee);if(Array.isArray(s)){s=s.filter(o=>te.test(o));const a=document.createElement("style");a.innerHTML=`.${t} {${s.join(";")}}`,document.querySelector("head")?.appendChild(a);}v.add(t);},y=(t,e)=>{const s=n$1.A11yUi.THEMES.get(t);if(s instanceof Map){const a=s.get(e);if(a!==void 0)return a}return ""},oe=t=>{const e=t.firstChild;if(!(!(e instanceof HTMLStyleElement)||e.dataset.themingFallback!==void 0))for(const s of Array.from(t.childNodes))if(s instanceof HTMLStyleElement&&s.tagName==="STYLE"&&s.dataset.themingFallback===void 0)t.removeChild(s);else break},ne=(t,e)=>{try{if(n$1.A11yUi.Theme?.mode==="ssr")throw new Error("SSR");const s=e.filter(a=>typeof a=="string"&&a.length>0).map(a=>{let o=N.get(a);return o||(o=new CSSStyleSheet,o.replaceSync(a),N.set(a,o)),o});t.adoptedStyleSheets=s;}catch{for(let a=e.length-1;a>=0;a--){const o=e[a];if(typeof o!="string"||o.length===0)continue;const r=e.length-1-a,i=document.createElement("style");switch(i.dataset.themingFallback="",r){case 4:i.dataset.themingBaseA11y="";break;case 3:i.dataset.themingBaseGlobal="";break;case 2:i.dataset.themingBaseComponent="";break;case 1:i.dataset.themingCustomGlobal="";break;case 0:i.dataset.themingCustomComponent="";break;default:i.dataset.themingUnknown="";break}i.innerHTML=o,t.insertBefore(i,t.firstChild);}}},re=(t,e,s)=>{if(s===false||s?.mode!=="before"&&s?.mode!=="after")return;const a=Array.from(t.childNodes).filter(r=>r instanceof HTMLStyleElement&&r.tagName==="STYLE");let o;try{o=Array.from(t.adoptedStyleSheets);}catch{o=[];}if(!(a.length===0&&o.length===0))if(s.mode==="before"){const r=[...o.map(i=>Array.from(i.cssRules).map(c=>c.cssText).join("")),...a.map(i=>i.innerHTML)];e.unshift(...r);}else a.forEach(r=>e.push(r.innerHTML)),o.forEach(r=>e.push(Array.from(r.cssRules).map(i=>i.cssText).join("")));},ie=(t,e,s)=>{const a=e.name||"default";let o;try{if(t.shadowRoot===null)throw new Error("ShadowRoot is null");o=t.shadowRoot;}catch{o=t;}const r=n$1.A11yUi.CSS_STYLE_CACHE.get(a)?.get(t.tagName);if(r)_(t,o,r,s);else {const i=y(a,"PROPERTIES"),c=y(a,"GLOBAL"),u=y(a,t.tagName);v.has(a)===false&&ae(a,c);const p=[i,c,u];if(re(o,p,e.encroachCss),e.cache===true){let m=n$1.A11yUi.CSS_STYLE_CACHE.get(a);m||(m=new Map,n$1.A11yUi.CSS_STYLE_CACHE.set(a,m)),m.set(t.tagName,p);}_(t,o,p,s);}},_=(t,e,s,a)=>{const o=n$1.A11yUi.Theme?.loglevel==="debug",r=o?performance.now():0;if(oe(e),ne(e,s),fe(t),requestAnimationFrame(a),o){const i=performance.now()-r,c=n$1.A11yUi.PERFORMANCE_MEASURES.get(t.tagName);c?(c.count+=1,c.totalTime+=i):n$1.A11yUi.PERFORMANCE_MEASURES.set(t.tagName,{count:1,totalTime:i});}},O=t=>{const e=n$1.A11yUi.STYLING_TASK_QUEUE.get(t);if(e){const{resetCss:s,themeDetails:a}=e;ie(t,a,s);}};const me={attributes:true,attributeFilter:[],childList:false,subtree:false},I=se?new MutationObserver((t,e)=>{const s=[];for(const a of t){const o=a.target;o.classList.contains("hydrated")&&n$1.A11yUi.STYLING_TASK_QUEUE.has(o)&&(O(o),s.push(o));}for(const a of s)e.observe(a,me);}):null;I&&(R=()=>{});const fe=t=>{n$1.A11yUi.STYLING_TASK_QUEUE.delete(t),R();};class ye{Prefix;Key;Tag;createTheme=(e,s)=>F(e,s);createTranslation=(e,s)=>j(e,s);constructor(e,s,a){this.Prefix=e,this.Key=Object.getOwnPropertyNames(s),this.Tag=Object.getOwnPropertyNames(a);}}
378
378
 
379
379
  var KeyEnum;
380
380
  (function (KeyEnum) {
@@ -796,9 +796,9 @@ var hasRequiredCjs$1;
796
796
  function requireCjs$1 () {
797
797
  if (hasRequiredCjs$1) return cjs$1;
798
798
  hasRequiredCjs$1 = 1;
799
- (function (exports$1) {
800
- Object.defineProperty(exports$1, "__esModule", { value: true });
801
- exports$1.querySelectorAll = void 0;
799
+ (function (exports) {
800
+ Object.defineProperty(exports, "__esModule", { value: true });
801
+ exports.querySelectorAll = void 0;
802
802
  const pushNodes = (set, domNodes) => {
803
803
  domNodes.forEach((domNode) => {
804
804
  if (set.has(domNode) === false) {
@@ -816,10 +816,10 @@ function requireCjs$1 () {
816
816
  for (let i = 0; i < nodeList.length; i++) {
817
817
  const shadowRoot = nodeList[i].shadowRoot;
818
818
  if (typeof shadowRoot === "object" && shadowRoot !== null) {
819
- pushNodes(domNodes, (0, exports$1.querySelectorAll)(selector, shadowRoot));
819
+ pushNodes(domNodes, (0, exports.querySelectorAll)(selector, shadowRoot));
820
820
  }
821
821
  else {
822
- pushNodes(domNodes, (0, exports$1.querySelectorAll)(selector, nodeList[i]));
822
+ pushNodes(domNodes, (0, exports.querySelectorAll)(selector, nodeList[i]));
823
823
  }
824
824
  }
825
825
  return Array.from(domNodes);
@@ -828,7 +828,7 @@ function requireCjs$1 () {
828
828
  throw new Error(`The parameter document for the method querySelectorAll is not type of Document, HTMLElement or ShadowRoot.`);
829
829
  }
830
830
  };
831
- exports$1.querySelectorAll = querySelectorAll;
831
+ exports.querySelectorAll = querySelectorAll;
832
832
 
833
833
  } (cjs$1));
834
834
  return cjs$1;
@@ -843,9 +843,9 @@ var hasRequiredCjs;
843
843
  function requireCjs () {
844
844
  if (hasRequiredCjs) return cjs;
845
845
  hasRequiredCjs = 1;
846
- (function (exports$1) {
847
- Object.defineProperty(exports$1, "__esModule", { value: true });
848
- exports$1.querySelector = void 0;
846
+ (function (exports) {
847
+ Object.defineProperty(exports, "__esModule", { value: true });
848
+ exports.querySelector = void 0;
849
849
  const querySelector = (selector, node = document) => {
850
850
  if (node instanceof Document ||
851
851
  node instanceof HTMLElement ||
@@ -856,10 +856,10 @@ function requireCjs () {
856
856
  for (let i = 0; i < nodeList.length; i++) {
857
857
  const shadowRoot = nodeList[i].shadowRoot;
858
858
  if (typeof shadowRoot === "object" && shadowRoot !== null) {
859
- domNode = (0, exports$1.querySelector)(selector, shadowRoot);
859
+ domNode = (0, exports.querySelector)(selector, shadowRoot);
860
860
  }
861
861
  else {
862
- domNode = (0, exports$1.querySelector)(selector, nodeList[i]);
862
+ domNode = (0, exports.querySelector)(selector, nodeList[i]);
863
863
  }
864
864
  if (domNode !== null) {
865
865
  break;
@@ -872,7 +872,7 @@ function requireCjs () {
872
872
  throw new Error(`The parameter document for the method querySelector is not type of Document, HTMLElement or ShadowRoot.`);
873
873
  }
874
874
  };
875
- exports$1.querySelector = querySelector;
875
+ exports.querySelector = querySelector;
876
876
 
877
877
  } (cjs));
878
878
  return cjs;
@@ -999,7 +999,7 @@ var KolEvent;
999
999
  * KoliBri - The accessible HTML-Standard
1000
1000
  */
1001
1001
 
1002
- const KoliBri = new fe('kol', KeyEnum, TagEnum);
1002
+ const KoliBri = new ye('kol', KeyEnum, TagEnum);
1003
1003
 
1004
1004
  var Bundesministerium;
1005
1005
  (function (Bundesministerium) {