@bigpixelrocket/uiok 0.2.2 → 0.3.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 +62 -1
- package/dist/button/TextLink.d.ts +27 -0
- package/dist/button/TextLink.js +15 -0
- package/dist/button/button.css +48 -0
- package/dist/button/index.d.ts +2 -1
- package/dist/button/index.js +2 -1
- package/dist/charts/Sparkline.d.ts +20 -0
- package/dist/charts/Sparkline.js +12 -0
- package/dist/charts/Sparkline.logic.d.ts +9 -0
- package/dist/charts/Sparkline.logic.js +27 -0
- package/dist/charts/charts.css +17 -0
- package/dist/charts/index.d.ts +2 -0
- package/dist/charts/index.js +2 -0
- package/dist/dialog/ConfirmDialog.d.ts +17 -1
- package/dist/dialog/ConfirmDialog.js +10 -4
- package/dist/dialog/DialogLists.d.ts +8 -1
- package/dist/dialog/DialogLists.js +3 -2
- package/dist/dialog/ModalDialog.d.ts +8 -0
- package/dist/dialog/ModalDialog.js +4 -2
- package/dist/dialog/ProgressDialog.d.ts +34 -0
- package/dist/dialog/ProgressDialog.js +40 -0
- package/dist/dialog/TypedNameDialog.d.ts +36 -0
- package/dist/dialog/TypedNameDialog.js +17 -0
- package/dist/dialog/index.d.ts +5 -2
- package/dist/dialog/index.js +4 -1
- package/dist/field/Switch.d.ts +26 -0
- package/dist/field/Switch.js +20 -0
- package/dist/field/field.css +110 -2
- package/dist/field/index.d.ts +3 -2
- package/dist/field/index.js +3 -2
- package/dist/filter/filter.css +16 -0
- package/dist/frame/AppRoot.d.ts +44 -0
- package/dist/frame/AppRoot.js +26 -0
- package/dist/frame/Dock.d.ts +88 -0
- package/dist/frame/Dock.js +129 -0
- package/dist/frame/FilterChips.d.ts +28 -0
- package/dist/frame/FilterChips.js +14 -0
- package/dist/frame/PageParts.d.ts +69 -0
- package/dist/frame/PageParts.js +60 -0
- package/dist/frame/PaneSplit.d.ts +74 -0
- package/dist/frame/PaneSplit.js +197 -0
- package/dist/frame/SidebarResizer.d.ts +35 -0
- package/dist/frame/SidebarResizer.js +43 -0
- package/dist/frame/StatusNotice.d.ts +20 -0
- package/dist/frame/StatusNotice.js +13 -0
- package/dist/frame/Tree.d.ts +140 -0
- package/dist/frame/Tree.js +141 -0
- package/dist/frame/TreeToggle.d.ts +18 -0
- package/dist/frame/TreeToggle.js +17 -0
- package/dist/frame/WindowFrame.d.ts +57 -0
- package/dist/frame/WindowFrame.js +19 -0
- package/dist/frame/frame.css +801 -0
- package/dist/frame/index.d.ts +22 -0
- package/dist/frame/index.js +22 -0
- package/dist/frame/sharedRef.d.ts +8 -0
- package/dist/frame/sharedRef.js +26 -0
- package/dist/grid/DataGrid.d.ts +10 -2
- package/dist/grid/DataGrid.js +47 -13
- package/dist/grid/DataGrid.logic.d.ts +16 -0
- package/dist/grid/DataGrid.logic.js +28 -0
- package/dist/grid/grid.css +128 -4
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/labels/UiokLabels.d.ts +6 -0
- package/dist/labels/UiokLabels.js +5 -1
- package/dist/labels/dialog.d.ts +12 -0
- package/dist/labels/dialog.js +7 -1
- package/dist/labels/index.d.ts +2 -0
- package/dist/labels/index.js +2 -0
- package/dist/labels/keys.js +2 -0
- package/dist/labels/paneTabs.d.ts +27 -0
- package/dist/labels/paneTabs.js +10 -0
- package/dist/labels/selectAll.d.ts +4 -1
- package/dist/labels/selectAll.js +1 -1
- package/dist/labels/settings.d.ts +46 -0
- package/dist/labels/settings.js +29 -0
- package/dist/legend/KeyLegendStrip.d.ts +9 -1
- package/dist/legend/KeyLegendStrip.js +119 -5
- package/dist/legend/legend.css +52 -0
- package/dist/listing/EmptyState.d.ts +40 -0
- package/dist/listing/EmptyState.js +14 -0
- package/dist/listing/Listing.d.ts +23 -5
- package/dist/listing/Listing.js +11 -8
- package/dist/listing/index.d.ts +3 -1
- package/dist/listing/index.js +3 -1
- package/dist/listing/listing.css +172 -5
- package/dist/log/LogWell.d.ts +34 -0
- package/dist/log/LogWell.js +39 -0
- package/dist/log/LogWell.logic.d.ts +16 -0
- package/dist/log/LogWell.logic.js +26 -0
- package/dist/log/index.d.ts +8 -0
- package/dist/log/index.js +8 -0
- package/dist/log/log.css +57 -0
- package/dist/pane/Pane.d.ts +49 -0
- package/dist/pane/Pane.js +17 -0
- package/dist/pane/PaneActions.d.ts +3 -1
- package/dist/pane/PaneActions.js +6 -5
- package/dist/pane/PaneKeys.d.ts +10 -3
- package/dist/pane/PaneKeys.js +26 -7
- package/dist/pane/PaneTabs.d.ts +92 -0
- package/dist/pane/PaneTabs.js +326 -0
- package/dist/pane/PaneTabs.logic.d.ts +97 -0
- package/dist/pane/PaneTabs.logic.js +158 -0
- package/dist/pane/index.d.ts +7 -1
- package/dist/pane/index.js +7 -1
- package/dist/pane/panetabs.css +408 -0
- package/dist/pane/usePaneKeys.js +9 -11
- package/dist/pane/useTabDrag.d.ts +49 -0
- package/dist/pane/useTabDrag.js +306 -0
- package/dist/segmented/SegmentedChoice.d.ts +8 -1
- package/dist/segmented/SegmentedChoice.js +7 -4
- package/dist/shell/AboutWindow.d.ts +21 -0
- package/dist/shell/AboutWindow.js +10 -0
- package/dist/shell/LanguageChoice.d.ts +27 -0
- package/dist/shell/LanguageChoice.js +17 -0
- package/dist/shell/LoadFailure.d.ts +22 -0
- package/dist/shell/LoadFailure.js +15 -0
- package/dist/shell/Lockup.d.ts +52 -0
- package/dist/shell/Lockup.js +30 -0
- package/dist/shell/SettingsDialog.d.ts +97 -0
- package/dist/shell/SettingsDialog.js +219 -0
- package/dist/shell/SettingsDialog.logic.d.ts +33 -0
- package/dist/shell/SettingsDialog.logic.js +42 -0
- package/dist/shell/SettingsFiles.d.ts +55 -0
- package/dist/shell/SettingsFiles.js +30 -0
- package/dist/shell/SettingsPageKeys.d.ts +42 -0
- package/dist/shell/SettingsPageKeys.js +70 -0
- package/dist/shell/SettingsSubsection.d.ts +34 -0
- package/dist/shell/SettingsSubsection.js +30 -0
- package/dist/shell/SignIn.d.ts +61 -0
- package/dist/shell/SignIn.js +36 -0
- package/dist/shell/ThemePicker.d.ts +74 -0
- package/dist/shell/ThemePicker.js +96 -0
- package/dist/shell/ThemePicker.logic.d.ts +13 -0
- package/dist/shell/ThemePicker.logic.js +26 -0
- package/dist/shell/TitleBar.d.ts +44 -0
- package/dist/shell/TitleBar.js +23 -0
- package/dist/shell/UpdatePill.d.ts +26 -0
- package/dist/shell/UpdatePill.js +17 -0
- package/dist/shell/Updates.d.ts +99 -0
- package/dist/shell/Updates.js +72 -0
- package/dist/shell/index.d.ts +27 -0
- package/dist/shell/index.js +27 -0
- package/dist/shell/shell.css +243 -4
- package/dist/styles.css +10 -0
- package/dist/surface/GroupSwatch.d.ts +22 -0
- package/dist/surface/GroupSwatch.js +15 -0
- package/dist/surface/Tag.d.ts +26 -0
- package/dist/surface/Tag.js +12 -0
- package/dist/surface/index.d.ts +7 -0
- package/dist/surface/index.js +7 -0
- package/dist/surface/surface.css +116 -1
- package/dist/themes/catalog.js +4 -0
- package/dist/themes/themes.generated.css +244 -0
- package/dist/themes/tokens.d.ts +17 -5
- package/dist/themes/tokens.js +75 -1
- package/dist/tokens.css +11 -0
- package/package.json +1 -1
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useCallback, useContext, useId, useLayoutEffect, useMemo, useRef, useSyncExternalStore } from 'react';
|
|
3
|
+
import { ICON_MD } from '../icon/sizes.js';
|
|
4
|
+
import { RowCursorContext } from '../listing/Listing.js';
|
|
5
|
+
import { InListingRowContext, InRowContext } from '../pane/PaneActions.js';
|
|
6
|
+
import { cutTooltip } from '../tooltip/Tooltip.logic.js';
|
|
7
|
+
import { useSharedRef } from './sharedRef.js';
|
|
8
|
+
import { TreeToggle } from './TreeToggle.js';
|
|
9
|
+
const TreeIdContext = createContext(null);
|
|
10
|
+
/** A row's element id in its tree: the tree's prefix and the row's key, made safe for an id. */
|
|
11
|
+
const rowId = (tree, rowKey) => `${tree}-${encodeURIComponent(rowKey)}`;
|
|
12
|
+
const levelStyle = (level) => level > 0 ? { '--tree-level': level } : undefined;
|
|
13
|
+
/**
|
|
14
|
+
* The sidebar's pane, which holds a tree: a pane at the sidebar's width
|
|
15
|
+
* whose rows lay out as the chevron's slot, the node's glyph, its name, and
|
|
16
|
+
* one trailing column. Narrower than its title and its tools side by side,
|
|
17
|
+
* its path bar takes a line for each.
|
|
18
|
+
*/
|
|
19
|
+
export function TreePane({ width, active = false, label, ref, children, ...handlers }) {
|
|
20
|
+
return (_jsx("aside", { "aria-label": label, className: active ? 'pane tree-pane active' : 'pane tree-pane', ref: ref, style: width === undefined ? undefined : { width }, ...handlers, children: children }));
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The tree's rows in the sidebar's scrolling list: the sidebar's home
|
|
24
|
+
* (`data-pane-home="sidebar"`), which `usePaneKeys` hands the focus and
|
|
25
|
+
* finds the sidebar pane by, focusable by script and out of the Tab order.
|
|
26
|
+
* Each row steps in by its level. While the list holds the focus, its
|
|
27
|
+
* active descendant is the cursor row, so a screen reader follows the
|
|
28
|
+
* cursor the keys move.
|
|
29
|
+
*/
|
|
30
|
+
export function TreeList({ label, ref, children, ...handlers }) {
|
|
31
|
+
const tree = useId();
|
|
32
|
+
const cursor = useContext(RowCursorContext);
|
|
33
|
+
const [list, attach] = useSharedRef(ref);
|
|
34
|
+
// Names the cursor row only while it is drawn here: a row a filter took
|
|
35
|
+
// away, or a cursor on another pane's row, leaves no active descendant
|
|
36
|
+
// pointing at nothing.
|
|
37
|
+
const sync = useCallback(() => {
|
|
38
|
+
const element = list.current;
|
|
39
|
+
if (element === null)
|
|
40
|
+
return;
|
|
41
|
+
const key = cursor.current();
|
|
42
|
+
const id = key === null ? null : rowId(tree, key);
|
|
43
|
+
// One lookup by id (the tree's prefix makes it unique in the document),
|
|
44
|
+
// never a scan of the rows.
|
|
45
|
+
const row = id === null ? null : element.ownerDocument.getElementById(id);
|
|
46
|
+
const drawnRow = row !== null && element.contains(row);
|
|
47
|
+
if (drawnRow && id !== null)
|
|
48
|
+
element.setAttribute('aria-activedescendant', id);
|
|
49
|
+
else
|
|
50
|
+
element.removeAttribute('aria-activedescendant');
|
|
51
|
+
}, [cursor, list, tree]);
|
|
52
|
+
// After every render and on every cursor move; and once a commit has put
|
|
53
|
+
// rows in or taken them out, by whatever state drew them: one microtask
|
|
54
|
+
// per commit, however many rows came or went, calling the latest sync.
|
|
55
|
+
const latestSync = useRef(sync);
|
|
56
|
+
const pending = useRef(false);
|
|
57
|
+
useLayoutEffect(() => {
|
|
58
|
+
latestSync.current = sync;
|
|
59
|
+
sync();
|
|
60
|
+
return cursor.subscribe(sync);
|
|
61
|
+
});
|
|
62
|
+
const scope = useMemo(() => ({
|
|
63
|
+
id: tree,
|
|
64
|
+
rowsChanged: () => {
|
|
65
|
+
if (pending.current)
|
|
66
|
+
return;
|
|
67
|
+
pending.current = true;
|
|
68
|
+
queueMicrotask(() => {
|
|
69
|
+
pending.current = false;
|
|
70
|
+
latestSync.current();
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}), [tree]);
|
|
74
|
+
return (_jsx("div", { "aria-label": label, className: "pane-list tree", "data-pane-home": "sidebar", ref: attach, role: "tree", tabIndex: -1, ...handlers, children: _jsx(TreeIdContext.Provider, { value: scope, children: children }) }));
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* One row of a sidebar's tree: the chevron's slot, the glyph, the name (cut
|
|
78
|
+
* with an ellipsis, whole in its tooltip) with its quieter detail, then its
|
|
79
|
+
* trailing column and its own tool. Like a listing's `Row`, it follows the
|
|
80
|
+
* pane's cursor (`RowCursorContext`), wearing the cursor row's look and
|
|
81
|
+
* `aria-current`; the pointer moving over it or the focus entering it moves
|
|
82
|
+
* the cursor there. Its controls leave the Tab order, since the tree's keys
|
|
83
|
+
* run them. The expansion and its keys stay the host's.
|
|
84
|
+
*/
|
|
85
|
+
export function TreeRow({ rowKey, level = 0, kind = 'node', toggle, glyph, name, detail, trailing, tool, marked = false, onOpen, focusable = false }) {
|
|
86
|
+
const cursor = useContext(RowCursorContext);
|
|
87
|
+
const tree = useContext(TreeIdContext);
|
|
88
|
+
const current = useSyncExternalStore(cursor.subscribe, () => cursor.current() === rowKey);
|
|
89
|
+
useLayoutEffect(() => {
|
|
90
|
+
cursor.rowsChanged?.();
|
|
91
|
+
tree?.rowsChanged();
|
|
92
|
+
return () => {
|
|
93
|
+
cursor.rowsChanged?.();
|
|
94
|
+
tree?.rowsChanged();
|
|
95
|
+
};
|
|
96
|
+
}, [cursor, rowKey, tree]);
|
|
97
|
+
const classes = [
|
|
98
|
+
'row',
|
|
99
|
+
kind === 'band' ? 'tree-band' : '',
|
|
100
|
+
kind === 'group' ? 'tree-group' : '',
|
|
101
|
+
current ? 'cursor' : '',
|
|
102
|
+
marked ? 'marked' : ''
|
|
103
|
+
]
|
|
104
|
+
.filter(Boolean)
|
|
105
|
+
.join(' ');
|
|
106
|
+
return (_jsx(InListingRowContext.Provider, { value: true, children: _jsx(InRowContext.Provider, { value: true, children: _jsxs("div", { "aria-current": current ? 'true' : undefined, "aria-expanded": toggle === undefined ? undefined : toggle.open, "aria-level": level + 1, "aria-selected": marked, className: classes, "data-row-key": rowKey, id: tree === null ? undefined : rowId(tree.id, rowKey), onClick: onOpen, onFocus: () => cursor.point(rowKey), onPointerMove: () => {
|
|
107
|
+
if (!current)
|
|
108
|
+
cursor.point(rowKey);
|
|
109
|
+
}, role: "treeitem", style: levelStyle(level), tabIndex: focusable ? (current ? 0 : -1) : undefined, children: [toggle === undefined ? (_jsx("span", { "aria-hidden": true, className: "row-icon" })) : (_jsx(TreeToggle, { label: toggle.label, onToggle: toggle.onToggle, open: toggle.open })), _jsx("span", { "aria-hidden": true, className: "tree-glyph", children: glyph }), _jsxs("span", { className: "row-name tree-name", ...(typeof name === 'string' && detail === undefined ? cutTooltip(name) : {}), children: [name, detail === undefined ? null : (_jsxs(_Fragment, { children: [' ', _jsx("span", { className: "tree-detail", children: detail })] }))] }), _jsxs("span", { className: "row-meta align-right", children: [trailing, tool === undefined ? null : _jsx("span", { className: "tree-row-tool", children: tool })] })] }) }) }));
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* A row of a tree that is not a node, at its level's indent in the small
|
|
113
|
+
* size: a filter field, a pager, a note, a heading, or a failed read with
|
|
114
|
+
* its action.
|
|
115
|
+
*/
|
|
116
|
+
export function TreeTool({ kind = 'tool', level = 0, icon: Icon, text, cursor = false, children }) {
|
|
117
|
+
const classes = [
|
|
118
|
+
'tree-tool',
|
|
119
|
+
kind === 'note' ? 'tree-note' : '',
|
|
120
|
+
kind === 'heading' ? 'tree-heading' : '',
|
|
121
|
+
kind === 'danger' ? 'danger' : '',
|
|
122
|
+
cursor ? 'cursor' : ''
|
|
123
|
+
]
|
|
124
|
+
.filter(Boolean)
|
|
125
|
+
.join(' ');
|
|
126
|
+
return (_jsxs("div", { className: classes, role: kind === 'danger' ? 'alert' : undefined, style: levelStyle(level), children: [Icon === undefined ? null : (_jsx("span", { "aria-hidden": true, className: "tree-note-glyph", children: _jsx(Icon, { size: ICON_MD }) })), text === undefined ? null : _jsx("span", { className: "tree-note-text", children: text }), children] }));
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* A tree's filter field: a bare field that fills its `TreeTool` row, the
|
|
130
|
+
* row underlined in the accent while the field holds the keyboard.
|
|
131
|
+
*/
|
|
132
|
+
export function TreeFilterInput({ value, onChange, label, placeholder, onKeyDown, ref }) {
|
|
133
|
+
return (_jsx("input", { "aria-label": label, className: "tree-filter-input", onChange: (event) => onChange(event.currentTarget.value), onKeyDown: onKeyDown, placeholder: placeholder, ref: ref, spellCheck: false, type: "text", value: value }));
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* A sidebar with nothing to list, saying so as a quiet row in the rows'
|
|
137
|
+
* place: from where a row's icon starts, dim, one row high.
|
|
138
|
+
*/
|
|
139
|
+
export function SidebarEmpty({ children }) {
|
|
140
|
+
return _jsx("p", { className: "space-nav-empty", children: children });
|
|
141
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
/** Props for {@link TreeToggle}. */
|
|
3
|
+
export interface TreeToggleProps {
|
|
4
|
+
/** Whether the row's children show. */
|
|
5
|
+
readonly open: boolean;
|
|
6
|
+
/** Opens or closes the row's children. */
|
|
7
|
+
readonly onToggle: () => void;
|
|
8
|
+
/** The button's accessible name ("Expand shop", "Collapse shop"). */
|
|
9
|
+
readonly label: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A tree row's disclosure chevron, in the row's first column (`tree-chev`):
|
|
13
|
+
* right while closed, down while open. A press toggles the row's children
|
|
14
|
+
* and never opens the row itself; it leaves the focus where it was, as a
|
|
15
|
+
* row's click does, and stays out of the Tab order, since the tree's keys
|
|
16
|
+
* open and close a row.
|
|
17
|
+
*/
|
|
18
|
+
export declare function TreeToggle({ open, onToggle, label }: TreeToggleProps): ReactElement;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronDown, ChevronRight } from 'lucide-react';
|
|
3
|
+
import { ICON_MD } from '../icon/sizes.js';
|
|
4
|
+
/**
|
|
5
|
+
* A tree row's disclosure chevron, in the row's first column (`tree-chev`):
|
|
6
|
+
* right while closed, down while open. A press toggles the row's children
|
|
7
|
+
* and never opens the row itself; it leaves the focus where it was, as a
|
|
8
|
+
* row's click does, and stays out of the Tab order, since the tree's keys
|
|
9
|
+
* open and close a row.
|
|
10
|
+
*/
|
|
11
|
+
export function TreeToggle({ open, onToggle, label }) {
|
|
12
|
+
const Icon = open ? ChevronDown : ChevronRight;
|
|
13
|
+
return (_jsx("button", { "aria-expanded": open, "aria-label": label, className: "tree-chev row-icon", onClick: (event) => {
|
|
14
|
+
event.stopPropagation();
|
|
15
|
+
onToggle();
|
|
16
|
+
}, onMouseDown: (event) => event.preventDefault(), tabIndex: -1, type: "button", children: _jsx(Icon, { "aria-hidden": true, size: ICON_MD }) }));
|
|
17
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode, Ref } from 'react';
|
|
2
|
+
import type { RegionHandlers } from '../pane/Pane.js';
|
|
3
|
+
/** Whether a slot was given something to draw: idiomatic `cond && <Part />` passes false for none. */
|
|
4
|
+
export declare const drawn: (node: ReactNode) => boolean;
|
|
5
|
+
/**
|
|
6
|
+
* The one element a host keeps its sidebar and main pane in (for its keys
|
|
7
|
+
* or its drop zone): its handlers and ref. It draws no box, so the parts
|
|
8
|
+
* inside it keep their places in the frame's grid.
|
|
9
|
+
*/
|
|
10
|
+
export interface WindowFrameGroup extends RegionHandlers {
|
|
11
|
+
readonly ref?: Ref<HTMLDivElement>;
|
|
12
|
+
}
|
|
13
|
+
/** Props for {@link WindowFrame}. */
|
|
14
|
+
export interface WindowFrameProps {
|
|
15
|
+
/** The title bar at the band's leading end (`TitleBar`), as wide as the sidebar. */
|
|
16
|
+
readonly brand: ReactNode;
|
|
17
|
+
/** The sidebar's pane (a `tree-pane`); none hides it, and the main pane takes the window's width. */
|
|
18
|
+
readonly sidebar?: ReactNode;
|
|
19
|
+
/** The sidebar's edge (`SidebarResizer`), beside it while it shows. */
|
|
20
|
+
readonly resizer?: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* The sidebar's width in pixels, which the title bar matches, and which it
|
|
23
|
+
* keeps while the sidebar is hidden so no tab moves.
|
|
24
|
+
*/
|
|
25
|
+
readonly sidebarWidth: number;
|
|
26
|
+
/** The main pane, whose tab row rises into the band beside the title bar. */
|
|
27
|
+
readonly main: ReactNode;
|
|
28
|
+
/** A strip that takes its turn under the main pane (files being imported). */
|
|
29
|
+
readonly tray?: ReactNode;
|
|
30
|
+
/** The dock under the main pane (a console, a log). */
|
|
31
|
+
readonly dock?: ReactNode;
|
|
32
|
+
/** The key legend across the window's foot (`KeyLegendStrip`). */
|
|
33
|
+
readonly legend?: ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* What stands at the band's trailing end, out of the drag region (the
|
|
36
|
+
* `UpdatePill`), for a window whose main pane has no tabs; a pane with
|
|
37
|
+
* tabs takes it as `PaneTabs`' `trailing` instead.
|
|
38
|
+
*/
|
|
39
|
+
readonly trailing?: ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* Gathers the sidebar, its edge, the main pane, the tray, and the dock in
|
|
42
|
+
* one element with these handlers; none leaves them the frame's own children.
|
|
43
|
+
*/
|
|
44
|
+
readonly group?: WindowFrameGroup;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The window's grid: the top band (the title bar at the sidebar's width,
|
|
48
|
+
* then the main pane's tabs), the sidebar and the main pane side by side on
|
|
49
|
+
* the ground, the tray and the dock under the main pane while they show,
|
|
50
|
+
* and the key legend across the foot. Each part fills its slot; the band's
|
|
51
|
+
* empty end is the window's drag region. Hiding the sidebar gives its room
|
|
52
|
+
* to the main pane, the tray, and the dock, and the main pane's tabs keep
|
|
53
|
+
* their place beside the title bar. The frame is the space's root, in the
|
|
54
|
+
* listing look: a column the panel's height that sizes every box by its
|
|
55
|
+
* border and resets its buttons, code, fieldsets, and legends.
|
|
56
|
+
*/
|
|
57
|
+
export declare function WindowFrame({ brand, sidebar, resizer, sidebarWidth, main, tray, dock, legend, trailing, group }: WindowFrameProps): ReactElement;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/** Whether a slot was given something to draw: idiomatic `cond && <Part />` passes false for none. */
|
|
3
|
+
export const drawn = (node) => node !== null && node !== undefined && node !== false && node !== '';
|
|
4
|
+
/**
|
|
5
|
+
* The window's grid: the top band (the title bar at the sidebar's width,
|
|
6
|
+
* then the main pane's tabs), the sidebar and the main pane side by side on
|
|
7
|
+
* the ground, the tray and the dock under the main pane while they show,
|
|
8
|
+
* and the key legend across the foot. Each part fills its slot; the band's
|
|
9
|
+
* empty end is the window's drag region. Hiding the sidebar gives its room
|
|
10
|
+
* to the main pane, the tray, and the dock, and the main pane's tabs keep
|
|
11
|
+
* their place beside the title bar. The frame is the space's root, in the
|
|
12
|
+
* listing look: a column the panel's height that sizes every box by its
|
|
13
|
+
* border and resets its buttons, code, fieldsets, and legends.
|
|
14
|
+
*/
|
|
15
|
+
export function WindowFrame({ brand, sidebar = null, resizer = null, sidebarWidth, main, tray = null, dock = null, legend = null, trailing = null, group }) {
|
|
16
|
+
const shown = drawn(sidebar);
|
|
17
|
+
const parts = (_jsxs(_Fragment, { children: [shown ? _jsx("div", { className: "window-frame-slot window-frame-sidebar", children: sidebar }) : null, shown ? resizer : null, _jsx("div", { className: "window-frame-slot window-frame-main", children: main }), drawn(tray) ? _jsx("div", { className: "window-frame-slot window-frame-tray", children: tray }) : null, drawn(dock) ? _jsx("div", { className: "window-frame-slot window-frame-dock", children: dock }) : null] }));
|
|
18
|
+
return (_jsxs("div", { className: "window-frame space-root listing-root", "data-sidebar": shown ? 'shown' : 'hidden', style: { '--window-band-width': `${sidebarWidth}px` }, children: [_jsxs("div", { className: "window-frame-band", children: [_jsx("div", { className: "window-frame-band-lead", children: brand }), _jsx("span", { "aria-hidden": true, className: "window-frame-band-rest" }), drawn(trailing) ? _jsx("div", { className: "shell-trailing", children: trailing }) : null] }), group === undefined ? (parts) : (_jsx("div", { className: "window-frame-group", ...group, children: parts })), drawn(legend) ? _jsx("div", { className: "window-frame-legend", children: legend }) : null] }));
|
|
19
|
+
}
|