@scality/core-ui 0.149.0 → 0.151.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/dist/components/constants.d.ts +8 -1
- package/dist/components/constants.d.ts.map +1 -1
- package/dist/components/constants.js +7 -0
- package/dist/components/statuswrapper/Statuswrapper.component.d.ts.map +1 -1
- package/dist/components/statuswrapper/Statuswrapper.component.js +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/lib/components/constants.ts +18 -2
- package/src/lib/components/statuswrapper/Statuswrapper.component.tsx +10 -5
- package/src/lib/index.ts +11 -1
|
@@ -23,5 +23,12 @@ export type QueryTimeSpan = {
|
|
|
23
23
|
};
|
|
24
24
|
export declare const queryTimeSpansCodes: QueryTimeSpan[];
|
|
25
25
|
export declare const NAN_STRING = "NAN";
|
|
26
|
-
export
|
|
26
|
+
export declare const STATUS_CRITICAL = "critical";
|
|
27
|
+
export declare const STATUS_WARNING = "warning";
|
|
28
|
+
export declare const STATUS_SUCCESS = "success";
|
|
29
|
+
export declare const STATUS_HEALTHY = "healthy";
|
|
30
|
+
export declare const STATUS_INFO = "info";
|
|
31
|
+
export declare const STATUS_UNKNOWN = "unknown";
|
|
32
|
+
export declare const STATUS_NONE = "none";
|
|
33
|
+
export type Status = 'none' | 'unknown' | 'info' | 'healthy' | 'success' | 'warning' | 'critical';
|
|
27
34
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/lib/components/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,EAAE;KAAG,GAAG,IAAI,IAAI,GAAG,GAAG;CAQ7C,CAAC;AACF,MAAM,MAAM,IAAI,GACZ,SAAS,GACT,OAAO,GACP,MAAM,GACN,OAAO,GACP,QAAQ,GACR,MAAM,GACN,SAAS,CAAC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AAO,MAAM,cAAc,YAAY,CAAC;AACxC,eAAO,MAAM,WAAW,SAAS,CAAC;AAClC,eAAO,MAAM,cAAc,YAAY,CAAC;AACxC,eAAO,MAAM,WAAW,SAAS,CAAC;AAElC,MAAM,MAAM,MAAM,GACd,MAAM,GACN,SAAS,GACT,MAAM,GACN,SAAS,GACT,SAAS,GACT,SAAS,GACT,UAAU,CAAC"}
|
|
@@ -45,3 +45,10 @@ export const queryTimeSpansCodes = [
|
|
|
45
45
|
},
|
|
46
46
|
];
|
|
47
47
|
export const NAN_STRING = 'NAN';
|
|
48
|
+
export const STATUS_CRITICAL = 'critical';
|
|
49
|
+
export const STATUS_WARNING = 'warning';
|
|
50
|
+
export const STATUS_SUCCESS = 'success';
|
|
51
|
+
export const STATUS_HEALTHY = 'healthy';
|
|
52
|
+
export const STATUS_INFO = 'info';
|
|
53
|
+
export const STATUS_UNKNOWN = 'unknown';
|
|
54
|
+
export const STATUS_NONE = 'none';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Statuswrapper.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/statuswrapper/Statuswrapper.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,
|
|
1
|
+
{"version":3,"file":"Statuswrapper.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/statuswrapper/Statuswrapper.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EACL,MAAM,EAKP,MAAM,cAAc,CAAC;AA8CtB,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,iBAAS,aAAa,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,KAAK,2CAQjD;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
|
+
import { STATUS_CRITICAL, STATUS_UNKNOWN, STATUS_WARNING, } from '../constants';
|
|
3
4
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
4
5
|
import { faQuestionCircle, faExclamationCircle, faTimesCircle, } from '@fortawesome/free-solid-svg-icons';
|
|
5
6
|
const BadgeWrapper = styled.span `
|
|
@@ -26,13 +27,12 @@ const BadgeStyled = styled(FontAwesomeIcon) `
|
|
|
26
27
|
`;
|
|
27
28
|
const getBadgeIcon = (status) => {
|
|
28
29
|
switch (status) {
|
|
29
|
-
case
|
|
30
|
+
case STATUS_WARNING:
|
|
30
31
|
return faExclamationCircle;
|
|
31
|
-
case
|
|
32
|
+
case STATUS_CRITICAL:
|
|
32
33
|
return faTimesCircle;
|
|
33
|
-
case
|
|
34
|
+
case STATUS_UNKNOWN:
|
|
34
35
|
return faQuestionCircle;
|
|
35
|
-
case 'healthy':
|
|
36
36
|
default:
|
|
37
37
|
return null;
|
|
38
38
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { Button } from './components/button/Button.component';
|
|
|
4
4
|
export { Checkbox } from './components/checkbox/Checkbox.component';
|
|
5
5
|
export { Chips } from './components/chips/Chips.component';
|
|
6
6
|
export { Dropdown } from './components/dropdown/Dropdown.component';
|
|
7
|
-
export { LOADER_SIZE } from './components/constants';
|
|
7
|
+
export { LOADER_SIZE, STATUS_CRITICAL, STATUS_WARNING, STATUS_SUCCESS, STATUS_HEALTHY, STATUS_INFO, STATUS_UNKNOWN, STATUS_NONE, Status, } from './components/constants';
|
|
8
8
|
export { Layout } from './components/layout/Layout.component';
|
|
9
9
|
export { Loader } from './components/loader/Loader.component';
|
|
10
10
|
export { Modal } from './components/modal/Modal.component';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EACL,WAAW,EACX,eAAe,EACf,cAAc,EACd,cAAc,EACd,cAAc,EACd,WAAW,EACX,cAAc,EACd,WAAW,EACX,MAAM,GACP,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,oDAAoD,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAC7E,OAAO,EAAE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C,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ export { Button } from './components/button/Button.component';
|
|
|
4
4
|
export { Checkbox } from './components/checkbox/Checkbox.component';
|
|
5
5
|
export { Chips } from './components/chips/Chips.component';
|
|
6
6
|
export { Dropdown } from './components/dropdown/Dropdown.component';
|
|
7
|
-
export { LOADER_SIZE } from './components/constants';
|
|
7
|
+
export { LOADER_SIZE, STATUS_CRITICAL, STATUS_WARNING, STATUS_SUCCESS, STATUS_HEALTHY, STATUS_INFO, STATUS_UNKNOWN, STATUS_NONE, } from './components/constants';
|
|
8
8
|
export { Layout } from './components/layout/Layout.component';
|
|
9
9
|
export { Loader } from './components/loader/Loader.component';
|
|
10
10
|
export { Modal } from './components/modal/Modal.component';
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@ export type Size =
|
|
|
16
16
|
| 'huge'
|
|
17
17
|
| 'massive';
|
|
18
18
|
// Replace the "success" by "health", but keep the key in the color-palette for the moment.
|
|
19
|
-
export type Variant =
|
|
19
|
+
export type Variant = 'base' | 'selected' | 'healthy' | 'warning' | 'danger';
|
|
20
20
|
// metric chart
|
|
21
21
|
// url query
|
|
22
22
|
export const QUERY_LAST_SEVEN_DAYS = 'now-7d';
|
|
@@ -64,4 +64,20 @@ export const queryTimeSpansCodes: QueryTimeSpan[] = [
|
|
|
64
64
|
},
|
|
65
65
|
];
|
|
66
66
|
export const NAN_STRING = 'NAN';
|
|
67
|
-
|
|
67
|
+
|
|
68
|
+
export const STATUS_CRITICAL = 'critical';
|
|
69
|
+
export const STATUS_WARNING = 'warning';
|
|
70
|
+
export const STATUS_SUCCESS = 'success';
|
|
71
|
+
export const STATUS_HEALTHY = 'healthy';
|
|
72
|
+
export const STATUS_INFO = 'info';
|
|
73
|
+
export const STATUS_UNKNOWN = 'unknown';
|
|
74
|
+
export const STATUS_NONE = 'none';
|
|
75
|
+
|
|
76
|
+
export type Status =
|
|
77
|
+
| 'none'
|
|
78
|
+
| 'unknown'
|
|
79
|
+
| 'info'
|
|
80
|
+
| 'healthy'
|
|
81
|
+
| 'success'
|
|
82
|
+
| 'warning'
|
|
83
|
+
| 'critical';
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
Status,
|
|
6
|
+
STATUS_CRITICAL,
|
|
7
|
+
STATUS_HEALTHY,
|
|
8
|
+
STATUS_UNKNOWN,
|
|
9
|
+
STATUS_WARNING,
|
|
10
|
+
} from '../constants';
|
|
5
11
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
6
12
|
import {
|
|
7
13
|
faQuestionCircle,
|
|
@@ -33,16 +39,15 @@ const BadgeStyled = styled(FontAwesomeIcon)`
|
|
|
33
39
|
|
|
34
40
|
const getBadgeIcon = (status: Status) => {
|
|
35
41
|
switch (status) {
|
|
36
|
-
case
|
|
42
|
+
case STATUS_WARNING:
|
|
37
43
|
return faExclamationCircle;
|
|
38
44
|
|
|
39
|
-
case
|
|
45
|
+
case STATUS_CRITICAL:
|
|
40
46
|
return faTimesCircle;
|
|
41
47
|
|
|
42
|
-
case
|
|
48
|
+
case STATUS_UNKNOWN:
|
|
43
49
|
return faQuestionCircle;
|
|
44
50
|
|
|
45
|
-
case 'healthy':
|
|
46
51
|
default:
|
|
47
52
|
return null;
|
|
48
53
|
}
|
package/src/lib/index.ts
CHANGED
|
@@ -4,7 +4,17 @@ export { Button } from './components/button/Button.component';
|
|
|
4
4
|
export { Checkbox } from './components/checkbox/Checkbox.component';
|
|
5
5
|
export { Chips } from './components/chips/Chips.component';
|
|
6
6
|
export { Dropdown } from './components/dropdown/Dropdown.component';
|
|
7
|
-
export {
|
|
7
|
+
export {
|
|
8
|
+
LOADER_SIZE,
|
|
9
|
+
STATUS_CRITICAL,
|
|
10
|
+
STATUS_WARNING,
|
|
11
|
+
STATUS_SUCCESS,
|
|
12
|
+
STATUS_HEALTHY,
|
|
13
|
+
STATUS_INFO,
|
|
14
|
+
STATUS_UNKNOWN,
|
|
15
|
+
STATUS_NONE,
|
|
16
|
+
Status,
|
|
17
|
+
} from './components/constants';
|
|
8
18
|
export { Layout } from './components/layout/Layout.component';
|
|
9
19
|
export { Loader } from './components/loader/Loader.component';
|
|
10
20
|
export { Modal } from './components/modal/Modal.component';
|