courthive-components 5.0.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -320,6 +320,39 @@ Import the bundled CSS:
320
320
  import 'courthive-components/dist/courthive-components.css';
321
321
  ```
322
322
 
323
+ ### Theme tokens — two families, on purpose
324
+
325
+ Colour is driven entirely by CSS custom properties defined in `src/styles/theme.css`, in a `:root`
326
+ block (light) and a `[data-theme='dark']` block. **Never hardcode a colour in component CSS**, and
327
+ never use Bulma classes or `--bulma-*`: class names that merely follow Bulma's naming are ours and
328
+ are fine, but the palette must resolve through a token or it cannot follow the theme.
329
+
330
+ | family | what it is | use it for |
331
+ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
332
+ | `--chc-*` | The general design system. Semantic roles — `--chc-text-primary`, `--chc-bg-elevated`, `--chc-border-primary`, `--chc-container-*` intents and their `--chc-on-*` foregrounds. | Anything shared: draws, cards, tables, buttons, notifications. |
333
+ | `--sp-*` | A slate palette with translucent, layered surfaces (`--sp-panel-bg`, `--sp-card-bg`, `--sp-border`) plus finer border and status intensities. | The schedule page, scheduling profile, policy catalog, topology builder and interactive scoring — surfaces designed as panels over a ground. |
334
+
335
+ They are **not** duplicates. `--chc-*` began as a compatibility layer whose light values match
336
+ previously hardcoded ones; `--sp-*` is a newer, denser palette with alpha-composited surfaces
337
+ `--chc-*` has no equivalent for. Consumers bridge both: TMX aliases 29 `--chc-*` and 13 `--sp-*` to
338
+ its own `--tmx-*` system.
339
+
340
+ **Rules that keep them working:**
341
+
342
+ - **Every token must be defined** in `theme.css`, in both blocks. A token used but never defined
343
+ renders its call-site fallback in _both_ themes — which is how `--sp-border-focus` shipped an
344
+ invisible focus border.
345
+ - **Do not write a fallback.** `var(--sp-muted)`, never `var(--sp-muted, #888)`. Fallbacks drift from
346
+ the definition — `--sp-muted` once had five different ones — and the token stops being a single
347
+ source of truth.
348
+ - **The library must not reference a consumer's tokens.** `--tmx-*` belongs to TMX; reaching for it
349
+ from here inverts the dependency.
350
+ - **`--chc-on-*` is the readable foreground for a `--chc-container-*` fill.** Both themes are held to
351
+ WCAG AA by `src/styles/theme-contrast.test.ts`; change a container colour and that test tells you
352
+ whether its foreground still works.
353
+ - Brand themes (`src/styles/themes.css`, `.chc-theme-*`) keep literal colours. A brand does not
354
+ follow the light/dark theme.
355
+
323
356
  ## TypeScript Support
324
357
 
325
358
  The package includes TypeScript definitions:
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Why a seed exists, for the on-screen draw.
3
+ *
4
+ * `Side.seedingBasis` records the ground on which a seeding was awarded, as distinct from
5
+ * `seedValue`, which says only where it sits in the order. It matters wherever a governing body
6
+ * permits seeds ABOVE the count its policy allows — a protected ranking seeded ALONGSIDE the normal
7
+ * seeds rather than in place of one. Such a seed displaced nobody, and it is the one somebody will
8
+ * ask about.
9
+ *
10
+ * ## Why the bracket is marked here and not on the printed sheet
11
+ *
12
+ * pdf-factory deliberately leaves the bracket alone and footnotes its **seedings table** instead:
13
+ * an entry line there already carries name, nationality and an entry-status badge, and the table
14
+ * exists to answer "why these seeds". The on-screen draw has **no seedings table** — the bracket is
15
+ * the only surface the fact can appear on, so leaving it unmarked leaves it nowhere.
16
+ *
17
+ * The marker is a single character appended inside the seed's own brackets, so it costs no layout;
18
+ * the basis itself goes in a `title`, following the same rule the presence work settled on — the
19
+ * fact is displayed, the detail is on hover.
20
+ *
21
+ * `RANKING` is the ordinary basis and is never marked. An absent basis means the ordinary one, not
22
+ * "unknown", so marking every seed would bury the one that is not.
23
+ */
24
+ /** The marker to append to a seed display, or `''` where the seed is ordinary. */
25
+ export declare function seedingBasisMarker(seedingBasis?: string): string;
26
+ /**
27
+ * The hover text for a marked seed, or `undefined` where there is nothing to say.
28
+ *
29
+ * An unrecognised basis is printed verbatim rather than dropped. The factory's basis enum can gain
30
+ * members, and a tooltip that silently omits one it does not know is worse than a tooltip showing
31
+ * an unfamiliar word — the second is a question, the first is a wrong answer.
32
+ */
33
+ export declare function seedingBasisTitle(seedingBasis?: string): string | undefined;
@@ -10,4 +10,6 @@ export type StatusCodePickerHandle = {
10
10
  export declare function buildStatusCodePicker(params: {
11
11
  groups?: StatusCodeGroups;
12
12
  labels?: ScoringModalLabels;
13
+ /** The code already recorded on the matchUp, so re-opening the dialog shows what was saved. */
14
+ initialCode?: string;
13
15
  }): StatusCodePickerHandle;