@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
@@ -13,6 +13,7 @@ var base$1 = require('./variations/_size/base.js');
|
|
13
13
|
var base$2 = require('./variations/_borderRadius/base.js');
|
14
14
|
var Drawer_styles = require('./Drawer.styles.js');
|
15
15
|
var DrawerContext = require('./DrawerContext.js');
|
16
|
+
var useFocusTrap = require('../../hooks/useFocusTrap.js');
|
16
17
|
var PopupContext = require('../Popup/PopupContext.js');
|
17
18
|
var useDrawer = require('./hooks/useDrawer.js');
|
18
19
|
var Overlay = require('../Overlay/Overlay.js');
|
@@ -58,7 +59,7 @@ var drawerRoot = function drawerRoot(Root) {
|
|
58
59
|
asModal = _ref$asModal === void 0 ? true : _ref$asModal,
|
59
60
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
60
61
|
var innerIsOpen = Boolean(isOpen || opened);
|
61
|
-
var trapRef =
|
62
|
+
var trapRef = useFocusTrap.useFocusTrap(true, initialFocusRef, focusAfterRef);
|
62
63
|
var popupController = PopupContext.usePopupContext();
|
63
64
|
var innerRef = plasmaCore.useForkRef(trapRef, outerRef);
|
64
65
|
var uniqId = plasmaCore.safeUseId();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Drawer.js","sources":["../../../src/components/Drawer/Drawer.tsx"],"sourcesContent":["import React, { forwardRef, useMemo } from 'react';\nimport { useFocusTrap, useForkRef, safeUseId } from '@salutejs/plasma-core';\n\nimport { component, mergeConfig } from '../../engines';\nimport type { RootProps } from '../../engines';\nimport { usePopupContext } from '../Popup';\nimport { Overlay } from '../Overlay';\nimport { DEFAULT_Z_INDEX } from '../Popup/utils';\nimport { panelConfig } from '../Panel';\nimport { cx, getSizeValueFromProp } from '../../utils';\n\nimport { classes, tokens } from './Drawer.tokens';\nimport type { DrawerProps } from './Drawer.types';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as borderRadiusCSS } from './variations/_borderRadius/base';\nimport { StyledPopup } from './Drawer.styles';\nimport { getIdLastDrawer } from './DrawerContext';\nimport { useDrawer } from './hooks';\n\n// issue #823\nconst mergedPanelConfig = mergeConfig(panelConfig);\nconst Panel = component(mergedPanelConfig);\n\nexport const drawerRoot = (Root: RootProps<HTMLDivElement, DrawerProps>) =>\n forwardRef<HTMLDivElement, DrawerProps>(\n (\n {\n id,\n zIndex,\n popupInfo,\n withBlur,\n children,\n view,\n size,\n width,\n height,\n isOpen,\n opened,\n initialFocusRef,\n focusAfterRef,\n className,\n onClose,\n onOverlayClick,\n onEscKeyDown,\n offset,\n frame,\n borderRadius = 'none',\n placement = 'right',\n closeOnEsc = true,\n closeOnOverlayClick = true,\n asModal = true,\n ...rest\n },\n outerRef,\n ) => {\n const innerIsOpen = Boolean(isOpen || opened);\n\n const trapRef = useFocusTrap(true, initialFocusRef, focusAfterRef);\n const popupController = usePopupContext();\n\n const innerRef = useForkRef<HTMLDivElement>(trapRef, outerRef);\n\n const uniqId = safeUseId();\n const innerId = id || uniqId;\n const overlayBackgroundToken = withBlur\n ? `var(${tokens.drawerOverlayWithBlurColor})`\n : `var(${tokens.drawerOverlayColor})`;\n const innerWidth = width ? getSizeValueFromProp(width) : '100%';\n const innerHeight = height ? getSizeValueFromProp(height) : '100%';\n\n const placementClass = placement ? classes[`${placement}Placement` as keyof typeof classes] : undefined;\n\n const { drawerInfo } = useDrawer({\n id: innerId,\n isOpen: innerIsOpen,\n closeOnEsc,\n onEscKeyDown,\n onClose,\n popupInfo,\n disableScroll: asModal,\n });\n const transparent = useMemo(() => getIdLastDrawer(popupController.items) !== innerId, [\n innerId,\n popupController.items,\n ]);\n\n const onDrawerOverlayKeyDown = (event: React.MouseEvent<HTMLDivElement>) => {\n if (onOverlayClick) {\n onOverlayClick(event);\n return;\n }\n\n if (onClose) {\n onClose();\n }\n };\n\n return (\n <StyledPopup\n id={innerId}\n ref={asModal ? innerRef : outerRef}\n className={cx(placementClass)}\n opened={innerIsOpen}\n zIndex={zIndex}\n placement={placement}\n popupInfo={drawerInfo}\n frame={frame}\n width={innerWidth}\n height={innerHeight}\n offset={offset}\n withAnimation\n overlay={\n asModal && (\n <Root view={view}>\n <Overlay\n className={classes.overlay}\n zIndex={zIndex || DEFAULT_Z_INDEX}\n backgroundColorProperty={overlayBackgroundToken}\n withBlur={withBlur}\n transparent={transparent}\n isClickable={closeOnOverlayClick}\n onOverlayClick={onDrawerOverlayKeyDown}\n />\n </Root>\n )\n }\n {...rest}\n >\n <Root\n view={view}\n size={size}\n style={{ width: innerWidth, height: innerHeight }}\n borderRadius={borderRadius}\n >\n <Panel width={innerWidth} height={innerHeight} className={className}>\n {children}\n </Panel>\n </Root>\n </StyledPopup>\n );\n },\n );\n\nexport const drawerConfig = {\n name: 'Drawer',\n tag: 'div',\n layout: drawerRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n borderRadius: {\n css: borderRadiusCSS,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n borderRadius: 'none',\n },\n};\n"],"names":["mergedPanelConfig","mergeConfig","panelConfig","Panel","component","drawerRoot","Root","forwardRef","_ref","outerRef","id","zIndex","popupInfo","withBlur","children","view","size","width","height","isOpen","opened","initialFocusRef","focusAfterRef","className","onClose","onOverlayClick","onEscKeyDown","offset","frame","_ref$borderRadius","borderRadius","_ref$placement","placement","_ref$closeOnEsc","closeOnEsc","_ref$closeOnOverlayCl","closeOnOverlayClick","_ref$asModal","asModal","rest","_objectWithoutProperties","_excluded","innerIsOpen","Boolean","trapRef","useFocusTrap","popupController","usePopupContext","innerRef","useForkRef","uniqId","safeUseId","innerId","overlayBackgroundToken","concat","tokens","drawerOverlayWithBlurColor","drawerOverlayColor","innerWidth","getSizeValueFromProp","innerHeight","placementClass","classes","undefined","_useDrawer","useDrawer","disableScroll","drawerInfo","transparent","useMemo","getIdLastDrawer","items","onDrawerOverlayKeyDown","event","React","createElement","StyledPopup","_extends","ref","cx","withAnimation","overlay","Overlay","DEFAULT_Z_INDEX","backgroundColorProperty","isClickable","style","drawerConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","borderRadiusCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAoBA;AACA,IAAMA,iBAAiB,gBAAGC,kBAAW,CAACC,mBAAW,CAAC,CAAA;AAClD,IAAMC,KAAK,gBAAGC,gBAAS,CAACJ,iBAAiB,CAAC,CAAA;IAE7BK,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAA4C,EAAA;AAAA,EAAA,oBACnEC,gBAAU,CACN,UAAAC,IAAA,EA4BIC,QAAQ,EACP;AAAA,IAAA,IA3BGC,EAAE,GAAAF,IAAA,CAAFE,EAAE;MACFC,MAAM,GAAAH,IAAA,CAANG,MAAM;MACNC,SAAS,GAAAJ,IAAA,CAATI,SAAS;MACTC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;MACRC,QAAQ,GAAAN,IAAA,CAARM,QAAQ;MACRC,IAAI,GAAAP,IAAA,CAAJO,IAAI;MACJC,IAAI,GAAAR,IAAA,CAAJQ,IAAI;MACJC,KAAK,GAAAT,IAAA,CAALS,KAAK;MACLC,MAAM,GAAAV,IAAA,CAANU,MAAM;MACNC,MAAM,GAAAX,IAAA,CAANW,MAAM;MACNC,MAAM,GAAAZ,IAAA,CAANY,MAAM;MACNC,eAAe,GAAAb,IAAA,CAAfa,eAAe;MACfC,aAAa,GAAAd,IAAA,CAAbc,aAAa;MACbC,SAAS,GAAAf,IAAA,CAATe,SAAS;MACTC,OAAO,GAAAhB,IAAA,CAAPgB,OAAO;MACPC,cAAc,GAAAjB,IAAA,CAAdiB,cAAc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AK,EAAEyC,UAAU;AAAExC,QAAAA,MAAM,EAAE0C,WAAAA;OAAc;AAClD9B,MAAAA,YAAY,EAAEA,YAAAA;AAAa,KAAA,eAE3B4C,KAAA,CAAAC,aAAA,CAACxE,KAAK,EAAA;AAACc,MAAAA,KAAK,EAAEyC,UAAW;AAACxC,MAAAA,MAAM,EAAE0C,WAAY;AAACrC,MAAAA,SAAS,EAAEA,SAAAA;KACrDT,EAAAA,QACE,CACL,CACG,CAAC,CAAA;AAEtB,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAMyE,YAAY,GAAG;AACxBC,EAAAA,IAAI,EAAE,QAAQ;AACdC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAErF,UAAU;AAClBsF,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,UAAU,EAAE;AACR7E,IAAAA,IAAI,EAAE;AACF8E,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACD9E,IAAAA,IAAI,EAAE;AACF6E,MAAAA,GAAG,EAAEE,WAAAA;KACR;AACDjE,IAAAA,YAAY,EAAE;AACV+D,MAAAA,GAAG,EAAEG,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNlF,IAAAA,IAAI,EAAE,SAAS;AACfC,IAAAA,IAAI,EAAE,GAAG;AACTc,IAAAA,YAAY,EAAE,MAAA;AAClB,GAAA;AACJ;;;;;"}
|
1
|
+
{"version":3,"file":"Drawer.js","sources":["../../../src/components/Drawer/Drawer.tsx"],"sourcesContent":["import React, { forwardRef, useMemo } from 'react';\nimport { useForkRef, safeUseId } from '@salutejs/plasma-core';\n\nimport { component, mergeConfig } from '../../engines';\nimport type { RootProps } from '../../engines';\nimport { usePopupContext } from '../Popup';\nimport { Overlay } from '../Overlay';\nimport { DEFAULT_Z_INDEX } from '../Popup/utils';\nimport { panelConfig } from '../Panel';\nimport { cx, getSizeValueFromProp } from '../../utils';\nimport { useFocusTrap } from '../../hooks';\n\nimport { classes, tokens } from './Drawer.tokens';\nimport type { DrawerProps } from './Drawer.types';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as borderRadiusCSS } from './variations/_borderRadius/base';\nimport { StyledPopup } from './Drawer.styles';\nimport { getIdLastDrawer } from './DrawerContext';\nimport { useDrawer } from './hooks';\n\n// issue #823\nconst mergedPanelConfig = mergeConfig(panelConfig);\nconst Panel = component(mergedPanelConfig);\n\nexport const drawerRoot = (Root: RootProps<HTMLDivElement, DrawerProps>) =>\n forwardRef<HTMLDivElement, DrawerProps>(\n (\n {\n id,\n zIndex,\n popupInfo,\n withBlur,\n children,\n view,\n size,\n width,\n height,\n isOpen,\n opened,\n initialFocusRef,\n focusAfterRef,\n className,\n onClose,\n onOverlayClick,\n onEscKeyDown,\n offset,\n frame,\n borderRadius = 'none',\n placement = 'right',\n closeOnEsc = true,\n closeOnOverlayClick = true,\n asModal = true,\n ...rest\n },\n outerRef,\n ) => {\n const innerIsOpen = Boolean(isOpen || opened);\n\n const trapRef = useFocusTrap(true, initialFocusRef, focusAfterRef);\n const popupController = usePopupContext();\n\n const innerRef = useForkRef<HTMLDivElement>(trapRef, outerRef);\n\n const uniqId = safeUseId();\n const innerId = id || uniqId;\n const overlayBackgroundToken = withBlur\n ? `var(${tokens.drawerOverlayWithBlurColor})`\n : `var(${tokens.drawerOverlayColor})`;\n const innerWidth = width ? getSizeValueFromProp(width) : '100%';\n const innerHeight = height ? getSizeValueFromProp(height) : '100%';\n\n const placementClass = placement ? classes[`${placement}Placement` as keyof typeof classes] : undefined;\n\n const { drawerInfo } = useDrawer({\n id: innerId,\n isOpen: innerIsOpen,\n closeOnEsc,\n onEscKeyDown,\n onClose,\n popupInfo,\n disableScroll: asModal,\n });\n const transparent = useMemo(() => getIdLastDrawer(popupController.items) !== innerId, [\n innerId,\n popupController.items,\n ]);\n\n const onDrawerOverlayKeyDown = (event: React.MouseEvent<HTMLDivElement>) => {\n if (onOverlayClick) {\n onOverlayClick(event);\n return;\n }\n\n if (onClose) {\n onClose();\n }\n };\n\n return (\n <StyledPopup\n id={innerId}\n ref={asModal ? innerRef : outerRef}\n className={cx(placementClass)}\n opened={innerIsOpen}\n zIndex={zIndex}\n placement={placement}\n popupInfo={drawerInfo}\n frame={frame}\n width={innerWidth}\n height={innerHeight}\n offset={offset}\n withAnimation\n overlay={\n asModal && (\n <Root view={view}>\n <Overlay\n className={classes.overlay}\n zIndex={zIndex || DEFAULT_Z_INDEX}\n backgroundColorProperty={overlayBackgroundToken}\n withBlur={withBlur}\n transparent={transparent}\n isClickable={closeOnOverlayClick}\n onOverlayClick={onDrawerOverlayKeyDown}\n />\n </Root>\n )\n }\n {...rest}\n >\n <Root\n view={view}\n size={size}\n style={{ width: innerWidth, height: innerHeight }}\n borderRadius={borderRadius}\n >\n <Panel width={innerWidth} height={innerHeight} className={className}>\n {children}\n </Panel>\n </Root>\n </StyledPopup>\n );\n },\n );\n\nexport const drawerConfig = {\n name: 'Drawer',\n tag: 'div',\n layout: drawerRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n borderRadius: {\n css: borderRadiusCSS,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n borderRadius: 'none',\n },\n};\n"],"names":["mergedPanelConfig","mergeConfig","panelConfig","Panel","component","drawerRoot","Root","forwardRef","_ref","outerRef","id","zIndex","popupInfo","withBlur","children","view","size","width","height","isOpen","opened","initialFocusRef","focusAfterRef","className","onClose","onOverlayClick","onEscKeyDown","offset","frame","_ref$borderRadius","borderRadius","_ref$placement","placement","_ref$closeOnEsc","closeOnEsc","_ref$closeOnOverlayCl","closeOnOverlayClick","_ref$asModal","asModal","rest","_objectWithoutProperties","_excluded","innerIsOpen","Boolean","trapRef","useFocusTrap","popupController","usePopupContext","innerRef","useForkRef","uniqId","safeUseId","innerId","overlayBackgroundToken","concat","tokens","drawerOverlayWithBlurColor","drawerOverlayColor","innerWidth","getSizeValueFromProp","innerHeight","placementClass","classes","undefined","_useDrawer","useDrawer","disableScroll","drawerInfo","transparent","useMemo","getIdLastDrawer","items","onDrawerOverlayKeyDown","event","React","createElement","StyledPopup","_extends","ref","cx","withAnimation","overlay","Overlay","DEFAULT_Z_INDEX","backgroundColorProperty","isClickable","style","drawerConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","borderRadiusCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAqBA;AACA,IAAMA,iBAAiB,gBAAGC,kBAAW,CAACC,mBAAW,CAAC,CAAA;AAClD,IAAMC,KAAK,gBAAGC,gBAAS,CAACJ,iBAAiB,CAAC,CAAA;IAE7BK,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAA4C,EAAA;AAAA,EAAA,oBACnEC,gBAAU,CACN,UAAAC,IAAA,EA4BIC,QAAQ,EACP;AAAA,IAAA,IA3BGC,EAAE,GAAAF,IAAA,CAAFE,EAAE;MACFC,MAAM,GAAAH,IAAA,CAANG,MAAM;MACNC,SAAS,GAAAJ,IAAA,CAATI,SAAS;MACTC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;MACRC,QAAQ,GAAAN,IAAA,CAARM,QAAQ;MACRC,IAAI,GAAAP,IAAA,CAAJO,IAAI;MACJC,IAAI,GAAAR,IAAA,CAAJQ,IAAI;MACJC,KAAK,GAAAT,IAAA,CAALS,KAAK;MACLC,MAAM,GAAAV,IAAA,CAANU,MAAM;MACNC,MAAM,GAAAX,IAAA,CAANW,MAAM;MACNC,MAAM,GAAAZ,IAAA,CAANY,MAAM;MACNC,eAAe,GAAAb,IAAA,CAAfa,eAAe;MACfC,aAAa,GAAAd,IAAA,CAAbc,aAAa;MACbC,SAAS,GAAAf,IAAA,CAATe,SAAS;MACTC,OAAO,GAAAhB,IAAA,CAAPgB,OAAO;MACPC,cAAc,GAAAjB,IAAA,CAAdiB,cAAc;MACdC,YAAY,GAAAlB,IAAA,CAAZkB,YAAY;MACZC,MAAM,GAAAnB,IAAA,CA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AAA,YAAY,EAAEA,YAAAA;AAAa,KAAA,eAE3B4C,KAAA,CAAAC,aAAA,CAACxE,KAAK,EAAA;AAACc,MAAAA,KAAK,EAAEyC,UAAW;AAACxC,MAAAA,MAAM,EAAE0C,WAAY;AAACrC,MAAAA,SAAS,EAAEA,SAAAA;KACrDT,EAAAA,QACE,CACL,CACG,CAAC,CAAA;AAEtB,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAMyE,YAAY,GAAG;AACxBC,EAAAA,IAAI,EAAE,QAAQ;AACdC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAErF,UAAU;AAClBsF,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,UAAU,EAAE;AACR7E,IAAAA,IAAI,EAAE;AACF8E,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACD9E,IAAAA,IAAI,EAAE;AACF6E,MAAAA,GAAG,EAAEE,WAAAA;KACR;AACDjE,IAAAA,YAAY,EAAE;AACV+D,MAAAA,GAAG,EAAEG,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNlF,IAAAA,IAAI,EAAE,SAAS;AACfC,IAAAA,IAAI,EAAE,GAAG;AACTc,IAAAA,YAAY,EAAE,MAAA;AAClB,GAAA;AACJ;;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createTabsController.js","sources":["../../../src/components/Tabs/createTabsController.tsx"],"sourcesContent":["import React, { forwardRef, ForwardRefExoticComponent, RefAttributes } from 'react';\n\nimport { HorizontalTabItemProps } from './TabItem.types';\nimport {
|
1
|
+
{"version":3,"file":"createTabsController.js","sources":["../../../src/components/Tabs/createTabsController.tsx"],"sourcesContent":["import React, { forwardRef, ForwardRefExoticComponent, RefAttributes } from 'react';\n\nimport { HorizontalTabItemProps } from './TabItem.types';\nimport { HorizontalTabsProps } from './Tabs.types';\n\nexport interface TabsControllerProps extends HorizontalTabsProps {\n items: Array<{ label: string } & HorizontalTabItemProps>;\n index: number;\n onIndexChange: (index: number) => void;\n children?: never;\n autoscroll?: boolean;\n}\n\n/**\n * @deprecated\n * Используйте Tabs, TabItem, указав параметры index, itemIndex, onIndexChange\n *\n * Функция для создания `TabController`, которая дает возможность\n * кастомизировать стили, при этом сохраняя единый интерфейс и функционал.\n */\nexport function createTabsController<T extends HTMLDivElement, P extends TabsControllerProps>(\n ListComponent: ForwardRefExoticComponent<HorizontalTabsProps & RefAttributes<HTMLDivElement>>,\n ItemComponent: ForwardRefExoticComponent<HorizontalTabItemProps & RefAttributes<HTMLDivElement>>,\n) {\n // eslint-disable-next-line prefer-arrow-callback\n return forwardRef<T, P>(function TabsController({ items, index, autoscroll, onIndexChange, ...rest }, ref) {\n const { disabled } = rest;\n\n return (\n <ListComponent ref={ref} index={index} {...rest}>\n {items.map(({ label, ...restItem }, i) => (\n <ItemComponent\n key={i}\n selected={i === index}\n itemIndex={i}\n onIndexChange={onIndexChange}\n tabIndex={!disabled && i === index ? 0 : -1}\n disabled={disabled}\n {...restItem}\n >\n {label}\n </ItemComponent>\n ))}\n </ListComponent>\n );\n });\n}\n"],"names":["createTabsController","ListComponent","ItemComponent","forwardRef","TabsController","_ref","ref","items","index","onIndexChange","rest","_objectWithoutProperties","_excluded","disabled","React","createElement","_extends","map","_ref2","i","label","restItem","_excluded2","key","selected","itemIndex","tabIndex"],"mappings":";;;;;;;;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,oBAAoBA,CAChCC,aAA6F,EAC7FC,aAAgG,EAClG;AACE;EACA,oBAAOC,gBAAU,CAAO,SAASC,cAAcA,CAAAC,IAAA,EAAuDC,GAAG,EAAE;AAAA,IAAA,IAAzDC,KAAK,GAAAF,IAAA,CAALE,KAAK,CAAA;MAAEC,KAAK,GAAAH,IAAA,CAALG,KAAK,CAAA;MAAcC,aAAa,GAAAJ,IAAA,CAAbI,aAAa,CAAA;AAAKC,MAAAA,IAAI,GAAAC,iDAAA,CAAAN,IAAA,EAAAO,SAAA,EAAA;AAC9F,IAAA,IAAQC,QAAQ,GAAKH,IAAI,CAAjBG,QAAQ,CAAA;AAEhB,IAAA,oBACIC,KAAA,CAAAC,aAAA,CAACd,aAAa,EAAAe,iCAAA,CAAA;AAACV,MAAAA,GAAG,EAAEA,GAAI;AAACE,MAAAA,KAAK,EAAEA,KAAAA;KAAWE,EAAAA,IAAI,GAC1CH,KAAK,CAACU,GAAG,CAAC,UAAAC,KAAA,EAAyBC,CAAC,EAAA;AAAA,MAAA,IAAvBC,KAAK,GAAAF,KAAA,CAALE,KAAK;AAAKC,QAAAA,QAAQ,GAAAV,iDAAA,CAAAO,KAAA,EAAAI,UAAA,CAAA,CAAA;AAAA,MAAA,oBAC5BR,KAAA,CAAAC,aAAA,CAACb,aAAa,EAAAc,iCAAA,CAAA;AACVO,QAAAA,GAAG,EAAEJ,CAAE;QACPK,QAAQ,EAAEL,CAAC,KAAKX,KAAM;AACtBiB,QAAAA,SAAS,EAAEN,CAAE;AACbV,QAAAA,aAAa,EAAEA,aAAc;QAC7BiB,QAAQ,EAAE,CAACb,QAAQ,IAAIM,CAAC,KAAKX,KAAK,GAAG,CAAC,GAAG,CAAC,CAAE;AAC5CK,QAAAA,QAAQ,EAAEA,QAAAA;OACNQ,EAAAA,QAAQ,CAEXD,EAAAA,KACU,CAAC,CAAA;AAAA,KACnB,CACU,CAAC,CAAA;AAExB,GAAC,CAAC,CAAA;AACN;;;;"}
|
@@ -37,8 +37,6 @@ var tokens = {
|
|
37
37
|
itemSelectedDividerColorHover: '--plasma-tab-item-selected-hover-divider-color',
|
38
38
|
outlineFocusColor: '--plasma-tabs-outline-focus-color',
|
39
39
|
arrowColor: '--plasma-tabs-arrow-color',
|
40
|
-
arrowColorHover: '--plasma-tabs-arrow-color-hover',
|
41
|
-
arrowColorActive: '--plasma-tabs-arrow-color-active',
|
42
40
|
tabsFilledBackgroundColor: '--plasma-tabs-filled-background-color',
|
43
41
|
tabsBackgroundColor: '--plasma-tabs-background-color',
|
44
42
|
tabsBorderRadius: '--plasma-tabs-border-radius',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tokens.js","sources":["../../../src/components/Tabs/tokens.ts"],"sourcesContent":["export const classes = {\n selectedTabsItem: 'selected-tabs-item',\n tabsPilled: 'tabs-pilled',\n tabsGroupFilledBackground: 'tabs-group-filled-background',\n tabsStretch: 'tabs-stretched',\n tabsNoDivider: 'tabs-no-divider',\n tabItemDivider: 'tab-item-divider',\n tabItemAnimated: 'tab-item-animated',\n tabContent: 'tab-item-content',\n tabRightContent: 'tab-item-right-content',\n tabLeftContent: 'tab-item-left-content',\n tabsHasLeftArrow: 'tabs-has-left-arrow',\n tabsHasRightArrow: 'tabs-has-right-arrow',\n tabsHasTopArrow: 'tabs-has-top-arrow',\n tabsHasBottomArrow: 'tabs-has-bottom-arrow',\n tabsClipScroll: 'tabs-clip-scroll',\n tabsClipShowAll: 'tabs-clip-show-all',\n};\n\nexport const tokens = {\n disabledOpacity: '--plasma-tabs-disabled-opacity',\n containerWidth: '--plasma-tabs-container-width',\n containerHeight: '--plasma-tabs-container-height',\n cursor: '--plasma-tabs-cursor',\n color: '--plasma-tabs-color',\n colorHover: '--plasma-tabs-color-hover',\n\n tabsDividerWidth: '--plasma-tabs-divider-width',\n tabsDividerHeight: '--plasma-tabs-divider-height',\n tabsDividerColor: '--plasma-tabs-divider-color',\n tabsDividerBorderRadius: '--plasma-tabs-divider-border-radius',\n\n itemSelectedDividerWidth: '--plasma-tab-item-selected-divider-width',\n itemSelectedDividerHeight: '--plasma-tab-item-selected-divider-height',\n itemSelectedDividerColor: '--plasma-tab-item-selected-divider-color',\n itemSelectedDividerColorHover: '--plasma-tab-item-selected-hover-divider-color',\n\n outlineFocusColor: '--plasma-tabs-outline-focus-color',\n arrowColor: '--plasma-tabs-arrow-color',\n
|
1
|
+
{"version":3,"file":"tokens.js","sources":["../../../src/components/Tabs/tokens.ts"],"sourcesContent":["export const classes = {\n selectedTabsItem: 'selected-tabs-item',\n tabsPilled: 'tabs-pilled',\n tabsGroupFilledBackground: 'tabs-group-filled-background',\n tabsStretch: 'tabs-stretched',\n tabsNoDivider: 'tabs-no-divider',\n tabItemDivider: 'tab-item-divider',\n tabItemAnimated: 'tab-item-animated',\n tabContent: 'tab-item-content',\n tabRightContent: 'tab-item-right-content',\n tabLeftContent: 'tab-item-left-content',\n tabsHasLeftArrow: 'tabs-has-left-arrow',\n tabsHasRightArrow: 'tabs-has-right-arrow',\n tabsHasTopArrow: 'tabs-has-top-arrow',\n tabsHasBottomArrow: 'tabs-has-bottom-arrow',\n tabsClipScroll: 'tabs-clip-scroll',\n tabsClipShowAll: 'tabs-clip-show-all',\n};\n\nexport const tokens = {\n disabledOpacity: '--plasma-tabs-disabled-opacity',\n containerWidth: '--plasma-tabs-container-width',\n containerHeight: '--plasma-tabs-container-height',\n cursor: '--plasma-tabs-cursor',\n color: '--plasma-tabs-color',\n colorHover: '--plasma-tabs-color-hover',\n\n tabsDividerWidth: '--plasma-tabs-divider-width',\n tabsDividerHeight: '--plasma-tabs-divider-height',\n tabsDividerColor: '--plasma-tabs-divider-color',\n tabsDividerBorderRadius: '--plasma-tabs-divider-border-radius',\n\n itemSelectedDividerWidth: '--plasma-tab-item-selected-divider-width',\n itemSelectedDividerHeight: '--plasma-tab-item-selected-divider-height',\n itemSelectedDividerColor: '--plasma-tab-item-selected-divider-color',\n itemSelectedDividerColorHover: '--plasma-tab-item-selected-hover-divider-color',\n\n outlineFocusColor: '--plasma-tabs-outline-focus-color',\n arrowColor: '--plasma-tabs-arrow-color',\n tabsFilledBackgroundColor: '--plasma-tabs-filled-background-color',\n\n tabsBackgroundColor: '--plasma-tabs-background-color',\n tabsBorderRadius: '--plasma-tabs-border-radius',\n tabsWidth: '--plasma-tabs-width',\n tabsHeight: '--plasma-tabs-height',\n tabsPadding: '--plasma-tabs-padding',\n tabsPilledBorderRadius: '--plasma-tabs-pilled-border-radius',\n\n itemBorderRadius: '--plasma-tab-item-border-radius',\n itemPilledBorderRadius: '--plasma-tab-item-pilled-border-radius',\n itemWidth: '--plasma-tab-item-width',\n itemHeight: '--plasma-tab-item-height',\n itemPadding: '--plasma-tab-item-padding',\n itemPaddingClear: '--plasma-tab-item-padding-clear',\n itemPaddingPilled: '--plasma-tab-item-padding-pilled',\n itemPaddingOrientationVertical: '--plasma-tab-item-padding-orientation-vertical',\n itemMarginLeft: '--plasma-tab-item-margin-left',\n itemMarginLeftFilled: '--plasma-tab-item-margin-left-filled',\n itemContentGap: '--plasma-tab-item-content-gap',\n\n itemContentPadding: '--plasma-tab-item-content-padding',\n itemContentPaddingClear: '--plasma-tab-item-content-padding-clear',\n\n arrowInnerPadding: '--plasma-tab-arrow-inner-padding',\n arrowOuterPadding: '--plasma-tab-arrow-outer-padding',\n arrowViewOuterPadding: '--plasma-tab-arrow-view-outer-padding',\n\n itemColor: '--plasma-tab-item-color',\n itemValueColor: '--plasma-tab-item-value-color',\n itemBackgroundColor: '--plasma-tab-item-background-color',\n itemColorHover: '--plasma-tab-item-color-hover',\n itemValueColorHover: '--plasma-tab-item-value-color-hover',\n itemColorActive: '--plasma-tab-item-color-active',\n itemValueColorActive: '--plasma-tab-item-value-color-active',\n itemBackgroundColorHover: '--plasma-tab-item-background-color-hover',\n\n itemSelectedColor: '--plasma-tab-item-selected-color',\n itemSelectedValueColor: '--plasma-tab-item-selected-value-color',\n itemSelectedBackgroundColor: '--plasma-tab-item-selected-background-color',\n itemSelectedColorHover: '--plasma-tab-item-selected-color-hover',\n itemSelectedValueColorHover: '--plasma-tab-item-selected-value-color-hover',\n itemSelectedBackgroundColorHover: '--plasma-tab-item-selected-background-color-hover',\n\n itemBackgroundTransition: '--plasma-tab-item-background-transition',\n\n fontFamily: '--plasma-tab-item-font-family',\n fontSize: '--plasma-tab-item-font-size',\n fontStyle: '--plasma-tab-item-font-style',\n fontWeight: '--plasma-tab-item-font-weight',\n letterSpacing: '--plasma-tab-item-letter-spacing',\n lineHeight: '--plasma-tab-item-lineheight',\n};\n"],"names":["classes","selectedTabsItem","tabsPilled","tabsGroupFilledBackground","tabsStretch","tabsNoDivider","tabItemDivider","tabItemAnimated","tabContent","tabRightContent","tabLeftContent","tabsHasLeftArrow","tabsHasRightArrow","tabsHasTopArrow","tabsHasBottomArrow","tabsClipScroll","tabsClipShowAll","tokens","disabledOpacity","containerWidth","containerHeight","cursor","color","colorHover","tabsDividerWidth","tabsDividerHeight","tabsDividerColor","tabsDividerBorderRadius","itemSelectedDividerWidth","itemSelectedDividerHeight","itemSelectedDividerColor","itemSelectedDividerColorHover","outlineFocusColor","arrowColor","tabsFilledBackgroundColor","tabsBackgroundColor","tabsBorderRadius","tabsWidth","tabsHeight","tabsPadding","tabsPilledBorderRadius","itemBorderRadius","itemPilledBorderRadius","itemWidth","itemHeight","itemPadding","itemPaddingClear","itemPaddingPilled","itemPaddingOrientationVertical","itemMarginLeft","itemMarginLeftFilled","itemContentGap","itemContentPadding","itemContentPaddingClear","arrowInnerPadding","arrowOuterPadding","arrowViewOuterPadding","itemColor","itemValueColor","itemBackgroundColor","itemColorHover","itemValueColorHover","itemColorActive","itemValueColorActive","itemBackgroundColorHover","itemSelectedColor","itemSelectedValueColor","itemSelectedBackgroundColor","itemSelectedColorHover","itemSelectedValueColorHover","itemSelectedBackgroundColorHover","itemBackgroundTransition","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight"],"mappings":";;;;AAAO,IAAMA,OAAO,GAAG;AACnBC,EAAAA,gBAAgB,EAAE,oBAAoB;AACtCC,EAAAA,UAAU,EAAE,aAAa;AACzBC,EAAAA,yBAAyB,EAAE,8BAA8B;AACzDC,EAAAA,WAAW,EAAE,gBAAgB;AAC7BC,EAAAA,aAAa,EAAE,iBAAiB;AAChCC,EAAAA,cAAc,EAAE,kBAAkB;AAClCC,EAAAA,eAAe,EAAE,mBAAmB;AACpCC,EAAAA,UAAU,EAAE,kBAAkB;AAC9BC,EAAAA,eAAe,EAAE,wBAAwB;AACzCC,EAAAA,cAAc,EAAE,u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AA;AAChB;;;;;"}
|
@@ -95,9 +95,7 @@ var horizontalTabItemRoot = function horizontalTabItemRoot(Root) {
|
|
95
95
|
disabled: disabled,
|
96
96
|
pilled: pilled,
|
97
97
|
role: role,
|
98
|
-
view: view
|
99
|
-
// TODO: убрать каст any, когда будут удалены deprecated props
|
100
|
-
,
|
98
|
+
view: view,
|
101
99
|
size: size,
|
102
100
|
onFocus: onItemFocus,
|
103
101
|
tabIndex: hasKeyNavigation ? navigationTabIndex : tabIndex,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"HorizontalTabItem.js","sources":["../../../../../../src/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.tsx"],"sourcesContent":["import React, { forwardRef, useRef, useContext, useEffect, useCallback } from 'react';\nimport { useForkRef } from '@salutejs/plasma-core';\n\nimport { RootProps } from '../../../../../engines';\nimport { classes } from '../../../tokens';\nimport { cx } from '../../../../../utils';\nimport { TabsContext } from '../../../TabsContext';\nimport { HorizontalTabItemProps } from '../../../TabItem.types';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as pilledCSS } from './variations/_pilled/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { LeftContent, RightContent, StyledContent, TabItemValue, base } from './HorizontalTabItem.styles';\n\nexport const horizontalTabItemRoot = (Root: RootProps<HTMLDivElement, HorizontalTabItemProps>) =>\n forwardRef<HTMLDivElement, HorizontalTabItemProps>((props, outerRef) => {\n const {\n size,\n view,\n isActive,\n selected,\n disabled = false,\n pilled = false,\n children,\n value,\n contentLeft,\n contentRight,\n animated = true,\n onIndexChange,\n itemIndex,\n tabIndex,\n className,\n onClick,\n ...rest\n } = props;\n\n const innerRef = useRef<HTMLDivElement>(null);\n const ref = useForkRef(outerRef, innerRef);\n const refs = useContext(TabsContext);\n\n const role = 'tab';\n\n const pilledAttr = view !== 'clear' && pilled;\n const animatedClass = animated ? classes.tabItemAnimated : undefined;\n const pilledClass = pilledAttr ? classes.tabsPilled : undefined;\n const selectedClass = isActive || selected ? classes.selectedTabsItem : undefined;\n const hasKeyNavigation = itemIndex !== undefined && onIndexChange !== undefined;\n const navigationTabIndex = !disabled && refs?.current === itemIndex ? 0 : -1;\n\n useEffect(() => {\n if (!refs) {\n return;\n }\n\n refs.register(innerRef);\n\n return () => refs.unregister(innerRef);\n }, [refs]);\n\n const onItemFocus = useCallback<React.FocusEventHandler>(\n (event) => {\n if (disabled) {\n return;\n }\n\n if (!hasKeyNavigation && innerRef?.current) {\n innerRef.current.scrollTo({\n top: 0,\n left: innerRef.current.offsetLeft,\n behavior: 'smooth',\n });\n\n return;\n }\n\n if (!refs) {\n return;\n }\n\n const focusIndex = refs.items.findIndex((itemRef) => itemRef.current === event.target);\n\n if (focusIndex === refs.current) {\n return;\n }\n\n onIndexChange?.(focusIndex);\n refs.setCurrent(focusIndex);\n },\n [refs, innerRef, onIndexChange, disabled],\n );\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n event.currentTarget.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n\n if (!onClick) {\n return;\n }\n\n onClick(event);\n };\n\n return (\n <Root\n ref={ref}\n disabled={disabled}\n pilled={pilled}\n role={role}\n view={view}\n // TODO: убрать каст any, когда будут удалены deprecated props\n size={size as any}\n onFocus={onItemFocus}\n tabIndex={hasKeyNavigation ? navigationTabIndex : tabIndex}\n className={cx(pilledClass, selectedClass, animatedClass, className)}\n onClick={handleClick}\n {...rest}\n >\n <>\n {contentLeft && <LeftContent className={classes.tabLeftContent}>{contentLeft}</LeftContent>}\n <StyledContent className={classes.tabContent}>{children}</StyledContent>\n {!contentRight && value && <TabItemValue>{value}</TabItemValue>}\n {!value && contentRight && (\n <RightContent className={classes.tabRightContent}>{contentRight}</RightContent>\n )}\n </>\n </Root>\n );\n });\n\nexport const horizontalTabItemConfig = {\n name: 'HorizontalTabItem',\n tag: 'button',\n layout: horizontalTabItemRoot,\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 },\n },\n defaults: {\n view: 'default',\n },\n};\n"],"names":["horizontalTabItemRoot","Root","forwardRef","props","outerRef","size","view","isActive","selected","_props$disabled","disabled","_props$pilled","pilled","children","value","contentLeft","contentRight","_props$animated","animated","onIndexChange","itemIndex","tabIndex","className","onClick","rest","_objectWithoutProperties","_excluded","innerRef","useRef","ref","useForkRef","refs","useContext","TabsContext","role","pilledAttr","animatedClass","classes","tabItemAnimated","undefined","pilledClass","tabsPilled","selectedClass","selectedTabsItem","hasKeyNavigation","navigationTabIndex","current","useEffect","register","unregister","onItemFocus","useCallback","event","scrollTo","top","left","offsetLeft","behavior","focusIndex","items","findIndex","itemRef","target","setCurrent","handleClick","currentTarget","scrollIntoView","block","inline","React","createElement","_extends","onFocus","cx","Fragment","LeftContent","tabLeftContent","StyledContent","tabContent","TabItemValue","RightContent","tabRightContent","horizontalTabItemConfig","name","tag","layout","base","variations","css","sizeCSS","viewCSS","disabledCSS","attrs","pilledCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;IAeaA,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAIC,IAAuD,EAAA;AAAA,EAAA,oBACzFC,gBAAU,CAAyC,UAACC,KAAK,EAAEC,QAAQ,EAAK;AACpE,IAAA,IACIC,IAAI,GAiBJF,KAAK,CAjBLE,IAAI;MACJC,IAAI,GAgBJH,KAAK,CAhBLG,IAAI;MACJC,QAAQ,GAeRJ,KAAK,CAfLI,QAAQ;MACRC,QAAQ,GAcRL,KAAK,CAdLK,QAAQ;MAAAC,eAAA,GAcRN,KAAK,CAbLO,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,eAAA;MAAAE,aAAA,GAahBR,KAAK,CAZLS,MAAM;AAANA,MAAAA,MAAM,GAAAD,aAAA,KAAG,KAAA,CAAA,GA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ontalTabItem/HorizontalTabItem.tsx"],"sourcesContent":["import React, { forwardRef, useRef, useContext, useEffect, useCallback } from 'react';\nimport { useForkRef } from '@salutejs/plasma-core';\n\nimport { RootProps } from '../../../../../engines';\nimport { classes } from '../../../tokens';\nimport { cx } from '../../../../../utils';\nimport { TabsContext } from '../../../TabsContext';\nimport { HorizontalTabItemProps } from '../../../TabItem.types';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as pilledCSS } from './variations/_pilled/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { LeftContent, RightContent, StyledContent, TabItemValue, base } from './HorizontalTabItem.styles';\n\nexport const horizontalTabItemRoot = (Root: RootProps<HTMLDivElement, HorizontalTabItemProps>) =>\n forwardRef<HTMLDivElement, HorizontalTabItemProps>((props, outerRef) => {\n const {\n size,\n view,\n isActive,\n selected,\n disabled = false,\n pilled = false,\n children,\n value,\n contentLeft,\n contentRight,\n animated = true,\n onIndexChange,\n itemIndex,\n tabIndex,\n className,\n onClick,\n ...rest\n } = props;\n\n const innerRef = useRef<HTMLDivElement>(null);\n const ref = useForkRef(outerRef, innerRef);\n const refs = useContext(TabsContext);\n\n const role = 'tab';\n\n const pilledAttr = view !== 'clear' && pilled;\n const animatedClass = animated ? classes.tabItemAnimated : undefined;\n const pilledClass = pilledAttr ? classes.tabsPilled : undefined;\n const selectedClass = isActive || selected ? classes.selectedTabsItem : undefined;\n const hasKeyNavigation = itemIndex !== undefined && onIndexChange !== undefined;\n const navigationTabIndex = !disabled && refs?.current === itemIndex ? 0 : -1;\n\n useEffect(() => {\n if (!refs) {\n return;\n }\n\n refs.register(innerRef);\n\n return () => refs.unregister(innerRef);\n }, [refs]);\n\n const onItemFocus = useCallback<React.FocusEventHandler>(\n (event) => {\n if (disabled) {\n return;\n }\n\n if (!hasKeyNavigation && innerRef?.current) {\n innerRef.current.scrollTo({\n top: 0,\n left: innerRef.current.offsetLeft,\n behavior: 'smooth',\n });\n\n return;\n }\n\n if (!refs) {\n return;\n }\n\n const focusIndex = refs.items.findIndex((itemRef) => itemRef.current === event.target);\n\n if (focusIndex === refs.current) {\n return;\n }\n\n onIndexChange?.(focusIndex);\n refs.setCurrent(focusIndex);\n },\n [refs, innerRef, onIndexChange, disabled],\n );\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n event.currentTarget.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n\n if (!onClick) {\n return;\n }\n\n onClick(event);\n };\n\n return (\n <Root\n ref={ref}\n disabled={disabled}\n pilled={pilled}\n role={role}\n view={view}\n size={size}\n onFocus={onItemFocus}\n tabIndex={hasKeyNavigation ? navigationTabIndex : tabIndex}\n className={cx(pilledClass, selectedClass, animatedClass, className)}\n onClick={handleClick}\n {...rest}\n >\n <>\n {contentLeft && <LeftContent className={classes.tabLeftContent}>{contentLeft}</LeftContent>}\n <StyledContent className={classes.tabContent}>{children}</StyledContent>\n {!contentRight && value && <TabItemValue>{value}</TabItemValue>}\n {!value && contentRight && (\n <RightContent className={classes.tabRightContent}>{contentRight}</RightContent>\n )}\n </>\n </Root>\n );\n });\n\nexport const horizontalTabItemConfig = {\n name: 'HorizontalTabItem',\n tag: 'button',\n layout: horizontalTabItemRoot,\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 },\n },\n defaults: {\n view: 'default',\n },\n};\n"],"names":["horizontalTabItemRoot","Root","forwardRef","props","outerRef","size","view","isActive","selected","_props$disabled","disabled","_props$pilled","pilled","children","value","contentLeft","contentRight","_props$animated","animated","onIndexChange","itemIndex","tabIndex","className","onClick","rest","_objectWithoutProperties","_excluded","innerRef","useRef","ref","useForkRef","refs","useContext","TabsContext","role","pilledAttr","animatedClass","classes","tabItemAnimated","undefined","pilledClass","tabsPilled","selectedClass","selectedTabsItem","hasKeyNavigation","navigationTabIndex","current","useEffect","register","unregister","onItemFocus","useCallback","event","scrollTo","top","left","offsetLeft","behavior","focusIndex","items","findIndex","itemRef","target","setCurrent","handleClick","currentTarget","scrollIntoView","block","inline","React","createElement","_extends","onFocus","cx","Fragment","LeftContent","tabLeftContent","StyledContent","tabContent","TabItemValue","RightContent","tabRightContent","horizontalTabItemConfig","name","tag","layout","base","variations","css","sizeCSS","viewCSS","disabledCSS","attrs","pilledCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;IAeaA,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAIC,IAAuD,EAAA;AAAA,EAAA,oBACzFC,gBAAU,CAAyC,UAACC,KAAK,EAAEC,QAAQ,EAAK;AACpE,IAAA,IACIC,IAAI,GAiBJF,KAAK,CAjBLE,IAAI;MACJC,IAAI,GAgBJH,KAAK,CAhBLG,IAAI;MACJC,QAAQ,GAeRJ,KAAK,CAfLI,QAAQ;MACRC,QAAQ,GAcRL,KAAK,CAdLK,QAAQ;MAAAC,eAAA,GAcRN,KAAK,CAbLO,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,eAAA;MAAAE,aAAA,GAahBR,KAAK,CAZLS,MAAM;AAANA,MAAAA,MAAM,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,aAAA;MACdE,QAAQ,GAWRV,KAAK,CAXLU,QAAQ;MACRC,KAAK,GAULX,KAAK,CAVLW,KAAK;MACLC,WAAW,GASXZ,KAAK,CATLY,WAAW;MACXC,YAAY,GAQZb,KAAK,CARLa,YAAY;MAAAC,eAAA,GAQZd,KAAK,CAPLe,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,eAAA;MACfE,aAAa,GAMbhB,KAAK,CANLgB,aAAa;MACbC,SAAS,GAKTjB,KAAK,CALLiB,SAAS;MACTC,QAAQ,GAIRlB,KAAK,CAJLkB,QAAQ;MACRC,SAAS,GAGT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AC1D,SAAS,EAAEe,cAAO,CAAC4C,eAAAA;KAAkBjE,EAAAA,YAA2B,CAEpF,CACA,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AAAA,EAAA;AAEC,IAAMkE,uBAAuB,GAAG;AACnCC,EAAAA,IAAI,EAAE,mBAAmB;AACzBC,EAAAA,GAAG,EAAE,QAAQ;AACbC,EAAAA,MAAM,EAAErF,qBAAqB;AAC7BsF,EAAAA,IAAI,EAAJA,6BAAI;AACJC,EAAAA,UAAU,EAAE;AACRlF,IAAAA,IAAI,EAAE;AACFmF,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACDnF,IAAAA,IAAI,EAAE;AACFkF,MAAAA,GAAG,EAAEE,WAAAA;KACR;AACDhF,IAAAA,QAAQ,EAAE;AACN8E,MAAAA,GAAG,EAAEG,WAAW;AAChBC,MAAAA,KAAK,EAAE,IAAA;KACV;AACDhF,IAAAA,MAAM,EAAE;AACJ4E,MAAAA,GAAG,EAAEK,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNxF,IAAAA,IAAI,EAAE,SAAA;AACV,GAAA;AACJ;;;;;"}
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
.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);}
|
4
4
|
|
5
|
-
.
|
5
|
+
.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;}
|
6
6
|
|
7
7
|
.base_j9bg3m_bbh58a1__de7491f9{opacity:var(--plasma-tabs-disabled-opacity);}
|
8
8
|
|
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
.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;}
|
12
12
|
|
13
|
-
.
|
14
|
-
.
|
15
|
-
.
|
16
|
-
.
|
13
|
+
.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;}
|
14
|
+
.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;}
|
15
|
+
.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;}
|
16
|
+
.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;}
|
@@ -17,19 +17,14 @@ var HorizontalTabs_styles = require('./HorizontalTabs.styles.js');
|
|
17
17
|
var IconDisclosureLeft = require('../../../../_Icon/Icons/IconDisclosureLeft.js');
|
18
18
|
var IconDisclosureRight = require('../../../../_Icon/Icons/IconDisclosureRight.js');
|
19
19
|
|
20
|
-
var _excluded = ["id", "stretch", "disabled", "clip", "size", "view", "children", "pilled", "index", "className"
|
20
|
+
var _excluded = ["id", "stretch", "disabled", "clip", "size", "view", "children", "pilled", "index", "className"];
|
21
21
|
var Keys = /*#__PURE__*/function (Keys) {
|
22
22
|
Keys[Keys["end"] = 35] = "end";
|
23
23
|
Keys[Keys["home"] = 36] = "home";
|
24
24
|
Keys[Keys["left"] = 37] = "left";
|
25
25
|
Keys[Keys["right"] = 39] = "right";
|
26
26
|
return Keys;
|
27
|
-
}(Keys || {});
|
28
|
-
var getIconSize = function getIconSize(size) {
|
29
|
-
return size === 'h1' || size === 'h2' ? 'm' : 's';
|
30
|
-
};
|
31
|
-
|
32
|
-
// TODO: https://github.com/salute-developers/plasma/issues/1474
|
27
|
+
}(Keys || {}); // TODO: https://github.com/salute-developers/plasma/issues/1474
|
33
28
|
var horizontalTabsRoot = function horizontalTabsRoot(Root) {
|
34
29
|
return /*#__PURE__*/React.forwardRef(function (props, outerRef) {
|
35
30
|
var id = props.id,
|
@@ -46,8 +41,6 @@ var horizontalTabsRoot = function horizontalTabsRoot(Root) {
|
|
46
41
|
pilled = _props$pilled === void 0 ? false : _props$pilled,
|
47
42
|
index$1 = props.index,
|
48
43
|
className = props.className,
|
49
|
-
_props$hasDivider = props.hasDivider,
|
50
|
-
hasDivider = _props$hasDivider === void 0 ? true : _props$hasDivider,
|
51
44
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(props, _excluded);
|
52
45
|
var _useState = React.useState(true),
|
53
46
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
@@ -65,7 +58,6 @@ var horizontalTabsRoot = function horizontalTabsRoot(Root) {
|
|
65
58
|
var isFilled = view === 'filled'; // outer padding is only for filled view
|
66
59
|
var pilledAttr = view !== 'clear' && pilled;
|
67
60
|
var pilledClass = pilledAttr ? tokens.classes.tabsPilled : undefined;
|
68
|
-
var noDividerClass = !hasDivider ? tokens.classes.tabsNoDivider : undefined;
|
69
61
|
var stretchClass = firstItemVisible && lastItemVisible && stretch ? tokens.classes.tabsStretch : undefined;
|
70
62
|
var hasLeftArrowClass = !firstItemVisible ? tokens.classes.tabsHasLeftArrow : undefined;
|
71
63
|
var hasRightArrowClass = !lastItemVisible ? tokens.classes.tabsHasRightArrow : undefined;
|
@@ -121,10 +113,9 @@ var horizontalTabsRoot = function horizontalTabsRoot(Root) {
|
|
121
113
|
ref: leftArrowRef,
|
122
114
|
isLeftArrow: true
|
123
115
|
}, /*#__PURE__*/React.createElement(IconDisclosureLeft.IconDisclosureLeft, {
|
124
|
-
|
125
|
-
color: "inherit"
|
116
|
+
color: "var(".concat(tokens.tokens.arrowColor, ")")
|
126
117
|
}));
|
127
|
-
}, [onPrev,
|
118
|
+
}, [onPrev, disabled, isFilled]);
|
128
119
|
var NextButton = React.useMemo(function () {
|
129
120
|
return /*#__PURE__*/React.createElement(HorizontalTabs_styles.StyledArrow, {
|
130
121
|
type: "button",
|
@@ -134,10 +125,9 @@ var horizontalTabsRoot = function horizontalTabsRoot(Root) {
|
|
134
125
|
disabled: disabled,
|
135
126
|
isFilled: isFilled
|
136
127
|
}, /*#__PURE__*/React.createElement(IconDisclosureRight.IconDisclosureRight, {
|
137
|
-
|
138
|
-
color: "inherit"
|
128
|
+
color: "var(".concat(tokens.tokens.arrowColor, ")")
|
139
129
|
}));
|
140
|
-
}, [onNext,
|
130
|
+
}, [onNext, disabled, isFilled]);
|
141
131
|
var handleScroll = React.useCallback(function (event) {
|
142
132
|
event.stopPropagation();
|
143
133
|
var maxScrollLeft = event.currentTarget.scrollWidth - event.currentTarget.clientWidth;
|
@@ -197,15 +187,13 @@ var horizontalTabsRoot = function horizontalTabsRoot(Root) {
|
|
197
187
|
value: refs
|
198
188
|
}, /*#__PURE__*/React.createElement(Root, _rollupPluginBabelHelpers.extends({
|
199
189
|
view: view,
|
200
|
-
role: "tablist"
|
201
|
-
// TODO: убрать каст any, когда будут удалены deprecated props
|
202
|
-
,
|
190
|
+
role: "tablist",
|
203
191
|
size: size,
|
204
192
|
pilled: pilled,
|
205
193
|
id: tabsId,
|
206
194
|
ref: outerRef,
|
207
195
|
disabled: disabled,
|
208
|
-
className: index.cx(pilledClass, stretchClass, hasLeftArrowClass, hasRightArrowClass,
|
196
|
+
className: index.cx(pilledClass, stretchClass, hasLeftArrowClass, hasRightArrowClass, className),
|
209
197
|
onKeyDown: onKeyDown
|
210
198
|
}, rest), !firstItemVisible && PreviousButton, /*#__PURE__*/React.createElement(HorizontalTabs_styles.StyledContentWrapper, {
|
211
199
|
className: index.cx(clipScrollClass, clipShowAllClass),
|
@@ -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,IAA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orizontalTabs.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,gBAAU,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,W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;AACfD,MAAAA,KAAK,EAAE,IAAA;KACV;AACD/H,IAAAA,MAAM,EAAE;AACJ2H,MAAAA,GAAG,EAAEM,WAAAA;AACT,KAAA;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,YAAM,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,YAAM,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,aAAM,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,aAAM,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,aAAM,CAACK,iBAAkB,EAAE,GAAA,CAAA,CAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAxBzF,IAAMG,WAAW,gBAAGjB,YAAM,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
|
|