@meddleware/ui 0.1.34 → 0.1.36

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.
Files changed (202) hide show
  1. package/README.md +49 -13
  2. package/dist/_virtual/_plugin-vue_export-helper.js +8 -0
  3. package/dist/base.css +48 -2
  4. package/dist/components/AppFooter.css +1 -0
  5. package/dist/components/AppFooter.js +7 -0
  6. package/dist/components/AppFooter.vue_vue_type_script_setup_true_lang.js +42 -0
  7. package/dist/components/AppHeader.css +1 -0
  8. package/dist/components/AppHeader.js +7 -0
  9. package/dist/components/AppHeader.vue.d.ts +8 -0
  10. package/dist/components/AppHeader.vue_vue_type_script_setup_true_lang.js +68 -0
  11. package/dist/components/AppSidebar.css +1 -0
  12. package/dist/components/AppSidebar.js +7 -0
  13. package/dist/components/AppSidebar.vue.d.ts +3 -0
  14. package/dist/components/AppSidebar.vue_vue_type_script_setup_true_lang.js +37 -0
  15. package/dist/components/AppTabNav.css +1 -0
  16. package/dist/components/AppTabNav.js +7 -0
  17. package/dist/components/AppTabNav.vue.d.ts +3 -0
  18. package/dist/components/AppTabNav.vue_vue_type_script_setup_true_lang.js +70 -0
  19. package/dist/components/ColorModeControl.css +1 -0
  20. package/dist/components/ColorModeControl.js +7 -0
  21. package/dist/components/ColorModeControl.vue_vue_type_script_setup_true_lang.js +58 -0
  22. package/dist/components/CopyableAddress.css +1 -0
  23. package/dist/components/CopyableAddress.js +7 -0
  24. package/dist/components/CopyableAddress.vue_vue_type_script_setup_true_lang.js +28 -0
  25. package/dist/components/CopyrightLine.css +1 -0
  26. package/dist/components/CopyrightLine.js +7 -0
  27. package/dist/components/CopyrightLine.vue.d.ts +6 -0
  28. package/dist/components/CopyrightLine.vue_vue_type_script_setup_true_lang.js +80 -0
  29. package/dist/components/ExplorerLink.css +1 -0
  30. package/dist/components/ExplorerLink.js +7 -0
  31. package/dist/components/ExplorerLink.vue_vue_type_script_setup_true_lang.js +27 -0
  32. package/dist/components/SidebarGroup.css +1 -0
  33. package/dist/components/SidebarGroup.js +7 -0
  34. package/dist/components/SidebarGroup.vue_vue_type_script_setup_true_lang.js +14 -0
  35. package/dist/components/SidebarItem.css +1 -0
  36. package/dist/components/SidebarItem.js +7 -0
  37. package/dist/components/SidebarItem.vue.d.ts +3 -0
  38. package/dist/components/SidebarItem.vue_vue_type_script_setup_true_lang.js +43 -0
  39. package/dist/components/StatusWidget.css +1 -0
  40. package/dist/components/StatusWidget.js +7 -0
  41. package/dist/components/StatusWidget.vue_vue_type_script_setup_true_lang.js +33 -0
  42. package/dist/components/UiActivityFeed.css +1 -0
  43. package/dist/components/UiActivityFeed.js +7 -0
  44. package/dist/components/UiActivityFeed.vue_vue_type_script_setup_true_lang.js +13 -0
  45. package/dist/components/UiActivityItem.css +1 -0
  46. package/dist/components/UiActivityItem.js +7 -0
  47. package/dist/components/UiActivityItem.vue_vue_type_script_setup_true_lang.js +22 -0
  48. package/dist/components/UiAmount.css +1 -0
  49. package/dist/components/UiAmount.js +7 -0
  50. package/dist/components/UiAmount.vue.d.ts +12 -0
  51. package/dist/components/UiAmount.vue_vue_type_script_setup_true_lang.js +31 -0
  52. package/dist/components/UiAppShell.css +1 -0
  53. package/dist/components/UiAppShell.js +7 -0
  54. package/dist/components/UiAppShell.vue.d.ts +26 -0
  55. package/dist/components/UiAppShell.vue_vue_type_script_setup_true_lang.js +27 -0
  56. package/dist/components/UiBadge.css +1 -0
  57. package/dist/components/UiBadge.js +7 -0
  58. package/dist/components/UiBadge.vue.d.ts +10 -1
  59. package/dist/components/UiBadge.vue_vue_type_script_setup_true_lang.js +35 -0
  60. package/dist/components/UiButton.css +1 -0
  61. package/dist/components/UiButton.js +7 -0
  62. package/dist/components/UiButton.vue.d.ts +17 -7
  63. package/dist/components/UiButton.vue_vue_type_script_setup_true_lang.js +60 -0
  64. package/dist/components/UiCard.css +1 -0
  65. package/dist/components/UiCard.js +7 -0
  66. package/dist/components/UiCard.vue.d.ts +20 -6
  67. package/dist/components/UiCard.vue_vue_type_script_setup_true_lang.js +51 -0
  68. package/dist/components/UiCheckField.css +1 -0
  69. package/dist/components/UiCheckField.js +7 -0
  70. package/dist/components/UiCheckField.vue.d.ts +26 -0
  71. package/dist/components/UiCheckField.vue_vue_type_script_setup_true_lang.js +31 -0
  72. package/dist/components/UiCodeBlock.css +1 -0
  73. package/dist/components/UiCodeBlock.js +7 -0
  74. package/dist/components/UiCodeBlock.vue.d.ts +21 -0
  75. package/dist/components/UiCodeBlock.vue_vue_type_script_setup_true_lang.js +21 -0
  76. package/dist/components/UiCopyButton.css +1 -0
  77. package/dist/components/UiCopyButton.js +7 -0
  78. package/dist/components/UiCopyButton.vue.d.ts +11 -0
  79. package/dist/components/UiCopyButton.vue_vue_type_script_setup_true_lang.js +64 -0
  80. package/dist/components/UiDataTable.css +1 -0
  81. package/dist/components/UiDataTable.js +7 -0
  82. package/dist/components/UiDataTable.vue.d.ts +5 -0
  83. package/dist/components/UiDataTable.vue_vue_type_script_setup_true_lang.js +56 -0
  84. package/dist/components/UiDateTimeField.js +5 -0
  85. package/dist/components/UiDateTimeField.vue.d.ts +18 -0
  86. package/dist/components/UiDateTimeField.vue_vue_type_script_setup_true_lang.js +51 -0
  87. package/dist/components/UiDialog.css +1 -0
  88. package/dist/components/UiDialog.js +7 -0
  89. package/dist/components/UiDialog.vue.d.ts +8 -5
  90. package/dist/components/UiDialog.vue_vue_type_script_setup_true_lang.js +78 -0
  91. package/dist/components/UiEmptyState.css +1 -0
  92. package/dist/components/UiEmptyState.js +7 -0
  93. package/dist/components/UiEmptyState.vue.d.ts +15 -0
  94. package/dist/components/UiEmptyState.vue_vue_type_script_setup_true_lang.js +10 -0
  95. package/dist/components/UiFieldHint.css +1 -0
  96. package/dist/components/UiFieldHint.js +7 -0
  97. package/dist/components/UiFieldHint.vue_vue_type_script_setup_true_lang.js +24 -0
  98. package/dist/components/UiFileField.css +1 -0
  99. package/dist/components/UiFileField.js +7 -0
  100. package/dist/components/UiFileField.vue.d.ts +17 -0
  101. package/dist/components/UiFileField.vue_vue_type_script_setup_true_lang.js +55 -0
  102. package/dist/components/UiFormField.css +1 -0
  103. package/dist/components/UiFormField.js +7 -0
  104. package/dist/components/UiFormField.vue_vue_type_script_setup_true_lang.js +38 -0
  105. package/dist/components/UiInput.css +1 -0
  106. package/dist/components/UiInput.js +7 -0
  107. package/dist/components/UiInput.vue.d.ts +10 -0
  108. package/dist/components/UiInput.vue_vue_type_script_setup_true_lang.js +20 -0
  109. package/dist/components/UiLiveStatus.css +1 -0
  110. package/dist/components/UiLiveStatus.js +7 -0
  111. package/dist/components/UiLiveStatus.vue.d.ts +19 -0
  112. package/dist/components/UiLiveStatus.vue_vue_type_script_setup_true_lang.js +17 -0
  113. package/dist/components/UiMeter.css +1 -0
  114. package/dist/components/UiMeter.js +7 -0
  115. package/dist/components/UiMeter.vue.d.ts +11 -0
  116. package/dist/components/UiMeter.vue_vue_type_script_setup_true_lang.js +41 -0
  117. package/dist/components/UiNotice.css +1 -0
  118. package/dist/components/UiNotice.js +7 -0
  119. package/dist/components/UiNotice.vue.d.ts +16 -8
  120. package/dist/components/UiNotice.vue_vue_type_script_setup_true_lang.js +22 -0
  121. package/dist/components/UiPager.css +1 -0
  122. package/dist/components/UiPager.js +7 -0
  123. package/dist/components/UiPager.vue.d.ts +23 -0
  124. package/dist/components/UiPager.vue_vue_type_script_setup_true_lang.js +46 -0
  125. package/dist/components/UiPanel.css +1 -0
  126. package/dist/components/UiPanel.js +7 -0
  127. package/dist/components/UiPanel.vue_vue_type_script_setup_true_lang.js +21 -0
  128. package/dist/components/UiSegmentedControl.css +1 -0
  129. package/dist/components/UiSegmentedControl.js +7 -0
  130. package/dist/components/UiSegmentedControl.vue.d.ts +11 -1
  131. package/dist/components/UiSegmentedControl.vue_vue_type_script_setup_true_lang.js +57 -0
  132. package/dist/components/UiSelect.css +1 -0
  133. package/dist/components/UiSelect.js +7 -0
  134. package/dist/components/UiSelect.vue.d.ts +2 -1
  135. package/dist/components/UiSelect.vue_vue_type_script_setup_true_lang.js +19 -0
  136. package/dist/components/UiSelectField.js +5 -0
  137. package/dist/components/UiSelectField.vue.d.ts +29 -0
  138. package/dist/components/UiSelectField.vue_vue_type_script_setup_true_lang.js +58 -0
  139. package/dist/components/UiSkipLink.css +1 -0
  140. package/dist/components/UiSkipLink.js +7 -0
  141. package/dist/components/UiSkipLink.vue.d.ts +8 -0
  142. package/dist/components/UiSkipLink.vue_vue_type_script_setup_true_lang.js +14 -0
  143. package/dist/components/UiStatGrid.css +1 -0
  144. package/dist/components/UiStatGrid.js +7 -0
  145. package/dist/components/UiStatGrid.vue_vue_type_script_setup_true_lang.js +10 -0
  146. package/dist/components/UiStatRow.css +1 -0
  147. package/dist/components/UiStatRow.js +7 -0
  148. package/dist/components/UiStatRow.vue_vue_type_script_setup_true_lang.js +19 -0
  149. package/dist/components/UiStatusBar.css +1 -0
  150. package/dist/components/UiStatusBar.js +7 -0
  151. package/dist/components/UiStatusBar.vue_vue_type_script_setup_true_lang.js +45 -0
  152. package/dist/components/UiStatusDot.css +1 -0
  153. package/dist/components/UiStatusDot.js +7 -0
  154. package/dist/components/UiStatusDot.vue.d.ts +6 -2
  155. package/dist/components/UiStatusDot.vue_vue_type_script_setup_true_lang.js +26 -0
  156. package/dist/components/UiStepper.css +1 -0
  157. package/dist/components/UiStepper.js +7 -0
  158. package/dist/components/UiStepper.vue.d.ts +10 -2
  159. package/dist/components/UiStepper.vue_vue_type_script_setup_true_lang.js +55 -0
  160. package/dist/components/UiTabPanel.css +1 -0
  161. package/dist/components/UiTabPanel.js +7 -0
  162. package/dist/components/UiTabPanel.vue_vue_type_script_setup_true_lang.js +22 -0
  163. package/dist/components/UiTextField.js +5 -0
  164. package/dist/components/UiTextField.vue.d.ts +35 -0
  165. package/dist/components/UiTextField.vue_vue_type_script_setup_true_lang.js +59 -0
  166. package/dist/components/UiTextarea.css +1 -0
  167. package/dist/components/UiTextarea.js +7 -0
  168. package/dist/components/UiTextarea.vue.d.ts +10 -0
  169. package/dist/components/UiTextarea.vue_vue_type_script_setup_true_lang.js +19 -0
  170. package/dist/components/UiToolIntro.css +1 -0
  171. package/dist/components/UiToolIntro.js +7 -0
  172. package/dist/components/UiToolIntro.vue_vue_type_script_setup_true_lang.js +10 -0
  173. package/dist/components/UiToolbar.css +1 -0
  174. package/dist/components/UiToolbar.js +7 -0
  175. package/dist/components/UiToolbar.vue.d.ts +5 -2
  176. package/dist/components/UiToolbar.vue_vue_type_script_setup_true_lang.js +49 -0
  177. package/dist/components/UiToolbarButton.css +1 -0
  178. package/dist/components/UiToolbarButton.js +7 -0
  179. package/dist/components/UiToolbarButton.vue_vue_type_script_setup_true_lang.js +13 -0
  180. package/dist/composables/useColorMode.js +46 -0
  181. package/dist/composables/useNow.d.ts +6 -0
  182. package/dist/composables/useNow.js +12 -0
  183. package/dist/composables/usePager.d.ts +28 -0
  184. package/dist/composables/usePager.js +36 -0
  185. package/dist/composables/useSeason.js +8 -0
  186. package/dist/composables/useStatusSnapshot.d.ts +28 -0
  187. package/dist/composables/useStatusSnapshot.js +38 -0
  188. package/dist/index.d.ts +28 -8
  189. package/dist/index.js +58 -0
  190. package/dist/internal/panel.d.ts +8 -2
  191. package/dist/internal/panel.js +29 -0
  192. package/dist/reset.css +1 -0
  193. package/dist/runtime-config.js +73 -0
  194. package/dist/styles/reset.d.ts +1 -0
  195. package/dist/tabs.js +9 -0
  196. package/dist/theme-init.js +26 -0
  197. package/package.json +15 -11
  198. package/dist/explorer.d.ts +0 -13
  199. package/dist/safe-href.d.ts +0 -20
  200. package/dist/status.d.ts +0 -29
  201. package/dist/truncate.d.ts +0 -14
  202. package/dist/ui.js +0 -1086
@@ -0,0 +1,56 @@
1
+ import { createCommentVNode as e, createElementBlock as t, createElementVNode as n, createTextVNode as r, defineComponent as i, nextTick as a, onBeforeUnmount as o, onMounted as s, onUpdated as c, openBlock as l, ref as u, renderSlot as d, toDisplayString as f, useSlots as p } from "vue";
2
+ //#region src/components/UiDataTable.vue?vue&type=script&setup=true&lang.ts
3
+ var m = [
4
+ "role",
5
+ "aria-label",
6
+ "tabindex"
7
+ ], h = { class: "mw-data-table" }, g = {
8
+ key: 0,
9
+ class: "mw-visually-hidden"
10
+ }, _ = { key: 1 }, v = {
11
+ key: 0,
12
+ class: "mw-data-table__empty"
13
+ }, y = {
14
+ key: 1,
15
+ class: "mw-data-table__hint"
16
+ }, b = /*@__PURE__*/ i({
17
+ __name: "UiDataTable",
18
+ props: {
19
+ empty: {},
20
+ rows: {},
21
+ caption: {}
22
+ },
23
+ setup(i) {
24
+ let b = i, x = p(), S = u(null), C = u(!1), w = null;
25
+ function T() {
26
+ let e = S.value;
27
+ e && (C.value = e.scrollWidth > e.clientWidth + 1);
28
+ }
29
+ s(() => {
30
+ if (T(), typeof ResizeObserver < "u" && S.value) {
31
+ w = new ResizeObserver(T), w.observe(S.value);
32
+ let e = S.value.querySelector("table");
33
+ e && w.observe(e);
34
+ }
35
+ }), c(() => void a(T)), o(() => w?.disconnect());
36
+ let E = () => b.rows === void 0 ? !x.default : b.rows === 0;
37
+ return (a, o) => (l(), t("div", {
38
+ ref_key: "wrap",
39
+ ref: S,
40
+ class: "mw-data-table-wrap",
41
+ role: C.value ? "region" : void 0,
42
+ "aria-label": C.value ? i.caption ?? "Table" : void 0,
43
+ tabindex: C.value ? 0 : void 0
44
+ }, [
45
+ n("table", h, [
46
+ i.caption || a.$slots.caption ? (l(), t("caption", g, [d(a.$slots, "caption", {}, () => [r(f(i.caption), 1)], !0)])) : e("", !0),
47
+ n("thead", null, [n("tr", null, [d(a.$slots, "head", {}, void 0, !0)])]),
48
+ E() ? e("", !0) : (l(), t("tbody", _, [d(a.$slots, "default", {}, void 0, !0)]))
49
+ ]),
50
+ E() && i.empty ? (l(), t("p", v, f(i.empty), 1)) : e("", !0),
51
+ C.value ? (l(), t("small", y, "Scroll sideways to see more columns.")) : e("", !0)
52
+ ], 8, m));
53
+ }
54
+ });
55
+ //#endregion
56
+ export { b as default };
@@ -0,0 +1,5 @@
1
+ import e from "./UiDateTimeField.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/components/UiDateTimeField.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,18 @@
1
+ type __VLS_Props = {
2
+ id: string;
3
+ label: string;
4
+ zone: string;
5
+ hint?: string;
6
+ error?: string | null;
7
+ };
8
+ type __VLS_ModelProps = {
9
+ modelValue?: string | null;
10
+ };
11
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
12
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ "update:modelValue": (value: string | null) => any;
14
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
15
+ "onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
16
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const _default: typeof __VLS_export;
18
+ export default _default;
@@ -0,0 +1,51 @@
1
+ import e from "./UiFormField.js";
2
+ import t from "./UiInput.js";
3
+ import { computed as n, createBlock as r, createVNode as i, defineComponent as a, mergeModels as o, mergeProps as s, openBlock as c, useModel as l, withCtx as u } from "vue";
4
+ import { fromLocalInput as d, toLocalInput as f } from "@meddleware/web-utils";
5
+ //#region src/components/UiDateTimeField.vue?vue&type=script&setup=true&lang.ts
6
+ var p = /*@__PURE__*/ a({
7
+ inheritAttrs: !1,
8
+ __name: "UiDateTimeField",
9
+ props: /*@__PURE__*/ o({
10
+ id: {},
11
+ label: {},
12
+ zone: {},
13
+ hint: {},
14
+ error: {}
15
+ }, {
16
+ modelValue: { default: null },
17
+ modelModifiers: {}
18
+ }),
19
+ emits: ["update:modelValue"],
20
+ setup(a) {
21
+ let o = l(a, "modelValue"), p = a, m = n({
22
+ get: () => f(o.value, p.zone),
23
+ set: (e) => {
24
+ let t = String(e ?? "");
25
+ o.value = t === "" ? null : d(t, p.zone);
26
+ }
27
+ });
28
+ return (n, o) => (c(), r(e, {
29
+ id: a.id,
30
+ label: `${a.label} (${a.zone})`,
31
+ hint: a.hint,
32
+ error: a.error
33
+ }, {
34
+ default: u(({ attrs: e }) => [i(t, s({
35
+ modelValue: m.value,
36
+ "onUpdate:modelValue": o[0] ||= (e) => m.value = e
37
+ }, {
38
+ ...e,
39
+ ...n.$attrs
40
+ }, { type: "datetime-local" }), null, 16, ["modelValue"])]),
41
+ _: 1
42
+ }, 8, [
43
+ "id",
44
+ "label",
45
+ "hint",
46
+ "error"
47
+ ]));
48
+ }
49
+ });
50
+ //#endregion
51
+ export { p as default };
@@ -0,0 +1 @@
1
+ @layer mw.reset;@layer mw.components{.mw-dialog[data-v-f8a5c8ff]{--_width:var(--v532f060d);width:var(--_width);border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);max-height:90dvh;color:var(--text);box-shadow:var(--shadow-3);padding:0}.mw-dialog[data-v-f8a5c8ff]::backdrop{background:var(--backdrop);-webkit-backdrop-filter:blur(var(--space-4xs));backdrop-filter:blur(var(--space-4xs))}.mw-dialog__content[data-v-f8a5c8ff]{gap:var(--space-sm);padding:var(--space-md);flex-direction:column;display:flex}.mw-dialog__header[data-v-f8a5c8ff]{justify-content:space-between;align-items:center;gap:var(--space-sm);display:flex}.mw-dialog__title[data-v-f8a5c8ff]{font-size:var(--font-size-base);font-weight:var(--font-weight-semibold);margin:0}.mw-dialog__close[data-v-f8a5c8ff]{padding:0 var(--space-3xs);border-radius:var(--radius);color:var(--muted);font-size:var(--font-size-xl);cursor:pointer;background:0 0;border:0;line-height:1}.mw-dialog__close[data-v-f8a5c8ff]:hover{color:var(--text)}.mw-dialog__actions[data-v-f8a5c8ff]{justify-content:flex-end;gap:var(--space-xs);flex-wrap:wrap;display:flex}}
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./UiDialog.vue_vue_type_script_setup_true_lang.js";
3
+ import "./UiDialog.css";
4
+ //#region src/components/UiDialog.vue
5
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-f8a5c8ff"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -5,23 +5,25 @@ type __VLS_Props = {
5
5
  dismissible?: boolean;
6
6
  /** Accessible label for the header close button. */
7
7
  closeLabel?: string;
8
- /** CSS width of the dialog (default `min(420px, 90vw)`). */
8
+ /** CSS width of the dialog (default: the narrow content width, `--mw-content-narrow`, capped at 90vw). */
9
9
  width?: string;
10
+ /** Heading rank (default 2), to fit the page's outline. */
11
+ level?: 2 | 3 | 4 | 5 | 6;
10
12
  };
11
13
  declare function close(returnValue?: string): void;
12
14
  type __VLS_ModelProps = {
13
15
  'open'?: boolean;
14
16
  };
15
17
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
16
- declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {
18
+ declare var __VLS_7: {}, __VLS_9: {}, __VLS_11: {
17
19
  close: typeof close;
18
20
  };
19
21
  type __VLS_Slots = {} & {
20
- title?: (props: typeof __VLS_1) => any;
22
+ title?: (props: typeof __VLS_7) => any;
21
23
  } & {
22
- default?: (props: typeof __VLS_3) => any;
24
+ default?: (props: typeof __VLS_9) => any;
23
25
  } & {
24
- actions?: (props: typeof __VLS_5) => any;
26
+ actions?: (props: typeof __VLS_11) => any;
25
27
  };
26
28
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
27
29
  close: typeof close;
@@ -32,6 +34,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
32
34
  onClose?: ((returnValue: string) => any) | undefined;
33
35
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
34
36
  }>, {
37
+ level: 2 | 3 | 4 | 5 | 6;
35
38
  dismissible: boolean;
36
39
  closeLabel: string;
37
40
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,78 @@
1
+ import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, defineComponent as o, mergeModels as s, onBeforeUnmount as c, onMounted as l, openBlock as u, ref as d, renderSlot as f, resolveDynamicComponent as p, toDisplayString as m, unref as h, useCssVars as g, useId as _, useModel as v, watch as y, withCtx as b } from "vue";
2
+ //#region src/components/UiDialog.vue?vue&type=script&setup=true&lang.ts
3
+ var x = ["aria-labelledby"], S = { class: "mw-dialog__content" }, C = { class: "mw-dialog__header" }, w = ["aria-label"], T = {
4
+ key: 0,
5
+ class: "mw-dialog__actions"
6
+ }, E = /*@__PURE__*/ o({
7
+ __name: "UiDialog",
8
+ props: /*@__PURE__*/ s({
9
+ title: {},
10
+ dismissible: {
11
+ type: Boolean,
12
+ default: !0
13
+ },
14
+ closeLabel: { default: "Close" },
15
+ width: {},
16
+ level: { default: 2 }
17
+ }, {
18
+ open: {
19
+ type: Boolean,
20
+ default: !1
21
+ },
22
+ openModifiers: {}
23
+ }),
24
+ emits: /*@__PURE__*/ s(["close"], ["update:open"]),
25
+ setup(o, { expose: s, emit: E }) {
26
+ g((e) => ({ v532f060d: M.value }));
27
+ let D = v(o, "open"), O = o, k = E, A = d(null), j = _(), M = e(() => O.width ?? "min(var(--mw-content-narrow), 90vw)"), N = typeof HTMLDialogElement < "u" && "closedBy" in HTMLDialogElement.prototype;
28
+ function P(e = "") {
29
+ A.value?.open && A.value.close(e);
30
+ }
31
+ function F(e) {
32
+ let t = A.value;
33
+ t && (e && !t.open ? t.showModal() : !e && t.open && t.close());
34
+ }
35
+ function I() {
36
+ A.value?.setAttribute("closedby", O.dismissible ? "any" : "none");
37
+ }
38
+ function L(e) {
39
+ O.dismissible && e.target === A.value && P();
40
+ }
41
+ function R(e) {
42
+ O.dismissible || e.preventDefault();
43
+ }
44
+ function z() {
45
+ D.value = !1, k("close", A.value?.returnValue ?? "");
46
+ }
47
+ return l(() => {
48
+ I(), N || A.value?.addEventListener("click", L), F(D.value);
49
+ }), c(() => {
50
+ A.value?.removeEventListener("click", L);
51
+ }), y(D, F, { flush: "post" }), y(() => O.dismissible, I), s({ close: P }), (e, s) => (u(), r("dialog", {
52
+ ref_key: "el",
53
+ ref: A,
54
+ class: "mw-dialog",
55
+ "aria-labelledby": h(j),
56
+ onCancel: R,
57
+ onClose: z
58
+ }, [i("article", S, [
59
+ i("header", C, [(u(), t(p(`h${o.level}`), {
60
+ id: h(j),
61
+ class: "mw-dialog__title"
62
+ }, {
63
+ default: b(() => [f(e.$slots, "title", {}, () => [a(m(o.title), 1)], !0)]),
64
+ _: 3
65
+ }, 8, ["id"])), o.dismissible ? (u(), r("button", {
66
+ key: 0,
67
+ type: "button",
68
+ class: "mw-dialog__close",
69
+ "aria-label": o.closeLabel,
70
+ onClick: s[0] ||= (e) => P()
71
+ }, "×", 8, w)) : n("", !0)]),
72
+ f(e.$slots, "default", {}, void 0, !0),
73
+ e.$slots.actions ? (u(), r("footer", T, [f(e.$slots, "actions", { close: P }, void 0, !0)])) : n("", !0)
74
+ ])], 40, x));
75
+ }
76
+ });
77
+ //#endregion
78
+ export { E as default };
@@ -0,0 +1 @@
1
+ @layer mw.reset;@layer mw.components{.mw-empty[data-v-8463293a]{align-items:center;gap:var(--space-xs);padding:var(--space-md) var(--space-sm);text-align:center;flex-direction:column;display:flex}.mw-empty__text[data-v-8463293a]{color:var(--muted);margin:0}}
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./UiEmptyState.vue_vue_type_script_setup_true_lang.js";
3
+ import "./UiEmptyState.css";
4
+ //#region src/components/UiEmptyState.vue
5
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-8463293a"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,15 @@
1
+ declare var __VLS_1: {}, __VLS_3: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ } & {
5
+ action?: (props: typeof __VLS_3) => any;
6
+ };
7
+ declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
8
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
9
+ declare const _default: typeof __VLS_export;
10
+ export default _default;
11
+ type __VLS_WithSlots<T, S> = T & {
12
+ new (): {
13
+ $slots: S;
14
+ };
15
+ };
@@ -0,0 +1,10 @@
1
+ import { createElementBlock as e, createElementVNode as t, defineComponent as n, openBlock as r, renderSlot as i } from "vue";
2
+ //#region src/components/UiEmptyState.vue?vue&type=script&setup=true&lang.ts
3
+ var a = { class: "mw-empty" }, o = { class: "mw-empty__text" }, s = /*@__PURE__*/ n({
4
+ __name: "UiEmptyState",
5
+ setup(n) {
6
+ return (n, s) => (r(), e("div", a, [t("p", o, [i(n.$slots, "default", {}, void 0, !0)]), i(n.$slots, "action", {}, void 0, !0)]));
7
+ }
8
+ });
9
+ //#endregion
10
+ export { s as default };
@@ -0,0 +1 @@
1
+ @layer mw.reset;@layer mw.components{.mw-field-hint[data-v-4390802c]{vertical-align:middle;margin-inline-start:var(--space-3xs);display:inline-block;position:relative}.mw-field-hint__btn[data-v-4390802c]{inline-size:calc(var(--space-sm) + var(--space-3xs));block-size:calc(var(--space-sm) + var(--space-3xs));font-size:var(--font-size-sm);font-weight:var(--font-weight-bold);border:1px solid var(--muted);color:var(--muted);cursor:help;background:0 0;border-radius:50%;justify-content:center;align-items:center;padding:0;font-family:inherit;line-height:1;display:inline-flex}.mw-field-hint__btn[data-v-4390802c]:focus-visible{outline:2px solid var(--focus-ring);outline-offset:1px}.mw-field-hint__tip[data-v-4390802c]{top:calc(100% + var(--space-3xs));z-index:var(--z-popover);min-width:calc(var(--mw-content-narrow) / 2);max-width:min(var(--mw-content-narrow), 90vw);padding:var(--space-2xs) var(--space-xs);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);font-size:var(--font-size-sm);font-weight:var(--font-weight-regular);line-height:var(--leading-normal);color:var(--text);box-shadow:var(--shadow-2);display:none;position:absolute;left:0}.mw-field-hint:hover .mw-field-hint__tip[data-v-4390802c],.mw-field-hint:focus-within .mw-field-hint__tip[data-v-4390802c]{display:block}}
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./UiFieldHint.vue_vue_type_script_setup_true_lang.js";
3
+ import "./UiFieldHint.css";
4
+ //#region src/components/UiFieldHint.vue
5
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-4390802c"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,24 @@
1
+ import { createElementBlock as e, createElementVNode as t, defineComponent as n, openBlock as r, renderSlot as i } from "vue";
2
+ //#region src/components/UiFieldHint.vue?vue&type=script&setup=true&lang.ts
3
+ var a = { class: "mw-field-hint" }, o = ["aria-describedby"], s = ["id"], c = /*@__PURE__*/ n({
4
+ __name: "UiFieldHint",
5
+ props: { fieldId: {} },
6
+ setup(n) {
7
+ function c(e) {
8
+ e.key === "Escape" && e.currentTarget.blur();
9
+ }
10
+ return (l, u) => (r(), e("span", a, [t("button", {
11
+ type: "button",
12
+ class: "mw-field-hint__btn",
13
+ "aria-describedby": `${n.fieldId}-hint`,
14
+ "aria-label": "Help",
15
+ onKeydown: c
16
+ }, "?", 40, o), t("span", {
17
+ id: `${n.fieldId}-hint`,
18
+ role: "tooltip",
19
+ class: "mw-field-hint__tip"
20
+ }, [i(l.$slots, "default", {}, void 0, !0)], 8, s)]));
21
+ }
22
+ });
23
+ //#endregion
24
+ export { c as default };
@@ -0,0 +1 @@
1
+ @layer mw.reset;@layer mw.components{.mw-file[data-v-fa50dd32]{max-width:100%;color:var(--text);font:inherit}.mw-file[data-v-fa50dd32]::file-selector-button{padding:var(--space-2xs) var(--space-xs);border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);color:var(--text);font:inherit;cursor:pointer;margin-inline-end:var(--space-xs)}.mw-file[data-v-fa50dd32]:disabled{filter:grayscale(.6);cursor:not-allowed}}
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./UiFileField.vue_vue_type_script_setup_true_lang.js";
3
+ import "./UiFileField.css";
4
+ //#region src/components/UiFileField.vue
5
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-fa50dd32"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,17 @@
1
+ type __VLS_Props = {
2
+ id: string;
3
+ label: string;
4
+ hint?: string;
5
+ error?: string | null;
6
+ /** The input's `accept` filter (media types or extensions). */
7
+ accept?: string;
8
+ disabled?: boolean;
9
+ required?: boolean;
10
+ };
11
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
+ select: (file: File | null) => any;
13
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
14
+ onSelect?: ((file: File | null) => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
@@ -0,0 +1,55 @@
1
+ import e from "./UiFormField.js";
2
+ import { createBlock as t, createElementVNode as n, defineComponent as r, openBlock as i, withCtx as a } from "vue";
3
+ //#region src/components/UiFileField.vue?vue&type=script&setup=true&lang.ts
4
+ var o = [
5
+ "id",
6
+ "accept",
7
+ "disabled",
8
+ "required",
9
+ "aria-invalid",
10
+ "aria-describedby"
11
+ ], s = /*@__PURE__*/ r({
12
+ __name: "UiFileField",
13
+ props: {
14
+ id: {},
15
+ label: {},
16
+ hint: {},
17
+ error: {},
18
+ accept: {},
19
+ disabled: { type: Boolean },
20
+ required: { type: Boolean }
21
+ },
22
+ emits: ["select"],
23
+ setup(r, { emit: s }) {
24
+ let c = s;
25
+ function l(e) {
26
+ c("select", e.target.files?.[0] ?? null);
27
+ }
28
+ return (s, c) => (i(), t(e, {
29
+ id: r.id,
30
+ label: r.label,
31
+ hint: r.hint,
32
+ error: r.error
33
+ }, {
34
+ default: a(({ attrs: e }) => [n("input", {
35
+ id: e.id,
36
+ type: "file",
37
+ class: "mw-file",
38
+ accept: r.accept,
39
+ disabled: r.disabled,
40
+ required: r.required,
41
+ "aria-invalid": e["aria-invalid"],
42
+ "aria-describedby": e["aria-describedby"],
43
+ onChange: l
44
+ }, null, 40, o)]),
45
+ _: 1
46
+ }, 8, [
47
+ "id",
48
+ "label",
49
+ "hint",
50
+ "error"
51
+ ]));
52
+ }
53
+ });
54
+ //#endregion
55
+ export { s as default };
@@ -0,0 +1 @@
1
+ @layer mw.reset;@layer mw.components{.mw-form-field[data-v-0256284b]{margin:0}.mw-form-field__label[data-v-0256284b]{font-weight:var(--font-weight-semibold);margin:var(--space-xs) 0 var(--space-3xs);display:inline-block}.mw-form-field :is(input[data-v-0256284b-s],select[data-v-0256284b-s],textarea[data-v-0256284b-s]){display:block}.mw-form-field__hint[data-v-0256284b],.mw-form-field__error[data-v-0256284b]{margin:var(--space-3xs) 0 0;font-size:var(--font-size-sm);display:block}.mw-form-field__hint[data-v-0256284b]{color:var(--muted);font-weight:var(--font-weight-regular)}.mw-form-field__error[data-v-0256284b]{color:var(--danger)}}
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./UiFormField.vue_vue_type_script_setup_true_lang.js";
3
+ import "./UiFormField.css";
4
+ //#region src/components/UiFormField.vue
5
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-0256284b"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,38 @@
1
+ import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, defineComponent as i, openBlock as a, renderSlot as o, toDisplayString as s } from "vue";
2
+ //#region src/components/UiFormField.vue?vue&type=script&setup=true&lang.ts
3
+ var c = { class: "mw-form-field" }, l = ["for"], u = ["id"], d = ["id"], f = /*@__PURE__*/ i({
4
+ __name: "UiFormField",
5
+ props: {
6
+ id: {},
7
+ label: {},
8
+ error: {},
9
+ hint: {}
10
+ },
11
+ setup(i) {
12
+ let f = i, p = e(() => `${f.id}-err`), m = e(() => `${f.id}-hint-text`), h = e(() => ({
13
+ id: f.id,
14
+ "aria-invalid": f.error ? !0 : void 0,
15
+ "aria-describedby": f.error ? p.value : f.hint ? m.value : void 0
16
+ }));
17
+ return (e, f) => (a(), n("p", c, [
18
+ r("label", {
19
+ for: i.id,
20
+ class: "mw-form-field__label"
21
+ }, s(i.label), 9, l),
22
+ o(e.$slots, "label-suffix"),
23
+ o(e.$slots, "default", { attrs: h.value }),
24
+ i.hint && !i.error ? (a(), n("small", {
25
+ key: 0,
26
+ id: m.value,
27
+ class: "mw-form-field__hint"
28
+ }, s(i.hint), 9, u)) : t("", !0),
29
+ i.error ? (a(), n("small", {
30
+ key: 1,
31
+ id: p.value,
32
+ class: "mw-form-field__error"
33
+ }, s(i.error), 9, d)) : t("", !0)
34
+ ]));
35
+ }
36
+ });
37
+ //#endregion
38
+ export { f as default };
@@ -0,0 +1 @@
1
+ @layer mw.reset;@layer mw.components{.mw-input[data-v-de27599b]{width:100%;padding:var(--space-2xs) var(--space-xs);background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:var(--radius);font:inherit}.mw-input[data-v-de27599b]::placeholder{color:var(--muted)}.mw-input[data-v-de27599b]:is(:focus-visible,:focus-within){outline:2px solid var(--focus-ring);outline-offset:1px}.mw-input[aria-invalid=true][data-v-de27599b]{border-color:var(--danger)}.mw-input[data-v-de27599b]:disabled{filter:grayscale(.6);cursor:not-allowed}}
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./UiInput.vue_vue_type_script_setup_true_lang.js";
3
+ import "./UiInput.css";
4
+ //#region src/components/UiInput.vue
5
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-de27599b"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,10 @@
1
+ type __VLS_ModelProps = {
2
+ modelValue?: string | number;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
+ "update:modelValue": (value: string | number | undefined) => any;
6
+ }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
7
+ "onUpdate:modelValue"?: ((value: string | number | undefined) => any) | undefined;
8
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const _default: typeof __VLS_export;
10
+ export default _default;
@@ -0,0 +1,20 @@
1
+ import { createElementBlock as e, defineComponent as t, openBlock as n, useModel as r, vModelText as i, withDirectives as a } from "vue";
2
+ //#region src/components/UiInput.vue?vue&type=script&setup=true&lang.ts
3
+ var o = /*@__PURE__*/ t({
4
+ __name: "UiInput",
5
+ props: {
6
+ modelValue: {},
7
+ modelModifiers: {}
8
+ },
9
+ emits: ["update:modelValue"],
10
+ setup(t) {
11
+ let o = r(t, "modelValue");
12
+ return (t, r) => a((n(), e("input", {
13
+ "onUpdate:modelValue": r[0] ||= (e) => o.value = e,
14
+ type: "text",
15
+ class: "mw-input"
16
+ }, null, 512)), [[i, o.value]]);
17
+ }
18
+ });
19
+ //#endregion
20
+ export { o as default };
@@ -0,0 +1 @@
1
+ @layer mw.reset;@layer mw.components{.mw-live[data-v-83076271]{color:var(--muted);font-size:var(--font-size-sm);display:block}.mw-live[data-v-83076271]:empty{display:none}}
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./UiLiveStatus.vue_vue_type_script_setup_true_lang.js";
3
+ import "./UiLiveStatus.css";
4
+ //#region src/components/UiLiveStatus.vue
5
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-83076271"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,19 @@
1
+ type __VLS_Props = {
2
+ message?: string; /** Names the region for assistive technology. */
3
+ label?: string;
4
+ };
5
+ declare var __VLS_1: {};
6
+ type __VLS_Slots = {} & {
7
+ default?: (props: typeof __VLS_1) => any;
8
+ };
9
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
10
+ label: string;
11
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
15
+ type __VLS_WithSlots<T, S> = T & {
16
+ new (): {
17
+ $slots: S;
18
+ };
19
+ };
@@ -0,0 +1,17 @@
1
+ import { createElementBlock as e, createTextVNode as t, defineComponent as n, openBlock as r, renderSlot as i, toDisplayString as a } from "vue";
2
+ //#region src/components/UiLiveStatus.vue?vue&type=script&setup=true&lang.ts
3
+ var o = ["aria-label"], s = /*@__PURE__*/ n({
4
+ __name: "UiLiveStatus",
5
+ props: {
6
+ message: {},
7
+ label: { default: "Status" }
8
+ },
9
+ setup(n) {
10
+ return (s, c) => (r(), e("output", {
11
+ class: "mw-live",
12
+ "aria-label": n.label
13
+ }, [i(s.$slots, "default", {}, () => [t(a(n.message), 1)], !0)], 8, o));
14
+ }
15
+ });
16
+ //#endregion
17
+ export { s as default };
@@ -0,0 +1 @@
1
+ @layer mw.reset;@layer mw.components{.mw-meter[data-v-3580c9b7]{gap:var(--space-xs);flex-wrap:wrap;align-items:center;display:flex}.mw-meter__label[data-v-3580c9b7]{font-weight:var(--font-weight-semibold)}.mw-meter__text[data-v-3580c9b7]{font-size:var(--font-size-sm);color:var(--muted)}.mw-meter__text--over[data-v-3580c9b7]{color:var(--danger);font-weight:var(--font-weight-semibold)}.mw-meter__bar[data-v-3580c9b7]{width:10rem;height:var(--space-xs);appearance:none;background:var(--lift);border:1px solid var(--border);border-radius:var(--radius-xs)}.mw-meter__bar[data-v-3580c9b7]::-webkit-meter-bar{background:var(--lift);border-radius:var(--radius-xs);border:0}.mw-meter__bar[data-v-3580c9b7]::-webkit-meter-optimum-value{background:var(--ok)}.mw-meter__bar[data-v-3580c9b7]::-webkit-meter-suboptimum-value{background:var(--warning-text)}.mw-meter__bar[data-v-3580c9b7]::-webkit-meter-even-less-good-value{background:var(--danger)}.mw-meter__bar[data-v-3580c9b7]:-moz-meter-optimum::-moz-meter-bar{background:var(--ok)}.mw-meter__bar[data-v-3580c9b7]:-moz-meter-sub-optimum::-moz-meter-bar{background:var(--warning-text)}.mw-meter__bar[data-v-3580c9b7]:-moz-meter-sub-sub-optimum::-moz-meter-bar{background:var(--danger)}}
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./UiMeter.vue_vue_type_script_setup_true_lang.js";
3
+ import "./UiMeter.css";
4
+ //#region src/components/UiMeter.vue
5
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-3580c9b7"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,11 @@
1
+ type __VLS_Props = {
2
+ label: string;
3
+ used: number;
4
+ limit: number | null;
5
+ unit?: string;
6
+ /** Format the numbers (default: as integers). */
7
+ format?: (n: number) => string;
8
+ };
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1,41 @@
1
+ import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, defineComponent as i, normalizeClass as a, openBlock as o, toDisplayString as s, unref as c, useId as l } from "vue";
2
+ //#region src/components/UiMeter.vue?vue&type=script&setup=true&lang.ts
3
+ var u = { class: "mw-meter" }, d = ["for"], f = [
4
+ "id",
5
+ "value",
6
+ "max",
7
+ "low",
8
+ "high"
9
+ ], p = /*@__PURE__*/ i({
10
+ __name: "UiMeter",
11
+ props: {
12
+ label: {},
13
+ used: {},
14
+ limit: {},
15
+ unit: {},
16
+ format: { type: Function }
17
+ },
18
+ setup(i) {
19
+ let p = i, m = l(), h = (e) => p.format ? p.format(e) : String(e), g = e(() => Math.max(p.limit ?? 0, 1)), _ = e(() => p.limit !== null && p.used > p.limit), v = e(() => p.limit === null ? "no limit" : _.value ? `over by ${h(p.used - p.limit)}` : p.limit > 0 && p.used / p.limit >= .8 ? "close to the limit" : "within the limit"), y = e(() => `${h(p.used)}${p.limit === null ? "" : ` / ${h(p.limit)}`}${p.unit ? ` ${p.unit}` : ""} — ${v.value}`);
20
+ return (e, l) => (o(), n("div", u, [
21
+ r("label", {
22
+ for: c(m),
23
+ class: "mw-meter__label"
24
+ }, s(i.label), 9, d),
25
+ i.limit === null ? t("", !0) : (o(), n("meter", {
26
+ key: 0,
27
+ id: c(m),
28
+ class: "mw-meter__bar",
29
+ value: Math.min(i.used, g.value),
30
+ min: "0",
31
+ max: g.value,
32
+ low: g.value * .5,
33
+ high: g.value * .8,
34
+ optimum: "0"
35
+ }, s(h(i.used)) + " of " + s(h(i.limit)), 9, f)),
36
+ r("span", { class: a(["mw-meter__text", { "mw-meter__text--over": _.value }]) }, s(y.value), 3)
37
+ ]));
38
+ }
39
+ });
40
+ //#endregion
41
+ export { p as default };