@softure-ai/theme-notion 0.12.0 → 0.13.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.
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,15 @@ Newest first. Each version lists what changed for an app that uses the theme. Wh
|
|
|
4
4
|
production, the version gets a line `verified in: <app>@<commit>` ([docs/05](../../docs/05-adoption-playbook.md),
|
|
5
5
|
"Definition of done").
|
|
6
6
|
|
|
7
|
+
## 0.13.0
|
|
8
|
+
|
|
9
|
+
- `AsidePanel` follow-ups (#1075): `AsidePanelToggle icon` (a `LucideIcon` drawn in both states, for a panel that
|
|
10
|
+
holds one tool its users know by its icon); the wide-screen `aside` carries `max-md:hidden`, so a phone served the
|
|
11
|
+
server HTML with a kept open panel no longer paints it until hydration swaps in the sheet (an app's
|
|
12
|
+
`contents max-md:hidden` wrapper can go); the toggle, the width switch and the sidebar opener set `title` from
|
|
13
|
+
their labels, so they show a hover hint; `AsidePanel description` adds one line under the phone sheet's title.
|
|
14
|
+
New optional props only.
|
|
15
|
+
|
|
7
16
|
## 0.12.0
|
|
8
17
|
|
|
9
18
|
- A panel slid in from the right of the app shell (#1044): `AsidePanelProvider` (replaces `SidebarProvider`, keeps
|
package/README.md
CHANGED
|
@@ -235,12 +235,16 @@ on a wide screen the left `Sidebar` (offcanvas) is folded, and opening the sideb
|
|
|
235
235
|
|
|
236
236
|
- `AsidePanelToggle`: one icon button fixed at the top-right edge, in the same place open or closed, with
|
|
237
237
|
`aria-expanded`, `aria-controls` and a label that switches between show and hide; `outline` while closed,
|
|
238
|
-
`secondary` while open. Opening from it moves focus to the panel's heading (`tabIndex=-1`).
|
|
238
|
+
`secondary` while open. Opening from it moves focus to the panel's heading (`tabIndex=-1`). `icon` (a
|
|
239
|
+
`LucideIcon`) replaces the panel icons in both states, for a panel that holds one tool its users know by its icon.
|
|
240
|
+
The toggle, the width switch and the sidebar opener show their label as a hover hint (`title`) too.
|
|
239
241
|
- `AsidePanel title`: an `aside` (`sticky top-0 h-dvh`, `border-l`) with a header holding the heading and a ghost
|
|
240
242
|
width switch: `standard` (two fifths) or `half` (the shell split half and half). Escape closes it and returns focus
|
|
241
243
|
to the toggle unless a dialog, menu, listbox or popover is open (`isOverlayOpen(document)`: Radix
|
|
242
244
|
`data-state="open"`, `:popover-open` or `dialog[open]`; a closed popover left in the page does not count).
|
|
243
|
-
Below `MOBILE_BREAKPOINT` it is a right `Sheet`, opened for that page only: the kept state never opens it there
|
|
245
|
+
Below `MOBILE_BREAKPOINT` it is a right `Sheet`, opened for that page only: the kept state never opens it there;
|
|
246
|
+
`description` adds one line under the sheet's title (its `aria-describedby`). The `aside` carries `max-md:hidden`,
|
|
247
|
+
so a phone served the wide-screen HTML (the server cannot tell the width) never paints it before hydration.
|
|
244
248
|
Its children render only while it is open, so pass a lazily loaded body (`next/dynamic` with `ssr: false`) and
|
|
245
249
|
screens that never open it never load its code.
|
|
246
250
|
- `AsidePanelSidebarOpener`: an icon button fixed at the top-left edge, shown only while the sidebar is folded on a
|
|
@@ -257,7 +261,7 @@ const MapPanel = dynamic(() => import("./map-panel"), { ssr: false });
|
|
|
257
261
|
<AppSidebar />
|
|
258
262
|
<SidebarInset>
|
|
259
263
|
<AsidePanelSidebarOpener />
|
|
260
|
-
<AsidePanelToggle />
|
|
264
|
+
<AsidePanelToggle icon={MapIcon} />
|
|
261
265
|
{children}
|
|
262
266
|
</SidebarInset>
|
|
263
267
|
<AsidePanel title="Map">
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type LucideIcon } from "lucide-react";
|
|
1
2
|
import { type ComponentProps, type ReactNode, type RefObject } from "react";
|
|
2
3
|
import { SidebarProvider } from "../ui/sidebar.js";
|
|
3
4
|
export type AsidePanelWidth = "standard" | "half";
|
|
@@ -37,10 +38,11 @@ export declare function AsidePanelProvider({ initialState, save, onSaveError, is
|
|
|
37
38
|
export interface AsidePanelToggleProps {
|
|
38
39
|
readonly showLabel?: string;
|
|
39
40
|
readonly hideLabel?: string;
|
|
41
|
+
readonly icon?: LucideIcon;
|
|
40
42
|
readonly className?: string;
|
|
41
43
|
}
|
|
42
44
|
/** The icon button at the top-right edge that shows and hides the panel; it stays in place either way. */
|
|
43
|
-
export declare function AsidePanelToggle({ showLabel, hideLabel, className }: AsidePanelToggleProps): import("react").JSX.Element | null;
|
|
45
|
+
export declare function AsidePanelToggle({ showLabel, hideLabel, icon, className }: AsidePanelToggleProps): import("react").JSX.Element | null;
|
|
44
46
|
export interface AsidePanelSidebarOpenerProps {
|
|
45
47
|
readonly label?: string;
|
|
46
48
|
readonly className?: string;
|
|
@@ -53,12 +55,13 @@ export interface AsidePanelProps {
|
|
|
53
55
|
readonly widenLabel?: string;
|
|
54
56
|
readonly narrowLabel?: string;
|
|
55
57
|
readonly closeLabel?: string;
|
|
58
|
+
readonly description?: string;
|
|
56
59
|
readonly className?: string;
|
|
57
60
|
}
|
|
58
61
|
/**
|
|
59
62
|
* The panel: an `aside` beside the shell's content on a wide screen (the content narrows next to it), a right `Sheet`
|
|
60
63
|
* on a phone. Place it after `SidebarInset` inside `AsidePanelProvider`.
|
|
61
64
|
*/
|
|
62
|
-
export declare function AsidePanel({ title, children, widenLabel, narrowLabel, closeLabel, className, }: AsidePanelProps): import("react").JSX.Element | null;
|
|
65
|
+
export declare function AsidePanel({ title, children, widenLabel, narrowLabel, closeLabel, description, className, }: AsidePanelProps): import("react").JSX.Element | null;
|
|
63
66
|
export {};
|
|
64
67
|
//# sourceMappingURL=AsidePanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsidePanel.d.ts","sourceRoot":"","sources":["../../src/notion/AsidePanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AsidePanel.d.ts","sourceRoot":"","sources":["../../src/notion/AsidePanel.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA2E,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AACxH,OAAO,EAQL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vB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAE7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAE9B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAE7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,UAAsC,EACtC,WAAwC,EACxC,UAAU,EACV,WAAW,EACX,SAAS,GACV,EAAE,eAAe,sCA2FjB"}
|
|
@@ -6,7 +6,7 @@ import { createContext, useCallback, useContext, useEffect, useMemo, useRef, use
|
|
|
6
6
|
import { cn } from "../lib/utils.js";
|
|
7
7
|
import { en as messages } from "../messages/en.js";
|
|
8
8
|
import { Button } from "../ui/button.js";
|
|
9
|
-
import { Sheet, SheetContent, SheetHeader, SheetTitle } from "../ui/sheet.js";
|
|
9
|
+
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "../ui/sheet.js";
|
|
10
10
|
import { SidebarProvider } from "../ui/sidebar.js";
|
|
11
11
|
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
12
12
|
import { isOverlayOpen } from "./overlay-open.js";
|
|
@@ -91,25 +91,26 @@ export function AsidePanelProvider({ initialState, save, onSaveError, isHidden =
|
|
|
91
91
|
return (_jsx(AsidePanelContext.Provider, { value: value, children: _jsx(SidebarProvider, { open: isSidebarShown, onOpenChange: changeSidebar, ...props, children: children }) }));
|
|
92
92
|
}
|
|
93
93
|
/** The icon button at the top-right edge that shows and hides the panel; it stays in place either way. */
|
|
94
|
-
export function AsidePanelToggle({ showLabel = messages.asidePanel.show, hideLabel = messages.asidePanel.hide, className }) {
|
|
94
|
+
export function AsidePanelToggle({ showLabel = messages.asidePanel.show, hideLabel = messages.asidePanel.hide, icon, className }) {
|
|
95
95
|
const { panelId, isOpen, isHidden, toggleRef, toggle } = useAsidePanelContext("AsidePanelToggle");
|
|
96
96
|
if (isHidden)
|
|
97
97
|
return null;
|
|
98
|
-
const Icon = isOpen ? PanelRightClose : PanelRightOpen;
|
|
99
|
-
|
|
98
|
+
const Icon = icon ?? (isOpen ? PanelRightClose : PanelRightOpen);
|
|
99
|
+
const label = isOpen ? hideLabel : showLabel;
|
|
100
|
+
return (_jsx(Button, { ref: toggleRef, type: "button", "data-slot": "aside-panel-toggle", variant: isOpen ? "secondary" : "outline", size: "icon", "aria-expanded": isOpen, "aria-controls": panelId, "aria-label": label, title: label, className: cn("fixed top-[calc(--spacing(2)+env(safe-area-inset-top))] right-[calc(--spacing(2)+env(safe-area-inset-right))] z-20", className), onClick: toggle, children: _jsx(Icon, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH }) }));
|
|
100
101
|
}
|
|
101
102
|
/** The icon button at the top-left edge, shown only while the sidebar is folded: brings it back, closes the panel. */
|
|
102
103
|
export function AsidePanelSidebarOpener({ label = messages.asidePanel.showSidebar, className }) {
|
|
103
104
|
const { isMobile, isSidebarFolded, openSidebar } = useAsidePanelContext("AsidePanelSidebarOpener");
|
|
104
105
|
if (isMobile || !isSidebarFolded)
|
|
105
106
|
return null;
|
|
106
|
-
return (_jsx(Button, { type: "button", "data-slot": "aside-panel-sidebar-opener", variant: "outline", size: "icon", "aria-label": label, className: cn("fixed top-[calc(--spacing(2)+env(safe-area-inset-top))] left-[calc(--spacing(2)+env(safe-area-inset-left))] z-20", className), onClick: openSidebar, children: _jsx(PanelLeft, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH }) }));
|
|
107
|
+
return (_jsx(Button, { type: "button", "data-slot": "aside-panel-sidebar-opener", variant: "outline", size: "icon", "aria-label": label, title: label, className: cn("fixed top-[calc(--spacing(2)+env(safe-area-inset-top))] left-[calc(--spacing(2)+env(safe-area-inset-left))] z-20", className), onClick: openSidebar, children: _jsx(PanelLeft, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH }) }));
|
|
107
108
|
}
|
|
108
109
|
/**
|
|
109
110
|
* The panel: an `aside` beside the shell's content on a wide screen (the content narrows next to it), a right `Sheet`
|
|
110
111
|
* on a phone. Place it after `SidebarInset` inside `AsidePanelProvider`.
|
|
111
112
|
*/
|
|
112
|
-
export function AsidePanel({ title, children, widenLabel = messages.asidePanel.widen, narrowLabel = messages.asidePanel.narrow, closeLabel, className, }) {
|
|
113
|
+
export function AsidePanel({ title, children, widenLabel = messages.asidePanel.widen, narrowLabel = messages.asidePanel.narrow, closeLabel, description, className, }) {
|
|
113
114
|
const { panelId, isOpen, width, isMobile, isHidden, toggleRef, isHeadingFocusRequested, close, setWidth } = useAsidePanelContext("AsidePanel");
|
|
114
115
|
const headingRef = useRef(null);
|
|
115
116
|
const headingId = `${panelId}-heading`;
|
|
@@ -137,18 +138,21 @@ export function AsidePanel({ title, children, widenLabel = messages.asidePanel.w
|
|
|
137
138
|
if (isHidden)
|
|
138
139
|
return null;
|
|
139
140
|
if (isMobile) {
|
|
140
|
-
return (_jsx(Sheet, { open: isOpen, onOpenChange: (next) => !next && close(), children: _jsxs(SheetContent, { id: panelId, side: "right", "data-slot": "aside-panel-sheet", "aria-describedby": undefined, closeLabel: closeLabel, className: cn("w-full gap-0 sm:max-w-none", className), onOpenAutoFocus: (event) => {
|
|
141
|
+
return (_jsx(Sheet, { open: isOpen, onOpenChange: (next) => !next && close(), children: _jsxs(SheetContent, { id: panelId, side: "right", "data-slot": "aside-panel-sheet", ...(description === undefined ? { "aria-describedby": undefined } : {}), closeLabel: closeLabel, className: cn("w-full gap-0 sm:max-w-none", className), onOpenAutoFocus: (event) => {
|
|
141
142
|
event.preventDefault();
|
|
142
143
|
headingRef.current?.focus();
|
|
143
144
|
}, onCloseAutoFocus: (event) => {
|
|
144
145
|
event.preventDefault();
|
|
145
146
|
toggleRef.current?.focus();
|
|
146
|
-
}, children: [
|
|
147
|
+
}, children: [_jsxs(SheetHeader, { className: "border-b border-border", children: [_jsx(SheetTitle, { ref: headingRef, tabIndex: -1, className: "outline-none", children: title }), description === undefined ? null : _jsx(SheetDescription, { children: description })] }), _jsx("div", { "data-slot": "aside-panel-content", className: "min-h-0 flex-1 overflow-y-auto", children: isOpen ? children : null })] }) }));
|
|
147
148
|
}
|
|
148
149
|
if (!isOpen)
|
|
149
150
|
return null;
|
|
150
151
|
const isHalf = width === "half";
|
|
151
152
|
const WidthIcon = isHalf ? ChevronsRight : ChevronsLeft;
|
|
152
|
-
|
|
153
|
+
const widthLabel = isHalf ? narrowLabel : widenLabel;
|
|
154
|
+
// A phone gets this branch in the server HTML (`useIsMobile` is false there) until hydration swaps in the sheet:
|
|
155
|
+
// `max-md:hidden` keeps it from painting. The `md` breakpoint equals the theme's mobile breakpoint.
|
|
156
|
+
return (_jsxs("aside", { id: panelId, "data-slot": "aside-panel", "data-width": width, "aria-labelledby": headingId, className: cn("sticky top-0 flex h-dvh max-md:hidden w-2/5 shrink-0 flex-col border-l border-border bg-background text-foreground data-[width=half]:w-1/2", className), children: [_jsxs("div", { "data-slot": "aside-panel-header", className: "flex h-11 shrink-0 items-center gap-2 border-b border-border pr-12 pl-4", children: [_jsx("h2", { ref: headingRef, id: headingId, tabIndex: -1, className: "min-w-0 flex-1 truncate text-heading-3 outline-none", children: title }), _jsx(Button, { type: "button", variant: "ghost", size: "icon", "aria-label": widthLabel, title: widthLabel, onClick: () => setWidth(isHalf ? "standard" : "half"), children: _jsx(WidthIcon, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH }) })] }), _jsx("div", { "data-slot": "aside-panel-content", className: "min-h-0 flex-1 overflow-y-auto", children: children })] }));
|
|
153
157
|
}
|
|
154
158
|
//# sourceMappingURL=AsidePanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsidePanel.js","sourceRoot":"","sources":["../../src/notion/AsidePanel.tsx"],"names":[],"m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ai/theme-notion",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "SOFTURE AI Notion theme: shadcn/ui components (new-york v4, Radix, Tailwind CSS v4, lucide) with the Notion design system's tokens and deltas, ready to import.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useIsMobile } from "@softure-ai/theme-kit/react";
|
|
4
|
-
import { ChevronsLeft, ChevronsRight, PanelLeft, PanelRightClose, PanelRightOpen } from "lucide-react";
|
|
4
|
+
import { ChevronsLeft, ChevronsRight, PanelLeft, PanelRightClose, PanelRightOpen, type LucideIcon } from "lucide-react";
|
|
5
5
|
import {
|
|
6
6
|
createContext,
|
|
7
7
|
useCallback,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
import { cn } from "../lib/utils.js";
|
|
19
19
|
import { en as messages } from "../messages/en.js";
|
|
20
20
|
import { Button } from "../ui/button.js";
|
|
21
|
-
import { Sheet, SheetContent, SheetHeader, SheetTitle } from "../ui/sheet.js";
|
|
21
|
+
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "../ui/sheet.js";
|
|
22
22
|
import { SidebarProvider } from "../ui/sidebar.js";
|
|
23
23
|
|
|
24
24
|
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
@@ -179,14 +179,18 @@ export interface AsidePanelToggleProps {
|
|
|
179
179
|
// The accessible names while closed and while open, from the app's message layer.
|
|
180
180
|
readonly showLabel?: string;
|
|
181
181
|
readonly hideLabel?: string;
|
|
182
|
+
// The icon drawn in both states, for a panel that holds one tool its users know by its icon (a map, a chat);
|
|
183
|
+
// `PanelRightOpen` and `PanelRightClose` otherwise.
|
|
184
|
+
readonly icon?: LucideIcon;
|
|
182
185
|
readonly className?: string;
|
|
183
186
|
}
|
|
184
187
|
|
|
185
188
|
/** The icon button at the top-right edge that shows and hides the panel; it stays in place either way. */
|
|
186
|
-
export function AsidePanelToggle({ showLabel = messages.asidePanel.show, hideLabel = messages.asidePanel.hide, className }: AsidePanelToggleProps) {
|
|
189
|
+
export function AsidePanelToggle({ showLabel = messages.asidePanel.show, hideLabel = messages.asidePanel.hide, icon, className }: AsidePanelToggleProps) {
|
|
187
190
|
const { panelId, isOpen, isHidden, toggleRef, toggle } = useAsidePanelContext("AsidePanelToggle");
|
|
188
191
|
if (isHidden) return null;
|
|
189
|
-
const Icon = isOpen ? PanelRightClose : PanelRightOpen;
|
|
192
|
+
const Icon = icon ?? (isOpen ? PanelRightClose : PanelRightOpen);
|
|
193
|
+
const label = isOpen ? hideLabel : showLabel;
|
|
190
194
|
|
|
191
195
|
return (
|
|
192
196
|
<Button
|
|
@@ -197,7 +201,8 @@ export function AsidePanelToggle({ showLabel = messages.asidePanel.show, hideLab
|
|
|
197
201
|
size="icon"
|
|
198
202
|
aria-expanded={isOpen}
|
|
199
203
|
aria-controls={panelId}
|
|
200
|
-
aria-label={
|
|
204
|
+
aria-label={label}
|
|
205
|
+
title={label}
|
|
201
206
|
className={cn("fixed top-[calc(--spacing(2)+env(safe-area-inset-top))] right-[calc(--spacing(2)+env(safe-area-inset-right))] z-20", className)}
|
|
202
207
|
onClick={toggle}
|
|
203
208
|
>
|
|
@@ -224,6 +229,7 @@ export function AsidePanelSidebarOpener({ label = messages.asidePanel.showSideba
|
|
|
224
229
|
variant="outline"
|
|
225
230
|
size="icon"
|
|
226
231
|
aria-label={label}
|
|
232
|
+
title={label}
|
|
227
233
|
className={cn("fixed top-[calc(--spacing(2)+env(safe-area-inset-top))] left-[calc(--spacing(2)+env(safe-area-inset-left))] z-20", className)}
|
|
228
234
|
onClick={openSidebar}
|
|
229
235
|
>
|
|
@@ -242,6 +248,8 @@ export interface AsidePanelProps {
|
|
|
242
248
|
readonly narrowLabel?: string;
|
|
243
249
|
// The phone sheet's close button text.
|
|
244
250
|
readonly closeLabel?: string;
|
|
251
|
+
// One line under the phone sheet's title, which the sheet is described by.
|
|
252
|
+
readonly description?: string;
|
|
245
253
|
readonly className?: string;
|
|
246
254
|
}
|
|
247
255
|
|
|
@@ -255,6 +263,7 @@ export function AsidePanel({
|
|
|
255
263
|
widenLabel = messages.asidePanel.widen,
|
|
256
264
|
narrowLabel = messages.asidePanel.narrow,
|
|
257
265
|
closeLabel,
|
|
266
|
+
description,
|
|
258
267
|
className,
|
|
259
268
|
}: AsidePanelProps) {
|
|
260
269
|
const { panelId, isOpen, width, isMobile, isHidden, toggleRef, isHeadingFocusRequested, close, setWidth } = useAsidePanelContext("AsidePanel");
|
|
@@ -290,7 +299,7 @@ export function AsidePanel({
|
|
|
290
299
|
id={panelId}
|
|
291
300
|
side="right"
|
|
292
301
|
data-slot="aside-panel-sheet"
|
|
293
|
-
aria-describedby
|
|
302
|
+
{...(description === undefined ? { "aria-describedby": undefined } : {})}
|
|
294
303
|
closeLabel={closeLabel}
|
|
295
304
|
className={cn("w-full gap-0 sm:max-w-none", className)}
|
|
296
305
|
onOpenAutoFocus={(event) => {
|
|
@@ -306,6 +315,7 @@ export function AsidePanel({
|
|
|
306
315
|
<SheetTitle ref={headingRef} tabIndex={-1} className="outline-none">
|
|
307
316
|
{title}
|
|
308
317
|
</SheetTitle>
|
|
318
|
+
{description === undefined ? null : <SheetDescription>{description}</SheetDescription>}
|
|
309
319
|
</SheetHeader>
|
|
310
320
|
<div data-slot="aside-panel-content" className="min-h-0 flex-1 overflow-y-auto">
|
|
311
321
|
{isOpen ? children : null}
|
|
@@ -318,7 +328,10 @@ export function AsidePanel({
|
|
|
318
328
|
if (!isOpen) return null;
|
|
319
329
|
const isHalf = width === "half";
|
|
320
330
|
const WidthIcon = isHalf ? ChevronsRight : ChevronsLeft;
|
|
331
|
+
const widthLabel = isHalf ? narrowLabel : widenLabel;
|
|
321
332
|
|
|
333
|
+
// A phone gets this branch in the server HTML (`useIsMobile` is false there) until hydration swaps in the sheet:
|
|
334
|
+
// `max-md:hidden` keeps it from painting. The `md` breakpoint equals the theme's mobile breakpoint.
|
|
322
335
|
return (
|
|
323
336
|
<aside
|
|
324
337
|
id={panelId}
|
|
@@ -326,7 +339,7 @@ export function AsidePanel({
|
|
|
326
339
|
data-width={width}
|
|
327
340
|
aria-labelledby={headingId}
|
|
328
341
|
className={cn(
|
|
329
|
-
"sticky top-0 flex h-dvh w-2/5 shrink-0 flex-col border-l border-border bg-background text-foreground data-[width=half]:w-1/2",
|
|
342
|
+
"sticky top-0 flex h-dvh max-md:hidden w-2/5 shrink-0 flex-col border-l border-border bg-background text-foreground data-[width=half]:w-1/2",
|
|
330
343
|
className,
|
|
331
344
|
)}
|
|
332
345
|
>
|
|
@@ -334,7 +347,7 @@ export function AsidePanel({
|
|
|
334
347
|
<h2 ref={headingRef} id={headingId} tabIndex={-1} className="min-w-0 flex-1 truncate text-heading-3 outline-none">
|
|
335
348
|
{title}
|
|
336
349
|
</h2>
|
|
337
|
-
<Button type="button" variant="ghost" size="icon" aria-label={
|
|
350
|
+
<Button type="button" variant="ghost" size="icon" aria-label={widthLabel} title={widthLabel} onClick={() => setWidth(isHalf ? "standard" : "half")}>
|
|
338
351
|
<WidthIcon aria-hidden="true" strokeWidth={ICON_STROKE_WIDTH} />
|
|
339
352
|
</Button>
|
|
340
353
|
</div>
|