@salutejs/plasma-new-hope 0.88.0-canary.1252.9517095860.0 → 0.88.0-canary.1254.9538803694.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Accordion/Accordion.css +1 -0
- package/cjs/components/Accordion/Accordion.js +81 -0
- package/cjs/components/Accordion/Accordion.js.map +1 -0
- package/cjs/components/Accordion/Accordion.styles.js +9 -0
- package/cjs/components/Accordion/Accordion.styles.js.map +1 -0
- package/cjs/components/Accordion/Accordion.styles_rsiff6.css +1 -0
- package/cjs/components/Accordion/Accordion.tokens.js +45 -0
- package/cjs/components/Accordion/Accordion.tokens.js.map +1 -0
- package/cjs/components/Accordion/ui/AccordionItem/AccordionItem.js +97 -0
- package/cjs/components/Accordion/ui/AccordionItem/AccordionItem.js.map +1 -0
- package/cjs/components/Accordion/ui/AccordionItem/AccordionItem.styles.js +63 -0
- package/cjs/components/Accordion/ui/AccordionItem/AccordionItem.styles.js.map +1 -0
- package/cjs/components/Accordion/utils/index.js +30 -0
- package/cjs/components/Accordion/utils/index.js.map +1 -0
- package/cjs/components/Accordion/variations/_size/base.js +9 -0
- package/cjs/components/Accordion/variations/_size/base.js.map +1 -0
- package/cjs/components/Accordion/variations/_size/base_x642ct.css +1 -0
- package/cjs/components/Accordion/variations/_view/base.js +9 -0
- package/cjs/components/Accordion/variations/_view/base.js.map +1 -0
- package/cjs/components/Accordion/variations/_view/base_x642ct.css +1 -0
- package/cjs/components/Segment/SegmentProvider/SegmentProvider.js +1 -4
- package/cjs/components/Segment/SegmentProvider/SegmentProvider.js.map +1 -1
- package/cjs/components/Segment/ui/SegmentGroup/SegmentGroup.js +2 -9
- package/cjs/components/Segment/ui/SegmentGroup/SegmentGroup.js.map +1 -1
- package/cjs/components/_Icon/Icon.assets/ChevronDownFill.js +24 -0
- package/cjs/components/_Icon/Icon.assets/ChevronDownFill.js.map +1 -0
- package/cjs/components/_Icon/Icon.assets/Minus.js +22 -0
- package/cjs/components/_Icon/Icon.assets/Minus.js.map +1 -0
- package/cjs/components/_Icon/Icons/IconChevronDownFill.js +23 -0
- package/cjs/components/_Icon/Icons/IconChevronDownFill.js.map +1 -0
- package/cjs/components/_Icon/Icons/IconMinus.js +23 -0
- package/cjs/components/_Icon/Icons/IconMinus.js.map +1 -0
- package/cjs/index.css +2 -0
- package/cjs/index.js +8 -0
- package/cjs/index.js.map +1 -1
- package/es/components/Accordion/Accordion.css +1 -0
- package/es/components/Accordion/Accordion.js +76 -0
- package/es/components/Accordion/Accordion.js.map +1 -0
- package/es/components/Accordion/Accordion.styles.js +5 -0
- package/es/components/Accordion/Accordion.styles.js.map +1 -0
- package/es/components/Accordion/Accordion.styles_rsiff6.css +1 -0
- package/es/components/Accordion/Accordion.tokens.js +40 -0
- package/es/components/Accordion/Accordion.tokens.js.map +1 -0
- package/es/components/Accordion/ui/AccordionItem/AccordionItem.js +93 -0
- package/es/components/Accordion/ui/AccordionItem/AccordionItem.js.map +1 -0
- package/es/components/Accordion/ui/AccordionItem/AccordionItem.styles.js +49 -0
- package/es/components/Accordion/ui/AccordionItem/AccordionItem.styles.js.map +1 -0
- package/es/components/Accordion/utils/index.js +25 -0
- package/es/components/Accordion/utils/index.js.map +1 -0
- package/es/components/Accordion/variations/_size/base.js +5 -0
- package/es/components/Accordion/variations/_size/base.js.map +1 -0
- package/es/components/Accordion/variations/_size/base_x642ct.css +1 -0
- package/es/components/Accordion/variations/_view/base.js +5 -0
- package/es/components/Accordion/variations/_view/base.js.map +1 -0
- package/es/components/Accordion/variations/_view/base_x642ct.css +1 -0
- package/es/components/Segment/SegmentProvider/SegmentProvider.js +1 -4
- package/es/components/Segment/SegmentProvider/SegmentProvider.js.map +1 -1
- package/es/components/Segment/ui/SegmentGroup/SegmentGroup.js +2 -9
- package/es/components/Segment/ui/SegmentGroup/SegmentGroup.js.map +1 -1
- package/es/components/_Icon/Icon.assets/ChevronDownFill.js +20 -0
- package/es/components/_Icon/Icon.assets/ChevronDownFill.js.map +1 -0
- package/es/components/_Icon/Icon.assets/Minus.js +18 -0
- package/es/components/_Icon/Icon.assets/Minus.js.map +1 -0
- package/es/components/_Icon/Icons/IconChevronDownFill.js +19 -0
- package/es/components/_Icon/Icons/IconChevronDownFill.js.map +1 -0
- package/es/components/_Icon/Icons/IconMinus.js +19 -0
- package/es/components/_Icon/Icons/IconMinus.js.map +1 -0
- package/es/index.css +2 -0
- package/es/index.js +3 -0
- package/es/index.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Accordion/Accordion.js +90 -0
- package/styled-components/cjs/components/Accordion/Accordion.styles.js +9 -0
- package/styled-components/cjs/components/Accordion/Accordion.tokens.js +43 -0
- package/styled-components/cjs/components/Accordion/Accordion.types.js +5 -0
- package/styled-components/cjs/components/Accordion/index.js +38 -0
- package/styled-components/cjs/components/Accordion/ui/AccordionItem/AccordionItem.js +103 -0
- package/styled-components/cjs/components/Accordion/ui/AccordionItem/AccordionItem.styles.js +49 -0
- package/styled-components/cjs/components/Accordion/ui/AccordionItem/AccordionItem.types.js +5 -0
- package/styled-components/cjs/components/Accordion/utils/index.js +27 -0
- package/styled-components/cjs/components/Accordion/variations/_size/base.js +8 -0
- package/styled-components/cjs/components/Accordion/variations/_size/tokens.json +6 -0
- package/styled-components/cjs/components/Accordion/variations/_stretching/base.js +8 -0
- package/styled-components/cjs/components/Accordion/variations/_stretching/tokens.json +1 -0
- package/styled-components/cjs/components/Accordion/variations/_view/base.js +8 -0
- package/styled-components/cjs/components/Accordion/variations/_view/tokens.json +8 -0
- package/styled-components/cjs/components/Segment/Segment.template-doc.mdx +1 -6
- package/styled-components/cjs/components/Segment/SegmentProvider/SegmentProvider.js +1 -4
- package/styled-components/cjs/components/Segment/ui/SegmentGroup/SegmentGroup.js +2 -9
- package/styled-components/cjs/components/_Icon/Icon.assets/ChevronDownFill.js +23 -0
- package/styled-components/cjs/components/_Icon/Icon.assets/Minus.js +21 -0
- package/styled-components/cjs/components/_Icon/Icons/IconChevronDownFill.js +22 -0
- package/styled-components/cjs/components/_Icon/Icons/IconMinus.js +22 -0
- package/styled-components/cjs/components/_Icon/index.js +15 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Accordion/Accordion.config.js +26 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Accordion/Accordion.js +17 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Accordion/Accordion.stories.tsx +66 -0
- package/styled-components/cjs/examples/plasma_web/components/Accordion/Accordion.config.js +30 -0
- package/styled-components/cjs/examples/plasma_web/components/Accordion/Accordion.js +17 -0
- package/styled-components/cjs/examples/plasma_web/components/Accordion/Accordion.stories.tsx +65 -0
- package/styled-components/cjs/index.js +11 -0
- package/styled-components/es/components/Accordion/Accordion.js +81 -0
- package/styled-components/es/components/Accordion/Accordion.styles.js +3 -0
- package/styled-components/es/components/Accordion/Accordion.tokens.js +37 -0
- package/styled-components/es/components/Accordion/Accordion.types.js +1 -0
- package/styled-components/es/components/Accordion/index.js +3 -0
- package/styled-components/es/components/Accordion/ui/AccordionItem/AccordionItem.js +94 -0
- package/styled-components/es/components/Accordion/ui/AccordionItem/AccordionItem.styles.js +42 -0
- package/styled-components/es/components/Accordion/ui/AccordionItem/AccordionItem.types.js +1 -0
- package/styled-components/es/components/Accordion/utils/index.js +21 -0
- package/styled-components/es/components/Accordion/variations/_size/base.js +2 -0
- package/styled-components/es/components/Accordion/variations/_size/tokens.json +6 -0
- package/styled-components/es/components/Accordion/variations/_stretching/base.js +2 -0
- package/styled-components/es/components/Accordion/variations/_stretching/tokens.json +1 -0
- package/styled-components/es/components/Accordion/variations/_view/base.js +2 -0
- package/styled-components/es/components/Accordion/variations/_view/tokens.json +8 -0
- package/styled-components/es/components/Segment/Segment.template-doc.mdx +1 -6
- package/styled-components/es/components/Segment/SegmentProvider/SegmentProvider.js +1 -4
- package/styled-components/es/components/Segment/ui/SegmentGroup/SegmentGroup.js +2 -9
- package/styled-components/es/components/_Icon/Icon.assets/ChevronDownFill.js +16 -0
- package/styled-components/es/components/_Icon/Icon.assets/Minus.js +14 -0
- package/styled-components/es/components/_Icon/Icons/IconChevronDownFill.js +15 -0
- package/styled-components/es/components/_Icon/Icons/IconMinus.js +15 -0
- package/styled-components/es/components/_Icon/index.js +3 -1
- package/styled-components/es/examples/plasma_b2c/components/Accordion/Accordion.config.js +20 -0
- package/styled-components/es/examples/plasma_b2c/components/Accordion/Accordion.js +6 -0
- package/styled-components/es/examples/plasma_b2c/components/Accordion/Accordion.stories.tsx +66 -0
- package/styled-components/es/examples/plasma_web/components/Accordion/Accordion.config.js +24 -0
- package/styled-components/es/examples/plasma_web/components/Accordion/Accordion.js +6 -0
- package/styled-components/es/examples/plasma_web/components/Accordion/Accordion.stories.tsx +65 -0
- package/styled-components/es/index.js +2 -1
- package/types/components/Accordion/Accordion.d.ts +43 -0
- package/types/components/Accordion/Accordion.d.ts.map +1 -0
- package/types/components/Accordion/Accordion.styles.d.ts +2 -0
- package/types/components/Accordion/Accordion.styles.d.ts.map +1 -0
- package/types/components/Accordion/Accordion.tokens.d.ts +38 -0
- package/types/components/Accordion/Accordion.tokens.d.ts.map +1 -0
- package/types/components/Accordion/Accordion.types.d.ts +36 -0
- package/types/components/Accordion/Accordion.types.d.ts.map +1 -0
- package/types/components/Accordion/index.d.ts +5 -0
- package/types/components/Accordion/index.d.ts.map +1 -0
- package/types/components/Accordion/ui/AccordionItem/AccordionItem.d.ts +4 -0
- package/types/components/Accordion/ui/AccordionItem/AccordionItem.d.ts.map +1 -0
- package/types/components/Accordion/ui/AccordionItem/AccordionItem.styles.d.ts +13 -0
- package/types/components/Accordion/ui/AccordionItem/AccordionItem.styles.d.ts.map +1 -0
- package/types/components/Accordion/ui/AccordionItem/AccordionItem.types.d.ts +51 -0
- package/types/components/Accordion/ui/AccordionItem/AccordionItem.types.d.ts.map +1 -0
- package/types/components/Accordion/utils/index.d.ts +17 -0
- package/types/components/Accordion/utils/index.d.ts.map +1 -0
- package/types/components/Accordion/variations/_size/base.d.ts +2 -0
- package/types/components/Accordion/variations/_size/base.d.ts.map +1 -0
- package/types/components/Accordion/variations/_stretching/base.d.ts +2 -0
- package/types/components/Accordion/variations/_stretching/base.d.ts.map +1 -0
- package/types/components/Accordion/variations/_view/base.d.ts +2 -0
- package/types/components/Accordion/variations/_view/base.d.ts.map +1 -0
- package/types/components/Segment/SegmentProvider/SegmentProvider.d.ts.map +1 -1
- package/types/components/Segment/SegmentProvider/SegmentProvider.types.d.ts +3 -4
- package/types/components/Segment/SegmentProvider/SegmentProvider.types.d.ts.map +1 -1
- package/types/components/Segment/ui/SegmentGroup/SegmentGroup.d.ts +0 -2
- package/types/components/Segment/ui/SegmentGroup/SegmentGroup.d.ts.map +1 -1
- package/types/components/Segment/ui/SegmentGroup/SegmentGroup.types.d.ts +0 -5
- package/types/components/Segment/ui/SegmentGroup/SegmentGroup.types.d.ts.map +1 -1
- package/types/components/_Icon/Icon.assets/ChevronDownFill.d.ts +4 -0
- package/types/components/_Icon/Icon.assets/ChevronDownFill.d.ts.map +1 -0
- package/types/components/_Icon/Icon.assets/Minus.d.ts +4 -0
- package/types/components/_Icon/Icon.assets/Minus.d.ts.map +1 -0
- package/types/components/_Icon/Icons/IconChevronDownFill.d.ts +4 -0
- package/types/components/_Icon/Icons/IconChevronDownFill.d.ts.map +1 -0
- package/types/components/_Icon/Icons/IconMinus.d.ts +4 -0
- package/types/components/_Icon/Icons/IconMinus.d.ts.map +1 -0
- package/types/components/_Icon/index.d.ts +2 -0
- package/types/components/_Icon/index.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Accordion/Accordion.config.d.ts +19 -0
- package/types/examples/plasma_b2c/components/Accordion/Accordion.config.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Accordion/Accordion.d.ts +26 -0
- package/types/examples/plasma_b2c/components/Accordion/Accordion.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Segment/Segment.d.ts +0 -1
- package/types/examples/plasma_b2c/components/Segment/Segment.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Accordion/Accordion.config.d.ts +23 -0
- package/types/examples/plasma_web/components/Accordion/Accordion.config.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Accordion/Accordion.d.ts +30 -0
- package/types/examples/plasma_web/components/Accordion/Accordion.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Segment/Segment.d.ts +0 -1
- package/types/examples/plasma_web/components/Segment/Segment.d.ts.map +1 -1
- package/types/examples/sds_engineer/components/Segment/Segment.d.ts +0 -1
- package/types/examples/sds_engineer/components/Segment/Segment.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- /package/cjs/components/{_Icon/Icons/IconClose.css → Accordion/ui/AccordionItem/AccordionItem.css} +0 -0
- /package/es/components/{_Icon/Icons/IconClose.css → Accordion/ui/AccordionItem/AccordionItem.css} +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SegmentGroup.js","sources":["../../../../../src/components/Segment/ui/SegmentGroup/SegmentGroup.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useMemo, useState, Children, useEffect } from 'react';\nimport type { SetStateAction, RefObject, MutableRefObject } from 'react';\nimport { safeUseId, useCarousel } from '@salutejs/plasma-core';\n\nimport type { RootProps } from '../../../../engines/types';\nimport { IconDisclosureLeft, IconDisclosureRight } from '../../../_Icon';\nimport { classes, tokens } from '../../tokens';\nimport { cx } from '../../../../utils';\nimport { useSegmentInner } from '../../SegmentProvider/SegmentProvider';\n\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as pilledCSS } from './variations/_pilled/base';\nimport { base as filledBackgroundCSS } from './variations/_filledBackgound/base';\nimport { base as stretchCSS } from './variations/_stretch/base';\nimport type { SegmentGroupProps } from './SegmentGroup.types';\nimport { StyledArrow, StyledContent, StyledContentWrapper, base } from './SegmentGroup.styles';\n\nexport const segmentGroupRoot = (Root: RootProps<HTMLDivElement, SegmentGroupProps>) =>\n forwardRef<HTMLDivElement, SegmentGroupProps>((props, outerRef) => {\n const {\n id,\n selectionMode,\n pilled,\n stretch,\n filledBackground = false,\n disabled = false,\n size,\n view,\n children,\n defaultSelected,\n ...rest\n } = props;\n\n const { setSelectionMode, setDisabledGroup, setSelectedSegmentItems } = useSegmentInner();\n\n const [index, setIndex] = useState(0);\n const [firstItemVisible, setFirstItemVisible] = useState(false);\n const [lastItemVisible, setLastItemVisible] = useState(false);\n\n const uniqId = safeUseId();\n const segmentGroupId = id || uniqId;\n\n const pilledAttr = view !== 'clear' && pilled;\n const filledBackgroundAttr = view !== 'clear' && filledBackground;\n const pilledClass = pilledAttr ? classes.segmentPilled : undefined;\n const filledClass = filledBackgroundAttr ? classes.segmentGroupFilledBackground : undefined;\n const stretchClass = firstItemVisible && lastItemVisible && stretch ? classes.segmentStretch : undefined;\n\n const items = Children?.map(children, (child) => child) || [];\n\n const onPrev = useCallback(() => {\n !disabled && setIndex((prevIndex) => (prevIndex > 0 ? prevIndex - 1 : 0));\n }, [disabled]);\n\n const onNext = useCallback(() => {\n !disabled && setIndex((prevIndex) => (prevIndex < items.length - 1 ? prevIndex + 1 : prevIndex));\n }, [disabled]);\n\n const onIntersecting = (setVisible: (value: SetStateAction<boolean>) => void) => (\n entries: IntersectionObserverEntry[],\n ) => {\n /*\n * Пробегаемся по элементам на которых есть слушатель события появления.\n * Если элемент находится в зоне видимости или выходит из нее, меняем значение флага видимости\n */\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n setVisible(true);\n } else {\n setVisible(false);\n }\n });\n };\n\n const { scrollRef, trackRef } = useCarousel({\n index,\n axis: 'x',\n scrollAlign: 'start',\n detectActive: true,\n debounceMs: 250,\n onIndexChange: setIndex,\n });\n\n const PreviousButton = useMemo(\n () => (\n <StyledArrow\n type=\"button\"\n aria-label=\"Предыдущий сегмент\"\n onClick={onPrev}\n tabIndex={disabled ? -1 : 0}\n disabled={disabled}\n >\n <IconDisclosureLeft color={`var(${tokens.arrowColor})`} />\n </StyledArrow>\n ),\n [onPrev],\n );\n\n const NextButton = useMemo(\n () => (\n <StyledArrow\n type=\"button\"\n aria-label=\"Следующий сегмент\"\n onClick={onNext}\n tabIndex={disabled ? -1 : 0}\n disabled={disabled}\n >\n <IconDisclosureRight color={`var(${tokens.arrowColor})`} />\n </StyledArrow>\n ),\n [onNext],\n );\n\n useEffect(() => {\n selectionMode && setSelectionMode(selectionMode);\n setDisabledGroup(disabled);\n }, [selectionMode, disabled]);\n\n useEffect(() => {\n if (defaultSelected?.length) {\n setSelectedSegmentItems(defaultSelected);\n }\n }, [defaultSelected]);\n\n useEffect(() => {\n // Intersection observer для первого сегмента\n const observeFirstItem = new IntersectionObserver(onIntersecting(setFirstItemVisible), {\n root: null,\n rootMargin: '0px',\n threshold: 0.5,\n });\n\n // Intersection observer для последнего сегмента\n const observeLastItem = new IntersectionObserver(onIntersecting(setLastItemVisible), {\n root: null,\n rootMargin: '0px',\n threshold: 0.5,\n });\n\n // получаем список сегментов внутри SegmentGroup\n const childrenArray = Array.from(trackRef.current?.children || []) as Array<Element>;\n if (childrenArray.length) {\n // подписываемся на событие появление внутри SegmentGroup\n observeFirstItem.observe(childrenArray[0]);\n observeLastItem.observe(childrenArray[childrenArray.length - 1]);\n }\n\n return () => {\n // отписываемся от события появления внутри SegmentGroup\n observeFirstItem.disconnect();\n observeLastItem.disconnect();\n };\n }, [children]);\n\n return (\n <Root\n view={view}\n size={size}\n id={segmentGroupId}\n ref={outerRef}\n filledBackground={filledBackgroundAttr}\n disabled={disabled}\n pilled={pilledAttr}\n className={cx(pilledClass, filledClass, stretchClass)}\n {...rest}\n >\n {!firstItemVisible && PreviousButton}\n <StyledContentWrapper ref={scrollRef as RefObject<HTMLDivElement>}>\n <StyledContent ref={trackRef as MutableRefObject<HTMLDivElement | null>}>{children}</StyledContent>\n </StyledContentWrapper>\n {!lastItemVisible && NextButton}\n </Root>\n );\n });\n\nexport const segmentGroupConfig = {\n name: 'SegmentGroup',\n tag: 'div',\n layout: segmentGroupRoot,\n base,\n variations: {\n size: {\n css: sizeCSS,\n },\n view: {\n css: viewCSS,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n pilled: {\n css: pilledCSS,\n attrs: true,\n },\n stretch: {\n css: stretchCSS,\n attrs: true,\n },\n filledBackground: {\n css: filledBackgroundCSS,\n attrs: true,\n },\n },\n defaults: {\n view: 'clear',\n size: 'xs',\n },\n};\n"],"names":["segmentGroupRoot","Root","forwardRef","props","outerRef","id","selectionMode","pilled","stretch","_props$filledBackgrou","filledBackground","_props$disabled","disabled","size","view","children","defaultSelected","rest","_objectWithoutProperties","_excluded","_useSegmentInner","useSegmentInner","setSelectionMode","setDisabledGroup","setSelectedSegmentItems","_useState","useState","_useState2","_slicedToArray","index","setIndex","_useState3","_useState4","firstItemVisible","setFirstItemVisible","_useState5","_useState6","lastItemVisible","setLastItemVisible","uniqId","safeUseId","segmentGroupId","pilledAttr","filledBackgroundAttr","pilledClass","classes","segmentPilled","undefined","filledClass","segmentGroupFilledBackground","stretchClass","segmentStretch","items","Children","map","child","onPrev","useCallback","prevIndex","onNext","length","onIntersecting","setVisible","entries","forEach","entry","isIntersecting","_useCarousel","useCarousel","axis","scrollAlign","detectActive","debounceMs","onIndexChange","scrollRef","trackRef","PreviousButton","useMemo","React","createElement","StyledArrow","type","onClick","tabIndex","IconDisclosureLeft","color","concat","tokens","arrowColor","NextButton","IconDisclosureRight","useEffect","_trackRef$current","observeFirstItem","IntersectionObserver","root","rootMargin","threshold","observeLastItem","childrenArray","Array","from","current","observe","disconnect","_extends","ref","className","cx","StyledContentWrapper","StyledContent","segmentGroupConfig","name","tag","layout","base","variations","css","sizeCSS","viewCSS","disabledCSS","attrs","pilledCSS","stretchCSS","filledBackgroundCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;IAmBaA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,IAAkD,EAAA;AAAA,EAAA,oBAC/EC,gBAAU,CAAoC,UAACC,KAAK,EAAEC,QAAQ,EAAK;AAC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K,EAAE,IAAA;KACV;AACDlH,IAAAA,MAAM,EAAE;AACJ8G,MAAAA,GAAG,EAAEK,WAAS;AACdD,MAAAA,KAAK,EAAE,IAAA;KACV;AACDjH,IAAAA,OAAO,EAAE;AACL6G,MAAAA,GAAG,EAAEM,WAAU;AACfF,MAAAA,KAAK,EAAE,IAAA;KACV;AACD/G,IAAAA,gBAAgB,EAAE;AACd2G,MAAAA,GAAG,EAAEO,WAAmB;AACxBH,MAAAA,KAAK,EAAE,IAAA;AACX,KAAA;GACH;AACDI,EAAAA,QAAQ,EAAE;AACN/G,IAAAA,IAAI,EAAE,OAAO;AACbD,IAAAA,IAAI,EAAE,IAAA;AACV,GAAA;AACJ;;;;;"}
|
1
|
+
{"version":3,"file":"SegmentGroup.js","sources":["../../../../../src/components/Segment/ui/SegmentGroup/SegmentGroup.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useMemo, useState, Children, useEffect } from 'react';\nimport type { SetStateAction, RefObject, MutableRefObject } from 'react';\nimport { safeUseId, useCarousel } from '@salutejs/plasma-core';\n\nimport type { RootProps } from '../../../../engines/types';\nimport { IconDisclosureLeft, IconDisclosureRight } from '../../../_Icon';\nimport { classes, tokens } from '../../tokens';\nimport { cx } from '../../../../utils';\nimport { useSegmentInner } from '../../SegmentProvider/SegmentProvider';\n\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as pilledCSS } from './variations/_pilled/base';\nimport { base as filledBackgroundCSS } from './variations/_filledBackgound/base';\nimport { base as stretchCSS } from './variations/_stretch/base';\nimport type { SegmentGroupProps } from './SegmentGroup.types';\nimport { StyledArrow, StyledContent, StyledContentWrapper, base } from './SegmentGroup.styles';\n\nexport const segmentGroupRoot = (Root: RootProps<HTMLDivElement, SegmentGroupProps>) =>\n forwardRef<HTMLDivElement, SegmentGroupProps>((props, outerRef) => {\n const {\n id,\n selectionMode,\n pilled,\n stretch,\n filledBackground = false,\n disabled = false,\n size,\n view,\n children,\n ...rest\n } = props;\n\n const { setSelectionMode, setDisabledGroup } = useSegmentInner();\n\n const [index, setIndex] = useState(0);\n const [firstItemVisible, setFirstItemVisible] = useState(false);\n const [lastItemVisible, setLastItemVisible] = useState(false);\n\n const uniqId = safeUseId();\n const segmentGroupId = id || uniqId;\n\n const pilledAttr = view !== 'clear' && pilled;\n const filledBackgroundAttr = view !== 'clear' && filledBackground;\n const pilledClass = pilledAttr ? classes.segmentPilled : undefined;\n const filledClass = filledBackgroundAttr ? classes.segmentGroupFilledBackground : undefined;\n const stretchClass = firstItemVisible && lastItemVisible && stretch ? classes.segmentStretch : undefined;\n\n const items = Children?.map(children, (child) => child) || [];\n\n const onPrev = useCallback(() => {\n !disabled && setIndex((prevIndex) => (prevIndex > 0 ? prevIndex - 1 : 0));\n }, [disabled]);\n\n const onNext = useCallback(() => {\n !disabled && setIndex((prevIndex) => (prevIndex < items.length - 1 ? prevIndex + 1 : prevIndex));\n }, [disabled]);\n\n const onIntersecting = (setVisible: (value: SetStateAction<boolean>) => void) => (\n entries: IntersectionObserverEntry[],\n ) => {\n /*\n * Пробегаемся по элементам на которых есть слушатель события появления.\n * Если элемент находится в зоне видимости или выходит из нее, меняем значение флага видимости\n */\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n setVisible(true);\n } else {\n setVisible(false);\n }\n });\n };\n\n const { scrollRef, trackRef } = useCarousel({\n index,\n axis: 'x',\n scrollAlign: 'start',\n detectActive: true,\n debounceMs: 250,\n onIndexChange: setIndex,\n });\n\n const PreviousButton = useMemo(\n () => (\n <StyledArrow\n type=\"button\"\n aria-label=\"Предыдущий сегмент\"\n onClick={onPrev}\n tabIndex={disabled ? -1 : 0}\n disabled={disabled}\n >\n <IconDisclosureLeft color={`var(${tokens.arrowColor})`} />\n </StyledArrow>\n ),\n [onPrev],\n );\n\n const NextButton = useMemo(\n () => (\n <StyledArrow\n type=\"button\"\n aria-label=\"Следующий сегмент\"\n onClick={onNext}\n tabIndex={disabled ? -1 : 0}\n disabled={disabled}\n >\n <IconDisclosureRight color={`var(${tokens.arrowColor})`} />\n </StyledArrow>\n ),\n [onNext],\n );\n\n useEffect(() => {\n selectionMode && setSelectionMode(selectionMode);\n setDisabledGroup(disabled);\n }, [selectionMode, disabled]);\n\n useEffect(() => {\n // Intersection observer для первого сегмента\n const observeFirstItem = new IntersectionObserver(onIntersecting(setFirstItemVisible), {\n root: null,\n rootMargin: '0px',\n threshold: 0.5,\n });\n\n // Intersection observer для последнего сегмента\n const observeLastItem = new IntersectionObserver(onIntersecting(setLastItemVisible), {\n root: null,\n rootMargin: '0px',\n threshold: 0.5,\n });\n\n // получаем список сегментов внутри SegmentGroup\n const childrenArray = Array.from(trackRef.current?.children || []) as Array<Element>;\n if (childrenArray.length) {\n // подписываемся на событие появление внутри SegmentGroup\n observeFirstItem.observe(childrenArray[0]);\n observeLastItem.observe(childrenArray[childrenArray.length - 1]);\n }\n\n return () => {\n // отписываемся от события появления внутри SegmentGroup\n observeFirstItem.disconnect();\n observeLastItem.disconnect();\n };\n }, [children]);\n\n return (\n <Root\n view={view}\n size={size}\n id={segmentGroupId}\n ref={outerRef}\n filledBackground={filledBackgroundAttr}\n disabled={disabled}\n pilled={pilledAttr}\n className={cx(pilledClass, filledClass, stretchClass)}\n {...rest}\n >\n {!firstItemVisible && PreviousButton}\n <StyledContentWrapper ref={scrollRef as RefObject<HTMLDivElement>}>\n <StyledContent ref={trackRef as MutableRefObject<HTMLDivElement | null>}>{children}</StyledContent>\n </StyledContentWrapper>\n {!lastItemVisible && NextButton}\n </Root>\n );\n });\n\nexport const segmentGroupConfig = {\n name: 'SegmentGroup',\n tag: 'div',\n layout: segmentGroupRoot,\n base,\n variations: {\n size: {\n css: sizeCSS,\n },\n view: {\n css: viewCSS,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n pilled: {\n css: pilledCSS,\n attrs: true,\n },\n stretch: {\n css: stretchCSS,\n attrs: true,\n },\n filledBackground: {\n css: filledBackgroundCSS,\n attrs: true,\n },\n },\n defaults: {\n view: 'clear',\n size: 'xs',\n },\n};\n"],"names":["segmentGroupRoot","Root","forwardRef","props","outerRef","id","selectionMode","pilled","stretch","_props$filledBackgrou","filledBackground","_props$disabled","disabled","size","view","children","rest","_objectWithoutProperties","_excluded","_useSegmentInner","useSegmentInner","setSelectionMode","setDisabledGroup","_useState","useState","_useState2","_slicedToArray","index","setIndex","_useState3","_useState4","firstItemVisible","setFirstItemVisible","_useState5","_useState6","lastItemVisible","setLastItemVisible","uniqId","safeUseId","segmentGroupId","pilledAttr","filledBackgroundAttr","pilledClass","classes","segmentPilled","undefined","filledClass","segmentGroupFilledBackground","stretchClass","segmentStretch","items","Children","map","child","onPrev","useCallback","prevIndex","onNext","length","onIntersecting","setVisible","entries","forEach","entry","isIntersecting","_useCarousel","useCarousel","axis","scrollAlign","detectActive","debounceMs","onIndexChange","scrollRef","trackRef","PreviousButton","useMemo","React","createElement","StyledArrow","type","onClick","tabIndex","IconDisclosureLeft","color","concat","tokens","arrowColor","NextButton","IconDisclosureRight","useEffect","_trackRef$current","observeFirstItem","IntersectionObserver","root","rootMargin","threshold","observeLastItem","childrenArray","Array","from","current","observe","disconnect","_extends","ref","className","cx","StyledContentWrapper","StyledContent","segmentGroupConfig","name","tag","layout","base","variations","css","sizeCSS","viewCSS","disabledCSS","attrs","pilledCSS","stretchCSS","filledBackgroundCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;IAmBaA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,IAAkD,EAAA;AAAA,EAAA,oBAC/EC,gBAAU,CAAoC,UAACC,KAAK,EAAEC,QAAQ,EAAK;AAC/D,IAAA,IACIC,EAAE,GAUFF,KAAK,CAVLE,EAAE;MACFC,aAAa,GASbH,KAAK,CATLG,aAAa;MACbC,MAAM,GAQNJ,KAAK,CARLI,MAAM;MACNC,OAAO,GAOPL,KAAK,CAPLK,OAAO;MAAAC,qBAAA,GAOPN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
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
6
|
+
var React = require('react');
|
7
|
+
|
8
|
+
var _path;
|
9
|
+
var ChevronDownFill = function ChevronDownFill(props) {
|
10
|
+
return /*#__PURE__*/React.createElement("svg", _rollupPluginBabelHelpers.extends({
|
11
|
+
width: "100%",
|
12
|
+
viewBox: "0 0 16 16",
|
13
|
+
fill: "none"
|
14
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
15
|
+
id: "path",
|
16
|
+
d: "M11.45 5.79C11.37 5.61 11.19 5.5 11 5.5L5 5.5C4.8 5.5 4.62 5.61 4.54 5.79C4.46 5.96 4.49 6.17 4.62 6.32L7.62 9.82C7.71 9.93 7.85 10 8 10C8.14 10 8.28 9.93 8.37 9.82L11.37 6.32C11.5 6.17 11.53 5.96 11.45 5.79Z",
|
17
|
+
fillRule: "evenodd",
|
18
|
+
fill: "currentColor",
|
19
|
+
clipRule: "evenodd"
|
20
|
+
})));
|
21
|
+
};
|
22
|
+
|
23
|
+
exports.ChevronDownFill = ChevronDownFill;
|
24
|
+
//# sourceMappingURL=ChevronDownFill.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ChevronDownFill.js","sources":["../../../../src/components/_Icon/Icon.assets/ChevronDownFill.tsx"],"sourcesContent":["import React from 'react';\n\nimport { IconProps } from '../IconRoot';\n\nexport const ChevronDownFill: React.FC<IconProps> = (props) => (\n <svg width=\"100%\" viewBox=\"0 0 16 16\" fill=\"none\" {...props}>\n <path\n id=\"path\"\n d=\"M11.45 5.79C11.37 5.61 11.19 5.5 11 5.5L5 5.5C4.8 5.5 4.62 5.61 4.54 5.79C4.46 5.96 4.49 6.17 4.62 6.32L7.62 9.82C7.71 9.93 7.85 10 8 10C8.14 10 8.28 9.93 8.37 9.82L11.37 6.32C11.5 6.17 11.53 5.96 11.45 5.79Z\"\n fillRule=\"evenodd\"\n fill=\"currentColor\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n"],"names":["ChevronDownFill","props","React","createElement","_extends","width","viewBox","fill","_path","id","d","fillRule","clipRule"],"mappings":";;;;;;;;IAIaA,eAAoC,GAAG,SAAvCA,eAAoCA,CAAIC,KAAK,EAAA;AAAA,EAAA,oBACtDC,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAAC,iCAAA,CAAA;AAAKC,IAAAA,KAAK,EAAC,MAAM;AAACC,IAAAA,OAAO,EAAC,WAAW;AAACC,IAAAA,IAAI,EAAC,MAAA;GAAWN,EAAAA,KAAK,GAAAO,KAAA,KAAAA,KAAA,gBACvDN,KAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AACIM,IAAAA,EAAE,EAAC,MAAM;AACTC,IAAAA,CAAC,EAAC,kNAAkN;AACpNC,IAAAA,QAAQ,EAAC,SAAS;AAClBJ,IAAAA,IAAI,EAAC,cAAc;AACnBK,IAAAA,QAAQ,EAAC,SAAA;GACZ,CAAC,CACD,CAAC,CAAA;AAAA;;;;"}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
6
|
+
var React = require('react');
|
7
|
+
|
8
|
+
var _path;
|
9
|
+
var Minus = function Minus(props) {
|
10
|
+
return /*#__PURE__*/React.createElement("svg", _rollupPluginBabelHelpers.extends({
|
11
|
+
width: "100%",
|
12
|
+
viewBox: "0 0 24 24",
|
13
|
+
fill: "none"
|
14
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
15
|
+
id: "icon",
|
16
|
+
d: "M3.25 12C3.25 11.58 3.58 11.25 4 11.25L20 11.25C20.41 11.25 20.75 11.58 20.75 12C20.75 12.41 20.41 12.75 20 12.75L4 12.75C3.58 12.75 3.25 12.41 3.25 12Z",
|
17
|
+
fill: "currentColor"
|
18
|
+
})));
|
19
|
+
};
|
20
|
+
|
21
|
+
exports.Minus = Minus;
|
22
|
+
//# sourceMappingURL=Minus.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Minus.js","sources":["../../../../src/components/_Icon/Icon.assets/Minus.tsx"],"sourcesContent":["import React from 'react';\n\nimport { IconProps } from '../IconRoot';\n\nexport const Minus: React.FC<IconProps> = (props) => (\n <svg width=\"100%\" viewBox=\"0 0 24 24\" fill=\"none\" {...props}>\n <path\n id=\"icon\"\n d=\"M3.25 12C3.25 11.58 3.58 11.25 4 11.25L20 11.25C20.41 11.25 20.75 11.58 20.75 12C20.75 12.41 20.41 12.75 20 12.75L4 12.75C3.58 12.75 3.25 12.41 3.25 12Z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n"],"names":["Minus","props","React","createElement","_extends","width","viewBox","fill","_path","id","d"],"mappings":";;;;;;;;IAIaA,KAA0B,GAAG,SAA7BA,KAA0BA,CAAIC,KAAK,EAAA;AAAA,EAAA,oBAC5CC,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAAC,iCAAA,CAAA;AAAKC,IAAAA,KAAK,EAAC,MAAM;AAACC,IAAAA,OAAO,EAAC,WAAW;AAACC,IAAAA,IAAI,EAAC,MAAA;GAAWN,EAAAA,KAAK,GAAAO,KAAA,KAAAA,KAAA,gBACvDN,KAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AACIM,IAAAA,EAAE,EAAC,MAAM;AACTC,IAAAA,CAAC,EAAC,0JAA0J;AAC5JH,IAAAA,IAAI,EAAC,cAAA;GACR,CAAC,CACD,CAAC,CAAA;AAAA;;;;"}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
var React = require('react');
|
6
|
+
var ChevronDownFill = require('../Icon.assets/ChevronDownFill.js');
|
7
|
+
var IconRoot = require('../IconRoot.js');
|
8
|
+
|
9
|
+
var IconChevronDownFill = function IconChevronDownFill(_ref) {
|
10
|
+
var _ref$size = _ref.size,
|
11
|
+
size = _ref$size === void 0 ? 'xs' : _ref$size,
|
12
|
+
color = _ref.color,
|
13
|
+
className = _ref.className;
|
14
|
+
return /*#__PURE__*/React.createElement(IconRoot.IconRoot, {
|
15
|
+
className: className,
|
16
|
+
size: size,
|
17
|
+
color: color,
|
18
|
+
icon: ChevronDownFill.ChevronDownFill
|
19
|
+
});
|
20
|
+
};
|
21
|
+
|
22
|
+
exports.IconChevronDownFill = IconChevronDownFill;
|
23
|
+
//# sourceMappingURL=IconChevronDownFill.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"IconChevronDownFill.js","sources":["../../../../src/components/_Icon/Icons/IconChevronDownFill.tsx"],"sourcesContent":["import React from 'react';\n\nimport { ChevronDownFill } from '../Icon.assets/ChevronDownFill';\nimport { IconRoot, IconProps } from '../IconRoot';\n\nexport const IconChevronDownFill: React.FC<IconProps> = ({ size = 'xs', color, className }) => {\n return <IconRoot className={className} size={size} color={color} icon={ChevronDownFill} />;\n};\n"],"names":["IconChevronDownFill","_ref","_ref$size","size","color","className","React","createElement","IconRoot","icon","ChevronDownFill"],"mappings":";;;;;;;;IAKaA,mBAAwC,GAAG,SAA3CA,mBAAwCA,CAAAC,IAAA,EAA0C;AAAA,EAAA,IAAAC,SAAA,GAAAD,IAAA,CAApCE,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,SAAA;IAAEE,KAAK,GAAAH,IAAA,CAALG,KAAK;IAAEC,SAAS,GAAAJ,IAAA,CAATI,SAAS,CAAA;AACpF,EAAA,oBAAOC,KAAA,CAAAC,aAAA,CAACC,iBAAQ,EAAA;AAACH,IAAAA,SAAS,EAAEA,SAAU;AAACF,IAAAA,IAAI,EAAEA,IAAK;AAACC,IAAAA,KAAK,EAAEA,KAAM;AAACK,IAAAA,IAAI,EAAEC,+BAAAA;AAAgB,GAAE,CAAC,CAAA;AAC9F;;;;"}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
var React = require('react');
|
6
|
+
var Minus = require('../Icon.assets/Minus.js');
|
7
|
+
var IconRoot = require('../IconRoot.js');
|
8
|
+
|
9
|
+
var IconMinus = function IconMinus(_ref) {
|
10
|
+
var _ref$size = _ref.size,
|
11
|
+
size = _ref$size === void 0 ? 's' : _ref$size,
|
12
|
+
color = _ref.color,
|
13
|
+
className = _ref.className;
|
14
|
+
return /*#__PURE__*/React.createElement(IconRoot.IconRoot, {
|
15
|
+
className: className,
|
16
|
+
size: size,
|
17
|
+
color: color,
|
18
|
+
icon: Minus.Minus
|
19
|
+
});
|
20
|
+
};
|
21
|
+
|
22
|
+
exports.IconMinus = IconMinus;
|
23
|
+
//# sourceMappingURL=IconMinus.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"IconMinus.js","sources":["../../../../src/components/_Icon/Icons/IconMinus.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Minus } from '../Icon.assets/Minus';\nimport { IconRoot, IconProps } from '../IconRoot';\n\nexport const IconMinus: React.FC<IconProps> = ({ size = 's', color, className }) => {\n return <IconRoot className={className} size={size} color={color} icon={Minus} />;\n};\n"],"names":["IconMinus","_ref","_ref$size","size","color","className","React","createElement","IconRoot","icon","Minus"],"mappings":";;;;;;;;IAKaA,SAA8B,GAAG,SAAjCA,SAA8BA,CAAAC,IAAA,EAAyC;AAAA,EAAA,IAAAC,SAAA,GAAAD,IAAA,CAAnCE,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,GAAG,GAAAA,SAAA;IAAEE,KAAK,GAAAH,IAAA,CAALG,KAAK;IAAEC,SAAS,GAAAJ,IAAA,CAATI,SAAS,CAAA;AACzE,EAAA,oBAAOC,KAAA,CAAAC,aAAA,CAACC,iBAAQ,EAAA;AAACH,IAAAA,SAAS,EAAEA,SAAU;AAACF,IAAAA,IAAI,EAAEA,IAAK;AAACC,IAAAA,KAAK,EAAEA,KAAM;AAACK,IAAAA,IAAI,EAAEC,WAAAA;AAAM,GAAE,CAAC,CAAA;AACpF;;;;"}
|
package/cjs/index.css
CHANGED
@@ -579,3 +579,5 @@
|
|
579
579
|
|
580
580
|
|
581
581
|
|
582
|
+
|
583
|
+
.Accordion_styles_rsiff6_bjv6ypd__465a9c67{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:var(--plasma-accordion-gap);-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;height:auto;background:var(--plasma-accordion-background);}.Accordion_styles_rsiff6_bjv6ypd__465a9c67.Accordion_styles_rsiff6_accordionStretchingFixed__465a9c67{width:var(--plasma-accordion-width);}.Accordion_styles_rsiff6_bjv6ypd__465a9c67.Accordion_styles_rsiff6_accordionStretchingFilled__465a9c67{width:100%;}
|
package/cjs/index.js
CHANGED
@@ -179,6 +179,9 @@ var Thumb_styles = require('./components/Slider/ui/Thumb/Thumb.styles.js');
|
|
179
179
|
require('@linaria/react');
|
180
180
|
var Range = require('./components/Range/Range.js');
|
181
181
|
var Range_tokens = require('./components/Range/Range.tokens.js');
|
182
|
+
var Accordion = require('./components/Accordion/Accordion.js');
|
183
|
+
var AccordionItem = require('./components/Accordion/ui/AccordionItem/AccordionItem.js');
|
184
|
+
var Accordion_tokens = require('./components/Accordion/Accordion.tokens.js');
|
182
185
|
var common = require('./engines/common.js');
|
183
186
|
var canUseDOM = require('./utils/canUseDOM.js');
|
184
187
|
var extractTextFrom = require('./utils/extractTextFrom.js');
|
@@ -526,6 +529,11 @@ exports.ThumbBase = Thumb_styles.ThumbBase;
|
|
526
529
|
exports.rangeConfig = Range.rangeConfig;
|
527
530
|
exports.rangeRoot = Range.rangeRoot;
|
528
531
|
exports.rangeTokens = Range_tokens.tokens;
|
532
|
+
exports.accordionConfig = Accordion.accordionConfig;
|
533
|
+
exports.accordionRoot = Accordion.accordionRoot;
|
534
|
+
exports.AccordionItem = AccordionItem.AccordionItem;
|
535
|
+
exports.accordionClasses = Accordion_tokens.classes;
|
536
|
+
exports.accordionTokens = Accordion_tokens.tokens;
|
529
537
|
exports.component = common.component;
|
530
538
|
exports.mergeConfig = common.mergeConfig;
|
531
539
|
exports.canUseDOM = canUseDOM.canUseDOM;
|
package/cjs/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
.Accordion_styles_rsiff6_bjv6ypd__465a9c67{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:var(--plasma-accordion-gap);-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;height:auto;background:var(--plasma-accordion-background);}.Accordion_styles_rsiff6_bjv6ypd__465a9c67.Accordion_styles_rsiff6_accordionStretchingFixed__465a9c67{width:var(--plasma-accordion-width);}.Accordion_styles_rsiff6_bjv6ypd__465a9c67.Accordion_styles_rsiff6_accordionStretchingFilled__465a9c67{width:100%;}
|
@@ -0,0 +1,76 @@
|
|
1
|
+
import { slicedToArray as _slicedToArray, toConsumableArray as _toConsumableArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
2
|
+
import React, { forwardRef, useState, Children } from 'react';
|
3
|
+
import { cx } from '../../utils/index.js';
|
4
|
+
import { base } from './Accordion.styles.js';
|
5
|
+
import { classes } from './Accordion.tokens.js';
|
6
|
+
import { base as base$1 } from './variations/_view/base.js';
|
7
|
+
import { base as base$2 } from './variations/_size/base.js';
|
8
|
+
import { getChildren } from './utils/index.js';
|
9
|
+
|
10
|
+
var accordionRoot = function accordionRoot(Root) {
|
11
|
+
return /*#__PURE__*/forwardRef(function (_ref, outerRootRef) {
|
12
|
+
var size = _ref.size,
|
13
|
+
view = _ref.view,
|
14
|
+
_ref$stretching = _ref.stretching,
|
15
|
+
stretching = _ref$stretching === void 0 ? 'filled' : _ref$stretching,
|
16
|
+
_ref$defaultActiveEve = _ref.defaultActiveEventKey,
|
17
|
+
defaultActiveEventKey = _ref$defaultActiveEve === void 0 ? [] : _ref$defaultActiveEve,
|
18
|
+
children = _ref.children,
|
19
|
+
disabled = _ref.disabled,
|
20
|
+
className = _ref.className,
|
21
|
+
singleActive = _ref.singleActive,
|
22
|
+
onChange = _ref.onChange;
|
23
|
+
var stretchingClass = classes["".concat(stretching, "Stretching")];
|
24
|
+
var _useState = useState(defaultActiveEventKey),
|
25
|
+
_useState2 = _slicedToArray(_useState, 2),
|
26
|
+
activeIndex = _useState2[0],
|
27
|
+
setActiveIndex = _useState2[1];
|
28
|
+
var updateValue = function updateValue(index, value) {
|
29
|
+
if (onChange) {
|
30
|
+
onChange(index, value);
|
31
|
+
}
|
32
|
+
if (singleActive) {
|
33
|
+
if (value) {
|
34
|
+
setActiveIndex([index]);
|
35
|
+
} else {
|
36
|
+
setActiveIndex([]);
|
37
|
+
}
|
38
|
+
} else if (value) {
|
39
|
+
setActiveIndex([index].concat(_toConsumableArray(activeIndex)));
|
40
|
+
} else {
|
41
|
+
var updatedActiveIndex = activeIndex.filter(function (i) {
|
42
|
+
return i !== index;
|
43
|
+
});
|
44
|
+
setActiveIndex(updatedActiveIndex);
|
45
|
+
}
|
46
|
+
};
|
47
|
+
var childrenArray = Children.toArray(children);
|
48
|
+
return /*#__PURE__*/React.createElement(Root, {
|
49
|
+
ref: outerRootRef,
|
50
|
+
size: size,
|
51
|
+
view: view,
|
52
|
+
className: cx(stretchingClass, classes.accordionRoot, className)
|
53
|
+
}, getChildren(childrenArray, activeIndex, disabled, updateValue));
|
54
|
+
});
|
55
|
+
};
|
56
|
+
var accordionConfig = {
|
57
|
+
name: 'Accordion',
|
58
|
+
tag: 'div',
|
59
|
+
layout: accordionRoot,
|
60
|
+
base: base,
|
61
|
+
variations: {
|
62
|
+
view: {
|
63
|
+
css: base$1
|
64
|
+
},
|
65
|
+
size: {
|
66
|
+
css: base$2
|
67
|
+
}
|
68
|
+
},
|
69
|
+
defaults: {
|
70
|
+
view: 'default',
|
71
|
+
size: 'm'
|
72
|
+
}
|
73
|
+
};
|
74
|
+
|
75
|
+
export { accordionConfig, accordionRoot };
|
76
|
+
//# sourceMappingURL=Accordion.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Accordion.js","sources":["../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import React, { Children, forwardRef, useState } from 'react';\n\nimport { RootPropsOmitOnChange } from '../../engines';\nimport { cx } from '../../utils';\n\nimport type { AccordionProps } from './Accordion.types';\nimport { base } from './Accordion.styles';\nimport { classes } from './Accordion.tokens';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { getChildren } from './utils';\n\nexport const accordionRoot = (Root: RootPropsOmitOnChange<HTMLDivElement, AccordionProps>) =>\n forwardRef<HTMLDivElement, AccordionProps>(\n (\n {\n size,\n view,\n stretching = 'filled',\n defaultActiveEventKey = [],\n children,\n disabled,\n className,\n singleActive,\n onChange,\n },\n outerRootRef,\n ) => {\n const stretchingClass = classes[`${stretching}Stretching` as keyof typeof classes];\n\n const [activeIndex, setActiveIndex] = useState<number[]>(defaultActiveEventKey);\n\n const updateValue = (index: number, value?: boolean) => {\n if (onChange) {\n onChange(index, value);\n }\n if (singleActive) {\n if (value) {\n setActiveIndex([index]);\n } else {\n setActiveIndex([]);\n }\n } else if (value) {\n setActiveIndex([index, ...activeIndex]);\n } else {\n const updatedActiveIndex = activeIndex.filter((i) => i !== index);\n setActiveIndex(updatedActiveIndex);\n }\n };\n\n const childrenArray = Children.toArray(children) as React.ReactElement[];\n return (\n <Root\n ref={outerRootRef}\n size={size}\n view={view}\n className={cx(stretchingClass, classes.accordionRoot, className)}\n >\n {getChildren(childrenArray, activeIndex, disabled, updateValue)}\n </Root>\n );\n },\n );\n\nexport const accordionConfig = {\n name: 'Accordion',\n tag: 'div',\n layout: accordionRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n },\n};\n"],"names":["accordionRoot","Root","forwardRef","_ref","outerRootRef","size","view","_ref$stretching","stretching","_ref$defaultActiveEve","defaultActiveEventKey","children","disabled","className","singleActive","onChange","stretchingClass","classes","concat","_useState","useState","_useState2","_slicedToArray","activeIndex","setActiveIndex","updateValue","index","value","_toConsumableArray","updatedActiveIndex","filter","i","childrenArray","Children","toArray","React","createElement","ref","cx","getChildren","accordionConfig","name","tag","layout","base","variations","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;AACFyC,MAAAA,GAAG,EAAEE,MAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACN3C,IAAAA,IAAI,EAAE,SAAS;AACfD,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Accordion.styles.js","sources":["../../../src/components/Accordion/Accordion.styles.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { classes, tokens } from './Accordion.tokens';\n\nexport const base = css`\n display: flex;\n flex-direction: column;\n gap: var(${tokens.accordionGap});\n align-items: stretch;\n height: auto;\n background: var(${tokens.accordionBackground});\n\n &.${classes.fixedStretching} {\n width: var(${tokens.accordionWidth});\n }\n &.${classes.filledStretching} {\n width: 100%;\n }\n`;\n"],"names":["base"],"mappings":"AAIO,IAAMA,IAAI,GAchB;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
.bjv6ypd{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:var(--plasma-accordion-gap);-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;height:auto;background:var(--plasma-accordion-background);}.bjv6ypd.accordion-stretching-fixed{width:var(--plasma-accordion-width);}.bjv6ypd.accordion-stretching-filled{width:100%;}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
var classes = {
|
2
|
+
filledStretching: 'accordion-stretching-filled',
|
3
|
+
fixedStretching: 'accordion-stretching-fixed',
|
4
|
+
accordionRoot: 'accordion-root',
|
5
|
+
accordionItem: 'accordion-item',
|
6
|
+
clearAccordionItem: 'clear-accordion-item',
|
7
|
+
accordionItemShowBody: 'accordion-item-show-body',
|
8
|
+
accordionPlusAnimationElement: 'accordion-plus-animation-element',
|
9
|
+
accordionDisabled: 'accordion-disabled'
|
10
|
+
};
|
11
|
+
var tokens = {
|
12
|
+
accordionGap: '--plasma-accordion-gap',
|
13
|
+
accordionWidth: '--plasma-accordion-width',
|
14
|
+
accordionBackground: '--plasma-accordion-background',
|
15
|
+
accordionItemBackground: '--plasma-accordion-item-background',
|
16
|
+
accordionItemBorderRadius: '--plasma-accordion-item-border-radius',
|
17
|
+
accordionItemPadding: '--plasma-accordion-item-padding',
|
18
|
+
accordionItemPaddingVertical: '--plasma-accordion-item-padding-vertical',
|
19
|
+
accordionItemPaddingHorizontal: '--plasma-accordion-item-padding-horizontal',
|
20
|
+
accordionItemGap: '--plasma-accordion-item-gap',
|
21
|
+
accordionItemFocus: '--plasma-accordion-item-focus',
|
22
|
+
accordionItemBorderBottom: '--plasma-accordion-item-border-bottom',
|
23
|
+
accordionItemTitleColor: '--plasma-accordion-item-title-color',
|
24
|
+
accordionItemTitleFontFamily: '--plasma-accordion-item-title-font-family',
|
25
|
+
accordionItemTitleFontSize: '--plasma-accordion-item-title-font-size',
|
26
|
+
accordionItemTitleFontStyle: '--plasma-accordion-item-title-font-style',
|
27
|
+
accordionItemTitleFontWeight: '--plasma-accordion-item-title-font-weight',
|
28
|
+
accordionItemTitleLetterSpacing: '--plasma-accordion-item-title-letter-spacing',
|
29
|
+
accordionItemTitleLineHeight: '--plasma-accordion-item-title-line-height',
|
30
|
+
accordionItemTextColor: '--plasma-accordion-item-text-color',
|
31
|
+
accordionItemTextFontFamily: '--plasma-accordion-item-text-font-family',
|
32
|
+
accordionItemTextFontSize: '--plasma-accordion-item-text-font-size',
|
33
|
+
accordionItemTextFontStyle: '--plasma-accordion-item-text-font-style',
|
34
|
+
accordionItemTextFontWeight: '--plasma-accordion-item-text-font-weight',
|
35
|
+
accordionItemTextLetterSpacing: '--plasma-accordion-item-text-letter-spacing',
|
36
|
+
accordionItemTextLineHeight: '--plasma-accordion-item-text-line-height'
|
37
|
+
};
|
38
|
+
|
39
|
+
export { classes, tokens };
|
40
|
+
//# sourceMappingURL=Accordion.tokens.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Accordion.tokens.js","sources":["../../../src/components/Accordion/Accordion.tokens.ts"],"sourcesContent":["export const classes = {\n filledStretching: 'accordion-stretching-filled',\n fixedStretching: 'accordion-stretching-fixed',\n accordionRoot: 'accordion-root',\n accordionItem: 'accordion-item',\n clearAccordionItem: 'clear-accordion-item',\n accordionItemShowBody: 'accordion-item-show-body',\n accordionPlusAnimationElement: 'accordion-plus-animation-element',\n accordionDisabled: 'accordion-disabled',\n};\n\nexport const tokens = {\n accordionGap: '--plasma-accordion-gap',\n accordionWidth: '--plasma-accordion-width',\n accordionBackground: '--plasma-accordion-background',\n\n accordionItemBackground: '--plasma-accordion-item-background',\n accordionItemBorderRadius: '--plasma-accordion-item-border-radius',\n accordionItemPadding: '--plasma-accordion-item-padding',\n accordionItemPaddingVertical: '--plasma-accordion-item-padding-vertical',\n accordionItemPaddingHorizontal: '--plasma-accordion-item-padding-horizontal',\n accordionItemGap: '--plasma-accordion-item-gap',\n accordionItemFocus: '--plasma-accordion-item-focus',\n accordionItemBorderBottom: '--plasma-accordion-item-border-bottom',\n\n accordionItemTitleColor: '--plasma-accordion-item-title-color',\n accordionItemTitleFontFamily: '--plasma-accordion-item-title-font-family',\n accordionItemTitleFontSize: '--plasma-accordion-item-title-font-size',\n accordionItemTitleFontStyle: '--plasma-accordion-item-title-font-style',\n accordionItemTitleFontWeight: '--plasma-accordion-item-title-font-weight',\n accordionItemTitleLetterSpacing: '--plasma-accordion-item-title-letter-spacing',\n accordionItemTitleLineHeight: '--plasma-accordion-item-title-line-height',\n\n accordionItemTextColor: '--plasma-accordion-item-text-color',\n accordionItemTextFontFamily: '--plasma-accordion-item-text-font-family',\n accordionItemTextFontSize: '--plasma-accordion-item-text-font-size',\n accordionItemTextFontStyle: '--plasma-accordion-item-text-font-style',\n accordionItemTextFontWeight: '--plasma-accordion-item-text-font-weight',\n accordionItemTextLetterSpacing: '--plasma-accordion-item-text-letter-spacing',\n accordionItemTextLineHeight: '--plasma-accordion-item-text-line-height',\n};\n"],"names":["classes","filledStretching","fixedStretching","accordionRoot","accordionItem","clearAccordionItem","accordionItemShowBody","accordionPlusAnimationElement","accordionDisabled","tokens","accordionGap","accordionWidth","accordionBackground","accordionItemBackground","accordionItemBorderRadius","accordionItemPadding","accordionItemPaddingVertical","accordionItemPaddingHorizontal","accordionItemGap","accordionItemFocus","accordionItemBorderBottom","accordionItemTitleColor","accordionItemTitleFontFamily","accordionItemTitleFontSize","accordionItemTitleFontStyle","accordionItemTitleFontWeight","accordionItemTitleLetterSpacing","accordionItemTitleLineHeight","accordionItemTextColor","accordionItemTextFontFamily","accordionItemTextFontSize","accordionItemTextFontStyle","accordionItemTextFontWeight","accordionItemTextLetterSpacing","accordionItemTextLineHeight"],"mappings":"AAAO,IAAMA,OAAO,GAAG;AACnBC,EAAAA,gBAAgB,EAAE,6BAA6B;AAC/CC,EAAAA,eAAe,EAAE,4BAA4B;AAC7CC,EAAAA,aAAa,EAAE,gBAAgB;AAC/BC,EAAAA,aAAa,EAAE,gBAAgB;AAC/BC,EAAAA,kBAAkB,EAAE,sBAAsB;AAC1CC,EAAAA,qBAAqB,EAAE,0BAA0B;AACjDC,EAAAA,6BAA6B,EAAE,kCAAkC;AACjEC,EAAAA,iBAAiB,EAAE,oBAAA;AACvB,EAAC;AAEM,IAAMC,MAAM,GAAG;AAClBC,EAAAA,YAAY,EAAE,wBAAwB;AACtCC,EAAAA,cAAc,EAAE,0BAA0B;AAC1CC,EAAAA,mBAAmB,EAAE,+BAA+B;AAEpDC,EAAAA,uBAAuB,EAAE,oCAAoC;AAC7DC,EAAAA,yBAAyB,EAAE,uCAAuC;AAClEC,EAAAA,oBAAoB,EAAE,iCAAiC;AACvDC,EAAAA,4BAA4B,EAAE,0CAA0C;AACxEC,EAAAA,8BAA8B,EAAE,4CAA4C;AAC5EC,EAAAA,gBAAgB,EAAE,6BAA6B;AAC/CC,EAAAA,kBAAkB,EAAE,+BAA+B;AACnDC,EAAAA,yBAAyB,EAAE,uCAAuC;AAElEC,EAAAA,uBAAuB,EAAE,qCAAqC;AAC9DC,EAAAA,4BAA4B,EAAE,2CAA2C;AACzEC,EAAAA,0BAA0B,EAAE,yCAAyC;AACrEC,EAAAA,2BAA2B,EAAE,0CAA0C;AACvEC,EAAAA,4BAA4B,EAAE,2CAA2C;AACzEC,EAAAA,+BAA+B,EAAE,8CAA8C;AAC/EC,EAAAA,4BAA4B,EAAE,2CAA2C;AAEzEC,EAAAA,sBAAsB,EAAE,oCAAoC;AAC5DC,EAAAA,2BAA2B,EAAE,0CAA0C;AACvEC,EAAAA,yBAAyB,EAAE,wCAAwC;AACnEC,EAAAA,0BAA0B,EAAE,yCAAyC;AACrEC,EAAAA,2BAA2B,EAAE,0CAA0C;AACvEC,EAAAA,8BAA8B,EAAE,6CAA6C;AAC7EC,EAAAA,2BAA2B,EAAE,0CAAA;AACjC;;;;"}
|
@@ -0,0 +1,93 @@
|
|
1
|
+
import { slicedToArray as _slicedToArray } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
|
+
import React, { useState, useRef, useEffect } from 'react';
|
3
|
+
import { convertRoundnessMatrix } from '../../../../utils/roundness.js';
|
4
|
+
import { classes, tokens } from '../../Accordion.tokens.js';
|
5
|
+
import { StyledAccordionItem, StyledAccordionHeader, StyledAccordionHeaderLeft, StyledAccordionContentLeft, StyledAccordionTitle, StyledAccordionContentRight, StyledAccordionBodyAnimate, StyledAccordionBody, StyledArrow, StyledPlus, StyledMinus } from './AccordionItem.styles.js';
|
6
|
+
|
7
|
+
var _StyledMinus, _StyledArrow;
|
8
|
+
var AccordionItem = function AccordionItem(_ref) {
|
9
|
+
var value = _ref.value,
|
10
|
+
contentRight = _ref.contentRight,
|
11
|
+
contentLeft = _ref.contentLeft,
|
12
|
+
title = _ref.title,
|
13
|
+
_ref$pin = _ref.pin,
|
14
|
+
pin = _ref$pin === void 0 ? 'square-square' : _ref$pin,
|
15
|
+
children = _ref.children,
|
16
|
+
_ref$type = _ref.type,
|
17
|
+
type = _ref$type === void 0 ? 'sign' : _ref$type,
|
18
|
+
index = _ref.index,
|
19
|
+
eventKey = _ref.eventKey,
|
20
|
+
disabled = _ref.disabled,
|
21
|
+
onChange = _ref.onChange;
|
22
|
+
var key = eventKey !== null && eventKey !== void 0 ? eventKey : index;
|
23
|
+
var _useState = useState(),
|
24
|
+
_useState2 = _slicedToArray(_useState, 2),
|
25
|
+
leftPadding = _useState2[0],
|
26
|
+
setLeftPadding = _useState2[1];
|
27
|
+
var handleOpen = function handleOpen() {
|
28
|
+
if (disabled) {
|
29
|
+
return;
|
30
|
+
}
|
31
|
+
if (onChange) {
|
32
|
+
onChange(key, !value);
|
33
|
+
}
|
34
|
+
};
|
35
|
+
var leftContentRef = useRef(null);
|
36
|
+
useEffect(function () {
|
37
|
+
var _leftContentRef$curre, _leftContentRef$curre2;
|
38
|
+
var leftContentWidth = (_leftContentRef$curre = leftContentRef === null || leftContentRef === void 0 || (_leftContentRef$curre2 = leftContentRef.current) === null || _leftContentRef$curre2 === void 0 ? void 0 : _leftContentRef$curre2.offsetWidth) !== null && _leftContentRef$curre !== void 0 ? _leftContentRef$curre : 0;
|
39
|
+
var leftPaddingBody = leftContentWidth ? "calc(".concat(leftContentWidth, "px + var(").concat(tokens.accordionItemGap, "))") : 0;
|
40
|
+
setLeftPadding(leftPaddingBody);
|
41
|
+
}, [value, type, leftContentRef, setLeftPadding]);
|
42
|
+
var openedBodyClass = value ? classes.accordionItemShowBody : undefined;
|
43
|
+
var StyledAnimationPLus = function StyledAnimationPLus() {
|
44
|
+
return /*#__PURE__*/React.createElement(StyledPlus, null, _StyledMinus || (_StyledMinus = /*#__PURE__*/React.createElement(StyledMinus, {
|
45
|
+
size: "xs",
|
46
|
+
color: "inhert"
|
47
|
+
})), /*#__PURE__*/React.createElement(StyledMinus, {
|
48
|
+
size: "xs",
|
49
|
+
color: "inhert",
|
50
|
+
className: openedBodyClass !== null && openedBodyClass !== void 0 ? openedBodyClass : classes.accordionPlusAnimationElement
|
51
|
+
}));
|
52
|
+
};
|
53
|
+
var accordionBorderRadius = convertRoundnessMatrix(pin, "var(".concat(tokens.accordionItemBorderRadius, ")"), '1.5rem');
|
54
|
+
var disabledClass = disabled ? classes.accordionDisabled : '';
|
55
|
+
var leftContent = contentLeft !== null && contentLeft !== void 0 ? contentLeft : type === 'arrow' ? _StyledArrow || (_StyledArrow = /*#__PURE__*/React.createElement(StyledArrow, {
|
56
|
+
size: "xs",
|
57
|
+
color: "inhert"
|
58
|
+
})) : undefined;
|
59
|
+
var leftContentRotate = type === 'arrow' && value ? classes.accordionItemShowBody : undefined;
|
60
|
+
var rightContent = contentRight !== null && contentRight !== void 0 ? contentRight : type === 'sign' ? /*#__PURE__*/React.createElement(StyledAnimationPLus, null) : undefined;
|
61
|
+
var rightContentRotate = type === 'sign' && value ? classes.accordionItemShowBody : undefined;
|
62
|
+
return /*#__PURE__*/React.createElement(StyledAccordionItem, {
|
63
|
+
className: classes.accordionItem,
|
64
|
+
key: key,
|
65
|
+
style: {
|
66
|
+
borderRadius: accordionBorderRadius
|
67
|
+
}
|
68
|
+
}, /*#__PURE__*/React.createElement(StyledAccordionHeader, {
|
69
|
+
role: "tab",
|
70
|
+
tabIndex: 0,
|
71
|
+
onClick: handleOpen,
|
72
|
+
className: disabledClass,
|
73
|
+
"aria-expanded": value,
|
74
|
+
"aria-controls": "accordion-item-section".concat(key),
|
75
|
+
id: "accordion-item-".concat(key)
|
76
|
+
}, /*#__PURE__*/React.createElement(StyledAccordionHeaderLeft, null, leftContent && /*#__PURE__*/React.createElement(StyledAccordionContentLeft, {
|
77
|
+
ref: leftContentRef,
|
78
|
+
className: leftContentRotate
|
79
|
+
}, leftContent), /*#__PURE__*/React.createElement(StyledAccordionTitle, null, title)), /*#__PURE__*/React.createElement(StyledAccordionContentRight, {
|
80
|
+
className: rightContentRotate
|
81
|
+
}, rightContent && rightContent)), /*#__PURE__*/React.createElement(StyledAccordionBodyAnimate, {
|
82
|
+
"aria-labelledby": "accordion-item-".concat(key),
|
83
|
+
"aria-hidden": !value,
|
84
|
+
id: "accordion-item-section".concat(key),
|
85
|
+
className: openedBodyClass,
|
86
|
+
style: {
|
87
|
+
paddingLeft: "".concat(leftPadding)
|
88
|
+
}
|
89
|
+
}, /*#__PURE__*/React.createElement(StyledAccordionBody, null, children)));
|
90
|
+
};
|
91
|
+
|
92
|
+
export { AccordionItem };
|
93
|
+
//# sourceMappingURL=AccordionItem.js.map
|
@@ -0,0 +1 @@
|
|
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,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,KAAR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5BmC,KAAA,CAAAC,aAAA,CAACgC,2BAA2B,EAAA;AAAC1B,IAAAA,SAAS,EAAEY,kBAAAA;GACnCD,EAAAA,YAAY,IAAIA,YACQ,CACV,CAAC,eACxBlB,KAAA,CAAAC,aAAA,CAACiC,0BAA0B,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,mBAAmB,EAAEpE,IAAAA,EAAAA,QAA8B,CAC5B,CACX,CAAC,CAAA;AAE9B;;;;"}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import styled from 'styled-components';
|
2
|
+
import 'react';
|
3
|
+
import '@linaria/react';
|
4
|
+
import { IconChevronDownFill } from '../../../_Icon/Icons/IconChevronDownFill.js';
|
5
|
+
import { IconMinus } from '../../../_Icon/Icons/IconMinus.js';
|
6
|
+
import { tokens, classes } from '../../Accordion.tokens.js';
|
7
|
+
import { addFocus } from '../../../../mixins/addFocus.js';
|
8
|
+
|
9
|
+
var StyledAccordionItem = /*#__PURE__*/styled.div.withConfig({
|
10
|
+
componentId: "plasma-new-hope__sc-iot32d-0"
|
11
|
+
})(["background:var(", ");border-bottom:var(", ");&:last-child{border-bottom:none;}"], tokens.accordionItemBackground, tokens.accordionItemBorderBottom);
|
12
|
+
var StyledAccordionHeader = /*#__PURE__*/styled.button.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({
|
15
|
+
outlineOffset: '0.125rem',
|
16
|
+
outlineSize: '0.125rem',
|
17
|
+
outlineRadius: '0',
|
18
|
+
outlineColor: /*#__PURE__*/"var(".concat(tokens.accordionItemFocus, ")")
|
19
|
+
}));
|
20
|
+
var StyledAccordionHeaderLeft = /*#__PURE__*/styled.div.withConfig({
|
21
|
+
componentId: "plasma-new-hope__sc-iot32d-2"
|
22
|
+
})(["display:flex;gap:var(", ");justify-content:space-between;align-items:center;"], tokens.accordionItemGap);
|
23
|
+
var StyledAccordionContentRight = /*#__PURE__*/styled.div.withConfig({
|
24
|
+
componentId: "plasma-new-hope__sc-iot32d-3"
|
25
|
+
})(["transition:0.2s;transform:rotate(90deg);&.", "{transition:0.2s;transform:rotate(0deg);}"], classes.accordionItemShowBody);
|
26
|
+
var StyledAccordionContentLeft = /*#__PURE__*/styled.div.withConfig({
|
27
|
+
componentId: "plasma-new-hope__sc-iot32d-4"
|
28
|
+
})(["transition:0.2s;display:flex;align-items:center;&.", "{transition:0.2s;transform:rotate(180deg);}"], classes.accordionItemShowBody);
|
29
|
+
var StyledAccordionTitle = /*#__PURE__*/styled.div.withConfig({
|
30
|
+
componentId: "plasma-new-hope__sc-iot32d-5"
|
31
|
+
})(["color:var(", ");font-family:var(", ");font-size:var(", ");font-weight:var(", ");font-style:var(", ");letter-spacing:var(", ");line-height:var(", ");"], tokens.accordionItemTitleColor, tokens.accordionItemTitleFontFamily, tokens.accordionItemTitleFontSize, tokens.accordionItemTitleFontWeight, tokens.accordionItemTitleFontStyle, tokens.accordionItemTitleLetterSpacing, tokens.accordionItemTitleLineHeight);
|
32
|
+
var StyledAccordionBodyAnimate = /*#__PURE__*/styled.div.withConfig({
|
33
|
+
componentId: "plasma-new-hope__sc-iot32d-6"
|
34
|
+
})(["display:grid;grid-template-rows:0fr;transition:grid-template-rows 0.2s ease-out;overflow:hidden;&.", "{grid-template-rows:1fr;padding-bottom:var(", ");&.", "{transition:0.2s;transform:rotate(0deg);}}"], classes.accordionItemShowBody, tokens.accordionItemPaddingVertical, classes.accordionPlusAnimationElement);
|
35
|
+
var StyledAccordionBody = /*#__PURE__*/styled.div.withConfig({
|
36
|
+
componentId: "plasma-new-hope__sc-iot32d-7"
|
37
|
+
})(["color:var(", ");font-family:var(", ");font-size:var(", ");font-weight:var(", ");font-style:var(", ");letter-spacing:var(", ");line-height:var(", ");overflow:hidden;padding-right:var(", ");padding-left:var(", ");"], tokens.accordionItemTextColor, tokens.accordionItemTextFontFamily, tokens.accordionItemTextFontSize, tokens.accordionItemTextFontWeight, tokens.accordionItemTextFontStyle, tokens.accordionItemTextLetterSpacing, tokens.accordionItemTextLineHeight, tokens.accordionItemPaddingHorizontal, tokens.accordionItemPaddingHorizontal);
|
38
|
+
var StyledArrow = /*#__PURE__*/styled(IconChevronDownFill).withConfig({
|
39
|
+
componentId: "plasma-new-hope__sc-iot32d-8"
|
40
|
+
})(["pointer-events:none;user-select:none;color:var(", ");"], tokens.accordionItemTextColor);
|
41
|
+
var StyledMinus = /*#__PURE__*/styled(IconMinus).withConfig({
|
42
|
+
componentId: "plasma-new-hope__sc-iot32d-9"
|
43
|
+
})(["pointer-events:none;user-select:none;color:var(", ");display:flex;align-items:center;position:absolute;top:0;left:0;&.", "{transition:0.2s;transform:rotate(90deg);}&.", "{transition:0.2s;transform:rotate(0deg);}"], tokens.accordionItemTextColor, classes.accordionPlusAnimationElement, classes.accordionItemShowBody);
|
44
|
+
var StyledPlus = /*#__PURE__*/styled.div.withConfig({
|
45
|
+
componentId: "plasma-new-hope__sc-iot32d-10"
|
46
|
+
})(["position:relative;height:1rem;display:flex;align-items:center;justify-content:center;width:1rem;"]);
|
47
|
+
|
48
|
+
export { StyledAccordionBody, StyledAccordionBodyAnimate, StyledAccordionContentLeft, StyledAccordionContentRight, StyledAccordionHeader, StyledAccordionHeaderLeft, StyledAccordionItem, StyledAccordionTitle, StyledArrow, StyledMinus, StyledPlus };
|
49
|
+
//# sourceMappingURL=AccordionItem.styles.js.map
|
@@ -0,0 +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.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,MAAM,CAACK,oBAAoB,EAE/BL,MAAM,CAACM,gBAAgB,EAO9BC,OAAO,CAACC,iBAAiB,eAS3BC,QAAQ,CAAC;AACPC,EAAAA,aAAa,EAAE,UAAU;AACzBC,EAAAA,WAAW,EAAE,UAAU;AACvBC,EAAAA,aAAa,EAAE,GAAG;AAClBC,EAAAA,YAAY,eAAAC,MAAAA,CAAAA,MAAA,CAASd,MAAM,CAACe,kBAAkB,EAAA,G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