@gem-sdk/core 2.0.0-staging.966 → 2.0.0-staging.969

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.
@@ -1,4 +1,4 @@
1
- "use strict";var colors=require("./colors.js"),makeStyle=require("./make-style.js"),constant=require("./constant.js");const getBorderStyle=o=>makeStyle.makeStyle({b:o?.border,bc:colors.getSingleColorVariable(o?.color),bw:o?.width}),getBorderRadiusStyle=(o,e)=>{let r=Object.entries(e||{}).reduce((o,[e,r])=>({...o,[`--${e}`]:r}),{});return Object.entries(o||{}).reduce((o,[e,r])=>({...o,[`--${e}`]:r}),r)},handleConvertBorderStyle=(o,e)=>{if(!o)return;if("desktop"in o||"tablet"in o||"mobile"in o){let r={desktop:{normal:"button"!==e||o.desktop?.normal?.borderType!=="none"||o.desktop?.normal?.isCustom?o.desktop?.normal?.border:"solid",hover:"button"!==e||o.desktop?.hover?.borderType!=="none"||o.desktop?.hover?.isCustom?o.desktop?.hover?.border:"solid",focus:"button"!==e||o.desktop?.focus?.borderType!=="none"||o.desktop?.focus?.isCustom?o.desktop?.focus?.border:"solid"},tablet:{normal:"button"!==e||o.tablet?.normal?.borderType!=="none"||o.tablet?.normal?.isCustom?o.tablet?.normal?.border:"solid",hover:"button"!==e||o.tablet?.hover?.borderType!=="none"||o.tablet?.hover?.isCustom?o.tablet?.hover?.border:"solid",focus:"button"!==e||o.tablet?.focus?.borderType!=="none"||o.tablet?.focus?.isCustom?o.tablet?.focus?.border:"solid"},mobile:{normal:"button"!==e||o.mobile?.normal?.borderType!=="none"||o.mobile?.normal?.isCustom?o.mobile?.normal?.border:"solid",hover:"button"!==e||o.mobile?.hover?.borderType!=="none"||o.mobile?.hover?.isCustom?o.mobile?.hover?.border:"solid",focus:"button"!==e||o.mobile?.focus?.borderType!=="none"||o.mobile?.focus?.isCustom?o.mobile?.focus?.border:"solid"}};return makeStyle.makeStyleResponsiveState("bs",r)}let r={normal:"button"!==e||o.normal?.borderType!=="none"||o.normal?.isCustom?o?.normal?.border:"solid",hover:"button"!==e||o.hover?.borderType!=="none"||o.hover?.isCustom?o?.hover?.border:"solid",focus:"button"!==e||o.focus?.borderType!=="none"||o.focus?.isCustom?o?.focus?.border:"solid"};return makeStyle.makeStyleState("bs",r)},handleConvertBorderWidth=(o,e)=>{if(!o)return;if("desktop"in o||"tablet"in o||"mobile"in o){let r={desktop:{normal:"button"!==e||o.desktop?.normal?.borderType!=="none"||o?.desktop?.normal?.isCustom?o.desktop?.normal?.width:"1px 1px 1px 1px",hover:"button"!==e||o.desktop?.hover?.borderType!=="none"||o?.desktop?.normal?.isCustom?o.desktop?.hover?.width:"1px 1px 1px 1px",focus:"button"!==e||o.desktop?.focus?.borderType!=="none"||o?.desktop?.normal?.isCustom?o.desktop?.focus?.width:"1px 1px 1px 1px"},tablet:{normal:"button"!==e||o.tablet?.normal?.borderType!=="none"||o?.tablet?.normal?.isCustom?o.tablet?.normal?.width:"1px 1px 1px 1px",hover:"button"!==e||o.tablet?.hover?.borderType!=="none"||o?.tablet?.hover?.isCustom?o.tablet?.hover?.width:"1px 1px 1px 1px",focus:"button"!==e||o.tablet?.focus?.borderType!=="none"||o?.tablet?.focus?.isCustom?o.tablet?.focus?.width:"1px 1px 1px 1px"},mobile:{normal:"button"!==e||o.mobile?.normal?.borderType!=="none"||o?.mobile?.normal?.isCustom?o.mobile?.normal?.width:"1px 1px 1px 1px",hover:"button"!==e||o.mobile?.hover?.borderType!=="none"||o?.mobile?.hover?.isCustom?o.mobile?.hover?.width:"1px 1px 1px 1px",focus:"button"!==e||o.mobile?.focus?.borderType!=="none"||o?.mobile?.focus?.isCustom?o.mobile?.focus?.width:"1px 1px 1px 1px"}};return makeStyle.makeStyleResponsiveState("bw",r)}let r={normal:"button"!==e||o.normal?.borderType!=="none"||o.normal?.isCustom?o?.normal?.width:"1px 1px 1px 1px",hover:"button"!==e||o.hover?.borderType!=="none"||o.hover?.isCustom?o?.hover?.width:"1px 1px 1px 1px",focus:"button"!==e||o.focus?.borderType!=="none"||o.focus?.isCustom?o?.focus?.width:"1px 1px 1px 1px"};return makeStyle.makeStyleState("bw",r)},getInputBorderWidth=(o,e)=>({desktop:{normal:o.desktop?.normal?.width?.split(" ")?.[e],hover:o.desktop?.hover?.width?.split(" ")?.[e]},tablet:{normal:o.tablet?.normal?.width?.split(" ")?.[e],hover:o.tablet?.hover?.width?.split(" ")?.[e]},mobile:{normal:o.mobile?.normal?.width?.split(" ")?.[e],hover:o.mobile?.hover?.width?.split(" ")?.[e]}}),handleConvertInputBorderWidth=(o,e)=>{if(o&&("desktop"in o||"tablet"in o||"mobile"in o))return{...makeStyle.makeStyleResponsiveState("btw",getInputBorderWidth(o,0)),...makeStyle.makeStyleResponsiveState("bbw",getInputBorderWidth(o,2)),..."minimalist"===e?makeStyle.makeStyleResponsiveState("brw",getInputBorderWidth(o,1)):{},..."minimalist"===e?makeStyle.makeStyleResponsiveState("blw",getInputBorderWidth(o,3)):{}}},handleConvertBorderColor=o=>{if(!o)return;if("desktop"in o||"tablet"in o||"mobile"in o){let e={desktop:{normal:o.desktop?.normal?.color,hover:o.desktop?.hover?.color,focus:o.desktop?.focus?.color},tablet:{normal:o.tablet?.normal?.color,hover:o.tablet?.hover?.color,focus:o.tablet?.focus?.color},mobile:{normal:o.mobile?.normal?.color,hover:o.mobile?.hover?.color,focus:o.mobile?.focus?.color}};return colors.getGlobalColorStateResponsiveStyle("bc",e)}let e={normal:o?.normal?.color,hover:o?.hover?.color,focus:o?.focus?.color};return colors.getGlobalColorStateStyle("bc",e)},handleConvertInputBorderColor=o=>{if(!o)return;if("desktop"in o||"tablet"in o||"mobile"in o){let e={desktop:{normal:o.desktop?.normal?.color,hover:o.desktop?.hover?.color,focus:o.desktop?.focus?.color},tablet:{normal:o.tablet?.normal?.color,hover:o.tablet?.hover?.color,focus:o.tablet?.focus?.color},mobile:{normal:o.mobile?.normal?.color,hover:o.mobile?.hover?.color,focus:o.mobile?.focus?.color}};return{...colors.getGlobalColorStateResponsiveStyle("btc",e),...colors.getGlobalColorStateResponsiveStyle("bbc",e),...colors.getGlobalColorStateResponsiveStyle("blc",e),...colors.getGlobalColorStateResponsiveStyle("brc",e)}}let e={normal:o?.normal?.color,hover:o?.hover?.color,focus:o?.focus?.color};return colors.getGlobalColorStateStyle("bc",e)},handleConvertClassColor=o=>{if(!o)return;if("desktop"in o||"tablet"in o||"mobile"in o){let e={desktop:{normal:o.desktop?.normal?.color,hover:o.desktop?.hover?.color,focus:o.desktop?.focus?.color},tablet:{normal:o.tablet?.normal?.color,hover:o.tablet?.hover?.color,focus:o.tablet?.focus?.color},mobile:{normal:o.mobile?.normal?.color,hover:o.mobile?.hover?.color,focus:o.mobile?.focus?.color}};return colors.getGlobalColorStateResponsiveClass("border",e)}let e={normal:o?.normal?.color,hover:o?.hover?.color,focus:o?.focus?.color};return colors.getGlobalColorStateClass("border",e)},handleConvertClassColorDynamicBtn=o=>{if(!o)return;if("desktop"in o||"tablet"in o||"mobile"in o){let e={desktop:{normal:o.desktop?.normal?.color,hover:o.desktop?.hover?.color,focus:o.desktop?.focus?.color},tablet:{normal:o.tablet?.normal?.color,hover:o.tablet?.hover?.color,focus:o.tablet?.focus?.color},mobile:{normal:o.mobile?.normal?.color,hover:o.mobile?.hover?.color,focus:o.mobile?.focus?.color}};return colors.getGlobalColorStateResponsiveClassDynamicBtn("border",e)}let e={normal:o?.normal?.color,hover:o?.hover?.color,focus:o?.focus?.color};return colors.getGlobalColorStateClassDynamicBtn("border",e)},composeBorderCss=(o,e)=>{if(!o)return"";let r=e?.important?" !important":"",{border:t,width:l,color:s}=o;return`${t?`border-style: ${t}${r};`:""}
1
+ "use strict";var colors=require("./colors.js"),makeStyle=require("./make-style.js"),constant=require("./constant.js"),filterStyles=require("./filter-styles.js");const getBorderStyle=o=>makeStyle.makeStyle({b:o?.border,bc:colors.getSingleColorVariable(o?.color),bw:o?.width}),getBorderRadiusStyle=(o,e)=>{let r=Object.entries(e||{}).reduce((o,[e,r])=>({...o,[`--${e}`]:r}),{});return Object.entries(o||{}).reduce((o,[e,r])=>({...o,[`--${e}`]:r}),r)},handleConvertBorderStyle=(o,e)=>{if(!o)return;if("desktop"in o||"tablet"in o||"mobile"in o){let r={desktop:{normal:"button"!==e||o.desktop?.normal?.borderType!=="none"||o.desktop?.normal?.isCustom?o.desktop?.normal?.border:"solid",hover:"button"!==e||o.desktop?.hover?.borderType!=="none"||o.desktop?.hover?.isCustom?o.desktop?.hover?.border:"solid",focus:"button"!==e||o.desktop?.focus?.borderType!=="none"||o.desktop?.focus?.isCustom?o.desktop?.focus?.border:"solid"},tablet:{normal:"button"!==e||o.tablet?.normal?.borderType!=="none"||o.tablet?.normal?.isCustom?o.tablet?.normal?.border:"solid",hover:"button"!==e||o.tablet?.hover?.borderType!=="none"||o.tablet?.hover?.isCustom?o.tablet?.hover?.border:"solid",focus:"button"!==e||o.tablet?.focus?.borderType!=="none"||o.tablet?.focus?.isCustom?o.tablet?.focus?.border:"solid"},mobile:{normal:"button"!==e||o.mobile?.normal?.borderType!=="none"||o.mobile?.normal?.isCustom?o.mobile?.normal?.border:"solid",hover:"button"!==e||o.mobile?.hover?.borderType!=="none"||o.mobile?.hover?.isCustom?o.mobile?.hover?.border:"solid",focus:"button"!==e||o.mobile?.focus?.borderType!=="none"||o.mobile?.focus?.isCustom?o.mobile?.focus?.border:"solid"}};return makeStyle.makeStyleResponsiveState("bs",r)}let r={normal:"button"!==e||o.normal?.borderType!=="none"||o.normal?.isCustom?o?.normal?.border:"solid",hover:"button"!==e||o.hover?.borderType!=="none"||o.hover?.isCustom?o?.hover?.border:"solid",focus:"button"!==e||o.focus?.borderType!=="none"||o.focus?.isCustom?o?.focus?.border:"solid"};return makeStyle.makeStyleState("bs",r)},handleConvertBorderWidth=(o,e)=>{if(!o)return;if("desktop"in o||"tablet"in o||"mobile"in o){let r={desktop:{normal:"button"!==e||o.desktop?.normal?.borderType!=="none"||o?.desktop?.normal?.isCustom?o.desktop?.normal?.width:"1px 1px 1px 1px",hover:"button"!==e||o.desktop?.hover?.borderType!=="none"||o?.desktop?.normal?.isCustom?o.desktop?.hover?.width:"1px 1px 1px 1px",focus:"button"!==e||o.desktop?.focus?.borderType!=="none"||o?.desktop?.normal?.isCustom?o.desktop?.focus?.width:"1px 1px 1px 1px"},tablet:{normal:"button"!==e||o.tablet?.normal?.borderType!=="none"||o?.tablet?.normal?.isCustom?o.tablet?.normal?.width:"1px 1px 1px 1px",hover:"button"!==e||o.tablet?.hover?.borderType!=="none"||o?.tablet?.hover?.isCustom?o.tablet?.hover?.width:"1px 1px 1px 1px",focus:"button"!==e||o.tablet?.focus?.borderType!=="none"||o?.tablet?.focus?.isCustom?o.tablet?.focus?.width:"1px 1px 1px 1px"},mobile:{normal:"button"!==e||o.mobile?.normal?.borderType!=="none"||o?.mobile?.normal?.isCustom?o.mobile?.normal?.width:"1px 1px 1px 1px",hover:"button"!==e||o.mobile?.hover?.borderType!=="none"||o?.mobile?.hover?.isCustom?o.mobile?.hover?.width:"1px 1px 1px 1px",focus:"button"!==e||o.mobile?.focus?.borderType!=="none"||o?.mobile?.focus?.isCustom?o.mobile?.focus?.width:"1px 1px 1px 1px"}};return makeStyle.makeStyleResponsiveState("bw",r)}let r={normal:"button"!==e||o.normal?.borderType!=="none"||o.normal?.isCustom?o?.normal?.width:"1px 1px 1px 1px",hover:"button"!==e||o.hover?.borderType!=="none"||o.hover?.isCustom?o?.hover?.width:"1px 1px 1px 1px",focus:"button"!==e||o.focus?.borderType!=="none"||o.focus?.isCustom?o?.focus?.width:"1px 1px 1px 1px"};return makeStyle.makeStyleState("bw",r)},getInputBorderWidth=(o,e)=>({desktop:{normal:o.desktop?.normal?.width?.split(" ")?.[e],hover:o.desktop?.hover?.width?.split(" ")?.[e]},tablet:{normal:o.tablet?.normal?.width?.split(" ")?.[e],hover:o.tablet?.hover?.width?.split(" ")?.[e]},mobile:{normal:o.mobile?.normal?.width?.split(" ")?.[e],hover:o.mobile?.hover?.width?.split(" ")?.[e]}}),handleConvertInputBorderWidth=(o,e)=>{if(o&&("desktop"in o||"tablet"in o||"mobile"in o))return{..."standard"===e?filterStyles.filterHoverVariables(makeStyle.makeStyleResponsiveState("btw",getInputBorderWidth(o,0))):makeStyle.makeStyleResponsiveState("btw",getInputBorderWidth(o,0)),..."standard"===e?filterStyles.filterHoverVariables(makeStyle.makeStyleResponsiveState("bbw",getInputBorderWidth(o,2))):makeStyle.makeStyleResponsiveState("bbw",getInputBorderWidth(o,2)),..."minimalist"===e?makeStyle.makeStyleResponsiveState("brw",getInputBorderWidth(o,1)):{},..."minimalist"===e?makeStyle.makeStyleResponsiveState("blw",getInputBorderWidth(o,3)):{}}},handleConvertBorderColor=o=>{if(!o)return;if("desktop"in o||"tablet"in o||"mobile"in o){let e={desktop:{normal:o.desktop?.normal?.color,hover:o.desktop?.hover?.color,focus:o.desktop?.focus?.color},tablet:{normal:o.tablet?.normal?.color,hover:o.tablet?.hover?.color,focus:o.tablet?.focus?.color},mobile:{normal:o.mobile?.normal?.color,hover:o.mobile?.hover?.color,focus:o.mobile?.focus?.color}};return colors.getGlobalColorStateResponsiveStyle("bc",e)}let e={normal:o?.normal?.color,hover:o?.hover?.color,focus:o?.focus?.color};return colors.getGlobalColorStateStyle("bc",e)},handleConvertInputBorderColor=o=>{if(!o)return;if("desktop"in o||"tablet"in o||"mobile"in o){let e={desktop:{normal:o.desktop?.normal?.color,hover:o.desktop?.hover?.color,focus:o.desktop?.focus?.color},tablet:{normal:o.tablet?.normal?.color,hover:o.tablet?.hover?.color,focus:o.tablet?.focus?.color},mobile:{normal:o.mobile?.normal?.color,hover:o.mobile?.hover?.color,focus:o.mobile?.focus?.color}};return{...colors.getGlobalColorStateResponsiveStyle("btc",e),...colors.getGlobalColorStateResponsiveStyle("bbc",e),...colors.getGlobalColorStateResponsiveStyle("blc",e),...colors.getGlobalColorStateResponsiveStyle("brc",e)}}let e={normal:o?.normal?.color,hover:o?.hover?.color,focus:o?.focus?.color};return colors.getGlobalColorStateStyle("bc",e)},handleConvertClassColor=o=>{if(!o)return;if("desktop"in o||"tablet"in o||"mobile"in o){let e={desktop:{normal:o.desktop?.normal?.color,hover:o.desktop?.hover?.color,focus:o.desktop?.focus?.color},tablet:{normal:o.tablet?.normal?.color,hover:o.tablet?.hover?.color,focus:o.tablet?.focus?.color},mobile:{normal:o.mobile?.normal?.color,hover:o.mobile?.hover?.color,focus:o.mobile?.focus?.color}};return colors.getGlobalColorStateResponsiveClass("border",e)}let e={normal:o?.normal?.color,hover:o?.hover?.color,focus:o?.focus?.color};return colors.getGlobalColorStateClass("border",e)},handleConvertClassColorDynamicBtn=o=>{if(!o)return;if("desktop"in o||"tablet"in o||"mobile"in o){let e={desktop:{normal:o.desktop?.normal?.color,hover:o.desktop?.hover?.color,focus:o.desktop?.focus?.color},tablet:{normal:o.tablet?.normal?.color,hover:o.tablet?.hover?.color,focus:o.tablet?.focus?.color},mobile:{normal:o.mobile?.normal?.color,hover:o.mobile?.hover?.color,focus:o.mobile?.focus?.color}};return colors.getGlobalColorStateResponsiveClassDynamicBtn("border",e)}let e={normal:o?.normal?.color,hover:o?.hover?.color,focus:o?.focus?.color};return colors.getGlobalColorStateClassDynamicBtn("border",e)},composeBorderCss=(o,e)=>{if(!o)return"";let r=e?.important?" !important":"",{border:t,width:l,color:s}=o;return`${t?`border-style: ${t}${r};`:""}
2
2
  ${l?`border-width: ${l}${r};`:""}
3
3
  ${s?`border-color: ${colors.getSingleColorVariable(s)}${r};`:""}
4
4
  `},composeBorderResponsive=o=>{let e={};return Object.assign(e,composeBorderDevice(o?.desktop,"desktop")),Object.assign(e,composeBorderDevice(o?.tablet,"tablet")),Object.assign(e,composeBorderDevice(o?.mobile,"mobile")),e},composeBorderDevice=(o,e)=>{let r=e&&"desktop"!==e?constant.devicesMapping?.[e]:"";return{[`--b${r}`]:o?.border,[`--bc${r}`]:colors.getSingleColorVariable(o?.color),[`--bw${r}`]:o?.width}};exports.composeBorderCss=composeBorderCss,exports.composeBorderResponsive=composeBorderResponsive,exports.getBorderRadiusStyle=getBorderRadiusStyle,exports.getBorderStyle=getBorderStyle,exports.handleConvertBorderColor=handleConvertBorderColor,exports.handleConvertBorderStyle=handleConvertBorderStyle,exports.handleConvertBorderWidth=handleConvertBorderWidth,exports.handleConvertClassColor=handleConvertClassColor,exports.handleConvertClassColorDynamicBtn=handleConvertClassColorDynamicBtn,exports.handleConvertInputBorderColor=handleConvertInputBorderColor,exports.handleConvertInputBorderWidth=handleConvertInputBorderWidth;
@@ -1,4 +1,4 @@
1
- import{getSingleColorVariable as o,getGlobalColorStateResponsiveStyle as e,getGlobalColorStateStyle as r,getGlobalColorStateResponsiveClass as t,getGlobalColorStateClass as l,getGlobalColorStateResponsiveClassDynamicBtn as n,getGlobalColorStateClassDynamicBtn as s}from"./colors.js";import{makeStyle as b,makeStyleResponsiveState as d,makeStyleState as i}from"./make-style.js";import{devicesMapping as m}from"./constant.js";let getBorderStyle=e=>b({b:e?.border,bc:o(e?.color),bw:e?.width}),getBorderRadiusStyle=(o,e)=>{let r=Object.entries(e||{}).reduce((o,[e,r])=>({...o,[`--${e}`]:r}),{});return Object.entries(o||{}).reduce((o,[e,r])=>({...o,[`--${e}`]:r}),r)},handleConvertBorderStyle=(o,e)=>{if(!o)return;if("desktop"in o||"tablet"in o||"mobile"in o){let r={desktop:{normal:"button"!==e||o.desktop?.normal?.borderType!=="none"||o.desktop?.normal?.isCustom?o.desktop?.normal?.border:"solid",hover:"button"!==e||o.desktop?.hover?.borderType!=="none"||o.desktop?.hover?.isCustom?o.desktop?.hover?.border:"solid",focus:"button"!==e||o.desktop?.focus?.borderType!=="none"||o.desktop?.focus?.isCustom?o.desktop?.focus?.border:"solid"},tablet:{normal:"button"!==e||o.tablet?.normal?.borderType!=="none"||o.tablet?.normal?.isCustom?o.tablet?.normal?.border:"solid",hover:"button"!==e||o.tablet?.hover?.borderType!=="none"||o.tablet?.hover?.isCustom?o.tablet?.hover?.border:"solid",focus:"button"!==e||o.tablet?.focus?.borderType!=="none"||o.tablet?.focus?.isCustom?o.tablet?.focus?.border:"solid"},mobile:{normal:"button"!==e||o.mobile?.normal?.borderType!=="none"||o.mobile?.normal?.isCustom?o.mobile?.normal?.border:"solid",hover:"button"!==e||o.mobile?.hover?.borderType!=="none"||o.mobile?.hover?.isCustom?o.mobile?.hover?.border:"solid",focus:"button"!==e||o.mobile?.focus?.borderType!=="none"||o.mobile?.focus?.isCustom?o.mobile?.focus?.border:"solid"}};return d("bs",r)}let r={normal:"button"!==e||o.normal?.borderType!=="none"||o.normal?.isCustom?o?.normal?.border:"solid",hover:"button"!==e||o.hover?.borderType!=="none"||o.hover?.isCustom?o?.hover?.border:"solid",focus:"button"!==e||o.focus?.borderType!=="none"||o.focus?.isCustom?o?.focus?.border:"solid"};return i("bs",r)},handleConvertBorderWidth=(o,e)=>{if(!o)return;if("desktop"in o||"tablet"in o||"mobile"in o){let r={desktop:{normal:"button"!==e||o.desktop?.normal?.borderType!=="none"||o?.desktop?.normal?.isCustom?o.desktop?.normal?.width:"1px 1px 1px 1px",hover:"button"!==e||o.desktop?.hover?.borderType!=="none"||o?.desktop?.normal?.isCustom?o.desktop?.hover?.width:"1px 1px 1px 1px",focus:"button"!==e||o.desktop?.focus?.borderType!=="none"||o?.desktop?.normal?.isCustom?o.desktop?.focus?.width:"1px 1px 1px 1px"},tablet:{normal:"button"!==e||o.tablet?.normal?.borderType!=="none"||o?.tablet?.normal?.isCustom?o.tablet?.normal?.width:"1px 1px 1px 1px",hover:"button"!==e||o.tablet?.hover?.borderType!=="none"||o?.tablet?.hover?.isCustom?o.tablet?.hover?.width:"1px 1px 1px 1px",focus:"button"!==e||o.tablet?.focus?.borderType!=="none"||o?.tablet?.focus?.isCustom?o.tablet?.focus?.width:"1px 1px 1px 1px"},mobile:{normal:"button"!==e||o.mobile?.normal?.borderType!=="none"||o?.mobile?.normal?.isCustom?o.mobile?.normal?.width:"1px 1px 1px 1px",hover:"button"!==e||o.mobile?.hover?.borderType!=="none"||o?.mobile?.hover?.isCustom?o.mobile?.hover?.width:"1px 1px 1px 1px",focus:"button"!==e||o.mobile?.focus?.borderType!=="none"||o?.mobile?.focus?.isCustom?o.mobile?.focus?.width:"1px 1px 1px 1px"}};return d("bw",r)}let r={normal:"button"!==e||o.normal?.borderType!=="none"||o.normal?.isCustom?o?.normal?.width:"1px 1px 1px 1px",hover:"button"!==e||o.hover?.borderType!=="none"||o.hover?.isCustom?o?.hover?.width:"1px 1px 1px 1px",focus:"button"!==e||o.focus?.borderType!=="none"||o.focus?.isCustom?o?.focus?.width:"1px 1px 1px 1px"};return i("bw",r)},getInputBorderWidth=(o,e)=>({desktop:{normal:o.desktop?.normal?.width?.split(" ")?.[e],hover:o.desktop?.hover?.width?.split(" ")?.[e]},tablet:{normal:o.tablet?.normal?.width?.split(" ")?.[e],hover:o.tablet?.hover?.width?.split(" ")?.[e]},mobile:{normal:o.mobile?.normal?.width?.split(" ")?.[e],hover:o.mobile?.hover?.width?.split(" ")?.[e]}}),handleConvertInputBorderWidth=(o,e)=>{if(o&&("desktop"in o||"tablet"in o||"mobile"in o))return{...d("btw",getInputBorderWidth(o,0)),...d("bbw",getInputBorderWidth(o,2)),..."minimalist"===e?d("brw",getInputBorderWidth(o,1)):{},..."minimalist"===e?d("blw",getInputBorderWidth(o,3)):{}}},handleConvertBorderColor=o=>{if(!o)return;if("desktop"in o||"tablet"in o||"mobile"in o){let r={desktop:{normal:o.desktop?.normal?.color,hover:o.desktop?.hover?.color,focus:o.desktop?.focus?.color},tablet:{normal:o.tablet?.normal?.color,hover:o.tablet?.hover?.color,focus:o.tablet?.focus?.color},mobile:{normal:o.mobile?.normal?.color,hover:o.mobile?.hover?.color,focus:o.mobile?.focus?.color}};return e("bc",r)}let t={normal:o?.normal?.color,hover:o?.hover?.color,focus:o?.focus?.color};return r("bc",t)},handleConvertInputBorderColor=o=>{if(!o)return;if("desktop"in o||"tablet"in o||"mobile"in o){let r={desktop:{normal:o.desktop?.normal?.color,hover:o.desktop?.hover?.color,focus:o.desktop?.focus?.color},tablet:{normal:o.tablet?.normal?.color,hover:o.tablet?.hover?.color,focus:o.tablet?.focus?.color},mobile:{normal:o.mobile?.normal?.color,hover:o.mobile?.hover?.color,focus:o.mobile?.focus?.color}};return{...e("btc",r),...e("bbc",r),...e("blc",r),...e("brc",r)}}let t={normal:o?.normal?.color,hover:o?.hover?.color,focus:o?.focus?.color};return r("bc",t)},handleConvertClassColor=o=>{if(!o)return;if("desktop"in o||"tablet"in o||"mobile"in o){let e={desktop:{normal:o.desktop?.normal?.color,hover:o.desktop?.hover?.color,focus:o.desktop?.focus?.color},tablet:{normal:o.tablet?.normal?.color,hover:o.tablet?.hover?.color,focus:o.tablet?.focus?.color},mobile:{normal:o.mobile?.normal?.color,hover:o.mobile?.hover?.color,focus:o.mobile?.focus?.color}};return t("border",e)}let e={normal:o?.normal?.color,hover:o?.hover?.color,focus:o?.focus?.color};return l("border",e)},handleConvertClassColorDynamicBtn=o=>{if(!o)return;if("desktop"in o||"tablet"in o||"mobile"in o){let e={desktop:{normal:o.desktop?.normal?.color,hover:o.desktop?.hover?.color,focus:o.desktop?.focus?.color},tablet:{normal:o.tablet?.normal?.color,hover:o.tablet?.hover?.color,focus:o.tablet?.focus?.color},mobile:{normal:o.mobile?.normal?.color,hover:o.mobile?.hover?.color,focus:o.mobile?.focus?.color}};return n("border",e)}let e={normal:o?.normal?.color,hover:o?.hover?.color,focus:o?.focus?.color};return s("border",e)},composeBorderCss=(e,r)=>{if(!e)return"";let t=r?.important?" !important":"",{border:l,width:n,color:s}=e;return`${l?`border-style: ${l}${t};`:""}
1
+ import{getSingleColorVariable as o,getGlobalColorStateResponsiveStyle as e,getGlobalColorStateStyle as r,getGlobalColorStateResponsiveClass as t,getGlobalColorStateClass as l,getGlobalColorStateResponsiveClassDynamicBtn as n,getGlobalColorStateClassDynamicBtn as s}from"./colors.js";import{makeStyle as b,makeStyleResponsiveState as d,makeStyleState as i}from"./make-style.js";import{devicesMapping as m}from"./constant.js";import{filterHoverVariables as a}from"./filter-styles.js";let getBorderStyle=e=>b({b:e?.border,bc:o(e?.color),bw:e?.width}),getBorderRadiusStyle=(o,e)=>{let r=Object.entries(e||{}).reduce((o,[e,r])=>({...o,[`--${e}`]:r}),{});return Object.entries(o||{}).reduce((o,[e,r])=>({...o,[`--${e}`]:r}),r)},handleConvertBorderStyle=(o,e)=>{if(!o)return;if("desktop"in o||"tablet"in o||"mobile"in o){let r={desktop:{normal:"button"!==e||o.desktop?.normal?.borderType!=="none"||o.desktop?.normal?.isCustom?o.desktop?.normal?.border:"solid",hover:"button"!==e||o.desktop?.hover?.borderType!=="none"||o.desktop?.hover?.isCustom?o.desktop?.hover?.border:"solid",focus:"button"!==e||o.desktop?.focus?.borderType!=="none"||o.desktop?.focus?.isCustom?o.desktop?.focus?.border:"solid"},tablet:{normal:"button"!==e||o.tablet?.normal?.borderType!=="none"||o.tablet?.normal?.isCustom?o.tablet?.normal?.border:"solid",hover:"button"!==e||o.tablet?.hover?.borderType!=="none"||o.tablet?.hover?.isCustom?o.tablet?.hover?.border:"solid",focus:"button"!==e||o.tablet?.focus?.borderType!=="none"||o.tablet?.focus?.isCustom?o.tablet?.focus?.border:"solid"},mobile:{normal:"button"!==e||o.mobile?.normal?.borderType!=="none"||o.mobile?.normal?.isCustom?o.mobile?.normal?.border:"solid",hover:"button"!==e||o.mobile?.hover?.borderType!=="none"||o.mobile?.hover?.isCustom?o.mobile?.hover?.border:"solid",focus:"button"!==e||o.mobile?.focus?.borderType!=="none"||o.mobile?.focus?.isCustom?o.mobile?.focus?.border:"solid"}};return d("bs",r)}let r={normal:"button"!==e||o.normal?.borderType!=="none"||o.normal?.isCustom?o?.normal?.border:"solid",hover:"button"!==e||o.hover?.borderType!=="none"||o.hover?.isCustom?o?.hover?.border:"solid",focus:"button"!==e||o.focus?.borderType!=="none"||o.focus?.isCustom?o?.focus?.border:"solid"};return i("bs",r)},handleConvertBorderWidth=(o,e)=>{if(!o)return;if("desktop"in o||"tablet"in o||"mobile"in o){let r={desktop:{normal:"button"!==e||o.desktop?.normal?.borderType!=="none"||o?.desktop?.normal?.isCustom?o.desktop?.normal?.width:"1px 1px 1px 1px",hover:"button"!==e||o.desktop?.hover?.borderType!=="none"||o?.desktop?.normal?.isCustom?o.desktop?.hover?.width:"1px 1px 1px 1px",focus:"button"!==e||o.desktop?.focus?.borderType!=="none"||o?.desktop?.normal?.isCustom?o.desktop?.focus?.width:"1px 1px 1px 1px"},tablet:{normal:"button"!==e||o.tablet?.normal?.borderType!=="none"||o?.tablet?.normal?.isCustom?o.tablet?.normal?.width:"1px 1px 1px 1px",hover:"button"!==e||o.tablet?.hover?.borderType!=="none"||o?.tablet?.hover?.isCustom?o.tablet?.hover?.width:"1px 1px 1px 1px",focus:"button"!==e||o.tablet?.focus?.borderType!=="none"||o?.tablet?.focus?.isCustom?o.tablet?.focus?.width:"1px 1px 1px 1px"},mobile:{normal:"button"!==e||o.mobile?.normal?.borderType!=="none"||o?.mobile?.normal?.isCustom?o.mobile?.normal?.width:"1px 1px 1px 1px",hover:"button"!==e||o.mobile?.hover?.borderType!=="none"||o?.mobile?.hover?.isCustom?o.mobile?.hover?.width:"1px 1px 1px 1px",focus:"button"!==e||o.mobile?.focus?.borderType!=="none"||o?.mobile?.focus?.isCustom?o.mobile?.focus?.width:"1px 1px 1px 1px"}};return d("bw",r)}let r={normal:"button"!==e||o.normal?.borderType!=="none"||o.normal?.isCustom?o?.normal?.width:"1px 1px 1px 1px",hover:"button"!==e||o.hover?.borderType!=="none"||o.hover?.isCustom?o?.hover?.width:"1px 1px 1px 1px",focus:"button"!==e||o.focus?.borderType!=="none"||o.focus?.isCustom?o?.focus?.width:"1px 1px 1px 1px"};return i("bw",r)},getInputBorderWidth=(o,e)=>({desktop:{normal:o.desktop?.normal?.width?.split(" ")?.[e],hover:o.desktop?.hover?.width?.split(" ")?.[e]},tablet:{normal:o.tablet?.normal?.width?.split(" ")?.[e],hover:o.tablet?.hover?.width?.split(" ")?.[e]},mobile:{normal:o.mobile?.normal?.width?.split(" ")?.[e],hover:o.mobile?.hover?.width?.split(" ")?.[e]}}),handleConvertInputBorderWidth=(o,e)=>{if(o&&("desktop"in o||"tablet"in o||"mobile"in o))return{..."standard"===e?a(d("btw",getInputBorderWidth(o,0))):d("btw",getInputBorderWidth(o,0)),..."standard"===e?a(d("bbw",getInputBorderWidth(o,2))):d("bbw",getInputBorderWidth(o,2)),..."minimalist"===e?d("brw",getInputBorderWidth(o,1)):{},..."minimalist"===e?d("blw",getInputBorderWidth(o,3)):{}}},handleConvertBorderColor=o=>{if(!o)return;if("desktop"in o||"tablet"in o||"mobile"in o){let r={desktop:{normal:o.desktop?.normal?.color,hover:o.desktop?.hover?.color,focus:o.desktop?.focus?.color},tablet:{normal:o.tablet?.normal?.color,hover:o.tablet?.hover?.color,focus:o.tablet?.focus?.color},mobile:{normal:o.mobile?.normal?.color,hover:o.mobile?.hover?.color,focus:o.mobile?.focus?.color}};return e("bc",r)}let t={normal:o?.normal?.color,hover:o?.hover?.color,focus:o?.focus?.color};return r("bc",t)},handleConvertInputBorderColor=o=>{if(!o)return;if("desktop"in o||"tablet"in o||"mobile"in o){let r={desktop:{normal:o.desktop?.normal?.color,hover:o.desktop?.hover?.color,focus:o.desktop?.focus?.color},tablet:{normal:o.tablet?.normal?.color,hover:o.tablet?.hover?.color,focus:o.tablet?.focus?.color},mobile:{normal:o.mobile?.normal?.color,hover:o.mobile?.hover?.color,focus:o.mobile?.focus?.color}};return{...e("btc",r),...e("bbc",r),...e("blc",r),...e("brc",r)}}let t={normal:o?.normal?.color,hover:o?.hover?.color,focus:o?.focus?.color};return r("bc",t)},handleConvertClassColor=o=>{if(!o)return;if("desktop"in o||"tablet"in o||"mobile"in o){let e={desktop:{normal:o.desktop?.normal?.color,hover:o.desktop?.hover?.color,focus:o.desktop?.focus?.color},tablet:{normal:o.tablet?.normal?.color,hover:o.tablet?.hover?.color,focus:o.tablet?.focus?.color},mobile:{normal:o.mobile?.normal?.color,hover:o.mobile?.hover?.color,focus:o.mobile?.focus?.color}};return t("border",e)}let e={normal:o?.normal?.color,hover:o?.hover?.color,focus:o?.focus?.color};return l("border",e)},handleConvertClassColorDynamicBtn=o=>{if(!o)return;if("desktop"in o||"tablet"in o||"mobile"in o){let e={desktop:{normal:o.desktop?.normal?.color,hover:o.desktop?.hover?.color,focus:o.desktop?.focus?.color},tablet:{normal:o.tablet?.normal?.color,hover:o.tablet?.hover?.color,focus:o.tablet?.focus?.color},mobile:{normal:o.mobile?.normal?.color,hover:o.mobile?.hover?.color,focus:o.mobile?.focus?.color}};return n("border",e)}let e={normal:o?.normal?.color,hover:o?.hover?.color,focus:o?.focus?.color};return s("border",e)},composeBorderCss=(e,r)=>{if(!e)return"";let t=r?.important?" !important":"",{border:l,width:n,color:s}=e;return`${l?`border-style: ${l}${t};`:""}
2
2
  ${n?`border-width: ${n}${t};`:""}
3
3
  ${s?`border-color: ${o(s)}${t};`:""}
4
4
  `},composeBorderResponsive=o=>{let e={};return Object.assign(e,composeBorderDevice(o?.desktop,"desktop")),Object.assign(e,composeBorderDevice(o?.tablet,"tablet")),Object.assign(e,composeBorderDevice(o?.mobile,"mobile")),e},composeBorderDevice=(e,r)=>{let t=r&&"desktop"!==r?m?.[r]:"";return{[`--b${t}`]:e?.border,[`--bc${t}`]:o(e?.color),[`--bw${t}`]:e?.width}};export{composeBorderCss,composeBorderResponsive,getBorderRadiusStyle,getBorderStyle,handleConvertBorderColor,handleConvertBorderStyle,handleConvertBorderWidth,handleConvertClassColor,handleConvertClassColorDynamicBtn,handleConvertInputBorderColor,handleConvertInputBorderWidth};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "2.0.0-staging.966",
3
+ "version": "2.0.0-staging.969",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",