@snack-uikit/status 0.8.8 → 0.10.0
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 +22 -0
- package/dist/cjs/components/Status/Status.js +6 -2
- package/dist/cjs/components/Status/styles.module.css +1 -0
- package/dist/esm/components/Status/Status.js +2 -1
- package/dist/esm/components/Status/styles.module.css +1 -0
- package/package.json +3 -2
- package/src/components/Status/Status.tsx +8 -1
- package/src/components/Status/styles.module.scss +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
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.0 (2025-07-18)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **VMWDEV-2607:** add prop for always show badge ([4076c9b](https://github.com/cloud-ru-tech/snack-uikit/commit/4076c9bb0c5f7c376cb138fee236751c58a02e6a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# 0.9.0 (2025-07-17)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **MC-00:** truncate status label ([06989bf](https://github.com/cloud-ru-tech/snack-uikit/commit/06989bf5fd33b73b543fb3a0b8b55603c0ecbe96))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
## 0.8.8 (2025-07-16)
|
|
7
29
|
|
|
8
30
|
### Only dependencies have been changed
|
|
@@ -25,6 +25,7 @@ const constants_1 = require("../../constants");
|
|
|
25
25
|
const StatusIndicator_1 = require("../StatusIndicator");
|
|
26
26
|
const constants_2 = require("./constants");
|
|
27
27
|
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
28
|
+
const truncate_string_1 = require("@snack-uikit/truncate-string");
|
|
28
29
|
function Status(_a) {
|
|
29
30
|
var {
|
|
30
31
|
label,
|
|
@@ -46,9 +47,12 @@ function Status(_a) {
|
|
|
46
47
|
}) : (0, jsx_runtime_1.jsx)(StatusIndicator_1.StatusIndicator, {
|
|
47
48
|
appearance: appearance,
|
|
48
49
|
size: constants_2.STATUS_INDICATOR_SIZE_MAP[size]
|
|
49
|
-
}), (0, jsx_runtime_1.jsx)(
|
|
50
|
+
}), (0, jsx_runtime_1.jsx)(truncate_string_1.TruncateString, {
|
|
51
|
+
text: label,
|
|
52
|
+
maxLines: 1,
|
|
50
53
|
className: styles_module_scss_1.default.label,
|
|
51
|
-
|
|
54
|
+
"data-test-id": 'status__title',
|
|
55
|
+
"data-size": size
|
|
52
56
|
})]
|
|
53
57
|
}));
|
|
54
58
|
}
|
|
@@ -17,7 +17,8 @@ import { APPEARANCE } from '../../constants';
|
|
|
17
17
|
import { StatusIndicator } from '../StatusIndicator';
|
|
18
18
|
import { LOADER_SIZE_MAP, SIZE, STATUS_INDICATOR_SIZE_MAP } from './constants';
|
|
19
19
|
import styles from './styles.module.css';
|
|
20
|
+
import { TruncateString } from '@snack-uikit/truncate-string';
|
|
20
21
|
export function Status(_a) {
|
|
21
22
|
var { label, size = SIZE.Xs, appearance = APPEARANCE.Primary, hasBackground, loading, className } = _a, rest = __rest(_a, ["label", "size", "appearance", "hasBackground", "loading", "className"]);
|
|
22
|
-
return (_jsxs("div", Object.assign({ className: cn(styles.container, className) }, extractSupportProps(rest), { "data-size": size, "data-has-background": hasBackground || undefined, "data-appearance": loading ? APPEARANCE.Neutral : appearance, children: [loading ? (_jsx(Spinner, { size: LOADER_SIZE_MAP[size] })) : (_jsx(StatusIndicator, { appearance: appearance, size: STATUS_INDICATOR_SIZE_MAP[size] })), _jsx(
|
|
23
|
+
return (_jsxs("div", Object.assign({ className: cn(styles.container, className) }, extractSupportProps(rest), { "data-size": size, "data-has-background": hasBackground || undefined, "data-appearance": loading ? APPEARANCE.Neutral : appearance, children: [loading ? (_jsx(Spinner, { size: LOADER_SIZE_MAP[size] })) : (_jsx(StatusIndicator, { appearance: appearance, size: STATUS_INDICATOR_SIZE_MAP[size] })), _jsx(TruncateString, { text: label, maxLines: 1, className: styles.label, "data-test-id": 'status__title', "data-size": size })] })));
|
|
23
24
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"title": "Status",
|
|
7
|
-
"version": "0.
|
|
7
|
+
"version": "0.10.0",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -37,8 +37,9 @@
|
|
|
37
37
|
"scripts": {},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@snack-uikit/loaders": "0.9.8",
|
|
40
|
+
"@snack-uikit/truncate-string": "0.7.0",
|
|
40
41
|
"@snack-uikit/utils": "3.10.1",
|
|
41
42
|
"classnames": "2.5.1"
|
|
42
43
|
},
|
|
43
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "93f66a95830871b0c0c29d43d6d9c28488a4c10a"
|
|
44
45
|
}
|
|
@@ -9,6 +9,7 @@ import { StatusIndicator } from '../StatusIndicator';
|
|
|
9
9
|
import { LOADER_SIZE_MAP, SIZE, STATUS_INDICATOR_SIZE_MAP } from './constants';
|
|
10
10
|
import styles from './styles.module.scss';
|
|
11
11
|
import { Size } from './types';
|
|
12
|
+
import { TruncateString } from '@snack-uikit/truncate-string';
|
|
12
13
|
|
|
13
14
|
export type StatusProps = WithSupportProps<{
|
|
14
15
|
/** Текст */
|
|
@@ -45,7 +46,13 @@ export function Status({
|
|
|
45
46
|
) : (
|
|
46
47
|
<StatusIndicator appearance={appearance} size={STATUS_INDICATOR_SIZE_MAP[size]} />
|
|
47
48
|
)}
|
|
48
|
-
<
|
|
49
|
+
<TruncateString
|
|
50
|
+
text={label}
|
|
51
|
+
maxLines={1}
|
|
52
|
+
className={styles.label}
|
|
53
|
+
data-test-id='status__title'
|
|
54
|
+
data-size={size}
|
|
55
|
+
/>
|
|
49
56
|
</div>
|
|
50
57
|
);
|
|
51
58
|
}
|
|
@@ -10,12 +10,13 @@ $appearances: 'primary', 'neutral', 'red', 'orange', 'blue', 'violet', 'pink', '
|
|
|
10
10
|
.container {
|
|
11
11
|
display: inline-flex;
|
|
12
12
|
align-items: center;
|
|
13
|
+
max-width: 100%;
|
|
13
14
|
|
|
14
15
|
&[data-has-background] {
|
|
15
16
|
@each $appearance in $appearances {
|
|
16
17
|
&[data-appearance='#{$appearance}'] {
|
|
17
18
|
background-color: styles-tokens-status.simple-var(styles-tokens-status.$theme-variables, 'sys', $appearance, 'decor-default');
|
|
18
|
-
|
|
19
|
+
|
|
19
20
|
.label {
|
|
20
21
|
color: styles-tokens-status.simple-var(styles-tokens-status.$theme-variables, 'sys', $appearance, 'text-support')
|
|
21
22
|
}
|
|
@@ -42,4 +43,4 @@ $appearances: 'primary', 'neutral', 'red', 'orange', 'blue', 'violet', 'pink', '
|
|
|
42
43
|
|
|
43
44
|
.label {
|
|
44
45
|
color: styles-tokens-status.$sys-neutral-text-support;
|
|
45
|
-
}
|
|
46
|
+
}
|