@elvia/elvis-toolbox
Advanced tools
Comparing version 9.3.1 to 9.4.0
@@ -5,3 +5,20 @@ { | ||
{ | ||
"date": "27.06.23", | ||
"date": "28.08.23", | ||
"version": "9.4.0", | ||
"changelog": [ | ||
{ | ||
"type": "new_feature", | ||
"changes": [ | ||
"Add breakpoints to use in media queries.", | ||
"Add flag to Overlay component to use global instead of local themes" | ||
] | ||
}, | ||
{ | ||
"type": "bug_fix", | ||
"changes": ["Tertiary button missing text color."] | ||
} | ||
] | ||
}, | ||
{ | ||
"date": "18.07.23", | ||
"version": "9.3.1", | ||
@@ -8,0 +25,0 @@ "changelog": [ |
@@ -1,2 +0,2 @@ | ||
import{getThemeColor,getThemeColorContrast}from"@elvia/elvis-colors";import styled,{css}from"styled-components";var getTypography=function(a){return"small"===a||"sm"===a?css(["font-family:'Red Hat Display',Verdana,sans-serif;font-style:normal;font-weight:500;font-size:14px;line-height:115%;"]):"medium"===a||"md"===a?css(["font-family:'Red Hat Display',Verdana,sans-serif;font-style:normal;font-weight:500;font-size:16px;line-height:125%;"]):css(["font-family:'Red Hat Display',Verdana,sans-serif;font-style:normal;font-weight:500;font-size:18px;line-height:24px;"])},ButtonBase=styled.button.withConfig({displayName:"button__ButtonBase",componentId:"sc-1tqgdb-0"})(["",";font-weight:500;display:flex;align-items:center;justify-content:center;gap:8px;margin:0;white-space:nowrap;&:disabled{cursor:default;}&:not(:disabled){cursor:pointer;&::selection{background-color:",";}}"],function(a){var b=a.size;return getTypography(null!==b&&void 0!==b?b:"md")},getThemeColor("background-selected-1")),getButtonHeight=function(a){return"large"===a||"lg"===a?"48px":"medium"===a||"md"===a?"40px":"32px"},getButtonPadding=function(a){return"large"===a||"lg"===a?"0 calc(32px - 1px)":"medium"===a||"md"===a?"0 calc(24px - 1px)":"0 calc(16px - 1px)"};export var PrimaryButton=styled(ButtonBase).withConfig({displayName:"button__PrimaryButton",componentId:"sc-1tqgdb-1"})(["height:",";border:1px solid ",";padding:",";background-color:",";color:",";transition:transform 100ms;border-radius:99px;&:not(:disabled){&:hover{background-color:",";border-color:",";color:",";}&:active{border-color:transparent;background-clip:padding-box;}}&:disabled{border-color:transparent;background-color:",";cursor:not-allowed;}"],function(a){var b=a.size;return getButtonHeight(null!==b&&void 0!==b?b:"md")},function(a){var b=a.isActive;return b?getThemeColor("border-selected-1"):getThemeColor("text-1")},function(a){var b=a.size;return getButtonPadding(null!==b&&void 0!==b?b:"md")},function(a){var b=a.isActive;return b?getThemeColor("background-selected-1"):getThemeColor("text-1")},function(a){var b=a.isActive;return b?getThemeColor("text-1"):getThemeColorContrast("text-1")},getThemeColor("background-hover-1"),getThemeColor("border-hover-1"),getThemeColor("text-1"),getThemeColor("background-disabled-2"));export var SecondaryButton=styled(PrimaryButton).withConfig({displayName:"button__SecondaryButton",componentId:"sc-1tqgdb-2"})(["background-color:",";color:",";&:disabled{background-color:transparent;border-color:",";color:",";}"],function(a){var b=a.isActive;return b?getThemeColor("background-selected-1"):"transparent"},getThemeColor("text-1"),getThemeColor("border-disabled-1"),getThemeColor("text-disabled-1"));export var TertiaryButton=styled(ButtonBase).withConfig({displayName:"button__TertiaryButton",componentId:"sc-1tqgdb-3"})(["border:none;background:transparent;position:relative;padding:0;height:",";&:after{content:'';display:block;position:absolute;bottom:0;left:0;right:0;height:2px;background-color:",";transform:scaleY(1);transform-origin:center bottom;transition:background-color 60ms,transform 100ms;}&:not(:disabled){&:hover:after{background-color:",";}&:active:after{transform:scaleY(0.5);}}&:disabled{color:",";}"],function(a){var b=a.size;return"sm"===b||"small"===b?"1.5rem":"2rem"},function(a){var b=a.isActive;return b?getThemeColor("background-selected-1"):"transparent"},getThemeColor("background-hover-1"),getThemeColor("background-disabled-1")); | ||
import{getThemeColor,getThemeColorContrast}from"@elvia/elvis-colors";import styled,{css}from"styled-components";var getTypography=function(a){return"small"===a||"sm"===a?css(["font-family:'Red Hat Display',Verdana,sans-serif;font-style:normal;font-weight:500;font-size:14px;line-height:115%;"]):"medium"===a||"md"===a?css(["font-family:'Red Hat Display',Verdana,sans-serif;font-style:normal;font-weight:500;font-size:16px;line-height:125%;"]):css(["font-family:'Red Hat Display',Verdana,sans-serif;font-style:normal;font-weight:500;font-size:18px;line-height:24px;"])},ButtonBase=styled.button.withConfig({displayName:"button__ButtonBase",componentId:"sc-1tqgdb-0"})(["",";font-weight:500;display:flex;align-items:center;justify-content:center;gap:8px;margin:0;white-space:nowrap;&:disabled{cursor:default;}&:not(:disabled){cursor:pointer;&::selection{background-color:",";}}"],function(a){var b=a.size;return getTypography(null!==b&&void 0!==b?b:"md")},getThemeColor("background-selected-1")),getButtonHeight=function(a){return"large"===a||"lg"===a?"48px":"medium"===a||"md"===a?"40px":"32px"},getButtonPadding=function(a){return"large"===a||"lg"===a?"0 calc(32px - 1px)":"medium"===a||"md"===a?"0 calc(24px - 1px)":"0 calc(16px - 1px)"};export var PrimaryButton=styled(ButtonBase).withConfig({displayName:"button__PrimaryButton",componentId:"sc-1tqgdb-1"})(["height:",";border:1px solid ",";padding:",";background-color:",";color:",";transition:transform 100ms;border-radius:99px;&:not(:disabled){&:hover{background-color:",";border-color:",";color:",";}&:active{border-color:transparent;background-clip:padding-box;}}&:disabled{border-color:transparent;background-color:",";cursor:not-allowed;}"],function(a){var b=a.size;return getButtonHeight(null!==b&&void 0!==b?b:"md")},function(a){var b=a.isActive;return b?getThemeColor("border-selected-1"):getThemeColor("text-1")},function(a){var b=a.size;return getButtonPadding(null!==b&&void 0!==b?b:"md")},function(a){var b=a.isActive;return b?getThemeColor("background-selected-1"):getThemeColor("text-1")},function(a){var b=a.isActive;return b?getThemeColor("text-1"):getThemeColorContrast("text-1")},getThemeColor("background-hover-1"),getThemeColor("border-hover-1"),getThemeColor("text-1"),getThemeColor("background-disabled-2"));export var SecondaryButton=styled(PrimaryButton).withConfig({displayName:"button__SecondaryButton",componentId:"sc-1tqgdb-2"})(["background-color:",";color:",";&:disabled{background-color:transparent;border-color:",";color:",";}"],function(a){var b=a.isActive;return b?getThemeColor("background-selected-1"):"transparent"},getThemeColor("text-1"),getThemeColor("border-disabled-1"),getThemeColor("text-disabled-1"));export var TertiaryButton=styled(ButtonBase).withConfig({displayName:"button__TertiaryButton",componentId:"sc-1tqgdb-3"})(["border:none;background:transparent;position:relative;padding:0;height:",";color:",";&:after{content:'';display:block;position:absolute;bottom:0;left:0;right:0;height:2px;background-color:",";transform:scaleY(1);transform-origin:center bottom;transition:background-color 60ms,transform 100ms;}&:not(:disabled){&:hover:after{background-color:",";}&:active:after{transform:scaleY(0.5);}}&:disabled{color:",";}"],function(a){var b=a.size;return"sm"===b||"small"===b?"1.5rem":"2rem"},getThemeColor("text-1"),function(a){var b=a.isActive;return b?getThemeColor("background-selected-1"):"transparent"},getThemeColor("background-hover-1"),getThemeColor("background-disabled-1")); | ||
//# sourceMappingURL=button.js.map |
@@ -7,2 +7,3 @@ import React, { ReactNode } from 'react'; | ||
hasAnimation?: boolean; | ||
useGlobalTheme?: boolean; | ||
children: ReactNode; | ||
@@ -9,0 +10,0 @@ } |
@@ -27,3 +27,3 @@ function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function _iterableToArrayLimit(a,b){var c=null==a?null:"undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(null!=c){var d,e,f,g,h=[],i=!0,j=!1;try{if(f=(c=c.call(a)).next,0===b){if(Object(c)!==c)return;i=!1}else for(;!(i=(d=f.call(c)).done)&&(h.push(d.value),h.length!==b);i=!0);}catch(a){j=!0,e=a}finally{try{if(!i&&null!=c.return&&(g=c.return(),Object(g)!==g))return}finally{if(j)throw e}}return h}}function _arrayWithHoles(a){if(Array.isArray(a))return a}import React,{forwardRef,useEffect,useRef,useState}from"react";import{createPortal,flushSync}from"react-dom";import{useCurrentTheme}from"../../hooks/useCurrentTheme";import{Backdrop}from"../backdrop/backdrop";import{exitDuration,OverlayContainer,OverlayDOMPosition}from"./overlayStyles";/** | ||
* @since 2.1.0 | ||
*/export var Overlay=forwardRef(function(a,b){var c=a.onClose,d=a.startFade,e=void 0!==d&&d,f=a.hasBackdrop,g=a.hasAnimation,h=void 0===g||g,i=a.children,j=useState(!1),k=_slicedToArray(j,2),l=k[0],m=k[1],n=useRef(!1),o=useRef(null),p=useCurrentTheme(o),q=p.themeClass,r=function(){m(!0),setTimeout(function(){n.current||flushSync(function(){return c()})},h?exitDuration:0)};return useEffect(function(){e&&r()},[e]),useEffect(function(){n.current=!1;var a=function(a){return"Escape"===a.code&&r()};return window.addEventListener("keydown",a),function(){window.removeEventListener("keydown",a),n.current=!0}},[]),React.createElement(OverlayDOMPosition,{ref:o},createPortal(React.createElement(React.Fragment,null,(void 0===f||f)&&React.createElement(Backdrop,{onClick:function onClick(){return r()},"data-testid":"backdrop"}),React.createElement(OverlayContainer,{ref:b,fadeOut:l,noAnimation:!h,className:q},i)),document.body))});Overlay.displayName="OverlayComponent"; | ||
*/export var Overlay=forwardRef(function(a,b){var c=a.onClose,d=a.startFade,e=void 0!==d&&d,f=a.hasBackdrop,g=a.hasAnimation,h=void 0===g||g,i=a.useGlobalTheme,j=a.children,k=useState(!1),l=_slicedToArray(k,2),m=l[0],n=l[1],o=useRef(!1),p=useRef(null),q=useCurrentTheme(p),r=q.themeClass,s=function(){n(!0),setTimeout(function(){o.current||flushSync(function(){return c()})},h?exitDuration:0)};return useEffect(function(){e&&s()},[e]),useEffect(function(){o.current=!1;var a=function(a){return"Escape"===a.code&&s()};return window.addEventListener("keydown",a),function(){window.removeEventListener("keydown",a),o.current=!0}},[]),React.createElement(OverlayDOMPosition,{ref:p},createPortal(React.createElement(React.Fragment,null,(void 0===f||f)&&React.createElement(Backdrop,{onClick:function onClick(){return s()},"data-testid":"backdrop"}),React.createElement(OverlayContainer,{ref:b,fadeOut:m,noAnimation:!h,className:i?"":r},j)),document.body))});Overlay.displayName="OverlayComponent"; | ||
//# sourceMappingURL=overlay.js.map |
{ | ||
"name": "@elvia/elvis-toolbox", | ||
"version": "9.3.1", | ||
"version": "9.4.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
246506
1524