nzk-react-components 3.0.0-0 → 3.0.0-2
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 +1 @@
|
|
|
1
|
-
"use strict";var n=require("../../_virtual/_tslib.js"),e=require("styled-components"),o=require("./utils.js"),t=require("./constants.js");function r(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var i,s,a,
|
|
1
|
+
"use strict";var n=require("../../_virtual/_tslib.js"),e=require("styled-components"),o=require("./utils.js"),t=require("./constants.js");function r(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var i,l,s,a,d,u=["backgroundColor","height","fullWidth","color","strokeColor","dropShadowColor","shadowColor","fontSize","round","disabled","wiggle","size","theme"],c=r(e).default.div.withConfig({shouldForwardProp:function(n){return!u.includes(n)},displayName:"Buttonstyles__StyledSpanButton",componentId:"sc-1r7fyax-0"}).attrs((function(n){return{role:"button"}}))(d||(d=n.__makeTemplateObject(["\n ","\n\n svg {\n height: 100%;\n width: 100%;\n }\n\n"],["\n ","\n\n svg {\n height: 100%;\n width: 100%;\n }\n\n"])),(function(r){var d=function(n){var e=n.theme?t.THEMES[n.theme]:void 0,o=t.THEMES.primary;return{backgroundColor:(null==e?void 0:e.backgroundColor)||n.backgroundColor||o.backgroundColor,color:(null==e?void 0:e.color)||n.color,strokeColor:(null==e?void 0:e.strokeColor)||n.strokeColor,shadowColor:(null==e?void 0:e.shadowColor)||n.shadowColor}}(r),u=function(n){return(n.size?t.SIZES[n.size]:void 0)||n.height||t.SIZES.regular}(r);return e.css(a||(a=n.__makeTemplateObject(["\n // Base\n ","\n // COLORS\n background-color: ",";\n ",";\n color: ",";\n filter: ",";\n\n // Dimensions\n ","\n "],["\n // Base\n ","\n // COLORS\n background-color: ",";\n ",";\n color: ",";\n filter: ",";\n\n // Dimensions\n ","\n "])),e.css(i||(i=n.__makeTemplateObject(['\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-family: "Rammetto One";\n border-radius: 1000px;\n cursor: pointer;\n user-select: none;\n text-decoration: none;\n '],['\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-family: "Rammetto One";\n border-radius: 1000px;\n cursor: pointer;\n user-select: none;\n text-decoration: none;\n ']))),d.backgroundColor,o.getShadows(n.__assign(n.__assign({},d),{height:u})),o.getTextColor(d),r.disabled?"grayscale(100%)":"none",function(t){return e.css(s||(s=n.__makeTemplateObject(["\n outline: none;\n border: none;\n height: ","px;\n font-size: ",";\n margin-bottom: ","px;\n padding: ",";\n ","\n "],["\n outline: none;\n border: none;\n height: ","px;\n font-size: ",";\n margin-bottom: ","px;\n padding: ",";\n ","\n "])),t.height,o.getTextSize(t),o.getSizeComparedToBase(t,12),o.getPadding(t),t.round&&e.css(l||(l=n.__makeTemplateObject(["\n width: ","px;\n padding: 0;\n flex-shrink: 0;\n "],["\n width: ","px;\n padding: 0;\n flex-shrink: 0;\n "])),t.height))}({height:u,round:r.round}))}));exports.StyledSpanButton=c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var o
|
|
1
|
+
"use strict";var n,o=require("../../_virtual/_tslib.js"),e=require("styled-components"),r=require("polished"),t=function(n,o){return n.height*o/64};exports.getPadding=function(n){return"".concat(.001*n.height,"px ").concat(n.height/2,"px")},exports.getShadows=function(a){var x=r.getLuminance(a.backgroundColor),p=a.shadowColor||x&&r.darken(.2,a.backgroundColor)||!x&&r.lighten(.2,a.backgroundColor),i=a.dropShadowColor||"rgba(0,0,0,0.3)",s=a.strokeColor||x&&r.lighten(.1,a.backgroundColor)||!x&&r.darken(.1,a.backgroundColor);return e.css(n||(n=o.__makeTemplateObject(["\n box-shadow:\n 0 ","px 0 ",",\n 0 ","px 0 ",",\n inset 0 0px 0px ","px ",";\n\n &:active {\n transform: translateY(","px);\n box-shadow:\n 0 ","px 0 ",",\n inset 0 0px 0px ","px ",";\n }\n "],["\n box-shadow:\n 0 ","px 0 ",",\n 0 ","px 0 ",",\n inset 0 0px 0px ","px ",";\n\n &:active {\n transform: translateY(","px);\n box-shadow:\n 0 ","px 0 ",",\n inset 0 0px 0px ","px ",";\n }\n "])),t(a,5),p,t(a,12),i,t(a,5),s,t(a,7),t(a,5),p,t(a,5),s)},exports.getSizeComparedToBase=t,exports.getTextColor=function(n){return n.color?n.color:n.backgroundColor&&r.getLuminance(n.backgroundColor)<=.5?"#fff":"#000"},exports.getTextSize=function(n){return function(n){return Boolean(n.fontSize)}(n)?n.fontSize:"".concat(n.height/2.5,"px")};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { BaseProps } from
|
|
2
|
+
import { BaseProps } from "./Button";
|
|
3
3
|
export declare const StyledSpanButton: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("styled-components/dist/types").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
4
4
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
5
5
|
}>, never>, BaseProps>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__makeTemplateObject as n,__assign as o}from"../../_virtual/_tslib.js";import
|
|
1
|
+
import{__makeTemplateObject as n,__assign as o}from"../../_virtual/_tslib.js";import r,{css as e}from"styled-components";import{getShadows as t,getTextColor as i,getTextSize as l,getSizeComparedToBase as d,getPadding as s}from"./utils.js";import{THEMES as a,SIZES as u}from"./constants.js";var c,h,g,p,m,f=["backgroundColor","height","fullWidth","color","strokeColor","dropShadowColor","shadowColor","fontSize","round","disabled","wiggle","size","theme"],b=r.div.withConfig({shouldForwardProp:function(n){return!f.includes(n)},displayName:"Buttonstyles__StyledSpanButton",componentId:"sc-1r7fyax-0"}).attrs((function(n){return{role:"button"}}))(m||(m=n(["\n ","\n\n svg {\n height: 100%;\n width: 100%;\n }\n\n"],["\n ","\n\n svg {\n height: 100%;\n width: 100%;\n }\n\n"])),(function(r){var m=function(n){var o=n.theme?a[n.theme]:void 0,r=a.primary;return{backgroundColor:(null==o?void 0:o.backgroundColor)||n.backgroundColor||r.backgroundColor,color:(null==o?void 0:o.color)||n.color,strokeColor:(null==o?void 0:o.strokeColor)||n.strokeColor,shadowColor:(null==o?void 0:o.shadowColor)||n.shadowColor}}(r),f=function(n){return(n.size?u[n.size]:void 0)||n.height||u.regular}(r);return e(p||(p=n(["\n // Base\n ","\n // COLORS\n background-color: ",";\n ",";\n color: ",";\n filter: ",";\n\n // Dimensions\n ","\n "],["\n // Base\n ","\n // COLORS\n background-color: ",";\n ",";\n color: ",";\n filter: ",";\n\n // Dimensions\n ","\n "])),e(c||(c=n(['\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-family: "Rammetto One";\n border-radius: 1000px;\n cursor: pointer;\n user-select: none;\n text-decoration: none;\n '],['\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-family: "Rammetto One";\n border-radius: 1000px;\n cursor: pointer;\n user-select: none;\n text-decoration: none;\n ']))),m.backgroundColor,t(o(o({},m),{height:f})),i(m),r.disabled?"grayscale(100%)":"none",function(o){return e(g||(g=n(["\n outline: none;\n border: none;\n height: ","px;\n font-size: ",";\n margin-bottom: ","px;\n padding: ",";\n ","\n "],["\n outline: none;\n border: none;\n height: ","px;\n font-size: ",";\n margin-bottom: ","px;\n padding: ",";\n ","\n "])),o.height,l(o),d(o,12),s(o),o.round&&e(h||(h=n(["\n width: ","px;\n padding: 0;\n flex-shrink: 0;\n "],["\n width: ","px;\n padding: 0;\n flex-shrink: 0;\n "])),o.height))}({height:f,round:r.round}))}));export{b as StyledSpanButton};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__makeTemplateObject as o}from"../../_virtual/_tslib.js";import{css as n}from"styled-components";import{getLuminance as r,darken as t,lighten as p}from"polished";var a,x=function(o){return o.color?o.color:o.backgroundColor&&r(o.backgroundColor)<=.5?"#fff":"#000"},e=function(o){return function(o){return Boolean(o.fontSize)}(o)?o.fontSize:"".concat(o.height/2.5,"px")},c=function(o){return"".concat(.001*o.height,"px ").concat(o.height/2,"px")},i=function(o,n){return o.height*n/64},u=function(x){var e=r(x.backgroundColor),c=x.shadowColor||e&&t(.2,x.backgroundColor)||!e&&p(.2,x.backgroundColor),u=x.dropShadowColor||"rgba(0,0,0,0.3)",l=x.strokeColor||e&&p(.1,x.backgroundColor)||!e&&t(.1,x.backgroundColor);return n(a||(a=o(["\n box-shadow
|
|
1
|
+
import{__makeTemplateObject as o}from"../../_virtual/_tslib.js";import{css as n}from"styled-components";import{getLuminance as r,darken as t,lighten as p}from"polished";var a,x=function(o){return o.color?o.color:o.backgroundColor&&r(o.backgroundColor)<=.5?"#fff":"#000"},e=function(o){return function(o){return Boolean(o.fontSize)}(o)?o.fontSize:"".concat(o.height/2.5,"px")},c=function(o){return"".concat(.001*o.height,"px ").concat(o.height/2,"px")},i=function(o,n){return o.height*n/64},u=function(x){var e=r(x.backgroundColor),c=x.shadowColor||e&&t(.2,x.backgroundColor)||!e&&p(.2,x.backgroundColor),u=x.dropShadowColor||"rgba(0,0,0,0.3)",l=x.strokeColor||e&&p(.1,x.backgroundColor)||!e&&t(.1,x.backgroundColor);return n(a||(a=o(["\n box-shadow:\n 0 ","px 0 ",",\n 0 ","px 0 ",",\n inset 0 0px 0px ","px ",";\n\n &:active {\n transform: translateY(","px);\n box-shadow:\n 0 ","px 0 ",",\n inset 0 0px 0px ","px ",";\n }\n "],["\n box-shadow:\n 0 ","px 0 ",",\n 0 ","px 0 ",",\n inset 0 0px 0px ","px ",";\n\n &:active {\n transform: translateY(","px);\n box-shadow:\n 0 ","px 0 ",",\n inset 0 0px 0px ","px ",";\n }\n "])),i(x,5),c,i(x,12),u,i(x,5),l,i(x,7),i(x,5),c,i(x,5),l)};export{c as getPadding,u as getShadows,i as getSizeComparedToBase,x as getTextColor,e as getTextSize};
|