@k2b/ui 0.65.0 → 0.66.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 (106) hide show
  1. package/README.md +47 -0
  2. package/dist/browser/v2/button.js +180 -0
  3. package/dist/browser/v2/button.js.map +1 -0
  4. package/dist/browser/v2/components.js +763 -0
  5. package/dist/browser/v2/components.js.map +1 -0
  6. package/dist/browser/v2/content.js +1107 -0
  7. package/dist/browser/v2/content.js.map +1 -0
  8. package/dist/browser/v2/controls.js +568 -0
  9. package/dist/browser/v2/controls.js.map +1 -0
  10. package/dist/browser/v2/describe.js +397 -0
  11. package/dist/browser/v2/describe.js.map +1 -0
  12. package/dist/browser/v2/index.js +25 -0
  13. package/dist/browser/v2/index.js.map +1 -0
  14. package/dist/browser/v2/layout.js +578 -0
  15. package/dist/browser/v2/layout.js.map +1 -0
  16. package/dist/browser/v2/link.js +9 -0
  17. package/dist/browser/v2/link.js.map +1 -0
  18. package/dist/browser/v2/marks.js +211 -0
  19. package/dist/browser/v2/marks.js.map +1 -0
  20. package/dist/browser/v2/states.js +180 -0
  21. package/dist/browser/v2/states.js.map +1 -0
  22. package/dist/browser/v2/structure.js +328 -0
  23. package/dist/browser/v2/structure.js.map +1 -0
  24. package/dist/browser/v2/testing/index.js +23 -0
  25. package/dist/browser/v2/testing/index.js.map +1 -0
  26. package/dist/browser/v2/testing/measure-v2-layout.js +762 -0
  27. package/dist/browser/v2/testing/measure-v2-layout.js.map +1 -0
  28. package/dist/browser/v2/testing/settled.js +52 -0
  29. package/dist/browser/v2/testing/settled.js.map +1 -0
  30. package/dist/browser/v2/tokens.js +83 -0
  31. package/dist/browser/v2/tokens.js.map +1 -0
  32. package/dist/browser/v2/types.js +24 -0
  33. package/dist/browser/v2/types.js.map +1 -0
  34. package/dist/ssr/v2/button.js +177 -0
  35. package/dist/ssr/v2/button.js.map +1 -0
  36. package/dist/ssr/v2/components.js +518 -0
  37. package/dist/ssr/v2/components.js.map +1 -0
  38. package/dist/ssr/v2/content.js +727 -0
  39. package/dist/ssr/v2/content.js.map +1 -0
  40. package/dist/ssr/v2/controls.js +268 -0
  41. package/dist/ssr/v2/controls.js.map +1 -0
  42. package/dist/ssr/v2/describe.js +397 -0
  43. package/dist/ssr/v2/describe.js.map +1 -0
  44. package/dist/ssr/v2/index.js +25 -0
  45. package/dist/ssr/v2/index.js.map +1 -0
  46. package/dist/ssr/v2/layout.js +377 -0
  47. package/dist/ssr/v2/layout.js.map +1 -0
  48. package/dist/ssr/v2/link.js +9 -0
  49. package/dist/ssr/v2/link.js.map +1 -0
  50. package/dist/ssr/v2/marks.js +126 -0
  51. package/dist/ssr/v2/marks.js.map +1 -0
  52. package/dist/ssr/v2/states.js +128 -0
  53. package/dist/ssr/v2/states.js.map +1 -0
  54. package/dist/ssr/v2/structure.js +229 -0
  55. package/dist/ssr/v2/structure.js.map +1 -0
  56. package/dist/ssr/v2/testing/index.js +23 -0
  57. package/dist/ssr/v2/testing/index.js.map +1 -0
  58. package/dist/ssr/v2/testing/measure-v2-layout.js +762 -0
  59. package/dist/ssr/v2/testing/measure-v2-layout.js.map +1 -0
  60. package/dist/ssr/v2/testing/settled.js +52 -0
  61. package/dist/ssr/v2/testing/settled.js.map +1 -0
  62. package/dist/ssr/v2/tokens.js +83 -0
  63. package/dist/ssr/v2/tokens.js.map +1 -0
  64. package/dist/ssr/v2/types.js +24 -0
  65. package/dist/ssr/v2/types.js.map +1 -0
  66. package/dist/types/v2/button.d.ts +54 -0
  67. package/dist/types/v2/components.d.ts +173 -0
  68. package/dist/types/v2/content.d.ts +233 -0
  69. package/dist/types/v2/controls.d.ts +118 -0
  70. package/dist/types/v2/describe.d.ts +18 -0
  71. package/dist/types/v2/index.d.ts +22 -0
  72. package/dist/types/v2/layout.d.ts +124 -0
  73. package/dist/types/v2/link.d.ts +7 -0
  74. package/dist/types/v2/marks.d.ts +90 -0
  75. package/dist/types/v2/states.d.ts +45 -0
  76. package/dist/types/v2/structure.d.ts +47 -0
  77. package/dist/types/v2/testing/index.d.ts +16 -0
  78. package/dist/types/v2/testing/measure-v2-layout.d.ts +99 -0
  79. package/dist/types/v2/testing/settled.d.ts +13 -0
  80. package/dist/types/v2/tokens.d.ts +77 -0
  81. package/dist/types/v2/types.d.ts +44 -0
  82. package/dist/v2.css +3072 -0
  83. package/package.json +23 -4
  84. package/skills/k2b-ui/SKILL.md +201 -0
  85. package/skills/k2b-ui/images/form-1440.png +0 -0
  86. package/skills/k2b-ui/images/form-390.png +0 -0
  87. package/skills/k2b-ui/images/list-detail-1440.png +0 -0
  88. package/skills/k2b-ui/images/list-detail-390.png +0 -0
  89. package/skills/k2b-ui/images/mail-1440.png +0 -0
  90. package/skills/k2b-ui/images/mail-390.png +0 -0
  91. package/skills/k2b-ui/images/record-1440.png +0 -0
  92. package/skills/k2b-ui/images/record-390.png +0 -0
  93. package/skills/k2b-ui/images/record-groups-1440.png +0 -0
  94. package/skills/k2b-ui/images/record-groups-390.png +0 -0
  95. package/skills/k2b-ui/images/table-1440.png +0 -0
  96. package/skills/k2b-ui/images/table-390.png +0 -0
  97. package/skills/k2b-ui/recipes/form.tsx +54 -0
  98. package/skills/k2b-ui/recipes/list-detail.tsx +105 -0
  99. package/skills/k2b-ui/recipes/mail.tsx +193 -0
  100. package/skills/k2b-ui/recipes/record-groups.tsx +115 -0
  101. package/skills/k2b-ui/recipes/record.tsx +163 -0
  102. package/skills/k2b-ui/recipes/table.tsx +68 -0
  103. package/skills/k2b-ui/references/mistakes.md +162 -0
  104. package/skills/k2b-ui/references/primitives.md +310 -0
  105. package/skills/k2b-ui/references/recipes.md +101 -0
  106. package/skills/k2b-ui/references/seeing.md +94 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["v2/testing/measure-v2-layout.ts"],"sourcesContent":["/**\n * A test helper, shipped as `@k2b/ui/v2/testing`: measures the layout rules of @k2b/ui v2 on a Playwright page, as numbers\n * against the mockup instead of a count of error classes (the lesson of the flat audit, 22.11.).\n *\n * - **edge:** a horizontal hairline or a tinted band reaches both edges of its column (within 1.5 px). A column edge\n * is a vertical hairline, an element matched by `columns`, or the edge of `root`.\n * - **double:** no two parallel lines lie at most 1 px apart over more than 1 px of length, also across components.\n * - **type:** every run of text is set in a type role: 12, 13, 14 or 18 px on a 16, 20 or 24 px line, in 400, 500 or\n * 600. Reading text (`prose`) may also use 16 px and a 22 px line.\n * - **grip:** the pill of every grip is centred on its 1 px line within ±0.25 CSS px, measured in the DOM and again\n * in the screenshot at the page's device pixel ratio, inside the grip only.\n *\n * A line is any way to draw one: a border side, a `box-shadow` without blur (offset or spread), a box of at most\n * 1.5 px, and the same on `::before` and `::after`, also under a `display: contents` parent whose own box has no\n * size. To measure a pseudo-element, the helper puts a stand-in element with the pseudo's computed style in its place\n * for the moment of the measurement and restores the page afterwards.\n *\n * Only what a person sees counts: a line or band is cut to the viewport and to every ancestor that clips it (a\n * scrolled column), so content scrolled out of view is measured after scrolling, not before. A rounded box (a\n * control, a mark, an overlay) floats on its own: its outline is no divider and makes no double line.\n *\n * The DOM contract of v2 marks what the rules need: `data-k2-column` (a column), `data-k2-grip` (a grip whose box is\n * its pill), `data-k2-prose` (reading text), `data-k2-figure` (a drawn mark such as the track of steps; its lines are\n * no dividers), `data-k2-canvas` (free drawing: never measured inside, only the line it draws itself) and\n * `data-k2-avatar` (initials, no type role). The options take other selectors, for the mockup's classes for example.\n *\n * - **inside:** a band or a group is one thing (rule 9): a horizontal hairline inside it separates its parts and is a\n * finding at any distance from other lines. A frame, a control's outline and a figure's track are no such line.\n * - **cut:** a control's label never leaves its box and is never clipped, unless it ends in \"…\" in its own box (the\n * way back to a list with a long name); a one-line text (the lines of a row, the\n * cells of a table with column widths) never wraps, it ends with \"…\"; a box that clips its text shows every line\n * whole and cuts a line at its end only with \"…\".\n *\n * ```ts\n * import { measureV2Layout } from \"@k2b/ui/v2/testing\";\n *\n * for (const deviceScaleFactor of [1, 2])\n * test(`DPR ${deviceScaleFactor}: the layout keeps the v2 rules`, async () => {\n * const page = await browser.newPage({ viewport: { width: 1440, height: 900 }, deviceScaleFactor });\n * await page.setContent(html);\n * expect((await measureV2Layout(page)).problems).toEqual([]);\n * });\n * ```\n */\nimport type { Page } from \"playwright\";\nimport { fontWeights, gripTolerance, hairline, typeRoles } from \"../tokens\";\nimport { settled } from \"./settled\";\n\nexport type V2LayoutOptions = {\n /** The element to measure; the whole body by default. */\n root?: string;\n /** Columns whose edges lines must reach. */\n columns?: string;\n /** Grips; each one's box is its pill. */\n grips?: string;\n /** Reading text, which may also use 16 px and a 22 px line. */\n prose?: string;\n /** Subtrees whose inside is never measured: free drawing in `Canvas`. The line such a surface draws itself counts. */\n skip?: string;\n /** One thing in one frame or band (rule 9): spacing alone separates its parts, so any line inside is a finding. */\n unbroken?: string;\n /** Controls whose label must never be cut: a text that leaves the control's box or is clipped by it. */\n controls?: string;\n /** Text that stays on one line and ends with \"…\" when it is too long; wrapping to a second line is a finding. */\n oneLine?: string;\n /** Drawn marks whose lines are no dividers, such as the track of steps; their text is still measured. */\n figure?: string;\n /** Text that has no type role, such as initials in an avatar. */\n untyped?: string;\n};\n\nexport type V2GripMeasure = {\n grip: string;\n /** Pill centre minus line centre in CSS px, from the DOM. */\n dom: number;\n /** The same from the screenshot, or null when the pill or its line could not be told from the background. */\n pixels: number | null;\n /** The width of the line in CSS px, from the screenshot. */\n lineWidth: number | null;\n};\n\nexport type V2Layout = {\n edge: string[];\n double: string[];\n /** Lines inside one thing (a band, a group), whatever their distance to other lines. */\n inside: string[];\n /** Cut control labels and one-line texts that wrap. */\n cut: string[];\n type: string[];\n grip: string[];\n grips: V2GripMeasure[];\n /** Pseudo-elements the helper could not measure without changing the page; each one is a problem, never a pass. */\n pseudo: string[];\n /** How many hairlines and tinted bands were measured, so a test can tell an empty page from a clean one. */\n measured: { lines: number; bands: number; texts: number };\n /** Every problem as one readable line; empty when the page keeps the rules. */\n problems: string[];\n};\n\ntype Limits = {\n sizes: number[];\n lineHeights: number[];\n weights: number[];\n hairline: number;\n tolerance: number;\n};\n\ntype InPage = Required<V2LayoutOptions> & Limits;\n\ntype Rect = { left: number; top: number; width: number; height: number };\n\ntype DomResult = {\n edge: string[];\n double: string[];\n inside: string[];\n cut: string[];\n type: string[];\n grip: string[];\n grips: { grip: string; dom: number; rect: Rect; line: { x0: number; x1: number } | null }[];\n pseudo: string[];\n measured: V2Layout[\"measured\"];\n};\n\n/** Runs in the page: closes over nothing. */\nfunction measureInPage(options: InPage): DomResult {\n const empty: DomResult = {\n edge: [],\n double: [],\n inside: [],\n cut: [],\n type: [],\n grip: [],\n grips: [],\n pseudo: [],\n measured: { lines: 0, bands: 0, texts: 0 },\n };\n const root = document.querySelector(options.root);\n if (!root) return { ...empty, edge: [`no element matches ${options.root}`] };\n const round = (value: number) => Math.round(value * 100) / 100;\n const clear = (color: string) => !color || color === \"transparent\" || /rgba\\(.*,\\s*0\\)$/.test(color) || /\\/\\s*0\\)$/.test(color);\n const name = (element: Element) => {\n const marker = element.getAttribute(\"data-probe\");\n if (marker) return `[data-probe=\"${marker}\"]`;\n const pseudo = element.getAttribute(\"data-k2-stand-in\");\n if (pseudo) return pseudo;\n const classes = typeof element.className === \"string\" ? element.className.trim().split(/\\s+/).filter(Boolean).slice(0, 2) : [];\n return `${element.tagName.toLowerCase()}${classes.map((c) => `.${c}`).join(\"\")}`;\n };\n\n // 1. Stand-ins for pseudo-elements that draw: read every computed style first, then write, so reading never sees a stand-in.\n const draws = (style: CSSStyleDeclaration) =>\n !clear(style.backgroundColor) ||\n style.backgroundImage !== \"none\" ||\n style.boxShadow !== \"none\" ||\n [\"top\", \"right\", \"bottom\", \"left\"].some(\n (side) =>\n Number.parseFloat(style.getPropertyValue(`border-${side}-width`)) > 0 &&\n ![\"none\", \"hidden\"].includes(style.getPropertyValue(`border-${side}-style`)) &&\n !clear(style.getPropertyValue(`border-${side}-color`)),\n );\n const planned: { owner: Element; which: \"before\" | \"after\"; values: [string, string][]; text: string }[] = [];\n // A quoted string such as `\"… \"` becomes the stand-in's text; anything else (a counter, attr()) changes its size, and\n // the comparison below then reports the pseudo-element as not measurable.\n const textOf = (content: string) => {\n try {\n return /^\".*\"$/.test(content) ? String(JSON.parse(content)) : \"\";\n } catch {\n return \"\";\n }\n };\n for (const owner of [root, ...Array.from(root.querySelectorAll(\"*\"))]) {\n if (owner.parentElement?.closest(options.skip)) continue;\n for (const which of [\"before\", \"after\"] as const) {\n const style = getComputedStyle(owner, `::${which}`);\n if (style.content === \"none\" || style.content === \"normal\" || style.display === \"none\" || !draws(style)) continue;\n const values: [string, string][] = [];\n for (let index = 0; index < style.length; index++) {\n const property = style.item(index);\n if (property !== \"content\") values.push([property, style.getPropertyValue(property)]);\n }\n planned.push({ owner, which, values, text: textOf(style.content) });\n }\n }\n const hide = document.createElement(\"style\");\n hide.textContent = \"[data-k2-hide-before]::before{content:none!important}[data-k2-hide-after]::after{content:none!important}\";\n const standIns = new Map<(typeof planned)[number], Element>();\n const pseudo: string[] = [];\n // A stand-in is a real element: it can change what a sibling selector matches (`.row:last-child`, `:empty`, `+`,\n // `:has()`) and so the look of its neighbours. Every box and line of the page is compared before and after; a\n // stand-in that changes anything is taken out again and its pseudo-element reported as not measurable.\n const look = () => {\n const seen = new Map<Element, string>();\n for (const element of [root, ...Array.from(root.querySelectorAll(\"*\"))]) {\n if (element.localName === \"k2-stand-in\") continue;\n const r = element.getBoundingClientRect();\n const s = getComputedStyle(element);\n seen.set(\n element,\n [r.left, r.top, r.width, r.height].map((n) => Math.round(n * 100)).join(\",\") +\n [\"top\", \"right\", \"bottom\", \"left\"]\n .map((side) => s.getPropertyValue(`border-${side}-width`) + s.getPropertyValue(`border-${side}-color`))\n .join() +\n s.boxShadow +\n s.backgroundColor +\n s.display,\n );\n }\n return seen;\n };\n const differences = (before: Map<Element, string>) => {\n const after = look();\n return [...before].filter(([element, value]) => after.get(element) !== value).map(([element]) => element);\n };\n const insert = (plan: (typeof planned)[number]) => {\n const { owner, which, values, text } = plan;\n const standIn = document.createElement(\"k2-stand-in\");\n for (const [property, value] of values) (standIn as HTMLElement).style.setProperty(property, value);\n standIn.textContent = text;\n standIn.setAttribute(\"data-k2-stand-in\", `${name(owner)}::${which}`);\n owner.setAttribute(`data-k2-hide-${which}`, \"\");\n if (which === \"before\") owner.prepend(standIn);\n else owner.append(standIn);\n standIns.set(plan, standIn);\n };\n const remove = (plan: (typeof planned)[number]) => {\n standIns.get(plan)?.remove();\n standIns.delete(plan);\n plan.owner.removeAttribute(`data-k2-hide-${plan.which}`);\n };\n\n try {\n if (planned.length) {\n const before = look();\n document.head.append(hide);\n for (const plan of planned) insert(plan);\n if (differences(before).length) {\n // Find the stand-ins that change the page, one at a time, and keep only the others.\n for (const plan of planned) remove(plan);\n const clean = planned.filter((plan) => {\n insert(plan);\n const changed = differences(before);\n remove(plan);\n if (changed.length)\n pseudo.push(\n `pseudo-element ${name(plan.owner)}::${plan.which} cannot be measured: in its place a real element changes ${changed\n .slice(0, 3)\n .map(name)\n .join(\", \")} (a sibling selector such as :last-child depends on it)`,\n );\n return !changed.length;\n });\n for (const plan of clean) insert(plan);\n if (differences(before).length) {\n for (const plan of clean) remove(plan);\n pseudo.push(\"pseudo-elements cannot be measured together: their stand-ins change the page only in combination\");\n }\n }\n }\n\n const visible = (element: Element) => {\n const rect = element.getBoundingClientRect();\n return rect.width > 0 && rect.height > 0 && element.checkVisibility({ visibilityProperty: true, opacityProperty: true });\n };\n const elements = [root, ...Array.from(root.querySelectorAll(\"*\"))].filter(\n // A skipped surface (a Canvas) is free inside, but the line it draws itself is a divider like any other, also\n // when a pseudo-element draws it (its stand-in stands inside the surface and counts as the surface).\n (element) => {\n const host = element.localName === \"k2-stand-in\" ? element.parentElement : element;\n return !host?.parentElement?.closest(options.skip) && visible(element);\n },\n );\n // What a person sees of an element: the viewport, cut by every ancestor that clips (a scrolled column, the card).\n const clips = new Map<Element, { left: number; right: number; top: number; bottom: number }>();\n const clipOf = (element: Element): { left: number; right: number; top: number; bottom: number } => {\n const known = clips.get(element);\n if (known) return known;\n const parent = element.parentElement;\n let clip = { left: 0, right: window.innerWidth, top: 0, bottom: window.innerHeight };\n if (parent) {\n clip = { ...clipOf(parent) };\n const style = getComputedStyle(parent);\n // Each axis on its own: `overflow: clip visible` cuts sideways only, and a 2 px tab mark below the box stays whole.\n if (style.display !== \"contents\") {\n const r = parent.getBoundingClientRect();\n if (style.overflowX !== \"visible\") clip = { ...clip, left: Math.max(clip.left, r.left), right: Math.min(clip.right, r.right) };\n if (style.overflowY !== \"visible\") clip = { ...clip, top: Math.max(clip.top, r.top), bottom: Math.min(clip.bottom, r.bottom) };\n }\n }\n clips.set(element, clip);\n return clip;\n };\n\n // 2. Every line: border sides, blur-free shadows, and boxes of at most 1.5 px, as far as it can be seen.\n // `frame`: one side of a box framed on several sides, or of a rounded one; it is no divider, so the edge rule skips it.\n // `round`: drawn by a rounded box, a control, mark or overlay; it floats on its own, so the double-line rule skips it.\n type Line = {\n element: Element;\n how: string;\n across0: number;\n across1: number;\n along0: number;\n along1: number;\n frame: boolean;\n round: boolean;\n /** Drawn by a box that also has a vertical side: a frame around something, never a line between parts. */\n boxed: boolean;\n };\n const horizontal: Line[] = [];\n const vertical: Line[] = [];\n const add = (\n element: Element,\n how: string,\n x0: number,\n x1: number,\n y0: number,\n y1: number,\n frame: boolean,\n round: boolean,\n boxed = frame,\n ) => {\n // Lines inside a figure (the track of steps, a progress bar) are marks, not dividers.\n if (element.closest(options.figure)) return;\n const clip = clipOf(element);\n const [cx0, cx1, cy0, cy1] = [Math.max(x0, clip.left), Math.min(x1, clip.right), Math.max(y0, clip.top), Math.min(y1, clip.bottom)];\n if (cx1 - cx0 <= 0.25 || cy1 - cy0 <= 0.25) return;\n const line = { element, how, frame: frame || round, round, boxed: boxed || round };\n if (x1 - x0 >= y1 - y0) horizontal.push({ ...line, across0: cy0, across1: cy1, along0: cx0, along1: cx1 });\n else vertical.push({ ...line, across0: cx0, across1: cx1, along0: cy0, along1: cy1 });\n };\n const shadowPattern = /(rgba?\\([^)]*\\)|#[0-9a-f]{3,8})\\s+(-?[\\d.]+)px\\s+(-?[\\d.]+)px\\s+([\\d.]+)px\\s+(-?[\\d.]+)px(\\s+inset)?/gi;\n for (const element of elements) {\n const style = getComputedStyle(element);\n const r = element.getBoundingClientRect();\n const sides = [\"top\", \"right\", \"bottom\", \"left\"].filter(\n (side) =>\n Number.parseFloat(style.getPropertyValue(`border-${side}-width`)) > 0 &&\n ![\"none\", \"hidden\"].includes(style.getPropertyValue(`border-${side}-style`)) &&\n !clear(style.getPropertyValue(`border-${side}-color`)),\n );\n const round = Number.parseFloat(style.borderTopLeftRadius) > 0;\n const framed = sides.length > 1;\n // `border-block` draws two lines, both between parts; a box with a side left or right frames something.\n const boxed = sides.includes(\"left\") || sides.includes(\"right\");\n for (const side of sides) {\n const width = Number.parseFloat(style.getPropertyValue(`border-${side}-width`));\n if (side === \"top\") add(element, \"border-top\", r.left, r.right, r.top, r.top + width, framed, round, boxed);\n if (side === \"bottom\") add(element, \"border-bottom\", r.left, r.right, r.bottom - width, r.bottom, framed, round, boxed);\n if (side === \"left\") add(element, \"border-left\", r.left, r.left + width, r.top, r.bottom, framed, round);\n if (side === \"right\") add(element, \"border-right\", r.right - width, r.right, r.top, r.bottom, framed, round);\n }\n if (style.boxShadow !== \"none\")\n for (const match of style.boxShadow.matchAll(shadowPattern)) {\n const [, color, ox, oy, blur, spread, inset] = match;\n if (clear(color!) || Number(blur) > 0) continue;\n const x = Number(ox);\n const y = Number(oy);\n const s = Number(spread);\n if (s > 0 && x === 0 && y === 0) {\n // A spread without offset draws a frame: inside the box when inset, around it otherwise.\n const [l, rt, tp, b] = inset ? [r.left, r.right, r.top, r.bottom] : [r.left - s, r.right + s, r.top - s, r.bottom + s];\n add(element, \"shadow-frame\", l, rt, tp, tp + s, true, round);\n add(element, \"shadow-frame\", l, rt, b - s, b, true, round);\n add(element, \"shadow-frame\", l, l + s, tp, b, true, round);\n add(element, \"shadow-frame\", rt - s, rt, tp, b, true, round);\n continue;\n }\n if (s !== 0) continue;\n if (y > 0) add(element, \"shadow\", r.left, r.right, inset ? r.top : r.bottom, (inset ? r.top : r.bottom) + y, false, round);\n if (y < 0) add(element, \"shadow\", r.left, r.right, (inset ? r.bottom : r.top) + y, inset ? r.bottom : r.top, false, round);\n if (x > 0) add(element, \"shadow\", inset ? r.left : r.right, (inset ? r.left : r.right) + x, r.top, r.bottom, false, round);\n if (x < 0) add(element, \"shadow\", (inset ? r.right : r.left) + x, inset ? r.right : r.left, r.top, r.bottom, false, round);\n }\n const thin = Math.min(r.width, r.height);\n if (thin <= options.hairline + 0.5 && Math.max(r.width, r.height) > 4 * thin && !clear(style.backgroundColor))\n add(element, \"box\", r.left, r.right, r.top, r.bottom, false, round);\n }\n const hairlines = (lines: Line[]) => lines.filter((line) => line.across1 - line.across0 <= options.hairline + 0.5);\n\n // 3. Column edges at a height: vertical hairlines, the columns and the root.\n const rootRect = root.getBoundingClientRect();\n const columns = Array.from(root.querySelectorAll(options.columns))\n .filter(visible)\n .map((column) => column.getBoundingClientRect());\n const edgesAt = (y: number) => {\n const lefts = [rootRect.left];\n const rights = [rootRect.right];\n for (const line of hairlines(vertical))\n if (line.along1 - line.along0 > 40 && line.along0 - 1 <= y && line.along1 + 1 >= y) {\n lefts.push(line.across1);\n rights.push(line.across0);\n }\n for (const column of columns)\n if (column.top - 1 <= y && column.bottom + 1 >= y) {\n lefts.push(column.left);\n rights.push(column.right);\n }\n return { lefts, rights };\n };\n const gaps = (x0: number, x1: number, y: number) => {\n const { lefts, rights } = edgesAt(y);\n const left = Math.max(...lefts.filter((x) => x <= x0 + 1.5));\n const right = Math.min(...rights.filter((x) => x >= x1 - 1.5));\n return { left: x0 - left, right: right - x1, edgeLeft: left, edgeRight: right };\n };\n const edge: string[] = [];\n // Collinear pieces of one line (the cells of a row) merge first.\n const dividers = hairlines(horizontal)\n .filter((line) => !line.frame)\n .sort((a, b) => a.across0 - b.across0 || a.along0 - b.along0);\n const merged: Line[] = [];\n for (const line of dividers) {\n const same = merged.find(\n (m) => Math.abs(m.across0 - line.across0) <= 0.6 && line.along0 <= m.along1 + 1.5 && line.along1 >= m.along0 - 1.5,\n );\n if (same) {\n same.along0 = Math.min(same.along0, line.along0);\n same.along1 = Math.max(same.along1, line.along1);\n } else merged.push({ ...line });\n }\n for (const line of merged) {\n if (line.along1 - line.along0 < 60) continue;\n const gap = gaps(line.along0, line.along1, line.across0);\n if (gap.left > 1.5 || gap.right > 1.5)\n edge.push(\n `line ${name(line.element)} ${line.how} at y ${round(line.across0)} stops ${round(gap.left)} px short of the left and ${round(gap.right)} px short of the right edge of its column (${round(gap.edgeLeft)}–${round(gap.edgeRight)})`,\n );\n }\n // Tinted bands: a fill of its own, not a control, not rounded, at least 160 x 36.\n const fillBelow = (element: Element) => {\n for (let parent = element.parentElement; parent; parent = parent.parentElement) {\n const color = getComputedStyle(parent).backgroundColor;\n if (!clear(color)) return color;\n }\n return \"rgb(255, 255, 255)\";\n };\n const control = (element: Element) =>\n !!element.closest(\n \"button, a, input, textarea, select, [role=button], [role=tab], [role=option], [role=menuitem], [role=separator], [contenteditable=true], [data-k2-grip]\",\n );\n let bands = 0;\n for (const element of elements) {\n const style = getComputedStyle(element);\n const color = style.backgroundColor;\n if (clear(color) || color === fillBelow(element) || control(element) || Number.parseFloat(style.borderTopLeftRadius) > 0) continue;\n let box = element.getBoundingClientRect();\n // A table row is tinted cell by cell (a sticky cell must be opaque), so a tinted row is measured as the band of\n // all its cells, once; a single tinted cell (an error, the cell under edit) is a state of that cell, no band.\n if (element.tagName === \"TD\" || element.tagName === \"TH\") {\n const cells = Array.from(element.parentElement?.children ?? []);\n if (cells[0] !== element || !cells.every((cell) => getComputedStyle(cell).backgroundColor === color)) continue;\n const last = cells[cells.length - 1]!.getBoundingClientRect();\n box = new DOMRect(box.left, box.top, last.right - box.left, box.height);\n }\n const clip = clipOf(element);\n const r = {\n left: Math.max(box.left, clip.left),\n right: Math.min(box.right, clip.right),\n top: Math.max(box.top, clip.top),\n bottom: Math.min(box.bottom, clip.bottom),\n };\n if (r.right - r.left < 160 || r.bottom - r.top < 36) continue;\n bands += 1;\n const gap = gaps(r.left, r.right, (r.top + r.bottom) / 2);\n if (gap.left > 1.5 || gap.right > 1.5)\n edge.push(\n `band ${name(element)} at y ${round(r.top)} stops ${round(gap.left)} px short of the left and ${round(gap.right)} px short of the right edge of its column`,\n );\n }\n\n // 4. Double lines: parallel, at most 1 px apart, sharing more than 1 px of length, of different elements.\n const collapsedPair = (a: Element, b: Element) => {\n const table = a.closest(\"table\");\n return !!table && table === b.closest(\"table\") && getComputedStyle(table).borderCollapse === \"collapse\";\n };\n const double: string[] = [];\n for (const list of [hairlines(horizontal), hairlines(vertical)]) {\n list.sort((a, b) => a.across0 - b.across0);\n for (const [index, a] of list.entries())\n for (const b of list.slice(index + 1)) {\n if (b.across0 - a.across1 > 1) break;\n if (a.element === b.element || a.round || b.round || collapsedPair(a.element, b.element)) continue;\n const shared = Math.min(a.along1, b.along1) - Math.max(a.along0, b.along0);\n if (shared > 1)\n double.push(\n `double line: ${name(a.element)} ${a.how} and ${name(b.element)} ${b.how} at ${round(a.across0)} px over ${round(shared)} px`,\n );\n }\n }\n\n // 4b. Lines inside one thing: a hairline drawn inside a band or a group, not on its own edge (rule 9).\n const inside: string[] = [];\n for (const line of hairlines(horizontal)) {\n if (line.boxed || line.round) continue;\n const owner = line.element.parentElement?.closest(options.unbroken);\n if (!owner || !root.contains(owner)) continue;\n // Inside the owner's own border: a line on its edge lies on the owner's line, which the double rule reports.\n const box = owner.getBoundingClientRect();\n const ownerStyle = getComputedStyle(owner);\n const top = box.top + Number.parseFloat(ownerStyle.borderTopWidth);\n const bottom = box.bottom - Number.parseFloat(ownerStyle.borderBottomWidth);\n if (line.across0 < top + 0.5 || line.across1 > bottom - 0.5) continue;\n inside.push(\n `line inside ${name(owner)}: ${name(line.element)} ${line.how} at y ${round(line.across0)} separates parts of one thing; spacing alone separates them`,\n );\n }\n\n // 4c. Cut text: a control's label that leaves its box or is clipped, a one-line text that wraps.\n const cut: string[] = [];\n const labelOf = (element: Element) => (element.textContent ?? \"\").replace(/\\s+/g, \" \").trim().slice(0, 40);\n // The boxes of the visible text in an element, one per line box of each text node.\n // Text kept only as a name (a visually hidden label of 1 px, such as the words of a button that gave way to its\n // symbol in a narrow place) shows nothing to cut.\n const hiddenName = (element: Element | null) => {\n for (let node = element; node; node = node.parentElement) {\n // A box of `display: contents` has no size of its own and hides nothing.\n if (getComputedStyle(node).display === \"contents\") continue;\n const r = node.getBoundingClientRect();\n if (r.width <= 1 || r.height <= 1) return true;\n if (node === root) break;\n }\n return false;\n };\n /** The boxes of the text in `element`, without text that `skip` names. */\n const textBoxes = (element: Element, skip?: (node: Node) => boolean) => {\n const boxes: DOMRect[] = [];\n const walker = document.createTreeWalker(element, NodeFilter.SHOW_TEXT);\n for (let node = walker.nextNode(); node; node = walker.nextNode()) {\n if (!node.textContent?.trim() || hiddenName(node.parentElement) || skip?.(node)) continue;\n const range = document.createRange();\n range.selectNodeContents(node);\n for (const box of Array.from(range.getClientRects())) if (box.width > 0 && box.height > 0) boxes.push(box);\n }\n return boxes;\n };\n // What cuts sideways for good: the element and every ancestor with overflow hidden or clip. A scroller (auto,\n // scroll) is left out: what it hides, a person scrolls to, such as tabs in a scrolling bar.\n const hardClipX = (element: Element) => {\n let left = Number.NEGATIVE_INFINITY;\n let right = Number.POSITIVE_INFINITY;\n for (let node: Element | null = element; node; node = node.parentElement) {\n const nodeStyle = getComputedStyle(node);\n // A box of `display: contents` has no box of its own, so its overflow cuts nothing.\n if (nodeStyle.display === \"contents\") {\n if (node === root) break;\n continue;\n }\n const overflow = nodeStyle.overflowX;\n // Inside a scroller everything can be scrolled into view; what lies beyond it is no cut of this control.\n if (node !== element && [\"auto\", \"scroll\"].includes(overflow)) break;\n if ([\"hidden\", \"clip\"].includes(overflow)) {\n const r = node.getBoundingClientRect();\n left = Math.max(left, r.left);\n right = Math.min(right, r.right);\n }\n if (node === root) break;\n }\n return { left, right };\n };\n // A label that ends in \"…\" in its own box (one line that clips with `text-overflow: ellipsis`) is cut on purpose,\n // as the way back to a list with a long name: it is no finding, while any other clipped label is.\n const endsInEllipsis = (element: Element) => {\n const style = getComputedStyle(element);\n return style.textOverflow === \"ellipsis\" && style.overflowX !== \"visible\" && style.whiteSpace.startsWith(\"nowrap\");\n };\n for (const control of Array.from(root.querySelectorAll(options.controls))) {\n if (!visible(control) || control.parentElement?.closest(options.skip)) continue;\n const box = control.getBoundingClientRect();\n let clipped = false;\n const shortened = [control, ...Array.from(control.querySelectorAll(\"*\"))].filter(endsInEllipsis);\n for (const part of [control, ...Array.from(control.querySelectorAll(\"*\"))]) {\n if (part !== control && hiddenName(part)) continue;\n const style = getComputedStyle(part);\n if (style.overflowX !== \"visible\" && part.scrollWidth > part.clientWidth + 1 && !endsInEllipsis(part)) clipped = true;\n }\n const clip = hardClipX(control);\n for (const r of textBoxes(control, (node) => shortened.some((part) => part.contains(node))))\n if (r.left < Math.max(box.left, clip.left) - 0.5 || r.right > Math.min(box.right, clip.right) + 0.5) clipped = true;\n if (clipped) cut.push(`control ${name(control)} cuts its label \"${labelOf(control)}\"; it needs the room of its whole label`);\n }\n // A box of text that clips (overflow hidden or clip, not a scroller) shows every line of it whole and cuts a line at\n // its end only with \"…\". Only boxes of text count: text of their own or inline children. A control's label is\n // judged above, more strictly.\n for (const element of elements) {\n if (!(element instanceof HTMLElement) || !element.textContent?.trim() || element.closest(options.controls)) continue;\n // Text kept only as a name (a visually hidden label of 1 px) shows nothing to cut.\n const box = element.getBoundingClientRect();\n if (box.width <= 1 || box.height <= 1) continue;\n const style = getComputedStyle(element);\n // A clamp to a number of lines ends its last line with \"…\" by itself.\n if (style.webkitLineClamp !== \"none\" && style.webkitLineClamp !== \"\") continue;\n const clipsX = style.overflowX === \"hidden\" || style.overflowX === \"clip\";\n const clipsY = style.overflowY === \"hidden\" || style.overflowY === \"clip\";\n if (!clipsX && !clipsY) continue;\n if (!Array.from(element.children).every((child) => getComputedStyle(child).display.startsWith(\"inline\"))) continue;\n if (clipsY && element.scrollHeight > element.clientHeight + 1)\n cut.push(\n `${name(element)} \"${labelOf(element)}\" hides ${element.scrollHeight - element.clientHeight} px of its text above or below; every line shows whole`,\n );\n // A control that sticks out sideways is reported once, at the control; the box above it says nothing new.\n const holdsControl = Array.from(element.children).some((child) => child.matches(options.controls));\n if (clipsX && !holdsControl && element.scrollWidth > element.clientWidth + 1 && style.textOverflow !== \"ellipsis\")\n cut.push(`${name(element)} \"${labelOf(element)}\" cuts its line without \"…\"`);\n }\n for (const element of Array.from(root.querySelectorAll(options.oneLine))) {\n if (!visible(element) || element.parentElement?.closest(options.skip)) continue;\n // Count line boxes, not the element's height: a control in the line makes it taller without a second line.\n const boxes = textBoxes(element).sort((a, b) => a.top - b.top);\n let lines = 0;\n let bottom = Number.NEGATIVE_INFINITY;\n for (const box of boxes) {\n if (box.top >= bottom - 1) lines += 1;\n bottom = Math.max(bottom, box.bottom);\n }\n if (lines > 1) cut.push(`${name(element)} \"${labelOf(element)}\" wraps to ${lines} lines; it stays on one line and ends with \"…\"`);\n }\n\n // 5. Type roles: every run of text that a person sees.\n const type = new Map<string, number>();\n let texts = 0;\n const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT);\n for (let node = walker.nextNode(); node; node = walker.nextNode()) {\n const parent = node.parentElement;\n if (!parent || !node.textContent?.trim() || parent.closest(options.skip) || parent.closest(options.untyped) || !visible(parent))\n continue;\n if (parent.closest(\"script, style, template\")) continue;\n texts += 1;\n const style = getComputedStyle(parent);\n const size = Number.parseFloat(style.fontSize);\n const lineHeight = Number.parseFloat(style.lineHeight);\n const weight = Number(style.fontWeight);\n const prose = !!parent.closest(options.prose);\n const sizeOk = options.sizes.includes(size) || (prose && size === 16);\n const lineOk = options.lineHeights.includes(lineHeight) || (prose && lineHeight === 22);\n if (sizeOk && lineOk && options.weights.includes(weight)) continue;\n const key = `${style.fontSize}/${style.lineHeight} ${weight} in ${name(parent)}`;\n type.set(key, (type.get(key) ?? 0) + 1);\n }\n\n // 6. Grips: the pill centre against the centre of the vertical hairline that runs through it, above the pill.\n const grip: string[] = [];\n const grips: DomResult[\"grips\"] = [];\n const standInsOf = (element: Element) => Array.from(element.querySelectorAll(\"k2-stand-in\"));\n for (const element of Array.from(root.querySelectorAll(options.grips)).filter(visible)) {\n const r = element.getBoundingClientRect();\n const centre = r.left + r.width / 2;\n const own = new Set([element, ...standInsOf(element)]);\n const y = r.top - 4;\n const candidates = hairlines(vertical)\n .filter(\n (line) =>\n !own.has(line.element) &&\n line.along0 <= y &&\n line.along1 >= y &&\n Math.abs((line.across0 + line.across1) / 2 - centre) <= r.width,\n )\n .sort((a, b) => Math.abs((a.across0 + a.across1) / 2 - centre) - Math.abs((b.across0 + b.across1) / 2 - centre));\n const line = candidates[0];\n const label = name(element);\n if (!line) {\n grip.push(`grip ${label} has no vertical line through it`);\n grips.push({ grip: label, dom: Number.NaN, rect: { left: r.left, top: r.top, width: r.width, height: r.height }, line: null });\n continue;\n }\n const offset = centre - (line.across0 + line.across1) / 2;\n if (Math.abs(offset) > options.tolerance) grip.push(`grip ${label}: pill centre ${round(offset)} px off its line (DOM)`);\n if (Math.abs(line.across1 - line.across0 - options.hairline) > 0.01)\n grip.push(`grip ${label}: its line is ${round(line.across1 - line.across0)} px, not ${options.hairline} px`);\n grips.push({\n grip: label,\n dom: round(offset),\n rect: { left: r.left, top: r.top, width: r.width, height: r.height },\n line: { x0: line.across0, x1: line.across1 },\n });\n }\n\n return {\n edge,\n double,\n inside,\n cut,\n type: [...type].map(([key, count]) => `text outside the type roles: ${key}${count > 1 ? ` (${count}×)` : \"\"}`),\n grip,\n grips,\n pseudo,\n measured: { lines: horizontal.length + vertical.length, bands, texts },\n };\n } finally {\n for (const plan of planned) remove(plan);\n hide.remove();\n }\n}\n\n/** Runs in the page: finds the pill and the line in a screenshot of one grip. */\nasync function gripPixelsInPage(input: { png: string; scale: number; left: number; top: number; width: number; height: number }) {\n const image = new Image();\n image.src = `data:image/png;base64,${input.png}`;\n await image.decode();\n const canvas = document.createElement(\"canvas\");\n canvas.width = image.naturalWidth;\n canvas.height = image.naturalHeight;\n const context = canvas.getContext(\"2d\");\n if (!context) return null;\n context.drawImage(image, 0, 0);\n const row = (y: number) => {\n const data = context.getImageData(0, Math.min(canvas.height - 1, Math.max(0, Math.round(y))), canvas.width, 1).data;\n return Array.from({ length: canvas.width }, (_, x) => [data[x * 4]!, data[x * 4 + 1]!, data[x * 4 + 2]!]);\n };\n const differs = (a: number[], b: number[]) => Math.abs(a[0]! - b[0]!) + Math.abs(a[1]! - b[1]!) + Math.abs(a[2]! - b[2]!) > 12;\n // The run of pixels between two columns that differ from the background on both sides (the columns left and right\n // of a line may have different fills), in device pixels.\n const run = (pixels: number[][], from: number, to: number) => {\n const before = pixels[from]!;\n const after = pixels[to]!;\n let first = -1;\n let last = -1;\n for (let x = from; x <= to; x++)\n if (differs(pixels[x]!, before) && differs(pixels[x]!, after)) {\n if (first < 0) first = x;\n last = x;\n }\n return first < 0 ? null : { first, last };\n };\n const s = input.scale;\n // Only inside the grip and 3 px around it, so text beside it never counts.\n const from = Math.round((input.left - 3) * s);\n const to = Math.round((input.left + input.width + 3) * s) - 1;\n // The line 3 px above the pill, and the pill 3 px below its top edge, above its first dots. A horizontal line or a\n // band edge can cross the column right there, so the line is also looked for further up and below the pill.\n const line = [input.top - 3, input.top - 5, input.top + input.height + 3, input.top + input.height + 5]\n .map((y) => run(row(y * s + s / 2), from, to))\n .find((found) => found !== null);\n const pill = run(row((input.top + 3) * s + s / 2), from, to);\n if (!line || !pill) return null;\n const centre = (r: { first: number; last: number }) => (r.first + r.last + 1) / 2;\n return { offset: (centre(pill) - centre(line)) / s, lineWidth: (line.last - line.first + 1) / s };\n}\n\n/** Measures the v2 layout rules on the page as it stands. Restores the page before it returns. */\nexport async function measureV2Layout(page: Page, options: V2LayoutOptions = {}): Promise<V2Layout> {\n // Fonts, observers and animations first: a measurement of a page that still moves measures a moment, not the page.\n await settled(page);\n const roles = Object.values(typeRoles);\n const limits: InPage = {\n root: options.root ?? \"body\",\n columns: options.columns ?? \"[data-k2-column]\",\n grips: options.grips ?? \"[data-k2-grip]\",\n prose: options.prose ?? \"[data-k2-prose]\",\n skip: options.skip ?? \"[data-k2-canvas]\",\n figure: options.figure ?? \"[data-k2-figure]\",\n untyped: options.untyped ?? \"[data-k2-avatar]\",\n unbroken: options.unbroken ?? \"[data-k2-part='Band'], [data-k2-part='Group']\",\n controls: options.controls ?? \".k2-btn, .k2-chip, .k2-tab\",\n // A row of three lines cuts each line; in a row of one or two lines the title may wrap (it is what the row is about).\n oneLine:\n options.oneLine ??\n \".k2-row[data-lines='3'] > :is(.k2-row-l1, .k2-row-l2, .k2-row-l3), .k2-row-meta, .k2-table[data-sized] .k2-cell-line:not([data-wrap])\",\n sizes: roles.map((role) => role.size),\n lineHeights: [...new Set(roles.map((role) => role.lineHeight))],\n weights: [...fontWeights],\n hairline: hairline.width,\n tolerance: gripTolerance,\n };\n const dom = await page.evaluate(measureInPage, limits);\n const scale = await page.evaluate(() => window.devicePixelRatio);\n const margin = 6;\n const grips: V2GripMeasure[] = [];\n const grip = [...dom.grip];\n for (const measure of dom.grips) {\n if (!measure.line) continue;\n const { left, top, width, height } = measure.rect;\n // A clip on whole CSS pixels, so the engine never resamples the picture.\n const x = Math.floor(left - margin);\n const y = Math.floor(top - margin);\n const png = await page.screenshot({\n clip: { x, y, width: Math.ceil(width + 2 * margin) + 1, height: Math.ceil(height + 2 * margin) + 1 },\n scale: \"device\",\n animations: \"disabled\",\n caret: \"hide\",\n });\n const pixels = await page.evaluate(gripPixelsInPage, {\n png: png.toString(\"base64\"),\n scale,\n left: left - x,\n top: top - y,\n width,\n height,\n });\n grips.push({ grip: measure.grip, dom: measure.dom, pixels: pixels?.offset ?? null, lineWidth: pixels?.lineWidth ?? null });\n if (!pixels) grip.push(`grip ${measure.grip}: pill or line not found in the screenshot at DPR ${scale}`);\n else {\n if (Math.abs(pixels.offset) > gripTolerance)\n grip.push(`grip ${measure.grip}: pill centre ${pixels.offset} px off its line in the screenshot at DPR ${scale}`);\n if (Math.abs(pixels.lineWidth - hairline.width) > 0.01)\n grip.push(`grip ${measure.grip}: its line is ${pixels.lineWidth} px wide in the screenshot at DPR ${scale}`);\n }\n }\n // The DOM measurement and the screenshots are separate round trips; a grip that moved in between was not measured.\n if (dom.grips.length) {\n const now = await page.evaluate(\n ({ root, grips: selector }) =>\n Array.from(document.querySelector(root)?.querySelectorAll(selector) ?? [])\n .filter((element) => element.checkVisibility({ visibilityProperty: true, opacityProperty: true }))\n .map((element) => element.getBoundingClientRect())\n .filter((r) => r.width > 0 && r.height > 0)\n .map((r) => [r.left, r.top, r.width, r.height]),\n { root: limits.root, grips: limits.grips },\n );\n const then = dom.grips.map(({ rect }) => [rect.left, rect.top, rect.width, rect.height]);\n if (JSON.stringify(now) !== JSON.stringify(then))\n grip.push(\"the grips moved between the DOM measurement and the screenshots; measure a page that holds still\");\n }\n const problems = [...dom.pseudo, ...dom.edge, ...dom.double, ...dom.inside, ...dom.cut, ...dom.type, ...grip];\n return {\n edge: dom.edge,\n double: dom.double,\n inside: dom.inside,\n cut: dom.cut,\n type: dom.type,\n grip,\n grips,\n pseudo: dom.pseudo,\n measured: dom.measured,\n problems,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAS,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,QAAQ,WAAW;AAC3E,SAAS,OAAO,QAAQ,WAAW;AA6EnC;AACA,SAAS,aAAa,CAAC,OAAe,EAAa;EACjD,MAAM,KAAgB,GA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EAAE,GAAG,CAAC,GAAG;IACZ,IAAI,EAAE,GAAG,CAAC,IAAI;IACd,IAAI;IACJ,KAAK;IACL,MAAM,EAAE,GAAG,CAAC,MAAM;IAClB,QAAQ,EAAE,GAAG,CAAC,QAAQ;IACtB;EACF,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Guards against state sampled before it settled (#1476, #1499).
3
+ * Waits for fonts, the first resize delivery and its scheduled frame, running finite document-timeline animations, then two frames.
4
+ * Infinite, scroll-driven, and paused animations are not waited for. A page that
5
+ * keeps starting finite animations is not settled: this throws with their names,
6
+ * and the test must wait for its own condition instead. Suites not about motion
7
+ * pass `reducedMotion: "reduce"` to newPage/newContext themselves. Playwright's
8
+ * pointer rests at the top left from the first page on, touch contexts included,
9
+ * so content that arrives there later fades into hover; the error marks such
10
+ * targets with `"hovered":true`.
11
+ */
12
+ export const settled = async page => {
13
+ const remaining = await page.evaluate(async () => {
14
+ await document.fonts.ready;
15
+ // MutationObserver can schedule the next frame; ResizeObserver reports after layout and schedules the frame
16
+ // after that. Include that first observation wave, once, before the snapshot. Later animation starts still fail.
17
+ await new Promise(resolve => {
18
+ const sizes = new ResizeObserver(() => {
19
+ sizes.disconnect();
20
+ requestAnimationFrame(() => resolve());
21
+ });
22
+ sizes.observe(document.documentElement);
23
+ });
24
+ const running = () => document.getAnimations().filter(animation => animation.timeline === document.timeline && animation.playState === "running" && Number.isFinite(animation.effect?.getComputedTiming().endTime));
25
+ const frames = () => new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(() => resolve())));
26
+ // A navigation the test triggered can start a document view transition a frame after it commits.
27
+ // Its user-agent animations belong to that navigation, not to a page that keeps animating, so they
28
+ // are awaited too, a bounded number of times. Any other animation that starts meanwhile still fails.
29
+ const viewTransition = animation => animation instanceof CSSAnimation && animation.animationName.startsWith("-ua-") && animation.effect instanceof KeyframeEffect && animation.effect.target === document.documentElement;
30
+ await Promise.allSettled(running().map(animation => animation.finished));
31
+ await frames();
32
+ for (let round = 0; round < 3; round++) {
33
+ const pending = running();
34
+ if (!pending.length || !pending.every(viewTransition)) break;
35
+ await Promise.allSettled(pending.map(animation => animation.finished));
36
+ await frames();
37
+ }
38
+ return running().map(animation => {
39
+ const target = animation.effect instanceof KeyframeEffect ? animation.effect.target : null;
40
+ return {
41
+ target: target instanceof Element ? `${target.tagName.toLowerCase()}${target.id ? `#${target.id}` : ""}${Array.from(target.classList, name => `.${name}`).join("")}` : null,
42
+ name: animation instanceof CSSTransition ? animation.transitionProperty : animation instanceof CSSAnimation ? animation.animationName : animation.id,
43
+ currentTime: animation.currentTime,
44
+ hovered: target instanceof Element && target.matches(":hover")
45
+ };
46
+ });
47
+ });
48
+ if (remaining.length) {
49
+ throw new Error(`settled: the page kept animating; finite animations started while it settled: ${JSON.stringify(remaining)}. Wait for the test's own condition instead.`);
50
+ }
51
+ };
52
+ //# sourceMappingURL=settled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["v2/testing/settled.ts"],"sourcesContent":["import type { Page } from \"playwright\";\n\n/**\n * Guards against state sampled before it settled (#1476, #1499).\n * Waits for fonts, the first resize delivery and its scheduled frame, running finite document-timeline animations, then two frames.\n * Infinite, scroll-driven, and paused animations are not waited for. A page that\n * keeps starting finite animations is not settled: this throws with their names,\n * and the test must wait for its own condition instead. Suites not about motion\n * pass `reducedMotion: \"reduce\"` to newPage/newContext themselves. Playwright's\n * pointer rests at the top left from the first page on, touch contexts included,\n * so content that arrives there later fades into hover; the error marks such\n * targets with `\"hovered\":true`.\n */\nexport const settled = async (page: Page): Promise<void> => {\n const remaining = await page.evaluate(async () => {\n await document.fonts.ready;\n // MutationObserver can schedule the next frame; ResizeObserver reports after layout and schedules the frame\n // after that. Include that first observation wave, once, before the snapshot. Later animation starts still fail.\n await new Promise<void>((resolve) => {\n const sizes = new ResizeObserver(() => {\n sizes.disconnect();\n requestAnimationFrame(() => resolve());\n });\n sizes.observe(document.documentElement);\n });\n const running = () =>\n document\n .getAnimations()\n .filter(\n (animation) =>\n animation.timeline === document.timeline &&\n animation.playState === \"running\" &&\n Number.isFinite(animation.effect?.getComputedTiming().endTime),\n );\n const frames = () => new Promise<void>((resolve) => requestAnimationFrame(() => requestAnimationFrame(() => resolve())));\n // A navigation the test triggered can start a document view transition a frame after it commits.\n // Its user-agent animations belong to that navigation, not to a page that keeps animating, so they\n // are awaited too, a bounded number of times. Any other animation that starts meanwhile still fails.\n const viewTransition = (animation: Animation) =>\n animation instanceof CSSAnimation &&\n animation.animationName.startsWith(\"-ua-\") &&\n animation.effect instanceof KeyframeEffect &&\n animation.effect.target === document.documentElement;\n await Promise.allSettled(running().map((animation) => animation.finished));\n await frames();\n for (let round = 0; round < 3; round++) {\n const pending = running();\n if (!pending.length || !pending.every(viewTransition)) break;\n await Promise.allSettled(pending.map((animation) => animation.finished));\n await frames();\n }\n return running().map((animation) => {\n const target = animation.effect instanceof KeyframeEffect ? animation.effect.target : null;\n return {\n target:\n target instanceof Element\n ? `${target.tagName.toLowerCase()}${target.id ? `#${target.id}` : \"\"}${Array.from(target.classList, (name) => `.${name}`).join(\"\")}`\n : null,\n name:\n animation instanceof CSSTransition\n ? animation.transitionProperty\n : animation instanceof CSSAnimation\n ? animation.animationName\n : animation.id,\n currentTime: animation.currentTime,\n hovered: target instanceof Element && target.matches(\":hover\"),\n };\n });\n });\n if (remaining.length) {\n throw new Error(\n `settled: the page kept animating; finite animations started while it settled: ${JSON.stringify(remaining)}. Wait for the test's own condition instead.`,\n );\n }\n};\n"],"mappings":"AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM,OAAO,GAAG,MAAO,IAAU,IAAoB;EAC1D,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,YAAY;IAChD,MAAM,QAAQ,CAAC,KAAK,CAAC,KAAK;IAC1B;IACA;IACA,MAAM,IAAI,OAAO,CAAQ,OAAO,IAAK;MACnC,MAAM,KA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CAAC,OAAO,CAAC,GAAG,CAAE,SAAS,IAAK,SAAS,CAAC,QAAQ,CAAC,CAAC;MACxE,MAAM,MAAM,CAAC,CAAC;IAChB;IACA,OAAO,OAAO,CAAC,CAAC,CAAC,GAAG,CAAE,SAAS,IAAK;MAClC,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,YAAY,cAAc,GAAG,SAAS,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI;MAC1F,OAAO;QACL,MAAM,EACJ,MAAM,YAAY,OAAO,GACrB,GAAG,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,GAAG,IAAI,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,EAAG,IAAI,IAAK,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,GAClI,IAAI;QACV,IAAI,EACF,SAAS,YAAY,aAAa,GAC9B,SAAS,CAAC,kBAAkB,GAC5B,SAAS,YAAY,YAAY,GAC/B,SAAS,CAAC,aAAa,GACvB,SAAS,CAAC,EAAE;QACpB,WAAW,EAAE,SAAS,CAAC,WAAW;QAClC,OAAO,EAAE,MAAM,YAAY,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ;MAC/D,CAAC;IACH,CAAC,CAAC;EACJ,CAAC,CAAC;EACF,IAAI,SAAS,CAAC,MAAM,EAAE;IACpB,MAAM,IAAI,KAAK,CACb,iFAAiF,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,8CAC5G,CAAC;EACH;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * The measured numbers of @k2b/ui v2, taken from the approved mockup (`v2.css`, draft 16). `v2.css` declares the same
3
+ * values as custom properties; a unit test keeps both in step, and the layout measurements in the browser tests read
4
+ * their limits from here.
5
+ */
6
+
7
+ /** The four type roles. A primitive picks a role, never a size. */
8
+ export const typeRoles = {
9
+ /** Labels, times, counters. */
10
+ meta: {
11
+ size: 12,
12
+ lineHeight: 16,
13
+ weight: 400
14
+ },
15
+ /** Rows and controls. */
16
+ row: {
17
+ size: 13,
18
+ lineHeight: 20,
19
+ weight: 400
20
+ },
21
+ /** Titles in a head, reading text. */
22
+ body: {
23
+ size: 14,
24
+ lineHeight: 20,
25
+ weight: 400
26
+ },
27
+ /** The one main statement or name. */
28
+ lead: {
29
+ size: 18,
30
+ lineHeight: 24,
31
+ weight: 600
32
+ }
33
+ };
34
+ /** The three weights; emphasis is a weight, never a size. */
35
+ export const fontWeights = [400, 500, 600];
36
+
37
+ /**
38
+ * Where text starts in a column: 20 px from 768 px, 16 px below. After an icon the text edge is 24 px further in
39
+ * (16 px icon and 8 px gap), so 44 px and 40 px on the phone.
40
+ */
41
+ export const textEdge = {
42
+ wide: 20,
43
+ phone: 16,
44
+ afterIcon: 24,
45
+ phoneBelow: 768
46
+ };
47
+
48
+ /** The one hairline: 1 px in one colour. Lines separate groups and reach the edges of their column. */
49
+ export const hairline = {
50
+ width: 1
51
+ };
52
+
53
+ /** Radii by role: a mark (4), a control or an overlay (8), round (999), the app card (14). Structure is square. */
54
+ export const radii = {
55
+ mark: 4,
56
+ control: 8,
57
+ overlay: 8,
58
+ round: 999,
59
+ card: 14
60
+ };
61
+
62
+ /**
63
+ * Fixed heights by place; a primitive takes its height from where it stands. The row heights are minima, as in the
64
+ * mockup: a row of two or three lines is taller than its minimum by its line, so it stands 53 and 73 px apart
65
+ * (`row2 + hairline.width`), exactly as the approved mockup renders it.
66
+ */
67
+ export const heights = {
68
+ head: 56,
69
+ status: 52,
70
+ tabs: 44,
71
+ bar: 40,
72
+ columns: 36,
73
+ row: 40,
74
+ row2: 52,
75
+ row3: 72,
76
+ dense: 32,
77
+ control: 36,
78
+ controlSmall: 28
79
+ };
80
+
81
+ /** A grip's pill centre lies on the centre of its line within this many CSS px, at device pixel ratio 1 and 2. */
82
+ export const gripTolerance = 0.25;
83
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["v2/tokens.ts"],"sourcesContent":["/**\n * The measured numbers of @k2b/ui v2, taken from the approved mockup (`v2.css`, draft 16). `v2.css` declares the same\n * values as custom properties; a unit test keeps both in step, and the layout measurements in the browser tests read\n * their limits from here.\n */\n\n/** The four type roles. A primitive picks a role, never a size. */\nexport const typeRoles = {\n /** Labels, times, counters. */\n meta: { size: 12, lineHeight: 16, weight: 400 },\n /** Rows and controls. */\n row: { size: 13, lineHeight: 20, weight: 400 },\n /** Titles in a head, reading text. */\n body: { size: 14, lineHeight: 20, weight: 400 },\n /** The one main statement or name. */\n lead: { size: 18, lineHeight: 24, weight: 600 },\n} as const;\n\nexport type TypeRole = keyof typeof typeRoles;\n\n/** The three weights; emphasis is a weight, never a size. */\nexport const fontWeights = [400, 500, 600] as const;\n\n/**\n * Where text starts in a column: 20 px from 768 px, 16 px below. After an icon the text edge is 24 px further in\n * (16 px icon and 8 px gap), so 44 px and 40 px on the phone.\n */\nexport const textEdge = { wide: 20, phone: 16, afterIcon: 24, phoneBelow: 768 } as const;\n\n/** The one hairline: 1 px in one colour. Lines separate groups and reach the edges of their column. */\nexport const hairline = { width: 1 } as const;\n\n/** Radii by role: a mark (4), a control or an overlay (8), round (999), the app card (14). Structure is square. */\nexport const radii = { mark: 4, control: 8, overlay: 8, round: 999, card: 14 } as const;\n\n/**\n * Fixed heights by place; a primitive takes its height from where it stands. The row heights are minima, as in the\n * mockup: a row of two or three lines is taller than its minimum by its line, so it stands 53 and 73 px apart\n * (`row2 + hairline.width`), exactly as the approved mockup renders it.\n */\nexport const heights = {\n head: 56,\n status: 52,\n tabs: 44,\n bar: 40,\n columns: 36,\n row: 40,\n row2: 52,\n row3: 72,\n dense: 32,\n control: 36,\n controlSmall: 28,\n} as const;\n\n/** A grip's pill centre lies on the centre of its line within this many CSS px, at device pixel ratio 1 and 2. */\nexport const gripTolerance = 0.25;\n"],"mappings":"A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Y,EAAE;AAChB,CAAU;;AAEV;AACA,OAAO,MAAM,aAAa,GAAG,IAAI","ignoreList":[]}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Opens a link's page in place, beside the real link (`href`): the contract of `@k2b/ssr/nav`'s `Link`, which the
3
+ * primitive renders. A plain same-origin click (the main button, no modifier key, no other target) reaches it; the
4
+ * link has then taken the click and cancelled a pending page swap, and the handler moves history with `push` or
5
+ * `replaceWith`, or loads the page with `fallback`. A click with a modifier key, "open in new tab" and a click before
6
+ * the page is live stay the browser's.
7
+ */
8
+
9
+ /** The width of a column that can be dragged: its minimum and its default, in CSS px. Nothing else. */
10
+
11
+ /**
12
+ * An action as data. The primitive decides whether it becomes a button, an icon button or a text button, so the
13
+ * same action looks the same in every place (concept, API style).
14
+ */
15
+
16
+ /** At most two actions, such as the text buttons in the head of a section; a third does not fit by type. */
17
+
18
+ /** The colours of meaning. A tone is never decoration: it says ok, wait, wrong, AI or "yours". */
19
+
20
+ /** A person or an organisation shown as initials on a colour. */
21
+
22
+ /** The initials of a name: the first letters of its first two words. */
23
+ export const initialsOf = person => person.initials ?? person.name.split(/\s+/).filter(Boolean).slice(0, 2).map(word => word[0].toUpperCase()).join("");
24
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["v2/types.ts"],"sourcesContent":["import type { LinkNavigateEvent } from \"@k2b/ssr/nav\";\n\n/**\n * Opens a link's page in place, beside the real link (`href`): the contract of `@k2b/ssr/nav`'s `Link`, which the\n * primitive renders. A plain same-origin click (the main button, no modifier key, no other target) reaches it; the\n * link has then taken the click and cancelled a pending page swap, and the handler moves history with `push` or\n * `replaceWith`, or loads the page with `fallback`. A click with a modifier key, \"open in new tab\" and a click before\n * the page is live stay the browser's.\n */\nexport type OnNavigate = (event: LinkNavigateEvent) => void | Promise<void>;\n\n/** The width of a column that can be dragged: its minimum and its default, in CSS px. Nothing else. */\nexport type Width = { min: number; default: number };\n\n/**\n * An action as data. The primitive decides whether it becomes a button, an icon button or a text button, so the\n * same action looks the same in every place (concept, API style).\n */\nexport type Action = {\n label: string;\n /** A Tabler icon name without the `ti-` prefix, such as `plus`. */\n icon?: string;\n href?: string;\n /** With `href`: opens the page in place on a plain click (see `OnNavigate`). */\n onNavigate?: OnNavigate;\n onClick?: () => void;\n /** A quiet summary after the label where the place shows one, such as \"Bank, Person, Portal\". */\n meta?: string;\n /** The action leads further, to a page with more: a chevron to the right after the label. */\n forward?: boolean;\n};\n\n/** At most two actions, such as the text buttons in the head of a section; a third does not fit by type. */\nexport type TwoActions = readonly [Action] | readonly [Action, Action];\n\n/** The colours of meaning. A tone is never decoration: it says ok, wait, wrong, AI or \"yours\". */\nexport type Status = \"ok\" | \"warn\" | \"bad\";\n\n/** A person or an organisation shown as initials on a colour. */\nexport type Person = {\n name: string;\n initials?: string;\n /** The colour behind the initials; without it the fixed colour of the name, the same everywhere in Cloud. */\n color?: string;\n};\n\n/** The initials of a name: the first letters of its first two words. */\nexport const initialsOf = (person: Person): string =>\n person.initials ??\n person.name\n .split(/\\s+/)\n .filter(Boolean)\n .slice(0, 2)\n .map((word) => word[0]!.toUpperCase())\n .join(\"\");\n"],"mappings":"AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;;AAGA;AACA;AACA;AACA;;AAeA;;AAGA;;AAGA;;AAQA;AACA,OAAO,MAAM,UAAU,GAAI,MAAc,IACvC,MAAM,CAAC,QAAQ,IACf,MAAM,CAAC,IAAI,CACR,KAAK,CAAC,KAAK,CAAC,CACZ,MAAM,CAAC,OAAO,CAAC,CACf,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CACX,GAAG,CAAE,IAAI,IAAK,IAAI,CAAC,CAAC,CAAC,CAAE,WAAW,CAAC,CAAC,CAAC,CACrC,IAAI,CAAC,EAAE,CAAC","ignoreList":[]}
@@ -0,0 +1,54 @@
1
+ import { type JSX } from "solid-js";
2
+ import type { Action, OnNavigate, Person } from "./types";
3
+ type ButtonBase = {
4
+ /**
5
+ * The weight of the action: `primary` filled blue (one per page), `secondary` framed (default), `ghost` without a
6
+ * frame, `text` a quiet text button in a head or at the end of a row. The height comes from the place.
7
+ */
8
+ variant?: "primary" | "secondary" | "ghost" | "text";
9
+ /** A Tabler icon name before the label. */
10
+ icon?: string;
11
+ /** A person instead of an icon, such as the one a thread is assigned to. */
12
+ avatar?: Person;
13
+ /** A link that looks like a button. */
14
+ href?: string;
15
+ /** With `href`: opens the page in place on a plain click (see `OnNavigate`); a disabled link never calls it. */
16
+ onNavigate?: OnNavigate;
17
+ onClick?: JSX.EventHandler<HTMLElement, MouseEvent>;
18
+ /** The button opens a menu: a chevron after the label. */
19
+ menu?: boolean;
20
+ /** The button leads further, to a page with more: a chevron to the right after the label. */
21
+ forward?: boolean;
22
+ disabled?: boolean;
23
+ type?: "button" | "submit";
24
+ /** Stays in a head on the phone, where the other actions move into the menu. */
25
+ keep?: boolean;
26
+ /**
27
+ * A hint under the pointer, for a button whose words give way to its symbol in a narrow place (the bar of a
28
+ * selection). An icon button shows its label as the hint by itself.
29
+ */
30
+ title?: string;
31
+ };
32
+ export type ButtonProps = ButtonBase & ({
33
+ children: JSX.Element;
34
+ label?: string;
35
+ } | {
36
+ children?: undefined;
37
+ /** An icon button needs a name (rule 5: wrong fails at once). */
38
+ label: string;
39
+ });
40
+ /** The one button: round, one height per place, a link through `href`. An icon button must have a label. */
41
+ export declare const Button: (props: ButtonProps) => JSX.Element;
42
+ /** An action as data turned into a button of the given weight; without an icon it always shows its label. */
43
+ export declare const ActionButton: (props: {
44
+ action: Action;
45
+ variant?: ButtonProps["variant"];
46
+ iconOnly?: boolean;
47
+ titled?: boolean;
48
+ }) => JSX.Element;
49
+ /** The copy button beside a value (internal to Facts). */
50
+ export declare const CopyButton: (props: {
51
+ label: string;
52
+ value: string;
53
+ }) => JSX.Element;
54
+ export {};
@@ -0,0 +1,173 @@
1
+ import { type JSX } from "solid-js";
2
+ import type { Action, OnNavigate, Person, Status, TwoActions } from "./types";
3
+ export type NavItem = {
4
+ label: string;
5
+ icon: string;
6
+ href?: string;
7
+ /** With `href`: opens the page in place on a plain click (see `OnNavigate`). */
8
+ onNavigate?: OnNavigate;
9
+ onClick?: () => void;
10
+ count?: number | string;
11
+ /** The open one. */
12
+ current?: boolean;
13
+ /** One level in, such as the folders of a mailbox. */
14
+ nested?: boolean;
15
+ /** Something new here. */
16
+ dot?: Status;
17
+ };
18
+ export type NavGroup = {
19
+ label?: string;
20
+ action?: Action;
21
+ items: readonly NavItem[];
22
+ };
23
+ export type NavProps = {
24
+ /** The app's name and symbol at the top. */
25
+ title: string;
26
+ icon: string;
27
+ groups: readonly NavGroup[];
28
+ /** Entries at the foot, such as "Hidden (2)". */
29
+ foot?: readonly NavItem[];
30
+ };
31
+ /** The sidebar of an app: its name, groups of round entries with counts, entries at the foot. */
32
+ export declare const Nav: (props: NavProps) => JSX.Element;
33
+ export type Tab = {
34
+ label: string;
35
+ icon?: string;
36
+ count?: number | string;
37
+ /** The tab leads to this page … */
38
+ href?: string;
39
+ /** … opens it in place on a plain click, while the link still opens in a new tab (see `OnNavigate`) … */
40
+ onNavigate?: OnNavigate;
41
+ /** … or switches the view in place. */
42
+ onClick?: () => void;
43
+ current?: boolean;
44
+ menu?: boolean;
45
+ };
46
+ export type TabsProps = {
47
+ items: readonly Tab[];
48
+ label: string;
49
+ };
50
+ /**
51
+ * The views of a head or of an object. In the start of a head bar they share it with the actions and give way to
52
+ * them; as the head of a pane they are a bar of their own, 44 px. The open tab stands on the line of its bar. (The
53
+ * keyboard comes with the behaviour layer.)
54
+ */
55
+ export declare const Tabs: (props: TabsProps) => JSX.Element;
56
+ /**
57
+ * Where a page stands, in the start of its head instead of tabs: the places before it quiet, the page itself in 600.
58
+ * On the phone the head with a path gives way to the phone bar of the shell, which names the page.
59
+ */
60
+ export type PathProps = {
61
+ items: readonly {
62
+ label: string;
63
+ href?: string;
64
+ }[];
65
+ label: string;
66
+ };
67
+ export declare const Path: (props: PathProps) => JSX.Element;
68
+ /** A key figure: words before and after, the value itself in 600 (leave it out for words alone, such as "12 offen"). */
69
+ export type StatusFact = {
70
+ before?: string;
71
+ value?: string | number;
72
+ after?: string;
73
+ };
74
+ export type StatusRowProps = {
75
+ /** The one main statement, such as "7 unread". */
76
+ lead: string;
77
+ /** Key figures after it; they leave on the phone. */
78
+ facts?: readonly StatusFact[];
79
+ /** A box at the start that selects all entries. */
80
+ select?: {
81
+ label: string;
82
+ checked?: boolean | "mixed";
83
+ onChange?: (checked: boolean) => void;
84
+ };
85
+ /** Filters or a segment at the end; they leave on the phone. */
86
+ filters?: JSX.Element;
87
+ /**
88
+ * While entries are selected the row becomes the bar of what can be done with them (rule 6): the count, the
89
+ * actions, and the way out.
90
+ */
91
+ selection?: {
92
+ count: string;
93
+ actions: readonly Action[];
94
+ clear: Action;
95
+ };
96
+ };
97
+ /** The status row of a pane (52 px): the one lead statement, key figures, filters on the right. */
98
+ export declare const StatusRow: (props: StatusRowProps) => JSX.Element;
99
+ export type NoticeProps = {
100
+ /** What it is: a note of a person, a summary by AI, something wrong, something waiting. */
101
+ tone: "note" | "ai" | "bad" | "warn";
102
+ /** A symbol other than the one of the tone, such as a pin for a pinned note. */
103
+ icon?: string;
104
+ /** A short title; the text then runs under it across the full width. */
105
+ title?: string;
106
+ /** Quiet words after the title: who and when. */
107
+ meta?: string;
108
+ /** Text buttons at the end; at most two. */
109
+ actions?: TwoActions;
110
+ children: JSX.Element;
111
+ };
112
+ /** A band with a sign, a sentence and its consequence, and at most two deeds. The tint is its edge. */
113
+ export declare const Notice: (props: NoticeProps) => JSX.Element;
114
+ export type DigestEntry = {
115
+ icon: string;
116
+ color?: string;
117
+ /** A short date, such as "17. Nov.". */
118
+ date: string;
119
+ /** The number or name of the thing. */
120
+ title: string;
121
+ /** Its state: a symbol and a word. */
122
+ state: {
123
+ icon: string;
124
+ label: string;
125
+ tone?: Status;
126
+ };
127
+ /** One sentence about it; `<Text weight="strong">` stresses a word. */
128
+ text: JSX.Element;
129
+ href?: string;
130
+ };
131
+ export type DigestProps = {
132
+ items: readonly DigestEntry[];
133
+ children?: never;
134
+ label?: string;
135
+ } | {
136
+ items?: never;
137
+ children: JSX.Element;
138
+ label?: string;
139
+ };
140
+ /**
141
+ * The newest few on a first page, without lines (decided 22.11.): dated entries in a grid of date, number with state
142
+ * and sentence, or plain rows whose second line is a sentence.
143
+ */
144
+ export declare const Digest: (props: DigestProps) => JSX.Element;
145
+ export type Step = {
146
+ label: string;
147
+ /** A quiet line under the step, such as a date or "10 von 18". */
148
+ meta?: string;
149
+ /** Done (grey with a tick), the one running now (a blue ring), or still to come (empty). */
150
+ state: "done" | "now" | "next";
151
+ };
152
+ /** A way of a few steps: done ones grey with a tick, the running one a blue ring, the coming ones empty. */
153
+ export type StepsProps = {
154
+ items: readonly Step[];
155
+ label: string;
156
+ };
157
+ export declare const Steps: (props: StepsProps) => JSX.Element;
158
+ export type RecordId = {
159
+ label?: string;
160
+ value: string;
161
+ icon?: string;
162
+ copy?: boolean;
163
+ };
164
+ export type RecordHeadProps = {
165
+ name: string;
166
+ avatar?: Person;
167
+ /** Kinds of the record, such as "Private". */
168
+ kinds?: readonly string[];
169
+ /** Identifiers and contact at a glance; they leave on the phone. */
170
+ ids?: readonly RecordId[];
171
+ };
172
+ /** The identity of a record in its head: avatar, name, kinds, identifiers. Put it in the start of the head `Bar`. */
173
+ export declare const RecordHead: (props: RecordHeadProps) => JSX.Element;