Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@beamwind/preset-system

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beamwind/preset-system - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

6

CHANGELOG.md

@@ -6,2 +6,8 @@ # Change Log

## [2.0.3](https://github.com/kenoxa/beamwind/compare/@beamwind/preset-system@2.0.1...@beamwind/preset-system@2.0.3) (2020-12-01)
### Bug Fixes
- color variant creation ([9984a11](https://github.com/kenoxa/beamwind/commit/9984a110f825a1940e5ef2644697ea8ee8ec385a))
## [2.0.2](https://github.com/kenoxa/beamwind/compare/@beamwind/preset-system@2.0.1...@beamwind/preset-system@2.0.2) (2020-12-01)

@@ -8,0 +14,0 @@

6

package.json
{
"name": "@beamwind/preset-system",
"version": "2.0.2",
"version": "2.0.3",
"description": "beamwind design system preset using a semantic naming scheme",

@@ -22,3 +22,3 @@ "keywords": [

"dependencies": {
"@beamwind/colors": "^2.0.1"
"@beamwind/colors": "^2.0.2"
},

@@ -28,3 +28,3 @@ "publishConfig": {

},
"gitHead": "0e2f26cd5bb66c504ac853a8229f8cdcba786f18",
"gitHead": "b1d2f0cf1af2025d2984df82c0c2f56fbc27ae54",
"exports": {

@@ -31,0 +31,0 @@ ".": {

@@ -109,3 +109,3 @@ # @beamwind/preset-system

> provide accessible contrast to their base color - `on-primary` or `on-primary-active`
> provide [accessible contrast](https://contrast-ratio.com/) to their base color - `on-primary` or `on-primary-active`

@@ -112,0 +112,0 @@ Whenever elements, such as text or icons, appear in front of surfaces, those elements should use colors designed to be clear and legible against the colors behind them. When a color appears "_on_" top of a primary color, it’s called an "_on primary color_". They are labelled using the original color category (such as primary color) with the prefix `on-`.

@@ -1,1 +0,1 @@

var presetSystem=(()=>{var z=Object.defineProperty,O=Math.pow,a=Object.assign,V=n=>z(n,"__esModule",{value:!0}),j=(n,e)=>{V(n);for(var t in e)z(n,t,{get:e[t],enumerable:!0})},P={};j(P,{default:()=>N});var A=(n,e,t)=>Math.min(Math.max(n,e),t),L=(n,e)=>Math.round(parseInt(n,16)*e),u=n=>{if(n[0]==="#"){let e=(n.length-1)/3,t=[17,1,.062272][e-1];return{r:L(n.substr(1,e),t),g:L(n.substr(1+e,e),t),b:L(n.substr(1+2*e,e),t)}}throw new Error(`Can not parse color ${n}`)},$=n=>("0"+A(n,0,255).toString(16)).slice(-2),T=n=>`#${$(n.r)}${$(n.g)}${$(n.b)}`,C=n=>{let e=n.r/255,t=n.g/255,r=n.b/255,s=Math.max(e,t,r),i=Math.min(e,t,r),o=(s+i)/2;if(s===i)return{h:0,s:0,l:o};let m,l=s-i,c=o>.5?l/(2-s-i):l/(s+i);switch(s){case e:m=(t-r)/l+(t<r?6:0);break;case t:m=(r-e)/l+2;break;default:m=(e-t)/l+4;break}return{h:m*60,s:c,l:o}},v=n=>Math.round(n*255),d=n=>{if(n.s===0)return{r:n.l,g:n.l,b:n.l};let e=(n.h%360+360)%360/60,t=(1-Math.abs(2*n.l-1))*n.s,r=t*(1-Math.abs(e%2-1)),s=0,i=0,o=0;e>=0&&e<1?(s=t,i=r):e>=1&&e<2?(s=r,i=t):e>=2&&e<3?(i=t,o=r):e>=3&&e<4?(i=r,o=t):e>=4&&e<5?(s=r,o=t):e>=5&&e<6&&(s=t,o=r);let m=n.l-t/2;return{r:v(s+m),g:v(i+m),b:v(o+m)}},H=n=>{let e=n/255;return e<=.03928?e/12.92:O((e+.055)/1.055,2.4)},M=n=>Number((.2126*H(n.r)+.7152*H(n.g)+.0722*H(n.b)).toFixed(3)),F=n=>{let e=u(n),t=(e.r*299+e.g*587+e.b*114)/1e3;return t>=128},B=(n,e,t,r)=>n*(e>.6?t:r),I=n=>{let e=u(n),t=C(e),r=M(e);return T(d({h:t.h,s:B(t.s,r,.8,.45),l:.95-B(t.l,r,.03,.06)}))},U=4.52,b=(n,e)=>{let t=M(d(n))+.05,r=M(d(e))+.05;return t<r?r/t:t/r},y=(n,e,t,r)=>{let s=C(u(n)),i=C(u(e)),o=r?.02:s.l,m=r?s.l:.98,l=a(a({},s),{l:m}),c=s;if(b(s,i)>=t)return n;if(b(l,i)<t){let S=b({h:0,s:0,l:0},i)>b({h:0,s:1,l:1},i)?"#000":"#fff";return n===S?S:y(S,e,t,r)}let R,w,g,p=s;do R=c,w=l,g=(o+m)/2,p=a(a({},p),{l:g}),b(p,i)<t?r?(m=g,l=p):(o=g,c=p):r?(o=g,c=p):(m=g,l=p);while(c.l!==R.l||l.l!==w.l);return T(d(c))},x=n=>{let e=F(n);return y(e?"#1A202C":I(n),n,U,e)},W=(n,e)=>{let t=C(u(n));return T(d(a(a({},t),{l:A(t.l-e,0,1)})))},f=(n,e,t)=>W(n,F(n)?e:t||e*-1),E=(n,e,t=n[e])=>{if(!(t&&t[0]==="#"))return{};let r=n[`${e}-hover`]||f(t,.05),s=n[`${e}-active`]||f(t,.1),i=n[`${e}-selected`]||f(t,.15),o=n[`${e}-disabled`]||f(t,-.05);return{[e]:t,[`on-${e}`]:n[`on-${e}`]||x(t),[`${e}-hover`]:r,[`on-${e}-hover`]:n[`on-${e}-hover`]||x(r),[`${e}-active`]:s,[`on-${e}-active`]:n[`on-${e}-active`]||x(s),[`${e}-disabled`]:o,[`on-${e}-disabled`]:n[`on-${e}-disabled`]||x(o),[`${e}-selected`]:i,[`on-${e}-selected`]:n[`on-${e}-selected`]||x(i)}},D=n=>n.indexOf("-")===-1,q=n=>Object.keys(n).filter(D).reduce((e,t)=>a(a({},e),E(e,t)),n),G=({colors:n}={})=>e=>({extend:{colors:q(a(a(a({},e("colors")),{surface:"#fafafa","on-surface":"#222",primary:"#0d3880",secondary:"#e60278",caution:"#ffc600",critical:"#d0011b",info:"#1e468c",neutral:"#596581",positive:"#138a08",promote:"#9556b7"}),n)),spacing:{none:"0px",xs:"0.125rem",sm:"0.25rem",md:"0.5rem",lg:"0.875rem",xl:"1.25rem","2xl":"2rem","3xl":"3rem","4xl":"5rem"},durations:{swift:"75ms",fast:"100ms",medium:"200ms",moderate:"300ms",slow:"500ms",supine:"700ms",glacial:"1000ms",inert:"1500ms"},animation:{spin:["1s linear infinite"],ping:["1s cubic-bezier(0,0,0.2,1) infinite"],pulse:["2s cubic-bezier(0.4,0,0.6,1) infinite"],bounce:["1s infinite"]},borderRadius:{sm:"0.125rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem"},borderWidth:{DEFAULT:"1px",none:"0px",xs:"1px",sm:"2px",md:"4px",lg:"8px"},boxShadow:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",DEFAULT:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",inner:"inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)"},fontFamily:{sans:'ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"',serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif',mono:'ui-monospace,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSize:{md:t=>t("fontSize","base")},height:{"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%"},inset:{"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%"},keyframes:{spin:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},ping:{"0%":{transform:"scale(1)",opacity:"1"},"75%,100%":{transform:"scale(2)",opacity:"0"}},pulse:{"0%,100%":{opacity:"1"},"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)","animation-timing-function":"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none","animation-timing-function":"cubic-bezier(0,0,0.2,1)"}}},lineHeight:{xs:"1rem",sm:"1.25rem",base:"1.5rem",md:t=>t("lineHeight","base"),lg:"1.75rem",xl:"1.75rem","2xl":"2rem","3xl":"2.25rem","4xl":"2.5rem"},maxWidth:{xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",prose:"65ch"},opacity:{},order:{},outline:{current:["2px dotted currentColor","2px"]},ringColor:{DEFAULT:"currentColor"},ringOffsetWidth:{none:"0px",xs:"1px",sm:"2px",md:"4px",lg:"8px"},ringWidth:{none:"0px",xs:"1px",sm:"2px",md:"4px",lg:"8px"},rotate:{none:"0deg",xs:"1deg",sm:"2deg",md:"3deg",lg:"6deg",xl:"12deg","2xl":"45deg",turn:"90deg",reverse:"180deg"},scale:{zip:"0","3xs":".5","2xs":".75",xs:".9",sm:".95",none:"1",lg:"1.05",xl:"1.1","2xl":"1.25","3xl":"1.5"},skew:{none:"0deg",xs:"1deg",sm:"2deg",md:"3deg",lg:"6deg",xl:"12deg"},strokeWidth:{none:"0",sm:"1",md:"2"},transitionTimingFunction:{linear:"linear",in:"cubic-bezier(0.4, 0, 1, 1)",out:"cubic-bezier(0, 0, 0.2, 1)","in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},translate:{"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%"},width:{"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%"},zIndex:{none:"0",hover:"1",focus:"2",active:"3"}}}),N=n=>({theme:G(n)});return P;})();
var presetSystem=(()=>{var O=Object.defineProperty,A=Math.pow,a=Object.assign,I=e=>O(e,"__esModule",{value:!0}),N=(e,n)=>{I(e);for(var t in n)O(e,t,{get:n[t],enumerable:!0})},q={};N(q,{default:()=>y});var B=(e,n,t)=>Math.min(Math.max(e,n),t),g=(e,n=255)=>Math.round(e*n),H=(e,n)=>g(parseInt(e,16),n),v=e=>("0"+B(e,0,255).toString(16)).slice(-2),R=e=>`#${v(e.r)}${v(e.g)}${v(e.b)}`,d=e=>{if(e[0]==="#"){let n=(e.length-1)/3,t=[17,1,.062272][n-1];return{r:H(e.substr(1,n),t),g:H(e.substr(1+n,n),t),b:H(e.substr(1+2*n,n),t)}}throw new Error(`Can not parse color ${e}`)},L=e=>{let n=e.r/255,t=e.g/255,r=e.b/255,s=Math.max(n,t,r),i=Math.min(n,t,r),o=(s+i)/2;if(s===i)return{h:0,s:0,l:o};let m,l=s-i,p=o>.5?l/(2-s-i):l/(s+i);switch(s){case n:m=(t-r)/l+(t<r?6:0);break;case t:m=(r-n)/l+2;break;default:m=(n-t)/l+4;break}return{h:m*60,s:p,l:o}},b=e=>{if(e.s===0)return{r:g(e.l),g:g(e.l),b:g(e.l)};let n=(e.h%360+360)%360/60,t=(1-Math.abs(2*e.l-1))*e.s,r=t*(1-Math.abs(n%2-1)),s=0,i=0,o=0;n>=0&&n<1?(s=t,i=r):n>=1&&n<2?(s=r,i=t):n>=2&&n<3?(i=t,o=r):n>=3&&n<4?(i=r,o=t):n>=4&&n<5?(s=r,o=t):n>=5&&n<6&&(s=t,o=r);let m=e.l-t/2;return{r:g(s+m),g:g(i+m),b:g(o+m)}},w=e=>(e/=255,e<=.03928?e/12.92:A((e+.055)/1.055,2.4)),C=e=>w(e.r)*.2126+w(e.g)*.7152+w(e.b)*.0722,F=e=>C(d(e))>=.5,U=4.52,f=(e,n)=>{let t=C(b(e))+.05,r=C(b(n))+.05;return t<r?r/t:t/r},T=(e,n,t,r)=>e*(n>.6?t:r),V=e=>n=>{let t=d(n);return R(b(e(L(t),C(t))))},W=V((e,n)=>({h:e.h,s:T(e.s,n,.8,.45),l:.95-T(e.l,n,.03,.06)})),D=V((e,n)=>({h:e.h,s:T(e.s,n,.45,.8),l:.05+T(e.l,n,.06,.03)})),E=(e,n,t,r)=>{let s=L(d(e)),i=L(d(n)),o=r?.02:s.l,m=r?s.l:.98,l=a(a({},s),{l:m}),p=s;if(f(s,i)>=t)return e;if(f(l,i)<t){let $=f({h:0,s:0,l:0},i)>f({h:0,s:1,l:1},i)?"#000":"#fff";return e===$?$:E($,n,t,r)}let M,z,x,c=s;do M=p,z=l,x=(o+m)/2,c=a(a({},c),{l:x}),f(c,i)<t?r?(m=x,l=c):(o=x,p=c):r?(o=x,p=c):(m=x,l=c);while(p.l!==M.l||l.l!==z.l);return R(b(p))},u=(e,n=D(e),t=W(e))=>{let r=F(e);return E(r?n:t,e,U,r)},P=(e,n)=>{let t=L(d(e));return R(b(a(a({},t),{l:B(t.l-n,0,1)})))},h=(e,n,t)=>P(e,F(e)?n:t||n*-1),G=(e,n,t=e[n])=>{if(!(t&&t[0]==="#"))return{};let r=e[`${n}-hover`]||h(t,.05),s=e[`${n}-active`]||h(t,.1),i=e[`${n}-selected`]||h(t,.15),o=e[`${n}-disabled`]||h(t,-.05);return{[n]:t,[`on-${n}`]:e[`on-${n}`]||u(t),[`${n}-hover`]:r,[`on-${n}-hover`]:e[`on-${n}-hover`]||u(r),[`${n}-active`]:s,[`on-${n}-active`]:e[`on-${n}-active`]||u(s),[`${n}-disabled`]:o,[`on-${n}-disabled`]:e[`on-${n}-disabled`]||u(o),[`${n}-selected`]:i,[`on-${n}-selected`]:e[`on-${n}-selected`]||u(i)}},Y=e=>e.indexOf("-")===-1,_=e=>Object.keys(e).filter(Y).reduce((n,t)=>a(a({},n),G(n,t)),e),j=({colors:e}={})=>n=>({extend:{colors:_(a(a(a({},n("colors")),{surface:"#fafafa","on-surface":"#222",primary:"#0d3880",secondary:"#e60278",caution:"#ffc600",critical:"#d0011b",info:"#1e468c",neutral:"#596581",positive:"#138a08",promote:"#9556b7"}),e)),spacing:{none:"0px",xs:"0.125rem",sm:"0.25rem",md:"0.5rem",lg:"0.875rem",xl:"1.25rem","2xl":"2rem","3xl":"3rem","4xl":"5rem"},durations:{swift:"75ms",fast:"100ms",medium:"200ms",moderate:"300ms",slow:"500ms",supine:"700ms",glacial:"1000ms",inert:"1500ms"},animation:{spin:["1s linear infinite"],ping:["1s cubic-bezier(0,0,0.2,1) infinite"],pulse:["2s cubic-bezier(0.4,0,0.6,1) infinite"],bounce:["1s infinite"]},borderRadius:{sm:"0.125rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem"},borderWidth:{DEFAULT:"1px",none:"0px",xs:"1px",sm:"2px",md:"4px",lg:"8px"},boxShadow:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",DEFAULT:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",inner:"inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)"},fontFamily:{sans:'ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"',serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif',mono:'ui-monospace,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSize:{md:t=>t("fontSize","base")},height:{"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%"},inset:{"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%"},keyframes:{spin:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},ping:{"0%":{transform:"scale(1)",opacity:"1"},"75%,100%":{transform:"scale(2)",opacity:"0"}},pulse:{"0%,100%":{opacity:"1"},"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)","animation-timing-function":"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none","animation-timing-function":"cubic-bezier(0,0,0.2,1)"}}},lineHeight:{xs:"1rem",sm:"1.25rem",base:"1.5rem",md:t=>t("lineHeight","base"),lg:"1.75rem",xl:"1.75rem","2xl":"2rem","3xl":"2.25rem","4xl":"2.5rem"},maxWidth:{xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",prose:"65ch"},opacity:{},order:{},outline:{current:["2px dotted currentColor","2px"]},ringColor:{DEFAULT:"currentColor"},ringOffsetWidth:{none:"0px",xs:"1px",sm:"2px",md:"4px",lg:"8px"},ringWidth:{none:"0px",xs:"1px",sm:"2px",md:"4px",lg:"8px"},rotate:{none:"0deg",xs:"1deg",sm:"2deg",md:"3deg",lg:"6deg",xl:"12deg","2xl":"45deg",turn:"90deg",reverse:"180deg"},scale:{zip:"0","3xs":".5","2xs":".75",xs:".9",sm:".95",none:"1",lg:"1.05",xl:"1.1","2xl":"1.25","3xl":"1.5"},skew:{none:"0deg",xs:"1deg",sm:"2deg",md:"3deg",lg:"6deg",xl:"12deg"},strokeWidth:{none:"0",sm:"1",md:"2"},transitionTimingFunction:{linear:"linear",in:"cubic-bezier(0.4, 0, 1, 1)",out:"cubic-bezier(0, 0, 0.2, 1)","in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},translate:{"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%"},width:{"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%"},zIndex:{none:"0",hover:"1",focus:"2",active:"3"}}}),y=e=>({theme:j(e)});return q;})();

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc