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

Sign up to get free protection for your applications and to get access to all the features.
@@ -73,23 +73,28 @@ var AccordionItem = function AccordionItem(_ref) {
73
73
  var rightContent = contentRight !== null && contentRight !== void 0 ? contentRight : type === 'sign' ? /*#__PURE__*/React.createElement(StyledAnimationPLus, null) : undefined;
74
74
  var rightContentRotate = type === 'sign' && value ? Accordion_tokens.classes.accordionItemShowBody : undefined;
75
75
  return /*#__PURE__*/React.createElement(AccordionItem_styles.StyledAccordionItem, {
76
- role: "tab",
77
76
  className: Accordion_tokens.classes.accordionItem,
78
- tabIndex: 0,
79
77
  key: key,
80
78
  style: {
81
79
  borderRadius: accordionBorderRadius
82
- },
83
- onKeyDown: onKeyPress
80
+ }
84
81
  }, /*#__PURE__*/React.createElement(AccordionItem_styles.StyledAccordionHeader, {
82
+ role: "tab",
83
+ tabIndex: 0,
85
84
  onClick: handleOpen,
86
- className: disabledClass
85
+ className: disabledClass,
86
+ "aria-expanded": "true",
87
+ "aria-controls": "accordion-item-section".concat(key),
88
+ id: "accordion-item-".concat(key),
89
+ onKeyDown: onKeyPress
87
90
  }, /*#__PURE__*/React.createElement(AccordionItem_styles.StyledAccordionHeaderLeft, null, leftContent && /*#__PURE__*/React.createElement(AccordionItem_styles.StyledAccordionContentLeft, {
88
91
  ref: leftContentRef,
89
92
  className: leftContentRotate
90
93
  }, leftContent), /*#__PURE__*/React.createElement(AccordionItem_styles.StyledAccordionTitle, null, title)), /*#__PURE__*/React.createElement(AccordionItem_styles.StyledAccordionContentRight, {
91
94
  className: rightContentRotate
92
95
  }, rightContent && rightContent)), /*#__PURE__*/React.createElement(AccordionItem_styles.StyledAccordionBodyAnimate, {
96
+ "aria-labelledby": "accordion-item-".concat(key),
97
+ id: "accordion-item-section".concat(key),
93
98
  className: openedBodyClass,
94
99
  style: {
95
100
  paddingLeft: "".concat(leftPadding)
@@ -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 role=\"tab\"\n className={classes.accordionItem}\n tabIndex={0}\n key={key}\n style={{ borderRadius: accordionBorderRadius }}\n onKeyDown={onKeyPress}\n >\n <StyledAccordionHeader onClick={handleOpen} className={disabledClass}>\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 className={openedBodyClass} style={{ paddingLeft: `${leftPadding}` }}>\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","role","accordionItem","tabIndex","style","borderRadius","onKeyDown","StyledAccordionHeader","onClick","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,CA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IAAAA,SAAS,EAAEY,kBAAAA;GACnCD,EAAAA,YAAY,IAAIA,YACQ,CACV,CAAC,eACxBlB,KAAA,CAAAC,aAAA,CAACiC,+CAA0B,EAAA;AAAC3B,IAAAA,SAAS,EAAEZ,eAAgB;AAAC6B,IAAAA,KAAK,EAAE;MAAEW,WAAW,EAAA,EAAA,CAAA3C,MAAA,CAAKhB,WAAW,CAAA;AAAG,KAAA;GAC3FwB,eAAAA,KAAA,CAAAC,aAAA,CAACmC,wCAAmB,EAAExE,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, 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,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 var addFocus = require('../../../../mixins/addFocus.js');
12
12
 
13
13
  var StyledAccordionItem = /*#__PURE__*/styled.div.withConfig({
14
14
  componentId: "plasma-new-hope__sc-iot32d-0"
15
- })(["background:var(", ");border-bottom:var(", ");&:focus{outline:none;}", " &:last-child{border-bottom:none;}"], Accordion_tokens.tokens.accordionItemBackground, Accordion_tokens.tokens.accordionItemBorderBottom, /*#__PURE__*/addFocus.addFocus({
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({
17
+ componentId: "plasma-new-hope__sc-iot32d-1"
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({
16
19
  outlineOffset: '0.125rem',
17
20
  outlineSize: '0.125rem',
18
21
  outlineRadius: '0',
19
22
  outlineColor: /*#__PURE__*/"var(".concat(Accordion_tokens.tokens.accordionItemFocus, ")")
20
23
  }));
21
- var StyledAccordionHeader = /*#__PURE__*/styled.div.withConfig({
22
- componentId: "plasma-new-hope__sc-iot32d-1"
23
- })(["padding:var(", ");display:flex;gap:var(", ");justify-content:space-between;align-items:center;cursor:pointer;&.", "{opacity:0.4;cursor:not-allowed;}"], Accordion_tokens.tokens.accordionItemPadding, Accordion_tokens.tokens.accordionItemGap, Accordion_tokens.classes.accordionDisabled);
24
24
  var StyledAccordionHeaderLeft = /*#__PURE__*/styled.div.withConfig({
25
25
  componentId: "plasma-new-hope__sc-iot32d-2"
26
26
  })(["display:flex;gap:var(", ");justify-content:space-between;align-items:center;"], Accordion_tokens.tokens.accordionItemGap);
@@ -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 &: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 &:last-child {\n border-bottom: none;\n }\n`;\n\nexport const StyledAccordionHeader = styled.div`\n padding: var(${tokens.accordionItemPadding});\n display: flex;\n gap: var(${tokens.accordionItemGap});\n justify-content: space-between;\n align-items: center;\n cursor: pointer;\n\n &.${classes.accordionDisabled} {\n opacity: 0.4;\n cursor: not-allowed;\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","addFocus","outlineOffset","outlineSize","outlineRadius","outlineColor","concat","accordionItemFocus","StyledAccordionHeader","accordionItemPadding","accordionItemGap","classes","accordionDisabled","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,CACvBC,CAAAA,CAAAA,CAAAA,iBAAAA,EAAAA,sBAAAA,EAAAA,0BAAAA,EAAAA,oCAAAA,CAAAA,EAAAA,uBAAM,CAACC,uBAAuB,EAC3BD,uBAAM,CAACE,yBAAyB,eAKnDC,iBAAQ,CAAC;AACPC,EAAAA,aAAa,EAAE,UAAU;AACzBC,EAAAA,WAAW,EAAE,UAAU;AACvBC,EAAAA,aAAa,EAAE,GAAG;AAClBC,EAAAA,YAAY,eAAAC,MAAAA,CAAAA,MAAA,CAASR,uBAAM,CAACS,kBAAkB,EAAA,GAAA,CAAA;AAClD,CAAC,CAAC,EAKL;IAEYC,qBAAqB,gBAAGd,MAAM,CAACC,GAAG,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,8BAAA;AAAA,CAC5BC,CAAAA,CAAAA,CAAAA,cAAAA,EAAAA,yBAAAA,EAAAA,sEAAAA,EAAAA,mCAAAA,CAAAA,EAAAA,uBAAM,CAACW,oBAAoB,EAE/BX,uBAAM,CAACY,gBAAgB,EAK9BC,wBAAO,CAACC,iBAAiB,EAIhC;IAEYC,yBAAyB,gBAAGnB,MAAM,CAACC,GAAG,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,8BAAA;AAAA,CAEpC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ionItem.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,uBAAM,CAACK,gBAAgB,EAO9BC,wBAAO,CAACC,iBAAiB,eAS3BC,iBAAQ,CAAC;AACPC,EAAAA,aAAa,EAAE,UAAU;AACzBC,EAAAA,WAAW,EAAE,UAAU;AACvBC,EAAAA,aAAa,EAAE,GAAG;AAClBC,EAAAA,YAAY,eAAAC,MAAAA,CAAAA,MAAA,CAASb,uBAAM,CAACc,kBAAkB,EAAA,GAAA,CAAA;AAClD,CAAC,CAAC,EACL;IAEYC,yBAAyB,gBAAGnB,MAAM,CAACC,GAAG,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,8BAAA;AAAA,CAEpCC,CAAAA,CAAAA,CAAAA,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
69
69
  var rightContent = contentRight !== null && contentRight !== void 0 ? contentRight : type === 'sign' ? /*#__PURE__*/React.createElement(StyledAnimationPLus, null) : undefined;
70
70
  var rightContentRotate = type === 'sign' && value ? classes.accordionItemShowBody : undefined;
71
71
  return /*#__PURE__*/React.createElement(StyledAccordionItem, {
72
- role: "tab",
73
72
  className: classes.accordionItem,
74
- tabIndex: 0,
75
73
  key: key,
76
74
  style: {
77
75
  borderRadius: accordionBorderRadius
78
- },
79
- onKeyDown: onKeyPress
76
+ }
80
77
  }, /*#__PURE__*/React.createElement(StyledAccordionHeader, {
78
+ role: "tab",
79
+ tabIndex: 0,
81
80
  onClick: handleOpen,
82
- className: disabledClass
81
+ className: disabledClass,
82
+ "aria-expanded": "true",
83
+ "aria-controls": "accordion-item-section".concat(key),
84
+ id: "accordion-item-".concat(key),
85
+ onKeyDown: onKeyPress
83
86
  }, /*#__PURE__*/React.createElement(StyledAccordionHeaderLeft, null, leftContent && /*#__PURE__*/React.createElement(StyledAccordionContentLeft, {
84
87
  ref: leftContentRef,
85
88
  className: leftContentRotate
86
89
  }, leftContent), /*#__PURE__*/React.createElement(StyledAccordionTitle, null, title)), /*#__PURE__*/React.createElement(StyledAccordionContentRight, {
87
90
  className: rightContentRotate
88
91
  }, rightContent && rightContent)), /*#__PURE__*/React.createElement(StyledAccordionBodyAnimate, {
92
+ "aria-labelledby": "accordion-item-".concat(key),
93
+ id: "accordion-item-section".concat(key),
89
94
  className: openedBodyClass,
90
95
  style: {
91
96
  paddingLeft: "".concat(leftPadding)
@@ -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 role=\"tab\"\n className={classes.accordionItem}\n tabIndex={0}\n key={key}\n style={{ borderRadius: accordionBorderRadius }}\n onKeyDown={onKeyPress}\n >\n <StyledAccordionHeader onClick={handleOpen} className={disabledClass}>\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 className={openedBodyClass} style={{ paddingLeft: `${leftPadding}` }}>\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","role","accordionItem","tabIndex","style","borderRadius","onKeyDown","StyledAccordionHeader","onClick","StyledAccordionHeaderLeft","StyledAccordionContentLeft","ref","StyledAccordionTitle","StyledAccordionContentRight","StyledAccordionBodyAnimate","paddingLeft","StyledAccordionBody"],"mappings":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FwB,eAAAA,KAAA,CAAAC,aAAA,CAACmC,mBAAmB,EAAExE,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, 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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D,IAAAA,SAAS,EAAElD,UAAAA;AAAW,GAAA,eAEtBqB,KAAA,CAAAC,aAAA,CAAC6B,yBAAyB,EAAA,IAAA,EACrBhB,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;;;;"}
@@ -8,15 +8,15 @@ import { addFocus } from '../../../../mixins/addFocus.js';
8
8
 
9
9
  var StyledAccordionItem = /*#__PURE__*/styled.div.withConfig({
10
10
  componentId: "plasma-new-hope__sc-iot32d-0"
11
- })(["background:var(", ");border-bottom:var(", ");&:focus{outline:none;}", " &:last-child{border-bottom:none;}"], tokens.accordionItemBackground, tokens.accordionItemBorderBottom, /*#__PURE__*/addFocus({
11
+ })(["background:var(", ");border-bottom:var(", ");&:last-child{border-bottom:none;}"], tokens.accordionItemBackground, tokens.accordionItemBorderBottom);
12
+ var StyledAccordionHeader = /*#__PURE__*/styled.div.withConfig({
13
+ componentId: "plasma-new-hope__sc-iot32d-1"
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({
12
15
  outlineOffset: '0.125rem',
13
16
  outlineSize: '0.125rem',
14
17
  outlineRadius: '0',
15
18
  outlineColor: /*#__PURE__*/"var(".concat(tokens.accordionItemFocus, ")")
16
19
  }));
17
- var StyledAccordionHeader = /*#__PURE__*/styled.div.withConfig({
18
- componentId: "plasma-new-hope__sc-iot32d-1"
19
- })(["padding:var(", ");display:flex;gap:var(", ");justify-content:space-between;align-items:center;cursor:pointer;&.", "{opacity:0.4;cursor:not-allowed;}"], tokens.accordionItemPadding, tokens.accordionItemGap, classes.accordionDisabled);
20
20
  var StyledAccordionHeaderLeft = /*#__PURE__*/styled.div.withConfig({
21
21
  componentId: "plasma-new-hope__sc-iot32d-2"
22
22
  })(["display:flex;gap:var(", ");justify-content:space-between;align-items:center;"], tokens.accordionItemGap);
@@ -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 &: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 &:last-child {\n border-bottom: none;\n }\n`;\n\nexport const StyledAccordionHeader = styled.div`\n padding: var(${tokens.accordionItemPadding});\n display: flex;\n gap: var(${tokens.accordionItemGap});\n justify-content: space-between;\n align-items: center;\n cursor: pointer;\n\n &.${classes.accordionDisabled} {\n opacity: 0.4;\n cursor: not-allowed;\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","addFocus","outlineOffset","outlineSize","outlineRadius","outlineColor","concat","accordionItemFocus","StyledAccordionHeader","accordionItemPadding","accordionItemGap","classes","accordionDisabled","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;E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AACqC,2BAA2B,EAEhCrC,MAAM,CAACsC,8BAA8B,EACtCtC,MAAM,CAACsC,8BAA8B,EAC5D;AAEM,IAAMC,WAAW,gBAAG3C,MAAM,CAAC4C,mBAAmB,CAAC,CAAA1C,UAAA,CAAA;EAAAC,WAAA,EAAA,8BAAA;AAAA,CAGrCC,CAAAA,CAAAA,CAAAA,iDAAAA,EAAAA,IAAAA,CAAAA,EAAAA,MAAM,CAAC+B,sBAAsB,EAC7C;AAEM,IAAMU,WAAW,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,EAOtClB,OAAO,CAACgB,6BAA6B,EAKrChB,OAAO,CAACI,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.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,CAA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AEM,IAAMC,WAAW,gBAAG3C,MAAM,CAAC4C,mBAAmB,CAAC,CAAA1C,UAAA,CAAA;EAAAC,WAAA,EAAA,8BAAA;AAAA,CAGrCC,CAAAA,CAAAA,CAAAA,iDAAAA,EAAAA,IAAAA,CAAAA,EAAAA,MAAM,CAAC+B,sBAAsB,EAC7C;AAEM,IAAMU,WAAW,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;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salutejs/plasma-new-hope",
3
- "version": "0.88.0-canary.1223.9462887113.0",
3
+ "version": "0.88.0-canary.1223.9505247307.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": "e1a603047e80c8086f177567584ab02e41e0106e"
106
+ "gitHead": "09b90fa9fdeda86772f56ffec2ae98d22d8182e4"
107
107
  }
@@ -82,23 +82,28 @@ var AccordionItem = exports.AccordionItem = function AccordionItem(_ref) {
82
82
  var rightContent = contentRight !== null && contentRight !== void 0 ? contentRight : type === 'sign' ? /*#__PURE__*/_react["default"].createElement(StyledAnimationPLus, null) : undefined;
83
83
  var rightContentRotate = type === 'sign' && value ? _Accordion.classes.accordionItemShowBody : undefined;
84
84
  return /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionItem, {
85
- role: "tab",
86
85
  className: _Accordion.classes.accordionItem,
87
- tabIndex: 0,
88
86
  key: key,
89
87
  style: {
90
88
  borderRadius: accordionBorderRadius
91
- },
92
- onKeyDown: onKeyPress
89
+ }
93
90
  }, /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionHeader, {
91
+ role: "tab",
92
+ tabIndex: 0,
94
93
  onClick: handleOpen,
95
- className: disabledClass
94
+ className: disabledClass,
95
+ "aria-expanded": "true",
96
+ "aria-controls": "accordion-item-section".concat(key),
97
+ id: "accordion-item-".concat(key),
98
+ onKeyDown: onKeyPress
96
99
  }, /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionHeaderLeft, null, leftContent && /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionContentLeft, {
97
100
  ref: leftContentRef,
98
101
  className: leftContentRotate
99
102
  }, leftContent), /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionTitle, null, title)), /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionContentRight, {
100
103
  className: rightContentRotate
101
104
  }, rightContent && rightContent)), /*#__PURE__*/_react["default"].createElement(_AccordionItem.StyledAccordionBodyAnimate, {
105
+ "aria-labelledby": "accordion-item-".concat(key),
106
+ id: "accordion-item-section".concat(key),
102
107
  className: openedBodyClass,
103
108
  style: {
104
109
  paddingLeft: "".concat(leftPadding)
@@ -11,15 +11,15 @@ var _mixins = /*#__PURE__*/require("../../../../mixins");
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
12
12
  var StyledAccordionItem = exports.StyledAccordionItem = /*#__PURE__*/_styledComponents["default"].div.withConfig({
13
13
  componentId: "plasma-new-hope__sc-20ij9z-0"
14
- })(["background:var(", ");border-bottom:var(", ");&:focus{outline:none;}", " &:last-child{border-bottom:none;}"], _Accordion.tokens.accordionItemBackground, _Accordion.tokens.accordionItemBorderBottom, /*#__PURE__*/(0, _mixins.addFocus)({
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({
16
+ componentId: "plasma-new-hope__sc-20ij9z-1"
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)({
15
18
  outlineOffset: '0.125rem',
16
19
  outlineSize: '0.125rem',
17
20
  outlineRadius: '0',
18
21
  outlineColor: /*#__PURE__*/"var(".concat(_Accordion.tokens.accordionItemFocus, ")")
19
22
  }));
20
- var StyledAccordionHeader = exports.StyledAccordionHeader = /*#__PURE__*/_styledComponents["default"].div.withConfig({
21
- componentId: "plasma-new-hope__sc-20ij9z-1"
22
- })(["padding:var(", ");display:flex;gap:var(", ");justify-content:space-between;align-items:center;cursor:pointer;&.", "{opacity:0.4;cursor:not-allowed;}"], _Accordion.tokens.accordionItemPadding, _Accordion.tokens.accordionItemGap, _Accordion.classes.accordionDisabled);
23
23
  var StyledAccordionHeaderLeft = exports.StyledAccordionHeaderLeft = /*#__PURE__*/_styledComponents["default"].div.withConfig({
24
24
  componentId: "plasma-new-hope__sc-20ij9z-2"
25
25
  })(["display:flex;gap:var(", ");justify-content:space-between;align-items:center;"], _Accordion.tokens.accordionItemGap);
@@ -73,23 +73,28 @@ export var AccordionItem = function AccordionItem(_ref) {
73
73
  var rightContent = contentRight !== null && contentRight !== void 0 ? contentRight : type === 'sign' ? /*#__PURE__*/React.createElement(StyledAnimationPLus, null) : undefined;
74
74
  var rightContentRotate = type === 'sign' && value ? classes.accordionItemShowBody : undefined;
75
75
  return /*#__PURE__*/React.createElement(StyledAccordionItem, {
76
- role: "tab",
77
76
  className: classes.accordionItem,
78
- tabIndex: 0,
79
77
  key: key,
80
78
  style: {
81
79
  borderRadius: accordionBorderRadius
82
- },
83
- onKeyDown: onKeyPress
80
+ }
84
81
  }, /*#__PURE__*/React.createElement(StyledAccordionHeader, {
82
+ role: "tab",
83
+ tabIndex: 0,
85
84
  onClick: handleOpen,
86
- className: disabledClass
85
+ className: disabledClass,
86
+ "aria-expanded": "true",
87
+ "aria-controls": "accordion-item-section".concat(key),
88
+ id: "accordion-item-".concat(key),
89
+ onKeyDown: onKeyPress
87
90
  }, /*#__PURE__*/React.createElement(StyledAccordionHeaderLeft, null, leftContent && /*#__PURE__*/React.createElement(StyledAccordionContentLeft, {
88
91
  ref: leftContentRef,
89
92
  className: leftContentRotate
90
93
  }, leftContent), /*#__PURE__*/React.createElement(StyledAccordionTitle, null, title)), /*#__PURE__*/React.createElement(StyledAccordionContentRight, {
91
94
  className: rightContentRotate
92
95
  }, rightContent && rightContent)), /*#__PURE__*/React.createElement(StyledAccordionBodyAnimate, {
96
+ "aria-labelledby": "accordion-item-".concat(key),
97
+ id: "accordion-item-section".concat(key),
93
98
  className: openedBodyClass,
94
99
  style: {
95
100
  paddingLeft: "".concat(leftPadding)
@@ -4,15 +4,15 @@ import { classes, tokens } from '../../Accordion.tokens';
4
4
  import { addFocus } from '../../../../mixins';
5
5
  export var StyledAccordionItem = /*#__PURE__*/styled.div.withConfig({
6
6
  componentId: "plasma-new-hope__sc-20ij9z-0"
7
- })(["background:var(", ");border-bottom:var(", ");&:focus{outline:none;}", " &:last-child{border-bottom:none;}"], tokens.accordionItemBackground, tokens.accordionItemBorderBottom, /*#__PURE__*/addFocus({
7
+ })(["background:var(", ");border-bottom:var(", ");&:last-child{border-bottom:none;}"], tokens.accordionItemBackground, tokens.accordionItemBorderBottom);
8
+ export var StyledAccordionHeader = /*#__PURE__*/styled.div.withConfig({
9
+ componentId: "plasma-new-hope__sc-20ij9z-1"
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({
8
11
  outlineOffset: '0.125rem',
9
12
  outlineSize: '0.125rem',
10
13
  outlineRadius: '0',
11
14
  outlineColor: /*#__PURE__*/"var(".concat(tokens.accordionItemFocus, ")")
12
15
  }));
13
- export var StyledAccordionHeader = /*#__PURE__*/styled.div.withConfig({
14
- componentId: "plasma-new-hope__sc-20ij9z-1"
15
- })(["padding:var(", ");display:flex;gap:var(", ");justify-content:space-between;align-items:center;cursor:pointer;&.", "{opacity:0.4;cursor:not-allowed;}"], tokens.accordionItemPadding, tokens.accordionItemGap, classes.accordionDisabled);
16
16
  export var StyledAccordionHeaderLeft = /*#__PURE__*/styled.div.withConfig({
17
17
  componentId: "plasma-new-hope__sc-20ij9z-2"
18
18
  })(["display:flex;gap:var(", ");justify-content:space-between;align-items:center;"], tokens.accordionItemGap);
@@ -9,7 +9,7 @@ declare type CustomAccordionProps = {
9
9
  */
10
10
  size?: string;
11
11
  /**
12
- * Возможность раскрытия всех элементов или только одного
12
+ * Возможность раскрытия всех элементов или только одногo
13
13
  */
14
14
  singleActive?: boolean;
15
15
  /**
@@ -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,CA8FvF,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,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 +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,oEAiB/B,CAAC;AAEF,eAAO,MAAM,qBAAqB,oEAYjC,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,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"}