@cloud-ru/ds-tabs 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/cjs/components/ScrollButton/ScrollButton.js +1 -1
- package/dist/cjs/components/Tab/Tab.js +1 -1
- package/dist/cjs/components/TabBar/TabBar.js +1 -1
- package/dist/cjs/components/TabContent/TabContent.js +1 -1
- package/dist/esm/components/ScrollButton/ScrollButton.js +1 -1
- package/dist/esm/components/Tab/Tab.js +1 -1
- package/dist/esm/components/TabBar/TabBar.js +1 -1
- package/dist/esm/components/TabContent/TabContent.js +1 -1
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/components/ScrollButton/ScrollButton.tsx +1 -1
- package/src/components/Tab/Tab.tsx +2 -2
- package/src/components/TabBar/TabBar.tsx +1 -1
- package/src/components/TabContent/TabContent.tsx +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 1.0.6 (2026-09-18)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @ds/tabs
|
|
9
|
+
|
|
10
|
+
## 1.0.5 (2026-09-15)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- **MKP-3950:** fix dti in tabs package ([8987fc7](https://github.com/cloud-ru-tech/snack-v2/commit/8987fc7757d9c2ae5cba7c69ca50bfb0c762cb0f))
|
|
15
|
+
|
|
6
16
|
## 1.0.4 (2026-09-01)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @ds/tabs
|
|
@@ -15,5 +15,5 @@ const MAP_DIRECTION_TO_ICON = {
|
|
|
15
15
|
bottom: (0, jsx_runtime_1.jsx)(system_1.ChevronDownSVG, {}),
|
|
16
16
|
};
|
|
17
17
|
function ScrollButton({ size, onClick, direction, orientation }) {
|
|
18
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.scrollButton, "data-direction": direction, "data-size": size, "data-orientation": orientation, "data-
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.scrollButton, "data-direction": direction, "data-size": size, "data-orientation": orientation, "data-test-id": `tabs__scroll-button-${direction}`, children: (0, jsx_runtime_1.jsx)(button_1.Button, { tabIndex: -1, icon: MAP_DIRECTION_TO_ICON[direction], size: 's', view: 'elevated', appearance: 'neutral', onClick: onClick, "aria-label": `Scroll ${direction}` }) }));
|
|
19
19
|
}
|
|
@@ -74,5 +74,5 @@ function Tab({ label, value, disabled = false, className, onClick, counter, ...o
|
|
|
74
74
|
return null;
|
|
75
75
|
}
|
|
76
76
|
const { typographyProps, counterProps } = MAP_SIZE_TO_PROPS[size];
|
|
77
|
-
return ((0, jsx_runtime_1.jsx)("button", { type: 'button', role: 'tab', "data-
|
|
77
|
+
return ((0, jsx_runtime_1.jsx)("button", { type: 'button', role: 'tab', "data-test-id": `tabs__tab-${value}`, ...(0, utils_1.extractSupportProps)(otherProps), id: value, ref: ref, "aria-disabled": disabled, "data-disabled": disabled || undefined, className: (0, classnames_1.default)(styles_module_scss_1.default.tab, className), "aria-controls": (0, utils_2.getTabContentId)(value), "aria-selected": selected, "data-selected": selected || undefined, "data-size": size, "data-orientation": orientation, onClick: handleClick, onFocus: onFocusHandler, onKeyDown: clickByEnterOrSpaceKey, children: (0, jsx_runtime_1.jsxs)(typography_1.Typography, { className: styles_module_scss_1.default.container, as: 'div', ...typographyProps, children: [label, counter && ((0, jsx_runtime_1.jsx)(counter_1.Counter, { appearance: counter.appearance, roleAppearance: counter.roleAppearance, value: counter.label, "data-test-id": `tabs__tab-counter-${value}`, ...counterProps })), (0, jsx_runtime_1.jsx)("span", { "data-state-layer": true, "aria-hidden": true, "data-state": 'emptyNeutralOnBackground' })] }) }));
|
|
78
78
|
}
|
|
@@ -115,5 +115,5 @@ function TabBar({ children, className, size = constants_1.SIZE.L, orientation =
|
|
|
115
115
|
orientation,
|
|
116
116
|
focusedTab,
|
|
117
117
|
onFocus: onFocusHandler,
|
|
118
|
-
}, children: children }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.marker, style: markerScrollPosition, "data-position": markerPosition, "data-orientation": orientation })] }) }) }), orientation === constants_1.ORIENTATION.Horizontal && hasOverflow.left && ((0, jsx_runtime_1.jsx)(ScrollButton_1.ScrollButton, { direction: 'left', onClick: scrollLeft, orientation: orientation, size: size })), orientation === constants_1.ORIENTATION.Horizontal && hasOverflow.right && ((0, jsx_runtime_1.jsx)(ScrollButton_1.ScrollButton, { direction: 'right', onClick: scrollRight, orientation: orientation, size: size })), orientation === constants_1.ORIENTATION.Vertical && hasOverflow.top && ((0, jsx_runtime_1.jsx)(ScrollButton_1.ScrollButton, { direction: 'top', onClick: scrollTop, orientation: orientation, size: size })), orientation === constants_1.ORIENTATION.Vertical && hasOverflow.bottom && ((0, jsx_runtime_1.jsx)(ScrollButton_1.ScrollButton, { direction: 'bottom', onClick: scrollBottom, orientation: orientation, size: size }))] })] }), slotActionButton && ((0, jsx_runtime_1.jsx)("div", { "data-
|
|
118
|
+
}, children: children }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.marker, style: markerScrollPosition, "data-position": markerPosition, "data-orientation": orientation })] }) }) }), orientation === constants_1.ORIENTATION.Horizontal && hasOverflow.left && ((0, jsx_runtime_1.jsx)(ScrollButton_1.ScrollButton, { direction: 'left', onClick: scrollLeft, orientation: orientation, size: size })), orientation === constants_1.ORIENTATION.Horizontal && hasOverflow.right && ((0, jsx_runtime_1.jsx)(ScrollButton_1.ScrollButton, { direction: 'right', onClick: scrollRight, orientation: orientation, size: size })), orientation === constants_1.ORIENTATION.Vertical && hasOverflow.top && ((0, jsx_runtime_1.jsx)(ScrollButton_1.ScrollButton, { direction: 'top', onClick: scrollTop, orientation: orientation, size: size })), orientation === constants_1.ORIENTATION.Vertical && hasOverflow.bottom && ((0, jsx_runtime_1.jsx)(ScrollButton_1.ScrollButton, { direction: 'bottom', onClick: scrollBottom, orientation: orientation, size: size }))] })] }), slotActionButton && ((0, jsx_runtime_1.jsx)("div", { "data-test-id": 'tabs__bar__after', "data-orientation": orientation, "data-size": size, className: styles_module_scss_1.default.tabBarAfter, children: slotActionButton }))] }));
|
|
119
119
|
}
|
|
@@ -10,5 +10,5 @@ function TabContent({ children, value, className, ...rest }) {
|
|
|
10
10
|
if (value !== selectedTab) {
|
|
11
11
|
return null;
|
|
12
12
|
}
|
|
13
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: className, role: 'tabpanel', id: (0, utils_2.getTabContentId)(value),
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: className, role: 'tabpanel', id: (0, utils_2.getTabContentId)(value), "aria-labelledby": value, "data-test-id": `tabs__tab-content-${value}`, ...(0, utils_1.extractSupportProps)(rest), children: children }));
|
|
14
14
|
}
|
|
@@ -9,5 +9,5 @@ const MAP_DIRECTION_TO_ICON = {
|
|
|
9
9
|
bottom: _jsx(ChevronDownSVG, {}),
|
|
10
10
|
};
|
|
11
11
|
export function ScrollButton({ size, onClick, direction, orientation }) {
|
|
12
|
-
return (_jsx("div", { className: styles.scrollButton, "data-direction": direction, "data-size": size, "data-orientation": orientation, "data-
|
|
12
|
+
return (_jsx("div", { className: styles.scrollButton, "data-direction": direction, "data-size": size, "data-orientation": orientation, "data-test-id": `tabs__scroll-button-${direction}`, children: _jsx(Button, { tabIndex: -1, icon: MAP_DIRECTION_TO_ICON[direction], size: 's', view: 'elevated', appearance: 'neutral', onClick: onClick, "aria-label": `Scroll ${direction}` }) }));
|
|
13
13
|
}
|
|
@@ -68,5 +68,5 @@ export function Tab({ label, value, disabled = false, className, onClick, counte
|
|
|
68
68
|
return null;
|
|
69
69
|
}
|
|
70
70
|
const { typographyProps, counterProps } = MAP_SIZE_TO_PROPS[size];
|
|
71
|
-
return (_jsx("button", { type: 'button', role: 'tab', "data-
|
|
71
|
+
return (_jsx("button", { type: 'button', role: 'tab', "data-test-id": `tabs__tab-${value}`, ...extractSupportProps(otherProps), id: value, ref: ref, "aria-disabled": disabled, "data-disabled": disabled || undefined, className: cn(styles.tab, className), "aria-controls": getTabContentId(value), "aria-selected": selected, "data-selected": selected || undefined, "data-size": size, "data-orientation": orientation, onClick: handleClick, onFocus: onFocusHandler, onKeyDown: clickByEnterOrSpaceKey, children: _jsxs(Typography, { className: styles.container, as: 'div', ...typographyProps, children: [label, counter && (_jsx(Counter, { appearance: counter.appearance, roleAppearance: counter.roleAppearance, value: counter.label, "data-test-id": `tabs__tab-counter-${value}`, ...counterProps })), _jsx("span", { "data-state-layer": true, "aria-hidden": true, "data-state": 'emptyNeutralOnBackground' })] }) }));
|
|
72
72
|
}
|
|
@@ -109,5 +109,5 @@ export function TabBar({ children, className, size = SIZE.L, orientation = ORIEN
|
|
|
109
109
|
orientation,
|
|
110
110
|
focusedTab,
|
|
111
111
|
onFocus: onFocusHandler,
|
|
112
|
-
}, children: children }), _jsx("div", { className: styles.marker, style: markerScrollPosition, "data-position": markerPosition, "data-orientation": orientation })] }) }) }), orientation === ORIENTATION.Horizontal && hasOverflow.left && (_jsx(ScrollButton, { direction: 'left', onClick: scrollLeft, orientation: orientation, size: size })), orientation === ORIENTATION.Horizontal && hasOverflow.right && (_jsx(ScrollButton, { direction: 'right', onClick: scrollRight, orientation: orientation, size: size })), orientation === ORIENTATION.Vertical && hasOverflow.top && (_jsx(ScrollButton, { direction: 'top', onClick: scrollTop, orientation: orientation, size: size })), orientation === ORIENTATION.Vertical && hasOverflow.bottom && (_jsx(ScrollButton, { direction: 'bottom', onClick: scrollBottom, orientation: orientation, size: size }))] })] }), slotActionButton && (_jsx("div", { "data-
|
|
112
|
+
}, children: children }), _jsx("div", { className: styles.marker, style: markerScrollPosition, "data-position": markerPosition, "data-orientation": orientation })] }) }) }), orientation === ORIENTATION.Horizontal && hasOverflow.left && (_jsx(ScrollButton, { direction: 'left', onClick: scrollLeft, orientation: orientation, size: size })), orientation === ORIENTATION.Horizontal && hasOverflow.right && (_jsx(ScrollButton, { direction: 'right', onClick: scrollRight, orientation: orientation, size: size })), orientation === ORIENTATION.Vertical && hasOverflow.top && (_jsx(ScrollButton, { direction: 'top', onClick: scrollTop, orientation: orientation, size: size })), orientation === ORIENTATION.Vertical && hasOverflow.bottom && (_jsx(ScrollButton, { direction: 'bottom', onClick: scrollBottom, orientation: orientation, size: size }))] })] }), slotActionButton && (_jsx("div", { "data-test-id": 'tabs__bar__after', "data-orientation": orientation, "data-size": size, className: styles.tabBarAfter, children: slotActionButton }))] }));
|
|
113
113
|
}
|
|
@@ -7,5 +7,5 @@ export function TabContent({ children, value, className, ...rest }) {
|
|
|
7
7
|
if (value !== selectedTab) {
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
10
|
-
return (_jsx("div", { className: className, role: 'tabpanel', id: getTabContentId(value),
|
|
10
|
+
return (_jsx("div", { className: className, role: 'tabpanel', id: getTabContentId(value), "aria-labelledby": value, "data-test-id": `tabs__tab-content-${value}`, ...extractSupportProps(rest), children: children }));
|
|
11
11
|
}
|