css-in-props 3.14.668 → 3.14.747

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,5 +1,21 @@
1
1
  # css-in-props
2
2
 
3
+ ## 3.14.747
4
+
5
+ ### Patch Changes
6
+
7
+ - Auto-generated cross-repo patch release.
8
+
9
+ ## 3.14.707
10
+
11
+ ### Patch Changes
12
+
13
+ - Auto-generated cross-repo patch release.
14
+ - Updated dependencies
15
+ - @symbo.ls/css@3.14.707
16
+ - @symbo.ls/scratch@3.14.707
17
+ - @symbo.ls/utils@3.14.707
18
+
3
19
  ## 3.14.668
4
20
 
5
21
  ### Patch Changes
@@ -0,0 +1 @@
1
+ "use strict";var u=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var b=(s,t)=>{for(var n in t)u(s,n,{get:t[n],enumerable:!0})},k=(s,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of v(t))!g.call(s,e)&&e!==n&&u(s,e,{get:()=>t[e],enumerable:!(o=m(t,e))||o.enumerable});return s};var y=s=>k(u({},"__esModule",{value:!0}),s);var x={};b(x,{warnUnresolvedPassthroughToken:()=>j});module.exports=y(x);var l=require("@symbo.ls/utils"),w=require("@symbo.ls/scratch");const S=/^-?[A-Z][0-9]?$/,_=/^[a-z][0-9]?$/,p=/var\(\s*(--[A-Za-z0-9-]+)/g,E=s=>{const t=new Set,n=new Set;if(!s||typeof s!="object")return{knownLetters:t,knownVars:n};for(const o in s){const e=s[o];if(!(!e||typeof e!="object")){if(e.sequence&&typeof e.sequence=="object")for(const r in e.sequence)t.add(r);if(e.vars&&typeof e.vars=="object")for(const r in e.vars)n.add(r)}}return{knownLetters:t,knownVars:n}},R=(s,t)=>{if(!t.size)return[];const n=s.split(/[(),\s]+/).filter(Boolean),o=new Set;for(const e of n){if(!S.test(e))continue;const r=e.charCodeAt(0)===45?e.slice(1):e;t.has(r)&&o.add(e)}return[...o]},A=(s,t)=>{if(!t.size)return[];const n=[];p.lastIndex=0;let o;for(;o=p.exec(s);){const e=o[1];if(t.has(e))continue;const r=e.lastIndexOf("-");if(r===-1)continue;const a=e.slice(r+1);if(!_.test(a))continue;const c=e.slice(0,r+1)+a.toUpperCase();c!==e&&t.has(c)&&n.push({varName:e,corrected:c})}return n},h=new Set,j=(s,t,n)=>{if(!(0,l.isLoudDevRuntime)()||!(0,l.isString)(t)||!t)return;let o;try{o=(0,w.getActiveConfig)()}catch{return}const{knownLetters:e,knownVars:r}=E(o);if(!e.size&&!r.size)return;const a=R(t,e),c=A(t,r);if(!a.length&&!c.length)return;const f=n?.__ref?.path?n.__ref.path.join("."):n?.key||"?";for(const i of a){const d=`${f}::${s}::bare::${i}::${t}`;h.has(d)||(h.add(d),console.warn(`[smbls/css-in-props] "${s}" on <${f}> looks like it contains an un-wrapped design-system token ("${i}") \u2014 "${s}" has no registered resolver, so its value is forwarded to the browser untouched. A bare letter token there is invalid CSS, so the browser drops the ENTIRE "${s}" declaration (not just this argument). Wrap it in var(--<family>-${i.replace("-","")}) (or calc(-1 * var(--<family>-${i.replace("-","")})) for a negative). Value: "${t}"`))}for(const{varName:i,corrected:d}of c){const $=`${f}::${s}::case::${i}::${t}`;h.has($)||(h.add($),console.warn(`[smbls/css-in-props] "${s}" on <${f}> references ${i}, which the active design system never emits. CSS custom-property names are case-sensitive \u2014 the real variable is ${d}, so this reference silently never resolves. Value: "${t}"`))}};
@@ -1 +1 @@
1
- "use strict";var P=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var v=(e,s)=>{for(var i in s)P(e,i,{get:s[i],enumerable:!0})},O=(e,s,i,f)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of A(s))!_.call(e,o)&&o!==i&&P(e,o,{get:()=>s[o],enumerable:!(f=j(s,o))||f.enumerable});return e};var T=e=>O(P({},"__esModule",{value:!0}),e);var I={};v(I,{exetuteClassPerComponent:()=>E,useCssInProps:()=>R,usePropsAsCSS:()=>g,useSelectorsAsCSS:()=>k});module.exports=T(I);var r=require("@symbo.ls/utils"),y=require("@symbo.ls/scratch"),d=require("../props/index.js"),x=require("../props/defaults.js"),C=require("./transformers.js");const b=(0,r.isProduction)(),g=(e,s,i)=>{const f=s?.context?.designSystem;f&&(0,y.pushConfig)(f);try{let o={};const l={},n=(t,p)=>{if(i.unpack){o={...o,...p};return}o[t]=p};for(const t in e){const p=e[t];if(t==="class"&&s.call("isString",e.class)){const c=p.split(" ");if(c.length){const a=s.context.designSystem.class,u=c.reduce((S,h)=>(0,r.merge)(S,a[h]),{});o.designSystemClass=u}}else if(t==="true"){const c=(0,r.exec)(p,s);(0,r.merge)(o,(0,C.applyTrueProps)(c,s))}else if(s.classlist[t]){const c=s.classlist[t],a=(0,r.isFunction)(c)?c(s,s.state,s.context):c;a&&n(t,a),!b&&(0,r.isObject)(o[t])&&(o[t].label=t)}else if(d.CSS_PROPS_REGISTRY[t]){let c=(0,r.exec)(p,s);(0,r.isArray)(c)&&(c=c.reduce((u,S)=>(0,r.merge)(u,S),{}));let a=d.CSS_PROPS_REGISTRY[t](c,s,s.state,s.context);(0,r.isArray)(a)&&(a=a.reduce((u,S)=>(0,r.merge)(u,S),{})),a&&n(t,a),!b&&(0,r.isObject)(o[t])&&(o[t].label=t)}else if(x.DEFAULT_CSS_PROPERTIES_LIST.has(t)){let c=(0,r.exec)(p,s);typeof c=="string"&&c.charCodeAt(0)===45&&c.charCodeAt(1)===45&&(c=`var(${c})`),n(t,{[t]:c}),!b&&(0,r.isObject)(o[t])&&(o[t].label=t)}else l[t]=p}return[o,l]}finally{f&&(0,y.popConfig)()}},k=(e,s)=>{const i={};for(const f in e){const o=C.transformersByPrefix[f.slice(0,1)];if(o){const l=o(f,e[f],s);if(l)for(const n in l)Object.prototype.hasOwnProperty.call(l,n)&&(i[n]&&typeof i[n]=="object"&&typeof l[n]=="object"?(0,r.overwriteDeep)(i[n],l[n]):i[n]=l[n])}}return i},R=(e,s,i={unpack:!0})=>{const[f,o]=g(e,s,i),l=k(o,s);let n=!1;for(const t in l){n=!0;break}if(n){if(i.unpack)return(0,r.overwrite)(f,l);f._selectors=l}return f},E=(e,s)=>{const i={};if(e.class)for(const f in e.class)i[f]=e.class[f](s);return i};
1
+ "use strict";var d=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var _=(e,s)=>{for(var c in s)d(e,c,{get:s[c],enumerable:!0})},O=(e,s,c,f)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of A(s))!T.call(e,o)&&o!==c&&d(e,o,{get:()=>s[o],enumerable:!(f=v(s,o))||f.enumerable});return e};var R=e=>O(d({},"__esModule",{value:!0}),e);var I={};_(I,{exetuteClassPerComponent:()=>E,useCssInProps:()=>w,usePropsAsCSS:()=>h,useSelectorsAsCSS:()=>k});module.exports=R(I);var r=require("@symbo.ls/utils"),P=require("@symbo.ls/scratch"),b=require("../props/index.js"),g=require("../props/defaults.js"),x=require("../props/passthroughTokenWarn.js"),C=require("./transformers.js");const y=(0,r.isProduction)(),h=(e,s,c)=>{const f=s?.context?.designSystem;f&&(0,P.pushConfig)(f);try{let o={};const l={},n=(t,p)=>{if(c.unpack){o={...o,...p};return}o[t]=p};for(const t in e){const p=e[t];if(t==="class"&&s.call("isString",e.class)){const i=p.split(" ");if(i.length){const a=s.context.designSystem.class,u=i.reduce((S,j)=>(0,r.merge)(S,a[j]),{});o.designSystemClass=u}}else if(t==="true"){const i=(0,r.exec)(p,s);(0,r.merge)(o,(0,C.applyTrueProps)(i,s))}else if(s.classlist[t]){const i=s.classlist[t],a=(0,r.isFunction)(i)?i(s,s.state,s.context):i;a&&n(t,a),!y&&(0,r.isObject)(o[t])&&(o[t].label=t)}else if(b.CSS_PROPS_REGISTRY[t]){let i=(0,r.exec)(p,s);(0,r.isArray)(i)&&(i=i.reduce((u,S)=>(0,r.merge)(u,S),{}));let a=b.CSS_PROPS_REGISTRY[t](i,s,s.state,s.context);(0,r.isArray)(a)&&(a=a.reduce((u,S)=>(0,r.merge)(u,S),{})),a&&n(t,a),!y&&(0,r.isObject)(o[t])&&(o[t].label=t)}else if(g.DEFAULT_CSS_PROPERTIES_LIST.has(t)){let i=(0,r.exec)(p,s);typeof i=="string"&&i.charCodeAt(0)===45&&i.charCodeAt(1)===45&&(i=`var(${i})`),y||(0,x.warnUnresolvedPassthroughToken)(t,i,s),n(t,{[t]:i}),!y&&(0,r.isObject)(o[t])&&(o[t].label=t)}else l[t]=p}return[o,l]}finally{f&&(0,P.popConfig)()}},k=(e,s)=>{const c={};for(const f in e){const o=C.transformersByPrefix[f.slice(0,1)];if(o){const l=o(f,e[f],s);if(l)for(const n in l)Object.prototype.hasOwnProperty.call(l,n)&&(c[n]&&typeof c[n]=="object"&&typeof l[n]=="object"?(0,r.overwriteDeep)(c[n],l[n]):c[n]=l[n])}}return c},w=(e,s,c={unpack:!0})=>{const[f,o]=h(e,s,c),l=k(o,s);let n=!1;for(const t in l){n=!0;break}if(n){if(c.unpack)return(0,r.overwrite)(f,l);f._selectors=l}return f},E=(e,s)=>{const c={};if(e.class)for(const f in e.class)c[f]=e.class[f](s);return c};
@@ -0,0 +1 @@
1
+ import{isString as $,isLoudDevRuntime as p}from"@symbo.ls/utils";import{getActiveConfig as w}from"@symbo.ls/scratch";const m=/^-?[A-Z][0-9]?$/,v=/^[a-z][0-9]?$/,u=/var\(\s*(--[A-Za-z0-9-]+)/g,g=s=>{const t=new Set,n=new Set;if(!s||typeof s!="object")return{knownLetters:t,knownVars:n};for(const r in s){const e=s[r];if(!(!e||typeof e!="object")){if(e.sequence&&typeof e.sequence=="object")for(const o in e.sequence)t.add(o);if(e.vars&&typeof e.vars=="object")for(const o in e.vars)n.add(o)}}return{knownLetters:t,knownVars:n}},b=(s,t)=>{if(!t.size)return[];const n=s.split(/[(),\s]+/).filter(Boolean),r=new Set;for(const e of n){if(!m.test(e))continue;const o=e.charCodeAt(0)===45?e.slice(1):e;t.has(o)&&r.add(e)}return[...r]},k=(s,t)=>{if(!t.size)return[];const n=[];u.lastIndex=0;let r;for(;r=u.exec(s);){const e=r[1];if(t.has(e))continue;const o=e.lastIndexOf("-");if(o===-1)continue;const a=e.slice(o+1);if(!v.test(a))continue;const c=e.slice(0,o+1)+a.toUpperCase();c!==e&&t.has(c)&&n.push({varName:e,corrected:c})}return n},h=new Set,_=(s,t,n)=>{if(!p()||!$(t)||!t)return;let r;try{r=w()}catch{return}const{knownLetters:e,knownVars:o}=g(r);if(!e.size&&!o.size)return;const a=b(t,e),c=k(t,o);if(!a.length&&!c.length)return;const f=n?.__ref?.path?n.__ref.path.join("."):n?.key||"?";for(const i of a){const d=`${f}::${s}::bare::${i}::${t}`;h.has(d)||(h.add(d),console.warn(`[smbls/css-in-props] "${s}" on <${f}> looks like it contains an un-wrapped design-system token ("${i}") \u2014 "${s}" has no registered resolver, so its value is forwarded to the browser untouched. A bare letter token there is invalid CSS, so the browser drops the ENTIRE "${s}" declaration (not just this argument). Wrap it in var(--<family>-${i.replace("-","")}) (or calc(-1 * var(--<family>-${i.replace("-","")})) for a negative). Value: "${t}"`))}for(const{varName:i,corrected:d}of c){const l=`${f}::${s}::case::${i}::${t}`;h.has(l)||(h.add(l),console.warn(`[smbls/css-in-props] "${s}" on <${f}> references ${i}, which the active design system never emits. CSS custom-property names are case-sensitive \u2014 the real variable is ${d}, so this reference silently never resolves. Value: "${t}"`))}};export{_ as warnUnresolvedPassthroughToken};
@@ -1 +1 @@
1
- import{exec as y,isArray as b,isFunction as g,isObject as C,isProduction as k,merge as S,overwrite as h,overwriteDeep as j}from"@symbo.ls/utils";import{pushConfig as A,popConfig as _}from"@symbo.ls/scratch";import{CSS_PROPS_REGISTRY as d}from"../props/index.js";import{DEFAULT_CSS_PROPERTIES_LIST as v}from"../props/defaults.js";import{applyTrueProps as O,transformersByPrefix as T}from"./transformers.js";const P=k(),R=(n,t,i)=>{const c=t?.context?.designSystem;c&&A(c);try{let o={};const f={},e=(s,a)=>{if(i.unpack){o={...o,...a};return}o[s]=a};for(const s in n){const a=n[s];if(s==="class"&&t.call("isString",n.class)){const r=a.split(" ");if(r.length){const l=t.context.designSystem.class,p=r.reduce((u,x)=>S(u,l[x]),{});o.designSystemClass=p}}else if(s==="true"){const r=y(a,t);S(o,O(r,t))}else if(t.classlist[s]){const r=t.classlist[s],l=g(r)?r(t,t.state,t.context):r;l&&e(s,l),!P&&C(o[s])&&(o[s].label=s)}else if(d[s]){let r=y(a,t);b(r)&&(r=r.reduce((p,u)=>S(p,u),{}));let l=d[s](r,t,t.state,t.context);b(l)&&(l=l.reduce((p,u)=>S(p,u),{})),l&&e(s,l),!P&&C(o[s])&&(o[s].label=s)}else if(v.has(s)){let r=y(a,t);typeof r=="string"&&r.charCodeAt(0)===45&&r.charCodeAt(1)===45&&(r=`var(${r})`),e(s,{[s]:r}),!P&&C(o[s])&&(o[s].label=s)}else f[s]=a}return[o,f]}finally{c&&_()}},E=(n,t)=>{const i={};for(const c in n){const o=T[c.slice(0,1)];if(o){const f=o(c,n[c],t);if(f)for(const e in f)Object.prototype.hasOwnProperty.call(f,e)&&(i[e]&&typeof i[e]=="object"&&typeof f[e]=="object"?j(i[e],f[e]):i[e]=f[e])}}return i},B=(n,t,i={unpack:!0})=>{const[c,o]=R(n,t,i),f=E(o,t);let e=!1;for(const s in f){e=!0;break}if(e){if(i.unpack)return h(c,f);c._selectors=f}return c},G=(n,t)=>{const i={};if(n.class)for(const c in n.class)i[c]=n.class[c](t);return i};export{G as exetuteClassPerComponent,B as useCssInProps,R as usePropsAsCSS,E as useSelectorsAsCSS};
1
+ import{exec as P,isArray as d,isFunction as x,isObject as C,isProduction as h,merge as S,overwrite as k,overwriteDeep as j}from"@symbo.ls/utils";import{pushConfig as v,popConfig as A}from"@symbo.ls/scratch";import{CSS_PROPS_REGISTRY as b}from"../props/index.js";import{DEFAULT_CSS_PROPERTIES_LIST as T}from"../props/defaults.js";import{warnUnresolvedPassthroughToken as _}from"../props/passthroughTokenWarn.js";import{applyTrueProps as O,transformersByPrefix as R}from"./transformers.js";const y=h(),w=(n,t,c)=>{const e=t?.context?.designSystem;e&&v(e);try{let o={};const f={},i=(s,a)=>{if(c.unpack){o={...o,...a};return}o[s]=a};for(const s in n){const a=n[s];if(s==="class"&&t.call("isString",n.class)){const r=a.split(" ");if(r.length){const l=t.context.designSystem.class,p=r.reduce((u,g)=>S(u,l[g]),{});o.designSystemClass=p}}else if(s==="true"){const r=P(a,t);S(o,O(r,t))}else if(t.classlist[s]){const r=t.classlist[s],l=x(r)?r(t,t.state,t.context):r;l&&i(s,l),!y&&C(o[s])&&(o[s].label=s)}else if(b[s]){let r=P(a,t);d(r)&&(r=r.reduce((p,u)=>S(p,u),{}));let l=b[s](r,t,t.state,t.context);d(l)&&(l=l.reduce((p,u)=>S(p,u),{})),l&&i(s,l),!y&&C(o[s])&&(o[s].label=s)}else if(T.has(s)){let r=P(a,t);typeof r=="string"&&r.charCodeAt(0)===45&&r.charCodeAt(1)===45&&(r=`var(${r})`),y||_(s,r,t),i(s,{[s]:r}),!y&&C(o[s])&&(o[s].label=s)}else f[s]=a}return[o,f]}finally{e&&A()}},E=(n,t)=>{const c={};for(const e in n){const o=R[e.slice(0,1)];if(o){const f=o(e,n[e],t);if(f)for(const i in f)Object.prototype.hasOwnProperty.call(f,i)&&(c[i]&&typeof c[i]=="object"&&typeof f[i]=="object"?j(c[i],f[i]):c[i]=f[i])}}return c},B=(n,t,c={unpack:!0})=>{const[e,o]=w(n,t,c),f=E(o,t);let i=!1;for(const s in f){i=!0;break}if(i){if(c.unpack)return k(e,f);e._selectors=f}return e},G=(n,t)=>{const c={};if(n.class)for(const e in n.class)c[e]=n.class[e](t);return c};export{G as exetuteClassPerComponent,B as useCssInProps,w as usePropsAsCSS,E as useSelectorsAsCSS};
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.668",
5
+ "version": "3.14.747",
6
6
  "repository": "https://github.com/symbo-ls/smbls",
7
7
  "type": "module",
8
8
  "module": "./dist/esm/index.js",
@@ -33,9 +33,9 @@
33
33
  "LICENSE"
34
34
  ],
35
35
  "dependencies": {
36
- "@symbo.ls/css": "^3.14.612",
37
- "@symbo.ls/utils": "^3.14.651",
38
- "@symbo.ls/scratch": "^3.14.651"
36
+ "@symbo.ls/css": "^3.14.707",
37
+ "@symbo.ls/utils": "^3.14.707",
38
+ "@symbo.ls/scratch": "^3.14.707"
39
39
  },
40
40
  "gitHead": "9fc1b79b41cdc725ca6b24aec64920a599634681",
41
41
  "browser": "./dist/esm/index.js",