@snack-uikit/toolbar 0.10.0 → 0.10.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/CHANGELOG.md +11 -0
- package/dist/cjs/helperComponents/BulkActions/BulkActions.js +30 -27
- package/dist/cjs/helperComponents/BulkActions/styles.module.css +7 -3
- package/dist/esm/helperComponents/BulkActions/BulkActions.js +1 -1
- package/dist/esm/helperComponents/BulkActions/styles.module.css +7 -3
- package/package.json +2 -2
- package/src/helperComponents/BulkActions/BulkActions.tsx +24 -22
- package/src/helperComponents/BulkActions/styles.module.scss +8 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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
|
+
## 0.10.1 (2025-01-31)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **PDS-1461:** update after token change ([3324d1d](https://github.com/cloud-ru-tech/snack-uikit/commit/3324d1da07b8d0e26186046d859985774fc06ce6))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# 0.10.0 (2025-01-23)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -60,35 +60,38 @@ function BulkActions(_ref) {
|
|
|
60
60
|
tabIndex: -1
|
|
61
61
|
})
|
|
62
62
|
}), (checked || indeterminate) && (0, jsx_runtime_1.jsxs)("div", {
|
|
63
|
-
className: styles_module_scss_1.default.
|
|
63
|
+
className: styles_module_scss_1.default.bulkActionsWrapper,
|
|
64
64
|
"data-test-id": constants_1.TEST_IDS.bulkActions,
|
|
65
65
|
ref: parentContainerRef,
|
|
66
|
-
children: [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
66
|
+
children: [(0, jsx_runtime_1.jsx)("div", {
|
|
67
|
+
className: styles_module_scss_1.default.bulkActions,
|
|
68
|
+
children: visibleItems.map(_ref2 => {
|
|
69
|
+
let {
|
|
70
|
+
label,
|
|
71
|
+
icon: Icon,
|
|
72
|
+
onClick,
|
|
73
|
+
disabled,
|
|
74
|
+
tooltip,
|
|
75
|
+
'data-test-id': testId
|
|
76
|
+
} = _ref2;
|
|
77
|
+
return (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, {
|
|
78
|
+
tip: tooltip,
|
|
79
|
+
open: tooltip ? undefined : false,
|
|
80
|
+
placement: 'top',
|
|
81
|
+
"data-test-id": `${testId}-tooltip`,
|
|
82
|
+
children: (0, jsx_runtime_1.jsx)(button_1.ButtonFunction, {
|
|
83
|
+
className: styles_module_scss_1.default.action,
|
|
84
|
+
fullWidth: true,
|
|
85
|
+
"data-test-id": testId,
|
|
86
|
+
iconPosition: 'before',
|
|
87
|
+
icon: (0, jsx_runtime_1.jsx)(Icon, {}),
|
|
88
|
+
label: label,
|
|
89
|
+
size: 'm',
|
|
90
|
+
onClick: onClick,
|
|
91
|
+
disabled: disabled
|
|
92
|
+
})
|
|
93
|
+
}, label);
|
|
94
|
+
})
|
|
92
95
|
}), hiddenItems.length > 0 && (0, jsx_runtime_1.jsx)(list_1.Droplist, {
|
|
93
96
|
trigger: 'clickAndFocusVisible',
|
|
94
97
|
closeDroplistOnItemClick: true,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
.
|
|
1
|
+
.bulkActionsWrapper{
|
|
2
2
|
padding-right:var(--space-toolbar-bulk-action-padding-right, 12px);
|
|
3
|
-
gap:var(--space-toolbar-bulk-action-gap, 8px);
|
|
4
3
|
scrollbar-width:none;
|
|
5
4
|
display:flex;
|
|
6
5
|
flex-shrink:1;
|
|
@@ -8,10 +7,15 @@
|
|
|
8
7
|
min-width:0;
|
|
9
8
|
-ms-overflow-style:none;
|
|
10
9
|
}
|
|
11
|
-
.
|
|
10
|
+
.bulkActionsWrapper::-webkit-scrollbar{
|
|
12
11
|
display:none;
|
|
13
12
|
}
|
|
14
13
|
|
|
14
|
+
.bulkActions{
|
|
15
|
+
gap:var(--space-toolbar-bulk-action-gap, 8px);
|
|
16
|
+
display:flex;
|
|
17
|
+
}
|
|
18
|
+
|
|
15
19
|
.checkboxWrapper{
|
|
16
20
|
border-radius:var(--radius-toolbar-checkbox, 14px);
|
|
17
21
|
width:var(--size-toolbar-checkbox, 40px);
|
|
@@ -22,7 +22,7 @@ export function BulkActions({ actions, checked, onCheck, indeterminate, selectio
|
|
|
22
22
|
parentContainerRef,
|
|
23
23
|
maxVisibleItems: 3,
|
|
24
24
|
});
|
|
25
|
-
return (_jsxs(_Fragment, { children: [selectionMode === SELECTION_MODE.Multiple && (_jsx("div", { className: styles.checkboxWrapper, onClick: onCheck, tabIndex: 0, role: 'checkbox', "aria-checked": checked, onKeyDown: handleKeyDown, "data-test-id": TEST_IDS.checkbox, children: _jsx(Checkbox, { size: 's', checked: checked, indeterminate: indeterminate, tabIndex: -1 }) })), (checked || indeterminate) && (_jsxs("div", { className: styles.
|
|
25
|
+
return (_jsxs(_Fragment, { children: [selectionMode === SELECTION_MODE.Multiple && (_jsx("div", { className: styles.checkboxWrapper, onClick: onCheck, tabIndex: 0, role: 'checkbox', "aria-checked": checked, onKeyDown: handleKeyDown, "data-test-id": TEST_IDS.checkbox, children: _jsx(Checkbox, { size: 's', checked: checked, indeterminate: indeterminate, tabIndex: -1 }) })), (checked || indeterminate) && (_jsxs("div", { className: styles.bulkActionsWrapper, "data-test-id": TEST_IDS.bulkActions, ref: parentContainerRef, children: [_jsx("div", { className: styles.bulkActions, children: visibleItems.map(({ label, icon: Icon, onClick, disabled, tooltip, 'data-test-id': testId }) => (_jsx(Tooltip, { tip: tooltip, open: tooltip ? undefined : false, placement: 'top', "data-test-id": `${testId}-tooltip`, children: _jsx(ButtonFunction, { className: styles.action, fullWidth: true, "data-test-id": testId, iconPosition: 'before', icon: _jsx(Icon, {}), label: label, size: 'm', onClick: onClick, disabled: disabled }) }, label))) }), hiddenItems.length > 0 && (_jsx(Droplist, { trigger: 'clickAndFocusVisible', closeDroplistOnItemClick: true, items: hiddenItems.map(({ label, icon: Icon, onClick, disabled, tooltip, 'data-test-id': testId }) => ({
|
|
26
26
|
id: label,
|
|
27
27
|
content: { option: label },
|
|
28
28
|
beforeContent: _jsx(Icon, {}),
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
.
|
|
1
|
+
.bulkActionsWrapper{
|
|
2
2
|
padding-right:var(--space-toolbar-bulk-action-padding-right, 12px);
|
|
3
|
-
gap:var(--space-toolbar-bulk-action-gap, 8px);
|
|
4
3
|
scrollbar-width:none;
|
|
5
4
|
display:flex;
|
|
6
5
|
flex-shrink:1;
|
|
@@ -8,10 +7,15 @@
|
|
|
8
7
|
min-width:0;
|
|
9
8
|
-ms-overflow-style:none;
|
|
10
9
|
}
|
|
11
|
-
.
|
|
10
|
+
.bulkActionsWrapper::-webkit-scrollbar{
|
|
12
11
|
display:none;
|
|
13
12
|
}
|
|
14
13
|
|
|
14
|
+
.bulkActions{
|
|
15
|
+
gap:var(--space-toolbar-bulk-action-gap, 8px);
|
|
16
|
+
display:flex;
|
|
17
|
+
}
|
|
18
|
+
|
|
15
19
|
.checkboxWrapper{
|
|
16
20
|
border-radius:var(--radius-toolbar-checkbox, 14px);
|
|
17
21
|
width:var(--size-toolbar-checkbox, 40px);
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"title": "Toolbar",
|
|
7
|
-
"version": "0.10.
|
|
7
|
+
"version": "0.10.1",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"@snack-uikit/utils": "3.7.0",
|
|
47
47
|
"classnames": "2.5.1"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "bad2d5ed6e54954b528c1ea9dae0b8f86e4c8147"
|
|
50
50
|
}
|
|
@@ -57,28 +57,30 @@ export function BulkActions({
|
|
|
57
57
|
)}
|
|
58
58
|
|
|
59
59
|
{(checked || indeterminate) && (
|
|
60
|
-
<div className={styles.
|
|
61
|
-
{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
60
|
+
<div className={styles.bulkActionsWrapper} data-test-id={TEST_IDS.bulkActions} ref={parentContainerRef}>
|
|
61
|
+
<div className={styles.bulkActions}>
|
|
62
|
+
{visibleItems.map(({ label, icon: Icon, onClick, disabled, tooltip, 'data-test-id': testId }) => (
|
|
63
|
+
<Tooltip
|
|
64
|
+
tip={tooltip}
|
|
65
|
+
key={label}
|
|
66
|
+
open={tooltip ? undefined : false}
|
|
67
|
+
placement='top'
|
|
68
|
+
data-test-id={`${testId}-tooltip`}
|
|
69
|
+
>
|
|
70
|
+
<ButtonFunction
|
|
71
|
+
className={styles.action}
|
|
72
|
+
fullWidth
|
|
73
|
+
data-test-id={testId}
|
|
74
|
+
iconPosition='before'
|
|
75
|
+
icon={<Icon />}
|
|
76
|
+
label={label}
|
|
77
|
+
size='m'
|
|
78
|
+
onClick={onClick}
|
|
79
|
+
disabled={disabled}
|
|
80
|
+
/>
|
|
81
|
+
</Tooltip>
|
|
82
|
+
))}
|
|
83
|
+
</div>
|
|
82
84
|
|
|
83
85
|
{hiddenItems.length > 0 && (
|
|
84
86
|
<Droplist
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
@use '@snack-uikit/figma-tokens/build/scss/components/styles-tokens-toolbar' as toolbar;
|
|
2
2
|
@use '@snack-uikit/figma-tokens/build/scss/components/styles-tokens-element' as element;
|
|
3
3
|
|
|
4
|
-
.
|
|
5
|
-
@include toolbar.composite-var(toolbar.$toolbar-bulk-action);
|
|
4
|
+
.bulkActionsWrapper {
|
|
5
|
+
@include toolbar.composite-var(toolbar.$toolbar-bulk-action-wrap);
|
|
6
6
|
|
|
7
7
|
scrollbar-width: none; /* Firefox */
|
|
8
8
|
|
|
@@ -20,6 +20,12 @@
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
.bulkActions {
|
|
24
|
+
@include toolbar.composite-var(toolbar.$toolbar-bulk-action);
|
|
25
|
+
|
|
26
|
+
display: flex;
|
|
27
|
+
}
|
|
28
|
+
|
|
23
29
|
.checkboxWrapper {
|
|
24
30
|
@include toolbar.composite-var(toolbar.$toolbar-checkbox);
|
|
25
31
|
|