@alfalab/core-components-tabs 5.2.2 → 6.0.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.
Files changed (106) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/dist/components/primary-tablist/Component.desktop.js +2 -2
  3. package/dist/components/primary-tablist/Component.js +18 -19
  4. package/dist/components/primary-tablist/Component.mobile.js +3 -3
  5. package/dist/components/primary-tablist/Component.responsive.js +2 -2
  6. package/dist/components/primary-tablist/index.css +19 -26
  7. package/dist/components/primary-tablist/mobile.css +45 -32
  8. package/dist/components/scrollable-container/Component.js +2 -3
  9. package/dist/components/scrollable-container/index.css +6 -17
  10. package/dist/components/secondary-tablist/Component.d.ts +1 -1
  11. package/dist/components/secondary-tablist/Component.desktop.js +2 -2
  12. package/dist/components/secondary-tablist/Component.js +1 -1
  13. package/dist/components/secondary-tablist/Component.mobile.js +3 -3
  14. package/dist/components/secondary-tablist/Component.responsive.js +2 -2
  15. package/dist/components/secondary-tablist/index.css +12 -17
  16. package/dist/components/secondary-tablist/mobile.css +39 -23
  17. package/dist/components/tab/Component.js +1 -1
  18. package/dist/components/tab/index.css +3 -3
  19. package/dist/components/tabs/Component.desktop.js +3 -3
  20. package/dist/components/tabs/Component.mobile.js +3 -3
  21. package/dist/components/tabs/Component.responsive.js +3 -3
  22. package/dist/cssm/components/primary-tablist/Component.js +17 -18
  23. package/dist/cssm/components/primary-tablist/index.module.css +0 -7
  24. package/dist/cssm/components/primary-tablist/mobile.module.css +0 -5
  25. package/dist/cssm/components/scrollable-container/Component.js +1 -2
  26. package/dist/cssm/components/scrollable-container/index.module.css +4 -15
  27. package/dist/cssm/components/secondary-tablist/Component.d.ts +1 -1
  28. package/dist/cssm/components/secondary-tablist/index.module.css +0 -5
  29. package/dist/cssm/components/secondary-tablist/mobile.module.css +0 -5
  30. package/dist/cssm/useTabs.d.ts +1 -1
  31. package/dist/cssm/useTabs.js +3 -2
  32. package/dist/cssm/vars.css +0 -5
  33. package/dist/desktop.js +3 -3
  34. package/dist/esm/components/primary-tablist/Component.desktop.js +2 -2
  35. package/dist/esm/components/primary-tablist/Component.js +18 -19
  36. package/dist/esm/components/primary-tablist/Component.mobile.js +3 -3
  37. package/dist/esm/components/primary-tablist/Component.responsive.js +2 -2
  38. package/dist/esm/components/primary-tablist/index.css +19 -26
  39. package/dist/esm/components/primary-tablist/mobile.css +45 -32
  40. package/dist/esm/components/scrollable-container/Component.js +2 -3
  41. package/dist/esm/components/scrollable-container/index.css +6 -17
  42. package/dist/esm/components/secondary-tablist/Component.d.ts +1 -1
  43. package/dist/esm/components/secondary-tablist/Component.desktop.js +2 -2
  44. package/dist/esm/components/secondary-tablist/Component.js +1 -1
  45. package/dist/esm/components/secondary-tablist/Component.mobile.js +3 -3
  46. package/dist/esm/components/secondary-tablist/Component.responsive.js +2 -2
  47. package/dist/esm/components/secondary-tablist/index.css +12 -17
  48. package/dist/esm/components/secondary-tablist/mobile.css +39 -23
  49. package/dist/esm/components/tab/Component.js +1 -1
  50. package/dist/esm/components/tab/index.css +3 -3
  51. package/dist/esm/components/tabs/Component.desktop.js +3 -3
  52. package/dist/esm/components/tabs/Component.mobile.js +3 -3
  53. package/dist/esm/components/tabs/Component.responsive.js +3 -3
  54. package/dist/esm/desktop.js +3 -3
  55. package/dist/esm/index.js +3 -3
  56. package/dist/esm/index.module-4ceeb0c2.js +4 -0
  57. package/dist/esm/index.module-62f9e5fe.js +4 -0
  58. package/dist/esm/mobile.js +3 -3
  59. package/dist/esm/responsive.js +3 -3
  60. package/dist/esm/{tslib.es6-47d33264.d.ts → tslib.es6-3cbdcf8b.d.ts} +0 -0
  61. package/dist/esm/{tslib.es6-47d33264.js → tslib.es6-3cbdcf8b.js} +0 -0
  62. package/dist/esm/useTabs.d.ts +1 -1
  63. package/dist/esm/useTabs.js +3 -2
  64. package/dist/index.js +3 -3
  65. package/dist/index.module-177547f1.js +6 -0
  66. package/dist/index.module-77910764.js +6 -0
  67. package/dist/mobile.js +3 -3
  68. package/dist/modern/components/primary-tablist/Component.desktop.js +1 -1
  69. package/dist/modern/components/primary-tablist/Component.js +11 -11
  70. package/dist/modern/components/primary-tablist/Component.mobile.js +2 -2
  71. package/dist/modern/components/primary-tablist/Component.responsive.js +1 -1
  72. package/dist/modern/components/primary-tablist/index.css +19 -26
  73. package/dist/modern/components/primary-tablist/mobile.css +45 -32
  74. package/dist/modern/components/scrollable-container/Component.js +2 -3
  75. package/dist/modern/components/scrollable-container/index.css +6 -17
  76. package/dist/modern/components/secondary-tablist/Component.d.ts +1 -1
  77. package/dist/modern/components/secondary-tablist/Component.desktop.js +1 -1
  78. package/dist/modern/components/secondary-tablist/Component.mobile.js +2 -2
  79. package/dist/modern/components/secondary-tablist/Component.responsive.js +1 -1
  80. package/dist/modern/components/secondary-tablist/index.css +12 -17
  81. package/dist/modern/components/secondary-tablist/mobile.css +39 -23
  82. package/dist/modern/components/tab/Component.js +1 -1
  83. package/dist/modern/components/tab/index.css +3 -3
  84. package/dist/modern/components/tabs/Component.desktop.js +2 -2
  85. package/dist/modern/components/tabs/Component.mobile.js +2 -2
  86. package/dist/modern/components/tabs/Component.responsive.js +2 -2
  87. package/dist/modern/desktop.js +2 -2
  88. package/dist/modern/index.js +2 -2
  89. package/dist/modern/index.module-4ceeb0c2.js +4 -0
  90. package/dist/modern/index.module-62f9e5fe.js +4 -0
  91. package/dist/modern/mobile.js +2 -2
  92. package/dist/modern/responsive.js +2 -2
  93. package/dist/modern/useTabs.d.ts +1 -1
  94. package/dist/modern/useTabs.js +3 -2
  95. package/dist/responsive.js +3 -3
  96. package/dist/{tslib.es6-59f28f0a.d.ts → tslib.es6-c391e8b1.d.ts} +0 -0
  97. package/dist/{tslib.es6-59f28f0a.js → tslib.es6-c391e8b1.js} +0 -0
  98. package/dist/useTabs.d.ts +1 -1
  99. package/dist/useTabs.js +3 -2
  100. package/package.json +4 -4
  101. package/dist/esm/index.module-bb9e3521.js +0 -4
  102. package/dist/esm/index.module-f1a2d8dc.js +0 -4
  103. package/dist/index.module-7b64b6d0.js +0 -6
  104. package/dist/index.module-c693433a.js +0 -6
  105. package/dist/modern/index.module-bb9e3521.js +0 -4
  106. package/dist/modern/index.module-f1a2d8dc.js +0 -4
@@ -1,10 +1,7 @@
1
- /* hash: 1l66m */
1
+ /* hash: 13568 */
2
2
  :root {
3
3
  }:root {
4
4
  }:root {
5
-
6
- /* TODO: цвета добавлены руками. Обновить токены */
7
- --color-light-text-secondary-inverted-transparent: rgba(255, 255, 255, 0.7);
8
5
  }:root {
9
6
  }:root {
10
7
 
@@ -49,30 +46,30 @@
49
46
 
50
47
  /* size xl */
51
48
  --secondary-tablist-xl-gaps: var(--gap-s);
52
- }.tabs__component_dapm9 {
49
+ }.tabs__component_3vamx {
53
50
  position: relative;
54
51
  display: flex;
55
52
  align-items: center;
56
- }.tabs__container_dapm9 {
53
+ }.tabs__container_3vamx {
57
54
  display: flex;
58
55
  align-items: center;
59
- }.tabs__title_dapm9 {
56
+ }.tabs__title_3vamx {
60
57
  white-space: nowrap;
61
- }/* sizes */.tabs__s_dapm9 {
58
+ }/* sizes */.tabs__s_3vamx {
62
59
  height: var(--size-s-height)
63
- }.tabs__s_dapm9 .tabs__title_dapm9 + .tabs__title_dapm9 {
60
+ }.tabs__s_3vamx .tabs__title_3vamx + .tabs__title_3vamx {
64
61
  margin-left: var(--secondary-tablist-s-gaps);
65
- }.tabs__m_dapm9 {
62
+ }.tabs__m_3vamx {
66
63
  height: var(--size-m-height)
67
- }.tabs__m_dapm9 .tabs__title_dapm9 + .tabs__title_dapm9 {
64
+ }.tabs__m_3vamx .tabs__title_3vamx + .tabs__title_3vamx {
68
65
  margin-left: var(--secondary-tablist-m-gaps);
69
- }.tabs__l_dapm9 {
66
+ }.tabs__l_3vamx {
70
67
  height: var(--size-l-height)
71
- }.tabs__l_dapm9 .tabs__title_dapm9 + .tabs__title_dapm9 {
68
+ }.tabs__l_3vamx .tabs__title_3vamx + .tabs__title_3vamx {
72
69
  margin-left: var(--secondary-tablist-l-gaps);
73
- }.tabs__xl_dapm9 {
70
+ }.tabs__xl_3vamx {
74
71
  height: var(--size-xl-height)
75
- }.tabs__xl_dapm9 .tabs__title_dapm9 + .tabs__title_dapm9 {
72
+ }.tabs__xl_3vamx .tabs__title_3vamx + .tabs__title_3vamx {
76
73
  margin-left: var(--secondary-tablist-xl-gaps);
77
74
  }
78
75
  :root {
@@ -225,6 +222,8 @@
225
222
  --color-dark-border-secondary-inverted: #6d7986;
226
223
  --color-dark-border-tertiary: #233549;
227
224
  --color-dark-border-tertiary-inverted: #b6bcc3;
225
+ --color-dark-border-underline: #6d7986;
226
+ --color-dark-border-underline-inverted: #b6bcc3;
228
227
  --color-dark-graphic-accent: #ef3124;
229
228
  --color-dark-graphic-attention: #e58933;
230
229
  --color-dark-graphic-link: #007aff;
@@ -237,6 +236,7 @@
237
236
  --color-dark-graphic-secondary-inverted: #233549;
238
237
  --color-dark-graphic-tertiary: #6d7986;
239
238
  --color-dark-specialbg-component: #485767;
239
+ --color-dark-specialbg-component-inverted: rgba(11, 31, 53, 0.07);
240
240
  --color-dark-specialbg-nulled: rgba(11, 31, 53, 0);
241
241
  --color-dark-specialbg-primary-grouped: #0b1f35;
242
242
  --color-dark-specialbg-secondary-grouped: #233549;
@@ -281,6 +281,8 @@
281
281
  --color-light-border-secondary-inverted: #b6bcc3;
282
282
  --color-light-border-tertiary: #f3f4f5;
283
283
  --color-light-border-tertiary-inverted: #6d7986;
284
+ --color-light-border-underline: #b6bcc3;
285
+ --color-light-border-underline-inverted: #6d7986;
284
286
  --color-light-graphic-accent: #ef3124;
285
287
  --color-light-graphic-attention: #e58933;
286
288
  --color-light-graphic-link: #007aff;
@@ -345,12 +347,15 @@
345
347
  --color-dark-bg-neutral-tint-10: rgb(90, 104, 118);
346
348
  --color-dark-bg-neutral-tint-15: rgb(99, 112, 126);
347
349
  --color-dark-bg-neutral-tint-30: rgb(127, 137, 149);
350
+ --color-dark-bg-neutral-shade-15: rgb(61, 74, 88);
351
+ --color-dark-bg-primary-alpha-8: rgba(11, 31, 53, 0.08);
348
352
  --color-dark-bg-primary-inverted-alpha-3: rgba(255, 255, 255, 0.03);
349
353
  --color-dark-bg-primary-inverted-alpha-7: rgba(255, 255, 255, 0.07);
350
354
  --color-dark-bg-primary-inverted-alpha-10: rgba(255, 255, 255, 0.1);
351
355
  --color-dark-bg-primary-inverted-alpha-15: rgba(255, 255, 255, 0.15);
352
356
  --color-dark-bg-primary-inverted-alpha-20: rgba(255, 255, 255, 0.2);
353
357
  --color-dark-bg-primary-inverted-alpha-40: rgba(255, 255, 255, 0.4);
358
+ --color-dark-bg-primary-inverted-alpha-50: rgba(255, 255, 255, 0.5);
354
359
  --color-dark-bg-secondary-inverted-alpha-7: rgba(182, 188, 195, 0.07);
355
360
  --color-dark-bg-secondary-inverted-alpha-15: rgba(182, 188, 195, 0.15);
356
361
  --color-dark-bg-tertiary-tint-7: rgb(74, 89, 104);
@@ -376,6 +381,7 @@
376
381
  --color-dark-specialbg-component-tint-7: rgb(85, 99, 114);
377
382
  --color-dark-specialbg-component-tint-10: rgb(90, 104, 118);
378
383
  --color-dark-specialbg-component-tint-30: rgb(127, 137, 149);
384
+ --color-dark-specialbg-component-inverted-shade-15: rgba(9, 26, 45, 0.2095);
379
385
  --color-dark-text-link-shade-30: rgb(0, 85, 179);
380
386
  --color-dark-text-link-shade-50: rgb(0, 61, 128);
381
387
  --color-dark-text-link-tint-20: rgb(51, 149, 255);
@@ -385,10 +391,15 @@
385
391
  --color-dark-text-primary-shade-50: rgb(128, 128, 128);
386
392
  --color-dark-text-primary-tint-20: rgb(255, 255, 255);
387
393
  --color-dark-text-primary-tint-40: rgb(255, 255, 255);
394
+ --color-dark-text-primary-inverted-alpha-40: rgba(11, 31, 53, 0.4);
395
+ --color-dark-text-primary-inverted-shade-30: rgb(8, 22, 37);
396
+ --color-dark-text-primary-inverted-shade-50: rgb(6, 16, 26);
388
397
  --color-dark-text-secondary-shade-30: rgb(127, 132, 136);
389
398
  --color-dark-text-secondary-shade-50: rgb(91, 94, 98);
390
399
  --color-dark-text-secondary-tint-20: rgb(197, 201, 207);
391
400
  --color-dark-text-secondary-tint-40: rgb(211, 215, 219);
401
+ --color-dark-text-secondary-inverted-shade-30: rgb(76, 85, 94);
402
+ --color-dark-text-secondary-inverted-shade-50: rgb(55, 61, 67);
392
403
  --color-light-bg-accent-alpha-30: rgba(239, 49, 36, 0.3);
393
404
  --color-light-bg-accent-shade-7: rgb(222, 46, 33);
394
405
  --color-light-bg-accent-shade-10: rgb(215, 44, 32);
@@ -399,12 +410,15 @@
399
410
  --color-light-bg-neutral-shade-10: rgb(197, 200, 203);
400
411
  --color-light-bg-neutral-shade-15: rgb(186, 189, 191);
401
412
  --color-light-bg-neutral-shade-30: rgb(153, 155, 157);
413
+ --color-light-bg-neutral-tint-15: rgb(224, 227, 230);
414
+ --color-light-bg-primary-alpha-8: rgba(255, 255, 255, 0.08);
402
415
  --color-light-bg-primary-inverted-alpha-3: rgba(11, 31, 53, 0.03);
403
416
  --color-light-bg-primary-inverted-alpha-7: rgba(11, 31, 53, 0.07);
404
417
  --color-light-bg-primary-inverted-alpha-10: rgba(11, 31, 53, 0.1);
405
418
  --color-light-bg-primary-inverted-alpha-15: rgba(11, 31, 53, 0.15);
406
419
  --color-light-bg-primary-inverted-alpha-20: rgba(11, 31, 53, 0.2);
407
420
  --color-light-bg-primary-inverted-alpha-40: rgba(11, 31, 53, 0.4);
421
+ --color-light-bg-primary-inverted-alpha-50: rgba(11, 31, 53, 0.5);
408
422
  --color-light-bg-secondary-inverted-alpha-7: rgba(35, 53, 73, 0.07);
409
423
  --color-light-bg-secondary-inverted-alpha-15: rgba(35, 53, 73, 0.15);
410
424
  --color-light-bg-tertiary-shade-7: rgb(215, 217, 219);
@@ -440,14 +454,17 @@
440
454
  --color-light-text-primary-tint-50: rgb(133, 143, 154);
441
455
  --color-light-text-primary-shade-20: rgb(9, 25, 42);
442
456
  --color-light-text-primary-shade-40: rgb(7, 19, 32);
457
+ --color-light-text-primary-inverted-alpha-40: rgba(255, 255, 255, 0.4);
458
+ --color-light-text-primary-inverted-tint-30: rgb(255, 255, 255);
459
+ --color-light-text-primary-inverted-tint-50: rgb(255, 255, 255);
443
460
  --color-light-text-secondary-tint-30: rgb(135, 145, 156);
444
461
  --color-light-text-secondary-tint-50: rgb(170, 177, 185);
445
462
  --color-light-text-secondary-shade-20: rgb(67, 78, 91);
446
463
  --color-light-text-secondary-shade-40: rgb(50, 59, 68);
447
-
448
- /* TODO: цвета добавлены руками. Обновить токены */
449
- --color-light-border-underline-inverted: #6d7986;
450
- --color-light-text-secondary-inverted-transparent: rgba(255, 255, 255, 0.7);
464
+ --color-light-text-secondary-inverted-tint-30: rgb(204, 208, 213);
465
+ --color-light-text-secondary-inverted-tint-50: rgb(219, 222, 225);
466
+ --color-static-bg-primary-dark-alpha-10: rgba(0, 0, 0, 0.1);
467
+ --color-static-bg-primary-dark-alpha-20: rgba(0, 0, 0, 0.2);
451
468
  }
452
469
  :root {
453
470
  --color-dynamic-primary-dark: rgba(0, 0, 0, 0.8);
@@ -570,7 +587,6 @@
570
587
  --size-xl-height: 72px;
571
588
  }
572
589
  :root {
573
- --tablist-hidden-scrollbar-height: 20px;
574
590
  --primary-tablist-color: var(--color-light-text-secondary);
575
591
  --primary-tablist-hover-color: var(--color-light-text-primary);
576
592
  --primary-tablist-selected-color: var(--color-light-text-primary);
@@ -628,11 +644,11 @@
628
644
  /* size xl */
629
645
  --secondary-tablist-xl-gaps: var(--gap-s);
630
646
  }
631
- .tabs__title_1l66m {
647
+ .tabs__title_kfsfv {
632
648
  }
633
- .tabs__title_1l66m + .tabs__title_1l66m {
649
+ .tabs__title_kfsfv + .tabs__title_kfsfv {
634
650
  margin-left: var(--secondary-tablist-mobile-gaps);
635
651
  }
636
- .tabs__mobile_1l66m {
652
+ .tabs__mobile_kfsfv {
637
653
  height: 48px;
638
654
  }
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import cn from 'classnames';
3
3
 
4
- var styles = {"component":"tabs__component_9ix6s","hidden":"tabs__hidden_9ix6s"};
4
+ var styles = {"component":"tabs__component_fu66z","hidden":"tabs__hidden_fu66z"};
5
5
  require('./index.css')
6
6
 
7
7
  const Tab = ({ children, hidden, className, disabled }) => children ? (React.createElement("div", { className: cn(styles.component, {
@@ -1,8 +1,8 @@
1
- /* hash: 9ix6s */
2
- .tabs__component_9ix6s {
1
+ /* hash: 1qj0v */
2
+ .tabs__component_fu66z {
3
3
  outline: none;
4
4
  }
5
5
 
6
- .tabs__hidden_9ix6s {
6
+ .tabs__hidden_fu66z {
7
7
  display: none;
8
8
  }
@@ -5,11 +5,11 @@ 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-f1a2d8dc.js';
8
+ import '../../index.module-62f9e5fe.js';
9
9
  import { PrimaryTabListDesktop } from '../primary-tablist/Component.desktop.js';
10
10
  import '@alfalab/core-components-tag/dist/modern';
11
11
  import '../secondary-tablist/Component.js';
12
- import '../../index.module-bb9e3521.js';
12
+ import '../../index.module-4ceeb0c2.js';
13
13
  import { SecondaryTabListDesktop } from '../secondary-tablist/Component.desktop.js';
14
14
  import { Tabs } from './Component.js';
15
15
 
@@ -5,10 +5,10 @@ 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-f1a2d8dc.js';
8
+ import '../../index.module-62f9e5fe.js';
9
9
  import '@alfalab/core-components-tag/dist/modern';
10
10
  import '../secondary-tablist/Component.js';
11
- import '../../index.module-bb9e3521.js';
11
+ import '../../index.module-4ceeb0c2.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';
@@ -5,11 +5,11 @@ 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-f1a2d8dc.js';
8
+ import '../../index.module-62f9e5fe.js';
9
9
  import '../primary-tablist/Component.desktop.js';
10
10
  import '@alfalab/core-components-tag/dist/modern';
11
11
  import '../secondary-tablist/Component.js';
12
- import '../../index.module-bb9e3521.js';
12
+ import '../../index.module-4ceeb0c2.js';
13
13
  import '../secondary-tablist/Component.desktop.js';
14
14
  import { Tabs } from './Component.js';
15
15
  import '@alfalab/hooks';
@@ -5,11 +5,11 @@ 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-f1a2d8dc.js';
8
+ import './index.module-62f9e5fe.js';
9
9
  export { PrimaryTabListDesktop } from './components/primary-tablist/Component.desktop.js';
10
10
  import '@alfalab/core-components-tag/dist/modern';
11
11
  import './components/secondary-tablist/Component.js';
12
- import './index.module-bb9e3521.js';
12
+ import './index.module-4ceeb0c2.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';
@@ -5,11 +5,11 @@ 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-f1a2d8dc.js';
8
+ import './index.module-62f9e5fe.js';
9
9
  import './components/primary-tablist/Component.desktop.js';
10
10
  import '@alfalab/core-components-tag/dist/modern';
11
11
  import './components/secondary-tablist/Component.js';
12
- import './index.module-bb9e3521.js';
12
+ import './index.module-4ceeb0c2.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_3vamx","container":"tabs__container_3vamx","title":"tabs__title_3vamx","s":"tabs__s_3vamx","m":"tabs__m_3vamx","l":"tabs__l_3vamx","xl":"tabs__xl_3vamx"};
2
+ require('./components/secondary-tablist/index.css')
3
+
4
+ export { commonStyles as c };
@@ -0,0 +1,4 @@
1
+ var commonStyles = {"component":"tabs__component_nld1v","container":"tabs__container_nld1v","title":"tabs__title_nld1v","disabled":"tabs__disabled_nld1v","focused":"tabs__focused_nld1v","selected":"tabs__selected_nld1v","line":"tabs__line_nld1v","s":"tabs__s_nld1v","m":"tabs__m_nld1v","l":"tabs__l_nld1v","xl":"tabs__xl_nld1v","rightAddons":"tabs__rightAddons_nld1v"};
2
+ require('./components/primary-tablist/index.css')
3
+
4
+ export { commonStyles as c };
@@ -5,10 +5,10 @@ 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-f1a2d8dc.js';
8
+ import './index.module-62f9e5fe.js';
9
9
  import '@alfalab/core-components-tag/dist/modern';
10
10
  import './components/secondary-tablist/Component.js';
11
- import './index.module-bb9e3521.js';
11
+ import './index.module-4ceeb0c2.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';
@@ -5,11 +5,11 @@ 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-f1a2d8dc.js';
8
+ import './index.module-62f9e5fe.js';
9
9
  import './components/primary-tablist/Component.desktop.js';
10
10
  import '@alfalab/core-components-tag/dist/modern';
11
11
  import './components/secondary-tablist/Component.js';
12
- import './index.module-bb9e3521.js';
12
+ import './index.module-4ceeb0c2.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 { MouseEvent, KeyboardEvent, MutableRefObject } from 'react';
1
+ import { KeyboardEvent, MouseEvent, MutableRefObject } from 'react';
2
2
  import { UseTabsProps } from "./typings";
3
3
  declare function useTabs({ titles, selectedId, onChange }: UseTabsProps): {
4
4
  getTabListItemProps: (index: number, outerRef?: MutableRefObject<HTMLElement> | undefined) => {
@@ -16,7 +16,8 @@ function useTabs({ titles = [], selectedId, onChange }) {
16
16
  }, [onChange, selectedId]);
17
17
  const focusTab = useCallback((position) => {
18
18
  const refs = itemRefs.current;
19
- if (refs.every(ref => ref.disabled))
19
+ const tabAvailable = (ref) => ref && !ref.disabled;
20
+ if (refs.every(ref => !tabAvailable(ref)))
20
21
  return;
21
22
  let focusedTabIndex = refs.findIndex(node => document.activeElement === node);
22
23
  if (focusedTabIndex === -1) {
@@ -38,7 +39,7 @@ function useTabs({ titles = [], selectedId, onChange }) {
38
39
  break;
39
40
  }
40
41
  const shift = ['prev', 'end'].includes(position) ? -1 : 1;
41
- while (refs[newFocusIndex].disabled) {
42
+ while (!tabAvailable(refs[newFocusIndex])) {
42
43
  newFocusIndex = (refs.length + newFocusIndex + shift) % refs.length;
43
44
  }
44
45
  refs[newFocusIndex].focus();
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- require('./tslib.es6-59f28f0a.js');
5
+ require('./tslib.es6-c391e8b1.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-c693433a.js');
13
+ require('./index.module-177547f1.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-7b64b6d0.js');
17
+ require('./index.module-77910764.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');
package/dist/useTabs.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { MouseEvent, KeyboardEvent, MutableRefObject } from 'react';
1
+ import { KeyboardEvent, MouseEvent, MutableRefObject } from 'react';
2
2
  import { UseTabsProps } from "./typings";
3
3
  declare function useTabs({ titles, selectedId, onChange }: UseTabsProps): {
4
4
  getTabListItemProps: (index: number, outerRef?: MutableRefObject<HTMLElement> | undefined) => {
package/dist/useTabs.js CHANGED
@@ -21,7 +21,8 @@ function useTabs(_a) {
21
21
  }, [onChange, selectedId]);
22
22
  var focusTab = React.useCallback(function (position) {
23
23
  var refs = itemRefs.current;
24
- if (refs.every(function (ref) { return ref.disabled; }))
24
+ var tabAvailable = function (ref) { return ref && !ref.disabled; };
25
+ if (refs.every(function (ref) { return !tabAvailable(ref); }))
25
26
  return;
26
27
  var focusedTabIndex = refs.findIndex(function (node) { return document.activeElement === node; });
27
28
  if (focusedTabIndex === -1) {
@@ -43,7 +44,7 @@ function useTabs(_a) {
43
44
  break;
44
45
  }
45
46
  var shift = ['prev', 'end'].includes(position) ? -1 : 1;
46
- while (refs[newFocusIndex].disabled) {
47
+ while (!tabAvailable(refs[newFocusIndex])) {
47
48
  newFocusIndex = (refs.length + newFocusIndex + shift) % refs.length;
48
49
  }
49
50
  refs[newFocusIndex].focus();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-tabs",
3
- "version": "5.2.2",
3
+ "version": "6.0.0",
4
4
  "description": "Tabs components",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -19,8 +19,8 @@
19
19
  "@types/lodash.debounce": "^4.0.6"
20
20
  },
21
21
  "dependencies": {
22
- "@alfalab/core-components-keyboard-focusable": "^2.0.1",
23
- "@alfalab/core-components-tag": "^3.3.0",
22
+ "@alfalab/core-components-keyboard-focusable": "^3.0.0",
23
+ "@alfalab/core-components-tag": "^4.0.0",
24
24
  "classnames": "^2.2.6",
25
25
  "compute-scroll-into-view": "^1.0.13",
26
26
  "lodash.debounce": "^4.0.8"
@@ -29,5 +29,5 @@
29
29
  "react": "^16.9.0 || ^17.0.1",
30
30
  "react-dom": "^16.9.0 || ^17.0.1"
31
31
  },
32
- "gitHead": "b85e5b31aff2cb11bc75b3c68d284e26cc63c353"
32
+ "gitHead": "10c9fd1caacf98a5c15f84529889ddf41e9e1b54"
33
33
  }
@@ -1,4 +0,0 @@
1
- var commonStyles = {"component":"tabs__component_dapm9","container":"tabs__container_dapm9","title":"tabs__title_dapm9","s":"tabs__s_dapm9","m":"tabs__m_dapm9","l":"tabs__l_dapm9","xl":"tabs__xl_dapm9"};
2
- require('./components/secondary-tablist/index.css')
3
-
4
- export { commonStyles as c };
@@ -1,4 +0,0 @@
1
- var commonStyles = {"component":"tabs__component_nesyh","container":"tabs__container_nesyh","title":"tabs__title_nesyh","disabled":"tabs__disabled_nesyh","focused":"tabs__focused_nesyh","selected":"tabs__selected_nesyh","line":"tabs__line_nesyh","scrollable":"tabs__scrollable_nesyh","s":"tabs__s_nesyh","m":"tabs__m_nesyh","l":"tabs__l_nesyh","xl":"tabs__xl_nesyh","rightAddons":"tabs__rightAddons_nesyh"};
2
- require('./components/primary-tablist/index.css')
3
-
4
- export { commonStyles as c };
@@ -1,6 +0,0 @@
1
- 'use strict';
2
-
3
- var commonStyles = {"component":"tabs__component_dapm9","container":"tabs__container_dapm9","title":"tabs__title_dapm9","s":"tabs__s_dapm9","m":"tabs__m_dapm9","l":"tabs__l_dapm9","xl":"tabs__xl_dapm9"};
4
- require('./components/secondary-tablist/index.css')
5
-
6
- exports.commonStyles = commonStyles;
@@ -1,6 +0,0 @@
1
- 'use strict';
2
-
3
- var commonStyles = {"component":"tabs__component_nesyh","container":"tabs__container_nesyh","title":"tabs__title_nesyh","disabled":"tabs__disabled_nesyh","focused":"tabs__focused_nesyh","selected":"tabs__selected_nesyh","line":"tabs__line_nesyh","scrollable":"tabs__scrollable_nesyh","s":"tabs__s_nesyh","m":"tabs__m_nesyh","l":"tabs__l_nesyh","xl":"tabs__xl_nesyh","rightAddons":"tabs__rightAddons_nesyh"};
4
- require('./components/primary-tablist/index.css')
5
-
6
- exports.commonStyles = commonStyles;
@@ -1,4 +0,0 @@
1
- var commonStyles = {"component":"tabs__component_dapm9","container":"tabs__container_dapm9","title":"tabs__title_dapm9","s":"tabs__s_dapm9","m":"tabs__m_dapm9","l":"tabs__l_dapm9","xl":"tabs__xl_dapm9"};
2
- require('./components/secondary-tablist/index.css')
3
-
4
- export { commonStyles as c };
@@ -1,4 +0,0 @@
1
- var commonStyles = {"component":"tabs__component_nesyh","container":"tabs__container_nesyh","title":"tabs__title_nesyh","disabled":"tabs__disabled_nesyh","focused":"tabs__focused_nesyh","selected":"tabs__selected_nesyh","line":"tabs__line_nesyh","scrollable":"tabs__scrollable_nesyh","s":"tabs__s_nesyh","m":"tabs__m_nesyh","l":"tabs__l_nesyh","xl":"tabs__xl_nesyh","rightAddons":"tabs__rightAddons_nesyh"};
2
- require('./components/primary-tablist/index.css')
3
-
4
- export { commonStyles as c };