@meddleware/ui 0.1.6 → 0.1.8
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/base.css +1 -1
- package/dist/components/AppSidebar.vue.d.ts +4 -2
- package/dist/components/CopyableAddress.vue.d.ts +13 -0
- package/dist/index.d.ts +1 -0
- package/dist/ui.js +102 -69
- package/package.json +2 -2
package/dist/base.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.mw-header[data-v-ad7cd1c5]{height:var(--mw-header-height,56px);background:var(--_bg);color:var(--_text);border-bottom:1px solid var(--_border);font-family:var(--mw-font-sans);align-items:center;gap:1rem;padding:0 1rem;display:flex}.mw-header--sticky[data-v-ad7cd1c5]{z-index:50;position:sticky;top:0}.mw-header__brand[data-v-ad7cd1c5]{letter-spacing:.01em;white-space:nowrap;align-items:center;gap:.5rem;font-weight:650;display:flex}.mw-header__center[data-v-ad7cd1c5]{flex:auto;min-width:0}.mw-header__actions[data-v-ad7cd1c5]{align-items:center;gap:.5rem;margin-left:auto;display:flex}.mw-sidebar[data-v-
|
|
1
|
+
.mw-header[data-v-ad7cd1c5]{height:var(--mw-header-height,56px);background:var(--_bg);color:var(--_text);border-bottom:1px solid var(--_border);font-family:var(--mw-font-sans);align-items:center;gap:1rem;padding:0 1rem;display:flex}.mw-header--sticky[data-v-ad7cd1c5]{z-index:50;position:sticky;top:0}.mw-header__brand[data-v-ad7cd1c5]{letter-spacing:.01em;white-space:nowrap;align-items:center;gap:.5rem;font-weight:650;display:flex}.mw-header__center[data-v-ad7cd1c5]{flex:auto;min-width:0}.mw-header__actions[data-v-ad7cd1c5]{align-items:center;gap:.5rem;margin-left:auto;display:flex}.mw-sidebar[data-v-0e0c098e]{width:var(--mw-sidebar-width,240px);background:var(--_bg);color:var(--_text);border-right:1px solid var(--_border);font-family:var(--mw-font-sans);flex-direction:column;display:flex}.mw-sidebar__head[data-v-0e0c098e]{border-bottom:1px solid var(--_border);padding:1rem}.mw-sidebar__nav[data-v-0e0c098e]{flex-direction:column;flex:auto;gap:.25rem;padding:.75rem;display:flex;overflow-y:auto}.mw-sidebar__body[data-v-0e0c098e]{flex-shrink:0}.mw-sidebar__foot[data-v-0e0c098e]{border-top:1px solid var(--_border);color:var(--_muted);padding:.75rem 1rem;font-size:.85rem}.mw-footer[data-v-c646b8e1]{background:var(--_bg);color:var(--_muted);border-top:1px solid var(--_border);font-family:var(--mw-font-sans);flex-wrap:wrap;align-items:center;gap:1rem;padding:.75rem 1rem;font-size:.85rem;display:flex}.mw-footer--transparent[data-v-c646b8e1]{border-top:1px solid var(--border)}.mw-footer__center[data-v-c646b8e1]{flex:auto;min-width:0}.mw-footer__end[data-v-c646b8e1]{margin-left:auto}.mw-mode[data-v-e4a6bf1d]{border:1px solid var(--_border,var(--border));border-radius:var(--mw-radius,10px);background:color-mix(in srgb, var(--_text,var(--text)) 6%, transparent);gap:2px;padding:2px;display:inline-flex}.mw-mode__btn[data-v-e4a6bf1d]{border-radius:calc(var(--mw-radius,10px) - 3px);color:var(--_text,var(--text));font:inherit;cursor:pointer;opacity:.7;background:0 0;border:0;align-items:center;gap:.35rem;padding:.25rem .5rem;font-size:.8rem;display:inline-flex}.mw-mode__btn[data-v-e4a6bf1d]:hover{opacity:1}.mw-mode__btn.is-active[data-v-e4a6bf1d]{opacity:1;background:color-mix(in srgb, var(--_text,var(--text)) 14%, transparent)}.mw-mode__btn[data-v-e4a6bf1d]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}@media (width<=640px){.mw-mode__label[data-v-e4a6bf1d]{display:none}}.mw-btn[data-v-299de2c3]{border-radius:var(--mw-radius,10px);font:inherit;cursor:pointer;border:1px solid #0000;justify-content:center;align-items:center;gap:.4rem;padding:.5rem .9rem;font-weight:550;transition:filter .12s,background .12s;display:inline-flex}.mw-btn[data-v-299de2c3]:disabled{opacity:.55;cursor:not-allowed}.mw-btn[data-v-299de2c3]:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.mw-btn--primary[data-v-299de2c3]{background:var(--accent);color:var(--accent-contrast)}.mw-btn--primary[data-v-299de2c3]:not(:disabled):hover{filter:brightness(1.08)}.mw-btn--secondary[data-v-299de2c3]{background:var(--secondary);color:var(--secondary-contrast)}.mw-btn--secondary[data-v-299de2c3]:not(:disabled):hover{filter:brightness(1.08)}.mw-btn--ghost[data-v-299de2c3]{color:var(--text);border-color:var(--border);background:0 0}.mw-btn--ghost[data-v-299de2c3]:not(:disabled):hover{background:var(--lift)}.mw-btn--danger[data-v-299de2c3]{background:var(--danger);color:var(--mw-neutral-000)}.mw-btn--danger[data-v-299de2c3]:not(:disabled):hover{filter:brightness(1.08)}.mw-card[data-v-fd2fd7ab]{background:var(--surface);border:1px solid var(--border);border-radius:var(--mw-radius,10px);color:var(--text);overflow:hidden}.mw-card__header[data-v-fd2fd7ab]{border-bottom:1px solid var(--border);padding:.85rem 1rem}.mw-card__title[data-v-fd2fd7ab]{margin:0;font-size:1rem;font-weight:600}.mw-card__body[data-v-fd2fd7ab]{padding:1rem}.mw-card__footer[data-v-fd2fd7ab]{border-top:1px solid var(--border);background:var(--lift);padding:.75rem 1rem}.mw-select[data-v-b9468387]{position:relative}.mw-select select[data-v-b9468387]{appearance:none;background:var(--surface);width:100%;color:var(--text);border:1px solid var(--border);border-radius:var(--mw-radius,10px);font:inherit;padding:.5rem 2.5rem .5rem .7rem}.mw-select select[data-v-b9468387]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.mw-select__chevron[data-v-b9468387]{pointer-events:none;stroke:var(--muted);stroke-width:1.5px;fill:none;position:absolute;top:50%;right:.75rem;transform:translateY(-50%)}.mw-notice[data-v-6f53d0be]{border:1px solid var(--border);border-radius:var(--mw-radius,10px);background:var(--lift);color:var(--text);border-left-width:3px;margin:0;padding:.6rem .8rem;font-size:.9rem}.mw-notice--error[data-v-6f53d0be]{border-left-color:var(--danger);color:var(--danger);background:color-mix(in srgb, var(--danger) 8%, transparent)}.mw-notice--ok[data-v-6f53d0be]{border-left-color:var(--ok);color:var(--ok);background:color-mix(in srgb, var(--ok) 8%, transparent)}.sidebar-item[data-v-e15afdf7]{border-radius:var(--mw-radius,10px);width:100%;color:inherit;font:inherit;text-align:left;cursor:pointer;opacity:.85;background:0 0;border:0;align-items:center;gap:.6rem;padding:.55rem .7rem;display:flex}.sidebar-item[data-v-e15afdf7]:hover:not(:disabled){background:color-mix(in srgb, currentColor 10%, transparent);opacity:1}.sidebar-item.is-active[data-v-e15afdf7]{background:color-mix(in srgb, var(--accent) 26%, transparent);opacity:1}.sidebar-item[data-v-e15afdf7]:disabled{cursor:default}.sidebar-item[data-v-e15afdf7]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.sidebar-item__icon[data-v-e15afdf7]{text-align:center;width:1.1rem}.ca-root[data-v-e2d23de9]{font-family:monospace;font-size:inherit;color:var(--muted,#888);cursor:pointer;text-underline-offset:2px;background:0 0;border:none;padding:0;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;transition:color .15s;display:inline-block}.ca-root[data-v-e2d23de9]:hover{color:var(--text,#f0f0f0)}.ca-root--copied[data-v-e2d23de9]{color:var(--accent,#6366f1);text-decoration:none}.status-widget[data-v-20197983]{color:inherit;opacity:.85;align-items:center;gap:.4rem;font-size:.8rem;text-decoration:none;display:inline-flex}.status-widget[data-v-20197983]:hover{opacity:1}.status-widget__dot[data-v-20197983]{border-radius:50%;flex-shrink:0;width:.55rem;height:.55rem}.status-widget--ok .status-widget__dot[data-v-20197983]{background:var(--mw-ok-500)}.status-widget--degraded .status-widget__dot[data-v-20197983]{background:var(--mw-gold-500)}.status-widget--error .status-widget__dot[data-v-20197983]{background:var(--mw-danger-500)}
|
|
2
2
|
/*$vite$:1*/
|
|
@@ -7,13 +7,15 @@ type __VLS_Props = {
|
|
|
7
7
|
/** Sidebar width (CSS length, e.g. '280px'). Defaults to `--mw-sidebar-width` (240px). */
|
|
8
8
|
width?: string;
|
|
9
9
|
};
|
|
10
|
-
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
|
|
10
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_7: {};
|
|
11
11
|
type __VLS_Slots = {} & {
|
|
12
12
|
head?: (props: typeof __VLS_1) => any;
|
|
13
13
|
} & {
|
|
14
14
|
default?: (props: typeof __VLS_3) => any;
|
|
15
15
|
} & {
|
|
16
|
-
|
|
16
|
+
body?: (props: typeof __VLS_5) => any;
|
|
17
|
+
} & {
|
|
18
|
+
foot?: (props: typeof __VLS_7) => any;
|
|
17
19
|
};
|
|
18
20
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
19
21
|
variant: PanelVariant;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
address: string;
|
|
3
|
+
/** Show prefix…suffix truncation (default true). Full address shown in title attribute always. */
|
|
4
|
+
truncate?: boolean;
|
|
5
|
+
/** [prefixChars, suffixChars] — only used when truncate is true. */
|
|
6
|
+
chars?: [number, number];
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
9
|
+
truncate: boolean;
|
|
10
|
+
chars: [number, number];
|
|
11
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { default as UiCard } from './components/UiCard.vue';
|
|
|
7
7
|
export { default as UiSelect } from './components/UiSelect.vue';
|
|
8
8
|
export { default as UiNotice } from './components/UiNotice.vue';
|
|
9
9
|
export { default as SidebarItem } from './components/SidebarItem.vue';
|
|
10
|
+
export { default as CopyableAddress } from './components/CopyableAddress.vue';
|
|
10
11
|
export { default as StatusWidget } from './components/StatusWidget.vue';
|
|
11
12
|
export { useColorMode } from './composables/useColorMode.js';
|
|
12
13
|
export type { ColorMode } from './composables/useColorMode.js';
|
package/dist/ui.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, mergeProps as o, normalizeClass as s, normalizeStyle as c, onMounted as l, onUnmounted as
|
|
1
|
+
import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, mergeProps as o, normalizeClass as s, normalizeStyle as c, onMounted as l, onUnmounted as u, openBlock as d, ref as f, renderList as p, renderSlot as m, toDisplayString as h, useModel as ee, vModelSelect as te, watch as ne, withDirectives as g } from "vue";
|
|
2
2
|
//#region src/internal/panel.ts
|
|
3
|
-
function
|
|
3
|
+
function _(e, t) {
|
|
4
4
|
let n;
|
|
5
5
|
return n = e === "transparent" ? {
|
|
6
6
|
"--_bg": "transparent",
|
|
@@ -24,7 +24,7 @@ function h(e, t) {
|
|
|
24
24
|
}
|
|
25
25
|
//#endregion
|
|
26
26
|
//#region src/components/AppHeader.vue?vue&type=script&setup=true&lang.ts
|
|
27
|
-
var
|
|
27
|
+
var re = { class: "mw-header__brand" }, ie = { class: "mw-header__center" }, ae = { class: "mw-header__actions" }, oe = /*@__PURE__*/ a({
|
|
28
28
|
__name: "AppHeader",
|
|
29
29
|
props: {
|
|
30
30
|
variant: { default: "dark" },
|
|
@@ -35,30 +35,33 @@ var ae = { class: "mw-header__brand" }, oe = { class: "mw-header__center" }, se
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
setup(e) {
|
|
38
|
-
let n = e, a = t(() =>
|
|
39
|
-
return (t, n) => (
|
|
38
|
+
let n = e, a = t(() => _(n.variant, n.colors));
|
|
39
|
+
return (t, n) => (d(), r("header", {
|
|
40
40
|
class: s(["mw-header", [`mw-header--${e.variant}`, { "mw-header--sticky": e.sticky }]]),
|
|
41
41
|
style: c(a.value)
|
|
42
42
|
}, [
|
|
43
|
-
i("div",
|
|
44
|
-
i("div",
|
|
45
|
-
i("div",
|
|
43
|
+
i("div", re, [m(t.$slots, "brand", {}, void 0, !0)]),
|
|
44
|
+
i("div", ie, [m(t.$slots, "default", {}, void 0, !0)]),
|
|
45
|
+
i("div", ae, [m(t.$slots, "actions", {}, void 0, !0)])
|
|
46
46
|
], 6));
|
|
47
47
|
}
|
|
48
|
-
}),
|
|
48
|
+
}), v = (e, t) => {
|
|
49
49
|
let n = e.__vccOpts || e;
|
|
50
50
|
for (let [e, r] of t) n[e] = r;
|
|
51
51
|
return n;
|
|
52
|
-
},
|
|
52
|
+
}, y = /*#__PURE__*/ v(oe, [["__scopeId", "data-v-ad7cd1c5"]]), b = {
|
|
53
53
|
key: 0,
|
|
54
54
|
class: "mw-sidebar__head"
|
|
55
|
-
},
|
|
55
|
+
}, x = {
|
|
56
56
|
class: "mw-sidebar__nav",
|
|
57
57
|
"aria-label": "Primary"
|
|
58
|
-
},
|
|
58
|
+
}, S = {
|
|
59
59
|
key: 1,
|
|
60
|
+
class: "mw-sidebar__body"
|
|
61
|
+
}, C = {
|
|
62
|
+
key: 2,
|
|
60
63
|
class: "mw-sidebar__foot"
|
|
61
|
-
},
|
|
64
|
+
}, w = /*#__PURE__*/ v(/* @__PURE__ */ a({
|
|
62
65
|
__name: "AppSidebar",
|
|
63
66
|
props: {
|
|
64
67
|
variant: { default: "dark" },
|
|
@@ -67,44 +70,45 @@ var ae = { class: "mw-header__brand" }, oe = { class: "mw-header__center" }, se
|
|
|
67
70
|
},
|
|
68
71
|
setup(e) {
|
|
69
72
|
let a = e, o = t(() => {
|
|
70
|
-
let e =
|
|
73
|
+
let e = _(a.variant, a.colors);
|
|
71
74
|
return a.width && (e["--mw-sidebar-width"] = a.width), e;
|
|
72
75
|
});
|
|
73
|
-
return (t, a) => (
|
|
76
|
+
return (t, a) => (d(), r("aside", {
|
|
74
77
|
class: s(["mw-sidebar", `mw-sidebar--${e.variant}`]),
|
|
75
78
|
style: c(o.value)
|
|
76
79
|
}, [
|
|
77
|
-
t.$slots.head ? (
|
|
78
|
-
i("nav",
|
|
79
|
-
t.$slots.
|
|
80
|
+
t.$slots.head ? (d(), r("div", b, [m(t.$slots, "head", {}, void 0, !0)])) : n("", !0),
|
|
81
|
+
i("nav", x, [m(t.$slots, "default", {}, void 0, !0)]),
|
|
82
|
+
t.$slots.body ? (d(), r("div", S, [m(t.$slots, "body", {}, void 0, !0)])) : n("", !0),
|
|
83
|
+
t.$slots.foot ? (d(), r("div", C, [m(t.$slots, "foot", {}, void 0, !0)])) : n("", !0)
|
|
80
84
|
], 6));
|
|
81
85
|
}
|
|
82
|
-
}), [["__scopeId", "data-v-
|
|
86
|
+
}), [["__scopeId", "data-v-0e0c098e"]]), T = { class: "mw-footer__start" }, E = { class: "mw-footer__center" }, D = { class: "mw-footer__end" }, O = /*#__PURE__*/ v(/* @__PURE__ */ a({
|
|
83
87
|
__name: "AppFooter",
|
|
84
88
|
props: {
|
|
85
89
|
variant: { default: "transparent" },
|
|
86
90
|
colors: {}
|
|
87
91
|
},
|
|
88
92
|
setup(e) {
|
|
89
|
-
let n = e, a = t(() =>
|
|
90
|
-
return (t, n) => (
|
|
93
|
+
let n = e, a = t(() => _(n.variant, n.colors));
|
|
94
|
+
return (t, n) => (d(), r("footer", {
|
|
91
95
|
class: s(["mw-footer", `mw-footer--${e.variant}`]),
|
|
92
96
|
style: c(a.value)
|
|
93
97
|
}, [
|
|
94
|
-
i("div",
|
|
95
|
-
i("div",
|
|
96
|
-
i("div",
|
|
98
|
+
i("div", T, [m(t.$slots, "start", {}, void 0, !0)]),
|
|
99
|
+
i("div", E, [m(t.$slots, "default", {}, void 0, !0)]),
|
|
100
|
+
i("div", D, [m(t.$slots, "end", {}, void 0, !0)])
|
|
97
101
|
], 6));
|
|
98
102
|
}
|
|
99
|
-
}), [["__scopeId", "data-v-c646b8e1"]]),
|
|
103
|
+
}), [["__scopeId", "data-v-c646b8e1"]]), k = {
|
|
100
104
|
class: "mw-mode",
|
|
101
105
|
role: "group",
|
|
102
106
|
"aria-label": "Colour mode"
|
|
103
|
-
},
|
|
107
|
+
}, A = [
|
|
104
108
|
"aria-pressed",
|
|
105
109
|
"title",
|
|
106
110
|
"onClick"
|
|
107
|
-
],
|
|
111
|
+
], j = { "aria-hidden": "true" }, M = { class: "mw-mode__label" }, N = /*#__PURE__*/ v(/* @__PURE__ */ a({
|
|
108
112
|
__name: "ColorModeControl",
|
|
109
113
|
props: {
|
|
110
114
|
modelValue: {},
|
|
@@ -125,16 +129,16 @@ var ae = { class: "mw-header__brand" }, oe = { class: "mw-header__center" }, se
|
|
|
125
129
|
dark: "☾",
|
|
126
130
|
system: "◐"
|
|
127
131
|
};
|
|
128
|
-
return (o, c) => (
|
|
132
|
+
return (o, c) => (d(), r("div", k, [(d(!0), r(e, null, p(t.modes, (e) => (d(), r("button", {
|
|
129
133
|
key: e,
|
|
130
134
|
type: "button",
|
|
131
135
|
class: s(["mw-mode__btn", { "is-active": t.modelValue === e }]),
|
|
132
136
|
"aria-pressed": t.modelValue === e,
|
|
133
137
|
title: n[e],
|
|
134
138
|
onClick: (t) => o.$emit("update:modelValue", e)
|
|
135
|
-
}, [i("span",
|
|
139
|
+
}, [i("span", j, h(a[e]), 1), i("span", M, h(n[e]), 1)], 10, A))), 128))]));
|
|
136
140
|
}
|
|
137
|
-
}), [["__scopeId", "data-v-e4a6bf1d"]]),
|
|
141
|
+
}), [["__scopeId", "data-v-e4a6bf1d"]]), P = ["type", "disabled"], F = /*#__PURE__*/ v(/* @__PURE__ */ a({
|
|
138
142
|
__name: "UiButton",
|
|
139
143
|
props: {
|
|
140
144
|
variant: { default: "primary" },
|
|
@@ -145,29 +149,29 @@ var ae = { class: "mw-header__brand" }, oe = { class: "mw-header__center" }, se
|
|
|
145
149
|
}
|
|
146
150
|
},
|
|
147
151
|
setup(e) {
|
|
148
|
-
return (t, n) => (
|
|
152
|
+
return (t, n) => (d(), r("button", {
|
|
149
153
|
type: e.type,
|
|
150
154
|
disabled: e.disabled,
|
|
151
155
|
class: s(["mw-btn", `mw-btn--${e.variant}`])
|
|
152
|
-
}, [
|
|
156
|
+
}, [m(t.$slots, "default", {}, void 0, !0)], 10, P));
|
|
153
157
|
}
|
|
154
|
-
}), [["__scopeId", "data-v-299de2c3"]]),
|
|
158
|
+
}), [["__scopeId", "data-v-299de2c3"]]), I = { class: "mw-card" }, L = {
|
|
155
159
|
key: 0,
|
|
156
160
|
class: "mw-card__header"
|
|
157
|
-
},
|
|
161
|
+
}, R = { class: "mw-card__title" }, z = { class: "mw-card__body" }, B = {
|
|
158
162
|
key: 1,
|
|
159
163
|
class: "mw-card__footer"
|
|
160
|
-
},
|
|
164
|
+
}, se = /*#__PURE__*/ v(/* @__PURE__ */ a({
|
|
161
165
|
__name: "UiCard",
|
|
162
166
|
props: { title: {} },
|
|
163
167
|
setup(e) {
|
|
164
|
-
return (t, a) => (
|
|
165
|
-
e.title || t.$slots.header ? (
|
|
166
|
-
i("div",
|
|
167
|
-
t.$slots.footer ? (
|
|
168
|
+
return (t, a) => (d(), r("section", I, [
|
|
169
|
+
e.title || t.$slots.header ? (d(), r("header", L, [m(t.$slots, "header", {}, () => [i("h3", R, h(e.title), 1)], !0)])) : n("", !0),
|
|
170
|
+
i("div", z, [m(t.$slots, "default", {}, void 0, !0)]),
|
|
171
|
+
t.$slots.footer ? (d(), r("footer", B, [m(t.$slots, "footer", {}, void 0, !0)])) : n("", !0)
|
|
168
172
|
]));
|
|
169
173
|
}
|
|
170
|
-
}), [["__scopeId", "data-v-fd2fd7ab"]]),
|
|
174
|
+
}), [["__scopeId", "data-v-fd2fd7ab"]]), V = { class: "mw-select" }, H = /*#__PURE__*/ v(/* @__PURE__ */ a({
|
|
171
175
|
inheritAttrs: !1,
|
|
172
176
|
__name: "UiSelect",
|
|
173
177
|
props: {
|
|
@@ -176,8 +180,8 @@ var ae = { class: "mw-header__brand" }, oe = { class: "mw-header__center" }, se
|
|
|
176
180
|
},
|
|
177
181
|
emits: ["update:modelValue"],
|
|
178
182
|
setup(e) {
|
|
179
|
-
let t =
|
|
180
|
-
return (e, n) => (
|
|
183
|
+
let t = ee(e, "modelValue");
|
|
184
|
+
return (e, n) => (d(), r("div", V, [g(i("select", o(e.$attrs, { "onUpdate:modelValue": n[0] ||= (e) => t.value = e }), [m(e.$slots, "default", {}, void 0, !0)], 16), [[te, t.value]]), n[1] ||= i("svg", {
|
|
181
185
|
class: "mw-select__chevron",
|
|
182
186
|
xmlns: "http://www.w3.org/2000/svg",
|
|
183
187
|
width: "12",
|
|
@@ -186,7 +190,7 @@ var ae = { class: "mw-header__brand" }, oe = { class: "mw-header__center" }, se
|
|
|
186
190
|
"aria-hidden": "true"
|
|
187
191
|
}, [i("path", { d: "M1 1l5 5 5-5" })], -1)]));
|
|
188
192
|
}
|
|
189
|
-
}), [["__scopeId", "data-v-b9468387"]]),
|
|
193
|
+
}), [["__scopeId", "data-v-b9468387"]]), U = ["role"], W = /*#__PURE__*/ v(/* @__PURE__ */ a({
|
|
190
194
|
__name: "UiNotice",
|
|
191
195
|
props: { type: {} },
|
|
192
196
|
setup(e) {
|
|
@@ -194,16 +198,16 @@ var ae = { class: "mw-header__brand" }, oe = { class: "mw-header__center" }, se
|
|
|
194
198
|
if (n.type === "error") return "alert";
|
|
195
199
|
if (n.type === "ok") return "status";
|
|
196
200
|
});
|
|
197
|
-
return (t, n) => (
|
|
201
|
+
return (t, n) => (d(), r("p", {
|
|
198
202
|
class: s(["mw-notice", e.type && e.type !== "info" ? `mw-notice--${e.type}` : ""]),
|
|
199
203
|
role: i.value
|
|
200
|
-
}, [
|
|
204
|
+
}, [m(t.$slots, "default", {}, void 0, !0)], 10, U));
|
|
201
205
|
}
|
|
202
|
-
}), [["__scopeId", "data-v-6f53d0be"]]),
|
|
206
|
+
}), [["__scopeId", "data-v-6f53d0be"]]), G = ["disabled", "aria-current"], K = {
|
|
203
207
|
key: 0,
|
|
204
208
|
class: "sidebar-item__icon",
|
|
205
209
|
"aria-hidden": "true"
|
|
206
|
-
},
|
|
210
|
+
}, ce = { class: "sidebar-item__label" }, le = /*#__PURE__*/ v(/* @__PURE__ */ a({
|
|
207
211
|
__name: "SidebarItem",
|
|
208
212
|
props: {
|
|
209
213
|
label: {},
|
|
@@ -218,30 +222,59 @@ var ae = { class: "mw-header__brand" }, oe = { class: "mw-header__center" }, se
|
|
|
218
222
|
}
|
|
219
223
|
},
|
|
220
224
|
setup(e) {
|
|
221
|
-
return (t, a) => (
|
|
225
|
+
return (t, a) => (d(), r("button", {
|
|
222
226
|
type: "button",
|
|
223
227
|
class: s(["sidebar-item", { "is-active": e.active }]),
|
|
224
228
|
disabled: e.disabled,
|
|
225
229
|
"aria-current": e.active ? "page" : void 0
|
|
226
|
-
}, [e.icon ? (
|
|
230
|
+
}, [e.icon ? (d(), r("span", K, h(e.icon), 1)) : n("", !0), i("span", ce, h(e.label), 1)], 10, G));
|
|
231
|
+
}
|
|
232
|
+
}), [["__scopeId", "data-v-e15afdf7"]]), ue = ["title"], de = /*#__PURE__*/ v(/* @__PURE__ */ a({
|
|
233
|
+
__name: "CopyableAddress",
|
|
234
|
+
props: {
|
|
235
|
+
address: {},
|
|
236
|
+
truncate: {
|
|
237
|
+
type: Boolean,
|
|
238
|
+
default: !0
|
|
239
|
+
},
|
|
240
|
+
chars: { default: () => [6, 4] }
|
|
241
|
+
},
|
|
242
|
+
setup(e) {
|
|
243
|
+
let n = e, i = f(!1), a = t(() => {
|
|
244
|
+
if (i.value) return "Copied!";
|
|
245
|
+
if (!n.truncate) return n.address;
|
|
246
|
+
let [e, t] = n.chars;
|
|
247
|
+
return `${n.address.slice(0, e)}…${n.address.slice(-t)}`;
|
|
248
|
+
});
|
|
249
|
+
async function o() {
|
|
250
|
+
await navigator.clipboard.writeText(n.address), i.value = !0, setTimeout(() => {
|
|
251
|
+
i.value = !1;
|
|
252
|
+
}, 1500);
|
|
253
|
+
}
|
|
254
|
+
return (t, n) => (d(), r("button", {
|
|
255
|
+
type: "button",
|
|
256
|
+
class: s(["ca-root", { "ca-root--copied": i.value }]),
|
|
257
|
+
title: e.address,
|
|
258
|
+
onClick: o
|
|
259
|
+
}, h(a.value), 11, ue));
|
|
227
260
|
}
|
|
228
|
-
}), [["__scopeId", "data-v-
|
|
261
|
+
}), [["__scopeId", "data-v-e2d23de9"]]), fe = /* @__PURE__ */ new Set([
|
|
229
262
|
"operational",
|
|
230
263
|
"degraded",
|
|
231
264
|
"down",
|
|
232
265
|
"unknown"
|
|
233
266
|
]);
|
|
234
|
-
function K(e) {
|
|
235
|
-
return typeof e == "string" && ue.has(e);
|
|
236
|
-
}
|
|
237
267
|
function q(e) {
|
|
268
|
+
return typeof e == "string" && fe.has(e);
|
|
269
|
+
}
|
|
270
|
+
function J(e) {
|
|
238
271
|
if (typeof e != "object" || !e) return null;
|
|
239
272
|
let t = e;
|
|
240
|
-
return !
|
|
273
|
+
return !q(t.overall) || typeof t.generated_at != "string" || !Array.isArray(t.groups) ? null : e;
|
|
241
274
|
}
|
|
242
275
|
//#endregion
|
|
243
276
|
//#region src/components/StatusWidget.vue?vue&type=script&setup=true&lang.ts
|
|
244
|
-
var
|
|
277
|
+
var pe = ["href", "title"], me = { class: "status-widget__label" }, he = /*#__PURE__*/ v(/* @__PURE__ */ a({
|
|
245
278
|
__name: "StatusWidget",
|
|
246
279
|
props: {
|
|
247
280
|
apiUrl: { default: "https://status.meddleware.co.uk/api/status" },
|
|
@@ -259,12 +292,12 @@ var de = ["href", "title"], J = { class: "status-widget__label" }, fe = /*#__PUR
|
|
|
259
292
|
degraded: "Degraded",
|
|
260
293
|
down: "Major outage",
|
|
261
294
|
unknown: "Status unknown"
|
|
262
|
-
}, o =
|
|
263
|
-
async function
|
|
295
|
+
}, o = f("ok"), c = f("All systems operational"), p = null;
|
|
296
|
+
async function m() {
|
|
264
297
|
try {
|
|
265
298
|
let e = await fetch(t.apiUrl);
|
|
266
299
|
if (!e.ok) throw Error(`HTTP ${e.status}`);
|
|
267
|
-
let r =
|
|
300
|
+
let r = J(await e.json());
|
|
268
301
|
if (!r) throw Error("unexpected response shape");
|
|
269
302
|
o.value = n[r.overall], c.value = a[r.overall];
|
|
270
303
|
} catch {
|
|
@@ -272,10 +305,10 @@ var de = ["href", "title"], J = { class: "status-widget__label" }, fe = /*#__PUR
|
|
|
272
305
|
}
|
|
273
306
|
}
|
|
274
307
|
return l(() => {
|
|
275
|
-
|
|
276
|
-
}),
|
|
277
|
-
|
|
278
|
-
}), (t, n) => (
|
|
308
|
+
m(), p = setInterval(m, t.pollInterval);
|
|
309
|
+
}), u(() => {
|
|
310
|
+
p !== null && clearInterval(p);
|
|
311
|
+
}), (t, n) => (d(), r("a", {
|
|
279
312
|
href: e.href,
|
|
280
313
|
target: "_blank",
|
|
281
314
|
rel: "noopener",
|
|
@@ -284,19 +317,19 @@ var de = ["href", "title"], J = { class: "status-widget__label" }, fe = /*#__PUR
|
|
|
284
317
|
}, [n[0] ||= i("span", {
|
|
285
318
|
class: "status-widget__dot",
|
|
286
319
|
"aria-hidden": "true"
|
|
287
|
-
}, null, -1), i("span",
|
|
320
|
+
}, null, -1), i("span", me, h(c.value), 1)], 10, pe));
|
|
288
321
|
}
|
|
289
|
-
}), [["__scopeId", "data-v-20197983"]]), Y = "mw-color-mode", X =
|
|
290
|
-
function
|
|
322
|
+
}), [["__scopeId", "data-v-20197983"]]), Y = "mw-color-mode", X = f("system"), Z = !1;
|
|
323
|
+
function ge() {
|
|
291
324
|
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
292
325
|
}
|
|
293
326
|
function Q(e) {
|
|
294
|
-
return e === "dark" || e === "system" &&
|
|
327
|
+
return e === "dark" || e === "system" && ge();
|
|
295
328
|
}
|
|
296
329
|
function $(e) {
|
|
297
330
|
typeof document > "u" || document.documentElement.setAttribute("data-theme", Q(e) ? "dark" : "light");
|
|
298
331
|
}
|
|
299
|
-
function
|
|
332
|
+
function _e(e = "system") {
|
|
300
333
|
if (!Z) {
|
|
301
334
|
Z = !0;
|
|
302
335
|
let t = null;
|
|
@@ -305,7 +338,7 @@ function me(e = "system") {
|
|
|
305
338
|
} catch {}
|
|
306
339
|
X.value = t ?? e, $(X.value), typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
|
|
307
340
|
X.value === "system" && $("system");
|
|
308
|
-
}),
|
|
341
|
+
}), ne(X, (e) => {
|
|
309
342
|
$(e);
|
|
310
343
|
try {
|
|
311
344
|
typeof localStorage < "u" && localStorage.setItem(Y, e);
|
|
@@ -326,4 +359,4 @@ function me(e = "system") {
|
|
|
326
359
|
};
|
|
327
360
|
}
|
|
328
361
|
//#endregion
|
|
329
|
-
export {
|
|
362
|
+
export { O as AppFooter, y as AppHeader, w as AppSidebar, N as ColorModeControl, de as CopyableAddress, le as SidebarItem, he as StatusWidget, F as UiButton, se as UiCard, W as UiNotice, H as UiSelect, q as isStatusLevel, J as parseSnapshot, _e as useColorMode };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meddleware/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Shared Vue 3 component library for @meddleware UIs \u2014 layout shell (header/sidebar/footer), colour-mode control, and primitives. Built on @meddleware/design-tokens.",
|
|
5
5
|
"license": "0BSD",
|
|
6
6
|
"type": "module",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"vue": "^3.5.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@meddleware/design-tokens": "^0.1.
|
|
32
|
+
"@meddleware/design-tokens": "^0.1.2"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@vitejs/plugin-vue": "^6.0.8",
|