@molecule/app-status-summary-vue 0.0.1-stage → 1.1.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/README.md +5 -5
- package/dist/StatusSummary.d.ts.map +1 -1
- package/dist/StatusSummary.js +38 -29
- package/dist/StatusSummary.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/package.json +6 -6
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-21T12:47:28.096Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-status-summary-vue
|
|
@@ -200,7 +200,7 @@ const StatusSummary: DefineComponent<
|
|
|
200
200
|
|
|
201
201
|
Peer dependencies:
|
|
202
202
|
|
|
203
|
-
- `@molecule/app-ui` ^1.0
|
|
203
|
+
- `@molecule/app-ui` ^1.4.0
|
|
204
204
|
- `@molecule/app-ui-vue` ^1.1.0
|
|
205
205
|
- `@molecule/app-vue` ^3.5.0
|
|
206
206
|
- `vue` ^3.4.0
|
|
@@ -221,8 +221,8 @@ Peer dependencies:
|
|
|
221
221
|
(green/yellow/orange/red/blue with white text) — they ignore the
|
|
222
222
|
app theme and cannot be restyled via ClassMap; acceptable for
|
|
223
223
|
status pages, but know they will not follow a rebrand.
|
|
224
|
-
- Status labels use `status.operational` … `status.maintenance` i18n
|
|
225
|
-
keys
|
|
226
|
-
|
|
224
|
+
- Status labels use the `status.operational` … `status.maintenance` i18n
|
|
225
|
+
keys, which the `common` locale bond ships in every language; the
|
|
226
|
+
English fallbacks in code match its en.ts.
|
|
227
227
|
- Node-valued props (`header`, `footer`) arrive as a prop AND a
|
|
228
228
|
same-named slot; group and component names may be nodes too.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusSummary.d.ts","sourceRoot":"","sources":["../src/StatusSummary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAsB,KAAK,QAAQ,EAAE,KAAK,KAAK,EAAmB,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"StatusSummary.d.ts","sourceRoot":"","sources":["../src/StatusSummary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAsB,KAAK,QAAQ,EAAE,KAAK,KAAK,EAAmB,MAAM,KAAK,CAAA;AAMpF,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAmD9D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa;;cAGG,QAAQ,CAAC,WAAW,EAAE,CAAC;;;;cACf,QAAQ,CAAC,eAAe,CAAC;;;;;;;;;UA+B/C,KAAK;;cAhCS,QAAQ,CAAC,WAAW,EAAE,CAAC;;;;cACf,QAAQ,CAAC,eAAe,CAAC;;;;;;;;;;;;4EA+G5D,CAAA"}
|
package/dist/StatusSummary.js
CHANGED
|
@@ -11,21 +11,17 @@
|
|
|
11
11
|
import { defineComponent, h } from 'vue';
|
|
12
12
|
import { getClassMap } from '@molecule/app-ui';
|
|
13
13
|
import { useTranslation } from '@molecule/app-vue';
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
degraded: '#eab308',
|
|
26
|
-
'partial-outage': '#f97316',
|
|
27
|
-
'major-outage': '#ef4444',
|
|
28
|
-
maintenance: '#60a5fa',
|
|
14
|
+
/**
|
|
15
|
+
* The semantic tone colouring each status: the theme's success green for
|
|
16
|
+
* operational, its warning amber for degraded and partial outage, its error
|
|
17
|
+
* red for a major outage and its info blue for maintenance.
|
|
18
|
+
*/
|
|
19
|
+
const STATUS_TONE = {
|
|
20
|
+
operational: 'success',
|
|
21
|
+
degraded: 'warning',
|
|
22
|
+
'partial-outage': 'warning',
|
|
23
|
+
'major-outage': 'error',
|
|
24
|
+
maintenance: 'info',
|
|
29
25
|
};
|
|
30
26
|
/** The statuses from most to least severe (React's `worst` order). */
|
|
31
27
|
const SEVERITY_ORDER = [
|
|
@@ -88,16 +84,37 @@ export const StatusSummary = defineComponent({
|
|
|
88
84
|
setup(props, { slots }) {
|
|
89
85
|
const cm = getClassMap();
|
|
90
86
|
const { t } = useTranslation();
|
|
87
|
+
/**
|
|
88
|
+
* The label for one status, through its literal i18n key with the English
|
|
89
|
+
* fallback (the same text the `common` locale bond's en.ts ships).
|
|
90
|
+
*
|
|
91
|
+
* @param status - The status to label.
|
|
92
|
+
* @returns The translated label.
|
|
93
|
+
*/
|
|
94
|
+
const statusLabel = (status) => {
|
|
95
|
+
switch (status) {
|
|
96
|
+
case 'operational':
|
|
97
|
+
return t('status.operational', {}, { defaultValue: 'Operational' });
|
|
98
|
+
case 'degraded':
|
|
99
|
+
return t('status.degraded', {}, { defaultValue: 'Degraded performance' });
|
|
100
|
+
case 'partial-outage':
|
|
101
|
+
return t('status.partial-outage', {}, { defaultValue: 'Partial outage' });
|
|
102
|
+
case 'major-outage':
|
|
103
|
+
return t('status.major-outage', {}, { defaultValue: 'Major outage' });
|
|
104
|
+
case 'maintenance':
|
|
105
|
+
return t('status.maintenance', {}, { defaultValue: 'Under maintenance' });
|
|
106
|
+
}
|
|
107
|
+
};
|
|
91
108
|
return () => {
|
|
92
109
|
const allStatuses = props.groups.flatMap((group) => group.components.map((component) => component.status));
|
|
93
110
|
const overall = props.overallStatus ?? worst(allStatuses);
|
|
94
111
|
return h('div', { class: cm.cn(cm.stack(4), props.className) }, [
|
|
95
112
|
h('div', {
|
|
96
|
-
class: cm.cn(cm.flex({ align: 'center', justify: 'between', gap: 'md' }), cm.sp('p', 3)),
|
|
97
|
-
style: {
|
|
113
|
+
class: cm.cn(cm.flex({ align: 'center', justify: 'between', gap: 'md' }), cm.sp('p', 3), cm.bgTone(STATUS_TONE[overall]), cm.textOnTone),
|
|
114
|
+
style: { borderRadius: '8px' },
|
|
98
115
|
}, [
|
|
99
116
|
h('span', { class: cm.cn(cm.textSize('lg'), cm.fontWeight('bold')) }, [
|
|
100
|
-
|
|
117
|
+
statusLabel(overall),
|
|
101
118
|
]),
|
|
102
119
|
...nodeValue(props.header, slots.header),
|
|
103
120
|
]),
|
|
@@ -114,17 +131,9 @@ export const StatusSummary = defineComponent({
|
|
|
114
131
|
: null,
|
|
115
132
|
]),
|
|
116
133
|
h('span', {
|
|
117
|
-
class: cm.cn(cm.sp('px', 2), cm.textSize('xs'), cm.fontWeight('semibold')),
|
|
118
|
-
style: {
|
|
119
|
-
|
|
120
|
-
background: STATUS_COLOR[component.status],
|
|
121
|
-
color: '#fff',
|
|
122
|
-
},
|
|
123
|
-
}, [
|
|
124
|
-
t(`status.${component.status}`, {}, {
|
|
125
|
-
defaultValue: STATUS_LABEL[component.status],
|
|
126
|
-
}),
|
|
127
|
-
]),
|
|
134
|
+
class: cm.cn(cm.sp('px', 2), cm.textSize('xs'), cm.fontWeight('semibold'), cm.bgTone(STATUS_TONE[component.status]), cm.textOnTone),
|
|
135
|
+
style: { borderRadius: '4px' },
|
|
136
|
+
}, [statusLabel(component.status)]),
|
|
128
137
|
]))),
|
|
129
138
|
])),
|
|
130
139
|
...nodeValue(props.footer, slots.footer),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusSummary.js","sourceRoot":"","sources":["../src/StatusSummary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC,EAA8C,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"StatusSummary.js","sourceRoot":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EACjB,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EACzB,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EACxC,EAAE,CAAC,UAAU,CACd;4BACD,KAAK,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE;yBAC/B,EACD,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAChC;qBACF,CACF,CACF,CACF;iBACF,CAAC,CACH;gBACD,GAAG,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;aACzC,CAAC,CAAA;QACJ,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
* (green/yellow/orange/red/blue with white text) — they ignore the
|
|
48
48
|
* app theme and cannot be restyled via ClassMap; acceptable for
|
|
49
49
|
* status pages, but know they will not follow a rebrand.
|
|
50
|
-
* - Status labels use `status.operational` … `status.maintenance` i18n
|
|
51
|
-
* keys
|
|
52
|
-
*
|
|
50
|
+
* - Status labels use the `status.operational` … `status.maintenance` i18n
|
|
51
|
+
* keys, which the `common` locale bond ships in every language; the
|
|
52
|
+
* English fallbacks in code match its en.ts.
|
|
53
53
|
* - Node-valued props (`header`, `footer`) arrive as a prop AND a
|
|
54
54
|
* same-named slot; group and component names may be nodes too.
|
|
55
55
|
*
|
package/dist/index.js
CHANGED
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
* (green/yellow/orange/red/blue with white text) — they ignore the
|
|
48
48
|
* app theme and cannot be restyled via ClassMap; acceptable for
|
|
49
49
|
* status pages, but know they will not follow a rebrand.
|
|
50
|
-
* - Status labels use `status.operational` … `status.maintenance` i18n
|
|
51
|
-
* keys
|
|
52
|
-
*
|
|
50
|
+
* - Status labels use the `status.operational` … `status.maintenance` i18n
|
|
51
|
+
* keys, which the `common` locale bond ships in every language; the
|
|
52
|
+
* English fallbacks in code match its en.ts.
|
|
53
53
|
* - Node-valued props (`header`, `footer`) arrive as a prop AND a
|
|
54
54
|
* same-named slot; group and component names may be nodes too.
|
|
55
55
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-status-summary-vue",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.1",
|
|
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-vue",
|
|
6
6
|
"type": "module",
|
|
@@ -42,18 +42,18 @@
|
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@molecule/app-ui": "^1.0
|
|
45
|
+
"@molecule/app-ui": "^1.4.0",
|
|
46
46
|
"@molecule/app-ui-vue": "^1.1.0",
|
|
47
47
|
"@molecule/app-vue": "^3.5.0",
|
|
48
48
|
"vue": "^3.4.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@molecule/app-framework-conformance": "0.0.0",
|
|
52
|
-
"@molecule/app-i18n": "1.2.
|
|
52
|
+
"@molecule/app-i18n": "1.2.2",
|
|
53
53
|
"@molecule/app-icons": "1.0.4",
|
|
54
|
-
"@molecule/app-ui": "1.
|
|
55
|
-
"@molecule/app-ui-vue": "1.1
|
|
56
|
-
"@molecule/app-vue": "3.
|
|
54
|
+
"@molecule/app-ui": "1.5.0",
|
|
55
|
+
"@molecule/app-ui-vue": "1.2.1",
|
|
56
|
+
"@molecule/app-vue": "3.9.0",
|
|
57
57
|
"@types/node": "26.6.5",
|
|
58
58
|
"jsdom": "30.1.3",
|
|
59
59
|
"typescript": "6.0.3",
|