zudoku 0.24.1 → 0.25.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.
Files changed (45) hide show
  1. package/dist/lib/components/Header.js +13 -13
  2. package/dist/lib/components/Header.js.map +1 -1
  3. package/dist/lib/components/Layout.js +1 -1
  4. package/dist/lib/components/Layout.js.map +1 -1
  5. package/dist/lib/components/TopNavigation.js +2 -2
  6. package/dist/lib/components/TopNavigation.js.map +1 -1
  7. package/dist/lib/components/navigation/SidebarWrapper.js +1 -1
  8. package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -1
  9. package/dist/lib/plugins/openapi/CollapsibleCode.js +2 -1
  10. package/dist/lib/plugins/openapi/CollapsibleCode.js.map +1 -1
  11. package/dist/lib/plugins/openapi/Endpoint.js +1 -1
  12. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  13. package/dist/lib/plugins/openapi/Sidecar.js +1 -1
  14. package/dist/lib/plugins/openapi/SidecarBox.js +4 -4
  15. package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
  16. package/dist/lib/plugins/openapi/playground/Headers.js +1 -1
  17. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  18. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
  19. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
  20. package/dist/lib/ui/Card.js +1 -1
  21. package/dist/lib/ui/Card.js.map +1 -1
  22. package/lib/{OperationList-CqLL5P5l.js → OperationList-c6V_vcgz.js} +787 -802
  23. package/lib/OperationList-c6V_vcgz.js.map +1 -0
  24. package/lib/{index-DzRORsY1.js → index-DkwDHnit.js} +4 -3
  25. package/lib/index-DkwDHnit.js.map +1 -0
  26. package/lib/ui/Card.js +7 -7
  27. package/lib/ui/Card.js.map +1 -1
  28. package/lib/zudoku.components.js +140 -140
  29. package/lib/zudoku.components.js.map +1 -1
  30. package/lib/zudoku.plugin-openapi.js +1 -1
  31. package/package.json +1 -1
  32. package/src/app/main.css +50 -37
  33. package/src/lib/components/Header.tsx +9 -5
  34. package/src/lib/components/Layout.tsx +1 -1
  35. package/src/lib/components/TopNavigation.tsx +2 -2
  36. package/src/lib/components/navigation/SidebarWrapper.tsx +2 -2
  37. package/src/lib/plugins/openapi/CollapsibleCode.tsx +10 -7
  38. package/src/lib/plugins/openapi/Endpoint.tsx +1 -3
  39. package/src/lib/plugins/openapi/Sidecar.tsx +2 -2
  40. package/src/lib/plugins/openapi/SidecarBox.tsx +4 -16
  41. package/src/lib/plugins/openapi/playground/Headers.tsx +1 -0
  42. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
  43. package/src/lib/ui/Card.tsx +1 -1
  44. package/lib/OperationList-CqLL5P5l.js.map +0 -1
  45. package/lib/index-DzRORsY1.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import "./jsx-runtime-Dx-03ztt.js";
2
2
  import "./chunk-D52XG6IA-Dl7HLe6j.js";
3
- import { o as a } from "./index-DzRORsY1.js";
3
+ import { o as a } from "./index-DkwDHnit.js";
4
4
  import "./ZudokuContext-hmLMUdf2.js";
5
5
  import "lucide-react";
6
6
  import "./hook-CHq7pFyz.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.24.1",
3
+ "version": "0.25.0",
4
4
  "type": "module",
5
5
  "homepage": "https://zudoku.dev",
6
6
  "repository": {
package/src/app/main.css CHANGED
@@ -85,8 +85,8 @@
85
85
  var(--top-header-height) + var(--top-nav-height) + var(--banner-height)
86
86
  );
87
87
  --scroll-padding: calc(var(--header-height) + 10px);
88
- --side-nav-width: theme("spacing.72");
89
- --padding-content-top: theme("spacing.12");
88
+ --side-nav-width: theme("spacing.80");
89
+ --padding-content-top: theme("spacing.6");
90
90
  --padding-content-bottom: theme("spacing.12");
91
91
  --padding-nav-item: theme("spacing[2.5]");
92
92
  --sidecar-grid-cols: 1fr minmax(200px, 260px);
@@ -238,48 +238,61 @@
238
238
  }
239
239
 
240
240
  /* Theme */
241
+
242
+ @layer base {
241
243
  :root {
242
244
  --background: 0 0% 100%;
243
- --foreground: 222.2 84% 4.9%;
245
+ --foreground: 240 10% 3.9%;
244
246
  --card: 0 0% 100%;
245
- --card-foreground: 222.2 84% 4.9%;
247
+ --card-foreground: 240 10% 3.9%;
246
248
  --popover: 0 0% 100%;
247
- --popover-foreground: 222.2 84% 4.9%;
248
- --primary: 221.2 83.2% 53.3%;
249
- --primary-foreground: 210 40% 98%;
250
- --secondary: 210 40% 96.1%;
251
- --secondary-foreground: 222.2 47.4% 11.2%;
252
- --muted: 210 40% 96.1%;
253
- --muted-foreground: 215.4 16.3% 46.9%;
254
- --accent: 210 40% 96.1%;
255
- --accent-foreground: 222.2 47.4% 11.2%;
256
- --destructive: 0 72.22% 50.59%;
257
- --destructive-foreground: 210 40% 98%;
258
- --border: 214.3 31.8% 91.4%;
259
- --input: 214.3 31.8% 91.4%;
260
- --ring: var(--primary);
261
- --radius: 0.5rem;
249
+ --popover-foreground: 240 10% 3.9%;
250
+ --primary: 240 5.9% 10%;
251
+ --primary-foreground: 0 0% 98%;
252
+ --secondary: 240 4.8% 95.9%;
253
+ --secondary-foreground: 240 5.9% 10%;
254
+ --muted: 240 4.8% 95.9%;
255
+ --muted-foreground: 240 3.8% 46.1%;
256
+ --accent: 240 4.8% 95.9%;
257
+ --accent-foreground: 240 5.9% 10%;
258
+ --destructive: 0 84.2% 60.2%;
259
+ --destructive-foreground: 0 0% 98%;
260
+ --border: 240 5.9% 95%;
261
+ --input: 240 5.9% 90%;
262
+ --ring: 240 5.9% 10%;
263
+ --radius: 0.75rem;
264
+ --chart-1: 12 76% 61%;
265
+ --chart-2: 173 58% 39%;
266
+ --chart-3: 197 37% 24%;
267
+ --chart-4: 43 74% 66%;
268
+ --chart-5: 27 87% 67%;
262
269
  }
263
270
 
264
271
  .dark {
265
- --background: 222.2 84% 4.9%;
266
- --foreground: 210 40% 98%;
267
- --card: 222.2 84% 4.9%;
268
- --card-foreground: 210 40% 98%;
269
- --popover: 222.2 84% 4.9%;
270
- --popover-foreground: 210 40% 98%;
271
- --primary: 217.2 91.2% 59.8%;
272
- --primary-foreground: 210 40% 98%;
273
- --secondary: 217.2 32.6% 17.5%;
274
- --secondary-foreground: 210 40% 98%;
275
- --muted: 217.2 32.6% 17.5%;
276
- --muted-foreground: 215 20.2% 65.1%;
277
- --accent: 217.2 32.6% 17.5%;
278
- --accent-foreground: 210 40% 98%;
272
+ --background: 240 10% 3.9%;
273
+ --foreground: 0 0% 98%;
274
+ --card: 240 10% 3.9%;
275
+ --card-foreground: 0 0% 98%;
276
+ --popover: 240 10% 3.9%;
277
+ --popover-foreground: 0 0% 98%;
278
+ --primary: 0 0% 98%;
279
+ --primary-foreground: 240 5.9% 10%;
280
+ --secondary: 240 3.7% 15.9%;
281
+ --secondary-foreground: 0 0% 98%;
282
+ --muted: 240 3.7% 15.9%;
283
+ --muted-foreground: 240 5% 64.9%;
284
+ --accent: 240 3.7% 15.9%;
285
+ --accent-foreground: 0 0% 98%;
279
286
  --destructive: 0 62.8% 30.6%;
280
- --destructive-foreground: 210 40% 98%;
281
- --border: 217.2 32.6% 17.5%;
282
- --input: 217.2 32.6% 17.5%;
283
- --ring: var(--primary);
287
+ --destructive-foreground: 0 0% 98%;
288
+ --border: 240 3.7% 15.9%;
289
+ --input: 240 3.7% 15.9%;
290
+ --ring: 240 4.9% 83.9%;
291
+ --chart-1: 220 70% 50%;
292
+ --chart-2: 160 60% 45%;
293
+ --chart-3: 30 80% 55%;
294
+ --chart-4: 280 65% 60%;
295
+ --chart-5: 340 75% 55%;
296
+ }
284
297
  }
285
298
  }
@@ -65,8 +65,8 @@ export const Header = memo(function HeaderInner() {
65
65
  return (
66
66
  <header className="sticky lg:top-0 z-10 bg-background/80 backdrop-blur w-full">
67
67
  <Banner />
68
- <div className="max-w-screen-2xl mx-auto">
69
- <div className="grid grid-cols-[1fr_auto] lg:grid-cols-[calc(var(--side-nav-width))_1fr] lg:gap-12 items-center border-b px-4 lg:px-12 h-[--top-header-height]">
68
+ <div className="border-b">
69
+ <div className="max-w-screen-2xl border-l border-r mx-auto grid grid-cols-[1fr_auto] lg:grid-cols-[calc(var(--side-nav-width))_1fr] lg:gap-12 items-center px-4 lg:px-12 h-[--top-header-height]">
70
70
  <div className="flex">
71
71
  <Link to="/">
72
72
  <div className="flex items-center gap-3.5">
@@ -176,9 +176,13 @@ export const Header = memo(function HeaderInner() {
176
176
  </div>
177
177
  </div>
178
178
  </div>
179
- <Slotlet name="top-navigation-before" />
180
- <TopNavigation />
181
- <Slotlet name="top-navigation-after" />
179
+ </div>
180
+ <div className="border-b">
181
+ <div className="max-w-screen-2xl mx-auto border-l border-r">
182
+ <Slotlet name="top-navigation-before" />
183
+ <TopNavigation />
184
+ <Slotlet name="top-navigation-after" />
185
+ </div>
182
186
  </div>
183
187
  </header>
184
188
  );
@@ -66,7 +66,7 @@ export const Layout = ({ children }: { children?: ReactNode }) => {
66
66
  <Header />
67
67
  <Slotlet name="layout-after-head" />
68
68
 
69
- <div className="w-full max-w-screen-2xl mx-auto px-4 lg:px-12">
69
+ <div className="w-full max-w-screen-2xl mx-auto px-4 lg:px-12 border-l border-r">
70
70
  {showSpinner ? (
71
71
  <LoadingFallback />
72
72
  ) : (
@@ -30,7 +30,7 @@ export const TopNavigation = () => {
30
30
 
31
31
  return (
32
32
  <Suspense>
33
- <nav className="hidden lg:block border-b text-sm px-12 h-[--top-nav-height]">
33
+ <nav className="hidden lg:block text-sm px-12 h-[--top-nav-height]">
34
34
  <ul className="flex flex-row items-center gap-8">
35
35
  {topNavigation.filter(isHiddenItem(isAuthenticated)).map((item) => (
36
36
  <li key={item.id}>
@@ -78,7 +78,7 @@ export const TopNavItem = ({
78
78
  <NavLink
79
79
  className={({ isPending }) =>
80
80
  cx(
81
- "block lg:py-3.5 font-medium -mb-px border-b-2",
81
+ "block lg:py-3.5 font-medium -mb-px",
82
82
  isActive || isPending
83
83
  ? "border-primary text-foreground"
84
84
  : "border-transparent text-foreground/75 hover:text-foreground hover:border-accent-foreground/25",
@@ -12,8 +12,8 @@ export const SidebarWrapper = forwardRef<
12
12
  // maybe this could be simplified by adjusting the layout
13
13
  data-navigation={String(pushMainContent)}
14
14
  className={cn(
15
- "scrollbar peer hidden lg:flex flex-col fixed text-sm overflow-y-auto shrink-0",
16
- "-mx-[--padding-nav-item] pb-20 mt-[--padding-content-top]",
15
+ "scrollbar peer hidden lg:flex flex-col fixed text-sm overflow-y-auto shrink-0 border-r pr-10",
16
+ "-mx-[--padding-nav-item] pb-20 pt-[--padding-content-top]",
17
17
  "w-[--side-nav-width] h-[calc(100%-var(--header-height))] scroll-pt-2 gap-2",
18
18
  className,
19
19
  )}
@@ -1,3 +1,4 @@
1
+ import { FoldVerticalIcon, UnfoldVerticalIcon } from "lucide-react";
1
2
  import { type CSSProperties, type ReactNode, useRef, useState } from "react";
2
3
  import { Button } from "zudoku/ui/Button.js";
3
4
  import {
@@ -43,22 +44,23 @@ export const CollapsibleCode = ({
43
44
  <CollapsibleContent
44
45
  forceMount
45
46
  className={cn(
46
- "relative overflow-hidden",
47
+ "relative overflow-hidden group",
47
48
  !open && isOverflowing && "max-h-[--max-height]",
48
49
  )}
49
50
  >
50
51
  {!open && isOverflowing && (
51
- <div className="absolute inset-0 bg-gradient-to-b from-transparent to-zinc-50/90 dark:to-zinc-800/90 z-10"></div>
52
+ <div className=" absolute inset-0 bg-gradient-to-b from-transparent to-zinc-50/90 dark:to-zinc-800/90 z-10 group-hover:to-transparent"></div>
52
53
  )}
53
54
  <div ref={contentRef}>{children}</div>
54
55
  {!open && isOverflowing && (
55
56
  <CollapsibleTrigger
56
- className="absolute inset-0 grid place-items-center z-10"
57
+ className="absolute inset-0 grid place-items-center z-10 cursor-pointer peer"
57
58
  asChild
58
59
  >
59
60
  <div>
60
- <Button className="bg-primary/70 border border-accent-foreground/25">
61
- Expand code
61
+ <Button variant="outline" className="hidden group-hover:flex">
62
+ <UnfoldVerticalIcon size={14} className="mr-1.5" />
63
+ Click to expand
62
64
  </Button>
63
65
  </div>
64
66
  </CollapsibleTrigger>
@@ -69,8 +71,9 @@ export const CollapsibleCode = ({
69
71
  className={cn("flex justify-center w-full mb-2", !open && "hidden")}
70
72
  >
71
73
  <CollapsibleTrigger asChild>
72
- <Button className="border border-accent-foreground/25">
73
- Collapse code
74
+ <Button variant="outline" size="sm">
75
+ Collapse
76
+ <FoldVerticalIcon size={14} className="ml-1.5" />
74
77
  </Button>
75
78
  </CollapsibleTrigger>
76
79
  </div>
@@ -66,9 +66,7 @@ export const Endpoint = () => {
66
66
 
67
67
  return (
68
68
  <div className="flex flex-wrap items-center gap-2">
69
- <span className="font-medium text-sm">
70
- {servers.length > 1 ? "Endpoints" : "Endpoint"}:
71
- </span>
69
+ <span className="font-medium text-sm">Endpoint</span>
72
70
 
73
71
  <SimpleSelect
74
72
  className="font-mono text-xs bg-border/50 dark:bg-border/70 py-1.5 max-w-[450px] truncate"
@@ -181,7 +181,7 @@ export const Sidecar = ({
181
181
  className="flex flex-col overflow-hidden sticky top-[--scroll-padding] gap-4"
182
182
  >
183
183
  <SidecarBox.Root>
184
- <SidecarBox.Head className="flex justify-between items-center flex-nowrap py-3 gap-2 text-xs">
184
+ <SidecarBox.Head className="flex justify-between items-center flex-nowrap py-4 gap-2 text-xs">
185
185
  <span className="font-mono break-words">
186
186
  <span className={cn("font-semibold", methodTextColor)}>
187
187
  {operation.method.toLocaleUpperCase()}
@@ -211,7 +211,7 @@ export const Sidecar = ({
211
211
  />
212
212
  </CollapsibleCode>
213
213
  </SidecarBox.Body>
214
- <SidecarBox.Footer className="flex items-center text-xs gap-2 justify-end py-1">
214
+ <SidecarBox.Footer className="flex items-center text-xs gap-2 justify-end py-3">
215
215
  <span>Show example in</span>
216
216
  <SimpleSelect
217
217
  className="self-start max-w-[150px]"
@@ -7,10 +7,7 @@ type BaseComponentProps<T = unknown> = PropsWithChildren<
7
7
 
8
8
  export const Root = ({ children, className }: BaseComponentProps) => (
9
9
  <div
10
- className={cn(
11
- "rounded-lg overflow-hidden border dark:border-transparent",
12
- className,
13
- )}
10
+ className={cn("rounded-xl overflow-hidden border border-border", className)}
14
11
  >
15
12
  {children}
16
13
  </div>
@@ -19,7 +16,7 @@ export const Root = ({ children, className }: BaseComponentProps) => (
19
16
  export const Head = ({ children, className }: BaseComponentProps) => (
20
17
  <div
21
18
  className={cn(
22
- "border-b dark:border-zinc-600 bg-zinc-100 dark:bg-zinc-700 p-2",
19
+ "border-b bg-muted dark:bg-transparent text-card-foreground p-3",
23
20
  className,
24
21
  )}
25
22
  >
@@ -28,20 +25,11 @@ export const Head = ({ children, className }: BaseComponentProps) => (
28
25
  );
29
26
 
30
27
  export const Body = ({ children, className }: BaseComponentProps) => (
31
- <div
32
- className={cn("bg-zinc-50 dark:bg-zinc-800 overflow-auto p-2", className)}
33
- >
34
- {children}
35
- </div>
28
+ <div className={cn("bg-card overflow-auto p-2", className)}>{children}</div>
36
29
  );
37
30
 
38
31
  export const Footer = ({ children, className }: BaseComponentProps) => (
39
- <div
40
- className={cn(
41
- "border-t dark:border-zinc-600 bg-zinc-100 dark:bg-zinc-700 p-2",
42
- className,
43
- )}
44
- >
32
+ <div className={cn("border-t bg-muted dark:bg-transparent p-3", className)}>
45
33
  {children}
46
34
  </div>
47
35
  );
@@ -63,6 +63,7 @@ export const Headers = ({
63
63
  className=""
64
64
  onClick={() => append({ name: "", value: "" })}
65
65
  type="button"
66
+ variant="secondary"
66
67
  >
67
68
  Add header
68
69
  </Button>
@@ -39,7 +39,7 @@ const PlaygroundDialog = (props: PlaygroundDialogProps) => {
39
39
  <Dialog onOpenChange={(open) => setOpen(open)}>
40
40
  <DialogTrigger asChild>
41
41
  {props.children ?? (
42
- <button className="flex gap-1 items-center px-2 py-1 rounded-md bg-primary/80 hover:bg-primary transition text-primary-foreground text-xs">
42
+ <button className="flex gap-1 items-center px-2 py-1 rounded-md transition text-xs bg-primary text-primary-foreground shadow-sm hover:bg-primary/80">
43
43
  Test
44
44
  <HeroPlayIcon className="" size={14} />
45
45
  </button>
@@ -8,7 +8,7 @@ const Card = React.forwardRef<
8
8
  <div
9
9
  ref={ref}
10
10
  className={cn(
11
- "rounded-xl border bg-card text-card-foreground shadow",
11
+ "rounded-xl border bg-card text-card-foreground shadow-sm",
12
12
  className,
13
13
  )}
14
14
  {...props}