@snack-uikit/list 0.8.0 → 0.8.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/helperComponents/Separator/Separator.js +2 -1
- package/dist/helperComponents/Separator/styles.module.css +11 -1
- package/package.json +2 -2
- package/src/helperComponents/Separator/Separator.tsx +4 -2
- package/src/helperComponents/Separator/styles.module.scss +12 -1
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.8.1 (2024-03-19)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **FF-4559:** truncate long group label ([4862a19](https://github.com/cloud-ru-tech/snack-uikit/commit/4862a192452c6e3b735ec0da0218e0af028dc127))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# 0.8.0 (2024-03-11)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Divider } from '@snack-uikit/divider';
|
|
3
|
+
import { TruncateString } from '@snack-uikit/truncate-string';
|
|
3
4
|
import styles from './styles.module.css';
|
|
4
5
|
export function Separator({ label, divider, mode = 'secondary', size = 's' }) {
|
|
5
6
|
if (label) {
|
|
6
|
-
return (_jsxs("div", { className: styles.separatorWithLabel, "data-size": size, children: [_jsx("span", { className: styles.label, "data-mode": mode, children: label }), divider && _jsx(Divider, { weight: mode === 'primary' ? 'regular' : 'light' })] }));
|
|
7
|
+
return (_jsxs("div", { className: styles.separatorWithLabel, "data-size": size, children: [_jsx("span", { className: styles.label, "data-mode": mode, children: _jsx(TruncateString, { text: label, maxLines: 1 }) }), divider && _jsx(Divider, { weight: mode === 'primary' ? 'regular' : 'light', className: styles.divider })] }));
|
|
7
8
|
}
|
|
8
9
|
if (divider) {
|
|
9
10
|
return (_jsx("div", { className: styles.separatorWithoutLabel, "data-size": size, children: _jsx(Divider, { weight: 'regular' }) }));
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
.separatorWithLabel{
|
|
2
|
+
overflow:hidden;
|
|
2
3
|
display:flex;
|
|
3
4
|
gap:var(--dimension-1m, 8px);
|
|
4
5
|
align-items:flex-end;
|
|
5
6
|
box-sizing:border-box;
|
|
7
|
+
width:100%;
|
|
8
|
+
min-width:100%;
|
|
6
9
|
}
|
|
7
10
|
.separatorWithLabel[data-size=s]{
|
|
8
11
|
padding-top:var(--space-drop-list-item-s-container-separator-subheader-vertical-padding, 4px);
|
|
@@ -102,11 +105,18 @@
|
|
|
102
105
|
}
|
|
103
106
|
|
|
104
107
|
.label{
|
|
105
|
-
|
|
108
|
+
overflow:hidden;
|
|
109
|
+
flex-shrink:1;
|
|
106
110
|
}
|
|
107
111
|
.label[data-mode=primary]{
|
|
108
112
|
color:var(--sys-neutral-text-main, #33333b);
|
|
109
113
|
}
|
|
110
114
|
.label[data-mode=secondary]{
|
|
111
115
|
color:var(--sys-neutral-text-light, #868892);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
hr.divider{
|
|
119
|
+
flex:1;
|
|
120
|
+
width:auto;
|
|
121
|
+
min-width:0;
|
|
112
122
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"title": "List",
|
|
7
|
-
"version": "0.8.
|
|
7
|
+
"version": "0.8.1",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@snack-uikit/locale": "*"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "886b294a5276c22c27fe63aaf6f71b0ab3f5e63f"
|
|
58
58
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Divider } from '@snack-uikit/divider';
|
|
2
|
+
import { TruncateString } from '@snack-uikit/truncate-string';
|
|
2
3
|
|
|
3
4
|
import styles from './styles.module.scss';
|
|
4
5
|
|
|
@@ -14,9 +15,10 @@ export function Separator({ label, divider, mode = 'secondary', size = 's' }: Se
|
|
|
14
15
|
return (
|
|
15
16
|
<div className={styles.separatorWithLabel} data-size={size}>
|
|
16
17
|
<span className={styles.label} data-mode={mode}>
|
|
17
|
-
{label}
|
|
18
|
+
<TruncateString text={label} maxLines={1} />
|
|
18
19
|
</span>
|
|
19
|
-
|
|
20
|
+
|
|
21
|
+
{divider && <Divider weight={mode === 'primary' ? 'regular' : 'light'} className={styles.divider} />}
|
|
20
22
|
</div>
|
|
21
23
|
);
|
|
22
24
|
}
|
|
@@ -16,10 +16,14 @@ $typography-secondary: (
|
|
|
16
16
|
);
|
|
17
17
|
|
|
18
18
|
.separatorWithLabel {
|
|
19
|
+
overflow: hidden;
|
|
19
20
|
display: flex;
|
|
20
21
|
gap: $dimension-1m;
|
|
21
22
|
align-items: flex-end;
|
|
23
|
+
|
|
22
24
|
box-sizing: border-box;
|
|
25
|
+
width: 100%;
|
|
26
|
+
min-width: 100%;
|
|
23
27
|
|
|
24
28
|
@each $size in $sizes {
|
|
25
29
|
&[data-size='#{$size}'] {
|
|
@@ -51,7 +55,8 @@ $typography-secondary: (
|
|
|
51
55
|
}
|
|
52
56
|
|
|
53
57
|
.label {
|
|
54
|
-
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
flex-shrink: 1;
|
|
55
60
|
|
|
56
61
|
&[data-mode='primary'] {
|
|
57
62
|
color: $sys-neutral-text-main;
|
|
@@ -61,3 +66,9 @@ $typography-secondary: (
|
|
|
61
66
|
color: $sys-neutral-text-light;
|
|
62
67
|
}
|
|
63
68
|
}
|
|
69
|
+
|
|
70
|
+
hr.divider {
|
|
71
|
+
flex: 1;
|
|
72
|
+
width: auto;
|
|
73
|
+
min-width: 0;
|
|
74
|
+
}
|