@checkstack/api-docs-frontend 0.1.8 → 0.1.10

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/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @checkstack/api-docs-frontend
2
2
 
3
+ ## 0.1.10
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [090143b]
8
+ - @checkstack/ui@0.5.1
9
+
10
+ ## 0.1.9
11
+
12
+ ### Patch Changes
13
+
14
+ - 223081d: Add icon support to PageLayout and improve mobile responsiveness
15
+
16
+ **PageLayout Icons:**
17
+
18
+ - Added required `icon` prop to `PageLayout` and `PageHeader` components that accepts a Lucide icon component reference
19
+ - Icons are rendered with consistent `h-6 w-6 text-primary` styling
20
+ - Updated all page components to include appropriate icons in their headers
21
+
22
+ **Mobile Layout Improvements:**
23
+
24
+ - Standardized responsive padding in main app shell (`p-3` on mobile, `p-6` on desktop)
25
+ - Added `CardHeaderRow` component for mobile-safe card headers with proper wrapping
26
+ - Improved `DateRangeFilter` responsive behavior with vertical stacking on mobile
27
+ - Migrated pages to use `PageLayout` for consistent responsive behavior
28
+
29
+ - Updated dependencies [223081d]
30
+ - @checkstack/ui@0.5.0
31
+
3
32
  ## 0.1.8
4
33
 
5
34
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/api-docs-frontend",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "type": "module",
5
5
  "main": "src/index.tsx",
6
6
  "scripts": {
@@ -7,6 +7,7 @@ import {
7
7
  CardTitle,
8
8
  Badge,
9
9
  Button,
10
+ PageLayout,
10
11
  } from "@checkstack/ui";
11
12
  import {
12
13
  ChevronDown,
@@ -17,6 +18,7 @@ import {
17
18
  Globe,
18
19
  User,
19
20
  Server,
21
+ FileCode,
20
22
  } from "lucide-react";
21
23
 
22
24
  interface OpenApiSpec {
@@ -125,7 +127,7 @@ function CopyButton({ text }: { text: string }) {
125
127
  function generateFetchExample(
126
128
  path: string,
127
129
  method: string,
128
- operation: OperationObject
130
+ operation: OperationObject,
129
131
  ): string {
130
132
  const baseUrl = "http://localhost:3000";
131
133
  const hasBody = operation.requestBody?.content?.["application/json"]?.schema;
@@ -292,7 +294,9 @@ function EndpointCard({
292
294
 
293
295
  {meta?.accessRules && meta.accessRules.length > 0 && (
294
296
  <div>
295
- <h4 className="text-sm font-medium mb-2">Required Access Rules</h4>
297
+ <h4 className="text-sm font-medium mb-2">
298
+ Required Access Rules
299
+ </h4>
296
300
  <div className="flex flex-wrap gap-2">
297
301
  {meta.accessRules.map((perm) => (
298
302
  <Badge key={perm} variant="secondary">
@@ -346,7 +350,7 @@ export function ApiDocsPage() {
346
350
  const [error, setError] = useState<string>();
347
351
  // Default to showing externally accessible endpoints only
348
352
  const [selectedTypes, setSelectedTypes] = useState<Set<string>>(
349
- new Set(["authenticated", "public"])
353
+ new Set(["authenticated", "public"]),
350
354
  );
351
355
 
352
356
  const toggleType = (type: string) => {
@@ -384,24 +388,18 @@ export function ApiDocsPage() {
384
388
  void fetchSpec();
385
389
  }, []);
386
390
 
387
- if (loading) {
391
+ if (loading || !spec) {
388
392
  return (
389
- <div className="container mx-auto py-8">
390
- <div className="animate-pulse">Loading API documentation...</div>
391
- </div>
392
- );
393
- }
394
-
395
- if (error || !spec) {
396
- return (
397
- <div className="container mx-auto py-8">
398
- <Card>
399
- <CardHeader>
400
- <CardTitle>Error Loading API Documentation</CardTitle>
401
- <CardDescription>{error ?? "Unknown error"}</CardDescription>
402
- </CardHeader>
403
- </Card>
404
- </div>
393
+ <PageLayout title="API Documentation" icon={FileCode} loading={loading}>
394
+ {error && (
395
+ <Card>
396
+ <CardHeader>
397
+ <CardTitle>Error Loading API Documentation</CardTitle>
398
+ <CardDescription>{error}</CardDescription>
399
+ </CardHeader>
400
+ </Card>
401
+ )}
402
+ </PageLayout>
405
403
  );
406
404
  }
407
405
 
@@ -433,14 +431,14 @@ export function ApiDocsPage() {
433
431
  }
434
432
 
435
433
  return (
436
- <div className="container mx-auto py-8 space-y-6">
437
- <div>
438
- <h1 className="text-3xl font-bold">{spec.info.title}</h1>
439
- <p className="text-muted-foreground mt-2">{spec.info.description}</p>
440
- <Badge variant="secondary" className="mt-2">
441
- v{spec.info.version}
442
- </Badge>
443
- </div>
434
+ <PageLayout
435
+ title={spec.info.title}
436
+ subtitle={spec.info.description}
437
+ icon={FileCode}
438
+ loading={loading}
439
+ maxWidth="full"
440
+ >
441
+ <Badge variant="secondary">v{spec.info.version}</Badge>
444
442
 
445
443
  <div className="flex flex-wrap items-center gap-2">
446
444
  <span className="text-sm text-muted-foreground">Filter by access:</span>
@@ -518,6 +516,6 @@ export function ApiDocsPage() {
518
516
  </div>
519
517
  ))}
520
518
  </div>
521
- </div>
519
+ </PageLayout>
522
520
  );
523
521
  }