@salutejs/plasma-new-hope 0.173.4-canary.1502.11517986665.0 → 0.173.4-canary.1508.11518994013.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Drawer/Drawer.js +2 -1
- package/cjs/components/Drawer/Drawer.js.map +1 -1
- package/cjs/components/Tabs/createTabsController.js.map +1 -1
- package/cjs/components/Tabs/tokens.js +0 -2
- package/cjs/components/Tabs/tokens.js.map +1 -1
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +1 -3
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js.map +1 -1
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.css +5 -5
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js +8 -20
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js.map +1 -1
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.js +1 -1
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.js.map +1 -1
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/{HorizontalTabs.styles_p9rk79.css → HorizontalTabs.styles_16kuvxt.css} +1 -1
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.js +1 -1
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.js.map +1 -1
- package/{es/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base_4ob3q5.css → cjs/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base_9miwn.css} +1 -1
- package/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.css +4 -4
- package/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js +6 -7
- package/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js.map +1 -1
- package/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js +1 -1
- package/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js.map +1 -1
- package/{es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles_1r1hidh.css → cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles_1fr5ovg.css} +1 -1
- package/cjs/index.css +9 -9
- package/emotion/cjs/components/Drawer/Drawer.js +4 -3
- package/emotion/cjs/components/Tabs/tokens.js +0 -2
- package/emotion/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +1 -3
- package/emotion/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js +8 -20
- package/emotion/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.js +4 -4
- package/emotion/cjs/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.js +1 -1
- package/emotion/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js +6 -7
- package/emotion/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js +4 -4
- package/emotion/cjs/examples/plasma_b2c/components/Tabs/Tabs.stories.tsx +33 -72
- package/emotion/cjs/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.js +15 -15
- package/emotion/cjs/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabs.config.js +15 -15
- package/emotion/cjs/examples/plasma_b2c/components/Tabs/vertical/VerticalTabs.config.js +6 -6
- package/emotion/cjs/examples/plasma_web/components/Tabs/Tabs.stories.tsx +33 -72
- package/emotion/cjs/examples/plasma_web/components/Tabs/horizontal/HorizontalTabItem.config.js +15 -15
- package/emotion/cjs/examples/plasma_web/components/Tabs/horizontal/HorizontalTabs.config.js +15 -15
- package/emotion/cjs/examples/plasma_web/components/Tabs/vertical/VerticalTabs.config.js +6 -6
- package/emotion/es/components/Drawer/Drawer.js +2 -1
- package/emotion/es/components/Tabs/tokens.js +0 -2
- package/emotion/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +1 -3
- package/emotion/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js +9 -21
- package/emotion/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.js +4 -4
- package/emotion/es/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.js +1 -1
- package/emotion/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js +7 -8
- package/emotion/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js +4 -4
- package/emotion/es/examples/plasma_b2c/components/Tabs/Tabs.stories.tsx +33 -72
- package/emotion/es/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.js +15 -15
- package/emotion/es/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabs.config.js +15 -15
- package/emotion/es/examples/plasma_b2c/components/Tabs/vertical/VerticalTabs.config.js +6 -6
- package/emotion/es/examples/plasma_web/components/Tabs/Tabs.stories.tsx +33 -72
- package/emotion/es/examples/plasma_web/components/Tabs/horizontal/HorizontalTabItem.config.js +15 -15
- package/emotion/es/examples/plasma_web/components/Tabs/horizontal/HorizontalTabs.config.js +15 -15
- package/emotion/es/examples/plasma_web/components/Tabs/vertical/VerticalTabs.config.js +6 -6
- package/es/components/Drawer/Drawer.js +2 -1
- package/es/components/Drawer/Drawer.js.map +1 -1
- package/es/components/Tabs/createTabsController.js.map +1 -1
- package/es/components/Tabs/tokens.js +0 -2
- package/es/components/Tabs/tokens.js.map +1 -1
- package/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +1 -3
- package/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js.map +1 -1
- package/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.css +5 -5
- package/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js +9 -21
- package/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js.map +1 -1
- package/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.js +1 -1
- package/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.js.map +1 -1
- package/es/components/Tabs/ui/horizontal/HorizontalTabs/{HorizontalTabs.styles_p9rk79.css → HorizontalTabs.styles_16kuvxt.css} +1 -1
- package/es/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.js +1 -1
- package/es/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.js.map +1 -1
- package/{cjs/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base_4ob3q5.css → es/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base_9miwn.css} +1 -1
- package/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.css +4 -4
- package/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js +7 -8
- package/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js.map +1 -1
- package/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js +1 -1
- package/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js.map +1 -1
- package/{cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles_1r1hidh.css → es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles_1fr5ovg.css} +1 -1
- package/es/index.css +9 -9
- package/package.json +2 -2
- package/styled-components/cjs/components/Drawer/Drawer.js +4 -3
- package/styled-components/cjs/components/Tabs/tokens.js +0 -2
- package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +1 -3
- package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js +8 -20
- package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.js +2 -2
- package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.js +1 -1
- package/styled-components/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js +6 -7
- package/styled-components/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js +2 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Tabs/Tabs.stories.tsx +33 -72
- package/styled-components/cjs/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.js +2 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabs.config.js +3 -3
- package/styled-components/cjs/examples/plasma_b2c/components/Tabs/vertical/VerticalTabs.config.js +1 -1
- package/styled-components/cjs/examples/plasma_web/components/Tabs/Tabs.stories.tsx +33 -72
- package/styled-components/cjs/examples/plasma_web/components/Tabs/horizontal/HorizontalTabItem.config.js +2 -2
- package/styled-components/cjs/examples/plasma_web/components/Tabs/horizontal/HorizontalTabs.config.js +3 -3
- package/styled-components/cjs/examples/plasma_web/components/Tabs/vertical/VerticalTabs.config.js +1 -1
- package/styled-components/es/components/Drawer/Drawer.js +2 -1
- package/styled-components/es/components/Tabs/tokens.js +0 -2
- package/styled-components/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +1 -3
- package/styled-components/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js +9 -21
- package/styled-components/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.js +2 -2
- package/styled-components/es/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.js +1 -1
- package/styled-components/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js +7 -8
- package/styled-components/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js +2 -2
- package/styled-components/es/examples/plasma_b2c/components/Tabs/Tabs.stories.tsx +33 -72
- package/styled-components/es/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.js +2 -2
- package/styled-components/es/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabs.config.js +3 -3
- package/styled-components/es/examples/plasma_b2c/components/Tabs/vertical/VerticalTabs.config.js +1 -1
- package/styled-components/es/examples/plasma_web/components/Tabs/Tabs.stories.tsx +33 -72
- package/styled-components/es/examples/plasma_web/components/Tabs/horizontal/HorizontalTabItem.config.js +2 -2
- package/styled-components/es/examples/plasma_web/components/Tabs/horizontal/HorizontalTabs.config.js +3 -3
- package/styled-components/es/examples/plasma_web/components/Tabs/vertical/VerticalTabs.config.js +1 -1
- package/types/components/Drawer/Drawer.d.ts.map +1 -1
- package/types/components/Tabs/TabItem.types.d.ts +8 -50
- package/types/components/Tabs/TabItem.types.d.ts.map +1 -1
- package/types/components/Tabs/Tabs.types.d.ts +2 -44
- package/types/components/Tabs/Tabs.types.d.ts.map +1 -1
- package/types/components/Tabs/createTabsController.d.ts +2 -2
- package/types/components/Tabs/createTabsController.d.ts.map +1 -1
- package/types/components/Tabs/index.d.ts +2 -2
- package/types/components/Tabs/index.d.ts.map +1 -1
- package/types/components/Tabs/tokens.d.ts +0 -2
- package/types/components/Tabs/tokens.d.ts.map +1 -1
- package/types/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.d.ts.map +1 -1
- package/types/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.d.ts +2 -2
- package/types/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.d.ts.map +1 -1
- package/types/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.d.ts.map +1 -1
- package/types/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.d.ts.map +1 -1
- package/types/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Tabs/TabItem.d.ts +6 -21
- package/types/examples/plasma_b2c/components/Tabs/TabItem.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Tabs/Tabs.d.ts +2 -2
- package/types/examples/plasma_b2c/components/Tabs/Tabs.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabs.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Tabs/vertical/VerticalTabs.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Tabs/TabItem.d.ts +6 -21
- package/types/examples/plasma_web/components/Tabs/TabItem.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Tabs/Tabs.d.ts +2 -2
- package/types/examples/plasma_web/components/Tabs/Tabs.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Tabs/horizontal/HorizontalTabs.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Tabs/vertical/VerticalTabs.config.d.ts.map +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"HorizontalTabs.js","sources":["../../../../../../src/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useMemo, useState, useEffect, useRef, KeyboardEvent } from 'react';\nimport type { MutableRefObject } from 'react';\nimport { safeUseId } from '@salutejs/plasma-core';\n\nimport type { RootProps } from '../../../../../engines/types';\nimport { IconDisclosureLeft, IconDisclosureRight } from '../../../../_Icon';\nimport { classes } from '../../../tokens';\nimport { cx } from '../../../../../utils';\nimport { TabItemRefs, TabsContext } from '../../../TabsContext';\nimport type { HorizontalTabsProps } from '../../../Tabs.types';\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 stretchCSS } from './variations/_stretch/base';\nimport { StyledArrow, StyledContent, StyledContentWrapper, base } from './HorizontalTabs.styles';\n\nenum Keys {\n end = 35,\n home = 36,\n left = 37,\n right = 39,\n}\n\nconst getIconSize = (size?: string) => {\n return size === 'h1' || size === 'h2' ? 'm' : 's';\n};\n\n// TODO: https://github.com/salute-developers/plasma/issues/1474\nexport const horizontalTabsRoot = (Root: RootProps<HTMLDivElement, HorizontalTabsProps>) =>\n forwardRef<HTMLDivElement, HorizontalTabsProps>((props, outerRef) => {\n const {\n id,\n stretch = false,\n disabled = false,\n clip = 'scroll',\n size,\n view,\n children,\n pilled = false,\n index,\n className,\n hasDivider = true,\n ...rest\n } = props;\n const [firstItemVisible, setFirstItemVisible] = useState(true);\n const [lastItemVisible, setLastItemVisible] = useState(true);\n\n const refs = useMemo(() => new TabItemRefs(index), []);\n\n const uniqId = safeUseId();\n const tabsId = id || uniqId;\n\n const isFilled = view === 'filled'; // outer padding is only for filled view\n const pilledAttr = view !== 'clear' && pilled;\n const pilledClass = pilledAttr ? classes.tabsPilled : undefined;\n\n const noDividerClass = !hasDivider ? classes.tabsNoDivider : undefined;\n const stretchClass = firstItemVisible && lastItemVisible && stretch ? classes.tabsStretch : undefined;\n const hasLeftArrowClass = !firstItemVisible ? classes.tabsHasLeftArrow : undefined;\n const hasRightArrowClass = !lastItemVisible ? classes.tabsHasRightArrow : undefined;\n const clipScrollClass = clip === 'scroll' ? classes.tabsClipScroll : undefined;\n const clipShowAllClass = clip === 'showAll' ? classes.tabsClipShowAll : undefined;\n\n const scrollRef = useRef<HTMLElement | null>(null);\n const trackRef = useRef<HTMLElement | null>(null);\n const leftArrowRef = useRef<HTMLButtonElement | null>(null);\n\n const onPrev = useCallback(() => {\n if (disabled || !scrollRef.current) {\n return;\n }\n\n const scrollLeft = Math.round(scrollRef.current.scrollLeft);\n const firstOverflowingTab = refs.items\n .slice()\n .reverse()\n .find((item: MutableRefObject<HTMLElement | null>) => {\n if (!item.current || item.current.offsetLeft === undefined) {\n return;\n }\n const tabStartX = item.current.offsetLeft;\n\n return tabStartX < scrollLeft;\n });\n\n firstOverflowingTab?.current?.scrollIntoView({ block: 'nearest', inline: 'start' });\n }, [disabled, scrollRef, refs]);\n\n const onNext = useCallback(() => {\n if (disabled || !scrollRef.current) {\n return;\n }\n\n const scrollRight = Math.round(scrollRef.current.scrollLeft + scrollRef.current.clientWidth);\n const lastOverflowingTab = refs.items.find((item: MutableRefObject<HTMLElement | null>) => {\n if (!item.current || item.current.offsetLeft === undefined) {\n return;\n }\n const tabEndX = item.current.offsetLeft + item.current.offsetWidth;\n\n return tabEndX > scrollRight;\n });\n\n lastOverflowingTab?.current?.scrollIntoView({ block: 'nearest', inline: 'end' });\n }, [disabled, scrollRef, refs]);\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 isFilled={isFilled}\n ref={leftArrowRef}\n isLeftArrow\n >\n <IconDisclosureLeft size={getIconSize(size)} color=\"inherit\" />\n </StyledArrow>\n ),\n [onPrev, size, disabled, isFilled],\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 isFilled={isFilled}\n >\n <IconDisclosureRight size={getIconSize(size)} color=\"inherit\" />\n </StyledArrow>\n ),\n [onNext, size, disabled, isFilled],\n );\n\n const handleScroll = useCallback(\n (event: React.UIEvent<HTMLElement>): void => {\n event.stopPropagation();\n const maxScrollLeft = event.currentTarget.scrollWidth - event.currentTarget.clientWidth;\n const scrollLeft = Math.round(event.currentTarget.scrollLeft);\n\n setFirstItemVisible(scrollLeft <= 0);\n setLastItemVisible(scrollLeft >= maxScrollLeft);\n },\n [setFirstItemVisible, setLastItemVisible],\n );\n\n const onKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n if (index === undefined) {\n return;\n }\n\n const minIndex = 0;\n const maxIndex = refs.items.length - 1;\n let nextIndex: number;\n\n switch (event.keyCode) {\n case Keys.end:\n nextIndex = maxIndex;\n break;\n case Keys.left:\n nextIndex = index > minIndex ? index - 1 : index;\n break;\n case Keys.right:\n nextIndex = index < maxIndex ? index + 1 : index;\n break;\n case Keys.home:\n nextIndex = minIndex;\n break;\n default:\n return;\n }\n\n if (nextIndex !== index) {\n event.preventDefault();\n refs.items[nextIndex].current?.focus();\n refs.items[nextIndex].current?.scrollIntoView({\n block: 'nearest',\n inline: 'center',\n behavior: 'smooth',\n });\n }\n },\n [index],\n );\n\n useEffect(() => {\n setLastItemVisible(scrollRef.current?.scrollWidth === scrollRef.current?.clientWidth);\n }, []);\n\n // Этот хук компенсирует появление левой стрелки при прокрутке\n useEffect(() => {\n if (firstItemVisible || !scrollRef.current || !leftArrowRef.current) {\n return;\n }\n\n scrollRef.current.scrollTo({\n left: Math.round(scrollRef.current.scrollLeft + leftArrowRef.current.clientWidth),\n });\n }, [firstItemVisible, scrollRef, leftArrowRef]);\n\n return (\n <TabsContext.Provider value={refs}>\n <Root\n view={view}\n role=\"tablist\"\n // TODO: убрать каст any, когда будут удалены deprecated props\n size={size as any}\n pilled={pilled}\n id={tabsId}\n ref={outerRef}\n disabled={disabled}\n className={cx(\n pilledClass,\n stretchClass,\n hasLeftArrowClass,\n hasRightArrowClass,\n noDividerClass,\n className,\n )}\n onKeyDown={onKeyDown}\n {...rest}\n >\n {!firstItemVisible && PreviousButton}\n <StyledContentWrapper\n className={cx(clipScrollClass, clipShowAllClass)}\n ref={scrollRef as MutableRefObject<HTMLDivElement | null>}\n onScroll={handleScroll}\n >\n <StyledContent ref={trackRef as MutableRefObject<HTMLDivElement | null>}>\n {children}\n </StyledContent>\n </StyledContentWrapper>\n {!lastItemVisible && NextButton}\n </Root>\n </TabsContext.Provider>\n );\n });\n\nexport const horizontalTabsConfig = {\n name: 'HorizontalTabs',\n tag: 'div',\n layout: horizontalTabsRoot,\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 stretch: {\n css: stretchCSS,\n attrs: true,\n },\n pilled: {\n css: pilledCSS,\n },\n },\n defaults: {\n view: 'clear',\n size: 'xs',\n },\n};\n"],"names":["Keys","getIconSize","size","horizontalTabsRoot","Root","forwardRef","props","outerRef","id","_props$stretch","stretch","_props$disabled","disabled","_props$clip","clip","view","children","_props$pilled","pilled","index","className","_props$hasDivider","hasDivider","rest","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","firstItemVisible","setFirstItemVisible","_useState3","_useState4","lastItemVisible","setLastItemVisible","refs","useMemo","TabItemRefs","uniqId","safeUseId","tabsId","isFilled","pilledAttr","pilledClass","classes","tabsPilled","undefined","noDividerClass","tabsNoDivider","stretchClass","tabsStretch","hasLeftArrowClass","tabsHasLeftArrow","hasRightArrowClass","tabsHasRightArrow","clipScrollClass","tabsClipScroll","clipShowAllClass","tabsClipShowAll","scrollRef","useRef","trackRef","leftArrowRef","onPrev","useCallback","_firstOverflowingTab$","current","scrollLeft","Math","round","firstOverflowingTab","items","slice","reverse","find","item","offsetLeft","tabStartX","scrollIntoView","block","inline","onNext","_lastOverflowingTab$c","scrollRight","clientWidth","lastOverflowingTab","tabEndX","offsetWidth","PreviousButton","React","createElement","StyledArrow","type","onClick","tabIndex","ref","isLeftArrow","IconDisclosureLeft","color","NextButton","IconDisclosureRight","handleScroll","event","stopPropagation","maxScrollLeft","currentTarget","scrollWidth","onKeyDown","minIndex","maxIndex","length","nextIndex","keyCode","end","left","right","home","_refs$items$nextIndex","_refs$items$nextIndex2","preventDefault","focus","behavior","useEffect","_scrollRef$current","_scrollRef$current2","scrollTo","TabsContext","Provider","value","_extends","role","cx","StyledContentWrapper","onScroll","StyledContent","horizontalTabsConfig","name","tag","layout","base","variations","css","sizeCSS","viewCSS","disabledCSS","attrs","stretchCSS","pilledCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;AAgBiG,IAE5FA,IAAI,0BAAJA,IAAI,EAAA;AAAJA,EAAAA,IAAI,CAAJA,IAAI,CAAA,KAAA,CAAA,GAAA,EAAA,CAAA,GAAA,KAAA,CAAA;AAAJA,EAAAA,IAAI,CAAJA,IAAI,CAAA,MAAA,CAAA,GAAA,EAAA,CAAA,GAAA,MAAA,CAAA;AAAJA,EAAAA,IAAI,CAAJA,IAAI,CAAA,MAAA,CAAA,GAAA,EAAA,CAAA,GAAA,MAAA,CAAA;AAAJA,EAAAA,IAAI,CAAJA,IAAI,CAAA,OAAA,CAAA,GAAA,EAAA,CAAA,GAAA,OAAA,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,eACpCC,KAAA,CAAAC,aAAA,CAAC0C,oBAAoB,EAAA;AACjBjH,MAAAA,SAAS,EAAEgH,EAAE,CAAC5E,eAAe,EAAEE,gBAAgB,CAAE;AACjDsC,MAAAA,GAAG,EAAEpC,SAAqD;AAC1D0E,MAAAA,QAAQ,EAAEhC,YAAAA;AAAa,KAAA,eAEvBZ,KAAA,CAAAC,aAAA,CAAC4C,aAAa,EAAA;AAACvC,MAAAA,GAAG,EAAElC,QAAAA;KACf9C,EAAAA,QACU,CACG,CAAC,EACtB,CAACkB,eAAe,IAAIkE,UACnB,CACY,CAAC,CAAA;AAE/B,GAAC,CAAC,CAAA;AAAA,EAAA;AAEC,IAAMoC,oBAAoB,GAAG;AAChCC,EAAAA,IAAI,EAAE,gBAAgB;AACtBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAExI,kBAAkB;AAC1ByI,EAAAA,IAAI,EAAJA,IAAI;AACJC,EAAAA,UAAU,EAAE;AACR3I,IAAAA,IAAI,EAAE;AACF4I,MAAAA,GAAG,EAAEC,MAAAA;KACR;AACDhI,IAAAA,IAAI,EAAE;AACF+H,MAAAA,GAAG,EAAEE,MAAAA;KACR;AACDpI,IAAAA,QAAQ,EAAE;AACNkI,MAAAA,GAAG,EAAEG,MAAW;AAChBC,MAAAA,KAAK,EAAE,IAAA;KACV;AACDxI,IAAAA,OAAO,EAAE;AACLoI,MAAAA,GAAG,EAAEK,MAAU;AACfD,MAAAA,KAAK,EAAE,IAAA;KACV;AACDhI,IAAAA,MAAM,EAAE;AACJ4H,MAAAA,GAAG,EAAEM,MAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNtI,IAAAA,IAAI,EAAE,OAAO;AACbb,IAAAA,IAAI,EAAE,IAAA;AACV,GAAA;AACJ;;;;"}
|
1
|
+
{"version":3,"file":"HorizontalTabs.js","sources":["../../../../../../src/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useMemo, useState, useEffect, useRef, KeyboardEvent } from 'react';\nimport type { MutableRefObject } from 'react';\nimport { safeUseId } 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 { TabItemRefs, TabsContext } from '../../../TabsContext';\nimport type { HorizontalTabsProps } from '../../../Tabs.types';\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 stretchCSS } from './variations/_stretch/base';\nimport { StyledArrow, StyledContent, StyledContentWrapper, base } from './HorizontalTabs.styles';\n\nenum Keys {\n end = 35,\n home = 36,\n left = 37,\n right = 39,\n}\n\n// TODO: https://github.com/salute-developers/plasma/issues/1474\nexport const horizontalTabsRoot = (Root: RootProps<HTMLDivElement, HorizontalTabsProps>) =>\n forwardRef<HTMLDivElement, HorizontalTabsProps>((props, outerRef) => {\n const {\n id,\n stretch = false,\n disabled = false,\n clip = 'scroll',\n size,\n view,\n children,\n pilled = false,\n index,\n className,\n ...rest\n } = props;\n const [firstItemVisible, setFirstItemVisible] = useState(true);\n const [lastItemVisible, setLastItemVisible] = useState(true);\n\n const refs = useMemo(() => new TabItemRefs(index), []);\n\n const uniqId = safeUseId();\n const tabsId = id || uniqId;\n\n const isFilled = view === 'filled'; // outer padding is only for filled view\n const pilledAttr = view !== 'clear' && pilled;\n const pilledClass = pilledAttr ? classes.tabsPilled : undefined;\n\n const stretchClass = firstItemVisible && lastItemVisible && stretch ? classes.tabsStretch : undefined;\n const hasLeftArrowClass = !firstItemVisible ? classes.tabsHasLeftArrow : undefined;\n const hasRightArrowClass = !lastItemVisible ? classes.tabsHasRightArrow : undefined;\n const clipScrollClass = clip === 'scroll' ? classes.tabsClipScroll : undefined;\n const clipShowAllClass = clip === 'showAll' ? classes.tabsClipShowAll : undefined;\n\n const scrollRef = useRef<HTMLElement | null>(null);\n const trackRef = useRef<HTMLElement | null>(null);\n const leftArrowRef = useRef<HTMLButtonElement | null>(null);\n\n const onPrev = useCallback(() => {\n if (disabled || !scrollRef.current) {\n return;\n }\n\n const scrollLeft = Math.round(scrollRef.current.scrollLeft);\n const firstOverflowingTab = refs.items\n .slice()\n .reverse()\n .find((item: MutableRefObject<HTMLElement | null>) => {\n if (!item.current || item.current.offsetLeft === undefined) {\n return;\n }\n const tabStartX = item.current.offsetLeft;\n\n return tabStartX < scrollLeft;\n });\n\n firstOverflowingTab?.current?.scrollIntoView({ block: 'nearest', inline: 'start' });\n }, [disabled, scrollRef, refs]);\n\n const onNext = useCallback(() => {\n if (disabled || !scrollRef.current) {\n return;\n }\n\n const scrollRight = Math.round(scrollRef.current.scrollLeft + scrollRef.current.clientWidth);\n const lastOverflowingTab = refs.items.find((item: MutableRefObject<HTMLElement | null>) => {\n if (!item.current || item.current.offsetLeft === undefined) {\n return;\n }\n const tabEndX = item.current.offsetLeft + item.current.offsetWidth;\n\n return tabEndX > scrollRight;\n });\n\n lastOverflowingTab?.current?.scrollIntoView({ block: 'nearest', inline: 'end' });\n }, [disabled, scrollRef, refs]);\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 isFilled={isFilled}\n ref={leftArrowRef}\n isLeftArrow\n >\n <IconDisclosureLeft color={`var(${tokens.arrowColor})`} />\n </StyledArrow>\n ),\n [onPrev, disabled, isFilled],\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 isFilled={isFilled}\n >\n <IconDisclosureRight color={`var(${tokens.arrowColor})`} />\n </StyledArrow>\n ),\n [onNext, disabled, isFilled],\n );\n\n const handleScroll = useCallback(\n (event: React.UIEvent<HTMLElement>): void => {\n event.stopPropagation();\n const maxScrollLeft = event.currentTarget.scrollWidth - event.currentTarget.clientWidth;\n const scrollLeft = Math.round(event.currentTarget.scrollLeft);\n\n setFirstItemVisible(scrollLeft <= 0);\n setLastItemVisible(scrollLeft >= maxScrollLeft);\n },\n [setFirstItemVisible, setLastItemVisible],\n );\n\n const onKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n if (index === undefined) {\n return;\n }\n\n const minIndex = 0;\n const maxIndex = refs.items.length - 1;\n let nextIndex: number;\n\n switch (event.keyCode) {\n case Keys.end:\n nextIndex = maxIndex;\n break;\n case Keys.left:\n nextIndex = index > minIndex ? index - 1 : index;\n break;\n case Keys.right:\n nextIndex = index < maxIndex ? index + 1 : index;\n break;\n case Keys.home:\n nextIndex = minIndex;\n break;\n default:\n return;\n }\n\n if (nextIndex !== index) {\n event.preventDefault();\n refs.items[nextIndex].current?.focus();\n refs.items[nextIndex].current?.scrollIntoView({\n block: 'nearest',\n inline: 'center',\n behavior: 'smooth',\n });\n }\n },\n [index],\n );\n\n useEffect(() => {\n setLastItemVisible(scrollRef.current?.scrollWidth === scrollRef.current?.clientWidth);\n }, []);\n\n // Этот хук компенсирует появление левой стрелки при прокрутке\n useEffect(() => {\n if (firstItemVisible || !scrollRef.current || !leftArrowRef.current) {\n return;\n }\n\n scrollRef.current.scrollTo({\n left: Math.round(scrollRef.current.scrollLeft + leftArrowRef.current.clientWidth),\n });\n }, [firstItemVisible, scrollRef, leftArrowRef]);\n\n return (\n <TabsContext.Provider value={refs}>\n <Root\n view={view}\n role=\"tablist\"\n size={size}\n pilled={pilled}\n id={tabsId}\n ref={outerRef}\n disabled={disabled}\n className={cx(pilledClass, stretchClass, hasLeftArrowClass, hasRightArrowClass, className)}\n onKeyDown={onKeyDown}\n {...rest}\n >\n {!firstItemVisible && PreviousButton}\n <StyledContentWrapper\n className={cx(clipScrollClass, clipShowAllClass)}\n ref={scrollRef as MutableRefObject<HTMLDivElement | null>}\n onScroll={handleScroll}\n >\n <StyledContent ref={trackRef as MutableRefObject<HTMLDivElement | null>}>\n {children}\n </StyledContent>\n </StyledContentWrapper>\n {!lastItemVisible && NextButton}\n </Root>\n </TabsContext.Provider>\n );\n });\n\nexport const horizontalTabsConfig = {\n name: 'HorizontalTabs',\n tag: 'div',\n layout: horizontalTabsRoot,\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 stretch: {\n css: stretchCSS,\n attrs: true,\n },\n pilled: {\n css: pilledCSS,\n },\n },\n defaults: {\n view: 'clear',\n size: 'xs',\n },\n};\n"],"names":["Keys","horizontalTabsRoot","Root","forwardRef","props","outerRef","id","_props$stretch","stretch","_props$disabled","disabled","_props$clip","clip","size","view","children","_props$pilled","pilled","index","className","rest","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","firstItemVisible","setFirstItemVisible","_useState3","_useState4","lastItemVisible","setLastItemVisible","refs","useMemo","TabItemRefs","uniqId","safeUseId","tabsId","isFilled","pilledAttr","pilledClass","classes","tabsPilled","undefined","stretchClass","tabsStretch","hasLeftArrowClass","tabsHasLeftArrow","hasRightArrowClass","tabsHasRightArrow","clipScrollClass","tabsClipScroll","clipShowAllClass","tabsClipShowAll","scrollRef","useRef","trackRef","leftArrowRef","onPrev","useCallback","_firstOverflowingTab$","current","scrollLeft","Math","round","firstOverflowingTab","items","slice","reverse","find","item","offsetLeft","tabStartX","scrollIntoView","block","inline","onNext","_lastOverflowingTab$c","scrollRight","clientWidth","lastOverflowingTab","tabEndX","offsetWidth","PreviousButton","React","createElement","StyledArrow","type","onClick","tabIndex","ref","isLeftArrow","IconDisclosureLeft","color","concat","tokens","arrowColor","NextButton","IconDisclosureRight","handleScroll","event","stopPropagation","maxScrollLeft","currentTarget","scrollWidth","onKeyDown","minIndex","maxIndex","length","nextIndex","keyCode","end","left","right","home","_refs$items$nextIndex","_refs$items$nextIndex2","preventDefault","focus","behavior","useEffect","_scrollRef$current","_scrollRef$current2","scrollTo","TabsContext","Provider","value","_extends","role","cx","StyledContentWrapper","onScroll","StyledContent","horizontalTabsConfig","name","tag","layout","base","variations","css","sizeCSS","viewCSS","disabledCSS","attrs","stretchCSS","pilledCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;AAgBiG,IAE5FA,IAAI,0BAAJA,IAAI,EAAA;AAAJA,EAAAA,IAAI,CAAJA,IAAI,CAAA,KAAA,CAAA,GAAA,EAAA,CAAA,GAAA,KAAA,CAAA;AAAJA,EAAAA,IAAI,CAAJA,IAAI,CAAA,MAAA,CAAA,GAAA,EAAA,CAAA,GAAA,MAAA,CAAA;AAAJA,EAAAA,IAAI,CAAJA,IAAI,CAAA,MAAA,CAAA,GAAA,EAAA,CAAA,GAAA,MAAA,CAAA;AAAJA,EAAAA,IAAI,CAAJA,IAAI,CAAA,OAAA,CAAA,GAAA,EAAA,CAAA,GAAA,OAAA,CAAA;AAAA,EAAA,OAAJA,IAAI,CAAA;AAAA,CAAA,CAAJA,IAAI,IAOT,EAAA,CAAA,CAAA;IACaC,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIC,IAAoD,EAAA;AAAA,EAAA,oBACnFC,UAAU,CAAsC,UAACC,KAAK,EAAEC,QAAQ,EAAK;AACjE,IAAA,IACIC,EAAE,GAWFF,KAAK,CAXLE,EAAE;MAAAC,cAAA,GAWFH,KAAK,CAVLI,OAAO;AAAPA,MAAAA,OAAO,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,cAAA;MAAAE,eAAA,GAUfL,KAAK,CATLM,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,eAAA;MAAAE,WAAA,GAShBP,KAAK,CARLQ,IAAI;AAAJA,MAAAA,IAAI,GAAAD,WAAA,KAAG,KAAA,CAAA,GAAA,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AAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNrI,IAAAA,IAAI,EAAE,OAAO;AACbD,IAAAA,IAAI,EAAE,IAAA;AACV,GAAA;AACJ;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"HorizontalTabs.styles.js","sources":["../../../../../../src/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.ts"],"sourcesContent":["import { css } from '@linaria/core';\nimport { styled } from '@linaria/react';\n\nimport { addFocus } from '../../../../../mixins';\nimport { classes, tokens } from '../../../tokens';\n\nexport const base = css`\n display: flex;\n gap: 0.125rem;\n align-items: center;\n position: relative;\n`;\n\nexport const StyledContent = styled.div`\n display: inline-flex;\n flex-direction: row;\n align-items: center;\n`;\n\nexport const StyledContentWrapper = styled.div`\n /* allows correctly display outline focus on tabs item */\n margin: -0.125rem;\n padding: 0.25rem;\n\n box-sizing: content-box;\n position: relative;\n height: 100%;\n width: 100%;\n display: flex;\n align-items: center;\n\n z-index: 1;\n\n &.${classes.tabsClipScroll} {\n overflow: scroll;\n scroll-padding: 0.25rem;\n overscroll-behavior: contain;\n\n scrollbar-width: none;\n ::-webkit-scrollbar {\n display: none;\n }\n }\n\n &.${classes.tabsClipShowAll} {\n overflow: visible;\n }\n`;\n\nexport const StyledArrow = styled.button<{ isLeftArrow?: boolean; isFilled?: boolean }>`\n display: flex;\n cursor: pointer;\n border: none;\n background-color: transparent;\n padding: 0;\n outline: none;\n\n ${addFocus({\n outlineSize: '0.063rem',\n outlineOffset: '-0.125rem',\n outlineColor: `var(${tokens.outlineFocusColor})`,\n outlineRadius: 'calc(var(--plasma_private-outline-radius) - 0.063rem)',\n })};\n\n &[disabled] {\n cursor: not-allowed;\n }\n\n --plasma_private-outer-padding: ${({ isFilled }) => (isFilled ? `var(${tokens.arrowOuterPadding})` : '')};\n\n padding-right: ${({ isLeftArrow }) =>\n isLeftArrow ? `var(${tokens.arrowInnerPadding})` : 'var(--plasma_private-outer-padding)'};\n padding-left: ${({ isLeftArrow }) =>\n isLeftArrow ? 'var(--plasma_private-outer-padding)' : `var(${tokens.arrowInnerPadding})`};\n
|
1
|
+
{"version":3,"file":"HorizontalTabs.styles.js","sources":["../../../../../../src/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.ts"],"sourcesContent":["import { css } from '@linaria/core';\nimport { styled } from '@linaria/react';\n\nimport { addFocus } from '../../../../../mixins';\nimport { classes, tokens } from '../../../tokens';\n\nexport const base = css`\n display: flex;\n gap: 0.125rem;\n align-items: center;\n position: relative;\n`;\n\nexport const StyledContent = styled.div`\n display: inline-flex;\n flex-direction: row;\n align-items: center;\n`;\n\nexport const StyledContentWrapper = styled.div`\n /* allows correctly display outline focus on tabs item */\n margin: -0.125rem;\n padding: 0.25rem;\n\n box-sizing: content-box;\n position: relative;\n height: 100%;\n width: 100%;\n display: flex;\n align-items: center;\n\n z-index: 1;\n\n &.${classes.tabsClipScroll} {\n overflow: scroll;\n scroll-padding: 0.25rem;\n overscroll-behavior: contain;\n\n scrollbar-width: none;\n ::-webkit-scrollbar {\n display: none;\n }\n }\n\n &.${classes.tabsClipShowAll} {\n overflow: visible;\n }\n`;\n\nexport const StyledArrow = styled.button<{ isLeftArrow?: boolean; isFilled?: boolean }>`\n display: flex;\n cursor: pointer;\n border: none;\n background-color: transparent;\n padding: 0;\n outline: none;\n\n ${addFocus({\n outlineSize: '0.063rem',\n outlineOffset: '-0.125rem',\n outlineColor: `var(${tokens.outlineFocusColor})`,\n outlineRadius: 'calc(var(--plasma_private-outline-radius) - 0.063rem)',\n })};\n\n &[disabled] {\n cursor: not-allowed;\n }\n\n --plasma_private-outer-padding: ${({ isFilled }) => (isFilled ? `var(${tokens.arrowOuterPadding})` : '')};\n\n padding-right: ${({ isLeftArrow }) =>\n isLeftArrow ? `var(${tokens.arrowInnerPadding})` : 'var(--plasma_private-outer-padding)'};\n padding-left: ${({ isLeftArrow }) =>\n isLeftArrow ? 'var(--plasma_private-outer-padding)' : `var(${tokens.arrowInnerPadding})`};\n`;\n"],"names":["base","StyledContent","styled","name","class","propsAsIs","StyledContentWrapper","_exp4","_ref","isFilled","concat","tokens","arrowOuterPadding","_exp5","_ref2","isLeftArrow","arrowInnerPadding","_exp6","_ref3","StyledArrow","vars"],"mappings":";;;AAMO,IAAMA,IAAI,GAKhB,UAAA;AAEM,IAAMC,aAAa,gBAAGC,MAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,eAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAIlC,EAAA;AAEM,IAAMC,oBAAoB,gBAAGJ,MAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,sBAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CA4BzC,EAAA;AAAC,IAAAE,KAAA,GA9CgBA,SA8ChBA,KAAAA,GAAA;AAAA,EAAA,OAqBoC,UAAAC,IAAA,EAAA;AAAA,IAAA,IAAGC,QAAAA,GAAAA,IAAAA,CAAAA,QAAAA,CAAAA;IAAAA,OAAgBA,QAAQ,UAAAC,MAAA,CAAUC,MAAM,CAACC,iBAAkB,SAAK,EAAG,CAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAAA,IAAAC,KAAA,GAnE1FA,SAmE0FA,KAAAA,GAAA;AAAA,EAAA,OAEvF,UAAAC,KAAA,EAAA;AAAA,IAAA,IAAGC,WAAAA,GAAAA,KAAAA,CAAAA,WAAAA,CAAAA;IAAAA,OAChBA,WAAW,UAAAL,MAAA,CAAUC,MAAM,CAACK,iBAAkB,SAAK,qCAAqC,CAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAAA,IAAAC,KAAA,GAtE9EA,SAsE8EA,KAAAA,GAAA;AAAA,EAAA,OAC5E,UAAAC,KAAA,EAAA;AAAA,IAAA,IAAGH,WAAAA,GAAAA,KAAAA,CAAAA,WAAAA,CAAAA;IAAAA,OACfA,WAAW,GAAG,qCAAqC,GAAA,MAAA,CAAAL,MAAA,CAAUC,MAAM,CAACK,iBAAkB,EAAE,GAAA,CAAA,CAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAxBzF,IAAMG,WAAW,gBAAGjB,MAAM,CAAA,QAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,aAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAAe,EAAAA,IAAA,EAAA;AAAA,IAAA,YAAA,EAAA,cAmBKb,KAAsE,EAAA,CAAA;AAAA,IAAA,YAAA,EAAA,cAEvFM,KAC2E,EAAA,CAAA;AAAA,IAAA,YAAA,EAAA,cAC5EI,KAC4E,EAAA,CAAA;AAAA,GAAA;AAAA,CAC/F;;;;"}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
.b7gl603{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:0.125rem;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative;}
|
2
2
|
.s191iwmt{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
|
3
3
|
.s158pfyo{margin:-0.125rem;padding:0.25rem;box-sizing:content-box;position:relative;height:100%;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;z-index:1;}.s158pfyo.tabs-clip-scroll{overflow:scroll;-webkit-scroll-padding:0.25rem;-moz-scroll-padding:0.25rem;-ms-scroll-padding:0.25rem;scroll-padding:0.25rem;overscroll-behavior:contain;-webkit-scrollbar-width:none;-moz-scrollbar-width:none;-ms-scrollbar-width:none;scrollbar-width:none;}.s158pfyo.tabs-clip-scroll::-webkit-scrollbar{display:none;}.s158pfyo.tabs-clip-show-all{overflow:visible;}
|
4
|
-
.s1in38wj{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;cursor:pointer;border:none;background-color:transparent;padding:0;outline:none;position:relative;--plasma_private-outer-padding:var(--s1in38wj-0);padding-right:var(--s1in38wj-1);padding-left:var(--s1in38wj-2);
|
4
|
+
.s1in38wj{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;cursor:pointer;border:none;background-color:transparent;padding:0;outline:none;position:relative;--plasma_private-outer-padding:var(--s1in38wj-0);padding-right:var(--s1in38wj-1);padding-left:var(--s1in38wj-2);}.s1in38wj::before{content:'';position:absolute;top:-0.125rem;left:-0.125rem;right:-0.125rem;bottom:-0.125rem;z-index:1;display:block;box-sizing:content-box;border:0.063rem solid transparent;border-radius:calc(var(--plasma_private-outline-radius) - 0.063rem);-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.s1in38wj.focus-visible:focus::before,.s1in38wj[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.063rem var(--plasma-tabs-outline-focus-color);}.s1in38wj[disabled]{cursor:not-allowed;}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"base.js","sources":["../../../../../../../../src/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { classes, tokens } from '../../../../../tokens';\n\nexport const base = css`\n background-color: var(${tokens.tabsBackgroundColor});\n\n &::after {\n content: '';\n position: absolute;\n bottom: 0.125rem;\n left: 0.125rem;\n right: 0.125rem;\n background: var(${tokens.tabsDividerColor});\n height: var(${tokens.tabsDividerHeight});\n border-radius: var(${tokens.tabsDividerBorderRadius});\n }\n\n &.${classes.tabsHasLeftArrow} {\n &::after {\n left: 1.5rem;\n }\n }\n\n &.${classes.tabsHasRightArrow} {\n &::after {\n right: 1.5rem;\n }\n }\n
|
1
|
+
{"version":3,"file":"base.js","sources":["../../../../../../../../src/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { classes, tokens } from '../../../../../tokens';\n\nexport const base = css`\n background-color: var(${tokens.tabsBackgroundColor});\n\n &::after {\n content: '';\n position: absolute;\n bottom: 0.125rem;\n left: 0.125rem;\n right: 0.125rem;\n background: var(${tokens.tabsDividerColor});\n height: var(${tokens.tabsDividerHeight});\n border-radius: var(${tokens.tabsDividerBorderRadius});\n }\n\n &.${classes.tabsHasLeftArrow} {\n &::after {\n left: 1.5rem;\n }\n }\n\n &.${classes.tabsHasRightArrow} {\n &::after {\n right: 1.5rem;\n }\n }\n`;\n"],"names":["base"],"mappings":"AAIO,IAAMA,IAAI,GAyBhB;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
.bupjtit{background-color:var(--plasma-tabs-background-color);}.bupjtit::after{content:'';position:absolute;bottom:0.125rem;left:0.125rem;right:0.125rem;background:var(--plasma-tabs-divider-color);height:var(--plasma-tabs-divider-height);border-radius:var(--plasma-tabs-divider-border-radius);}.bupjtit.tabs-has-left-arrow::after{left:1.5rem;}.bupjtit.tabs-has-right-arrow::after{right:1.5rem;}
|
1
|
+
.bupjtit{background-color:var(--plasma-tabs-background-color);}.bupjtit::after{content:'';position:absolute;bottom:0.125rem;left:0.125rem;right:0.125rem;background:var(--plasma-tabs-divider-color);height:var(--plasma-tabs-divider-height);border-radius:var(--plasma-tabs-divider-border-radius);}.bupjtit.tabs-has-left-arrow::after{left:1.5rem;}.bupjtit.tabs-has-right-arrow::after{right:1.5rem;}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
.IconRoot_7pl7ig_svvlqhf__32c458a1{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;width:var(--svvlqhf-0);height:var(--svvlqhf-0);-webkit-flex:0 0 var(--svvlqhf-0);-ms-flex:0 0 var(--svvlqhf-0);flex:0 0 var(--svvlqhf-0);}
|
2
2
|
|
3
|
-
.
|
4
|
-
.
|
5
|
-
.
|
6
|
-
.
|
3
|
+
.VerticalTabs_styles_1fr5ovg_b2r261u__3eaab5a9{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:0.125rem;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
|
4
|
+
.VerticalTabs_styles_1fr5ovg_s1tfgc53__3eaab5a9{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:start;-webkit-box-align:start;-ms-flex-align:start;align-items:start;}
|
5
|
+
.VerticalTabs_styles_1fr5ovg_s16g9t9z__3eaab5a9{margin:-0.125rem;padding:0.25rem;box-sizing:content-box;position:relative;height:100%;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;z-index:1;}.VerticalTabs_styles_1fr5ovg_s16g9t9z__3eaab5a9.VerticalTabs_styles_1fr5ovg_tabsClipScroll__3eaab5a9{overflow:scroll;-webkit-scroll-padding:0.25rem;-moz-scroll-padding:0.25rem;-ms-scroll-padding:0.25rem;scroll-padding:0.25rem;overscroll-behavior:contain;-webkit-scrollbar-width:none;-moz-scrollbar-width:none;-ms-scrollbar-width:none;scrollbar-width:none;}.VerticalTabs_styles_1fr5ovg_s16g9t9z__3eaab5a9.VerticalTabs_styles_1fr5ovg_tabsClipScroll__3eaab5a9::-webkit-scrollbar{display:none;}.VerticalTabs_styles_1fr5ovg_s16g9t9z__3eaab5a9.VerticalTabs_styles_1fr5ovg_tabsClipScroll__3eaab5a9 .VerticalTabs_styles_1fr5ovg_s1tfgc53__3eaab5a9{margin-top:auto;}.VerticalTabs_styles_1fr5ovg_s16g9t9z__3eaab5a9.VerticalTabs_styles_1fr5ovg_tabsClipShowAll__3eaab5a9{overflow:visible;}
|
6
|
+
.VerticalTabs_styles_1fr5ovg_s81cx4__3eaab5a9{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;cursor:pointer;border:none;background-color:transparent;padding:0;outline:none;-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);position:relative;}.VerticalTabs_styles_1fr5ovg_s81cx4__3eaab5a9::before{content:'';position:absolute;top:-0.125rem;left:-0.125rem;right:-0.125rem;bottom:-0.125rem;z-index:1;display:block;box-sizing:content-box;border:0.063rem solid transparent;border-radius:calc(var(--plasma_private-outline-radius) - 0.063rem);-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.VerticalTabs_styles_1fr5ovg_s81cx4__3eaab5a9.VerticalTabs_styles_1fr5ovg_focusVisible__3eaab5a9:focus::before,.VerticalTabs_styles_1fr5ovg_s81cx4__3eaab5a9[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.063rem var(--plasma-tabs-outline-focus-color);}.VerticalTabs_styles_1fr5ovg_s81cx4__3eaab5a9[disabled]{cursor:not-allowed;}
|
7
7
|
|
8
8
|
.base_1sekozo_b1t51iwr__491bf88c{width:var(--plasma-tabs-width);height:var(--plasma-tabs-height);--plasma_private-outline-radius:var(--plasma-tabs-border-radius);border-radius:var(--plasma-tabs-border-radius);}
|
9
9
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
2
|
import React, { forwardRef, useState, useMemo, useRef, useCallback, useEffect } from 'react';
|
3
3
|
import { safeUseId } from '@salutejs/plasma-core';
|
4
|
-
import { classes } from '../../../tokens.js';
|
4
|
+
import { classes, tokens } from '../../../tokens.js';
|
5
5
|
import { cx } from '../../../../../utils/index.js';
|
6
6
|
import { TabItemRefs, TabsContext } from '../../../TabsContext.js';
|
7
7
|
import { StyledContentWrapper, StyledContent, base, StyledArrow } from './VerticalTabs.styles.js';
|
@@ -11,7 +11,6 @@ import { base as base$3 } from './variations/_disabled/base.js';
|
|
11
11
|
import { IconDisclosureLeft } from '../../../../_Icon/Icons/IconDisclosureLeft.js';
|
12
12
|
import { IconDisclosureRight } from '../../../../_Icon/Icons/IconDisclosureRight.js';
|
13
13
|
|
14
|
-
var _IconDisclosureLeft, _IconDisclosureRight;
|
15
14
|
var _excluded = ["id", "disabled", "clip", "size", "view", "children", "index", "className", "orientation", "hasDivider"];
|
16
15
|
var Keys = /*#__PURE__*/function (Keys) {
|
17
16
|
Keys[Keys["end"] = 35] = "end";
|
@@ -100,18 +99,18 @@ var verticalTabsRoot = function verticalTabsRoot(Root) {
|
|
100
99
|
tabIndex: disabled ? -1 : 0,
|
101
100
|
disabled: disabled,
|
102
101
|
ref: upArrowRef
|
103
|
-
},
|
104
|
-
color: "
|
105
|
-
}))
|
102
|
+
}, /*#__PURE__*/React.createElement(IconDisclosureLeft, {
|
103
|
+
color: "var(".concat(tokens.arrowColor, ")")
|
104
|
+
}));
|
106
105
|
var NextButton = /*#__PURE__*/React.createElement(StyledArrow, {
|
107
106
|
type: "button",
|
108
107
|
"aria-label": "\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439 \u0442\u0430\u0431",
|
109
108
|
onClick: onNext,
|
110
109
|
tabIndex: disabled ? -1 : 0,
|
111
110
|
disabled: disabled
|
112
|
-
},
|
113
|
-
color: "
|
114
|
-
}))
|
111
|
+
}, /*#__PURE__*/React.createElement(IconDisclosureRight, {
|
112
|
+
color: "var(".concat(tokens.arrowColor, ")")
|
113
|
+
}));
|
115
114
|
var handleScroll = useCallback(function (event) {
|
116
115
|
event.stopPropagation();
|
117
116
|
var maxScrollTop = event.currentTarget.scrollHeight - event.currentTarget.clientHeight;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"VerticalTabs.js","sources":["../../../../../../src/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useMemo, useState, useEffect, useRef, KeyboardEvent } from 'react';\nimport type { MutableRefObject } from 'react';\nimport { safeUseId } from '@salutejs/plasma-core';\n\nimport type { RootProps } from '../../../../../engines/types';\nimport { classes } from '../../../tokens';\nimport { cx } from '../../../../../utils';\nimport { TabItemRefs, TabsContext } from '../../../TabsContext';\nimport type { VerticalTabsProps } from '../../../Tabs.types';\nimport { IconDisclosureLeft, IconDisclosureRight } from '../../../../_Icon';\n\nimport { base, StyledArrow, StyledContent, StyledContentWrapper } from './VerticalTabs.styles';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\n\nenum Keys {\n end = 35,\n home = 36,\n up = 38,\n down = 40,\n}\n\n// TODO: https://github.com/salute-developers/plasma/issues/1474\nexport const verticalTabsRoot = (Root: RootProps<HTMLDivElement, VerticalTabsProps>) =>\n forwardRef<HTMLDivElement, VerticalTabsProps>((props, outerRef) => {\n const {\n id,\n disabled = false,\n clip = 'showAll',\n size,\n view,\n children,\n index,\n className,\n orientation,\n hasDivider = true,\n ...rest\n } = props;\n\n const [firstItemVisible, setFirstItemVisible] = useState(true);\n const [lastItemVisible, setLastItemVisible] = useState(true);\n\n const refs = useMemo(() => new TabItemRefs(index), []);\n\n const uniqId = safeUseId();\n const tabsId = id || uniqId;\n\n const noDividerClass = !hasDivider ? classes.tabsNoDivider : undefined;\n const hasTopArrowClass = !firstItemVisible ? classes.tabsHasTopArrow : undefined;\n const hasBottomArrowClass = !lastItemVisible ? classes.tabsHasBottomArrow : undefined;\n const clipScrollClass = clip === 'scroll' ? classes.tabsClipScroll : undefined;\n const clipShowAllClass = clip === 'showAll' ? classes.tabsClipShowAll : undefined;\n\n const scrollRef = useRef<HTMLElement | null>(null);\n const trackRef = useRef<HTMLElement | null>(null);\n const upArrowRef = useRef<HTMLButtonElement | null>(null);\n\n const onPrev = useCallback(() => {\n if (disabled || !scrollRef.current) {\n return;\n }\n\n const scrollTop = Math.round(scrollRef.current.scrollTop);\n const firstOverflowingTab = refs.items\n .slice()\n .reverse()\n .find((item: MutableRefObject<HTMLElement | null>) => {\n if (!item.current || item.current.offsetTop === undefined) {\n return;\n }\n const tabStartY = item.current.offsetTop;\n\n return tabStartY < scrollTop;\n });\n\n firstOverflowingTab?.current?.scrollIntoView({ block: 'start', inline: 'nearest' });\n }, [disabled, scrollRef, refs]);\n\n const onNext = useCallback(() => {\n if (disabled || !scrollRef.current) {\n return;\n }\n\n const scrollBottom = Math.round(scrollRef.current.scrollTop + scrollRef.current.clientHeight);\n const lastOverflowingTab = refs.items.find((item: MutableRefObject<HTMLElement | null>) => {\n if (!item.current || item.current.offsetTop === undefined) {\n return;\n }\n const tabEndY = item.current.offsetTop + item.current.offsetHeight;\n\n return tabEndY > scrollBottom;\n });\n\n lastOverflowingTab?.current?.scrollIntoView({ block: 'end', inline: 'nearest' });\n }, [disabled, scrollRef, refs]);\n\n const PreviousButton = (\n <StyledArrow\n type=\"button\"\n aria-label=\"Предыдущий таб\"\n onClick={onPrev}\n tabIndex={disabled ? -1 : 0}\n disabled={disabled}\n ref={upArrowRef}\n >\n <IconDisclosureLeft color=\"inherit\" />\n </StyledArrow>\n );\n\n const NextButton = (\n <StyledArrow\n type=\"button\"\n aria-label=\"Следующий таб\"\n onClick={onNext}\n tabIndex={disabled ? -1 : 0}\n disabled={disabled}\n >\n <IconDisclosureRight color=\"inherit\" />\n </StyledArrow>\n );\n\n const handleScroll = useCallback(\n (event: React.UIEvent<HTMLElement>): void => {\n event.stopPropagation();\n const maxScrollTop = event.currentTarget.scrollHeight - event.currentTarget.clientHeight;\n const scrollTop = Math.round(event.currentTarget.scrollTop);\n\n setFirstItemVisible(scrollTop <= 0);\n setLastItemVisible(scrollTop >= maxScrollTop);\n },\n [setFirstItemVisible, setLastItemVisible],\n );\n\n const onKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n if (index === undefined) {\n return;\n }\n\n const minIndex = 0;\n const maxIndex = refs.items.length - 1;\n let nextIndex: number;\n\n switch (event.keyCode) {\n case Keys.end:\n nextIndex = maxIndex;\n break;\n case Keys.up:\n nextIndex = index > minIndex ? index - 1 : index;\n break;\n case Keys.down:\n nextIndex = index < maxIndex ? index + 1 : index;\n break;\n case Keys.home:\n nextIndex = minIndex;\n break;\n default:\n return;\n }\n\n if (nextIndex !== index) {\n event.preventDefault();\n refs.items[nextIndex].current?.focus();\n refs.items[nextIndex].current?.scrollIntoView({\n block: 'nearest',\n inline: 'nearest',\n behavior: 'smooth',\n });\n }\n },\n [index],\n );\n\n useEffect(() => {\n setLastItemVisible(scrollRef.current?.scrollHeight === scrollRef.current?.clientHeight);\n }, []);\n\n // Этот хук компенсирует появление верхней стрелки при прокрутке\n useEffect(() => {\n if (firstItemVisible || !scrollRef.current || !upArrowRef.current) {\n return;\n }\n\n scrollRef.current.scrollTo({\n top: Math.round(scrollRef.current.scrollTop + upArrowRef.current.clientHeight),\n });\n }, [firstItemVisible, scrollRef, upArrowRef]);\n\n return (\n <TabsContext.Provider value={refs}>\n <Root\n view={view}\n role=\"tablist\"\n size={size}\n id={tabsId}\n ref={outerRef}\n disabled={disabled}\n className={cx(hasTopArrowClass, hasBottomArrowClass, noDividerClass, className)}\n onKeyDown={onKeyDown}\n orientation={orientation}\n {...rest}\n >\n {!firstItemVisible && PreviousButton}\n <StyledContentWrapper\n className={cx(clipScrollClass, clipShowAllClass)}\n ref={scrollRef as MutableRefObject<HTMLDivElement | null>}\n onScroll={handleScroll}\n >\n <StyledContent ref={trackRef as MutableRefObject<HTMLDivElement | null>}>\n {children}\n </StyledContent>\n </StyledContentWrapper>\n {!lastItemVisible && NextButton}\n </Root>\n </TabsContext.Provider>\n );\n });\n\nexport const verticalTabsConfig = {\n name: 'VerticalTabs',\n tag: 'div',\n layout: verticalTabsRoot,\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 },\n defaults: {\n view: 'divider',\n size: 'xs',\n },\n};\n"],"names":["Keys","verticalTabsRoot","Root","forwardRef","props","outerRef","id","_props$disabled","disabled","_props$clip","clip","size","view","children","index","className","orientation","_props$hasDivider","hasDivider","rest","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","firstItemVisible","setFirstItemVisible","_useState3","_useState4","lastItemVisible","setLastItemVisible","refs","useMemo","TabItemRefs","uniqId","safeUseId","tabsId","noDividerClass","classes","tabsNoDivider","undefined","hasTopArrowClass","tabsHasTopArrow","hasBottomArrowClass","tabsHasBottomArrow","clipScrollClass","tabsClipScroll","clipShowAllClass","tabsClipShowAll","scrollRef","useRef","trackRef","upArrowRef","onPrev","useCallback","_firstOverflowingTab$","current","scrollTop","Math","round","firstOverflowingTab","items","slice","reverse","find","item","offsetTop","tabStartY","scrollIntoView","block","inline","onNext","_lastOverflowingTab$c","scrollBottom","clientHeight","lastOverflowingTab","tabEndY","offsetHeight","PreviousButton","React","createElement","StyledArrow","type","onClick","tabIndex","ref","_IconDisclosureLeft","IconDisclosureLeft","color","NextButton","_IconDisclosureRight","IconDisclosureRight","handleScroll","event","stopPropagation","maxScrollTop","currentTarget","scrollHeight","onKeyDown","minIndex","maxIndex","length","nextIndex","keyCode","end","up","down","home","_refs$items$nextIndex","_refs$items$nextIndex2","preventDefault","focus","behavior","useEffect","_scrollRef$current","_scrollRef$current2","scrollTo","top","TabsContext","Provider","value","_extends","role","cx","StyledContentWrapper","onScroll","StyledContent","verticalTabsConfig","name","tag","layout","base","variations","css","sizeCSS","viewCSS","disabledCSS","attrs","defaults"],"mappings":";;;;;;;;;;;;;;;AAckE,IAE7DA,IAAI,0BAAJA,IAAI,EAAA;AAAJA,EAAAA,IAAI,CAAJA,IAAI,CAAA,KAAA,CAAA,GAAA,EAAA,CAAA,GAAA,KAAA,CAAA;AAAJA,EAAAA,IAAI,CA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AAAA,IAAI,EAAE,SAAS;AACfD,IAAAA,IAAI,EAAE,IAAA;AACV,GAAA;AACJ;;;;"}
|
1
|
+
{"version":3,"file":"VerticalTabs.js","sources":["../../../../../../src/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useMemo, useState, useEffect, useRef, KeyboardEvent } from 'react';\nimport type { MutableRefObject } from 'react';\nimport { safeUseId } from '@salutejs/plasma-core';\n\nimport type { RootProps } from '../../../../../engines/types';\nimport { classes, tokens } from '../../../tokens';\nimport { cx } from '../../../../../utils';\nimport { TabItemRefs, TabsContext } from '../../../TabsContext';\nimport type { VerticalTabsProps } from '../../../Tabs.types';\nimport { IconDisclosureLeft, IconDisclosureRight } from '../../../../_Icon';\n\nimport { base, StyledArrow, StyledContent, StyledContentWrapper } from './VerticalTabs.styles';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\n\nenum Keys {\n end = 35,\n home = 36,\n up = 38,\n down = 40,\n}\n\n// TODO: https://github.com/salute-developers/plasma/issues/1474\nexport const verticalTabsRoot = (Root: RootProps<HTMLDivElement, VerticalTabsProps>) =>\n forwardRef<HTMLDivElement, VerticalTabsProps>((props, outerRef) => {\n const {\n id,\n disabled = false,\n clip = 'showAll',\n size,\n view,\n children,\n index,\n className,\n orientation,\n hasDivider = true,\n ...rest\n } = props;\n\n const [firstItemVisible, setFirstItemVisible] = useState(true);\n const [lastItemVisible, setLastItemVisible] = useState(true);\n\n const refs = useMemo(() => new TabItemRefs(index), []);\n\n const uniqId = safeUseId();\n const tabsId = id || uniqId;\n\n const noDividerClass = !hasDivider ? classes.tabsNoDivider : undefined;\n const hasTopArrowClass = !firstItemVisible ? classes.tabsHasTopArrow : undefined;\n const hasBottomArrowClass = !lastItemVisible ? classes.tabsHasBottomArrow : undefined;\n const clipScrollClass = clip === 'scroll' ? classes.tabsClipScroll : undefined;\n const clipShowAllClass = clip === 'showAll' ? classes.tabsClipShowAll : undefined;\n\n const scrollRef = useRef<HTMLElement | null>(null);\n const trackRef = useRef<HTMLElement | null>(null);\n const upArrowRef = useRef<HTMLButtonElement | null>(null);\n\n const onPrev = useCallback(() => {\n if (disabled || !scrollRef.current) {\n return;\n }\n\n const scrollTop = Math.round(scrollRef.current.scrollTop);\n const firstOverflowingTab = refs.items\n .slice()\n .reverse()\n .find((item: MutableRefObject<HTMLElement | null>) => {\n if (!item.current || item.current.offsetTop === undefined) {\n return;\n }\n const tabStartY = item.current.offsetTop;\n\n return tabStartY < scrollTop;\n });\n\n firstOverflowingTab?.current?.scrollIntoView({ block: 'start', inline: 'nearest' });\n }, [disabled, scrollRef, refs]);\n\n const onNext = useCallback(() => {\n if (disabled || !scrollRef.current) {\n return;\n }\n\n const scrollBottom = Math.round(scrollRef.current.scrollTop + scrollRef.current.clientHeight);\n const lastOverflowingTab = refs.items.find((item: MutableRefObject<HTMLElement | null>) => {\n if (!item.current || item.current.offsetTop === undefined) {\n return;\n }\n const tabEndY = item.current.offsetTop + item.current.offsetHeight;\n\n return tabEndY > scrollBottom;\n });\n\n lastOverflowingTab?.current?.scrollIntoView({ block: 'end', inline: 'nearest' });\n }, [disabled, scrollRef, refs]);\n\n const PreviousButton = (\n <StyledArrow\n type=\"button\"\n aria-label=\"Предыдущий таб\"\n onClick={onPrev}\n tabIndex={disabled ? -1 : 0}\n disabled={disabled}\n ref={upArrowRef}\n >\n <IconDisclosureLeft color={`var(${tokens.arrowColor})`} />\n </StyledArrow>\n );\n\n const NextButton = (\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\n const handleScroll = useCallback(\n (event: React.UIEvent<HTMLElement>): void => {\n event.stopPropagation();\n const maxScrollTop = event.currentTarget.scrollHeight - event.currentTarget.clientHeight;\n const scrollTop = Math.round(event.currentTarget.scrollTop);\n\n setFirstItemVisible(scrollTop <= 0);\n setLastItemVisible(scrollTop >= maxScrollTop);\n },\n [setFirstItemVisible, setLastItemVisible],\n );\n\n const onKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n if (index === undefined) {\n return;\n }\n\n const minIndex = 0;\n const maxIndex = refs.items.length - 1;\n let nextIndex: number;\n\n switch (event.keyCode) {\n case Keys.end:\n nextIndex = maxIndex;\n break;\n case Keys.up:\n nextIndex = index > minIndex ? index - 1 : index;\n break;\n case Keys.down:\n nextIndex = index < maxIndex ? index + 1 : index;\n break;\n case Keys.home:\n nextIndex = minIndex;\n break;\n default:\n return;\n }\n\n if (nextIndex !== index) {\n event.preventDefault();\n refs.items[nextIndex].current?.focus();\n refs.items[nextIndex].current?.scrollIntoView({\n block: 'nearest',\n inline: 'nearest',\n behavior: 'smooth',\n });\n }\n },\n [index],\n );\n\n useEffect(() => {\n setLastItemVisible(scrollRef.current?.scrollHeight === scrollRef.current?.clientHeight);\n }, []);\n\n // Этот хук компенсирует появление верхней стрелки при прокрутке\n useEffect(() => {\n if (firstItemVisible || !scrollRef.current || !upArrowRef.current) {\n return;\n }\n\n scrollRef.current.scrollTo({\n top: Math.round(scrollRef.current.scrollTop + upArrowRef.current.clientHeight),\n });\n }, [firstItemVisible, scrollRef, upArrowRef]);\n\n return (\n <TabsContext.Provider value={refs}>\n <Root\n view={view}\n role=\"tablist\"\n size={size}\n id={tabsId}\n ref={outerRef}\n disabled={disabled}\n className={cx(hasTopArrowClass, hasBottomArrowClass, noDividerClass, className)}\n onKeyDown={onKeyDown}\n orientation={orientation}\n {...rest}\n >\n {!firstItemVisible && PreviousButton}\n <StyledContentWrapper\n className={cx(clipScrollClass, clipShowAllClass)}\n ref={scrollRef as MutableRefObject<HTMLDivElement | null>}\n onScroll={handleScroll}\n >\n <StyledContent ref={trackRef as MutableRefObject<HTMLDivElement | null>}>\n {children}\n </StyledContent>\n </StyledContentWrapper>\n {!lastItemVisible && NextButton}\n </Root>\n </TabsContext.Provider>\n );\n });\n\nexport const verticalTabsConfig = {\n name: 'VerticalTabs',\n tag: 'div',\n layout: verticalTabsRoot,\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 },\n defaults: {\n view: 'divider',\n size: 'xs',\n },\n};\n"],"names":["Keys","verticalTabsRoot","Root","forwardRef","props","outerRef","id","_props$disabled","disabled","_props$clip","clip","size","view","children","index","className","orientation","_props$hasDivider","hasDivider","rest","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","firstItemVisible","setFirstItemVisible","_useState3","_useState4","lastItemVisible","setLastItemVisible","refs","useMemo","TabItemRefs","uniqId","safeUseId","tabsId","noDividerClass","classes","tabsNoDivider","undefined","hasTopArrowClass","tabsHasTopArrow","hasBottomArrowClass","tabsHasBottomArrow","clipScrollClass","tabsClipScroll","clipShowAllClass","tabsClipShowAll","scrollRef","useRef","trackRef","upArrowRef","onPrev","useCallback","_firstOverflowingTab$","current","scrollTop","Math","round","firstOverflowingTab","items","slice","reverse","find","item","offsetTop","tabStartY","scrollIntoView","block","inline","onNext","_lastOverflowingTab$c","scrollBottom","clientHeight","lastOverflowingTab","tabEndY","offsetHeight","PreviousButton","React","createElement","StyledArrow","type","onClick","tabIndex","ref","IconDisclosureLeft","color","concat","tokens","arrowColor","NextButton","IconDisclosureRight","handleScroll","event","stopPropagation","maxScrollTop","currentTarget","scrollHeight","onKeyDown","minIndex","maxIndex","length","nextIndex","keyCode","end","up","down","home","_refs$items$nextIndex","_refs$items$nextIndex2","preventDefault","focus","behavior","useEffect","_scrollRef$current","_scrollRef$current2","scrollTo","top","TabsContext","Provider","value","_extends","role","cx","StyledContentWrapper","onScroll","StyledContent","verticalTabsConfig","name","tag","layout","base","variations","css","sizeCSS","viewCSS","disabledCSS","attrs","defaults"],"mappings":";;;;;;;;;;;;;;AAckE,I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KACR;AACD5H,IAAAA,IAAI,EAAE;AACF2H,MAAAA,GAAG,EAAEE,MAAAA;KACR;AACDjI,IAAAA,QAAQ,EAAE;AACN+H,MAAAA,GAAG,EAAEG,MAAW;AAChBC,MAAAA,KAAK,EAAE,IAAA;AACX,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNhI,IAAAA,IAAI,EAAE,SAAS;AACfD,IAAAA,IAAI,EAAE,IAAA;AACV,GAAA;AACJ;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"VerticalTabs.styles.js","sources":["../../../../../../src/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.ts"],"sourcesContent":["import { css } from '@linaria/core';\nimport { styled } from '@linaria/react';\n\nimport { addFocus } from '../../../../../mixins';\nimport { classes, tokens } from '../../../tokens';\n\nexport const base = css`\n position: relative;\n display: flex;\n flex-direction: column;\n gap: 0.125rem;\n align-items: center;\n`;\n\nexport const StyledContent = styled.div<{ hasDivider?: boolean }>`\n display: inline-flex;\n flex-direction: column;\n align-items: start;\n`;\n\nexport const StyledContentWrapper = styled.div`\n /* allows correctly display outline focus on tabs item */\n margin: -0.125rem;\n padding: 0.25rem;\n\n box-sizing: content-box;\n position: relative;\n height: 100%;\n width: 100%;\n display: flex;\n align-items: center;\n\n z-index: 1;\n\n &.${classes.tabsClipScroll} {\n overflow: scroll;\n scroll-padding: 0.25rem;\n overscroll-behavior: contain;\n\n scrollbar-width: none;\n ::-webkit-scrollbar {\n display: none;\n }\n\n ${StyledContent} {\n margin-top: auto;\n }\n }\n\n &.${classes.tabsClipShowAll} {\n overflow: visible;\n }\n`;\n\nexport const StyledArrow = styled.button`\n display: flex;\n cursor: pointer;\n border: none;\n background-color: transparent;\n padding: 0;\n outline: none;\n transform: rotate(90deg);\n\n ${addFocus({\n outlineSize: '0.063rem',\n outlineOffset: '-0.125rem',\n outlineColor: `var(${tokens.outlineFocusColor})`,\n outlineRadius: 'calc(var(--plasma_private-outline-radius) - 0.063rem)',\n })};\n\n &[disabled] {\n cursor: not-allowed;\n }\n
|
1
|
+
{"version":3,"file":"VerticalTabs.styles.js","sources":["../../../../../../src/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.ts"],"sourcesContent":["import { css } from '@linaria/core';\nimport { styled } from '@linaria/react';\n\nimport { addFocus } from '../../../../../mixins';\nimport { classes, tokens } from '../../../tokens';\n\nexport const base = css`\n position: relative;\n display: flex;\n flex-direction: column;\n gap: 0.125rem;\n align-items: center;\n`;\n\nexport const StyledContent = styled.div<{ hasDivider?: boolean }>`\n display: inline-flex;\n flex-direction: column;\n align-items: start;\n`;\n\nexport const StyledContentWrapper = styled.div`\n /* allows correctly display outline focus on tabs item */\n margin: -0.125rem;\n padding: 0.25rem;\n\n box-sizing: content-box;\n position: relative;\n height: 100%;\n width: 100%;\n display: flex;\n align-items: center;\n\n z-index: 1;\n\n &.${classes.tabsClipScroll} {\n overflow: scroll;\n scroll-padding: 0.25rem;\n overscroll-behavior: contain;\n\n scrollbar-width: none;\n ::-webkit-scrollbar {\n display: none;\n }\n\n ${StyledContent} {\n margin-top: auto;\n }\n }\n\n &.${classes.tabsClipShowAll} {\n overflow: visible;\n }\n`;\n\nexport const StyledArrow = styled.button`\n display: flex;\n cursor: pointer;\n border: none;\n background-color: transparent;\n padding: 0;\n outline: none;\n transform: rotate(90deg);\n\n ${addFocus({\n outlineSize: '0.063rem',\n outlineOffset: '-0.125rem',\n outlineColor: `var(${tokens.outlineFocusColor})`,\n outlineRadius: 'calc(var(--plasma_private-outline-radius) - 0.063rem)',\n })};\n\n &[disabled] {\n cursor: not-allowed;\n }\n`;\n"],"names":["base","StyledContent","styled","name","class","propsAsIs","StyledContentWrapper","StyledArrow"],"mappings":";;AAMO,IAAMA,IAAI,GAMhB,UAAA;AAEM,IAAMC,aAAa,gBAAGC,MAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,eAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAIlC,EAAA;AAEM,IAAMC,oBAAoB,gBAAGJ,MAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,sBAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAgCzC,EAAA;AAEM,IAAME,WAAW,gBAAGL,MAAM,CAAA,QAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,aAAA;AAAAC,EAAAA,OAAAA,EAAA,QAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAmBhC;;;;"}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
.b2r261u{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:0.125rem;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
|
2
2
|
.s1tfgc53{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:start;-webkit-box-align:start;-ms-flex-align:start;align-items:start;}
|
3
3
|
.s16g9t9z{margin:-0.125rem;padding:0.25rem;box-sizing:content-box;position:relative;height:100%;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;z-index:1;}.s16g9t9z.tabs-clip-scroll{overflow:scroll;-webkit-scroll-padding:0.25rem;-moz-scroll-padding:0.25rem;-ms-scroll-padding:0.25rem;scroll-padding:0.25rem;overscroll-behavior:contain;-webkit-scrollbar-width:none;-moz-scrollbar-width:none;-ms-scrollbar-width:none;scrollbar-width:none;}.s16g9t9z.tabs-clip-scroll::-webkit-scrollbar{display:none;}.s16g9t9z.tabs-clip-scroll .s1tfgc53{margin-top:auto;}.s16g9t9z.tabs-clip-show-all{overflow:visible;}
|
4
|
-
.s81cx4{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;cursor:pointer;border:none;background-color:transparent;padding:0;outline:none;-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);position:relative;
|
4
|
+
.s81cx4{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;cursor:pointer;border:none;background-color:transparent;padding:0;outline:none;-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);position:relative;}.s81cx4::before{content:'';position:absolute;top:-0.125rem;left:-0.125rem;right:-0.125rem;bottom:-0.125rem;z-index:1;display:block;box-sizing:content-box;border:0.063rem solid transparent;border-radius:calc(var(--plasma_private-outline-radius) - 0.063rem);-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.s81cx4.focus-visible:focus::before,.s81cx4[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.063rem var(--plasma-tabs-outline-focus-color);}.s81cx4[disabled]{cursor:not-allowed;}
|
package/es/index.css
CHANGED
@@ -229,7 +229,7 @@
|
|
229
229
|
|
230
230
|
.base_1sq08yf_bxoicu2__bb7a4868{width:var(--plasma-tabs-width);height:var(--plasma-tabs-height);--plasma_private-outline-radius:var(--plasma-tabs-border-radius);border-radius:var(--plasma-tabs-border-radius);}
|
231
231
|
|
232
|
-
.
|
232
|
+
.base_9miwn_bupjtit__d014f2e9{background-color:var(--plasma-tabs-background-color);}.base_9miwn_bupjtit__d014f2e9::after{content:'';position:absolute;bottom:0.125rem;left:0.125rem;right:0.125rem;background:var(--plasma-tabs-divider-color);height:var(--plasma-tabs-divider-height);border-radius:var(--plasma-tabs-divider-border-radius);}.base_9miwn_bupjtit__d014f2e9.base_9miwn_tabsHasLeftArrow__d014f2e9::after{left:1.5rem;}.base_9miwn_bupjtit__d014f2e9.base_9miwn_tabsHasRightArrow__d014f2e9::after{right:1.5rem;}
|
233
233
|
|
234
234
|
.base_j9bg3m_bbh58a1__de7491f9{opacity:var(--plasma-tabs-disabled-opacity);}
|
235
235
|
|
@@ -237,10 +237,10 @@
|
|
237
237
|
|
238
238
|
.base_1j9ii1x_b1eicxhd__666b97df.base_1j9ii1x_tabsStretched__666b97df{width:100%;}.base_1j9ii1x_b1eicxhd__666b97df.base_1j9ii1x_tabsStretched__666b97df .base_1j9ii1x_s158pfyo__666b97df,.base_1j9ii1x_b1eicxhd__666b97df.base_1j9ii1x_tabsStretched__666b97df .base_1j9ii1x_s191iwmt__666b97df,.base_1j9ii1x_b1eicxhd__666b97df.base_1j9ii1x_tabsStretched__666b97df .base_1j9ii1x_s191iwmt__666b97df > button{width:100%;margin-left:0;}
|
239
239
|
|
240
|
-
.
|
241
|
-
.
|
242
|
-
.
|
243
|
-
.
|
240
|
+
.HorizontalTabs_styles_16kuvxt_b7gl603__73e81f22{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:0.125rem;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative;}
|
241
|
+
.HorizontalTabs_styles_16kuvxt_s191iwmt__73e81f22{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
|
242
|
+
.HorizontalTabs_styles_16kuvxt_s158pfyo__73e81f22{margin:-0.125rem;padding:0.25rem;box-sizing:content-box;position:relative;height:100%;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;z-index:1;}.HorizontalTabs_styles_16kuvxt_s158pfyo__73e81f22.HorizontalTabs_styles_16kuvxt_tabsClipScroll__73e81f22{overflow:scroll;-webkit-scroll-padding:0.25rem;-moz-scroll-padding:0.25rem;-ms-scroll-padding:0.25rem;scroll-padding:0.25rem;overscroll-behavior:contain;-webkit-scrollbar-width:none;-moz-scrollbar-width:none;-ms-scrollbar-width:none;scrollbar-width:none;}.HorizontalTabs_styles_16kuvxt_s158pfyo__73e81f22.HorizontalTabs_styles_16kuvxt_tabsClipScroll__73e81f22::-webkit-scrollbar{display:none;}.HorizontalTabs_styles_16kuvxt_s158pfyo__73e81f22.HorizontalTabs_styles_16kuvxt_tabsClipShowAll__73e81f22{overflow:visible;}
|
243
|
+
.HorizontalTabs_styles_16kuvxt_s1in38wj__73e81f22{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;cursor:pointer;border:none;background-color:transparent;padding:0;outline:none;position:relative;--plasma_private-outer-padding:var(--s1in38wj-0);padding-right:var(--s1in38wj-1);padding-left:var(--s1in38wj-2);}.HorizontalTabs_styles_16kuvxt_s1in38wj__73e81f22::before{content:'';position:absolute;top:-0.125rem;left:-0.125rem;right:-0.125rem;bottom:-0.125rem;z-index:1;display:block;box-sizing:content-box;border:0.063rem solid transparent;border-radius:calc(var(--plasma_private-outline-radius) - 0.063rem);-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.HorizontalTabs_styles_16kuvxt_s1in38wj__73e81f22.HorizontalTabs_styles_16kuvxt_focusVisible__73e81f22:focus::before,.HorizontalTabs_styles_16kuvxt_s1in38wj__73e81f22[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.063rem var(--plasma-tabs-outline-focus-color);}.HorizontalTabs_styles_16kuvxt_s1in38wj__73e81f22[disabled]{cursor:not-allowed;}
|
244
244
|
|
245
245
|
.base_4zingj_b1vyjqk2__b8b7d053{color:var(--plasma-tab-item-color);background-color:var(--plasma-tab-item-background-color);margin-left:var(--plasma-tab-item-margin-left-filled,var(--plasma-tab-item-margin-left));}.base_4zingj_b1vyjqk2__b8b7d053:hover{color:var(--plasma-tab-item-color-hover);background-color:var(--plasma-tab-item-background-color-hover);}.base_4zingj_b1vyjqk2__b8b7d053:hover .base_4zingj_t1nh4m12__b8b7d053{color:var(--plasma-tab-item-value-color-hover);}.base_4zingj_b1vyjqk2__b8b7d053:active{color:var(--plasma-tab-item-color-active);}.base_4zingj_b1vyjqk2__b8b7d053:active .base_4zingj_t1nh4m12__b8b7d053{color:var(--plasma-tab-item-value-color-active);}.base_4zingj_b1vyjqk2__b8b7d053.base_4zingj_tabItemAnimated__b8b7d053{-webkit-transition:var(--plasma-tab-item-background-transition);transition:var(--plasma-tab-item-background-transition);}.base_4zingj_b1vyjqk2__b8b7d053.base_4zingj_selectedTabsItem__b8b7d053{color:var(--plasma-tab-item-selected-color);background-color:var(--plasma-tab-item-selected-background-color);}.base_4zingj_b1vyjqk2__b8b7d053.base_4zingj_selectedTabsItem__b8b7d053:hover{color:var(--plasma-tab-item-selected-color-hover);background-color:var(--plasma-tab-item-selected-background-color-hover);}.base_4zingj_b1vyjqk2__b8b7d053.base_4zingj_selectedTabsItem__b8b7d053:hover::after{background:var(--plasma-tab-item-selected-hover-divider-color);}.base_4zingj_b1vyjqk2__b8b7d053.base_4zingj_selectedTabsItem__b8b7d053 .base_4zingj_t1nh4m12__b8b7d053{color:var(--plasma-tab-item-selected-value-color-hover);}.base_4zingj_b1vyjqk2__b8b7d053.base_4zingj_selectedTabsItem__b8b7d053 .base_4zingj_t1nh4m12__b8b7d053:hover{color:var(--plasma-tab-item-selected-value-color-hover);}.base_4zingj_b1vyjqk2__b8b7d053.base_4zingj_selectedTabsItem__b8b7d053::after{content:'';position:absolute;bottom:0;left:0;right:0;background:var(--plasma-tab-item-selected-divider-color);height:var(--plasma-tab-item-selected-divider-height);border-radius:0.063rem;}
|
246
246
|
|
@@ -256,10 +256,10 @@
|
|
256
256
|
.HorizontalTabItem_styles_hfqv5b_r13nweg3__5835ec0b{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;color:inherit;}.HorizontalTabItem_styles_hfqv5b_r13nweg3__5835ec0b:hover{color:inherit;}
|
257
257
|
.HorizontalTabItem_styles_hfqv5b_l1iip2sx__5835ec0b{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;color:inherit;}.HorizontalTabItem_styles_hfqv5b_l1iip2sx__5835ec0b:hover{color:inherit;}
|
258
258
|
|
259
|
-
.
|
260
|
-
.
|
261
|
-
.
|
262
|
-
.
|
259
|
+
.VerticalTabs_styles_1fr5ovg_b2r261u__3eaab5a9{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:0.125rem;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
|
260
|
+
.VerticalTabs_styles_1fr5ovg_s1tfgc53__3eaab5a9{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:start;-webkit-box-align:start;-ms-flex-align:start;align-items:start;}
|
261
|
+
.VerticalTabs_styles_1fr5ovg_s16g9t9z__3eaab5a9{margin:-0.125rem;padding:0.25rem;box-sizing:content-box;position:relative;height:100%;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;z-index:1;}.VerticalTabs_styles_1fr5ovg_s16g9t9z__3eaab5a9.VerticalTabs_styles_1fr5ovg_tabsClipScroll__3eaab5a9{overflow:scroll;-webkit-scroll-padding:0.25rem;-moz-scroll-padding:0.25rem;-ms-scroll-padding:0.25rem;scroll-padding:0.25rem;overscroll-behavior:contain;-webkit-scrollbar-width:none;-moz-scrollbar-width:none;-ms-scrollbar-width:none;scrollbar-width:none;}.VerticalTabs_styles_1fr5ovg_s16g9t9z__3eaab5a9.VerticalTabs_styles_1fr5ovg_tabsClipScroll__3eaab5a9::-webkit-scrollbar{display:none;}.VerticalTabs_styles_1fr5ovg_s16g9t9z__3eaab5a9.VerticalTabs_styles_1fr5ovg_tabsClipScroll__3eaab5a9 .VerticalTabs_styles_1fr5ovg_s1tfgc53__3eaab5a9{margin-top:auto;}.VerticalTabs_styles_1fr5ovg_s16g9t9z__3eaab5a9.VerticalTabs_styles_1fr5ovg_tabsClipShowAll__3eaab5a9{overflow:visible;}
|
262
|
+
.VerticalTabs_styles_1fr5ovg_s81cx4__3eaab5a9{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;cursor:pointer;border:none;background-color:transparent;padding:0;outline:none;-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);position:relative;}.VerticalTabs_styles_1fr5ovg_s81cx4__3eaab5a9::before{content:'';position:absolute;top:-0.125rem;left:-0.125rem;right:-0.125rem;bottom:-0.125rem;z-index:1;display:block;box-sizing:content-box;border:0.063rem solid transparent;border-radius:calc(var(--plasma_private-outline-radius) - 0.063rem);-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.VerticalTabs_styles_1fr5ovg_s81cx4__3eaab5a9.VerticalTabs_styles_1fr5ovg_focusVisible__3eaab5a9:focus::before,.VerticalTabs_styles_1fr5ovg_s81cx4__3eaab5a9[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.063rem var(--plasma-tabs-outline-focus-color);}.VerticalTabs_styles_1fr5ovg_s81cx4__3eaab5a9[disabled]{cursor:not-allowed;}
|
263
263
|
|
264
264
|
.base_1sekozo_b1t51iwr__491bf88c{width:var(--plasma-tabs-width);height:var(--plasma-tabs-height);--plasma_private-outline-radius:var(--plasma-tabs-border-radius);border-radius:var(--plasma-tabs-border-radius);}
|
265
265
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salutejs/plasma-new-hope",
|
3
|
-
"version": "0.173.4-canary.
|
3
|
+
"version": "0.173.4-canary.1508.11518994013.0",
|
4
4
|
"description": "Salute Design System blueprint",
|
5
5
|
"main": "cjs/index.js",
|
6
6
|
"module": "es/index.js",
|
@@ -127,5 +127,5 @@
|
|
127
127
|
"sideEffects": [
|
128
128
|
"*.css"
|
129
129
|
],
|
130
|
-
"gitHead": "
|
130
|
+
"gitHead": "9b1312a29889222d50b9f7e3e13245b06bfe3221"
|
131
131
|
}
|
@@ -13,13 +13,14 @@ var _Overlay = /*#__PURE__*/require("../Overlay");
|
|
13
13
|
var _utils = /*#__PURE__*/require("../Popup/utils");
|
14
14
|
var _Panel = /*#__PURE__*/require("../Panel");
|
15
15
|
var _utils2 = /*#__PURE__*/require("../../utils");
|
16
|
+
var _hooks = /*#__PURE__*/require("../../hooks");
|
16
17
|
var _Drawer = /*#__PURE__*/require("./Drawer.tokens");
|
17
18
|
var _base = /*#__PURE__*/require("./variations/_view/base");
|
18
19
|
var _base2 = /*#__PURE__*/require("./variations/_size/base");
|
19
20
|
var _base3 = /*#__PURE__*/require("./variations/_borderRadius/base");
|
20
21
|
var _Drawer2 = /*#__PURE__*/require("./Drawer.styles");
|
21
22
|
var _DrawerContext = /*#__PURE__*/require("./DrawerContext");
|
22
|
-
var
|
23
|
+
var _hooks2 = /*#__PURE__*/require("./hooks");
|
23
24
|
var _excluded = ["id", "zIndex", "popupInfo", "withBlur", "children", "view", "size", "width", "height", "isOpen", "opened", "initialFocusRef", "focusAfterRef", "className", "onClose", "onOverlayClick", "onEscKeyDown", "offset", "frame", "borderRadius", "placement", "closeOnEsc", "closeOnOverlayClick", "asModal"];
|
24
25
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
25
26
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
@@ -62,7 +63,7 @@ var drawerRoot = exports.drawerRoot = function drawerRoot(Root) {
|
|
62
63
|
asModal = _ref$asModal === void 0 ? true : _ref$asModal,
|
63
64
|
rest = _objectWithoutProperties(_ref, _excluded);
|
64
65
|
var innerIsOpen = Boolean(isOpen || opened);
|
65
|
-
var trapRef = (0,
|
66
|
+
var trapRef = (0, _hooks.useFocusTrap)(true, initialFocusRef, focusAfterRef);
|
66
67
|
var popupController = (0, _Popup.usePopupContext)();
|
67
68
|
var innerRef = (0, _plasmaCore.useForkRef)(trapRef, outerRef);
|
68
69
|
var uniqId = (0, _plasmaCore.safeUseId)();
|
@@ -71,7 +72,7 @@ var drawerRoot = exports.drawerRoot = function drawerRoot(Root) {
|
|
71
72
|
var innerWidth = width ? (0, _utils2.getSizeValueFromProp)(width) : '100%';
|
72
73
|
var innerHeight = height ? (0, _utils2.getSizeValueFromProp)(height) : '100%';
|
73
74
|
var placementClass = placement ? _Drawer.classes["".concat(placement, "Placement")] : undefined;
|
74
|
-
var _useDrawer = (0,
|
75
|
+
var _useDrawer = (0, _hooks2.useDrawer)({
|
75
76
|
id: innerId,
|
76
77
|
isOpen: innerIsOpen,
|
77
78
|
closeOnEsc: closeOnEsc,
|
@@ -39,8 +39,6 @@ var tokens = exports.tokens = {
|
|
39
39
|
itemSelectedDividerColorHover: '--plasma-tab-item-selected-hover-divider-color',
|
40
40
|
outlineFocusColor: '--plasma-tabs-outline-focus-color',
|
41
41
|
arrowColor: '--plasma-tabs-arrow-color',
|
42
|
-
arrowColorHover: '--plasma-tabs-arrow-color-hover',
|
43
|
-
arrowColorActive: '--plasma-tabs-arrow-color-active',
|
44
42
|
tabsFilledBackgroundColor: '--plasma-tabs-filled-background-color',
|
45
43
|
tabsBackgroundColor: '--plasma-tabs-background-color',
|
46
44
|
tabsBorderRadius: '--plasma-tabs-border-radius',
|
package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js
CHANGED
@@ -101,9 +101,7 @@ var horizontalTabItemRoot = exports.horizontalTabItemRoot = function horizontalT
|
|
101
101
|
disabled: disabled,
|
102
102
|
pilled: pilled,
|
103
103
|
role: role,
|
104
|
-
view: view
|
105
|
-
// TODO: убрать каст any, когда будут удалены deprecated props
|
106
|
-
,
|
104
|
+
view: view,
|
107
105
|
size: size,
|
108
106
|
onFocus: onItemFocus,
|
109
107
|
tabIndex: hasKeyNavigation ? navigationTabIndex : tabIndex,
|