@elvia/elvis-accordion
Advanced tools
Comparing version 2.9.4 to 2.10.0
@@ -5,2 +5,12 @@ { | ||
{ | ||
"date": "14.06.23", | ||
"version": "2.10.0", | ||
"changelog": [ | ||
{ | ||
"type": "new_feature", | ||
"changes": ["The <code>openLabel</code> and <code>closeLabel</code> props now also accept slots."] | ||
} | ||
] | ||
}, | ||
{ | ||
"date": "07.06.23", | ||
@@ -7,0 +17,0 @@ "version": "2.9.4", |
@@ -5,3 +5,3 @@ /* | ||
*/ | ||
var _excluded=["content","isOpen","isHovering","isFullWidth","openLabel","closeLabel","openDetailText","closeDetailText","openAriaLabel","closeAriaLabel","isStartAligned","hasBoldLabel","labelPosition","size","type","spacingAboveContent","spacingBelowContent","overflowHeight","typography","onOpen","onClose","className","inlineStyle","webcomponent"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_extends.apply(this,arguments)}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}function _objectWithoutProperties(a,b){if(null==a)return{};var c,d,e=_objectWithoutPropertiesLoose(a,b);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(d=0;d<f.length;d++)c=f[d],0<=b.indexOf(c)||Object.prototype.propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}return e}function _objectWithoutPropertiesLoose(a,b){if(null==a)return{};var c,d,e={},f=Object.keys(a);for(d=0;d<f.length;d++)c=f[d],0<=b.indexOf(c)||(e[c]=a[c]);return e}import React,{useCallback,useEffect,useMemo,useRef,useState}from"react";import{outlineListener,useSlot,IconWrapper}from"@elvia/elvis-toolbox";import{AccordionArea,AccordionButtonArea,AccordionButton,AccordionLabel,AccordionLabelText,AccordionDetailText,AccordionContent}from"./styledComponents";import expandCircleColor from"@elvia/elvis-assets-icons/dist/icons/expandCircleColor";import expandCircleFilledColor from"@elvia/elvis-assets-icons/dist/icons/expandCircleFilledColor";var Accordion=function(a){var b=a.content,c=a.isOpen,d=void 0!==c&&c,e=a.isHovering,f=void 0!==e&&e,g=a.isFullWidth,h=void 0!==g&&g,i=a.openLabel,j=a.closeLabel,k=a.openDetailText,l=a.closeDetailText,m=a.openAriaLabel,n=a.closeAriaLabel,o=a.isStartAligned,p=void 0!==o&&o,q=a.hasBoldLabel,r=a.labelPosition,s=void 0===r?"center":r,t=a.size,u=void 0===t?"medium":t,v=a.type,w=void 0===v?"normal":v,x=a.spacingAboveContent,y=void 0===x?"8px":x,z=a.spacingBelowContent,A=void 0===z?"16px":z,B=a.overflowHeight,C=a.typography,D=a.onOpen,E=a.onClose,F=a.className,G=a.inlineStyle,H=a.webcomponent,I=_objectWithoutProperties(a,_excluded),J=useState(d),K=_slicedToArray(J,2),L=K[0],M=K[1],N=useState(!1),O=_slicedToArray(N,2),P=O[0],Q=O[1],R=useState(!1),S=_slicedToArray(R,2),T=S[0],U=S[1],V=useState(0),W=_slicedToArray(V,2),X=W[0],Y=W[1],Z=useRef(null);useEffect(function(){return Z&&Z.current&&outlineListener(Z.current),function(){Z&&Z.current&&outlineListener(Z.current,!0)}},[]);var $=useSlot("content",H,{callback:useCallback(function(a){return U(a)},[]),useEffectDependencies:useMemo(function(){return[w]},[w])}),_=$.ref;useEffect(function(){M(d)},[d]),useEffect(function(){"single"===w?U(!1):U(!0)},[w]),useEffect(function(){b&&U(!0)},[b]),useEffect(function(){var a=_.current;if(a){var b=function(){var b=2*Math.ceil(a.scrollHeight/2);Y(function(a){return 2===Math.abs(a-b)?a:b})},c=new MutationObserver(b),d=new ResizeObserver(b);return c.observe(a,{childList:!0,subtree:!0}),d.observe(a),b(),function(){c.disconnect(),d.disconnect()}}},[_,_.current]);var aa=function(){"single"===w||(L?(null===E||void 0===E?void 0:E(),null===H||void 0===H?void 0:H.triggerEvent("onClose")):(null===D||void 0===D?void 0:D(),null===H||void 0===H?void 0:H.triggerEvent("onOpen")),M(function(a){return!a}))};return/*#__PURE__*/React.createElement(AccordionArea,_extends({className:F,style:G,"data-testid":"accordion-area",ref:Z},I),"overflow"===w?/*#__PURE__*/React.createElement(AccordionContent,{type:w,spacingAboveContent:y,spacingBelowContent:A,isOpenState:L,overflowHeight:B,contentHeight:X,hasContent:T,ref:_,"data-testid":"accordion-content-overflow"},b):null,/*#__PURE__*/React.createElement(AccordionButtonArea,{labelPosition:s,type:w},/*#__PURE__*/React.createElement(AccordionButton,{"aria-expanded":L,size:u,currType:w,isFullWidth:h,isOpenState:L,hasBoldLabel:!(void 0!==q)||q,openDetailText:k,typography:C,onClick:function onClick(){return aa()},onMouseEnter:function onMouseEnter(){return Q(!0)},onMouseLeave:function onMouseLeave(){return Q(!1)},"data-testid":"accordion-button-label","aria-label":function decideButtonAriaLabel(){if(L){var a;return null!==(a=null!==n&&void 0!==n?n:j)&&void 0!==a?a:"Lukk"}var b;return null!==(b=null!==m&&void 0!==m?m:i)&&void 0!==b?b:"\xC5pne"}()},function shouldShowLeftIcon(){return p&&!h}()&&/*#__PURE__*/React.createElement(IconWrapper,{icon:P||f?expandCircleFilledColor:expandCircleColor,size:"small"===u?"xs":"sm"}),/*#__PURE__*/React.createElement(AccordionLabel,{hasLabel:"single"!==w,openLabel:null!==i&&void 0!==i?i:"",isStartAligned:p,isFullWidth:h},/*#__PURE__*/React.createElement(AccordionLabelText,null,L?j:i),/*#__PURE__*/React.createElement(AccordionDetailText,{size:u,openDetailText:k},L?l:k)),function shouldShowRightIcon(){return p&&h||!p}()&&/*#__PURE__*/React.createElement(IconWrapper,{icon:P||f?expandCircleFilledColor:expandCircleColor,size:"small"===u?"xs":"sm"}))),"normal"===w?/*#__PURE__*/React.createElement(AccordionContent,{type:w,spacingAboveContent:y,spacingBelowContent:A,isOpenState:L,hasContent:T,contentHeight:X,overflowHeight:B,"data-testid":"accordion-content-normal",ref:_},b):null)};export default Accordion; | ||
var _excluded=["content","isOpen","isHovering","isFullWidth","openLabel","closeLabel","openDetailText","closeDetailText","openAriaLabel","closeAriaLabel","isStartAligned","hasBoldLabel","labelPosition","size","type","spacingAboveContent","spacingBelowContent","overflowHeight","typography","onOpen","onClose","className","inlineStyle","webcomponent"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_extends.apply(this,arguments)}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}function _objectWithoutProperties(a,b){if(null==a)return{};var c,d,e=_objectWithoutPropertiesLoose(a,b);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(d=0;d<f.length;d++)c=f[d],0<=b.indexOf(c)||Object.prototype.propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}return e}function _objectWithoutPropertiesLoose(a,b){if(null==a)return{};var c,d,e={},f=Object.keys(a);for(d=0;d<f.length;d++)c=f[d],0<=b.indexOf(c)||(e[c]=a[c]);return e}import React,{useCallback,useEffect,useMemo,useRef,useState}from"react";import{outlineListener,useSlot,IconWrapper}from"@elvia/elvis-toolbox";import{AccordionArea,AccordionButtonArea,AccordionButton,AccordionLabel,AccordionLabelText,AccordionDetailText,AccordionContent}from"./styledComponents";import expandCircleColor from"@elvia/elvis-assets-icons/dist/icons/expandCircleColor";import expandCircleFilledColor from"@elvia/elvis-assets-icons/dist/icons/expandCircleFilledColor";var Accordion=function(a){var b=a.content,c=a.isOpen,d=void 0!==c&&c,e=a.isHovering,f=void 0!==e&&e,g=a.isFullWidth,h=void 0!==g&&g,i=a.openLabel,j=a.closeLabel,k=a.openDetailText,l=a.closeDetailText,m=a.openAriaLabel,n=a.closeAriaLabel,o=a.isStartAligned,p=void 0!==o&&o,q=a.hasBoldLabel,r=a.labelPosition,s=void 0===r?"center":r,t=a.size,u=void 0===t?"medium":t,v=a.type,w=void 0===v?"normal":v,x=a.spacingAboveContent,y=void 0===x?"8px":x,z=a.spacingBelowContent,A=void 0===z?"16px":z,B=a.overflowHeight,C=a.typography,D=a.onOpen,E=a.onClose,F=a.className,G=a.inlineStyle,H=a.webcomponent,I=_objectWithoutProperties(a,_excluded),J=useState(d),K=_slicedToArray(J,2),L=K[0],M=K[1],N=useState(!1),O=_slicedToArray(N,2),P=O[0],Q=O[1],R=useState(!1),S=_slicedToArray(R,2),T=S[0],U=S[1],V=useState(0),W=_slicedToArray(V,2),X=W[0],Y=W[1],Z=useRef(null);useEffect(function(){return Z&&Z.current&&outlineListener(Z.current),function(){Z&&Z.current&&outlineListener(Z.current,!0)}},[]);var $=useSlot("openLabel",H,{useEffectDependencies:useMemo(function(){return[L]},[L])}),_=$.ref,aa=useSlot("closeLabel",H,{useEffectDependencies:useMemo(function(){return[L]},[L])}),ba=aa.ref,ca=useSlot("content",H,{callback:useCallback(function(a){return U(a)},[]),useEffectDependencies:useMemo(function(){return[w]},[w])}),da=ca.ref;useEffect(function(){M(d)},[d]),useEffect(function(){"single"===w?U(!1):U(!0)},[w]),useEffect(function(){b&&U(!0)},[b]),useEffect(function(){var a=da.current;if(a){var b=function(){var b=2*Math.ceil(a.scrollHeight/2);Y(function(a){return 2===Math.abs(a-b)?a:b})},c=new MutationObserver(b),d=new ResizeObserver(b);return c.observe(a,{childList:!0,subtree:!0}),d.observe(a),b(),function(){c.disconnect(),d.disconnect()}}},[da,da.current]);var ea=function(){"single"===w||(L?(null===E||void 0===E?void 0:E(),null===H||void 0===H?void 0:H.triggerEvent("onClose")):(null===D||void 0===D?void 0:D(),null===H||void 0===H?void 0:H.triggerEvent("onOpen")),M(function(a){return!a}))};return/*#__PURE__*/React.createElement(AccordionArea,_extends({className:F,style:G,"data-testid":"accordion-area",ref:Z},I),"overflow"===w?/*#__PURE__*/React.createElement(AccordionContent,{type:w,spacingAboveContent:y,spacingBelowContent:A,isOpenState:L,overflowHeight:B,contentHeight:X,hasContent:T,ref:da,"data-testid":"accordion-content-overflow"},b):null,/*#__PURE__*/React.createElement(AccordionButtonArea,{labelPosition:s,type:w},/*#__PURE__*/React.createElement(AccordionButton,{"aria-expanded":L,size:u,currType:w,isFullWidth:h,isOpenState:L,hasBoldLabel:!(void 0!==q)||q,openDetailText:k,typography:C,onClick:function onClick(){return ea()},onMouseEnter:function onMouseEnter(){return Q(!0)},onMouseLeave:function onMouseLeave(){return Q(!1)},"data-testid":"accordion-button-label","aria-label":function decideButtonAriaLabel(){if(L){var a;return null!==(a=null!==n&&void 0!==n?n:j)&&void 0!==a?a:"Lukk"}var b;return null!==(b=null!==m&&void 0!==m?m:i)&&void 0!==b?b:"\xC5pne"}()},function shouldShowLeftIcon(){return p&&!h}()&&/*#__PURE__*/React.createElement(IconWrapper,{icon:P||f?expandCircleFilledColor:expandCircleColor,size:"small"===u?"xs":"sm"}),/*#__PURE__*/React.createElement(AccordionLabel,{hasLabel:"single"!==w,isStartAligned:p,isFullWidth:h},L?/*#__PURE__*/React.createElement(AccordionLabelText,{ref:ba},j):/*#__PURE__*/React.createElement(AccordionLabelText,{ref:_},i),/*#__PURE__*/React.createElement(AccordionDetailText,{size:u,openDetailText:k},L?l:k)),function shouldShowRightIcon(){return p&&h||!p}()&&/*#__PURE__*/React.createElement(IconWrapper,{icon:P||f?expandCircleFilledColor:expandCircleColor,size:"small"===u?"xs":"sm"}))),"normal"===w?/*#__PURE__*/React.createElement(AccordionContent,{type:w,spacingAboveContent:y,spacingBelowContent:A,isOpenState:L,hasContent:T,contentHeight:X,overflowHeight:B,"data-testid":"accordion-content-normal",ref:da},b):null)};export default Accordion; | ||
//# sourceMappingURL=elvia-accordion.js.map |
@@ -21,3 +21,2 @@ import { AccordionLabelPosition, AccordionSize, AccordionSpacingContent, AccordionType } from './elvia-accordion.types'; | ||
hasLabel: boolean; | ||
openLabel: string; | ||
isStartAligned: boolean | undefined; | ||
@@ -24,0 +23,0 @@ isFullWidth: boolean | undefined; |
@@ -5,3 +5,3 @@ /* | ||
*/ | ||
import styled,{css}from"styled-components";import{getThemeColor}from"@elvia/elvis-colors";import{getTypographyCss}from"@elvia/elvis-typography";var bezierCurve="cubic-bezier(0.71, 0, 0.31, 1)";export var AccordionArea=styled.div.withConfig({displayName:"styledComponents__AccordionArea",componentId:"sc-nszrkq-0"})(["display:flex;flex-direction:column;width:100%;"]);var decideLabelPosition=function(a){return"center"===a?"center":"right"===a?"flex-end":"left"===a?"start":"flex-start"};export var AccordionButtonArea=styled.div.withConfig({displayName:"styledComponents__AccordionButtonArea",componentId:"sc-nszrkq-1"})(["display:flex;justify-content:",";flex-direction:row;width:100%;"],function(a){var b=a.labelPosition;return decideLabelPosition(b)});var decideButtonFontSize=function(a){switch(a){case"small":return"14";case"large":return"20";case"medium":default:return"16";}};export var AccordionButton=styled.button.withConfig({displayName:"styledComponents__AccordionButton",componentId:"sc-nszrkq-2"})(["border:none;background:transparent;display:flex;padding:0;font-family:'Red Hat Display',Verdana,sans-serif;font-weight:",";font-size:",";line-height:",";"," text-align:left;cursor:pointer;color:",";width:",";justify-content:",";align-items:center;svg{transform:rotate(0deg);transition:transform 0.2s ease-out;",";}"],function(a){var b=a.hasBoldLabel,c=a.openDetailText;return b||c!==void 0?"500":"400"},function(a){var b=a.size;return"".concat(decideButtonFontSize(b),"px")},function(a){var b=a.size;return"small"===b?"16px":"24px"},function(a){var b=a.typography;return b&&getTypographyCss(b)},getThemeColor("text-1"),function(a){var b=a.isFullWidth,c=a.currType;return b&&"normal"===c?"100%":"auto"},function(a){var b=a.isFullWidth,c=a.currType;return b&&"normal"===c?"space-between":"inherit"},function(a){var b=a.isOpenState;return b&&css(["transform:rotate(180deg);"])});export var AccordionLabel=styled.div.withConfig({displayName:"styledComponents__AccordionLabel",componentId:"sc-nszrkq-3"})(["display:",";flex-direction:row;align-items:baseline;margin-left:",";margin-right:",";"],function(a){var b=a.openLabel,c=a.hasLabel;return b&&c?"flex":"none"},function(a){var b=a.isStartAligned,c=a.isFullWidth;return b&&!c?"8px":"0"},function(a){var b=a.isStartAligned,c=a.isFullWidth;return b&&!c?"0":"8px"});export var AccordionLabelText=styled.div.withConfig({displayName:"styledComponents__AccordionLabelText",componentId:"sc-nszrkq-4"})(["display:flex;"]);var decideDetailTextSize=function(a){return"small"===a?getTypographyCss("text-micro"):"large"===a?getTypographyCss("text-md"):getTypographyCss("text-sm")};export var AccordionDetailText=styled.div.withConfig({displayName:"styledComponents__AccordionDetailText",componentId:"sc-nszrkq-5"})(["",";display:flex;text-align:left;color:",";margin-left:",";"],function(a){var b=a.size;return decideDetailTextSize(b)},getThemeColor("text-1"),function(a){var b=a.openDetailText;return b===void 0?"0;":"8px;"});var decideContentMarginTop=function(a,b,c){return"overflow"!==a&&b?c:"0"},decideContentMaxHeight=function(a,b,c,d){return a?"".concat(c,"px"):"overflow"===b?d?"".concat(d,"px"):"calc(2em * 1.3)":"0"},decideContentOpacity=function(a,b){return a||"overflow"===b?"1":"0"},decideContentTransitionDuration=function(a){return"".concat(Math.max(.2,Math.min(a/1000,.7)),"s")};export var AccordionContent=styled.div.withConfig({displayName:"styledComponents__AccordionContent",componentId:"sc-nszrkq-6"})(["display:",";visibility:",";background:transparent;font-size:16px;line-height:inherit;margin-top:",";margin-bottom:",";pointer-events:",";max-height:",";width:100%;opacity:",";overflow-y:hidden;transition:all "," ",";transition-property:opacity,max-height,visibility;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}position:relative;"],function(a){var b=a.hasContent;return b?"block":"none"},function(a){var b=a.type,c=a.isOpenState;return"normal"!==b||c?"visible":"hidden"},function(a){var b=a.type,c=a.hasContent,d=a.spacingAboveContent;return decideContentMarginTop(b,c,d)},function(a){var b=a.type,c=a.spacingBelowContent;return"overflow"===b?c:0},function(a){var b=a.isOpenState;return b?"auto":"none"},function(a){var b=a.isOpenState,c=a.type,d=a.contentHeight,e=a.overflowHeight;return decideContentMaxHeight(b,c,d,e)},function(a){var b=a.isOpenState,c=a.type;return decideContentOpacity(b,c)},function(a){var b=a.contentHeight;return decideContentTransitionDuration(b)},"cubic-bezier(0.71, 0, 0.31, 1)"); | ||
import styled,{css}from"styled-components";import{getThemeColor}from"@elvia/elvis-colors";import{getTypographyCss}from"@elvia/elvis-typography";var bezierCurve="cubic-bezier(0.71, 0, 0.31, 1)";export var AccordionArea=styled.div.withConfig({displayName:"styledComponents__AccordionArea",componentId:"sc-nszrkq-0"})(["display:flex;flex-direction:column;width:100%;"]);var decideLabelPosition=function(a){return"center"===a?"center":"right"===a?"flex-end":"left"===a?"start":"flex-start"};export var AccordionButtonArea=styled.div.withConfig({displayName:"styledComponents__AccordionButtonArea",componentId:"sc-nszrkq-1"})(["display:flex;justify-content:",";flex-direction:row;width:100%;"],function(a){var b=a.labelPosition;return decideLabelPosition(b)});var decideButtonFontSize=function(a){switch(a){case"small":return"14";case"large":return"20";case"medium":default:return"16";}};export var AccordionButton=styled.button.withConfig({displayName:"styledComponents__AccordionButton",componentId:"sc-nszrkq-2"})(["border:none;background:transparent;display:flex;padding:0;font-family:'Red Hat Display',Verdana,sans-serif;font-weight:",";font-size:",";line-height:",";"," text-align:left;cursor:pointer;color:",";width:",";justify-content:",";align-items:center;svg{transform:rotate(0deg);transition:transform 0.2s ease-out;",";}"],function(a){var b=a.hasBoldLabel,c=a.openDetailText;return b||c!==void 0?"500":"400"},function(a){var b=a.size;return"".concat(decideButtonFontSize(b),"px")},function(a){var b=a.size;return"small"===b?"16px":"24px"},function(a){var b=a.typography;return b&&getTypographyCss(b)},getThemeColor("text-1"),function(a){var b=a.isFullWidth,c=a.currType;return b&&"normal"===c?"100%":"auto"},function(a){var b=a.isFullWidth,c=a.currType;return b&&"normal"===c?"space-between":"inherit"},function(a){var b=a.isOpenState;return b&&css(["transform:rotate(180deg);"])});export var AccordionLabel=styled.div.withConfig({displayName:"styledComponents__AccordionLabel",componentId:"sc-nszrkq-3"})(["display:",";flex-direction:row;align-items:baseline;margin-left:",";margin-right:",";"],function(a){var b=a.hasLabel;return b?"flex":"none"},function(a){var b=a.isStartAligned,c=a.isFullWidth;return b&&!c?"8px":"0"},function(a){var b=a.isStartAligned,c=a.isFullWidth;return b&&!c?"0":"8px"});export var AccordionLabelText=styled.div.withConfig({displayName:"styledComponents__AccordionLabelText",componentId:"sc-nszrkq-4"})(["display:flex;"]);var decideDetailTextSize=function(a){return"small"===a?getTypographyCss("text-micro"):"large"===a?getTypographyCss("text-md"):getTypographyCss("text-sm")};export var AccordionDetailText=styled.div.withConfig({displayName:"styledComponents__AccordionDetailText",componentId:"sc-nszrkq-5"})(["",";display:flex;text-align:left;color:",";margin-left:",";"],function(a){var b=a.size;return decideDetailTextSize(b)},getThemeColor("text-1"),function(a){var b=a.openDetailText;return b===void 0?"0;":"8px;"});var decideContentMarginTop=function(a,b,c){return"overflow"!==a&&b?c:"0"},decideContentMaxHeight=function(a,b,c,d){return a?"".concat(c,"px"):"overflow"===b?d?"".concat(d,"px"):"calc(2em * 1.3)":"0"},decideContentOpacity=function(a,b){return a||"overflow"===b?"1":"0"},decideContentTransitionDuration=function(a){return"".concat(Math.max(.2,Math.min(a/1000,.7)),"s")};export var AccordionContent=styled.div.withConfig({displayName:"styledComponents__AccordionContent",componentId:"sc-nszrkq-6"})(["display:",";visibility:",";background:transparent;font-size:16px;line-height:inherit;margin-top:",";margin-bottom:",";pointer-events:",";max-height:",";width:100%;opacity:",";overflow-y:hidden;transition:all "," ",";transition-property:opacity,max-height,visibility;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}position:relative;"],function(a){var b=a.hasContent;return b?"block":"none"},function(a){var b=a.type,c=a.isOpenState;return"normal"!==b||c?"visible":"hidden"},function(a){var b=a.type,c=a.hasContent,d=a.spacingAboveContent;return decideContentMarginTop(b,c,d)},function(a){var b=a.type,c=a.spacingBelowContent;return"overflow"===b?c:0},function(a){var b=a.isOpenState;return b?"auto":"none"},function(a){var b=a.isOpenState,c=a.type,d=a.contentHeight,e=a.overflowHeight;return decideContentMaxHeight(b,c,d,e)},function(a){var b=a.isOpenState,c=a.type;return decideContentOpacity(b,c)},function(a){var b=a.contentHeight;return decideContentTransitionDuration(b)},"cubic-bezier(0.71, 0, 0.31, 1)"); | ||
//# sourceMappingURL=styledComponents.js.map |
{ | ||
"name": "@elvia/elvis-accordion", | ||
"version": "2.9.4", | ||
"version": "2.10.0", | ||
"main": "web_component.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
67850
1080