@alfalab/core-components-tabs 7.4.2 → 7.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/components/primary-tablist/Component.desktop.js +1 -1
- package/components/primary-tablist/Component.js +4 -1
- package/components/primary-tablist/Component.mobile.js +2 -2
- package/components/primary-tablist/Component.responsive.js +1 -1
- package/components/primary-tablist/index.css +29 -29
- package/components/primary-tablist/mobile.css +32 -32
- package/components/scrollable-container/Component.js +1 -1
- package/components/scrollable-container/index.css +5 -5
- package/components/secondary-tablist/Component.desktop.js +1 -1
- package/components/secondary-tablist/Component.mobile.js +2 -2
- package/components/secondary-tablist/Component.responsive.js +1 -1
- 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/tabs/Component.desktop.js +2 -2
- package/components/tabs/Component.js +2 -1
- package/components/tabs/Component.mobile.js +2 -2
- package/components/tabs/Component.responsive.js +2 -2
- package/cssm/components/primary-tablist/Component.js +4 -1
- package/cssm/components/tabs/Component.js +2 -1
- package/cssm/hooks/use-tablist-titles.d.ts +2 -0
- package/cssm/hooks/use-tabs.d.ts +1 -0
- package/cssm/hooks/use-tabs.js +6 -0
- package/cssm/index-3885b0d7.d.ts +2 -2
- package/cssm/typings.d.ts +1 -0
- package/desktop.js +2 -2
- package/esm/components/primary-tablist/Component.desktop.js +1 -1
- package/esm/components/primary-tablist/Component.js +5 -2
- package/esm/components/primary-tablist/Component.mobile.js +2 -2
- package/esm/components/primary-tablist/Component.responsive.js +1 -1
- package/esm/components/primary-tablist/index.css +29 -29
- package/esm/components/primary-tablist/mobile.css +32 -32
- package/esm/components/scrollable-container/Component.js +1 -1
- package/esm/components/scrollable-container/index.css +5 -5
- package/esm/components/secondary-tablist/Component.desktop.js +1 -1
- package/esm/components/secondary-tablist/Component.mobile.js +2 -2
- package/esm/components/secondary-tablist/Component.responsive.js +1 -1
- 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/tabs/Component.desktop.js +2 -2
- package/esm/components/tabs/Component.js +2 -1
- package/esm/components/tabs/Component.mobile.js +2 -2
- package/esm/components/tabs/Component.responsive.js +2 -2
- package/esm/desktop.js +2 -2
- package/esm/hooks/use-tablist-titles.d.ts +2 -0
- package/esm/hooks/use-tabs.d.ts +1 -0
- package/esm/hooks/use-tabs.js +6 -0
- package/esm/index-3885b0d7.d.ts +2 -2
- package/esm/index.js +2 -2
- package/esm/index.module-72f734ce.js +4 -0
- package/esm/index.module-bd9d6b19.js +4 -0
- package/esm/mobile.js +2 -2
- package/esm/responsive.js +2 -2
- package/esm/typings.d.ts +1 -0
- package/hooks/use-tablist-titles.d.ts +2 -0
- package/hooks/use-tabs.d.ts +1 -0
- package/hooks/use-tabs.js +6 -0
- package/index-3885b0d7.d.ts +2 -2
- package/index.js +2 -2
- package/index.module-0f7a6fdd.js +6 -0
- package/index.module-56173cf5.js +6 -0
- package/mobile.js +2 -2
- package/modern/components/primary-tablist/Component.desktop.js +1 -1
- package/modern/components/primary-tablist/Component.js +1 -1
- package/modern/components/primary-tablist/Component.mobile.js +2 -2
- package/modern/components/primary-tablist/Component.responsive.js +1 -1
- package/modern/components/primary-tablist/index.css +29 -29
- package/modern/components/primary-tablist/mobile.css +32 -32
- package/modern/components/scrollable-container/Component.js +1 -1
- package/modern/components/scrollable-container/index.css +5 -5
- package/modern/components/secondary-tablist/Component.desktop.js +1 -1
- package/modern/components/secondary-tablist/Component.mobile.js +2 -2
- package/modern/components/secondary-tablist/Component.responsive.js +1 -1
- 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/tabs/Component.desktop.js +2 -2
- package/modern/components/tabs/Component.js +2 -1
- package/modern/components/tabs/Component.mobile.js +2 -2
- package/modern/components/tabs/Component.responsive.js +2 -2
- package/modern/desktop.js +2 -2
- package/modern/hooks/use-tablist-titles.d.ts +2 -0
- package/modern/hooks/use-tabs.d.ts +1 -0
- package/modern/hooks/use-tabs.js +6 -0
- package/modern/index-3885b0d7.d.ts +2 -2
- package/modern/index.js +2 -2
- package/modern/index.module-2b4e7121.js +4 -0
- package/modern/index.module-e78fc797.js +4 -0
- package/modern/mobile.js +2 -2
- package/modern/responsive.js +2 -2
- package/modern/typings.d.ts +1 -0
- package/package.json +2 -2
- package/responsive.js +2 -2
- package/typings.d.ts +1 -0
- package/esm/index.module-ad30718b.js +0 -4
- package/esm/index.module-edd5702f.js +0 -4
- package/index.module-1aeb14d5.js +0 -6
- package/index.module-cfd2d08c.js +0 -6
- package/modern/index.module-be8fee8f.js +0 -4
- package/modern/index.module-c36d785f.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 7qqf9 */
|
|
2
2
|
:root {
|
|
3
3
|
}/* deprecated */:root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
4
4
|
}:root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -51,30 +51,30 @@
|
|
|
51
51
|
|
|
52
52
|
/* size xl */
|
|
53
53
|
--secondary-tablist-xl-gaps: var(--gap-m);
|
|
54
|
-
}.
|
|
54
|
+
}.tabs__component_p6mqe {
|
|
55
55
|
position: relative;
|
|
56
56
|
display: inline-flex;
|
|
57
|
-
}.
|
|
57
|
+
}.tabs__fullWidthScroll_p6mqe {
|
|
58
58
|
margin: 0 var(--gap-m);
|
|
59
|
-
}.
|
|
59
|
+
}.tabs__container_p6mqe {
|
|
60
60
|
overflow: hidden;
|
|
61
61
|
|
|
62
62
|
/* focus-outline fix */
|
|
63
63
|
margin: var(--gap-2xs-neg) 0 var(--gap-2xs-neg) var(--gap-2xs-neg);
|
|
64
64
|
padding: var(--gap-2xs) 0 var(--gap-2xs) var(--gap-2xs);
|
|
65
|
-
}.
|
|
65
|
+
}.tabs__title_p6mqe {
|
|
66
66
|
white-space: nowrap;
|
|
67
|
-
}/* sizes */.
|
|
67
|
+
}/* sizes */.tabs__xxs_p6mqe .tabs__title_p6mqe + .tabs__title_p6mqe {
|
|
68
68
|
margin-left: var(--secondary-tablist-xxs-gaps);
|
|
69
|
-
}.
|
|
69
|
+
}.tabs__xs_p6mqe .tabs__title_p6mqe + .tabs__title_p6mqe {
|
|
70
70
|
margin-left: var(--secondary-tablist-xs-gaps);
|
|
71
|
-
}.
|
|
71
|
+
}.tabs__s_p6mqe .tabs__title_p6mqe + .tabs__title_p6mqe {
|
|
72
72
|
margin-left: var(--secondary-tablist-s-gaps);
|
|
73
|
-
}.
|
|
73
|
+
}.tabs__m_p6mqe .tabs__title_p6mqe + .tabs__title_p6mqe {
|
|
74
74
|
margin-left: var(--secondary-tablist-m-gaps);
|
|
75
|
-
}.
|
|
75
|
+
}.tabs__l_p6mqe .tabs__title_p6mqe + .tabs__title_p6mqe {
|
|
76
76
|
margin-left: var(--secondary-tablist-l-gaps);
|
|
77
|
-
}.
|
|
77
|
+
}.tabs__xl_p6mqe .tabs__title_p6mqe + .tabs__title_p6mqe {
|
|
78
78
|
margin-left: var(--secondary-tablist-xl-gaps);
|
|
79
79
|
} :root {
|
|
80
80
|
--color-dark-indigo: #0b1f35;
|
|
@@ -963,7 +963,7 @@
|
|
|
963
963
|
|
|
964
964
|
/* size xl */
|
|
965
965
|
--secondary-tablist-xl-gaps: var(--gap-m);
|
|
966
|
-
} .
|
|
967
|
-
} .
|
|
966
|
+
} .tabs__title_2f5to {
|
|
967
|
+
} .tabs__mobile_2f5to .tabs__title_2f5to + .tabs__title_2f5to {
|
|
968
968
|
margin-left: var(--secondary-tablist-mobile-gaps);
|
|
969
969
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
|
|
4
|
-
var styles = {"component":"
|
|
4
|
+
var styles = {"component":"tabs__component_1luo8","hidden":"tabs__hidden_1luo8"};
|
|
5
5
|
require('./index.css')
|
|
6
6
|
|
|
7
7
|
var Tab = function (_a) {
|
|
@@ -17,10 +17,10 @@ import '../../synthetic-events.js';
|
|
|
17
17
|
import '../scrollable-container/Component.js';
|
|
18
18
|
import 'compute-scroll-into-view';
|
|
19
19
|
import '../title/Component.js';
|
|
20
|
-
import '../../index.module-
|
|
20
|
+
import '../../index.module-72f734ce.js';
|
|
21
21
|
import '../secondary-tablist/Component.js';
|
|
22
22
|
import '@alfalab/core-components-tag/esm';
|
|
23
|
-
import '../../index.module-
|
|
23
|
+
import '../../index.module-bd9d6b19.js';
|
|
24
24
|
|
|
25
25
|
var views = {
|
|
26
26
|
primary: PrimaryTabListDesktop,
|
|
@@ -4,7 +4,7 @@ var Tabs = function (_a) {
|
|
|
4
4
|
var TabList = _a.TabList, className = _a.className, containerClassName = _a.containerClassName, size = _a.size, defaultMatch = _a.defaultMatch, children = _a.children, selectedId = _a.selectedId, scrollable = _a.scrollable, collapsible = _a.collapsible, collapsedTabsIds = _a.collapsedTabsIds, _b = _a.fullWidthScroll, fullWidthScroll = _b === void 0 ? false : _b, _c = _a.keepMounted, keepMounted = _c === void 0 ? false : _c, dataTestId = _a.dataTestId, onChange = _a.onChange;
|
|
5
5
|
var tabsArray = React.Children.toArray(children);
|
|
6
6
|
var titles = tabsArray.map(function (_a) {
|
|
7
|
-
var _b = _a.props, title = _b.title, id = _b.id, rightAddons = _b.rightAddons, disabled = _b.disabled, hidden = _b.hidden, toggleClassName = _b.toggleClassName;
|
|
7
|
+
var _b = _a.props, title = _b.title, id = _b.id, rightAddons = _b.rightAddons, disabled = _b.disabled, hidden = _b.hidden, toggleClassName = _b.toggleClassName, toggleTestId = _b.dataTestId;
|
|
8
8
|
return ({
|
|
9
9
|
title: title,
|
|
10
10
|
id: id,
|
|
@@ -12,6 +12,7 @@ var Tabs = function (_a) {
|
|
|
12
12
|
rightAddons: rightAddons,
|
|
13
13
|
hidden: hidden,
|
|
14
14
|
toggleClassName: toggleClassName,
|
|
15
|
+
dataTestId: toggleTestId,
|
|
15
16
|
});
|
|
16
17
|
});
|
|
17
18
|
var tabs = tabsArray.filter(function (tab) { return tab.props.id === selectedId || tab.props.keepMounted || keepMounted; });
|
|
@@ -17,10 +17,10 @@ import '../../synthetic-events.js';
|
|
|
17
17
|
import '../scrollable-container/Component.js';
|
|
18
18
|
import 'compute-scroll-into-view';
|
|
19
19
|
import '../title/Component.js';
|
|
20
|
-
import '../../index.module-
|
|
20
|
+
import '../../index.module-72f734ce.js';
|
|
21
21
|
import '../secondary-tablist/Component.js';
|
|
22
22
|
import '@alfalab/core-components-tag/esm';
|
|
23
|
-
import '../../index.module-
|
|
23
|
+
import '../../index.module-bd9d6b19.js';
|
|
24
24
|
|
|
25
25
|
var views = {
|
|
26
26
|
primary: PrimaryTabListMobile,
|
|
@@ -18,12 +18,12 @@ import '../../synthetic-events.js';
|
|
|
18
18
|
import '../scrollable-container/Component.js';
|
|
19
19
|
import 'compute-scroll-into-view';
|
|
20
20
|
import '../title/Component.js';
|
|
21
|
-
import '../../index.module-
|
|
21
|
+
import '../../index.module-72f734ce.js';
|
|
22
22
|
import '../primary-tablist/Component.mobile.js';
|
|
23
23
|
import '../secondary-tablist/Component.desktop.js';
|
|
24
24
|
import '../secondary-tablist/Component.js';
|
|
25
25
|
import '@alfalab/core-components-tag/esm';
|
|
26
|
-
import '../../index.module-
|
|
26
|
+
import '../../index.module-bd9d6b19.js';
|
|
27
27
|
import '../secondary-tablist/Component.mobile.js';
|
|
28
28
|
|
|
29
29
|
var views = {
|
package/esm/desktop.js
CHANGED
|
@@ -16,10 +16,10 @@ import './hooks/use-tablist-titles.js';
|
|
|
16
16
|
import '@alfalab/hooks';
|
|
17
17
|
import './synthetic-events.js';
|
|
18
18
|
import './components/title/Component.js';
|
|
19
|
-
import './index.module-
|
|
19
|
+
import './index.module-72f734ce.js';
|
|
20
20
|
import 'compute-scroll-into-view';
|
|
21
21
|
import './components/secondary-tablist/Component.js';
|
|
22
22
|
import '@alfalab/core-components-tag/esm';
|
|
23
|
-
import './index.module-
|
|
23
|
+
import './index.module-bd9d6b19.js';
|
|
24
24
|
import './components/tabs/Component.js';
|
|
25
25
|
import '@juggle/resize-observer';
|
|
@@ -12,6 +12,7 @@ declare const useTablistTitles: ({ titles, selectedId, collapsible, collapsedTab
|
|
|
12
12
|
rightAddons?: import("react").ReactNode;
|
|
13
13
|
hidden?: boolean | undefined;
|
|
14
14
|
toggleClassName?: string | undefined;
|
|
15
|
+
dataTestId?: string | undefined;
|
|
15
16
|
}[];
|
|
16
17
|
selectedTab: HTMLButtonElement | null;
|
|
17
18
|
focusedTab: HTMLButtonElement | null;
|
|
@@ -19,6 +20,7 @@ declare const useTablistTitles: ({ titles, selectedId, collapsible, collapsedTab
|
|
|
19
20
|
role: string;
|
|
20
21
|
tabIndex: number;
|
|
21
22
|
'aria-selected': boolean;
|
|
23
|
+
'data-test-id': string | undefined;
|
|
22
24
|
disabled: boolean | undefined;
|
|
23
25
|
ref: (node: HTMLButtonElement) => void;
|
|
24
26
|
onKeyDown: (event: import("react").KeyboardEvent<HTMLButtonElement>) => void;
|
package/esm/hooks/use-tabs.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ declare function useTabs({ titles, selectedId, onChange }: UseTabsProps): {
|
|
|
5
5
|
role: string;
|
|
6
6
|
tabIndex: number;
|
|
7
7
|
'aria-selected': boolean;
|
|
8
|
+
'data-test-id': string | undefined;
|
|
8
9
|
disabled: boolean | undefined;
|
|
9
10
|
ref: (node: HTMLButtonElement) => void;
|
|
10
11
|
onKeyDown: (event: KeyboardEvent<HTMLButtonElement>) => void;
|
package/esm/hooks/use-tabs.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { useState, useRef, useCallback } from 'react';
|
|
2
2
|
|
|
3
|
+
var getDataTestId = function (dataTestId, element) {
|
|
4
|
+
var elementPart = element ? "-".concat(element.toLowerCase()) : '';
|
|
5
|
+
return dataTestId ? "".concat(dataTestId).concat(elementPart) : undefined;
|
|
6
|
+
};
|
|
7
|
+
|
|
3
8
|
function useTabs(_a) {
|
|
4
9
|
var _b = _a.titles, titles = _b === void 0 ? [] : _b, selectedId = _a.selectedId, onChange = _a.onChange;
|
|
5
10
|
var _c = useState(null), selectedTab = _c[0], setSelectedTab = _c[1];
|
|
@@ -73,6 +78,7 @@ function useTabs(_a) {
|
|
|
73
78
|
role: 'tab',
|
|
74
79
|
tabIndex: itemSelected ? 0 : -1,
|
|
75
80
|
'aria-selected': itemSelected,
|
|
81
|
+
'data-test-id': getDataTestId(item.dataTestId, 'toggle'),
|
|
76
82
|
disabled: item.disabled,
|
|
77
83
|
ref: function (node) {
|
|
78
84
|
// eslint-disable-next-line no-param-reassign
|
package/esm/index-3885b0d7.d.ts
CHANGED
package/esm/index.js
CHANGED
|
@@ -18,12 +18,12 @@ import './hooks/use-collapsible-elements.js';
|
|
|
18
18
|
import '@juggle/resize-observer';
|
|
19
19
|
import './synthetic-events.js';
|
|
20
20
|
import './components/title/Component.js';
|
|
21
|
-
import './index.module-
|
|
21
|
+
import './index.module-72f734ce.js';
|
|
22
22
|
import './components/primary-tablist/Component.mobile.js';
|
|
23
23
|
import 'compute-scroll-into-view';
|
|
24
24
|
import './components/secondary-tablist/Component.desktop.js';
|
|
25
25
|
import './components/secondary-tablist/Component.js';
|
|
26
26
|
import '@alfalab/core-components-tag/esm';
|
|
27
|
-
import './index.module-
|
|
27
|
+
import './index.module-bd9d6b19.js';
|
|
28
28
|
import './components/secondary-tablist/Component.mobile.js';
|
|
29
29
|
import './components/tabs/Component.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var commonStyles = {"component":"tabs__component_929ww","fullWidthScroll":"tabs__fullWidthScroll_929ww","container":"tabs__container_929ww","title":"tabs__title_929ww","disabled":"tabs__disabled_929ww","focused":"tabs__focused_929ww","collapsed":"tabs__collapsed_929ww","selected":"tabs__selected_929ww","line":"tabs__line_929ww","s":"tabs__s_929ww","xs":"tabs__xs_929ww","xxs":"tabs__xxs_929ww","pickerWrapper":"tabs__pickerWrapper_929ww","option":"tabs__option_929ww","m":"tabs__m_929ww","l":"tabs__l_929ww","xl":"tabs__xl_929ww","rightAddons":"tabs__rightAddons_929ww"};
|
|
2
|
+
require('./components/primary-tablist/index.css')
|
|
3
|
+
|
|
4
|
+
export { commonStyles as c };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var commonStyles = {"component":"tabs__component_p6mqe","fullWidthScroll":"tabs__fullWidthScroll_p6mqe","container":"tabs__container_p6mqe","title":"tabs__title_p6mqe","xxs":"tabs__xxs_p6mqe","xs":"tabs__xs_p6mqe","s":"tabs__s_p6mqe","m":"tabs__m_p6mqe","l":"tabs__l_p6mqe","xl":"tabs__xl_p6mqe"};
|
|
2
|
+
require('./components/secondary-tablist/index.css')
|
|
3
|
+
|
|
4
|
+
export { commonStyles as c };
|
package/esm/mobile.js
CHANGED
|
@@ -17,9 +17,9 @@ import './hooks/use-collapsible-elements.js';
|
|
|
17
17
|
import '@juggle/resize-observer';
|
|
18
18
|
import './synthetic-events.js';
|
|
19
19
|
import './components/title/Component.js';
|
|
20
|
-
import './index.module-
|
|
20
|
+
import './index.module-72f734ce.js';
|
|
21
21
|
import 'compute-scroll-into-view';
|
|
22
22
|
import './components/secondary-tablist/Component.js';
|
|
23
23
|
import '@alfalab/core-components-tag/esm';
|
|
24
|
-
import './index.module-
|
|
24
|
+
import './index.module-bd9d6b19.js';
|
|
25
25
|
import './components/tabs/Component.js';
|
package/esm/responsive.js
CHANGED
|
@@ -17,13 +17,13 @@ import '@alfalab/core-components-picker-button/esm/desktop';
|
|
|
17
17
|
import './hooks/use-tablist-titles.js';
|
|
18
18
|
import './synthetic-events.js';
|
|
19
19
|
import './components/title/Component.js';
|
|
20
|
-
import './index.module-
|
|
20
|
+
import './index.module-72f734ce.js';
|
|
21
21
|
import './components/primary-tablist/Component.mobile.js';
|
|
22
22
|
import 'compute-scroll-into-view';
|
|
23
23
|
import './components/secondary-tablist/Component.desktop.js';
|
|
24
24
|
import './components/secondary-tablist/Component.js';
|
|
25
25
|
import '@alfalab/core-components-tag/esm';
|
|
26
|
-
import './index.module-
|
|
26
|
+
import './index.module-bd9d6b19.js';
|
|
27
27
|
import './components/secondary-tablist/Component.mobile.js';
|
|
28
28
|
import './components/tabs/Component.js';
|
|
29
29
|
import '@juggle/resize-observer';
|
package/esm/typings.d.ts
CHANGED
|
@@ -121,6 +121,7 @@ type TabListTitle = {
|
|
|
121
121
|
toggleClassName?: string;
|
|
122
122
|
selected?: boolean;
|
|
123
123
|
collapsed?: boolean;
|
|
124
|
+
dataTestId?: string;
|
|
124
125
|
};
|
|
125
126
|
type TabListProps = Pick<TabsProps, 'className' | 'containerClassName' | 'size' | 'defaultMatch' | 'selectedId' | 'scrollable' | 'collapsible' | 'collapsedTabsIds' | 'onChange' | 'dataTestId' | 'fullWidthScroll'> & {
|
|
126
127
|
/**
|
|
@@ -12,6 +12,7 @@ declare const useTablistTitles: ({ titles, selectedId, collapsible, collapsedTab
|
|
|
12
12
|
rightAddons?: import("react").ReactNode;
|
|
13
13
|
hidden?: boolean | undefined;
|
|
14
14
|
toggleClassName?: string | undefined;
|
|
15
|
+
dataTestId?: string | undefined;
|
|
15
16
|
}[];
|
|
16
17
|
selectedTab: HTMLButtonElement | null;
|
|
17
18
|
focusedTab: HTMLButtonElement | null;
|
|
@@ -19,6 +20,7 @@ declare const useTablistTitles: ({ titles, selectedId, collapsible, collapsedTab
|
|
|
19
20
|
role: string;
|
|
20
21
|
tabIndex: number;
|
|
21
22
|
'aria-selected': boolean;
|
|
23
|
+
'data-test-id': string | undefined;
|
|
22
24
|
disabled: boolean | undefined;
|
|
23
25
|
ref: (node: HTMLButtonElement) => void;
|
|
24
26
|
onKeyDown: (event: import("react").KeyboardEvent<HTMLButtonElement>) => void;
|
package/hooks/use-tabs.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ declare function useTabs({ titles, selectedId, onChange }: UseTabsProps): {
|
|
|
5
5
|
role: string;
|
|
6
6
|
tabIndex: number;
|
|
7
7
|
'aria-selected': boolean;
|
|
8
|
+
'data-test-id': string | undefined;
|
|
8
9
|
disabled: boolean | undefined;
|
|
9
10
|
ref: (node: HTMLButtonElement) => void;
|
|
10
11
|
onKeyDown: (event: KeyboardEvent<HTMLButtonElement>) => void;
|
package/hooks/use-tabs.js
CHANGED
|
@@ -4,6 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
|
|
7
|
+
var getDataTestId = function (dataTestId, element) {
|
|
8
|
+
var elementPart = element ? "-".concat(element.toLowerCase()) : '';
|
|
9
|
+
return dataTestId ? "".concat(dataTestId).concat(elementPart) : undefined;
|
|
10
|
+
};
|
|
11
|
+
|
|
7
12
|
function useTabs(_a) {
|
|
8
13
|
var _b = _a.titles, titles = _b === void 0 ? [] : _b, selectedId = _a.selectedId, onChange = _a.onChange;
|
|
9
14
|
var _c = React.useState(null), selectedTab = _c[0], setSelectedTab = _c[1];
|
|
@@ -77,6 +82,7 @@ function useTabs(_a) {
|
|
|
77
82
|
role: 'tab',
|
|
78
83
|
tabIndex: itemSelected ? 0 : -1,
|
|
79
84
|
'aria-selected': itemSelected,
|
|
85
|
+
'data-test-id': getDataTestId(item.dataTestId, 'toggle'),
|
|
80
86
|
disabled: item.disabled,
|
|
81
87
|
ref: function (node) {
|
|
82
88
|
// eslint-disable-next-line no-param-reassign
|
package/index-3885b0d7.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -22,13 +22,13 @@ require('./hooks/use-collapsible-elements.js');
|
|
|
22
22
|
require('@juggle/resize-observer');
|
|
23
23
|
require('./synthetic-events.js');
|
|
24
24
|
require('./components/title/Component.js');
|
|
25
|
-
require('./index.module-
|
|
25
|
+
require('./index.module-0f7a6fdd.js');
|
|
26
26
|
require('./components/primary-tablist/Component.mobile.js');
|
|
27
27
|
require('compute-scroll-into-view');
|
|
28
28
|
require('./components/secondary-tablist/Component.desktop.js');
|
|
29
29
|
require('./components/secondary-tablist/Component.js');
|
|
30
30
|
require('@alfalab/core-components-tag');
|
|
31
|
-
require('./index.module-
|
|
31
|
+
require('./index.module-56173cf5.js');
|
|
32
32
|
require('./components/secondary-tablist/Component.mobile.js');
|
|
33
33
|
require('./components/tabs/Component.js');
|
|
34
34
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var commonStyles = {"component":"tabs__component_929ww","fullWidthScroll":"tabs__fullWidthScroll_929ww","container":"tabs__container_929ww","title":"tabs__title_929ww","disabled":"tabs__disabled_929ww","focused":"tabs__focused_929ww","collapsed":"tabs__collapsed_929ww","selected":"tabs__selected_929ww","line":"tabs__line_929ww","s":"tabs__s_929ww","xs":"tabs__xs_929ww","xxs":"tabs__xxs_929ww","pickerWrapper":"tabs__pickerWrapper_929ww","option":"tabs__option_929ww","m":"tabs__m_929ww","l":"tabs__l_929ww","xl":"tabs__xl_929ww","rightAddons":"tabs__rightAddons_929ww"};
|
|
4
|
+
require('./components/primary-tablist/index.css')
|
|
5
|
+
|
|
6
|
+
exports.commonStyles = commonStyles;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var commonStyles = {"component":"tabs__component_p6mqe","fullWidthScroll":"tabs__fullWidthScroll_p6mqe","container":"tabs__container_p6mqe","title":"tabs__title_p6mqe","xxs":"tabs__xxs_p6mqe","xs":"tabs__xs_p6mqe","s":"tabs__s_p6mqe","m":"tabs__m_p6mqe","l":"tabs__l_p6mqe","xl":"tabs__xl_p6mqe"};
|
|
4
|
+
require('./components/secondary-tablist/index.css')
|
|
5
|
+
|
|
6
|
+
exports.commonStyles = commonStyles;
|
package/mobile.js
CHANGED
|
@@ -21,11 +21,11 @@ require('./hooks/use-collapsible-elements.js');
|
|
|
21
21
|
require('@juggle/resize-observer');
|
|
22
22
|
require('./synthetic-events.js');
|
|
23
23
|
require('./components/title/Component.js');
|
|
24
|
-
require('./index.module-
|
|
24
|
+
require('./index.module-0f7a6fdd.js');
|
|
25
25
|
require('compute-scroll-into-view');
|
|
26
26
|
require('./components/secondary-tablist/Component.js');
|
|
27
27
|
require('@alfalab/core-components-tag');
|
|
28
|
-
require('./index.module-
|
|
28
|
+
require('./index.module-56173cf5.js');
|
|
29
29
|
require('./components/tabs/Component.js');
|
|
30
30
|
|
|
31
31
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PrimaryTabList } from './Component.js';
|
|
3
|
-
import { c as commonStyles } from '../../index.module-
|
|
3
|
+
import { c as commonStyles } from '../../index.module-2b4e7121.js';
|
|
4
4
|
import 'classnames';
|
|
5
5
|
import '@alfalab/core-components-badge/modern';
|
|
6
6
|
import '@alfalab/core-components-keyboard-focusable/modern';
|
|
@@ -50,7 +50,7 @@ const PrimaryTabList = ({ size, styles = {}, className, containerClassName, titl
|
|
|
50
50
|
const renderContent = () => (React.createElement("div", { role: 'tablist', "data-test-id": dataTestId, className: cn(styles.component, className, size && styles[size], {
|
|
51
51
|
[styles.fullWidthScroll]: fullWidthScroll,
|
|
52
52
|
}) },
|
|
53
|
-
tablistTitles.map((
|
|
53
|
+
tablistTitles.map(({ dataTestId: _, ...restTitleProps }, index) => (React.createElement(KeyboardFocusable, { key: restTitleProps.id }, (ref, focused) => (React.createElement(Title, { ...getTabListItemProps(index, ref), ...restTitleProps, focused: focused, styles: styles }))))),
|
|
54
54
|
collapsedOptions.length ? (React.createElement("span", { ref: addonRef, role: 'menu', className: styles.pickerWrapper },
|
|
55
55
|
React.createElement(PickerButtonDesktop, { fieldClassName: styles.title, optionClassName: cn(styles.pickerOption, size && styles[size]), options: collapsedOptions, onChange: handleOptionsChange, rightAddons: collapsedAddonsLength ? (React.createElement(Badge, { view: 'count', content: collapsedAddonsLength })) : null, size: 'l', view: 'ghost', label: '\u0415\u0449\u0451', popoverPosition: 'bottom-end' }))) : null,
|
|
56
56
|
React.createElement("div", { className: styles.line, ref: lineRef })));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { PrimaryTabList } from './Component.js';
|
|
4
|
-
import { c as commonStyles } from '../../index.module-
|
|
4
|
+
import { c as commonStyles } from '../../index.module-2b4e7121.js';
|
|
5
5
|
import '@alfalab/core-components-badge/modern';
|
|
6
6
|
import '@alfalab/core-components-keyboard-focusable/modern';
|
|
7
7
|
import '@alfalab/core-components-picker-button/modern/desktop';
|
|
@@ -15,7 +15,7 @@ import '../scrollable-container/Component.js';
|
|
|
15
15
|
import 'compute-scroll-into-view';
|
|
16
16
|
import '../title/Component.js';
|
|
17
17
|
|
|
18
|
-
const mobileStyles = {"title":"
|
|
18
|
+
const mobileStyles = {"title":"tabs__title_1e8y8 tabs__title_929ww","mobile":"tabs__mobile_1e8y8"};
|
|
19
19
|
require('./mobile.css')
|
|
20
20
|
|
|
21
21
|
const styles = {
|
|
@@ -15,7 +15,7 @@ import '../../synthetic-events.js';
|
|
|
15
15
|
import '../scrollable-container/Component.js';
|
|
16
16
|
import 'compute-scroll-into-view';
|
|
17
17
|
import '../title/Component.js';
|
|
18
|
-
import '../../index.module-
|
|
18
|
+
import '../../index.module-2b4e7121.js';
|
|
19
19
|
|
|
20
20
|
const PrimaryTabListResponsive = ({ size, defaultMatch = 'desktop', collapsible, collapsedTabsIds, fullWidthScroll, ...restProps }) => {
|
|
21
21
|
const [view] = useMedia([
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 190gt */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-border-accent: #ef3124;
|
|
@@ -83,11 +83,11 @@
|
|
|
83
83
|
/* size l */
|
|
84
84
|
|
|
85
85
|
/* size xl */
|
|
86
|
-
} .
|
|
86
|
+
} .tabs__component_929ww {
|
|
87
87
|
position: relative;
|
|
88
88
|
display: inline-flex;
|
|
89
89
|
min-width: 100%
|
|
90
|
-
} .
|
|
90
|
+
} .tabs__component_929ww:before {
|
|
91
91
|
content: '';
|
|
92
92
|
display: block;
|
|
93
93
|
position: absolute;
|
|
@@ -95,17 +95,17 @@
|
|
|
95
95
|
height: 1px;
|
|
96
96
|
width: 100%;
|
|
97
97
|
background-color: var(--primary-tablist-bottom-border-color);
|
|
98
|
-
} .
|
|
98
|
+
} .tabs__fullWidthScroll_929ww {
|
|
99
99
|
min-width: calc(100% - 2 * var(--gap-m));
|
|
100
100
|
margin: 0 var(--gap-m);
|
|
101
|
-
} .
|
|
101
|
+
} .tabs__container_929ww {
|
|
102
102
|
position: relative;
|
|
103
103
|
overflow: hidden;
|
|
104
104
|
|
|
105
105
|
/* focus-outline fix */
|
|
106
106
|
margin: var(--gap-2xs-neg) 0 var(--gap-2xs-neg) var(--gap-2xs-neg);
|
|
107
107
|
padding: var(--gap-2xs) 0 var(--gap-2xs) var(--gap-2xs);
|
|
108
|
-
} .
|
|
108
|
+
} .tabs__title_929ww {
|
|
109
109
|
display: flex;
|
|
110
110
|
align-items: center;
|
|
111
111
|
height: 100%;
|
|
@@ -122,76 +122,76 @@
|
|
|
122
122
|
user-select: none;
|
|
123
123
|
cursor: pointer;
|
|
124
124
|
outline: none
|
|
125
|
-
} .
|
|
125
|
+
} .tabs__title_929ww:not(.tabs__disabled_929ww):hover {
|
|
126
126
|
color: var(--primary-tablist-hover-color);
|
|
127
|
-
} .
|
|
127
|
+
} .tabs__focused_929ww {
|
|
128
128
|
outline: 2px solid var(--focus-color);
|
|
129
129
|
outline-offset: 2px;
|
|
130
|
-
} .
|
|
130
|
+
} .tabs__collapsed_929ww {
|
|
131
131
|
order: 99;
|
|
132
132
|
visibility: collapse;
|
|
133
|
-
} .
|
|
133
|
+
} .tabs__selected_929ww {
|
|
134
134
|
cursor: default;
|
|
135
135
|
color: var(--primary-tablist-selected-color);
|
|
136
|
-
} .
|
|
136
|
+
} .tabs__disabled_929ww {
|
|
137
137
|
cursor: var(--disabled-cursor);
|
|
138
138
|
color: var(--primary-tablist-disabled-color);
|
|
139
|
-
} .
|
|
139
|
+
} .tabs__line_929ww {
|
|
140
140
|
position: absolute;
|
|
141
141
|
height: 3px;
|
|
142
142
|
bottom: 0;
|
|
143
143
|
left: 0;
|
|
144
144
|
background-color: var(--primary-tablist-line-color);
|
|
145
145
|
transition: transform 0.2s ease, width 0.2s ease;
|
|
146
|
-
} /* sizes */ .
|
|
146
|
+
} /* sizes */ .tabs__s_929ww .tabs__title_929ww, .tabs__xs_929ww .tabs__title_929ww, .tabs__xxs_929ww .tabs__title_929ww {
|
|
147
147
|
padding: var(--primary-tablist-s-padding);
|
|
148
148
|
font-size: var(--primary-tablist-s-font-size);
|
|
149
149
|
font-weight: var(--primary-tablist-s-font-weight);
|
|
150
150
|
font-family: var(--primary-tablist-s-font-family);
|
|
151
151
|
line-height: 24px;
|
|
152
|
-
} .
|
|
152
|
+
} .tabs__s_929ww .tabs__title_929ww + .tabs__title_929ww, .tabs__xs_929ww .tabs__title_929ww + .tabs__title_929ww, .tabs__xxs_929ww .tabs__title_929ww + .tabs__title_929ww {
|
|
153
153
|
margin-left: var(--primary-tablist-s-gaps);
|
|
154
|
-
} .
|
|
154
|
+
} .tabs__s_929ww .tabs__pickerWrapper_929ww, .tabs__xs_929ww .tabs__pickerWrapper_929ww, .tabs__xxs_929ww .tabs__pickerWrapper_929ww {
|
|
155
155
|
margin-left: var(--primary-tablist-s-gaps);
|
|
156
|
-
} .
|
|
156
|
+
} .tabs__s_929ww .tabs__option_929ww, .tabs__xs_929ww .tabs__option_929ww, .tabs__xxs_929ww .tabs__option_929ww {
|
|
157
157
|
padding: 0;
|
|
158
|
-
} .
|
|
158
|
+
} .tabs__m_929ww .tabs__title_929ww {
|
|
159
159
|
padding: var(--primary-tablist-m-padding);
|
|
160
160
|
font-size: var(--primary-tablist-m-font-size);
|
|
161
161
|
font-weight: var(--primary-tablist-m-font-weight);
|
|
162
162
|
font-family: var(--primary-tablist-m-font-family);
|
|
163
163
|
line-height: 24px;
|
|
164
|
-
} .
|
|
164
|
+
} .tabs__m_929ww .tabs__title_929ww + .tabs__title_929ww {
|
|
165
165
|
margin-left: var(--primary-tablist-m-gaps);
|
|
166
|
-
} .
|
|
166
|
+
} .tabs__m_929ww .tabs__pickerWrapper_929ww {
|
|
167
167
|
margin-left: var(--primary-tablist-m-gaps);
|
|
168
|
-
} .
|
|
168
|
+
} .tabs__m_929ww .tabs__option_929ww {
|
|
169
169
|
padding: 0;
|
|
170
|
-
} .
|
|
170
|
+
} .tabs__l_929ww .tabs__title_929ww {
|
|
171
171
|
padding: var(--primary-tablist-l-padding);
|
|
172
172
|
font-size: var(--primary-tablist-l-font-size);
|
|
173
173
|
font-weight: var(--primary-tablist-l-font-weight);
|
|
174
174
|
font-family: var(--primary-tablist-l-font-family);
|
|
175
175
|
line-height: 24px;
|
|
176
|
-
} .
|
|
176
|
+
} .tabs__l_929ww .tabs__title_929ww + .tabs__title_929ww {
|
|
177
177
|
margin-left: var(--primary-tablist-l-gaps);
|
|
178
|
-
} .
|
|
178
|
+
} .tabs__l_929ww .tabs__pickerWrapper_929ww {
|
|
179
179
|
margin-left: var(--primary-tablist-l-gaps);
|
|
180
|
-
} .
|
|
180
|
+
} .tabs__l_929ww .tabs__option_929ww {
|
|
181
181
|
padding: 0;
|
|
182
|
-
} .
|
|
182
|
+
} .tabs__xl_929ww .tabs__title_929ww {
|
|
183
183
|
padding: var(--primary-tablist-xl-padding);
|
|
184
184
|
font-size: var(--primary-tablist-xl-font-size);
|
|
185
185
|
font-weight: var(--primary-tablist-xl-font-weight);
|
|
186
186
|
font-family: var(--primary-tablist-xl-font-family);
|
|
187
187
|
line-height: 32px;
|
|
188
|
-
} .
|
|
188
|
+
} .tabs__xl_929ww .tabs__title_929ww + .tabs__title_929ww {
|
|
189
189
|
margin-left: var(--primary-tablist-xl-gaps);
|
|
190
|
-
} .
|
|
190
|
+
} .tabs__xl_929ww .tabs__pickerWrapper_929ww {
|
|
191
191
|
margin-left: var(--primary-tablist-xl-gaps);
|
|
192
|
-
} .
|
|
192
|
+
} .tabs__xl_929ww .tabs__option_929ww {
|
|
193
193
|
padding: 0;
|
|
194
|
-
} .
|
|
194
|
+
} .tabs__rightAddons_929ww {
|
|
195
195
|
display: flex;
|
|
196
196
|
justify-content: center;
|
|
197
197
|
align-items: center;
|