Skip to content

Commit 56dc8db

Browse files
feat: v2 docs page (#357)
* feat: initial layout + ts * feat: improved primitives * feat: initial sidebar * feat: commonly used * feat: updated structure * feat: initial docs sidebar * feat: updated docs page * feat: initial structure * feat: remove checkbox docs * feat: initial template * feat: support playground * proper spacing * fix: format * fix: popover can externally change w/ microtask update * fix: adjust width of popover in DesktopNav component * fix: format
1 parent 2097e9b commit 56dc8db

File tree

16 files changed

+374
-250
lines changed

16 files changed

+374
-250
lines changed

docs/src/docs-widgets/action/action.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ const buttonVariants = cva(
88
variants: {
99
variant: {
1010
primary: "border-lavender-500 bg-lavender-400 text-white",
11-
secondary: "border-lavender-400 bg-lavender-200 text-lavender-600"
11+
secondary: "border-lavender-400 bg-lavender-200 text-lavender-600",
12+
trigger: "border-light-700 text-light-700 bg-white w-full p-2.5"
1213
}
1314
},
1415
defaultVariants: {
@@ -21,7 +22,8 @@ const shadowVariants = cva("absolute inset-0 z-1 translate-1", {
2122
variants: {
2223
variant: {
2324
primary: "bg-[#6C2CC4]",
24-
secondary: "bg-[#AC7EF4]"
25+
secondary: "bg-[#AC7EF4]",
26+
trigger: "bg-[#B3BAC1]"
2527
}
2628
},
2729
defaultVariants: {

docs/src/docs-widgets/anatomy-table/anatomy-table.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const AnatomyTable = component$<{ api: ComponentParts }>(({ api }) => {
1010
const anatomyItems = api.anatomy.filter((item): item is AnatomyItem => "name" in item);
1111

1212
return (
13-
<div class="my-4">
13+
<div>
1414
<div class="border-neutral-primary border overflow-hidden">
1515
<table class="w-full border-collapse text-sm">
1616
<thead>

docs/src/docs-widgets/api-table/api-table.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import type {
33
ComponentEntry,
44
ParsedProps
55
} from "@kunai-consulting/code-notate-core";
6-
import { Popover } from "@qds.dev/ui";
76
import { component$, useContext, useTask$ } from "@qwik.dev/core";
8-
import { rootContextId } from "~/routes/layout";
7+
8+
import { Popover } from "@qds.dev/ui";
9+
import { rootContextId } from "~/routes/components/layout";
910
import { MainHeading, SubHeading } from "../toc/toc";
1011

1112
type DataAttribute = {

docs/src/docs-widgets/features/features.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export const Features = component$<{ api: ComponentParts }>(({ api }) => {
1010
);
1111

1212
return (
13-
<div class="my-4">
14-
<ul class="list-disc list-inside space-y-2">
13+
<div>
14+
<ul class="list-disc list-inside space-y-4">
1515
{features.map((feature) => (
1616
<li class="flex items-center gap-2" key={feature}>
1717
<span>

docs/src/docs-widgets/header/header.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,12 @@ const DesktopNav = component$(() => {
141141
const restOfItems = navData.slice(1);
142142

143143
return (
144-
<Navbar.Root class="hidden lg:block px-6 bg-white fixed top-6 w-full rounded-2xl border-[1.6px] border-blue-300 max-w-[600px] shadow-[6px_6px_0_0px_var(--color-blue-200)]">
144+
<Navbar.Root class="hidden lg:block px-6 bg-white fixed top-6 w-full rounded-2xl border-[1.6px] border-blue-300 max-w-[650px] shadow-[6px_6px_0_0px_var(--color-blue-200)]">
145145
<Navbar.List class="flex items-center justify-between">
146146
<Navbar.Item>
147147
<Navbar.ItemLink href={firstItem.href} class="flex items-center gap-2">
148148
{firstItem.icon}
149-
<span class="font-arcade text-xl ">{firstItem.label}</span>
149+
<span class="font-arcade text-2xl ">{firstItem.label}</span>
150150
</Navbar.ItemLink>
151151
</Navbar.Item>
152152
<li>
@@ -165,8 +165,8 @@ const DesktopNav = component$(() => {
165165
<span>{item.label}</span>
166166
</Navbar.ItemTrigger>
167167
<Navbar.ItemContent
168-
class="open:grid gap-4 max-w-[600px] w-full shadow-[6px_6px_0_0px_var(--color-blue-200)] rounded-2xl p-4 border-[1.6px] border-blue-300 transition-discrete duration-[325ms] ease-in-out open:animate-to-visible not-open:animate-from-visible opacity-0"
169-
style={getContentGridTemplate(item.label)}
168+
class="open:grid gap-4 shadow-[6px_6px_0_0px_var(--color-blue-200)] rounded-2xl p-4 border-[1.6px] border-blue-300 transition-discrete duration-[325ms] ease-in-out open:animate-to-visible not-open:animate-from-visible opacity-0"
169+
style={{ ...getContentGridTemplate(item.label), width: "650px" }}
170170
ui-mega-popover
171171
>
172172
{item.links?.map((link) => {
@@ -223,7 +223,7 @@ const MobileNav = component$(() => {
223223
<div class="flex items-center justify-between w-full h-16 lg:hidden bg-white border-b-2 border-lavender-200">
224224
<a href="/" class="p-4 flex items-center gap-2" aria-label="QDS Home">
225225
<QwikLogo />
226-
<span class="font-arcade text-xl ">QDS</span>
226+
<span class="font-arcade text-xl">QDS</span>
227227
</a>
228228

229229
<Modal.Root>
@@ -242,7 +242,7 @@ const MobileNav = component$(() => {
242242
);
243243
});
244244

245-
const QwikLogo = component$(() => {
245+
export const QwikLogo = component$(() => {
246246
return (
247247
<div>
248248
<svg
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { type Component, component$ } from "@qwik.dev/core";
2+
3+
type PlaygroundConfig = {
4+
controls?: string[];
5+
};
6+
7+
type PlaygroundProps = {
8+
// biome-ignore lint/suspicious/noExplicitAny: template can have any props
9+
template: Component<any>;
10+
config?: PlaygroundConfig;
11+
};
12+
13+
export const Playground = component$<PlaygroundProps>(
14+
({ template: Template, config }) => {
15+
return (
16+
<div class="p-6 border-[1.6px] border-blue-500 rounded-2xl shadow-[6px_6px_0_0px_var(--color-blue-200)]">
17+
<div class="mb-4">
18+
<h3 class="font-semibold mb-2">Playground</h3>
19+
{config?.controls && (
20+
<div class="text-sm text-gray-600">
21+
Controls: {config.controls.join(", ")}
22+
</div>
23+
)}
24+
</div>
25+
<div class="p-8 bg-gray-50 flex items-center justify-center">
26+
<Template />
27+
</div>
28+
</div>
29+
);
30+
}
31+
);

0 commit comments

Comments
 (0)