@alfalab/core-components-tabs 8.5.2 → 8.6.0
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/collapsible/index.js +0 -19
- package/components/primary-tablist/Component.collapsible.d.ts +1 -1
- package/components/primary-tablist/Component.collapsible.js +5 -12
- package/components/primary-tablist/Component.d.ts +1 -1
- package/components/primary-tablist/Component.desktop.js +1 -16
- package/components/primary-tablist/Component.js +4 -11
- package/components/primary-tablist/Component.mobile.d.ts +1 -1
- package/components/primary-tablist/Component.mobile.js +3 -22
- package/components/primary-tablist/Component.responsive.js +0 -17
- package/components/primary-tablist/index.css +288 -30
- package/components/primary-tablist/mobile.css +499 -33
- package/components/scroll-controls/Component.d.ts +1 -0
- package/components/scroll-controls/Component.js +7 -7
- package/components/scroll-controls/index.css +23 -26
- package/components/scroll-controls/index.js +0 -8
- package/components/scrollable-container/Component.d.ts +5 -1
- package/components/scrollable-container/Component.js +3 -9
- package/components/scrollable-container/index.css +6 -6
- package/components/scrollable-container/index.js +0 -10
- package/components/secondary-tablist/Component.desktop.js +1 -13
- package/components/secondary-tablist/Component.js +0 -9
- package/components/secondary-tablist/Component.mobile.js +2 -13
- package/components/secondary-tablist/Component.responsive.js +0 -16
- package/components/secondary-tablist/index.css +11 -11
- package/components/secondary-tablist/mobile.css +13 -13
- package/components/tab/Component.js +1 -1
- package/components/tab/index.css +3 -3
- package/components/tab/index.js +0 -2
- package/components/tabs/Component.collapsible.js +0 -15
- package/components/tabs/Component.d.ts +1 -1
- package/components/tabs/Component.desktop.js +0 -20
- package/components/tabs/Component.js +2 -2
- package/components/tabs/Component.mobile.js +0 -20
- package/components/tabs/Component.responsive.js +0 -26
- package/components/title/index.js +0 -3
- package/cssm/collapsible/index.js +0 -20
- package/cssm/components/primary-tablist/Component.collapsible.d.ts +1 -1
- package/cssm/components/primary-tablist/Component.collapsible.js +4 -11
- package/cssm/components/primary-tablist/Component.d.ts +1 -1
- package/cssm/components/primary-tablist/Component.desktop.js +0 -17
- package/cssm/components/primary-tablist/Component.js +4 -13
- package/cssm/components/primary-tablist/Component.mobile.d.ts +1 -1
- package/cssm/components/primary-tablist/Component.mobile.js +1 -22
- package/cssm/components/primary-tablist/Component.responsive.js +0 -20
- package/cssm/components/primary-tablist/index.module.css +259 -1
- package/cssm/components/primary-tablist/mobile.module.css +210 -0
- package/cssm/components/primary-tablist/text-styles.module.css +16 -0
- package/cssm/components/scroll-controls/Component.d.ts +1 -0
- package/cssm/components/scroll-controls/Component.js +6 -6
- package/cssm/components/scroll-controls/index.js +0 -9
- package/cssm/components/scroll-controls/index.module.css +12 -15
- package/cssm/components/scrollable-container/Component.d.ts +5 -1
- package/cssm/components/scrollable-container/Component.js +2 -9
- package/cssm/components/scrollable-container/index.js +0 -12
- package/cssm/components/secondary-tablist/Component.desktop.js +0 -14
- package/cssm/components/secondary-tablist/Component.js +0 -11
- package/cssm/components/secondary-tablist/Component.mobile.js +0 -13
- package/cssm/components/secondary-tablist/Component.responsive.js +0 -19
- package/cssm/components/tab/index.js +0 -3
- package/cssm/components/tabs/Component.collapsible.js +0 -15
- package/cssm/components/tabs/Component.d.ts +1 -1
- package/cssm/components/tabs/Component.desktop.js +0 -22
- package/cssm/components/tabs/Component.js +2 -2
- package/cssm/components/tabs/Component.mobile.js +0 -24
- package/cssm/components/tabs/Component.responsive.js +0 -30
- package/cssm/components/title/index.js +0 -3
- package/cssm/desktop/index.js +0 -26
- package/cssm/hooks/use-tablist-titles.js +0 -4
- package/cssm/index.js +0 -34
- package/cssm/mobile/index.js +0 -28
- package/cssm/shared/index.js +0 -16
- package/cssm/typings.d.ts +5 -1
- package/desktop/index.js +0 -23
- package/esm/collapsible/index.js +0 -19
- package/esm/components/primary-tablist/Component.collapsible.d.ts +1 -1
- package/esm/components/primary-tablist/Component.collapsible.js +5 -12
- package/esm/components/primary-tablist/Component.d.ts +1 -1
- package/esm/components/primary-tablist/Component.desktop.js +1 -16
- package/esm/components/primary-tablist/Component.js +4 -11
- package/esm/components/primary-tablist/Component.mobile.d.ts +1 -1
- package/esm/components/primary-tablist/Component.mobile.js +4 -22
- package/esm/components/primary-tablist/Component.responsive.js +0 -17
- package/esm/components/primary-tablist/index.css +288 -30
- package/esm/components/primary-tablist/mobile.css +499 -33
- package/esm/components/scroll-controls/Component.d.ts +1 -0
- package/esm/components/scroll-controls/Component.js +7 -7
- package/esm/components/scroll-controls/index.css +23 -26
- package/esm/components/scroll-controls/index.js +0 -8
- package/esm/components/scrollable-container/Component.d.ts +5 -1
- package/esm/components/scrollable-container/Component.js +3 -9
- package/esm/components/scrollable-container/index.css +6 -6
- package/esm/components/scrollable-container/index.js +0 -10
- package/esm/components/secondary-tablist/Component.desktop.js +1 -13
- package/esm/components/secondary-tablist/Component.js +0 -9
- package/esm/components/secondary-tablist/Component.mobile.js +2 -13
- package/esm/components/secondary-tablist/Component.responsive.js +0 -16
- package/esm/components/secondary-tablist/index.css +11 -11
- package/esm/components/secondary-tablist/mobile.css +13 -13
- package/esm/components/tab/Component.js +1 -1
- package/esm/components/tab/index.css +3 -3
- package/esm/components/tab/index.js +0 -2
- package/esm/components/tabs/Component.collapsible.js +0 -15
- package/esm/components/tabs/Component.d.ts +1 -1
- package/esm/components/tabs/Component.desktop.js +0 -20
- package/esm/components/tabs/Component.js +2 -2
- package/esm/components/tabs/Component.mobile.js +0 -20
- package/esm/components/tabs/Component.responsive.js +0 -26
- package/esm/components/title/index.js +0 -3
- package/esm/desktop/index.js +0 -23
- package/esm/hooks/use-tablist-titles.js +0 -4
- package/esm/index.js +0 -29
- package/esm/index.module-09631eda.js +4 -0
- package/esm/index.module-b24b51c6.js +4 -0
- package/esm/mobile/index.js +0 -23
- package/esm/shared/index.js +0 -14
- package/esm/typings.d.ts +5 -1
- package/hooks/use-tablist-titles.js +0 -4
- package/index.js +0 -29
- package/index.module-8583a636.js +6 -0
- package/index.module-fe7d33d0.js +6 -0
- package/mobile/index.js +0 -23
- package/modern/collapsible/index.js +0 -18
- package/modern/components/primary-tablist/Component.collapsible.d.ts +1 -1
- package/modern/components/primary-tablist/Component.collapsible.js +5 -12
- package/modern/components/primary-tablist/Component.d.ts +1 -1
- package/modern/components/primary-tablist/Component.desktop.js +1 -16
- package/modern/components/primary-tablist/Component.js +4 -11
- package/modern/components/primary-tablist/Component.mobile.d.ts +1 -1
- package/modern/components/primary-tablist/Component.mobile.js +3 -18
- package/modern/components/primary-tablist/Component.responsive.js +0 -17
- package/modern/components/primary-tablist/index.css +288 -30
- package/modern/components/primary-tablist/mobile.css +499 -33
- package/modern/components/scroll-controls/Component.d.ts +1 -0
- package/modern/components/scroll-controls/Component.js +7 -7
- package/modern/components/scroll-controls/index.css +23 -26
- package/modern/components/scroll-controls/index.js +0 -7
- package/modern/components/scrollable-container/Component.d.ts +5 -1
- package/modern/components/scrollable-container/Component.js +3 -8
- package/modern/components/scrollable-container/index.css +6 -6
- package/modern/components/scrollable-container/index.js +0 -9
- package/modern/components/secondary-tablist/Component.desktop.js +1 -13
- package/modern/components/secondary-tablist/Component.js +0 -9
- package/modern/components/secondary-tablist/Component.mobile.js +2 -13
- package/modern/components/secondary-tablist/Component.responsive.js +0 -16
- package/modern/components/secondary-tablist/index.css +11 -11
- package/modern/components/secondary-tablist/mobile.css +13 -13
- package/modern/components/tab/Component.js +1 -1
- package/modern/components/tab/index.css +3 -3
- package/modern/components/tab/index.js +0 -2
- package/modern/components/tabs/Component.collapsible.js +0 -15
- package/modern/components/tabs/Component.d.ts +1 -1
- package/modern/components/tabs/Component.desktop.js +0 -20
- package/modern/components/tabs/Component.js +2 -2
- package/modern/components/tabs/Component.mobile.js +0 -20
- package/modern/components/tabs/Component.responsive.js +0 -26
- package/modern/components/title/index.js +0 -2
- package/modern/desktop/index.js +0 -22
- package/modern/hooks/use-tablist-titles.js +0 -4
- package/modern/index.js +0 -28
- package/modern/index.module-819ff0ab.js +4 -0
- package/modern/index.module-ee14bf5a.js +4 -0
- package/modern/mobile/index.js +0 -22
- package/modern/shared/index.js +0 -13
- package/modern/typings.d.ts +5 -1
- package/package.json +4 -4
- package/shared/index.js +0 -14
- package/src/components/primary-tablist/Component.collapsible.tsx +12 -3
- package/src/components/primary-tablist/Component.mobile.tsx +2 -8
- package/src/components/primary-tablist/Component.tsx +10 -3
- package/src/components/primary-tablist/index.module.css +6 -0
- package/src/components/primary-tablist/mobile.module.css +4 -0
- package/src/components/primary-tablist/text-styles.module.css +228 -0
- package/src/components/scroll-controls/Component.tsx +15 -8
- package/src/components/scroll-controls/index.module.css +12 -19
- package/src/components/scrollable-container/Component.tsx +7 -0
- package/src/components/tabs/Component.tsx +2 -0
- package/src/typings.ts +25 -0
- package/typings.d.ts +5 -1
- package/esm/index.module-1e961bec.js +0 -4
- package/esm/index.module-b07a0a20.js +0 -4
- package/index.module-6c875fed.js +0 -6
- package/index.module-dcd338c3.js +0 -6
- package/modern/index.module-11a3c51b.js +0 -4
- package/modern/index.module-b0eb0617.js +0 -4
package/modern/index.js
CHANGED
|
@@ -2,31 +2,3 @@ export { PrimaryTabListResponsive } from './components/primary-tablist/Component
|
|
|
2
2
|
export { SecondaryTabListResponsive } from './components/secondary-tablist/Component.responsive.js';
|
|
3
3
|
export { Tab } from './components/tab/Component.js';
|
|
4
4
|
export { TabsResponsive as Tabs } from './components/tabs/Component.responsive.js';
|
|
5
|
-
import 'react';
|
|
6
|
-
import '@alfalab/core-components-mq/modern';
|
|
7
|
-
import './components/primary-tablist/Component.desktop.js';
|
|
8
|
-
import './components/primary-tablist/Component.js';
|
|
9
|
-
import '@juggle/resize-observer';
|
|
10
|
-
import 'classnames';
|
|
11
|
-
import '@alfalab/core-components-keyboard-focusable/modern';
|
|
12
|
-
import '@alfalab/core-components-shared/modern';
|
|
13
|
-
import './hooks/use-tabs.js';
|
|
14
|
-
import 'react-merge-refs';
|
|
15
|
-
import './components/scrollable-container/Component.js';
|
|
16
|
-
import 'compute-scroll-into-view';
|
|
17
|
-
import './components/scroll-controls/Component.js';
|
|
18
|
-
import 'lodash.debounce';
|
|
19
|
-
import '@alfalab/core-components-icon-button/modern';
|
|
20
|
-
import '@alfalab/icons-glyph/ChevronLeftMIcon';
|
|
21
|
-
import '@alfalab/icons-glyph/ChevronRightMIcon';
|
|
22
|
-
import './components/scroll-controls/utils.js';
|
|
23
|
-
import './components/title/Component.js';
|
|
24
|
-
import './index.module-b0eb0617.js';
|
|
25
|
-
import './components/primary-tablist/Component.mobile.js';
|
|
26
|
-
import './components/secondary-tablist/Component.desktop.js';
|
|
27
|
-
import '@alfalab/core-components-tag/modern/desktop';
|
|
28
|
-
import './components/secondary-tablist/Component.js';
|
|
29
|
-
import './index.module-11a3c51b.js';
|
|
30
|
-
import './components/secondary-tablist/Component.mobile.js';
|
|
31
|
-
import '@alfalab/core-components-tag/modern/mobile';
|
|
32
|
-
import './components/tabs/Component.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const commonStyles = {"component":"tabs__component_12vn9","fullWidthScroll":"tabs__fullWidthScroll_12vn9","container":"tabs__container_12vn9","title":"tabs__title_12vn9","xxs":"tabs__xxs_12vn9","xs":"tabs__xs_12vn9","s":"tabs__s_12vn9","m":"tabs__m_12vn9","l":"tabs__l_12vn9","xl":"tabs__xl_12vn9"};
|
|
2
|
+
require('./components/secondary-tablist/index.css')
|
|
3
|
+
|
|
4
|
+
export { commonStyles as c };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const styles = {"component":"tabs__component_ravim","desktop":"tabs__desktop_ravim","paragraph-primary-large":"tabs__paragraph-primary-large_ravim","title":"tabs__title_ravim","paragraph-primary-medium":"tabs__paragraph-primary-medium_ravim","paragraph-primary-small":"tabs__paragraph-primary-small_ravim","action-primary-large":"tabs__action-primary-large_ravim","action-primary-medium":"tabs__action-primary-medium_ravim","action-primary-small":"tabs__action-primary-small_ravim","accent-primary-large":"tabs__accent-primary-large_ravim","accent-primary-medium":"tabs__accent-primary-medium_ravim","accent-primary-small":"tabs__accent-primary-small_ravim","pickerWrapper":"tabs__pickerWrapper_ravim","option":"tabs__option_ravim","scrollControls":"tabs__scrollControls_ravim","headline-system-xlarge":"tabs__headline-system-xlarge_ravim","headline-system-large":"tabs__headline-system-large_ravim","headline-system-medium":"tabs__headline-system-medium_ravim","headline-system-small":"tabs__headline-system-small_ravim","headline-system-xsmall":"tabs__headline-system-xsmall_ravim","headline-xlarge":"tabs__headline-xlarge_ravim","headline-large":"tabs__headline-large_ravim","headline-medium":"tabs__headline-medium_ravim","headline-small":"tabs__headline-small_ravim","headline-xsmall":"tabs__headline-xsmall_ravim","fullWidthScroll":"tabs__fullWidthScroll_ravim","container":"tabs__container_ravim","disabled":"tabs__disabled_ravim","focused":"tabs__focused_ravim","collapsed":"tabs__collapsed_ravim","selected":"tabs__selected_ravim","line":"tabs__line_ravim","s":"tabs__s_ravim","xs":"tabs__xs_ravim","xxs":"tabs__xxs_ravim","m":"tabs__m_ravim","l":"tabs__l_ravim","xl":"tabs__xl_ravim","rightAddons":"tabs__rightAddons_ravim"};
|
|
2
|
+
require('./components/primary-tablist/index.css')
|
|
3
|
+
|
|
4
|
+
export { styles as s };
|
package/modern/mobile/index.js
CHANGED
|
@@ -2,25 +2,3 @@ export { PrimaryTabListMobile } from '../components/primary-tablist/Component.mo
|
|
|
2
2
|
export { SecondaryTabListMobile } from '../components/secondary-tablist/Component.mobile.js';
|
|
3
3
|
export { Tab } from '../components/tab/Component.js';
|
|
4
4
|
export { TabsMobile } from '../components/tabs/Component.mobile.js';
|
|
5
|
-
import 'react';
|
|
6
|
-
import 'classnames';
|
|
7
|
-
import '../components/primary-tablist/Component.js';
|
|
8
|
-
import '@juggle/resize-observer';
|
|
9
|
-
import '@alfalab/core-components-keyboard-focusable/modern';
|
|
10
|
-
import '@alfalab/core-components-shared/modern';
|
|
11
|
-
import '../hooks/use-tabs.js';
|
|
12
|
-
import 'react-merge-refs';
|
|
13
|
-
import '../components/scrollable-container/Component.js';
|
|
14
|
-
import 'compute-scroll-into-view';
|
|
15
|
-
import '../components/scroll-controls/Component.js';
|
|
16
|
-
import 'lodash.debounce';
|
|
17
|
-
import '@alfalab/core-components-icon-button/modern';
|
|
18
|
-
import '@alfalab/icons-glyph/ChevronLeftMIcon';
|
|
19
|
-
import '@alfalab/icons-glyph/ChevronRightMIcon';
|
|
20
|
-
import '../components/scroll-controls/utils.js';
|
|
21
|
-
import '../components/title/Component.js';
|
|
22
|
-
import '../index.module-b0eb0617.js';
|
|
23
|
-
import '@alfalab/core-components-tag/modern/mobile';
|
|
24
|
-
import '../components/secondary-tablist/Component.js';
|
|
25
|
-
import '../index.module-11a3c51b.js';
|
|
26
|
-
import '../components/tabs/Component.js';
|
package/modern/shared/index.js
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
1
|
export { ScrollableContainer } from '../components/scrollable-container/Component.js';
|
|
2
2
|
export { useTabs } from '../hooks/use-tabs.js';
|
|
3
3
|
export { useCollapsibleElements } from '../hooks/use-collapsible-elements.js';
|
|
4
|
-
import 'react';
|
|
5
|
-
import 'classnames';
|
|
6
|
-
import 'compute-scroll-into-view';
|
|
7
|
-
import '../components/scroll-controls/Component.js';
|
|
8
|
-
import 'lodash.debounce';
|
|
9
|
-
import '@alfalab/core-components-icon-button/modern';
|
|
10
|
-
import '@alfalab/icons-glyph/ChevronLeftMIcon';
|
|
11
|
-
import '@alfalab/icons-glyph/ChevronRightMIcon';
|
|
12
|
-
import '../components/scroll-controls/utils.js';
|
|
13
|
-
import 'react-merge-refs';
|
|
14
|
-
import '@alfalab/core-components-shared/modern';
|
|
15
|
-
import '@juggle/resize-observer';
|
|
16
|
-
import '@alfalab/hooks';
|
package/modern/typings.d.ts
CHANGED
|
@@ -22,6 +22,10 @@ type TabsProps = {
|
|
|
22
22
|
* Внешний вид заголовков табов
|
|
23
23
|
*/
|
|
24
24
|
view?: 'primary' | 'secondary';
|
|
25
|
+
/**
|
|
26
|
+
* Стиль текста. Имеет приоритет над size. Работает только в primary табах.
|
|
27
|
+
*/
|
|
28
|
+
textStyle?: 'paragraph-primary-large' | 'paragraph-primary-medium' | 'paragraph-primary-small' | 'action-primary-large' | 'action-primary-medium' | 'action-primary-small' | 'accent-primary-large' | 'accent-primary-medium' | 'accent-primary-small' | 'headline-system-xlarge' | 'headline-system-large' | 'headline-system-medium' | 'headline-system-small' | 'headline-system-xsmall' | 'headline-xlarge' | 'headline-large' | 'headline-medium' | 'headline-small' | 'headline-xsmall';
|
|
25
29
|
/**
|
|
26
30
|
* Высота заголовков табов
|
|
27
31
|
*/
|
|
@@ -136,7 +140,7 @@ type TabListTitle = {
|
|
|
136
140
|
dataTestId?: string;
|
|
137
141
|
toggleRef?: Ref<HTMLDivElement>;
|
|
138
142
|
};
|
|
139
|
-
type TabListProps = Pick<TabsProps, 'className' | 'containerClassName' | 'size' | 'defaultMatchMediaValue' | 'selectedId' | 'scrollable' | 'collapsedTabsIds' | 'onChange' | 'dataTestId' | 'fullWidthScroll' | 'tagShape' | 'tagView'> & {
|
|
143
|
+
type TabListProps = Pick<TabsProps, 'className' | 'containerClassName' | 'size' | 'defaultMatchMediaValue' | 'selectedId' | 'scrollable' | 'collapsedTabsIds' | 'onChange' | 'dataTestId' | 'fullWidthScroll' | 'tagShape' | 'tagView' | 'textStyle'> & {
|
|
140
144
|
/**
|
|
141
145
|
* Заголовки табов
|
|
142
146
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-tabs",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.6.0",
|
|
4
4
|
"description": "Tabs components",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@alfalab/core-components-keyboard-focusable": "^4.1.0",
|
|
18
|
-
"@alfalab/core-components-tag": "^8.0
|
|
19
|
-
"@alfalab/core-components-picker-button": "^11.5.
|
|
18
|
+
"@alfalab/core-components-tag": "^8.1.0",
|
|
19
|
+
"@alfalab/core-components-picker-button": "^11.5.3",
|
|
20
20
|
"@alfalab/core-components-badge": "^5.5.1",
|
|
21
21
|
"@alfalab/core-components-mq": "^4.2.0",
|
|
22
22
|
"@alfalab/hooks": "^1.13.0",
|
|
23
23
|
"@alfalab/core-components-shared": "^0.9.1",
|
|
24
|
-
"@alfalab/core-components-icon-button": "^6.5.
|
|
24
|
+
"@alfalab/core-components-icon-button": "^6.5.2",
|
|
25
25
|
"@alfalab/icons-glyph": "^2.139.0",
|
|
26
26
|
"classnames": "^2.3.1",
|
|
27
27
|
"compute-scroll-into-view": "^3.1.0",
|
package/shared/index.js
CHANGED
|
@@ -5,20 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var components_scrollableContainer_Component = require('../components/scrollable-container/Component.js');
|
|
6
6
|
var hooks_useTabs = require('../hooks/use-tabs.js');
|
|
7
7
|
var hooks_useCollapsibleElements = require('../hooks/use-collapsible-elements.js');
|
|
8
|
-
require('react');
|
|
9
|
-
require('classnames');
|
|
10
|
-
require('compute-scroll-into-view');
|
|
11
|
-
require('../components/scroll-controls/Component.js');
|
|
12
|
-
require('tslib');
|
|
13
|
-
require('lodash.debounce');
|
|
14
|
-
require('@alfalab/core-components-icon-button');
|
|
15
|
-
require('@alfalab/icons-glyph/ChevronLeftMIcon');
|
|
16
|
-
require('@alfalab/icons-glyph/ChevronRightMIcon');
|
|
17
|
-
require('../components/scroll-controls/utils.js');
|
|
18
|
-
require('react-merge-refs');
|
|
19
|
-
require('@alfalab/core-components-shared');
|
|
20
|
-
require('@juggle/resize-observer');
|
|
21
|
-
require('@alfalab/hooks');
|
|
22
8
|
|
|
23
9
|
|
|
24
10
|
|
|
@@ -27,6 +27,7 @@ export const CollapsiblePrimaryTabList = ({
|
|
|
27
27
|
dataTestId,
|
|
28
28
|
breakpoint = 1024,
|
|
29
29
|
defaultMatchMediaValue,
|
|
30
|
+
textStyle,
|
|
30
31
|
}: TabListProps) => {
|
|
31
32
|
const lineRef = useRef<HTMLDivElement>(null);
|
|
32
33
|
|
|
@@ -92,7 +93,7 @@ export const CollapsiblePrimaryTabList = ({
|
|
|
92
93
|
<div
|
|
93
94
|
role='tablist'
|
|
94
95
|
data-test-id={dataTestId}
|
|
95
|
-
className={cn(styles.component, className, size && styles[size], {
|
|
96
|
+
className={cn(styles.component, className, !textStyle && size && styles[size], {
|
|
96
97
|
[styles.fullWidthScroll]: fullWidthScroll,
|
|
97
98
|
})}
|
|
98
99
|
>
|
|
@@ -113,7 +114,7 @@ export const CollapsiblePrimaryTabList = ({
|
|
|
113
114
|
<span ref={addonRef} role='menu' className={styles.pickerWrapper}>
|
|
114
115
|
<PickerButtonDesktop
|
|
115
116
|
fieldClassName={styles.title}
|
|
116
|
-
optionClassName={cn(
|
|
117
|
+
optionClassName={cn(size && styles[size])}
|
|
117
118
|
options={collapsedOptions}
|
|
118
119
|
onChange={handleOptionsChange}
|
|
119
120
|
rightAddons={
|
|
@@ -134,7 +135,15 @@ export const CollapsiblePrimaryTabList = ({
|
|
|
134
135
|
);
|
|
135
136
|
|
|
136
137
|
return (
|
|
137
|
-
<div
|
|
138
|
+
<div
|
|
139
|
+
ref={containerRef}
|
|
140
|
+
className={cn(
|
|
141
|
+
styles.container,
|
|
142
|
+
textStyle && styles[textStyle],
|
|
143
|
+
styles.desktop,
|
|
144
|
+
containerClassName,
|
|
145
|
+
)}
|
|
146
|
+
>
|
|
138
147
|
{renderContent()}
|
|
139
148
|
</div>
|
|
140
149
|
);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import cn from 'classnames';
|
|
3
2
|
|
|
4
3
|
import { TabListProps } from '../../typings';
|
|
5
4
|
|
|
@@ -15,11 +14,6 @@ const styles = {
|
|
|
15
14
|
|
|
16
15
|
export type PrimaryTabListMobileProps = Omit<TabListProps, 'size' | 'collapsedTabsIds'>;
|
|
17
16
|
|
|
18
|
-
export const PrimaryTabListMobile = (
|
|
19
|
-
<PrimaryTabList
|
|
20
|
-
{...restProps}
|
|
21
|
-
styles={styles}
|
|
22
|
-
className={cn(className, styles.mobile)}
|
|
23
|
-
platform='mobile'
|
|
24
|
-
/>
|
|
17
|
+
export const PrimaryTabListMobile = (props: PrimaryTabListMobileProps) => (
|
|
18
|
+
<PrimaryTabList {...props} styles={styles} platform='mobile' />
|
|
25
19
|
);
|
|
@@ -22,6 +22,7 @@ export const PrimaryTabList = ({
|
|
|
22
22
|
onChange,
|
|
23
23
|
dataTestId,
|
|
24
24
|
platform,
|
|
25
|
+
textStyle,
|
|
25
26
|
}: TabListProps & Styles & PlatformProps) => {
|
|
26
27
|
const lineRef = useRef<HTMLDivElement>(null);
|
|
27
28
|
|
|
@@ -55,7 +56,7 @@ export const PrimaryTabList = ({
|
|
|
55
56
|
<div
|
|
56
57
|
role='tablist'
|
|
57
58
|
data-test-id={dataTestId}
|
|
58
|
-
className={cn(styles.component, className, size && styles[size], {
|
|
59
|
+
className={cn(styles.component, className, !textStyle && size && styles[size], {
|
|
59
60
|
[styles.fullWidthScroll]: fullWidthScroll,
|
|
60
61
|
})}
|
|
61
62
|
>
|
|
@@ -76,18 +77,24 @@ export const PrimaryTabList = ({
|
|
|
76
77
|
</div>
|
|
77
78
|
);
|
|
78
79
|
|
|
80
|
+
const wrapperClassName = cn(textStyle && styles[textStyle], styles[platform]);
|
|
81
|
+
|
|
79
82
|
return scrollable ? (
|
|
80
83
|
<ScrollableContainer
|
|
84
|
+
containerWrapperClassName={wrapperClassName}
|
|
81
85
|
activeChild={focusedTab || selectedTab}
|
|
82
86
|
containerClassName={containerClassName}
|
|
87
|
+
scrollControlsClassName={cn(textStyle && styles.scrollControls)}
|
|
83
88
|
fullWidthScroll={fullWidthScroll}
|
|
84
89
|
view='primary'
|
|
85
|
-
size={size}
|
|
90
|
+
size={textStyle ? undefined : size}
|
|
86
91
|
platform={platform}
|
|
87
92
|
>
|
|
88
93
|
{renderContent()}
|
|
89
94
|
</ScrollableContainer>
|
|
90
95
|
) : (
|
|
91
|
-
<div className={cn(styles.container, containerClassName)}>
|
|
96
|
+
<div className={cn(styles.container, wrapperClassName, containerClassName)}>
|
|
97
|
+
{renderContent()}
|
|
98
|
+
</div>
|
|
92
99
|
);
|
|
93
100
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@import '@alfalab/core-components-themes/src/default.css';
|
|
2
2
|
@import '../../vars.css';
|
|
3
|
+
@import './text-styles.module.css';
|
|
3
4
|
|
|
4
5
|
.component {
|
|
5
6
|
position: relative;
|
|
@@ -17,6 +18,11 @@
|
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
|
|
21
|
+
.desktop {
|
|
22
|
+
@mixin text-style;
|
|
23
|
+
@mixin text-style-desktop;
|
|
24
|
+
}
|
|
25
|
+
|
|
20
26
|
.fullWidthScroll {
|
|
21
27
|
min-width: calc(100% - 2 * var(--gap-m));
|
|
22
28
|
margin: 0 var(--gap-m);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@import '@alfalab/core-components-themes/src/default.css';
|
|
2
2
|
@import '../../vars.css';
|
|
3
|
+
@import './text-styles.module.css';
|
|
3
4
|
|
|
4
5
|
.title {
|
|
5
6
|
composes: title from 'index.module.css';
|
|
@@ -17,4 +18,7 @@
|
|
|
17
18
|
margin-left: var(--primary-tablist-mobile-gaps);
|
|
18
19
|
}
|
|
19
20
|
}
|
|
21
|
+
|
|
22
|
+
@mixin text-style;
|
|
23
|
+
@mixin text-style-mobile;
|
|
20
24
|
}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
@import '@alfalab/core-components-themes/src/default.css';
|
|
2
|
+
|
|
3
|
+
@define-mixin element_styles $lh {
|
|
4
|
+
& .title {
|
|
5
|
+
padding-bottom: calc($lh / 2);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
& .title + .title,
|
|
9
|
+
& .pickerWrapper {
|
|
10
|
+
margin-left: $lh;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
& .option {
|
|
14
|
+
padding: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
& .scrollControls {
|
|
18
|
+
& > button {
|
|
19
|
+
box-sizing: content-box;
|
|
20
|
+
width: $lh;
|
|
21
|
+
height: $lh;
|
|
22
|
+
padding: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
& button:first-child {
|
|
26
|
+
margin: 0 0 0 calc($lh / 2);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@define-mixin text-style {
|
|
32
|
+
&.paragraph-primary-large .title {
|
|
33
|
+
@mixin paragraph_primary_large;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&.paragraph-primary-medium .title {
|
|
37
|
+
@mixin paragraph_primary_medium;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&.paragraph-primary-small .title {
|
|
41
|
+
@mixin paragraph_primary_small;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&.action-primary-large .title {
|
|
45
|
+
@mixin action_primary_large;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&.action-primary-medium .title {
|
|
49
|
+
@mixin action_primary_medium;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&.action-primary-small .title {
|
|
53
|
+
@mixin action_primary_small;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&.accent-primary-large .title {
|
|
57
|
+
@mixin accent_primary_large;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&.accent-primary-medium .title {
|
|
61
|
+
@mixin accent_primary_medium;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&.accent-primary-small .title {
|
|
65
|
+
@mixin accent_primary_small;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&.paragraph-primary-large,
|
|
69
|
+
&.paragraph-primary-medium,
|
|
70
|
+
&.accent-primary-large,
|
|
71
|
+
&.accent-primary-medium,
|
|
72
|
+
&.action-primary-large,
|
|
73
|
+
&.action-primary-medium {
|
|
74
|
+
@mixin element_styles 24px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&.paragraph-primary-small,
|
|
78
|
+
&.accent-primary-small,
|
|
79
|
+
&.action-primary-small {
|
|
80
|
+
@mixin element_styles 20px;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@define-mixin text-style-desktop {
|
|
85
|
+
&.headline-system-xlarge .title {
|
|
86
|
+
@mixin headline-system_xlarge;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&.headline-system-large .title {
|
|
90
|
+
@mixin headline-system_large;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&.headline-system-medium .title {
|
|
94
|
+
@mixin headline-system_medium;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&.headline-system-small .title {
|
|
98
|
+
@mixin headline-system_small;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&.headline-system-xsmall .title {
|
|
102
|
+
@mixin headline-system_xsmall;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&.headline-xlarge .title {
|
|
106
|
+
@mixin headline_xlarge;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&.headline-large .title {
|
|
110
|
+
@mixin headline_large;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&.headline-medium .title {
|
|
114
|
+
@mixin headline_medium;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&.headline-small .title {
|
|
118
|
+
@mixin headline_small;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&.headline-xsmall .title {
|
|
122
|
+
@mixin headline_xsmall;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&.headline-system-xlarge {
|
|
126
|
+
@mixin element_styles 52px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&.headline-system-large,
|
|
130
|
+
&.headline-large {
|
|
131
|
+
@mixin element_styles 48px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&.headline-system-medium {
|
|
135
|
+
@mixin element_styles 36px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&.headline-system-small {
|
|
139
|
+
@mixin element_styles 26px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&.headline-system-xsmall {
|
|
143
|
+
@mixin element_styles 22px;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
&.headline-xlarge {
|
|
147
|
+
@mixin element_styles 64px;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
&.headline-medium {
|
|
151
|
+
@mixin element_styles 40px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&.headline-small {
|
|
155
|
+
@mixin element_styles 32px;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&.headline-xsmall {
|
|
159
|
+
@mixin element_styles 24px;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
@define-mixin text-style-mobile {
|
|
164
|
+
&.headline-system-xlarge .title {
|
|
165
|
+
@mixin headline-system-mobile_xlarge;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&.headline-system-large .title {
|
|
169
|
+
@mixin headline-system-mobile_large;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
&.headline-system-medium .title {
|
|
173
|
+
@mixin headline-system-mobile_medium;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
&.headline-system-small .title {
|
|
177
|
+
@mixin headline-system-mobile_small;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&.headline-system-xsmall .title {
|
|
181
|
+
@mixin headline-system-mobile_xsmall;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
&.headline-xlarge .title {
|
|
185
|
+
@mixin headline-mobile_xlarge;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
&.headline-large .title {
|
|
189
|
+
@mixin headline-mobile_large;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
&.headline-medium .title {
|
|
193
|
+
@mixin headline-mobile_medium;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
&.headline-small .title {
|
|
197
|
+
@mixin headline-mobile_small;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
&.headline-xsmall .title {
|
|
201
|
+
@mixin headline-mobile_xsmall;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
&.headline-system-xlarge,
|
|
205
|
+
&.headline-xlarge {
|
|
206
|
+
@mixin element_styles 40px;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
&.headline-system-large,
|
|
210
|
+
&.headline-large {
|
|
211
|
+
@mixin element_styles 36px;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
&.headline-system-medium,
|
|
215
|
+
&.headline-medium {
|
|
216
|
+
@mixin element_styles 32px;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
&.headline-system-small,
|
|
220
|
+
&.headline-small {
|
|
221
|
+
@mixin element_styles 28px;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
&.headline-system-xsmall,
|
|
225
|
+
&.headline-xsmall {
|
|
226
|
+
@mixin element_styles 20px;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
@@ -3,8 +3,8 @@ import cn from 'classnames';
|
|
|
3
3
|
import _debounce from 'lodash.debounce';
|
|
4
4
|
|
|
5
5
|
import { IconButton } from '@alfalab/core-components-icon-button';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { ChevronLeftCompactSIcon } from '@alfalab/icons-glyph/ChevronLeftCompactSIcon';
|
|
7
|
+
import { ChevronRightCompactSIcon } from '@alfalab/icons-glyph/ChevronRightCompactSIcon';
|
|
8
8
|
|
|
9
9
|
import { TabsProps } from '../../typings';
|
|
10
10
|
|
|
@@ -13,13 +13,14 @@ import { getDisabledState, scrollIntoFirstTab, scrollIntoLastTab } from './utils
|
|
|
13
13
|
import styles from './index.module.css';
|
|
14
14
|
|
|
15
15
|
type ScrollControlsProps = {
|
|
16
|
+
className?: string;
|
|
16
17
|
view: Exclude<TabsProps['view'], undefined>;
|
|
17
18
|
size: TabsProps['size'];
|
|
18
19
|
containerRef: RefObject<HTMLDivElement>;
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
export const ScrollControls = forwardRef<HTMLDivElement, ScrollControlsProps>(
|
|
22
|
-
({ containerRef, view, size: sizeProp }, ref) => {
|
|
23
|
+
({ containerRef, view, size: sizeProp, className }, ref) => {
|
|
23
24
|
const container = containerRef.current;
|
|
24
25
|
const [disabledState, updateDisabledState] = useState(() => getDisabledState(container));
|
|
25
26
|
|
|
@@ -56,19 +57,25 @@ export const ScrollControls = forwardRef<HTMLDivElement, ScrollControlsProps>(
|
|
|
56
57
|
return (
|
|
57
58
|
<div
|
|
58
59
|
ref={ref}
|
|
59
|
-
className={cn(
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
className={cn(
|
|
61
|
+
styles.component,
|
|
62
|
+
styles[view],
|
|
63
|
+
sizeProp && styles[sizeProp],
|
|
64
|
+
className,
|
|
65
|
+
{
|
|
66
|
+
[styles.borderVisible]: !disabledState.toRight,
|
|
67
|
+
},
|
|
68
|
+
)}
|
|
62
69
|
>
|
|
63
70
|
<IconButton
|
|
64
71
|
{...commonButtonProps}
|
|
65
|
-
icon={
|
|
72
|
+
icon={ChevronLeftCompactSIcon}
|
|
66
73
|
disabled={disabledState.toLeft}
|
|
67
74
|
onClick={handleScrollLeft}
|
|
68
75
|
/>
|
|
69
76
|
<IconButton
|
|
70
77
|
{...commonButtonProps}
|
|
71
|
-
icon={
|
|
78
|
+
icon={ChevronRightCompactSIcon}
|
|
72
79
|
disabled={disabledState.toRight}
|
|
73
80
|
onClick={handleScrollRight}
|
|
74
81
|
/>
|
|
@@ -5,21 +5,6 @@
|
|
|
5
5
|
position: relative;
|
|
6
6
|
display: flex;
|
|
7
7
|
flex-shrink: 0;
|
|
8
|
-
|
|
9
|
-
&:before {
|
|
10
|
-
content: '';
|
|
11
|
-
display: block;
|
|
12
|
-
position: absolute;
|
|
13
|
-
top: 0;
|
|
14
|
-
left: 0;
|
|
15
|
-
width: 1px;
|
|
16
|
-
background-color: transparent;
|
|
17
|
-
transition: background-color 0.3s ease;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.borderVisible:before {
|
|
22
|
-
background-color: var(--color-light-neutral-translucent-300);
|
|
23
8
|
}
|
|
24
9
|
|
|
25
10
|
.primary {
|
|
@@ -36,10 +21,6 @@
|
|
|
36
21
|
background-color: var(--primary-tablist-bottom-border-color);
|
|
37
22
|
}
|
|
38
23
|
|
|
39
|
-
&:before {
|
|
40
|
-
bottom: 2px;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
24
|
.button:first-child {
|
|
44
25
|
padding-left: var(--gap-xs);
|
|
45
26
|
margin-right: var(--gap-xs);
|
|
@@ -55,6 +36,14 @@
|
|
|
55
36
|
justify-content: center;
|
|
56
37
|
|
|
57
38
|
&:before {
|
|
39
|
+
content: '';
|
|
40
|
+
display: block;
|
|
41
|
+
position: absolute;
|
|
42
|
+
top: 0;
|
|
43
|
+
left: 0;
|
|
44
|
+
width: 1px;
|
|
45
|
+
background-color: transparent;
|
|
46
|
+
transition: background-color 0.3s ease;
|
|
58
47
|
bottom: 0;
|
|
59
48
|
}
|
|
60
49
|
|
|
@@ -66,3 +55,7 @@
|
|
|
66
55
|
}
|
|
67
56
|
}
|
|
68
57
|
}
|
|
58
|
+
|
|
59
|
+
.borderVisible:before {
|
|
60
|
+
background-color: var(--color-light-neutral-translucent-300);
|
|
61
|
+
}
|
|
@@ -23,6 +23,11 @@ export type ScrollableContainerProps = {
|
|
|
23
23
|
*/
|
|
24
24
|
containerClassName?: string;
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Дополнительный класс кнопок прокрутки
|
|
28
|
+
*/
|
|
29
|
+
scrollControlsClassName?: string;
|
|
30
|
+
|
|
26
31
|
/**
|
|
27
32
|
* Дочерние компоненты
|
|
28
33
|
*/
|
|
@@ -56,6 +61,7 @@ const isOverflown = (
|
|
|
56
61
|
export const ScrollableContainer = ({
|
|
57
62
|
containerWrapperClassName,
|
|
58
63
|
containerClassName,
|
|
64
|
+
scrollControlsClassName,
|
|
59
65
|
children,
|
|
60
66
|
activeChild,
|
|
61
67
|
fullWidthScroll,
|
|
@@ -123,6 +129,7 @@ export const ScrollableContainer = ({
|
|
|
123
129
|
</div>
|
|
124
130
|
{overflown && platform === 'desktop' ? (
|
|
125
131
|
<ScrollControls
|
|
132
|
+
className={scrollControlsClassName}
|
|
126
133
|
ref={controlsRef}
|
|
127
134
|
containerRef={containerRef}
|
|
128
135
|
view={view}
|