@charcuterie/ui 2.9.0 → 2.10.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 (56) hide show
  1. package/README.md +9 -0
  2. package/dist/Header/Header.d.ts +52 -0
  3. package/dist/Header/Header.d.ts.map +1 -0
  4. package/dist/Header/Header.js +55 -0
  5. package/dist/Header/Header.js.map +1 -0
  6. package/dist/Main/Main.d.ts +113 -0
  7. package/dist/Main/Main.d.ts.map +1 -0
  8. package/dist/Main/Main.js +123 -0
  9. package/dist/Main/Main.js.map +1 -0
  10. package/dist/Rail/Rail.d.ts +61 -0
  11. package/dist/Rail/Rail.d.ts.map +1 -0
  12. package/dist/Rail/Rail.js +64 -0
  13. package/dist/Rail/Rail.js.map +1 -0
  14. package/dist/Shell/Shell.d.ts +112 -0
  15. package/dist/Shell/Shell.d.ts.map +1 -0
  16. package/dist/Shell/Shell.js +116 -0
  17. package/dist/Shell/Shell.js.map +1 -0
  18. package/dist/Shell/contentWidth.d.ts +63 -0
  19. package/dist/Shell/contentWidth.d.ts.map +1 -0
  20. package/dist/Shell/contentWidth.js +74 -0
  21. package/dist/Shell/contentWidth.js.map +1 -0
  22. package/dist/Shell/shellContext.d.ts +36 -0
  23. package/dist/Shell/shellContext.d.ts.map +1 -0
  24. package/dist/Shell/shellContext.js +32 -0
  25. package/dist/Shell/shellContext.js.map +1 -0
  26. package/dist/index.d.ts +9 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +4 -0
  29. package/dist/index.js.map +1 -1
  30. package/dist/viewport.testHelpers.d.ts +31 -0
  31. package/dist/viewport.testHelpers.d.ts.map +1 -0
  32. package/dist/viewport.testHelpers.js +34 -0
  33. package/dist/viewport.testHelpers.js.map +1 -0
  34. package/package.json +1 -1
  35. package/src/Header/Header.mdx +72 -0
  36. package/src/Header/Header.stories.tsx +221 -0
  37. package/src/Header/Header.test.tsx +122 -0
  38. package/src/Header/Header.tsx +118 -0
  39. package/src/Main/Main.mdx +149 -0
  40. package/src/Main/Main.stories.tsx +164 -0
  41. package/src/Main/Main.test.tsx +167 -0
  42. package/src/Main/Main.tsx +174 -0
  43. package/src/Rail/Rail.mdx +75 -0
  44. package/src/Rail/Rail.stories.tsx +177 -0
  45. package/src/Rail/Rail.test.tsx +150 -0
  46. package/src/Rail/Rail.tsx +102 -0
  47. package/src/Shell/Shell.mdx +186 -0
  48. package/src/Shell/Shell.stories.tsx +185 -0
  49. package/src/Shell/Shell.test.tsx +267 -0
  50. package/src/Shell/Shell.tsx +170 -0
  51. package/src/Shell/contentWidth.ts +89 -0
  52. package/src/Shell/shellContext.ts +41 -0
  53. package/src/index.ts +16 -0
  54. package/src/shell.storyHelpers.tsx +258 -0
  55. package/src/sourceRules.test.ts +17 -1
  56. package/src/viewport.testHelpers.ts +47 -0
@@ -0,0 +1,116 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useUniqueId } from "@charcuterie/logic";
3
+ import { useMemo, } from "react";
4
+ import { toClassName } from "../toClassName.js";
5
+ import { DEFAULT_CONTENT_WIDTH, } from "./contentWidth.js";
6
+ import { ShellContext } from "./shellContext.js";
7
+ /**
8
+ * The page frame: one `Header`, up to two `Rail`s, one `Main`.
9
+ *
10
+ * **The largest duplicated surface in the fleet.** Ten of twelve UI
11
+ * repos hand-roll this, and three of them have a file literally
12
+ * called `AppShell.tsx` — mail-sifter's and points-market's headers
13
+ * are a **byte-identical** string
14
+ * (`sticky top-0 z-40 border-b border-border-subtle bg-surface-base/90 backdrop-blur-md`),
15
+ * arrived at independently, and board-games' is the same structure
16
+ * with `sticky` dropped. The remaining seven spell it as
17
+ * `PageChrome`, `Header`, `DashboardHeader`, `Layout` (twice),
18
+ * `TitleBar`, and inline in `App.tsx`.
19
+ *
20
+ * Three things fall out of owning it once, and each is a bug
21
+ * somewhere in that list today:
22
+ *
23
+ * - **A skip link.** All ten are missing one. A keyboard user
24
+ * tabs through the whole header on every page.
25
+ * - **One width, not two.** `Header` and `Main` read the same
26
+ * `contentWidth` through context — see `shellContext.ts` for
27
+ * the app where they disagree.
28
+ * - **Sticky that is actually sticky.** mux-magic's `PageHeader`
29
+ * is *described* as sticky and sets only `z-index`; it never
30
+ * sets `position: sticky`, so the z-index does nothing and the
31
+ * header scrolls away. `Header`'s `isSticky` sets both or
32
+ * neither.
33
+ *
34
+ * ## The layout is one grid, and the rails do not duplicate
35
+ *
36
+ * Three columns at `md` and up — `auto minmax(0, 1fr) auto`, so an
37
+ * absent rail is a **zero-width track** rather than a conditional
38
+ * subtree — collapsing to a single column below it, where the
39
+ * children simply stack in DOM order. The same `Rail` element is
40
+ * in the document at every width; nothing is rendered twice behind
41
+ * `hidden`/`lg:hidden`.
42
+ *
43
+ * That matters beyond tidiness. mux-magic's `PageHeader` renders
44
+ * its entire control set twice (lines 290–345 and 356–410) and
45
+ * mail-sifter's `TriageQueue` does the same, so every action
46
+ * exists twice in the DOM at every viewport: tests have to be
47
+ * defensively scoped with `within(toolbar)`, and any agent driving
48
+ * the page sees phantom controls it cannot click.
49
+ *
50
+ * `minmax(0, 1fr)` on the middle track is the horizontal-scroll
51
+ * fix, not a formality. A grid track's automatic minimum is
52
+ * `min-content`, so **one long unbroken string in `Main` widens
53
+ * the whole page** — which is the bug plex-channels' narrow view
54
+ * has today. rip-deck's `BayGrid` documents the same fix from the
55
+ * other end.
56
+ *
57
+ * There is no `gap`: an empty `auto` track is 0 wide, but a `gap`
58
+ * beside it is not, so a shell with no rails would carry two
59
+ * mystery gutters. `Rail` and `Main` bring their own padding.
60
+ *
61
+ * ## `overflow-x: clip` — the structural guarantee
62
+ *
63
+ * `minmax(0, 1fr)` fixes the tracks and `Main`'s `wrap-anywhere`
64
+ * fixes the text, but neither reaches the shape that actually
65
+ * broke plex-channels: **a closed panel parked at
66
+ * `transform: translateX(110%)`**. A transform does not take a box
67
+ * out of the document's scrollable overflow region — and neither
68
+ * does `visibility: hidden` — so an off-screen drawer that looks
69
+ * absent still makes the page scroll to it. It is a favourite
70
+ * fleet pattern and no amount of `min-width: 0` touches it.
71
+ *
72
+ * `clip`, not `hidden`, and the two are not interchangeable here:
73
+ * `overflow: hidden` creates a **scroll container**, which would
74
+ * become the sticky containing block for `Header` and freeze it in
75
+ * place. `overflow-x: clip` creates no scrollport, so `Header`
76
+ * keeps sticking to the viewport, and `overflow-y` stays `visible`
77
+ * — a pair that is legal for `clip` and illegal for `hidden`,
78
+ * which would compute the other axis to `auto`.
79
+ *
80
+ * The trade is deliberate: content wider than the frame is
81
+ * **clipped rather than reachable by scrolling sideways**, which is
82
+ * exactly the outcome asked for. Content that genuinely needs to
83
+ * be wider owns a scroll container of its own — the pattern
84
+ * `Main.mdx` documents for tables.
85
+ *
86
+ * ### `relative` is what makes the clip reach anything
87
+ *
88
+ * `overflow-x: clip` only clips descendants whose **containing
89
+ * block chain passes through the clipping element**. An absolutely
90
+ * positioned element with no positioned ancestor resolves against
91
+ * the *initial* containing block instead, so it sails straight
92
+ * past every `overflow` in the tree and lands its overflow on
93
+ * `documentElement` — where `document.body.scrollWidth` still
94
+ * reads clean and only `document.documentElement.scrollWidth`
95
+ * shows it.
96
+ *
97
+ * That is not hypothetical: it is measured. Before this
98
+ * `relative`, the parked-drawer fixture reported `shellScroll:
99
+ * 390`, `bodyScroll: 390` and `docScroll: 742` at a 390px
100
+ * viewport — the shell dutifully clipping a box it had no
101
+ * authority over.
102
+ *
103
+ * The obvious candidate to own it, `Main`'s content column, does
104
+ * **not**: `container-type: inline-size` computes `contain` to
105
+ * `none` in Chromium and establishes no containing block for
106
+ * absolute positioning, which is measured too — the drawer's
107
+ * `offsetParent` was `BODY`. So `Shell` takes the job, which is
108
+ * also the honest place for it: the frame is what an app's parked
109
+ * chrome is parked against.
110
+ */
111
+ export const Shell = ({ children, className, contentWidth = DEFAULT_CONTENT_WIDTH, skipLinkLabel = "Skip to main content", ...divProps }) => {
112
+ const mainId = useUniqueId();
113
+ const shellContext = useMemo(() => ({ contentWidth, mainId }), [contentWidth, mainId]);
114
+ return (_jsx(ShellContext.Provider, { value: shellContext, children: _jsxs("div", { ...divProps, className: toClassName("relative grid min-h-dvh grid-cols-1 grid-rows-[auto_auto_1fr_auto] overflow-x-clip bg-surface-base text-content-primary md:grid-cols-[auto_minmax(0,1fr)_auto] md:grid-rows-[auto_1fr]", className), children: [_jsx("a", { className: "fixed top-0 start-0 z-[var(--layer-toast)] m-3 -translate-y-24 rounded-md border border-border-subtle bg-surface-raised px-3 py-2 font-medium text-content-primary text-sm shadow-medium focus-visible:translate-y-0", href: `#${mainId}`, children: skipLinkLabel }), children] }) }));
115
+ };
116
+ //# sourceMappingURL=Shell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Shell.js","sourceRoot":"","sources":["../../src/Shell/Shell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAGL,OAAO,GACR,MAAM,OAAO,CAAA;AAEd,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAEL,qBAAqB,GACtB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAOhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuGG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EACpB,QAAQ,EACR,SAAS,EACT,YAAY,GAAG,qBAAqB,EACpC,aAAa,GAAG,sBAAsB,EACtC,GAAG,QAAQ,EACA,EAAa,EAAE;IAC1B,MAAM,MAAM,GAAG,WAAW,EAAE,CAAA;IAE5B,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CAAC,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,EAChC,CAAC,YAAY,EAAE,MAAM,CAAC,CACvB,CAAA;IAED,OAAO,CACL,KAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YACxC,kBACM,QAAQ,EACZ,SAAS,EAAE,WAAW,CACpB,wLAAwL,EACxL,SAAS,CACV,aAcD,YACE,SAAS,EAAC,sNAAsN,EAChO,IAAI,EAAE,IAAI,MAAM,EAAE,YAEjB,aAAa,GACZ,EAEH,QAAQ,IACL,GACgB,CACzB,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * How wide the content column is allowed to get — the one number
3
+ * the fleet has never agreed on.
4
+ *
5
+ * Ten repos hand-roll their page chrome and **no two of them cap
6
+ * the column at the same width**: `max-w-5xl` (board-games,
7
+ * portly), `max-w-6xl` and `max-w-3xl` mixed inside one app
8
+ * (mux-magic), `max-w-7xl` (gallery-downloader, spoolbuddy),
9
+ * `max-w-[90rem]` (mail-sifter), `80rem` (points-market), a raw
10
+ * `1400px` in plain CSS (plex-channels), a JS-computed one
11
+ * (rip-deck), and none at all in three more. It is the least
12
+ * standardized value in the entire fleet.
13
+ *
14
+ * Two shapes are accepted, because the fleet genuinely has two
15
+ * cases and collapsing them is what produced the mess:
16
+ *
17
+ * 1. A **`screen.*` step** — the ordinary page. Named, so a
18
+ * reviewer reads `contentWidth="lg"` rather than deciding
19
+ * whether `max-w-6xl` was chosen or inherited.
20
+ * 2. A **`${number}rem` literal** — the runtime-computed case.
21
+ * rip-deck's `contentMaxWidthRem(columns)` widens the cap as
22
+ * the grid gains columns (1 → 56rem, 2 → 72rem, 3 → 106rem),
23
+ * and no fixed scale can express a number that is decided
24
+ * after the viewport is measured.
25
+ *
26
+ * `"full"` is the third answer and it is deliberate rather than a
27
+ * hole: a wall of poster tiles wants the whole window, and an app
28
+ * that wants that today reaches the same place by *omitting* the
29
+ * cap, which is indistinguishable from having forgotten it.
30
+ *
31
+ * **`max-w-*` is not used and must not be.** Tailwind v4 owns
32
+ * `--container-*` for that scale at *different* sizes than our
33
+ * `screen.*`, which is the collision that renamed our
34
+ * container-query scale to `--cq-*`
35
+ * ([decision](../../../../docs/decisions/2026-07-29-container-query-scale-is-cq-not-container.md)).
36
+ * The cap is therefore an inline `max-inline-size` reading
37
+ * `var(--screen-*)`, so it stays a token rather than becoming a
38
+ * literal the moment it is written down.
39
+ */
40
+ import { screen } from "@charcuterie/tokens";
41
+ /** `sm` | `md` | `lg` | `xl` | `2xl`, from the token scale. */
42
+ export type ScreenStep = keyof typeof screen;
43
+ export type ContentWidth = ScreenStep | "full" | `${number}rem`;
44
+ /**
45
+ * The `max-inline-size` a `contentWidth` resolves to, or
46
+ * `undefined` for `"full"` — which is the absence of the property
47
+ * rather than a very large value, so nothing has to be un-set.
48
+ */
49
+ export declare const toMaxInlineSize: (contentWidth: ContentWidth) => string | undefined;
50
+ /**
51
+ * The cap an app gets without asking, and it is deliberately
52
+ * **narrower** than most of what the fleet ships.
53
+ *
54
+ * The owner's complaint, verbatim: *"All these apps seem to be
55
+ * really narrow with a very large max-width. By that I mean 1
56
+ * column, but waaaaaaay too wide."* A single column of prose or
57
+ * form fields at `max-w-7xl` is one line of text the eye has to
58
+ * track across a monitor. `screen.lg` is 64rem — wide enough for a
59
+ * two-up card grid, narrow enough to read — and an app whose
60
+ * content genuinely fills a window says so, once, in one place.
61
+ */
62
+ export declare const DEFAULT_CONTENT_WIDTH: ContentWidth;
63
+ //# sourceMappingURL=contentWidth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contentWidth.d.ts","sourceRoot":"","sources":["../../src/Shell/contentWidth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAE5C,+DAA+D;AAC/D,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,MAAM,CAAA;AAE5C,MAAM,MAAM,YAAY,GACpB,UAAU,GACV,MAAM,GACN,GAAG,MAAM,KAAK,CAAA;AASlB;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC1B,cAAc,YAAY,KACzB,MAAM,GAAG,SAUX,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,EAAE,YAAmB,CAAA"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * How wide the content column is allowed to get — the one number
3
+ * the fleet has never agreed on.
4
+ *
5
+ * Ten repos hand-roll their page chrome and **no two of them cap
6
+ * the column at the same width**: `max-w-5xl` (board-games,
7
+ * portly), `max-w-6xl` and `max-w-3xl` mixed inside one app
8
+ * (mux-magic), `max-w-7xl` (gallery-downloader, spoolbuddy),
9
+ * `max-w-[90rem]` (mail-sifter), `80rem` (points-market), a raw
10
+ * `1400px` in plain CSS (plex-channels), a JS-computed one
11
+ * (rip-deck), and none at all in three more. It is the least
12
+ * standardized value in the entire fleet.
13
+ *
14
+ * Two shapes are accepted, because the fleet genuinely has two
15
+ * cases and collapsing them is what produced the mess:
16
+ *
17
+ * 1. A **`screen.*` step** — the ordinary page. Named, so a
18
+ * reviewer reads `contentWidth="lg"` rather than deciding
19
+ * whether `max-w-6xl` was chosen or inherited.
20
+ * 2. A **`${number}rem` literal** — the runtime-computed case.
21
+ * rip-deck's `contentMaxWidthRem(columns)` widens the cap as
22
+ * the grid gains columns (1 → 56rem, 2 → 72rem, 3 → 106rem),
23
+ * and no fixed scale can express a number that is decided
24
+ * after the viewport is measured.
25
+ *
26
+ * `"full"` is the third answer and it is deliberate rather than a
27
+ * hole: a wall of poster tiles wants the whole window, and an app
28
+ * that wants that today reaches the same place by *omitting* the
29
+ * cap, which is indistinguishable from having forgotten it.
30
+ *
31
+ * **`max-w-*` is not used and must not be.** Tailwind v4 owns
32
+ * `--container-*` for that scale at *different* sizes than our
33
+ * `screen.*`, which is the collision that renamed our
34
+ * container-query scale to `--cq-*`
35
+ * ([decision](../../../../docs/decisions/2026-07-29-container-query-scale-is-cq-not-container.md)).
36
+ * The cap is therefore an inline `max-inline-size` reading
37
+ * `var(--screen-*)`, so it stays a token rather than becoming a
38
+ * literal the moment it is written down.
39
+ */
40
+ import { screen } from "@charcuterie/tokens";
41
+ /**
42
+ * Derived from the scale rather than restated, so a step added to
43
+ * `screen.*` is accepted here without a second edit — and one
44
+ * removed stops typechecking at every call site.
45
+ */
46
+ const SCREEN_STEPS = new Set(Object.keys(screen));
47
+ /**
48
+ * The `max-inline-size` a `contentWidth` resolves to, or
49
+ * `undefined` for `"full"` — which is the absence of the property
50
+ * rather than a very large value, so nothing has to be un-set.
51
+ */
52
+ export const toMaxInlineSize = (contentWidth) => {
53
+ if (contentWidth === "full") {
54
+ return undefined;
55
+ }
56
+ if (SCREEN_STEPS.has(contentWidth)) {
57
+ return `var(--screen-${contentWidth})`;
58
+ }
59
+ return contentWidth;
60
+ };
61
+ /**
62
+ * The cap an app gets without asking, and it is deliberately
63
+ * **narrower** than most of what the fleet ships.
64
+ *
65
+ * The owner's complaint, verbatim: *"All these apps seem to be
66
+ * really narrow with a very large max-width. By that I mean 1
67
+ * column, but waaaaaaay too wide."* A single column of prose or
68
+ * form fields at `max-w-7xl` is one line of text the eye has to
69
+ * track across a monitor. `screen.lg` is 64rem — wide enough for a
70
+ * two-up card grid, narrow enough to read — and an app whose
71
+ * content genuinely fills a window says so, once, in one place.
72
+ */
73
+ export const DEFAULT_CONTENT_WIDTH = "lg";
74
+ //# sourceMappingURL=contentWidth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contentWidth.js","sourceRoot":"","sources":["../../src/Shell/contentWidth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAU5C;;;;GAIG;AACH,MAAM,YAAY,GAAG,IAAI,GAAG,CAAS,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;AAEzD;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,YAA0B,EACN,EAAE;IACtB,IAAI,YAAY,KAAK,MAAM,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,IAAI,YAAY,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;QACnC,OAAO,gBAAgB,YAAY,GAAG,CAAA;IACxC,CAAC;IAED,OAAO,YAAY,CAAA;AACrB,CAAC,CAAA;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAiB,IAAI,CAAA"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * What `Shell` tells `Header` and `Main` so they cannot disagree.
3
+ *
4
+ * This context exists because of one specific bug, present in the
5
+ * fleet today: **points-market's header is width-constrained and
6
+ * its `<main>` is not.** `AppShell.tsx` wraps the header row in
7
+ * `.pm-constrained` (80rem) and then renders
8
+ * `<main className="px-4 py-6 sm:px-6">` with no cap at all, so on
9
+ * a wide monitor the page title sits above content that starts to
10
+ * its left and runs past its right. Nothing errors, both values
11
+ * are individually reasonable, and the two were simply written on
12
+ * different days.
13
+ *
14
+ * A width that has to be stated twice will eventually be stated
15
+ * twice differently. So it is stated **once**, on `Shell`, and the
16
+ * two elements that have to agree read it from here. Either can
17
+ * still override for a genuine reason — a full-bleed hero `Main`
18
+ * under a constrained `Header` is a real design — but that now
19
+ * takes a prop somebody wrote on purpose.
20
+ *
21
+ * `mainId` rides along for the same reason: the skip link's `href`
22
+ * and the `<main>` it lands on are one value, generated once.
23
+ */
24
+ import type { ContentWidth } from "./contentWidth.ts";
25
+ export type ShellContextValue = {
26
+ contentWidth: ContentWidth;
27
+ mainId: string;
28
+ };
29
+ /**
30
+ * `null` rather than a default object, so `Header` and `Main` can
31
+ * tell "no `Shell` above me" from "a `Shell` that chose the
32
+ * defaults" — the first case has to generate its own `<main>` id,
33
+ * the second must not.
34
+ */
35
+ export declare const ShellContext: import("react").Context<ShellContextValue | null>;
36
+ //# sourceMappingURL=shellContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shellContext.d.ts","sourceRoot":"","sources":["../../src/Shell/shellContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,EAAE,YAAY,CAAA;IAC1B,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,YAAY,mDACsB,CAAA"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * What `Shell` tells `Header` and `Main` so they cannot disagree.
3
+ *
4
+ * This context exists because of one specific bug, present in the
5
+ * fleet today: **points-market's header is width-constrained and
6
+ * its `<main>` is not.** `AppShell.tsx` wraps the header row in
7
+ * `.pm-constrained` (80rem) and then renders
8
+ * `<main className="px-4 py-6 sm:px-6">` with no cap at all, so on
9
+ * a wide monitor the page title sits above content that starts to
10
+ * its left and runs past its right. Nothing errors, both values
11
+ * are individually reasonable, and the two were simply written on
12
+ * different days.
13
+ *
14
+ * A width that has to be stated twice will eventually be stated
15
+ * twice differently. So it is stated **once**, on `Shell`, and the
16
+ * two elements that have to agree read it from here. Either can
17
+ * still override for a genuine reason — a full-bleed hero `Main`
18
+ * under a constrained `Header` is a real design — but that now
19
+ * takes a prop somebody wrote on purpose.
20
+ *
21
+ * `mainId` rides along for the same reason: the skip link's `href`
22
+ * and the `<main>` it lands on are one value, generated once.
23
+ */
24
+ import { createContext } from "react";
25
+ /**
26
+ * `null` rather than a default object, so `Header` and `Main` can
27
+ * tell "no `Shell` above me" from "a `Shell` that chose the
28
+ * defaults" — the first case has to generate its own `<main>` id,
29
+ * the second must not.
30
+ */
31
+ export const ShellContext = createContext(null);
32
+ //# sourceMappingURL=shellContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shellContext.js","sourceRoot":"","sources":["../../src/Shell/shellContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AASrC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GACvB,aAAa,CAA2B,IAAI,CAAC,CAAA"}
package/dist/index.d.ts CHANGED
@@ -68,6 +68,8 @@ export type { FieldGroupProps } from "./Field/FieldGroup.tsx";
68
68
  export { FieldGroup } from "./Field/FieldGroup.tsx";
69
69
  export type { FileDropZoneProps } from "./FileDropZone/FileDropZone.tsx";
70
70
  export { FileDropZone } from "./FileDropZone/FileDropZone.tsx";
71
+ export type { HeaderProps } from "./Header/Header.tsx";
72
+ export { Header } from "./Header/Header.tsx";
71
73
  export type { IconButtonProps } from "./IconButton/IconButton.tsx";
72
74
  export { IconButton } from "./IconButton/IconButton.tsx";
73
75
  export type { IntentAppearance } from "./intentStyles.ts";
@@ -80,6 +82,8 @@ export type { LiveStatusIndicatorProps, LiveStatusIndicatorSize, } from "./LiveS
80
82
  export { LiveStatusIndicator } from "./LiveStatusIndicator/LiveStatusIndicator.tsx";
81
83
  export type { LogLine, LogViewerProps, } from "./LogViewer/LogViewer.tsx";
82
84
  export { LogViewer } from "./LogViewer/LogViewer.tsx";
85
+ export type { MainProps } from "./Main/Main.tsx";
86
+ export { Main } from "./Main/Main.tsx";
83
87
  export type { MediaTileProps, MediaTileRatio, } from "./MediaTile/MediaTile.tsx";
84
88
  export { MediaTile } from "./MediaTile/MediaTile.tsx";
85
89
  export type { MediaStatus } from "./MediaTile/mediaStatus.ts";
@@ -96,6 +100,8 @@ export type { ProgressThreshold } from "./ProgressBar/progressValue.ts";
96
100
  export { getProgressIntent, toProgressPercent, toProgressValue, } from "./ProgressBar/progressValue.ts";
97
101
  export type { RadioGroupProps, RadioItem, } from "./RadioGroup/RadioGroup.tsx";
98
102
  export { RadioGroup } from "./RadioGroup/RadioGroup.tsx";
103
+ export type { RailLandmark, RailProps, RailSide, } from "./Rail/Rail.tsx";
104
+ export { Rail } from "./Rail/Rail.tsx";
99
105
  export { AnchorLink } from "./RouterLink/AnchorLink.tsx";
100
106
  export { RouterLinkProvider, useRouterLink, } from "./RouterLink/RouterLinkProvider.tsx";
101
107
  export type { RouterLinkComponent, RouterLinkProps, } from "./RouterLink/routerLink.ts";
@@ -104,6 +110,9 @@ export type { SegmentedControlProps, SegmentedItem, } from "./SegmentedControl/S
104
110
  export { SegmentedControl } from "./SegmentedControl/SegmentedControl.tsx";
105
111
  export type { SelectItem, SelectOption, SelectOptionGroup, SelectProps, } from "./Select/Select.tsx";
106
112
  export { Select } from "./Select/Select.tsx";
113
+ export type { ContentWidth, ScreenStep, } from "./Shell/contentWidth.ts";
114
+ export type { ShellProps } from "./Shell/Shell.tsx";
115
+ export { Shell } from "./Shell/Shell.tsx";
107
116
  export type { SkeletonProps, SkeletonShape, } from "./Skeleton/Skeleton.tsx";
108
117
  export { Skeleton } from "./Skeleton/Skeleton.tsx";
109
118
  export type { SortableTableHeaderProps, SortDirection, } from "./SortableTableHeader/SortableTableHeader.tsx";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,YAAY,EACV,qBAAqB,EACrB,aAAa,EACb,cAAc,GACf,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,YAAY,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAC9D,YAAY,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EACL,aAAa,EACb,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,EACjC,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,iCAAiC,CAAA;AACxC,YAAY,EACV,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,sCA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A;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EACL,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EACV,OAAO,EACP,cAAc,EACd,eAAe,EACf,SAAS,GACV,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AACtC,YAAY,EACV,kBAAkB,EAClB,aAAa,GACd,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAClD,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,YAAY,EACV,WAAW,EACX,gBAAgB,GACjB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,YAAY,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC5D,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,YAAY,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA"}
package/dist/index.js CHANGED
@@ -49,12 +49,14 @@ export { EmptyState } from "./EmptyState/EmptyState.js";
49
49
  export { Field } from "./Field/Field.js";
50
50
  export { FieldGroup } from "./Field/FieldGroup.js";
51
51
  export { FileDropZone } from "./FileDropZone/FileDropZone.js";
52
+ export { Header } from "./Header/Header.js";
52
53
  export { IconButton } from "./IconButton/IconButton.js";
53
54
  export { ARIA_DISABLED_CLASS, DISABLED_CLASS, FOCUS_RING_CLASS, INTENT_APPEARANCE_CLASS, INTENT_CONTENT_CLASS, INTENT_HOVER_CLASS, INTENT_SOLID_FILL_CLASS, } from "./intentStyles.js";
54
55
  export { Lightbox } from "./Lightbox/Lightbox.js";
55
56
  export { Listbox } from "./Listbox/Listbox.js";
56
57
  export { LiveStatusIndicator } from "./LiveStatusIndicator/LiveStatusIndicator.js";
57
58
  export { LogViewer } from "./LogViewer/LogViewer.js";
59
+ export { Main } from "./Main/Main.js";
58
60
  export { MediaTile } from "./MediaTile/MediaTile.js";
59
61
  export { mediaTransitions } from "./MediaTile/mediaStatus.js";
60
62
  export { Menu } from "./Menu/Menu.js";
@@ -63,11 +65,13 @@ export { Popover } from "./Popover/Popover.js";
63
65
  export { ProgressBar } from "./ProgressBar/ProgressBar.js";
64
66
  export { getProgressIntent, toProgressPercent, toProgressValue, } from "./ProgressBar/progressValue.js";
65
67
  export { RadioGroup } from "./RadioGroup/RadioGroup.js";
68
+ export { Rail } from "./Rail/Rail.js";
66
69
  export { AnchorLink } from "./RouterLink/AnchorLink.js";
67
70
  export { RouterLinkProvider, useRouterLink, } from "./RouterLink/RouterLinkProvider.js";
68
71
  export { getIsRoutedHref } from "./RouterLink/routerLink.js";
69
72
  export { SegmentedControl } from "./SegmentedControl/SegmentedControl.js";
70
73
  export { Select } from "./Select/Select.js";
74
+ export { Shell } from "./Shell/Shell.js";
71
75
  export { Skeleton } from "./Skeleton/Skeleton.js";
72
76
  export { SortableTableHeader } from "./SortableTableHeader/SortableTableHeader.js";
73
77
  export { Spinner } from "./Spinner/Spinner.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAOH,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA2B,CAAA;AAErD,OAAO,EAAE,YAAY,EAAE,MAA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AKtC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAyB,CAAA;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAmB,CAAA;AAKzC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAyB,CAAA;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAuB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAqC,CAAA"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Resize the browser and **wait until the page agrees**.
3
+ *
4
+ * `page.viewport()` resolves when the driver has asked for the
5
+ * resize, not when the tester frame has been laid out at the new
6
+ * size. On the first resize in a file that gap is real: the
7
+ * assertion runs against the *previous* width, so a
8
+ * horizontal-scroll test at 390px silently measures a 1440px page
9
+ * and reports a number nobody can explain. It is a race, so it
10
+ * fails intermittently — which is the worst possible property for
11
+ * the one gate that says the shell does not scroll sideways.
12
+ *
13
+ * Polling `innerWidth` is the honest wait: it is the same number
14
+ * the media queries and the layout resolved against, so when it
15
+ * matches, the thing under test really is at the width the test
16
+ * claims.
17
+ */
18
+ export declare const setViewport: ({ height, width, }: {
19
+ height: number;
20
+ width: number;
21
+ }) => Promise<void>;
22
+ /** A phone in portrait — the width plex-channels scrolls at. */
23
+ export declare const PHONE: {
24
+ height: number;
25
+ width: number;
26
+ };
27
+ export declare const DESKTOP: {
28
+ height: number;
29
+ width: number;
30
+ };
31
+ //# sourceMappingURL=viewport.testHelpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewport.testHelpers.d.ts","sourceRoot":"","sources":["../src/viewport.testHelpers.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,WAAW,GAAU,oBAG/B;IACD,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;CACd,KAAG,OAAO,CAAC,IAAI,CAgBf,CAAA;AAED,gEAAgE;AAChE,eAAO,MAAM,KAAK;;;CAA8B,CAAA;AAEhD,eAAO,MAAM,OAAO;;;CAA+B,CAAA"}
@@ -0,0 +1,34 @@
1
+ import { page } from "@vitest/browser/context";
2
+ /**
3
+ * Resize the browser and **wait until the page agrees**.
4
+ *
5
+ * `page.viewport()` resolves when the driver has asked for the
6
+ * resize, not when the tester frame has been laid out at the new
7
+ * size. On the first resize in a file that gap is real: the
8
+ * assertion runs against the *previous* width, so a
9
+ * horizontal-scroll test at 390px silently measures a 1440px page
10
+ * and reports a number nobody can explain. It is a race, so it
11
+ * fails intermittently — which is the worst possible property for
12
+ * the one gate that says the shell does not scroll sideways.
13
+ *
14
+ * Polling `innerWidth` is the honest wait: it is the same number
15
+ * the media queries and the layout resolved against, so when it
16
+ * matches, the thing under test really is at the width the test
17
+ * claims.
18
+ */
19
+ export const setViewport = async ({ height, width, }) => {
20
+ await page.viewport(width, height);
21
+ const deadline = Date.now() + 2000;
22
+ while (globalThis.innerWidth !== width) {
23
+ if (Date.now() > deadline) {
24
+ throw new Error(`The viewport never reached ${width}px — it is ${globalThis.innerWidth}px. Every width assertion after this point would be measuring the wrong page.`);
25
+ }
26
+ await new Promise((resolve) => {
27
+ globalThis.requestAnimationFrame(resolve);
28
+ });
29
+ }
30
+ };
31
+ /** A phone in portrait — the width plex-channels scrolls at. */
32
+ export const PHONE = { height: 844, width: 390 };
33
+ export const DESKTOP = { height: 900, width: 1440 };
34
+ //# sourceMappingURL=viewport.testHelpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewport.testHelpers.js","sourceRoot":"","sources":["../src/viewport.testHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAE9C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAAE,EAChC,MAAM,EACN,KAAK,GAIN,EAAiB,EAAE;IAClB,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;IAElC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAA;IAElC,OAAO,UAAU,CAAC,UAAU,KAAK,KAAK,EAAE,CAAC;QACvC,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CACb,8BAA8B,KAAK,cAAc,UAAU,CAAC,UAAU,+EAA+E,CACtJ,CAAA;QACH,CAAC;QAED,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC5B,UAAU,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAA;QAC3C,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAA;AAED,gEAAgE;AAChE,MAAM,CAAC,MAAM,KAAK,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,CAAA;AAEhD,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@charcuterie/ui",
3
- "version": "2.9.0",
3
+ "version": "2.10.0",
4
4
  "description": "The Charcuterie components. Tokens for look, @charcuterie/logic for state, ARIA that agents can actually drive.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -0,0 +1,72 @@
1
+ import { Canvas, Controls, Meta } from "@storybook/addon-docs/blocks";
2
+
3
+ import * as HeaderStories from "./Header.stories";
4
+
5
+ <Meta of={HeaderStories} />
6
+
7
+ # Header
8
+
9
+ The `<header>` landmark, the app's name, and the controls that belong to the frame rather
10
+ than to the page. Ten repos hand-roll this row; two of them wrote the same string.
11
+
12
+ <Canvas of={HeaderStories.Default} />
13
+
14
+ ## Props
15
+
16
+ <Controls />
17
+
18
+ <Canvas of={HeaderStories.AllStates} />
19
+
20
+ ## `isSticky` sets `position` **and** `z-index`
21
+
22
+ That pairing is the entire reason the prop is a boolean rather than two class names.
23
+
24
+ mux-magic's `PageHeader` is documented as a sticky header and sets only `z-index`
25
+ (`PageHeader.tsx:173`). It never sets `position: sticky`, so it scrolls away like any other
26
+ block and the z-index it carries has nothing to stack against — it is a flex-column shell
27
+ wearing a sticky header's clothes. The CSS is valid, the intent is stated in a comment, and
28
+ nobody scrolls a component in a review.
29
+
30
+ <Canvas of={HeaderStories.AllVariants} />
31
+
32
+ The z-index is `--layer-sticky` (100) from the token scale, never a hand-picked number. The
33
+ fleet's headers currently sit at `z-40` (mail-sifter, points-market), `z-50` (rip-deck),
34
+ `z-10` (spoolbuddy) and `z-[100]` (mux-magic) with no ordering guarantee between a header
35
+ and anything else. On the scale, `sticky` is below `dropdown` (200), `modal` (400) and
36
+ `toast` (500) — so a `Menu` opened *from* the header paints over it, by construction.
37
+
38
+ <Canvas of={HeaderStories.NotSticky} />
39
+
40
+ ## It invents no colours
41
+
42
+ `bg-surface-raised/85`, `backdrop-blur-md`, `border-border-subtle`. The fleet's copy of this
43
+ line is `bg-surface-base/90` — the header at *the same colour as the page behind it*,
44
+ leaning entirely on the blur to separate the two, so it disappears against a page that has
45
+ not been scrolled. `raised` means *more separated from base*, which is the role this
46
+ element actually wants.
47
+
48
+ ## The width comes from `Shell`
49
+
50
+ <Canvas of={HeaderStories.Responsive} />
51
+
52
+ The `<header>` is full-bleed — the border and the translucent fill run edge to edge — and
53
+ only its **inner row** is capped. That is what stops a constrained header from reading as a
54
+ floating island on an ultrawide, and it is the half points-market got right while its
55
+ `<main>` went uncapped.
56
+
57
+ The cap itself comes from `Shell`'s `contentWidth` through context, so the title always
58
+ sits directly above the content it names. Passing `contentWidth` here overrides it for the
59
+ rare case where they genuinely differ.
60
+
61
+ ## Slots, in render order
62
+
63
+ `heading` → `children` → `actions`. Every one is optional: a header with only actions is
64
+ image-viewer's `TitleBar`, one with only a heading is board-games'. `children` is the middle
65
+ — a search field, a breadcrumb, a status pill — and `actions` is pushed to the far end with
66
+ `ms-auto`, so it stays at the end in RTL too.
67
+
68
+ <Canvas of={HeaderStories.Interactive} />
69
+
70
+ `headingLevel` defaults to `1`, because on most pages the app's name *is* the document's
71
+ top-level heading. An app whose page title is its `h1` sets `headingLevel={2}` here rather
72
+ than leaving two of them.