zudoku 0.4.5-dev.0 → 0.4.5-dev.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.4.5-dev.0",
3
+ "version": "0.4.5-dev.2",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
package/src/app/demo.tsx CHANGED
@@ -35,6 +35,9 @@ if (!root) {
35
35
  const config = {
36
36
  page: {
37
37
  pageTitle: "",
38
+ banner: {
39
+ message: <DemoAnnouncement />,
40
+ },
38
41
  },
39
42
  topNavigation: [
40
43
  {
@@ -42,9 +45,6 @@ const config = {
42
45
  label: "API Reference",
43
46
  },
44
47
  ],
45
- slotlets: {
46
- "layout-before-head": <DemoAnnouncement />,
47
- },
48
48
  plugins: [
49
49
  // Using the plugin directly because there's no config file to load in the virtual plugins
50
50
  openApiPlugin({
package/src/app/main.css CHANGED
@@ -80,8 +80,11 @@
80
80
  :root {
81
81
  --top-header-height: 65px;
82
82
  --top-nav-height: 50px;
83
+ --banner-height: 48px;
83
84
  --side-nav-width: theme("spacing.72");
84
- --header-height: calc(var(--top-header-height) + var(--top-nav-height));
85
+ --header-height: calc(
86
+ var(--top-header-height) + var(--top-nav-height) + var(--banner-height)
87
+ );
85
88
  --scroll-padding: calc(var(--header-height) + 10px);
86
89
  --padding-content-top: theme("spacing.12");
87
90
  --padding-content-bottom: theme("spacing.12");
@@ -60,6 +60,15 @@ export const Header = memo(function HeaderInner() {
60
60
 
61
61
  return (
62
62
  <header className="sticky lg:top-0 z-10 bg-background/80 backdrop-blur w-full">
63
+ <>
64
+ {page?.banner ? (
65
+ <div className="h-[--banner-height] bg-primary/90 text-primary-foreground text-center text-sm font-medium py-2 flex items-center justify-center">
66
+ <div>{page.banner.message}</div>
67
+ </div>
68
+ ) : (
69
+ <style>{`:root{--banner-height: 0}`}</style>
70
+ )}
71
+ </>
63
72
  <div className="max-w-screen-2xl mx-auto">
64
73
  <div className="grid grid-cols-2 lg:grid-cols-[calc(var(--side-nav-width))_1fr] lg:gap-12 items-center border-b px-10 lg:px-12 h-[--top-header-height]">
65
74
  <div className="flex">
@@ -25,7 +25,7 @@ export const Layout = ({ children }: { children?: ReactNode }) => {
25
25
 
26
26
  useEffect(() => {
27
27
  // Initialize the authentication plugin
28
- authentication?.pageLoad ? authentication.pageLoad() : null;
28
+ authentication?.pageLoad?.();
29
29
  }, [authentication]);
30
30
 
31
31
  useEffect(() => {
@@ -1,4 +1,5 @@
1
1
  import { QueryClient } from "@tanstack/react-query";
2
+ import { ReactNode } from "react";
2
3
  import type { SidebarConfig } from "../../config/validators/SidebarSchema.js";
3
4
  import { type AuthenticationProvider } from "../authentication/authentication.js";
4
5
  import type { ComponentsContextType } from "../components/context/ComponentsContext.js";
@@ -48,6 +49,9 @@ type Page = Partial<{
48
49
  width?: string;
49
50
  alt?: string;
50
51
  };
52
+ banner?: {
53
+ message: ReactNode;
54
+ };
51
55
  }>;
52
56
 
53
57
  export type ZudokuContextOptions = {
@@ -1,14 +1,17 @@
1
- export const DemoAnnouncement = () => (
2
- <div className="h-12 w-full bg-pink-900 text-pink-100 text-center text-sm font-medium py-2 flex items-center justify-center ">
3
- This demo hosting of your OpenAPI isn't as fast or flexible as self-hosting;{" "}
4
- <a
5
- href="https://github.com/zuplo/zudoku"
6
- className="px-1 underline hover:white"
7
- >
8
- Get started here
9
- </a>{" "}
10
- to see Zudoku at full tilt.
11
- </div>
12
- );
1
+ export const DemoAnnouncement = () => {
2
+ return (
3
+ <>
4
+ This demo hosting of your OpenAPI isn't as fast or flexible as
5
+ self-hosting;{" "}
6
+ <a
7
+ href="https://github.com/zuplo/zudoku"
8
+ className="px-1 underline hover:white"
9
+ >
10
+ Get started here
11
+ </a>{" "}
12
+ to see Zudoku at full tilt.
13
+ </>
14
+ );
15
+ };
13
16
 
14
17
  export default DemoAnnouncement;