@elvia/elvis-accordion
Advanced tools
Comparing version 3.2.6 to 3.2.7
@@ -6,2 +6,12 @@ { | ||
{ | ||
"date": "31.05.24", | ||
"version": "3.2.7", | ||
"changelog": [ | ||
{ | ||
"type": "bug_fix", | ||
"changes": ["Fixed a bug where an icon in the accordion open/close label would rotate."] | ||
} | ||
] | ||
}, | ||
{ | ||
"date": "30.05.24", | ||
@@ -8,0 +18,0 @@ "version": "3.2.6", |
// components/elvis-accordion/src/react/elvia-accordion.tsx | ||
import expandCircleColor from "@elvia/elvis-assets-icons/dist/icons/expandCircleColor"; | ||
import expandCircleFilledColor from "@elvia/elvis-assets-icons/dist/icons/expandCircleFilledColor"; | ||
import { IconWrapper, outlineListener, useSlot } from "@elvia/elvis-toolbox"; | ||
import { outlineListener, useSlot } from "@elvia/elvis-toolbox"; | ||
import React, { useEffect, useMemo, useRef, useState } from "react"; | ||
@@ -10,2 +10,3 @@ | ||
import { getThemeColor } from "@elvia/elvis-colors"; | ||
import { IconWrapper } from "@elvia/elvis-toolbox"; | ||
import { getTypographyCss } from "@elvia/elvis-typography"; | ||
@@ -17,3 +18,3 @@ import { css } from "@emotion/react"; | ||
var AccordionArea = /* @__PURE__ */ _styled("div", { | ||
target: "e1wflppn7", | ||
target: "e1wflppn8", | ||
label: "AccordionArea" | ||
@@ -45,3 +46,3 @@ })("display:flex;flex-direction:", ({ | ||
var AccordionButtonArea = /* @__PURE__ */ _styled("div", { | ||
target: "e1wflppn6", | ||
target: "e1wflppn7", | ||
label: "AccordionButtonArea" | ||
@@ -51,2 +52,6 @@ })("display:flex;justify-content:", ({ | ||
}) => decideLabelPosition(labelPosition), ";flex-direction:row;width:100%;"); | ||
var StyledIconWrapper = /* @__PURE__ */ _styled(IconWrapper, { | ||
target: "e1wflppn6", | ||
label: "StyledIconWrapper" | ||
})(); | ||
var _ref = false ? { | ||
@@ -71,3 +76,3 @@ name: "17euf7j-AccordionButton", | ||
reverseLayout | ||
}) => reverseLayout ? "row-reverse" : "row", ";gap:8px;align-items:center;user-select:text;svg{transform:rotate(0deg);transition:transform 0.2s ease-out;", ({ | ||
}) => reverseLayout ? "row-reverse" : "row", ";gap:8px;align-items:center;user-select:text;", StyledIconWrapper, "{transform:rotate(0deg);transition:transform 0.2s ease-out;", ({ | ||
isOpenState | ||
@@ -264,3 +269,3 @@ }) => isOpenState && _ref, ";}"); | ||
}; | ||
return /* @__PURE__ */ React.createElement(AccordionArea, { className, style: inlineStyle, "data-testid": "accordion-area", isOverflow: type === "overflow", overflowSpacing: spacingBelowContent, ref: accordionRef, ...rest }, /* @__PURE__ */ React.createElement(AccordionButtonArea, { labelPosition }, /* @__PURE__ */ React.createElement(AccordionButton, { "aria-expanded": isOpenState, accordionType: type, isFullWidth, isOpenState, onClick: () => handleOnClick(), onMouseEnter: () => setIsHoveringButton(true), onMouseLeave: () => setIsHoveringButton(false), "aria-label": decideButtonAriaLabel(), reverseLayout: isStartAligned && !isFullWidth }, /* @__PURE__ */ React.createElement(AccordionLabel, { hasLabel: type !== "single", isFullWidth }, isOpenState ? /* @__PURE__ */ React.createElement(AccordionLabelText, { size, typography, isFullWidth, hasDetailText: !!openDetailText || !!closeDetailText, ref: closeLabelRef }, closeLabel) : /* @__PURE__ */ React.createElement(AccordionLabelText, { size, typography, isFullWidth, hasDetailText: !!openDetailText || !!closeDetailText, ref: openLabelRef }, openLabel), /* @__PURE__ */ React.createElement(AccordionDetailText, { size, openDetailText }, !isOpenState ? openDetailText : closeDetailText)), /* @__PURE__ */ React.createElement(IconWrapper, { icon: isHoveringButton || isHovering ? expandCircleFilledColor : expandCircleColor, size: getIconSize(size) }))), type !== "single" && /* @__PURE__ */ React.createElement(AccordionHeightAnimator, { contentHeight: getSlotHeight(), isOpen: isOpenState, isOverflow: type === "overflow", onTransitionEnd, style: { | ||
return /* @__PURE__ */ React.createElement(AccordionArea, { className, style: inlineStyle, "data-testid": "accordion-area", isOverflow: type === "overflow", overflowSpacing: spacingBelowContent, ref: accordionRef, ...rest }, /* @__PURE__ */ React.createElement(AccordionButtonArea, { labelPosition }, /* @__PURE__ */ React.createElement(AccordionButton, { "aria-expanded": isOpenState, accordionType: type, isFullWidth, isOpenState, onClick: () => handleOnClick(), onMouseEnter: () => setIsHoveringButton(true), onMouseLeave: () => setIsHoveringButton(false), "aria-label": decideButtonAriaLabel(), reverseLayout: isStartAligned && !isFullWidth }, /* @__PURE__ */ React.createElement(AccordionLabel, { hasLabel: type !== "single", isFullWidth }, isOpenState ? /* @__PURE__ */ React.createElement(AccordionLabelText, { size, typography, isFullWidth, hasDetailText: !!openDetailText || !!closeDetailText, ref: closeLabelRef }, closeLabel) : /* @__PURE__ */ React.createElement(AccordionLabelText, { size, typography, isFullWidth, hasDetailText: !!openDetailText || !!closeDetailText, ref: openLabelRef }, openLabel), /* @__PURE__ */ React.createElement(AccordionDetailText, { size, openDetailText }, !isOpenState ? openDetailText : closeDetailText)), /* @__PURE__ */ React.createElement(StyledIconWrapper, { icon: isHoveringButton || isHovering ? expandCircleFilledColor : expandCircleColor, size: getIconSize(size) }))), type !== "single" && /* @__PURE__ */ React.createElement(AccordionHeightAnimator, { contentHeight: getSlotHeight(), isOpen: isOpenState, isOverflow: type === "overflow", onTransitionEnd, style: { | ||
visibility, | ||
@@ -267,0 +272,0 @@ height: contentHeight |
@@ -24,2 +24,7 @@ /// <reference types="react" /> | ||
} | ||
export declare const StyledIconWrapper: import("@emotion/styled").StyledComponent<import("@elvia/elvis-toolbox").IconWrapperProps<{ | ||
getIcon: (color?: (import("@elvia/elvis-colors").ColorLabel | (string & {})) | undefined) => string; | ||
}> & { | ||
theme?: import("@emotion/react").Theme | undefined; | ||
}, {}, {}>; | ||
export declare const AccordionButton: import("@emotion/styled").StyledComponent<{ | ||
@@ -26,0 +31,0 @@ theme?: import("@emotion/react").Theme | undefined; |
{ | ||
"name": "@elvia/elvis-accordion", | ||
"version": "3.2.6", | ||
"version": "3.2.7", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "homepage": "https://design.elvia.io/components/accordion", |
43197
1335