Socket
Socket
Sign inDemoInstall

jsx-to-styled

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsx-to-styled - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

8

CHANGELOG.md

@@ -7,6 +7,14 @@ ### Changelog

#### [1.1.0](https://github.com/mleralec/jsx-to-styled/compare/1.0.0...1.1.0)
- fix: other props is missing [`362f237`](https://github.com/mleralec/jsx-to-styled/commit/362f237291d9cc5e5074c688426fc51be465f287)
- fix: export theme as interface instead of type [`75a135c`](https://github.com/mleralec/jsx-to-styled/commit/75a135ca232e786ebab01047075d614e73a44ccd)
#### [1.0.0](https://github.com/mleralec/jsx-to-styled/compare/1.0.0-alpha.3...1.0.0)
> 2 July 2022
- feat: other styled props [`e091250`](https://github.com/mleralec/jsx-to-styled/commit/e091250ed39722fe4565b13681e2014642431d3d)
- chore: update documentation [`980cd95`](https://github.com/mleralec/jsx-to-styled/commit/980cd95acf126a2c17f8323f8b3ecbdaca164c2d)
- chore: release v1.0.0 [`006dfb4`](https://github.com/mleralec/jsx-to-styled/commit/006dfb40d7a91c39171648887a5799fe772ab069)

@@ -13,0 +21,0 @@ #### [1.0.0-alpha.3](https://github.com/mleralec/jsx-to-styled/compare/1.0.0-alpha.2...1.0.0-alpha.3)

13

dist/index.es.js

@@ -98,2 +98,12 @@ const background = (props) => {

};
const other = (props) => {
return {
cursor: props.cursor,
float: props.float,
objectFit: props.objectFit,
objectPosition: props.objectPosition,
transform: props.transform,
visibility: props.visibility
};
};
const position = (props) => {

@@ -141,2 +151,3 @@ return {

...layout(props),
...other(props),
...position(props),

@@ -146,2 +157,2 @@ ...space(props),

});
export { background, border, color, system as default, flex, grid, layout, position, space, system, typography };
export { background, border, color, system as default, flex, grid, layout, other, position, space, system, typography };

2

dist/index.umd.js

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

(function(i,d){typeof exports=="object"&&typeof module!="undefined"?d(exports):typeof define=="function"&&define.amd?define(["exports"],d):(i=typeof globalThis!="undefined"?globalThis:i||self,d(i["jsx-to-styled"]={}))})(this,function(i){"use strict";const d=e=>({background:e.background,backgroundImage:e.backgroundImage,backgroundSize:e.backgroundSize,backgroundPosition:e.backgroundPosition,backgroundRepeat:e.backgroundRepeat}),t=(e,n,u)=>{var f;return((f=n==null?void 0:n[u])==null?void 0:f[e])||e},o=e=>({border:e.border,borderWidth:t(e.borderWidth,e.theme,"borderWidths"),borderStyle:e.borderStyle,borderColor:t(e.borderColor,e.theme,"colors"),borderRadius:t(e.borderRadius,e.theme,"radii"),borderTop:e.borderTop,borderTopWidth:t(e.borderTopWidth,e.theme,"borderWidths"),borderTopStyle:e.borderTopStyle,borderTopColor:t(e.borderTopColor,e.theme,"colors"),borderTopLeftRadius:t(e.borderTopLeftRadius,e.theme,"radii"),borderTopRightRadius:t(e.borderTopRightRadius,e.theme,"radii"),borderRight:e.borderRight,borderRightWidth:t(e.borderRightWidth,e.theme,"borderWidths"),borderRightStyle:e.borderRightStyle,borderRightColor:t(e.borderRightColor,e.theme,"colors"),borderBottom:e.borderBottom,borderBottomWidth:t(e.borderBottomWidth,e.theme,"borderWidths"),borderBottomStyle:e.borderBottomStyle,borderBottomColor:t(e.borderBottomColor,e.theme,"colors"),borderBottomLeftRadius:t(e.borderBottomLeftRadius,e.theme,"radii"),borderBottomRightRadius:t(e.borderBottomRightRadius,e.theme,"radii"),borderLeft:e.borderLeft,borderLeftWidth:t(e.borderLeftWidth,e.theme,"borderWidths"),borderLeftStyle:e.borderLeftStyle,borderLeftColor:t(e.borderLeftColor,e.theme,"colors")}),a=e=>({color:t(e.color,e.theme,"colors"),backgroundColor:t(e.backgroundColor,e.theme,"colors"),opacity:e.opacity}),l=e=>({alignItems:e.alignItems,alignContent:e.alignContent,justifyItems:e.justifyItems,justifyContent:e.justifyContent,flexWrap:e.flexWrap,flexDirection:e.flexDirection,flex:e.flex,flexGrow:e.flexGrow,flexShrink:e.flexShrink,flexBasis:e.flexBasis,justifySelf:e.justifySelf,alignSelf:e.alignSelf,order:e.order}),m=e=>({gridGap:t(e.gridGap,e.theme,"spaces"),gridRowGap:t(e.gridRowGap,e.theme,"spaces"),gridColumnGap:t(e.gridColumnGap,e.theme,"spaces"),gridColumn:e.gridColumn,gridRow:e.gridRow,gridArea:e.gridArea,gridAutoFlow:e.gridAutoFlow,gridAutoRows:e.gridAutoRows,gridAutoColumns:e.gridAutoColumns,gridTemplateRows:e.gridTemplateRows,gridTemplateColumns:e.gridTemplateColumns,gridTemplateAreas:e.gridTemplateAreas}),r=e=>({width:t(e.w,e.theme,"sizes"),height:t(e.h,e.theme,"sizes"),minWidht:t(e.minW,e.theme,"sizes"),maxWidth:t(e.maxW,e.theme,"sizes"),minHeight:t(e.minH,e.theme,"sizes"),maxHeight:t(e.maxH,e.theme,"sizes"),display:e.display,verticalAlign:e.verticalAlign,overflow:e.overflow,overflowX:e.overflowX,overflowY:e.overflowY}),g=e=>({position:e.position,zIndex:e.zIndex,top:t(e.top,e.theme,"spaces"),right:t(e.right,e.theme,"spaces"),bottom:t(e.bottom,e.theme,"spaces"),left:t(e.left,e.theme,"spaces")}),h=e=>({margin:t(e.m,e.theme,"spaces"),marginTop:t(e.mt||e.my,e.theme,"spaces"),marginRight:t(e.mr||e.mx,e.theme,"spaces"),marginBottom:t(e.mb||e.mb,e.theme,"spaces"),marginLeft:t(e.ml||e.mx,e.theme,"spaces"),padding:t(e.p,e.theme,"spaces"),paddingTop:t(e.pt||e.py,e.theme,"spaces"),paddingRight:t(e.pr||e.px,e.theme,"spaces"),paddingBottom:t(e.pb||e.pb,e.theme,"spaces"),paddingLeft:t(e.pl||e.px,e.theme,"spaces")}),b=e=>({fontFamily:t(e.fontFamily,e.theme,"fonts"),fontSize:t(e.fontSize,e.theme,"fontSizes"),fontWeight:t(e.fontWeight,e.theme,"fontWeights"),letterSpacing:t(e.letterSpacing,e.theme,"letterSpacings"),textAlign:e.textAlign,fontStyle:e.fontStyle,textDecoration:e.textDecoration}),c=e=>({...d(e),...o(e),...a(e),...l(e),...m(e),...r(e),...g(e),...h(e),...b(e)});i.background=d,i.border=o,i.color=a,i.default=c,i.flex=l,i.grid=m,i.layout=r,i.position=g,i.space=h,i.system=c,i.typography=b,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
(function(i,d){typeof exports=="object"&&typeof module!="undefined"?d(exports):typeof define=="function"&&define.amd?define(["exports"],d):(i=typeof globalThis!="undefined"?globalThis:i||self,d(i["jsx-to-styled"]={}))})(this,function(i){"use strict";const d=e=>({background:e.background,backgroundImage:e.backgroundImage,backgroundSize:e.backgroundSize,backgroundPosition:e.backgroundPosition,backgroundRepeat:e.backgroundRepeat}),t=(e,o,y)=>{var u;return((u=o==null?void 0:o[y])==null?void 0:u[e])||e},n=e=>({border:e.border,borderWidth:t(e.borderWidth,e.theme,"borderWidths"),borderStyle:e.borderStyle,borderColor:t(e.borderColor,e.theme,"colors"),borderRadius:t(e.borderRadius,e.theme,"radii"),borderTop:e.borderTop,borderTopWidth:t(e.borderTopWidth,e.theme,"borderWidths"),borderTopStyle:e.borderTopStyle,borderTopColor:t(e.borderTopColor,e.theme,"colors"),borderTopLeftRadius:t(e.borderTopLeftRadius,e.theme,"radii"),borderTopRightRadius:t(e.borderTopRightRadius,e.theme,"radii"),borderRight:e.borderRight,borderRightWidth:t(e.borderRightWidth,e.theme,"borderWidths"),borderRightStyle:e.borderRightStyle,borderRightColor:t(e.borderRightColor,e.theme,"colors"),borderBottom:e.borderBottom,borderBottomWidth:t(e.borderBottomWidth,e.theme,"borderWidths"),borderBottomStyle:e.borderBottomStyle,borderBottomColor:t(e.borderBottomColor,e.theme,"colors"),borderBottomLeftRadius:t(e.borderBottomLeftRadius,e.theme,"radii"),borderBottomRightRadius:t(e.borderBottomRightRadius,e.theme,"radii"),borderLeft:e.borderLeft,borderLeftWidth:t(e.borderLeftWidth,e.theme,"borderWidths"),borderLeftStyle:e.borderLeftStyle,borderLeftColor:t(e.borderLeftColor,e.theme,"colors")}),a=e=>({color:t(e.color,e.theme,"colors"),backgroundColor:t(e.backgroundColor,e.theme,"colors"),opacity:e.opacity}),l=e=>({alignItems:e.alignItems,alignContent:e.alignContent,justifyItems:e.justifyItems,justifyContent:e.justifyContent,flexWrap:e.flexWrap,flexDirection:e.flexDirection,flex:e.flex,flexGrow:e.flexGrow,flexShrink:e.flexShrink,flexBasis:e.flexBasis,justifySelf:e.justifySelf,alignSelf:e.alignSelf,order:e.order}),m=e=>({gridGap:t(e.gridGap,e.theme,"spaces"),gridRowGap:t(e.gridRowGap,e.theme,"spaces"),gridColumnGap:t(e.gridColumnGap,e.theme,"spaces"),gridColumn:e.gridColumn,gridRow:e.gridRow,gridArea:e.gridArea,gridAutoFlow:e.gridAutoFlow,gridAutoRows:e.gridAutoRows,gridAutoColumns:e.gridAutoColumns,gridTemplateRows:e.gridTemplateRows,gridTemplateColumns:e.gridTemplateColumns,gridTemplateAreas:e.gridTemplateAreas}),r=e=>({width:t(e.w,e.theme,"sizes"),height:t(e.h,e.theme,"sizes"),minWidht:t(e.minW,e.theme,"sizes"),maxWidth:t(e.maxW,e.theme,"sizes"),minHeight:t(e.minH,e.theme,"sizes"),maxHeight:t(e.maxH,e.theme,"sizes"),display:e.display,verticalAlign:e.verticalAlign,overflow:e.overflow,overflowX:e.overflowX,overflowY:e.overflowY}),g=e=>({cursor:e.cursor,float:e.float,objectFit:e.objectFit,objectPosition:e.objectPosition,transform:e.transform,visibility:e.visibility}),h=e=>({position:e.position,zIndex:e.zIndex,top:t(e.top,e.theme,"spaces"),right:t(e.right,e.theme,"spaces"),bottom:t(e.bottom,e.theme,"spaces"),left:t(e.left,e.theme,"spaces")}),b=e=>({margin:t(e.m,e.theme,"spaces"),marginTop:t(e.mt||e.my,e.theme,"spaces"),marginRight:t(e.mr||e.mx,e.theme,"spaces"),marginBottom:t(e.mb||e.mb,e.theme,"spaces"),marginLeft:t(e.ml||e.mx,e.theme,"spaces"),padding:t(e.p,e.theme,"spaces"),paddingTop:t(e.pt||e.py,e.theme,"spaces"),paddingRight:t(e.pr||e.px,e.theme,"spaces"),paddingBottom:t(e.pb||e.pb,e.theme,"spaces"),paddingLeft:t(e.pl||e.px,e.theme,"spaces")}),c=e=>({fontFamily:t(e.fontFamily,e.theme,"fonts"),fontSize:t(e.fontSize,e.theme,"fontSizes"),fontWeight:t(e.fontWeight,e.theme,"fontWeights"),letterSpacing:t(e.letterSpacing,e.theme,"letterSpacings"),textAlign:e.textAlign,fontStyle:e.fontStyle,textDecoration:e.textDecoration}),f=e=>({...d(e),...n(e),...a(e),...l(e),...m(e),...r(e),...g(e),...h(e),...b(e),...c(e)});i.background=d,i.border=n,i.color=a,i.default=f,i.flex=l,i.grid=m,i.layout=r,i.other=g,i.position=h,i.space=b,i.system=f,i.typography=c,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});

@@ -7,4 +7,5 @@ export * from './background';

export * from './layout';
export * from './other';
export * from './position';
export * from './space';
export * from './typography';

@@ -12,2 +12,2 @@ import type * as CSS from 'csstype';

}>;
export declare const layout: (props: OtherProps & ThemeProp) => CSSObject;
export declare const other: (props: OtherProps & ThemeProp) => CSSObject;
import type { CSSObject } from 'styled-components';
import type { BackgroundProps, BorderProps, ColorProps, FlexProps, GridProps, LayoutProps, PositionProps, SpaceProps, TypographyProps } from './config';
import type { BackgroundProps, BorderProps, ColorProps, FlexProps, GridProps, LayoutProps, OtherProps, PositionProps, SpaceProps, TypographyProps } from './config';
import type { ThemeProp } from './types';
export declare type SystemProps = BackgroundProps & BorderProps & ColorProps & FlexProps & GridProps & LayoutProps & PositionProps & SpaceProps & TypographyProps;
export declare type SystemProps = BackgroundProps & BorderProps & ColorProps & FlexProps & GridProps & LayoutProps & PositionProps & SpaceProps & TypographyProps & OtherProps;
export declare const system: (props: SystemProps & ThemeProp) => CSSObject;
export declare type ThemeKeys = 'colors' | 'spaces' | 'sizes' | 'fonts' | 'fontSizes' | 'fontWeights' | 'lineHeights' | 'letterSpacings' | 'borderWidths' | 'radii';
export declare type Theme = Partial<Record<ThemeKeys, Record<string, string>>>;
export interface Theme extends Partial<Record<ThemeKeys, Record<string, string>>> {
}
{
"name": "jsx-to-styled",
"description": "jsx-to-styled adds styled props to your React components",
"version": "1.0.0",
"version": "1.1.0",
"author": "mleralec",

@@ -6,0 +6,0 @@ "license": "MIT",

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