@salutejs/plasma-new-hope 0.173.4-canary.1502.11517986665.0 → 0.173.4-canary.1508.11518994013.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. package/cjs/components/Drawer/Drawer.js +2 -1
  2. package/cjs/components/Drawer/Drawer.js.map +1 -1
  3. package/cjs/components/Tabs/createTabsController.js.map +1 -1
  4. package/cjs/components/Tabs/tokens.js +0 -2
  5. package/cjs/components/Tabs/tokens.js.map +1 -1
  6. package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +1 -3
  7. package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js.map +1 -1
  8. package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.css +5 -5
  9. package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js +8 -20
  10. package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js.map +1 -1
  11. package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.js +1 -1
  12. package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.js.map +1 -1
  13. package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/{HorizontalTabs.styles_p9rk79.css → HorizontalTabs.styles_16kuvxt.css} +1 -1
  14. package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.js +1 -1
  15. package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.js.map +1 -1
  16. package/{es/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base_4ob3q5.css → cjs/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base_9miwn.css} +1 -1
  17. package/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.css +4 -4
  18. package/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js +6 -7
  19. package/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js.map +1 -1
  20. package/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js +1 -1
  21. package/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js.map +1 -1
  22. package/{es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles_1r1hidh.css → cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles_1fr5ovg.css} +1 -1
  23. package/cjs/index.css +9 -9
  24. package/emotion/cjs/components/Drawer/Drawer.js +4 -3
  25. package/emotion/cjs/components/Tabs/tokens.js +0 -2
  26. package/emotion/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +1 -3
  27. package/emotion/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js +8 -20
  28. package/emotion/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.js +4 -4
  29. package/emotion/cjs/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.js +1 -1
  30. package/emotion/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js +6 -7
  31. package/emotion/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js +4 -4
  32. package/emotion/cjs/examples/plasma_b2c/components/Tabs/Tabs.stories.tsx +33 -72
  33. package/emotion/cjs/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.js +15 -15
  34. package/emotion/cjs/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabs.config.js +15 -15
  35. package/emotion/cjs/examples/plasma_b2c/components/Tabs/vertical/VerticalTabs.config.js +6 -6
  36. package/emotion/cjs/examples/plasma_web/components/Tabs/Tabs.stories.tsx +33 -72
  37. package/emotion/cjs/examples/plasma_web/components/Tabs/horizontal/HorizontalTabItem.config.js +15 -15
  38. package/emotion/cjs/examples/plasma_web/components/Tabs/horizontal/HorizontalTabs.config.js +15 -15
  39. package/emotion/cjs/examples/plasma_web/components/Tabs/vertical/VerticalTabs.config.js +6 -6
  40. package/emotion/es/components/Drawer/Drawer.js +2 -1
  41. package/emotion/es/components/Tabs/tokens.js +0 -2
  42. package/emotion/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +1 -3
  43. package/emotion/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js +9 -21
  44. package/emotion/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.js +4 -4
  45. package/emotion/es/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.js +1 -1
  46. package/emotion/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js +7 -8
  47. package/emotion/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js +4 -4
  48. package/emotion/es/examples/plasma_b2c/components/Tabs/Tabs.stories.tsx +33 -72
  49. package/emotion/es/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.js +15 -15
  50. package/emotion/es/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabs.config.js +15 -15
  51. package/emotion/es/examples/plasma_b2c/components/Tabs/vertical/VerticalTabs.config.js +6 -6
  52. package/emotion/es/examples/plasma_web/components/Tabs/Tabs.stories.tsx +33 -72
  53. package/emotion/es/examples/plasma_web/components/Tabs/horizontal/HorizontalTabItem.config.js +15 -15
  54. package/emotion/es/examples/plasma_web/components/Tabs/horizontal/HorizontalTabs.config.js +15 -15
  55. package/emotion/es/examples/plasma_web/components/Tabs/vertical/VerticalTabs.config.js +6 -6
  56. package/es/components/Drawer/Drawer.js +2 -1
  57. package/es/components/Drawer/Drawer.js.map +1 -1
  58. package/es/components/Tabs/createTabsController.js.map +1 -1
  59. package/es/components/Tabs/tokens.js +0 -2
  60. package/es/components/Tabs/tokens.js.map +1 -1
  61. package/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +1 -3
  62. package/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js.map +1 -1
  63. package/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.css +5 -5
  64. package/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js +9 -21
  65. package/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js.map +1 -1
  66. package/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.js +1 -1
  67. package/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.js.map +1 -1
  68. package/es/components/Tabs/ui/horizontal/HorizontalTabs/{HorizontalTabs.styles_p9rk79.css → HorizontalTabs.styles_16kuvxt.css} +1 -1
  69. package/es/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.js +1 -1
  70. package/es/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.js.map +1 -1
  71. package/{cjs/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base_4ob3q5.css → es/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base_9miwn.css} +1 -1
  72. package/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.css +4 -4
  73. package/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js +7 -8
  74. package/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js.map +1 -1
  75. package/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js +1 -1
  76. package/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js.map +1 -1
  77. package/{cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles_1r1hidh.css → es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles_1fr5ovg.css} +1 -1
  78. package/es/index.css +9 -9
  79. package/package.json +2 -2
  80. package/styled-components/cjs/components/Drawer/Drawer.js +4 -3
  81. package/styled-components/cjs/components/Tabs/tokens.js +0 -2
  82. package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +1 -3
  83. package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js +8 -20
  84. package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.js +2 -2
  85. package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.js +1 -1
  86. package/styled-components/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js +6 -7
  87. package/styled-components/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js +2 -2
  88. package/styled-components/cjs/examples/plasma_b2c/components/Tabs/Tabs.stories.tsx +33 -72
  89. package/styled-components/cjs/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.js +2 -2
  90. package/styled-components/cjs/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabs.config.js +3 -3
  91. package/styled-components/cjs/examples/plasma_b2c/components/Tabs/vertical/VerticalTabs.config.js +1 -1
  92. package/styled-components/cjs/examples/plasma_web/components/Tabs/Tabs.stories.tsx +33 -72
  93. package/styled-components/cjs/examples/plasma_web/components/Tabs/horizontal/HorizontalTabItem.config.js +2 -2
  94. package/styled-components/cjs/examples/plasma_web/components/Tabs/horizontal/HorizontalTabs.config.js +3 -3
  95. package/styled-components/cjs/examples/plasma_web/components/Tabs/vertical/VerticalTabs.config.js +1 -1
  96. package/styled-components/es/components/Drawer/Drawer.js +2 -1
  97. package/styled-components/es/components/Tabs/tokens.js +0 -2
  98. package/styled-components/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +1 -3
  99. package/styled-components/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js +9 -21
  100. package/styled-components/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.js +2 -2
  101. package/styled-components/es/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.js +1 -1
  102. package/styled-components/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js +7 -8
  103. package/styled-components/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js +2 -2
  104. package/styled-components/es/examples/plasma_b2c/components/Tabs/Tabs.stories.tsx +33 -72
  105. package/styled-components/es/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.js +2 -2
  106. package/styled-components/es/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabs.config.js +3 -3
  107. package/styled-components/es/examples/plasma_b2c/components/Tabs/vertical/VerticalTabs.config.js +1 -1
  108. package/styled-components/es/examples/plasma_web/components/Tabs/Tabs.stories.tsx +33 -72
  109. package/styled-components/es/examples/plasma_web/components/Tabs/horizontal/HorizontalTabItem.config.js +2 -2
  110. package/styled-components/es/examples/plasma_web/components/Tabs/horizontal/HorizontalTabs.config.js +3 -3
  111. package/styled-components/es/examples/plasma_web/components/Tabs/vertical/VerticalTabs.config.js +1 -1
  112. package/types/components/Drawer/Drawer.d.ts.map +1 -1
  113. package/types/components/Tabs/TabItem.types.d.ts +8 -50
  114. package/types/components/Tabs/TabItem.types.d.ts.map +1 -1
  115. package/types/components/Tabs/Tabs.types.d.ts +2 -44
  116. package/types/components/Tabs/Tabs.types.d.ts.map +1 -1
  117. package/types/components/Tabs/createTabsController.d.ts +2 -2
  118. package/types/components/Tabs/createTabsController.d.ts.map +1 -1
  119. package/types/components/Tabs/index.d.ts +2 -2
  120. package/types/components/Tabs/index.d.ts.map +1 -1
  121. package/types/components/Tabs/tokens.d.ts +0 -2
  122. package/types/components/Tabs/tokens.d.ts.map +1 -1
  123. package/types/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.d.ts.map +1 -1
  124. package/types/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.d.ts +2 -2
  125. package/types/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.d.ts.map +1 -1
  126. package/types/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.d.ts.map +1 -1
  127. package/types/components/Tabs/ui/horizontal/HorizontalTabs/variations/_view/base.d.ts.map +1 -1
  128. package/types/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.d.ts.map +1 -1
  129. package/types/examples/plasma_b2c/components/Tabs/TabItem.d.ts +6 -21
  130. package/types/examples/plasma_b2c/components/Tabs/TabItem.d.ts.map +1 -1
  131. package/types/examples/plasma_b2c/components/Tabs/Tabs.d.ts +2 -2
  132. package/types/examples/plasma_b2c/components/Tabs/Tabs.d.ts.map +1 -1
  133. package/types/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabs.config.d.ts.map +1 -1
  134. package/types/examples/plasma_b2c/components/Tabs/vertical/VerticalTabs.config.d.ts.map +1 -1
  135. package/types/examples/plasma_web/components/Tabs/TabItem.d.ts +6 -21
  136. package/types/examples/plasma_web/components/Tabs/TabItem.d.ts.map +1 -1
  137. package/types/examples/plasma_web/components/Tabs/Tabs.d.ts +2 -2
  138. package/types/examples/plasma_web/components/Tabs/Tabs.d.ts.map +1 -1
  139. package/types/examples/plasma_web/components/Tabs/horizontal/HorizontalTabs.config.d.ts.map +1 -1
  140. package/types/examples/plasma_web/components/Tabs/vertical/VerticalTabs.config.d.ts.map +1 -1
@@ -17,7 +17,7 @@ var _base3 = /*#__PURE__*/require("./variations/_disabled/base");
17
17
  var _base4 = /*#__PURE__*/require("./variations/_pilled/base");
18
18
  var _base5 = /*#__PURE__*/require("./variations/_stretch/base");
19
19
  var _HorizontalTabs = /*#__PURE__*/require("./HorizontalTabs.styles");
20
- var _excluded = ["id", "stretch", "disabled", "clip", "size", "view", "children", "pilled", "index", "className", "hasDivider"];
20
+ var _excluded = ["id", "stretch", "disabled", "clip", "size", "view", "children", "pilled", "index", "className"];
21
21
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
22
22
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
23
23
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -35,12 +35,7 @@ var Keys = /*#__PURE__*/function (Keys) {
35
35
  Keys[Keys["left"] = 37] = "left";
36
36
  Keys[Keys["right"] = 39] = "right";
37
37
  return Keys;
38
- }(Keys || {});
39
- var getIconSize = function getIconSize(size) {
40
- return size === 'h1' || size === 'h2' ? 'm' : 's';
41
- };
42
-
43
- // TODO: https://github.com/salute-developers/plasma/issues/1474
38
+ }(Keys || {}); // TODO: https://github.com/salute-developers/plasma/issues/1474
44
39
  var horizontalTabsRoot = exports.horizontalTabsRoot = function horizontalTabsRoot(Root) {
45
40
  return /*#__PURE__*/(0, _react.forwardRef)(function (props, outerRef) {
46
41
  var id = props.id,
@@ -57,8 +52,6 @@ var horizontalTabsRoot = exports.horizontalTabsRoot = function horizontalTabsRoo
57
52
  pilled = _props$pilled === void 0 ? false : _props$pilled,
58
53
  index = props.index,
59
54
  className = props.className,
60
- _props$hasDivider = props.hasDivider,
61
- hasDivider = _props$hasDivider === void 0 ? true : _props$hasDivider,
62
55
  rest = _objectWithoutProperties(props, _excluded);
63
56
  var _useState = (0, _react.useState)(true),
64
57
  _useState2 = _slicedToArray(_useState, 2),
@@ -76,7 +69,6 @@ var horizontalTabsRoot = exports.horizontalTabsRoot = function horizontalTabsRoo
76
69
  var isFilled = view === 'filled'; // outer padding is only for filled view
77
70
  var pilledAttr = view !== 'clear' && pilled;
78
71
  var pilledClass = pilledAttr ? _tokens.classes.tabsPilled : undefined;
79
- var noDividerClass = !hasDivider ? _tokens.classes.tabsNoDivider : undefined;
80
72
  var stretchClass = firstItemVisible && lastItemVisible && stretch ? _tokens.classes.tabsStretch : undefined;
81
73
  var hasLeftArrowClass = !firstItemVisible ? _tokens.classes.tabsHasLeftArrow : undefined;
82
74
  var hasRightArrowClass = !lastItemVisible ? _tokens.classes.tabsHasRightArrow : undefined;
@@ -132,10 +124,9 @@ var horizontalTabsRoot = exports.horizontalTabsRoot = function horizontalTabsRoo
132
124
  ref: leftArrowRef,
133
125
  isLeftArrow: true
134
126
  }, /*#__PURE__*/_react["default"].createElement(_Icon.IconDisclosureLeft, {
135
- size: getIconSize(size),
136
- color: "inherit"
127
+ color: "var(".concat(_tokens.tokens.arrowColor, ")")
137
128
  }));
138
- }, [onPrev, size, disabled, isFilled]);
129
+ }, [onPrev, disabled, isFilled]);
139
130
  var NextButton = (0, _react.useMemo)(function () {
140
131
  return /*#__PURE__*/_react["default"].createElement(_HorizontalTabs.StyledArrow, {
141
132
  type: "button",
@@ -145,10 +136,9 @@ var horizontalTabsRoot = exports.horizontalTabsRoot = function horizontalTabsRoo
145
136
  disabled: disabled,
146
137
  isFilled: isFilled
147
138
  }, /*#__PURE__*/_react["default"].createElement(_Icon.IconDisclosureRight, {
148
- size: getIconSize(size),
149
- color: "inherit"
139
+ color: "var(".concat(_tokens.tokens.arrowColor, ")")
150
140
  }));
151
- }, [onNext, size, disabled, isFilled]);
141
+ }, [onNext, disabled, isFilled]);
152
142
  var handleScroll = (0, _react.useCallback)(function (event) {
153
143
  event.stopPropagation();
154
144
  var maxScrollLeft = event.currentTarget.scrollWidth - event.currentTarget.clientWidth;
@@ -208,15 +198,13 @@ var horizontalTabsRoot = exports.horizontalTabsRoot = function horizontalTabsRoo
208
198
  value: refs
209
199
  }, /*#__PURE__*/_react["default"].createElement(Root, _extends({
210
200
  view: view,
211
- role: "tablist"
212
- // TODO: убрать каст any, когда будут удалены deprecated props
213
- ,
201
+ role: "tablist",
214
202
  size: size,
215
203
  pilled: pilled,
216
204
  id: tabsId,
217
205
  ref: outerRef,
218
206
  disabled: disabled,
219
- className: (0, _utils.cx)(pilledClass, stretchClass, hasLeftArrowClass, hasRightArrowClass, noDividerClass, className),
207
+ className: (0, _utils.cx)(pilledClass, stretchClass, hasLeftArrowClass, hasRightArrowClass, className),
220
208
  onKeyDown: onKeyDown
221
209
  }, rest), !firstItemVisible && PreviousButton, /*#__PURE__*/_react["default"].createElement(_HorizontalTabs.StyledContentWrapper, {
222
210
  className: (0, _utils.cx)(clipScrollClass, clipShowAllClass),
@@ -21,7 +21,7 @@ var StyledContentWrapper = exports.StyledContentWrapper = /*#__PURE__*/_styledCo
21
21
  })(["margin:-0.125rem;padding:0.25rem;box-sizing:content-box;position:relative;height:100%;width:100%;display:flex;align-items:center;z-index:1;&.", "{overflow:scroll;scroll-padding:0.25rem;overscroll-behavior:contain;scrollbar-width:none;::-webkit-scrollbar{display:none;}}&.", "{overflow:visible;}"], _tokens.classes.tabsClipScroll, _tokens.classes.tabsClipShowAll);
22
22
  var StyledArrow = exports.StyledArrow = /*#__PURE__*/_styledComponents["default"].button.withConfig({
23
23
  componentId: "plasma-new-hope__sc-1nr0m0h-2"
24
- })(["display:flex;cursor:pointer;border:none;background-color:transparent;padding:0;outline:none;", ";&[disabled]{cursor:not-allowed;}--plasma_private-outer-padding:", ";padding-right:", ";padding-left:", ";color:var(", ");&:hover{color:var(", ");}&:active{color:var(", ");}"], /*#__PURE__*/(0, _mixins.addFocus)({
24
+ })(["display:flex;cursor:pointer;border:none;background-color:transparent;padding:0;outline:none;", ";&[disabled]{cursor:not-allowed;}--plasma_private-outer-padding:", ";padding-right:", ";padding-left:", ";"], /*#__PURE__*/(0, _mixins.addFocus)({
25
25
  outlineSize: '0.063rem',
26
26
  outlineOffset: '-0.125rem',
27
27
  outlineColor: /*#__PURE__*/"var(".concat(_tokens.tokens.outlineFocusColor, ")"),
@@ -35,4 +35,4 @@ var StyledArrow = exports.StyledArrow = /*#__PURE__*/_styledComponents["default"
35
35
  }, function (_ref3) {
36
36
  var isLeftArrow = _ref3.isLeftArrow;
37
37
  return isLeftArrow ? 'var(--plasma_private-outer-padding)' : "var(".concat(_tokens.tokens.arrowInnerPadding, ")");
38
- }, _tokens.tokens.arrowColor, _tokens.tokens.arrowColorHover, _tokens.tokens.arrowColorActive);
38
+ });
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.base = void 0;
7
7
  var _styledComponents = /*#__PURE__*/require("styled-components");
8
8
  var _tokens = /*#__PURE__*/require("../../../../../tokens");
9
- var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["background-color:var(", ");&::after{content:'';position:absolute;bottom:0.125rem;left:0.125rem;right:0.125rem;background:var(", ");height:var(", ");border-radius:var(", ");}&.", "{&::after{left:1.5rem;}}&.", "{&::after{right:1.5rem;}}&.", "{&::after{height:0;}}"], _tokens.tokens.tabsBackgroundColor, _tokens.tokens.tabsDividerColor, _tokens.tokens.tabsDividerHeight, _tokens.tokens.tabsDividerBorderRadius, _tokens.classes.tabsHasLeftArrow, _tokens.classes.tabsHasRightArrow, _tokens.classes.tabsNoDivider);
9
+ var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["background-color:var(", ");&::after{content:'';position:absolute;bottom:0.125rem;left:0.125rem;right:0.125rem;background:var(", ");height:var(", ");border-radius:var(", ");}&.", "{&::after{left:1.5rem;}}&.", "{&::after{right:1.5rem;}}"], _tokens.tokens.tabsBackgroundColor, _tokens.tokens.tabsDividerColor, _tokens.tokens.tabsDividerHeight, _tokens.tokens.tabsDividerBorderRadius, _tokens.classes.tabsHasLeftArrow, _tokens.classes.tabsHasRightArrow);
@@ -15,7 +15,6 @@ var _VerticalTabs = /*#__PURE__*/require("./VerticalTabs.styles");
15
15
  var _base = /*#__PURE__*/require("./variations/_size/base");
16
16
  var _base2 = /*#__PURE__*/require("./variations/_view/base");
17
17
  var _base3 = /*#__PURE__*/require("./variations/_disabled/base");
18
- var _IconDisclosureLeft, _IconDisclosureRight;
19
18
  var _excluded = ["id", "disabled", "clip", "size", "view", "children", "index", "className", "orientation", "hasDivider"];
20
19
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
21
20
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
@@ -115,18 +114,18 @@ var verticalTabsRoot = exports.verticalTabsRoot = function verticalTabsRoot(Root
115
114
  tabIndex: disabled ? -1 : 0,
116
115
  disabled: disabled,
117
116
  ref: upArrowRef
118
- }, _IconDisclosureLeft || (_IconDisclosureLeft = /*#__PURE__*/_react["default"].createElement(_Icon.IconDisclosureLeft, {
119
- color: "inherit"
120
- })));
117
+ }, /*#__PURE__*/_react["default"].createElement(_Icon.IconDisclosureLeft, {
118
+ color: "var(".concat(_tokens.tokens.arrowColor, ")")
119
+ }));
121
120
  var NextButton = /*#__PURE__*/_react["default"].createElement(_VerticalTabs.StyledArrow, {
122
121
  type: "button",
123
122
  "aria-label": "\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439 \u0442\u0430\u0431",
124
123
  onClick: onNext,
125
124
  tabIndex: disabled ? -1 : 0,
126
125
  disabled: disabled
127
- }, _IconDisclosureRight || (_IconDisclosureRight = /*#__PURE__*/_react["default"].createElement(_Icon.IconDisclosureRight, {
128
- color: "inherit"
129
- })));
126
+ }, /*#__PURE__*/_react["default"].createElement(_Icon.IconDisclosureRight, {
127
+ color: "var(".concat(_tokens.tokens.arrowColor, ")")
128
+ }));
130
129
  var handleScroll = (0, _react.useCallback)(function (event) {
131
130
  event.stopPropagation();
132
131
  var maxScrollTop = event.currentTarget.scrollHeight - event.currentTarget.clientHeight;
@@ -21,9 +21,9 @@ var StyledContentWrapper = exports.StyledContentWrapper = /*#__PURE__*/_styledCo
21
21
  })(["margin:-0.125rem;padding:0.25rem;box-sizing:content-box;position:relative;height:100%;width:100%;display:flex;align-items:center;z-index:1;&.", "{overflow:scroll;scroll-padding:0.25rem;overscroll-behavior:contain;scrollbar-width:none;::-webkit-scrollbar{display:none;}", "{margin-top:auto;}}&.", "{overflow:visible;}"], _tokens.classes.tabsClipScroll, StyledContent, _tokens.classes.tabsClipShowAll);
22
22
  var StyledArrow = exports.StyledArrow = /*#__PURE__*/_styledComponents["default"].button.withConfig({
23
23
  componentId: "plasma-new-hope__sc-gz8fxn-2"
24
- })(["display:flex;cursor:pointer;border:none;background-color:transparent;padding:0;outline:none;transform:rotate(90deg);", ";&[disabled]{cursor:not-allowed;}color:var(", ");&:hover{color:var(", ");}&:active{color:var(", ");}"], /*#__PURE__*/(0, _mixins.addFocus)({
24
+ })(["display:flex;cursor:pointer;border:none;background-color:transparent;padding:0;outline:none;transform:rotate(90deg);", ";&[disabled]{cursor:not-allowed;}"], /*#__PURE__*/(0, _mixins.addFocus)({
25
25
  outlineSize: '0.063rem',
26
26
  outlineOffset: '-0.125rem',
27
27
  outlineColor: /*#__PURE__*/"var(".concat(_tokens.tokens.outlineFocusColor, ")"),
28
28
  outlineRadius: 'calc(var(--plasma_private-outline-radius) - 0.063rem)'
29
- }), _tokens.tokens.arrowColor, _tokens.tokens.arrowColorHover, _tokens.tokens.arrowColorActive);
29
+ }));
@@ -12,7 +12,6 @@ import { Tabs } from './Tabs';
12
12
  import { TabItem } from './TabItem';
13
13
 
14
14
  const clips = ['none', 'scroll', 'showAll'];
15
- const headerClips = ['none', 'scroll'];
16
15
  const sizes = ['xs', 's', 'm', 'l'] as const;
17
16
  const headerSizes = ['h5', 'h4', 'h3', 'h2', 'h1'] as const;
18
17
 
@@ -21,6 +20,7 @@ type HeaderSize = typeof headerSizes[number];
21
20
 
22
21
  type CustomStoryTabsProps = {
23
22
  itemQuantity: number;
23
+ hasDivider: boolean;
24
24
  contentLeft: string;
25
25
  contentRight: string;
26
26
  stretch: boolean;
@@ -30,12 +30,12 @@ type CustomStoryTabsProps = {
30
30
  const contentLeftOptions = ['none', 'icon'];
31
31
  const contentRightOptions = ['none', 'counter', 'icon'];
32
32
 
33
- const getContentLeft = (contentLeftOption: string, size: string) => {
33
+ const getContentLeft = (contentLeftOption: string, size: Size) => {
34
34
  const iconSize = size === 'xs' ? 'xs' : 's';
35
35
  return contentLeftOption === 'icon' ? <IconMic size={iconSize} color="inherit" /> : undefined;
36
36
  };
37
37
 
38
- const getContentRight = (contentRightOption: string, size: string) => {
38
+ const getContentRight = (contentRightOption: string, size: Size) => {
39
39
  const iconSize = size === 'xs' ? 'xs' : 's';
40
40
  const counterSize = size === 'xs' ? 'xxs' : 'xs';
41
41
 
@@ -96,7 +96,7 @@ const StoryHorizontalDefault = (props: HorizontalStoryTabsProps) => {
96
96
  const [index, setIndex] = useState(0);
97
97
 
98
98
  return (
99
- <Tabs view="divider" hasDivider={hasDivider} stretch={stretch} disabled={disabled} size={size}>
99
+ <Tabs view={hasDivider ? 'divider' : 'clear'} stretch={stretch} disabled={disabled} size={size}>
100
100
  {items.map((_, i) => {
101
101
  if (helperText !== '') {
102
102
  return (
@@ -152,7 +152,7 @@ const StoryHorizontalScroll = (props: HorizontalStoryTabsProps) => {
152
152
  const [index, setIndex] = useState(0);
153
153
 
154
154
  return (
155
- <Tabs clip={clip} view="divider" hasDivider={hasDivider} disabled={disabled} size={size} style={{ width }}>
155
+ <Tabs clip={clip} view={hasDivider ? 'divider' : 'clear'} disabled={disabled} size={size} style={{ width }}>
156
156
  {items.map((_, i) => {
157
157
  if (helperText !== '') {
158
158
  return (
@@ -220,7 +220,7 @@ const StoryHorizontalShowAll = (props: HorizontalStoryTabsProps) => {
220
220
  });
221
221
 
222
222
  return (
223
- <Tabs clip={clip} view="divider" hasDivider={hasDivider} disabled={disabled} size={size}>
223
+ <Tabs clip={clip} view={hasDivider ? 'divider' : 'clear'} disabled={disabled} size={size}>
224
224
  {visibleItems.map((_, i) => {
225
225
  if (helperText !== '') {
226
226
  return (
@@ -603,47 +603,31 @@ export const VerticalTabs: StoryObj<VerticalStoryTabsProps> = {
603
603
  },
604
604
  };
605
605
 
606
- const StoryHeaderDefault = (props: HorizontalStoryTabsProps) => {
607
- const { disabled, itemQuantity, size, helperText } = props;
608
- const items = Array(itemQuantity).fill(0);
609
- const [index, setIndex] = useState(0);
610
-
611
- return (
612
- <Tabs view="clear" disabled={disabled} size={size as HeaderSize}>
613
- {items.map((_, i) => (
614
- <TabItem
615
- key={`item:${i}`}
616
- view="clear"
617
- selected={i === index}
618
- onClick={() => !disabled && setIndex(i)}
619
- tabIndex={!disabled ? 0 : -1}
620
- disabled={disabled}
621
- value={helperText}
622
- size={size as HeaderSize}
623
- >
624
- {`Label${i + 1}`}
625
- </TabItem>
626
- ))}
627
- </Tabs>
628
- );
629
- };
630
-
631
- const StoryHeaderScroll = (props: HorizontalStoryTabsProps) => {
632
- const { disabled, itemQuantity, size, helperText, width } = props;
606
+ const StoryHeaderTabs = (props: StoryTabsProps) => {
607
+ const {
608
+ disabled,
609
+ itemQuantity,
610
+ size,
611
+ contentLeft: contentLeftOption,
612
+ contentRight: contentRightOption,
613
+ hasDivider,
614
+ stretch,
615
+ } = props;
633
616
  const items = Array(itemQuantity).fill(0);
634
617
  const [index, setIndex] = useState(0);
635
618
 
636
619
  return (
637
- <Tabs view="clear" disabled={disabled} size={size as HeaderSize} style={{ width }}>
620
+ <Tabs view={hasDivider ? 'divider' : 'clear'} disabled={disabled} size={size} stretch={stretch}>
638
621
  {items.map((_, i) => (
639
622
  <TabItem
640
623
  key={`item:${i}`}
641
- view="clear"
624
+ view="divider"
642
625
  selected={i === index}
643
626
  onClick={() => !disabled && setIndex(i)}
644
627
  tabIndex={!disabled ? 0 : -1}
645
628
  disabled={disabled}
646
- value={helperText}
629
+ contentLeft={getContentLeft(contentLeftOption, size as Size)}
630
+ contentRight={getContentRight(contentRightOption, size as Size)}
647
631
  size={size as HeaderSize}
648
632
  >
649
633
  {`Label${i + 1}`}
@@ -653,60 +637,37 @@ const StoryHeaderScroll = (props: HorizontalStoryTabsProps) => {
653
637
  );
654
638
  };
655
639
 
656
- export const HeaderTabs: StoryObj<HorizontalStoryTabsProps> = {
640
+ export const HeaderTabs: StoryObj<StoryTabsProps> = {
657
641
  args: {
658
642
  size: 'h5',
659
643
  disabled: false,
660
- helperText: '',
661
- itemQuantity: 6,
662
- width: '12rem',
644
+ hasDivider: true,
645
+ itemQuantity: 4,
663
646
  },
664
647
  argTypes: {
665
- clip: {
666
- options: headerClips,
648
+ size: {
649
+ options: headerSizes,
667
650
  control: {
668
651
  type: 'select',
669
652
  },
670
653
  },
671
- width: {
672
- control: {
673
- type: 'text',
674
- },
675
- if: { arg: 'clip', eq: 'scroll' },
676
- },
677
- stretch: {
678
- table: {
679
- disable: true,
680
- },
681
- },
682
654
  contentLeft: {
683
- table: {
684
- disable: true,
655
+ options: contentLeftOptions,
656
+ control: {
657
+ type: 'select',
685
658
  },
686
659
  },
687
660
  contentRight: {
688
- table: {
689
- disable: true,
661
+ options: contentRightOptions,
662
+ control: {
663
+ type: 'select',
690
664
  },
691
665
  },
692
- hasDivider: {
666
+ clip: {
693
667
  table: {
694
668
  disable: true,
695
669
  },
696
670
  },
697
- size: {
698
- options: headerSizes,
699
- control: {
700
- type: 'select',
701
- },
702
- },
703
- },
704
- render: (args) => {
705
- switch (args.clip) {
706
- case 'scroll':
707
- return <StoryHeaderScroll {...args} />;
708
- default:
709
- return <StoryHeaderDefault {...args} />;
710
- }
711
671
  },
672
+ render: (args) => <StoryHeaderTabs {...args} />,
712
673
  };
@@ -26,8 +26,8 @@ var config = exports.config = {
26
26
  h5: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.375rem;", ":auto;", ":3rem;", ":0rem;", ":1.75rem;", ":0.625rem;", ":var(--plasma-typo-h5-font-family);", ":var(--plasma-typo-h5-font-size);", ":var(--plasma-typo-h5-font-style);", ":var(--plasma-typo-h5-font-weight);", ":var(--plasma-typo-h5-letter-spacing);", ":var(--plasma-typo-h5-line-height);"], _Tabs.tabsTokens.itemBorderRadius, _Tabs.tabsTokens.itemWidth, _Tabs.tabsTokens.itemHeight, _Tabs.tabsTokens.itemPadding, _Tabs.tabsTokens.itemMarginLeft, _Tabs.tabsTokens.itemContentGap, _Tabs.tabsTokens.fontFamily, _Tabs.tabsTokens.fontSize, _Tabs.tabsTokens.fontStyle, _Tabs.tabsTokens.fontWeight, _Tabs.tabsTokens.letterSpacing, _Tabs.tabsTokens.lineHeight),
27
27
  h4: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.375rem;", ":auto;", ":3.25rem;", ":0rem;", ":2rem;", ":0.625rem;", ":var(--plasma-typo-h4-font-family);", ":var(--plasma-typo-h4-font-size);", ":var(--plasma-typo-h4-font-style);", ":var(--plasma-typo-h4-font-weight);", ":var(--plasma-typo-h4-letter-spacing);", ":var(--plasma-typo-h4-line-height);"], _Tabs.tabsTokens.itemBorderRadius, _Tabs.tabsTokens.itemWidth, _Tabs.tabsTokens.itemHeight, _Tabs.tabsTokens.itemPadding, _Tabs.tabsTokens.itemMarginLeft, _Tabs.tabsTokens.itemContentGap, _Tabs.tabsTokens.fontFamily, _Tabs.tabsTokens.fontSize, _Tabs.tabsTokens.fontStyle, _Tabs.tabsTokens.fontWeight, _Tabs.tabsTokens.letterSpacing, _Tabs.tabsTokens.lineHeight),
28
28
  h3: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":auto;", ":3.875rem;", ":0rem;", ":2.25rem;", ":0.75rem;", ":var(--plasma-typo-h3-font-family);", ":var(--plasma-typo-h3-font-size);", ":var(--plasma-typo-h3-font-style);", ":var(--plasma-typo-h3-font-weight);", ":var(--plasma-typo-h3-letter-spacing);", ":var(--plasma-typo-h3-line-height);"], _Tabs.tabsTokens.itemBorderRadius, _Tabs.tabsTokens.itemWidth, _Tabs.tabsTokens.itemHeight, _Tabs.tabsTokens.itemPadding, _Tabs.tabsTokens.itemMarginLeft, _Tabs.tabsTokens.itemContentGap, _Tabs.tabsTokens.fontFamily, _Tabs.tabsTokens.fontSize, _Tabs.tabsTokens.fontStyle, _Tabs.tabsTokens.fontWeight, _Tabs.tabsTokens.letterSpacing, _Tabs.tabsTokens.lineHeight),
29
- h2: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.625rem;", ":auto;", ":4.5rem;", ":0rem;", ":2.5rem;", ":0.875rem;", ":var(--plasma-typo-h2-font-family);", ":var(--plasma-typo-h2-font-size);", ":var(--plasma-typo-h2-font-style);", ":var(--plasma-typo-h2-font-weight);", ":var(--plasma-typo-h2-letter-spacing);", ":var(--plasma-typo-h2-line-height);"], _Tabs.tabsTokens.itemBorderRadius, _Tabs.tabsTokens.itemWidth, _Tabs.tabsTokens.itemHeight, _Tabs.tabsTokens.itemPadding, _Tabs.tabsTokens.itemMarginLeft, _Tabs.tabsTokens.itemContentGap, _Tabs.tabsTokens.fontFamily, _Tabs.tabsTokens.fontSize, _Tabs.tabsTokens.fontStyle, _Tabs.tabsTokens.fontWeight, _Tabs.tabsTokens.letterSpacing, _Tabs.tabsTokens.lineHeight),
30
- h1: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.75rem;", ":auto;", ":5.75rem;", ":0rem;", ":3.5rem;", ":1rem;", ":var(--plasma-typo-h1-font-family);", ":var(--plasma-typo-h1-font-size);", ":var(--plasma-typo-h1-font-style);", ":var(--plasma-typo-h1-font-weight);", ":var(--plasma-typo-h1-letter-spacing);", ":var(--plasma-typo-h1-line-height);"], _Tabs.tabsTokens.itemBorderRadius, _Tabs.tabsTokens.itemWidth, _Tabs.tabsTokens.itemHeight, _Tabs.tabsTokens.itemPadding, _Tabs.tabsTokens.itemMarginLeft, _Tabs.tabsTokens.itemContentGap, _Tabs.tabsTokens.fontFamily, _Tabs.tabsTokens.fontSize, _Tabs.tabsTokens.fontStyle, _Tabs.tabsTokens.fontWeight, _Tabs.tabsTokens.letterSpacing, _Tabs.tabsTokens.lineHeight)
29
+ h2: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.625rem;", ":auto;", ":4.5rem;", ":0rem;", ":2.5rem;", ":1rem;", ":var(--plasma-typo-h2-font-family);", ":var(--plasma-typo-h2-font-size);", ":var(--plasma-typo-h2-font-style);", ":var(--plasma-typo-h2-font-weight);", ":var(--plasma-typo-h2-letter-spacing);", ":var(--plasma-typo-h2-line-height);"], _Tabs.tabsTokens.itemBorderRadius, _Tabs.tabsTokens.itemWidth, _Tabs.tabsTokens.itemHeight, _Tabs.tabsTokens.itemPadding, _Tabs.tabsTokens.itemMarginLeft, _Tabs.tabsTokens.itemContentGap, _Tabs.tabsTokens.fontFamily, _Tabs.tabsTokens.fontSize, _Tabs.tabsTokens.fontStyle, _Tabs.tabsTokens.fontWeight, _Tabs.tabsTokens.letterSpacing, _Tabs.tabsTokens.lineHeight),
30
+ h1: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.75rem;", ":auto;", ":5.75rem;", ":0rem;", ":3.5rem;", ":0.5rem;", ":var(--plasma-typo-h1-font-family);", ":var(--plasma-typo-h1-font-size);", ":var(--plasma-typo-h1-font-style);", ":var(--plasma-typo-h1-font-weight);", ":var(--plasma-typo-h1-letter-spacing);", ":var(--plasma-typo-h1-line-height);"], _Tabs.tabsTokens.itemBorderRadius, _Tabs.tabsTokens.itemWidth, _Tabs.tabsTokens.itemHeight, _Tabs.tabsTokens.itemPadding, _Tabs.tabsTokens.itemMarginLeft, _Tabs.tabsTokens.itemContentGap, _Tabs.tabsTokens.fontFamily, _Tabs.tabsTokens.fontSize, _Tabs.tabsTokens.fontStyle, _Tabs.tabsTokens.fontWeight, _Tabs.tabsTokens.letterSpacing, _Tabs.tabsTokens.lineHeight)
31
31
  },
32
32
  disabled: {
33
33
  "true": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.4;"], _Tabs.tabsTokens.disabledOpacity)
@@ -13,9 +13,9 @@ var config = exports.config = {
13
13
  },
14
14
  variations: {
15
15
  view: {
16
- clear: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-secondary);", ":var(--text-secondary-hover);", ":var(---text-secondary-active);", ":transparent;", ":var(--surface-accent);", ":0rem;", ":transparent;", ":0rem;"], _Tabs.tabsTokens.arrowColor, _Tabs.tabsTokens.arrowColorHover, _Tabs.tabsTokens.arrowColorActive, _Tabs.tabsTokens.tabsBackgroundColor, _Tabs.tabsTokens.outlineFocusColor, _Tabs.tabsTokens.tabsDividerHeight, _Tabs.tabsTokens.tabsDividerColor, _Tabs.tabsTokens.tabsDividerBorderRadius),
17
- filled: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-secondary);", ":var(--text-secondary-hover);", ":var(---text-secondary-active);", ":var(--surface-transparent-primary);", ":var(--surface-accent);", ":0rem;", ":transparent;", ":0rem;"], _Tabs.tabsTokens.arrowColor, _Tabs.tabsTokens.arrowColorHover, _Tabs.tabsTokens.arrowColorActive, _Tabs.tabsTokens.tabsBackgroundColor, _Tabs.tabsTokens.outlineFocusColor, _Tabs.tabsTokens.tabsDividerHeight, _Tabs.tabsTokens.tabsDividerColor, _Tabs.tabsTokens.tabsDividerBorderRadius),
18
- divider: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-secondary);", ":var(--text-secondary-hover);", ":var(---text-secondary-active);", ":transparent;", ":var(--surface-accent);", ":0.0625rem;", ":var(--surface-transparent-tertiary);", ":0.0625rem;"], _Tabs.tabsTokens.arrowColor, _Tabs.tabsTokens.arrowColorHover, _Tabs.tabsTokens.arrowColorActive, _Tabs.tabsTokens.tabsBackgroundColor, _Tabs.tabsTokens.outlineFocusColor, _Tabs.tabsTokens.tabsDividerHeight, _Tabs.tabsTokens.tabsDividerColor, _Tabs.tabsTokens.tabsDividerBorderRadius)
16
+ clear: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-secondary);", ":transparent;", ":var(--surface-accent);", ":0rem;", ":transparent;", ":0rem;"], _Tabs.tabsTokens.arrowColor, _Tabs.tabsTokens.tabsBackgroundColor, _Tabs.tabsTokens.outlineFocusColor, _Tabs.tabsTokens.tabsDividerHeight, _Tabs.tabsTokens.tabsDividerColor, _Tabs.tabsTokens.tabsDividerBorderRadius),
17
+ filled: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-secondary);", ":var(--surface-transparent-primary);", ":var(--surface-accent);", ":0rem;", ":transparent;", ":0rem;"], _Tabs.tabsTokens.arrowColor, _Tabs.tabsTokens.tabsBackgroundColor, _Tabs.tabsTokens.outlineFocusColor, _Tabs.tabsTokens.tabsDividerHeight, _Tabs.tabsTokens.tabsDividerColor, _Tabs.tabsTokens.tabsDividerBorderRadius),
18
+ divider: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-secondary);", ":transparent;", ":var(--surface-accent);", ":0.0625rem;", ":var(--surface-transparent-tertiary);", ":0.0625rem;"], _Tabs.tabsTokens.arrowColor, _Tabs.tabsTokens.tabsBackgroundColor, _Tabs.tabsTokens.outlineFocusColor, _Tabs.tabsTokens.tabsDividerHeight, _Tabs.tabsTokens.tabsDividerColor, _Tabs.tabsTokens.tabsDividerBorderRadius)
19
19
  },
20
20
  size: {
21
21
  xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":fit-content;", ":auto;", ":0rem;", ":0.125rem;"], _Tabs.tabsTokens.tabsBorderRadius, _Tabs.tabsTokens.tabsWidth, _Tabs.tabsTokens.tabsHeight, _Tabs.tabsTokens.arrowInnerPadding, _Tabs.tabsTokens.arrowOuterPadding),
@@ -13,7 +13,7 @@ var config = exports.config = {
13
13
  },
14
14
  variations: {
15
15
  view: {
16
- divider: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-secondary);", ":var(--text-secondary-hover);", ":var(---text-secondary-active);", ":transparent;", ":var(--surface-accent);", ":0.0625rem;", ":0.0625rem;", ":var(--surface-transparent-tertiary);", ":0.0625rem;"], _Tabs.tabsTokens.arrowColor, _Tabs.tabsTokens.arrowColorHover, _Tabs.tabsTokens.arrowColorActive, _Tabs.tabsTokens.tabsBackgroundColor, _Tabs.tabsTokens.outlineFocusColor, _Tabs.tabsTokens.tabsDividerWidth, _Tabs.tabsTokens.tabsDividerHeight, _Tabs.tabsTokens.tabsDividerColor, _Tabs.tabsTokens.tabsDividerBorderRadius)
16
+ divider: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-secondary);", ":transparent;", ":var(--surface-accent);", ":0.0625rem;", ":0.0625rem;", ":var(--surface-transparent-tertiary);", ":0.0625rem;"], _Tabs.tabsTokens.arrowColor, _Tabs.tabsTokens.tabsBackgroundColor, _Tabs.tabsTokens.outlineFocusColor, _Tabs.tabsTokens.tabsDividerWidth, _Tabs.tabsTokens.tabsDividerHeight, _Tabs.tabsTokens.tabsDividerColor, _Tabs.tabsTokens.tabsDividerBorderRadius)
17
17
  },
18
18
  size: {
19
19
  xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":fit-content;", ":auto;", ":0rem;", ":0.125rem;"], _Tabs.tabsTokens.tabsBorderRadius, _Tabs.tabsTokens.tabsWidth, _Tabs.tabsTokens.tabsHeight, _Tabs.tabsTokens.arrowInnerPadding, _Tabs.tabsTokens.arrowOuterPadding),
@@ -12,7 +12,6 @@ import { Tabs } from './Tabs';
12
12
  import { TabItem } from './TabItem';
13
13
 
14
14
  const clips = ['none', 'scroll', 'showAll'];
15
- const headerClips = ['none', 'scroll'];
16
15
  const sizes = ['xs', 's', 'm', 'l'] as const;
17
16
  const headerSizes = ['h5', 'h4', 'h3', 'h2', 'h1'] as const;
18
17
 
@@ -21,6 +20,7 @@ type HeaderSize = typeof headerSizes[number];
21
20
 
22
21
  type CustomStoryTabsProps = {
23
22
  itemQuantity: number;
23
+ hasDivider: boolean;
24
24
  contentLeft: string;
25
25
  contentRight: string;
26
26
  stretch: boolean;
@@ -30,12 +30,12 @@ type CustomStoryTabsProps = {
30
30
  const contentLeftOptions = ['none', 'icon'];
31
31
  const contentRightOptions = ['none', 'counter', 'icon'];
32
32
 
33
- const getContentLeft = (contentLeftOption: string, size: string) => {
33
+ const getContentLeft = (contentLeftOption: string, size: Size) => {
34
34
  const iconSize = size === 'xs' ? 'xs' : 's';
35
35
  return contentLeftOption === 'icon' ? <IconMic size={iconSize} color="inherit" /> : undefined;
36
36
  };
37
37
 
38
- const getContentRight = (contentRightOption: string, size: string) => {
38
+ const getContentRight = (contentRightOption: string, size: Size) => {
39
39
  const iconSize = size === 'xs' ? 'xs' : 's';
40
40
  const counterSize = size === 'xs' ? 'xxs' : 'xs';
41
41
 
@@ -96,7 +96,7 @@ const StoryHorizontalDefault = (props: HorizontalStoryTabsProps) => {
96
96
  const [index, setIndex] = useState(0);
97
97
 
98
98
  return (
99
- <Tabs view="divider" hasDivider={hasDivider} stretch={stretch} disabled={disabled} size={size}>
99
+ <Tabs view={hasDivider ? 'divider' : 'clear'} stretch={stretch} disabled={disabled} size={size}>
100
100
  {items.map((_, i) => {
101
101
  if (helperText !== '') {
102
102
  return (
@@ -152,7 +152,7 @@ const StoryHorizontalScroll = (props: HorizontalStoryTabsProps) => {
152
152
  const [index, setIndex] = useState(0);
153
153
 
154
154
  return (
155
- <Tabs clip={clip} view="divider" hasDivider={hasDivider} disabled={disabled} size={size} style={{ width }}>
155
+ <Tabs clip={clip} view={hasDivider ? 'divider' : 'clear'} disabled={disabled} size={size} style={{ width }}>
156
156
  {items.map((_, i) => {
157
157
  if (helperText !== '') {
158
158
  return (
@@ -220,7 +220,7 @@ const StoryHorizontalShowAll = (props: HorizontalStoryTabsProps) => {
220
220
  });
221
221
 
222
222
  return (
223
- <Tabs clip={clip} view="divider" hasDivider={hasDivider} disabled={disabled} size={size}>
223
+ <Tabs clip={clip} view={hasDivider ? 'divider' : 'clear'} disabled={disabled} size={size}>
224
224
  {visibleItems.map((_, i) => {
225
225
  if (helperText !== '') {
226
226
  return (
@@ -603,47 +603,31 @@ export const VerticalTabs: StoryObj<VerticalStoryTabsProps> = {
603
603
  },
604
604
  };
605
605
 
606
- const StoryHeaderDefault = (props: HorizontalStoryTabsProps) => {
607
- const { disabled, itemQuantity, size, helperText } = props;
608
- const items = Array(itemQuantity).fill(0);
609
- const [index, setIndex] = useState(0);
610
-
611
- return (
612
- <Tabs view="clear" disabled={disabled} size={size as HeaderSize}>
613
- {items.map((_, i) => (
614
- <TabItem
615
- key={`item:${i}`}
616
- view="clear"
617
- selected={i === index}
618
- onClick={() => !disabled && setIndex(i)}
619
- tabIndex={!disabled ? 0 : -1}
620
- disabled={disabled}
621
- value={helperText}
622
- size={size as HeaderSize}
623
- >
624
- {`Label${i + 1}`}
625
- </TabItem>
626
- ))}
627
- </Tabs>
628
- );
629
- };
630
-
631
- const StoryHeaderScroll = (props: HorizontalStoryTabsProps) => {
632
- const { disabled, itemQuantity, size, helperText, width } = props;
606
+ const StoryHeaderTabs = (props: StoryTabsProps) => {
607
+ const {
608
+ disabled,
609
+ itemQuantity,
610
+ size,
611
+ contentLeft: contentLeftOption,
612
+ contentRight: contentRightOption,
613
+ hasDivider,
614
+ stretch,
615
+ } = props;
633
616
  const items = Array(itemQuantity).fill(0);
634
617
  const [index, setIndex] = useState(0);
635
618
 
636
619
  return (
637
- <Tabs view="clear" disabled={disabled} size={size as HeaderSize} style={{ width }}>
620
+ <Tabs view={hasDivider ? 'divider' : 'clear'} disabled={disabled} size={size} stretch={stretch}>
638
621
  {items.map((_, i) => (
639
622
  <TabItem
640
623
  key={`item:${i}`}
641
- view="clear"
624
+ view="divider"
642
625
  selected={i === index}
643
626
  onClick={() => !disabled && setIndex(i)}
644
627
  tabIndex={!disabled ? 0 : -1}
645
628
  disabled={disabled}
646
- value={helperText}
629
+ contentLeft={getContentLeft(contentLeftOption, size as Size)}
630
+ contentRight={getContentRight(contentRightOption, size as Size)}
647
631
  size={size as HeaderSize}
648
632
  >
649
633
  {`Label${i + 1}`}
@@ -653,60 +637,37 @@ const StoryHeaderScroll = (props: HorizontalStoryTabsProps) => {
653
637
  );
654
638
  };
655
639
 
656
- export const HeaderTabs: StoryObj<HorizontalStoryTabsProps> = {
640
+ export const HeaderTabs: StoryObj<StoryTabsProps> = {
657
641
  args: {
658
642
  size: 'h5',
659
643
  disabled: false,
660
- helperText: '',
661
- itemQuantity: 6,
662
- width: '12rem',
644
+ hasDivider: true,
645
+ itemQuantity: 4,
663
646
  },
664
647
  argTypes: {
665
- clip: {
666
- options: headerClips,
648
+ size: {
649
+ options: headerSizes,
667
650
  control: {
668
651
  type: 'select',
669
652
  },
670
653
  },
671
- width: {
672
- control: {
673
- type: 'text',
674
- },
675
- if: { arg: 'clip', eq: 'scroll' },
676
- },
677
- stretch: {
678
- table: {
679
- disable: true,
680
- },
681
- },
682
654
  contentLeft: {
683
- table: {
684
- disable: true,
655
+ options: contentLeftOptions,
656
+ control: {
657
+ type: 'select',
685
658
  },
686
659
  },
687
660
  contentRight: {
688
- table: {
689
- disable: true,
661
+ options: contentRightOptions,
662
+ control: {
663
+ type: 'select',
690
664
  },
691
665
  },
692
- hasDivider: {
666
+ clip: {
693
667
  table: {
694
668
  disable: true,
695
669
  },
696
670
  },
697
- size: {
698
- options: headerSizes,
699
- control: {
700
- type: 'select',
701
- },
702
- },
703
- },
704
- render: (args) => {
705
- switch (args.clip) {
706
- case 'scroll':
707
- return <StoryHeaderScroll {...args} />;
708
- default:
709
- return <StoryHeaderDefault {...args} />;
710
- }
711
671
  },
672
+ render: (args) => <StoryHeaderTabs {...args} />,
712
673
  };
@@ -26,8 +26,8 @@ var config = exports.config = {
26
26
  h5: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.375rem;", ":auto;", ":3rem;", ":0rem;", ":1.75rem;", ":0.625rem;", ":var(--plasma-typo-h5-font-family);", ":var(--plasma-typo-h5-font-size);", ":var(--plasma-typo-h5-font-style);", ":var(--plasma-typo-h5-font-weight);", ":var(--plasma-typo-h5-letter-spacing);", ":var(--plasma-typo-h5-line-height);"], _Tabs.tabsTokens.itemBorderRadius, _Tabs.tabsTokens.itemWidth, _Tabs.tabsTokens.itemHeight, _Tabs.tabsTokens.itemPadding, _Tabs.tabsTokens.itemMarginLeft, _Tabs.tabsTokens.itemContentGap, _Tabs.tabsTokens.fontFamily, _Tabs.tabsTokens.fontSize, _Tabs.tabsTokens.fontStyle, _Tabs.tabsTokens.fontWeight, _Tabs.tabsTokens.letterSpacing, _Tabs.tabsTokens.lineHeight),
27
27
  h4: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.375rem;", ":auto;", ":3.25rem;", ":0rem;", ":2rem;", ":0.625rem;", ":var(--plasma-typo-h4-font-family);", ":var(--plasma-typo-h4-font-size);", ":var(--plasma-typo-h4-font-style);", ":var(--plasma-typo-h4-font-weight);", ":var(--plasma-typo-h4-letter-spacing);", ":var(--plasma-typo-h4-line-height);"], _Tabs.tabsTokens.itemBorderRadius, _Tabs.tabsTokens.itemWidth, _Tabs.tabsTokens.itemHeight, _Tabs.tabsTokens.itemPadding, _Tabs.tabsTokens.itemMarginLeft, _Tabs.tabsTokens.itemContentGap, _Tabs.tabsTokens.fontFamily, _Tabs.tabsTokens.fontSize, _Tabs.tabsTokens.fontStyle, _Tabs.tabsTokens.fontWeight, _Tabs.tabsTokens.letterSpacing, _Tabs.tabsTokens.lineHeight),
28
28
  h3: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":auto;", ":3.875rem;", ":0rem;", ":2.25rem;", ":0.75rem;", ":var(--plasma-typo-h3-font-family);", ":var(--plasma-typo-h3-font-size);", ":var(--plasma-typo-h3-font-style);", ":var(--plasma-typo-h3-font-weight);", ":var(--plasma-typo-h3-letter-spacing);", ":var(--plasma-typo-h3-line-height);"], _Tabs.tabsTokens.itemBorderRadius, _Tabs.tabsTokens.itemWidth, _Tabs.tabsTokens.itemHeight, _Tabs.tabsTokens.itemPadding, _Tabs.tabsTokens.itemMarginLeft, _Tabs.tabsTokens.itemContentGap, _Tabs.tabsTokens.fontFamily, _Tabs.tabsTokens.fontSize, _Tabs.tabsTokens.fontStyle, _Tabs.tabsTokens.fontWeight, _Tabs.tabsTokens.letterSpacing, _Tabs.tabsTokens.lineHeight),
29
- h2: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.625rem;", ":auto;", ":4.5rem;", ":0rem;", ":2.5rem;", ":0.875rem;", ":var(--plasma-typo-h2-font-family);", ":var(--plasma-typo-h2-font-size);", ":var(--plasma-typo-h2-font-style);", ":var(--plasma-typo-h2-font-weight);", ":var(--plasma-typo-h2-letter-spacing);", ":var(--plasma-typo-h2-line-height);"], _Tabs.tabsTokens.itemBorderRadius, _Tabs.tabsTokens.itemWidth, _Tabs.tabsTokens.itemHeight, _Tabs.tabsTokens.itemPadding, _Tabs.tabsTokens.itemMarginLeft, _Tabs.tabsTokens.itemContentGap, _Tabs.tabsTokens.fontFamily, _Tabs.tabsTokens.fontSize, _Tabs.tabsTokens.fontStyle, _Tabs.tabsTokens.fontWeight, _Tabs.tabsTokens.letterSpacing, _Tabs.tabsTokens.lineHeight),
30
- h1: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.75rem;", ":auto;", ":5.75rem;", ":0rem;", ":3.5rem;", ":1rem;", ":var(--plasma-typo-h1-font-family);", ":var(--plasma-typo-h1-font-size);", ":var(--plasma-typo-h1-font-style);", ":var(--plasma-typo-h1-font-weight);", ":var(--plasma-typo-h1-letter-spacing);", ":var(--plasma-typo-h1-line-height);"], _Tabs.tabsTokens.itemBorderRadius, _Tabs.tabsTokens.itemWidth, _Tabs.tabsTokens.itemHeight, _Tabs.tabsTokens.itemPadding, _Tabs.tabsTokens.itemMarginLeft, _Tabs.tabsTokens.itemContentGap, _Tabs.tabsTokens.fontFamily, _Tabs.tabsTokens.fontSize, _Tabs.tabsTokens.fontStyle, _Tabs.tabsTokens.fontWeight, _Tabs.tabsTokens.letterSpacing, _Tabs.tabsTokens.lineHeight)
29
+ h2: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.625rem;", ":auto;", ":4.5rem;", ":0rem;", ":2.5rem;", ":1rem;", ":var(--plasma-typo-h2-font-family);", ":var(--plasma-typo-h2-font-size);", ":var(--plasma-typo-h2-font-style);", ":var(--plasma-typo-h2-font-weight);", ":var(--plasma-typo-h2-letter-spacing);", ":var(--plasma-typo-h2-line-height);"], _Tabs.tabsTokens.itemBorderRadius, _Tabs.tabsTokens.itemWidth, _Tabs.tabsTokens.itemHeight, _Tabs.tabsTokens.itemPadding, _Tabs.tabsTokens.itemMarginLeft, _Tabs.tabsTokens.itemContentGap, _Tabs.tabsTokens.fontFamily, _Tabs.tabsTokens.fontSize, _Tabs.tabsTokens.fontStyle, _Tabs.tabsTokens.fontWeight, _Tabs.tabsTokens.letterSpacing, _Tabs.tabsTokens.lineHeight),
30
+ h1: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.75rem;", ":auto;", ":5.75rem;", ":0rem;", ":3.5rem;", ":0.5rem;", ":var(--plasma-typo-h1-font-family);", ":var(--plasma-typo-h1-font-size);", ":var(--plasma-typo-h1-font-style);", ":var(--plasma-typo-h1-font-weight);", ":var(--plasma-typo-h1-letter-spacing);", ":var(--plasma-typo-h1-line-height);"], _Tabs.tabsTokens.itemBorderRadius, _Tabs.tabsTokens.itemWidth, _Tabs.tabsTokens.itemHeight, _Tabs.tabsTokens.itemPadding, _Tabs.tabsTokens.itemMarginLeft, _Tabs.tabsTokens.itemContentGap, _Tabs.tabsTokens.fontFamily, _Tabs.tabsTokens.fontSize, _Tabs.tabsTokens.fontStyle, _Tabs.tabsTokens.fontWeight, _Tabs.tabsTokens.letterSpacing, _Tabs.tabsTokens.lineHeight)
31
31
  },
32
32
  disabled: {
33
33
  "true": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.4;"], _Tabs.tabsTokens.disabledOpacity)
@@ -13,9 +13,9 @@ var config = exports.config = {
13
13
  },
14
14
  variations: {
15
15
  view: {
16
- clear: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-secondary);", ":var(--text-secondary-hover);", ":var(---text-secondary-active);", ":transparent;", ":var(--surface-accent);", ":0rem;", ":transparent;", ":0rem;"], _Tabs.tabsTokens.arrowColor, _Tabs.tabsTokens.arrowColorHover, _Tabs.tabsTokens.arrowColorActive, _Tabs.tabsTokens.tabsBackgroundColor, _Tabs.tabsTokens.outlineFocusColor, _Tabs.tabsTokens.tabsDividerHeight, _Tabs.tabsTokens.tabsDividerColor, _Tabs.tabsTokens.tabsDividerBorderRadius),
17
- filled: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-secondary);", ":var(--text-secondary-hover);", ":var(---text-secondary-active);", ":var(--surface-transparent-primary);", ":var(--surface-accent);", ":0rem;", ":transparent;", ":0rem;"], _Tabs.tabsTokens.arrowColor, _Tabs.tabsTokens.arrowColorHover, _Tabs.tabsTokens.arrowColorActive, _Tabs.tabsTokens.tabsBackgroundColor, _Tabs.tabsTokens.outlineFocusColor, _Tabs.tabsTokens.tabsDividerHeight, _Tabs.tabsTokens.tabsDividerColor, _Tabs.tabsTokens.tabsDividerBorderRadius),
18
- divider: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-secondary);", ":var(--text-secondary-hover);", ":var(---text-secondary-active);", ":transparent;", ":var(--surface-accent);", ":0.0625rem;", ":var(--surface-transparent-tertiary);", ":0.0625rem;"], _Tabs.tabsTokens.arrowColor, _Tabs.tabsTokens.arrowColorHover, _Tabs.tabsTokens.arrowColorActive, _Tabs.tabsTokens.tabsBackgroundColor, _Tabs.tabsTokens.outlineFocusColor, _Tabs.tabsTokens.tabsDividerHeight, _Tabs.tabsTokens.tabsDividerColor, _Tabs.tabsTokens.tabsDividerBorderRadius)
16
+ clear: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-secondary);", ":transparent;", ":var(--surface-accent);", ":0rem;", ":transparent;", ":0rem;"], _Tabs.tabsTokens.arrowColor, _Tabs.tabsTokens.tabsBackgroundColor, _Tabs.tabsTokens.outlineFocusColor, _Tabs.tabsTokens.tabsDividerHeight, _Tabs.tabsTokens.tabsDividerColor, _Tabs.tabsTokens.tabsDividerBorderRadius),
17
+ filled: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-secondary);", ":var(--surface-transparent-primary);", ":var(--surface-accent);", ":0rem;", ":transparent;", ":0rem;"], _Tabs.tabsTokens.arrowColor, _Tabs.tabsTokens.tabsBackgroundColor, _Tabs.tabsTokens.outlineFocusColor, _Tabs.tabsTokens.tabsDividerHeight, _Tabs.tabsTokens.tabsDividerColor, _Tabs.tabsTokens.tabsDividerBorderRadius),
18
+ divider: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-secondary);", ":transparent;", ":var(--surface-accent);", ":0.0625rem;", ":var(--surface-transparent-tertiary);", ":0.0625rem;"], _Tabs.tabsTokens.arrowColor, _Tabs.tabsTokens.tabsBackgroundColor, _Tabs.tabsTokens.outlineFocusColor, _Tabs.tabsTokens.tabsDividerHeight, _Tabs.tabsTokens.tabsDividerColor, _Tabs.tabsTokens.tabsDividerBorderRadius)
19
19
  },
20
20
  size: {
21
21
  xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":fit-content;", ":auto;", ":0rem;", ":0.125rem;"], _Tabs.tabsTokens.tabsBorderRadius, _Tabs.tabsTokens.tabsWidth, _Tabs.tabsTokens.tabsHeight, _Tabs.tabsTokens.arrowInnerPadding, _Tabs.tabsTokens.arrowOuterPadding),