@kubit-ui-web/react-components 2.0.0-beta.43 → 2.0.0-beta.44

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.
@@ -32,12 +32,11 @@ export declare class Provider {
32
32
  #themesMediaQueries: typeof cssMediaQueries;
33
33
  #linkId: string;
34
34
  #jsInCss: boolean;
35
- #linkBuilder: (url: string, id: string) => void;
36
- #handlerThemes: (data: {
37
- css: string;
38
- foreign?: { high?: string[]; low?: string[] };
39
- }) => void;
40
- #cleanUpLinks: () => void;
35
+ /* Bernova provider methods */
36
+ #linkBuilder(css: string, id: string): void;
37
+ #handlerThemes(data: { css: string }): void;
38
+ #cleanUpLinks(): void;
39
+ /* Bernova provider methods */
41
40
 
42
41
  constructor(options?: { linkId?: string; jsInCss?: boolean });
43
42
 
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Provider=void 0;var _stats=require("./stats/stats");class Provider{#e;#t;#s;#i;#r;#n;#o;#h;#a;#c=(e,t)=>{if("undefined"==typeof document)return;let s=document.getElementById(t);s||(s=document.createElement("link"),s.id=t,s.rel="stylesheet",document.head.appendChild(s));const i=new URL(e,import.meta.url).href;s.href=i};#l=e=>{const{css:t,foreign:s}=e,i=s?.before||[],r=s?.after||[];i.forEach((e,t)=>{const s=`${this.#h}-foreign-before-${t+1}`;this.#c(e,s)}),this.#c(t,this.#h),r.forEach((e,t)=>{const s=`${this.#h}-foreign-after-${t+1}`;this.#c(e,s)})};#d=()=>{"undefined"!=typeof document&&document.querySelectorAll(`link[id^="${this.#h}"]`).forEach(e=>e.remove())};constructor({linkId:e,jsInCss:t}={}){this.#t=_stats.cssThemes,this.#s=_stats.cssVars,this.#i=_stats.cssClasses,this.#r=_stats.cssAvailableComponents,this.#n=_stats.cssGlobalStyles,this.#o=_stats.cssMediaQueries,this.#h=e||"kb-styled-link",this.#e=Object.keys(_stats.cssThemes)[0],this.#a=!!t,this.getComponentStyles=this.getComponentStyles.bind(this),"undefined"!=typeof window&&"undefined"!=typeof document&&this.#a&&(this.#d(),this.#l(this.#t[this.#e]))}get themeSelected(){return this.#e}set themeSelected(e){if(!(e in this.#t))throw new Error(`${e} is not exists`);this.#a&&(this.#d(),this.#l(this.#t[e])),this.#e=e}get allThemesNames(){return Object.keys(this.#t)}get allThemes(){return this.#t}get variables(){return this.#s[this.#e]}get classNames(){return this.#i[this.#e]}get components(){return this.#r[this.#e]}get globalStyles(){return this.#n[this.#e]}get mediaQueries(){return this.#o[this.#e]}getComponentStyles({variant:e,component:t,additionalClassNames:s}){const i=this.#i[this.#e][t.toLocaleUpperCase()];if(!i)return{};const r={},n=!!e&&`$_${e.toLocaleLowerCase().replace(/-/g,"_")}`;if(n&&n in i){const e=i[n];Object.entries(e).forEach(([e,t])=>{e in r||(r[e]=t)})}return Object.entries(i).forEach(([e,t])=>{e.startsWith("$_")||e in r||(r[e]=t)}),s&&Object.keys(s).length&&Object.entries(s).forEach(([e,t])=>{e in r||(r[e]=""),r[e]+=` ${t}`}),r}}exports.Provider=Provider;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Provider=void 0;var _stats=require("./stats/stats");class Provider{#e;#s;#t;#n;#i;#r;#h;#a;#m;#l=(e,s)=>{if("undefined"==typeof document)return;let t=document.getElementById(s);t||(t=document.createElement("style"),t.id=s,t.type="text/css",document.head.appendChild(t)),t.innerHTML=e};#o=e=>{const{css:s}=e;this.#l(s,this.#a)};#c=()=>{if("undefined"==typeof document)return;const e=document.getElementById(this.#a);e&&e.remove()};constructor({linkId:e,jsInCss:s}={}){this.#s=_stats.cssThemes,this.#t=_stats.cssVars,this.#n=_stats.cssClasses,this.#i=_stats.cssAvailableComponents,this.#r=_stats.cssGlobalStyles,this.#h=_stats.cssMediaQueries,this.#a=e||"kb-styled-link",this.#e=Object.keys(_stats.cssThemes)[0],this.#m=!!s,this.getComponentStyles=this.getComponentStyles.bind(this),"undefined"!=typeof window&&"undefined"!=typeof document&&this.#m&&(this.#c(),this.#o(this.#s[this.#e]))}get themeSelected(){return this.#e}set themeSelected(e){if(!(e in this.#s))throw new Error(`${e} is not exists`);this.#m&&(this.#c(),this.#o(this.#s[e])),this.#e=e}get allThemesNames(){return Object.keys(this.#s)}get allThemes(){return this.#s}get variables(){return this.#t[this.#e]}get classNames(){return this.#n[this.#e]}get components(){return this.#i[this.#e]}get globalStyles(){return this.#r[this.#e]}get mediaQueries(){return this.#h[this.#e]}getComponentStyles({variant:e,component:s,additionalClassNames:t}){const n=this.#n[this.#e][s.toLocaleUpperCase()];if(!n)return{};const i={},r=(()=>{if(e){return`$_${e.toLocaleLowerCase().replace(/-/g,"_")}`}return!1})();if(r&&r in n){const e=n[r];Object.entries(e).forEach(([e,s])=>{e in i||(i[e]=s)})}return Object.entries(n).forEach(([e,s])=>{e.startsWith("$_")||e in i||(i[e]=s)}),t&&Object.keys(t).length&&Object.entries(t).forEach(([e,s])=>{e in i||(i[e]=""),i[e]+=` ${s}`}),i}}exports.Provider=Provider;