@remit/web-client 0.0.330 → 0.0.331
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/dist/src/components/layout/AppFrame.d.ts +2 -3
- package/dist/src/components/layout/AppFrame.js +7 -8
- package/dist/src/components/layout/CalendarTopBar.d.ts +1 -0
- package/dist/src/components/layout/CalendarTopBar.js +9 -0
- package/dist/src/components/layout/DesktopAppBar.d.ts +1 -0
- package/dist/src/components/layout/DesktopAppBar.js +7 -0
- package/dist/src/components/layout/DesktopChrome.d.ts +6 -0
- package/dist/src/components/layout/DesktopChrome.js +9 -0
- package/dist/src/components/layout/MailShell.d.ts +1 -0
- package/dist/src/components/layout/MailShell.js +1 -0
- package/dist/src/routes/calendar.js +6 -4
- package/dist/src/routes/mail.js +6 -3
- package/package.json +2 -2
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
export interface AppFrameProps {
|
|
3
3
|
children: ReactNode;
|
|
4
|
-
/** A full-screen surface on a phone takes the tab bar's room too. */
|
|
5
4
|
hideTabBar?: boolean;
|
|
6
5
|
}
|
|
7
6
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* On a phone, the tab bar under the content. Wide screens get their app bar
|
|
8
|
+
* from the shell's own `appBar` slot, so the frame adds nothing there.
|
|
10
9
|
*/
|
|
11
10
|
export declare function AppFrame({ children, hideTabBar }: AppFrameProps): import("react").JSX.Element;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AppTabBar } from "@remit/ui";
|
|
3
3
|
import { useLayoutTier } from "../../hooks/useLayoutTier";
|
|
4
4
|
import { useAppSwitch } from "../../routing";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* On a phone, the tab bar under the content. Wide screens get their app bar
|
|
7
|
+
* from the shell's own `appBar` slot, so the frame adds nothing there.
|
|
8
8
|
*/
|
|
9
9
|
export function AppFrame({ children, hideTabBar = false }) {
|
|
10
10
|
const isPhone = useLayoutTier() === "phone";
|
|
11
11
|
const { items, active, switchTo } = useAppSwitch();
|
|
12
|
-
if (isPhone)
|
|
13
|
-
return
|
|
14
|
-
}
|
|
15
|
-
return (_jsxs("div", { className: "flex h-full w-full", children: [_jsx(AppBar, { items: items, active: active, onNavigate: switchTo }), _jsx("div", { className: "min-w-0 flex-1", children: children })] }));
|
|
12
|
+
if (!isPhone)
|
|
13
|
+
return _jsx(_Fragment, { children: children });
|
|
14
|
+
return (_jsxs("div", { className: "flex h-full w-full flex-col", style: hideTabBar ? undefined : { ["--app-tab-bar"]: "3.5rem" }, children: [_jsx("div", { className: "min-h-0 flex-1", children: children }), !hideTabBar && (_jsx(AppTabBar, { items: items, active: active, onNavigate: switchTo }))] }));
|
|
16
15
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function CalendarTopBar(): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AppTopBar, Button } from "@remit/ui";
|
|
3
|
+
import { Settings } from "lucide-react";
|
|
4
|
+
import { AccountMenu } from "../../auth/AccountMenu";
|
|
5
|
+
import { useGoToSection } from "../../routing";
|
|
6
|
+
export function CalendarTopBar() {
|
|
7
|
+
const goToSection = useGoToSection();
|
|
8
|
+
return (_jsx(AppTopBar, { search: null, actions: _jsxs(_Fragment, { children: [_jsx(Button, { variant: "ghost", size: "sm", icon: _jsx(Settings, { className: "size-4" }), title: "Settings", "aria-label": "Settings", onClick: () => goToSection("accounts") }), _jsx(AccountMenu, {})] }) }));
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function DesktopAppBar(): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { AppBar } from "@remit/ui";
|
|
3
|
+
import { useAppSwitch } from "../../routing";
|
|
4
|
+
export function DesktopAppBar() {
|
|
5
|
+
const { items, active, switchTo } = useAppSwitch();
|
|
6
|
+
return _jsx(AppBar, { items: items, active: active, onNavigate: switchTo });
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { AppChrome } from "@remit/ui";
|
|
3
|
+
import { useLayoutTier } from "../../hooks/useLayoutTier";
|
|
4
|
+
import { DesktopAppBar } from "./DesktopAppBar";
|
|
5
|
+
export function DesktopChrome({ topBar, children }) {
|
|
6
|
+
if (useLayoutTier() === "phone")
|
|
7
|
+
return _jsx(_Fragment, { children: children });
|
|
8
|
+
return (_jsx("div", { className: "flex h-full w-full flex-col overflow-hidden bg-canvas", children: _jsx(AppChrome, { topBar: topBar, appBar: _jsx(DesktopAppBar, {}), children: children }) }));
|
|
9
|
+
}
|
|
@@ -25,6 +25,7 @@ export function MailShell({ phone, list, reading, intelligence, hasThread = fals
|
|
|
25
25
|
return _jsx(AppShellSkeleton, {});
|
|
26
26
|
const shared = {
|
|
27
27
|
nav: chrome.nav,
|
|
28
|
+
appBar: chrome.appBar,
|
|
28
29
|
overlay: chrome.overlay,
|
|
29
30
|
skeleton: _jsx(AppShellSkeleton, {}),
|
|
30
31
|
isLoading: chrome.isLoading,
|
|
@@ -13,6 +13,8 @@ import { createFileRoute, Outlet, useNavigate } from "@tanstack/react-router";
|
|
|
13
13
|
import { useEffect } from "react";
|
|
14
14
|
import { AppFrame } from "../components/layout/AppFrame";
|
|
15
15
|
import { AppShellSkeleton } from "../components/layout/AppShellSkeleton";
|
|
16
|
+
import { CalendarTopBar } from "../components/layout/CalendarTopBar";
|
|
17
|
+
import { DesktopChrome } from "../components/layout/DesktopChrome";
|
|
16
18
|
import { useIsWritingEvent } from "../routing";
|
|
17
19
|
import "../lib/client";
|
|
18
20
|
export const Route = createFileRoute("/calendar")({
|
|
@@ -35,9 +37,9 @@ function CalendarLayout() {
|
|
|
35
37
|
navigate({ to: "/onboarding", replace: true });
|
|
36
38
|
}, [hasNoAccounts, navigate]);
|
|
37
39
|
if (isError) {
|
|
38
|
-
return (_jsx("div", { className: "flex h-full items-center justify-center bg-canvas p-4", children: _jsx(ErrorState, { title: "Couldn't load your account", error: error, onRetry: () => {
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
return (_jsx(DesktopChrome, { topBar: _jsx(CalendarTopBar, {}), children: _jsx("div", { className: "flex h-full items-center justify-center bg-canvas p-4", children: _jsx(ErrorState, { title: "Couldn't load your account", error: error, onRetry: () => {
|
|
41
|
+
refetch();
|
|
42
|
+
} }) }) }));
|
|
41
43
|
}
|
|
42
|
-
return (_jsx(AppFrame, { hideTabBar: isWriting, children: isLoading || hasNoAccounts ? _jsx(AppShellSkeleton, {}) : _jsx(Outlet, {}) }));
|
|
44
|
+
return (_jsx(AppFrame, { hideTabBar: isWriting, children: _jsx(DesktopChrome, { topBar: _jsx(CalendarTopBar, {}), children: isLoading || hasNoAccounts ? _jsx(AppShellSkeleton, {}) : _jsx(Outlet, {}) }) }));
|
|
43
45
|
}
|
package/dist/src/routes/mail.js
CHANGED
|
@@ -6,6 +6,8 @@ import { createFileRoute, Outlet, useNavigate, useRouterState, } from "@tanstack
|
|
|
6
6
|
import { useCallback, useEffect, useMemo } from "react";
|
|
7
7
|
import { AppFrame } from "../components/layout/AppFrame";
|
|
8
8
|
import { ComposeFab } from "../components/layout/ComposeFab";
|
|
9
|
+
import { DesktopAppBar } from "../components/layout/DesktopAppBar";
|
|
10
|
+
import { DesktopChrome } from "../components/layout/DesktopChrome";
|
|
9
11
|
import { MailShellProvider } from "../components/layout/MailShell";
|
|
10
12
|
import { MailTopBar } from "../components/layout/MailTopBar";
|
|
11
13
|
import { MailNav } from "../components/mail/MailNav";
|
|
@@ -165,6 +167,7 @@ function MailLayout() {
|
|
|
165
167
|
// and the phone takeover; there is no room for a bar spanning panes that do
|
|
166
168
|
// not exist side by side.
|
|
167
169
|
topBar: isSinglePane ? undefined : _jsx(MailTopBar, { accounts: accounts }),
|
|
170
|
+
appBar: tier === "phone" ? undefined : _jsx(DesktopAppBar, {}),
|
|
168
171
|
// Single-pane only, where the FAB is the compose entry point. Above it the
|
|
169
172
|
// top bar owns compose.
|
|
170
173
|
overlay: isSinglePane ? _jsx(ComposeFab, {}) : undefined,
|
|
@@ -172,9 +175,9 @@ function MailLayout() {
|
|
|
172
175
|
onOpenNav: () => showOverlay("nav"),
|
|
173
176
|
onCloseNav: () => showOverlay(undefined),
|
|
174
177
|
};
|
|
175
|
-
return (_jsx(MailContext.Provider, { value: mailContextValue, children: _jsxs(MailFreshnessProvider, { accountIds: accountIds, children: [_jsx(AppFrame, { children: isConfigError ? (_jsx("div", { className: "flex h-full items-center justify-center bg-canvas p-4", children: _jsx(ErrorState, { title: "Couldn't load your account", error: configError, onRetry: () => {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
+
return (_jsx(MailContext.Provider, { value: mailContextValue, children: _jsxs(MailFreshnessProvider, { accountIds: accountIds, children: [_jsx(AppFrame, { children: isConfigError ? (_jsx(DesktopChrome, { topBar: _jsx(MailTopBar, { accounts: accounts }), children: _jsx("div", { className: "flex h-full items-center justify-center bg-canvas p-4", children: _jsx(ErrorState, { title: "Couldn't load your account", error: configError, onRetry: () => {
|
|
179
|
+
refetchConfig();
|
|
180
|
+
} }) }) })) : (
|
|
178
181
|
// Each list route mounts its own shell around its own panes.
|
|
179
182
|
_jsx(MailShellProvider, { chrome: shellChrome, children: _jsx(Outlet, {}) })) }), _jsx(KeyboardShortcutsModal, { isOpen: showShortcuts, onClose: () => showOverlay(undefined) })] }) }));
|
|
180
183
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remit/web-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.331",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Remit web client, published as composable primitives — the app shell, auth shells, and runtime config. A distributor imports what it composes and bundles it.",
|
|
6
6
|
"exports": {
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"@hookform/resolvers": "5.4.0",
|
|
94
|
-
"@remit/ui": "0.0.
|
|
94
|
+
"@remit/ui": "0.0.227",
|
|
95
95
|
"@tanstack/react-query": "5.101.2",
|
|
96
96
|
"@tanstack/react-query-devtools": "5.101.2",
|
|
97
97
|
"@tanstack/react-router": "1.170.18",
|