@publicapps/icons 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LazyLoader.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";var e=require("@babel/runtime/helpers/interopRequireWildcard").default;Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var r=e(require("react"));const t=({icon:e})=>{(0,r.useEffect)((()=>()=>{}),[e])};var u=exports.default=t;
package/esm/Icon.js ADDED
@@ -0,0 +1 @@
1
+ "use client";import e,{forwardRef as t,useContext as i,useId as s,useMemo as o}from"react";import{styleFunction as n,ContextThemeProvider as c,getSpecificCssRule as r}from"@publicapps/styles";import l from"./IconStyle";import a from"./IconBody";import{jsx as m}from"react/jsx-runtime";const d=t(((e,t)=>{const{icon:d,color:h,size:f,title:p,sx:u,hidden:g,disabled:k,dir:x,id:y,className:C,...I}=e;const b=y||String(s()).slice(1,-1)+"icon";const z=i(c);const{classesName:S,style:N,styleSx:D}=l(z);const j=N();const P=D({sx:u,color:h,disabled:k,onClick:e?.onClick?true:false});const E=n.getClassName(j?.[S?.icon_container],P?.[S?.icon_container],P?.[S?.sx],n.CheckDirectionItem(x),n.CheckDisabledItem(k),n.CheckHiddenItem(g),n.checkExistsMargin(I),n.checkExistsPadding(I),C);const R=o((()=>{const e=r(["fontSize"],u,((e,t)=>({height:t,width:t})));if(!Object.keys(e||{})?.length)return null;return e}),[u]);return e?.onClick?m("button",{className:E,title:p||"",id:b,...n?.getRestProps(I),ref:t,children:typeof d==="string"?m(a,{icon:d,theTheme:z,comID:b,size:f,fontSize:R}):null}):m("div",{className:E,title:p||"",id:b,...n?.getRestProps(I),ref:t,children:typeof d==="string"?m(a,{icon:d,theTheme:z,comID:b,size:f,fontSize:R}):null})}));export default d;
@@ -0,0 +1 @@
1
+ "use client";import n,{useEffect as e,useRef as o,useState as t}from"react";import{pkgConfigIcon as r}from"./index";import c from"./IconStyle";import{jsx as s,Fragment as l,jsxs as i}from"react/jsx-runtime";function a({icon:a,theTheme:u,comID:m,size:d,fontSize:f}){const p=o({strIconName:null});const[h,I]=t(null);const{classesName:y,styleIconBody:g,styleSxIconBody:x}=c(u);const N=g();const k=x({size:d,fontSize:f});e((()=>{const n=()=>{try{const n=String(a).toLowerCase().trim();if(p?.current?.strIconName===n)return;const e=import("stable"==="node"?`./icons.json`:`../icons.json`);return e.then((e=>{let o=e?.default||e;o=typeof o==="string"?JSON.parse(o):o;let t=o?.[n];p.current.strIconName=n;I(t)})).catch((e=>{if(r?.blnIsTestingMode)if(typeof"stable"==="undefined")try{return import(`./icons.json`).then((e=>{let o=e?.default||e;o=typeof o==="string"?JSON.parse(o):o;let t=o?.[n];I(t)})).catch((n=>{if(r?.blnIsTestingMode){console.log(n);console.error("Icon ( "+a+" ) not found.")}I(null)}))}catch(e){if(r?.blnIsTestingMode){console.log(e);console.error("Icon ( "+a+" ) not found.")}I(null)}console.log(e);console.error("Icon ( "+a+" ) not found.");p.current.strIconName=n;I(null)}))}catch(n){if(r?.blnIsTestingMode)console.error("Icon ( "+a+" ) not found.");p.current.strIconName=null;I(null)}};n()}),[a]);return s(n.Fragment,{children:s("svg",{className:`${N?.[y?.icon]} ${k?.[y?.icon]}`,viewBox:"0 0 24 24",children:!h?null:i(l,{children:[h?.["circle"]?h?.["circle"].map(((n,e)=>s("circle",{cx:n["cx"],cy:n["cy"],r:n["r"]},e))):null,h?.["path"]?h?.["path"].map(((n,e)=>s("path",{d:n},e))):null,h?.["line"]?h["line"].map(((n,e)=>s("line",{x1:n["x1"],y1:n["y1"],x2:n["x2"],y2:n["y2"],strokeWidth:n["strokeWidth"]?n["strokeWidth"]:"",strokeLinecap:n["strokeLinecap"]?n["strokeLinecap"]:"",stroke:"currentColor"},e))):null]})})})}export default a;
@@ -0,0 +1 @@
1
+ "use client";import{StyleBuilder as e,styleVariables as t,cssKeys as o,mainTheme as n,styleFunction as l}from"@publicapps/styles";export default r=>{const i=r?.cssObject?r?.cssObject:n?.cssObject;const s={icon_container:`${t?.prefixDefaultClassName}_icon_container`,icon:`${t?.prefixDefaultClassName}_icon`,sx:`${t?.prefixDefaultClassName}_icon_sx`};const c=e({blnRandomPrefix:false,blnIsDefaultStyle:true,blnCbmisStyle:true,objStyles:{[s?.icon_container]:{position:"relative",background:i?.color?.[o?.transparent],backgroundColor:i?.color?.[o?.transparent],margin:"auto",padding:0,zIndex:1,display:"flex",alignItems:"center",justifyContent:"center",placeContent:"center",outline:"none",border:"none",height:"fit-content",width:"fit-content",boxSizing:i?.boxSizing?.[o?.borderBox],overflow:"hidden"}}});const a=e({blnRandomPrefix:true,blnIsDefaultStyle:false,blnCbmisStyle:true,objStyles:{[s?.icon_container]:e=>({"&hover":e?.onClick?{background:i?.color?.[o?.bodyColorBgLight],cursor:"pointer"}:null,color:l.checkColorReturnValue(e?.color||i?.color?.[o?.currentColor])}),[s?.sx]:e=>({...e?.sx})}});const b=e({blnRandomPrefix:false,blnIsDefaultStyle:true,blnCbmisStyle:true,objStyles:{[s?.icon]:{fill:i?.color?.[o?.currentColor]}}});const u=e({blnRandomPrefix:true,blnIsDefaultStyle:false,blnCbmisStyle:true,objStyles:{[s?.icon]:e=>{if(e?.size)return{width:e?.size,height:e?.size};if(e?.fontSize)return{...e?.fontSize};return{width:i?.text?.[o?.size]?.[o?.body1],height:i?.text?.[o?.size]?.[o?.body1]}}}});return{classesName:s,style:c,styleSx:a,styleIconBody:b,styleSxIconBody:u}};
@@ -0,0 +1 @@
1
+ import o,{useEffect as t}from"react";const r=({icon:o})=>{t((()=>()=>{}),[o])};export default r;
File without changes
package/esm/index.js ADDED
@@ -0,0 +1 @@
1
+ "use client";function n(){const n={blnIsTestingMode:true};return n}export var pkgConfigIcon=n();export function setPkgConfigIcon({blnIsTestingMode:n=false}){pkgConfigIcon.blnIsTestingMode=n}export{default}from"./Icon";export{default as Icon}from"./Icon";