@charcuterie/ui 3.28.0 → 3.28.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/dist/Main/Main.js CHANGED
@@ -118,6 +118,6 @@ export const Main = ({ children, className, contentWidth, id, ...mainProps }) =>
118
118
  const maxInlineSize = toMaxInlineSize(contentWidth ??
119
119
  shell?.contentWidth ??
120
120
  DEFAULT_CONTENT_WIDTH);
121
- return (_jsx("main", { ...mainProps, className: toClassName("col-start-1 row-start-3 min-w-0 md:col-start-2 md:row-start-2", className), id: id ?? shell?.mainId ?? fallbackId, tabIndex: -1, children: _jsx("div", { className: "@container mx-auto flex w-full min-w-0 flex-col gap-6 wrap-anywhere px-4 py-6 sm:px-6", style: { maxInlineSize }, children: children }) }));
121
+ return (_jsx("main", { ...mainProps, className: toClassName("charcuterie-scrollbar col-start-1 row-start-3 min-h-0 min-w-0 overflow-y-auto md:col-start-2 md:row-start-2", className), id: id ?? shell?.mainId ?? fallbackId, tabIndex: -1, children: _jsx("div", { className: "@container mx-auto flex w-full min-w-0 flex-col gap-6 wrap-anywhere px-4 py-6 sm:px-6", style: { maxInlineSize }, children: children }) }));
122
122
  };
123
123
  //# sourceMappingURL=Main.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Main.js","sourceRoot":"","sources":["../../src/Main/Main.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAGL,UAAU,GACX,MAAM,OAAO,CAAA;AAEd,OAAO,EAEL,qBAAqB,EACrB,eAAe,GAChB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAM/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AG,SAAS,EACF,EAAa,EAAE;IACzB,MAAM,KAAK,GAAG,UAAU,CAAC,YAAY,CAAC,CAAA;IAEtC,iEAAiE;IACjE,2DAA2D;IAC3D,MAAM,UAAU,GAAG,WAAW,EAAE,CAAA;IAEhC,MAAM,aAAa,GAAG,eAAe,CACnC,YAAY;QACV,KAAK,EAAE,YAAY;QACnB,qBAAqB,CACxB,CAAA;IAED,OAAO,CACL,kBACM,SAAS,EACb,SAAS,EAAE,WAAW,CACpB,6GAA6G,EAC7G,SAAS,CACV,EACD,EAAE,EAAE,EAAE,IAAI,KAAK,EAAE,MAAM,IAAI,UAAU,EACrC,QAAQ,EAAE,CAAC,CAAC,YAaZ,cACE,SAAS,EAAC,uFAAuF,EACjG,KAAK,EAAE,EAAE,aAAa,EAAE,YAEvB,QAAQ,GACL,GACD,CACR,CAAA;AACH,CAAC,CAAA"}
package/dist/Rail/Rail.js CHANGED
@@ -57,7 +57,7 @@ const LANDMARK_ELEMENT = {
57
57
  */
58
58
  export const Rail = ({ children, className, label, landmark = "complementary", side = "start", ...railProps }) => {
59
59
  const Element = LANDMARK_ELEMENT[landmark];
60
- return (_jsx(Element, { ...railProps, "aria-label": label, className: toClassName("flex min-w-0 gap-2 overflow-x-auto border-border-subtle p-4 md:row-start-2 md:w-64 md:flex-col md:overflow-x-visible", side === "start"
60
+ return (_jsx(Element, { ...railProps, "aria-label": label, className: toClassName("flex min-w-0 gap-2 overflow-x-auto border-border-subtle p-4 md:row-start-2 md:min-h-0 md:w-64 md:flex-col md:overflow-x-visible", side === "start"
61
61
  ? "row-start-2 border-b md:col-start-1 md:border-b-0 md:border-e"
62
62
  : "row-start-4 border-t md:col-start-3 md:border-t-0 md:border-s", className), children: children }));
63
63
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Rail.js","sourceRoot":"","sources":["../../src/Rail/Rail.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAY/C,MAAM,gBAAgB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,CAAC,CAAC,+DAA+D,EACnE,SAAS,CACV,YAEA,QAAQ,GACD,CACX,CAAA;AACH,CAAC,CAAA"}
@@ -111,6 +111,6 @@ import { ShellContext } from "./shellContext.js";
111
111
  export const Shell = ({ children, className, contentWidth = DEFAULT_CONTENT_WIDTH, skipLinkLabel = "Skip to main content", ...divProps }) => {
112
112
  const mainId = useUniqueId();
113
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] }) }));
114
+ return (_jsx(ShellContext.Provider, { value: shellContext, children: _jsxs("div", { ...divProps, className: toClassName("relative grid h-dvh grid-cols-1 grid-rows-[auto_auto_minmax(0,1fr)_auto] overflow-x-clip bg-surface-base text-content-primary md:grid-cols-[auto_minmax(0,1fr)_auto] md:grid-rows-[auto_minmax(0,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
115
  };
116
116
  //# sourceMappingURL=Shell.js.map
@@ -1 +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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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,wMAAwM,EACxM,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@charcuterie/ui",
3
- "version": "3.28.0",
3
+ "version": "3.28.1",
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",
package/src/Main/Main.tsx CHANGED
@@ -146,7 +146,7 @@ export const Main = ({
146
146
  <main
147
147
  {...mainProps}
148
148
  className={toClassName(
149
- "col-start-1 row-start-3 min-w-0 md:col-start-2 md:row-start-2",
149
+ "charcuterie-scrollbar col-start-1 row-start-3 min-h-0 min-w-0 overflow-y-auto md:col-start-2 md:row-start-2",
150
150
  className,
151
151
  )}
152
152
  id={id ?? shell?.mainId ?? fallbackId}
package/src/Rail/Rail.tsx CHANGED
@@ -89,7 +89,7 @@ export const Rail = ({
89
89
  {...railProps}
90
90
  aria-label={label}
91
91
  className={toClassName(
92
- "flex min-w-0 gap-2 overflow-x-auto border-border-subtle p-4 md:row-start-2 md:w-64 md:flex-col md:overflow-x-visible",
92
+ "flex min-w-0 gap-2 overflow-x-auto border-border-subtle p-4 md:row-start-2 md:min-h-0 md:w-64 md:flex-col md:overflow-x-visible",
93
93
  side === "start"
94
94
  ? "row-start-2 border-b md:col-start-1 md:border-b-0 md:border-e"
95
95
  : "row-start-4 border-t md:col-start-3 md:border-t-0 md:border-s",
@@ -127,6 +127,14 @@ rail that only changes *position* uses a media query and nothing else.
127
127
 
128
128
  <Canvas of={ShellStories.Responsive} />
129
129
 
130
+ ## The page content scrolls; the frame stays available
131
+
132
+ The shell fills the viewport. `Main` is the only vertical scroll region, so a long page does
133
+ not scroll the header or either rail away. This keeps navigation actions available, including
134
+ an app's rail-collapse control. The rail is not a second vertical scroll area.
135
+
136
+ <Canvas of={ShellStories.Scrollable} />
137
+
130
138
  ## It does not scroll sideways, and that is a test
131
139
 
132
140
  Plex Channels' narrow view scrolls left and right as wide as its content area. The usual
@@ -10,6 +10,7 @@ import {
10
10
  PageContent,
11
11
  RailDetail,
12
12
  RailNavigation,
13
+ ScrollFiller,
13
14
  } from "../shell.storyHelpers.tsx"
14
15
  import { Shell } from "./Shell.tsx"
15
16
 
@@ -183,3 +184,26 @@ export const Interactive: Story = {
183
184
  </Shell>
184
185
  ),
185
186
  }
187
+
188
+ /** A long page leaves the header and rail in place. */
189
+ export const Scrollable: Story = {
190
+ render: (shellProps) => (
191
+ <Shell {...shellProps}>
192
+ <Header
193
+ actions={<HeaderSchemeToggle />}
194
+ heading="Rip Deck"
195
+ />
196
+
197
+ <Rail label="Sections" landmark="navigation">
198
+ <RailNavigation />
199
+ </Rail>
200
+
201
+ <Main>
202
+ <PageContent />
203
+ <div style={{ minBlockSize: "150vh" }}>
204
+ <ScrollFiller />
205
+ </div>
206
+ </Main>
207
+ </Shell>
208
+ ),
209
+ }
@@ -16,6 +16,7 @@ const {
16
16
  Default,
17
17
  Interactive,
18
18
  Responsive,
19
+ Scrollable,
19
20
  WithBothRails,
20
21
  WithStartRail,
21
22
  } = composeStories(stories)
@@ -152,6 +153,34 @@ test("the shell fills the viewport at desktop width without overflowing it", asy
152
153
  await expectNoHorizontalScroll()
153
154
  })
154
155
 
156
+ test("only main scrolls vertically, keeping the rail available", async () => {
157
+ await setViewport(DESKTOP)
158
+
159
+ const { canvas, canvasElement } =
160
+ await mountStory(Scrollable)
161
+
162
+ const shell =
163
+ canvasElement.firstElementChild as HTMLElement
164
+ const main = canvas.getByRole("main")
165
+ const rail = canvas.getByRole("navigation", {
166
+ name: "Sections",
167
+ })
168
+
169
+ await expect(shell.clientHeight).toBe(DESKTOP.height)
170
+ await expect(main.scrollHeight).toBeGreaterThan(
171
+ main.clientHeight,
172
+ )
173
+ await expect(
174
+ globalThis.getComputedStyle(main).overflowY,
175
+ ).toBe("auto")
176
+
177
+ main.scrollTo({ top: main.scrollHeight })
178
+
179
+ await expect(main.scrollTop).toBeGreaterThan(0)
180
+ await expect(rail.scrollTop).toBe(0)
181
+ await expectNoAxeViolations(canvasElement)
182
+ })
183
+
155
184
  test("the shell is one banner, one main, and two uniquely-named rails", async () => {
156
185
  const { canvas, canvasElement } =
157
186
  await mountStory(WithBothRails)
@@ -140,7 +140,7 @@ export const Shell = ({
140
140
  <div
141
141
  {...divProps}
142
142
  className={toClassName(
143
- "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]",
143
+ "relative grid h-dvh grid-cols-1 grid-rows-[auto_auto_minmax(0,1fr)_auto] overflow-x-clip bg-surface-base text-content-primary md:grid-cols-[auto_minmax(0,1fr)_auto] md:grid-rows-[auto_minmax(0,1fr)]",
144
144
  className,
145
145
  )}
146
146
  >