@nadicodeai/ui 12.1.210 → 12.1.212
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/AGENTS.md +11 -4
- package/dist/components/account-menu.d.ts +3 -3
- package/dist/components/account-menu.d.ts.map +1 -1
- package/dist/components/account-menu.js +7 -5
- package/dist/components/activity-feed.d.ts +4 -2
- package/dist/components/activity-feed.d.ts.map +1 -1
- package/dist/components/activity-feed.js +10 -3
- package/dist/components/board.d.ts +45 -0
- package/dist/components/board.d.ts.map +1 -0
- package/dist/components/board.js +35 -0
- package/dist/components/breadcrumb.d.ts +3 -3
- package/dist/components/breadcrumb.d.ts.map +1 -1
- package/dist/components/button.d.ts +6 -1
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +5 -2
- package/dist/components/card-row.js +1 -1
- package/dist/components/chart-card.d.ts +19 -6
- package/dist/components/chart-card.d.ts.map +1 -1
- package/dist/components/chart-card.js +17 -7
- package/dist/components/collection-page.d.ts +4 -4
- package/dist/components/collection-page.d.ts.map +1 -1
- package/dist/components/collection-page.js +4 -8
- package/dist/components/collection-toolbar.d.ts +5 -4
- package/dist/components/collection-toolbar.d.ts.map +1 -1
- package/dist/components/collection-toolbar.js +9 -5
- package/dist/components/column-foot.d.ts +53 -0
- package/dist/components/column-foot.d.ts.map +1 -0
- package/dist/components/column-foot.js +32 -0
- package/dist/components/conversation-card.d.ts +38 -0
- package/dist/components/conversation-card.d.ts.map +1 -0
- package/dist/components/conversation-card.js +19 -0
- package/dist/components/data-table.d.ts +27 -22
- package/dist/components/data-table.d.ts.map +1 -1
- package/dist/components/data-table.js +76 -25
- package/dist/components/entry-page.d.ts +55 -0
- package/dist/components/entry-page.d.ts.map +1 -0
- package/dist/components/entry-page.js +41 -0
- package/dist/components/entry-scene.d.ts +1 -1
- package/dist/components/entry-scene.js +1 -1
- package/dist/components/filter-toolbar.d.ts +43 -0
- package/dist/components/filter-toolbar.d.ts.map +1 -0
- package/dist/components/filter-toolbar.js +44 -0
- package/dist/components/hive-scene.d.ts +4 -1
- package/dist/components/hive-scene.d.ts.map +1 -1
- package/dist/components/hive-scene.js +6 -1
- package/dist/components/invite-card.js +1 -1
- package/dist/components/item.d.ts +1 -1
- package/dist/components/item.js +2 -2
- package/dist/components/kpi-card.d.ts +10 -3
- package/dist/components/kpi-card.d.ts.map +1 -1
- package/dist/components/kpi-card.js +12 -4
- package/dist/components/message-notice.d.ts +3 -3
- package/dist/components/message-notice.js +1 -1
- package/dist/components/notice-banner.d.ts +1 -1
- package/dist/components/notice-banner.js +1 -1
- package/dist/components/object-page.d.ts +8 -2
- package/dist/components/object-page.d.ts.map +1 -1
- package/dist/components/object-page.js +7 -2
- package/dist/components/object-workspace.d.ts +25 -5
- package/dist/components/object-workspace.d.ts.map +1 -1
- package/dist/components/object-workspace.js +30 -7
- package/dist/components/page-actions.d.ts +0 -2
- package/dist/components/page-actions.d.ts.map +1 -1
- package/dist/components/page-actions.js +1 -5
- package/dist/components/page-frame.d.ts +38 -0
- package/dist/components/page-frame.d.ts.map +1 -0
- package/dist/components/page-frame.js +29 -0
- package/dist/components/page-header.d.ts +4 -3
- package/dist/components/page-header.d.ts.map +1 -1
- package/dist/components/page-header.js +5 -4
- package/dist/components/pending-label.d.ts +1 -1
- package/dist/components/pending-label.d.ts.map +1 -1
- package/dist/components/pending-label.js +4 -6
- package/dist/components/place-count.d.ts +20 -0
- package/dist/components/place-count.d.ts.map +1 -0
- package/dist/components/place-count.js +16 -0
- package/dist/components/plan-card.d.ts +49 -0
- package/dist/components/plan-card.d.ts.map +1 -0
- package/dist/components/plan-card.js +22 -0
- package/dist/components/product-band.d.ts +20 -0
- package/dist/components/product-band.d.ts.map +1 -0
- package/dist/components/product-band.js +23 -0
- package/dist/components/product-shell.d.ts +316 -44
- package/dist/components/product-shell.d.ts.map +1 -1
- package/dist/components/product-shell.js +533 -36
- package/dist/components/reading-column.d.ts +1 -1
- package/dist/components/reading-column.js +1 -1
- package/dist/components/record-list.d.ts +19 -3
- package/dist/components/record-list.d.ts.map +1 -1
- package/dist/components/record-list.js +23 -8
- package/dist/components/record-time.d.ts +6 -2
- package/dist/components/record-time.d.ts.map +1 -1
- package/dist/components/record-time.js +8 -5
- package/dist/components/row-edit-form.d.ts +1 -1
- package/dist/components/row-edit-form.js +1 -1
- package/dist/components/scope-switcher.d.ts +3 -1
- package/dist/components/scope-switcher.d.ts.map +1 -1
- package/dist/components/scope-switcher.js +3 -6
- package/dist/components/settings-page.d.ts +3 -3
- package/dist/components/settings-page.js +3 -3
- package/dist/components/settings-section.d.ts +19 -5
- package/dist/components/settings-section.d.ts.map +1 -1
- package/dist/components/settings-section.js +14 -6
- package/dist/components/sidebar-sections.d.ts.map +1 -1
- package/dist/components/sidebar-sections.js +4 -4
- package/dist/components/sidebar.d.ts +27 -5
- package/dist/components/sidebar.d.ts.map +1 -1
- package/dist/components/sidebar.js +56 -24
- package/dist/components/table-card.d.ts.map +1 -1
- package/dist/components/table-card.js +2 -1
- package/dist/components/table-layouts.d.ts +27 -0
- package/dist/components/table-layouts.d.ts.map +1 -1
- package/dist/components/table-layouts.js +30 -0
- package/dist/components/toast.d.ts +10 -1
- package/dist/components/toast.d.ts.map +1 -1
- package/dist/components/toast.js +24 -1
- package/dist/components/update-card.js +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/internal/button-classes.d.ts +2 -0
- package/dist/internal/button-classes.d.ts.map +1 -1
- package/dist/internal/button-classes.js +54 -46
- package/dist/internal/card-actions.d.ts +3 -0
- package/dist/internal/card-actions.d.ts.map +1 -0
- package/dist/internal/card-actions.js +4 -0
- package/dist/internal/footer-strip.d.ts.map +1 -1
- package/dist/internal/footer-strip.js +3 -1
- package/dist/internal/table-compact-line.d.ts +1 -7
- package/dist/internal/table-compact-line.d.ts.map +1 -1
- package/dist/internal/table-compact-line.js +5 -11
- package/dist/lib/product-shell.d.ts +20 -0
- package/dist/lib/product-shell.d.ts.map +1 -0
- package/dist/lib/product-shell.js +19 -0
- package/dist/showcase/specimens/compositions.d.ts +15 -0
- package/dist/showcase/specimens/compositions.d.ts.map +1 -1
- package/dist/showcase/specimens/compositions.js +70 -0
- package/dist/showcase/specimens/index.d.ts +11 -0
- package/dist/showcase/specimens/index.d.ts.map +1 -1
- package/dist/showcase/specimens/navigation.d.ts +4 -0
- package/dist/showcase/specimens/navigation.d.ts.map +1 -1
- package/dist/showcase/specimens/navigation.js +26 -1
- package/dist/showcase/usage.generated.d.ts +1 -1
- package/dist/showcase/usage.generated.d.ts.map +1 -1
- package/dist/showcase/usage.generated.js +166 -45
- package/dist/styles/components.css +38 -0
- package/dist/styles/globals.css +0 -5
- package/package.json +6 -2
|
@@ -1,66 +1,469 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
-
import {
|
|
4
|
+
import { PanelLeftIcon, Plus, RotateCw, SearchIcon, XIcon } from "lucide-react";
|
|
5
|
+
import { createContext, Fragment, use, useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore, } from "react";
|
|
6
|
+
import { flushSync } from "react-dom";
|
|
5
7
|
import { AccountMenu } from "./account-menu.js";
|
|
8
|
+
import { FootBand } from "./column-foot.js";
|
|
9
|
+
import { AgentListRow } from "./agent-list-row.js";
|
|
10
|
+
import { Button, ButtonLink } from "./button.js";
|
|
6
11
|
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from "./breadcrumb.js";
|
|
12
|
+
import { EmptyState } from "./empty-state.js";
|
|
13
|
+
import { IdentityMark, } from "./identity-mark.js";
|
|
7
14
|
import { Kbd } from "./kbd.js";
|
|
8
15
|
import { NoticeBanner } from "./notice-banner.js";
|
|
9
|
-
import {
|
|
16
|
+
import { PageActionsHostProvider } from "./page-actions.js";
|
|
17
|
+
import { PageHeader } from "./page-header.js";
|
|
18
|
+
import { RecordContextMenu } from "./record-commands.js";
|
|
19
|
+
import { ScopeSwitcher } from "./scope-switcher.js";
|
|
20
|
+
import { SIDEBAR_WIDTH_ICON, Sidebar, SidebarBrand, SidebarFind, SidebarFrame, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarInset, SidebarMenu, SidebarMenuButton, SidebarMenuChevron, SidebarMenuItem, SIDEBAR_WIDTH_MARKS, SidebarProvider, SidebarTrigger, useSidebar, } from "./sidebar.js";
|
|
10
21
|
import { SidebarSections } from "./sidebar-sections.js";
|
|
11
|
-
import {
|
|
22
|
+
import { Skeleton, SkeletonRegion } from "./skeleton.js";
|
|
23
|
+
import { StatusBadge } from "./status-badge.js";
|
|
24
|
+
import { TabsLink, TabsNav } from "./tabs-nav.js";
|
|
25
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.js";
|
|
26
|
+
import { PlaceCount } from "./place-count.js";
|
|
12
27
|
import { CommandRunnerHost } from "../internal/command-runner.js";
|
|
28
|
+
import { cssVariables } from "../lib/css-variables.js";
|
|
29
|
+
import { PRODUCT_SHELL_HEADING_ID, PRODUCT_SHELL_KEPT_COLLAPSED_ATTRIBUTE, PRODUCT_SHELL_KEPT_WIDTH_ATTRIBUTE, PRODUCT_SHELL_KEPT_WIDTH_PROPERTY, } from "../lib/product-shell.js";
|
|
30
|
+
import { cn } from "../lib/utils.js";
|
|
31
|
+
function useNarrowerThan(px) {
|
|
32
|
+
const query = px === undefined ? null : `(max-width: ${px - 0.02}px)`;
|
|
33
|
+
return useSyncExternalStore((changed) => {
|
|
34
|
+
if (!query)
|
|
35
|
+
return () => { };
|
|
36
|
+
const list = window.matchMedia(query);
|
|
37
|
+
list.addEventListener("change", changed);
|
|
38
|
+
return () => list.removeEventListener("change", changed);
|
|
39
|
+
}, () => (query ? window.matchMedia(query).matches : false), () => false);
|
|
40
|
+
}
|
|
41
|
+
const READABLE_NAME_PX = 48;
|
|
42
|
+
const namesIn = (room) => room.querySelectorAll(".truncate");
|
|
43
|
+
function nameShortfall(room) {
|
|
44
|
+
let lacking = 0;
|
|
45
|
+
for (const name of namesIn(room)) {
|
|
46
|
+
lacking += Math.max(0, Math.min(name.scrollWidth, READABLE_NAME_PX) - name.clientWidth);
|
|
47
|
+
}
|
|
48
|
+
return lacking;
|
|
49
|
+
}
|
|
50
|
+
function useCompactControls(pathRoom, offered) {
|
|
51
|
+
const [compact, setCompact] = useState(false);
|
|
52
|
+
useLayoutEffect(() => {
|
|
53
|
+
const room = pathRoom.current;
|
|
54
|
+
const bar = room?.parentElement;
|
|
55
|
+
if (!offered || !room || !bar)
|
|
56
|
+
return;
|
|
57
|
+
let fullFrom = 0;
|
|
58
|
+
const check = (show) => {
|
|
59
|
+
if (fullFrom > 0) {
|
|
60
|
+
if (bar.clientWidth < fullFrom)
|
|
61
|
+
return;
|
|
62
|
+
fullFrom = 0;
|
|
63
|
+
show(false);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const lacking = nameShortfall(room);
|
|
67
|
+
if (lacking === 0)
|
|
68
|
+
return;
|
|
69
|
+
fullFrom = bar.clientWidth + lacking;
|
|
70
|
+
show(true);
|
|
71
|
+
};
|
|
72
|
+
check(setCompact);
|
|
73
|
+
if (typeof ResizeObserver === "undefined" || typeof MutationObserver === "undefined")
|
|
74
|
+
return;
|
|
75
|
+
// Observer records arrive before paint: committing there keeps a frame from showing the
|
|
76
|
+
// controls the names were not measured with.
|
|
77
|
+
const showNow = (next) => flushSync(() => setCompact(next));
|
|
78
|
+
// The path places its names after it measures the bar's ends, so a name narrows after the
|
|
79
|
+
// room itself has settled: each name is watched too.
|
|
80
|
+
const resized = new ResizeObserver(() => check(showNow));
|
|
81
|
+
const watch = () => {
|
|
82
|
+
resized.disconnect();
|
|
83
|
+
resized.observe(bar);
|
|
84
|
+
resized.observe(room);
|
|
85
|
+
for (const name of namesIn(room))
|
|
86
|
+
resized.observe(name);
|
|
87
|
+
};
|
|
88
|
+
watch();
|
|
89
|
+
// Another path's names were never measured beside the host's controls: bring them back and
|
|
90
|
+
// measure again, since the room a previous name lacked says nothing about this one.
|
|
91
|
+
const renamed = new MutationObserver(() => {
|
|
92
|
+
watch();
|
|
93
|
+
if (fullFrom > 0) {
|
|
94
|
+
fullFrom = 0;
|
|
95
|
+
showNow(false);
|
|
96
|
+
}
|
|
97
|
+
check(showNow);
|
|
98
|
+
});
|
|
99
|
+
renamed.observe(room, { childList: true, characterData: true, subtree: true });
|
|
100
|
+
return () => {
|
|
101
|
+
resized.disconnect();
|
|
102
|
+
renamed.disconnect();
|
|
103
|
+
setCompact(false);
|
|
104
|
+
};
|
|
105
|
+
}, [pathRoom, offered]);
|
|
106
|
+
return offered && compact;
|
|
107
|
+
}
|
|
108
|
+
const isRegion = (value) => typeof value === "object" && value !== null && "region" in value;
|
|
109
|
+
const ProductShellContext = createContext(null);
|
|
110
|
+
const ProductShellColumnContext = createContext(null);
|
|
111
|
+
function useColumn() {
|
|
112
|
+
const column = use(ProductShellColumnContext);
|
|
113
|
+
if (!column)
|
|
114
|
+
throw new Error("A column region is drawn inside ProductShell's column.");
|
|
115
|
+
return column;
|
|
116
|
+
}
|
|
117
|
+
const ProductShellWordsContext = createContext(null);
|
|
118
|
+
const waitingIn = (places) => places.reduce((sum, place) => sum + (place.badge ?? 0), 0);
|
|
119
|
+
const subscribeToNothing = () => () => { };
|
|
13
120
|
/**
|
|
14
121
|
* A desktop or web product's frame: its navigation column, the top bar with the path, and the page.
|
|
15
122
|
*
|
|
16
123
|
* @family Navigation
|
|
17
|
-
* @when The frame of every product page in the Portal, Nadia and Alveare Server: the product's home, Find, its places or an area's sections, the update offer or the way out, and the account, beside the page with its path. Alveare keeps Buzz's sidebar and mounts the
|
|
18
|
-
* @instead A product never draws `Sidebar`, `SidebarFrame`, `SidebarProvider`, `SidebarInset`, `AccountMenu` or `
|
|
19
|
-
* @behaviour One column, its regions in this order: the home with the collapse control, Find, the places in their groups, one band (the update offer or the way out),
|
|
20
|
-
* @words Every word is the product's: the places' nouns, the path's names exactly as the places and the records write them, and `labels` from its catalogue.
|
|
21
|
-
* @access
|
|
124
|
+
* @when The frame of every product page in the Portal, Nadia and Alveare Server: the product's home, Find, its places or an area's sections, the update offer or the way out, and the account, beside the page with its path. Alveare keeps Buzz's sidebar and mounts this shell's foot in it as `ColumnFoot`, and its counts as `PlaceCount` (nadicode decision, 6 November 2026). Nadia's window is this shell with `host`, inside Hermes's `window.shell` area: each Agent is a place with her orb as its `mark` and what she is doing as its `status`, with Find as a lens and New Agent as `create` in the column's top row, and her company is a `foot` place that opens its area. A product shows its `home`, its mark and name, only where nothing else names it: on the web, as the Portal in a browser among many tabs, where the mark is also the way home; a desktop app's window, Dock and menu bar already name it, so its column starts with its Find and then its places (owner ruling, 2026-11-07). Find's `form` follows the column: a product whose column is a list of conversations or Agents, as Nadia's, takes the lens (`button`); a product of many places, as the Portal, takes the field (owner ruling, 2026-11-07).
|
|
125
|
+
* @instead A product never draws `Sidebar`, `SidebarFrame`, `SidebarProvider`, `SidebarInset`, `AccountMenu`, `UpdateCard`, `PageHeader` or `ReadingColumn` itself, which `nadicodeai/page-composition` refuses: it passes its places, its account, its band, its path and its title (nadicode decision). A page's own views are `Tabs`; an object's sections swap the column (`sections`) or stand in the band under the top bar (`tabs`), never a second column (nadicode decision). A part that waits for the page's language or for who is signed in is a region (`{ region }`) the product streams beside the page, drawn with the shell's component for it, so the frame and the page never wait for it; while it resolves, that component with `loading` holds its place. A product that reads everything before it draws shows `ProductShellSkeleton` meanwhile (owner ruling, 7 November 2026).
|
|
126
|
+
* @behaviour One column, its regions in this order: the home with the collapse control (no home where the window already names the product: a desktop app's column starts with its Find, and a host's `mover` fills the row's free room, where the window's own buttons sit), and Find's lens and the plus of `create` beside it when Find is a `button`, Find's field when it is one, the places in their groups, then the column's foot, pinned at its bottom with no rule above it and in glass on the column's own colour so the places scroll under it: one band (the update offer or the way out), the `foot` places and the account with the bell beside it (nadicode decision; owner ruling, 7 November 2026); the foot's places stay whether the column holds the places or an area's sections. The column is 256 px wide, dragged on its edge between 224 and 384 px, collapsed by its control, by the handle's Enter or by dragging it under the narrowest width to 48 px of icons, or with `width.collapsedTo` `marks` to 64 px of marks at 40, the width a column of Agents or people collapses to on every page of the product, and a sheet under 768 px; the width and the collapse go to the product through `width.onChange`, and the shell opens at the ones it is given, or, with `width.kept`, at the ones the product keeps in the browser, which its pre-paint script already gave the column the server drew, so the first frame stands at the kept width with no jump (owner ruling, 6 November 2026; the first frame at the kept width, owner ruling, 7 November 2026); below `width.collapseBelow` the column shows its marks alone with no control or handle to open it, and opens again as the window widens, keeping the person's choice. Collapsed, the account shows its picture alone and the update card one icon. A place's badge counts what waits there in the attention colour, and the phone's menu button carries their sum. A place with its own `mark` leads its row with it in place of an icon: an Agent's orb at 64 px beside her name and `status`, as `AgentListRow` draws her, any other mark at 32; collapsed, the column shows each mark alone, at 40 in a column of marks and 32 in one of icons, with the name and the status in its tooltip. A place's `commands` open on a right-click of its row, as a record's in a list, and its one `action` stands beside its row as a small outline button while the column shows names, as a failed set-up's Try again. A group with a `label` is a navigation named by it, headed only when the column holds more than one group; the lens and the plus stand as 36 px ghost icon buttons with 18 px icons in the column's top row, the lens's tooltip and `aria-keyshortcuts` naming its key, and collapsed as icon rows above the places, while an area's sections, collapsed, start with their way out; while a group's places are read it holds three placeholder rows, a failed read says so with its Try again (collapsed, one button that tries again, the message in its tooltip), and a read with no place says its `empty` line. Choosing a place closes the sheet, and so does any new page. Every confirmation a command in the frame opens is the shell's: it closes the sheet first, so one overlay never opens over another (nadicode decision); Find closes it too as it opens the product's search. The top bar stands over the page above a 1 px rule and holds navigation only, never the page's commands: the menu button at phone width, the path, and the assistant at its end (nadicode decision). The path stands at the bar's true centre on one line while its names fit whole there; when centring would cut a name, it moves toward the bar's start only as far as needed to show its names whole, and cuts them with an ellipsis only when even that is not enough; what stands at the bar's end never overlaps it, the path giving up its room first (owner ruling, 2026-11-07 (centred), with names kept whole). With the window's own buttons at its start (`startInset`), the collapsed column's top row is theirs and its control to open stands under them. The path is the breadcrumb, never a back button in its place (nadicode decision); a step may carry its own mark beside its name, and the last step may be a switcher among the page's siblings, as an Agent's chats; under 1024 px it keeps only the page and the step before it, and the open record's `status` stands beside its name; a `scope` step stands at the path's start with the way back to the whole scope, the page's name centred (owner ruling, 7 November 2026). The pages sit on the workspace ground under a 1 px rule, at most 1280 px wide with 24 px around them; the strip, when there is one, stands between the top bar and the page; the band of `tabs` stands under them and stays while the page scrolls under the top bar (owner ruling, 7 November 2026). The `title` row stands first in the page's column and carries the page's actions (`PageActions`); a title in the `settings` column narrows the whole page to that column, 960 px, so the title and everything under it share one edge from the first paint (owner ruling, 7 November 2026). A region that waits for the viewer before it knows whether it draws (`ProductShellTabs pending`) keeps the page unseen until it does, so the page never moves when it arrives. A new page opens at its top. Choosing a section in the column, or anything in the sheet, moves focus to the new page's heading once it arrives; a page opened any other way keeps focus where it was (owner ruling, 7 November 2026). With `labels.skip`, the first thing a keyboard reaches is a link to the page, shown only while focused. With `host`, the shell fills the region the host gives it rather than the viewport, the host's page area fills the room under the top bar edge to edge with its own landmark and scrolling, the host's `controls` stand at the top bar's end, and its `compactControls` in their place while they would cut a name of the path under 48 px, about three letters and the ellipsis, until the bar has grown the room those names lacked, its `mover` fills the bar's free room, `endInset` keeps the bar's end clear of the window's own buttons and `startInset` its start while the column is a sheet, the bar keeps the window's edge spacing, 12 px at either end, at every width, and with `underBar` the host's page runs under the bar, which is glass over it with only its bottom rim, as DESIGN.md's glass over Nadia's conversation.
|
|
127
|
+
* @words Every word is the product's: the places' nouns, the path's names exactly as the places and the records write them, the title as the column writes it, and `labels` from its catalogue. A product whose words wait for the page's language draws `labels` in a region with `ProductShellWords`: the frame's controls are named by those hidden words, so they stand in the first HTML before any language is known. A status is a short state ("Working", "Needs you"); `create` names what it adds ("New Agent").
|
|
128
|
+
* @access Each group of places is a navigation named by its heading, or by `labels.navigation` when it has none, with the places as buttons or links, the current one `aria-current="page"`, busy while its places are read; a place's row reads its name, then its status; the handle is a separator named by `labels.resize`; the page is the `main` landmark the product passes, named by `labels.main`, which the skip link focuses, or the one the host draws; the path is a navigation named by `labels.path`; the band of tabs is a navigation named by what its sections are of. The title is the page's `h1`. The phone's menu button names how many things wait. The skeleton, and a region's `loading` form, is busy and draws no word.
|
|
22
129
|
*/
|
|
23
130
|
export function ProductShell(props) {
|
|
24
131
|
const { width } = props;
|
|
25
132
|
const [open, setOpen] = useState(!width.collapsed);
|
|
133
|
+
const narrow = useNarrowerThan(width.collapseBelow);
|
|
26
134
|
const kept = useRef({ value: width.value, collapsed: width.collapsed });
|
|
27
135
|
const keep = (change) => {
|
|
28
136
|
kept.current = { ...kept.current, ...change };
|
|
29
137
|
width.onChange(kept.current);
|
|
30
138
|
};
|
|
31
|
-
|
|
139
|
+
const hydrated = useSyncExternalStore(subscribeToNothing, () => true, () => false);
|
|
140
|
+
return (_jsxs(SidebarProvider, { className: cn("min-h-0 overflow-hidden",
|
|
141
|
+
// A hosted shell fills the region its host gives it, and lays a host's aside over the page there.
|
|
142
|
+
props.host ? "relative h-full" : "h-svh", "md:[:root[data-product-shell-kept-width]_&]:[--sidebar-width:var(--product-shell-kept-width)]!", "md:[:root[data-product-shell-kept-collapsed]_&]:[--sidebar-width:var(--sidebar-width-icon)]!"), "data-hydrated": hydrated ? "true" : undefined, "data-slot": "product-shell", collapsedTo: width.collapsedTo, defaultWidth: width.value, onOpenChange: (next) => {
|
|
32
143
|
setOpen(next);
|
|
33
144
|
keep({ collapsed: !next });
|
|
34
|
-
}, onWidthChange: (value) => keep({ value }), open: open, children: _jsx(
|
|
145
|
+
}, onWidthChange: (value) => keep({ value }), open: open && !narrow, children: [width.kept ? (_jsx(KeptWidth, { read: width.kept, onRead: (next) => {
|
|
146
|
+
kept.current = next;
|
|
147
|
+
setOpen(!next.collapsed);
|
|
148
|
+
} })) : null, _jsx(Frame, { ...props, narrow: narrow })] }));
|
|
149
|
+
}
|
|
150
|
+
function KeptWidth({ read, onRead, }) {
|
|
151
|
+
const { restore } = useSidebar();
|
|
152
|
+
const taken = useRef(false);
|
|
153
|
+
useLayoutEffect(() => {
|
|
154
|
+
if (taken.current)
|
|
155
|
+
return;
|
|
156
|
+
taken.current = true;
|
|
157
|
+
const kept = read();
|
|
158
|
+
restore({ open: !kept.collapsed, width: kept.value });
|
|
159
|
+
onRead(kept);
|
|
160
|
+
document.documentElement.removeAttribute(PRODUCT_SHELL_KEPT_WIDTH_ATTRIBUTE);
|
|
161
|
+
document.documentElement.removeAttribute(PRODUCT_SHELL_KEPT_COLLAPSED_ATTRIBUTE);
|
|
162
|
+
document.documentElement.style.removeProperty(PRODUCT_SHELL_KEPT_WIDTH_PROPERTY);
|
|
163
|
+
}, [read, onRead, restore]);
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
function crumbKey(crumb) {
|
|
167
|
+
return crumb.scope ? crumb.scope.value : crumb.label;
|
|
35
168
|
}
|
|
36
|
-
function Frame({ home, find, band, account, bell, path, assistant, strip, aside, titleBar, labels, main, children, places, sections, }) {
|
|
37
|
-
const { isMobile, state, setOpenMobile } = useSidebar();
|
|
169
|
+
function Frame({ home, create, find, band, foot, account, bell, path, title, tabs, address, assistant, strip, aside, titleBar, labels, main, host, children, places, sections, narrow, }) {
|
|
170
|
+
const { isMobile, state, openMobile, setOpenMobile, toggleSidebar } = useSidebar();
|
|
38
171
|
const collapsed = state === "collapsed" && !isMobile;
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
172
|
+
const generatedId = useId();
|
|
173
|
+
const mainId = main?.props.id ?? `product-shell-page-${generatedId}`;
|
|
174
|
+
const ids = useMemo(() => ({
|
|
175
|
+
navigation: `${generatedId}-navigation`,
|
|
176
|
+
openNavigation: `${generatedId}-open-navigation`,
|
|
177
|
+
collapse: `${generatedId}-collapse`,
|
|
178
|
+
resize: `${generatedId}-resize`,
|
|
179
|
+
path: `${generatedId}-path`,
|
|
180
|
+
main: `${generatedId}-main`,
|
|
181
|
+
}), [generatedId]);
|
|
43
182
|
const page = useRef(null);
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
183
|
+
const shown = useRef(null);
|
|
184
|
+
const focusFrom = useRef(null);
|
|
185
|
+
const [regionWords, setRegionWords] = useState();
|
|
186
|
+
const words = isRegion(labels) ? regionWords : labels;
|
|
187
|
+
const [regionWaiting, setRegionWaiting] = useState(0);
|
|
188
|
+
const topCommands = [
|
|
189
|
+
...(find && !isRegion(find) && find.form === "button"
|
|
190
|
+
? [
|
|
191
|
+
{
|
|
192
|
+
label: find.label,
|
|
193
|
+
icon: SearchIcon,
|
|
194
|
+
onClick: find.onOpen,
|
|
195
|
+
shortcut: find.key,
|
|
196
|
+
keyshortcuts: find.key ? `Meta+${find.key} Control+${find.key}` : undefined,
|
|
197
|
+
},
|
|
198
|
+
]
|
|
199
|
+
: []),
|
|
200
|
+
...(create ? [{ label: create.label, icon: Plus, onClick: create.onClick }] : []),
|
|
201
|
+
];
|
|
202
|
+
const waiting = (isRegion(places)
|
|
203
|
+
? regionWaiting
|
|
204
|
+
: waitingIn((places ?? []).flatMap((group) => group.places))) + waitingIn(foot ?? []);
|
|
205
|
+
// A choice made in the sheet, whose closing leaves focus to the new page's heading.
|
|
206
|
+
const sheetChoice = useRef(false);
|
|
207
|
+
const closeSheet = useCallback(() => setOpenMobile(false), [setOpenMobile]);
|
|
208
|
+
const choose = useCallback(() => {
|
|
209
|
+
focusFrom.current = shown.current ?? "";
|
|
210
|
+
if (isMobile)
|
|
211
|
+
sheetChoice.current = true;
|
|
212
|
+
setOpenMobile(false);
|
|
213
|
+
}, [isMobile, setOpenMobile]);
|
|
214
|
+
const show = useCallback((next) => {
|
|
215
|
+
const previous = shown.current;
|
|
216
|
+
if (previous === next)
|
|
217
|
+
return;
|
|
218
|
+
shown.current = next;
|
|
219
|
+
if (previous === null)
|
|
220
|
+
return;
|
|
221
|
+
if (page.current)
|
|
48
222
|
page.current.scrollTop = 0;
|
|
49
|
-
|
|
223
|
+
if (openMobile) {
|
|
224
|
+
focusFrom.current ??= "";
|
|
225
|
+
sheetChoice.current = true;
|
|
226
|
+
setOpenMobile(false);
|
|
227
|
+
}
|
|
228
|
+
}, [openMobile, setOpenMobile]);
|
|
229
|
+
// Reads the address the shell shows rather than the render's, so a region that calls it later,
|
|
230
|
+
// such as a band of sections resolving, reaches the request as it stands then.
|
|
231
|
+
const focusHeading = useCallback(() => {
|
|
232
|
+
if (focusFrom.current === null || focusFrom.current === shown.current)
|
|
233
|
+
return;
|
|
234
|
+
const heading = shownHeading(page.current);
|
|
235
|
+
if (!heading)
|
|
236
|
+
return;
|
|
237
|
+
heading.focus({ preventScroll: true });
|
|
238
|
+
focusFrom.current = null;
|
|
239
|
+
}, []);
|
|
240
|
+
// Where focus goes once the sheet has closed: back to its button, unless a choice in it opened
|
|
241
|
+
// a page, whose heading takes focus now if it has arrived and as it arrives otherwise.
|
|
242
|
+
const sheetFinalFocus = () => {
|
|
243
|
+
if (!sheetChoice.current)
|
|
244
|
+
return true;
|
|
245
|
+
sheetChoice.current = false;
|
|
246
|
+
if (focusFrom.current !== null)
|
|
247
|
+
return false;
|
|
248
|
+
return shownHeading(page.current) ?? page.current ?? false;
|
|
249
|
+
};
|
|
50
250
|
const pageRegion = useRender({
|
|
51
251
|
defaultTagName: "div",
|
|
52
252
|
render: main,
|
|
53
253
|
ref: page,
|
|
54
254
|
props: {
|
|
55
|
-
|
|
56
|
-
|
|
255
|
+
id: mainId,
|
|
256
|
+
"aria-labelledby": isRegion(labels) || labels.main !== undefined ? ids.main : undefined,
|
|
257
|
+
// The page scrolls here, so a keyboard reaches it even on a page with no control to tab to
|
|
258
|
+
// (axe's scrollable-region-focusable); the skip link lands on it too.
|
|
259
|
+
tabIndex: 0,
|
|
260
|
+
className: "min-h-0 flex-1 overflow-auto overscroll-contain focus-visible:-outline-offset-(--outline-offset-focus) group-has-data-tabs-pending/product-shell-workspace:invisible",
|
|
261
|
+
children: (_jsx("div", { className: "mx-auto flex w-full min-w-0 max-w-7xl flex-col gap-6 p-6 has-[>[data-slot=product-shell-title]>[data-page-column=settings]]:max-w-[calc(60rem+3rem)]", "data-slot": "product-shell-column", children: _jsxs(PageActionsHostProvider, { children: [title ? (_jsx("div", { className: "min-w-0 empty:hidden has-[>.sr-only]:contents", "data-slot": "product-shell-title", children: isRegion(title) ? (_jsx(Fragment, { children: title.region }, "title-region")) : (_jsx(ProductShellTitle, { ...title })) })) : null, children] }) })),
|
|
57
262
|
},
|
|
58
263
|
state: { slot: "product-shell-page" },
|
|
59
264
|
});
|
|
60
|
-
const
|
|
61
|
-
|
|
265
|
+
const Mover = host?.mover;
|
|
266
|
+
// The window's own buttons hold the collapsed column's top row, so its control to open stands under them.
|
|
267
|
+
const expandBelowButtons = host?.startInset !== undefined;
|
|
268
|
+
// Each side of the bar keeps the room of what stands in it; the path takes the room between.
|
|
269
|
+
const startCluster = useRef(null);
|
|
270
|
+
const endCluster = useRef(null);
|
|
271
|
+
const [sideRoom, setSideRoom] = useState({ start: 0, end: 0 });
|
|
272
|
+
useLayoutEffect(() => {
|
|
273
|
+
const start = startCluster.current;
|
|
274
|
+
const end = endCluster.current;
|
|
275
|
+
if (!start || !end)
|
|
276
|
+
return;
|
|
277
|
+
const measure = () => setSideRoom({ start: start.offsetWidth, end: end.offsetWidth });
|
|
278
|
+
measure();
|
|
279
|
+
if (typeof ResizeObserver === "undefined")
|
|
280
|
+
return;
|
|
281
|
+
const observer = new ResizeObserver(measure);
|
|
282
|
+
observer.observe(start, { box: "border-box" });
|
|
283
|
+
observer.observe(end, { box: "border-box" });
|
|
284
|
+
return () => observer.disconnect();
|
|
285
|
+
}, []);
|
|
286
|
+
const pathRoom = useRef(null);
|
|
287
|
+
const compact = useCompactControls(pathRoom, host?.compactControls !== undefined);
|
|
288
|
+
const hosted = host !== undefined;
|
|
289
|
+
const placesRegion = isRegion(places);
|
|
290
|
+
const wordsRegion = isRegion(labels);
|
|
291
|
+
const context = useMemo(() => ({ ids, hosted, show, focusHeading }), [ids, hosted, show, focusHeading]);
|
|
292
|
+
const column = useMemo(() => ({
|
|
293
|
+
collapsed,
|
|
294
|
+
sheet: isMobile,
|
|
295
|
+
choose,
|
|
296
|
+
closeSheet,
|
|
297
|
+
navigationId: ids.navigation,
|
|
298
|
+
reportWaiting: placesRegion && !isMobile ? setRegionWaiting : undefined,
|
|
299
|
+
}), [collapsed, isMobile, choose, closeSheet, ids.navigation, placesRegion]);
|
|
300
|
+
const waitingCounter = useMemo(() => ({
|
|
301
|
+
collapsed: false,
|
|
302
|
+
sheet: true,
|
|
303
|
+
choose,
|
|
304
|
+
closeSheet,
|
|
305
|
+
navigationId: ids.navigation,
|
|
306
|
+
reportWaiting: setRegionWaiting,
|
|
307
|
+
onlyCountsWaiting: true,
|
|
308
|
+
}), [choose, closeSheet, ids.navigation]);
|
|
309
|
+
const wordsContext = useMemo(() => ({
|
|
310
|
+
ids,
|
|
311
|
+
mainId,
|
|
312
|
+
waiting,
|
|
313
|
+
publish: wordsRegion ? setRegionWords : undefined,
|
|
314
|
+
}), [ids, mainId, waiting, wordsRegion]);
|
|
315
|
+
const topBar = (_jsxs("header", { className: cn(
|
|
316
|
+
// The sides split the room the path leaves, so the path stays centred while its names fit whole; past that the start gives up its room first, and only then are names cut.
|
|
317
|
+
"grid min-h-14 w-full min-w-0 shrink-0 grid-cols-[minmax(var(--product-shell-start-room,0px),1fr)_minmax(0,auto)_minmax(min(var(--product-shell-end-room,0px),calc(100%-1.5rem-var(--product-shell-start-room,0px))),1fr)] items-center gap-3 py-1 md:py-0",
|
|
318
|
+
// A host's bar is its window's title bar, and keeps the window's edge spacing at every width.
|
|
319
|
+
host ? "px-3" : "px-3 md:px-8",
|
|
320
|
+
// Over a host's page that runs under it, the bar is glass whose rim shows only along its bottom edge.
|
|
321
|
+
host?.underBar
|
|
322
|
+
? "absolute inset-x-0 top-0 z-10 nc-glass [clip-path:inset(0_1px_-4rem_1px)]"
|
|
323
|
+
: host
|
|
324
|
+
? "border-b bg-background"
|
|
325
|
+
: "bg-background"), "data-slot": "product-shell-top-bar", style: cssVariables({
|
|
326
|
+
"--product-shell-end-inset": host?.endInset,
|
|
327
|
+
"--product-shell-start-inset": host?.startInset,
|
|
328
|
+
"--product-shell-start-room": sideRoom.start ? `${sideRoom.start}px` : undefined,
|
|
329
|
+
// The window's own buttons count in the end's room.
|
|
330
|
+
"--product-shell-end-room": sideRoom.end ? `${sideRoom.end}px` : undefined,
|
|
331
|
+
}), children: [_jsx("div", { className: "flex items-center self-stretch justify-self-start ps-[max(0px,calc(var(--product-shell-start-inset,0px)-0.75rem))] md:hidden", ref: startCluster, children: _jsx(SidebarTrigger, { "aria-labelledby": ids.openNavigation, attention: waiting, className: "-ml-1 self-center" }) }), Mover ? (_jsx("div", { className: "hidden self-stretch md:flex md:col-start-1 md:row-start-1", children: _jsx(Mover, {}) })) : null, _jsx("div", { className: "col-start-2 row-start-1 flex h-full min-w-0 items-center justify-center", ref: pathRoom, children: isRegion(path) ? (_jsx(Fragment, { children: path.region }, "path-region")) : (_jsx(ProductShellPath, { crumbs: path })) }), _jsxs("div", { className: "col-start-3 row-start-1 flex min-w-0 items-center justify-end gap-1 self-stretch", children: [Mover ? (_jsx("div", { className: "flex min-w-0 flex-1 self-stretch", children: _jsx(Mover, {}) })) : null, _jsxs("div", { className: "flex shrink-0 items-center gap-1 pe-(--product-shell-end-inset)", ref: endCluster, children: [host?.controls ? (_jsx("div", { className: "flex shrink-0 items-center gap-1", "data-compact": compact && host.compactControls ? "" : undefined, "data-slot": "product-shell-controls", children: compact && host.compactControls ? host.compactControls : host.controls })) : null, assistant ? _jsx(Fragment, { children: assistant }, "assistant") : null] })] })] }));
|
|
332
|
+
const stripRegion = strip ? (isRegion(strip) ? (_jsx(Fragment, { children: strip.region }, "strip-region")) : (_jsx(ProductShellStrip, { ...strip }))) : null;
|
|
333
|
+
return (_jsx(ProductShellContext, { value: context, children: _jsxs(CommandRunnerHost, { onAsk: closeSheet, children: [_jsx(ProductShellWordsContext, { value: wordsContext, children: isRegion(labels) ? (_jsx(Fragment, { children: labels.region }, "words-region")) : (_jsx(ProductShellWords, { ...labels })) }), _jsx(ProductShellColumnContext, { value: column, children: _jsxs(Sidebar, { mobileCloseLabel: words?.closeNavigation ?? "", mobileDescription: words?.navigationDescription, mobileFinalFocus: sheetFinalFocus, mobileTitle: words?.navigation, resize: narrow ? undefined : { "aria-labelledby": ids.resize }, children: [isMobile ? null : titleBar, _jsxs(SidebarFrame, { account: isRegion(account) ? (_jsx(Fragment, { children: account.region }, "account-region")) : (_jsx(ProductShellAccount, { ...account })), actions: bell ? _jsx(Fragment, { children: bell }, "bell") : undefined, band: band === undefined ? undefined : isRegion(band) ? (_jsx(Fragment, { children: band.region }, "band-region")) : (_jsx(ProductShellBand, { band: band })), find: find === undefined ? null : isRegion(find) ? (_jsx(Fragment, { children: find.region }, "find-region")) : find.form === "button" ? null : (_jsx(ProductShellFindField, { find: find })), foot: foot && foot.length > 0 ? (_jsx(SidebarMenu, { children: foot.map((place) => (_jsx(PlaceRow, { collapsed: collapsed, onChosen: isMobile ? choose : closeSheet, place: place }, place.id))) })) : undefined, header: !home ? (Mover ? (_jsx("div", { className: "flex h-14 min-w-0", children: _jsx(Mover, {}) })) : null) : isRegion(home) ? (_jsx(Fragment, { children: home.region }, "home-region")) : (_jsx(ProductShellHome, { ...home })), toggle: _jsxs(_Fragment, { children: [collapsed
|
|
334
|
+
? null
|
|
335
|
+
: topCommands.map((command) => (_jsx(TopCommand, { command: command, onChosen: closeSheet }, command.label))), collapsed && (narrow || expandBelowButtons) ? (Mover ? (_jsx("div", { className: "flex h-14 w-full self-stretch", children: _jsx(Mover, {}) })) : null) : narrow ? null : (_jsx(SidebarTrigger, { "aria-labelledby": ids.collapse, className: "hidden shrink-0 md:inline-flex" }))] }), children: [collapsed &&
|
|
336
|
+
((places && topCommands.length > 0) || (expandBelowButtons && !narrow)) ? (_jsx(SidebarGroup, { children: _jsx(SidebarGroupContent, { children: _jsxs(SidebarMenu, { children: [expandBelowButtons && !narrow ? (_jsx(SidebarMenuItem, { children: _jsx(SidebarMenuButton, { "aria-expanded": false, "aria-labelledby": ids.collapse, onClick: toggleSidebar, tooltip: words?.collapse, children: _jsx(PanelLeftIcon, { "aria-hidden": "true" }) }) })) : null, (places ? topCommands : []).map((command) => (_jsx(SidebarMenuItem, { children: _jsxs(SidebarMenuButton, { "aria-keyshortcuts": command.keyshortcuts, onClick: command.onClick, tooltip: command.label, children: [_jsx(command.icon, { "aria-hidden": "true" }), _jsx("span", { className: "sr-only", children: command.label })] }) }, command.label)))] }) }) })) : null, places ? (isRegion(places) ? (_jsx(Fragment, { children: places.region }, "places-region")) : (_jsx(ProductShellPlaces, { places: places }))) : sections ? (_jsx(ProductShellSections, { ...sections })) : null] })] }) }), isMobile && isRegion(places) ? (_jsx(ProductShellColumnContext, { value: waitingCounter, children: _jsx(Fragment, { children: places.region }, "places-count") })) : null, _jsxs(SidebarInset, { className: cn("h-full min-h-0 min-w-0", !host && "overflow-clip"), children: [isMobile ? titleBar : null, host ? (_jsxs("div", { className: "relative flex min-h-0 min-w-0 flex-1 flex-col", children: [topBar, stripRegion, _jsx("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", "data-slot": "product-shell-page", children: children })] })) : (_jsxs("div", { className: "grid min-h-0 min-w-0 flex-1 grid-rows-[auto_minmax(0,1fr)] gap-(--nc-guide) overflow-clip bg-border has-[>[data-slot=product-shell-strip]]:grid-rows-[auto_auto_minmax(0,1fr)]", "data-slot": "product-shell-inset", children: [topBar, stripRegion, _jsxs("div", { className: "group/product-shell-workspace flex min-h-0 min-w-0 flex-col overflow-clip bg-(--nc-material-workspace)", "data-slot": "product-shell-workspace", children: [tabs ? (_jsx("div", { className: "min-w-0 shrink-0", "data-slot": "product-shell-tabs-region", children: isRegion(tabs) ? (_jsx(Fragment, { children: tabs.region }, "tabs-region")) : (_jsx(ProductShellTabs, { ...tabs })) })) : null, pageRegion] })] }))] }), aside ? _jsx(Fragment, { children: aside }, "aside") : null, isRegion(address) ? (_jsx(Fragment, { children: address.region }, "address-region")) : (_jsx(ProductShellAddress, { address: address ?? (isRegion(path) ? "" : path.map(crumbKey).join("\u0000")) }))] }) }));
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* The shell's own words, from the product's catalogue: the skip link, and the hidden words the
|
|
340
|
+
* frame's controls are named by, so a product whose words wait for its language draws them in a
|
|
341
|
+
* region while the controls stand in the first HTML. `ProductShell` draws them from its `labels`;
|
|
342
|
+
* a product renders this in that region.
|
|
343
|
+
*/
|
|
344
|
+
export function ProductShellWords(labels) {
|
|
345
|
+
const words = use(ProductShellWordsContext);
|
|
346
|
+
if (!words)
|
|
347
|
+
throw new Error("ProductShellWords is drawn inside ProductShell.");
|
|
348
|
+
const { ids, mainId, waiting, publish } = words;
|
|
349
|
+
useLayoutEffect(() => publish?.(labels), [publish, labels]);
|
|
350
|
+
return (_jsxs(_Fragment, { children: [labels.skip ? (_jsx("a", { className: "fixed top-4 left-4 z-50 -translate-y-16 rounded-md border-0 bg-background px-4 py-2 text-sm font-medium text-foreground opacity-0 nc-elevation-floating focus-visible:translate-y-0 focus-visible:opacity-100", "data-slot": "product-shell-skip", href: `#${mainId}`, children: labels.skip })) : null, _jsxs("div", { "data-slot": "product-shell-words", hidden: true, children: [_jsx("span", { id: ids.navigation, children: labels.navigation }), _jsx("span", { id: ids.openNavigation, children: labels.openNavigation(waiting) }), _jsx("span", { id: ids.collapse, children: labels.collapse }), _jsx("span", { id: ids.resize, children: labels.resize }), _jsx("span", { id: ids.path, children: labels.path }), labels.main === undefined ? null : _jsx("span", { id: ids.main, children: labels.main })] })] }));
|
|
351
|
+
}
|
|
352
|
+
/** Tells the shell the page's address: `ProductShell` draws it from its `address`, and a product renders it in that region. */
|
|
353
|
+
export function ProductShellAddress({ address }) {
|
|
354
|
+
const shell = use(ProductShellContext);
|
|
355
|
+
const show = shell?.show;
|
|
356
|
+
const focusHeading = shell?.focusHeading;
|
|
357
|
+
useLayoutEffect(() => show?.(address), [show, address]);
|
|
358
|
+
// oxlint-disable-next-line react/exhaustive-effect-dependencies -- each new address is where a waiting heading may have arrived
|
|
359
|
+
useEffect(() => focusHeading?.(), [address, focusHeading]);
|
|
360
|
+
return null;
|
|
361
|
+
}
|
|
362
|
+
/** The column's home: `ProductShell` draws it from its `home`, and a product renders it in that region, or with `loading` while the region resolves. */
|
|
363
|
+
export function ProductShellHome(props) {
|
|
364
|
+
const { closeSheet } = useColumn();
|
|
365
|
+
if (props.loading) {
|
|
366
|
+
return (_jsx(SkeletonRegion, { busy: true, className: "flex h-12 items-center", "data-slot": "product-shell-home-skeleton", children: _jsx(Skeleton, { className: "h-[18px] w-44 max-w-full" }) }));
|
|
367
|
+
}
|
|
368
|
+
const brand = _jsx(SidebarBrand, { mark: props.mark, product: props.product });
|
|
369
|
+
if (!props.link)
|
|
370
|
+
return brand;
|
|
371
|
+
return (_jsx(SidebarMenu, { children: _jsx(SidebarMenuItem, { children: _jsx(SidebarMenuButton, { className: "px-0", onClick: closeSheet, render: props.link, size: "lg", children: brand }) }) }));
|
|
372
|
+
}
|
|
373
|
+
/** Find's field under the column's top: `ProductShell` draws it from its `find`, and a product renders it in that region, or with `loading` while the region resolves. */
|
|
374
|
+
export function ProductShellFindField(props) {
|
|
375
|
+
const { closeSheet } = useColumn();
|
|
376
|
+
if (props.loading) {
|
|
377
|
+
return (_jsx(SkeletonRegion, { busy: true, "data-slot": "product-shell-find-skeleton", children: _jsx(Skeleton, { className: "h-9 w-full column-collapsed:w-9" }) }));
|
|
378
|
+
}
|
|
379
|
+
const { find } = props;
|
|
380
|
+
return (_jsx(SidebarFind, { label: find.label, onClick: () => {
|
|
381
|
+
closeSheet();
|
|
382
|
+
find.onOpen();
|
|
383
|
+
}, shortcut: find.key ? _jsx(Kbd, { keyName: find.key, meta: true, size: "sm" }) : null }));
|
|
384
|
+
}
|
|
385
|
+
const LOADING_PLACES = [
|
|
386
|
+
{ id: "places", places: [], loading: true },
|
|
387
|
+
];
|
|
388
|
+
/** The column's places in their groups: `ProductShell` draws them from its `places`, and a product renders them in that region, or with `loading` while the region resolves. */
|
|
389
|
+
export function ProductShellPlaces(props) {
|
|
390
|
+
const { collapsed, sheet, choose, closeSheet, navigationId, reportWaiting, onlyCountsWaiting } = useColumn();
|
|
391
|
+
const groups = props.loading ? LOADING_PLACES : props.places;
|
|
392
|
+
const waiting = waitingIn(groups.flatMap((group) => group.places));
|
|
393
|
+
useLayoutEffect(() => {
|
|
394
|
+
if (!reportWaiting)
|
|
395
|
+
return;
|
|
396
|
+
reportWaiting(waiting);
|
|
397
|
+
return () => reportWaiting(0);
|
|
398
|
+
}, [reportWaiting, waiting]);
|
|
399
|
+
if (onlyCountsWaiting)
|
|
400
|
+
return null;
|
|
401
|
+
return groups.map((group) => (_jsx(PlaceGroup, { collapsed: collapsed, group: group, headed: groups.length > 1, navigationId: navigationId, onChosen: sheet ? choose : closeSheet }, group.id)));
|
|
402
|
+
}
|
|
403
|
+
/** An area's or an object's sections in the places' room: `ProductShell` draws them from its `sections`, and a product renders them in the places' region. */
|
|
404
|
+
export function ProductShellSections(props) {
|
|
405
|
+
const { collapsed, choose, onlyCountsWaiting } = useColumn();
|
|
406
|
+
if (onlyCountsWaiting)
|
|
407
|
+
return null;
|
|
408
|
+
return (_jsx(SidebarGroup, { children: _jsx(SidebarGroupContent, { children: _jsx(SidebarSections, { ...props, narrow: collapsed, onChosen: choose }) }) }));
|
|
409
|
+
}
|
|
410
|
+
/** The band above the account: `ProductShell` draws it from its `band`, and a product renders it in that region, or with `loading` while the region resolves. */
|
|
411
|
+
export function ProductShellBand(props) {
|
|
412
|
+
const { collapsed } = useColumn();
|
|
413
|
+
if (props.loading) {
|
|
414
|
+
return (_jsxs(SkeletonRegion, { busy: true, className: "flex h-12 items-center gap-2 px-2", "data-slot": "product-shell-band-skeleton", children: [_jsx(Skeleton, { className: "size-4 shrink-0" }), collapsed ? null : _jsx(Skeleton, { className: "h-4 w-24 column-collapsed:hidden" })] }));
|
|
415
|
+
}
|
|
416
|
+
return _jsx(FootBand, { band: props.band, narrow: collapsed });
|
|
62
417
|
}
|
|
63
|
-
|
|
418
|
+
/** The account menu at the column's foot: `ProductShell` draws it from its `account`, and a product renders it in that region, or with `loading` while the region resolves. */
|
|
419
|
+
export function ProductShellAccount(props) {
|
|
420
|
+
const { collapsed } = useColumn();
|
|
421
|
+
if ("loading" in props) {
|
|
422
|
+
return (_jsxs(SkeletonRegion, { busy: true, className: "flex h-control-height items-center gap-2 px-2", "data-slot": "product-shell-account-skeleton", children: [_jsx(Skeleton, { className: "size-5 shrink-0", shape: "circle" }), collapsed ? null : _jsx(Skeleton, { className: "h-4 w-28 column-collapsed:hidden" })] }));
|
|
423
|
+
}
|
|
424
|
+
return _jsx(AccountMenu, { ...props, pictureOnly: collapsed });
|
|
425
|
+
}
|
|
426
|
+
/** The strip under the top bar: `ProductShell` draws it from its `strip`, and a product renders it in that region. */
|
|
427
|
+
export function ProductShellStrip(props) {
|
|
428
|
+
const hosted = use(ProductShellContext)?.hosted ?? false;
|
|
429
|
+
if (hosted)
|
|
430
|
+
return _jsx(NoticeBanner, { ...props });
|
|
431
|
+
return (_jsx("div", { className: "min-w-0 bg-background p-3 md:px-4", "data-slot": "product-shell-strip", children: _jsx(NoticeBanner, { ...props }) }));
|
|
432
|
+
}
|
|
433
|
+
function PlaceGroup({ group, headed, navigationId, collapsed, onChosen, }) {
|
|
434
|
+
const rows = group.loading ? (_jsx(PlaceSkeletons, { collapsed: collapsed })) : group.failed ? (_jsx(PlacesFailed, { collapsed: collapsed, message: group.failed })) : group.places.length === 0 && group.empty !== undefined ? (collapsed ? null : (_jsx(EmptyState, { kind: "nothingYet", message: group.empty, scope: "card" }))) : (_jsx(SidebarMenu, { children: group.places.map((place) => (_jsx(PlaceRow, { collapsed: collapsed, onChosen: onChosen, place: place }, place.id))) }));
|
|
435
|
+
return (_jsxs(SidebarGroup, { children: [group.label && headed ? _jsx(SidebarGroupLabel, { render: _jsx("h2", { children: group.label }) }) : null, _jsx("nav", { "aria-busy": group.loading === true, "aria-label": group.label, "aria-labelledby": group.label === undefined ? navigationId : undefined, children: _jsx(SidebarGroupContent, { children: rows }) })] }));
|
|
436
|
+
}
|
|
437
|
+
function TopCommand({ command, onChosen }) {
|
|
438
|
+
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { render: _jsx(Button, { "aria-keyshortcuts": command.keyshortcuts, "aria-label": command.label, className: "shrink-0 column-collapsed:hidden", onClick: () => {
|
|
439
|
+
onChosen();
|
|
440
|
+
command.onClick();
|
|
441
|
+
}, size: "icon", variant: "ghost" }), children: _jsx(command.icon, { "aria-hidden": "true", className: "size-4.5" }) }), _jsx(TooltipContent, { shortcut: command.shortcut ? { keyName: command.shortcut, meta: true, size: "sm" } : undefined, side: "bottom", children: command.label })] }));
|
|
442
|
+
}
|
|
443
|
+
function PlaceSkeletons({ collapsed }) {
|
|
444
|
+
return (_jsx(SidebarMenu, { children: [0, 1, 2].map((index) => (_jsxs(SidebarMenuItem, { className: cn("flex h-12 items-center gap-2 px-2 column-collapsed:justify-center column-collapsed:px-0", collapsed && "justify-center px-0"), children: [_jsx(Skeleton, { className: "size-8 shrink-0" }), collapsed ? null : (_jsxs("span", { className: "grid flex-1 gap-1 column-collapsed:hidden", children: [_jsx(Skeleton, { className: "h-4 w-28" }), _jsx(Skeleton, { className: "h-3 w-20" })] }))] }, index))) }));
|
|
445
|
+
}
|
|
446
|
+
function PlacesFailed({ collapsed, message }) {
|
|
447
|
+
if (!collapsed)
|
|
448
|
+
return _jsx(EmptyState, { kind: "failed", message: message, scope: "card" });
|
|
449
|
+
const [retry] = message.actions;
|
|
450
|
+
return (_jsx(SidebarMenu, { children: _jsx(SidebarMenuItem, { children: _jsxs(SidebarMenuButton, { disabled: retry === undefined || retry.pending === true, onClick: retry?.onClick, tooltip: message.title, type: "button", children: [_jsx(RotateCw, { "aria-hidden": "true" }), _jsxs("span", { className: "sr-only", children: [message.title, " ", retry?.label] })] }) }) }));
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* The page's heading that takes focus: the one shown, since a page a router keeps for a quick
|
|
454
|
+
* return stays in the document, hidden, with its own, and none while a band of sections still
|
|
455
|
+
* pending keeps the whole page unseen.
|
|
456
|
+
*/
|
|
457
|
+
function shownHeading(page) {
|
|
458
|
+
for (const heading of page?.querySelectorAll("h1[tabindex]") ?? []) {
|
|
459
|
+
// A document without layout, such as a test's, knows nothing hidden.
|
|
460
|
+
if (!("checkVisibility" in heading) || heading.checkVisibility({ visibilityProperty: true })) {
|
|
461
|
+
return heading;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
return null;
|
|
465
|
+
}
|
|
466
|
+
function PlaceRow({ place, collapsed, onChosen, }) {
|
|
64
467
|
const go = place.link
|
|
65
468
|
? { render: place.link, onClick: onChosen }
|
|
66
469
|
: {
|
|
@@ -69,15 +472,109 @@ function PlaceRow({ place, onChosen }) {
|
|
|
69
472
|
onChosen();
|
|
70
473
|
},
|
|
71
474
|
};
|
|
72
|
-
|
|
475
|
+
const tooltip = place.status
|
|
476
|
+
? {
|
|
477
|
+
children: (_jsxs("span", { className: "grid", children: [_jsx("span", { className: "font-medium", children: place.label }), _jsx("span", { children: place.status })] })),
|
|
478
|
+
}
|
|
479
|
+
: place.label;
|
|
480
|
+
const marked = place.mark !== undefined;
|
|
481
|
+
const { widthIcon } = useSidebar();
|
|
482
|
+
const markSize = collapsed ? (widthIcon === SIDEBAR_WIDTH_MARKS ? 40 : 32) : 64;
|
|
483
|
+
const action = collapsed ? undefined : place.action;
|
|
484
|
+
const row = (_jsxs(SidebarMenuItem, { className: cn(action && "flex items-center gap-1"), children: [_jsxs(SidebarMenuButton, { "aria-current": place.current ? "page" : undefined, className: cn(marked && !collapsed && "h-auto min-h-13 py-0.5 ps-1", marked && markSize === 40 && "column-collapsed:size-12! column-collapsed:p-1!", action && "min-w-0 flex-1"), isActive: place.current === true, size: marked ? "lg" : "default", tooltip: tooltip, ...go, children: [_jsx(PlaceFigureAndWords, { collapsed: collapsed, markSize: markSize, place: place }), place.opensArea && !collapsed ? _jsx(SidebarMenuChevron, {}) : null] }), action ? (_jsx(Button, { className: "column-collapsed:hidden", onClick: action.onClick, size: "xs", type: "button", variant: "outline", children: action.label })) : null, place.badge ? _jsx(PlaceCount, { count: place.badge, tone: "attention" }) : null] }));
|
|
485
|
+
return place.commands ? _jsx(RecordContextMenu, { ...place.commands, children: row }) : row;
|
|
486
|
+
}
|
|
487
|
+
function PlaceFigureAndWords({ place, collapsed, markSize, }) {
|
|
488
|
+
const { mark } = place;
|
|
489
|
+
if (mark?.kind === "agent") {
|
|
490
|
+
return (_jsx(AgentListRow, { color: mark.orb.color, current: place.current === true, form: mark.orb.form, name: place.label, narrow: collapsed, size: markSize, state: mark.orb.state, stateLine: place.status }));
|
|
491
|
+
}
|
|
492
|
+
// Collapsed, the row shows its figure alone: the words stay for a screen reader, whatever room a touch target gives.
|
|
493
|
+
const words = place.status ? (_jsxs("span", { className: cn("grid min-w-0 column-collapsed:sr-only", collapsed && "sr-only"), children: [_jsx("span", { className: "truncate", children: place.label }), _jsx("span", { className: "truncate text-xs text-muted-foreground", children: place.status })] })) : (_jsx("span", { className: cn("truncate column-collapsed:sr-only", collapsed && "sr-only"), children: place.label }));
|
|
494
|
+
return (_jsxs(_Fragment, { children: [mark ? (_jsx(IdentityMark, { ...mark, size: markSize === 40 ? 40 : 32 })) : place.icon ? (_jsx(place.icon, {})) : null, words] }));
|
|
495
|
+
}
|
|
496
|
+
function Status({ status }) {
|
|
497
|
+
return _jsx(StatusBadge, { label: status.label, tone: status.tone });
|
|
498
|
+
}
|
|
499
|
+
const STEP_LINK = "inline-flex min-h-touch-target min-w-0 items-center [@media(hover:hover)_and_(pointer:fine)]:min-h-0";
|
|
500
|
+
/**
|
|
501
|
+
* The top bar's path, drawn from its crumbs: `ProductShell` draws it from its `path`, and a
|
|
502
|
+
* product whose router resolves the path beside the page renders it in that region, or with
|
|
503
|
+
* `loading` while the region resolves.
|
|
504
|
+
*/
|
|
505
|
+
export function ProductShellPath(props) {
|
|
506
|
+
const pathId = use(ProductShellContext)?.ids.path;
|
|
507
|
+
const name = props.label === undefined ? { "aria-labelledby": pathId ?? "" } : { "aria-label": props.label };
|
|
508
|
+
if (props.loading) {
|
|
509
|
+
return (_jsx(SkeletonRegion, { busy: true, "data-slot": "product-shell-path-skeleton", children: _jsx(Skeleton, { className: "h-4 w-40" }) }));
|
|
510
|
+
}
|
|
511
|
+
const [first, ...rest] = props.crumbs;
|
|
512
|
+
if (first?.scope)
|
|
513
|
+
return _jsx(ScopedPath, { name: name, rest: rest, scope: first });
|
|
514
|
+
return _jsx(Path, { crumbs: props.crumbs, name: name });
|
|
515
|
+
}
|
|
516
|
+
function Path({ crumbs, name }) {
|
|
517
|
+
const current = crumbs.at(-1);
|
|
518
|
+
if (!current || current.scope)
|
|
519
|
+
return null;
|
|
520
|
+
const ancestors = crumbs.slice(0, -1);
|
|
521
|
+
return (_jsx(Breadcrumb, { ...name, className: "min-w-0", "data-slot": "product-shell-path", children: _jsxs(BreadcrumbList, { className: "min-w-0 flex-nowrap justify-center", children: [ancestors.map((crumb, index) => {
|
|
522
|
+
// Under 1024 px the path keeps the page and the step before it.
|
|
523
|
+
const far = index < ancestors.length - 1;
|
|
524
|
+
return (_jsxs(Fragment
|
|
525
|
+
// A path is a fixed list per page, so the position is the identity.
|
|
526
|
+
, { children: [_jsxs(BreadcrumbItem, { className: cn("min-w-0", far && "hidden lg:inline-flex"), children: [crumb.mark ? _jsx(IdentityMark, { ...crumb.mark, size: 20 }) : null, crumb.scope ? null : crumb.link ? (_jsx(BreadcrumbLink, { className: STEP_LINK, render: crumb.link, children: _jsx("span", { className: "truncate", children: crumb.label }) })) : crumb.group ? (_jsx("span", { className: "min-w-0 truncate", children: crumb.label })) : (_jsx(BreadcrumbLink, { className: "min-w-0", disabled: true, children: _jsx("span", { className: "truncate", children: crumb.label }) }))] }), _jsx(BreadcrumbSeparator, { className: far ? "hidden lg:inline-flex" : undefined })] }, index));
|
|
527
|
+
}), _jsx(BreadcrumbItem, { className: "min-w-0", children: _jsxs("span", { className: "inline-flex min-w-0 items-center gap-2", children: [current.mark ? _jsx(IdentityMark, { ...current.mark, size: 20 }) : null, current.switcher ? (_jsx(ScopeSwitcher, { ...current.switcher, variant: "navigation" })) : (_jsx(BreadcrumbPage, { className: "block min-w-0 truncate", children: current.label })), current.status ? (_jsx("span", { className: "shrink-0", children: _jsx(Status, { status: current.status }) })) : null] }) })] }) }));
|
|
528
|
+
}
|
|
529
|
+
function ScopedPath({ scope: step, rest, name, }) {
|
|
530
|
+
const { close, ...switcher } = step.scope;
|
|
531
|
+
const current = rest.at(-1);
|
|
532
|
+
return (_jsx(Breadcrumb, { ...name, className: "w-full min-w-0", "data-slot": "product-shell-path", children: _jsxs(BreadcrumbList, { className: "grid min-w-0 grid-cols-1 items-center gap-0 md:grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] md:gap-3", children: [_jsxs(BreadcrumbItem, { className: "min-w-0 gap-2", "data-scope": "", children: [_jsx("span", { className: "min-w-0 flex-1 md:flex-initial", children: _jsx(ScopeSwitcher, { ...switcher, variant: "navigation" }) }), step.status ? (_jsx("span", { className: "hidden shrink-0 md:inline-flex", children: _jsx(Status, { status: step.status }) })) : null, close ? (_jsx(ButtonLink, { "aria-label": close.label, render: close.link, size: "icon", variant: "ghost", children: _jsx(XIcon, { "aria-hidden": "true" }) })) : null] }), current && !current.scope ? (_jsxs(BreadcrumbItem, { className: "min-w-0 flex-wrap justify-center gap-x-3 gap-y-1 md:flex-nowrap md:justify-self-center", children: [step.status ? (_jsx("span", { className: "inline-flex shrink-0 md:hidden", children: _jsx(Status, { status: step.status }) })) : null, _jsx(BreadcrumbPage, { className: "block min-w-0 truncate", children: current.label })] })) : null] }) }));
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* The page's title row, drawn from its title: `ProductShell` draws it from its `title`, and a
|
|
536
|
+
* product whose router resolves the title beside the page renders it in that region, or with
|
|
537
|
+
* `loading` while the region resolves. It carries the page's `PageActions`.
|
|
538
|
+
*/
|
|
539
|
+
export function ProductShellTitle(props) {
|
|
540
|
+
const focusHeading = use(ProductShellContext)?.focusHeading;
|
|
541
|
+
// A choice in the column waits for the new page's heading, which may arrive after the page.
|
|
542
|
+
useEffect(() => focusHeading?.(), [focusHeading]);
|
|
543
|
+
const headingProps = { tabIndex: -1, id: PRODUCT_SHELL_HEADING_ID };
|
|
544
|
+
if (!props.loading && props.unseen) {
|
|
545
|
+
return _jsx(PageHeader, { headingProps: headingProps, title: props.text, unseen: true });
|
|
546
|
+
}
|
|
547
|
+
// The page's whole column follows its title's: the shell narrows to the settings column while
|
|
548
|
+
// a title in it stands first, so the title and the page share one edge from the first paint.
|
|
549
|
+
return (_jsx("div", { "data-page-column": props.column ?? "full", children: props.loading ? (_jsxs("div", { "aria-busy": "true", className: "grid min-h-9 gap-2", "data-slot": "product-shell-title-skeleton", children: [_jsx(Skeleton, { className: "h-7 w-48" }), _jsx(Skeleton, { className: "h-4 w-80 max-w-full" })] })) : (_jsx(PageHeader, { description: props.description, headingProps: headingProps, title: props.text })) }));
|
|
550
|
+
}
|
|
551
|
+
/** Marks the band as pending, which keeps the page unseen; a heading waiting for focus takes it once the band resolves. */
|
|
552
|
+
function PendingTabs() {
|
|
553
|
+
const focusHeading = use(ProductShellContext)?.focusHeading;
|
|
554
|
+
useEffect(() => () => focusHeading?.(), [focusHeading]);
|
|
555
|
+
return _jsx("span", { "data-tabs-pending": "", hidden: true });
|
|
73
556
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
557
|
+
/**
|
|
558
|
+
* The band of an area's or an object's sections under the top bar: `ProductShell` draws it from
|
|
559
|
+
* its `tabs`, and a product whose router resolves the sections beside the page renders it in that
|
|
560
|
+
* region; `loading` holds the band's place, and `pending`, for a band that only some viewers have,
|
|
561
|
+
* draws nothing and keeps the page unseen until the viewer is known.
|
|
562
|
+
*/
|
|
563
|
+
export function ProductShellTabs(props) {
|
|
564
|
+
if (props.pending)
|
|
565
|
+
return _jsx(PendingTabs, {});
|
|
566
|
+
if (props.loading) {
|
|
567
|
+
return (_jsxs("div", { "aria-busy": "true", className: "flex gap-6 border-b bg-background px-6 py-4 md:px-8", "data-slot": "product-shell-tabs-skeleton", children: [_jsx(Skeleton, { className: "h-3 w-24" }), _jsx(Skeleton, { className: "h-3 w-20" }), _jsx(Skeleton, { className: "h-3 w-24" })] }));
|
|
568
|
+
}
|
|
569
|
+
return (_jsx(TabsNav, { "aria-label": props.label, band: true, children: props.tabs.map((tab) => (_jsx(TabsLink, { current: tab.id === props.current, render: tab.link, children: tab.label }, tab.id))) }));
|
|
78
570
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
571
|
+
/**
|
|
572
|
+
* The frame's loading state, while the product reads what the frame needs, such as who is signed
|
|
573
|
+
* in: the column at the width it will open at, the top bar and the workspace, with placeholders
|
|
574
|
+
* where the home, Find, the places, the band, the account and the path will be, and no word.
|
|
575
|
+
*/
|
|
576
|
+
export function ProductShellSkeleton({ width, }) {
|
|
577
|
+
const column = width.collapsed ? SIDEBAR_WIDTH_ICON : width.value;
|
|
578
|
+
const narrow = width.collapsed;
|
|
579
|
+
return (_jsxs(SkeletonRegion, { busy: true, className: "flex h-svh min-h-0 w-full overflow-hidden bg-background", "data-slot": "product-shell-skeleton", children: [_jsxs("div", { className: "hidden min-h-0 shrink-0 flex-col border-r bg-sidebar md:flex", style: { width: column }, children: [_jsx("div", { className: "box-content flex h-14 shrink-0 items-center border-b px-3", children: narrow ? null : _jsx(Skeleton, { className: "h-[18px] w-44 max-w-full" }) }), _jsx("div", { className: "shrink-0 p-2", children: _jsx(Skeleton, { className: "h-9 w-full" }) }), _jsx("div", { className: "grid min-h-0 flex-1 content-start gap-1 p-2", children: Array.from({ length: 5 }, (_, row) => (_jsxs("div", { className: "flex h-control-height items-center gap-2 px-2", children: [_jsx(Skeleton, { className: "size-4 shrink-0" }), narrow ? null : _jsx(Skeleton, { className: "h-4 w-24" })] }, row))) }), _jsxs("div", { className: "flex h-12 shrink-0 items-center gap-2 border-t px-4", children: [_jsx(Skeleton, { className: "size-4 shrink-0" }), narrow ? null : _jsx(Skeleton, { className: "h-4 w-24" })] }), _jsxs("div", { className: "flex h-14 shrink-0 items-center gap-2 border-t px-4", children: [_jsx(Skeleton, { className: "size-5 shrink-0", shape: "circle" }), narrow ? null : _jsx(Skeleton, { className: "h-4 w-28" })] })] }), _jsxs("div", { className: "grid min-h-0 min-w-0 flex-1 grid-rows-[auto_minmax(0,1fr)] gap-(--nc-guide) bg-border", children: [_jsx("div", { className: "flex min-h-14 items-center justify-center bg-background px-3", children: _jsx(Skeleton, { className: "h-4 w-40" }) }), _jsx("div", { className: "bg-(--nc-material-workspace)" })] })] }));
|
|
83
580
|
}
|