@meddleware/ui 0.1.45 → 0.1.47

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 (143) hide show
  1. package/README.md +69 -8
  2. package/dist/base.css +47 -46
  3. package/dist/brand/mark.d.ts +2 -0
  4. package/dist/components/AppFooter.css +1 -1
  5. package/dist/components/AppFooter.js +1 -1
  6. package/dist/components/AppHeader.css +1 -1
  7. package/dist/components/AppHeader.js +1 -1
  8. package/dist/components/AppSidebar.css +1 -1
  9. package/dist/components/AppSidebar.js +1 -1
  10. package/dist/components/AppSidebar.vue_vue_type_script_setup_true_lang.js +1 -1
  11. package/dist/components/AppTabNav.css +1 -1
  12. package/dist/components/AppTabNav.js +1 -1
  13. package/dist/components/AppTabNav.vue.d.ts +7 -0
  14. package/dist/components/BrandMark.css +1 -1
  15. package/dist/components/BrandMark.js +1 -1
  16. package/dist/components/ColorModeControl.css +1 -1
  17. package/dist/components/ColorModeControl.js +1 -1
  18. package/dist/components/CopyableAddress.css +1 -1
  19. package/dist/components/CopyableAddress.js +1 -1
  20. package/dist/components/CopyrightLine.css +1 -1
  21. package/dist/components/CopyrightLine.js +1 -1
  22. package/dist/components/CopyrightLine.vue.d.ts +6 -0
  23. package/dist/components/ExplorerLink.css +1 -1
  24. package/dist/components/ExplorerLink.js +1 -1
  25. package/dist/components/SidebarItem.css +1 -1
  26. package/dist/components/SidebarItem.js +1 -1
  27. package/dist/components/SidebarItem.vue.d.ts +3 -0
  28. package/dist/components/StatusWidget.css +1 -1
  29. package/dist/components/StatusWidget.js +1 -1
  30. package/dist/components/UiActivityFeed.css +1 -1
  31. package/dist/components/UiActivityFeed.js +1 -1
  32. package/dist/components/UiActivityItem.css +1 -1
  33. package/dist/components/UiActivityItem.js +1 -1
  34. package/dist/components/UiActivityItem.vue.d.ts +3 -0
  35. package/dist/components/UiAmount.css +1 -1
  36. package/dist/components/UiAmount.js +1 -1
  37. package/dist/components/UiAmount.vue.d.ts +2 -0
  38. package/dist/components/UiAppShell.css +1 -1
  39. package/dist/components/UiAppShell.js +1 -1
  40. package/dist/components/UiAppShell.vue.d.ts +2 -0
  41. package/dist/components/UiBadge.css +1 -1
  42. package/dist/components/UiBadge.js +1 -1
  43. package/dist/components/UiBadge.vue.d.ts +1 -0
  44. package/dist/components/UiButton.css +1 -1
  45. package/dist/components/UiButton.js +1 -1
  46. package/dist/components/UiCard.css +1 -1
  47. package/dist/components/UiCard.js +1 -1
  48. package/dist/components/UiCheckField.css +1 -1
  49. package/dist/components/UiCheckField.js +1 -1
  50. package/dist/components/UiCheckField.vue.d.ts +4 -0
  51. package/dist/components/UiCodeBlock.css +1 -1
  52. package/dist/components/UiCodeBlock.js +1 -1
  53. package/dist/components/UiCodeBlock.vue.d.ts +3 -0
  54. package/dist/components/UiCopyButton.css +1 -1
  55. package/dist/components/UiCopyButton.js +1 -1
  56. package/dist/components/UiDataTable.css +1 -1
  57. package/dist/components/UiDataTable.js +1 -1
  58. package/dist/components/UiDataTable.vue.d.ts +4 -0
  59. package/dist/components/UiDateTimeField.vue.d.ts +6 -0
  60. package/dist/components/UiDialog.css +1 -1
  61. package/dist/components/UiDialog.js +1 -1
  62. package/dist/components/UiDialog.vue.d.ts +5 -0
  63. package/dist/components/UiDialog.vue_vue_type_script_setup_true_lang.js +1 -1
  64. package/dist/components/UiEmptyState.css +1 -1
  65. package/dist/components/UiEmptyState.js +1 -1
  66. package/dist/components/UiFieldHint.css +1 -1
  67. package/dist/components/UiFieldHint.js +1 -1
  68. package/dist/components/UiFieldHint.vue.d.ts +1 -0
  69. package/dist/components/UiFileField.css +1 -1
  70. package/dist/components/UiFileField.js +1 -1
  71. package/dist/components/UiFileField.vue.d.ts +6 -0
  72. package/dist/components/UiFormField.css +1 -1
  73. package/dist/components/UiFormField.js +1 -1
  74. package/dist/components/UiFormField.vue.d.ts +4 -0
  75. package/dist/components/UiInput.css +1 -1
  76. package/dist/components/UiInput.js +1 -1
  77. package/dist/components/UiInput.vue.d.ts +1 -0
  78. package/dist/components/UiLiveStatus.css +1 -1
  79. package/dist/components/UiLiveStatus.js +1 -1
  80. package/dist/components/UiLiveStatus.vue.d.ts +3 -1
  81. package/dist/components/UiMeter.css +1 -1
  82. package/dist/components/UiMeter.js +1 -1
  83. package/dist/components/UiMeter.vue.d.ts +4 -0
  84. package/dist/components/UiNotice.css +1 -1
  85. package/dist/components/UiNotice.js +1 -1
  86. package/dist/components/UiPager.css +1 -1
  87. package/dist/components/UiPager.js +1 -1
  88. package/dist/components/UiPager.vue.d.ts +4 -0
  89. package/dist/components/UiPanel.css +1 -1
  90. package/dist/components/UiPanel.js +1 -1
  91. package/dist/components/UiPanel.vue.d.ts +2 -0
  92. package/dist/components/UiRoleGuide.css +1 -0
  93. package/dist/components/UiRoleGuide.js +7 -0
  94. package/dist/components/UiRoleGuide.vue.d.ts +36 -0
  95. package/dist/components/UiRoleGuide.vue_vue_type_script_setup_true_lang.js +75 -0
  96. package/dist/components/UiSegmentedControl.css +1 -1
  97. package/dist/components/UiSegmentedControl.js +1 -1
  98. package/dist/components/UiSegmentedControl.vue.d.ts +7 -0
  99. package/dist/components/UiSelect.css +1 -1
  100. package/dist/components/UiSelect.js +1 -1
  101. package/dist/components/UiSelect.vue.d.ts +1 -4
  102. package/dist/components/UiSelectField.vue.d.ts +7 -0
  103. package/dist/components/UiSkipLink.css +1 -1
  104. package/dist/components/UiSkipLink.js +1 -1
  105. package/dist/components/UiSkipLink.vue.d.ts +1 -0
  106. package/dist/components/UiStatGrid.css +1 -1
  107. package/dist/components/UiStatGrid.js +1 -1
  108. package/dist/components/UiStatRow.css +1 -1
  109. package/dist/components/UiStatRow.js +1 -1
  110. package/dist/components/UiStatRow.vue.d.ts +2 -0
  111. package/dist/components/UiStatusBar.css +1 -1
  112. package/dist/components/UiStatusBar.js +1 -1
  113. package/dist/components/UiStatusBar.vue.d.ts +4 -0
  114. package/dist/components/UiStatusDot.css +1 -1
  115. package/dist/components/UiStatusDot.js +1 -1
  116. package/dist/components/UiStatusDot.vue.d.ts +3 -0
  117. package/dist/components/UiStepper.css +1 -1
  118. package/dist/components/UiStepper.js +1 -1
  119. package/dist/components/UiStepper.vue.d.ts +6 -0
  120. package/dist/components/UiTabPanel.css +1 -1
  121. package/dist/components/UiTabPanel.js +1 -1
  122. package/dist/components/UiTabPanel.vue.d.ts +2 -0
  123. package/dist/components/UiTextField.vue.d.ts +6 -0
  124. package/dist/components/UiTextarea.css +1 -1
  125. package/dist/components/UiTextarea.js +1 -1
  126. package/dist/components/UiTextarea.vue.d.ts +1 -0
  127. package/dist/components/UiToolIntro.css +1 -1
  128. package/dist/components/UiToolIntro.js +1 -1
  129. package/dist/components/UiToolbar.css +1 -1
  130. package/dist/components/UiToolbar.js +1 -1
  131. package/dist/components/UiToolbar.vue.d.ts +7 -1
  132. package/dist/components/UiToolbarButton.css +1 -1
  133. package/dist/components/UiToolbarButton.js +1 -1
  134. package/dist/composables/usePager.d.ts +9 -0
  135. package/dist/composables/useSeason.d.ts +5 -1
  136. package/dist/composables/useStatusSnapshot.d.ts +2 -0
  137. package/dist/index.d.ts +2 -0
  138. package/dist/index.js +49 -48
  139. package/dist/internal/panel.d.ts +13 -0
  140. package/dist/internal/placeTip.d.ts +3 -0
  141. package/dist/runtime-config.d.ts +12 -1
  142. package/dist/tabs.d.ts +1 -0
  143. package/package.json +5 -5
@@ -1,21 +1,30 @@
1
1
  import { type Ref } from 'vue';
2
2
  /** A page of a keyset-paginated list: the items and an opaque cursor for the next page (absent or null on the last). */
3
3
  export interface PageOf<T> {
4
+ /** The rows on this page. */
4
5
  items: T[];
6
+ /** The cursor for the next page; absent or null on the last page. */
5
7
  next_cursor?: string | null;
6
8
  }
9
+ /** What `usePager` returns: reactive state and the four moves. */
7
10
  export interface Pager<T> {
11
+ /** The rows of the page being shown. */
8
12
  items: Ref<T[]>;
13
+ /** A page is being fetched. */
9
14
  loading: Ref<boolean>;
15
+ /** The last failure as a sentence for people, or null. */
10
16
  error: Ref<string | null>;
11
17
  /** Zero-based index of the page being shown. */
12
18
  index: Ref<number>;
19
+ /** Whether a next page exists. */
13
20
  hasNext: Ref<boolean>;
14
21
  /** Start again from the first page (after a filter changes). */
15
22
  reset: () => Promise<void>;
16
23
  /** Fetch the current page again. */
17
24
  reload: () => Promise<void>;
25
+ /** Go to the next page (does nothing on the last). */
18
26
  next: () => Promise<void>;
27
+ /** Go back one page (does nothing on the first). */
19
28
  prev: () => Promise<void>;
20
29
  }
21
30
  /**
@@ -1,2 +1,6 @@
1
- /** Maps calendar month to season name and sets data-season on <html>. Call once at app init. */
1
+ /**
2
+ * Map the calendar month to a season name and set `data-season` on <html>. Call once at app init.
3
+ * The seasons follow the northern-hemisphere meteorological calendar: spring March to May, summer June to August, autumn September to
4
+ * November, winter December to February.
5
+ */
2
6
  export declare function useSeason(): void;
@@ -2,6 +2,7 @@ import { type Ref } from 'vue';
2
2
  import { type StatusSnapshot } from '@meddleware/web-utils';
3
3
  /** The shortest poll interval honoured, so a tiny `intervalMs` cannot hammer the status endpoint. */
4
4
  export declare const MIN_STATUS_POLL_MS = 15000;
5
+ /** Options for {@link useStatusSnapshot}. */
5
6
  export interface UseStatusSnapshotOptions {
6
7
  /** URL of the `GET /api/status` endpoint. */
7
8
  url: string;
@@ -10,6 +11,7 @@ export interface UseStatusSnapshotOptions {
10
11
  /** Time allowed for one request, headers and body (default 10 000). */
11
12
  timeoutMs?: number;
12
13
  }
14
+ /** What {@link useStatusSnapshot} returns. */
13
15
  export interface StatusSnapshotState {
14
16
  /** The latest valid snapshot, kept across a failed poll (null until the first success). */
15
17
  snapshot: Ref<StatusSnapshot | null>;
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/UiSelect.js";
15
- import m from "./components/UiNotice.js";
16
- import h from "./components/SidebarItem.js";
17
- import g from "./components/SidebarGroup.js";
18
- import { tabIds as _ } from "./tabs.js";
19
- import v from "./components/AppTabNav.js";
20
- import y from "./components/UiTabPanel.js";
21
- import b from "./components/UiDialog.js";
22
- import x from "./components/UiCopyButton.js";
23
- import S from "./components/CopyableAddress.js";
24
- import C from "./components/ExplorerLink.js";
25
- import w from "./components/UiStepper.js";
26
- import T from "./components/UiSegmentedControl.js";
27
- import E from "./components/UiFieldHint.js";
28
- import D from "./components/UiFormField.js";
29
- import O from "./components/UiToolIntro.js";
30
- import k from "./components/UiInput.js";
31
- import A from "./components/UiTextarea.js";
32
- import j from "./components/UiFileField.js";
33
- import M from "./components/UiTextField.js";
34
- import N from "./components/UiSelectField.js";
35
- import P from "./components/UiCheckField.js";
36
- import F from "./components/UiDateTimeField.js";
37
- import I from "./components/UiMeter.js";
38
- import L from "./components/UiPager.js";
39
- import R from "./components/UiLiveStatus.js";
40
- import z from "./components/UiEmptyState.js";
41
- import B from "./components/UiCodeBlock.js";
42
- import V from "./components/UiAmount.js";
43
- import H from "./components/UiPanel.js";
44
- import U from "./components/UiBadge.js";
45
- import W from "./components/UiToolbarButton.js";
46
- import G from "./components/UiToolbar.js";
47
- import K from "./components/UiStatGrid.js";
48
- import q from "./components/UiStatRow.js";
49
- import J from "./components/UiDataTable.js";
50
- import { useNow as Y } from "./composables/useNow.js";
51
- import X from "./components/UiStatusDot.js";
52
- import Z from "./components/UiStatusBar.js";
53
- import Q from "./components/UiActivityFeed.js";
54
- import $ from "./components/UiActivityItem.js";
55
- import { MIN_STATUS_POLL_MS as ee, useStatusSnapshot as te } from "./composables/useStatusSnapshot.js";
56
- import ne from "./components/StatusWidget.js";
57
- import { useSeason as re } from "./composables/useSeason.js";
58
- import { usePager as ie } from "./composables/usePager.js";
59
- import { RUNTIME_CONFIG_PATH as ae, RUNTIME_ENDPOINT_KEYS as oe, loadRuntimeConfig as se, parseEndpoint as ce, parseRuntimeConfig as le, resetRuntimeConfigForTesting as ue, runtimeEndpoints as de, withRuntimeEnv as fe } from "./runtime-config.js";
60
- import { DEFAULT_TRUNCATE_CHARS as pe, STATUS_HEADLINE as me, STATUS_LABEL as he, isStatusLevel as ge, parseSnapshot as _e, safeHref as ve, safeIcon as ye, safePath as be, suiExplorerUrl as xe, truncateMiddle as Se, walruscanBlobUrl as Ce } from "@meddleware/web-utils";
61
- export { r as AppFooter, t as AppHeader, n as AppSidebar, v as AppTabNav, u as AppToolShell, i as BrandMark, a as ColorModeControl, S as CopyableAddress, o as CopyrightLine, pe as DEFAULT_TRUNCATE_CHARS, C as ExplorerLink, ee as MIN_STATUS_POLL_MS, ae as RUNTIME_CONFIG_PATH, oe as RUNTIME_ENDPOINT_KEYS, me as STATUS_HEADLINE, he as STATUS_LABEL, g as SidebarGroup, h as SidebarItem, ne as StatusWidget, Q as UiActivityFeed, $ as UiActivityItem, V as UiAmount, c as UiAppShell, U as UiBadge, d as UiButton, f as UiCard, P as UiCheckField, B as UiCodeBlock, x as UiCopyButton, J as UiDataTable, F as UiDateTimeField, b as UiDialog, z as UiEmptyState, E as UiFieldHint, j as UiFileField, D as UiFormField, k as UiInput, R as UiLiveStatus, I as UiMeter, m as UiNotice, L as UiPager, H as UiPanel, T as UiSegmentedControl, p as UiSelect, N as UiSelectField, s as UiSkipLink, K as UiStatGrid, q as UiStatRow, Z as UiStatusBar, X as UiStatusDot, w as UiStepper, y as UiTabPanel, M as UiTextField, A as UiTextarea, O as UiToolIntro, G as UiToolbar, W as UiToolbarButton, ge as isStatusLevel, se as loadRuntimeConfig, ce as parseEndpoint, le as parseRuntimeConfig, _e as parseSnapshot, ue as resetRuntimeConfigForTesting, de as runtimeEndpoints, ve as safeHref, ye as safeIcon, be as safePath, xe as suiExplorerUrl, _ as tabIds, Se as truncateMiddle, l as useColorMode, Y as useNow, ie as usePager, re as useSeason, te as useStatusSnapshot, e as useStickyOffset, Ce as walruscanBlobUrl, fe as withRuntimeEnv };
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 };
@@ -3,13 +3,21 @@ import { type Ref } from 'vue';
3
3
  export type PanelVariant = 'light' | 'dark' | 'transparent';
4
4
  /** Optional per-instance colour overrides (win over the token defaults). */
5
5
  export interface PanelColors {
6
+ /** Panel background. */
6
7
  bg?: string;
8
+ /** A raised surface on the panel. */
7
9
  surface?: string;
10
+ /** Body text colour. */
8
11
  text?: string;
12
+ /** Secondary text colour (must stay legible on `bg`). */
9
13
  muted?: string;
14
+ /** Divider and edge colour. */
10
15
  border?: string;
16
+ /** Success status colour legible on this panel. */
11
17
  ok?: string;
18
+ /** Danger status colour legible on this panel. */
12
19
  danger?: string;
20
+ /** Informational status colour legible on this panel. */
13
21
  info?: string;
14
22
  }
15
23
  /**
@@ -21,11 +29,16 @@ export interface PanelColors {
21
29
  * legible on that panel; the components re-scope `--ok`/`--danger`/`--info` to
22
30
  * them for their content. Transparent panels keep the page's status roles.
23
31
  * Any supplied `colors` override the defaults — token values are the default.
32
+ * @param variant - which panel scheme to resolve
33
+ * @param colors - optional per-instance overrides
34
+ * @returns the custom properties (name to value) for the panel's root element
24
35
  */
25
36
  export declare function panelVars(variant: PanelVariant, colors?: PanelColors): Record<string, string>;
26
37
  /**
27
38
  * Apply a panel's per-instance `colors` overrides to its root element. The variant's own colours are CLASSES (`mw-panel--dark` …, in the
28
39
  * reset), so only an override is ever written, and it is written through the CSSOM (`style.setProperty`) rather than a `style` attribute
29
40
  * in the template: nothing inline is rendered, and it needs no `'unsafe-inline'` in a strict `style-src`. Clearing `colors` clears it.
41
+ * @param el - the panel's root element
42
+ * @param colors - a function returning the current overrides (read again whenever they change)
30
43
  */
31
44
  export declare function usePanelOverrides(el: Ref<HTMLElement | null>, colors: () => PanelColors | undefined): void;
@@ -7,11 +7,13 @@ export interface Box {
7
7
  }
8
8
  /** Which side of the anchor the tip is on. */
9
9
  export type Side = 'bottom' | 'top' | 'right' | 'left';
10
+ /** Where a tip goes and how it was chosen. */
10
11
  export interface Placement {
11
12
  /** The tip's left edge in DOCUMENT coordinates (the page's own, so the tip scrolls with the page). */
12
13
  left: number;
13
14
  /** The tip's top edge in document coordinates. */
14
15
  top: number;
16
+ /** The side of the anchor the tip is on. */
15
17
  side: Side;
16
18
  /** False when no side keeps the whole tip inside the viewport: the default side is used and the page grows to hold it. */
17
19
  fits: boolean;
@@ -30,6 +32,7 @@ export declare const SIDE_ORDER: readonly Side[];
30
32
  * @param scroll The page's scroll offsets (`scrollX`, `scrollY`), added to turn viewport coordinates into document coordinates.
31
33
  * @param gap The space between the anchor and the tip.
32
34
  * @param margin The space kept clear at the viewport's edges.
35
+ * @returns the chosen side, the position in document coordinates, and whether the whole tip fits on screen
33
36
  */
34
37
  export declare function placeTip(anchor: Box, tip: {
35
38
  width: number;
@@ -24,7 +24,9 @@
24
24
  */
25
25
  /** The only keys a runtime config may set: machine-zone endpoints. */
26
26
  export declare const RUNTIME_ENDPOINT_KEYS: readonly ["VITE_INDEXER_URL", "VITE_WALRUS_RELAY_TESTNET", "VITE_WALRUS_RELAY_MAINNET"];
27
+ /** One of the keys a runtime config may set. */
27
28
  export type RuntimeEndpointKey = (typeof RUNTIME_ENDPOINT_KEYS)[number];
29
+ /** The overrides a runtime config can carry: any subset of the endpoint keys, each a validated URL. */
28
30
  export type RuntimeEndpoints = Partial<Record<RuntimeEndpointKey, string>>;
29
31
  /** Default location: same origin, so it is the operator's own file and needs no CORS. */
30
32
  export declare const RUNTIME_CONFIG_PATH = "/runtime-config.json";
@@ -34,6 +36,8 @@ export declare function parseEndpoint(value: unknown): string | undefined;
34
36
  /**
35
37
  * Validate a parsed runtime config. Unknown keys and invalid values are dropped (and reported), so a
36
38
  * typo can never inject anything; the result holds only valid endpoint overrides.
39
+ * @param input - the parsed JSON of the file
40
+ * @returns the valid overrides, and the names of the keys that were dropped (`<root>` when the file is not an object)
37
41
  */
38
42
  export declare function parseRuntimeConfig(input: unknown): {
39
43
  endpoints: RuntimeEndpoints;
@@ -42,11 +46,18 @@ export declare function parseRuntimeConfig(input: unknown): {
42
46
  /**
43
47
  * Fetch and apply the runtime config. Never throws: on any failure the build-time values stay in force.
44
48
  * Resolves to the endpoints that were applied.
49
+ * @param path - where to load it from: a same-origin path (default `/runtime-config.json`)
50
+ * @param fetchImpl - the fetch to use (a test passes a stand-in)
51
+ * @returns the overrides now in force
45
52
  */
46
53
  export declare function loadRuntimeConfig(path?: string, fetchImpl?: typeof fetch): Promise<Readonly<RuntimeEndpoints>>;
47
54
  /** The endpoints applied by {@link loadRuntimeConfig} (empty before it ran or when nothing applied). */
48
55
  export declare function runtimeEndpoints(): Readonly<RuntimeEndpoints>;
49
- /** The build-time environment with the runtime endpoint overrides applied on top. */
56
+ /**
57
+ * The build-time environment with the runtime endpoint overrides applied on top.
58
+ * @param buildEnv - `import.meta.env`
59
+ * @returns a copy with the overrides applied
60
+ */
50
61
  export declare function withRuntimeEnv<T extends Record<string, unknown>>(buildEnv: T): T & RuntimeEndpoints;
51
62
  /** Test hook: forget the loaded overrides. */
52
63
  export declare function resetRuntimeConfigForTesting(): void;
package/dist/tabs.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /** The two ids that link a tab to its panel. */
1
2
  export interface TabIds {
2
3
  /** id of the `role="tab"` button. */
3
4
  tab: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meddleware/ui",
3
- "version": "0.1.45",
3
+ "version": "0.1.47",
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",
@@ -48,13 +48,13 @@
48
48
  "vue": "^3.5.0"
49
49
  },
50
50
  "dependencies": {
51
- "@meddleware/design-tokens": "^0.1.13",
52
- "@meddleware/web-utils": "^0.0.4"
51
+ "@meddleware/design-tokens": "^0.1.14",
52
+ "@meddleware/web-utils": "^0.0.5"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@axe-core/playwright": "^4.13.0",
56
- "@meddleware/eslint-config": "^0.0.4",
57
- "@meddleware/frontend-config": "^0.0.14",
56
+ "@meddleware/eslint-config": "^0.0.5",
57
+ "@meddleware/frontend-config": "^0.0.17",
58
58
  "@playwright/test": "~1.64.1",
59
59
  "@resvg/resvg-js": "^2.6.2",
60
60
  "@vitejs/plugin-vue": "^6.0.9",