@alfalab/core-components-tab-bar 2.0.8 → 2.1.1

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/Component.js CHANGED
@@ -13,7 +13,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
13
13
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
14
14
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
15
15
 
16
- var styles = {"component":"tab-bar__component_1ppo6","modal-bg-primary":"tab-bar__modal-bg-primary_1ppo6","modal-bg-alt-primary":"tab-bar__modal-bg-alt-primary_1ppo6","border":"tab-bar__border_1ppo6"};
16
+ var styles = {"component":"tab-bar__component_9k0ye","modal-bg-primary":"tab-bar__modal-bg-primary_9k0ye","modal-bg-alt-primary":"tab-bar__modal-bg-alt-primary_9k0ye","border":"tab-bar__border_9k0ye"};
17
17
  require('./index.css')
18
18
 
19
19
  var TabBarComponent = React.forwardRef(function (_a, ref) {
@@ -14,7 +14,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
14
14
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
15
15
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
16
16
 
17
- var styles = {"component":"tab-bar__component_bqjx3","primary":"tab-bar__primary_bqjx3","secondary":"tab-bar__secondary_bqjx3","icon":"tab-bar__icon_bqjx3","label":"tab-bar__label_bqjx3","labelSelected":"tab-bar__labelSelected_bqjx3","indicator":"tab-bar__indicator_bqjx3"};
17
+ var styles = {"component":"tab-bar__component_1bx2r","primary":"tab-bar__primary_1bx2r","secondary":"tab-bar__secondary_1bx2r","icon":"tab-bar__icon_1bx2r","label":"tab-bar__label_1bx2r","labelSelected":"tab-bar__labelSelected_1bx2r","indicator":"tab-bar__indicator_1bx2r"};
18
18
  require('./index.css')
19
19
 
20
20
  var TabComponent = React.forwardRef(function (_a, ref) {
@@ -1,4 +1,4 @@
1
- /* hash: 1l5ez */
1
+ /* hash: 1ahji */
2
2
  :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 */ /* 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 */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-accent-primary: #ef3124;
@@ -22,17 +22,18 @@
22
22
  --gap-xs: 8px; /* 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 */
23
23
 
24
24
  /* новые значения, используйте их */
25
+ --gap-0: 0;
25
26
  --gap-4: var(--gap-2xs);
26
27
  --gap-8: var(--gap-xs);
27
28
  } :root {
28
29
  } :root {
29
- } .tab-bar__component_bqjx3 {
30
+ } .tab-bar__component_1bx2r {
30
31
  box-sizing: border-box;
31
32
  background-color: transparent;
32
33
  -webkit-tap-highlight-color: transparent;
33
34
  outline: none;
34
35
  border: 0;
35
- margin: 0;
36
+ margin: var(--gap-0);
36
37
  box-shadow: none;
37
38
  border-radius: 0;
38
39
  -webkit-user-select: none;
@@ -48,19 +49,19 @@
48
49
  flex-direction: column;
49
50
  flex: 1 0 0;
50
51
  align-items: center;
51
- padding: var(--gap-8) 0;
52
+ padding: var(--gap-8) var(--gap-0);
52
53
  color: var(--color-light-neutral-translucent-700);
53
- } .tab-bar__primary_bqjx3 {
54
+ } .tab-bar__primary_1bx2r {
54
55
  color: var(--color-light-accent-primary);
55
- } .tab-bar__secondary_bqjx3 {
56
+ } .tab-bar__secondary_1bx2r {
56
57
  color: var(--color-light-accent-secondary);
57
- } .tab-bar__icon_bqjx3 {
58
+ } .tab-bar__icon_1bx2r {
58
59
  display: flex;
59
60
  align-items: center;
60
61
  justify-content: center;
61
62
  flex-grow: 1;
62
63
  width: 100%;
63
- } .tab-bar__label_bqjx3 {
64
+ } .tab-bar__label_1bx2r {
64
65
  -webkit-line-clamp: 1;
65
66
  display: -webkit-box;
66
67
  -webkit-box-orient: vertical;
@@ -69,9 +70,9 @@
69
70
  flex-shrink: 0;
70
71
 
71
72
  color: var(--color-light-text-secondary);
72
- } .tab-bar__labelSelected_bqjx3 {
73
+ } .tab-bar__labelSelected_1bx2r {
73
74
  color: inherit;
74
- } .tab-bar__indicator_bqjx3 {
75
+ } .tab-bar__indicator_1bx2r {
75
76
  position: absolute;
76
77
  top: 3px;
77
78
  left: calc(50% + var(--gap-4));
@@ -21,6 +21,7 @@
21
21
  --gap-xs: 8px; /* 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 */
22
22
 
23
23
  /* новые значения, используйте их */
24
+ --gap-0: 0;
24
25
  --gap-4: var(--gap-2xs);
25
26
  --gap-8: var(--gap-xs);
26
27
  } :root {
@@ -31,7 +32,7 @@
31
32
  -webkit-tap-highlight-color: transparent;
32
33
  outline: none;
33
34
  border: 0;
34
- margin: 0;
35
+ margin: var(--gap-0);
35
36
  box-shadow: none;
36
37
  border-radius: 0;
37
38
  -webkit-user-select: none;
@@ -47,7 +48,7 @@
47
48
  flex-direction: column;
48
49
  flex: 1 0 0;
49
50
  align-items: center;
50
- padding: var(--gap-8) 0;
51
+ padding: var(--gap-8) var(--gap-0);
51
52
  color: var(--color-light-neutral-translucent-700);
52
53
  } .primary {
53
54
  color: var(--color-light-accent-primary);
package/esm/Component.js CHANGED
@@ -4,7 +4,7 @@ import cn from 'classnames';
4
4
  import { getDataTestId } from '@alfalab/core-components-shared/esm';
5
5
  import { Tab } from './components/tab/Component.js';
6
6
 
7
- var styles = {"component":"tab-bar__component_1ppo6","modal-bg-primary":"tab-bar__modal-bg-primary_1ppo6","modal-bg-alt-primary":"tab-bar__modal-bg-alt-primary_1ppo6","border":"tab-bar__border_1ppo6"};
7
+ var styles = {"component":"tab-bar__component_9k0ye","modal-bg-primary":"tab-bar__modal-bg-primary_9k0ye","modal-bg-alt-primary":"tab-bar__modal-bg-alt-primary_9k0ye","border":"tab-bar__border_9k0ye"};
8
8
  require('./index.css')
9
9
 
10
10
  var TabBarComponent = forwardRef(function (_a, ref) {
@@ -5,7 +5,7 @@ import { Indicator } from '@alfalab/core-components-indicator/esm';
5
5
  import { Typography } from '@alfalab/core-components-typography/esm';
6
6
  import { INDICATOR_BORDER_COLOR, INDICATOR_BG_COLOR } from '../../consts.js';
7
7
 
8
- var styles = {"component":"tab-bar__component_bqjx3","primary":"tab-bar__primary_bqjx3","secondary":"tab-bar__secondary_bqjx3","icon":"tab-bar__icon_bqjx3","label":"tab-bar__label_bqjx3","labelSelected":"tab-bar__labelSelected_bqjx3","indicator":"tab-bar__indicator_bqjx3"};
8
+ var styles = {"component":"tab-bar__component_1bx2r","primary":"tab-bar__primary_1bx2r","secondary":"tab-bar__secondary_1bx2r","icon":"tab-bar__icon_1bx2r","label":"tab-bar__label_1bx2r","labelSelected":"tab-bar__labelSelected_1bx2r","indicator":"tab-bar__indicator_1bx2r"};
9
9
  require('./index.css')
10
10
 
11
11
  var TabComponent = forwardRef(function (_a, ref) {
@@ -1,4 +1,4 @@
1
- /* hash: 1l5ez */
1
+ /* hash: 1ahji */
2
2
  :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 */ /* 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 */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-accent-primary: #ef3124;
@@ -22,17 +22,18 @@
22
22
  --gap-xs: 8px; /* 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 */
23
23
 
24
24
  /* новые значения, используйте их */
25
+ --gap-0: 0;
25
26
  --gap-4: var(--gap-2xs);
26
27
  --gap-8: var(--gap-xs);
27
28
  } :root {
28
29
  } :root {
29
- } .tab-bar__component_bqjx3 {
30
+ } .tab-bar__component_1bx2r {
30
31
  box-sizing: border-box;
31
32
  background-color: transparent;
32
33
  -webkit-tap-highlight-color: transparent;
33
34
  outline: none;
34
35
  border: 0;
35
- margin: 0;
36
+ margin: var(--gap-0);
36
37
  box-shadow: none;
37
38
  border-radius: 0;
38
39
  -webkit-user-select: none;
@@ -48,19 +49,19 @@
48
49
  flex-direction: column;
49
50
  flex: 1 0 0;
50
51
  align-items: center;
51
- padding: var(--gap-8) 0;
52
+ padding: var(--gap-8) var(--gap-0);
52
53
  color: var(--color-light-neutral-translucent-700);
53
- } .tab-bar__primary_bqjx3 {
54
+ } .tab-bar__primary_1bx2r {
54
55
  color: var(--color-light-accent-primary);
55
- } .tab-bar__secondary_bqjx3 {
56
+ } .tab-bar__secondary_1bx2r {
56
57
  color: var(--color-light-accent-secondary);
57
- } .tab-bar__icon_bqjx3 {
58
+ } .tab-bar__icon_1bx2r {
58
59
  display: flex;
59
60
  align-items: center;
60
61
  justify-content: center;
61
62
  flex-grow: 1;
62
63
  width: 100%;
63
- } .tab-bar__label_bqjx3 {
64
+ } .tab-bar__label_1bx2r {
64
65
  -webkit-line-clamp: 1;
65
66
  display: -webkit-box;
66
67
  -webkit-box-orient: vertical;
@@ -69,9 +70,9 @@
69
70
  flex-shrink: 0;
70
71
 
71
72
  color: var(--color-light-text-secondary);
72
- } .tab-bar__labelSelected_bqjx3 {
73
+ } .tab-bar__labelSelected_1bx2r {
73
74
  color: inherit;
74
- } .tab-bar__indicator_bqjx3 {
75
+ } .tab-bar__indicator_1bx2r {
75
76
  position: absolute;
76
77
  top: 3px;
77
78
  left: calc(50% + var(--gap-4));
package/esm/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 1cyul */
1
+ /* hash: 1sc93 */
2
2
  :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 */ /* 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 */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-base-bg-alt-primary: #f2f3f5;
@@ -21,7 +21,7 @@
21
21
  /* новые значения, используйте их */
22
22
  } :root {
23
23
  } :root {
24
- } .tab-bar__component_1ppo6 {
24
+ } .tab-bar__component_9k0ye {
25
25
  display: flex;
26
26
  justify-content: center;
27
27
  height: 64px;
@@ -29,10 +29,10 @@
29
29
  box-sizing: border-box;
30
30
  overflow: hidden;
31
31
  transition: box-shadow 0.2s ease
32
- } .tab-bar__component_1ppo6.tab-bar__modal-bg-primary_1ppo6 {
32
+ } .tab-bar__component_9k0ye.tab-bar__modal-bg-primary_9k0ye {
33
33
  background-color: var(--color-light-base-bg-primary);
34
- } .tab-bar__component_1ppo6.tab-bar__modal-bg-alt-primary_1ppo6 {
34
+ } .tab-bar__component_9k0ye.tab-bar__modal-bg-alt-primary_9k0ye {
35
35
  background-color: var(--color-light-base-bg-alt-primary);
36
- } .tab-bar__border_1ppo6 {
36
+ } .tab-bar__border_9k0ye {
37
37
  box-shadow: 0 -1px 0 0 var(--color-light-neutral-translucent-300);
38
38
  }
package/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 1cyul */
1
+ /* hash: 1sc93 */
2
2
  :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 */ /* 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 */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-base-bg-alt-primary: #f2f3f5;
@@ -21,7 +21,7 @@
21
21
  /* новые значения, используйте их */
22
22
  } :root {
23
23
  } :root {
24
- } .tab-bar__component_1ppo6 {
24
+ } .tab-bar__component_9k0ye {
25
25
  display: flex;
26
26
  justify-content: center;
27
27
  height: 64px;
@@ -29,10 +29,10 @@
29
29
  box-sizing: border-box;
30
30
  overflow: hidden;
31
31
  transition: box-shadow 0.2s ease
32
- } .tab-bar__component_1ppo6.tab-bar__modal-bg-primary_1ppo6 {
32
+ } .tab-bar__component_9k0ye.tab-bar__modal-bg-primary_9k0ye {
33
33
  background-color: var(--color-light-base-bg-primary);
34
- } .tab-bar__component_1ppo6.tab-bar__modal-bg-alt-primary_1ppo6 {
34
+ } .tab-bar__component_9k0ye.tab-bar__modal-bg-alt-primary_9k0ye {
35
35
  background-color: var(--color-light-base-bg-alt-primary);
36
- } .tab-bar__border_1ppo6 {
36
+ } .tab-bar__border_9k0ye {
37
37
  box-shadow: 0 -1px 0 0 var(--color-light-neutral-translucent-300);
38
38
  }
@@ -3,7 +3,7 @@ import cn from 'classnames';
3
3
  import { getDataTestId } from '@alfalab/core-components-shared/modern';
4
4
  import { Tab } from './components/tab/Component.js';
5
5
 
6
- const styles = {"component":"tab-bar__component_1ppo6","modal-bg-primary":"tab-bar__modal-bg-primary_1ppo6","modal-bg-alt-primary":"tab-bar__modal-bg-alt-primary_1ppo6","border":"tab-bar__border_1ppo6"};
6
+ const styles = {"component":"tab-bar__component_9k0ye","modal-bg-primary":"tab-bar__modal-bg-primary_9k0ye","modal-bg-alt-primary":"tab-bar__modal-bg-alt-primary_9k0ye","border":"tab-bar__border_9k0ye"};
7
7
  require('./index.css')
8
8
 
9
9
  const TabBarComponent = forwardRef(({ children, className, selectedId, border, dataTestId, tabClassNames, onChange, accentColor = 'primary', bgColor = 'modal-bg-primary', ...restProps }, ref) => {
@@ -4,7 +4,7 @@ import { Indicator } from '@alfalab/core-components-indicator/modern';
4
4
  import { Typography } from '@alfalab/core-components-typography/modern';
5
5
  import { INDICATOR_BORDER_COLOR, INDICATOR_BG_COLOR } from '../../consts.js';
6
6
 
7
- const styles = {"component":"tab-bar__component_bqjx3","primary":"tab-bar__primary_bqjx3","secondary":"tab-bar__secondary_bqjx3","icon":"tab-bar__icon_bqjx3","label":"tab-bar__label_bqjx3","labelSelected":"tab-bar__labelSelected_bqjx3","indicator":"tab-bar__indicator_bqjx3"};
7
+ const styles = {"component":"tab-bar__component_1bx2r","primary":"tab-bar__primary_1bx2r","secondary":"tab-bar__secondary_1bx2r","icon":"tab-bar__icon_1bx2r","label":"tab-bar__label_1bx2r","labelSelected":"tab-bar__labelSelected_1bx2r","indicator":"tab-bar__indicator_1bx2r"};
8
8
  require('./index.css')
9
9
 
10
10
  const TabComponent = forwardRef(({ showIndicator, indicatorProps, label, icon, id, selected, onChange, onClick, tabClassNames = {}, dataTestId, className, labelClassName, selectedClassName, iconClassName, href, Component = href ? 'a' : 'button', accentColor = 'primary', bgColor = 'modal-bg-primary', ...restProps }, ref) => {
@@ -1,4 +1,4 @@
1
- /* hash: 1l5ez */
1
+ /* hash: 1ahji */
2
2
  :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 */ /* 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 */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-accent-primary: #ef3124;
@@ -22,17 +22,18 @@
22
22
  --gap-xs: 8px; /* 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 */
23
23
 
24
24
  /* новые значения, используйте их */
25
+ --gap-0: 0;
25
26
  --gap-4: var(--gap-2xs);
26
27
  --gap-8: var(--gap-xs);
27
28
  } :root {
28
29
  } :root {
29
- } .tab-bar__component_bqjx3 {
30
+ } .tab-bar__component_1bx2r {
30
31
  box-sizing: border-box;
31
32
  background-color: transparent;
32
33
  -webkit-tap-highlight-color: transparent;
33
34
  outline: none;
34
35
  border: 0;
35
- margin: 0;
36
+ margin: var(--gap-0);
36
37
  box-shadow: none;
37
38
  border-radius: 0;
38
39
  -webkit-user-select: none;
@@ -48,19 +49,19 @@
48
49
  flex-direction: column;
49
50
  flex: 1 0 0;
50
51
  align-items: center;
51
- padding: var(--gap-8) 0;
52
+ padding: var(--gap-8) var(--gap-0);
52
53
  color: var(--color-light-neutral-translucent-700);
53
- } .tab-bar__primary_bqjx3 {
54
+ } .tab-bar__primary_1bx2r {
54
55
  color: var(--color-light-accent-primary);
55
- } .tab-bar__secondary_bqjx3 {
56
+ } .tab-bar__secondary_1bx2r {
56
57
  color: var(--color-light-accent-secondary);
57
- } .tab-bar__icon_bqjx3 {
58
+ } .tab-bar__icon_1bx2r {
58
59
  display: flex;
59
60
  align-items: center;
60
61
  justify-content: center;
61
62
  flex-grow: 1;
62
63
  width: 100%;
63
- } .tab-bar__label_bqjx3 {
64
+ } .tab-bar__label_1bx2r {
64
65
  -webkit-line-clamp: 1;
65
66
  display: -webkit-box;
66
67
  -webkit-box-orient: vertical;
@@ -69,9 +70,9 @@
69
70
  flex-shrink: 0;
70
71
 
71
72
  color: var(--color-light-text-secondary);
72
- } .tab-bar__labelSelected_bqjx3 {
73
+ } .tab-bar__labelSelected_1bx2r {
73
74
  color: inherit;
74
- } .tab-bar__indicator_bqjx3 {
75
+ } .tab-bar__indicator_1bx2r {
75
76
  position: absolute;
76
77
  top: 3px;
77
78
  left: calc(50% + var(--gap-4));
package/modern/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 1cyul */
1
+ /* hash: 1sc93 */
2
2
  :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 */ /* 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 */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-base-bg-alt-primary: #f2f3f5;
@@ -21,7 +21,7 @@
21
21
  /* новые значения, используйте их */
22
22
  } :root {
23
23
  } :root {
24
- } .tab-bar__component_1ppo6 {
24
+ } .tab-bar__component_9k0ye {
25
25
  display: flex;
26
26
  justify-content: center;
27
27
  height: 64px;
@@ -29,10 +29,10 @@
29
29
  box-sizing: border-box;
30
30
  overflow: hidden;
31
31
  transition: box-shadow 0.2s ease
32
- } .tab-bar__component_1ppo6.tab-bar__modal-bg-primary_1ppo6 {
32
+ } .tab-bar__component_9k0ye.tab-bar__modal-bg-primary_9k0ye {
33
33
  background-color: var(--color-light-base-bg-primary);
34
- } .tab-bar__component_1ppo6.tab-bar__modal-bg-alt-primary_1ppo6 {
34
+ } .tab-bar__component_9k0ye.tab-bar__modal-bg-alt-primary_9k0ye {
35
35
  background-color: var(--color-light-base-bg-alt-primary);
36
- } .tab-bar__border_1ppo6 {
36
+ } .tab-bar__border_9k0ye {
37
37
  box-shadow: 0 -1px 0 0 var(--color-light-neutral-translucent-300);
38
38
  }
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ import { TabBarProps } from "./types";
4
+ declare const TabBar: React.ForwardRefExoticComponent<TabBarProps & React.RefAttributes<HTMLDivElement>> & {
5
+ Tab: React.ForwardRefExoticComponent<import("./types").TabProps & React.RefAttributes<HTMLElement>>;
6
+ };
7
+ export { TabBar };
@@ -0,0 +1,26 @@
1
+ import React, { forwardRef, Children, cloneElement } from 'react';
2
+ import cn from 'classnames';
3
+ import { getDataTestId } from '@alfalab/core-components-shared/moderncssm';
4
+ import { Tab } from './components/tab/Component.js';
5
+ import styles from './index.module.css';
6
+
7
+ const TabBarComponent = forwardRef(({ children, className, selectedId, border, dataTestId, tabClassNames, onChange, accentColor = 'primary', bgColor = 'modal-bg-primary', ...restProps }, ref) => {
8
+ if (Children.count(children) > 5) {
9
+ // eslint-disable-next-line no-console
10
+ console.error('Компонент TabBar не может содержать больше 5 табов');
11
+ }
12
+ return (React.createElement("nav", { "data-test-id": dataTestId, ...restProps, ref: ref, className: cn(styles.component, styles[bgColor], className, {
13
+ [styles.border]: border,
14
+ }) }, Children.map(children, (tab) => cloneElement(tab, {
15
+ bgColor,
16
+ accentColor,
17
+ selected: tab.props.id === selectedId,
18
+ onChange,
19
+ tabClassNames,
20
+ dataTestId: getDataTestId(dataTestId, 'tab'),
21
+ }))));
22
+ });
23
+ TabBarComponent.displayName = 'TabBarComponent';
24
+ const TabBar = Object.assign(TabBarComponent, { Tab });
25
+
26
+ export { TabBar };
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ import { TabProps } from "../../types";
4
+ declare const Tab: React.ForwardRefExoticComponent<TabProps & React.RefAttributes<HTMLElement>>;
5
+ export { Tab };
@@ -0,0 +1,29 @@
1
+ import React, { forwardRef, isValidElement, cloneElement } from 'react';
2
+ import cn from 'classnames';
3
+ import { Indicator } from '@alfalab/core-components-indicator/moderncssm';
4
+ import { Typography } from '@alfalab/core-components-typography/moderncssm';
5
+ import { INDICATOR_BORDER_COLOR, INDICATOR_BG_COLOR } from '../../consts.js';
6
+ import styles from './index.module.css';
7
+
8
+ const TabComponent = forwardRef(({ showIndicator, indicatorProps, label, icon, id, selected, onChange, onClick, tabClassNames = {}, dataTestId, className, labelClassName, selectedClassName, iconClassName, href, Component = href ? 'a' : 'button', accentColor = 'primary', bgColor = 'modal-bg-primary', ...restProps }, ref) => {
9
+ const handleClick = (event) => {
10
+ onChange?.(id);
11
+ onClick?.(event);
12
+ };
13
+ const { className: commonClassName, labelClassName: commonLabelClassName, selectedClassName: commonSelectedClassName, iconClassName: commonIconClassName, } = tabClassNames;
14
+ return (React.createElement(Component, { "data-test-id": dataTestId, tabIndex: 0, ...(Component === 'button' ? { type: 'button' } : null), ...restProps, href: href, id: id, ref: ref, className: cn(styles.component, commonClassName, className, selected && commonSelectedClassName, selected && selectedClassName, {
15
+ [styles[accentColor]]: selected,
16
+ }), onClick: handleClick },
17
+ React.createElement("div", { className: cn(styles.icon, commonIconClassName, iconClassName) }, isValidElement(icon) ? cloneElement(icon, { selected }) : icon),
18
+ React.createElement(Typography.Text, { weight: 'medium', view: 'secondary-small', className: cn(styles.label, commonLabelClassName, labelClassName, {
19
+ [styles.labelSelected]: selected,
20
+ }) }, isValidElement(label) ? cloneElement(label, { selected }) : label),
21
+ showIndicator && (React.createElement("div", { className: styles.indicator },
22
+ React.createElement(Indicator, { ...indicatorProps, height: indicatorProps?.value ? 16 : undefined, border: {
23
+ width: 2,
24
+ color: INDICATOR_BORDER_COLOR[bgColor],
25
+ }, backgroundColor: INDICATOR_BG_COLOR[accentColor] })))));
26
+ });
27
+ const Tab = TabComponent;
28
+
29
+ export { Tab };
@@ -0,0 +1 @@
1
+ export * from "./Component";
@@ -0,0 +1 @@
1
+ export { Tab } from './Component.js';
@@ -0,0 +1,66 @@
1
+ /* */
2
+
3
+ .component {
4
+ box-sizing: border-box;
5
+ background-color: transparent;
6
+ -webkit-tap-highlight-color: transparent;
7
+ outline: none;
8
+ border: 0;
9
+ margin: var(--gap-0);
10
+ box-shadow: none;
11
+ border-radius: 0;
12
+ -webkit-user-select: none;
13
+ user-select: none;
14
+ vertical-align: middle;
15
+ appearance: none;
16
+ text-decoration: none;
17
+ min-width: 0;
18
+ cursor: pointer;
19
+
20
+ position: relative;
21
+ display: inline-flex;
22
+ flex-direction: column;
23
+ flex: 1 0 0;
24
+ align-items: center;
25
+ padding: var(--gap-8) var(--gap-0);
26
+ color: var(--color-light-neutral-translucent-700);
27
+ }
28
+
29
+ .primary {
30
+ color: var(--color-light-accent-primary);
31
+ }
32
+
33
+ .secondary {
34
+ color: var(--color-light-accent-secondary);
35
+ }
36
+
37
+ .icon {
38
+ display: flex;
39
+ align-items: center;
40
+ justify-content: center;
41
+ flex-grow: 1;
42
+ width: 100%;
43
+ }
44
+
45
+ .label {
46
+ -webkit-line-clamp: 1;
47
+ display: -webkit-box;
48
+ -webkit-box-orient: vertical;
49
+ overflow: hidden;
50
+ word-break: break-all;
51
+ flex-shrink: 0;
52
+
53
+ color: var(--color-light-text-secondary);
54
+ }
55
+
56
+ .labelSelected {
57
+ color: inherit;
58
+ }
59
+
60
+ .indicator {
61
+ position: absolute;
62
+ top: 3px;
63
+ left: calc(50% + var(--gap-4));
64
+ height: 16px;
65
+ min-width: 16px;
66
+ }
@@ -0,0 +1,9 @@
1
+ declare const INDICATOR_BORDER_COLOR: {
2
+ 'modal-bg-primary': string;
3
+ 'modal-bg-alt-primary': string;
4
+ };
5
+ declare const INDICATOR_BG_COLOR: {
6
+ primary: string;
7
+ secondary: string;
8
+ };
9
+ export { INDICATOR_BORDER_COLOR, INDICATOR_BG_COLOR };
@@ -0,0 +1,10 @@
1
+ const INDICATOR_BORDER_COLOR = {
2
+ 'modal-bg-primary': 'var(--color-light-base-bg-primary)',
3
+ 'modal-bg-alt-primary': 'var(--color-light-base-bg-alt-primary)',
4
+ };
5
+ const INDICATOR_BG_COLOR = {
6
+ primary: 'var(--color-light-accent-primary)',
7
+ secondary: 'var(--color-light-accent-secondary)',
8
+ };
9
+
10
+ export { INDICATOR_BG_COLOR, INDICATOR_BORDER_COLOR };
@@ -0,0 +1,2 @@
1
+ export { TabBar } from "./Component";
2
+ export { TabBarProps, TabProps } from "./types";
@@ -0,0 +1 @@
1
+ export { TabBar } from './Component.js';
@@ -0,0 +1,23 @@
1
+ /* */
2
+
3
+ .component {
4
+ display: flex;
5
+ justify-content: center;
6
+ height: 64px;
7
+ max-height: 64px;
8
+ box-sizing: border-box;
9
+ overflow: hidden;
10
+ transition: box-shadow 0.2s ease
11
+ }
12
+
13
+ .component.modal-bg-primary {
14
+ background-color: var(--color-light-base-bg-primary);
15
+ }
16
+
17
+ .component.modal-bg-alt-primary {
18
+ background-color: var(--color-light-base-bg-alt-primary);
19
+ }
20
+
21
+ .border {
22
+ box-shadow: 0 -1px 0 0 var(--color-light-neutral-translucent-300);
23
+ }
@@ -0,0 +1 @@
1
+ export { getTabBarTestIds } from "../utils";
@@ -0,0 +1 @@
1
+ export { getTabBarTestIds } from '../utils.js';
@@ -0,0 +1,107 @@
1
+ import { AllHTMLAttributes, ElementType, ForwardRefExoticComponent, HTMLAttributes, ReactElement, ReactNode, RefAttributes } from 'react';
2
+ import { IndicatorProps } from "@alfalab/core-components-indicator";
3
+ type TabElementType = ReactElement<TabProps, ForwardRefExoticComponent<TabProps & RefAttributes<HTMLElement>>>;
4
+ interface TabBarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
5
+ /**
6
+ * Дополнительный класс
7
+ */
8
+ className?: string;
9
+ /**
10
+ * Идентификатор для систем автоматизированного тестирования.
11
+ * Для таба используется модификатор -tab
12
+ */
13
+ dataTestId?: string;
14
+ /**
15
+ * Дополнительные классы для таба.
16
+ */
17
+ tabClassNames?: {
18
+ /**
19
+ * Дополнительный класс таба
20
+ */
21
+ className?: string;
22
+ /**
23
+ * Дополнительный класс таба в выбранном состоянии
24
+ */
25
+ selectedClassName?: string;
26
+ /**
27
+ * Дополнительный класс подписи
28
+ */
29
+ labelClassName?: string;
30
+ /**
31
+ * Дополнительный класс враппера иконки
32
+ */
33
+ iconClassName?: string;
34
+ };
35
+ /**
36
+ * Список табов
37
+ */
38
+ children: TabElementType[];
39
+ /**
40
+ * Идентификатор выбранного таба
41
+ */
42
+ selectedId?: string;
43
+ /**
44
+ * Включает верхний бордер
45
+ */
46
+ border?: boolean;
47
+ /**
48
+ * Обработчик изменения выбранного таба
49
+ */
50
+ onChange?: (id: string) => void;
51
+ /**
52
+ * Цвет активного таба
53
+ */
54
+ accentColor?: 'primary' | 'secondary';
55
+ /**
56
+ * Цвет фона
57
+ */
58
+ bgColor?: 'modal-bg-primary' | 'modal-bg-alt-primary';
59
+ }
60
+ type AdditionalTabProps = Record<string, unknown>;
61
+ interface TabProps extends Omit<AllHTMLAttributes<unknown>, 'onChange' | 'label'>, AdditionalTabProps {
62
+ /**
63
+ * Кастомный компонент таба.
64
+ * @default button
65
+ */
66
+ Component?: ElementType;
67
+ /**
68
+ * Идентификатор таба
69
+ */
70
+ id: string;
71
+ /**
72
+ * Лейбл
73
+ */
74
+ label: ReactNode;
75
+ /**
76
+ * Иконка
77
+ */
78
+ icon: ReactNode;
79
+ /**
80
+ * Показать индикатор
81
+ */
82
+ showIndicator?: boolean;
83
+ /**
84
+ * Свойства индикатора
85
+ */
86
+ indicatorProps?: Omit<IndicatorProps, 'color' | 'backgroundColor' | 'border' | 'view' | 'size' | 'height'>;
87
+ /**
88
+ * Дополнительный класс таба
89
+ */
90
+ className?: string;
91
+ /**
92
+ * Дополнительный класс таба в выбранном состоянии
93
+ */
94
+ selectedClassName?: string;
95
+ /**
96
+ * Дополнительный класс подписи
97
+ */
98
+ labelClassName?: string;
99
+ /**
100
+ * Дополнительный класс враппера иконки
101
+ */
102
+ iconClassName?: string;
103
+ }
104
+ interface PrivateTabProps extends Pick<TabBarProps, 'tabClassNames' | 'onChange' | 'dataTestId' | 'accentColor' | 'bgColor'> {
105
+ selected: boolean;
106
+ }
107
+ export { TabBarProps, TabProps, PrivateTabProps };
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,5 @@
1
+ declare function getTabBarTestIds(dataTestId: string): {
2
+ tabBar: string;
3
+ tab: string;
4
+ };
5
+ export { getTabBarTestIds };
@@ -0,0 +1,10 @@
1
+ import { getDataTestId } from '@alfalab/core-components-shared/moderncssm';
2
+
3
+ function getTabBarTestIds(dataTestId) {
4
+ return {
5
+ tabBar: dataTestId,
6
+ tab: getDataTestId(dataTestId, 'tab'),
7
+ };
8
+ }
9
+
10
+ export { getTabBarTestIds };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-tab-bar",
3
- "version": "2.0.8",
3
+ "version": "2.1.1",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -15,12 +15,12 @@
15
15
  "react-dom": ">=16.8.0"
16
16
  },
17
17
  "dependencies": {
18
- "@alfalab/core-components-typography": "^4.9.0",
19
- "@alfalab/core-components-indicator": "^2.1.1",
20
- "@alfalab/core-components-shared": "^0.12.0",
18
+ "@alfalab/core-components-typography": "^4.10.1",
19
+ "@alfalab/core-components-indicator": "^2.2.1",
20
+ "@alfalab/core-components-shared": "^0.12.1",
21
21
  "classnames": "^2.3.1",
22
22
  "tslib": "^2.4.0"
23
23
  },
24
- "themesVersion": "13.0.2",
25
- "varsVersion": "9.11.1"
24
+ "themesVersion": "13.2.0",
25
+ "varsVersion": "9.13.0"
26
26
  }
@@ -1,4 +1,4 @@
1
- @import '@alfalab/core-components-themes/src/default.css';
1
+ @import '@alfalab/core-components-vars/src/index.css';
2
2
 
3
3
  .component {
4
4
  @mixin button-reset;
@@ -8,7 +8,7 @@
8
8
  flex-direction: column;
9
9
  flex: 1 0 0;
10
10
  align-items: center;
11
- padding: var(--gap-8) 0;
11
+ padding: var(--gap-8) var(--gap-0);
12
12
  color: var(--color-light-neutral-translucent-700);
13
13
  }
14
14
 
@@ -1,4 +1,4 @@
1
- @import '@alfalab/core-components-themes/src/default.css';
1
+ @import '@alfalab/core-components-vars/src/index.css';
2
2
 
3
3
  .component {
4
4
  display: flex;