@gem-sdk/core 2.0.0-staging.955 → 2.0.0-staging.965
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,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),shop=require("../hooks/shop.js"),AddonContext=require("../contexts/AddonContext.js");const AddOn=({name:e})=>{let t=AddonContext.useAddon(e),n=shop.usePluginEnable();return n?.includes(e)?jsxRuntime.jsx(t,{}):null};exports.default=AddOn;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var constant=require("./constant.js"),makeStyle=require("./make-style.js");const getCornerCSSFromGlobal=e=>e?.radiusType?["custom","circle"].includes(e?.radiusType)?makeStyle.makeStyle({bblr:e.bblr,bbrr:e.bbrr,btlr:e.btlr,btrr:e.btrr}):makeStyle.makeStyle({radius:`var(--g-radius-${e?.radiusType})`}):{},getRadiusCSSFromGlobal=(e,s,t)=>{if(!s||!e)return{};let a=t&&"desktop"!==t?constant.devicesMapping?.[t]:"",r=constant.stateMapping?.[e];return{[`-${r}-radius${a}`]:`var(--g-radius-${s})`}},getCustomRadius=(e,s,t)=>{let a=["custom","pill","rounded","single","none","circle","square"];if(!s||!e||!a.includes(s?.radiusType??""))return{};let r=t&&"desktop"!==t?constant.devicesMapping?.[t]:"",o=constant.stateMapping?.[e];return{[`-${o}-bblr${r}`]:s.bblr,[`-${o}-bbrr${r}`]:s.bbrr,[`-${o}-btlr${r}`]:s.btlr,[`-${o}-btrr${r}`]:s.btrr}},composeRadius=e=>e?"desktop"in e||"tablet"in e||"mobile"in e?composeRadiusResponsiveState(e):composeRadiusState(e):{},composeRadiusResponsive=e=>{let s={};return Object.assign(s,getCustomRadius("normal",e?.desktop,"desktop")),Object.assign(s,getCustomRadius("normal",e?.tablet,"tablet")),Object.assign(s,getCustomRadius("normal",e?.mobile,"mobile")),s},composeRadiusState=(e,s)=>{let t={};switch(e?.normal?.radiusType){case"medium":case"large":case"small":Object.assign(t,getRadiusCSSFromGlobal("normal",e?.normal?.radiusType,s));break;default:Object.assign(t,getCustomRadius("normal",e?.normal,s))}switch(e?.hover?.radiusType){case"medium":case"large":case"small":Object.assign(t,getRadiusCSSFromGlobal("hover",e?.hover?.radiusType,s));break;default:Object.assign(t,getCustomRadius("hover",e?.hover,s))}switch(e?.focus?.radiusType){case"medium":case"large":case"small":Object.assign(t,getRadiusCSSFromGlobal("focus",e?.focus?.radiusType,s));break;default:Object.assign(t,getCustomRadius("focus",e?.focus,s))}return t},composeRadiusResponsiveState=e=>{let s={};return Object.assign(s,composeRadiusState(e?.desktop,"desktop")),Object.assign(s,composeRadiusState(e?.tablet,"tablet")),Object.assign(s,composeRadiusState(e?.mobile,"mobile")),s},getRadiusStyleActiveState=e=>{let s=["circle","square","rounded","none","custom"];return s.includes(
|
|
1
|
+
"use strict";var constant=require("./constant.js"),makeStyle=require("./make-style.js");const getCornerCSSFromGlobal=e=>e?.radiusType?["custom","circle"].includes(e?.radiusType)?makeStyle.makeStyle({bblr:e.bblr,bbrr:e.bbrr,btlr:e.btlr,btrr:e.btrr}):makeStyle.makeStyle({radius:`var(--g-radius-${e?.radiusType})`}):{},getRadiusCSSFromGlobal=(e,s,t)=>{if(!s||!e)return{};let a=t&&"desktop"!==t?constant.devicesMapping?.[t]:"",r=constant.stateMapping?.[e];return{[`-${r}-radius${a}`]:`var(--g-radius-${s})`}},getCustomRadius=(e,s,t)=>{let a=["custom","pill","rounded","single","none","circle","square"];if(!s||!e||!a.includes(s?.radiusType??""))return{};let r=t&&"desktop"!==t?constant.devicesMapping?.[t]:"",o=constant.stateMapping?.[e];return{[`-${o}-bblr${r}`]:s.bblr,[`-${o}-bbrr${r}`]:s.bbrr,[`-${o}-btlr${r}`]:s.btlr,[`-${o}-btrr${r}`]:s.btrr}},composeRadius=e=>e?"desktop"in e||"tablet"in e||"mobile"in e?composeRadiusResponsiveState(e):composeRadiusState(e):{},composeRadiusResponsive=e=>{let s={};return Object.assign(s,getCustomRadius("normal",e?.desktop,"desktop")),Object.assign(s,getCustomRadius("normal",e?.tablet,"tablet")),Object.assign(s,getCustomRadius("normal",e?.mobile,"mobile")),s},composeRadiusState=(e,s)=>{let t={};switch(e?.normal?.radiusType){case"medium":case"large":case"small":Object.assign(t,getRadiusCSSFromGlobal("normal",e?.normal?.radiusType,s));break;default:Object.assign(t,getCustomRadius("normal",e?.normal,s))}switch(e?.hover?.radiusType){case"medium":case"large":case"small":Object.assign(t,getRadiusCSSFromGlobal("hover",e?.hover?.radiusType,s));break;default:Object.assign(t,getCustomRadius("hover",e?.hover,s))}switch(e?.focus?.radiusType){case"medium":case"large":case"small":Object.assign(t,getRadiusCSSFromGlobal("focus",e?.focus?.radiusType,s));break;default:Object.assign(t,getCustomRadius("focus",e?.focus,s))}return t},composeRadiusResponsiveState=e=>{let s={};return Object.assign(s,composeRadiusState(e?.desktop,"desktop")),Object.assign(s,composeRadiusState(e?.tablet,"tablet")),Object.assign(s,composeRadiusState(e?.mobile,"mobile")),s},getRadiusStyleActiveState=e=>{let s=["circle","square","rounded","none","custom"],t=e?.active||e?.normal;return s.includes(t?.radiusType||"")?getCustomRadius("normal",t):getRadiusCSSFromGlobal("normal",t?.radiusType)},composeCornerCss=(e,s=!1)=>{let t;if(!e)return"";let{radiusType:a,bblr:r,bbrr:o,btlr:i,btrr:u}=e,l=s?" !important":"";switch(a){case"medium":case"large":case"small":t=`border-radius: var(--g-radius-${a});`;break;case"circle":case"square":case"none":case"rounded":case"custom":t=`
|
|
2
2
|
${r?`border-bottom-left-radius: ${r}${l};`:""}
|
|
3
3
|
${o?`border-bottom-right-radius: ${o}${l};`:""}
|
|
4
4
|
${i?`border-top-left-radius: ${i}${l};`:""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{jsx as t}from"react/jsx-runtime";import{
|
|
2
|
+
import{jsx as t}from"react/jsx-runtime";import{usePluginEnable as o}from"../hooks/shop.js";import{useAddon as r}from"../contexts/AddonContext.js";let AddOn=({name:e})=>{let n=r(e),d=o();return d?.includes(e)?t(n,{}):null};export{AddOn as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{devicesMapping as e,stateMapping as s}from"./constant.js";import{makeStyle as
|
|
2
|
-
${
|
|
1
|
+
import{devicesMapping as e,stateMapping as s}from"./constant.js";import{makeStyle as a}from"./make-style.js";let getCornerCSSFromGlobal=e=>e?.radiusType?["custom","circle"].includes(e?.radiusType)?a({bblr:e.bblr,bbrr:e.bbrr,btlr:e.btlr,btrr:e.btrr}):a({radius:`var(--g-radius-${e?.radiusType})`}):{},getRadiusCSSFromGlobal=(a,r,t)=>{if(!r||!a)return{};let o=t&&"desktop"!==t?e?.[t]:"",i=s?.[a];return{[`-${i}-radius${o}`]:`var(--g-radius-${r})`}},getCustomRadius=(a,r,t)=>{let o=["custom","pill","rounded","single","none","circle","square"];if(!r||!a||!o.includes(r?.radiusType??""))return{};let i=t&&"desktop"!==t?e?.[t]:"",u=s?.[a];return{[`-${u}-bblr${i}`]:r.bblr,[`-${u}-bbrr${i}`]:r.bbrr,[`-${u}-btlr${i}`]:r.btlr,[`-${u}-btrr${i}`]:r.btrr}},composeRadius=e=>e?"desktop"in e||"tablet"in e||"mobile"in e?composeRadiusResponsiveState(e):composeRadiusState(e):{},composeRadiusResponsive=e=>{let s={};return Object.assign(s,getCustomRadius("normal",e?.desktop,"desktop")),Object.assign(s,getCustomRadius("normal",e?.tablet,"tablet")),Object.assign(s,getCustomRadius("normal",e?.mobile,"mobile")),s},composeRadiusState=(e,s)=>{let a={};switch(e?.normal?.radiusType){case"medium":case"large":case"small":Object.assign(a,getRadiusCSSFromGlobal("normal",e?.normal?.radiusType,s));break;default:Object.assign(a,getCustomRadius("normal",e?.normal,s))}switch(e?.hover?.radiusType){case"medium":case"large":case"small":Object.assign(a,getRadiusCSSFromGlobal("hover",e?.hover?.radiusType,s));break;default:Object.assign(a,getCustomRadius("hover",e?.hover,s))}switch(e?.focus?.radiusType){case"medium":case"large":case"small":Object.assign(a,getRadiusCSSFromGlobal("focus",e?.focus?.radiusType,s));break;default:Object.assign(a,getCustomRadius("focus",e?.focus,s))}return a},composeRadiusResponsiveState=e=>{let s={};return Object.assign(s,composeRadiusState(e?.desktop,"desktop")),Object.assign(s,composeRadiusState(e?.tablet,"tablet")),Object.assign(s,composeRadiusState(e?.mobile,"mobile")),s},getRadiusStyleActiveState=e=>{let s=["circle","square","rounded","none","custom"],a=e?.active||e?.normal;return s.includes(a?.radiusType||"")?getCustomRadius("normal",a):getRadiusCSSFromGlobal("normal",a?.radiusType)},composeCornerCss=(e,s=!1)=>{let a;if(!e)return"";let{radiusType:r,bblr:t,bbrr:o,btlr:i,btrr:u}=e,l=s?" !important":"";switch(r){case"medium":case"large":case"small":a=`border-radius: var(--g-radius-${r});`;break;case"circle":case"square":case"none":case"rounded":case"custom":a=`
|
|
2
|
+
${t?`border-bottom-left-radius: ${t}${l};`:""}
|
|
3
3
|
${o?`border-bottom-right-radius: ${o}${l};`:""}
|
|
4
4
|
${i?`border-top-left-radius: ${i}${l};`:""}
|
|
5
5
|
${u?`border-top-right-radius: ${u}${l};`:""}
|
|
6
|
-
`}return
|
|
6
|
+
`}return a};export{composeCornerCss,composeRadius,composeRadiusResponsive,getCornerCSSFromGlobal,getCustomRadius,getRadiusCSSFromGlobal,getRadiusStyleActiveState};
|