@lincyaw/aegis-ui 0.17.1 → 0.19.0

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 (101) hide show
  1. package/dist/components/ui/AnchoredPopover.cjs +2 -0
  2. package/dist/components/ui/AnchoredPopover.cjs.map +1 -0
  3. package/dist/components/ui/AnchoredPopover.d.ts +49 -0
  4. package/dist/components/ui/AnchoredPopover.js +144 -0
  5. package/dist/components/ui/AnchoredPopover.js.map +1 -0
  6. package/dist/components/ui/Breadcrumb.cjs +1 -1
  7. package/dist/components/ui/Breadcrumb.cjs.map +1 -1
  8. package/dist/components/ui/Breadcrumb.d.ts +13 -1
  9. package/dist/components/ui/Breadcrumb.js +28 -19
  10. package/dist/components/ui/Breadcrumb.js.map +1 -1
  11. package/dist/components/ui/CodeBlock.cjs +2 -2
  12. package/dist/components/ui/CodeBlock.cjs.map +1 -1
  13. package/dist/components/ui/CodeBlock.d.ts +28 -1
  14. package/dist/components/ui/CodeBlock.js +94 -36
  15. package/dist/components/ui/CodeBlock.js.map +1 -1
  16. package/dist/components/ui/DetailBeside.cjs +1 -1
  17. package/dist/components/ui/DetailBeside.cjs.map +1 -1
  18. package/dist/components/ui/DetailBeside.d.ts +38 -9
  19. package/dist/components/ui/DetailBeside.js +104 -85
  20. package/dist/components/ui/DetailBeside.js.map +1 -1
  21. package/dist/components/ui/LineIcon.cjs +2 -0
  22. package/dist/components/ui/LineIcon.cjs.map +1 -0
  23. package/dist/components/ui/LineIcon.d.ts +15 -0
  24. package/dist/components/ui/LineIcon.js +33 -0
  25. package/dist/components/ui/LineIcon.js.map +1 -0
  26. package/dist/components/ui/PaneLayout.cjs +2 -0
  27. package/dist/components/ui/PaneLayout.cjs.map +1 -0
  28. package/dist/components/ui/PaneLayout.d.ts +33 -0
  29. package/dist/components/ui/PaneLayout.js +34 -0
  30. package/dist/components/ui/PaneLayout.js.map +1 -0
  31. package/dist/components/ui/Quote.cjs +2 -0
  32. package/dist/components/ui/Quote.cjs.map +1 -0
  33. package/dist/components/ui/Quote.d.ts +12 -0
  34. package/dist/components/ui/Quote.js +10 -0
  35. package/dist/components/ui/Quote.js.map +1 -0
  36. package/dist/components/ui/SectionDivider.cjs +1 -1
  37. package/dist/components/ui/SectionDivider.cjs.map +1 -1
  38. package/dist/components/ui/SectionDivider.d.ts +7 -1
  39. package/dist/components/ui/SectionDivider.js +9 -7
  40. package/dist/components/ui/SectionDivider.js.map +1 -1
  41. package/dist/components/ui/StatusDot.cjs.map +1 -1
  42. package/dist/components/ui/StatusDot.d.ts +3 -2
  43. package/dist/components/ui/StatusDot.js.map +1 -1
  44. package/dist/components/ui/Toolbar.cjs +1 -1
  45. package/dist/components/ui/Toolbar.cjs.map +1 -1
  46. package/dist/components/ui/Toolbar.d.ts +10 -1
  47. package/dist/components/ui/Toolbar.js +17 -7
  48. package/dist/components/ui/Toolbar.js.map +1 -1
  49. package/dist/components/ui/index.d.ts +10 -2
  50. package/dist/index.cjs +1 -1
  51. package/dist/index.d.ts +1 -1
  52. package/dist/index.js +343 -332
  53. package/dist/index.js.map +1 -1
  54. package/dist/layouts/PageWrapper.cjs +1 -1
  55. package/dist/layouts/PageWrapper.cjs.map +1 -1
  56. package/dist/layouts/PageWrapper.d.ts +7 -1
  57. package/dist/layouts/PageWrapper.js +13 -8
  58. package/dist/layouts/PageWrapper.js.map +1 -1
  59. package/dist/layouts/shell/AegisShell.cjs +1 -1
  60. package/dist/layouts/shell/AegisShell.cjs.map +1 -1
  61. package/dist/layouts/shell/AegisShell.d.ts +1 -1
  62. package/dist/layouts/shell/AegisShell.js +193 -150
  63. package/dist/layouts/shell/AegisShell.js.map +1 -1
  64. package/dist/layouts/shell/ShellMenuToggle.cjs +2 -0
  65. package/dist/layouts/shell/ShellMenuToggle.cjs.map +1 -0
  66. package/dist/layouts/shell/ShellMenuToggle.d.ts +8 -0
  67. package/dist/layouts/shell/ShellMenuToggle.js +23 -0
  68. package/dist/layouts/shell/ShellMenuToggle.js.map +1 -0
  69. package/dist/layouts/shell/Sidebar.cjs +1 -1
  70. package/dist/layouts/shell/Sidebar.cjs.map +1 -1
  71. package/dist/layouts/shell/Sidebar.d.ts +10 -4
  72. package/dist/layouts/shell/Sidebar.js +39 -32
  73. package/dist/layouts/shell/Sidebar.js.map +1 -1
  74. package/dist/layouts/shell/TopHeader.cjs +1 -1
  75. package/dist/layouts/shell/TopHeader.cjs.map +1 -1
  76. package/dist/layouts/shell/TopHeader.d.ts +14 -0
  77. package/dist/layouts/shell/TopHeader.js +127 -110
  78. package/dist/layouts/shell/TopHeader.js.map +1 -1
  79. package/dist/layouts/shell/buildRouteTree.cjs +1 -1
  80. package/dist/layouts/shell/buildRouteTree.cjs.map +1 -1
  81. package/dist/layouts/shell/buildRouteTree.js +5 -5
  82. package/dist/layouts/shell/buildRouteTree.js.map +1 -1
  83. package/dist/layouts/shell/index.d.ts +1 -0
  84. package/dist/layouts/shell/shellNavContext.cjs +2 -0
  85. package/dist/layouts/shell/shellNavContext.cjs.map +1 -0
  86. package/dist/layouts/shell/shellNavContext.d.ts +8 -0
  87. package/dist/layouts/shell/shellNavContext.js +6 -0
  88. package/dist/layouts/shell/shellNavContext.js.map +1 -0
  89. package/dist/layouts/shell/types.d.ts +21 -0
  90. package/dist/lib/scrollView.cjs +1 -1
  91. package/dist/lib/scrollView.cjs.map +1 -1
  92. package/dist/lib/scrollView.d.ts +6 -0
  93. package/dist/lib/scrollView.js +26 -17
  94. package/dist/lib/scrollView.js.map +1 -1
  95. package/dist/locale/strings.cjs +1 -1
  96. package/dist/locale/strings.cjs.map +1 -1
  97. package/dist/locale/strings.d.ts +2 -0
  98. package/dist/locale/strings.js +7 -5
  99. package/dist/locale/strings.js.map +1 -1
  100. package/dist/style.css +1 -1
  101. package/package.json +1 -1
@@ -1,121 +1,140 @@
1
- import { jsx as i, jsxs as k } from "react/jsx-runtime";
2
- import { useState as z, useRef as s, useCallback as h, useEffect as F, useMemo as O, useContext as U, createContext as W } from "react";
3
- import { useIsomorphicLayoutEffect as j } from "../../hooks/useIsomorphicLayoutEffect.js";
4
- import { useMediaQuery as Y } from "../../hooks/useMediaQuery.js";
5
- import { viewBoundsOf as G, scrollerOf as T } from "../../lib/scrollView.js";
1
+ import { jsx as o, jsxs as S } from "react/jsx-runtime";
2
+ import { useState as Y, useRef as i, useCallback as R, useEffect as G, useMemo as q, useContext as J, createContext as V } from "react";
3
+ import { useIsomorphicLayoutEffect as F } from "../../hooks/useIsomorphicLayoutEffect.js";
4
+ import { useMediaQuery as X } from "../../hooks/useMediaQuery.js";
5
+ import { scrollingAncestorOf as H, viewBoundsOf as Z, scrollerOf as ee } from "../../lib/scrollView.js";
6
6
  /* empty css */
7
- import { SelectedRowDetailContext as A } from "./selectedRowDetail.js";
8
- const H = "(max-width: 768px)", I = W(null);
9
- function J(u, c, f, m, o) {
10
- const b = o.top + m, a = u.top < b ? u.top - b : Math.max(u.bottom - o.bottom, 0);
11
- return Math.max(a, c + f - o.bottom);
7
+ import { Pane as U } from "./PaneLayout.js";
8
+ import { SelectedRowDetailContext as k } from "./selectedRowDetail.js";
9
+ const te = "(max-width: 768px)", D = V(null);
10
+ function ne(r, c, d, p, s) {
11
+ const f = s.top + p, a = r.top < f ? r.top - f : Math.max(r.bottom - s.bottom, 0);
12
+ return Math.max(a, c + d - s.bottom);
12
13
  }
13
- function K({ boxRef: u }) {
14
- const c = U(I);
15
- return /* @__PURE__ */ i("div", { ref: u, className: "aegis-detail-beside__inline", role: "group", children: c });
14
+ function re({ boxRef: r }) {
15
+ const c = J(D);
16
+ return /* @__PURE__ */ o("div", { ref: r, className: "aegis-detail-beside__inline", role: "group", children: c });
16
17
  }
17
- function oe({
18
- columns: u,
19
- detail: c,
20
- children: f,
21
- revealKey: m,
22
- scrollContainer: o = null,
23
- className: b
24
- }) {
25
- const a = Y(H), [Q, R] = z(!1), E = s(null), y = s(null), g = s(null), d = s(null), p = s(!1), N = s(0), B = s(m), M = s(void 0), _ = s({ children: f, detail: c }), l = h(() => {
26
- const e = d.current, t = g.current, r = y.current;
18
+ function fe(r) {
19
+ const { detail: c, children: d, revealKey: p } = r, s = r.layout === "panes", f = s ? null : r.scrollContainer ?? null, a = X(te), [L, x] = Y(!1), m = i(null), C = i(null), b = i(null), B = i(null), O = i(null), h = i(null), g = i(!1), T = i(0), _ = i(p), M = i(void 0), N = i({ children: d, detail: c }), u = R(() => {
20
+ const e = h.current, t = b.current, n = C.current;
27
21
  if (e === null) {
28
- r?.style.removeProperty("height");
22
+ n?.style.removeProperty("height");
29
23
  return;
30
24
  }
31
25
  if (t === null)
32
26
  return;
33
- const n = e.getBoundingClientRect();
34
- if (r === null)
27
+ const l = e.getBoundingClientRect();
28
+ if (n === null) {
35
29
  t.style.setProperty(
36
30
  "--aegis-detail-beside-row-height",
37
- `${String(n.height)}px`
31
+ `${String(l.height)}px`
38
32
  );
39
- else {
40
- const w = r.getBoundingClientRect().top;
41
- r.style.height = `${String(Math.max(n.top - w, 0))}px`;
33
+ const v = s && m.current !== null ? H(m.current) : null;
34
+ v === null ? (t.style.removeProperty("--detail-beside-view-height"), t.style.removeProperty("--detail-beside-sticky-top")) : (t.style.setProperty(
35
+ "--detail-beside-view-height",
36
+ `${String(v.clientHeight)}px`
37
+ ), t.style.setProperty("--detail-beside-sticky-top", "0px"));
38
+ } else {
39
+ const v = n.getBoundingClientRect().top;
40
+ n.style.height = `${String(Math.max(l.top - v, 0))}px`;
42
41
  }
43
- }, []), x = h(() => {
44
- l();
45
- const e = d.current, t = g.current;
46
- if (e === null || t === null)
42
+ }, [s]), P = R(() => {
43
+ u();
44
+ const e = h.current, t = m.current, n = b.current, l = B.current !== null;
45
+ if (e === null || t === null || n === null && !l)
47
46
  return;
48
- const r = e.getBoundingClientRect(), n = y.current, w = J(
49
- r,
50
- n === null ? r.bottom : n.getBoundingClientRect().top,
51
- t.getBoundingClientRect().height,
52
- parseFloat(getComputedStyle(t).scrollMarginTop),
53
- G(o)
54
- ), P = T(o);
55
- Math.abs(w) >= 1 && P.scrollBy({ top: w, behavior: "instant" }), N.current = P.scrollTop;
56
- }, [l, o]), v = h(() => {
57
- M.current = B.current, p.current = !0, R(!0), queueMicrotask(() => {
58
- x(), R(!1);
47
+ const v = s ? H(t) : f, $ = e.getBoundingClientRect(), I = C.current, Q = ne(
48
+ $,
49
+ I === null ? $.bottom : I.getBoundingClientRect().top,
50
+ n === null ? 0 : n.getBoundingClientRect().height,
51
+ n === null ? 0 : parseFloat(getComputedStyle(n).scrollMarginTop),
52
+ Z(v)
53
+ ), E = ee(v);
54
+ Math.abs(Q) >= 1 && E.scrollBy({ top: Q, behavior: "instant" }), O.current = E, T.current = E.scrollTop;
55
+ }, [s, u, f]), y = R(() => {
56
+ M.current = _.current, B.current?.parentElement?.scrollTo({
57
+ top: 0,
58
+ behavior: "instant"
59
+ }), g.current = !0, x(!0), queueMicrotask(() => {
60
+ P(), x(!1);
59
61
  });
60
- }, [x]), C = h(
62
+ }, [P]), j = R(
61
63
  (e) => {
62
- const t = e !== d.current;
63
- d.current = e, e === null ? (p.current = !1, R(!1), l()) : M.current !== B.current ? v() : (t && (p.current = !1), l());
64
+ const t = e !== h.current;
65
+ h.current = e, e === null ? (g.current = !1, x(!1), u()) : M.current !== _.current ? y() : (t && (g.current = !1), u());
64
66
  },
65
- [l, v]
66
- ), S = h(() => {
67
- R(!0);
67
+ [u, y]
68
+ ), z = R(() => {
69
+ x(!0);
68
70
  }, []);
69
- j(() => {
70
- const e = _.current.children !== f || _.current.detail !== c;
71
- _.current = { children: f, detail: c }, B.current = m, M.current !== m && d.current !== null ? v() : (e && (p.current = !1), l());
72
- }), j(() => {
73
- const e = E.current;
71
+ F(() => {
72
+ const e = N.current.children !== d || N.current.detail !== c;
73
+ N.current = { children: d, detail: c }, _.current = p, M.current !== p && h.current !== null ? y() : (e && (g.current = !1), u());
74
+ }), F(() => {
75
+ const e = m.current;
74
76
  if (e === null)
75
77
  return;
76
78
  const t = new ResizeObserver(() => {
77
- p.current ? x() : l();
79
+ g.current ? P() : u();
78
80
  });
79
- for (const n of a ? [e] : [e, g.current])
80
- n !== null && t.observe(n);
81
- const r = (n) => {
82
- n.target instanceof Node && d.current?.contains(n.target) && v();
81
+ for (const l of a ? [e] : [e, b.current])
82
+ l !== null && t.observe(l);
83
+ const n = (l) => {
84
+ l.target instanceof Node && h.current?.contains(l.target) && y();
83
85
  };
84
- return e.addEventListener("click", r), () => {
85
- t.disconnect(), e.removeEventListener("click", r);
86
+ return e.addEventListener("click", n), () => {
87
+ t.disconnect(), e.removeEventListener("click", n);
86
88
  };
87
- }, [a, l, x, v]), F(() => {
88
- const e = T(o), t = o ?? window, r = () => {
89
- Math.abs(e.scrollTop - N.current) >= 1 && (p.current = !1);
89
+ }, [a, u, P, y]), G(() => {
90
+ const e = () => {
91
+ const l = O.current;
92
+ l !== null && Math.abs(l.scrollTop - T.current) >= 1 && (g.current = !1);
93
+ }, t = s ? document : f ?? window, n = { capture: s, passive: !0 };
94
+ return t.addEventListener("scroll", e, n), () => {
95
+ t.removeEventListener("scroll", e, n);
90
96
  };
91
- return t.addEventListener("scroll", r, { passive: !0 }), () => {
92
- t.removeEventListener("scroll", r);
93
- };
94
- }, [o]);
95
- const D = O(
96
- () => a ? /* @__PURE__ */ i(K, { boxRef: g }) : null,
97
+ }, [s, f]);
98
+ const A = q(
99
+ () => a ? /* @__PURE__ */ o(re, { boxRef: b }) : null,
97
100
  [a]
98
- ), $ = O(
99
- () => ({ placeRow: C, awaitRow: S, inline: D }),
100
- [C, S, D]
101
- ), L = /* @__PURE__ */ i(A.Provider, { value: null, children: c }), q = ["aegis-detail-beside", b ?? ""].filter(Boolean).join(" ");
102
- return /* @__PURE__ */ i(A.Provider, { value: $, children: /* @__PURE__ */ i(I.Provider, { value: L, children: /* @__PURE__ */ k(
101
+ ), K = q(
102
+ () => ({ placeRow: j, awaitRow: z, inline: A }),
103
+ [j, z, A]
104
+ ), w = /* @__PURE__ */ o(k.Provider, { value: null, children: c });
105
+ if (r.layout === "panes")
106
+ return /* @__PURE__ */ o(k.Provider, { value: K, children: /* @__PURE__ */ S(D.Provider, { value: w, children: [
107
+ /* @__PURE__ */ o(U, { size: "fill", ...r.listPane, children: /* @__PURE__ */ o(
108
+ "div",
109
+ {
110
+ ref: m,
111
+ className: "aegis-detail-beside__list",
112
+ "aria-busy": L || void 0,
113
+ children: d
114
+ }
115
+ ) }),
116
+ !a && /* @__PURE__ */ o(U, { size: "lg", ...r.detailPane, children: /* @__PURE__ */ o("div", { ref: B, children: w }) })
117
+ ] }) });
118
+ const W = ["aegis-detail-beside", r.className ?? ""].filter(Boolean).join(" ");
119
+ return /* @__PURE__ */ o(k.Provider, { value: K, children: /* @__PURE__ */ o(D.Provider, { value: w, children: /* @__PURE__ */ S(
103
120
  "div",
104
121
  {
105
- className: q,
106
- style: { "--aegis-detail-beside-columns": u },
107
- "aria-busy": Q || void 0,
122
+ className: W,
123
+ style: {
124
+ "--aegis-detail-beside-columns": r.columns
125
+ },
126
+ "aria-busy": L || void 0,
108
127
  children: [
109
- /* @__PURE__ */ i("div", { ref: E, className: "aegis-detail-beside__list", children: f }),
110
- !a && /* @__PURE__ */ k("div", { className: "aegis-detail-beside__side", children: [
111
- /* @__PURE__ */ i("div", { ref: y }),
112
- /* @__PURE__ */ i("div", { ref: g, className: "aegis-detail-beside__detail", children: L })
128
+ /* @__PURE__ */ o("div", { ref: m, className: "aegis-detail-beside__list", children: d }),
129
+ !a && /* @__PURE__ */ S("div", { className: "aegis-detail-beside__side", children: [
130
+ /* @__PURE__ */ o("div", { ref: C }),
131
+ /* @__PURE__ */ o("div", { ref: b, className: "aegis-detail-beside__detail", children: w })
113
132
  ] })
114
133
  ]
115
134
  }
116
135
  ) }) });
117
136
  }
118
137
  export {
119
- oe as DetailBeside
138
+ fe as DetailBeside
120
139
  };
121
140
  //# sourceMappingURL=DetailBeside.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DetailBeside.js","sources":["../../../src/components/ui/DetailBeside.tsx"],"sourcesContent":["import {\n type CSSProperties,\n type ReactNode,\n type RefObject,\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect';\nimport { useMediaQuery } from '../../hooks/useMediaQuery';\nimport {\n type ViewBounds,\n scrollerOf,\n viewBoundsOf,\n} from '../../lib/scrollView';\nimport './DetailBeside.css';\nimport {\n type SelectedRowDetail,\n SelectedRowDetailContext,\n} from './selectedRowDetail';\n\nexport interface DetailBesideProps {\n /**\n * `grid-template-columns` of the list and the detail above 768 px, e.g.\n * `'3fr 2fr'`.\n */\n columns: string;\n /**\n * The selected item's detail: one element, such as a `Panel` titled with\n * the item's name. It is never taller than the view, so a long Panel\n * scrolls its body. Render it anew from the host's data whenever that\n * data changes: that render tells DetailBeside the change was new data,\n * so the page stays where it is. A detail that fetches its own data and\n * redraws without this host rendering leaves the page following the row,\n * and its next change of size scrolls the page.\n */\n detail: ReactNode;\n /**\n * The list: a `TraceTree`, `FileTree`, `DataTable`, `TreeTable` or\n * `ServiceMap`, in a Panel say. The detail follows the row it draws\n * selected. Like `detail`, render it anew from the host's data whenever\n * that data changes, so the page stays where it is on new data; a list\n * that fetches its own data and redraws without this host rendering\n * leaves the page following the row, and its next change of size scrolls\n * the page.\n */\n children: ReactNode;\n /**\n * The selection as the page's address names it, or null where the\n * address names none and the list shows a default. It changes only by\n * the viewer's doing: a click, a key, a link, back or forward. The page\n * scrolls to the selected row when this changes, and on the first\n * placement after mount; a row that comes into place for new data, such\n * as a default the data moved, is only levelled with.\n */\n revealKey: string | null;\n /** The element that scrolls the page; omitted or null means the viewport. */\n scrollContainer?: HTMLElement | null;\n className?: string;\n}\n\nconst NARROW_QUERY = '(max-width: 768px)';\n\n/**\n * The detail as the inline slot draws it. It is kept out of the context the\n * lists read, so a new detail re-renders the slot and not the list.\n */\nconst DetailContext = createContext<ReactNode>(null);\n\n/**\n * How far to scroll so the row is in the view, clear of the `inset` at the\n * view's top, and the detail, whose top can rise no higher than `ceiling`,\n * fits above the view's bottom.\n */\nfunction revealDistance(\n row: DOMRect,\n ceiling: number,\n height: number,\n inset: number,\n view: ViewBounds,\n): number {\n const top = view.top + inset;\n const toRow =\n row.top < top ? row.top - top : Math.max(row.bottom - view.bottom, 0);\n return Math.max(toRow, ceiling + height - view.bottom);\n}\n\n/** The detail right after the selected row, at 768 px and below. */\nfunction InlineDetail({ boxRef }: { boxRef: RefObject<HTMLDivElement> }) {\n const detail = useContext(DetailContext);\n return (\n <div ref={boxRef} className=\"aegis-detail-beside__inline\" role=\"group\">\n {detail}\n </div>\n );\n}\n\n/**\n * A tree, table or map with the selected item's detail beside it. Above\n * 768 px the detail stands in a column on the right, level with the\n * selected row: when the row is too low for it, its bottom meets the\n * view's bottom, and while the page scrolls it stays in the view below\n * the header; while the list draws no row selected, it stands at the\n * column's top. At 768 px and below the list draws the detail right after\n * the selected row, the rows that follow under it; a map draws it over\n * the map, under the node. When the page opens with a selection,\n * `revealKey` changes or the viewer clicks the selected row, the page\n * scrolls at once, as little as it takes to show the row and the detail\n * whole, and again whenever the list or the detail changes size, until the\n * viewer scrolls or the host renders a new list or detail. Any other\n * placement, such as new data moving the selection or the rows, levels\n * the detail with its row by the same rule and leaves the page where it\n * is; the browser's scroll anchoring can still move it when rows arrive\n * above the view, unless the host sets `overflow-anchor: none` on its\n * scroller. The wrapper is `aria-busy` while a selected row it reveals is\n * still on its way.\n */\nexport function DetailBeside({\n columns,\n detail,\n children,\n revealKey,\n scrollContainer = null,\n className,\n}: DetailBesideProps) {\n const narrow = useMediaQuery(NARROW_QUERY);\n const [busy, setBusy] = useState(false);\n const listRef = useRef<HTMLDivElement>(null);\n const spacerRef = useRef<HTMLDivElement>(null);\n const detailRef = useRef<HTMLDivElement>(null);\n const rowRef = useRef<HTMLElement | null>(null);\n /** Whether the page is still where the last reveal left it. */\n const followRef = useRef(false);\n const revealedAtRef = useRef(0);\n /** The latest render's revealKey, and the last reveal's: undefined before the first. */\n const revealKeyRef = useRef(revealKey);\n const revealedKeyRef = useRef<string | null | undefined>(undefined);\n /** The latest render's list and detail, which change when the host renders them anew. */\n const shownRef = useRef({ children, detail });\n\n /**\n * Sets the detail level with the row: above 768 px through the spacer's\n * height, at and below by telling the inline detail how tall the row is.\n * While the list draws no row selected, such as when a filter or a closed\n * parent hides it, the detail stands at the top of its column.\n */\n const place = useCallback(() => {\n const row = rowRef.current;\n const box = detailRef.current;\n const spacer = spacerRef.current;\n if (row === null) {\n spacer?.style.removeProperty('height');\n return;\n }\n if (box === null) {\n return;\n }\n const rowBox = row.getBoundingClientRect();\n if (spacer === null) {\n box.style.setProperty(\n '--aegis-detail-beside-row-height',\n `${String(rowBox.height)}px`,\n );\n } else {\n const top = spacer.getBoundingClientRect().top;\n spacer.style.height = `${String(Math.max(rowBox.top - top, 0))}px`;\n }\n }, []);\n\n /** Places the row and scrolls as little as it takes to show it and its detail whole. */\n const reveal = useCallback(() => {\n place();\n const row = rowRef.current;\n const box = detailRef.current;\n if (row === null || box === null) {\n return;\n }\n const rowBox = row.getBoundingClientRect();\n const spacer = spacerRef.current;\n const distance = revealDistance(\n rowBox,\n spacer === null ? rowBox.bottom : spacer.getBoundingClientRect().top,\n box.getBoundingClientRect().height,\n parseFloat(getComputedStyle(box).scrollMarginTop),\n viewBoundsOf(scrollContainer),\n );\n const scroller = scrollerOf(scrollContainer);\n if (Math.abs(distance) >= 1) {\n scroller.scrollBy({ top: distance, behavior: 'instant' });\n }\n revealedAtRef.current = scroller.scrollTop;\n }, [place, scrollContainer]);\n\n // A list places its row while React attaches refs, before the detail's\n // own ref is in and before the re-renders its layout effects ask for,\n // so the reveal waits for the commit to finish.\n const revealSoon = useCallback(() => {\n revealedKeyRef.current = revealKeyRef.current;\n followRef.current = true;\n setBusy(true);\n queueMicrotask(() => {\n reveal();\n setBusy(false);\n });\n }, [reveal]);\n\n // A row placed while a reveal is due is revealed; any other is levelled\n // with, and a new one ends following.\n const placeRow = useCallback(\n (row: HTMLElement | null) => {\n const fresh = row !== rowRef.current;\n rowRef.current = row;\n if (row === null) {\n followRef.current = false;\n setBusy(false);\n place();\n } else if (revealedKeyRef.current !== revealKeyRef.current) {\n revealSoon();\n } else {\n if (fresh) {\n followRef.current = false;\n }\n place();\n }\n },\n [place, revealSoon],\n );\n\n const awaitRow = useCallback(() => {\n setBusy(true);\n }, []);\n\n // Runs after the lists have placed their rows in this commit, so a new\n // revealKey reveals the row it selects. A render by the host without one\n // ends following.\n useIsomorphicLayoutEffect(() => {\n const rendered =\n shownRef.current.children !== children ||\n shownRef.current.detail !== detail;\n shownRef.current = { children, detail };\n revealKeyRef.current = revealKey;\n if (revealedKeyRef.current !== revealKey && rowRef.current !== null) {\n revealSoon();\n } else {\n if (rendered) {\n followRef.current = false;\n }\n place();\n }\n });\n\n useIsomorphicLayoutEffect(() => {\n const list = listRef.current;\n if (list === null) {\n return undefined;\n }\n const observer = new ResizeObserver(() => {\n if (followRef.current) {\n reveal();\n } else {\n place();\n }\n });\n // At 768 px and below the detail lies inside the list.\n for (const box of narrow ? [list] : [list, detailRef.current]) {\n if (box !== null) {\n observer.observe(box);\n }\n }\n const activate = (event: MouseEvent): void => {\n if (\n event.target instanceof Node &&\n rowRef.current?.contains(event.target)\n ) {\n revealSoon();\n }\n };\n list.addEventListener('click', activate);\n return () => {\n observer.disconnect();\n list.removeEventListener('click', activate);\n };\n }, [narrow, place, reveal, revealSoon]);\n\n useEffect(() => {\n const scroller = scrollerOf(scrollContainer);\n const target = scrollContainer ?? window;\n const scrolled = (): void => {\n if (Math.abs(scroller.scrollTop - revealedAtRef.current) >= 1) {\n followRef.current = false;\n }\n };\n target.addEventListener('scroll', scrolled, { passive: true });\n return () => {\n target.removeEventListener('scroll', scrolled);\n };\n }, [scrollContainer]);\n\n const inline = useMemo(\n () => (narrow ? <InlineDetail boxRef={detailRef} /> : null),\n [narrow],\n );\n const slot = useMemo(\n (): SelectedRowDetail => ({ placeRow, awaitRow, inline }),\n [placeRow, awaitRow, inline],\n );\n const isolated = (\n <SelectedRowDetailContext.Provider value={null}>\n {detail}\n </SelectedRowDetailContext.Provider>\n );\n\n const cls = ['aegis-detail-beside', className ?? '']\n .filter(Boolean)\n .join(' ');\n\n return (\n <SelectedRowDetailContext.Provider value={slot}>\n <DetailContext.Provider value={isolated}>\n <div\n className={cls}\n style={{ '--aegis-detail-beside-columns': columns } as CSSProperties}\n aria-busy={busy || undefined}\n >\n <div ref={listRef} className=\"aegis-detail-beside__list\">\n {children}\n </div>\n {!narrow && (\n <div className=\"aegis-detail-beside__side\">\n <div ref={spacerRef} />\n <div ref={detailRef} className=\"aegis-detail-beside__detail\">\n {isolated}\n </div>\n </div>\n )}\n </div>\n </DetailContext.Provider>\n </SelectedRowDetailContext.Provider>\n );\n}\n"],"names":["NARROW_QUERY","DetailContext","createContext","revealDistance","row","ceiling","height","inset","view","top","toRow","InlineDetail","boxRef","detail","useContext","jsx","DetailBeside","columns","children","revealKey","scrollContainer","className","narrow","useMediaQuery","busy","setBusy","useState","listRef","useRef","spacerRef","detailRef","rowRef","followRef","revealedAtRef","revealKeyRef","revealedKeyRef","shownRef","place","useCallback","box","spacer","rowBox","reveal","distance","viewBoundsOf","scroller","scrollerOf","revealSoon","placeRow","fresh","awaitRow","useIsomorphicLayoutEffect","rendered","list","observer","activate","event","useEffect","target","scrolled","inline","useMemo","slot","isolated","SelectedRowDetailContext","cls","jsxs"],"mappings":";;;;;;;AAkEA,MAAMA,IAAe,sBAMfC,IAAgBC,EAAyB,IAAI;AAOnD,SAASC,EACPC,GACAC,GACAC,GACAC,GACAC,GACQ;AACR,QAAMC,IAAMD,EAAK,MAAMD,GACjBG,IACJN,EAAI,MAAMK,IAAML,EAAI,MAAMK,IAAM,KAAK,IAAIL,EAAI,SAASI,EAAK,QAAQ,CAAC;AACtE,SAAO,KAAK,IAAIE,GAAOL,IAAUC,IAASE,EAAK,MAAM;AACvD;AAGA,SAASG,EAAa,EAAE,QAA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,GAAA,EAAa,QAAQmB,GAAW,IAAK;AAAA,IACtD,CAACR,CAAM;AAAA,EAAA,GAEHwC,IAAOD;AAAA,IACX,OAA0B,EAAE,UAAAb,GAAU,UAAAE,GAAU,QAAAU;IAChD,CAACZ,GAAUE,GAAUU,CAAM;AAAA,EAAA,GAEvBG,IACJ,gBAAAhD,EAACiD,EAAyB,UAAzB,EAAkC,OAAO,MACvC,UAAAnD,GACH,GAGIoD,IAAM,CAAC,uBAAuB5C,KAAa,EAAE,EAChD,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,SACE,gBAAAN,EAACiD,EAAyB,UAAzB,EAAkC,OAAOF,GACxC,UAAA,gBAAA/C,EAACd,EAAc,UAAd,EAAuB,OAAO8D,GAC7B,UAAA,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWD;AAAA,MACX,OAAO,EAAE,iCAAiChD,EAAA;AAAA,MAC1C,aAAWO,KAAQ;AAAA,MAEnB,UAAA;AAAA,QAAA,gBAAAT,EAAC,OAAA,EAAI,KAAKY,GAAS,WAAU,6BAC1B,UAAAT,GACH;AAAA,QACC,CAACI,KACA,gBAAA4C,EAAC,OAAA,EAAI,WAAU,6BACb,UAAA;AAAA,UAAA,gBAAAnD,EAAC,OAAA,EAAI,KAAKc,EAAA,CAAW;AAAA,4BACpB,OAAA,EAAI,KAAKC,GAAW,WAAU,+BAC5B,UAAAiC,EAAA,CACH;AAAA,QAAA,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAGN,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"DetailBeside.js","sources":["../../../src/components/ui/DetailBeside.tsx"],"sourcesContent":["import {\n type CSSProperties,\n type ReactNode,\n type RefObject,\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect';\nimport { useMediaQuery } from '../../hooks/useMediaQuery';\nimport {\n type ViewBounds,\n scrollerOf,\n scrollingAncestorOf,\n viewBoundsOf,\n} from '../../lib/scrollView';\nimport './DetailBeside.css';\nimport { Pane, type PaneProps } from './PaneLayout';\nimport {\n type SelectedRowDetail,\n SelectedRowDetailContext,\n} from './selectedRowDetail';\n\ninterface DetailBesideBaseProps {\n /**\n * The selected item's detail: one element, such as a `Panel` titled with\n * the item's name. Render it anew from the host's data whenever that\n * data changes: that render tells DetailBeside the change was new data,\n * so the page stays where it is. A detail that fetches its own data and\n * redraws without this host rendering leaves the page following the row,\n * and its next change of size scrolls the page.\n */\n detail: ReactNode;\n /**\n * The list: a `TraceTree`, `FileTree`, `DataTable`, `TreeTable` or\n * `ServiceMap`, in a Panel say. The detail follows the row it draws\n * selected. Like `detail`, render it anew from the host's data whenever\n * that data changes, so the page stays where it is on new data; a list\n * that fetches its own data and redraws without this host rendering\n * leaves the page following the row, and its next change of size scrolls\n * the page.\n */\n children: ReactNode;\n /**\n * The selection as the page's address names it, or null where the\n * address names none and the list shows a default. It changes only by\n * the viewer's doing: a click, a key, a link, back or forward. The page\n * scrolls to the selected row when this changes, and on the first\n * placement after mount; a row that comes into place for new data, such\n * as a default the data moved, is only levelled with.\n */\n revealKey: string | null;\n}\n\n/** The column form: the list and the detail in a grid of their own. */\nexport interface DetailBesideColumnsProps extends DetailBesideBaseProps {\n layout?: 'columns';\n /**\n * `grid-template-columns` of the list and the detail above 768 px, e.g.\n * `'3fr 2fr'`. The detail is never taller than the view, so a long Panel\n * scrolls its body.\n */\n columns: string;\n /** The element that scrolls the page; omitted or null means the viewport. */\n scrollContainer?: HTMLElement | null;\n className?: string;\n}\n\n/** A `Pane` of the pane form, as `Pane` takes it but for its content. */\nexport type DetailBesidePane = Omit<PaneProps, 'children'>;\n\n/**\n * The pane form: the list and the detail as two `Pane`s, set directly in a\n * `PaneLayout` after any panes that come before the list.\n */\nexport interface DetailBesidePanesProps extends DetailBesideBaseProps {\n layout: 'panes';\n /** The list's pane; `size` defaults to `fill`. */\n listPane?: DetailBesidePane;\n /** The detail's pane above 768 px; `size` defaults to `lg`. */\n detailPane?: DetailBesidePane;\n}\n\nexport type DetailBesideProps =\n | DetailBesideColumnsProps\n | DetailBesidePanesProps;\n\nconst NARROW_QUERY = '(max-width: 768px)';\n\n/**\n * The detail as the inline slot draws it. It is kept out of the context the\n * lists read, so a new detail re-renders the slot and not the list.\n */\nconst DetailContext = createContext<ReactNode>(null);\n\n/**\n * How far to scroll so the row is in the view, clear of the `inset` at the\n * view's top, and the detail, whose top can rise no higher than `ceiling`,\n * fits above the view's bottom.\n */\nfunction revealDistance(\n row: DOMRect,\n ceiling: number,\n height: number,\n inset: number,\n view: ViewBounds,\n): number {\n const top = view.top + inset;\n const toRow =\n row.top < top ? row.top - top : Math.max(row.bottom - view.bottom, 0);\n return Math.max(toRow, ceiling + height - view.bottom);\n}\n\n/** The detail right after the selected row, at 768 px and below. */\nfunction InlineDetail({ boxRef }: { boxRef: RefObject<HTMLDivElement> }) {\n const detail = useContext(DetailContext);\n return (\n <div ref={boxRef} className=\"aegis-detail-beside__inline\" role=\"group\">\n {detail}\n </div>\n );\n}\n\n/**\n * A tree, table or map with the selected item's detail beside it. Above\n * 768 px the detail stands in a column on the right, level with the\n * selected row: when the row is too low for it, its bottom meets the\n * view's bottom, and while the page scrolls it stays in the view below\n * the header; while the list draws no row selected, it stands at the\n * column's top. At 768 px and below the list draws the detail right after\n * the selected row, the rows that follow under it; a map draws it over\n * the map, under the node. When the page opens with a selection,\n * `revealKey` changes or the viewer clicks the selected row, the page\n * scrolls at once, as little as it takes to show the row and the detail\n * whole, and again whenever the list or the detail changes size, until the\n * viewer scrolls or the host renders a new list or detail. Any other\n * placement, such as new data moving the selection or the rows, levels\n * the detail with its row by the same rule and leaves the page where it\n * is; the browser's scroll anchoring can still move it when rows arrive\n * above the view, unless the host sets `overflow-anchor: none` on its\n * scroller. The wrapper is `aria-busy` while a selected row it reveals is\n * still on its way.\n *\n * With `layout=\"panes\"` the list and the detail are two `Pane`s of the\n * `PaneLayout` it is set in, divided by a hairline, and each scrolls on its\n * own. Above 768 px the detail stands at its pane's top, and a reveal\n * scrolls the list's pane to the row and the detail's pane to its top. At\n * 768 px and below there is only the list's pane, which draws the detail\n * right after the selected row as the column form does, and a reveal\n * scrolls the nearest scroller around it, the stacked `PaneLayout` in a\n * bleed page. The list is `aria-busy` while a selected row is on its way.\n */\nexport function DetailBeside(props: DetailBesideProps) {\n const { detail, children, revealKey } = props;\n const panes = props.layout === 'panes';\n const scrollContainer = panes ? null : (props.scrollContainer ?? null);\n const narrow = useMediaQuery(NARROW_QUERY);\n const [busy, setBusy] = useState(false);\n const listRef = useRef<HTMLDivElement>(null);\n const spacerRef = useRef<HTMLDivElement>(null);\n const detailRef = useRef<HTMLDivElement>(null);\n /** Above 768 px in the pane form, the detail's box, whose parent is its pane. */\n const detailPaneRef = useRef<HTMLDivElement>(null);\n /** The scroller of the last reveal, whose scroll by the viewer ends following. */\n const scrollerRef = useRef<HTMLElement | null>(null);\n const rowRef = useRef<HTMLElement | null>(null);\n /** Whether the page is still where the last reveal left it. */\n const followRef = useRef(false);\n const revealedAtRef = useRef(0);\n /** The latest render's revealKey, and the last reveal's: undefined before the first. */\n const revealKeyRef = useRef(revealKey);\n const revealedKeyRef = useRef<string | null | undefined>(undefined);\n /** The latest render's list and detail, which change when the host renders them anew. */\n const shownRef = useRef({ children, detail });\n\n /**\n * Sets the detail level with the row: above 768 px through the spacer's\n * height, at and below by telling the inline detail how tall the row is.\n * While the list draws no row selected, such as when a filter or a closed\n * parent hides it, the detail stands at the top of its column.\n */\n const place = useCallback(() => {\n const row = rowRef.current;\n const box = detailRef.current;\n const spacer = spacerRef.current;\n if (row === null) {\n spacer?.style.removeProperty('height');\n return;\n }\n if (box === null) {\n return;\n }\n const rowBox = row.getBoundingClientRect();\n if (spacer === null) {\n box.style.setProperty(\n '--aegis-detail-beside-row-height',\n `${String(rowBox.height)}px`,\n );\n const scroller =\n panes && listRef.current !== null\n ? scrollingAncestorOf(listRef.current)\n : null;\n if (scroller === null) {\n box.style.removeProperty('--detail-beside-view-height');\n box.style.removeProperty('--detail-beside-sticky-top');\n } else {\n box.style.setProperty(\n '--detail-beside-view-height',\n `${String(scroller.clientHeight)}px`,\n );\n box.style.setProperty('--detail-beside-sticky-top', '0px');\n }\n } else {\n const top = spacer.getBoundingClientRect().top;\n spacer.style.height = `${String(Math.max(rowBox.top - top, 0))}px`;\n }\n }, [panes]);\n\n /** Places the row and scrolls as little as it takes to show it and its detail whole. */\n const reveal = useCallback(() => {\n place();\n const row = rowRef.current;\n const list = listRef.current;\n const box = detailRef.current;\n // The detail's own pane, above 768 px, leaves only the row to show.\n const besidePane = detailPaneRef.current !== null;\n if (row === null || list === null || (box === null && !besidePane)) {\n return;\n }\n const container = panes ? scrollingAncestorOf(list) : scrollContainer;\n const rowBox = row.getBoundingClientRect();\n const spacer = spacerRef.current;\n const distance = revealDistance(\n rowBox,\n spacer === null ? rowBox.bottom : spacer.getBoundingClientRect().top,\n box === null ? 0 : box.getBoundingClientRect().height,\n box === null ? 0 : parseFloat(getComputedStyle(box).scrollMarginTop),\n viewBoundsOf(container),\n );\n const scroller = scrollerOf(container);\n if (Math.abs(distance) >= 1) {\n scroller.scrollBy({ top: distance, behavior: 'instant' });\n }\n scrollerRef.current = scroller;\n revealedAtRef.current = scroller.scrollTop;\n }, [panes, place, scrollContainer]);\n\n // A list places its row while React attaches refs, before the detail's\n // own ref is in and before the re-renders its layout effects ask for,\n // so the reveal waits for the commit to finish.\n const revealSoon = useCallback(() => {\n revealedKeyRef.current = revealKeyRef.current;\n detailPaneRef.current?.parentElement?.scrollTo({\n top: 0,\n behavior: 'instant',\n });\n followRef.current = true;\n setBusy(true);\n queueMicrotask(() => {\n reveal();\n setBusy(false);\n });\n }, [reveal]);\n\n // A row placed while a reveal is due is revealed; any other is levelled\n // with, and a new one ends following.\n const placeRow = useCallback(\n (row: HTMLElement | null) => {\n const fresh = row !== rowRef.current;\n rowRef.current = row;\n if (row === null) {\n followRef.current = false;\n setBusy(false);\n place();\n } else if (revealedKeyRef.current !== revealKeyRef.current) {\n revealSoon();\n } else {\n if (fresh) {\n followRef.current = false;\n }\n place();\n }\n },\n [place, revealSoon],\n );\n\n const awaitRow = useCallback(() => {\n setBusy(true);\n }, []);\n\n // Runs after the lists have placed their rows in this commit, so a new\n // revealKey reveals the row it selects. A render by the host without one\n // ends following.\n useIsomorphicLayoutEffect(() => {\n const rendered =\n shownRef.current.children !== children ||\n shownRef.current.detail !== detail;\n shownRef.current = { children, detail };\n revealKeyRef.current = revealKey;\n if (revealedKeyRef.current !== revealKey && rowRef.current !== null) {\n revealSoon();\n } else {\n if (rendered) {\n followRef.current = false;\n }\n place();\n }\n });\n\n useIsomorphicLayoutEffect(() => {\n const list = listRef.current;\n if (list === null) {\n return undefined;\n }\n const observer = new ResizeObserver(() => {\n if (followRef.current) {\n reveal();\n } else {\n place();\n }\n });\n // At 768 px and below the detail lies inside the list.\n for (const box of narrow ? [list] : [list, detailRef.current]) {\n if (box !== null) {\n observer.observe(box);\n }\n }\n const activate = (event: MouseEvent): void => {\n if (\n event.target instanceof Node &&\n rowRef.current?.contains(event.target)\n ) {\n revealSoon();\n }\n };\n list.addEventListener('click', activate);\n return () => {\n observer.disconnect();\n list.removeEventListener('click', activate);\n };\n }, [narrow, place, reveal, revealSoon]);\n\n useEffect(() => {\n const scrolled = (): void => {\n const scroller = scrollerRef.current;\n if (\n scroller !== null &&\n Math.abs(scroller.scrollTop - revealedAtRef.current) >= 1\n ) {\n followRef.current = false;\n }\n };\n // The pane form's scroller is whichever holds the list, found at each\n // reveal; scroll events do not bubble, but they pass the document.\n const target = panes ? document : (scrollContainer ?? window);\n const options = { capture: panes, passive: true };\n target.addEventListener('scroll', scrolled, options);\n return () => {\n target.removeEventListener('scroll', scrolled, options);\n };\n }, [panes, scrollContainer]);\n\n const inline = useMemo(\n () => (narrow ? <InlineDetail boxRef={detailRef} /> : null),\n [narrow],\n );\n const slot = useMemo(\n (): SelectedRowDetail => ({ placeRow, awaitRow, inline }),\n [placeRow, awaitRow, inline],\n );\n const isolated = (\n <SelectedRowDetailContext.Provider value={null}>\n {detail}\n </SelectedRowDetailContext.Provider>\n );\n\n if (props.layout === 'panes') {\n return (\n <SelectedRowDetailContext.Provider value={slot}>\n <DetailContext.Provider value={isolated}>\n <Pane size=\"fill\" {...props.listPane}>\n <div\n ref={listRef}\n className=\"aegis-detail-beside__list\"\n aria-busy={busy || undefined}\n >\n {children}\n </div>\n </Pane>\n {!narrow && (\n <Pane size=\"lg\" {...props.detailPane}>\n <div ref={detailPaneRef}>{isolated}</div>\n </Pane>\n )}\n </DetailContext.Provider>\n </SelectedRowDetailContext.Provider>\n );\n }\n\n const cls = ['aegis-detail-beside', props.className ?? '']\n .filter(Boolean)\n .join(' ');\n\n return (\n <SelectedRowDetailContext.Provider value={slot}>\n <DetailContext.Provider value={isolated}>\n <div\n className={cls}\n style={\n {\n '--aegis-detail-beside-columns': props.columns,\n } as CSSProperties\n }\n aria-busy={busy || undefined}\n >\n <div ref={listRef} className=\"aegis-detail-beside__list\">\n {children}\n </div>\n {!narrow && (\n <div className=\"aegis-detail-beside__side\">\n <div ref={spacerRef} />\n <div ref={detailRef} className=\"aegis-detail-beside__detail\">\n {isolated}\n </div>\n </div>\n )}\n </div>\n </DetailContext.Provider>\n </SelectedRowDetailContext.Provider>\n );\n}\n"],"names":["NARROW_QUERY","DetailContext","createContext","revealDistance","row","ceiling","height","inset","view","top","toRow","InlineDetail","boxRef","detail","useContext","jsx","DetailBeside","props","children","revealKey","panes","scrollContainer","narrow","useMediaQuery","busy","setBusy","useState","listRef","useRef","spacerRef","detailRef","detailPaneRef","scrollerRef","rowRef","followRef","revealedAtRef","revealKeyRef","revealedKeyRef","shownRef","place","useCallback","box","spacer","rowBox","scroller","scrollingAncestorOf","reveal","list","besidePane","container","distance","viewBoundsOf","scrollerOf","revealSoon","placeRow","fresh","awaitRow","useIsomorphicLayoutEffect","rendered","observer","activate","event","useEffect","scrolled","target","options","inline","useMemo","slot","isolated","SelectedRowDetailContext","jsxs","Pane","cls"],"mappings":";;;;;;;;AA4FA,MAAMA,KAAe,sBAMfC,IAAgBC,EAAyB,IAAI;AAOnD,SAASC,GACPC,GACAC,GACAC,GACAC,GACAC,GACQ;AACR,QAAMC,IAAMD,EAAK,MAAMD,GACjBG,IACJN,EAAI,MAAMK,IAAML,EAAI,MAAMK,IAAM,KAAK,IAAIL,EAAI,SAASI,EAAK,QAAQ,CAAC;AACtE,SAAO,KAAK,IAAIE,GAAOL,IAAUC,IAASE,EAAK,MAAM;AACvD;AAGA,SAASG,GAAa,EAAE,QAAAC,KAAiD;AACvE,QAAMC,IAASC,EAAWb,CAAa;AACvC,SACE,gBAAAc,EAAC,SAAI,KAAKH,GAAQ,WAAU,+BAA8B,MAAK,SAC5D,UAAAC,EAAA,CACH;AAEJ;AA+BO,SAASG,GAAaC,GAA0B;AACrD,QAAM,EAAE,QAAAJ,GAAQ,UAAAK,GAAU,WAAAC,EAAA,IAAcF,GAClCG,IAAQH,EAAM,WAAW,SACzBI,IAAkBD,IAAQ,OAAQH,EAAM,mBAAmB,MAC3DK,IAASC,EAAcvB,EAAY,GACnC,CAACwB,GAAMC,CAAO,IAAIC,EAAS,EAAK,GAChCC,IAAUC,EAAuB,IAAI,GACrCC,IAAYD,EAAuB,IAAI,GACvCE,IAAYF,EAAuB,IAAI,GAEvCG,IAAgBH,EAAuB,IAAI,GAE3CI,IAAcJ,EAA2B,IAAI,GAC7CK,IAASL,EAA2B,IAAI,GAExCM,IAAYN,EAAO,EAAK,GACxBO,IAAgBP,EAAO,CAAC,GAExBQ,IAAeR,EAAOT,CAAS,GAC/BkB,IAAiBT,EAAkC,MAAS,GAE5DU,IAAWV,EAAO,EAAE,UAAAV,GAAU,QAAAL,GAAQ,GAQtC0B,IAAQC,EAAY,MAAM;AAC9B,UAAMpC,IAAM6B,EAAO,SACbQ,IAAMX,EAAU,SAChBY,IAASb,EAAU;AAC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WAAU,6BACb,UAAA;AAAA,UAAA,gBAAAxD,EAAC,OAAA,EAAI,KAAKc,EAAA,CAAW;AAAA,4BACpB,OAAA,EAAI,KAAKC,GAAW,WAAU,+BAC5B,UAAAuC,EAAA,CACH;AAAA,QAAA,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAGN,EAAA,CACF;AAEJ;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime");;/* empty css */function c({children:i,size:n="md",title:e,className:r}){const s=["aegis-line-icon",`aegis-line-icon--${n}`,r??""].filter(Boolean).join(" ");return o.jsxs("svg",{className:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",role:e===void 0?void 0:"img","aria-hidden":e===void 0?!0:void 0,"aria-label":e,focusable:"false",children:[e!==void 0&&o.jsx("title",{children:e}),i]})}exports.LineIcon=c;
2
+ //# sourceMappingURL=LineIcon.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LineIcon.cjs","sources":["../../../src/components/ui/LineIcon.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport './LineIcon.css';\n\nexport interface LineIconProps {\n /**\n * The glyph's geometry on a 24-unit grid: `path`, `circle`, `rect` and\n * the like. The icon strokes them in the current text colour.\n */\n children: ReactNode;\n /** `sm` = `--line-icon-size-sm` (14), `md` 16, `lg` 18. */\n size?: 'sm' | 'md' | 'lg';\n /** Accessible name. Without one the icon is decorative and hidden. */\n title?: string;\n className?: string;\n}\n\n/** A stroked line glyph: 24-unit grid, round caps and joins, no fill. */\nexport function LineIcon({\n children,\n size = 'md',\n title,\n className,\n}: LineIconProps) {\n const cls = ['aegis-line-icon', `aegis-line-icon--${size}`, className ?? '']\n .filter(Boolean)\n .join(' ');\n return (\n <svg\n className={cls}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n role={title === undefined ? undefined : 'img'}\n aria-hidden={title === undefined ? true : undefined}\n aria-label={title}\n focusable=\"false\"\n >\n {title !== undefined && <title>{title}</title>}\n {children}\n </svg>\n );\n}\n"],"names":["LineIcon","children","size","title","className","cls","jsxs","jsx"],"mappings":"mJAkBO,SAASA,EAAS,CACvB,SAAAC,EACA,KAAAC,EAAO,KACP,MAAAC,EACA,UAAAC,CACF,EAAkB,CAChB,MAAMC,EAAM,CAAC,kBAAmB,oBAAoBH,CAAI,GAAIE,GAAa,EAAE,EACxE,OAAO,OAAO,EACd,KAAK,GAAG,EACX,OACEE,EAAAA,KAAC,MAAA,CACC,UAAWD,EACX,QAAQ,YACR,KAAK,OACL,OAAO,eACP,cAAc,QACd,eAAe,QACf,KAAMF,IAAU,OAAY,OAAY,MACxC,cAAaA,IAAU,OAAY,GAAO,OAC1C,aAAYA,EACZ,UAAU,QAET,SAAA,CAAAA,IAAU,QAAaI,EAAAA,IAAC,QAAA,CAAO,SAAAJ,EAAM,EACrCF,CAAA,CAAA,CAAA,CAGP"}
@@ -0,0 +1,15 @@
1
+ import { ReactNode } from 'react';
2
+ export interface LineIconProps {
3
+ /**
4
+ * The glyph's geometry on a 24-unit grid: `path`, `circle`, `rect` and
5
+ * the like. The icon strokes them in the current text colour.
6
+ */
7
+ children: ReactNode;
8
+ /** `sm` = `--line-icon-size-sm` (14), `md` 16, `lg` 18. */
9
+ size?: 'sm' | 'md' | 'lg';
10
+ /** Accessible name. Without one the icon is decorative and hidden. */
11
+ title?: string;
12
+ className?: string;
13
+ }
14
+ /** A stroked line glyph: 24-unit grid, round caps and joins, no fill. */
15
+ export declare function LineIcon({ children, size, title, className, }: LineIconProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,33 @@
1
+ import { jsxs as s, jsx as a } from "react/jsx-runtime";
2
+ /* empty css */
3
+ function d({
4
+ children: i,
5
+ size: e = "md",
6
+ title: o,
7
+ className: n
8
+ }) {
9
+ const r = ["aegis-line-icon", `aegis-line-icon--${e}`, n ?? ""].filter(Boolean).join(" ");
10
+ return /* @__PURE__ */ s(
11
+ "svg",
12
+ {
13
+ className: r,
14
+ viewBox: "0 0 24 24",
15
+ fill: "none",
16
+ stroke: "currentColor",
17
+ strokeLinecap: "round",
18
+ strokeLinejoin: "round",
19
+ role: o === void 0 ? void 0 : "img",
20
+ "aria-hidden": o === void 0 ? !0 : void 0,
21
+ "aria-label": o,
22
+ focusable: "false",
23
+ children: [
24
+ o !== void 0 && /* @__PURE__ */ a("title", { children: o }),
25
+ i
26
+ ]
27
+ }
28
+ );
29
+ }
30
+ export {
31
+ d as LineIcon
32
+ };
33
+ //# sourceMappingURL=LineIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LineIcon.js","sources":["../../../src/components/ui/LineIcon.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport './LineIcon.css';\n\nexport interface LineIconProps {\n /**\n * The glyph's geometry on a 24-unit grid: `path`, `circle`, `rect` and\n * the like. The icon strokes them in the current text colour.\n */\n children: ReactNode;\n /** `sm` = `--line-icon-size-sm` (14), `md` 16, `lg` 18. */\n size?: 'sm' | 'md' | 'lg';\n /** Accessible name. Without one the icon is decorative and hidden. */\n title?: string;\n className?: string;\n}\n\n/** A stroked line glyph: 24-unit grid, round caps and joins, no fill. */\nexport function LineIcon({\n children,\n size = 'md',\n title,\n className,\n}: LineIconProps) {\n const cls = ['aegis-line-icon', `aegis-line-icon--${size}`, className ?? '']\n .filter(Boolean)\n .join(' ');\n return (\n <svg\n className={cls}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n role={title === undefined ? undefined : 'img'}\n aria-hidden={title === undefined ? true : undefined}\n aria-label={title}\n focusable=\"false\"\n >\n {title !== undefined && <title>{title}</title>}\n {children}\n </svg>\n );\n}\n"],"names":["LineIcon","children","size","title","className","cls","jsxs","jsx"],"mappings":";;AAkBO,SAASA,EAAS;AAAA,EACvB,UAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,WAAAC;AACF,GAAkB;AAChB,QAAMC,IAAM,CAAC,mBAAmB,oBAAoBH,CAAI,IAAIE,KAAa,EAAE,EACxE,OAAO,OAAO,EACd,KAAK,GAAG;AACX,SACE,gBAAAE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWD;AAAA,MACX,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,QAAO;AAAA,MACP,eAAc;AAAA,MACd,gBAAe;AAAA,MACf,MAAMF,MAAU,SAAY,SAAY;AAAA,MACxC,eAAaA,MAAU,SAAY,KAAO;AAAA,MAC1C,cAAYA;AAAA,MACZ,WAAU;AAAA,MAET,UAAA;AAAA,QAAAA,MAAU,UAAa,gBAAAI,EAAC,SAAA,EAAO,UAAAJ,GAAM;AAAA,QACrCF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime");;/* empty css */function l({direction:n="row",children:i,className:e}){const a=["aegis-pane-layout",`aegis-pane-layout--${n}`,e??""].filter(Boolean).join(" ");return s.jsx("div",{className:a,children:i})}function r({size:n="fill",padding:i="md",label:e,children:a,className:t}){const o=["aegis-pane",`aegis-pane--${n}`,`aegis-pane--padding-${i}`,t??""].filter(Boolean).join(" ");return e===void 0?s.jsx("div",{className:o,children:a}):s.jsx("section",{className:o,"aria-label":e,children:a})}exports.Pane=r;exports.PaneLayout=l;
2
+ //# sourceMappingURL=PaneLayout.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PaneLayout.cjs","sources":["../../../src/components/ui/PaneLayout.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport './PaneLayout.css';\n\nexport interface PaneLayoutProps {\n /** `row` sets the panes side by side, `column` stacks them. */\n direction?: 'row' | 'column';\n /**\n * `Pane`s, or nested `PaneLayout`s set directly in place of a pane: a\n * nested layout fills its share as a pane does, and is not wrapped in one.\n */\n children: ReactNode;\n className?: string;\n}\n\n/**\n * A region filled edge to edge by panes, each divided from the next by a\n * hairline, with no gap and no card around them. It grows to fill a flex\n * parent such as a bleed `PageWrapper`; at 768 px or narrower a row stacks\n * and the whole layout scrolls as one.\n */\nexport function PaneLayout({\n direction = 'row',\n children,\n className,\n}: PaneLayoutProps) {\n const cls = [\n 'aegis-pane-layout',\n `aegis-pane-layout--${direction}`,\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n return <div className={cls}>{children}</div>;\n}\n\nexport interface PaneProps {\n /**\n * `fill` shares the room left by the others; `sm`, `md` and `lg` are the\n * fixed `--pane-width-*` widths of a row; `auto` takes its content's size.\n */\n size?: 'fill' | 'sm' | 'md' | 'lg' | 'auto';\n /** `md` insets the content by `--space-6` (`--space-4` at ≤768 px). */\n padding?: 'none' | 'md';\n /** Names the pane for assistive technology, making it a region. */\n label?: string;\n children: ReactNode;\n className?: string;\n}\n\n/** One pane of a `PaneLayout`; it scrolls its own content. */\nexport function Pane({\n size = 'fill',\n padding = 'md',\n label,\n children,\n className,\n}: PaneProps) {\n const cls = [\n 'aegis-pane',\n `aegis-pane--${size}`,\n `aegis-pane--padding-${padding}`,\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n return label === undefined ? (\n <div className={cls}>{children}</div>\n ) : (\n <section className={cls} aria-label={label}>\n {children}\n </section>\n );\n}\n"],"names":["PaneLayout","direction","children","className","cls","jsx","Pane","size","padding","label"],"mappings":"qJAqBO,SAASA,EAAW,CACzB,UAAAC,EAAY,MACZ,SAAAC,EACA,UAAAC,CACF,EAAoB,CAClB,MAAMC,EAAM,CACV,oBACA,sBAAsBH,CAAS,GAC/BE,GAAa,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG,EACX,OAAOE,EAAAA,IAAC,MAAA,CAAI,UAAWD,EAAM,SAAAF,CAAA,CAAS,CACxC,CAiBO,SAASI,EAAK,CACnB,KAAAC,EAAO,OACP,QAAAC,EAAU,KACV,MAAAC,EACA,SAAAP,EACA,UAAAC,CACF,EAAc,CACZ,MAAMC,EAAM,CACV,aACA,eAAeG,CAAI,GACnB,uBAAuBC,CAAO,GAC9BL,GAAa,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG,EACX,OAAOM,IAAU,OACfJ,EAAAA,IAAC,MAAA,CAAI,UAAWD,EAAM,SAAAF,CAAA,CAAS,EAE/BG,EAAAA,IAAC,UAAA,CAAQ,UAAWD,EAAK,aAAYK,EAClC,SAAAP,EACH,CAEJ"}
@@ -0,0 +1,33 @@
1
+ import { ReactNode } from 'react';
2
+ export interface PaneLayoutProps {
3
+ /** `row` sets the panes side by side, `column` stacks them. */
4
+ direction?: 'row' | 'column';
5
+ /**
6
+ * `Pane`s, or nested `PaneLayout`s set directly in place of a pane: a
7
+ * nested layout fills its share as a pane does, and is not wrapped in one.
8
+ */
9
+ children: ReactNode;
10
+ className?: string;
11
+ }
12
+ /**
13
+ * A region filled edge to edge by panes, each divided from the next by a
14
+ * hairline, with no gap and no card around them. It grows to fill a flex
15
+ * parent such as a bleed `PageWrapper`; at 768 px or narrower a row stacks
16
+ * and the whole layout scrolls as one.
17
+ */
18
+ export declare function PaneLayout({ direction, children, className, }: PaneLayoutProps): import("react/jsx-runtime").JSX.Element;
19
+ export interface PaneProps {
20
+ /**
21
+ * `fill` shares the room left by the others; `sm`, `md` and `lg` are the
22
+ * fixed `--pane-width-*` widths of a row; `auto` takes its content's size.
23
+ */
24
+ size?: 'fill' | 'sm' | 'md' | 'lg' | 'auto';
25
+ /** `md` insets the content by `--space-6` (`--space-4` at ≤768 px). */
26
+ padding?: 'none' | 'md';
27
+ /** Names the pane for assistive technology, making it a region. */
28
+ label?: string;
29
+ children: ReactNode;
30
+ className?: string;
31
+ }
32
+ /** One pane of a `PaneLayout`; it scrolls its own content. */
33
+ export declare function Pane({ size, padding, label, children, className, }: PaneProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,34 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ /* empty css */
3
+ function c({
4
+ direction: n = "row",
5
+ children: o,
6
+ className: a
7
+ }) {
8
+ const e = [
9
+ "aegis-pane-layout",
10
+ `aegis-pane-layout--${n}`,
11
+ a ?? ""
12
+ ].filter(Boolean).join(" ");
13
+ return /* @__PURE__ */ i("div", { className: e, children: o });
14
+ }
15
+ function p({
16
+ size: n = "fill",
17
+ padding: o = "md",
18
+ label: a,
19
+ children: e,
20
+ className: t
21
+ }) {
22
+ const s = [
23
+ "aegis-pane",
24
+ `aegis-pane--${n}`,
25
+ `aegis-pane--padding-${o}`,
26
+ t ?? ""
27
+ ].filter(Boolean).join(" ");
28
+ return a === void 0 ? /* @__PURE__ */ i("div", { className: s, children: e }) : /* @__PURE__ */ i("section", { className: s, "aria-label": a, children: e });
29
+ }
30
+ export {
31
+ p as Pane,
32
+ c as PaneLayout
33
+ };
34
+ //# sourceMappingURL=PaneLayout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PaneLayout.js","sources":["../../../src/components/ui/PaneLayout.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport './PaneLayout.css';\n\nexport interface PaneLayoutProps {\n /** `row` sets the panes side by side, `column` stacks them. */\n direction?: 'row' | 'column';\n /**\n * `Pane`s, or nested `PaneLayout`s set directly in place of a pane: a\n * nested layout fills its share as a pane does, and is not wrapped in one.\n */\n children: ReactNode;\n className?: string;\n}\n\n/**\n * A region filled edge to edge by panes, each divided from the next by a\n * hairline, with no gap and no card around them. It grows to fill a flex\n * parent such as a bleed `PageWrapper`; at 768 px or narrower a row stacks\n * and the whole layout scrolls as one.\n */\nexport function PaneLayout({\n direction = 'row',\n children,\n className,\n}: PaneLayoutProps) {\n const cls = [\n 'aegis-pane-layout',\n `aegis-pane-layout--${direction}`,\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n return <div className={cls}>{children}</div>;\n}\n\nexport interface PaneProps {\n /**\n * `fill` shares the room left by the others; `sm`, `md` and `lg` are the\n * fixed `--pane-width-*` widths of a row; `auto` takes its content's size.\n */\n size?: 'fill' | 'sm' | 'md' | 'lg' | 'auto';\n /** `md` insets the content by `--space-6` (`--space-4` at ≤768 px). */\n padding?: 'none' | 'md';\n /** Names the pane for assistive technology, making it a region. */\n label?: string;\n children: ReactNode;\n className?: string;\n}\n\n/** One pane of a `PaneLayout`; it scrolls its own content. */\nexport function Pane({\n size = 'fill',\n padding = 'md',\n label,\n children,\n className,\n}: PaneProps) {\n const cls = [\n 'aegis-pane',\n `aegis-pane--${size}`,\n `aegis-pane--padding-${padding}`,\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n return label === undefined ? (\n <div className={cls}>{children}</div>\n ) : (\n <section className={cls} aria-label={label}>\n {children}\n </section>\n );\n}\n"],"names":["PaneLayout","direction","children","className","cls","jsx","Pane","size","padding","label"],"mappings":";;AAqBO,SAASA,EAAW;AAAA,EACzB,WAAAC,IAAY;AAAA,EACZ,UAAAC;AAAA,EACA,WAAAC;AACF,GAAoB;AAClB,QAAMC,IAAM;AAAA,IACV;AAAA,IACA,sBAAsBH,CAAS;AAAA,IAC/BE,KAAa;AAAA,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG;AACX,SAAO,gBAAAE,EAAC,OAAA,EAAI,WAAWD,GAAM,UAAAF,EAAA,CAAS;AACxC;AAiBO,SAASI,EAAK;AAAA,EACnB,MAAAC,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,OAAAC;AAAA,EACA,UAAAP;AAAA,EACA,WAAAC;AACF,GAAc;AACZ,QAAMC,IAAM;AAAA,IACV;AAAA,IACA,eAAeG,CAAI;AAAA,IACnB,uBAAuBC,CAAO;AAAA,IAC9BL,KAAa;AAAA,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG;AACX,SAAOM,MAAU,SACf,gBAAAJ,EAAC,OAAA,EAAI,WAAWD,GAAM,UAAAF,EAAA,CAAS,IAE/B,gBAAAG,EAAC,WAAA,EAAQ,WAAWD,GAAK,cAAYK,GAClC,UAAAP,GACH;AAEJ;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime");;/* empty css */function i({tone:e="neutral",children:t,className:o}){const u=["aegis-quote",`aegis-quote--${e}`,o??""].filter(Boolean).join(" ");return r.jsx("blockquote",{className:u,children:t})}exports.Quote=i;
2
+ //# sourceMappingURL=Quote.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Quote.cjs","sources":["../../../src/components/ui/Quote.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport './Quote.css';\n\nexport interface QuoteProps {\n /**\n * `neutral` sets off text quoted from a source, e.g. a requirement's\n * statement. `warning` is the anomaly tone: quoted failure output only.\n */\n tone?: 'neutral' | 'warning';\n children: ReactNode;\n className?: string;\n}\n\n/** Quoted text set off by a rule down its left edge. */\nexport function Quote({ tone = 'neutral', children, className }: QuoteProps) {\n const cls = ['aegis-quote', `aegis-quote--${tone}`, className ?? '']\n .filter(Boolean)\n .join(' ');\n return <blockquote className={cls}>{children}</blockquote>;\n}\n"],"names":["Quote","tone","children","className","cls","jsx"],"mappings":"gJAeO,SAASA,EAAM,CAAE,KAAAC,EAAO,UAAW,SAAAC,EAAU,UAAAC,GAAyB,CAC3E,MAAMC,EAAM,CAAC,cAAe,gBAAgBH,CAAI,GAAIE,GAAa,EAAE,EAChE,OAAO,OAAO,EACd,KAAK,GAAG,EACX,OAAOE,EAAAA,IAAC,aAAA,CAAW,UAAWD,EAAM,SAAAF,CAAA,CAAS,CAC/C"}
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+ export interface QuoteProps {
3
+ /**
4
+ * `neutral` sets off text quoted from a source, e.g. a requirement's
5
+ * statement. `warning` is the anomaly tone: quoted failure output only.
6
+ */
7
+ tone?: 'neutral' | 'warning';
8
+ children: ReactNode;
9
+ className?: string;
10
+ }
11
+ /** Quoted text set off by a rule down its left edge. */
12
+ export declare function Quote({ tone, children, className }: QuoteProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ /* empty css */
3
+ function u({ tone: o = "neutral", children: e, className: t }) {
4
+ const r = ["aegis-quote", `aegis-quote--${o}`, t ?? ""].filter(Boolean).join(" ");
5
+ return /* @__PURE__ */ i("blockquote", { className: r, children: e });
6
+ }
7
+ export {
8
+ u as Quote
9
+ };
10
+ //# sourceMappingURL=Quote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Quote.js","sources":["../../../src/components/ui/Quote.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport './Quote.css';\n\nexport interface QuoteProps {\n /**\n * `neutral` sets off text quoted from a source, e.g. a requirement's\n * statement. `warning` is the anomaly tone: quoted failure output only.\n */\n tone?: 'neutral' | 'warning';\n children: ReactNode;\n className?: string;\n}\n\n/** Quoted text set off by a rule down its left edge. */\nexport function Quote({ tone = 'neutral', children, className }: QuoteProps) {\n const cls = ['aegis-quote', `aegis-quote--${tone}`, className ?? '']\n .filter(Boolean)\n .join(' ');\n return <blockquote className={cls}>{children}</blockquote>;\n}\n"],"names":["Quote","tone","children","className","cls","jsx"],"mappings":";;AAeO,SAASA,EAAM,EAAE,MAAAC,IAAO,WAAW,UAAAC,GAAU,WAAAC,KAAyB;AAC3E,QAAMC,IAAM,CAAC,eAAe,gBAAgBH,CAAI,IAAIE,KAAa,EAAE,EAChE,OAAO,OAAO,EACd,KAAK,GAAG;AACX,SAAO,gBAAAE,EAAC,cAAA,EAAW,WAAWD,GAAM,UAAAF,EAAA,CAAS;AAC/C;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");;/* empty css */function a({children:s,extra:i,rule:r=!0,className:n}){const d=["aegis-section-divider",r?"aegis-section-divider--ruled":"",n??""].filter(Boolean).join(" ");return e.jsx("div",{className:d,children:e.jsxs("div",{className:"aegis-section-divider__head",children:[e.jsx("span",{className:"aegis-section-divider__label",children:s}),i&&e.jsx("span",{className:"aegis-section-divider__extra",children:i})]})})}exports.SectionDivider=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");;/* empty css */function t({children:s,extra:i,rule:r=!0,variant:d="meta",className:n}){const a=["aegis-section-divider",r?"aegis-section-divider--ruled":"",d==="group"?"aegis-section-divider--group":"",n??""].filter(Boolean).join(" ");return e.jsx("div",{className:a,children:e.jsxs("div",{className:"aegis-section-divider__head",children:[e.jsx("span",{className:"aegis-section-divider__label",children:s}),i&&e.jsx("span",{className:"aegis-section-divider__extra",children:i})]})})}exports.SectionDivider=t;
2
2
  //# sourceMappingURL=SectionDivider.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"SectionDivider.cjs","sources":["../../../src/components/ui/SectionDivider.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport './SectionDivider.css';\n\ninterface SectionDividerProps {\n /** Uppercase tracked label. */\n children: ReactNode;\n /** Right-aligned content (chip / link / mono value). */\n extra?: ReactNode;\n /** Render the hairline rule below the label. */\n rule?: boolean;\n className?: string;\n}\n\nexport function SectionDivider({\n children,\n extra,\n rule = true,\n className,\n}: SectionDividerProps) {\n const cls = [\n 'aegis-section-divider',\n rule ? 'aegis-section-divider--ruled' : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className={cls}>\n <div className=\"aegis-section-divider__head\">\n <span className=\"aegis-section-divider__label\">{children}</span>\n {extra && <span className=\"aegis-section-divider__extra\">{extra}</span>}\n </div>\n </div>\n );\n}\n"],"names":["SectionDivider","children","extra","rule","className","cls","jsxs","jsx"],"mappings":"yJAcO,SAASA,EAAe,CAC7B,SAAAC,EACA,MAAAC,EACA,KAAAC,EAAO,GACP,UAAAC,CACF,EAAwB,CACtB,MAAMC,EAAM,CACV,wBACAF,EAAO,+BAAiC,GACxCC,GAAa,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG,EAEX,aACG,MAAA,CAAI,UAAWC,EACd,SAAAC,EAAAA,KAAC,MAAA,CAAI,UAAU,8BACb,SAAA,CAAAC,EAAAA,IAAC,OAAA,CAAK,UAAU,+BAAgC,SAAAN,CAAA,CAAS,EACxDC,GAASK,EAAAA,IAAC,OAAA,CAAK,UAAU,+BAAgC,SAAAL,CAAA,CAAM,CAAA,CAAA,CAClE,CAAA,CACF,CAEJ"}
1
+ {"version":3,"file":"SectionDivider.cjs","sources":["../../../src/components/ui/SectionDivider.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport './SectionDivider.css';\n\ninterface SectionDividerProps {\n /** Uppercase tracked label. */\n children: ReactNode;\n /** Right-aligned content (chip / link / mono value). */\n extra?: ReactNode;\n /** Render the hairline rule below the label. */\n rule?: boolean;\n /**\n * `meta` is the uppercase tracked micro label. `group` names a group of\n * fields or rows inside a pane in the label type role, in sentence case,\n * e.g. 原文 or 验证记录 with its count as the extra.\n */\n variant?: 'meta' | 'group';\n className?: string;\n}\n\nexport function SectionDivider({\n children,\n extra,\n rule = true,\n variant = 'meta',\n className,\n}: SectionDividerProps) {\n const cls = [\n 'aegis-section-divider',\n rule ? 'aegis-section-divider--ruled' : '',\n variant === 'group' ? 'aegis-section-divider--group' : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className={cls}>\n <div className=\"aegis-section-divider__head\">\n <span className=\"aegis-section-divider__label\">{children}</span>\n {extra && <span className=\"aegis-section-divider__extra\">{extra}</span>}\n </div>\n </div>\n );\n}\n"],"names":["SectionDivider","children","extra","rule","variant","className","cls","jsxs","jsx"],"mappings":"yJAoBO,SAASA,EAAe,CAC7B,SAAAC,EACA,MAAAC,EACA,KAAAC,EAAO,GACP,QAAAC,EAAU,OACV,UAAAC,CACF,EAAwB,CACtB,MAAMC,EAAM,CACV,wBACAH,EAAO,+BAAiC,GACxCC,IAAY,QAAU,+BAAiC,GACvDC,GAAa,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG,EAEX,aACG,MAAA,CAAI,UAAWC,EACd,SAAAC,EAAAA,KAAC,MAAA,CAAI,UAAU,8BACb,SAAA,CAAAC,EAAAA,IAAC,OAAA,CAAK,UAAU,+BAAgC,SAAAP,CAAA,CAAS,EACxDC,GAASM,EAAAA,IAAC,OAAA,CAAK,UAAU,+BAAgC,SAAAN,CAAA,CAAM,CAAA,CAAA,CAClE,CAAA,CACF,CAEJ"}
@@ -6,7 +6,13 @@ interface SectionDividerProps {
6
6
  extra?: ReactNode;
7
7
  /** Render the hairline rule below the label. */
8
8
  rule?: boolean;
9
+ /**
10
+ * `meta` is the uppercase tracked micro label. `group` names a group of
11
+ * fields or rows inside a pane in the label type role, in sentence case,
12
+ * e.g. 原文 or 验证记录 with its count as the extra.
13
+ */
14
+ variant?: 'meta' | 'group';
9
15
  className?: string;
10
16
  }
11
- export declare function SectionDivider({ children, extra, rule, className, }: SectionDividerProps): import("react/jsx-runtime").JSX.Element;
17
+ export declare function SectionDivider({ children, extra, rule, variant, className, }: SectionDividerProps): import("react/jsx-runtime").JSX.Element;
12
18
  export {};
@@ -1,22 +1,24 @@
1
- import { jsx as i, jsxs as n } from "react/jsx-runtime";
1
+ import { jsx as i, jsxs as o } from "react/jsx-runtime";
2
2
  /* empty css */
3
- function t({
3
+ function l({
4
4
  children: s,
5
5
  extra: e,
6
- rule: a = !0,
6
+ rule: r = !0,
7
+ variant: a = "meta",
7
8
  className: d
8
9
  }) {
9
- const r = [
10
+ const n = [
10
11
  "aegis-section-divider",
11
- a ? "aegis-section-divider--ruled" : "",
12
+ r ? "aegis-section-divider--ruled" : "",
13
+ a === "group" ? "aegis-section-divider--group" : "",
12
14
  d ?? ""
13
15
  ].filter(Boolean).join(" ");
14
- return /* @__PURE__ */ i("div", { className: r, children: /* @__PURE__ */ n("div", { className: "aegis-section-divider__head", children: [
16
+ return /* @__PURE__ */ i("div", { className: n, children: /* @__PURE__ */ o("div", { className: "aegis-section-divider__head", children: [
15
17
  /* @__PURE__ */ i("span", { className: "aegis-section-divider__label", children: s }),
16
18
  e && /* @__PURE__ */ i("span", { className: "aegis-section-divider__extra", children: e })
17
19
  ] }) });
18
20
  }
19
21
  export {
20
- t as SectionDivider
22
+ l as SectionDivider
21
23
  };
22
24
  //# sourceMappingURL=SectionDivider.js.map