@checkstack/api-docs-frontend 0.1.8 → 0.1.9
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 +22 -0
- package/package.json +1 -1
- package/src/ApiDocsPage.tsx +27 -29
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @checkstack/api-docs-frontend
|
|
2
2
|
|
|
3
|
+
## 0.1.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 223081d: Add icon support to PageLayout and improve mobile responsiveness
|
|
8
|
+
|
|
9
|
+
**PageLayout Icons:**
|
|
10
|
+
|
|
11
|
+
- Added required `icon` prop to `PageLayout` and `PageHeader` components that accepts a Lucide icon component reference
|
|
12
|
+
- Icons are rendered with consistent `h-6 w-6 text-primary` styling
|
|
13
|
+
- Updated all page components to include appropriate icons in their headers
|
|
14
|
+
|
|
15
|
+
**Mobile Layout Improvements:**
|
|
16
|
+
|
|
17
|
+
- Standardized responsive padding in main app shell (`p-3` on mobile, `p-6` on desktop)
|
|
18
|
+
- Added `CardHeaderRow` component for mobile-safe card headers with proper wrapping
|
|
19
|
+
- Improved `DateRangeFilter` responsive behavior with vertical stacking on mobile
|
|
20
|
+
- Migrated pages to use `PageLayout` for consistent responsive behavior
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [223081d]
|
|
23
|
+
- @checkstack/ui@0.5.0
|
|
24
|
+
|
|
3
25
|
## 0.1.8
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/package.json
CHANGED
package/src/ApiDocsPage.tsx
CHANGED
|
@@ -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">
|
|
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
|
-
<
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
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
|
-
<
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
</
|
|
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
|
-
</
|
|
519
|
+
</PageLayout>
|
|
522
520
|
);
|
|
523
521
|
}
|