@specglass/theme-default 0.0.9 → 0.0.11
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/__tests__/design-tokens.test.d.ts +1 -0
- package/dist/__tests__/design-tokens.test.js +107 -0
- package/dist/islands/CopyButton.js +2 -6
- package/dist/islands/LanguageToggle.d.ts +16 -0
- package/dist/islands/LanguageToggle.js +88 -0
- package/dist/islands/SearchPalette.js +57 -8
- package/dist/islands/ThemeToggle.js +1 -1
- package/dist/scripts/code-block-enhancer.js +6 -3
- package/dist/themes/notdiamond-dark.json +168 -0
- package/dist/themes/notdiamond-light.json +168 -0
- package/dist/ui/command.js +2 -2
- package/dist/ui/dialog.js +2 -2
- package/dist/utils/shiki.d.ts +1 -1
- package/dist/utils/shiki.js +5 -3
- package/package.json +5 -3
- package/src/components/ApiAuth.astro +31 -4
- package/src/components/ApiEndpoint.astro +67 -44
- package/src/components/ApiNavigation.astro +8 -11
- package/src/components/ApiParameters.astro +113 -162
- package/src/components/ApiResponse.astro +1 -1
- package/src/components/Callout.astro +59 -18
- package/src/components/Card.astro +4 -4
- package/src/components/CodeBlock.astro +7 -7
- package/src/components/CodeBlockGroup.astro +3 -3
- package/src/components/CodeExample.astro +183 -0
- package/src/components/EditLink.astro +53 -0
- package/src/components/Footer.astro +87 -25
- package/src/components/Header.astro +63 -7
- package/src/components/Sidebar.astro +43 -11
- package/src/components/TableOfContents.astro +5 -5
- package/src/components/Tabs.astro +51 -20
- package/src/islands/CopyButton.tsx +36 -34
- package/src/islands/LanguageToggle.tsx +214 -0
- package/src/islands/SearchPalette.tsx +121 -39
- package/src/islands/ThemeToggle.tsx +45 -48
- package/src/layouts/ApiReferencePage.astro +67 -56
- package/src/layouts/DocPage.astro +32 -27
- package/src/layouts/LandingPage.astro +348 -27
- package/src/scripts/code-block-enhancer.ts +8 -3
- package/src/styles/global.css +388 -59
- package/src/themes/notdiamond-dark.json +168 -0
- package/src/themes/notdiamond-light.json +168 -0
- package/src/ui/command.tsx +1 -2
- package/src/ui/dialog.tsx +8 -5
- package/src/utils/shiki.ts +5 -3
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
/**
|
|
3
|
-
* ApiParameters.astro — Displays endpoint parameters and request body.
|
|
4
|
-
*
|
|
3
|
+
* ApiParameters.astro — Displays endpoint parameters and request body schemas.
|
|
4
|
+
* Shows path, query, header, and cookie parameters in a table format,
|
|
5
|
+
* plus request body content schemas when present.
|
|
5
6
|
*/
|
|
6
7
|
import type { ApiParameter, ApiRequestBody } from "@specglass/core";
|
|
7
8
|
import { renderTypeString, flattenSchemaProperties } from "../utils/schema-renderer";
|
|
@@ -13,192 +14,142 @@ export interface Props {
|
|
|
13
14
|
|
|
14
15
|
const { parameters, requestBody } = Astro.props;
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
];
|
|
17
|
+
const parametersByLocation = {
|
|
18
|
+
path: parameters.filter((p) => p.in === "path"),
|
|
19
|
+
query: parameters.filter((p) => p.in === "query"),
|
|
20
|
+
header: parameters.filter((p) => p.in === "header"),
|
|
21
|
+
cookie: parameters.filter((p) => p.in === "cookie"),
|
|
22
|
+
};
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const nonEmptyGroups = paramGroups.filter((g) => g.params.length > 0);
|
|
32
|
-
const hasParameters = nonEmptyGroups.length > 0;
|
|
33
|
-
const hasRequestBody = !!requestBody;
|
|
34
|
-
|
|
35
|
-
// Process request body content types
|
|
36
|
-
const requestBodyEntries = requestBody?.content ? Object.entries(requestBody.content) : [];
|
|
24
|
+
const locationLabels: Record<string, string> = {
|
|
25
|
+
path: "Path Parameters",
|
|
26
|
+
query: "Query Parameters",
|
|
27
|
+
header: "Header Parameters",
|
|
28
|
+
cookie: "Cookie Parameters",
|
|
29
|
+
};
|
|
37
30
|
---
|
|
38
31
|
|
|
32
|
+
{/* Parameter tables by location */}
|
|
39
33
|
{
|
|
40
|
-
(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
{nonEmptyGroups.map((group) => (
|
|
34
|
+
Object.entries(parametersByLocation).map(
|
|
35
|
+
([location, params]) =>
|
|
36
|
+
params.length > 0 && (
|
|
44
37
|
<div class="mb-6">
|
|
45
38
|
<h3 class="text-sm font-semibold text-text-muted uppercase tracking-wider mb-3">
|
|
46
|
-
{
|
|
39
|
+
{locationLabels[location]}
|
|
47
40
|
</h3>
|
|
48
41
|
<div class="border border-border rounded-lg overflow-hidden">
|
|
49
42
|
<table class="w-full text-sm">
|
|
50
43
|
<thead>
|
|
51
|
-
<tr class="
|
|
52
|
-
<th class="text-left px-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<th class="text-left px-
|
|
44
|
+
<tr class="border-b border-border/50 bg-surface-raised">
|
|
45
|
+
<th class="text-left px-3 py-2 text-text-muted font-medium text-xs w-1/4">
|
|
46
|
+
Name
|
|
47
|
+
</th>
|
|
48
|
+
<th class="text-left px-3 py-2 text-text-muted font-medium text-xs w-1/5">
|
|
49
|
+
Type
|
|
50
|
+
</th>
|
|
51
|
+
<th class="text-left px-3 py-2 text-text-muted font-medium text-xs">
|
|
52
|
+
Description
|
|
53
|
+
</th>
|
|
56
54
|
</tr>
|
|
57
55
|
</thead>
|
|
58
|
-
<tbody class="divide-y divide-border">
|
|
59
|
-
{
|
|
60
|
-
<tr class="
|
|
61
|
-
<td class="px-
|
|
62
|
-
<code class="text-xs font-mono text-text
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
<code class="text-xs font-mono text-text-muted">
|
|
66
|
-
{renderTypeString(param.schema)}
|
|
67
|
-
</code>
|
|
68
|
-
{param.schema?.enum && param.schema.enum.length > 0 && (
|
|
69
|
-
<div class="mt-1 flex flex-wrap gap-1">
|
|
70
|
-
{param.schema.enum.map((val) => (
|
|
71
|
-
<span class="inline-block px-1.5 py-0.5 text-xs rounded bg-surface-raised text-text-muted font-mono">
|
|
72
|
-
{String(val)}
|
|
73
|
-
</span>
|
|
74
|
-
))}
|
|
75
|
-
</div>
|
|
76
|
-
)}
|
|
77
|
-
</td>
|
|
78
|
-
<td class="px-4 py-3">
|
|
79
|
-
{param.required ? (
|
|
80
|
-
<span class="inline-flex px-2 py-0.5 rounded text-xs font-medium bg-red-500/15 text-red-400 border border-red-500/30">
|
|
56
|
+
<tbody class="divide-y divide-border/30">
|
|
57
|
+
{params.map((param) => (
|
|
58
|
+
<tr class="even:bg-surface-1">
|
|
59
|
+
<td class="px-3 py-2">
|
|
60
|
+
<code class="text-xs font-mono text-text">{param.name}</code>
|
|
61
|
+
{param.required && (
|
|
62
|
+
<span class="ml-1.5 text-[0.625rem] font-semibold text-red-500 uppercase">
|
|
81
63
|
required
|
|
82
64
|
</span>
|
|
83
|
-
) : (
|
|
84
|
-
<span class="inline-flex px-2 py-0.5 rounded text-xs font-medium bg-surface-raised text-text-muted">
|
|
85
|
-
optional
|
|
86
|
-
</span>
|
|
87
65
|
)}
|
|
88
66
|
</td>
|
|
89
|
-
<td class="px-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
Example:{" "}
|
|
94
|
-
<code class="text-xs font-mono">{JSON.stringify(param.example)}</code>
|
|
95
|
-
</div>
|
|
96
|
-
)}
|
|
67
|
+
<td class="px-3 py-2">
|
|
68
|
+
<code class="text-xs font-mono text-text-muted">
|
|
69
|
+
{renderTypeString(param.schema)}
|
|
70
|
+
</code>
|
|
97
71
|
</td>
|
|
72
|
+
<td class="px-3 py-2 text-text-muted text-xs">{param.description || "—"}</td>
|
|
98
73
|
</tr>
|
|
99
74
|
))}
|
|
100
75
|
</tbody>
|
|
101
76
|
</table>
|
|
102
77
|
</div>
|
|
103
78
|
</div>
|
|
104
|
-
)
|
|
79
|
+
),
|
|
80
|
+
)
|
|
81
|
+
}
|
|
105
82
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
83
|
+
{/* Request Body */}
|
|
84
|
+
{
|
|
85
|
+
requestBody && (
|
|
86
|
+
<div class="mb-6">
|
|
87
|
+
<h3 class="text-sm font-semibold text-text-muted uppercase tracking-wider mb-3">
|
|
88
|
+
Request Body
|
|
89
|
+
{requestBody.required && (
|
|
90
|
+
<span class="ml-1.5 text-[0.625rem] font-semibold text-red-500 uppercase">required</span>
|
|
91
|
+
)}
|
|
92
|
+
</h3>
|
|
93
|
+
{requestBody.description && (
|
|
94
|
+
<p class="text-sm text-text-muted mb-3">{requestBody.description}</p>
|
|
95
|
+
)}
|
|
96
|
+
{Object.entries(requestBody.content).map(([contentType, mediaType]) => {
|
|
97
|
+
const bodyProperties = flattenSchemaProperties(
|
|
98
|
+
mediaType.schema,
|
|
99
|
+
mediaType.schema?.required,
|
|
100
|
+
);
|
|
101
|
+
return (
|
|
102
|
+
<div class="border border-border rounded-lg overflow-hidden mb-3">
|
|
103
|
+
<div class="flex items-center gap-2 px-4 py-2 bg-surface-raised border-b border-border">
|
|
104
|
+
<span class="text-xs font-mono text-text-muted px-2 py-0.5 rounded bg-surface-raised border border-border">
|
|
105
|
+
{contentType}
|
|
114
106
|
</span>
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
<code class="text-xs font-mono text-text font-semibold">
|
|
157
|
-
{prop.depth > 0 && <span class="text-text-muted/40 mr-1">↳</span>}
|
|
158
|
-
{prop.name}
|
|
159
|
-
</code>
|
|
160
|
-
</td>
|
|
161
|
-
<td class="px-4 py-3">
|
|
162
|
-
<code class="text-xs font-mono text-text-muted">{prop.type}</code>
|
|
163
|
-
{prop.enumValues && prop.enumValues.length > 0 && (
|
|
164
|
-
<div class="mt-1 flex flex-wrap gap-1">
|
|
165
|
-
{prop.enumValues.map((val) => (
|
|
166
|
-
<span class="inline-block px-1.5 py-0.5 text-xs rounded bg-surface-raised text-text-muted font-mono">
|
|
167
|
-
{val}
|
|
168
|
-
</span>
|
|
169
|
-
))}
|
|
170
|
-
</div>
|
|
171
|
-
)}
|
|
172
|
-
</td>
|
|
173
|
-
<td class="px-4 py-3">
|
|
174
|
-
{prop.required ? (
|
|
175
|
-
<span class="inline-flex px-2 py-0.5 rounded text-xs font-medium bg-red-500/15 text-red-400 border border-red-500/30">
|
|
176
|
-
required
|
|
177
|
-
</span>
|
|
178
|
-
) : (
|
|
179
|
-
<span class="inline-flex px-2 py-0.5 rounded text-xs font-medium bg-surface-raised text-text-muted">
|
|
180
|
-
optional
|
|
181
|
-
</span>
|
|
182
|
-
)}
|
|
183
|
-
</td>
|
|
184
|
-
<td class="px-4 py-3 text-text-muted text-xs">
|
|
185
|
-
{prop.description || "—"}
|
|
186
|
-
</td>
|
|
187
|
-
</tr>
|
|
188
|
-
))}
|
|
189
|
-
</tbody>
|
|
190
|
-
</table>
|
|
191
|
-
</div>
|
|
192
|
-
) : (
|
|
193
|
-
<div class="border border-border rounded-lg p-4 text-text-muted text-xs">
|
|
194
|
-
<code class="font-mono">{renderTypeString(mediaType.schema)}</code>
|
|
195
|
-
</div>
|
|
196
|
-
)}
|
|
107
|
+
</div>
|
|
108
|
+
{bodyProperties.length > 0 ? (
|
|
109
|
+
<table class="w-full text-sm">
|
|
110
|
+
<thead>
|
|
111
|
+
<tr class="border-b border-border/50">
|
|
112
|
+
<th class="text-left px-3 py-2 text-text-muted font-medium text-xs w-1/4">
|
|
113
|
+
Field
|
|
114
|
+
</th>
|
|
115
|
+
<th class="text-left px-3 py-2 text-text-muted font-medium text-xs w-1/5">
|
|
116
|
+
Type
|
|
117
|
+
</th>
|
|
118
|
+
<th class="text-left px-3 py-2 text-text-muted font-medium text-xs">
|
|
119
|
+
Description
|
|
120
|
+
</th>
|
|
121
|
+
</tr>
|
|
122
|
+
</thead>
|
|
123
|
+
<tbody class="divide-y divide-border/30">
|
|
124
|
+
{bodyProperties.map((prop) => (
|
|
125
|
+
<tr class="even:bg-surface-1">
|
|
126
|
+
<td class:list={["px-3 py-2", prop.depth > 0 && "pl-6"]}>
|
|
127
|
+
<code class="text-xs font-mono text-text">
|
|
128
|
+
{prop.depth > 0 && <span class="text-text-muted/40 mr-1">↳</span>}
|
|
129
|
+
{prop.name}
|
|
130
|
+
</code>
|
|
131
|
+
{prop.required && (
|
|
132
|
+
<span class="ml-1.5 text-[0.625rem] font-semibold text-red-500 uppercase">
|
|
133
|
+
required
|
|
134
|
+
</span>
|
|
135
|
+
)}
|
|
136
|
+
</td>
|
|
137
|
+
<td class="px-3 py-2">
|
|
138
|
+
<code class="text-xs font-mono text-text-muted">{prop.type}</code>
|
|
139
|
+
</td>
|
|
140
|
+
<td class="px-3 py-2 text-text-muted text-xs">{prop.description || "—"}</td>
|
|
141
|
+
</tr>
|
|
142
|
+
))}
|
|
143
|
+
</tbody>
|
|
144
|
+
</table>
|
|
145
|
+
) : (
|
|
146
|
+
<div class="px-4 py-3 text-text-muted text-xs">
|
|
147
|
+
<code class="font-mono">{renderTypeString(mediaType.schema)}</code>
|
|
197
148
|
</div>
|
|
198
|
-
)
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
)}
|
|
149
|
+
)}
|
|
150
|
+
</div>
|
|
151
|
+
);
|
|
152
|
+
})}
|
|
202
153
|
</div>
|
|
203
154
|
)
|
|
204
155
|
}
|
|
@@ -79,7 +79,7 @@ function getStatusColor(code: string): string {
|
|
|
79
79
|
</thead>
|
|
80
80
|
<tbody class="divide-y divide-border/30">
|
|
81
81
|
{bodyProperties.map((prop) => (
|
|
82
|
-
<tr>
|
|
82
|
+
<tr class="even:bg-surface-1">
|
|
83
83
|
<td class:list={["px-3 py-2", prop.depth > 0 && "pl-6"]}>
|
|
84
84
|
<code class="text-xs font-mono text-text">
|
|
85
85
|
{prop.depth > 0 && <span class="text-text-muted/40 mr-1">↳</span>}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Callout component — renders styled callout boxes for documentation.
|
|
4
4
|
*
|
|
5
5
|
* Supports types: info, warning, danger, tip — each with distinct
|
|
6
|
-
* icon, background color, and left border color.
|
|
6
|
+
* SVG icon, background color, and left border color.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
9
|
* <Callout type="warning">This is a warning</Callout>
|
|
@@ -16,39 +16,80 @@ export interface Props {
|
|
|
16
16
|
|
|
17
17
|
const { type = "info" } = Astro.props;
|
|
18
18
|
|
|
19
|
-
const icons: Record<string, string> = {
|
|
20
|
-
info: "ℹ️",
|
|
21
|
-
warning: "⚠️",
|
|
22
|
-
danger: "🚨",
|
|
23
|
-
tip: "💡",
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const icon = icons[type] ?? icons.info;
|
|
27
|
-
|
|
28
19
|
/**
|
|
29
20
|
* Tailwind classes per callout type.
|
|
30
21
|
* Each variant has: background, left-border, and text color.
|
|
31
|
-
*
|
|
22
|
+
* Explicit light + dark: variants for semantic color accuracy.
|
|
32
23
|
*/
|
|
33
24
|
const typeClasses: Record<string, string> = {
|
|
34
|
-
info: "
|
|
35
|
-
warning:
|
|
36
|
-
|
|
37
|
-
|
|
25
|
+
info: "border-blue-500/20 bg-blue-500/5 text-blue-200 dark:border-blue-400/20 dark:bg-blue-400/5",
|
|
26
|
+
warning:
|
|
27
|
+
"border-amber-500/20 bg-amber-500/5 text-amber-200 dark:border-amber-400/20 dark:bg-amber-400/5",
|
|
28
|
+
danger: "border-red-500/20 bg-red-500/5 text-red-200 dark:border-red-400/20 dark:bg-red-400/5",
|
|
29
|
+
tip: "border-green-500/20 bg-green-500/5 text-green-200 dark:border-green-400/20 dark:bg-green-400/5",
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const iconColorMap: Record<string, string> = {
|
|
33
|
+
info: "text-blue-400",
|
|
34
|
+
warning: "text-amber-400",
|
|
35
|
+
danger: "text-red-400",
|
|
36
|
+
tip: "text-green-400",
|
|
38
37
|
};
|
|
39
38
|
|
|
40
39
|
const classes = typeClasses[type] ?? typeClasses.info;
|
|
40
|
+
const iconColor = iconColorMap[type] ?? iconColorMap.info;
|
|
41
41
|
---
|
|
42
42
|
|
|
43
43
|
<aside
|
|
44
44
|
role="note"
|
|
45
45
|
class:list={[
|
|
46
|
-
"flex gap-3 px-
|
|
46
|
+
"flex gap-3 px-4 py-3.5 my-6 border rounded-xl text-[0.875rem] leading-relaxed",
|
|
47
47
|
classes,
|
|
48
48
|
]}
|
|
49
49
|
>
|
|
50
|
-
<span class="shrink-0
|
|
51
|
-
|
|
50
|
+
<span class:list={["shrink-0 mt-0.5", iconColor]}>
|
|
51
|
+
{
|
|
52
|
+
type === "info" && (
|
|
53
|
+
<svg class="h-4 w-4" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
|
54
|
+
<path
|
|
55
|
+
fill-rule="evenodd"
|
|
56
|
+
d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z"
|
|
57
|
+
clip-rule="evenodd"
|
|
58
|
+
/>
|
|
59
|
+
</svg>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
{
|
|
63
|
+
type === "warning" && (
|
|
64
|
+
<svg class="h-4 w-4" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
|
65
|
+
<path
|
|
66
|
+
fill-rule="evenodd"
|
|
67
|
+
d="M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z"
|
|
68
|
+
clip-rule="evenodd"
|
|
69
|
+
/>
|
|
70
|
+
</svg>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
{
|
|
74
|
+
type === "danger" && (
|
|
75
|
+
<svg class="h-4 w-4" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
|
76
|
+
<path
|
|
77
|
+
fill-rule="evenodd"
|
|
78
|
+
d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z"
|
|
79
|
+
clip-rule="evenodd"
|
|
80
|
+
/>
|
|
81
|
+
</svg>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
{
|
|
85
|
+
type === "tip" && (
|
|
86
|
+
<svg class="h-4 w-4" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
|
87
|
+
<path d="M10 1a6 6 0 00-3.815 10.631C7.237 12.5 8 13.443 8 14.456v.644a.75.75 0 00.75.75h2.5a.75.75 0 00.75-.75v-.644c0-1.013.762-1.957 1.815-2.825A6 6 0 0010 1zM8.863 17.414a.75.75 0 00-.226 1.483 9.066 9.066 0 002.726 0 .75.75 0 00-.226-1.483 7.563 7.563 0 01-2.274 0z" />
|
|
88
|
+
</svg>
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
</span>
|
|
92
|
+
<div class="min-w-0 flex-1 [&>p:first-child]:mt-0 [&>p:last-child]:mb-0 text-text">
|
|
52
93
|
<slot />
|
|
53
94
|
</div>
|
|
54
95
|
</aside>
|
|
@@ -24,9 +24,9 @@ const Tag = href ? "a" : "div";
|
|
|
24
24
|
|
|
25
25
|
<Tag
|
|
26
26
|
class:list={[
|
|
27
|
-
"block p-
|
|
27
|
+
"block p-6 my-4 rounded-xl bg-surface-1 ring-1 ring-border/50 transition-[ring-color,box-shadow] duration-150",
|
|
28
28
|
href &&
|
|
29
|
-
"no-underline text-inherit cursor-pointer hover:border
|
|
29
|
+
"no-underline text-inherit cursor-pointer hover:ring-border hover:shadow-md focus-visible:outline-2 focus-visible:outline-primary focus-visible:outline-offset-2",
|
|
30
30
|
]}
|
|
31
31
|
href={href}
|
|
32
32
|
>
|
|
@@ -34,12 +34,12 @@ const Tag = href ? "a" : "div";
|
|
|
34
34
|
(icon || title) && (
|
|
35
35
|
<div class="flex items-center gap-2 mb-2">
|
|
36
36
|
{icon && <span class="text-xl shrink-0">{icon}</span>}
|
|
37
|
-
{title && <h3 class="m-0 text-
|
|
37
|
+
{title && <h3 class="m-0 text-[0.9375rem] font-semibold text-text">{title}</h3>}
|
|
38
38
|
</div>
|
|
39
39
|
)
|
|
40
40
|
}
|
|
41
41
|
<div
|
|
42
|
-
class="text-[0.
|
|
42
|
+
class="text-[0.875rem] text-text-muted leading-relaxed [&>p:first-child]:mt-0 [&>p:last-child]:mb-0"
|
|
43
43
|
>
|
|
44
44
|
<slot />
|
|
45
45
|
</div>
|
|
@@ -73,7 +73,7 @@ const highlightedHtml = await highlight(codeContent, lang, {
|
|
|
73
73
|
<style>
|
|
74
74
|
.code-block {
|
|
75
75
|
margin: 1.5rem 0;
|
|
76
|
-
border: 1px solid var(--code-block-border,
|
|
76
|
+
border: 1px solid var(--code-block-border, oklch(0.92 0.004 286.32));
|
|
77
77
|
border-radius: 0.5rem;
|
|
78
78
|
overflow: hidden;
|
|
79
79
|
}
|
|
@@ -82,8 +82,8 @@ const highlightedHtml = await highlight(codeContent, lang, {
|
|
|
82
82
|
display: flex;
|
|
83
83
|
align-items: center;
|
|
84
84
|
padding: 0.5rem 1rem;
|
|
85
|
-
background-color: var(--code-block-header-bg,
|
|
86
|
-
border-bottom: 1px solid var(--code-block-border,
|
|
85
|
+
background-color: var(--code-block-header-bg, oklch(0.967 0.001 286.375));
|
|
86
|
+
border-bottom: 1px solid var(--code-block-border, oklch(0.92 0.004 286.32));
|
|
87
87
|
font-size: 0.8125rem;
|
|
88
88
|
font-family: var(
|
|
89
89
|
--font-mono,
|
|
@@ -97,7 +97,7 @@ const highlightedHtml = await highlight(codeContent, lang, {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
.code-block-title {
|
|
100
|
-
color: var(--code-block-title-color,
|
|
100
|
+
color: var(--code-block-title-color, oklch(0.552 0.016 285.938));
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
.code-block-body {
|
|
@@ -135,8 +135,8 @@ const highlightedHtml = await highlight(codeContent, lang, {
|
|
|
135
135
|
-->
|
|
136
136
|
<style is:global>
|
|
137
137
|
.dark .code-block {
|
|
138
|
-
--code-block-border: oklch(0.
|
|
139
|
-
--code-block-header-bg: oklch(0.
|
|
140
|
-
--code-block-title-color: oklch(0.
|
|
138
|
+
--code-block-border: oklch(0.274 0.006 286.033);
|
|
139
|
+
--code-block-header-bg: oklch(0.21 0.006 285.885);
|
|
140
|
+
--code-block-title-color: oklch(0.705 0.015 286.067);
|
|
141
141
|
}
|
|
142
142
|
</style>
|
|
@@ -145,9 +145,9 @@
|
|
|
145
145
|
<!-- All global styles consolidated into one block -->
|
|
146
146
|
<style is:global>
|
|
147
147
|
.dark .code-block-group {
|
|
148
|
-
--code-block-border: oklch(0.
|
|
149
|
-
--code-block-header-bg: oklch(0.
|
|
150
|
-
--code-block-title-color: oklch(0.
|
|
148
|
+
--code-block-border: oklch(0.274 0.006 286.033);
|
|
149
|
+
--code-block-header-bg: oklch(0.21 0.006 285.885);
|
|
150
|
+
--code-block-title-color: oklch(0.705 0.015 286.067);
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
.code-group-tabs {
|