tempest-react-sdk 0.12.0 → 0.13.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/dist/styles.css +1 -1
- package/dist/tempest-react-sdk.cjs +3 -3
- package/dist/tempest-react-sdk.cjs.map +1 -1
- package/dist/tempest-react-sdk.d.ts +60 -0
- package/dist/tempest-react-sdk.js +2546 -2478
- package/dist/tempest-react-sdk.js.map +1 -1
- package/package.json +1 -1
|
@@ -243,6 +243,66 @@ export declare interface ApiError {
|
|
|
243
243
|
body?: unknown;
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
+
/**
|
|
247
|
+
* Mobile-first top app bar for PWAs — leading (back / brand) + title +
|
|
248
|
+
* trailing actions, sticky with safe-area padding out of the box.
|
|
249
|
+
*
|
|
250
|
+
* Consumers customise via tokens (`--tempest-*`) and slots; the SDK ships the
|
|
251
|
+
* layout, sticky/safe-area behaviour, and accessible back button so apps don't
|
|
252
|
+
* hand-roll one per screen. For a desktop three-slot nav use [[Navbar]].
|
|
253
|
+
*
|
|
254
|
+
* @example
|
|
255
|
+
* // Detail screen with back + a trailing action
|
|
256
|
+
* <AppBar
|
|
257
|
+
* title="Profile"
|
|
258
|
+
* showBack
|
|
259
|
+
* onBack={() => navigate(-1)}
|
|
260
|
+
* actions={<IconButton icon={<Settings />} onClick={openSettings} />}
|
|
261
|
+
* />
|
|
262
|
+
*
|
|
263
|
+
* @example
|
|
264
|
+
* // Home screen — brand left, centered title disabled
|
|
265
|
+
* <AppBar brand={<Logo />} actions={<UserMenu />} />
|
|
266
|
+
*/
|
|
267
|
+
export declare function AppBar({ title, leading, showBack, onBack, backLabel, backIcon, brand, actions, centered, sticky, tone, bordered, safeArea, className, ...props }: AppBarProps): JSX.Element;
|
|
268
|
+
|
|
269
|
+
export declare interface AppBarProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
|
|
270
|
+
/** Page title — string or any node. Rendered as the bar's `<h1>`. */
|
|
271
|
+
title?: ReactNode;
|
|
272
|
+
/**
|
|
273
|
+
* Replace the whole left slot. When set, the auto back button and `brand`
|
|
274
|
+
* are ignored — you own the leading content.
|
|
275
|
+
*/
|
|
276
|
+
leading?: ReactNode;
|
|
277
|
+
/** Show a back button in the left slot. Ignored when `leading` is set. */
|
|
278
|
+
showBack?: boolean;
|
|
279
|
+
/**
|
|
280
|
+
* Back-button handler. Defaults to `window.history.back()`. With a router,
|
|
281
|
+
* pass `onBack={() => navigate(-1)}`.
|
|
282
|
+
*/
|
|
283
|
+
onBack?: () => void;
|
|
284
|
+
/** Accessible label for the back button. Default `"Go back"`. */
|
|
285
|
+
backLabel?: string;
|
|
286
|
+
/** Custom back icon. Default a left arrow. */
|
|
287
|
+
backIcon?: ReactNode;
|
|
288
|
+
/** Brand / logo node shown in the left slot (after the back button). */
|
|
289
|
+
brand?: ReactNode;
|
|
290
|
+
/** Right slot — action buttons / menu. One node or many. */
|
|
291
|
+
actions?: ReactNode;
|
|
292
|
+
/** Center the title (three-column grid). Default `false` (left-aligned). */
|
|
293
|
+
centered?: boolean;
|
|
294
|
+
/** Stick to the top of the scroll container. Default `true`. */
|
|
295
|
+
sticky?: boolean;
|
|
296
|
+
/** Visual tone. Default `"surface"`. */
|
|
297
|
+
tone?: AppBarTone;
|
|
298
|
+
/** Thin bottom border. Default `true`. */
|
|
299
|
+
bordered?: boolean;
|
|
300
|
+
/** Add `env(safe-area-inset-top)` padding (iOS notch / PWA). Default `true`. */
|
|
301
|
+
safeArea?: boolean;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export declare type AppBarTone = "surface" | "primary" | "transparent";
|
|
305
|
+
|
|
246
306
|
/**
|
|
247
307
|
* Compose the Tempest app-wide providers in one place: error boundary →
|
|
248
308
|
* TanStack Query → theme → i18n. Query and theme are on by default; i18n and
|