@alfalab/core-components-tabs 6.3.0 → 6.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/CHANGELOG.md +53 -0
- package/components/primary-tablist/Component.d.ts +6 -0
- package/{dist/components → components}/primary-tablist/Component.desktop.d.ts +0 -0
- package/{dist/components → components}/primary-tablist/Component.desktop.js +2 -2
- package/components/primary-tablist/Component.js +55 -0
- package/{dist/esm/components → components}/primary-tablist/Component.mobile.d.ts +1 -1
- package/{dist/components → components}/primary-tablist/Component.mobile.js +3 -3
- package/components/primary-tablist/Component.responsive.d.ts +4 -0
- package/{dist/components → components}/primary-tablist/Component.responsive.js +4 -4
- package/{dist/components → components}/primary-tablist/index.css +27 -21
- package/{dist/components → components}/primary-tablist/mobile.css +34 -24
- package/{dist/cssm/components → components}/scrollable-container/Component.d.ts +2 -1
- package/{dist/components → components}/scrollable-container/Component.js +14 -4
- package/{dist/components → components}/scrollable-container/index.css +11 -6
- package/{dist/components → components}/scrollable-container/index.d.ts +0 -0
- package/{dist/components → components}/scrollable-container/index.js +0 -0
- package/components/secondary-tablist/Component.d.ts +8 -0
- package/{dist/esm/components → components}/secondary-tablist/Component.desktop.d.ts +1 -1
- package/{dist/components → components}/secondary-tablist/Component.desktop.js +2 -2
- package/components/secondary-tablist/Component.js +38 -0
- package/{dist/components → components}/secondary-tablist/Component.mobile.d.ts +1 -1
- package/{dist/components → components}/secondary-tablist/Component.mobile.js +3 -3
- package/{dist/cssm/components → components}/secondary-tablist/Component.responsive.d.ts +1 -1
- package/{dist/components → components}/secondary-tablist/Component.responsive.js +4 -4
- package/{dist/components → components}/secondary-tablist/index.css +15 -14
- package/{dist/modern/components → components}/secondary-tablist/mobile.css +21 -16
- package/{dist/components → components}/tab/Component.d.ts +0 -0
- package/{dist/components → components}/tab/Component.js +1 -1
- package/components/tab/index.css +8 -0
- package/{dist/components → components}/tab/index.d.ts +0 -0
- package/{dist/components → components}/tab/index.js +0 -0
- package/components/tabs/Component.d.ts +4 -0
- package/{dist/modern/components → components}/tabs/Component.desktop.d.ts +2 -2
- package/{dist/components → components}/tabs/Component.desktop.js +3 -3
- package/{dist/cssm/components → components}/tabs/Component.js +4 -3
- package/{dist/modern/components → components}/tabs/Component.mobile.d.ts +1 -1
- package/{dist/components → components}/tabs/Component.mobile.js +3 -3
- package/{dist/components → components}/tabs/Component.responsive.d.ts +1 -1
- package/{dist/components → components}/tabs/Component.responsive.js +3 -3
- package/cssm/components/primary-tablist/Component.d.ts +6 -0
- package/{dist/cssm → cssm}/components/primary-tablist/Component.desktop.d.ts +0 -0
- package/{dist/cssm → cssm}/components/primary-tablist/Component.desktop.js +1 -1
- package/cssm/components/primary-tablist/Component.js +56 -0
- package/{dist → cssm}/components/primary-tablist/Component.mobile.d.ts +1 -1
- package/{dist/cssm → cssm}/components/primary-tablist/Component.mobile.js +1 -1
- package/cssm/components/primary-tablist/Component.responsive.d.ts +4 -0
- package/{dist/cssm → cssm}/components/primary-tablist/Component.responsive.js +3 -3
- package/{dist/cssm → cssm}/components/primary-tablist/index.module.css +8 -2
- package/{dist/cssm → cssm}/components/primary-tablist/mobile.module.css +0 -0
- package/{dist/esm → cssm}/components/scrollable-container/Component.d.ts +2 -1
- package/{dist/cssm → cssm}/components/scrollable-container/Component.js +13 -3
- package/{dist/cssm → cssm}/components/scrollable-container/index.d.ts +0 -0
- package/{dist/cssm → cssm}/components/scrollable-container/index.js +0 -0
- package/{dist/cssm → cssm}/components/scrollable-container/index.module.css +7 -2
- package/cssm/components/secondary-tablist/Component.d.ts +8 -0
- package/{dist → cssm}/components/secondary-tablist/Component.desktop.d.ts +1 -1
- package/{dist/cssm → cssm}/components/secondary-tablist/Component.desktop.js +1 -1
- package/cssm/components/secondary-tablist/Component.js +39 -0
- package/{dist/cssm → cssm}/components/secondary-tablist/Component.mobile.d.ts +1 -1
- package/{dist/cssm → cssm}/components/secondary-tablist/Component.mobile.js +1 -1
- package/{dist → cssm}/components/secondary-tablist/Component.responsive.d.ts +1 -1
- package/{dist/cssm → cssm}/components/secondary-tablist/Component.responsive.js +3 -3
- package/{dist/cssm → cssm}/components/secondary-tablist/index.module.css +5 -4
- package/{dist/cssm → cssm}/components/secondary-tablist/mobile.module.css +0 -0
- package/{dist/cssm → cssm}/components/tab/Component.d.ts +0 -0
- package/{dist/cssm → cssm}/components/tab/Component.js +0 -0
- package/{dist/cssm → cssm}/components/tab/index.d.ts +0 -0
- package/{dist/cssm → cssm}/components/tab/index.js +0 -0
- package/{dist/cssm → cssm}/components/tab/index.module.css +0 -0
- package/cssm/components/tabs/Component.d.ts +4 -0
- package/{dist/cssm → cssm}/components/tabs/Component.desktop.d.ts +1 -1
- package/{dist/cssm → cssm}/components/tabs/Component.desktop.js +2 -2
- package/{dist → cssm}/components/tabs/Component.js +4 -3
- package/{dist/cssm → cssm}/components/tabs/Component.mobile.d.ts +1 -1
- package/{dist/cssm → cssm}/components/tabs/Component.mobile.js +2 -2
- package/{dist/cssm → cssm}/components/tabs/Component.responsive.d.ts +1 -1
- package/{dist/cssm → cssm}/components/tabs/Component.responsive.js +2 -2
- package/{dist/cssm → cssm}/desktop.d.ts +0 -0
- package/{dist/cssm → cssm}/desktop.js +2 -2
- package/{dist/cssm → cssm}/index.d.ts +0 -0
- package/{dist/cssm → cssm}/index.js +2 -2
- package/{dist/cssm → cssm}/mobile.d.ts +0 -0
- package/{dist/cssm → cssm}/mobile.js +2 -2
- package/{dist/cssm → cssm}/responsive.d.ts +0 -0
- package/{dist/cssm → cssm}/responsive.js +2 -2
- package/{dist/cssm → cssm}/tslib.es6-ce870b46.d.ts +0 -0
- package/{dist/cssm → cssm}/tslib.es6-ce870b46.js +0 -0
- package/{dist/esm → cssm}/typings.d.ts +21 -11
- package/{dist/cssm → cssm}/typings.js +0 -0
- package/{dist/cssm → cssm}/useTabs.d.ts +0 -0
- package/{dist/cssm → cssm}/useTabs.js +0 -0
- package/{dist/cssm → cssm}/vars.css +0 -0
- package/{dist/desktop.d.ts → desktop.d.ts} +0 -0
- package/{dist/desktop.js → desktop.js} +3 -3
- package/esm/components/primary-tablist/Component.d.ts +6 -0
- package/{dist/esm → esm}/components/primary-tablist/Component.desktop.d.ts +0 -0
- package/{dist/esm → esm}/components/primary-tablist/Component.desktop.js +3 -3
- package/esm/components/primary-tablist/Component.js +46 -0
- package/{dist/modern → esm}/components/primary-tablist/Component.mobile.d.ts +1 -1
- package/{dist/esm → esm}/components/primary-tablist/Component.mobile.js +4 -4
- package/esm/components/primary-tablist/Component.responsive.d.ts +4 -0
- package/{dist/esm → esm}/components/primary-tablist/Component.responsive.js +5 -5
- package/{dist/modern → esm}/components/primary-tablist/index.css +27 -21
- package/{dist/modern → esm}/components/primary-tablist/mobile.css +34 -24
- package/{dist/modern → esm}/components/scrollable-container/Component.d.ts +2 -1
- package/{dist/esm → esm}/components/scrollable-container/Component.js +14 -4
- package/{dist/esm → esm}/components/scrollable-container/index.css +11 -6
- package/{dist/esm → esm}/components/scrollable-container/index.d.ts +0 -0
- package/{dist/esm → esm}/components/scrollable-container/index.js +0 -0
- package/esm/components/secondary-tablist/Component.d.ts +8 -0
- package/{dist/cssm → esm}/components/secondary-tablist/Component.desktop.d.ts +1 -1
- package/{dist/esm → esm}/components/secondary-tablist/Component.desktop.js +3 -3
- package/esm/components/secondary-tablist/Component.js +29 -0
- package/{dist/esm → esm}/components/secondary-tablist/Component.mobile.d.ts +1 -1
- package/{dist/esm → esm}/components/secondary-tablist/Component.mobile.js +4 -4
- package/{dist/esm → esm}/components/secondary-tablist/Component.responsive.d.ts +1 -1
- package/{dist/esm → esm}/components/secondary-tablist/Component.responsive.js +5 -5
- package/{dist/modern → esm}/components/secondary-tablist/index.css +15 -14
- package/{dist → esm}/components/secondary-tablist/mobile.css +21 -16
- package/{dist/esm → esm}/components/tab/Component.d.ts +0 -0
- package/{dist/esm → esm}/components/tab/Component.js +1 -1
- package/esm/components/tab/index.css +8 -0
- package/{dist/esm → esm}/components/tab/index.d.ts +0 -0
- package/{dist/esm → esm}/components/tab/index.js +0 -0
- package/esm/components/tabs/Component.d.ts +4 -0
- package/{dist → esm}/components/tabs/Component.desktop.d.ts +1 -1
- package/{dist/esm → esm}/components/tabs/Component.desktop.js +5 -5
- package/{dist/esm → esm}/components/tabs/Component.js +4 -3
- package/{dist/esm → esm}/components/tabs/Component.mobile.d.ts +1 -1
- package/{dist/esm → esm}/components/tabs/Component.mobile.js +5 -5
- package/{dist/esm → esm}/components/tabs/Component.responsive.d.ts +1 -1
- package/{dist/esm → esm}/components/tabs/Component.responsive.js +5 -5
- package/{dist/esm → esm}/desktop.d.ts +0 -0
- package/{dist/esm → esm}/desktop.js +5 -5
- package/{dist/esm → esm}/index.d.ts +0 -0
- package/{dist/esm → esm}/index.js +5 -5
- package/esm/index.module-4ce3b0dd.js +4 -0
- package/esm/index.module-71ecf1b8.js +4 -0
- package/{dist/esm → esm}/mobile.d.ts +0 -0
- package/{dist/esm → esm}/mobile.js +5 -5
- package/{dist/esm → esm}/responsive.d.ts +0 -0
- package/{dist/esm → esm}/responsive.js +5 -5
- package/{dist/esm/tslib.es6-8a4b035c.d.ts → esm/tslib.es6-656bff1b.d.ts} +0 -0
- package/{dist/esm/tslib.es6-8a4b035c.js → esm/tslib.es6-656bff1b.js} +0 -0
- package/{dist/modern → esm}/typings.d.ts +21 -11
- package/{dist/esm → esm}/typings.js +0 -0
- package/{dist/esm → esm}/useTabs.d.ts +0 -0
- package/{dist/esm → esm}/useTabs.js +0 -0
- package/{dist/index.d.ts → index.d.ts} +0 -0
- package/{dist/index.js → index.js} +3 -3
- package/index.module-0ac56b69.js +6 -0
- package/index.module-c97a2b1a.js +6 -0
- package/{dist/mobile.d.ts → mobile.d.ts} +0 -0
- package/{dist/mobile.js → mobile.js} +3 -3
- package/modern/components/primary-tablist/Component.d.ts +6 -0
- package/{dist/modern → modern}/components/primary-tablist/Component.desktop.d.ts +0 -0
- package/{dist/modern → modern}/components/primary-tablist/Component.desktop.js +2 -2
- package/{dist/modern → modern}/components/primary-tablist/Component.js +8 -6
- package/{dist/cssm → modern}/components/primary-tablist/Component.mobile.d.ts +1 -1
- package/{dist/modern → modern}/components/primary-tablist/Component.mobile.js +3 -3
- package/modern/components/primary-tablist/Component.responsive.d.ts +4 -0
- package/{dist/modern → modern}/components/primary-tablist/Component.responsive.js +4 -4
- package/{dist/esm → modern}/components/primary-tablist/index.css +27 -21
- package/{dist/esm → modern}/components/primary-tablist/mobile.css +34 -24
- package/{dist → modern}/components/scrollable-container/Component.d.ts +2 -1
- package/{dist/modern → modern}/components/scrollable-container/Component.js +13 -4
- package/{dist/modern → modern}/components/scrollable-container/index.css +11 -6
- package/{dist/modern → modern}/components/scrollable-container/index.d.ts +0 -0
- package/{dist/modern → modern}/components/scrollable-container/index.js +0 -0
- package/modern/components/secondary-tablist/Component.d.ts +8 -0
- package/{dist/modern → modern}/components/secondary-tablist/Component.desktop.d.ts +1 -1
- package/{dist/modern → modern}/components/secondary-tablist/Component.desktop.js +2 -2
- package/modern/components/secondary-tablist/Component.js +24 -0
- package/{dist/modern → modern}/components/secondary-tablist/Component.mobile.d.ts +1 -1
- package/{dist/modern → modern}/components/secondary-tablist/Component.mobile.js +3 -3
- package/{dist/modern → modern}/components/secondary-tablist/Component.responsive.d.ts +1 -1
- package/{dist/modern → modern}/components/secondary-tablist/Component.responsive.js +4 -4
- package/{dist/esm → modern}/components/secondary-tablist/index.css +15 -14
- package/{dist/esm → modern}/components/secondary-tablist/mobile.css +21 -16
- package/{dist/modern → modern}/components/tab/Component.d.ts +0 -0
- package/{dist/modern → modern}/components/tab/Component.js +1 -1
- package/modern/components/tab/index.css +8 -0
- package/{dist/modern → modern}/components/tab/index.d.ts +0 -0
- package/{dist/modern → modern}/components/tab/index.js +0 -0
- package/modern/components/tabs/Component.d.ts +4 -0
- package/{dist/esm → modern}/components/tabs/Component.desktop.d.ts +1 -1
- package/{dist/modern → modern}/components/tabs/Component.desktop.js +4 -4
- package/{dist/modern → modern}/components/tabs/Component.js +4 -3
- package/{dist → modern}/components/tabs/Component.mobile.d.ts +1 -1
- package/{dist/modern → modern}/components/tabs/Component.mobile.js +4 -4
- package/{dist/modern → modern}/components/tabs/Component.responsive.d.ts +1 -1
- package/{dist/modern → modern}/components/tabs/Component.responsive.js +4 -4
- package/{dist/modern → modern}/desktop.d.ts +0 -0
- package/{dist/modern → modern}/desktop.js +4 -4
- package/{dist/modern → modern}/index.d.ts +0 -0
- package/{dist/modern → modern}/index.js +4 -4
- package/modern/index.module-4ce3b0dd.js +4 -0
- package/modern/index.module-71ecf1b8.js +4 -0
- package/{dist/modern → modern}/mobile.d.ts +0 -0
- package/{dist/modern → modern}/mobile.js +4 -4
- package/{dist/modern → modern}/responsive.d.ts +0 -0
- package/{dist/modern → modern}/responsive.js +4 -4
- package/{dist/cssm → modern}/typings.d.ts +21 -11
- package/{dist/modern → modern}/typings.js +0 -0
- package/{dist/modern → modern}/useTabs.d.ts +0 -0
- package/{dist/modern → modern}/useTabs.js +0 -0
- package/package.json +12 -15
- package/{dist/responsive.d.ts → responsive.d.ts} +0 -0
- package/{dist/responsive.js → responsive.js} +3 -3
- package/{dist/send-stats.js → send-stats.js} +0 -0
- package/{dist/tslib.es6-394cebb0.d.ts → tslib.es6-5331b0cd.d.ts} +0 -0
- package/{dist/tslib.es6-394cebb0.js → tslib.es6-5331b0cd.js} +0 -0
- package/{dist/typings.d.ts → typings.d.ts} +21 -11
- package/{dist/typings.js → typings.js} +0 -0
- package/{dist/useTabs.d.ts → useTabs.d.ts} +0 -0
- package/{dist/useTabs.js → useTabs.js} +0 -0
- package/dist/components/primary-tablist/Component.d.ts +0 -13
- package/dist/components/primary-tablist/Component.js +0 -50
- package/dist/components/primary-tablist/Component.responsive.d.ts +0 -4
- package/dist/components/secondary-tablist/Component.d.ts +0 -15
- package/dist/components/secondary-tablist/Component.js +0 -33
- package/dist/components/tab/index.css +0 -8
- package/dist/components/tabs/Component.d.ts +0 -4
- package/dist/cssm/components/primary-tablist/Component.d.ts +0 -13
- package/dist/cssm/components/primary-tablist/Component.js +0 -51
- package/dist/cssm/components/primary-tablist/Component.responsive.d.ts +0 -4
- package/dist/cssm/components/secondary-tablist/Component.d.ts +0 -15
- package/dist/cssm/components/secondary-tablist/Component.js +0 -34
- package/dist/cssm/components/tabs/Component.d.ts +0 -4
- package/dist/esm/components/primary-tablist/Component.d.ts +0 -13
- package/dist/esm/components/primary-tablist/Component.js +0 -41
- package/dist/esm/components/primary-tablist/Component.responsive.d.ts +0 -4
- package/dist/esm/components/secondary-tablist/Component.d.ts +0 -15
- package/dist/esm/components/secondary-tablist/Component.js +0 -24
- package/dist/esm/components/tab/index.css +0 -8
- package/dist/esm/components/tabs/Component.d.ts +0 -4
- package/dist/esm/index.module-4687a3b6.js +0 -4
- package/dist/esm/index.module-4cd5c08a.js +0 -4
- package/dist/index.module-a61e7b44.js +0 -6
- package/dist/index.module-b9c824d3.js +0 -6
- package/dist/modern/components/primary-tablist/Component.d.ts +0 -13
- package/dist/modern/components/primary-tablist/Component.responsive.d.ts +0 -4
- package/dist/modern/components/secondary-tablist/Component.d.ts +0 -15
- package/dist/modern/components/secondary-tablist/Component.js +0 -20
- package/dist/modern/components/tab/index.css +0 -8
- package/dist/modern/components/tabs/Component.d.ts +0 -4
- package/dist/modern/index.module-4687a3b6.js +0 -4
- package/dist/modern/index.module-4cd5c08a.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 97vuj */
|
|
2
2
|
:root {
|
|
3
3
|
}:root {
|
|
4
4
|
}:root {
|
|
@@ -49,26 +49,26 @@
|
|
|
49
49
|
|
|
50
50
|
/* size xl */
|
|
51
51
|
--secondary-tablist-xl-gaps: var(--gap-m);
|
|
52
|
-
}.
|
|
52
|
+
}.tabs__component_1yv68 {
|
|
53
53
|
position: relative;
|
|
54
|
-
display: flex;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}.
|
|
54
|
+
display: inline-flex;
|
|
55
|
+
}.tabs__fullWidthScroll_1yv68 {
|
|
56
|
+
margin: 0 var(--gap-m);
|
|
57
|
+
}.tabs__container_1yv68 {
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
}.tabs__title_1yv68 {
|
|
60
60
|
white-space: nowrap;
|
|
61
|
-
}/* sizes */.
|
|
61
|
+
}/* sizes */.tabs__xxs_1yv68 .tabs__title_1yv68 + .tabs__title_1yv68 {
|
|
62
62
|
margin-left: var(--secondary-tablist-xxs-gaps);
|
|
63
|
-
}.
|
|
63
|
+
}.tabs__xs_1yv68 .tabs__title_1yv68 + .tabs__title_1yv68 {
|
|
64
64
|
margin-left: var(--secondary-tablist-xs-gaps);
|
|
65
|
-
}.
|
|
65
|
+
}.tabs__s_1yv68 .tabs__title_1yv68 + .tabs__title_1yv68 {
|
|
66
66
|
margin-left: var(--secondary-tablist-s-gaps);
|
|
67
|
-
}.
|
|
67
|
+
}.tabs__m_1yv68 .tabs__title_1yv68 + .tabs__title_1yv68 {
|
|
68
68
|
margin-left: var(--secondary-tablist-m-gaps);
|
|
69
|
-
}.
|
|
69
|
+
}.tabs__l_1yv68 .tabs__title_1yv68 + .tabs__title_1yv68 {
|
|
70
70
|
margin-left: var(--secondary-tablist-l-gaps);
|
|
71
|
-
}.
|
|
71
|
+
}.tabs__xl_1yv68 .tabs__title_1yv68 + .tabs__title_1yv68 {
|
|
72
72
|
margin-left: var(--secondary-tablist-xl-gaps);
|
|
73
73
|
}
|
|
74
74
|
:root {
|
|
@@ -453,7 +453,9 @@
|
|
|
453
453
|
--color-dark-border-underline-inverted-alpha-30: rgba(182, 188, 195, 0.3);
|
|
454
454
|
--color-dark-graphic-accent-alpha-30: rgba(239, 49, 36, 0.3);
|
|
455
455
|
--color-dark-graphic-accent-shade-15: rgb(203, 42, 31);
|
|
456
|
+
--color-dark-graphic-accent-tint-7: rgb(240, 63, 51);
|
|
456
457
|
--color-dark-graphic-accent-tint-10: rgb(241, 70, 58);
|
|
458
|
+
--color-dark-graphic-accent-tint-15: rgb(241, 80, 69);
|
|
457
459
|
--color-dark-graphic-accent-tint-30: rgb(244, 111, 102);
|
|
458
460
|
--color-dark-graphic-negative-alpha-30: rgba(241, 80, 69, 0.3);
|
|
459
461
|
--color-dark-graphic-negative-shade-20: rgb(193, 64, 55);
|
|
@@ -587,7 +589,9 @@
|
|
|
587
589
|
--color-light-border-underline-inverted-alpha-30: rgba(109, 121, 134, 0.3);
|
|
588
590
|
--color-light-graphic-accent-alpha-30: rgba(239, 49, 36, 0.3);
|
|
589
591
|
--color-light-graphic-accent-tint-15: rgb(241, 80, 69);
|
|
592
|
+
--color-light-graphic-accent-shade-7: rgb(222, 46, 33);
|
|
590
593
|
--color-light-graphic-accent-shade-10: rgb(215, 44, 32);
|
|
594
|
+
--color-light-graphic-accent-shade-15: rgb(203, 42, 31);
|
|
591
595
|
--color-light-graphic-accent-shade-30: rgb(167, 34, 25);
|
|
592
596
|
--color-light-graphic-negative-alpha-30: rgba(241, 80, 69, 0.3);
|
|
593
597
|
--color-light-graphic-negative-tint-20: rgb(244, 115, 106);
|
|
@@ -776,6 +780,7 @@
|
|
|
776
780
|
--border-radius-l: 12px;
|
|
777
781
|
--border-radius-xl: 16px;
|
|
778
782
|
--border-radius-xxl: 20px;
|
|
783
|
+
--border-radius-3xl: 24px;
|
|
779
784
|
--border-radius-circle: 50%;
|
|
780
785
|
--border-radius-pill: 99px;
|
|
781
786
|
}
|
|
@@ -858,8 +863,8 @@
|
|
|
858
863
|
/* size xl */
|
|
859
864
|
--secondary-tablist-xl-gaps: var(--gap-m);
|
|
860
865
|
}
|
|
861
|
-
.
|
|
866
|
+
.tabs__title_3pr9a {
|
|
862
867
|
}
|
|
863
|
-
.
|
|
868
|
+
.tabs__mobile_3pr9a .tabs__title_3pr9a + .tabs__title_3pr9a {
|
|
864
869
|
margin-left: var(--secondary-tablist-mobile-gaps);
|
|
865
870
|
}
|
|
File without changes
|
|
@@ -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_1x5pl","hidden":"tabs__hidden_1x5pl"};
|
|
5
5
|
require('./index.css')
|
|
6
6
|
|
|
7
7
|
const Tab = ({ children, hidden, className, disabled, dataTestId }) => children ? (React.createElement("div", { className: cn(styles.component, {
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TabsProps } from "../../typings";
|
|
3
|
+
declare const Tabs: ({ TabList, className, containerClassName, size, defaultMatch, children, selectedId, scrollable, fullWidthScroll, keepMounted, dataTestId, onChange, }: Pick<TabsProps, "children" | "className" | "onChange" | "size" | "dataTestId" | "mobile" | "containerClassName" | "defaultMatch" | "selectedId" | "scrollable" | "fullWidthScroll" | "keepMounted" | "TabList">) => JSX.Element;
|
|
4
|
+
export { Tabs };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TabsProps } from "../../typings";
|
|
3
|
-
type TabsDesktopProps = Omit<TabsProps, 'TabList'>;
|
|
3
|
+
type TabsDesktopProps = Omit<TabsProps, 'TabList' | 'fullWidthScroll'>;
|
|
4
4
|
declare const TabsDesktop: ({ view, scrollable, size, ...restProps }: Pick<TabsProps, "children" | "className" | "onChange" | "size" | "dataTestId" | "view" | "mobile" | "containerClassName" | "defaultMatch" | "selectedId" | "scrollable" | "keepMounted">) => JSX.Element;
|
|
5
5
|
export { TabsDesktopProps, TabsDesktop };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import '@alfalab/core-components-keyboard-focusable/
|
|
2
|
+
import '@alfalab/core-components-keyboard-focusable/modern';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import 'compute-scroll-into-view';
|
|
5
5
|
import '../scrollable-container/Component.js';
|
|
6
6
|
import '../../useTabs.js';
|
|
7
7
|
import '../primary-tablist/Component.js';
|
|
8
|
-
import '../../index.module-
|
|
8
|
+
import '../../index.module-71ecf1b8.js';
|
|
9
9
|
import { PrimaryTabListDesktop } from '../primary-tablist/Component.desktop.js';
|
|
10
|
-
import '@alfalab/core-components-tag/
|
|
10
|
+
import '@alfalab/core-components-tag/modern';
|
|
11
11
|
import '../secondary-tablist/Component.js';
|
|
12
|
-
import '../../index.module-
|
|
12
|
+
import '../../index.module-4ce3b0dd.js';
|
|
13
13
|
import { SecondaryTabListDesktop } from '../secondary-tablist/Component.desktop.js';
|
|
14
14
|
import { Tabs } from './Component.js';
|
|
15
15
|
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import React, { cloneElement } from 'react';
|
|
2
2
|
|
|
3
|
-
const Tabs = ({ TabList, className, containerClassName, size, defaultMatch, children, selectedId, scrollable, keepMounted = false, dataTestId, onChange, }) => {
|
|
3
|
+
const Tabs = ({ TabList, className, containerClassName, size, defaultMatch, children, selectedId, scrollable, fullWidthScroll = false, keepMounted = false, dataTestId, onChange, }) => {
|
|
4
4
|
const tabsArray = React.Children.toArray(children);
|
|
5
|
-
const titles = tabsArray.map(({ props: { title, id, rightAddons, disabled, hidden } }) => ({
|
|
5
|
+
const titles = tabsArray.map(({ props: { title, id, rightAddons, disabled, hidden, toggleClassName } }) => ({
|
|
6
6
|
title,
|
|
7
7
|
id,
|
|
8
8
|
disabled,
|
|
9
9
|
rightAddons,
|
|
10
10
|
hidden,
|
|
11
|
+
toggleClassName,
|
|
11
12
|
}));
|
|
12
13
|
const tabs = tabsArray.filter(tab => tab.props.id === selectedId || tab.props.keepMounted || keepMounted);
|
|
13
14
|
return (React.createElement("div", { className: className },
|
|
14
|
-
React.createElement(TabList, { containerClassName: containerClassName, size: size, titles: titles, selectedId: selectedId, scrollable: scrollable, onChange: onChange, dataTestId: dataTestId, defaultMatch: defaultMatch }),
|
|
15
|
+
React.createElement(TabList, { containerClassName: containerClassName, size: size, titles: titles, selectedId: selectedId, scrollable: scrollable, onChange: onChange, dataTestId: dataTestId, defaultMatch: defaultMatch, fullWidthScroll: fullWidthScroll }),
|
|
15
16
|
tabs.map(tab => cloneElement(tab, { hidden: tab.props.id !== selectedId }))));
|
|
16
17
|
};
|
|
17
18
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TabsProps } from "../../typings";
|
|
3
3
|
type TabsMobileProps = Omit<TabsProps, 'TabList' | 'size'>;
|
|
4
|
-
declare const TabsMobile: ({ view, scrollable, ...restProps }: Pick<TabsProps, "children" | "className" | "onChange" | "dataTestId" | "view" | "mobile" | "containerClassName" | "defaultMatch" | "selectedId" | "scrollable" | "keepMounted">) => JSX.Element;
|
|
4
|
+
declare const TabsMobile: ({ view, scrollable, ...restProps }: Pick<TabsProps, "children" | "className" | "onChange" | "dataTestId" | "view" | "mobile" | "containerClassName" | "defaultMatch" | "selectedId" | "scrollable" | "fullWidthScroll" | "keepMounted">) => JSX.Element;
|
|
5
5
|
export { TabsMobileProps, TabsMobile };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import '@alfalab/core-components-keyboard-focusable/
|
|
2
|
+
import '@alfalab/core-components-keyboard-focusable/modern';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import 'compute-scroll-into-view';
|
|
5
5
|
import '../scrollable-container/Component.js';
|
|
6
6
|
import '../../useTabs.js';
|
|
7
7
|
import '../primary-tablist/Component.js';
|
|
8
|
-
import '../../index.module-
|
|
9
|
-
import '@alfalab/core-components-tag/
|
|
8
|
+
import '../../index.module-71ecf1b8.js';
|
|
9
|
+
import '@alfalab/core-components-tag/modern';
|
|
10
10
|
import '../secondary-tablist/Component.js';
|
|
11
|
-
import '../../index.module-
|
|
11
|
+
import '../../index.module-4ce3b0dd.js';
|
|
12
12
|
import { Tabs } from './Component.js';
|
|
13
13
|
import { PrimaryTabListMobile } from '../primary-tablist/Component.mobile.js';
|
|
14
14
|
import { SecondaryTabListMobile } from '../secondary-tablist/Component.mobile.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TabsProps } from "../../typings";
|
|
3
3
|
type TabsResponsiveProps = Omit<TabsProps, 'TabList'>;
|
|
4
|
-
declare const TabsResponsive: ({ view, scrollable, ...restProps }: Pick<TabsProps, "children" | "className" | "onChange" | "size" | "dataTestId" | "view" | "mobile" | "containerClassName" | "defaultMatch" | "selectedId" | "scrollable" | "keepMounted">) => JSX.Element;
|
|
4
|
+
declare const TabsResponsive: ({ view, scrollable, ...restProps }: Pick<TabsProps, "children" | "className" | "onChange" | "size" | "dataTestId" | "view" | "mobile" | "containerClassName" | "defaultMatch" | "selectedId" | "scrollable" | "fullWidthScroll" | "keepMounted">) => JSX.Element;
|
|
5
5
|
export { TabsResponsiveProps, TabsResponsive };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import '@alfalab/core-components-keyboard-focusable/
|
|
2
|
+
import '@alfalab/core-components-keyboard-focusable/modern';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import 'compute-scroll-into-view';
|
|
5
5
|
import '../scrollable-container/Component.js';
|
|
6
6
|
import '../../useTabs.js';
|
|
7
7
|
import '../primary-tablist/Component.js';
|
|
8
|
-
import '../../index.module-
|
|
8
|
+
import '../../index.module-71ecf1b8.js';
|
|
9
9
|
import '../primary-tablist/Component.desktop.js';
|
|
10
|
-
import '@alfalab/core-components-tag/
|
|
10
|
+
import '@alfalab/core-components-tag/modern';
|
|
11
11
|
import '../secondary-tablist/Component.js';
|
|
12
|
-
import '../../index.module-
|
|
12
|
+
import '../../index.module-4ce3b0dd.js';
|
|
13
13
|
import '../secondary-tablist/Component.desktop.js';
|
|
14
14
|
import { Tabs } from './Component.js';
|
|
15
15
|
import '@alfalab/hooks';
|
|
File without changes
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
import '@alfalab/core-components-keyboard-focusable/
|
|
2
|
+
import '@alfalab/core-components-keyboard-focusable/modern';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import 'compute-scroll-into-view';
|
|
5
5
|
export { ScrollableContainer } from './components/scrollable-container/Component.js';
|
|
6
6
|
export { useTabs } from './useTabs.js';
|
|
7
7
|
import './components/primary-tablist/Component.js';
|
|
8
|
-
import './index.module-
|
|
8
|
+
import './index.module-71ecf1b8.js';
|
|
9
9
|
export { PrimaryTabListDesktop } from './components/primary-tablist/Component.desktop.js';
|
|
10
|
-
import '@alfalab/core-components-tag/
|
|
10
|
+
import '@alfalab/core-components-tag/modern';
|
|
11
11
|
import './components/secondary-tablist/Component.js';
|
|
12
|
-
import './index.module-
|
|
12
|
+
import './index.module-4ce3b0dd.js';
|
|
13
13
|
export { SecondaryTabListDesktop } from './components/secondary-tablist/Component.desktop.js';
|
|
14
14
|
export { Tab } from './components/tab/Component.js';
|
|
15
15
|
import './components/tabs/Component.js';
|
|
File without changes
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
import '@alfalab/core-components-keyboard-focusable/
|
|
2
|
+
import '@alfalab/core-components-keyboard-focusable/modern';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import 'compute-scroll-into-view';
|
|
5
5
|
export { ScrollableContainer } from './components/scrollable-container/Component.js';
|
|
6
6
|
export { useTabs } from './useTabs.js';
|
|
7
7
|
import './components/primary-tablist/Component.js';
|
|
8
|
-
import './index.module-
|
|
8
|
+
import './index.module-71ecf1b8.js';
|
|
9
9
|
import './components/primary-tablist/Component.desktop.js';
|
|
10
|
-
import '@alfalab/core-components-tag/
|
|
10
|
+
import '@alfalab/core-components-tag/modern';
|
|
11
11
|
import './components/secondary-tablist/Component.js';
|
|
12
|
-
import './index.module-
|
|
12
|
+
import './index.module-4ce3b0dd.js';
|
|
13
13
|
import './components/secondary-tablist/Component.desktop.js';
|
|
14
14
|
export { Tab } from './components/tab/Component.js';
|
|
15
15
|
import './components/tabs/Component.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var commonStyles = {"component":"tabs__component_1yv68","fullWidthScroll":"tabs__fullWidthScroll_1yv68","container":"tabs__container_1yv68","title":"tabs__title_1yv68","xxs":"tabs__xxs_1yv68","xs":"tabs__xs_1yv68","s":"tabs__s_1yv68","m":"tabs__m_1yv68","l":"tabs__l_1yv68","xl":"tabs__xl_1yv68"};
|
|
2
|
+
require('./components/secondary-tablist/index.css')
|
|
3
|
+
|
|
4
|
+
export { commonStyles as c };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var commonStyles = {"component":"tabs__component_yvz75","fullWidthScroll":"tabs__fullWidthScroll_yvz75","container":"tabs__container_yvz75","title":"tabs__title_yvz75","disabled":"tabs__disabled_yvz75","focused":"tabs__focused_yvz75","selected":"tabs__selected_yvz75","line":"tabs__line_yvz75","s":"tabs__s_yvz75","xs":"tabs__xs_yvz75","xxs":"tabs__xxs_yvz75","m":"tabs__m_yvz75","l":"tabs__l_yvz75","xl":"tabs__xl_yvz75","rightAddons":"tabs__rightAddons_yvz75"};
|
|
2
|
+
require('./components/primary-tablist/index.css')
|
|
3
|
+
|
|
4
|
+
export { commonStyles as c };
|
|
File without changes
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
import '@alfalab/core-components-keyboard-focusable/
|
|
2
|
+
import '@alfalab/core-components-keyboard-focusable/modern';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import 'compute-scroll-into-view';
|
|
5
5
|
export { ScrollableContainer } from './components/scrollable-container/Component.js';
|
|
6
6
|
export { useTabs } from './useTabs.js';
|
|
7
7
|
import './components/primary-tablist/Component.js';
|
|
8
|
-
import './index.module-
|
|
9
|
-
import '@alfalab/core-components-tag/
|
|
8
|
+
import './index.module-71ecf1b8.js';
|
|
9
|
+
import '@alfalab/core-components-tag/modern';
|
|
10
10
|
import './components/secondary-tablist/Component.js';
|
|
11
|
-
import './index.module-
|
|
11
|
+
import './index.module-4ce3b0dd.js';
|
|
12
12
|
export { Tab } from './components/tab/Component.js';
|
|
13
13
|
import './components/tabs/Component.js';
|
|
14
14
|
export { PrimaryTabListMobile } from './components/primary-tablist/Component.mobile.js';
|
|
File without changes
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
import '@alfalab/core-components-keyboard-focusable/
|
|
2
|
+
import '@alfalab/core-components-keyboard-focusable/modern';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import 'compute-scroll-into-view';
|
|
5
5
|
export { ScrollableContainer } from './components/scrollable-container/Component.js';
|
|
6
6
|
export { useTabs } from './useTabs.js';
|
|
7
7
|
import './components/primary-tablist/Component.js';
|
|
8
|
-
import './index.module-
|
|
8
|
+
import './index.module-71ecf1b8.js';
|
|
9
9
|
import './components/primary-tablist/Component.desktop.js';
|
|
10
|
-
import '@alfalab/core-components-tag/
|
|
10
|
+
import '@alfalab/core-components-tag/modern';
|
|
11
11
|
import './components/secondary-tablist/Component.js';
|
|
12
|
-
import './index.module-
|
|
12
|
+
import './index.module-4ce3b0dd.js';
|
|
13
13
|
import './components/secondary-tablist/Component.desktop.js';
|
|
14
14
|
export { Tab } from './components/tab/Component.js';
|
|
15
15
|
import './components/tabs/Component.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC, ReactElement, ReactNode } from 'react';
|
|
1
|
+
import { MouseEvent, FC, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { TagProps } from "@alfalab/core-components-tag";
|
|
3
3
|
type SelectedId = string | number;
|
|
4
4
|
type TabsMatchMedia = 'desktop' | 'mobile';
|
|
@@ -39,6 +39,10 @@ type TabsProps = {
|
|
|
39
39
|
* Рендерить заголовки табов в контейнере со скроллом
|
|
40
40
|
*/
|
|
41
41
|
scrollable?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* При скроле табы будут уходить в край экрана
|
|
44
|
+
*/
|
|
45
|
+
fullWidthScroll?: boolean;
|
|
42
46
|
/**
|
|
43
47
|
* Компоненты табов
|
|
44
48
|
*/
|
|
@@ -68,9 +72,13 @@ type TabProps = {
|
|
|
68
72
|
*/
|
|
69
73
|
title: string;
|
|
70
74
|
/**
|
|
71
|
-
* Дополнительный класс
|
|
75
|
+
* Дополнительный класс для контейнера содержимого таба
|
|
72
76
|
*/
|
|
73
77
|
className?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Дополнительный класс для кнопки таба
|
|
80
|
+
*/
|
|
81
|
+
toggleClassName?: string;
|
|
74
82
|
/**
|
|
75
83
|
* Блокирует таб
|
|
76
84
|
*/
|
|
@@ -96,17 +104,19 @@ type TabProps = {
|
|
|
96
104
|
*/
|
|
97
105
|
dataTestId?: string;
|
|
98
106
|
};
|
|
99
|
-
type
|
|
107
|
+
type TabListTitle = {
|
|
108
|
+
title: string;
|
|
109
|
+
id: SelectedId;
|
|
110
|
+
disabled?: boolean;
|
|
111
|
+
rightAddons?: ReactNode;
|
|
112
|
+
hidden?: boolean;
|
|
113
|
+
toggleClassName?: string;
|
|
114
|
+
};
|
|
115
|
+
type TabListProps = Pick<TabsProps, 'className' | 'containerClassName' | 'size' | 'defaultMatch' | 'selectedId' | 'scrollable' | 'onChange' | 'dataTestId' | 'fullWidthScroll'> & {
|
|
100
116
|
/**
|
|
101
117
|
* Заголовки табов
|
|
102
118
|
*/
|
|
103
|
-
titles?:
|
|
104
|
-
title: string;
|
|
105
|
-
id: SelectedId;
|
|
106
|
-
disabled?: boolean;
|
|
107
|
-
rightAddons?: ReactNode;
|
|
108
|
-
hidden?: boolean;
|
|
109
|
-
}>;
|
|
119
|
+
titles?: TabListTitle[];
|
|
110
120
|
};
|
|
111
121
|
type SecondaryTabListProps = TabListProps & {
|
|
112
122
|
tagSize?: TagProps['size'];
|
|
@@ -117,4 +127,4 @@ type Styles = {
|
|
|
117
127
|
[key: string]: string;
|
|
118
128
|
};
|
|
119
129
|
};
|
|
120
|
-
export { SelectedId, TabsMatchMedia, TabsProps, TabProps, TabListProps, SecondaryTabListProps, UseTabsProps, Styles };
|
|
130
|
+
export { SelectedId, TabsMatchMedia, TabsProps, TabProps, TabListTitle, TabListProps, SecondaryTabListProps, UseTabsProps, Styles };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,33 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-tabs",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.6.0",
|
|
4
4
|
"description": "Tabs components",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"main": "
|
|
8
|
-
"module": "./
|
|
9
|
-
"files": [
|
|
10
|
-
"dist"
|
|
11
|
-
],
|
|
7
|
+
"main": "index.js",
|
|
8
|
+
"module": "./esm/index.js",
|
|
12
9
|
"scripts": {
|
|
13
|
-
"postinstall": "node ./
|
|
10
|
+
"postinstall": "node -e \"if (require('fs').existsSync('./send-stats.js')){require('./send-stats.js')} \""
|
|
14
11
|
},
|
|
15
12
|
"publishConfig": {
|
|
16
|
-
"access": "public"
|
|
13
|
+
"access": "public",
|
|
14
|
+
"directory": "dist"
|
|
17
15
|
},
|
|
18
16
|
"devDependencies": {
|
|
19
17
|
"@types/lodash.debounce": "^4.0.6"
|
|
20
18
|
},
|
|
21
19
|
"dependencies": {
|
|
22
|
-
"@alfalab/core-components-keyboard-focusable": "^3.
|
|
23
|
-
"@alfalab/core-components-tag": "^4.
|
|
24
|
-
"classnames": "^2.
|
|
20
|
+
"@alfalab/core-components-keyboard-focusable": "^3.2.0",
|
|
21
|
+
"@alfalab/core-components-tag": "^4.4.0",
|
|
22
|
+
"classnames": "^2.3.1",
|
|
25
23
|
"compute-scroll-into-view": "^1.0.13",
|
|
26
24
|
"lodash.debounce": "^4.0.8"
|
|
27
25
|
},
|
|
28
26
|
"peerDependencies": {
|
|
29
|
-
"react": "^16.9.0 || ^17.0.1",
|
|
30
|
-
"react-dom": "^16.9.0 || ^17.0.1"
|
|
31
|
-
}
|
|
32
|
-
"gitHead": "dcd5c0c8e25b7c374ff9311505ccf738a82e22c0"
|
|
27
|
+
"react": "^16.9.0 || ^17.0.1 || ^18.0.0",
|
|
28
|
+
"react-dom": "^16.9.0 || ^17.0.1 || ^18.0.0"
|
|
29
|
+
}
|
|
33
30
|
}
|
|
File without changes
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('./tslib.es6-
|
|
5
|
+
require('./tslib.es6-5331b0cd.js');
|
|
6
6
|
require('react');
|
|
7
7
|
require('@alfalab/core-components-keyboard-focusable');
|
|
8
8
|
require('classnames');
|
|
@@ -10,11 +10,11 @@ require('compute-scroll-into-view');
|
|
|
10
10
|
var components_scrollableContainer_Component = require('./components/scrollable-container/Component.js');
|
|
11
11
|
var useTabs = require('./useTabs.js');
|
|
12
12
|
require('./components/primary-tablist/Component.js');
|
|
13
|
-
require('./index.module-
|
|
13
|
+
require('./index.module-0ac56b69.js');
|
|
14
14
|
require('./components/primary-tablist/Component.desktop.js');
|
|
15
15
|
require('@alfalab/core-components-tag');
|
|
16
16
|
require('./components/secondary-tablist/Component.js');
|
|
17
|
-
require('./index.module-
|
|
17
|
+
require('./index.module-c97a2b1a.js');
|
|
18
18
|
require('./components/secondary-tablist/Component.desktop.js');
|
|
19
19
|
var components_tab_Component = require('./components/tab/Component.js');
|
|
20
20
|
require('./components/tabs/Component.js');
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC, ReactElement, ReactNode } from 'react';
|
|
1
|
+
import { MouseEvent, FC, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { TagProps } from "@alfalab/core-components-tag";
|
|
3
3
|
type SelectedId = string | number;
|
|
4
4
|
type TabsMatchMedia = 'desktop' | 'mobile';
|
|
@@ -39,6 +39,10 @@ type TabsProps = {
|
|
|
39
39
|
* Рендерить заголовки табов в контейнере со скроллом
|
|
40
40
|
*/
|
|
41
41
|
scrollable?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* При скроле табы будут уходить в край экрана
|
|
44
|
+
*/
|
|
45
|
+
fullWidthScroll?: boolean;
|
|
42
46
|
/**
|
|
43
47
|
* Компоненты табов
|
|
44
48
|
*/
|
|
@@ -68,9 +72,13 @@ type TabProps = {
|
|
|
68
72
|
*/
|
|
69
73
|
title: string;
|
|
70
74
|
/**
|
|
71
|
-
* Дополнительный класс
|
|
75
|
+
* Дополнительный класс для контейнера содержимого таба
|
|
72
76
|
*/
|
|
73
77
|
className?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Дополнительный класс для кнопки таба
|
|
80
|
+
*/
|
|
81
|
+
toggleClassName?: string;
|
|
74
82
|
/**
|
|
75
83
|
* Блокирует таб
|
|
76
84
|
*/
|
|
@@ -96,17 +104,19 @@ type TabProps = {
|
|
|
96
104
|
*/
|
|
97
105
|
dataTestId?: string;
|
|
98
106
|
};
|
|
99
|
-
type
|
|
107
|
+
type TabListTitle = {
|
|
108
|
+
title: string;
|
|
109
|
+
id: SelectedId;
|
|
110
|
+
disabled?: boolean;
|
|
111
|
+
rightAddons?: ReactNode;
|
|
112
|
+
hidden?: boolean;
|
|
113
|
+
toggleClassName?: string;
|
|
114
|
+
};
|
|
115
|
+
type TabListProps = Pick<TabsProps, 'className' | 'containerClassName' | 'size' | 'defaultMatch' | 'selectedId' | 'scrollable' | 'onChange' | 'dataTestId' | 'fullWidthScroll'> & {
|
|
100
116
|
/**
|
|
101
117
|
* Заголовки табов
|
|
102
118
|
*/
|
|
103
|
-
titles?:
|
|
104
|
-
title: string;
|
|
105
|
-
id: SelectedId;
|
|
106
|
-
disabled?: boolean;
|
|
107
|
-
rightAddons?: ReactNode;
|
|
108
|
-
hidden?: boolean;
|
|
109
|
-
}>;
|
|
119
|
+
titles?: TabListTitle[];
|
|
110
120
|
};
|
|
111
121
|
type SecondaryTabListProps = TabListProps & {
|
|
112
122
|
tagSize?: TagProps['size'];
|
|
@@ -117,4 +127,4 @@ type Styles = {
|
|
|
117
127
|
[key: string]: string;
|
|
118
128
|
};
|
|
119
129
|
};
|
|
120
|
-
export { SelectedId, TabsMatchMedia, TabsProps, TabProps, TabListProps, SecondaryTabListProps, UseTabsProps, Styles };
|
|
130
|
+
export { SelectedId, TabsMatchMedia, TabsProps, TabProps, TabListTitle, TabListProps, SecondaryTabListProps, UseTabsProps, Styles };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Styles } from "../../typings";
|
|
4
|
-
declare const PrimaryTabList: ({ size, styles, className, containerClassName, titles, selectedId, scrollable, onChange, dataTestId, }: Pick<import("../../typings").TabsProps, "className" | "onChange" | "size" | "dataTestId" | "containerClassName" | "defaultMatch" | "selectedId" | "scrollable"> & {
|
|
5
|
-
titles?: {
|
|
6
|
-
title: string;
|
|
7
|
-
id: React.ReactText;
|
|
8
|
-
disabled?: boolean | undefined;
|
|
9
|
-
rightAddons?: React.ReactNode;
|
|
10
|
-
hidden?: boolean | undefined;
|
|
11
|
-
}[] | undefined;
|
|
12
|
-
} & Styles) => JSX.Element;
|
|
13
|
-
export { PrimaryTabList };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var tslib_es6 = require('../../tslib.es6-394cebb0.js');
|
|
6
|
-
var React = require('react');
|
|
7
|
-
var coreComponentsKeyboardFocusable = require('@alfalab/core-components-keyboard-focusable');
|
|
8
|
-
var cn = require('classnames');
|
|
9
|
-
require('compute-scroll-into-view');
|
|
10
|
-
var components_scrollableContainer_Component = require('../scrollable-container/Component.js');
|
|
11
|
-
var useTabs = require('../../useTabs.js');
|
|
12
|
-
|
|
13
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
-
|
|
15
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
|
-
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
17
|
-
|
|
18
|
-
var PrimaryTabList = function (_a) {
|
|
19
|
-
var size = _a.size, _b = _a.styles, styles = _b === void 0 ? {} : _b, className = _a.className, containerClassName = _a.containerClassName, _c = _a.titles, titles = _c === void 0 ? [] : _c, _d = _a.selectedId, selectedId = _d === void 0 ? titles.length ? titles[0].id : undefined : _d, _e = _a.scrollable, scrollable = _e === void 0 ? true : _e, onChange = _a.onChange, dataTestId = _a.dataTestId;
|
|
20
|
-
var lineRef = React.useRef(null);
|
|
21
|
-
var _f = useTabs.useTabs({
|
|
22
|
-
titles: titles,
|
|
23
|
-
selectedId: selectedId,
|
|
24
|
-
onChange: onChange,
|
|
25
|
-
}), selectedTab = _f.selectedTab, focusedTab = _f.focusedTab, getTabListItemProps = _f.getTabListItemProps;
|
|
26
|
-
React.useEffect(function () {
|
|
27
|
-
if (selectedTab && lineRef.current) {
|
|
28
|
-
lineRef.current.style.width = selectedTab.offsetWidth + "px";
|
|
29
|
-
lineRef.current.style.transform = "translateX(" + selectedTab.offsetLeft + "px)";
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
var renderContent = function () { return (React__default['default'].createElement(React__default['default'].Fragment, null,
|
|
33
|
-
titles.map(function (item, index) {
|
|
34
|
-
if (item.hidden)
|
|
35
|
-
return null;
|
|
36
|
-
return (React__default['default'].createElement(coreComponentsKeyboardFocusable.KeyboardFocusable, { key: item.id }, function (ref, focused) {
|
|
37
|
-
var _a;
|
|
38
|
-
return (React__default['default'].createElement("button", tslib_es6.__assign({}, getTabListItemProps(index, ref), { type: 'button', className: cn__default['default'](styles.title, (_a = {},
|
|
39
|
-
_a[styles.selected] = item.id === selectedId,
|
|
40
|
-
_a[styles.disabled] = item.disabled,
|
|
41
|
-
_a)) }),
|
|
42
|
-
React__default['default'].createElement("span", { className: focused ? styles.focused : undefined }, item.title),
|
|
43
|
-
item.rightAddons && (React__default['default'].createElement("span", { className: styles.rightAddons }, item.rightAddons))));
|
|
44
|
-
}));
|
|
45
|
-
}),
|
|
46
|
-
React__default['default'].createElement("div", { className: styles.line, ref: lineRef }))); };
|
|
47
|
-
return (React__default['default'].createElement("div", { role: 'tablist', "data-test-id": dataTestId, className: cn__default['default'](styles.component, className, size && styles[size]) }, scrollable ? (React__default['default'].createElement(components_scrollableContainer_Component.ScrollableContainer, { activeChild: focusedTab || selectedTab, containerClassName: containerClassName }, renderContent())) : (React__default['default'].createElement("div", { className: cn__default['default'](styles.container, containerClassName) }, renderContent()))));
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
exports.PrimaryTabList = PrimaryTabList;
|