@salutejs/plasma-new-hope 0.88.0-canary.1223.9505247307.0 → 0.88.0-canary.1223.9514251012.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -36,15 +36,6 @@ var AccordionItem = function AccordionItem(_ref) {
36
36
  onChange(key, !value);
37
37
  }
38
38
  };
39
- var onKeyPress = function onKeyPress(event) {
40
- if (disabled) {
41
- return;
42
- }
43
- event.persist();
44
- if (event.keyCode === 13 || event.keyCode === 32) {
45
- handleOpen();
46
- }
47
- };
48
39
  var leftContentRef = React.useRef(null);
49
40
  React.useEffect(function () {
50
41
  var _leftContentRef$curre, _leftContentRef$curre2;
@@ -83,10 +74,9 @@ var AccordionItem = function AccordionItem(_ref) {
83
74
  tabIndex: 0,
84
75
  onClick: handleOpen,
85
76
  className: disabledClass,
86
- "aria-expanded": "true",
77
+ "aria-expanded": value,
87
78
  "aria-controls": "accordion-item-section".concat(key),
88
- id: "accordion-item-".concat(key),
89
- onKeyDown: onKeyPress
79
+ id: "accordion-item-".concat(key)
90
80
  }, /*#__PURE__*/React.createElement(AccordionItem_styles.StyledAccordionHeaderLeft, null, leftContent && /*#__PURE__*/React.createElement(AccordionItem_styles.StyledAccordionContentLeft, {
91
81
  ref: leftContentRef,
92
82
  className: leftContentRotate
@@ -94,6 +84,7 @@ var AccordionItem = function AccordionItem(_ref) {
94
84
  className: rightContentRotate
95
85
  }, rightContent && rightContent)), /*#__PURE__*/React.createElement(AccordionItem_styles.StyledAccordionBodyAnimate, {
96
86
  "aria-labelledby": "accordion-item-".concat(key),
87
+ "aria-hidden": !value,
97
88
  id: "accordion-item-section".concat(key),
98
89
  className: openedBodyClass,
99
90
  style: {
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionItem.js","sources":["../../../../../src/components/Accordion/ui/AccordionItem/AccordionItem.tsx"],"sourcesContent":["import React, { HTMLAttributes, useState, KeyboardEvent, useRef, useEffect } from 'react';\n\nimport { convertRoundnessMatrix } from '../../../../utils/roundness';\nimport { classes, tokens } from '../../Accordion.tokens';\n\nimport {\n StyledAccordionItem,\n StyledAccordionHeader,\n StyledAccordionBody,\n StyledAccordionTitle,\n StyledAccordionContentLeft,\n StyledAccordionHeaderLeft,\n StyledAccordionContentRight,\n StyledArrow,\n StyledMinus,\n StyledPlus,\n StyledAccordionBodyAnimate,\n} from './AccordionItem.styles';\nimport type { AccordionItemProps } from './AccordionItem.types';\n\nexport const AccordionItem: React.FC<HTMLAttributes<HTMLDivElement> & AccordionItemProps> = ({\n value,\n contentRight,\n contentLeft,\n title,\n pin = 'square-square',\n children,\n type = 'sign',\n index,\n eventKey,\n disabled,\n onChange,\n}) => {\n const key = eventKey ?? index;\n\n const [leftPadding, setLeftPadding] = useState<string | number | null>();\n\n const handleOpen = () => {\n if (disabled) {\n return;\n }\n if (onChange) {\n onChange(key, !value);\n }\n };\n\n const onKeyPress = (event: KeyboardEvent<HTMLDivElement>) => {\n if (disabled) {\n return;\n }\n event.persist();\n if (event.keyCode === 13 || event.keyCode === 32) {\n handleOpen();\n }\n };\n\n const leftContentRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const leftContentWidth = leftContentRef?.current?.offsetWidth ?? 0;\n const leftPaddingBody = leftContentWidth ? `calc(${leftContentWidth}px + var(${tokens.accordionItemGap}))` : 0;\n setLeftPadding(leftPaddingBody);\n }, [value, type, leftContentRef, setLeftPadding]);\n\n const openedBodyClass = value ? classes.accordionItemShowBody : undefined;\n\n const StyledAnimationPLus = () => (\n <StyledPlus>\n <StyledMinus size=\"xs\" color=\"inhert\" />\n <StyledMinus\n size=\"xs\"\n color=\"inhert\"\n className={openedBodyClass ?? classes.accordionPlusAnimationElement}\n />\n </StyledPlus>\n );\n\n const accordionBorderRadius = convertRoundnessMatrix(pin, `var(${tokens.accordionItemBorderRadius})`, '1.5rem');\n const disabledClass = disabled ? classes.accordionDisabled : '';\n\n const leftContent = contentLeft ?? (type === 'arrow' ? <StyledArrow size=\"xs\" color=\"inhert\" /> : undefined);\n const leftContentRotate = type === 'arrow' && value ? classes.accordionItemShowBody : undefined;\n\n const rightContent = contentRight ?? (type === 'sign' ? <StyledAnimationPLus /> : undefined);\n const rightContentRotate = type === 'sign' && value ? classes.accordionItemShowBody : undefined;\n\n return (\n <StyledAccordionItem\n className={classes.accordionItem}\n key={key}\n style={{ borderRadius: accordionBorderRadius }}\n >\n <StyledAccordionHeader\n role=\"tab\"\n tabIndex={0}\n onClick={handleOpen}\n className={disabledClass}\n aria-expanded=\"true\"\n aria-controls={`accordion-item-section${key}`}\n id={`accordion-item-${key}`}\n onKeyDown={onKeyPress}\n >\n <StyledAccordionHeaderLeft>\n {leftContent && (\n <StyledAccordionContentLeft ref={leftContentRef} className={leftContentRotate}>\n {leftContent}\n </StyledAccordionContentLeft>\n )}\n <StyledAccordionTitle>{title}</StyledAccordionTitle>\n </StyledAccordionHeaderLeft>\n\n <StyledAccordionContentRight className={rightContentRotate}>\n {rightContent && rightContent}\n </StyledAccordionContentRight>\n </StyledAccordionHeader>\n <StyledAccordionBodyAnimate\n aria-labelledby={`accordion-item-${key}`}\n id={`accordion-item-section${key}`}\n className={openedBodyClass}\n style={{ paddingLeft: `${leftPadding}` }}\n >\n <StyledAccordionBody>{children}</StyledAccordionBody>\n </StyledAccordionBodyAnimate>\n </StyledAccordionItem>\n );\n};\n"],"names":["AccordionItem","_ref","value","contentRight","contentLeft","title","_ref$pin","pin","children","_ref$type","type","index","eventKey","disabled","onChange","key","_useState","useState","_useState2","_slicedToArray","leftPadding","setLeftPadding","handleOpen","onKeyPress","event","persist","keyCode","leftContentRef","useRef","useEffect","_leftContentRef$curre","_leftContentRef$curre2","leftContentWidth","current","offsetWidth","leftPaddingBody","concat","tokens","accordionItemGap","openedBodyClass","classes","accordionItemShowBody","undefined","StyledAnimationPLus","React","createElement","StyledPlus","_StyledMinus","StyledMinus","size","color","className","accordionPlusAnimationElement","accordionBorderRadius","convertRoundnessMatrix","accordionItemBorderRadius","disabledClass","accordionDisabled","leftContent","_StyledArrow","StyledArrow","leftContentRotate","rightContent","rightContentRotate","StyledAccordionItem","accordionItem","style","borderRadius","StyledAccordionHeader","role","tabIndex","onClick","id","onKeyDown","StyledAccordionHeaderLeft","StyledAccordionContentLeft","ref","StyledAccordionTitle","StyledAccordionContentRight","StyledAccordionBodyAnimate","paddingLeft","StyledAccordionBody"],"mappings":";;;;;;;;;;;IAoBaA,aAA4E,GAAG,SAA/EA,aAA4EA,CAAAC,IAAA,EAYnF;AAAA,EAAA,IAXFC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,YAAY,GAAAF,IAAA,CAAZE,YAAY;IACZC,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXC,KAAK,GAAAJ,IAAA,CAALI,KAAK;IAAAC,QAAA,GAAAL,IAAA,CACLM,GAAG;AAAHA,IAAAA,GAAG,GAAAD,QAAA,KAAG,KAAA,CAAA,GAAA,eAAe,GAAAA,QAAA;IACrBE,QAAQ,GAAAP,IAAA,CAARO,QAAQ;IAAAC,SAAA,GAAAR,IAAA,CACRS,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,SAAA;IACbE,KAAK,GAAAV,IAAA,CAALU,KAAK;IACLC,QAAQ,GAAAX,IAAA,CAARW,QAAQ;IACRC,QAAQ,GAAAZ,IAAA,CAARY,QAAQ;IACRC,QAAQ,GAAAb,IAAA,CAARa,QAAQ,CAAA;EAER,IAAMC,GAAG,GAAGH,QAAQ,KAAA,IAAA,IAARA,QAAQ,KAARA,KAAAA,CAAAA,GAAAA,QAAQ,GAAID,KAAK,CAAA;AAE7B,EAAA,IAAAK,SAAA,GAAsCC,cAAQ,EAA0B;IAAAC,UAAA,GAAAC,uCAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAAjEI,IAAAA,WAAW,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,cAAc,GAAAH,UAAA,CAAA,CAAA,CAAA,CAAA;AAElC,EAAA,IAAMI,UAAU,GAAG,SAAbA,UA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,yCAAoB,EAAExE,IAAAA,EAAAA,KAA4B,CAC5B,CAAC,eAE5BuC,KAAA,CAAAC,aAAA,CAACiC,gDAA2B,EAAA;AAAC3B,IAAAA,SAAS,EAAEY,kBAAAA;GACnCD,EAAAA,YAAY,IAAIA,YACQ,CACV,CAAC,eACxBlB,KAAA,CAAAC,aAAA,CAACkC,+CAA0B,EAAA;IACvB,iBAAA3C,EAAAA,iBAAAA,CAAAA,MAAA,CAAmCrB,GAAG,CAAG;AACzCyD,IAAAA,EAAE,EAAApC,wBAAAA,CAAAA,MAAA,CAA2BrB,GAAG,CAAG;AACnCoC,IAAAA,SAAS,EAAEZ,eAAgB;AAC3B2B,IAAAA,KAAK,EAAE;MAAEc,WAAW,EAAA,EAAA,CAAA5C,MAAA,CAAKhB,WAAW,CAAA;AAAG,KAAA;GAEvCwB,eAAAA,KAAA,CAAAC,aAAA,CAACoC,wCAAmB,EAAEzE,IAAAA,EAAAA,QAA8B,CAC5B,CACX,CAAC,CAAA;AAE9B;;;;"}
1
+ {"version":3,"file":"AccordionItem.js","sources":["../../../../../src/components/Accordion/ui/AccordionItem/AccordionItem.tsx"],"sourcesContent":["import React, { HTMLAttributes, useState, useRef, useEffect } from 'react';\n\nimport { convertRoundnessMatrix } from '../../../../utils/roundness';\nimport { classes, tokens } from '../../Accordion.tokens';\n\nimport {\n StyledAccordionItem,\n StyledAccordionHeader,\n StyledAccordionBody,\n StyledAccordionTitle,\n StyledAccordionContentLeft,\n StyledAccordionHeaderLeft,\n StyledAccordionContentRight,\n StyledArrow,\n StyledMinus,\n StyledPlus,\n StyledAccordionBodyAnimate,\n} from './AccordionItem.styles';\nimport type { AccordionItemProps } from './AccordionItem.types';\n\nexport const AccordionItem: React.FC<HTMLAttributes<HTMLDivElement> & AccordionItemProps> = ({\n value,\n contentRight,\n contentLeft,\n title,\n pin = 'square-square',\n children,\n type = 'sign',\n index,\n eventKey,\n disabled,\n onChange,\n}) => {\n const key = eventKey ?? index;\n\n const [leftPadding, setLeftPadding] = useState<string | number | null>();\n\n const handleOpen = () => {\n if (disabled) {\n return;\n }\n if (onChange) {\n onChange(key, !value);\n }\n };\n\n const leftContentRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const leftContentWidth = leftContentRef?.current?.offsetWidth ?? 0;\n const leftPaddingBody = leftContentWidth ? `calc(${leftContentWidth}px + var(${tokens.accordionItemGap}))` : 0;\n setLeftPadding(leftPaddingBody);\n }, [value, type, leftContentRef, setLeftPadding]);\n\n const openedBodyClass = value ? classes.accordionItemShowBody : undefined;\n\n const StyledAnimationPLus = () => (\n <StyledPlus>\n <StyledMinus size=\"xs\" color=\"inhert\" />\n <StyledMinus\n size=\"xs\"\n color=\"inhert\"\n className={openedBodyClass ?? classes.accordionPlusAnimationElement}\n />\n </StyledPlus>\n );\n\n const accordionBorderRadius = convertRoundnessMatrix(pin, `var(${tokens.accordionItemBorderRadius})`, '1.5rem');\n const disabledClass = disabled ? classes.accordionDisabled : '';\n\n const leftContent = contentLeft ?? (type === 'arrow' ? <StyledArrow size=\"xs\" color=\"inhert\" /> : undefined);\n const leftContentRotate = type === 'arrow' && value ? classes.accordionItemShowBody : undefined;\n\n const rightContent = contentRight ?? (type === 'sign' ? <StyledAnimationPLus /> : undefined);\n const rightContentRotate = type === 'sign' && value ? classes.accordionItemShowBody : undefined;\n\n return (\n <StyledAccordionItem\n className={classes.accordionItem}\n key={key}\n style={{ borderRadius: accordionBorderRadius }}\n >\n <StyledAccordionHeader\n role=\"tab\"\n tabIndex={0}\n onClick={handleOpen}\n className={disabledClass}\n aria-expanded={value}\n aria-controls={`accordion-item-section${key}`}\n id={`accordion-item-${key}`}\n >\n <StyledAccordionHeaderLeft>\n {leftContent && (\n <StyledAccordionContentLeft ref={leftContentRef} className={leftContentRotate}>\n {leftContent}\n </StyledAccordionContentLeft>\n )}\n <StyledAccordionTitle>{title}</StyledAccordionTitle>\n </StyledAccordionHeaderLeft>\n\n <StyledAccordionContentRight className={rightContentRotate}>\n {rightContent && rightContent}\n </StyledAccordionContentRight>\n </StyledAccordionHeader>\n <StyledAccordionBodyAnimate\n aria-labelledby={`accordion-item-${key}`}\n aria-hidden={!value}\n id={`accordion-item-section${key}`}\n className={openedBodyClass}\n style={{ paddingLeft: `${leftPadding}` }}\n >\n <StyledAccordionBody>{children}</StyledAccordionBody>\n </StyledAccordionBodyAnimate>\n </StyledAccordionItem>\n );\n};\n"],"names":["AccordionItem","_ref","value","contentRight","contentLeft","title","_ref$pin","pin","children","_ref$type","type","index","eventKey","disabled","onChange","key","_useState","useState","_useState2","_slicedToArray","leftPadding","setLeftPadding","handleOpen","leftContentRef","useRef","useEffect","_leftContentRef$curre","_leftContentRef$curre2","leftContentWidth","current","offsetWidth","leftPaddingBody","concat","tokens","accordionItemGap","openedBodyClass","classes","accordionItemShowBody","undefined","StyledAnimationPLus","React","createElement","StyledPlus","_StyledMinus","StyledMinus","size","color","className","accordionPlusAnimationElement","accordionBorderRadius","convertRoundnessMatrix","accordionItemBorderRadius","disabledClass","accordionDisabled","leftContent","_StyledArrow","StyledArrow","leftContentRotate","rightContent","rightContentRotate","StyledAccordionItem","accordionItem","style","borderRadius","StyledAccordionHeader","role","tabIndex","onClick","id","StyledAccordionHeaderLeft","StyledAccordionContentLeft","ref","StyledAccordionTitle","StyledAccordionContentRight","StyledAccordionBodyAnimate","paddingLeft","StyledAccordionBody"],"mappings":";;;;;;;;;;;IAoBaA,aAA4E,GAAG,SAA/EA,aAA4EA,CAAAC,IAAA,EAYnF;AAAA,EAAA,IAXFC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,YAAY,GAAAF,IAAA,CAAZE,YAAY;IACZC,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXC,KAAK,GAAAJ,IAAA,CAALI,KAAK;IAAAC,QAAA,GAAAL,IAAA,CACLM,GAAG;AAAHA,IAAAA,GAAG,GAAAD,QAAA,KAAG,KAAA,CAAA,GAAA,eAAe,GAAAA,QAAA;IACrBE,QAAQ,GAAAP,I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,EAAA,iBAAA,CAAApC,MAAA,CAAoBjB,GAAG,CAAA;AAAG,GAAA,eAE5ByB,KAAA,CAAAC,aAAA,CAAC4B,8CAAyB,EAAA,IAAA,EACrBf,WAAW,iBACRd,KAAA,CAAAC,aAAA,CAAC6B,+CAA0B,EAAA;AAACC,IAAAA,GAAG,EAAEhD,cAAe;AAACwB,IAAAA,SAAS,EAAEU,iBAAAA;AAAkB,GAAA,EACzEH,WACuB,CAC/B,eACDd,KAAA,CAAAC,aAAA,CAAC+B,yCAAoB,EAAEnE,IAAAA,EAAAA,KAA4B,CAC5B,CAAC,eAE5BmC,KAAA,CAAAC,aAAA,CAACgC,gDAA2B,EAAA;AAAC1B,IAAAA,SAAS,EAAEY,kBAAAA;GACnCD,EAAAA,YAAY,IAAIA,YACQ,CACV,CAAC,eACxBlB,KAAA,CAAAC,aAAA,CAACiC,+CAA0B,EAAA;IACvB,iBAAA1C,EAAAA,iBAAAA,CAAAA,MAAA,CAAmCjB,GAAG,CAAG;AACzC,IAAA,aAAA,EAAa,CAACb,KAAM;AACpBkE,IAAAA,EAAE,EAAApC,wBAAAA,CAAAA,MAAA,CAA2BjB,GAAG,CAAG;AACnCgC,IAAAA,SAAS,EAAEZ,eAAgB;AAC3B2B,IAAAA,KAAK,EAAE;MAAEa,WAAW,EAAA,EAAA,CAAA3C,MAAA,CAAKZ,WAAW,CAAA;AAAG,KAAA;GAEvCoB,eAAAA,KAAA,CAAAC,aAAA,CAACmC,wCAAmB,EAAEpE,IAAAA,EAAAA,QAA8B,CAC5B,CACX,CAAC,CAAA;AAE9B;;;;"}
@@ -13,7 +13,7 @@ var addFocus = require('../../../../mixins/addFocus.js');
13
13
  var StyledAccordionItem = /*#__PURE__*/styled.div.withConfig({
14
14
  componentId: "plasma-new-hope__sc-iot32d-0"
15
15
  })(["background:var(", ");border-bottom:var(", ");&:last-child{border-bottom:none;}"], Accordion_tokens.tokens.accordionItemBackground, Accordion_tokens.tokens.accordionItemBorderBottom);
16
- var StyledAccordionHeader = /*#__PURE__*/styled.div.withConfig({
16
+ var StyledAccordionHeader = /*#__PURE__*/styled.button.withConfig({
17
17
  componentId: "plasma-new-hope__sc-iot32d-1"
18
18
  })(["width:100%;border:none;padding:var(", ");display:flex;gap:var(", ");justify-content:space-between;align-items:center;background:none;box-sizing:border-box;cursor:pointer;&.", "{opacity:0.4;cursor:not-allowed;}&:focus{outline:none;}", ""], Accordion_tokens.tokens.accordionItemPadding, Accordion_tokens.tokens.accordionItemGap, Accordion_tokens.classes.accordionDisabled, /*#__PURE__*/addFocus.addFocus({
19
19
  outlineOffset: '0.125rem',
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionItem.styles.js","sources":["../../../../../src/components/Accordion/ui/AccordionItem/AccordionItem.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport { IconChevronDownFill, IconMinus } from '../../../_Icon';\nimport { classes, tokens } from '../../Accordion.tokens';\nimport { addFocus } from '../../../../mixins';\n\nexport const StyledAccordionItem = styled.div`\n background: var(${tokens.accordionItemBackground});\n border-bottom: var(${tokens.accordionItemBorderBottom});\n\n &:last-child {\n border-bottom: none;\n }\n`;\n\nexport const StyledAccordionHeader = styled.div`\n width: 100%;\n border: none;\n padding: var(${tokens.accordionItemPadding});\n display: flex;\n gap: var(${tokens.accordionItemGap});\n justify-content: space-between;\n align-items: center;\n background: none;\n box-sizing: border-box;\n cursor: pointer;\n\n &.${classes.accordionDisabled} {\n opacity: 0.4;\n cursor: not-allowed;\n }\n\n &:focus {\n outline: none;\n }\n\n ${addFocus({\n outlineOffset: '0.125rem',\n outlineSize: '0.125rem',\n outlineRadius: '0',\n outlineColor: `var(${tokens.accordionItemFocus})`,\n })}\n`;\n\nexport const StyledAccordionHeaderLeft = styled.div`\n display: flex;\n gap: var(${tokens.accordionItemGap});\n justify-content: space-between;\n align-items: center;\n`;\n\nexport const StyledAccordionContentRight = styled.div`\n transition: 0.2s;\n transform: rotate(90deg);\n\n &.${classes.accordionItemShowBody} {\n transition: 0.2s;\n transform: rotate(0deg);\n }\n`;\n\nexport const StyledAccordionContentLeft = styled.div`\n transition: 0.2s;\n display: flex;\n align-items: center;\n\n &.${classes.accordionItemShowBody} {\n transition: 0.2s;\n transform: rotate(180deg);\n }\n`;\n\nexport const StyledAccordionTitle = styled.div`\n color: var(${tokens.accordionItemTitleColor});\n font-family: var(${tokens.accordionItemTitleFontFamily});\n font-size: var(${tokens.accordionItemTitleFontSize});\n font-weight: var(${tokens.accordionItemTitleFontWeight});\n font-style: var(${tokens.accordionItemTitleFontStyle});\n letter-spacing: var(${tokens.accordionItemTitleLetterSpacing});\n line-height: var(${tokens.accordionItemTitleLineHeight});\n`;\n\nexport const StyledAccordionBodyAnimate = styled.div`\n display: grid;\n grid-template-rows: 0fr;\n transition: grid-template-rows 0.2s ease-out;\n overflow: hidden;\n\n &.${classes.accordionItemShowBody} {\n grid-template-rows: 1fr;\n padding-bottom: var(${tokens.accordionItemPaddingVertical});\n\n &.${classes.accordionPlusAnimationElement} {\n transition: 0.2s;\n transform: rotate(0deg);\n }\n }\n`;\n\nexport const StyledAccordionBody = styled.div`\n color: var(${tokens.accordionItemTextColor});\n font-family: var(${tokens.accordionItemTextFontFamily});\n font-size: var(${tokens.accordionItemTextFontSize});\n font-weight: var(${tokens.accordionItemTextFontWeight});\n font-style: var(${tokens.accordionItemTextFontStyle});\n letter-spacing: var(${tokens.accordionItemTextLetterSpacing});\n line-height: var(${tokens.accordionItemTextLineHeight});\n overflow: hidden;\n padding-right: var(${tokens.accordionItemPaddingHorizontal});\n padding-left: var(${tokens.accordionItemPaddingHorizontal});\n`;\n\nexport const StyledArrow = styled(IconChevronDownFill)`\n pointer-events: none;\n user-select: none;\n color: var(${tokens.accordionItemTextColor});\n`;\n\nexport const StyledMinus = styled(IconMinus)`\n pointer-events: none;\n user-select: none;\n color: var(${tokens.accordionItemTextColor});\n display: flex;\n align-items: center;\n position: absolute;\n top: 0;\n left: 0;\n\n &.${classes.accordionPlusAnimationElement} {\n transition: 0.2s;\n transform: rotate(90deg);\n }\n\n &.${classes.accordionItemShowBody} {\n transition: 0.2s;\n transform: rotate(0deg);\n }\n`;\n\nexport const StyledPlus = styled.div`\n position: relative;\n height: 1rem;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 1rem;\n`;\n"],"names":["StyledAccordionItem","styled","div","withConfig","componentId","tokens","accordionItemBackground","accordionItemBorderBottom","StyledAccordionHeader","accordionItemPadding","accordionItemGap","classes","accordionDisabled","addFocus","outlineOffset","outlineSize","outlineRadius","outlineColor","concat","accordionItemFocus","StyledAccordionHeaderLeft","StyledAccordionContentRight","accordionItemShowBody","StyledAccordionContentLeft","StyledAccordionTitle","accordionItemTitleColor","accordionItemTitleFontFamily","accordionItemTitleFontSize","accordionItemTitleFontWeight","accordionItemTitleFontStyle","accordionItemTitleLetterSpacing","accordionItemTitleLineHeight","StyledAccordionBodyAnimate","accordionItemPaddingVertical","accordionPlusAnimationElement","StyledAccordionBody","accordionItemTextColor","accordionItemTextFontFamily","accordionItemTextFontSize","accordionItemTextFontWeight","accordionItemTextFontStyle","accordionItemTextLetterSpacing","accordionItemTextLineHeight","accordionItemPaddingHorizontal","StyledArrow","IconChevronDownFill","StyledMinus","IconMinus","StyledPlus"],"mappings":";;;;;;;;;;;;IAMaA,mBAAmB,gBAAGC,MAAM,CAACC,GAAG,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,8BAAA;AAAA,CAAA,CAAA,CAAA,CAAA,iBAAA,EAAA,sBAAA,EAAA,qCAAA,CAAA,EACvBC,uBAAM,CAACC,uBAAuB,EAC3BD,uBAAM,CAACE,yBAAyB,EAKxD;IAEYC,qBAAqB,gBAAGP,MAAM,CAACC,GAAG,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,8BAAA;AAAA,CAAA,CAAA,CAAA,CAAA,qCAAA,EAAA,yBAAA,EAAA,4GAAA,EAAA,yDAAA,EAAA,EAAA,CAAA,EAG5BC,uBAAM,CAACI,oBAAoB,EAE/BJ,u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,EAAA,8BAAA;AAAA,CAG3BC,CAAAA,CAAAA,CAAAA,iDAAAA,EAAAA,qEAAAA,EAAAA,8CAAAA,EAAAA,2CAAAA,CAAAA,EAAAA,uBAAM,CAAC+B,sBAAsB,EAOtCzB,wBAAO,CAACuB,6BAA6B,EAKrCvB,wBAAO,CAACW,qBAAqB,EAIpC;IAEY0B,UAAU,gBAAG/C,MAAM,CAACC,GAAG,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,+BAAA;AAAA,CAOnC,CAAA,CAAA,CAAA,kGAAA,CAAA;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"AccordionItem.styles.js","sources":["../../../../../src/components/Accordion/ui/AccordionItem/AccordionItem.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport { IconChevronDownFill, IconMinus } from '../../../_Icon';\nimport { classes, tokens } from '../../Accordion.tokens';\nimport { addFocus } from '../../../../mixins';\n\nexport const StyledAccordionItem = styled.div`\n background: var(${tokens.accordionItemBackground});\n border-bottom: var(${tokens.accordionItemBorderBottom});\n\n &:last-child {\n border-bottom: none;\n }\n`;\n\nexport const StyledAccordionHeader = styled.button`\n width: 100%;\n border: none;\n padding: var(${tokens.accordionItemPadding});\n display: flex;\n gap: var(${tokens.accordionItemGap});\n justify-content: space-between;\n align-items: center;\n background: none;\n box-sizing: border-box;\n cursor: pointer;\n\n &.${classes.accordionDisabled} {\n opacity: 0.4;\n cursor: not-allowed;\n }\n\n &:focus {\n outline: none;\n }\n\n ${addFocus({\n outlineOffset: '0.125rem',\n outlineSize: '0.125rem',\n outlineRadius: '0',\n outlineColor: `var(${tokens.accordionItemFocus})`,\n })}\n`;\n\nexport const StyledAccordionHeaderLeft = styled.div`\n display: flex;\n gap: var(${tokens.accordionItemGap});\n justify-content: space-between;\n align-items: center;\n`;\n\nexport const StyledAccordionContentRight = styled.div`\n transition: 0.2s;\n transform: rotate(90deg);\n\n &.${classes.accordionItemShowBody} {\n transition: 0.2s;\n transform: rotate(0deg);\n }\n`;\n\nexport const StyledAccordionContentLeft = styled.div`\n transition: 0.2s;\n display: flex;\n align-items: center;\n\n &.${classes.accordionItemShowBody} {\n transition: 0.2s;\n transform: rotate(180deg);\n }\n`;\n\nexport const StyledAccordionTitle = styled.div`\n color: var(${tokens.accordionItemTitleColor});\n font-family: var(${tokens.accordionItemTitleFontFamily});\n font-size: var(${tokens.accordionItemTitleFontSize});\n font-weight: var(${tokens.accordionItemTitleFontWeight});\n font-style: var(${tokens.accordionItemTitleFontStyle});\n letter-spacing: var(${tokens.accordionItemTitleLetterSpacing});\n line-height: var(${tokens.accordionItemTitleLineHeight});\n`;\n\nexport const StyledAccordionBodyAnimate = styled.div`\n display: grid;\n grid-template-rows: 0fr;\n transition: grid-template-rows 0.2s ease-out;\n overflow: hidden;\n\n &.${classes.accordionItemShowBody} {\n grid-template-rows: 1fr;\n padding-bottom: var(${tokens.accordionItemPaddingVertical});\n\n &.${classes.accordionPlusAnimationElement} {\n transition: 0.2s;\n transform: rotate(0deg);\n }\n }\n`;\n\nexport const StyledAccordionBody = styled.div`\n color: var(${tokens.accordionItemTextColor});\n font-family: var(${tokens.accordionItemTextFontFamily});\n font-size: var(${tokens.accordionItemTextFontSize});\n font-weight: var(${tokens.accordionItemTextFontWeight});\n font-style: var(${tokens.accordionItemTextFontStyle});\n letter-spacing: var(${tokens.accordionItemTextLetterSpacing});\n line-height: var(${tokens.accordionItemTextLineHeight});\n overflow: hidden;\n padding-right: var(${tokens.accordionItemPaddingHorizontal});\n padding-left: var(${tokens.accordionItemPaddingHorizontal});\n`;\n\nexport const StyledArrow = styled(IconChevronDownFill)`\n pointer-events: none;\n user-select: none;\n color: var(${tokens.accordionItemTextColor});\n`;\n\nexport const StyledMinus = styled(IconMinus)`\n pointer-events: none;\n user-select: none;\n color: var(${tokens.accordionItemTextColor});\n display: flex;\n align-items: center;\n position: absolute;\n top: 0;\n left: 0;\n\n &.${classes.accordionPlusAnimationElement} {\n transition: 0.2s;\n transform: rotate(90deg);\n }\n\n &.${classes.accordionItemShowBody} {\n transition: 0.2s;\n transform: rotate(0deg);\n }\n`;\n\nexport const StyledPlus = styled.div`\n position: relative;\n height: 1rem;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 1rem;\n`;\n"],"names":["StyledAccordionItem","styled","div","withConfig","componentId","tokens","accordionItemBackground","accordionItemBorderBottom","StyledAccordionHeader","button","accordionItemPadding","accordionItemGap","classes","accordionDisabled","addFocus","outlineOffset","outlineSize","outlineRadius","outlineColor","concat","accordionItemFocus","StyledAccordionHeaderLeft","StyledAccordionContentRight","accordionItemShowBody","StyledAccordionContentLeft","StyledAccordionTitle","accordionItemTitleColor","accordionItemTitleFontFamily","accordionItemTitleFontSize","accordionItemTitleFontWeight","accordionItemTitleFontStyle","accordionItemTitleLetterSpacing","accordionItemTitleLineHeight","StyledAccordionBodyAnimate","accordionItemPaddingVertical","accordionPlusAnimationElement","StyledAccordionBody","accordionItemTextColor","accordionItemTextFontFamily","accordionItemTextFontSize","accordionItemTextFontWeight","accordionItemTextFontStyle","accordionItemTextLetterSpacing","accordionItemTextLineHeight","accordionItemPaddingHorizontal","StyledArrow","IconChevronDownFill","StyledMinus","IconMinus","StyledPlus"],"mappings":";;;;;;;;;;;;IAMaA,mBAAmB,gBAAGC,MAAM,CAACC,GAAG,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,8BAAA;AAAA,CAAA,CAAA,CAAA,CAAA,iBAAA,EAAA,sBAAA,EAAA,qCAAA,CAAA,EACvBC,uBAAM,CAACC,uBAAuB,EAC3BD,uBAAM,CAACE,yBAAyB,EAKxD;IAEYC,qBAAqB,gBAAGP,MAAM,CAACQ,MAAM,CAAAN,UAAA,CAAA;EAAAC,WAAA,EAAA,8BAAA;AAAA,CAAA,CAAA,CAAA,CAAA,qCAAA,EAAA,yBAAA,EAAA,4GAAA,EAAA,yDAAA,EAAA,EAAA,CAAA,EAG/BC,uBAAM,CAACK,oBAAoB,EAE/BL,uBAAM,CAACM,gBAAgB,E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AA,CAG3BC,CAAAA,CAAAA,CAAAA,iDAAAA,EAAAA,qEAAAA,EAAAA,8CAAAA,EAAAA,2CAAAA,CAAAA,EAAAA,uBAAM,CAACgC,sBAAsB,EAOtCzB,wBAAO,CAACuB,6BAA6B,EAKrCvB,wBAAO,CAACW,qBAAqB,EAIpC;IAEY0B,UAAU,gBAAGhD,MAAM,CAACC,GAAG,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,+BAAA;AAAA,CAOnC,CAAA,CAAA,CAAA,kGAAA,CAAA;;;;;;;;;;;;;;"}
@@ -32,15 +32,6 @@ var AccordionItem = function AccordionItem(_ref) {
32
32
  onChange(key, !value);
33
33
  }
34
34
  };
35
- var onKeyPress = function onKeyPress(event) {
36
- if (disabled) {
37
- return;
38
- }
39
- event.persist();
40
- if (event.keyCode === 13 || event.keyCode === 32) {
41
- handleOpen();
42
- }
43
- };
44
35
  var leftContentRef = useRef(null);
45
36
  useEffect(function () {
46
37
  var _leftContentRef$curre, _leftContentRef$curre2;
@@ -79,10 +70,9 @@ var AccordionItem = function AccordionItem(_ref) {
79
70
  tabIndex: 0,
80
71
  onClick: handleOpen,
81
72
  className: disabledClass,
82
- "aria-expanded": "true",
73
+ "aria-expanded": value,
83
74
  "aria-controls": "accordion-item-section".concat(key),
84
- id: "accordion-item-".concat(key),
85
- onKeyDown: onKeyPress
75
+ id: "accordion-item-".concat(key)
86
76
  }, /*#__PURE__*/React.createElement(StyledAccordionHeaderLeft, null, leftContent && /*#__PURE__*/React.createElement(StyledAccordionContentLeft, {
87
77
  ref: leftContentRef,
88
78
  className: leftContentRotate
@@ -90,6 +80,7 @@ var AccordionItem = function AccordionItem(_ref) {
90
80
  className: rightContentRotate
91
81
  }, rightContent && rightContent)), /*#__PURE__*/React.createElement(StyledAccordionBodyAnimate, {
92
82
  "aria-labelledby": "accordion-item-".concat(key),
83
+ "aria-hidden": !value,
93
84
  id: "accordion-item-section".concat(key),
94
85
  className: openedBodyClass,
95
86
  style: {
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionItem.js","sources":["../../../../../src/components/Accordion/ui/AccordionItem/AccordionItem.tsx"],"sourcesContent":["import React, { HTMLAttributes, useState, KeyboardEvent, useRef, useEffect } from 'react';\n\nimport { convertRoundnessMatrix } from '../../../../utils/roundness';\nimport { classes, tokens } from '../../Accordion.tokens';\n\nimport {\n StyledAccordionItem,\n StyledAccordionHeader,\n StyledAccordionBody,\n StyledAccordionTitle,\n StyledAccordionContentLeft,\n StyledAccordionHeaderLeft,\n StyledAccordionContentRight,\n StyledArrow,\n StyledMinus,\n StyledPlus,\n StyledAccordionBodyAnimate,\n} from './AccordionItem.styles';\nimport type { AccordionItemProps } from './AccordionItem.types';\n\nexport const AccordionItem: React.FC<HTMLAttributes<HTMLDivElement> & AccordionItemProps> = ({\n value,\n contentRight,\n contentLeft,\n title,\n pin = 'square-square',\n children,\n type = 'sign',\n index,\n eventKey,\n disabled,\n onChange,\n}) => {\n const key = eventKey ?? index;\n\n const [leftPadding, setLeftPadding] = useState<string | number | null>();\n\n const handleOpen = () => {\n if (disabled) {\n return;\n }\n if (onChange) {\n onChange(key, !value);\n }\n };\n\n const onKeyPress = (event: KeyboardEvent<HTMLDivElement>) => {\n if (disabled) {\n return;\n }\n event.persist();\n if (event.keyCode === 13 || event.keyCode === 32) {\n handleOpen();\n }\n };\n\n const leftContentRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const leftContentWidth = leftContentRef?.current?.offsetWidth ?? 0;\n const leftPaddingBody = leftContentWidth ? `calc(${leftContentWidth}px + var(${tokens.accordionItemGap}))` : 0;\n setLeftPadding(leftPaddingBody);\n }, [value, type, leftContentRef, setLeftPadding]);\n\n const openedBodyClass = value ? classes.accordionItemShowBody : undefined;\n\n const StyledAnimationPLus = () => (\n <StyledPlus>\n <StyledMinus size=\"xs\" color=\"inhert\" />\n <StyledMinus\n size=\"xs\"\n color=\"inhert\"\n className={openedBodyClass ?? classes.accordionPlusAnimationElement}\n />\n </StyledPlus>\n );\n\n const accordionBorderRadius = convertRoundnessMatrix(pin, `var(${tokens.accordionItemBorderRadius})`, '1.5rem');\n const disabledClass = disabled ? classes.accordionDisabled : '';\n\n const leftContent = contentLeft ?? (type === 'arrow' ? <StyledArrow size=\"xs\" color=\"inhert\" /> : undefined);\n const leftContentRotate = type === 'arrow' && value ? classes.accordionItemShowBody : undefined;\n\n const rightContent = contentRight ?? (type === 'sign' ? <StyledAnimationPLus /> : undefined);\n const rightContentRotate = type === 'sign' && value ? classes.accordionItemShowBody : undefined;\n\n return (\n <StyledAccordionItem\n className={classes.accordionItem}\n key={key}\n style={{ borderRadius: accordionBorderRadius }}\n >\n <StyledAccordionHeader\n role=\"tab\"\n tabIndex={0}\n onClick={handleOpen}\n className={disabledClass}\n aria-expanded=\"true\"\n aria-controls={`accordion-item-section${key}`}\n id={`accordion-item-${key}`}\n onKeyDown={onKeyPress}\n >\n <StyledAccordionHeaderLeft>\n {leftContent && (\n <StyledAccordionContentLeft ref={leftContentRef} className={leftContentRotate}>\n {leftContent}\n </StyledAccordionContentLeft>\n )}\n <StyledAccordionTitle>{title}</StyledAccordionTitle>\n </StyledAccordionHeaderLeft>\n\n <StyledAccordionContentRight className={rightContentRotate}>\n {rightContent && rightContent}\n </StyledAccordionContentRight>\n </StyledAccordionHeader>\n <StyledAccordionBodyAnimate\n aria-labelledby={`accordion-item-${key}`}\n id={`accordion-item-section${key}`}\n className={openedBodyClass}\n style={{ paddingLeft: `${leftPadding}` }}\n >\n <StyledAccordionBody>{children}</StyledAccordionBody>\n </StyledAccordionBodyAnimate>\n </StyledAccordionItem>\n );\n};\n"],"names":["AccordionItem","_ref","value","contentRight","contentLeft","title","_ref$pin","pin","children","_ref$type","type","index","eventKey","disabled","onChange","key","_useState","useState","_useState2","_slicedToArray","leftPadding","setLeftPadding","handleOpen","onKeyPress","event","persist","keyCode","leftContentRef","useRef","useEffect","_leftContentRef$curre","_leftContentRef$curre2","leftContentWidth","current","offsetWidth","leftPaddingBody","concat","tokens","accordionItemGap","openedBodyClass","classes","accordionItemShowBody","undefined","StyledAnimationPLus","React","createElement","StyledPlus","_StyledMinus","StyledMinus","size","color","className","accordionPlusAnimationElement","accordionBorderRadius","convertRoundnessMatrix","accordionItemBorderRadius","disabledClass","accordionDisabled","leftContent","_StyledArrow","StyledArrow","leftContentRotate","rightContent","rightContentRotate","StyledAccordionItem","accordionItem","style","borderRadius","StyledAccordionHeader","role","tabIndex","onClick","id","onKeyDown","StyledAccordionHeaderLeft","StyledAccordionContentLeft","ref","StyledAccordionTitle","StyledAccordionContentRight","StyledAccordionBodyAnimate","paddingLeft","StyledAccordionBody"],"mappings":";;;;;;;IAoBaA,aAA4E,GAAG,SAA/EA,aAA4EA,CAAAC,IAAA,EAYnF;AAAA,EAAA,IAXFC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,YAAY,GAAAF,IAAA,CAAZE,YAAY;IACZC,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXC,KAAK,GAAAJ,IAAA,CAALI,KAAK;IAAAC,QAAA,GAAAL,IAAA,CACLM,GAAG;AAAHA,IAAAA,GAAG,GAAAD,QAAA,KAAG,KAAA,CAAA,GAAA,eAAe,GAAAA,QAAA;IACrBE,QAAQ,GAAAP,IAAA,CAARO,QAAQ;IAAAC,SAAA,GAAAR,IAAA,CACRS,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,SAAA;IACbE,KAAK,GAAAV,IAAA,CAALU,KAAK;IACLC,QAAQ,GAAAX,IAAA,CAARW,QAAQ;IACRC,QAAQ,GAAAZ,IAAA,CAARY,QAAQ;IACRC,QAAQ,GAAAb,IAAA,CAARa,QAAQ,CAAA;EAER,IAAMC,GAAG,GAAGH,QAAQ,KAAA,IAAA,IAARA,QAAQ,KAARA,KAAAA,CAAAA,GAAAA,QAAQ,GAAID,KAAK,CAAA;AAE7B,EAAA,IAAAK,SAAA,GAAsCC,QAAQ,EAA0B;I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hB,WAAW,iBACRd,KAAA,CAAAC,aAAA,CAAC8B,0BAA0B,EAAA;AAACC,IAAAA,GAAG,EAAEjD,cAAe;AAACwB,IAAAA,SAAS,EAAEU,iBAAAA;AAAkB,GAAA,EACzEH,WACuB,CAC/B,eACDd,KAAA,CAAAC,aAAA,CAACgC,oBAAoB,EAAExE,IAAAA,EAAAA,KAA4B,CAC5B,CAAC,eAE5BuC,KAAA,CAAAC,aAAA,CAACiC,2BAA2B,EAAA;AAAC3B,IAAAA,SAAS,EAAEY,kBAAAA;GACnCD,EAAAA,YAAY,IAAIA,YACQ,CACV,CAAC,eACxBlB,KAAA,CAAAC,aAAA,CAACkC,0BAA0B,EAAA;IACvB,iBAAA3C,EAAAA,iBAAAA,CAAAA,MAAA,CAAmCrB,GAAG,CAAG;AACzCyD,IAAAA,EAAE,EAAApC,wBAAAA,CAAAA,MAAA,CAA2BrB,GAAG,CAAG;AACnCoC,IAAAA,SAAS,EAAEZ,eAAgB;AAC3B2B,IAAAA,KAAK,EAAE;MAAEc,WAAW,EAAA,EAAA,CAAA5C,MAAA,CAAKhB,WAAW,CAAA;AAAG,KAAA;GAEvCwB,eAAAA,KAAA,CAAAC,aAAA,CAACoC,mBAAmB,EAAEzE,IAAAA,EAAAA,QAA8B,CAC5B,CACX,CAAC,CAAA;AAE9B;;;;"}
1
+ {"version":3,"file":"AccordionItem.js","sources":["../../../../../src/components/Accordion/ui/AccordionItem/AccordionItem.tsx"],"sourcesContent":["import React, { HTMLAttributes, useState, useRef, useEffect } from 'react';\n\nimport { convertRoundnessMatrix } from '../../../../utils/roundness';\nimport { classes, tokens } from '../../Accordion.tokens';\n\nimport {\n StyledAccordionItem,\n StyledAccordionHeader,\n StyledAccordionBody,\n StyledAccordionTitle,\n StyledAccordionContentLeft,\n StyledAccordionHeaderLeft,\n StyledAccordionContentRight,\n StyledArrow,\n StyledMinus,\n StyledPlus,\n StyledAccordionBodyAnimate,\n} from './AccordionItem.styles';\nimport type { AccordionItemProps } from './AccordionItem.types';\n\nexport const AccordionItem: React.FC<HTMLAttributes<HTMLDivElement> & AccordionItemProps> = ({\n value,\n contentRight,\n contentLeft,\n title,\n pin = 'square-square',\n children,\n type = 'sign',\n index,\n eventKey,\n disabled,\n onChange,\n}) => {\n const key = eventKey ?? index;\n\n const [leftPadding, setLeftPadding] = useState<string | number | null>();\n\n const handleOpen = () => {\n if (disabled) {\n return;\n }\n if (onChange) {\n onChange(key, !value);\n }\n };\n\n const leftContentRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const leftContentWidth = leftContentRef?.current?.offsetWidth ?? 0;\n const leftPaddingBody = leftContentWidth ? `calc(${leftContentWidth}px + var(${tokens.accordionItemGap}))` : 0;\n setLeftPadding(leftPaddingBody);\n }, [value, type, leftContentRef, setLeftPadding]);\n\n const openedBodyClass = value ? classes.accordionItemShowBody : undefined;\n\n const StyledAnimationPLus = () => (\n <StyledPlus>\n <StyledMinus size=\"xs\" color=\"inhert\" />\n <StyledMinus\n size=\"xs\"\n color=\"inhert\"\n className={openedBodyClass ?? classes.accordionPlusAnimationElement}\n />\n </StyledPlus>\n );\n\n const accordionBorderRadius = convertRoundnessMatrix(pin, `var(${tokens.accordionItemBorderRadius})`, '1.5rem');\n const disabledClass = disabled ? classes.accordionDisabled : '';\n\n const leftContent = contentLeft ?? (type === 'arrow' ? <StyledArrow size=\"xs\" color=\"inhert\" /> : undefined);\n const leftContentRotate = type === 'arrow' && value ? classes.accordionItemShowBody : undefined;\n\n const rightContent = contentRight ?? (type === 'sign' ? <StyledAnimationPLus /> : undefined);\n const rightContentRotate = type === 'sign' && value ? classes.accordionItemShowBody : undefined;\n\n return (\n <StyledAccordionItem\n className={classes.accordionItem}\n key={key}\n style={{ borderRadius: accordionBorderRadius }}\n >\n <StyledAccordionHeader\n role=\"tab\"\n tabIndex={0}\n onClick={handleOpen}\n className={disabledClass}\n aria-expanded={value}\n aria-controls={`accordion-item-section${key}`}\n id={`accordion-item-${key}`}\n >\n <StyledAccordionHeaderLeft>\n {leftContent && (\n <StyledAccordionContentLeft ref={leftContentRef} className={leftContentRotate}>\n {leftContent}\n </StyledAccordionContentLeft>\n )}\n <StyledAccordionTitle>{title}</StyledAccordionTitle>\n </StyledAccordionHeaderLeft>\n\n <StyledAccordionContentRight className={rightContentRotate}>\n {rightContent && rightContent}\n </StyledAccordionContentRight>\n </StyledAccordionHeader>\n <StyledAccordionBodyAnimate\n aria-labelledby={`accordion-item-${key}`}\n aria-hidden={!value}\n id={`accordion-item-section${key}`}\n className={openedBodyClass}\n style={{ paddingLeft: `${leftPadding}` }}\n >\n <StyledAccordionBody>{children}</StyledAccordionBody>\n </StyledAccordionBodyAnimate>\n </StyledAccordionItem>\n );\n};\n"],"names":["AccordionItem","_ref","value","contentRight","contentLeft","title","_ref$pin","pin","children","_ref$type","type","index","eventKey","disabled","onChange","key","_useState","useState","_useState2","_slicedToArray","leftPadding","setLeftPadding","handleOpen","leftContentRef","useRef","useEffect","_leftContentRef$curre","_leftContentRef$curre2","leftContentWidth","current","offsetWidth","leftPaddingBody","concat","tokens","accordionItemGap","openedBodyClass","classes","accordionItemShowBody","undefined","StyledAnimationPLus","React","createElement","StyledPlus","_StyledMinus","StyledMinus","size","color","className","accordionPlusAnimationElement","accordionBorderRadius","convertRoundnessMatrix","accordionItemBorderRadius","disabledClass","accordionDisabled","leftContent","_StyledArrow","StyledArrow","leftContentRotate","rightContent","rightContentRotate","StyledAccordionItem","accordionItem","style","borderRadius","StyledAccordionHeader","role","tabIndex","onClick","id","StyledAccordionHeaderLeft","StyledAccordionContentLeft","ref","StyledAccordionTitle","StyledAccordionContentRight","StyledAccordionBodyAnimate","paddingLeft","StyledAccordionBody"],"mappings":";;;;;;;IAoBaA,aAA4E,GAAG,SAA/EA,aAA4EA,CAAAC,IAAA,EAYnF;AAAA,EAAA,IAXFC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,YAAY,GAAAF,IAAA,CAAZE,YAAY;IACZC,WAAW,GAAAH,IAAA,C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PURE__*/styled.div.withConfig({
10
10
  componentId: "plasma-new-hope__sc-iot32d-0"
11
11
  })(["background:var(", ");border-bottom:var(", ");&:last-child{border-bottom:none;}"], tokens.accordionItemBackground, tokens.accordionItemBorderBottom);
12
- var StyledAccordionHeader = /*#__PURE__*/styled.div.withConfig({
12
+ var StyledAccordionHeader = /*#__PURE__*/styled.button.withConfig({
13
13
  componentId: "plasma-new-hope__sc-iot32d-1"
14
14
  })(["width:100%;border:none;padding:var(", ");display:flex;gap:var(", ");justify-content:space-between;align-items:center;background:none;box-sizing:border-box;cursor:pointer;&.", "{opacity:0.4;cursor:not-allowed;}&:focus{outline:none;}", ""], tokens.accordionItemPadding, tokens.accordionItemGap, classes.accordionDisabled, /*#__PURE__*/addFocus({
15
15
  outlineOffset: '0.125rem',
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionItem.styles.js","sources":["../../../../../src/components/Accordion/ui/AccordionItem/AccordionItem.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport { IconChevronDownFill, IconMinus } from '../../../_Icon';\nimport { classes, tokens } from '../../Accordion.tokens';\nimport { addFocus } from '../../../../mixins';\n\nexport const StyledAccordionItem = styled.div`\n background: var(${tokens.accordionItemBackground});\n border-bottom: var(${tokens.accordionItemBorderBottom});\n\n &:last-child {\n border-bottom: none;\n }\n`;\n\nexport const StyledAccordionHeader = styled.div`\n width: 100%;\n border: none;\n padding: var(${tokens.accordionItemPadding});\n display: flex;\n gap: var(${tokens.accordionItemGap});\n justify-content: space-between;\n align-items: center;\n background: none;\n box-sizing: border-box;\n cursor: pointer;\n\n &.${classes.accordionDisabled} {\n opacity: 0.4;\n cursor: not-allowed;\n }\n\n &:focus {\n outline: none;\n }\n\n ${addFocus({\n outlineOffset: '0.125rem',\n outlineSize: '0.125rem',\n outlineRadius: '0',\n outlineColor: `var(${tokens.accordionItemFocus})`,\n })}\n`;\n\nexport const StyledAccordionHeaderLeft = styled.div`\n display: flex;\n gap: var(${tokens.accordionItemGap});\n justify-content: space-between;\n align-items: center;\n`;\n\nexport const StyledAccordionContentRight = styled.div`\n transition: 0.2s;\n transform: rotate(90deg);\n\n &.${classes.accordionItemShowBody} {\n transition: 0.2s;\n transform: rotate(0deg);\n }\n`;\n\nexport const StyledAccordionContentLeft = styled.div`\n transition: 0.2s;\n display: flex;\n align-items: center;\n\n &.${classes.accordionItemShowBody} {\n transition: 0.2s;\n transform: rotate(180deg);\n }\n`;\n\nexport const StyledAccordionTitle = styled.div`\n color: var(${tokens.accordionItemTitleColor});\n font-family: var(${tokens.accordionItemTitleFontFamily});\n font-size: var(${tokens.accordionItemTitleFontSize});\n font-weight: var(${tokens.accordionItemTitleFontWeight});\n font-style: var(${tokens.accordionItemTitleFontStyle});\n letter-spacing: var(${tokens.accordionItemTitleLetterSpacing});\n line-height: var(${tokens.accordionItemTitleLineHeight});\n`;\n\nexport const StyledAccordionBodyAnimate = styled.div`\n display: grid;\n grid-template-rows: 0fr;\n transition: grid-template-rows 0.2s ease-out;\n overflow: hidden;\n\n &.${classes.accordionItemShowBody} {\n grid-template-rows: 1fr;\n padding-bottom: var(${tokens.accordionItemPaddingVertical});\n\n &.${classes.accordionPlusAnimationElement} {\n transition: 0.2s;\n transform: rotate(0deg);\n }\n }\n`;\n\nexport const StyledAccordionBody = styled.div`\n color: var(${tokens.accordionItemTextColor});\n font-family: var(${tokens.accordionItemTextFontFamily});\n font-size: var(${tokens.accordionItemTextFontSize});\n font-weight: var(${tokens.accordionItemTextFontWeight});\n font-style: var(${tokens.accordionItemTextFontStyle});\n letter-spacing: var(${tokens.accordionItemTextLetterSpacing});\n line-height: var(${tokens.accordionItemTextLineHeight});\n overflow: hidden;\n padding-right: var(${tokens.accordionItemPaddingHorizontal});\n padding-left: var(${tokens.accordionItemPaddingHorizontal});\n`;\n\nexport const StyledArrow = styled(IconChevronDownFill)`\n pointer-events: none;\n user-select: none;\n color: var(${tokens.accordionItemTextColor});\n`;\n\nexport const StyledMinus = styled(IconMinus)`\n pointer-events: none;\n user-select: none;\n color: var(${tokens.accordionItemTextColor});\n display: flex;\n align-items: center;\n position: absolute;\n top: 0;\n left: 0;\n\n &.${classes.accordionPlusAnimationElement} {\n transition: 0.2s;\n transform: rotate(90deg);\n }\n\n &.${classes.accordionItemShowBody} {\n transition: 0.2s;\n transform: rotate(0deg);\n }\n`;\n\nexport const StyledPlus = styled.div`\n position: relative;\n height: 1rem;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 1rem;\n`;\n"],"names":["StyledAccordionItem","styled","div","withConfig","componentId","tokens","accordionItemBackground","accordionItemBorderBottom","StyledAccordionHeader","accordionItemPadding","accordionItemGap","classes","accordionDisabled","addFocus","outlineOffset","outlineSize","outlineRadius","outlineColor","concat","accordionItemFocus","StyledAccordionHeaderLeft","StyledAccordionContentRight","accordionItemShowBody","StyledAccordionContentLeft","StyledAccordionTitle","accordionItemTitleColor","accordionItemTitleFontFamily","accordionItemTitleFontSize","accordionItemTitleFontWeight","accordionItemTitleFontStyle","accordionItemTitleLetterSpacing","accordionItemTitleLineHeight","StyledAccordionBodyAnimate","accordionItemPaddingVertical","accordionPlusAnimationElement","StyledAccordionBody","accordionItemTextColor","accordionItemTextFontFamily","accordionItemTextFontSize","accordionItemTextFontWeight","accordionItemTextFontStyle","accordionItemTextLetterSpacing","accordionItemTextLineHeight","accordionItemPaddingHorizontal","StyledArrow","IconChevronDownFill","StyledMinus","IconMinus","StyledPlus"],"mappings":";;;;;;;;IAMaA,mBAAmB,gBAAGC,MAAM,CAACC,GAAG,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,8BAAA;AAAA,CAAA,CAAA,CAAA,CAAA,iBAAA,EAAA,sBAAA,EAAA,qCAAA,CAAA,EACvBC,MAAM,CAACC,uBAAuB,EAC3BD,MAAM,CAACE,yBAAyB,EAKxD;IAEYC,qBAAqB,gBAAGP,MAAM,CAACC,GAAG,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,8BAAA;AAAA,CAAA,CAAA,CAAA,CAAA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AW,gBAAG7C,MAAM,CAAC8C,SAAS,CAAC,CAAA5C,UAAA,CAAA;EAAAC,WAAA,EAAA,8BAAA;AAAA,CAG3BC,CAAAA,CAAAA,CAAAA,iDAAAA,EAAAA,qEAAAA,EAAAA,8CAAAA,EAAAA,2CAAAA,CAAAA,EAAAA,MAAM,CAAC+B,sBAAsB,EAOtCzB,OAAO,CAACuB,6BAA6B,EAKrCvB,OAAO,CAACW,qBAAqB,EAIpC;IAEY0B,UAAU,gBAAG/C,MAAM,CAACC,GAAG,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,+BAAA;AAAA,CAOnC,CAAA,CAAA,CAAA,kGAAA,CAAA;;;;"}
1
+ {"version":3,"file":"AccordionItem.styles.js","sources":["../../../../../src/components/Accordion/ui/AccordionItem/AccordionItem.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport { IconChevronDownFill, IconMinus } from '../../../_Icon';\nimport { classes, tokens } from '../../Accordion.tokens';\nimport { addFocus } from '../../../../mixins';\n\nexport const StyledAccordionItem = styled.div`\n background: var(${tokens.accordionItemBackground});\n border-bottom: var(${tokens.accordionItemBorderBottom});\n\n &:last-child {\n border-bottom: none;\n }\n`;\n\nexport const StyledAccordionHeader = styled.button`\n width: 100%;\n border: none;\n padding: var(${tokens.accordionItemPadding});\n display: flex;\n gap: var(${tokens.accordionItemGap});\n justify-content: space-between;\n align-items: center;\n background: none;\n box-sizing: border-box;\n cursor: pointer;\n\n &.${classes.accordionDisabled} {\n opacity: 0.4;\n cursor: not-allowed;\n }\n\n &:focus {\n outline: none;\n }\n\n ${addFocus({\n outlineOffset: '0.125rem',\n outlineSize: '0.125rem',\n outlineRadius: '0',\n outlineColor: `var(${tokens.accordionItemFocus})`,\n })}\n`;\n\nexport const StyledAccordionHeaderLeft = styled.div`\n display: flex;\n gap: var(${tokens.accordionItemGap});\n justify-content: space-between;\n align-items: center;\n`;\n\nexport const StyledAccordionContentRight = styled.div`\n transition: 0.2s;\n transform: rotate(90deg);\n\n &.${classes.accordionItemShowBody} {\n transition: 0.2s;\n transform: rotate(0deg);\n }\n`;\n\nexport const StyledAccordionContentLeft = styled.div`\n transition: 0.2s;\n display: flex;\n align-items: center;\n\n &.${classes.accordionItemShowBody} {\n transition: 0.2s;\n transform: rotate(180deg);\n }\n`;\n\nexport const StyledAccordionTitle = styled.div`\n color: var(${tokens.accordionItemTitleColor});\n font-family: var(${tokens.accordionItemTitleFontFamily});\n font-size: var(${tokens.accordionItemTitleFontSize});\n font-weight: var(${tokens.accordionItemTitleFontWeight});\n font-style: var(${tokens.accordionItemTitleFontStyle});\n letter-spacing: var(${tokens.accordionItemTitleLetterSpacing});\n line-height: var(${tokens.accordionItemTitleLineHeight});\n`;\n\nexport const StyledAccordionBodyAnimate = styled.div`\n display: grid;\n grid-template-rows: 0fr;\n transition: grid-template-rows 0.2s ease-out;\n overflow: hidden;\n\n &.${classes.accordionItemShowBody} {\n grid-template-rows: 1fr;\n padding-bottom: var(${tokens.accordionItemPaddingVertical});\n\n &.${classes.accordionPlusAnimationElement} {\n transition: 0.2s;\n transform: rotate(0deg);\n }\n }\n`;\n\nexport const StyledAccordionBody = styled.div`\n color: var(${tokens.accordionItemTextColor});\n font-family: var(${tokens.accordionItemTextFontFamily});\n font-size: var(${tokens.accordionItemTextFontSize});\n font-weight: var(${tokens.accordionItemTextFontWeight});\n font-style: var(${tokens.accordionItemTextFontStyle});\n letter-spacing: var(${tokens.accordionItemTextLetterSpacing});\n line-height: var(${tokens.accordionItemTextLineHeight});\n overflow: hidden;\n padding-right: var(${tokens.accordionItemPaddingHorizontal});\n padding-left: var(${tokens.accordionItemPaddingHorizontal});\n`;\n\nexport const StyledArrow = styled(IconChevronDownFill)`\n pointer-events: none;\n user-select: none;\n color: var(${tokens.accordionItemTextColor});\n`;\n\nexport const StyledMinus = styled(IconMinus)`\n pointer-events: none;\n user-select: none;\n color: var(${tokens.accordionItemTextColor});\n display: flex;\n align-items: center;\n position: absolute;\n top: 0;\n left: 0;\n\n &.${classes.accordionPlusAnimationElement} {\n transition: 0.2s;\n transform: rotate(90deg);\n }\n\n &.${classes.accordionItemShowBody} {\n transition: 0.2s;\n transform: rotate(0deg);\n }\n`;\n\nexport const StyledPlus = styled.div`\n position: relative;\n height: 1rem;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 1rem;\n`;\n"],"names":["StyledAccordionItem","styled","div","withConfig","componentId","tokens","accordionItemBackground","accordionItemBorderBottom","StyledAccordionHeader","button","accordionItemPadding","accordionItemGap","classes","accordionDisabled","addFocus","outlineOffset","outlineSize","outlineRadius","outlineColor","concat","accordionItemFocus","StyledAccordionHeaderLeft","StyledAccordionContentRight","accordionItemShowBody","StyledAccordionContentLeft","StyledAccordionTitle","accordionItemTitleColor","accordionItemTitleFontFamily","accordionItemTitleFontSize","accordionItemTitleFontWeight","accordionItemTitleFontStyle","accordionItemTitleLetterSpacing","accordionItemTitleLineHeight","StyledAccordionBodyAnimate","accordionItemPaddingVertical","accordionPlusAnimationElement","StyledAccordionBody","accordionItemTextColor","accordionItemTextFontFamily","accordionItemTextFontSize","accordionItemTextFontWeight","accordionItemTextFontStyle","accordionItemTextLetterSpacing","accordionItemTextLineHeight","accordionItemPaddingHorizontal","StyledArrow","IconChevronDownFill","StyledMinus","IconMinus","StyledPlus"],"mappings":";;;;;;;;IAMaA,mBAAmB,gBAAGC,MAAM,CAACC,GAAG,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,8BAAA;AAAA,CAAA,CAAA,CAAA,CAAA,iBAAA,EAAA,sBAAA,EAAA,qCAAA,CAAA,EACvBC,MAAM,CAACC,uBAAuB,EAC3BD,MAAM,CAACE,yBAAyB,EAKxD;IAEYC,qBAAqB,gBAAGP,MAAM,CAACQ,MAAM,CAAAN,UAAA,CAAA;EAAAC,WAAA,EAAA,8BAAA;AAAA,CAAA,CAAA,CAAA,CAAA,qCAAA,EAAA,yBAAA,EAAA,4GAAA,EAAA,yDAAA,EAAA,EAAA,CAAA,EAG/BC,MAA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AAA,8BAAA;AAAA,CAG3BC,CAAAA,CAAAA,CAAAA,iDAAAA,EAAAA,qEAAAA,EAAAA,8CAAAA,EAAAA,2CAAAA,CAAAA,EAAAA,MAAM,CAACgC,sBAAsB,EAOtCzB,OAAO,CAACuB,6BAA6B,EAKrCvB,OAAO,CAACW,qBAAqB,EAIpC;IAEY0B,UAAU,gBAAGhD,MAAM,CAACC,GAAG,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,+BAAA;AAAA,CAOnC,CAAA,CAAA,CAAA,kGAAA,CAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salutejs/plasma-new-hope",
3
- "version": "0.88.0-canary.1223.9505247307.0",
3
+ "version": "0.88.0-canary.1223.9514251012.0",
4
4
  "description": "Salute Design System blueprint",
5
5
  "main": "cjs/index.js",
6
6
  "module": "es/index.js",
@@ -103,5 +103,5 @@
103
103
  "react-popper": "2.3.0",
104
104
  "storeon": "3.1.5"
105
105
  },
106
- "gitHead": "09b90fa9fdeda86772f56ffec2ae98d22d8182e4"
106
+ "gitHead": "d22178f6cfb9a6301a80d52e99d4b97bd9d8fd93"
107
107
  }
@@ -45,15 +45,6 @@ var AccordionItem = exports.AccordionItem = function AccordionItem(_ref) {
45
45
  onChange(key, !value);
46
46
  }
47
47
  };
48
- var onKeyPress = function onKeyPress(event) {
49
- if (disabled) {
50
- return;
51
- }
52
- event.persist();
53
- if (event.keyCode === 13 || event.keyCode === 32) {
54
- handleOpen();
55
- }
56
- };
57
48
  var leftContentRef = (0, _react.useRef)(null);
58
49
  (0, _react.useEffect)(function () {
59
50
  var _leftContentRef$curre, _leftContentRef$curre2;
@@ -92,10 +83,9 @@ var AccordionItem = exports.AccordionItem = function AccordionItem(_ref) {
92
83
  tabIndex: 0,
93
84
  onClick: handleOpen,
94
85
  className: disabledClass,
95
- "aria-expanded": "true",
86
+ "aria-expanded": value,
96
87
  "aria-controls": "accordion-item-section".concat(key),
97
- id: "accordion-item-".concat(key),
98
- onKeyDown: onKeyPress
88
+ id: "accordion-item-".concat(key)
99
89
  }, /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionHeaderLeft, null, leftContent && /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionContentLeft, {
100
90
  ref: leftContentRef,
101
91
  className: leftContentRotate
@@ -103,6 +93,7 @@ var AccordionItem = exports.AccordionItem = function AccordionItem(_ref) {
103
93
  className: rightContentRotate
104
94
  }, rightContent && rightContent)), /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionBodyAnimate, {
105
95
  "aria-labelledby": "accordion-item-".concat(key),
96
+ "aria-hidden": !value,
106
97
  id: "accordion-item-section".concat(key),
107
98
  className: openedBodyClass,
108
99
  style: {
@@ -12,7 +12,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
12
12
  var StyledAccordionItem = exports.StyledAccordionItem = /*#__PURE__*/_styledComponents["default"].div.withConfig({
13
13
  componentId: "plasma-new-hope__sc-20ij9z-0"
14
14
  })(["background:var(", ");border-bottom:var(", ");&:last-child{border-bottom:none;}"], _Accordion.tokens.accordionItemBackground, _Accordion.tokens.accordionItemBorderBottom);
15
- var StyledAccordionHeader = exports.StyledAccordionHeader = /*#__PURE__*/_styledComponents["default"].div.withConfig({
15
+ var StyledAccordionHeader = exports.StyledAccordionHeader = /*#__PURE__*/_styledComponents["default"].button.withConfig({
16
16
  componentId: "plasma-new-hope__sc-20ij9z-1"
17
17
  })(["width:100%;border:none;padding:var(", ");display:flex;gap:var(", ");justify-content:space-between;align-items:center;background:none;box-sizing:border-box;cursor:pointer;&.", "{opacity:0.4;cursor:not-allowed;}&:focus{outline:none;}", ""], _Accordion.tokens.accordionItemPadding, _Accordion.tokens.accordionItemGap, _Accordion.classes.accordionDisabled, /*#__PURE__*/(0, _mixins.addFocus)({
18
18
  outlineOffset: '0.125rem',
@@ -36,15 +36,6 @@ export var AccordionItem = function AccordionItem(_ref) {
36
36
  onChange(key, !value);
37
37
  }
38
38
  };
39
- var onKeyPress = function onKeyPress(event) {
40
- if (disabled) {
41
- return;
42
- }
43
- event.persist();
44
- if (event.keyCode === 13 || event.keyCode === 32) {
45
- handleOpen();
46
- }
47
- };
48
39
  var leftContentRef = useRef(null);
49
40
  useEffect(function () {
50
41
  var _leftContentRef$curre, _leftContentRef$curre2;
@@ -83,10 +74,9 @@ export var AccordionItem = function AccordionItem(_ref) {
83
74
  tabIndex: 0,
84
75
  onClick: handleOpen,
85
76
  className: disabledClass,
86
- "aria-expanded": "true",
77
+ "aria-expanded": value,
87
78
  "aria-controls": "accordion-item-section".concat(key),
88
- id: "accordion-item-".concat(key),
89
- onKeyDown: onKeyPress
79
+ id: "accordion-item-".concat(key)
90
80
  }, /*#__PURE__*/React.createElement(StyledAccordionHeaderLeft, null, leftContent && /*#__PURE__*/React.createElement(StyledAccordionContentLeft, {
91
81
  ref: leftContentRef,
92
82
  className: leftContentRotate
@@ -94,6 +84,7 @@ export var AccordionItem = function AccordionItem(_ref) {
94
84
  className: rightContentRotate
95
85
  }, rightContent && rightContent)), /*#__PURE__*/React.createElement(StyledAccordionBodyAnimate, {
96
86
  "aria-labelledby": "accordion-item-".concat(key),
87
+ "aria-hidden": !value,
97
88
  id: "accordion-item-section".concat(key),
98
89
  className: openedBodyClass,
99
90
  style: {
@@ -5,7 +5,7 @@ import { addFocus } from '../../../../mixins';
5
5
  export var StyledAccordionItem = /*#__PURE__*/styled.div.withConfig({
6
6
  componentId: "plasma-new-hope__sc-20ij9z-0"
7
7
  })(["background:var(", ");border-bottom:var(", ");&:last-child{border-bottom:none;}"], tokens.accordionItemBackground, tokens.accordionItemBorderBottom);
8
- export var StyledAccordionHeader = /*#__PURE__*/styled.div.withConfig({
8
+ export var StyledAccordionHeader = /*#__PURE__*/styled.button.withConfig({
9
9
  componentId: "plasma-new-hope__sc-20ij9z-1"
10
10
  })(["width:100%;border:none;padding:var(", ");display:flex;gap:var(", ");justify-content:space-between;align-items:center;background:none;box-sizing:border-box;cursor:pointer;&.", "{opacity:0.4;cursor:not-allowed;}&:focus{outline:none;}", ""], tokens.accordionItemPadding, tokens.accordionItemGap, classes.accordionDisabled, /*#__PURE__*/addFocus({
11
11
  outlineOffset: '0.125rem',
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/Accordion/ui/AccordionItem/AccordionItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,cAAc,EAA8C,MAAM,OAAO,CAAC;AAkB1F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,kBAAkB,CAyGvF,CAAC"}
1
+ {"version":3,"file":"AccordionItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/Accordion/ui/AccordionItem/AccordionItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,cAAc,EAA+B,MAAM,OAAO,CAAC;AAkB3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,kBAAkB,CA+FvF,CAAC"}
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  export declare const StyledAccordionItem: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- export declare const StyledAccordionHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export declare const StyledAccordionHeader: import("styled-components").StyledComponent<"button", any, {}, never>;
4
4
  export declare const StyledAccordionHeaderLeft: import("styled-components").StyledComponent<"div", any, {}, never>;
5
5
  export declare const StyledAccordionContentRight: import("styled-components").StyledComponent<"div", any, {}, never>;
6
6
  export declare const StyledAccordionContentLeft: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionItem.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/Accordion/ui/AccordionItem/AccordionItem.styles.ts"],"names":[],"mappings":";AAMA,eAAO,MAAM,mBAAmB,oEAO/B,CAAC;AAEF,eAAO,MAAM,qBAAqB,oEA2BjC,CAAC;AAEF,eAAO,MAAM,yBAAyB,oEAKrC,CAAC;AAEF,eAAO,MAAM,2BAA2B,oEAQvC,CAAC;AAEF,eAAO,MAAM,0BAA0B,oEAStC,CAAC;AAEF,eAAO,MAAM,oBAAoB,oEAQhC,CAAC;AAEF,eAAO,MAAM,0BAA0B,oEAetC,CAAC;AAEF,eAAO,MAAM,mBAAmB,oEAW/B,CAAC;AAEF,eAAO,MAAM,WAAW,8HAIvB,CAAC;AAEF,eAAO,MAAM,WAAW,8HAmBvB,CAAC;AAEF,eAAO,MAAM,UAAU,oEAOtB,CAAC"}
1
+ {"version":3,"file":"AccordionItem.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/Accordion/ui/AccordionItem/AccordionItem.styles.ts"],"names":[],"mappings":";AAMA,eAAO,MAAM,mBAAmB,oEAO/B,CAAC;AAEF,eAAO,MAAM,qBAAqB,uEA2BjC,CAAC;AAEF,eAAO,MAAM,yBAAyB,oEAKrC,CAAC;AAEF,eAAO,MAAM,2BAA2B,oEAQvC,CAAC;AAEF,eAAO,MAAM,0BAA0B,oEAStC,CAAC;AAEF,eAAO,MAAM,oBAAoB,oEAQhC,CAAC;AAEF,eAAO,MAAM,0BAA0B,oEAetC,CAAC;AAEF,eAAO,MAAM,mBAAmB,oEAW/B,CAAC;AAEF,eAAO,MAAM,WAAW,8HAIvB,CAAC;AAEF,eAAO,MAAM,WAAW,8HAmBvB,CAAC;AAEF,eAAO,MAAM,UAAU,oEAOtB,CAAC"}
@@ -2,7 +2,7 @@ import type { ReactNode } from 'react';
2
2
  import type { Pin } from '../../../../utils/roundness';
3
3
  declare type CustomAccordionItemProps = {
4
4
  /**
5
- * Значение раскрытия аккардеона
5
+ * Значение раскрытия аккордеона
6
6
  */
7
7
  value?: boolean;
8
8
  /**