@elvia/elvis-toolbox
Advanced tools
Comparing version 9.3.0 to 9.3.1
@@ -5,2 +5,12 @@ { | ||
{ | ||
"date": "27.06.23", | ||
"version": "9.3.1", | ||
"changelog": [ | ||
{ | ||
"type": "bug_fix", | ||
"changes": ["Fixed the typography and disabled color on primary/secondary buttons."] | ||
} | ||
] | ||
}, | ||
{ | ||
"date": "26.06.23", | ||
@@ -155,3 +165,3 @@ "version": "9.3.0", | ||
"type": "bug_fix", | ||
"changes": ["Overlay not closing properly on localhost in React"] | ||
"changes": ["Overlay not closing properly on localhost in React."] | ||
} | ||
@@ -158,0 +168,0 @@ ] |
@@ -1,2 +0,2 @@ | ||
import{getThemeColor,getThemeColorContrast}from"@elvia/elvis-colors";import{getTypographyCss}from"@elvia/elvis-typography";import styled,{css}from"styled-components";var getTypography=function(a){return"small"===a||"sm"===a?css(["",";line-height:1.15;"],getTypographyCss("text-sm")):"medium"===a||"md"===a?css(["",";line-height:1.25;"],getTypographyCss("text-md")):css(["",";font-size:1.125rem;line-height:1;"],getTypographyCss("text-lg"))},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:",";background-color:",";}"],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("border-disabled-1"),getThemeColor("background-disabled-1"));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:",";&: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")); | ||
//# sourceMappingURL=button.js.map |
@@ -25,3 +25,3 @@ export type FormFieldSizes = 'small' | 'medium'; | ||
export declare const FormFieldContainer: import("styled-components").StyledComponent<"label", any, FormFieldContainerProps, never>; | ||
interface LabelProps { | ||
export interface LabelProps { | ||
hasOptionalText?: boolean; | ||
@@ -32,3 +32,2 @@ } | ||
export declare const FormFieldInput: import("styled-components").StyledComponent<"input", any, {}, never>; | ||
export {}; | ||
//# sourceMappingURL=formFieldStyles.d.ts.map |
@@ -19,4 +19,4 @@ 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{useEffect,useState}from"react";import{isSsr}from"../isSsr";var defaultOptions={offset:8,alignWidths:!0,verticalPosition:"bottom",horizontalPosition:"center"};/** | ||
* @since 2.1.0 | ||
*/export var useConnectedOverlay=function(a,b,c){var d=Object.assign(Object.assign({},defaultOptions),c),e=useState(d.verticalPosition),f=_slicedToArray(e,2),g=f[0],h=f[1],i=useState(d.horizontalPosition),j=_slicedToArray(i,2),k=j[0],l=j[1],m=useState(!1),n=_slicedToArray(m,2),o=n[0],p=n[1],q=function(){return isSsr()?null:navigator.userAgent.toLowerCase().includes("android")&&window.visualViewport?{height:window.visualViewport.height,width:window.visualViewport.width,innerWidth:window.visualViewport.width,scrollX:window.scrollX,scrollY:window.scrollY}:{height:window.innerHeight,width:window.innerWidth,innerWidth:document.body.clientWidth,scrollX:window.scrollX,scrollY:window.scrollY}},r=function(a,b,c,e){var f=function(a){return a<=8+e.scrollY?Math.min(8+e.scrollY,b.top+e.scrollY):a+c.height>=e.height+e.scrollY-8?Math.max(e.height+e.scrollY-c.height-8,b.bottom+e.scrollY-c.height):a},g=function(b){a.top="".concat(b,"px"),a.bottom="unset"},i=function(b){a.top="unset",a.bottom="".concat(b,"px")},j=function(){i(e.height-b.top+d.offset-e.scrollY),h("top")},k=function(){g(b.bottom+d.offset+e.scrollY),h("bottom")},l=function(){var a=b.top-d.offset-c.height,f=e.height-(b.bottom+d.offset+c.height);f<a?j():k()};"top"===d.verticalPosition?0<b.top-d.offset-c.height?j():l():"top-inside"===d.verticalPosition?function alignTopInside(){var a=b.top+e.scrollY;g(f(a)),h("top-inside")}():"center"===d.verticalPosition?function alignCenter(){var a=b.top+(b.height-c.height)/2+e.scrollY;g(f(a)),h("center")}():"bottom-inside"===d.verticalPosition?function alignBottomInside(){var a=b.bottom-c.height+e.scrollY;g(f(a)),h("bottom")}():b.bottom+d.offset+c.height<e.height?k():l()},s=function(a,b,c,e){var f=function(a){return a<=8+e.scrollX?Math.min(8+e.scrollX,b.left+e.scrollX):a+c>=e.innerWidth+e.scrollX-8?Math.max(e.innerWidth+e.scrollX-c-8,b.right+e.scrollX-c):a},g=function(b){a.left="".concat(b,"px"),a.right="unset"},h=function(b){a.left="unset",a.right="".concat(b,"px")},i=function(){h(e.innerWidth-b.left+d.offset-e.scrollX),l("left")},j=function(){g(b.right+d.offset+e.scrollX),l("right")},k=function(){var a=b.left-d.offset-c,f=e.width-(b.right+d.offset+c);f<a?i():j()};"left"===d.horizontalPosition?0<b.left-d.offset-c?i():k():"left-inside"===d.horizontalPosition?function alignLeftInside(){var a=b.left+e.scrollX;g(f(a)),l("left-inside")}():"center"===d.horizontalPosition?function alignCenter(){var a=b.left+(b.width-c)/2+e.scrollX;g(f(a)),l("center")}():"right-inside"===d.horizontalPosition?function alignRightInside(){var a=b.right-c+e.scrollX;g(f(a)),l("right-inside")}():b.right+d.offset+c<e.width?j():k()},t=function(){var c,e,f,g=null===(c=b.current)||void 0===c?void 0:c.style,h=null===(e=b.current)||void 0===e?void 0:e.getBoundingClientRect(),i=null===(f=a.current)||void 0===f?void 0:f.getBoundingClientRect(),j=q();g&&h&&i&&j&&(d.alignWidths&&(g.width="".concat(i.width,"px")),r(g,i,h,j),s(g,i,d.alignWidths?i.width:h.width,j))};return useEffect(function(){if(o){// This method needs to be inside the useEffect for the removeEventListener to work | ||
*/export var useConnectedOverlay=function(a,b,c){var d=Object.assign(Object.assign({},defaultOptions),c),e=useState(d.verticalPosition),f=_slicedToArray(e,2),g=f[0],h=f[1],i=useState(d.horizontalPosition),j=_slicedToArray(i,2),k=j[0],l=j[1],m=useState(!1),n=_slicedToArray(m,2),o=n[0],p=n[1],q=function(){return isSsr()?null:navigator.userAgent.toLowerCase().includes("android")&&window.visualViewport?{height:window.visualViewport.height,width:window.visualViewport.width,innerWidth:window.visualViewport.width,scrollX:window.scrollX,scrollY:window.scrollY}:{height:window.innerHeight,width:window.innerWidth,innerWidth:document.body.clientWidth,scrollX:window.scrollX,scrollY:window.scrollY}},r=function(a,b,c,e){var f=function(a){return a<=8+e.scrollY?Math.min(8+e.scrollY,b.top+e.scrollY):a+c.height>=e.height+e.scrollY-8?Math.max(e.height+e.scrollY-c.height-8,b.bottom+e.scrollY-c.height):a},g=function(b){a.top="".concat(b,"px"),a.bottom="unset"},i=function(b){a.top="unset",a.bottom="".concat(b,"px")},j=function(){i(e.height-b.top+d.offset-e.scrollY),h("top")},k=function(){g(b.bottom+d.offset+e.scrollY),h("bottom")},l=function(){var a=b.top-d.offset-c.height,f=e.height-(b.bottom+d.offset+c.height);f<a?j():k()};"top"===d.verticalPosition?0<b.top-d.offset-c.height?j():l():"top-inside"===d.verticalPosition?function alignTopInside(){var a=b.top+e.scrollY;g(f(a)),h("top-inside")}():"center"===d.verticalPosition?function alignCenter(){var a=b.top+(b.height-c.height)/2+e.scrollY;g(f(a)),h("center")}():"bottom-inside"===d.verticalPosition?function alignBottomInside(){var a=b.bottom-c.height+e.scrollY;g(f(a)),h("bottom")}():b.bottom+d.offset+c.height<e.height?k():l()},s=function(a,b,c,e){var f=function(a){return a<=8+e.scrollX?Math.min(8+e.scrollX,b.left+e.scrollX):a+c>=e.innerWidth+e.scrollX-8?Math.max(e.innerWidth+e.scrollX-c-8,b.right+e.scrollX-c):a},g=function(b){a.left="".concat(b,"px"),a.right="unset"},h=function(b){a.left="unset",a.right="".concat(b,"px")},i=function(){h(e.innerWidth-b.left+d.offset-e.scrollX),l("left")},j=function(){g(b.right+d.offset+e.scrollX),l("right")},k=function(){var a=b.left-d.offset-c,f=e.width-(b.right+d.offset+c);f<a?i():j()};"left"===d.horizontalPosition?0<b.left-d.offset-c?i():k():"left-inside"===d.horizontalPosition?function alignLeftInside(){var a=b.left+e.scrollX;g(f(a)),l("left-inside")}():"center"===d.horizontalPosition?function alignCenter(){var a=b.left+(b.width-c)/2+e.scrollX;g(f(a)),l("center")}():"right-inside"===d.horizontalPosition?function alignRightInside(){var a=b.right-c+e.scrollX;g(f(a)),l("right-inside")}():b.right+d.offset+c<e.width?j():k()},t=function(){var c,e,f,g=null===(c=b.current)||void 0===c?void 0:c.style,h=null===(e=b.current)||void 0===e?void 0:e.getBoundingClientRect(),i=null===(f=a.current)||void 0===f?void 0:f.getBoundingClientRect(),j=q();g&&h&&i&&j&&(d.alignWidths&&(g.width="".concat(i.width,"px")),r(g,i,h,j),s(g,i,d.alignWidths?i.width:h.width,j))};/** Get screen dimensions based on device */return useEffect(function(){if(o){// This method needs to be inside the useEffect for the removeEventListener to work | ||
var a=function(){o&&t()};if(a(),!isSsr())return window.addEventListener("resize",a),window.addEventListener("scroll",a),function(){window.removeEventListener("resize",a),window.removeEventListener("scroll",a)}}},[o]),{isShowing:o,setIsShowing:p,verticalPosition:g,horizontalPosition:k,updatePreferredPosition:function updatePreferredPosition(a,b){a&&(d.verticalPosition=a),b&&(d.horizontalPosition=b),t()}}}; | ||
//# sourceMappingURL=useConnectedOverlay.js.map |
@@ -13,3 +13,4 @@ import{useEffect,useRef}from"react";/** | ||
* @since 7.1.0 | ||
*/export var useRovingFocus=function(a){var b,c=useRef(null),d=null!==(b=null===a||void 0===a?void 0:a.elementRef)&&void 0!==b?b:c,e=Object.assign({dir:"both",observableAttributes:["aria-hidden","style","class"]},a),f=useRef(),g=useRef(0),h=useRef(),i=useRef(!1),j=function(a){return a?Array.from(a.querySelectorAll("a[href], button, textarea, input, select, details, [tabindex]:not([tabindex=\u201C-1\u201D]")).filter(function(a){return!a.hasAttribute("disabled")&&"true"!==a.getAttribute("aria-hidden")}):[]},k=function(){if("both"===e.dir)return["ArrowUp","ArrowLeft"];return"horizontal"===e.dir?["ArrowLeft"]:["ArrowUp"]},l=function(){if("both"===e.dir)return["ArrowDown","ArrowRight"];return"horizontal"===e.dir?["ArrowRight"]:["ArrowDown"]},m=function(a,b,c){return k().includes(a.code)?(a.preventDefault(),0===c?b-1:c-1):l().includes(a.code)?(a.preventDefault(),c===b-1?0:c+1):"Home"===a.code?(a.preventDefault(),0):"End"===a.code?(a.preventDefault(),b-1):c},n=function(a,b){return a.findIndex(function(a){return!!b&&(a.isEqualNode(b)||a.textContent&&a.textContent===b.textContent)})},o=function(a){var b=n(a,f.current);-1===b&&(-1===g.current?b=0:b=Math.min(a.length-1,g.current)),g.current=b,f.current=a[b],i.current&&f.current.focus()},p=function(a){f.current?a.forEach(function(a){return a.tabIndex=a===f.current?0:-1}):a.forEach(function(a,b){return a.tabIndex=0===b?0:-1})};useEffect(function(){var a=d.current;if(a){var b=function(){var b;null===(b=h.current)||void 0===b?void 0:b.call(h);var c=j(a);f.current&&o(c),p(c),h.current=q(a,c)},c=new MutationObserver(b);return c.observe(a,{subtree:!0,childList:!0,attributes:!0,attributeFilter:e.observableAttributes}),b(),function(){return c.disconnect()}}},[d.current]);var q=function(a,b){var c=function(a){var c;-1!==a&&a!==g.current&&(console.log("B"),b[g.current].tabIndex=-1,b[a].tabIndex=0,null===(c=b[a])||void 0===c?void 0:c.focus(),f.current=b[a],g.current=a)},d=function(a){var d,h=g.current,i=m(a,b.length,g.current);c(i),f.current&&h!==i&&(null===(d=e.onKeyDown)||void 0===d?void 0:d.call(e,f.current,g.current))},h=function(a){console.log("items: ",b,"target: ",a.target);var d=b.findIndex(function(b){return b===a.target});console.log("Index after click",d),c(d)},j=function(a){i.current=-1!==n(b,a.target)};return document.addEventListener("focus",j,!0),a.addEventListener("keydown",d),a.addEventListener("click",h),function(){document.removeEventListener("focus",j,!0),a.removeEventListener("keydown",d),a.removeEventListener("click",h)}};return{ref:d}}; | ||
*/export var useRovingFocus=function(a){var b,c=useRef(null),d=null!==(b=null===a||void 0===a?void 0:a.elementRef)&&void 0!==b?b:c,e=Object.assign({dir:"both",observableAttributes:["aria-hidden","style","class"]},a),f=useRef(),g=useRef(0),h=useRef(),i=useRef(!1),j=function(a){return a?Array.from(a.querySelectorAll("a[href], button, textarea, input, select, details, [tabindex]:not([tabindex=\u201C-1\u201D]")).filter(function(a){return!a.hasAttribute("disabled")&&"true"!==a.getAttribute("aria-hidden")}):[]},k=function(){if("both"===e.dir)return["ArrowUp","ArrowLeft"];return"horizontal"===e.dir?["ArrowLeft"]:["ArrowUp"]},l=function(){if("both"===e.dir)return["ArrowDown","ArrowRight"];return"horizontal"===e.dir?["ArrowRight"]:["ArrowDown"]},m=function(a,b,c){return k().includes(a.code)?(a.preventDefault(),0===c?b-1:c-1):l().includes(a.code)?(a.preventDefault(),c===b-1?0:c+1):"Home"===a.code?(a.preventDefault(),0):"End"===a.code?(a.preventDefault(),b-1):c},n=function(a,b){return a.findIndex(function(a){return!!b&&(a.isEqualNode(b)||a.textContent&&a.textContent===b.textContent)})},o=function(a){var b=n(a,f.current);-1===b&&(-1===g.current?b=0:b=Math.min(a.length-1,g.current)),g.current=b,f.current=a[b],i.current&&f.current.focus()},p=function(a){f.current?a.forEach(function(a){return a.tabIndex=a===f.current?0:-1}):a.forEach(function(a,b){return a.tabIndex=0===b?0:-1})};// Restore focused item and focused index after the list has mutated | ||
useEffect(function(){var a=d.current;if(a){var b=function(){var b;null===(b=h.current)||void 0===b?void 0:b.call(h);var c=j(a);f.current&&o(c),p(c),h.current=q(a,c)},c=new MutationObserver(b);return c.observe(a,{subtree:!0,childList:!0,attributes:!0,attributeFilter:e.observableAttributes}),b(),function(){return c.disconnect()}}},[d.current]);var q=function(a,b){var c=function(a){var c;-1!==a&&a!==g.current&&(b[g.current].tabIndex=-1,b[a].tabIndex=0,null===(c=b[a])||void 0===c?void 0:c.focus(),f.current=b[a],g.current=a)},d=function(a){var d,h=g.current,i=m(a,b.length,g.current);c(i),f.current&&h!==i&&(null===(d=e.onKeyDown)||void 0===d?void 0:d.call(e,f.current,g.current))},h=function(a){var d=b.findIndex(function(b){return b===a.target});c(d)},j=function(a){i.current=-1!==n(b,a.target)};return document.addEventListener("focus",j,!0),a.addEventListener("keydown",d),a.addEventListener("click",h),function(){document.removeEventListener("focus",j,!0),a.removeEventListener("keydown",d),a.removeEventListener("click",h)}};return{ref:d}}; | ||
//# sourceMappingURL=useRovingFocus.js.map |
@@ -9,3 +9,3 @@ export { isSsr } from './isSsr'; | ||
export { IconButton } from './components/button/iconButton'; | ||
export { FormFieldSizes, FormFieldInput, FormFieldContainer, FormFieldContainerProps, FormFieldInputContainer, FormFieldInputSuffixText, FormFieldLabel, } from './components/form-field/formFieldStyles'; | ||
export { FormFieldSizes, FormFieldInput, FormFieldContainer, FormFieldContainerProps, FormFieldInputContainer, FormFieldInputSuffixText, FormFieldLabel, LabelProps, } from './components/form-field/formFieldStyles'; | ||
export { FormFieldError, FormFieldErrorContainer } from './components/form-field/errorStyles'; | ||
@@ -12,0 +12,0 @@ export { Overlay } from './components/overlay/overlay'; |
@@ -5,5 +5,5 @@ /** | ||
* @param destroy Destroys the listener that was started on the element when set to true. | ||
*/export var outlineListener=function(a,b){if(a){var c=function(b){"Tab"===b.key&&a.classList.contains("ewc-no-outline")&&(a.classList.remove("ewc-no-outline"),a.addEventListener("mousedown",d,!1))},d=function(){a.classList.contains("ewc-no-outline")||(a.classList.add("ewc-no-outline"),a.removeEventListener("mousedown",d,!1))};// If destroy is true -> Remove all listeners and return | ||
return b?(a.removeEventListener("keydown",c),void a.removeEventListener("mousedown",d,!1)):void(// Start listening for keyboard and mousedown on element to add or remove outline | ||
a.addEventListener("keydown",c),a.addEventListener("mousedown",d,!1))}}; | ||
*/export var outlineListener=function(a,b){if(a){// If destroy is true -> Remove all listeners and return | ||
// Start listening for keyboard and mousedown on element to add or remove outline | ||
var c=function(b){"Tab"===b.key&&a.classList.contains("ewc-no-outline")&&(a.classList.remove("ewc-no-outline"),a.addEventListener("mousedown",d,!1))},d=function(){a.classList.contains("ewc-no-outline")||(a.classList.add("ewc-no-outline"),a.removeEventListener("mousedown",d,!1))};return b?(a.removeEventListener("keydown",c),void a.removeEventListener("mousedown",d,!1)):void(a.addEventListener("keydown",c),a.addEventListener("mousedown",d,!1))}}; | ||
//# sourceMappingURL=outlineListener.js.map |
@@ -26,4 +26,4 @@ import{isSsr}from"./isSsr";var consoleWarnDeprecatedProp=function(a,b){var c=a.propName,d=a.componentName,e=a.deprecatedDetails;if(void 0!==e){var f=e.isCallbackFunction?"callback function":b?"slot":"prop",g=e.version?" from version ".concat(e.version):"",h=e.newProp?"\nSee prop '".concat(e.newProp,"' for replacement."):"",i=e.isDirectReplacement?"\nThis prop can be directly replaced by the new prop name.":"",j=e.explanation?"\n".concat(e.explanation):"";console.warn("Deprecation warning in ".concat(d,":\nThe ").concat(f," '").concat(c,"' is deprecated").concat(g,".").concat(h).concat(i).concat(j))}},isDeprecatedProp=function(a,b){return b.some(function(b){return b.name===a})},getPropInfo=function(a,b,c){var d=b.map(function(a){return a.name}).indexOf(a),e="elvia"+c.name.replace(/([A-Z])/g,"-$1").toLowerCase(),f=b[d].deprecatedDetails;return{propName:a,componentName:e,deprecatedDetails:f}};/** | ||
*/export var warnDeprecatedProps=function(a,b){var c,d;// If not on localhost, don't console log deprecation warnings. | ||
if(!(isSsr()||-1===window.location.href.indexOf("localhost"))){var e=a.attributes.filter(function(a){return a.deprecatedDetails}),f=[];// List of deprecated callbacks that have already been console warned. Used to avoid duplicated warnings. | ||
for(var g in b){isDeprecatedProp(g,e)&&consoleWarnDeprecatedProp(getPropInfo(g,e,a),!1);var h=b.webcomponent;if(h){// Check for deprecated slots on webcomponent. | ||
if(!(isSsr()||-1===window.location.href.indexOf("localhost"))){// List of deprecated callbacks that have already been console warned. Used to avoid duplicated warnings. | ||
var e=a.attributes.filter(function(a){return a.deprecatedDetails}),f=[];for(var g in b){isDeprecatedProp(g,e)&&consoleWarnDeprecatedProp(getPropInfo(g,e,a),!1);var h=b.webcomponent;if(h){// Check for deprecated slots on webcomponent. | ||
if("_slots"in h)for(var i in h._slots)isDeprecatedProp(i,e)&&consoleWarnDeprecatedProp(getPropInfo(i,e,a),!0);// Check for deprecated callback function on webcomponent Angular. | ||
@@ -30,0 +30,0 @@ for(var j in h)if(/^__zone_symbol__.*false/.test(j)){var k=null===(d=null===(c=h[j])||void 0===c?void 0:c[0])||void 0===d?void 0:d.eventName;k&&isDeprecatedProp(k,e)&&!f.includes(k)&&(consoleWarnDeprecatedProp(getPropInfo(k,e,a),!1),f.push(k))}// Check for deprecated callback function on webcomponent Vue. |
{ | ||
"name": "@elvia/elvis-toolbox", | ||
"version": "9.3.0", | ||
"version": "9.3.1", | ||
"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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
245650
1506