@meddleware/ui 0.1.44 → 0.1.46
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 +3 -2
- package/dist/components/AppToolShell.vue_vue_type_script_setup_true_lang.js +12 -5
- package/dist/components/ColorModeControl.css +1 -1
- package/dist/components/ColorModeControl.js +1 -1
- package/dist/components/ColorModeControl.vue.d.ts +9 -0
- package/dist/components/ColorModeControl.vue_vue_type_script_setup_true_lang.js +43 -28
- package/dist/components/CopyrightLine.css +1 -1
- package/dist/components/CopyrightLine.js +1 -1
- package/dist/components/UiButton.vue.d.ts +1 -1
- package/dist/components/UiRoleGuide.css +1 -0
- package/dist/components/UiRoleGuide.js +7 -0
- package/dist/components/UiRoleGuide.vue.d.ts +36 -0
- package/dist/components/UiRoleGuide.vue_vue_type_script_setup_true_lang.js +75 -0
- package/dist/composables/useColorMode.d.ts +5 -0
- package/dist/composables/useColorMode.js +33 -25
- package/dist/index.d.ts +2 -0
- package/dist/index.js +49 -48
- package/package.json +1 -1
package/dist/base.css
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
@layer mw.reset;@layer mw.components{.mw-sidebar[data-v-f5e6df6c]{--_width:var(--v4ba6c322);height:100%;width:var(--_width);background:var(--_bg);color:var(--_text);border:0;border-right:1px solid var(--_border);font-family:var(--mw-font-sans);flex-direction:column;margin:0;padding:0;display:flex;position:static;inset:auto;overflow:visible}.mw-sidebar__nav[data-v-f5e6df6c]{gap:var(--space-3xs);padding:var(--space-xs) 0;flex-direction:column;flex:auto;display:flex;overflow-y:auto}@media (width<45em){.mw-sidebar[data-v-f5e6df6c]:not(:popover-open){display:none}.mw-sidebar[data-v-f5e6df6c]:popover-open{width:min(var(--_width), 85vw);height:100dvh;box-shadow:var(--shadow-3);position:fixed;inset:0 auto 0 0}.mw-sidebar[data-v-f5e6df6c]::backdrop{background:var(--backdrop)}}.mw-sidebar a[data-v-f5e6df6c-s]{color:inherit}.mw-sidebar[data-v-f5e6df6c]:not(.mw-sidebar--transparent){--ok:var(--_ok);--danger:var(--_danger);--info:var(--_info)}}
|
|
6
6
|
@layer mw.reset;@layer mw.components{.mw-tab-nav[data-v-7b318cd8]{gap:var(--space-3xs);border-bottom:var(--space-4xs) solid var(--border);flex-wrap:wrap;margin:0;padding:0;list-style:none;display:flex}.mw-tab-nav__item[data-v-7b318cd8]{display:contents}.mw-tab-nav__tab[data-v-7b318cd8]{appearance:none;border:none;border-bottom:var(--space-4xs) solid transparent;padding:var(--space-2xs) var(--space-sm);margin-bottom:calc(-1 * var(--space-4xs));cursor:pointer;font-size:var(--font-size-base);color:var(--muted);transition:color var(--transition-base), border-color var(--transition-base);background:0 0;border-radius:0}.mw-tab-nav__tab[data-v-7b318cd8]:hover{color:var(--text)}.mw-tab-nav__tab--active[data-v-7b318cd8]{border-bottom-color:var(--accent);color:var(--text);font-weight:var(--font-weight-semibold)}.mw-tab-nav--raised[data-v-7b318cd8]{border-bottom:1px solid var(--border);background:var(--surface);padding:var(--space-3xs) var(--space-3xs) 0;align-items:flex-end;gap:var(--space-4xs);scrollbar-width:none;flex-shrink:0;overflow-x:auto}.mw-tab-nav--raised[data-v-7b318cd8]::-webkit-scrollbar{display:none}.mw-tab-nav--raised .mw-tab-nav__tab[data-v-7b318cd8]{border-bottom:1px solid var(--border);padding:var(--space-3xs) var(--space-xs) var(--space-3xs);font-size:var(--font-size-sm);font-weight:var(--font-weight-medium);color:var(--muted);background:var(--lift);border-top:var(--space-4xs) solid transparent;white-space:nowrap;transition:color var(--transition-base), background var(--transition-base), border-color var(--transition-base);border-left:1px solid #0000;border-right:1px solid #0000;margin-bottom:-1px}.mw-tab-nav--raised .mw-tab-nav__tab[data-v-7b318cd8]:hover:not(.mw-tab-nav__tab--active){color:var(--text);background:var(--surface)}.mw-tab-nav--raised .mw-tab-nav__tab--active[data-v-7b318cd8]{color:var(--text);background:var(--bg);border-color:var(--accent) var(--border) var(--bg) var(--border);font-weight:var(--font-weight-semibold)}.mw-tab-nav--raised.mw-tab-nav--lg[data-v-7b318cd8]{gap:var(--space-4xs);padding:var(--space-3xs) var(--space-3xs) 0}.mw-tab-nav--raised.mw-tab-nav--lg .mw-tab-nav__tab[data-v-7b318cd8]{padding:var(--space-2xs) var(--space-sm);font-size:var(--font-size-base);font-weight:var(--font-weight-semibold)}.mw-tab-nav--flush[data-v-7b318cd8]{background:0 0;padding-inline:0}}
|
|
7
7
|
@layer mw.reset;@layer mw.components{.mw-brand-mark[data-v-701f75be]{inline-size:var(--mw-brand-size,1em);block-size:var(--mw-brand-size,1em);vertical-align:-.125em;flex:none;display:inline-block}}
|
|
8
|
-
@layer mw.reset;@layer mw.components{.mw-mode[data-v-
|
|
8
|
+
@layer mw.reset;@layer mw.components{.mw-mode[data-v-635622c5]{align-items:center;gap:var(--space-4xs);min-inline-size:0;padding:var(--space-4xs);border:1px solid var(--_border,var(--border));border-radius:var(--radius);flex-wrap:wrap;margin:0;display:inline-flex}.mw-mode__btn[data-v-635622c5]{justify-content:center;align-items:center;gap:var(--space-3xs);min-block-size:1.5rem;min-inline-size:1.5rem;padding:var(--space-3xs) var(--space-2xs);border-radius:var(--radius-sm);color:var(--_muted,var(--muted));font:inherit;font-size:var(--font-size-sm);cursor:pointer;transition:color var(--transition-base), background var(--transition-base);background:0 0;border:0;display:inline-flex}.mw-mode__btn[data-v-635622c5]:hover{color:var(--_text,var(--text))}.mw-mode__btn.is-active[data-v-635622c5]{color:var(--_text,var(--text));background:color-mix(in srgb, var(--_text,var(--text)) 14%, transparent)}.mw-mode__btn[data-v-635622c5]:focus-visible{outline:2px solid var(--focus-ring);outline-offset:1px}.mw-mode__remember[data-v-635622c5]{align-items:center;gap:var(--space-3xs);min-block-size:1.5rem;padding-inline:var(--space-2xs);color:var(--_muted,var(--muted));font-size:var(--font-size-sm);cursor:pointer;display:inline-flex}.mw-mode__remember input[data-v-635622c5]{accent-color:var(--_text,var(--text));margin:0}@media (forced-colors:active){.mw-mode__btn.is-active[data-v-635622c5]{outline-offset:-2px;outline:2px solid highlight}}@media (width<40em){.mw-mode__label[data-v-635622c5]{display:none}}}
|
|
9
9
|
@layer mw.reset;@layer mw.components{.ca-root[data-v-60f80445]{align-items:center;gap:.35em;max-width:100%;display:inline-flex}.ca-value[data-v-60f80445]{font-family:var(--mw-font-mono);font-size:inherit;overflow-wrap:anywhere;white-space:normal;min-width:0}}
|
|
10
|
-
@layer mw.reset;@layer mw.components{.copyright-line[data-v-
|
|
10
|
+
@layer mw.reset;@layer mw.components{.copyright-line[data-v-77c14a9d]{text-align:center;max-width:100%;display:inline-block}.symbol-link[data-v-77c14a9d]{white-space:nowrap;color:inherit;vertical-align:text-top;padding:0 var(--space-4xs);align-items:center;text-decoration:none;display:inline-flex}.symbol-link[data-v-77c14a9d]:hover{text-decoration:underline}.symbol-mark[data-v-77c14a9d]{vertical-align:-.15em;display:inline}}
|
|
11
11
|
@layer mw.reset;@layer mw.components{.el-root[data-v-afd81c09]{min-block-size:calc(var(--space-sm) + var(--space-3xs));font-family:var(--mw-font-mono);font-size:inherit;color:var(--mw-link,var(--accent));text-underline-offset:.18em;transition:color var(--duration-base);-webkit-text-decoration:underline dotted;text-decoration:underline dotted;display:inline-block}.el-root[data-v-afd81c09]:hover{color:var(--text);text-decoration-style:solid}}
|
|
12
12
|
@layer mw.reset;@layer mw.components{.sidebar-group[data-v-d2020093]{border:0;min-inline-size:0;margin:0;padding:0}.sidebar-group--l1+.sidebar-group--l1[data-v-d2020093]{margin-block-start:var(--space-2xs)}.sidebar-group__label[data-v-d2020093]{float:inline-start;width:100%;padding:var(--space-3xs) var(--space-xs);font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold);color:var(--_muted,var(--muted));-webkit-user-select:none;user-select:none}.sidebar-group__label[data-v-d2020093]+*{clear:both}.sidebar-group--l1>.sidebar-group__label[data-v-d2020093]{text-transform:uppercase;letter-spacing:var(--tracking-wide)}.sidebar-group--l2[data-v-d2020093]{padding-inline-start:var(--space-3xs)}.sidebar-group--l2>.sidebar-group__label[data-v-d2020093]{font-weight:var(--font-weight-medium);padding-inline-start:var(--space-xs)}}
|
|
13
13
|
@layer mw.reset;@layer mw.components{.sidebar-item[data-v-cb0a8084]{align-items:center;gap:var(--space-2xs);width:100%;padding:var(--space-2xs) var(--space-sm);color:var(--_muted,var(--muted));font:inherit;text-align:left;cursor:pointer;transition:background var(--transition-base), color var(--transition-base);background:0 0;border:0;border-radius:0;text-decoration:none;display:flex}.sidebar-item[data-v-cb0a8084]:hover:not(:disabled){background:color-mix(in srgb, currentColor 10%, transparent);color:var(--_text,var(--text))}.sidebar-item.is-active[data-v-cb0a8084]{background:color-mix(in srgb, var(--accent) 26%, transparent);color:var(--_text,var(--text))}.sidebar-item[data-v-cb0a8084]:disabled{cursor:default}@media (forced-colors:active){.sidebar-item.is-active[data-v-cb0a8084]{outline-offset:-2px;outline:2px solid highlight}}.sidebar-item[data-v-cb0a8084]:focus-visible{outline:2px solid var(--focus-ring);outline-offset:-2px}.sidebar-item__icon[data-v-cb0a8084]{width:var(--space-sm);text-align:center}}
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
@layer mw.reset;@layer mw.components{.mw-notice[data-v-9bed4c15]{padding:var(--space-2xs) var(--space-xs);border:1px solid var(--border);border-left-width:var(--space-4xs);border-radius:var(--radius);background:var(--lift);color:var(--text);font-size:var(--font-size-sm);margin:0}.mw-notice--error[data-v-9bed4c15]{border-left-color:var(--danger);background:color-mix(in srgb, var(--danger) 8%, var(--lift))}.mw-notice--ok[data-v-9bed4c15]{border-left-color:var(--ok);background:color-mix(in srgb, var(--ok) 8%, var(--lift))}.mw-notice--warning[data-v-9bed4c15]{border-left-color:var(--warning);background:color-mix(in srgb, var(--warning) 12%, var(--lift))}}
|
|
35
35
|
@layer mw.reset;@layer mw.components{.mw-pager[data-v-57e1edea]{gap:var(--space-sm);margin-top:var(--space-xs);flex-wrap:wrap;justify-content:flex-end;align-items:center;display:flex}.mw-pager__page[data-v-57e1edea]{color:var(--muted);font-size:var(--font-size-sm)}}
|
|
36
36
|
@layer mw.reset;@layer mw.components{.mw-panel[data-v-db89a6f2]{padding:var(--space-xs);border:1px solid var(--border);border-radius:var(--radius-xs);background:var(--surface);overflow:hidden}.mw-panel__title[data-v-db89a6f2]{margin:calc(-1 * var(--space-xs)) calc(-1 * var(--space-xs)) var(--space-xs);padding:var(--space-3xs) var(--space-xs);font-size:var(--font-size-2xs);font-weight:var(--font-weight-semibold);letter-spacing:var(--tracking-wide);line-height:inherit;text-transform:uppercase;color:var(--muted);background:var(--lift);border-bottom:1px solid var(--border)}}
|
|
37
|
+
@layer mw.reset;@layer mw.components{.mw-role-guide[data-v-d60d7087]{gap:var(--space-md);grid-template-columns:minmax(0,1fr);display:grid}.mw-role-guide__choices[data-v-d60d7087]{gap:var(--space-xs);border:0;grid-template-columns:repeat(auto-fit,minmax(min(100%,14rem),1fr));inline-size:100%;min-inline-size:0;margin:0;padding:0;display:grid}.mw-role-guide__legend[data-v-d60d7087]{margin-bottom:var(--space-2xs);font-weight:var(--font-weight-semibold);grid-column:1/-1;padding:0}.mw-role-guide__choice[data-v-d60d7087]{gap:var(--space-4xs) var(--space-2xs);padding:var(--space-sm);border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);cursor:pointer;transition:border-color var(--transition-base), box-shadow var(--transition-base);grid-template-columns:auto 1fr;align-items:start;display:grid}.mw-role-guide__choice input[data-v-d60d7087]{block-size:1.25rem;inline-size:1.25rem;accent-color:var(--accent);grid-row:1/span 2;margin:.25em 0 0}.mw-role-guide__choice-title[data-v-d60d7087]{font-weight:var(--font-weight-semibold)}.mw-role-guide__choice-summary[data-v-d60d7087]{color:var(--muted);font-size:var(--font-size-sm)}.mw-role-guide__choice[data-v-d60d7087]:has(input:checked){border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}.mw-role-guide__choice[data-v-d60d7087]:has(input:focus-visible){outline:2px solid var(--focus-ring);outline-offset:2px}.mw-role-guide__panels[data-v-d60d7087]{gap:var(--space-md);grid-template-columns:minmax(0,1fr);display:grid}@supports selector(:has(*)){.mw-role-guide__panel[data-v-d60d7087]{display:none}:is(.mw-role-guide:has(.mw-role-guide__choice:first-of-type input:checked) .mw-role-guide__panel[data-v-d60d7087]:first-of-type,.mw-role-guide:has(.mw-role-guide__choice:nth-of-type(2) input:checked) .mw-role-guide__panel[data-v-d60d7087]:nth-of-type(2),.mw-role-guide:has(.mw-role-guide__choice:nth-of-type(3) input:checked) .mw-role-guide__panel[data-v-d60d7087]:nth-of-type(3),.mw-role-guide:has(.mw-role-guide__choice:nth-of-type(4) input:checked) .mw-role-guide__panel[data-v-d60d7087]:nth-of-type(4),.mw-role-guide:has(.mw-role-guide__choice:nth-of-type(5) input:checked) .mw-role-guide__panel[data-v-d60d7087]:nth-of-type(5),.mw-role-guide:has(.mw-role-guide__choice:nth-of-type(6) input:checked) .mw-role-guide__panel[data-v-d60d7087]:nth-of-type(6)){display:block}}.mw-role-guide__panel[data-v-d60d7087]{overflow-wrap:anywhere;min-inline-size:0;padding:var(--space-md);border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);scroll-margin-block-start:var(--space-2xl)}.mw-role-guide__title[data-v-d60d7087]{margin:0 0 var(--space-sm);font-size:var(--font-size-lg)}.mw-role-guide__steps[data-v-d60d7087]{margin:0 0 var(--space-sm);padding:0;list-style:none}.mw-role-guide__steps li[data-v-d60d7087]{min-block-size:2rem;padding-block-end:var(--space-sm);padding-inline-start:2.75rem;position:relative}.mw-role-guide__steps li[data-v-d60d7087]:not(:last-child){background:linear-gradient(var(--border), var(--border)) no-repeat calc(1rem - 1px) 2rem / 2px calc(100% - 2rem)}.mw-role-guide__num[data-v-d60d7087]{border:2px solid var(--accent);background:var(--surface);block-size:2rem;inline-size:2rem;font-weight:var(--font-weight-semibold);border-radius:50%;place-items:center;display:grid;position:absolute;inset-block-start:0;inset-inline-start:0}.mw-role-guide__facts[data-v-d60d7087]{gap:var(--space-3xs) var(--space-sm);margin:0 0 var(--space-sm);grid-template-columns:max-content minmax(0,1fr);display:grid}.mw-role-guide__facts dt[data-v-d60d7087]{font-weight:var(--font-weight-semibold)}.mw-role-guide__facts dd[data-v-d60d7087]{color:var(--muted);margin:0}.mw-role-guide__links[data-v-d60d7087]{gap:var(--space-xs);flex-wrap:wrap;margin:0;display:flex}@media (forced-colors:active){.mw-role-guide__choice[data-v-d60d7087]:has(input:checked){outline:2px solid highlight}}@media (prefers-reduced-motion:reduce){.mw-role-guide__choice[data-v-d60d7087]{transition:none}}}
|
|
37
38
|
@layer mw.reset;@layer mw.components{.mw-seg[data-v-895d43d3]{border:1px solid var(--border);border-radius:var(--radius);min-inline-size:0;margin:0;padding:0;display:inline-flex;overflow:hidden}.mw-seg__legend[data-v-895d43d3]{float:inline-start;width:100%;padding:var(--space-3xs) var(--space-xs);font-size:var(--font-size-sm)}.mw-seg--wrap[data-v-895d43d3]{flex-wrap:wrap}@media (width<36em){.mw-seg--grid[data-v-895d43d3]{grid-template-columns:repeat(auto-fit,minmax(min(100%,7rem),1fr));display:grid}.mw-seg--grid .mw-seg__item[data-v-895d43d3]{white-space:normal;padding-block:var(--space-4xs);text-align:center}}.mw-seg__item[data-v-895d43d3]{justify-content:center;align-items:center;gap:var(--space-3xs);min-height:var(--space-md);padding:0 var(--space-sm);border-right:1px solid var(--border);cursor:pointer;font-size:var(--font-size-sm);color:var(--text);transition:background var(--transition-base), color var(--transition-base);-webkit-user-select:none;user-select:none;white-space:nowrap;background:0 0;margin:0;display:flex}.mw-seg__item[data-v-895d43d3]:last-child{border-right:none}.mw-seg__item[data-v-895d43d3]:hover:not(.mw-seg__item--active){background:var(--lift)}.mw-seg__item--active[data-v-895d43d3]{background:var(--accent);color:var(--accent-contrast)}.mw-seg__item[data-v-895d43d3]:has(input:focus-visible){outline:2px solid var(--focus-ring);outline-offset:-2px}.mw-seg__item--disabled[data-v-895d43d3]{filter:grayscale(.6);pointer-events:none;cursor:not-allowed}.mw-seg__item input[type=radio][data-v-895d43d3]{opacity:0;pointer-events:none;width:0;height:0;position:absolute}}
|
|
38
39
|
@layer mw.reset;@layer mw.components{.mw-select[data-v-6af38ca7]{--_chevron-stroke:var(--muted);--_chevron-arm:var(--space-2xs);appearance:none;width:100%;padding:var(--space-2xs) calc(var(--space-md) + var(--space-2xs)) var(--space-2xs) var(--space-xs);background-color:var(--surface);background-image:linear-gradient(45deg, transparent calc(50% - var(--space-4xs) / 2), var(--_chevron-stroke) calc(50% - var(--space-4xs) / 2), var(--_chevron-stroke) calc(50% + var(--space-4xs) / 2), transparent calc(50% + var(--space-4xs) / 2)), linear-gradient(-45deg, transparent calc(50% - var(--space-4xs) / 2), var(--_chevron-stroke) calc(50% - var(--space-4xs) / 2), var(--_chevron-stroke) calc(50% + var(--space-4xs) / 2), transparent calc(50% + var(--space-4xs) / 2));background-position:right calc(var(--space-xs) + var(--_chevron-arm)) center, right var(--space-xs) center;background-size:var(--_chevron-arm) var(--_chevron-arm);color:var(--text);border:1px solid var(--control-border);border-radius:var(--radius);font:inherit;background-repeat:no-repeat}.mw-select[data-v-6af38ca7]:focus-visible{outline:2px solid var(--focus-ring);outline-offset:1px}}
|
|
39
40
|
@layer mw.reset;@layer mw.components{.mw-skip[data-v-ddc3c0de]{z-index:var(--z-skip);padding:var(--space-2xs) var(--space-xs);background:var(--accent);color:var(--accent-contrast);border-radius:var(--radius-sm);font-weight:var(--font-weight-semibold);position:absolute;inset-block-start:var(--space-2xs);inset-inline-start:var(--space-2xs);transform:translateY(-200%)}.mw-skip[data-v-ddc3c0de]:focus{transform:none}}
|
|
@@ -34,19 +34,26 @@ var y = {
|
|
|
34
34
|
defaultMode: { default: "dark" }
|
|
35
35
|
},
|
|
36
36
|
setup(p) {
|
|
37
|
-
let b = p, { mode: x, set: S } = o(b.defaultMode),
|
|
37
|
+
let b = p, { mode: x, set: S, remember: C, setRemember: w } = o(b.defaultMode), T = s(() => b.docsUrl === !1 ? void 0 : b.docsUrl || `https://docs.meddleware.co.uk/blockchain/sui/${b.slug}/`), E = s(() => b.devUrl === !1 ? void 0 : b.devUrl || `https://meddleware.dev/sui/${b.slug}/`);
|
|
38
38
|
return (o, s) => (m(), c(a, { contained: p.contained }, {
|
|
39
39
|
header: v(() => [f(e, { variant: "dark" }, {
|
|
40
40
|
brand: v(() => [h(o.$slots, "brand", {}, () => [f(n), d(" " + g(p.title), 1)])]),
|
|
41
41
|
actions: v(() => [h(o.$slots, "actions"), f(r, {
|
|
42
42
|
"model-value": _(x),
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
remember: _(C),
|
|
44
|
+
"onUpdate:modelValue": _(S),
|
|
45
|
+
"onUpdate:remember": _(w)
|
|
46
|
+
}, null, 8, [
|
|
47
|
+
"model-value",
|
|
48
|
+
"remember",
|
|
49
|
+
"onUpdate:modelValue",
|
|
50
|
+
"onUpdate:remember"
|
|
51
|
+
])]),
|
|
45
52
|
_: 3
|
|
46
53
|
})]),
|
|
47
54
|
footer: v(() => [f(t, {
|
|
48
|
-
"docs-url":
|
|
49
|
-
"dev-url":
|
|
55
|
+
"docs-url": T.value,
|
|
56
|
+
"dev-url": E.value
|
|
50
57
|
}, {
|
|
51
58
|
start: v(() => [f(i, {
|
|
52
59
|
"symbol-variant": "kopimi",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer mw.reset;@layer mw.components{.mw-mode[data-v-
|
|
1
|
+
@layer mw.reset;@layer mw.components{.mw-mode[data-v-635622c5]{align-items:center;gap:var(--space-4xs);min-inline-size:0;padding:var(--space-4xs);border:1px solid var(--_border,var(--border));border-radius:var(--radius);flex-wrap:wrap;margin:0;display:inline-flex}.mw-mode__btn[data-v-635622c5]{justify-content:center;align-items:center;gap:var(--space-3xs);min-block-size:1.5rem;min-inline-size:1.5rem;padding:var(--space-3xs) var(--space-2xs);border-radius:var(--radius-sm);color:var(--_muted,var(--muted));font:inherit;font-size:var(--font-size-sm);cursor:pointer;transition:color var(--transition-base), background var(--transition-base);background:0 0;border:0;display:inline-flex}.mw-mode__btn[data-v-635622c5]:hover{color:var(--_text,var(--text))}.mw-mode__btn.is-active[data-v-635622c5]{color:var(--_text,var(--text));background:color-mix(in srgb, var(--_text,var(--text)) 14%, transparent)}.mw-mode__btn[data-v-635622c5]:focus-visible{outline:2px solid var(--focus-ring);outline-offset:1px}.mw-mode__remember[data-v-635622c5]{align-items:center;gap:var(--space-3xs);min-block-size:1.5rem;padding-inline:var(--space-2xs);color:var(--_muted,var(--muted));font-size:var(--font-size-sm);cursor:pointer;display:inline-flex}.mw-mode__remember input[data-v-635622c5]{accent-color:var(--_text,var(--text));margin:0}@media (forced-colors:active){.mw-mode__btn.is-active[data-v-635622c5]{outline-offset:-2px;outline:2px solid highlight}}@media (width<40em){.mw-mode__label[data-v-635622c5]{display:none}}}
|
|
@@ -2,6 +2,6 @@ import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
|
2
2
|
import t from "./ColorModeControl.vue_vue_type_script_setup_true_lang.js";
|
|
3
3
|
import "./ColorModeControl.css";
|
|
4
4
|
//#region src/components/ColorModeControl.vue
|
|
5
|
-
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-
|
|
5
|
+
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-635622c5"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|
|
@@ -9,13 +9,22 @@ type __VLS_Props = {
|
|
|
9
9
|
modelValue: ColorMode;
|
|
10
10
|
/** Which modes to offer (default all three). */
|
|
11
11
|
modes?: ColorMode[];
|
|
12
|
+
/**
|
|
13
|
+
* Whether the choice is kept on this device (`v-model:remember`, e.g. `useColorMode().remember`). When bound, a
|
|
14
|
+
* "Remember on this device" box is shown beside the modes, unticked unless the person ticked it before; unticking forgets the
|
|
15
|
+
* stored choice. Leave it unbound and the control offers no storage at all (docs/legal STORAGE_LEDGER B2).
|
|
16
|
+
*/
|
|
17
|
+
remember?: boolean;
|
|
12
18
|
};
|
|
13
19
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
20
|
"update:modelValue": (args_0: ColorMode) => any;
|
|
21
|
+
"update:remember": (args_0: boolean) => any;
|
|
15
22
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
23
|
"onUpdate:modelValue"?: ((args_0: ColorMode) => any) | undefined;
|
|
24
|
+
"onUpdate:remember"?: ((args_0: boolean) => any) | undefined;
|
|
17
25
|
}>, {
|
|
18
26
|
modes: ColorMode[];
|
|
27
|
+
remember: boolean;
|
|
19
28
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
29
|
declare const _default: typeof __VLS_export;
|
|
21
30
|
export default _default;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Fragment as e,
|
|
1
|
+
import { Fragment as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, defineComponent as a, normalizeClass as o, openBlock as s, renderList as c, toDisplayString as l } from "vue";
|
|
2
2
|
//#region src/components/ColorModeControl.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
-
var
|
|
3
|
+
var u = { class: "mw-mode" }, d = [
|
|
4
4
|
"aria-pressed",
|
|
5
5
|
"title",
|
|
6
6
|
"onClick"
|
|
7
|
-
],
|
|
7
|
+
], f = {
|
|
8
8
|
viewBox: "0 0 24 24",
|
|
9
9
|
width: "1em",
|
|
10
10
|
height: "1em",
|
|
@@ -14,10 +14,13 @@ var c = { class: "mw-mode" }, l = [
|
|
|
14
14
|
"stroke-linecap": "round",
|
|
15
15
|
"stroke-linejoin": "round",
|
|
16
16
|
"aria-hidden": "true"
|
|
17
|
-
},
|
|
17
|
+
}, p = {
|
|
18
18
|
key: 1,
|
|
19
19
|
d: "M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"
|
|
20
|
-
},
|
|
20
|
+
}, m = { class: "mw-mode__label" }, h = {
|
|
21
|
+
key: 0,
|
|
22
|
+
class: "mw-mode__remember"
|
|
23
|
+
}, g = ["checked"], _ = /*@__PURE__*/ a({
|
|
21
24
|
__name: "ColorModeControl",
|
|
22
25
|
props: {
|
|
23
26
|
modelValue: {},
|
|
@@ -25,34 +28,46 @@ var c = { class: "mw-mode" }, l = [
|
|
|
25
28
|
"light",
|
|
26
29
|
"dark",
|
|
27
30
|
"system"
|
|
28
|
-
] }
|
|
31
|
+
] },
|
|
32
|
+
remember: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: void 0
|
|
35
|
+
}
|
|
29
36
|
},
|
|
30
|
-
emits: ["update:modelValue"],
|
|
31
|
-
setup(
|
|
32
|
-
let
|
|
37
|
+
emits: ["update:modelValue", "update:remember"],
|
|
38
|
+
setup(a) {
|
|
39
|
+
let _ = {
|
|
33
40
|
light: "Light",
|
|
34
41
|
dark: "Dark",
|
|
35
42
|
system: "System"
|
|
36
43
|
};
|
|
37
|
-
return (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
y: "4",
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
44
|
+
return (v, y) => (s(), n("fieldset", u, [
|
|
45
|
+
y[6] ||= r("legend", { class: "mw-visually-hidden" }, "Colour mode", -1),
|
|
46
|
+
(s(!0), n(e, null, c(a.modes, (t) => (s(), n("button", {
|
|
47
|
+
key: t,
|
|
48
|
+
type: "button",
|
|
49
|
+
class: o(["mw-mode__btn", { "is-active": a.modelValue === t }]),
|
|
50
|
+
"aria-pressed": a.modelValue === t,
|
|
51
|
+
title: _[t],
|
|
52
|
+
onClick: (e) => v.$emit("update:modelValue", t)
|
|
53
|
+
}, [(s(), n("svg", f, [t === "light" ? (s(), n(e, { key: 0 }, [y[1] ||= r("circle", {
|
|
54
|
+
cx: "12",
|
|
55
|
+
cy: "12",
|
|
56
|
+
r: "4"
|
|
57
|
+
}, null, -1), y[2] ||= r("path", { d: "M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4" }, null, -1)], 64)) : t === "dark" ? (s(), n("path", p)) : (s(), n(e, { key: 2 }, [y[3] ||= r("rect", {
|
|
58
|
+
x: "3",
|
|
59
|
+
y: "4",
|
|
60
|
+
width: "18",
|
|
61
|
+
height: "12",
|
|
62
|
+
rx: "2"
|
|
63
|
+
}, null, -1), y[4] ||= r("path", { d: "M8 20h8M12 16v4" }, null, -1)], 64))])), r("span", m, l(_[t]), 1)], 10, d))), 128)),
|
|
64
|
+
a.remember === void 0 ? t("", !0) : (s(), n("label", h, [r("input", {
|
|
65
|
+
type: "checkbox",
|
|
66
|
+
checked: a.remember,
|
|
67
|
+
onChange: y[0] ||= (e) => v.$emit("update:remember", e.target.checked)
|
|
68
|
+
}, null, 40, g), y[5] ||= i(" Remember on this device ", -1)]))
|
|
69
|
+
]));
|
|
55
70
|
}
|
|
56
71
|
});
|
|
57
72
|
//#endregion
|
|
58
|
-
export {
|
|
73
|
+
export { _ as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer mw.reset;@layer mw.components{.copyright-line[data-v-
|
|
1
|
+
@layer mw.reset;@layer mw.components{.copyright-line[data-v-77c14a9d]{text-align:center;max-width:100%;display:inline-block}.symbol-link[data-v-77c14a9d]{white-space:nowrap;color:inherit;vertical-align:text-top;padding:0 var(--space-4xs);align-items:center;text-decoration:none;display:inline-flex}.symbol-link[data-v-77c14a9d]:hover{text-decoration:underline}.symbol-mark[data-v-77c14a9d]{vertical-align:-.15em;display:inline}}
|
|
@@ -2,6 +2,6 @@ import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
|
2
2
|
import t from "./CopyrightLine.vue_vue_type_script_setup_true_lang.js";
|
|
3
3
|
import "./CopyrightLine.css";
|
|
4
4
|
//#region src/components/CopyrightLine.vue
|
|
5
|
-
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-
|
|
5
|
+
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-77c14a9d"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|
|
@@ -23,8 +23,8 @@ type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
|
23
23
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
24
24
|
variant: "danger" | "link" | "primary" | "secondary" | "ghost";
|
|
25
25
|
type: "button" | "submit" | "reset";
|
|
26
|
-
disabled: boolean;
|
|
27
26
|
size: "md" | "sm";
|
|
27
|
+
disabled: boolean;
|
|
28
28
|
busy: boolean;
|
|
29
29
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
30
30
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer mw.reset;@layer mw.components{.mw-role-guide[data-v-d60d7087]{gap:var(--space-md);grid-template-columns:minmax(0,1fr);display:grid}.mw-role-guide__choices[data-v-d60d7087]{gap:var(--space-xs);border:0;grid-template-columns:repeat(auto-fit,minmax(min(100%,14rem),1fr));inline-size:100%;min-inline-size:0;margin:0;padding:0;display:grid}.mw-role-guide__legend[data-v-d60d7087]{margin-bottom:var(--space-2xs);font-weight:var(--font-weight-semibold);grid-column:1/-1;padding:0}.mw-role-guide__choice[data-v-d60d7087]{gap:var(--space-4xs) var(--space-2xs);padding:var(--space-sm);border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);cursor:pointer;transition:border-color var(--transition-base), box-shadow var(--transition-base);grid-template-columns:auto 1fr;align-items:start;display:grid}.mw-role-guide__choice input[data-v-d60d7087]{block-size:1.25rem;inline-size:1.25rem;accent-color:var(--accent);grid-row:1/span 2;margin:.25em 0 0}.mw-role-guide__choice-title[data-v-d60d7087]{font-weight:var(--font-weight-semibold)}.mw-role-guide__choice-summary[data-v-d60d7087]{color:var(--muted);font-size:var(--font-size-sm)}.mw-role-guide__choice[data-v-d60d7087]:has(input:checked){border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}.mw-role-guide__choice[data-v-d60d7087]:has(input:focus-visible){outline:2px solid var(--focus-ring);outline-offset:2px}.mw-role-guide__panels[data-v-d60d7087]{gap:var(--space-md);grid-template-columns:minmax(0,1fr);display:grid}@supports selector(:has(*)){.mw-role-guide__panel[data-v-d60d7087]{display:none}:is(.mw-role-guide:has(.mw-role-guide__choice:first-of-type input:checked) .mw-role-guide__panel[data-v-d60d7087]:first-of-type,.mw-role-guide:has(.mw-role-guide__choice:nth-of-type(2) input:checked) .mw-role-guide__panel[data-v-d60d7087]:nth-of-type(2),.mw-role-guide:has(.mw-role-guide__choice:nth-of-type(3) input:checked) .mw-role-guide__panel[data-v-d60d7087]:nth-of-type(3),.mw-role-guide:has(.mw-role-guide__choice:nth-of-type(4) input:checked) .mw-role-guide__panel[data-v-d60d7087]:nth-of-type(4),.mw-role-guide:has(.mw-role-guide__choice:nth-of-type(5) input:checked) .mw-role-guide__panel[data-v-d60d7087]:nth-of-type(5),.mw-role-guide:has(.mw-role-guide__choice:nth-of-type(6) input:checked) .mw-role-guide__panel[data-v-d60d7087]:nth-of-type(6)){display:block}}.mw-role-guide__panel[data-v-d60d7087]{overflow-wrap:anywhere;min-inline-size:0;padding:var(--space-md);border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);scroll-margin-block-start:var(--space-2xl)}.mw-role-guide__title[data-v-d60d7087]{margin:0 0 var(--space-sm);font-size:var(--font-size-lg)}.mw-role-guide__steps[data-v-d60d7087]{margin:0 0 var(--space-sm);padding:0;list-style:none}.mw-role-guide__steps li[data-v-d60d7087]{min-block-size:2rem;padding-block-end:var(--space-sm);padding-inline-start:2.75rem;position:relative}.mw-role-guide__steps li[data-v-d60d7087]:not(:last-child){background:linear-gradient(var(--border), var(--border)) no-repeat calc(1rem - 1px) 2rem / 2px calc(100% - 2rem)}.mw-role-guide__num[data-v-d60d7087]{border:2px solid var(--accent);background:var(--surface);block-size:2rem;inline-size:2rem;font-weight:var(--font-weight-semibold);border-radius:50%;place-items:center;display:grid;position:absolute;inset-block-start:0;inset-inline-start:0}.mw-role-guide__facts[data-v-d60d7087]{gap:var(--space-3xs) var(--space-sm);margin:0 0 var(--space-sm);grid-template-columns:max-content minmax(0,1fr);display:grid}.mw-role-guide__facts dt[data-v-d60d7087]{font-weight:var(--font-weight-semibold)}.mw-role-guide__facts dd[data-v-d60d7087]{color:var(--muted);margin:0}.mw-role-guide__links[data-v-d60d7087]{gap:var(--space-xs);flex-wrap:wrap;margin:0;display:flex}@media (forced-colors:active){.mw-role-guide__choice[data-v-d60d7087]:has(input:checked){outline:2px solid highlight}}@media (prefers-reduced-motion:reduce){.mw-role-guide__choice[data-v-d60d7087]{transition:none}}}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./UiRoleGuide.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
import "./UiRoleGuide.css";
|
|
4
|
+
//#region src/components/UiRoleGuide.vue
|
|
5
|
+
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-d60d7087"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { n as default };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** One path through the guide. */
|
|
2
|
+
export interface RoleGuideRole {
|
|
3
|
+
/** Stable id, used in the address (`#for-<id>`) and the radio value: lowercase letters, digits and hyphens. */
|
|
4
|
+
id: string;
|
|
5
|
+
/** The choice's label and the panel's heading ("Use the tools"). */
|
|
6
|
+
title: string;
|
|
7
|
+
/** One line under the choice ("Get things done without being kept"). */
|
|
8
|
+
summary: string;
|
|
9
|
+
/** The numbered steps, in order (plain text). */
|
|
10
|
+
steps: string[];
|
|
11
|
+
/** "You'll need" (optional). */
|
|
12
|
+
need?: string;
|
|
13
|
+
/** "You get" (optional). */
|
|
14
|
+
get?: string;
|
|
15
|
+
/** Links onward; the first is drawn as the main action. External links name it in their text (e.g. "Developer guide ↗"). */
|
|
16
|
+
links?: {
|
|
17
|
+
text: string;
|
|
18
|
+
href: string;
|
|
19
|
+
}[];
|
|
20
|
+
}
|
|
21
|
+
type __VLS_Props = {
|
|
22
|
+
/** The paths, in order (two to six). */
|
|
23
|
+
roles: RoleGuideRole[];
|
|
24
|
+
/** The radio group's name: unique on the page. */
|
|
25
|
+
name: string;
|
|
26
|
+
/** The question the choices answer. */
|
|
27
|
+
legend?: string;
|
|
28
|
+
/** Heading rank of each panel's title, to fit the page's outline. */
|
|
29
|
+
level?: 2 | 3 | 4;
|
|
30
|
+
};
|
|
31
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
32
|
+
legend: string;
|
|
33
|
+
level: 2 | 3 | 4;
|
|
34
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
|
+
declare const _default: typeof __VLS_export;
|
|
36
|
+
export default _default;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import e from "./UiButton.js";
|
|
2
|
+
import { Fragment as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, defineComponent as s, onMounted as c, openBlock as l, ref as u, renderList as d, resolveDynamicComponent as f, toDisplayString as p, unref as m, withCtx as h } from "vue";
|
|
3
|
+
import { safeHref as g } from "@meddleware/web-utils";
|
|
4
|
+
//#region src/components/UiRoleGuide.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var _ = { class: "mw-role-guide" }, v = { class: "mw-role-guide__choices" }, y = { class: "mw-role-guide__legend" }, b = [
|
|
6
|
+
"name",
|
|
7
|
+
"value",
|
|
8
|
+
"checked",
|
|
9
|
+
"onChange"
|
|
10
|
+
], x = { class: "mw-role-guide__choice-title" }, S = { class: "mw-role-guide__choice-summary" }, C = { class: "mw-role-guide__panels" }, w = ["id", "aria-labelledby"], T = { class: "mw-role-guide__steps" }, E = {
|
|
11
|
+
class: "mw-role-guide__num",
|
|
12
|
+
"aria-hidden": "true"
|
|
13
|
+
}, D = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "mw-role-guide__facts"
|
|
16
|
+
}, O = {
|
|
17
|
+
key: 1,
|
|
18
|
+
class: "mw-role-guide__links"
|
|
19
|
+
}, k = /*@__PURE__*/ s({
|
|
20
|
+
__name: "UiRoleGuide",
|
|
21
|
+
props: {
|
|
22
|
+
roles: {},
|
|
23
|
+
name: {},
|
|
24
|
+
legend: { default: "I'm here to…" },
|
|
25
|
+
level: { default: 3 }
|
|
26
|
+
},
|
|
27
|
+
setup(s) {
|
|
28
|
+
let k = s, A = u(k.roles[0]?.id ?? ""), j = (e) => `for-${e}`;
|
|
29
|
+
function M(e) {
|
|
30
|
+
A.value = e, typeof window < "u" && typeof history < "u" && history.replaceState(history.state, "", `#${j(e)}`);
|
|
31
|
+
}
|
|
32
|
+
return c(() => {
|
|
33
|
+
let e = window.location.hash.replace(/^#for-/, "");
|
|
34
|
+
k.roles.some((t) => t.id === e) && (A.value = e);
|
|
35
|
+
}), (c, u) => (l(), i("div", _, [a("fieldset", v, [a("legend", y, p(s.legend), 1), (l(!0), i(t, null, d(s.roles, (e) => (l(), i("label", {
|
|
36
|
+
key: e.id,
|
|
37
|
+
class: "mw-role-guide__choice"
|
|
38
|
+
}, [
|
|
39
|
+
a("input", {
|
|
40
|
+
type: "radio",
|
|
41
|
+
name: s.name,
|
|
42
|
+
value: e.id,
|
|
43
|
+
checked: A.value === e.id,
|
|
44
|
+
onChange: (t) => M(e.id)
|
|
45
|
+
}, null, 40, b),
|
|
46
|
+
a("span", x, p(e.title), 1),
|
|
47
|
+
a("span", S, p(e.summary), 1)
|
|
48
|
+
]))), 128))]), a("div", C, [(l(!0), i(t, null, d(s.roles, (c) => (l(), i("section", {
|
|
49
|
+
id: j(c.id),
|
|
50
|
+
key: c.id,
|
|
51
|
+
class: "mw-role-guide__panel",
|
|
52
|
+
"aria-labelledby": `${j(c.id)}-title`
|
|
53
|
+
}, [
|
|
54
|
+
(l(), n(f(`h${s.level}`), {
|
|
55
|
+
id: `${j(c.id)}-title`,
|
|
56
|
+
class: "mw-role-guide__title"
|
|
57
|
+
}, {
|
|
58
|
+
default: h(() => [o(p(c.title), 1)]),
|
|
59
|
+
_: 2
|
|
60
|
+
}, 1032, ["id"])),
|
|
61
|
+
a("ol", T, [(l(!0), i(t, null, d(c.steps, (e, t) => (l(), i("li", { key: t }, [a("span", E, p(t + 1), 1), o(p(e), 1)]))), 128))]),
|
|
62
|
+
c.need || c.get ? (l(), i("dl", D, [c.need ? (l(), i(t, { key: 0 }, [u[0] ||= a("dt", null, "You'll need", -1), a("dd", null, p(c.need), 1)], 64)) : r("", !0), c.get ? (l(), i(t, { key: 1 }, [u[1] ||= a("dt", null, "You get", -1), a("dd", null, p(c.get), 1)], 64)) : r("", !0)])) : r("", !0),
|
|
63
|
+
c.links?.length ? (l(), i("p", O, [(l(!0), i(t, null, d(c.links, (t, r) => (l(), n(e, {
|
|
64
|
+
key: t.href,
|
|
65
|
+
href: m(g)(t.href),
|
|
66
|
+
variant: r === 0 ? "primary" : "secondary"
|
|
67
|
+
}, {
|
|
68
|
+
default: h(() => [o(p(t.text), 1)]),
|
|
69
|
+
_: 2
|
|
70
|
+
}, 1032, ["href", "variant"]))), 128))])) : r("", !0)
|
|
71
|
+
], 8, w))), 128))])]));
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
//#endregion
|
|
75
|
+
export { k as default };
|
|
@@ -5,11 +5,16 @@ export type ColorMode = 'light' | 'dark' | 'system';
|
|
|
5
5
|
* External colour-mode state manager. `ColorModeControl` is presentational and
|
|
6
6
|
* does NOT own state — bind it to `mode`/`set` (or your own store) instead.
|
|
7
7
|
*
|
|
8
|
+
* Nothing is stored unless the person asks: bind `remember` to the control's "Remember on this device" box
|
|
9
|
+
* (`ColorModeControl` `v-model:remember`). Without it, the system setting (or `defaultMode`) applies and choices last for the visit.
|
|
10
|
+
*
|
|
8
11
|
* @param defaultMode used only on first init when nothing is persisted.
|
|
9
12
|
*/
|
|
10
13
|
export declare function useColorMode(defaultMode?: ColorMode): {
|
|
11
14
|
mode: Ref<ColorMode, ColorMode>;
|
|
12
15
|
set: (m: ColorMode) => void;
|
|
13
16
|
cycle: () => void;
|
|
17
|
+
remember: Ref<boolean, boolean>;
|
|
18
|
+
setRemember: (keep: boolean) => void;
|
|
14
19
|
isDark: () => boolean;
|
|
15
20
|
};
|
|
@@ -1,46 +1,54 @@
|
|
|
1
1
|
import { effectScope as e, ref as t, watch as n } from "vue";
|
|
2
2
|
//#region src/composables/useColorMode.ts
|
|
3
|
-
var r = "mw-color-mode", i = t("system"), a = !1;
|
|
4
|
-
function
|
|
3
|
+
var r = "mw-color-mode", i = t("system"), a = t(!1), o = !1;
|
|
4
|
+
function s(e) {
|
|
5
|
+
try {
|
|
6
|
+
if (typeof localStorage > "u") return;
|
|
7
|
+
e === null ? localStorage.removeItem(r) : localStorage.setItem(r, e);
|
|
8
|
+
} catch {}
|
|
9
|
+
}
|
|
10
|
+
function c() {
|
|
5
11
|
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
6
12
|
}
|
|
7
|
-
function
|
|
8
|
-
return e === "dark" || e === "system" &&
|
|
13
|
+
function l(e) {
|
|
14
|
+
return e === "dark" || e === "system" && c();
|
|
9
15
|
}
|
|
10
|
-
function
|
|
11
|
-
typeof document < "u" && document.documentElement.setAttribute("data-theme",
|
|
16
|
+
function u(e) {
|
|
17
|
+
typeof document < "u" && document.documentElement.setAttribute("data-theme", l(e) ? "dark" : "light");
|
|
12
18
|
}
|
|
13
|
-
function
|
|
14
|
-
if (!
|
|
15
|
-
|
|
16
|
-
let
|
|
19
|
+
function d(t = "system") {
|
|
20
|
+
if (!o) {
|
|
21
|
+
o = !0;
|
|
22
|
+
let c = null;
|
|
17
23
|
try {
|
|
18
24
|
let e = typeof localStorage < "u" ? localStorage.getItem(r) : null;
|
|
19
|
-
(e === "light" || e === "dark" || e === "system") && (
|
|
25
|
+
(e === "light" || e === "dark" || e === "system") && (c = e);
|
|
20
26
|
} catch {}
|
|
21
|
-
i.value =
|
|
22
|
-
i.value === "system" &&
|
|
27
|
+
i.value = c ?? t, a.value = c !== null, u(i.value), typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
|
|
28
|
+
i.value === "system" && u("system");
|
|
23
29
|
}), e(!0).run(() => {
|
|
24
30
|
n(i, (e) => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
typeof localStorage < "u" && localStorage.setItem(r, e);
|
|
28
|
-
} catch {}
|
|
29
|
-
});
|
|
31
|
+
u(e), a.value && s(e);
|
|
32
|
+
}), n(a, (e) => s(e ? i.value : null));
|
|
30
33
|
});
|
|
31
34
|
}
|
|
32
|
-
function
|
|
35
|
+
function c(e) {
|
|
33
36
|
i.value = e;
|
|
34
37
|
}
|
|
35
|
-
function
|
|
36
|
-
|
|
38
|
+
function d() {
|
|
39
|
+
c(i.value === "light" ? "dark" : i.value === "dark" ? "system" : "light");
|
|
40
|
+
}
|
|
41
|
+
function f(e) {
|
|
42
|
+
a.value = e;
|
|
37
43
|
}
|
|
38
44
|
return {
|
|
39
45
|
mode: i,
|
|
40
|
-
set:
|
|
41
|
-
cycle:
|
|
42
|
-
|
|
46
|
+
set: c,
|
|
47
|
+
cycle: d,
|
|
48
|
+
remember: a,
|
|
49
|
+
setRemember: f,
|
|
50
|
+
isDark: () => l(i.value)
|
|
43
51
|
};
|
|
44
52
|
}
|
|
45
53
|
//#endregion
|
|
46
|
-
export {
|
|
54
|
+
export { d as useColorMode };
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export { default as BrandMark } from './components/BrandMark.vue';
|
|
|
6
6
|
export { default as ColorModeControl } from './components/ColorModeControl.vue';
|
|
7
7
|
export { default as UiButton } from './components/UiButton.vue';
|
|
8
8
|
export { default as UiCard } from './components/UiCard.vue';
|
|
9
|
+
export { default as UiRoleGuide } from './components/UiRoleGuide.vue';
|
|
10
|
+
export type { RoleGuideRole } from './components/UiRoleGuide.vue';
|
|
9
11
|
export { default as UiSelect } from './components/UiSelect.vue';
|
|
10
12
|
export { default as UiNotice } from './components/UiNotice.vue';
|
|
11
13
|
export { default as SidebarItem } from './components/SidebarItem.vue';
|
package/dist/index.js
CHANGED
|
@@ -11,51 +11,52 @@ import { useColorMode as l } from "./composables/useColorMode.js";
|
|
|
11
11
|
import u from "./components/AppToolShell.js";
|
|
12
12
|
import d from "./components/UiButton.js";
|
|
13
13
|
import f from "./components/UiCard.js";
|
|
14
|
-
import p from "./components/
|
|
15
|
-
import m from "./components/
|
|
16
|
-
import h from "./components/
|
|
17
|
-
import g from "./components/
|
|
18
|
-
import
|
|
19
|
-
import v from "./
|
|
20
|
-
import y from "./components/
|
|
21
|
-
import b from "./components/
|
|
22
|
-
import x from "./components/
|
|
23
|
-
import S from "./components/
|
|
24
|
-
import C from "./components/
|
|
25
|
-
import w from "./components/
|
|
26
|
-
import T from "./components/
|
|
27
|
-
import E from "./components/
|
|
28
|
-
import D from "./components/
|
|
29
|
-
import O from "./components/
|
|
30
|
-
import k from "./components/
|
|
31
|
-
import A from "./components/
|
|
32
|
-
import j from "./components/
|
|
33
|
-
import M from "./components/
|
|
34
|
-
import N from "./components/
|
|
35
|
-
import P from "./components/
|
|
36
|
-
import F from "./components/
|
|
37
|
-
import I from "./components/
|
|
38
|
-
import L from "./components/
|
|
39
|
-
import R from "./components/
|
|
40
|
-
import z from "./components/
|
|
41
|
-
import B from "./components/
|
|
42
|
-
import V from "./components/
|
|
43
|
-
import H from "./components/
|
|
44
|
-
import U from "./components/
|
|
45
|
-
import W from "./components/
|
|
46
|
-
import G from "./components/
|
|
47
|
-
import K from "./components/
|
|
48
|
-
import q from "./components/
|
|
49
|
-
import J from "./components/
|
|
50
|
-
import
|
|
51
|
-
import X from "./
|
|
52
|
-
import Z from "./components/
|
|
53
|
-
import Q from "./components/
|
|
54
|
-
import $ from "./components/
|
|
55
|
-
import
|
|
56
|
-
import ne from "./
|
|
57
|
-
import
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
|
|
14
|
+
import p from "./components/UiRoleGuide.js";
|
|
15
|
+
import m from "./components/UiSelect.js";
|
|
16
|
+
import h from "./components/UiNotice.js";
|
|
17
|
+
import g from "./components/SidebarItem.js";
|
|
18
|
+
import _ from "./components/SidebarGroup.js";
|
|
19
|
+
import { tabIds as v } from "./tabs.js";
|
|
20
|
+
import y from "./components/AppTabNav.js";
|
|
21
|
+
import b from "./components/UiTabPanel.js";
|
|
22
|
+
import x from "./components/UiDialog.js";
|
|
23
|
+
import S from "./components/UiCopyButton.js";
|
|
24
|
+
import C from "./components/CopyableAddress.js";
|
|
25
|
+
import w from "./components/ExplorerLink.js";
|
|
26
|
+
import T from "./components/UiStepper.js";
|
|
27
|
+
import E from "./components/UiSegmentedControl.js";
|
|
28
|
+
import D from "./components/UiFieldHint.js";
|
|
29
|
+
import O from "./components/UiFormField.js";
|
|
30
|
+
import k from "./components/UiToolIntro.js";
|
|
31
|
+
import A from "./components/UiInput.js";
|
|
32
|
+
import j from "./components/UiTextarea.js";
|
|
33
|
+
import M from "./components/UiFileField.js";
|
|
34
|
+
import N from "./components/UiTextField.js";
|
|
35
|
+
import P from "./components/UiSelectField.js";
|
|
36
|
+
import F from "./components/UiCheckField.js";
|
|
37
|
+
import I from "./components/UiDateTimeField.js";
|
|
38
|
+
import L from "./components/UiMeter.js";
|
|
39
|
+
import R from "./components/UiPager.js";
|
|
40
|
+
import z from "./components/UiLiveStatus.js";
|
|
41
|
+
import B from "./components/UiEmptyState.js";
|
|
42
|
+
import V from "./components/UiCodeBlock.js";
|
|
43
|
+
import H from "./components/UiAmount.js";
|
|
44
|
+
import U from "./components/UiPanel.js";
|
|
45
|
+
import W from "./components/UiBadge.js";
|
|
46
|
+
import G from "./components/UiToolbarButton.js";
|
|
47
|
+
import K from "./components/UiToolbar.js";
|
|
48
|
+
import q from "./components/UiStatGrid.js";
|
|
49
|
+
import J from "./components/UiStatRow.js";
|
|
50
|
+
import Y from "./components/UiDataTable.js";
|
|
51
|
+
import { useNow as X } from "./composables/useNow.js";
|
|
52
|
+
import Z from "./components/UiStatusDot.js";
|
|
53
|
+
import Q from "./components/UiStatusBar.js";
|
|
54
|
+
import $ from "./components/UiActivityFeed.js";
|
|
55
|
+
import ee from "./components/UiActivityItem.js";
|
|
56
|
+
import { MIN_STATUS_POLL_MS as te, useStatusSnapshot as ne } from "./composables/useStatusSnapshot.js";
|
|
57
|
+
import re from "./components/StatusWidget.js";
|
|
58
|
+
import { useSeason as ie } from "./composables/useSeason.js";
|
|
59
|
+
import { usePager as ae } from "./composables/usePager.js";
|
|
60
|
+
import { RUNTIME_CONFIG_PATH as oe, RUNTIME_ENDPOINT_KEYS as se, loadRuntimeConfig as ce, parseEndpoint as le, parseRuntimeConfig as ue, resetRuntimeConfigForTesting as de, runtimeEndpoints as fe, withRuntimeEnv as pe } from "./runtime-config.js";
|
|
61
|
+
import { DEFAULT_TRUNCATE_CHARS as me, STATUS_HEADLINE as he, STATUS_LABEL as ge, isStatusLevel as _e, parseSnapshot as ve, safeHref as ye, safeIcon as be, safePath as xe, suiExplorerUrl as Se, truncateMiddle as Ce, walruscanBlobUrl as we } from "@meddleware/web-utils";
|
|
62
|
+
export { r as AppFooter, t as AppHeader, n as AppSidebar, y as AppTabNav, u as AppToolShell, i as BrandMark, a as ColorModeControl, C as CopyableAddress, o as CopyrightLine, me as DEFAULT_TRUNCATE_CHARS, w as ExplorerLink, te as MIN_STATUS_POLL_MS, oe as RUNTIME_CONFIG_PATH, se as RUNTIME_ENDPOINT_KEYS, he as STATUS_HEADLINE, ge as STATUS_LABEL, _ as SidebarGroup, g as SidebarItem, re as StatusWidget, $ as UiActivityFeed, ee as UiActivityItem, H as UiAmount, c as UiAppShell, W as UiBadge, d as UiButton, f as UiCard, F as UiCheckField, V as UiCodeBlock, S as UiCopyButton, Y as UiDataTable, I as UiDateTimeField, x as UiDialog, B as UiEmptyState, D as UiFieldHint, M as UiFileField, O as UiFormField, A as UiInput, z as UiLiveStatus, L as UiMeter, h as UiNotice, R as UiPager, U as UiPanel, p as UiRoleGuide, E as UiSegmentedControl, m as UiSelect, P as UiSelectField, s as UiSkipLink, q as UiStatGrid, J as UiStatRow, Q as UiStatusBar, Z as UiStatusDot, T as UiStepper, b as UiTabPanel, N as UiTextField, j as UiTextarea, k as UiToolIntro, K as UiToolbar, G as UiToolbarButton, _e as isStatusLevel, ce as loadRuntimeConfig, le as parseEndpoint, ue as parseRuntimeConfig, ve as parseSnapshot, de as resetRuntimeConfigForTesting, fe as runtimeEndpoints, ye as safeHref, be as safeIcon, xe as safePath, Se as suiExplorerUrl, v as tabIds, Ce as truncateMiddle, l as useColorMode, X as useNow, ae as usePager, ie as useSeason, ne as useStatusSnapshot, e as useStickyOffset, we as walruscanBlobUrl, pe as withRuntimeEnv };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meddleware/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.46",
|
|
4
4
|
"description": "Shared Vue 3 component library for @meddleware UIs — layout shell (header/sidebar/footer), colour-mode control, and primitives. Built on @meddleware/design-tokens.",
|
|
5
5
|
"homepage": "https://docs.meddleware.co.uk/",
|
|
6
6
|
"license": "0BSD",
|