css-in-props 3.14.612 → 3.14.651
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/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var m=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var a=(r,o)=>{for(var t in o)m(r,t,{get:o[t],enumerable:!0})},h=(r,o,t,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of c(o))!g.call(r,s)&&s!==t&&m(r,s,{get:()=>o[s],enumerable:!(n=l(o,s))||n.enumerable});return r};var T=r=>h(m({},"__esModule",{value:!0}),r);var C={};a(C,{THEME_PROPS:()=>S,getSystemGlobalTheme:()=>d});module.exports=T(C);var e=require("@symbo.ls/scratch"),f=require("@symbo.ls/utils");const d=({context:r,state:o})=>{const t=o?.root?.globalTheme||r.designSystem?.globalTheme;return t==="auto"?null:t},i=(r,o)=>{if(o==null||o==="")return;if(!(0,f.isObject)(o))return{[r]:o};const t={};let n=!1;for(const s in o){const u=o[s];u==null||u===""||(0,f.isObject)(u)||(t[s]={[r]:u},n=!0)}return n?t:void 0},S={theme:(r,o)=>{if(r)return o.themeModifier?(0,e.getMediaTheme)(r,`@${o.themeModifier}`):(0,e.getMediaTheme)(r)},color:(r,o)=>{const t=d(o);if(r)return i("color",(0,e.getMediaColor)(r,t))},background:(r,o)=>{const t=d(o);if(r)return(0,f.isString)(r)&&r.includes("gradient")&&r.includes("(")?{background:(0,e.resolveColorsInGradient)(r,t)}:i("background",(0,e.getMediaColor)(r,t))},backgroundColor:(r,o)=>{const t=d(o);if(r)return i("backgroundColor",(0,e.getMediaColor)(r,t))},backgroundImage:(r,o,t,n)=>{const s=d(o);if(!r)return;const u=n.assets&&n.assets[r];if(u&&u.content)r=u.content.src;else{const b=n.files&&n.files[r];b&&b.content&&(r=b.content.src)}return i("backgroundImage",(0,e.transformBackgroundImage)(r,s))},textStroke:r=>({WebkitTextStroke:(0,e.transformTextStroke)(r)}),outline:r=>({outline:(0,e.transformBorder)(r)}),outlineOffset:(r,o)=>(0,e.transformSizeRatio)("outlineOffset",r,o),border:r=>({border:(0,e.transformBorder)(r)}),borderColor:(r,o)=>{const t=d(o);if(r)return i("borderColor",(0,e.getMediaColor)(r,t))},borderTopColor:(r,o)=>{const t=d(o);if(r)return i("borderTopColor",(0,e.getMediaColor)(r,t))},borderBottomColor:(r,o)=>{const t=d(o);if(r)return i("borderBottomColor",(0,e.getMediaColor)(r,t))},borderLeftColor:(r,o)=>{const t=d(o);if(r)return i("borderLeftColor",(0,e.getMediaColor)(r,t))},borderRightColor:(r,o)=>{const t=d(o);if(r)return i("borderRightColor",(0,e.getMediaColor)(r,t))},borderLeft:r=>({borderLeft:(0,e.transformBorder)(r)}),borderTop:r=>({borderTop:(0,e.transformBorder)(r)}),borderRight:r=>({borderRight:(0,e.transformBorder)(r)}),borderBottom:r=>({borderBottom:(0,e.transformBorder)(r)}),shadow:(r,o)=>{const t=d(o);if(r)return i("boxShadow",(0,e.transformShadow)(r,t))},boxShadow:(r,o)=>{if(!(0,f.isString)(r))return;const[t,n]=r.split("!importan"),s=d(o),u=n?" !important":"",b=(0,e.transformBoxShadow)(t.trim(),s);return(0,f.isString)(b)?{boxShadow:b+u}:i("boxShadow",b)},textShadow:(r,{context:o})=>i("textShadow",(0,e.transformBoxShadow)(r,o.designSystem.globalTheme)),columnRule:r=>({columnRule:(0,e.transformBorder)(r)})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getMediaTheme as
|
|
1
|
+
import{getMediaTheme as l,getMediaColor as d,transformTextStroke as a,transformShadow as h,transformBoxShadow as c,transformBorder as b,transformBackgroundImage as T,resolveColorsInGradient as S,transformSizeRatio as C}from"@symbo.ls/scratch";import{isObject as g,isString as m}from"@symbo.ls/utils";const s=({context:r,state:o})=>{const e=o?.root?.globalTheme||r.designSystem?.globalTheme;return e==="auto"?null:e},t=(r,o)=>{if(o==null||o==="")return;if(!g(o))return{[r]:o};const e={};let i=!1;for(const f in o){const n=o[f];n==null||n===""||g(n)||(e[f]={[r]:n},i=!0)}return i?e:void 0},x={theme:(r,o)=>{if(r)return o.themeModifier?l(r,`@${o.themeModifier}`):l(r)},color:(r,o)=>{const e=s(o);if(r)return t("color",d(r,e))},background:(r,o)=>{const e=s(o);if(r)return m(r)&&r.includes("gradient")&&r.includes("(")?{background:S(r,e)}:t("background",d(r,e))},backgroundColor:(r,o)=>{const e=s(o);if(r)return t("backgroundColor",d(r,e))},backgroundImage:(r,o,e,i)=>{const f=s(o);if(!r)return;const n=i.assets&&i.assets[r];if(n&&n.content)r=n.content.src;else{const u=i.files&&i.files[r];u&&u.content&&(r=u.content.src)}return t("backgroundImage",T(r,f))},textStroke:r=>({WebkitTextStroke:a(r)}),outline:r=>({outline:b(r)}),outlineOffset:(r,o)=>C("outlineOffset",r,o),border:r=>({border:b(r)}),borderColor:(r,o)=>{const e=s(o);if(r)return t("borderColor",d(r,e))},borderTopColor:(r,o)=>{const e=s(o);if(r)return t("borderTopColor",d(r,e))},borderBottomColor:(r,o)=>{const e=s(o);if(r)return t("borderBottomColor",d(r,e))},borderLeftColor:(r,o)=>{const e=s(o);if(r)return t("borderLeftColor",d(r,e))},borderRightColor:(r,o)=>{const e=s(o);if(r)return t("borderRightColor",d(r,e))},borderLeft:r=>({borderLeft:b(r)}),borderTop:r=>({borderTop:b(r)}),borderRight:r=>({borderRight:b(r)}),borderBottom:r=>({borderBottom:b(r)}),shadow:(r,o)=>{const e=s(o);if(r)return t("boxShadow",h(r,e))},boxShadow:(r,o)=>{if(!m(r))return;const[e,i]=r.split("!importan"),f=s(o),n=i?" !important":"",u=c(e.trim(),f);return m(u)?{boxShadow:u+n}:t("boxShadow",u)},textShadow:(r,{context:o})=>t("textShadow",c(r,o.designSystem.globalTheme)),columnRule:r=>({columnRule:b(r)})};export{x as THEME_PROPS,s as getSystemGlobalTheme};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "css-in-props",
|
|
3
3
|
"description": "Utilize props as CSS methods",
|
|
4
4
|
"author": "symbo.ls",
|
|
5
|
-
"version": "3.14.
|
|
5
|
+
"version": "3.14.651",
|
|
6
6
|
"repository": "https://github.com/symbo-ls/smbls",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"module": "./dist/esm/index.js",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@symbo.ls/css": "^3.14.612",
|
|
37
|
-
"@symbo.ls/utils": "^3.14.
|
|
38
|
-
"@symbo.ls/scratch": "^3.14.
|
|
37
|
+
"@symbo.ls/utils": "^3.14.651",
|
|
38
|
+
"@symbo.ls/scratch": "^3.14.651"
|
|
39
39
|
},
|
|
40
40
|
"gitHead": "9fc1b79b41cdc725ca6b24aec64920a599634681",
|
|
41
41
|
"browser": "./dist/esm/index.js",
|