Skip to content

Commit acf68ca

Browse files
committed
feat: docs UI improvements
1 parent 1c3a454 commit acf68ca

File tree

12 files changed

+1918
-737
lines changed

12 files changed

+1918
-737
lines changed

packages/docs/assets/css/main.css

Lines changed: 130 additions & 104 deletions
Large diffs are not rendered by default.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
:root {
2+
/* Primary accent color - define both the color and RGB values separately for opacity control */
3+
--color-accent: #3b82f6; /* blue-500 */
4+
--color-accent-rgb: 59, 130, 246;
5+
6+
/* Text colors */
7+
--color-text-primary: #1f2937; /* gray-800 */
8+
--color-text-secondary: #4b5563; /* gray-600 */
9+
10+
/* Background colors */
11+
--color-bg-card: #ffffff;
12+
--color-bg-card-secondary: #f9fafb; /* gray-50 */
13+
14+
/* Border colors */
15+
--color-border: #e5e7eb; /* gray-200 */
16+
}
17+
18+
@media (prefers-color-scheme: dark) {
19+
:root {
20+
--color-text-primary: #f3f4f6; /* gray-100 */
21+
--color-text-secondary: #d1d5db; /* gray-300 */
22+
23+
--color-bg-card: #1f2937; /* gray-800 */
24+
--color-bg-card-secondary: #111827; /* gray-900 */
25+
26+
--color-border: #374151; /* gray-700 */
27+
}
28+
}
Lines changed: 46 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,80 @@
11
<template>
2-
<div class="code-window my-6 shadow-lg border border-gray-100 rounded-lg overflow-hidden">
3-
<div class="code-window-header flex justify-between items-center bg-gray-50 border-b border-gray-100 px-4 py-2">
2+
<div
3+
class="code-window my-6 border border-gray-200 rounded-lg overflow-hidden"
4+
>
5+
<div
6+
class="code-window-header flex justify-between items-center bg-gray-50 border-b border-gray-100 px-4 py-2"
7+
>
48
<div class="code-window-dots">
5-
<div class="code-window-dot bg-accent-6"></div>
6-
<div class="code-window-dot bg-accent-5"></div>
7-
<div class="code-window-dot bg-accent-4"></div>
9+
<div class="code-window-dot bg-error"></div>
10+
<div class="code-window-dot bg-warning"></div>
11+
<div class="code-window-dot bg-success"></div>
812
</div>
913
<div class="language-label text-gray-500 text-xs">{{ language }}</div>
10-
<button
11-
v-if="code"
12-
@click="copyCode"
14+
<button
15+
v-if="code"
16+
@click="copyCode"
1317
class="text-xs text-gray-500 hover:text-accent-1 transition-colors px-2 py-1 rounded hover:bg-gray-100"
1418
>
15-
{{ copied ? 'Copied!' : 'Copy' }}
19+
{{ copied ? "Copied!" : "Copy" }}
1620
</button>
1721
</div>
18-
<div class="code-window-content relative p-6 bg-black text-white overflow-auto">
19-
<!-- Code content -->
22+
<div
23+
class="code-window-content relative p-6 bg-[#272822] text-white overflow-auto"
24+
>
25+
<!-- Code content with Monokai-like background -->
2026
<div class="relative z-10">
2127
<slot></slot>
2228
</div>
23-
29+
2430
<!-- Line numbers -->
25-
<div v-if="showLineNumbers" class="absolute top-6 left-4 text-opacity-50 select-none">
26-
<div v-for="n in lineCount" :key="n" class="text-gray-500 text-right pr-4">{{ n }}</div>
31+
<div
32+
v-if="showLineNumbers"
33+
class="absolute top-6 left-4 text-opacity-50 select-none"
34+
>
35+
<div
36+
v-for="n in lineCount"
37+
:key="n"
38+
class="text-gray-500 text-right pr-4"
39+
>
40+
{{ n }}
41+
</div>
2742
</div>
2843
</div>
2944
</div>
3045
</template>
3146

3247
<script setup>
33-
import { ref, computed, onMounted } from 'vue';
48+
import { ref, computed, onMounted } from "vue"
3449
3550
const props = defineProps({
3651
language: {
3752
type: String,
38-
default: 'typescript'
53+
default: "typescript",
3954
},
4055
showLineNumbers: {
4156
type: Boolean,
42-
default: true
57+
default: true,
4358
},
4459
code: {
4560
type: String,
46-
default: ''
47-
}
48-
});
61+
default: "",
62+
},
63+
})
4964
50-
const copied = ref(false);
65+
const copied = ref(false)
5166
const lineCount = computed(() => {
52-
if (!props.code) return 0;
53-
return props.code.split('\n').length;
54-
});
67+
if (!props.code) return 0
68+
return props.code.split("\n").length
69+
})
5570
5671
const copyCode = () => {
57-
navigator.clipboard.writeText(props.code);
58-
copied.value = true;
72+
navigator.clipboard.writeText(props.code)
73+
copied.value = true
5974
setTimeout(() => {
60-
copied.value = false;
61-
}, 2000);
62-
};
75+
copied.value = false
76+
}, 2000)
77+
}
6378
</script>
6479

6580
<style scoped>
@@ -72,5 +87,6 @@ const copyCode = () => {
7287
7388
.code-window-dot {
7489
@apply w-2.5 h-2.5 rounded-full mr-1;
90+
/* No box-shadow */
7591
}
76-
</style>
92+
</style>
Lines changed: 110 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,128 @@
11
<template>
22
<footer class="mt-16 border-t border-gray-200 py-12 bg-white">
33
<div class="container mx-auto px-4">
4-
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
4+
<div class="grid grid-cols-1 md:grid-cols-3 gap-12">
55
<div class="fade-in">
6-
<h3 class="text-xl font-bold text-black mb-4">Documentation</h3>
7-
<ul class="space-y-2">
8-
<li><a href="/docs/getting-started" class="text-gray-600 hover:text-accent-1 transition-colors">Getting Started</a></li>
9-
<li><a href="/docs/api-reference" class="text-gray-600 hover:text-accent-1 transition-colors">API Reference</a></li>
10-
<li><a href="/docs/examples" class="text-gray-600 hover:text-accent-1 transition-colors">Examples</a></li>
6+
<h3 class="text-xl font-bold text-black mb-6">Documentation</h3>
7+
<ul class="space-y-3">
8+
<li>
9+
<a
10+
href="/docs/getting-started"
11+
class="text-gray-600 hover:text-accent-1 transition-colors"
12+
>Getting Started</a
13+
>
14+
</li>
15+
<li>
16+
<a
17+
href="/docs/api-reference"
18+
class="text-gray-600 hover:text-accent-1 transition-colors"
19+
>API Reference</a
20+
>
21+
</li>
22+
<li>
23+
<a
24+
href="/docs/examples"
25+
class="text-gray-600 hover:text-accent-1 transition-colors"
26+
>Examples</a
27+
>
28+
</li>
1129
</ul>
1230
</div>
13-
<div class="fade-in" style="animation-delay: 100ms;">
14-
<h3 class="text-xl font-bold text-black mb-4">Resources</h3>
15-
<ul class="space-y-2">
16-
<li><a href="https://github.com/formkit/jsonreader" target="_blank" class="text-gray-600 hover:text-accent-1 transition-colors">GitHub</a></li>
17-
<li><a href="https://github.com/formkit/jsonreader/issues" target="_blank" class="text-gray-600 hover:text-accent-1 transition-colors">Issues</a></li>
18-
<li><a href="https://www.npmjs.com/package/jsonreader" target="_blank" class="text-gray-600 hover:text-accent-1 transition-colors">npm Package</a></li>
31+
<div class="fade-in">
32+
<h3 class="text-xl font-bold text-black mb-6">Resources</h3>
33+
<ul class="space-y-3">
34+
<li>
35+
<a
36+
href="https://github.com/formkit/jsonreader"
37+
target="_blank"
38+
class="text-gray-600 hover:text-accent-1 transition-colors"
39+
>GitHub</a
40+
>
41+
</li>
42+
<li>
43+
<a
44+
href="https://github.com/formkit/jsonreader/issues"
45+
target="_blank"
46+
class="text-gray-600 hover:text-accent-1 transition-colors"
47+
>Issues</a
48+
>
49+
</li>
50+
<li>
51+
<a
52+
href="https://www.npmjs.com/package/jsonreader"
53+
target="_blank"
54+
class="text-gray-600 hover:text-accent-1 transition-colors"
55+
>npm Package</a
56+
>
57+
</li>
1958
</ul>
2059
</div>
21-
<div class="fade-in" style="animation-delay: 200ms;">
22-
<h3 class="text-xl font-bold text-black mb-4">About</h3>
23-
<p class="text-gray-600 mb-4">
24-
jsonreader is a utility for processing JSON data from streams in real-time, optimized for AI tool calls and large API responses.
60+
<div class="fade-in">
61+
<h3 class="text-xl font-bold text-black mb-6">About</h3>
62+
<p class="text-gray-600 mb-6">
63+
jsonreader is a utility for processing JSON data from streams in
64+
real-time, optimized for AI tool calls and large API responses.
2565
</p>
2666
<div class="flex items-center space-x-4">
27-
<a href="https://github.com/formkit/jsonreader" target="_blank" class="text-gray-500 hover:text-accent-1 transition-colors">
28-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-github"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"></path></svg>
67+
<a
68+
href="https://github.com/formkit/jsonreader"
69+
target="_blank"
70+
class="text-gray-500 hover:text-accent-1 transition-colors"
71+
>
72+
<svg
73+
xmlns="http://www.w3.org/2000/svg"
74+
width="24"
75+
height="24"
76+
viewBox="0 0 24 24"
77+
fill="none"
78+
stroke="currentColor"
79+
stroke-width="2"
80+
stroke-linecap="round"
81+
stroke-linejoin="round"
82+
class="feather feather-github"
83+
>
84+
<path
85+
d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"
86+
></path>
87+
</svg>
2988
</a>
30-
<a href="https://twitter.com/formkit" target="_blank" class="text-gray-500 hover:text-accent-1 transition-colors">
31-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-twitter"><path d="M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z"></path></svg>
89+
<a
90+
href="https://twitter.com/formkit"
91+
target="_blank"
92+
class="text-gray-500 hover:text-accent-1 transition-colors"
93+
>
94+
<svg
95+
xmlns="http://www.w3.org/2000/svg"
96+
width="24"
97+
height="24"
98+
viewBox="0 0 24 24"
99+
fill="currentColor"
100+
stroke="none"
101+
stroke-width="0"
102+
class="feather"
103+
>
104+
<path
105+
d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"
106+
/>
107+
</svg>
32108
</a>
33109
</div>
34110
</div>
35111
</div>
36-
<div class="mt-8 pt-8 border-t border-gray-100 text-center text-gray-500 text-sm slide-up">
37-
<p>© 2024 <a href="https://formkit.com" target="_blank" class="text-gray-600 hover:text-accent-1">FormKit</a>. Released under the MIT License.</p>
112+
<div
113+
class="mt-12 pt-8 border-t border-gray-100 text-center text-gray-500 text-sm"
114+
>
115+
<p>
116+
© {{ new Date().getFullYear() }}
117+
<a
118+
href="https://formkit.com"
119+
target="_blank"
120+
class="text-gray-600 hover:text-accent-1"
121+
>FormKit</a
122+
>. Dual-license — Free for personal use, $10 per project for
123+
commercial use.
124+
</p>
38125
</div>
39126
</div>
40127
</footer>
41-
</template>
128+
</template>

packages/docs/components/Logo.vue

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<template>
2+
<span :class="['text-accent flex items-center', sizeClasses.container]">
3+
<span
4+
:class="[
5+
'inline-flex items-center justify-center bg-accent text-white rounded-full leading-none tracking-tighter',
6+
sizeClasses.icon,
7+
]"
8+
>{&hellip;}</span
9+
>
10+
<span :class="sizeClasses.text">jsonreader</span>
11+
</span>
12+
</template>
13+
14+
<script setup>
15+
import { computed } from "vue"
16+
17+
const props = defineProps({
18+
size: {
19+
type: String,
20+
default: "large", // 'large', 'medium', or 'small'
21+
},
22+
})
23+
24+
const sizeClasses = computed(() => {
25+
switch (props.size) {
26+
case "small":
27+
return {
28+
container: "text-xl",
29+
icon: "w-8 h-8 mr-2 text-xs",
30+
text: "font-semibold",
31+
}
32+
case "medium":
33+
return {
34+
container: "text-2xl",
35+
icon: "w-10 h-10 mr-2.5 text-xl",
36+
text: "font-bold",
37+
}
38+
case "large":
39+
default:
40+
return {
41+
container: "text-3xl md:text-4xl",
42+
icon: "w-16 h-16 md:w-20 md:h-20 mr-3 md:mr-4 text-2xl md:text-3xl",
43+
text: "font-bold",
44+
}
45+
}
46+
})
47+
</script>
48+
49+
<style scoped>
50+
/* Component-specific styles can be added here */
51+
</style>

0 commit comments

Comments
 (0)