@parallelworks/ui 0.50.0 → 0.52.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/README.md +204 -18
- package/dist/ai/agent/toolStrings.d.ts +2 -0
- package/dist/ai/agent/toolStrings.js +20 -18
- package/dist/ai/ai.css +12 -0
- package/dist/ai/components/AllocationSelector.js +5 -1
- package/dist/ai/components/AttachmentManager.js +51 -42
- package/dist/ai/components/AttachmentUpload.d.ts +4 -2
- package/dist/ai/components/AttachmentUpload.js +9 -9
- package/dist/ai/components/BlockedGroupBanner.js +8 -14
- package/dist/ai/components/BranchNavigator.js +11 -12
- package/dist/ai/components/ChatEmptyState.js +12 -19
- package/dist/ai/components/ChatInput.d.ts +4 -3
- package/dist/ai/components/ChatInput.js +27 -13
- package/dist/ai/components/ChatMessage.js +45 -121
- package/dist/ai/components/ChatMessageList.d.ts +5 -2
- package/dist/ai/components/ChatMessageList.js +89 -51
- package/dist/ai/components/ChatSidebar.js +11 -7
- package/dist/ai/components/ChatThread.js +1 -13
- package/dist/ai/components/DragOverlay.js +3 -3
- package/dist/ai/components/MessageAttachments.d.ts +10 -0
- package/dist/ai/components/MessageAttachments.js +78 -0
- package/dist/ai/components/ModelSelector.js +4 -4
- package/dist/ai/components/PastedText.js +2 -2
- package/dist/ai/components/ProviderIssueBanner.js +19 -23
- package/dist/ai/components/ShareDialog.js +2 -2
- package/dist/ai/components/agent/ActivityLine.d.ts +0 -2
- package/dist/ai/components/agent/ActivityLine.js +8 -51
- package/dist/ai/components/agent/AgentMessageParts.js +117 -56
- package/dist/ai/core/ChatProvider.d.ts +16 -5
- package/dist/ai/core/ChatProvider.js +41 -8
- package/dist/ai/core/config.js +4 -3
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.js +3 -3
- package/dist/ai/strings.d.ts +29 -3
- package/dist/ai/strings.js +81 -26
- package/dist/ai/types.d.ts +4 -0
- package/dist/ai/ui/Notice.d.ts +2 -2
- package/dist/ai/ui/Notice.js +29 -62
- package/dist/ai/ui/sidebar.d.ts +5 -3
- package/dist/ai/ui/sidebar.js +21 -9
- package/dist/components/ActionMenu.d.ts +1 -0
- package/dist/components/ActionMenu.js +6 -1
- package/dist/components/AppLink.d.ts +26 -0
- package/dist/components/AppLink.js +51 -0
- package/dist/components/Avatar.d.ts +2 -1
- package/dist/components/Avatar.js +4 -2
- package/dist/components/Button.d.ts +15 -5
- package/dist/components/Button.js +47 -40
- package/dist/components/Callout.d.ts +31 -7
- package/dist/components/Callout.js +51 -24
- package/dist/components/Card.d.ts +11 -6
- package/dist/components/Card.js +14 -8
- package/dist/components/Checkbox.js +2 -1
- package/dist/components/ColorInput.js +5 -3
- package/dist/components/Combobox.js +49 -19
- package/dist/components/ConfirmModal.d.ts +19 -8
- package/dist/components/ConfirmModal.js +31 -53
- package/dist/components/CopyButton.d.ts +38 -0
- package/dist/components/CopyButton.js +68 -0
- package/dist/components/CreateModal.js +118 -111
- package/dist/components/DatePicker.js +12 -8
- package/dist/components/DescriptionList.d.ts +51 -17
- package/dist/components/DescriptionList.js +117 -31
- package/dist/components/Disclosure.js +1 -1
- package/dist/components/Drawer.js +10 -16
- package/dist/components/Field.d.ts +15 -5
- package/dist/components/Field.js +41 -9
- package/dist/components/IconButton.d.ts +14 -5
- package/dist/components/IconButton.js +25 -14
- package/dist/components/InfoTip.d.ts +4 -1
- package/dist/components/InfoTip.js +2 -1
- package/dist/components/Input.d.ts +14 -8
- package/dist/components/Input.js +46 -31
- package/dist/components/Loader.js +1 -1
- package/dist/components/MenuEntries.d.ts +43 -12
- package/dist/components/MenuEntries.js +34 -19
- package/dist/components/Meter.js +5 -4
- package/dist/components/Modal.d.ts +28 -4
- package/dist/components/Modal.js +37 -14
- package/dist/components/Overview.d.ts +20 -12
- package/dist/components/Overview.js +14 -9
- package/dist/components/PageHeader.d.ts +47 -65
- package/dist/components/PageHeader.js +275 -153
- package/dist/components/PageHeaderAction.d.ts +67 -0
- package/dist/components/PageHeaderAction.js +107 -0
- package/dist/components/Pagination.js +6 -16
- package/dist/components/Popover.js +3 -2
- package/dist/components/Provider.d.ts +79 -19
- package/dist/components/Provider.js +140 -130
- package/dist/components/Radio.js +2 -1
- package/dist/components/RefreshButton.js +7 -8
- package/dist/components/RequiredMark.js +1 -1
- package/dist/components/RunStatusIcon.js +2 -2
- package/dist/components/Section.js +1 -1
- package/dist/components/Select.d.ts +4 -9
- package/dist/components/Select.js +24 -11
- package/dist/components/SettingModeOption.d.ts +1 -1
- package/dist/components/SettingModeOption.js +7 -1
- package/dist/components/SettingsCard.d.ts +5 -3
- package/dist/components/SettingsCard.js +27 -20
- package/dist/components/Slider.js +1 -1
- package/dist/components/StatusBadge.js +2 -2
- package/dist/components/StatusIcons.js +2 -2
- package/dist/components/Switch.js +5 -4
- package/dist/components/Table.d.ts +30 -20
- package/dist/components/Table.js +50 -73
- package/dist/components/Tabs.d.ts +3 -7
- package/dist/components/Tabs.js +6 -10
- package/dist/components/ThemeEditor.js +24 -14
- package/dist/components/Toast.d.ts +11 -3
- package/dist/components/Toast.js +47 -22
- package/dist/components/buttonClasses.js +2 -2
- package/dist/components/comboboxItems.d.ts +4 -0
- package/dist/components/comboboxItems.js +6 -1
- package/dist/components/dismiss.d.ts +12 -0
- package/dist/components/dismiss.js +19 -0
- package/dist/components/fieldBox.d.ts +4 -0
- package/dist/components/fieldBox.js +7 -3
- package/dist/components/floating.d.ts +3 -3
- package/dist/components/floating.js +1 -1
- package/dist/components/markdownCodeBreaks.js +3 -4
- package/dist/components/pageHeaderStore.d.ts +41 -0
- package/dist/components/pageHeaderStore.js +67 -0
- package/dist/components/pathBreaks.d.ts +8 -0
- package/dist/components/pathBreaks.js +28 -0
- package/dist/components/segmented.js +1 -1
- package/dist/components/shortcutKey.d.ts +2 -1
- package/dist/components/shortcutKey.js +19 -2
- package/dist/components/splitter.js +1 -1
- package/dist/components/tone.d.ts +5 -2
- package/dist/components/tone.js +15 -6
- package/dist/components/useCssIsDark.js +40 -18
- package/dist/components/useTheme.js +9 -10
- package/dist/dev.d.ts +9 -0
- package/dist/dev.js +14 -0
- package/dist/editor/Editor.d.ts +3 -2
- package/dist/editor/Editor.js +11 -2
- package/dist/editor/EditorField.d.ts +2 -1
- package/dist/editor/EditorField.js +11 -29
- package/dist/editor/FormCodePanel.d.ts +7 -3
- package/dist/editor/FormCodePanel.js +14 -7
- package/dist/editor/Monaco.d.ts +14 -5
- package/dist/editor/Monaco.js +163 -112
- package/dist/editor/index.d.ts +5 -5
- package/dist/editor/index.js +3 -3
- package/dist/editor/themes.d.ts +8 -5
- package/dist/editor/themes.js +58 -30
- package/dist/editor/yaml.d.ts +6 -2
- package/dist/editor/yaml.js +11 -2
- package/dist/file-explorer/FileExplorer.js +143 -124
- package/dist/file-explorer/FileExplorerContext.js +1 -1
- package/dist/file-explorer/FilePreview/StreamedBadge.js +3 -1
- package/dist/file-explorer/FilePreview/Viewer.js +2 -2
- package/dist/file-explorer/FilePreview/index.js +4 -4
- package/dist/file-explorer/FileRow.js +1 -1
- package/dist/file-explorer/FileRowsWindow.js +34 -3
- package/dist/file-explorer/FileTable.js +3 -1
- package/dist/file-explorer/TreeView.js +37 -14
- package/dist/file-explorer/helpers.d.ts +2 -1
- package/dist/file-explorer/helpers.js +21 -20
- package/dist/file-explorer/toasts.js +27 -19
- package/dist/file-explorer/treeRows.d.ts +6 -0
- package/dist/file-explorer/treeRows.js +19 -1
- package/dist/file-explorer/useNearEnd.js +3 -6
- package/dist/form/Fields/CheckboxGroupField.js +12 -5
- package/dist/form/Fields/DurationField.js +1 -1
- package/dist/form/Fields/LabelField.js +1 -1
- package/dist/form/Fields/ObjectField.d.ts +1 -1
- package/dist/form/Fields/ObjectField.js +3 -2
- package/dist/form/Fields/StringField.js +16 -29
- package/dist/form/Fields/TextAreaField.js +3 -4
- package/dist/form/Form.js +3 -8
- package/dist/form/Wizard/WizardNavigation.js +1 -4
- package/dist/form/Wizard/WizardStepIndicator.js +1 -1
- package/dist/form/Wizard/utils.js +1 -1
- package/dist/form/fieldFrame.d.ts +1 -1
- package/dist/form/fieldFrame.js +2 -2
- package/dist/form/types/fieldComponentTypes.d.ts +2 -1
- package/dist/graph/AnnotationBanner.d.ts +1 -2
- package/dist/graph/AnnotationBanner.js +30 -32
- package/dist/graph/Connectors.js +4 -1
- package/dist/graph/DependencyGraph.js +2 -2
- package/dist/graph/GraphEditor.js +12 -10
- package/dist/graph/GraphEditorDialogs.js +2 -2
- package/dist/graph/GraphNode.js +7 -4
- package/dist/graph/InputDialog.js +1 -1
- package/dist/graph/InputsEditor.js +14 -11
- package/dist/graph/MatrixGroup.js +9 -3
- package/dist/graph/ProblemsButton.js +2 -2
- package/dist/graph/Reveal.js +18 -10
- package/dist/graph/ShortcutsButton.d.ts +11 -2
- package/dist/graph/ShortcutsButton.js +15 -4
- package/dist/graph/TreeView.js +35 -18
- package/dist/graph/WorkflowSettingsDialog.js +1 -1
- package/dist/graph/editorChrome.js +1 -1
- package/dist/graph/editorFields.js +1 -1
- package/dist/graph/editorRows.js +16 -10
- package/dist/graph/editorStrings.d.ts +7 -0
- package/dist/graph/editorStrings.js +8 -1
- package/dist/graph/fieldProblems.js +1 -1
- package/dist/graph/inputRefs.js +1 -1
- package/dist/graph/settingsViews.js +11 -18
- package/dist/graph/stepWith.js +2 -2
- package/dist/icons.d.ts +2 -0
- package/dist/icons.js +4 -2
- package/dist/index.d.ts +12 -12
- package/dist/index.js +16 -16
- package/dist/list/ActionToolbar.d.ts +44 -8
- package/dist/list/ActionToolbar.js +301 -102
- package/dist/list/ListPage.d.ts +15 -23
- package/dist/list/ListPage.js +46 -45
- package/dist/list/ListTable.d.ts +32 -7
- package/dist/list/ListTable.js +48 -12
- package/dist/list/ListViewControls.js +2 -2
- package/dist/list/UserHoverCard.js +7 -15
- package/dist/list/index.d.ts +2 -2
- package/dist/list/index.js +2 -2
- package/dist/list/listSearch.js +12 -10
- package/dist/list/listView.d.ts +10 -1
- package/dist/list/listView.js +15 -1
- package/dist/list/rowMenu.d.ts +2 -2
- package/dist/logviewer/LogViewer.d.ts +4 -2
- package/dist/logviewer/LogViewer.js +88 -70
- package/dist/logviewer/logviewer.css +3 -2
- package/dist/reducedMotion.d.ts +5 -0
- package/dist/reducedMotion.js +20 -0
- package/dist/safeUrl.d.ts +1 -1
- package/dist/safeUrl.js +4 -2
- package/dist/styles/theme.css +24 -10
- package/dist/styles.css +1 -1
- package/dist/theme/derive.d.ts +1 -1
- package/dist/theme/derive.js +46 -21
- package/dist/theme/fit.js +10 -4
- package/package.json +1 -1
- package/dist/components/Breadcrumbs.d.ts +0 -37
- package/dist/components/Breadcrumbs.js +0 -90
- package/dist/components/CopyToClipboard.d.ts +0 -17
- package/dist/components/CopyToClipboard.js +0 -66
- package/dist/components/Sort.d.ts +0 -9
- package/dist/components/Sort.js +0 -42
package/dist/components/Input.js
CHANGED
|
@@ -1,39 +1,52 @@
|
|
|
1
1
|
import { cx } from "../cx.js";
|
|
2
|
-
import { Field, RevealToggle } from "./Field.js";
|
|
3
2
|
import { fieldBox } from "./fieldBox.js";
|
|
3
|
+
import { Field, RevealToggle } from "./Field.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
import {
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { Input } from "@base-ui/react/input";
|
|
6
7
|
//#region src/components/Input.tsx
|
|
7
8
|
/** The Field around a control when it has a label; the control alone when it doesn't. */
|
|
8
|
-
function framed({ label, hint, description, error }, { id, required, disabled }, control) {
|
|
9
|
+
function framed({ label, hint, help, description, error, size }, { id, required, disabled }, control) {
|
|
9
10
|
if (label === void 0) return control(error ? { "aria-invalid": true } : {});
|
|
10
11
|
return /* @__PURE__ */ jsx(Field, {
|
|
11
12
|
label,
|
|
12
13
|
hint,
|
|
14
|
+
help,
|
|
13
15
|
description,
|
|
14
16
|
error,
|
|
15
17
|
required,
|
|
16
18
|
disabled,
|
|
19
|
+
size,
|
|
17
20
|
id,
|
|
18
21
|
children: control
|
|
19
22
|
});
|
|
20
23
|
}
|
|
21
|
-
/**
|
|
22
|
-
|
|
24
|
+
/** The control props joined with the element's own: its own `aria-describedby` stays beside the
|
|
25
|
+
* field's, and its own invalid mark holds when the field sets none. */
|
|
26
|
+
function joined(control, own) {
|
|
27
|
+
return {
|
|
28
|
+
...control,
|
|
29
|
+
"aria-invalid": control["aria-invalid"] ?? own["aria-invalid"],
|
|
30
|
+
"aria-describedby": [own["aria-describedby"], control["aria-describedby"]].filter(Boolean).join(" ") || void 0
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/** A single-line text field. `type="password"` adds a button that shows what was typed. Placed in
|
|
34
|
+
* a Field, it takes the Field's label, description and invalid state. */
|
|
35
|
+
function Input$1({ label, hint, help, description, error, className, mono, size, type, ref, ...props }) {
|
|
23
36
|
const [revealed, setRevealed] = useState(false);
|
|
24
37
|
const secret = type === "password";
|
|
25
38
|
return framed({
|
|
26
39
|
label,
|
|
27
40
|
hint,
|
|
41
|
+
help,
|
|
28
42
|
description,
|
|
29
|
-
error
|
|
43
|
+
error,
|
|
44
|
+
size
|
|
30
45
|
}, props, (control) => {
|
|
31
|
-
const input = /* @__PURE__ */ jsx(
|
|
46
|
+
const input = /* @__PURE__ */ jsx(Input, {
|
|
32
47
|
ref,
|
|
33
48
|
...props,
|
|
34
|
-
...control,
|
|
35
|
-
"aria-invalid": control["aria-invalid"] ?? props["aria-invalid"],
|
|
36
|
-
"aria-describedby": [props["aria-describedby"], control["aria-describedby"]].filter(Boolean).join(" ") || void 0,
|
|
49
|
+
...joined(control, props),
|
|
37
50
|
type: secret && revealed ? "text" : type,
|
|
38
51
|
className: cx(fieldBox({ size }), mono && "font-mono", secret && "pr-9", className)
|
|
39
52
|
});
|
|
@@ -46,25 +59,27 @@ var Input = forwardRef(({ label, hint, description, error, className, mono, size
|
|
|
46
59
|
})]
|
|
47
60
|
}) : input;
|
|
48
61
|
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
62
|
+
}
|
|
63
|
+
/** A multi-line text field that grows by hand. Placed in a Field, it takes the Field's label,
|
|
64
|
+
* description and invalid state. */
|
|
65
|
+
function Textarea({ label, hint, help, description, error, className, mono, size, ref, ...props }) {
|
|
66
|
+
return framed({
|
|
67
|
+
label,
|
|
68
|
+
hint,
|
|
69
|
+
help,
|
|
70
|
+
description,
|
|
71
|
+
error,
|
|
72
|
+
size
|
|
73
|
+
}, props, (control) => /* @__PURE__ */ jsx(Input, {
|
|
74
|
+
...props,
|
|
75
|
+
...joined(control, props),
|
|
76
|
+
ref,
|
|
77
|
+
render: /* @__PURE__ */ jsx("textarea", {}),
|
|
78
|
+
className: cx(fieldBox({
|
|
79
|
+
size,
|
|
80
|
+
multiline: true
|
|
81
|
+
}), size === "sm" ? "min-h-16" : "min-h-24", "resize-y", mono && "font-mono", className)
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
69
84
|
//#endregion
|
|
70
|
-
export { Input, Textarea, framed };
|
|
85
|
+
export { Input$1 as Input, Textarea, framed };
|
|
@@ -31,7 +31,7 @@ function Loader({ size = 48, label, variant = "spinner", inline = false, color,
|
|
|
31
31
|
"aria-label": label || loading,
|
|
32
32
|
className: cx("items-center", inline ? "inline-flex gap-2" : "flex w-full flex-col justify-center gap-y-1"),
|
|
33
33
|
children: [/* @__PURE__ */ jsx("span", {
|
|
34
|
-
className: cx("inline-flex", !color && "text-(--theme-accent
|
|
34
|
+
className: cx("inline-flex", !color && "text-(--theme-accent)"),
|
|
35
35
|
style: color ? { color } : void 0,
|
|
36
36
|
children: variant === "logo" ? /* @__PURE__ */ jsx("svg", {
|
|
37
37
|
viewBox: "0 0 64.29 64.29",
|
|
@@ -1,27 +1,51 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
export interface MenuAction {
|
|
2
|
+
interface MenuActionBase {
|
|
4
3
|
label: string;
|
|
5
4
|
icon?: ReactNode;
|
|
6
|
-
/** Navigates instead of calling onClick. */
|
|
7
|
-
href?: string | undefined;
|
|
8
|
-
/** Loads the page instead of routing, for paths the host's router doesn't serve. */
|
|
9
|
-
reloadDocument?: boolean | undefined;
|
|
10
|
-
onClick?: (() => void) | undefined;
|
|
11
5
|
disabled?: boolean | undefined;
|
|
12
6
|
/** Why the action is disabled, shown on hover and read with its name. */
|
|
13
7
|
disabledReason?: string | undefined;
|
|
14
8
|
destructive?: boolean | undefined;
|
|
9
|
+
/** More text a menu's search matches, beside the label. */
|
|
10
|
+
keywords?: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
/** Runs `onClick`. */
|
|
13
|
+
interface MenuClickAction extends MenuActionBase {
|
|
14
|
+
onClick: () => void;
|
|
15
15
|
/** Makes the row an on/off choice, checked while true. */
|
|
16
16
|
checked?: boolean | undefined;
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
href?: never;
|
|
18
|
+
reloadDocument?: never;
|
|
19
|
+
target?: never;
|
|
20
|
+
copy?: never;
|
|
21
|
+
}
|
|
22
|
+
/** Navigates to `href`. */
|
|
23
|
+
interface MenuLinkAction extends MenuActionBase {
|
|
24
|
+
href: string;
|
|
25
|
+
/** Loads the page instead of routing, for paths the host's router doesn't serve. */
|
|
26
|
+
reloadDocument?: boolean | undefined;
|
|
27
|
+
/** `_blank` opens it in a new tab, such as a page outside the app. */
|
|
28
|
+
target?: '_blank' | undefined;
|
|
29
|
+
onClick?: never;
|
|
30
|
+
checked?: never;
|
|
31
|
+
copy?: never;
|
|
32
|
+
}
|
|
33
|
+
/** Copies `copy.text` to the clipboard, confirmed with a toast naming `copy.label`. */
|
|
34
|
+
interface MenuCopyAction extends MenuActionBase {
|
|
35
|
+
copy: {
|
|
19
36
|
text: string;
|
|
20
37
|
label: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
38
|
+
};
|
|
39
|
+
onClick?: never;
|
|
40
|
+
checked?: never;
|
|
41
|
+
href?: never;
|
|
42
|
+
reloadDocument?: never;
|
|
43
|
+
target?: never;
|
|
24
44
|
}
|
|
45
|
+
/** Something a menu row does: runs `onClick`, navigates to `href`, or copies
|
|
46
|
+
* `copy`. Exactly one, so a row that does nothing when chosen doesn't compile.
|
|
47
|
+
* A disabled action keeps its behavior; one that has none belongs out of the menu. */
|
|
48
|
+
export type MenuAction = MenuClickAction | MenuLinkAction | MenuCopyAction;
|
|
25
49
|
/** A row that opens a menu of its own. */
|
|
26
50
|
export interface MenuSubmenu {
|
|
27
51
|
label: string;
|
|
@@ -54,3 +78,10 @@ export declare function MenuEntries({ entries, search, query, }: {
|
|
|
54
78
|
/** The search's text, from the MenuFilter around the menu's root. */
|
|
55
79
|
query?: string;
|
|
56
80
|
}): import("react").JSX.Element;
|
|
81
|
+
/** Warns in development when an action has no behavior. The types rule that
|
|
82
|
+
* out, but a JavaScript caller or a cast still can, and its row renders fine
|
|
83
|
+
* and silently does nothing. */
|
|
84
|
+
export declare function warnIfInert(action: MenuAction, where: string): void;
|
|
85
|
+
/** Runs an action that isn't a link: copies its text or calls its onClick. */
|
|
86
|
+
export declare function useRunAction(): (action: MenuAction) => void;
|
|
87
|
+
export {};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { cx } from "../cx.js";
|
|
2
2
|
import { MenuCheckboxItem, MenuItem, MenuLinkItem, MenuPopup, MenuSeparator, MenuSubmenuTrigger } from "./Menu.js";
|
|
3
|
-
import {
|
|
4
|
-
import { EmptyState } from "./EmptyState.js";
|
|
3
|
+
import { isDev } from "../dev.js";
|
|
5
4
|
import { keyedByContent } from "./keys.js";
|
|
6
5
|
import { Tooltip } from "./Tooltip.js";
|
|
7
|
-
import {
|
|
6
|
+
import { AppLink } from "./AppLink.js";
|
|
7
|
+
import { EmptyState } from "./EmptyState.js";
|
|
8
8
|
import { useQueryMatch } from "./search.js";
|
|
9
9
|
import { useCopy } from "./useCopy.js";
|
|
10
10
|
import { Menu } from "@base-ui/react/menu";
|
|
11
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
import { useState } from "react";
|
|
12
|
+
import { useCallback, useState } from "react";
|
|
13
13
|
//#region src/components/MenuEntries.tsx
|
|
14
14
|
var menuDivider = { divider: true };
|
|
15
15
|
var isMenuDivider = (entry) => "divider" in entry;
|
|
@@ -38,7 +38,7 @@ function MenuEntries({ entries, search, query = "" }) {
|
|
|
38
38
|
children: /* @__PURE__ */ jsx(Menu.Input, {
|
|
39
39
|
"aria-label": search.placeholder,
|
|
40
40
|
placeholder: search.placeholder,
|
|
41
|
-
className: "w-full rounded-md border border-(--theme-border) bg-(--theme-muted-panel-bg) px-2 py-1 text-[13px] text-(--theme-app) outline-none placeholder:text-(--theme-placeholder) focus:border-(--theme-
|
|
41
|
+
className: "w-full rounded-md border border-(--theme-border) bg-(--theme-muted-panel-bg) px-2 py-1 text-[13px] text-(--theme-app) outline-none placeholder:text-(--theme-placeholder) focus:border-(--theme-focus)"
|
|
42
42
|
})
|
|
43
43
|
}),
|
|
44
44
|
/* @__PURE__ */ jsx(Menu.List, { children: /* @__PURE__ */ jsx(EntryRows, { entries: shown }) }),
|
|
@@ -73,25 +73,40 @@ function SubmenuRow({ submenu }) {
|
|
|
73
73
|
})] })
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
-
var destructiveClassName = "text-(--theme-error) data-highlighted:text-(--theme-error)";
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
var destructiveClassName = "text-(--theme-error-text) data-highlighted:text-(--theme-error-text)";
|
|
77
|
+
var warnedInert = /* @__PURE__ */ new Set();
|
|
78
|
+
/** Warns in development when an action has no behavior. The types rule that
|
|
79
|
+
* out, but a JavaScript caller or a cast still can, and its row renders fine
|
|
80
|
+
* and silently does nothing. */
|
|
81
|
+
function warnIfInert(action, where) {
|
|
82
|
+
if (!isDev()) return;
|
|
83
|
+
if (action.onClick || action.href || action.copy || warnedInert.has(action.label)) return;
|
|
84
|
+
warnedInert.add(action.label);
|
|
85
|
+
console.warn(`${where}: the action "${action.label}" has no onClick, href or copy, so choosing it does nothing.`);
|
|
86
|
+
}
|
|
87
|
+
/** Runs an action that isn't a link: copies its text or calls its onClick. */
|
|
88
|
+
function useRunAction() {
|
|
79
89
|
const { copy } = useCopy();
|
|
90
|
+
return useCallback((action) => {
|
|
91
|
+
if (action.copy) copy(action.copy.text, { label: action.copy.label });
|
|
92
|
+
else action.onClick?.();
|
|
93
|
+
}, [copy]);
|
|
94
|
+
}
|
|
95
|
+
function ActionRow({ action }) {
|
|
96
|
+
warnIfInert(action, "MenuEntries");
|
|
97
|
+
const runAction = useRunAction();
|
|
80
98
|
const className = cx(action.destructive && destructiveClassName);
|
|
81
99
|
const content = /* @__PURE__ */ jsxs(Fragment, { children: [action.icon, action.label] });
|
|
82
|
-
if (action.href && !action.disabled) return
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
100
|
+
if (action.href && !action.disabled) return /* @__PURE__ */ jsx(MenuLinkItem, {
|
|
101
|
+
render: /* @__PURE__ */ jsx(AppLink, {
|
|
102
|
+
href: action.href,
|
|
103
|
+
reloadDocument: action.reloadDocument,
|
|
104
|
+
target: action.target
|
|
105
|
+
}),
|
|
88
106
|
className,
|
|
89
107
|
children: content
|
|
90
108
|
});
|
|
91
|
-
const run = () =>
|
|
92
|
-
if (action.copy) copy(action.copy.text, { label: action.copy.label });
|
|
93
|
-
action.onClick?.();
|
|
94
|
-
};
|
|
109
|
+
const run = () => runAction(action);
|
|
95
110
|
const reason = action.disabled ? action.disabledReason : void 0;
|
|
96
111
|
const label = /* @__PURE__ */ jsxs(Fragment, { children: [content, reason && /* @__PURE__ */ jsxs("span", {
|
|
97
112
|
className: "sr-only",
|
|
@@ -115,4 +130,4 @@ function ActionRow({ action }) {
|
|
|
115
130
|
});
|
|
116
131
|
}
|
|
117
132
|
//#endregion
|
|
118
|
-
export { MenuEntries, MenuFilter, isMenuDivider, isMenuSubmenu, menuDivider };
|
|
133
|
+
export { MenuEntries, MenuFilter, isMenuDivider, isMenuSubmenu, menuDivider, useRunAction, warnIfInert };
|
package/dist/components/Meter.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cx } from "../cx.js";
|
|
2
|
+
import { toneFill } from "./tone.js";
|
|
2
3
|
import { Tooltip } from "./Tooltip.js";
|
|
3
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
import { Meter } from "@base-ui/react/meter";
|
|
@@ -6,10 +7,10 @@ import { Progress } from "@base-ui/react/progress";
|
|
|
6
7
|
//#region src/components/Meter.tsx
|
|
7
8
|
var fillClassName = {
|
|
8
9
|
accent: "bg-(--theme-accent)",
|
|
9
|
-
success:
|
|
10
|
-
warning:
|
|
11
|
-
error:
|
|
12
|
-
muted:
|
|
10
|
+
success: toneFill.success,
|
|
11
|
+
warning: toneFill.warning,
|
|
12
|
+
error: toneFill.error,
|
|
13
|
+
muted: toneFill.muted
|
|
13
14
|
};
|
|
14
15
|
var trackClassName = {
|
|
15
16
|
sm: "h-1",
|
|
@@ -6,9 +6,27 @@ export declare const modalPanelClassName = "rounded-xl border border-(--theme-bo
|
|
|
6
6
|
export declare const ModalTitle: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").DialogTitleProps, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
7
7
|
/** Describes the modal for assistive technology; renders a `<p>`. */
|
|
8
8
|
export declare const ModalDescription: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").DialogDescriptionProps, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
9
|
-
|
|
9
|
+
declare const sizeClasses: {
|
|
10
|
+
readonly sm: 'w-[400px]';
|
|
11
|
+
readonly md: 'w-[480px]';
|
|
12
|
+
readonly lg: 'w-[560px]';
|
|
13
|
+
readonly xl: 'w-[672px]';
|
|
14
|
+
};
|
|
15
|
+
export type ModalSize = keyof typeof sizeClasses;
|
|
16
|
+
export interface ModalProps extends Omit<Dialog.Popup.Props, 'className' | 'children' | 'render' | 'title'> {
|
|
10
17
|
open: boolean;
|
|
11
18
|
onClose: () => void;
|
|
19
|
+
/** The header's heading, which names the modal. Without one, name it with
|
|
20
|
+
* `aria-label`, or with a `ModalTitle` among the children. */
|
|
21
|
+
title?: ReactNode;
|
|
22
|
+
/** A line under the title, which describes the modal. */
|
|
23
|
+
description?: ReactNode;
|
|
24
|
+
/** Actions along the bottom edge, such as Cancel and Save, ruled off from the
|
|
25
|
+
* body; they stay in view as a tall body scrolls. */
|
|
26
|
+
footer?: ReactNode;
|
|
27
|
+
/** Its width, which narrows to fit a small window. Without one, it's as wide
|
|
28
|
+
* as its content. */
|
|
29
|
+
size?: ModalSize | undefined;
|
|
12
30
|
/** A confirmation the person must answer: it takes the alertdialog role and the
|
|
13
31
|
* backdrop doesn't close it. Escape still cancels while it's dismissible. */
|
|
14
32
|
alert?: boolean | undefined;
|
|
@@ -21,9 +39,15 @@ export interface ModalProps extends Omit<Dialog.Popup.Props, 'className' | 'chil
|
|
|
21
39
|
panel?: boolean;
|
|
22
40
|
/** The backdrop's dimming, for a modal that needs a darker or blurred stage. */
|
|
23
41
|
backdropClassName?: string;
|
|
42
|
+
/** On the panel. */
|
|
24
43
|
className?: string;
|
|
25
|
-
|
|
44
|
+
/** The body. With a title or a footer it sits padded between them and scrolls
|
|
45
|
+
* when the window is short; without either, it is the whole panel. */
|
|
46
|
+
children?: ReactNode;
|
|
26
47
|
}
|
|
27
48
|
/** A modal dialog: focus stays inside, the page behind is inert and doesn't scroll,
|
|
28
|
-
* and focus returns to where it was on close.
|
|
29
|
-
|
|
49
|
+
* and focus returns to where it was on close. Give it a `title`, a `description`
|
|
50
|
+
* and a `footer` for the standard layout, as a Drawer has, or lay out the whole
|
|
51
|
+
* panel with the children. */
|
|
52
|
+
export declare function Modal({ open, onClose, title, description, footer, size, alert, dismissible, align, panel, backdropClassName, className, children, ...popupProps }: ModalProps): import("react").JSX.Element;
|
|
53
|
+
export {};
|
package/dist/components/Modal.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cx } from "../cx.js";
|
|
2
|
-
import {
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { closeHandler } from "./dismiss.js";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { AlertDialog } from "@base-ui/react/alert-dialog";
|
|
5
5
|
import { Dialog } from "@base-ui/react/dialog";
|
|
6
6
|
//#region src/components/Modal.tsx
|
|
@@ -10,23 +10,46 @@ var modalPanelClassName = "rounded-xl border border-(--theme-border) bg-(--theme
|
|
|
10
10
|
var ModalTitle = Dialog.Title;
|
|
11
11
|
/** Describes the modal for assistive technology; renders a `<p>`. */
|
|
12
12
|
var ModalDescription = Dialog.Description;
|
|
13
|
+
var sizeClasses = {
|
|
14
|
+
sm: "w-[400px]",
|
|
15
|
+
md: "w-[480px]",
|
|
16
|
+
lg: "w-[560px]",
|
|
17
|
+
xl: "w-[672px]"
|
|
18
|
+
};
|
|
13
19
|
/** A modal dialog: focus stays inside, the page behind is inert and doesn't scroll,
|
|
14
|
-
* and focus returns to where it was on close.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
onClose();
|
|
23
|
-
};
|
|
20
|
+
* and focus returns to where it was on close. Give it a `title`, a `description`
|
|
21
|
+
* and a `footer` for the standard layout, as a Drawer has, or lay out the whole
|
|
22
|
+
* panel with the children. */
|
|
23
|
+
function Modal({ open, onClose, title, description, footer, size, alert = false, dismissible = true, align = "top", panel = true, backdropClassName = "bg-black/40", className, children, ...popupProps }) {
|
|
24
|
+
const onOpenChange = closeHandler(dismissible, onClose);
|
|
25
|
+
const header = title !== void 0 || description !== void 0;
|
|
26
|
+
const body = children !== void 0 && children !== null && children !== false;
|
|
27
|
+
const laidOut = header || footer !== void 0;
|
|
24
28
|
const content = /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, { className: cx("fixed inset-0 z-(--layer-modal)", backdropClassName) }), /* @__PURE__ */ jsx(Dialog.Viewport, {
|
|
25
29
|
className: cx("fixed inset-0 z-(--layer-modal) flex justify-center px-4 pt-20 pb-8", align === "center" ? "items-center" : "items-start sm:pt-[max(14vh,5rem)]"),
|
|
26
30
|
children: /* @__PURE__ */ jsx(Dialog.Popup, {
|
|
27
31
|
...popupProps,
|
|
28
|
-
className: cx(panel && "rounded-xl border border-(--theme-border) bg-(--theme-app-bg) text-(--theme-app) shadow-2xl", "outline-none", className),
|
|
29
|
-
children
|
|
32
|
+
className: cx(panel && "rounded-xl border border-(--theme-border) bg-(--theme-app-bg) text-(--theme-app) shadow-2xl", size && [sizeClasses[size], "max-w-full"], laidOut && "flex max-h-full flex-col", "outline-none", className),
|
|
33
|
+
children: laidOut ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
34
|
+
header && /* @__PURE__ */ jsxs("div", {
|
|
35
|
+
className: cx("shrink-0 px-5 pt-5", !body && "pb-5"),
|
|
36
|
+
children: [title !== void 0 && /* @__PURE__ */ jsx(ModalTitle, {
|
|
37
|
+
className: "m-0 text-lg font-semibold",
|
|
38
|
+
children: title
|
|
39
|
+
}), description !== void 0 && /* @__PURE__ */ jsx(ModalDescription, {
|
|
40
|
+
className: "m-0 mt-1.5 text-sm text-(--theme-muted-text-color)",
|
|
41
|
+
children: description
|
|
42
|
+
})]
|
|
43
|
+
}),
|
|
44
|
+
body && /* @__PURE__ */ jsx("div", {
|
|
45
|
+
className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-5 py-4",
|
|
46
|
+
children
|
|
47
|
+
}),
|
|
48
|
+
footer !== void 0 && /* @__PURE__ */ jsx("div", {
|
|
49
|
+
className: "flex shrink-0 items-center justify-end gap-2 border-t border-(--theme-border) px-5 py-3",
|
|
50
|
+
children: footer
|
|
51
|
+
})
|
|
52
|
+
] }) : children
|
|
30
53
|
})
|
|
31
54
|
})] });
|
|
32
55
|
return alert ? /* @__PURE__ */ jsx(AlertDialog.Root, {
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface OverviewProps {
|
|
3
|
+
/** The thing's mark, such as its type's icon or an avatar. */
|
|
4
|
+
icon: ReactNode;
|
|
5
|
+
name: ReactNode;
|
|
6
|
+
/** Under the name, such as its kind. */
|
|
7
|
+
type?: ReactNode;
|
|
8
|
+
/** A row under the type, such as badges. */
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
/** At the row's end, centered against the name block, such as actions. */
|
|
11
|
+
actions?: ReactNode;
|
|
12
|
+
/** Sketches the icon and two lines while the thing loads. */
|
|
13
|
+
loading?: boolean | undefined;
|
|
14
|
+
/** The loading sketch's icon size, in pixels, to match the icon that replaces it. */
|
|
15
|
+
iconSize?: number | undefined;
|
|
16
|
+
className?: string | undefined;
|
|
17
|
+
}
|
|
18
|
+
/** A thing's summary at the top of its page: its mark, its name and kind, and
|
|
19
|
+
* what to do with it. */
|
|
20
|
+
export declare function Overview({ icon, name, type, children, actions, className, loading, iconSize, }: OverviewProps): import("react").JSX.Element;
|
|
@@ -2,17 +2,19 @@ import { cx } from "../cx.js";
|
|
|
2
2
|
import { LoadingRegion, Skeleton } from "./Skeleton.js";
|
|
3
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/Overview.tsx
|
|
5
|
-
|
|
5
|
+
/** A thing's summary at the top of its page: its mark, its name and kind, and
|
|
6
|
+
* what to do with it. */
|
|
7
|
+
function Overview({ icon, name, type, children, actions, className, loading = false, iconSize = 75 }) {
|
|
6
8
|
return /* @__PURE__ */ jsxs("div", {
|
|
7
|
-
className: cx("flex items-center
|
|
9
|
+
className: cx("flex w-full items-center gap-3", className),
|
|
8
10
|
children: [
|
|
9
11
|
loading ? /* @__PURE__ */ jsx(Skeleton, {
|
|
10
12
|
circle: true,
|
|
11
13
|
height: iconSize,
|
|
12
14
|
className: "shrink-0"
|
|
13
|
-
}) :
|
|
15
|
+
}) : icon,
|
|
14
16
|
/* @__PURE__ */ jsx("div", {
|
|
15
|
-
className: "flex
|
|
17
|
+
className: "flex min-w-0 flex-1 flex-col",
|
|
16
18
|
children: loading ? /* @__PURE__ */ jsx(LoadingRegion, {
|
|
17
19
|
className: "space-y-1",
|
|
18
20
|
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
@@ -21,19 +23,22 @@ function Overview({ Icon, name, type, children, right, className, loading, iconS
|
|
|
21
23
|
})
|
|
22
24
|
}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
23
25
|
/* @__PURE__ */ jsx("div", {
|
|
24
|
-
className: "font-semibold
|
|
26
|
+
className: "text-xl font-semibold tracking-tight",
|
|
25
27
|
children: name
|
|
26
28
|
}),
|
|
27
|
-
type && /* @__PURE__ */ jsx("p", {
|
|
28
|
-
|
|
29
|
+
type && /* @__PURE__ */ jsx("p", {
|
|
30
|
+
className: "m-0 text-sm text-(--theme-muted-text-color)",
|
|
31
|
+
children: type
|
|
32
|
+
}),
|
|
33
|
+
children && /* @__PURE__ */ jsx("div", {
|
|
29
34
|
className: "flex flex-row gap-x-2",
|
|
30
35
|
children
|
|
31
36
|
})
|
|
32
37
|
] })
|
|
33
38
|
}),
|
|
34
|
-
|
|
39
|
+
actions && /* @__PURE__ */ jsx("div", {
|
|
35
40
|
className: "shrink-0 self-center",
|
|
36
|
-
children:
|
|
41
|
+
children: actions
|
|
37
42
|
})
|
|
38
43
|
]
|
|
39
44
|
});
|
|
@@ -1,70 +1,52 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
label: ReactNode;
|
|
10
|
-
href?: string;
|
|
11
|
-
}
|
|
12
|
-
/** With menu, the plus opens a chooser; otherwise navigates to or calls the
|
|
13
|
-
* single action. `word` is the visible verb; `label` stays the full action for
|
|
14
|
-
* the tooltip and screen readers. */
|
|
15
|
-
export declare function HeaderAddButton({ href, onClick, label, word, menu, disabled, disabledHint, }: {
|
|
16
|
-
href?: string;
|
|
17
|
-
onClick?: () => void;
|
|
18
|
-
label: string;
|
|
19
|
-
word?: 'add' | 'create';
|
|
20
|
-
menu?: MenuEntry[];
|
|
21
|
-
/** Button mode only. */
|
|
22
|
-
disabled?: boolean;
|
|
23
|
-
disabledHint?: string;
|
|
24
|
-
}): import("react").JSX.Element;
|
|
25
|
-
/** The header's "…" menu of actions on the page's subject. */
|
|
26
|
-
export declare function HeaderActionMenu({ items, label }: {
|
|
27
|
-
items: MenuEntry[];
|
|
28
|
-
label?: string;
|
|
29
|
-
}): import("react").JSX.Element | null;
|
|
30
|
-
export declare function HeaderEditButton({ href, onClick, label: labelProp, disabled, tooltip, }: {
|
|
31
|
-
href?: string;
|
|
32
|
-
onClick?: () => void;
|
|
33
|
-
label?: string;
|
|
34
|
-
disabled?: boolean;
|
|
35
|
-
tooltip?: string | undefined;
|
|
36
|
-
}): import("react").JSX.Element;
|
|
37
|
-
/** Renders nothing when the modern breadcrumb strip isn't mounted (classic chrome or self-headered pages). */
|
|
38
|
-
export declare function BreadcrumbsTitleAction({ children }: {
|
|
39
|
-
children: ReactNode;
|
|
40
|
-
}): import("react").ReactPortal | null;
|
|
41
|
-
export declare function BreadcrumbsRightAction({ children }: {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type Breadcrumb } from './pageHeaderStore.js';
|
|
3
|
+
export type { Breadcrumb } from './pageHeaderStore.js';
|
|
4
|
+
/**
|
|
5
|
+
* Holds the header the current page declares, for the `PageHeaderBar` the
|
|
6
|
+
* shell renders. Wrap the shell, above both the bar and the routes.
|
|
7
|
+
*/
|
|
8
|
+
export declare function PageHeaderProvider({ children }: {
|
|
42
9
|
children: ReactNode;
|
|
43
|
-
}): import("react").ReactPortal | null;
|
|
44
|
-
export declare function BreadcrumbsActionButton({ icon: Icon, label, ariaLabel, href, onClick, disabled, tooltip, destructive, }: {
|
|
45
|
-
icon: ComponentType<{
|
|
46
|
-
className?: string;
|
|
47
|
-
}>;
|
|
48
|
-
label: string;
|
|
49
|
-
ariaLabel?: string;
|
|
50
|
-
href?: string;
|
|
51
|
-
onClick?: (() => void) | undefined;
|
|
52
|
-
disabled?: boolean;
|
|
53
|
-
tooltip?: string | undefined;
|
|
54
|
-
/** In the error color, as a destructive menu entry is, for an action that removes or breaks
|
|
55
|
-
* something. */
|
|
56
|
-
destructive?: boolean | undefined;
|
|
57
10
|
}): import("react").JSX.Element;
|
|
58
|
-
interface PageHeaderProps {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
11
|
+
export interface PageHeaderProps {
|
|
12
|
+
/** The trail to this page, ending with the page itself, which becomes its
|
|
13
|
+
* `h1`. A crumb with an empty label, such as a name still loading, shows a
|
|
14
|
+
* placeholder. */
|
|
15
|
+
breadcrumbs?: readonly Breadcrumb[] | undefined;
|
|
16
|
+
/** Beside the title: actions on the page's subject, such as edit, rename or
|
|
17
|
+
* favorite, or its `PageHeaderMenu`. */
|
|
18
|
+
titleActions?: ReactNode;
|
|
19
|
+
/** At the end of the bar: the page's commands, such as Save or "+ Create". */
|
|
62
20
|
actions?: ReactNode;
|
|
21
|
+
/** A row under the bar, such as tabs or a time range, that stays put while
|
|
22
|
+
* the page scrolls. */
|
|
63
23
|
toolbar?: ReactNode;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
24
|
+
/** Takes the bar away, for a page that fills the window. */
|
|
25
|
+
hidden?: boolean | undefined;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Declares the page's header: its breadcrumbs, title actions, actions and
|
|
29
|
+
* toolbar. Under a `PageHeaderProvider` it renders nothing in place: the
|
|
30
|
+
* shell's `PageHeaderBar` shows it, while the actions stay in the page's React
|
|
31
|
+
* tree, with its context and state. Without a provider it renders the bar
|
|
32
|
+
* itself, for a page with no shell.
|
|
33
|
+
*
|
|
34
|
+
* Any component may render one, such as a form adding its Save button: the bar
|
|
35
|
+
* shows the actions of all of them, outermost first, and the trail of the last
|
|
36
|
+
* one rendered that has one, so a page's trail replaces its layout's.
|
|
37
|
+
*/
|
|
38
|
+
export declare function PageHeader(props: PageHeaderProps): import("react").JSX.Element | null;
|
|
39
|
+
export interface PageHeaderBarProps {
|
|
40
|
+
/** A shorter bar, for a page that gives the window to an embedded app. */
|
|
41
|
+
compact?: boolean | undefined;
|
|
42
|
+
/** Keep the bar when the page declares nothing, such as on a narrow screen
|
|
43
|
+
* where it holds the navigation toggle. A page's `hidden` still wins. */
|
|
44
|
+
persistent?: boolean | undefined;
|
|
45
|
+
className?: string | undefined;
|
|
68
46
|
}
|
|
69
|
-
|
|
70
|
-
|
|
47
|
+
/**
|
|
48
|
+
* The bar showing what the current page declares with `PageHeader`. The shell
|
|
49
|
+
* renders one, inside a `PageHeaderProvider`, wherever its chrome puts it. It
|
|
50
|
+
* renders nothing while the page declares nothing.
|
|
51
|
+
*/
|
|
52
|
+
export declare function PageHeaderBar({ compact, persistent, className, }: PageHeaderBarProps): import("react").JSX.Element | null;
|