@cloud-ru/ds-accordion 1.1.6-preview-3ffb7c01.0 → 1.1.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 +6 -0
- package/dist/cjs/components/CollapseBlock/CollapseBlock.js +6 -1
- package/dist/esm/components/CollapseBlock/CollapseBlock.js +6 -1
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/components/CollapseBlock/CollapseBlock.tsx +12 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
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.1.6 (2026-10-02)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **FF-9218:** stop click propagation in collapse block ([c9e3892](https://github.com/cloud-ru-tech/snack-v2/commit/c9e389265fa46f809fdd3d20d3a7922e27cf3a4a))
|
|
11
|
+
|
|
6
12
|
## 1.1.5 (2026-10-01)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @ds/accordion
|
|
@@ -16,6 +16,7 @@ const constants_1 = require("../../constants");
|
|
|
16
16
|
const helperComponents_1 = require("../../helperComponents");
|
|
17
17
|
const hooks_1 = require("./hooks");
|
|
18
18
|
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
19
|
+
const stopPropagation = (e) => e.stopPropagation();
|
|
19
20
|
const MAP_COMPONENT_TO_TILE_SIZE = {
|
|
20
21
|
accordionPrimary: 'l',
|
|
21
22
|
accordionSecondary: 'm',
|
|
@@ -36,7 +37,11 @@ function CollapseBlock({ id, title, afterTitle, subTitle, children, className, v
|
|
|
36
37
|
const chevronLabelledBy = [title && titleId, afterTitle && afterTitleId].filter(Boolean).join(' ') || undefined;
|
|
37
38
|
return ((0, jsx_runtime_1.jsxs)("div", { ...(0, utils_1.extractSupportProps)(rest), className: (0, classnames_1.default)(styles_module_scss_1.default.wrapper, className), "data-acrylic-appearance": appearance, "data-acrylic-level": level, "data-expanded": isOpen, "data-completely-open": isCompletelyOpen || undefined, "data-view": view, "data-component": component, "data-test-id": dataTestId ?? constants_1.TEST_IDS.collapseBlock, style: {
|
|
38
39
|
'--sn-collapse-block-animation-duration': `${constants_1.ANIMATION_DURATION}ms`,
|
|
39
|
-
}, children: [component !== 'accordionTertiary' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.acrylic }), view === constants_1.VIEW.Outline && (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.stateLayer, "data-state": 'borderOnBackground' })] })), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.titleContent, "data-expanded": isOpen || undefined, "data-completely-close": isCompletelyClose || undefined, "data-chevron-position": chevronPosition, onClick: toggleOpen, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.titleWrapper, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.titleLine, children: [title && ((0, jsx_runtime_1.jsx)(typography_1.Typography, { size: MAP_COMPONENT_TO_TILE_SIZE[component], variant: 'title', className: styles_module_scss_1.default.title, id: titleId, "data-test-id": constants_1.TEST_IDS.title, children: (0, jsx_runtime_1.jsx)(truncate_string_1.TruncateString, { text: title, variant: 'end' }) })), afterTitle && (
|
|
40
|
+
}, children: [component !== 'accordionTertiary' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.acrylic }), view === constants_1.VIEW.Outline && (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.stateLayer, "data-state": 'borderOnBackground' })] })), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.titleContent, "data-expanded": isOpen || undefined, "data-completely-close": isCompletelyClose || undefined, "data-chevron-position": chevronPosition, onClick: toggleOpen, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.titleWrapper, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.titleLine, children: [title && ((0, jsx_runtime_1.jsx)(typography_1.Typography, { size: MAP_COMPONENT_TO_TILE_SIZE[component], variant: 'title', className: styles_module_scss_1.default.title, id: titleId, "data-test-id": constants_1.TEST_IDS.title, children: (0, jsx_runtime_1.jsx)(truncate_string_1.TruncateString, { text: title, variant: 'end' }) })), afterTitle && (
|
|
41
|
+
/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */
|
|
42
|
+
(0, jsx_runtime_1.jsx)("div", { id: afterTitleId, "data-test-id": constants_1.TEST_IDS.afterTitle, className: styles_module_scss_1.default.afterTitle, onClick: stopPropagation, children: afterTitle }))] }), subTitle && (
|
|
43
|
+
/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */
|
|
44
|
+
(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.subTitle, "data-test-id": constants_1.TEST_IDS.subTitle, onClick: stopPropagation, children: subTitle }))] }), showChevron && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.chevronWrapper, children: (0, jsx_runtime_1.jsx)(helperComponents_1.ChevronButton, { expanded: isOpen, contentId: contentId, labelledBy: chevronLabelledBy, "data-test-id": constants_1.TEST_IDS.chevron }) }))] }), (0, jsx_runtime_1.jsx)("div", { id: contentId, className: styles_module_scss_1.default.collapse, "data-expanded": isOpen || undefined, "aria-hidden": !isOpen, children: (0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.container, isCompletelyOpen && styles_module_scss_1.default.containerCompletelyOpen), "data-completely-close": isCompletelyClose || undefined, "data-expanded": isOpen || undefined, children: [(0, jsx_runtime_1.jsx)("div", {}), isMounted ? (0, jsx_runtime_1.jsx)("div", { "data-test-id": constants_1.TEST_IDS.content, children: children }) : null] }) })] }));
|
|
40
45
|
}
|
|
41
46
|
function getCollapseBlock(component) {
|
|
42
47
|
return function CollapseBlockWithComponent(props) {
|
|
@@ -9,6 +9,7 @@ import { ANIMATION_DURATION, CHEVRON_POSITION, TEST_IDS, VIEW } from '../../cons
|
|
|
9
9
|
import { ChevronButton } from '../../helperComponents/index.js';
|
|
10
10
|
import { useCollapseState } from './hooks.js';
|
|
11
11
|
import styles from './styles.module.css';
|
|
12
|
+
const stopPropagation = (e) => e.stopPropagation();
|
|
12
13
|
const MAP_COMPONENT_TO_TILE_SIZE = {
|
|
13
14
|
accordionPrimary: 'l',
|
|
14
15
|
accordionSecondary: 'm',
|
|
@@ -29,7 +30,11 @@ export function CollapseBlock({ id, title, afterTitle, subTitle, children, class
|
|
|
29
30
|
const chevronLabelledBy = [title && titleId, afterTitle && afterTitleId].filter(Boolean).join(' ') || undefined;
|
|
30
31
|
return (_jsxs("div", { ...extractSupportProps(rest), className: cn(styles.wrapper, className), "data-acrylic-appearance": appearance, "data-acrylic-level": level, "data-expanded": isOpen, "data-completely-open": isCompletelyOpen || undefined, "data-view": view, "data-component": component, "data-test-id": dataTestId ?? TEST_IDS.collapseBlock, style: {
|
|
31
32
|
'--sn-collapse-block-animation-duration': `${ANIMATION_DURATION}ms`,
|
|
32
|
-
}, children: [component !== 'accordionTertiary' && (_jsxs(_Fragment, { children: [_jsx("div", { className: styles.acrylic }), view === VIEW.Outline && _jsx("div", { className: styles.stateLayer, "data-state": 'borderOnBackground' })] })), _jsxs("div", { className: styles.titleContent, "data-expanded": isOpen || undefined, "data-completely-close": isCompletelyClose || undefined, "data-chevron-position": chevronPosition, onClick: toggleOpen, children: [_jsxs("div", { className: styles.titleWrapper, children: [_jsxs("div", { className: styles.titleLine, children: [title && (_jsx(Typography, { size: MAP_COMPONENT_TO_TILE_SIZE[component], variant: 'title', className: styles.title, id: titleId, "data-test-id": TEST_IDS.title, children: _jsx(TruncateString, { text: title, variant: 'end' }) })), afterTitle && (
|
|
33
|
+
}, children: [component !== 'accordionTertiary' && (_jsxs(_Fragment, { children: [_jsx("div", { className: styles.acrylic }), view === VIEW.Outline && _jsx("div", { className: styles.stateLayer, "data-state": 'borderOnBackground' })] })), _jsxs("div", { className: styles.titleContent, "data-expanded": isOpen || undefined, "data-completely-close": isCompletelyClose || undefined, "data-chevron-position": chevronPosition, onClick: toggleOpen, children: [_jsxs("div", { className: styles.titleWrapper, children: [_jsxs("div", { className: styles.titleLine, children: [title && (_jsx(Typography, { size: MAP_COMPONENT_TO_TILE_SIZE[component], variant: 'title', className: styles.title, id: titleId, "data-test-id": TEST_IDS.title, children: _jsx(TruncateString, { text: title, variant: 'end' }) })), afterTitle && (
|
|
34
|
+
/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */
|
|
35
|
+
_jsx("div", { id: afterTitleId, "data-test-id": TEST_IDS.afterTitle, className: styles.afterTitle, onClick: stopPropagation, children: afterTitle }))] }), subTitle && (
|
|
36
|
+
/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */
|
|
37
|
+
_jsx("div", { className: styles.subTitle, "data-test-id": TEST_IDS.subTitle, onClick: stopPropagation, children: subTitle }))] }), showChevron && (_jsx("div", { className: styles.chevronWrapper, children: _jsx(ChevronButton, { expanded: isOpen, contentId: contentId, labelledBy: chevronLabelledBy, "data-test-id": TEST_IDS.chevron }) }))] }), _jsx("div", { id: contentId, className: styles.collapse, "data-expanded": isOpen || undefined, "aria-hidden": !isOpen, children: _jsxs("div", { className: cn(styles.container, isCompletelyOpen && styles.containerCompletelyOpen), "data-completely-close": isCompletelyClose || undefined, "data-expanded": isOpen || undefined, children: [_jsx("div", {}), isMounted ? _jsx("div", { "data-test-id": TEST_IDS.content, children: children }) : null] }) })] }));
|
|
33
38
|
}
|
|
34
39
|
function getCollapseBlock(component) {
|
|
35
40
|
return function CollapseBlockWithComponent(props) {
|