Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ It works like shadcn/ui — same composition, same copy-paste approach — but *
of code from shadcn, Radix, Headless UI, cva or clsx**. Everything lives in `packages/ui/src`.

```
172 components · 4 languages · 6 themes · 3 densities · 0 UI dependencies in the core
174 components · 4 languages · 6 themes · 3 densities · 0 UI dependencies in the core
```

| Category | Count | For |
Expand Down Expand Up @@ -52,7 +52,7 @@ projectx-ui/
├─ packages/
│ ├─ ui/ The library
│ │ └─ src/
│ │ ├─ components/ 149 components (.tsx + .css per component)
│ │ ├─ components/ 151 components (.tsx + .css per component)
│ │ ├─ motion/ 23 components behind @projectx/ui/motion (optional)
│ │ ├─ lib/ cn, variants, Slot, Portal, hooks, positioning, dates
│ │ ├─ icons/ in-house icon set (one path per glyph)
Expand Down
4 changes: 2 additions & 2 deletions README.nl.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Werkt zoals shadcn/ui — dezelfde compositie, dezelfde copy-paste-aanpak — ma
code van shadcn, Radix, Headless UI, cva of clsx**. Alles staat in `packages/ui/src`.

```
172 componenten · 4 talen · 6 thema's · 3 dichtheden · 0 UI-dependencies in de kern
174 componenten · 4 talen · 6 thema's · 3 dichtheden · 0 UI-dependencies in de kern
```

| Categorie | Aantal | Waarvoor |
Expand Down Expand Up @@ -52,7 +52,7 @@ projectx-ui/
├─ packages/
│ ├─ ui/ De library
│ │ └─ src/
│ │ ├─ components/ 149 componenten (.tsx + .css per component)
│ │ ├─ components/ 151 componenten (.tsx + .css per component)
│ │ ├─ motion/ 23 componenten achter @projectx/ui/motion (optioneel)
│ │ ├─ lib/ cn, variants, Slot, Portal, hooks, positionering, datums
│ │ ├─ icons/ eigen icon set (één path per glyph)
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/app/[locale]/docs/componenten/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export default async function ComponentPage({
{component.notes?.length ? (
<div className="docs-section">
<h2 className="docs-section-title">{t("notes")}</h2>
<div style={{ display: "grid", gap: 12, marginTop: 14 }}>
<div className="docs-notes">
{component.notes.map((note) => (
<Alert key={note} tone="blue" icon={<Icon name="info" size={17} />}>
{note}
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/app/[locale]/docs/theming/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default async function ThemingPage({ params }: { params: Promise<{ locale

<div className="docs-section">
<h2 className="docs-section-title">{t("allTitle")}</h2>
<Table dense minWidth={620}>
<Table dense stack minWidth={620}>
<TableHeader>
<TableRow>
<TableHead>{t("token")}</TableHead>
Expand All @@ -151,10 +151,10 @@ export default async function ThemingPage({ params }: { params: Promise<{ locale
<TableCell strong>
<span className="docs-type">{token.name}</span>
</TableCell>
<TableCell>
<TableCell label={t("light")}>
<span className="docs-default">{token.light}</span>
</TableCell>
<TableCell>
<TableCell label={t("darkCol")}>
<span className="docs-default">{token.dark ?? "—"}</span>
</TableCell>
</TableRow>
Expand Down
48 changes: 46 additions & 2 deletions apps/docs/app/[locale]/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ a { color: inherit; }
background: color-mix(in srgb, var(--surface) 82%, transparent);
backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 30;
}
.docs-topbar-title { font-weight: 650; font-size: 14.5px; text-decoration: none; white-space: nowrap; }
.docs-topbar-name { font-size: 15px; letter-spacing: -0.02em; white-space: nowrap; }
.docs-topbar > * { flex-shrink: 0; }
.docs-body { flex: 1; width: 100%; max-width: 880px; margin: 0 auto; padding: 40px 32px 96px; min-width: 0; }
.docs-body-wide { max-width: 1180px; }

Expand All @@ -69,6 +72,7 @@ a { color: inherit; }
.docs-h3 { font-size: 15px; font-weight: 650; color: var(--text); margin-top: 26px; }
.docs-p { font-size: 14.5px; color: var(--text-2); line-height: 1.7; margin-top: 10px; }
.docs-p code, .docs-inline-code {
overflow-wrap: anywhere;
font-family: var(--mono); font-size: .88em; padding: 2px 5px;
background: var(--surface-3); border: 1px solid var(--border);
border-radius: 5px; color: var(--text);
Expand All @@ -87,6 +91,10 @@ a { color: inherit; }
radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0) 0 0 / 18px 18px,
var(--surface);
}
.docs-preview-file {
min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
font-size: 11.5px; color: var(--text-3); font-family: var(--mono);
}
.docs-preview-stage-start { justify-content: flex-start; align-items: flex-start; }
.docs-preview-stage-block { display: block; }
.docs-code {
Expand Down Expand Up @@ -134,20 +142,35 @@ a { color: inherit; }
.docs-toc a { display: block; padding: 5px 0; font-size: 13px; color: var(--text-3); text-decoration: none; }
.docs-toc a:hover { color: var(--text); }

.docs-notes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 14px; }
.docs-notes .lui-alert-text { overflow-wrap: anywhere; }

.docs-nav-toggle { display: none; }
.docs-nav-close,
.docs-nav-scrim { display: none; }

@media (max-width: 1100px) { .docs-toc { display: none; } }
@media (max-width: 900px) {
.docs-nav {
position: fixed; z-index: 80; transform: translateX(-100%);
transition: transform .26s var(--ease); box-shadow: var(--sh-xl);
/* Dicht: onzichtbaar (geen schaduw aan de rand, links niet bereikbaar met Tab). */
visibility: hidden; transition: transform .26s var(--ease), visibility 0s .26s;
}
.docs-nav[data-open] { transform: none; }
.docs-nav[data-open] { transform: none; visibility: visible; box-shadow: var(--sh-xl); transition: transform .26s var(--ease); }
.docs-nav-toggle { display: grid; }
.docs-nav-close {
display: grid; place-items: center; position: absolute; top: 14px; right: 10px;
width: 34px; height: 34px; border: 0; border-radius: var(--r-full);
background: transparent; color: var(--text-2); cursor: pointer;
}
.docs-nav-close:hover { background: var(--surface-3); color: var(--text); }
.docs-nav-close:focus-visible { outline: none; box-shadow: var(--ring); }
.docs-nav-scrim { display: block; position: fixed; inset: 0; z-index: 79; background: var(--overlay); }
.docs-body { padding: 26px 18px 80px; }
.docs-title { font-size: 27px; }
}


/* ---------- labels "nieuw" en "bijgewerkt" ---------- */
.docs-tag {
display: inline-flex; align-items: center; flex: none;
Expand Down Expand Up @@ -243,3 +266,24 @@ a { color: inherit; }
/* Startpagina: titel van "Alle componenten" met de zoekknop ernaast. */
.docs-all-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 56px; }
.docs-all-search { min-width: 260px; }

/* ---------- Gsm (onderaan, zodat deze regels voorrang krijgen) ---------- */
@media (max-width: 640px) {
.docs-topbar { gap: 6px; padding: 0 12px; }
.docs-variant-switch { position: static; }
/* Meer ruimte voor de demo; wat toch breder is, kan je opzij vegen in plaats van dat het wegvalt. */
.docs-preview-stage { padding: 26px 14px; overflow-x: auto; overscroll-behavior-x: contain; justify-content: safe center; }
.docs-preview-stage-start { justify-content: flex-start; }
.docs-hero { padding: 56px 18px 48px; }
}
@media (max-width: 480px) {
.docs-topbar-version { display: none; }
.docs-locale svg:last-child { display: none; }
.docs-locale { padding: 0 8px; }
}
@media (max-width: 400px) {
.docs-topbar-home .docs-topbar-name { display: none; }
}
/* Is het lettertype breder dan verwacht (ander systeemfont), dan krimpt de naam
met "…" in plaats van dat de hele pagina horizontaal gaat scrollen. */
.docs-topbar-home .docs-topbar-name { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
17 changes: 6 additions & 11 deletions apps/docs/app/[locale]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { CodeBlock } from "@/components/code-block";
import { LocaleSwitcher } from "@/components/locale-switcher";
import { DocsTag } from "@/components/docs-tag";
import { DocsSearch } from "@/components/docs-search";
import { version } from "../../package.json";

const FEATURES = [
{ key: "zeroDeps", icon: "shield" as const },
Expand All @@ -28,18 +29,12 @@ export default async function HomePage({ params }: { params: Promise<{ locale: s

return (
<>
<header
style={{
position: "sticky", top: 0, zIndex: 30, height: 60,
display: "flex", alignItems: "center", gap: 12, padding: "0 24px",
borderBottom: "1px solid var(--border)",
background: "color-mix(in srgb, var(--surface) 82%, transparent)",
backdropFilter: "blur(8px)",
}}
>
<header className="docs-topbar docs-topbar-home">
<span className="docs-nav-mark" style={{ width: 32, height: 32, fontSize: 15 }}>L</span>
<strong style={{ fontSize: 15, letterSpacing: "-0.02em" }}>ProjectX UI</strong>
<Badge tone="accent" size="sm">v0.1.0</Badge>
<strong className="docs-topbar-name">ProjectX UI</strong>
<Badge tone="accent" size="sm" className="docs-topbar-version">
v{version}
</Badge>
<span style={{ flex: 1 }} />
<DocsSearch />
<Button variant="ghost" size="sm" asChild>
Expand Down
8 changes: 6 additions & 2 deletions apps/docs/components/docs-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const CATEGORY_KEYS: Record<string, string> = {
Motion: "motion",
};

export function DocsNav({ open }: { open?: boolean }) {
export function DocsNav({ open, onClose }: { open?: boolean; onClose?: () => void }) {
const pathname = usePathname();
const [query, setQuery] = React.useState("");
const t = useTranslations("nav");
Expand All @@ -48,7 +48,11 @@ export function DocsNav({ open }: { open?: boolean }) {
}));

return (
<nav className="docs-nav" data-open={open ? "" : undefined}>
<nav className="docs-nav" aria-label={t("label")} data-open={open ? "" : undefined}>
{/* Enkel op mobiel zichtbaar: de knop in de bovenbalk valt daar onder de open navigatie. */}
<button type="button" className="docs-nav-close" aria-label={t("close")} onClick={onClose}>
<Icon name="x" size={18} />
</button>
<Link href="/" className="docs-nav-brand">
<span className="docs-nav-mark">L</span>
<span>
Expand Down
7 changes: 6 additions & 1 deletion apps/docs/components/docs-search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ export function DocsSearch({ shortcut = true, className }: { shortcut?: boolean;

return (
<>
<CommandTrigger className={className ?? "docs-search"} placeholder={t("placeholder")} onClick={() => setOpen(true)} />
<CommandTrigger
className={className ?? "docs-search"}
placeholder={t("placeholder")}
aria-label={t("placeholder")}
onClick={() => setOpen(true)}
/>
<CommandDialog open={open} onOpenChange={setOpen} shortcut={shortcut} aria-label={t("title")}>
<CommandInput placeholder={t("placeholder")} />
<CommandList>
Expand Down
26 changes: 22 additions & 4 deletions apps/docs/components/docs-shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,50 @@
import * as React from "react";
import { useTranslations } from "next-intl";
import { Badge, Button, Icon, PalettePicker, ThemeToggle } from "@projectx/ui";
import { Link } from "@/i18n/navigation";
import { Link, usePathname } from "@/i18n/navigation";
import { DocsNav } from "./docs-nav";
import { DocsSearch } from "./docs-search";
import { LocaleSwitcher } from "./locale-switcher";
import { version } from "../package.json";

export function DocsShell({ children }: { children: React.ReactNode }) {
const [open, setOpen] = React.useState(false);
const t = useTranslations("shell");
const pathname = usePathname();

// Een andere pagina gekozen: de navigatie (op mobiel een schuifpaneel) gaat dicht.
React.useEffect(() => setOpen(false), [pathname]);

// Escape sluit de open navigatie.
React.useEffect(() => {
if (!open) return;
const sluit = (event: KeyboardEvent) => event.key === "Escape" && setOpen(false);
document.addEventListener("keydown", sluit);
return () => document.removeEventListener("keydown", sluit);
}, [open]);

return (
<div className="docs-shell">
<DocsNav open={open} />
<DocsNav open={open} onClose={() => setOpen(false)} />
{/* Verduistering naast de open navigatie op mobiel; een tik erop sluit ze. */}
{open && <div className="docs-nav-scrim" aria-hidden="true" onClick={() => setOpen(false)} />}
<div className="docs-main">
<header className="docs-topbar">
<Button
variant="ghost"
size="sm"
className="docs-nav-toggle"
aria-label={t("openNav")}
aria-expanded={open}
icon={<Icon name="menu" />}
onClick={() => setOpen((value) => !value)}
/>
<Link href="/docs" style={{ fontWeight: 650, fontSize: 14.5, textDecoration: "none" }}>
<Link href="/docs" className="docs-topbar-title">
{t("docs")}
</Link>
<Badge tone="accent" size="sm">v0.1.0</Badge>
<Badge tone="accent" size="sm" className="docs-topbar-version">
v{version}
</Badge>
<span style={{ flex: 1 }} />
<DocsSearch />
<PalettePicker size="sm" className="docs-palette" aria-label={t("palette")} />
Expand Down
1 change: 1 addition & 0 deletions apps/docs/components/locale-switcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export function LocaleSwitcher() {
variant="ghost"
size="sm"
aria-label={t("language")}
className="docs-locale"
icon={<Icon name="globe" size={15} />}
iconRight={<Icon name="chevronDown" size={13} />}
suppressHydrationWarning
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/components/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function Preview({ demoKey, code, html, hasTailwind = false, align = "cen
]}
/>
<span style={{ flex: 1 }} />
<span style={{ fontSize: 11.5, color: "var(--text-3)", fontFamily: "var(--mono)" }}>{file}</span>
<span className="docs-preview-file">{file}</span>
</div>

{tab === "preview" ? (
Expand Down
8 changes: 4 additions & 4 deletions apps/docs/components/props-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export async function PropsTable({ name }: { name: string }) {
Erft daarnaast alle props van <code className="docs-inline-code">{entry.extends}</code>.
</p>
)}
<Table dense minWidth={640}>
<Table dense stack minWidth={640}>
<TableHeader>
<TableRow>
<TableHead>{t("prop")}</TableHead>
Expand All @@ -33,13 +33,13 @@ export async function PropsTable({ name }: { name: string }) {
{prop.name}
{prop.required && <span style={{ color: "var(--red)" }}>*</span>}
</TableCell>
<TableCell>
<TableCell label={t("type")}>
<span className="docs-type">{prop.type}</span>
</TableCell>
<TableCell>
<TableCell label={t("default")}>
<span className="docs-default">{prop.default ?? "—"}</span>
</TableCell>
<TableCell>{prop.description || "—"}</TableCell>
<TableCell label={t("description")}>{prop.description || "—"}</TableCell>
</TableRow>
))}
</TableBody>
Expand Down
Loading