@hh.ru/magritte-ui-tabs 7.0.28 → 7.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{Tab-BL4Tgu9S.js → Tab-m4sRBbyf.js} +2 -2
- package/{Tab-BL4Tgu9S.js.map → Tab-m4sRBbyf.js.map} +1 -1
- package/Tab.js +1 -1
- package/Tabs.js +1 -1
- package/index.css +133 -133
- package/index.js +1 -1
- package/package.json +8 -8
- package/useTabs.js +1 -1
|
@@ -10,7 +10,7 @@ import { OFFSETS_BY_MODE } from './offsets.js';
|
|
|
10
10
|
import { TooltipHover } from '@hh.ru/magritte-ui-tooltip';
|
|
11
11
|
import { Text } from '@hh.ru/magritte-ui-typography';
|
|
12
12
|
|
|
13
|
-
var styles = {"tabs":"magritte-tabs___VcV8C_7-0-
|
|
13
|
+
var styles = {"tabs":"magritte-tabs___VcV8C_7-0-29","tab-wrapper":"magritte-tab-wrapper___9j9qk_7-0-29","tabWrapper":"magritte-tab-wrapper___9j9qk_7-0-29","tab":"magritte-tab___B0BeU_7-0-29","tab_selected":"magritte-tab_selected___w9PT2_7-0-29","tabSelected":"magritte-tab_selected___w9PT2_7-0-29","tab-wrapper_primary":"magritte-tab-wrapper_primary___yt3sT_7-0-29","tabWrapperPrimary":"magritte-tab-wrapper_primary___yt3sT_7-0-29","tab_primary":"magritte-tab_primary___3Of2H_7-0-29","tabPrimary":"magritte-tab_primary___3Of2H_7-0-29","tab-label":"magritte-tab-label___nFmge_7-0-29","tabLabel":"magritte-tab-label___nFmge_7-0-29","postfix":"magritte-postfix___30ZxD_7-0-29","tab-content":"magritte-tab-content___onvTJ_7-0-29","tabContent":"magritte-tab-content___onvTJ_7-0-29","tab-wrapper_secondary":"magritte-tab-wrapper_secondary___avLln_7-0-29","tabWrapperSecondary":"magritte-tab-wrapper_secondary___avLln_7-0-29","tab_secondary":"magritte-tab_secondary___-00LL_7-0-29","tabSecondary":"magritte-tab_secondary___-00LL_7-0-29","postfix-wrapper":"magritte-postfix-wrapper___1dORq_7-0-29","postfixWrapper":"magritte-postfix-wrapper___1dORq_7-0-29","indicator-wrapper":"magritte-indicator-wrapper___Q68i7_7-0-29","indicatorWrapper":"magritte-indicator-wrapper___Q68i7_7-0-29","indicator":"magritte-indicator___irp4W_7-0-29","animate":"magritte-animate___5GxTP_7-0-29"};
|
|
14
14
|
|
|
15
15
|
const TabForwardRefRenderFunc = ({ Element = 'button', badge = false, children, 'data-qa': dataQa = 'tab', focused, hidden, id, itemRef, mode = 'primary', onClick, onSelect, postfix, selected, ...buttonProps }, ref) => {
|
|
16
16
|
const activatorRef = useRef(null);
|
|
@@ -77,4 +77,4 @@ const TabComponent = forwardRef(TabForwardRefRenderFunc);
|
|
|
77
77
|
const Tab = TabComponent;
|
|
78
78
|
|
|
79
79
|
export { Tab as T, styles as s };
|
|
80
|
-
//# sourceMappingURL=Tab-
|
|
80
|
+
//# sourceMappingURL=Tab-m4sRBbyf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tab-BL4Tgu9S.js","sources":["../src/Tab.tsx"],"sourcesContent":["import { forwardRef, useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport classnames from 'classnames';\n\nimport '@hh.ru/magritte-common-focus-visible';\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport type { PolymorphicForwardRefRenderFunc, PolymorphicComponentWithRef } from '@hh.ru/magritte-types';\nimport { Badge, ComponentWithBadge } from '@hh.ru/magritte-ui-badge';\nimport { useScrollContext } from '@hh.ru/magritte-ui-scrollable-container';\nimport { OFFSETS_BY_MODE } from '@hh.ru/magritte-ui-tabs/offsets';\nimport type { TabProps } from '@hh.ru/magritte-ui-tabs/types';\nimport { TooltipHover } from '@hh.ru/magritte-ui-tooltip';\nimport { Text } from '@hh.ru/magritte-ui-typography';\n\nimport styles from './tabs.less';\n\nconst TabForwardRefRenderFunc: PolymorphicForwardRefRenderFunc<TabProps, 'button'> = (\n {\n Element = 'button',\n badge = false,\n children,\n 'data-qa': dataQa = 'tab',\n focused,\n hidden,\n id,\n itemRef,\n mode = 'primary',\n onClick,\n onSelect,\n postfix,\n selected,\n ...buttonProps\n },\n ref\n) => {\n const activatorRef = useRef<HTMLSpanElement>(null);\n const elementRef = useRef<HTMLElement | null>(null);\n const labelRef = useRef<HTMLSpanElement>(null);\n const mouseEventRef = useRef(false);\n\n const { removeItem, registerItem, scrollToItem } = useScrollContext();\n\n const scrollItemCallback = useCallback(\n (element: HTMLElement | null) => {\n if (element !== null) {\n elementRef.current = element;\n registerItem(elementRef);\n } else {\n removeItem(elementRef);\n elementRef.current = null;\n }\n },\n [registerItem, removeItem]\n );\n\n const elementRefCallback = useMultipleRefs<HTMLElement>(scrollItemCallback, ref as React.Ref<HTMLElement>);\n\n const [showTooltip, setShowTooltip] = useState(false);\n\n useLayoutEffect(() => {\n if (focused && elementRef.current) {\n elementRef.current.focus();\n }\n }, [focused]);\n\n useLayoutEffect(() => {\n if (selected && elementRef.current) {\n scrollToItem(elementRef);\n if (showTooltip && labelRef.current) {\n labelRef.current.dispatchEvent(new MouseEvent('mouseout', { bubbles: true, cancelable: true }));\n }\n }\n }, [selected, scrollToItem, showTooltip]);\n\n useLayoutEffect(() => {\n if (\n mode === 'secondary' &&\n labelRef.current !== null &&\n labelRef.current.scrollWidth > labelRef.current.offsetWidth\n ) {\n setShowTooltip(true);\n }\n }, [mode, setShowTooltip]);\n\n const handleFocus = useCallback(() => {\n if (!mouseEventRef.current) {\n scrollToItem(elementRef);\n }\n }, [scrollToItem]);\n\n const setMouseEventRef = useCallback(() => (mouseEventRef.current = true), []);\n\n const resetMouseEventRef = useCallback(() => (mouseEventRef.current = false), []);\n\n const handleWheel = useCallback(() => {\n if (labelRef?.current) {\n labelRef.current.dispatchEvent(new MouseEvent('mouseout', { bubbles: true, cancelable: true }));\n }\n }, []);\n\n if (hidden) {\n return null;\n }\n\n const handleClick: React.MouseEventHandler<HTMLElement> = (event) => {\n onSelect?.(id);\n onClick?.(event);\n };\n\n const content = (\n <span className={styles.tabContent} ref={activatorRef}>\n <span className={styles.tabLabel} ref={labelRef}>\n <Text Element=\"span\" typography={mode === 'primary' ? 'subtitle-1-semibold' : 'label-3-regular'}>\n {children}\n </Text>\n </span>\n {postfix && (\n <span className={styles.postfixWrapper} data-qa=\"tab-postfix\">\n <Text\n Element=\"span\"\n typography={mode === 'primary' ? 'subtitle-1-semibold' : 'subtitle-2-semibold'}\n >\n <span className={styles.postfix}>{postfix}</span>\n </Text>\n </span>\n )}\n </span>\n );\n\n const tabElement = (\n <Element\n {...buttonProps}\n type=\"button\"\n ref={elementRefCallback}\n role=\"tab\"\n data-qa={dataQa}\n onClick={handleClick}\n className={classnames(styles.tab, { [styles.tabSelected]: selected, [styles[`tab_${mode}`]]: !!mode })}\n aria-selected={selected}\n onFocus={handleFocus}\n onMouseDown={setMouseEventRef}\n onMouseLeave={resetMouseEventRef}\n onMouseUp={resetMouseEventRef}\n onWheel={showTooltip ? handleWheel : undefined}\n >\n {content}\n {showTooltip && (\n <TooltipHover activatorRef={activatorRef} placement=\"top-center\">\n {children}\n </TooltipHover>\n )}\n </Element>\n );\n\n return (\n <div\n data-qa={`wrapper-${dataQa}`}\n ref={itemRef}\n className={classnames(styles.tabWrapper, { [styles[`tab-wrapper_${mode}`]]: !!mode })}\n >\n {badge ? (\n <ComponentWithBadge badge={<Badge size=\"extra-small\" />} {...OFFSETS_BY_MODE[mode]}>\n {tabElement}\n </ComponentWithBadge>\n ) : (\n tabElement\n )}\n </div>\n );\n};\n\nconst TabComponent = forwardRef(TabForwardRefRenderFunc) as PolymorphicComponentWithRef<TabProps, 'button'>;\n\nexport const Tab: PolymorphicComponentWithRef<TabProps, 'button'> = TabComponent;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;AAeA,MAAM,uBAAuB,GAAwD,CACjF,EACI,OAAO,GAAG,QAAQ,EAClB,KAAK,GAAG,KAAK,EACb,QAAQ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tab.tsx"],"sourcesContent":["import { forwardRef, useCallback, useLayoutEffect, useRef, useState } from 'react';\nimport classnames from 'classnames';\n\nimport '@hh.ru/magritte-common-focus-visible';\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport type { PolymorphicForwardRefRenderFunc, PolymorphicComponentWithRef } from '@hh.ru/magritte-types';\nimport { Badge, ComponentWithBadge } from '@hh.ru/magritte-ui-badge';\nimport { useScrollContext } from '@hh.ru/magritte-ui-scrollable-container';\nimport { OFFSETS_BY_MODE } from '@hh.ru/magritte-ui-tabs/offsets';\nimport type { TabProps } from '@hh.ru/magritte-ui-tabs/types';\nimport { TooltipHover } from '@hh.ru/magritte-ui-tooltip';\nimport { Text } from '@hh.ru/magritte-ui-typography';\n\nimport styles from './tabs.less';\n\nconst TabForwardRefRenderFunc: PolymorphicForwardRefRenderFunc<TabProps, 'button'> = (\n {\n Element = 'button',\n badge = false,\n children,\n 'data-qa': dataQa = 'tab',\n focused,\n hidden,\n id,\n itemRef,\n mode = 'primary',\n onClick,\n onSelect,\n postfix,\n selected,\n ...buttonProps\n },\n ref\n) => {\n const activatorRef = useRef<HTMLSpanElement>(null);\n const elementRef = useRef<HTMLElement | null>(null);\n const labelRef = useRef<HTMLSpanElement>(null);\n const mouseEventRef = useRef(false);\n\n const { removeItem, registerItem, scrollToItem } = useScrollContext();\n\n const scrollItemCallback = useCallback(\n (element: HTMLElement | null) => {\n if (element !== null) {\n elementRef.current = element;\n registerItem(elementRef);\n } else {\n removeItem(elementRef);\n elementRef.current = null;\n }\n },\n [registerItem, removeItem]\n );\n\n const elementRefCallback = useMultipleRefs<HTMLElement>(scrollItemCallback, ref as React.Ref<HTMLElement>);\n\n const [showTooltip, setShowTooltip] = useState(false);\n\n useLayoutEffect(() => {\n if (focused && elementRef.current) {\n elementRef.current.focus();\n }\n }, [focused]);\n\n useLayoutEffect(() => {\n if (selected && elementRef.current) {\n scrollToItem(elementRef);\n if (showTooltip && labelRef.current) {\n labelRef.current.dispatchEvent(new MouseEvent('mouseout', { bubbles: true, cancelable: true }));\n }\n }\n }, [selected, scrollToItem, showTooltip]);\n\n useLayoutEffect(() => {\n if (\n mode === 'secondary' &&\n labelRef.current !== null &&\n labelRef.current.scrollWidth > labelRef.current.offsetWidth\n ) {\n setShowTooltip(true);\n }\n }, [mode, setShowTooltip]);\n\n const handleFocus = useCallback(() => {\n if (!mouseEventRef.current) {\n scrollToItem(elementRef);\n }\n }, [scrollToItem]);\n\n const setMouseEventRef = useCallback(() => (mouseEventRef.current = true), []);\n\n const resetMouseEventRef = useCallback(() => (mouseEventRef.current = false), []);\n\n const handleWheel = useCallback(() => {\n if (labelRef?.current) {\n labelRef.current.dispatchEvent(new MouseEvent('mouseout', { bubbles: true, cancelable: true }));\n }\n }, []);\n\n if (hidden) {\n return null;\n }\n\n const handleClick: React.MouseEventHandler<HTMLElement> = (event) => {\n onSelect?.(id);\n onClick?.(event);\n };\n\n const content = (\n <span className={styles.tabContent} ref={activatorRef}>\n <span className={styles.tabLabel} ref={labelRef}>\n <Text Element=\"span\" typography={mode === 'primary' ? 'subtitle-1-semibold' : 'label-3-regular'}>\n {children}\n </Text>\n </span>\n {postfix && (\n <span className={styles.postfixWrapper} data-qa=\"tab-postfix\">\n <Text\n Element=\"span\"\n typography={mode === 'primary' ? 'subtitle-1-semibold' : 'subtitle-2-semibold'}\n >\n <span className={styles.postfix}>{postfix}</span>\n </Text>\n </span>\n )}\n </span>\n );\n\n const tabElement = (\n <Element\n {...buttonProps}\n type=\"button\"\n ref={elementRefCallback}\n role=\"tab\"\n data-qa={dataQa}\n onClick={handleClick}\n className={classnames(styles.tab, { [styles.tabSelected]: selected, [styles[`tab_${mode}`]]: !!mode })}\n aria-selected={selected}\n onFocus={handleFocus}\n onMouseDown={setMouseEventRef}\n onMouseLeave={resetMouseEventRef}\n onMouseUp={resetMouseEventRef}\n onWheel={showTooltip ? handleWheel : undefined}\n >\n {content}\n {showTooltip && (\n <TooltipHover activatorRef={activatorRef} placement=\"top-center\">\n {children}\n </TooltipHover>\n )}\n </Element>\n );\n\n return (\n <div\n data-qa={`wrapper-${dataQa}`}\n ref={itemRef}\n className={classnames(styles.tabWrapper, { [styles[`tab-wrapper_${mode}`]]: !!mode })}\n >\n {badge ? (\n <ComponentWithBadge badge={<Badge size=\"extra-small\" />} {...OFFSETS_BY_MODE[mode]}>\n {tabElement}\n </ComponentWithBadge>\n ) : (\n tabElement\n )}\n </div>\n );\n};\n\nconst TabComponent = forwardRef(TabForwardRefRenderFunc) as PolymorphicComponentWithRef<TabProps, 'button'>;\n\nexport const Tab: PolymorphicComponentWithRef<TabProps, 'button'> = TabComponent;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;AAeA,MAAM,uBAAuB,GAAwD,CACjF,EACI,OAAO,GAAG,QAAQ,EAClB,KAAK,GAAG,KAAK,EACb,QAAQ,EACR,SAAS,EAAE,MAAM,GAAG,KAAK,EACzB,OAAO,EACP,MAAM,EACN,EAAE,EACF,OAAO,EACP,IAAI,GAAG,SAAS,EAChB,OAAO,EACP,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,GAAG,WAAW,EACjB,EACD,GAAG,KACH;AACA,IAAA,MAAM,YAAY,GAAG,MAAM,CAAkB,IAAI,CAAC,CAAC;AACnD,IAAA,MAAM,UAAU,GAAG,MAAM,CAAqB,IAAI,CAAC,CAAC;AACpD,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAkB,IAAI,CAAC,CAAC;AAC/C,IAAA,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAEpC,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,gBAAgB,EAAE,CAAC;AAEtE,IAAA,MAAM,kBAAkB,GAAG,WAAW,CAClC,CAAC,OAA2B,KAAI;AAC5B,QAAA,IAAI,OAAO,KAAK,IAAI,EAAE;AAClB,YAAA,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC;YAC7B,YAAY,C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OAAO,EACZ,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,IAAI,CAAA,CAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAA,QAAA,EAEpF,KAAK,IACFA,GAAA,CAAC,kBAAkB,EAAC,EAAA,KAAK,EAAEA,GAAA,CAAC,KAAK,EAAA,EAAC,IAAI,EAAC,aAAa,EAAG,CAAA,EAAA,GAAM,eAAe,CAAC,IAAI,CAAC,EAC7E,QAAA,EAAA,UAAU,GACM,KAErB,UAAU,CACb,EAAA,CACC,EACR;AACN,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,UAAU,CAAC,uBAAuB,CAAoD,CAAC;AAErG,MAAM,GAAG,GAAoD;;;;"}
|
package/Tab.js
CHANGED
|
@@ -9,5 +9,5 @@ import '@hh.ru/magritte-ui-scrollable-container';
|
|
|
9
9
|
import './offsets.js';
|
|
10
10
|
import '@hh.ru/magritte-ui-tooltip';
|
|
11
11
|
import '@hh.ru/magritte-ui-typography';
|
|
12
|
-
export { T as Tab } from './Tab-
|
|
12
|
+
export { T as Tab } from './Tab-m4sRBbyf.js';
|
|
13
13
|
//# sourceMappingURL=Tab.js.map
|
package/Tabs.js
CHANGED
|
@@ -2,7 +2,7 @@ import './index.css';
|
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useState, useRef, useCallback } from 'react';
|
|
4
4
|
import { ScrollableContainer } from '@hh.ru/magritte-ui-scrollable-container';
|
|
5
|
-
import { s as styles, T as Tab } from './Tab-
|
|
5
|
+
import { s as styles, T as Tab } from './Tab-m4sRBbyf.js';
|
|
6
6
|
import { useTabs } from './useTabs.js';
|
|
7
7
|
import 'classnames';
|
|
8
8
|
import '@hh.ru/magritte-common-focus-visible';
|
package/index.css
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
1
|
:root{
|
|
2
|
-
--magritte-color-component-tabs-stroke-state-focused-accessible-v24-0
|
|
3
|
-
--magritte-color-component-tabs-background-selected-v24-0
|
|
4
|
-
--magritte-color-component-tabs-background-unselected-v24-0
|
|
5
|
-
--magritte-color-component-tabs-background-state-unselected-pressed-v24-0
|
|
6
|
-
--magritte-color-component-tabs-background-state-unselected-focused-v24-0
|
|
7
|
-
--magritte-color-component-tabs-background-state-selected-focused-v24-0
|
|
8
|
-
--magritte-color-component-tabs-background-state-unselected-hovered-v24-0
|
|
9
|
-
--magritte-color-component-tabs-text-selected-v24-0
|
|
10
|
-
--magritte-color-component-tabs-text-unselected-v24-0
|
|
11
|
-
--magritte-color-component-tabs-postfix-text-selected-v24-0
|
|
12
|
-
--magritte-color-component-tabs-postfix-text-unselected-v24-0
|
|
13
|
-
--magritte-color-component-secondary-tabs-stroke-state-focused-accessible-v24-0
|
|
14
|
-
--magritte-color-component-secondary-tabs-text-selected-v24-0
|
|
15
|
-
--magritte-color-component-secondary-tabs-text-unselected-v24-0
|
|
16
|
-
--magritte-color-component-secondary-tabs-indicator-selected-v24-0
|
|
17
|
-
--magritte-color-component-secondary-tabs-text-state-unselected-hovered-v24-0
|
|
18
|
-
--magritte-color-component-secondary-tabs-text-state-unselected-pressed-v24-0
|
|
19
|
-
--magritte-color-component-secondary-tabs-postfix-text-selected-v24-0
|
|
20
|
-
--magritte-color-component-secondary-tabs-postfix-text-unselected-v24-0
|
|
2
|
+
--magritte-color-component-tabs-stroke-state-focused-accessible-v24-1-0:#0070ff7a;
|
|
3
|
+
--magritte-color-component-tabs-background-selected-v24-1-0:#000000;
|
|
4
|
+
--magritte-color-component-tabs-background-unselected-v24-1-0:#F1F4F9;
|
|
5
|
+
--magritte-color-component-tabs-background-state-unselected-pressed-v24-1-0:#F1F4F9;
|
|
6
|
+
--magritte-color-component-tabs-background-state-unselected-focused-v24-1-0:#F1F4F9;
|
|
7
|
+
--magritte-color-component-tabs-background-state-selected-focused-v24-1-0:#000000;
|
|
8
|
+
--magritte-color-component-tabs-background-state-unselected-hovered-v24-1-0:#DCE3EB;
|
|
9
|
+
--magritte-color-component-tabs-text-selected-v24-1-0:#ffffff;
|
|
10
|
+
--magritte-color-component-tabs-text-unselected-v24-1-0:#6a7885;
|
|
11
|
+
--magritte-color-component-tabs-postfix-text-selected-v24-1-0:#BBC8D4;
|
|
12
|
+
--magritte-color-component-tabs-postfix-text-unselected-v24-1-0:#AABBCA;
|
|
13
|
+
--magritte-color-component-secondary-tabs-stroke-state-focused-accessible-v24-1-0:#0070ff7a;
|
|
14
|
+
--magritte-color-component-secondary-tabs-text-selected-v24-1-0:#000000;
|
|
15
|
+
--magritte-color-component-secondary-tabs-text-unselected-v24-1-0:#768694;
|
|
16
|
+
--magritte-color-component-secondary-tabs-indicator-selected-v24-1-0:#000000;
|
|
17
|
+
--magritte-color-component-secondary-tabs-text-state-unselected-hovered-v24-1-0:#000000;
|
|
18
|
+
--magritte-color-component-secondary-tabs-text-state-unselected-pressed-v24-1-0:#000000;
|
|
19
|
+
--magritte-color-component-secondary-tabs-postfix-text-selected-v24-1-0:#AABBCA;
|
|
20
|
+
--magritte-color-component-secondary-tabs-postfix-text-unselected-v24-1-0:#AABBCA;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
:root{
|
|
24
|
-
--magritte-semantic-animation-ease-in-out-tiger-100-timing-function-v24-0
|
|
25
|
-
--magritte-semantic-animation-ease-in-out-tiger-100-duration-v24-0
|
|
26
|
-
--magritte-semantic-animation-ease-in-out-tiger-200-timing-function-v24-0
|
|
27
|
-
--magritte-semantic-animation-ease-in-out-tiger-200-duration-v24-0
|
|
24
|
+
--magritte-semantic-animation-ease-in-out-tiger-100-timing-function-v24-1-0:cubic-bezier(0.25, 0.1, 0.25, 1);
|
|
25
|
+
--magritte-semantic-animation-ease-in-out-tiger-100-duration-v24-1-0:100ms;
|
|
26
|
+
--magritte-semantic-animation-ease-in-out-tiger-200-timing-function-v24-1-0:cubic-bezier(0.25, 0.1, 0.25, 1);
|
|
27
|
+
--magritte-semantic-animation-ease-in-out-tiger-200-duration-v24-1-0:200ms;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.magritte-night-theme{
|
|
31
|
-
--magritte-color-component-tabs-background-selected-v24-0
|
|
32
|
-
--magritte-color-component-tabs-background-unselected-v24-0
|
|
33
|
-
--magritte-color-component-tabs-background-state-unselected-pressed-v24-0
|
|
34
|
-
--magritte-color-component-tabs-background-state-unselected-focused-v24-0
|
|
35
|
-
--magritte-color-component-tabs-background-state-selected-focused-v24-0
|
|
36
|
-
--magritte-color-component-tabs-background-state-unselected-hovered-v24-0
|
|
37
|
-
--magritte-color-component-tabs-text-selected-v24-0
|
|
38
|
-
--magritte-color-component-tabs-text-unselected-v24-0
|
|
39
|
-
--magritte-color-component-tabs-postfix-text-selected-v24-0
|
|
40
|
-
--magritte-color-component-tabs-postfix-text-unselected-v24-0
|
|
41
|
-
--magritte-color-component-secondary-tabs-text-selected-v24-0
|
|
42
|
-
--magritte-color-component-secondary-tabs-text-unselected-v24-0
|
|
43
|
-
--magritte-color-component-secondary-tabs-indicator-selected-v24-0
|
|
44
|
-
--magritte-color-component-secondary-tabs-text-state-unselected-hovered-v24-0
|
|
45
|
-
--magritte-color-component-secondary-tabs-text-state-unselected-pressed-v24-0
|
|
46
|
-
--magritte-color-component-secondary-tabs-postfix-text-selected-v24-0
|
|
47
|
-
--magritte-color-component-secondary-tabs-postfix-text-unselected-v24-0
|
|
48
|
-
}
|
|
49
|
-
.magritte-tabs___VcV8C_7-0-
|
|
31
|
+
--magritte-color-component-tabs-background-selected-v24-1-0:#ffffff;
|
|
32
|
+
--magritte-color-component-tabs-background-unselected-v24-1-0:#303030;
|
|
33
|
+
--magritte-color-component-tabs-background-state-unselected-pressed-v24-1-0:#303030;
|
|
34
|
+
--magritte-color-component-tabs-background-state-unselected-focused-v24-1-0:#303030;
|
|
35
|
+
--magritte-color-component-tabs-background-state-selected-focused-v24-1-0:#ffffff;
|
|
36
|
+
--magritte-color-component-tabs-background-state-unselected-hovered-v24-1-0:#3B3B3B;
|
|
37
|
+
--magritte-color-component-tabs-text-selected-v24-1-0:#000000;
|
|
38
|
+
--magritte-color-component-tabs-text-unselected-v24-1-0:#B9B9B9;
|
|
39
|
+
--magritte-color-component-tabs-postfix-text-selected-v24-1-0:#919191;
|
|
40
|
+
--magritte-color-component-tabs-postfix-text-unselected-v24-1-0:#919191;
|
|
41
|
+
--magritte-color-component-secondary-tabs-text-selected-v24-1-0:#ffffff;
|
|
42
|
+
--magritte-color-component-secondary-tabs-text-unselected-v24-1-0:#ABABAB;
|
|
43
|
+
--magritte-color-component-secondary-tabs-indicator-selected-v24-1-0:#ffffff;
|
|
44
|
+
--magritte-color-component-secondary-tabs-text-state-unselected-hovered-v24-1-0:#ABABAB;
|
|
45
|
+
--magritte-color-component-secondary-tabs-text-state-unselected-pressed-v24-1-0:#ABABAB;
|
|
46
|
+
--magritte-color-component-secondary-tabs-postfix-text-selected-v24-1-0:#919191;
|
|
47
|
+
--magritte-color-component-secondary-tabs-postfix-text-unselected-v24-1-0:#919191;
|
|
48
|
+
}
|
|
49
|
+
.magritte-tabs___VcV8C_7-0-29{
|
|
50
50
|
display:flex;
|
|
51
51
|
align-items:center;
|
|
52
52
|
outline:none;
|
|
53
53
|
}
|
|
54
|
-
.magritte-tab-wrapper___9j9qk_7-0-
|
|
54
|
+
.magritte-tab-wrapper___9j9qk_7-0-29:last-of-type{
|
|
55
55
|
margin-right:0px;
|
|
56
56
|
}
|
|
57
|
-
.magritte-tab___B0BeU_7-0-
|
|
57
|
+
.magritte-tab___B0BeU_7-0-29{
|
|
58
58
|
box-sizing:border-box;
|
|
59
59
|
flex-shrink:0;
|
|
60
60
|
display:block;
|
|
@@ -62,168 +62,168 @@
|
|
|
62
62
|
border:0;
|
|
63
63
|
outline:0 solid transparent;
|
|
64
64
|
min-height:40px;
|
|
65
|
-
transition:all var(--magritte-semantic-animation-ease-in-out-tiger-100-duration-v24-0
|
|
65
|
+
transition:all var(--magritte-semantic-animation-ease-in-out-tiger-100-duration-v24-1-0) var(--magritte-semantic-animation-ease-in-out-tiger-100-timing-function-v24-1-0);
|
|
66
66
|
}
|
|
67
|
-
.magritte-tab___B0BeU_7-0-
|
|
67
|
+
.magritte-tab___B0BeU_7-0-29:active{
|
|
68
68
|
transform:scale(0.96);
|
|
69
|
-
transition:all var(--magritte-semantic-animation-ease-in-out-tiger-200-duration-v24-0
|
|
69
|
+
transition:all var(--magritte-semantic-animation-ease-in-out-tiger-200-duration-v24-1-0) var(--magritte-semantic-animation-ease-in-out-tiger-200-timing-function-v24-1-0);
|
|
70
70
|
}
|
|
71
|
-
.magritte-tab___B0BeU_7-0-
|
|
71
|
+
.magritte-tab___B0BeU_7-0-29.magritte-tab_selected___w9PT2_7-0-29{
|
|
72
72
|
cursor:default;
|
|
73
73
|
}
|
|
74
|
-
.magritte-tab___B0BeU_7-0-
|
|
74
|
+
.magritte-tab___B0BeU_7-0-29.magritte-tab_selected___w9PT2_7-0-29:active{
|
|
75
75
|
transform:none;
|
|
76
76
|
}
|
|
77
|
-
.magritte-tab-wrapper_primary___yt3sT_7-0-
|
|
77
|
+
.magritte-tab-wrapper_primary___yt3sT_7-0-29{
|
|
78
78
|
margin-right:12px;
|
|
79
79
|
}
|
|
80
|
-
.magritte-tab_primary___3Of2H_7-0-
|
|
80
|
+
.magritte-tab_primary___3Of2H_7-0-29{
|
|
81
81
|
border-radius:100px;
|
|
82
|
-
background-color:var(--magritte-color-component-tabs-background-unselected-v24-0
|
|
83
|
-
--magritte-ui-text-color-override:var(--magritte-color-component-tabs-text-unselected-v24-0
|
|
82
|
+
background-color:var(--magritte-color-component-tabs-background-unselected-v24-1-0);
|
|
83
|
+
--magritte-ui-text-color-override:var(--magritte-color-component-tabs-text-unselected-v24-1-0);
|
|
84
84
|
}
|
|
85
|
-
.magritte-tab_primary___3Of2H_7-0-
|
|
86
|
-
background-color:var(--magritte-color-component-tabs-background-state-unselected-pressed-v24-0
|
|
85
|
+
.magritte-tab_primary___3Of2H_7-0-29:active{
|
|
86
|
+
background-color:var(--magritte-color-component-tabs-background-state-unselected-pressed-v24-1-0);
|
|
87
87
|
}
|
|
88
|
-
.magritte-tab_primary___3Of2H_7-0-
|
|
89
|
-
background-color:var(--magritte-color-component-tabs-background-state-unselected-focused-v24-0
|
|
90
|
-
outline:4px solid var(--magritte-color-component-tabs-stroke-state-focused-accessible-v24-0
|
|
88
|
+
.magritte-tab_primary___3Of2H_7-0-29.focus-visible{
|
|
89
|
+
background-color:var(--magritte-color-component-tabs-background-state-unselected-focused-v24-1-0);
|
|
90
|
+
outline:4px solid var(--magritte-color-component-tabs-stroke-state-focused-accessible-v24-1-0);
|
|
91
91
|
}
|
|
92
|
-
.magritte-tab_primary___3Of2H_7-0-
|
|
93
|
-
background-color:var(--magritte-color-component-tabs-background-selected-v24-0
|
|
94
|
-
--magritte-ui-text-color-override:var(--magritte-color-component-tabs-text-selected-v24-0
|
|
92
|
+
.magritte-tab_primary___3Of2H_7-0-29.magritte-tab_selected___w9PT2_7-0-29{
|
|
93
|
+
background-color:var(--magritte-color-component-tabs-background-selected-v24-1-0);
|
|
94
|
+
--magritte-ui-text-color-override:var(--magritte-color-component-tabs-text-selected-v24-1-0);
|
|
95
95
|
}
|
|
96
|
-
.magritte-tab_primary___3Of2H_7-0-
|
|
97
|
-
color:var(--magritte-color-component-tabs-text-selected-v24-0
|
|
96
|
+
.magritte-tab_primary___3Of2H_7-0-29.magritte-tab_selected___w9PT2_7-0-29 .magritte-tab-label___nFmge_7-0-29{
|
|
97
|
+
color:var(--magritte-color-component-tabs-text-selected-v24-1-0);
|
|
98
98
|
}
|
|
99
|
-
.magritte-tab_primary___3Of2H_7-0-
|
|
100
|
-
color:var(--magritte-color-component-tabs-postfix-text-selected-v24-0
|
|
99
|
+
.magritte-tab_primary___3Of2H_7-0-29.magritte-tab_selected___w9PT2_7-0-29 .magritte-postfix___30ZxD_7-0-29{
|
|
100
|
+
color:var(--magritte-color-component-tabs-postfix-text-selected-v24-1-0);
|
|
101
101
|
}
|
|
102
|
-
.magritte-tab_primary___3Of2H_7-0-
|
|
103
|
-
background-color:var(--magritte-color-component-tabs-background-selected-v24-0
|
|
102
|
+
.magritte-tab_primary___3Of2H_7-0-29.magritte-tab_selected___w9PT2_7-0-29:active{
|
|
103
|
+
background-color:var(--magritte-color-component-tabs-background-selected-v24-1-0);
|
|
104
104
|
}
|
|
105
|
-
.magritte-tab_primary___3Of2H_7-0-
|
|
106
|
-
background-color:var(--magritte-color-component-tabs-background-state-selected-focused-v24-0
|
|
107
|
-
outline:4px solid var(--magritte-color-component-tabs-stroke-state-focused-accessible-v24-0
|
|
105
|
+
.magritte-tab_primary___3Of2H_7-0-29.magritte-tab_selected___w9PT2_7-0-29.focus-visible{
|
|
106
|
+
background-color:var(--magritte-color-component-tabs-background-state-selected-focused-v24-1-0);
|
|
107
|
+
outline:4px solid var(--magritte-color-component-tabs-stroke-state-focused-accessible-v24-1-0);
|
|
108
108
|
}
|
|
109
109
|
@media (min-width: 1020px){
|
|
110
|
-
body.magritte-old-layout .magritte-tab_primary___3Of2H_7-0-
|
|
111
|
-
background-color:var(--magritte-color-component-tabs-background-selected-v24-0
|
|
110
|
+
body.magritte-old-layout .magritte-tab_primary___3Of2H_7-0-29.magritte-tab_selected___w9PT2_7-0-29:hover:not(:active){
|
|
111
|
+
background-color:var(--magritte-color-component-tabs-background-selected-v24-1-0);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
@media (min-width: 1024px){
|
|
115
|
-
body:not(.magritte-old-layout) .magritte-tab_primary___3Of2H_7-0-
|
|
116
|
-
background-color:var(--magritte-color-component-tabs-background-selected-v24-0
|
|
115
|
+
body:not(.magritte-old-layout) .magritte-tab_primary___3Of2H_7-0-29.magritte-tab_selected___w9PT2_7-0-29:hover:not(:active){
|
|
116
|
+
background-color:var(--magritte-color-component-tabs-background-selected-v24-1-0);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
.magritte-tab_primary___3Of2H_7-0-
|
|
119
|
+
.magritte-tab_primary___3Of2H_7-0-29 .magritte-tab-content___onvTJ_7-0-29{
|
|
120
120
|
padding:8px 16px;
|
|
121
121
|
}
|
|
122
|
-
.magritte-tab_primary___3Of2H_7-0-
|
|
123
|
-
color:var(--magritte-color-component-tabs-text-unselected-v24-0
|
|
122
|
+
.magritte-tab_primary___3Of2H_7-0-29 .magritte-tab-label___nFmge_7-0-29{
|
|
123
|
+
color:var(--magritte-color-component-tabs-text-unselected-v24-1-0);
|
|
124
124
|
}
|
|
125
|
-
.magritte-tab_primary___3Of2H_7-0-
|
|
126
|
-
color:var(--magritte-color-component-tabs-postfix-text-unselected-v24-0
|
|
125
|
+
.magritte-tab_primary___3Of2H_7-0-29 .magritte-postfix___30ZxD_7-0-29{
|
|
126
|
+
color:var(--magritte-color-component-tabs-postfix-text-unselected-v24-1-0);
|
|
127
127
|
}
|
|
128
128
|
@media (min-width: 1020px){
|
|
129
|
-
body.magritte-old-layout .magritte-tab_primary___3Of2H_7-0-
|
|
130
|
-
background-color:var(--magritte-color-component-tabs-background-state-unselected-hovered-v24-0
|
|
129
|
+
body.magritte-old-layout .magritte-tab_primary___3Of2H_7-0-29:hover:not(:active){
|
|
130
|
+
background-color:var(--magritte-color-component-tabs-background-state-unselected-hovered-v24-1-0);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
@media (min-width: 1024px){
|
|
134
|
-
body:not(.magritte-old-layout) .magritte-tab_primary___3Of2H_7-0-
|
|
135
|
-
background-color:var(--magritte-color-component-tabs-background-state-unselected-hovered-v24-0
|
|
134
|
+
body:not(.magritte-old-layout) .magritte-tab_primary___3Of2H_7-0-29:hover:not(:active){
|
|
135
|
+
background-color:var(--magritte-color-component-tabs-background-state-unselected-hovered-v24-1-0);
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
-
.magritte-tab-wrapper_secondary___avLln_7-0-
|
|
138
|
+
.magritte-tab-wrapper_secondary___avLln_7-0-29{
|
|
139
139
|
margin-right:24px;
|
|
140
140
|
}
|
|
141
|
-
.magritte-tab_secondary___-00LL_7-0-
|
|
141
|
+
.magritte-tab_secondary___-00LL_7-0-29{
|
|
142
142
|
border-radius:12px;
|
|
143
143
|
max-width:288px;
|
|
144
|
-
--magritte-ui-text-color-override:var(--magritte-color-component-secondary-tabs-text-unselected-v24-0
|
|
144
|
+
--magritte-ui-text-color-override:var(--magritte-color-component-secondary-tabs-text-unselected-v24-1-0);
|
|
145
145
|
}
|
|
146
|
-
.magritte-tab_secondary___-00LL_7-0-
|
|
147
|
-
--magritte-ui-text-color-override:var(--magritte-color-component-secondary-tabs-text-state-unselected-pressed-v24-0
|
|
146
|
+
.magritte-tab_secondary___-00LL_7-0-29:active{
|
|
147
|
+
--magritte-ui-text-color-override:var(--magritte-color-component-secondary-tabs-text-state-unselected-pressed-v24-1-0);
|
|
148
148
|
}
|
|
149
|
-
.magritte-tab_secondary___-00LL_7-0-
|
|
150
|
-
color:var(--magritte-color-component-secondary-tabs-text-state-unselected-pressed-v24-0
|
|
149
|
+
.magritte-tab_secondary___-00LL_7-0-29:active .magritte-tab-label___nFmge_7-0-29{
|
|
150
|
+
color:var(--magritte-color-component-secondary-tabs-text-state-unselected-pressed-v24-1-0);
|
|
151
151
|
}
|
|
152
|
-
.magritte-tab_secondary___-00LL_7-0-
|
|
153
|
-
outline:4px solid var(--magritte-color-component-secondary-tabs-stroke-state-focused-accessible-v24-0
|
|
152
|
+
.magritte-tab_secondary___-00LL_7-0-29.focus-visible{
|
|
153
|
+
outline:4px solid var(--magritte-color-component-secondary-tabs-stroke-state-focused-accessible-v24-1-0);
|
|
154
154
|
}
|
|
155
|
-
.magritte-tab_secondary___-00LL_7-0-
|
|
156
|
-
--magritte-ui-text-color-override:var(--magritte-color-component-secondary-tabs-text-selected-v24-0
|
|
155
|
+
.magritte-tab_secondary___-00LL_7-0-29.magritte-tab_selected___w9PT2_7-0-29{
|
|
156
|
+
--magritte-ui-text-color-override:var(--magritte-color-component-secondary-tabs-text-selected-v24-1-0);
|
|
157
157
|
}
|
|
158
|
-
.magritte-tab_secondary___-00LL_7-0-
|
|
159
|
-
color:var(--magritte-color-component-secondary-tabs-text-selected-v24-0
|
|
158
|
+
.magritte-tab_secondary___-00LL_7-0-29.magritte-tab_selected___w9PT2_7-0-29 .magritte-tab-label___nFmge_7-0-29{
|
|
159
|
+
color:var(--magritte-color-component-secondary-tabs-text-selected-v24-1-0);
|
|
160
160
|
}
|
|
161
|
-
.magritte-tab_secondary___-00LL_7-0-
|
|
162
|
-
color:var(--magritte-color-component-secondary-tabs-postfix-text-selected-v24-0
|
|
161
|
+
.magritte-tab_secondary___-00LL_7-0-29.magritte-tab_selected___w9PT2_7-0-29 .magritte-postfix___30ZxD_7-0-29{
|
|
162
|
+
color:var(--magritte-color-component-secondary-tabs-postfix-text-selected-v24-1-0);
|
|
163
163
|
}
|
|
164
|
-
.magritte-tab_secondary___-00LL_7-0-
|
|
165
|
-
--magritte-ui-text-color-override:var(--magritte-color-component-secondary-tabs-text-selected-v24-0
|
|
164
|
+
.magritte-tab_secondary___-00LL_7-0-29.magritte-tab_selected___w9PT2_7-0-29:active{
|
|
165
|
+
--magritte-ui-text-color-override:var(--magritte-color-component-secondary-tabs-text-selected-v24-1-0);
|
|
166
166
|
}
|
|
167
|
-
.magritte-tab_secondary___-00LL_7-0-
|
|
168
|
-
color:var(--magritte-color-component-secondary-tabs-text-selected-v24-0
|
|
167
|
+
.magritte-tab_secondary___-00LL_7-0-29.magritte-tab_selected___w9PT2_7-0-29:active .magritte-tab-label___nFmge_7-0-29{
|
|
168
|
+
color:var(--magritte-color-component-secondary-tabs-text-selected-v24-1-0);
|
|
169
169
|
}
|
|
170
|
-
.magritte-tab_secondary___-00LL_7-0-
|
|
171
|
-
outline:4px solid var(--magritte-color-component-secondary-tabs-stroke-state-focused-accessible-v24-0
|
|
170
|
+
.magritte-tab_secondary___-00LL_7-0-29.magritte-tab_selected___w9PT2_7-0-29.focus-visible{
|
|
171
|
+
outline:4px solid var(--magritte-color-component-secondary-tabs-stroke-state-focused-accessible-v24-1-0);
|
|
172
172
|
}
|
|
173
173
|
@media (min-width: 1020px){
|
|
174
|
-
body.magritte-old-layout .magritte-tab_secondary___-00LL_7-0-
|
|
175
|
-
--magritte-ui-text-color-override:var(--magritte-color-component-secondary-tabs-text-selected-v24-0
|
|
174
|
+
body.magritte-old-layout .magritte-tab_secondary___-00LL_7-0-29.magritte-tab_selected___w9PT2_7-0-29:hover:not(:active){
|
|
175
|
+
--magritte-ui-text-color-override:var(--magritte-color-component-secondary-tabs-text-selected-v24-1-0);
|
|
176
176
|
}
|
|
177
|
-
body.magritte-old-layout .magritte-tab_secondary___-00LL_7-0-
|
|
178
|
-
color:var(--magritte-color-component-secondary-tabs-text-selected-v24-0
|
|
177
|
+
body.magritte-old-layout .magritte-tab_secondary___-00LL_7-0-29.magritte-tab_selected___w9PT2_7-0-29:hover:not(:active) .magritte-tab-label___nFmge_7-0-29{
|
|
178
|
+
color:var(--magritte-color-component-secondary-tabs-text-selected-v24-1-0);
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
@media (min-width: 1024px){
|
|
182
|
-
body:not(.magritte-old-layout) .magritte-tab_secondary___-00LL_7-0-
|
|
183
|
-
--magritte-ui-text-color-override:var(--magritte-color-component-secondary-tabs-text-selected-v24-0
|
|
182
|
+
body:not(.magritte-old-layout) .magritte-tab_secondary___-00LL_7-0-29.magritte-tab_selected___w9PT2_7-0-29:hover:not(:active){
|
|
183
|
+
--magritte-ui-text-color-override:var(--magritte-color-component-secondary-tabs-text-selected-v24-1-0);
|
|
184
184
|
}
|
|
185
|
-
body:not(.magritte-old-layout) .magritte-tab_secondary___-00LL_7-0-
|
|
186
|
-
color:var(--magritte-color-component-secondary-tabs-text-selected-v24-0
|
|
185
|
+
body:not(.magritte-old-layout) .magritte-tab_secondary___-00LL_7-0-29.magritte-tab_selected___w9PT2_7-0-29:hover:not(:active) .magritte-tab-label___nFmge_7-0-29{
|
|
186
|
+
color:var(--magritte-color-component-secondary-tabs-text-selected-v24-1-0);
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
.magritte-tab_secondary___-00LL_7-0-
|
|
189
|
+
.magritte-tab_secondary___-00LL_7-0-29 .magritte-tab-content___onvTJ_7-0-29{
|
|
190
190
|
padding:16px 0;
|
|
191
191
|
}
|
|
192
|
-
.magritte-tab_secondary___-00LL_7-0-
|
|
193
|
-
color:var(--magritte-color-component-secondary-tabs-text-unselected-v24-0
|
|
192
|
+
.magritte-tab_secondary___-00LL_7-0-29 .magritte-tab-label___nFmge_7-0-29{
|
|
193
|
+
color:var(--magritte-color-component-secondary-tabs-text-unselected-v24-1-0);
|
|
194
194
|
}
|
|
195
|
-
.magritte-tab_secondary___-00LL_7-0-
|
|
196
|
-
color:var(--magritte-color-component-secondary-tabs-postfix-text-unselected-v24-0
|
|
195
|
+
.magritte-tab_secondary___-00LL_7-0-29 .magritte-postfix___30ZxD_7-0-29{
|
|
196
|
+
color:var(--magritte-color-component-secondary-tabs-postfix-text-unselected-v24-1-0);
|
|
197
197
|
}
|
|
198
198
|
@media (min-width: 1020px){
|
|
199
|
-
body.magritte-old-layout .magritte-tab_secondary___-00LL_7-0-
|
|
200
|
-
--magritte-ui-text-color-override:var(--magritte-color-component-secondary-tabs-text-state-unselected-hovered-v24-0
|
|
199
|
+
body.magritte-old-layout .magritte-tab_secondary___-00LL_7-0-29:hover:not(:active){
|
|
200
|
+
--magritte-ui-text-color-override:var(--magritte-color-component-secondary-tabs-text-state-unselected-hovered-v24-1-0);
|
|
201
201
|
}
|
|
202
|
-
body.magritte-old-layout .magritte-tab_secondary___-00LL_7-0-
|
|
203
|
-
color:var(--magritte-color-component-secondary-tabs-text-state-unselected-hovered-v24-0
|
|
202
|
+
body.magritte-old-layout .magritte-tab_secondary___-00LL_7-0-29:hover:not(:active) .magritte-tab-label___nFmge_7-0-29{
|
|
203
|
+
color:var(--magritte-color-component-secondary-tabs-text-state-unselected-hovered-v24-1-0);
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
@media (min-width: 1024px){
|
|
207
|
-
body:not(.magritte-old-layout) .magritte-tab_secondary___-00LL_7-0-
|
|
208
|
-
--magritte-ui-text-color-override:var(--magritte-color-component-secondary-tabs-text-state-unselected-hovered-v24-0
|
|
207
|
+
body:not(.magritte-old-layout) .magritte-tab_secondary___-00LL_7-0-29:hover:not(:active){
|
|
208
|
+
--magritte-ui-text-color-override:var(--magritte-color-component-secondary-tabs-text-state-unselected-hovered-v24-1-0);
|
|
209
209
|
}
|
|
210
|
-
body:not(.magritte-old-layout) .magritte-tab_secondary___-00LL_7-0-
|
|
211
|
-
color:var(--magritte-color-component-secondary-tabs-text-state-unselected-hovered-v24-0
|
|
210
|
+
body:not(.magritte-old-layout) .magritte-tab_secondary___-00LL_7-0-29:hover:not(:active) .magritte-tab-label___nFmge_7-0-29{
|
|
211
|
+
color:var(--magritte-color-component-secondary-tabs-text-state-unselected-hovered-v24-1-0);
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
.magritte-tab-content___onvTJ_7-0-
|
|
214
|
+
.magritte-tab-content___onvTJ_7-0-29{
|
|
215
215
|
display:flex;
|
|
216
216
|
align-items:center;
|
|
217
217
|
height:24px;
|
|
218
218
|
}
|
|
219
|
-
.magritte-tab-label___nFmge_7-0-
|
|
219
|
+
.magritte-tab-label___nFmge_7-0-29{
|
|
220
220
|
flex:0 1 auto;
|
|
221
221
|
min-width:0;
|
|
222
222
|
overflow:hidden;
|
|
223
223
|
text-overflow:ellipsis;
|
|
224
224
|
white-space:pre;
|
|
225
225
|
}
|
|
226
|
-
.magritte-postfix-wrapper___1dORq_7-0-
|
|
226
|
+
.magritte-postfix-wrapper___1dORq_7-0-29{
|
|
227
227
|
flex:0 0 auto;
|
|
228
228
|
min-width:0;
|
|
229
229
|
max-width:100%;
|
|
@@ -232,16 +232,16 @@
|
|
|
232
232
|
text-overflow:ellipsis;
|
|
233
233
|
white-space:pre;
|
|
234
234
|
}
|
|
235
|
-
.magritte-indicator-wrapper___Q68i7_7-0-
|
|
235
|
+
.magritte-indicator-wrapper___Q68i7_7-0-29{
|
|
236
236
|
margin-top:-4px;
|
|
237
237
|
}
|
|
238
|
-
.magritte-indicator___irp4W_7-0-
|
|
238
|
+
.magritte-indicator___irp4W_7-0-29{
|
|
239
239
|
position:relative;
|
|
240
|
-
background-color:var(--magritte-color-component-secondary-tabs-indicator-selected-v24-0
|
|
240
|
+
background-color:var(--magritte-color-component-secondary-tabs-indicator-selected-v24-1-0);
|
|
241
241
|
border-radius:4px 4px 0 0;
|
|
242
242
|
height:4px;
|
|
243
243
|
width:0;
|
|
244
244
|
}
|
|
245
|
-
.magritte-animate___5GxTP_7-0-
|
|
246
|
-
transition:all var(--magritte-semantic-animation-ease-in-out-tiger-200-duration-v24-0
|
|
245
|
+
.magritte-animate___5GxTP_7-0-29{
|
|
246
|
+
transition:all var(--magritte-semantic-animation-ease-in-out-tiger-200-duration-v24-1-0) var(--magritte-semantic-animation-ease-in-out-tiger-200-timing-function-v24-1-0);
|
|
247
247
|
}
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hh.ru/magritte-ui-tabs",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.29",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"@hh.ru/magritte-common-focus-visible": "0.1.9",
|
|
23
23
|
"@hh.ru/magritte-common-keyboard": "4.1.4",
|
|
24
24
|
"@hh.ru/magritte-common-use-multiple-refs": "1.1.10",
|
|
25
|
-
"@hh.ru/magritte-design-tokens": "24.0
|
|
25
|
+
"@hh.ru/magritte-design-tokens": "24.1.0",
|
|
26
26
|
"@hh.ru/magritte-types": "5.0.5",
|
|
27
|
-
"@hh.ru/magritte-ui-badge": "3.3.
|
|
27
|
+
"@hh.ru/magritte-ui-badge": "3.3.4",
|
|
28
28
|
"@hh.ru/magritte-ui-breakpoint": "6.0.2",
|
|
29
|
-
"@hh.ru/magritte-ui-button": "
|
|
30
|
-
"@hh.ru/magritte-ui-scrollable-container": "5.2.
|
|
31
|
-
"@hh.ru/magritte-ui-tooltip": "10.1.
|
|
32
|
-
"@hh.ru/magritte-ui-typography": "4.3.
|
|
29
|
+
"@hh.ru/magritte-ui-button": "7.0.0",
|
|
30
|
+
"@hh.ru/magritte-ui-scrollable-container": "5.2.47",
|
|
31
|
+
"@hh.ru/magritte-ui-tooltip": "10.1.12",
|
|
32
|
+
"@hh.ru/magritte-ui-typography": "4.3.3"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"classnames": ">=2.3.2",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "bcc47002e5afb62cdb3f71fee209867b84407086"
|
|
42
42
|
}
|
package/useTabs.js
CHANGED
|
@@ -2,7 +2,7 @@ import './index.css';
|
|
|
2
2
|
import { useState, useRef, useMemo, useCallback, Children, useEffect, isValidElement } from 'react';
|
|
3
3
|
import { keyboardMatch, keyboardKeys, keyboardMatches } from '@hh.ru/magritte-common-keyboard';
|
|
4
4
|
import { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';
|
|
5
|
-
import { s as styles, T as Tab } from './Tab-
|
|
5
|
+
import { s as styles, T as Tab } from './Tab-m4sRBbyf.js';
|
|
6
6
|
import 'react/jsx-runtime';
|
|
7
7
|
import 'classnames';
|
|
8
8
|
import '@hh.ru/magritte-common-focus-visible';
|