@remit/ui 0.0.226 → 0.0.227
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.
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
export function AppChrome({ topBar, appBar, children }) {
|
|
3
|
+
return (_jsxs(_Fragment, { children: [topBar, _jsxs("div", { className: "flex min-h-0 flex-1", children: [appBar, _jsx("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: children })] })] }));
|
|
4
|
+
}
|
|
@@ -55,6 +55,11 @@ export interface AppShellSlottedProps {
|
|
|
55
55
|
* read as the app's search rather than the list's.
|
|
56
56
|
*/
|
|
57
57
|
topBar?: ReactNode;
|
|
58
|
+
/**
|
|
59
|
+
* The app switcher bar. Sits down the left edge beneath `topBar`, so the top
|
|
60
|
+
* bar runs the full width above it.
|
|
61
|
+
*/
|
|
62
|
+
appBar?: ReactNode;
|
|
58
63
|
/**
|
|
59
64
|
* Content rendered outside the pane group (e.g., the compose FAB). Floats
|
|
60
65
|
* over the layout regardless of width.
|
|
@@ -110,4 +115,4 @@ export interface AppShellLayoutContext {
|
|
|
110
115
|
* Returns null outside of an `AppShellSlotted` (tests / Storybook).
|
|
111
116
|
*/
|
|
112
117
|
export declare function useAppShellLayout(): AppShellLayoutContext | null;
|
|
113
|
-
export declare function AppShellSlotted({ nav, list, reading, intelligence, intelligenceOpen, hasThread, density, listBias, header, topBar, overlay, skeleton, isLoading, initialWidth, navOpen: navOpenProp, onOpenNav, onCloseNav, }: AppShellSlottedProps): import("react").JSX.Element;
|
|
118
|
+
export declare function AppShellSlotted({ nav, list, reading, intelligence, intelligenceOpen, hasThread, density, listBias, header, topBar, appBar, overlay, skeleton, isLoading, initialWidth, navOpen: navOpenProp, onOpenNav, onCloseNav, }: AppShellSlottedProps): import("react").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, useContext, useState } from "react";
|
|
3
|
+
import { AppChrome } from "./app-chrome.js";
|
|
3
4
|
import { resolvePaneLayout, useContainerWidth, } from "./app-shell-types.js";
|
|
4
5
|
import { Dialog } from "./dialog.js";
|
|
5
6
|
import { ResizableHandle, ResizablePanel, ResizablePanelGroup, WholePixelWidth, } from "./resizable.js";
|
|
@@ -22,7 +23,7 @@ export function useAppShellLayout() {
|
|
|
22
23
|
/* ------------------------------------------------------------------ */
|
|
23
24
|
/* AppShellSlotted */
|
|
24
25
|
/* ------------------------------------------------------------------ */
|
|
25
|
-
export function AppShellSlotted({ nav, list, reading, intelligence, intelligenceOpen = true, hasThread = true, density = "comfortable", listBias = "balanced", header, topBar, overlay, skeleton, isLoading = false, initialWidth, navOpen: navOpenProp, onOpenNav, onCloseNav, }) {
|
|
26
|
+
export function AppShellSlotted({ nav, list, reading, intelligence, intelligenceOpen = true, hasThread = true, density = "comfortable", listBias = "balanced", header, topBar, appBar, overlay, skeleton, isLoading = false, initialWidth, navOpen: navOpenProp, onOpenNav, onCloseNav, }) {
|
|
26
27
|
const [containerRef, containerWidth] = useContainerWidth(initialWidth);
|
|
27
28
|
const panes = resolvePaneLayout(containerWidth ?? 0);
|
|
28
29
|
const [navCollapsed, setNavCollapsed] = useState(false);
|
|
@@ -71,5 +72,5 @@ export function AppShellSlotted({ nav, list, reading, intelligence, intelligence
|
|
|
71
72
|
const share = listShare(listBias, density);
|
|
72
73
|
const contentPanes = (_jsxs(ResizablePanelGroup, { direction: "horizontal", className: "min-h-0 flex-1", children: [_jsx(ResizablePanel, { id: "list", order: 1, defaultSize: showReadingPane ? share.size : 100, minSize: 22, maxSize: showReadingPane ? share.max : 100, className: "min-w-0", children: list }), showReadingPane && (_jsxs(_Fragment, { children: [_jsx(ResizableHandle, {}), _jsx(ResizablePanel, { id: "reading", order: 2, minSize: 29, className: "min-w-0", children: _jsx(WholePixelWidth, { className: "h-full", children: reading }) })] })), showIntelligencePanel && (_jsxs(_Fragment, { children: [_jsx(ResizableHandle, {}), _jsx(ResizablePanel, { id: "intelligence", order: 3, defaultSize: 25, minSize: 18, maxSize: 39, className: "min-w-0", children: intelligence })] }))] }, showReadingPane ? "list-reading" : "list-only"));
|
|
73
74
|
const content = (_jsxs("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [!showNavPane && header && _jsx("div", { className: "shrink-0", children: header }), contentPanes] }));
|
|
74
|
-
return (_jsx(AppShellLayoutCtx.Provider, { value: layoutCtx, children:
|
|
75
|
+
return (_jsx(AppShellLayoutCtx.Provider, { value: layoutCtx, children: _jsxs("div", { ref: containerRef, className: "safe-area-frame @container flex h-full w-full flex-col overflow-hidden bg-canvas font-sans text-fg", children: [_jsx(AppChrome, { topBar: topBar, appBar: appBar, children: isLoading && skeleton ? (skeleton) : navPaneVisible ? (_jsxs(ResizablePanelGroup, { direction: "horizontal", className: "min-h-0 flex-1", children: [_jsx(ResizablePanel, { id: "nav", order: 1, defaultSize: 17, minSize: 12, maxSize: 24, className: "min-w-0", children: nav }), _jsx(ResizableHandle, {}), _jsx(ResizablePanel, { id: "content", order: 2, className: "flex min-w-0 flex-col", children: content })] })) : (content) }), !(isLoading && skeleton) && (_jsxs(_Fragment, { children: [!showNavPane && (_jsx(Dialog, { open: navOpen, onClose: closeNav, title: "Folders", anchor: "left", children: nav })), overlay] }))] }) }));
|
|
75
76
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export { AddressDisplay, type AddressDisplayProps, AddressList, type AddressList
|
|
|
9
9
|
export { AddressTag, type AddressTagProps } from "./components/address-tag.js";
|
|
10
10
|
export { type AgendaDensity, AgendaFlow, type AgendaFlowProps, type AgendaScrollTarget, } from "./components/agenda-flow.js";
|
|
11
11
|
export { NextUpCard, type NextUpCardProps, } from "./components/agenda-panels.js";
|
|
12
|
+
export { AppChrome, type AppChromeProps } from "./components/app-chrome.js";
|
|
12
13
|
export { AppPasswordHint, type AppPasswordHintProps, } from "./components/app-password-hint.js";
|
|
13
14
|
export { type AppShellLayoutContext, AppShellSlotted, type AppShellSlottedProps, useAppShellLayout, } from "./components/app-shell-slotted.js";
|
|
14
15
|
export { type AppShellProps, type Density, INTELLIGENCE_MIN_WIDTH, type MessageListKeyboard, type MessageListSelection, type NarrowView, type NavAccount, type NavAccountStatus, type NavLinkComponent, type NavLinkRenderProps, type NavMailbox, type NavMailboxRole, type PaneLayout, READING_PANE_MIN_WIDTH, resolvePaneLayout, type ThreadData, type ThreadMessageData, type ThreadRowData, type ThreadSection, type TouchSeed, useContainerWidth, } from "./components/app-shell-types.js";
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export { AddressDisplay, AddressList, } from "./components/address-display.js";
|
|
|
9
9
|
export { AddressTag } from "./components/address-tag.js";
|
|
10
10
|
export { AgendaFlow, } from "./components/agenda-flow.js";
|
|
11
11
|
export { NextUpCard, } from "./components/agenda-panels.js";
|
|
12
|
+
export { AppChrome } from "./components/app-chrome.js";
|
|
12
13
|
export { AppPasswordHint, } from "./components/app-password-hint.js";
|
|
13
14
|
export { AppShellSlotted, useAppShellLayout, } from "./components/app-shell-slotted.js";
|
|
14
15
|
export { INTELLIGENCE_MIN_WIDTH, READING_PANE_MIN_WIDTH, resolvePaneLayout, useContainerWidth, } from "./components/app-shell-types.js";
|