@molecule/app-status-summary-solid 1.1.0 → 1.1.2
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/README.md +6 -6
- package/dist/StatusSummary.d.ts.map +1 -1
- package/dist/StatusSummary.jsx +40 -33
- package/dist/StatusSummary.jsx.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-11-
|
|
6
|
+
Generated: 2026-11-28T22:55:36.528Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-status-summary-solid
|
|
@@ -148,8 +148,8 @@ function StatusSummary(props: StatusSummaryProps): JSX.Element
|
|
|
148
148
|
|
|
149
149
|
Peer dependencies:
|
|
150
150
|
|
|
151
|
-
- `@molecule/app-solid` ^3.5.0
|
|
152
|
-
- `@molecule/app-ui` ^1.0
|
|
151
|
+
- `@molecule/app-solid` ^3.5.0 || ^4.0.0
|
|
152
|
+
- `@molecule/app-ui` ^1.4.0
|
|
153
153
|
- `@molecule/app-ui-solid` ^1.1.0
|
|
154
154
|
- `solid-js` ^1.8.0
|
|
155
155
|
|
|
@@ -169,9 +169,9 @@ Peer dependencies:
|
|
|
169
169
|
(green/yellow/orange/red/blue with white text) — they ignore the
|
|
170
170
|
app theme and cannot be restyled via ClassMap; acceptable for
|
|
171
171
|
status pages, but know they will not follow a rebrand.
|
|
172
|
-
- Status labels use `status.operational` … `status.maintenance` i18n
|
|
173
|
-
keys
|
|
174
|
-
|
|
172
|
+
- Status labels use the `status.operational` … `status.maintenance` i18n
|
|
173
|
+
keys, which the `common` locale bond ships in every language; the
|
|
174
|
+
English fallbacks in code match its en.ts.
|
|
175
175
|
- `header` renders inside the overall banner (last-updated stamp,
|
|
176
176
|
subscribe button); `footer` renders below the grid (incident list).
|
|
177
177
|
Group and component names may be JSX elements.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusSummary.d.ts","sourceRoot":"","sources":["../src/StatusSummary.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAO,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"StatusSummary.d.ts","sourceRoot":"","sources":["../src/StatusSummary.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAO,MAAM,UAAU,CAAA;AAM9C,OAAO,KAAK,EAAmB,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAqCrE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,CAAC,kBAAkB,CA2FvD,CAAA"}
|
package/dist/StatusSummary.jsx
CHANGED
|
@@ -10,21 +10,17 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { useTranslation } from '@molecule/app-solid';
|
|
12
12
|
import { getClassMap } from '@molecule/app-ui';
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
degraded: '#eab308',
|
|
25
|
-
'partial-outage': '#f97316',
|
|
26
|
-
'major-outage': '#ef4444',
|
|
27
|
-
maintenance: '#60a5fa',
|
|
13
|
+
/**
|
|
14
|
+
* The semantic tone colouring each status: the theme's success green for
|
|
15
|
+
* operational, its warning amber for degraded and partial outage, its error
|
|
16
|
+
* red for a major outage and its info blue for maintenance.
|
|
17
|
+
*/
|
|
18
|
+
const STATUS_TONE = {
|
|
19
|
+
operational: 'success',
|
|
20
|
+
degraded: 'warning',
|
|
21
|
+
'partial-outage': 'warning',
|
|
22
|
+
'major-outage': 'error',
|
|
23
|
+
maintenance: 'info',
|
|
28
24
|
};
|
|
29
25
|
/** The statuses from most to least severe (React's `worst` order). */
|
|
30
26
|
const SEVERITY_ORDER = [
|
|
@@ -62,26 +58,39 @@ function worst(statuses) {
|
|
|
62
58
|
export const StatusSummary = (props) => {
|
|
63
59
|
const cm = getClassMap();
|
|
64
60
|
const { t } = useTranslation();
|
|
61
|
+
/**
|
|
62
|
+
* The label for one status, through its literal i18n key with the English
|
|
63
|
+
* fallback (the same text the `common` locale bond's en.ts ships).
|
|
64
|
+
*
|
|
65
|
+
* @param status - The status to label.
|
|
66
|
+
* @returns The translated label.
|
|
67
|
+
*/
|
|
68
|
+
const statusLabel = (status) => {
|
|
69
|
+
switch (status) {
|
|
70
|
+
case 'operational':
|
|
71
|
+
return t('status.operational', {}, { defaultValue: 'Operational' });
|
|
72
|
+
case 'degraded':
|
|
73
|
+
return t('status.degraded', {}, { defaultValue: 'Degraded performance' });
|
|
74
|
+
case 'partial-outage':
|
|
75
|
+
return t('status.partial-outage', {}, { defaultValue: 'Partial outage' });
|
|
76
|
+
case 'major-outage':
|
|
77
|
+
return t('status.major-outage', {}, { defaultValue: 'Major outage' });
|
|
78
|
+
case 'maintenance':
|
|
79
|
+
return t('status.maintenance', {}, { defaultValue: 'Under maintenance' });
|
|
80
|
+
}
|
|
81
|
+
};
|
|
65
82
|
/** Every component status in the summary, in render order. */
|
|
66
83
|
const allStatuses = () => props.groups.flatMap((group) => group.components.map((component) => component.status));
|
|
67
84
|
/** The banner's status: React's `overallStatus ?? worst(allStatuses)`. */
|
|
68
85
|
const overall = () => props.overallStatus ?? worst(allStatuses());
|
|
69
|
-
/** The banner's
|
|
70
|
-
const bannerStyle =
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
'border-radius': '8px',
|
|
74
|
-
});
|
|
75
|
-
/** One badge's inline style, in React's declaration order. */
|
|
76
|
-
const badgeStyle = (status) => ({
|
|
77
|
-
'border-radius': '4px',
|
|
78
|
-
background: STATUS_COLOR[status],
|
|
79
|
-
color: '#fff',
|
|
80
|
-
});
|
|
86
|
+
/** The banner's rounded corners, in React's declaration order. */
|
|
87
|
+
const bannerStyle = { 'border-radius': '8px' };
|
|
88
|
+
/** One badge's rounded corners, in React's declaration order. */
|
|
89
|
+
const badgeStyle = { 'border-radius': '4px' };
|
|
81
90
|
return (<div class={cm.cn(cm.stack(4), props.className)}>
|
|
82
|
-
<div class={cm.cn(cm.flex({ align: 'center', justify: 'between', gap: 'md' }), cm.sp('p', 3))} style={bannerStyle
|
|
91
|
+
<div class={cm.cn(cm.flex({ align: 'center', justify: 'between', gap: 'md' }), cm.sp('p', 3), cm.bgTone(STATUS_TONE[overall()]), cm.textOnTone)} style={bannerStyle}>
|
|
83
92
|
<span class={cm.cn(cm.textSize('lg'), cm.fontWeight('bold'))}>
|
|
84
|
-
{
|
|
93
|
+
{statusLabel(overall())}
|
|
85
94
|
</span>
|
|
86
95
|
{props.header}
|
|
87
96
|
</div>
|
|
@@ -97,10 +106,8 @@ export const StatusSummary = (props) => {
|
|
|
97
106
|
{component.subtitle}
|
|
98
107
|
</span>) : undefined}
|
|
99
108
|
</div>
|
|
100
|
-
<span class={cm.cn(cm.sp('px', 2), cm.textSize('xs'), cm.fontWeight('semibold'))} style={badgeStyle
|
|
101
|
-
{
|
|
102
|
-
defaultValue: STATUS_LABEL[component.status],
|
|
103
|
-
})}
|
|
109
|
+
<span class={cm.cn(cm.sp('px', 2), cm.textSize('xs'), cm.fontWeight('semibold'), cm.bgTone(STATUS_TONE[component.status]), cm.textOnTone)} style={badgeStyle}>
|
|
110
|
+
{statusLabel(component.status)}
|
|
104
111
|
</span>
|
|
105
112
|
</li>))}
|
|
106
113
|
</ul>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusSummary.jsx","sourceRoot":"","sources":["../src/StatusSummary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A"}
|
package/dist/index.d.ts
CHANGED
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
* (green/yellow/orange/red/blue with white text) — they ignore the
|
|
43
43
|
* app theme and cannot be restyled via ClassMap; acceptable for
|
|
44
44
|
* status pages, but know they will not follow a rebrand.
|
|
45
|
-
* - Status labels use `status.operational` … `status.maintenance` i18n
|
|
46
|
-
* keys
|
|
47
|
-
*
|
|
45
|
+
* - Status labels use the `status.operational` … `status.maintenance` i18n
|
|
46
|
+
* keys, which the `common` locale bond ships in every language; the
|
|
47
|
+
* English fallbacks in code match its en.ts.
|
|
48
48
|
* - `header` renders inside the overall banner (last-updated stamp,
|
|
49
49
|
* subscribe button); `footer` renders below the grid (incident list).
|
|
50
50
|
* Group and component names may be JSX elements.
|
package/dist/index.js
CHANGED
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
* (green/yellow/orange/red/blue with white text) — they ignore the
|
|
43
43
|
* app theme and cannot be restyled via ClassMap; acceptable for
|
|
44
44
|
* status pages, but know they will not follow a rebrand.
|
|
45
|
-
* - Status labels use `status.operational` … `status.maintenance` i18n
|
|
46
|
-
* keys
|
|
47
|
-
*
|
|
45
|
+
* - Status labels use the `status.operational` … `status.maintenance` i18n
|
|
46
|
+
* keys, which the `common` locale bond ships in every language; the
|
|
47
|
+
* English fallbacks in code match its en.ts.
|
|
48
48
|
* - `header` renders inside the overall banner (last-updated stamp,
|
|
49
49
|
* subscribe button); `footer` renders below the grid (incident list).
|
|
50
50
|
* Group and component names may be JSX elements.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-status-summary-solid",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Status-page summary: component grid with operational/degraded/outage badges + incident list",
|
|
5
5
|
"homepage": "https://www.molecule.dev/packages/app-status-summary-solid",
|
|
6
6
|
"type": "module",
|
|
@@ -42,20 +42,20 @@
|
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@molecule/app-solid": "^3.5.0",
|
|
46
|
-
"@molecule/app-ui": "^1.0
|
|
45
|
+
"@molecule/app-solid": "^3.5.0 || ^4.0.0",
|
|
46
|
+
"@molecule/app-ui": "^1.4.0",
|
|
47
47
|
"@molecule/app-ui-solid": "^1.1.0",
|
|
48
48
|
"solid-js": "^1.8.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@molecule/app-framework-conformance": "0.0.0",
|
|
52
|
-
"@molecule/app-i18n": "1.
|
|
52
|
+
"@molecule/app-i18n": "1.4.0",
|
|
53
53
|
"@molecule/app-icons": "1.0.4",
|
|
54
|
-
"@molecule/app-solid": "
|
|
55
|
-
"@molecule/app-ui": "1.
|
|
56
|
-
"@molecule/app-ui-solid": "1.
|
|
54
|
+
"@molecule/app-solid": "4.0.0",
|
|
55
|
+
"@molecule/app-ui": "1.17.0",
|
|
56
|
+
"@molecule/app-ui-solid": "1.12.2",
|
|
57
57
|
"@types/node": "26.6.5",
|
|
58
|
-
"jsdom": "
|
|
58
|
+
"jsdom": "31.0.1",
|
|
59
59
|
"solid-js": "1.9.17",
|
|
60
60
|
"typescript": "6.0.3",
|
|
61
61
|
"vite-plugin-solid": "2.11.15",
|