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 src/layouts/MdxWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ export function MdxWrapper({ Component }: { Component: MdxComponent }) {
data-ai-toolbar="true"
className="not-prose mb-6 flex flex-wrap items-center justify-between gap-2 pb-4 border-b border-border"
>
<div className="flex items-center gap-2 text-xs text-muted-foreground">
<span className="inline-flex items-center gap-1.5 font-medium text-foreground">
<div className="flex flex-wrap items-center gap-2 text-xs text-muted-foreground">
<span className="inline-flex items-center gap-1.5 font-medium text-foreground whitespace-nowrap">
AI Context:
</span>
<a
Expand Down
107 changes: 55 additions & 52 deletions src/partials/CustomizationPlayground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { Badge } from '../dashkit/Badge';
import { Button } from '../dashkit/Button/Button';
import {
Table,
TableContainer,
TableHeader,
TableBody,
TableRow,
Expand Down Expand Up @@ -126,12 +127,12 @@ export function CustomizationPlayground() {
</div>

{/* Palette Fine-Tuning */}
<div className="flex flex-col gap-5 pt-3 border-t border-border">
<div className="space-y-2.5">
<div className="flex flex-col gap-6 pt-5 border-t border-border">
<div className="flex flex-col gap-3">
<span className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
Primary Brand Palette (`data-primary=&quot;{primaryColor}&quot;`)
</span>
<div className="flex flex-wrap gap-2">
<div className="flex flex-wrap gap-2.5">
{PRIMARY_COLORS.map(c => {
const isSelected = primaryColor === c.id;
return (
Expand All @@ -155,11 +156,11 @@ export function CustomizationPlayground() {
</div>
</div>

<div className="space-y-2.5">
<div className="flex flex-col gap-3">
<span className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
Base Neutral Palette (`data-base=&quot;{baseColor}&quot;`)
</span>
<div className="flex flex-wrap gap-2">
<div className="flex flex-wrap gap-2.5">
{BASE_COLORS.map(c => {
const isSelected = baseColor === c.id;
return (
Expand Down Expand Up @@ -205,54 +206,56 @@ export function CustomizationPlayground() {
</div>
</CardHeader>
<CardContent>
<Table>
<TableHeader>
<TableRow>
<TableHead>Token Variable</TableHead>
<TableHead>Category</TableHead>
<TableHead>Light Value (`:root`)</TableHead>
<TableHead>Dark Value (`.dark`)</TableHead>
<TableHead>Role</TableHead>
</TableRow>
</TableHeader>
<TableBody>
{activePreset.tokens.map(token => (
<TableRow key={token.variable}>
<TableCell className="font-mono text-xs font-semibold text-foreground">
{token.variable}
</TableCell>
<TableCell>
<Badge variant="soft" color="base" content={token.category} />
</TableCell>
<TableCell className="font-mono text-xs">
<span className="inline-flex items-center gap-2">
{token.lightPreviewColor && (
<span
className="size-3.5 ds-rounded-sm border border-border shrink-0"
style={{ backgroundColor: token.lightPreviewColor }}
/>
)}
<span>{token.lightValue}</span>
</span>
</TableCell>
<TableCell className="font-mono text-xs">
<span className="inline-flex items-center gap-2">
{token.darkPreviewColor && (
<span
className="size-3.5 ds-rounded-sm border border-border shrink-0"
style={{ backgroundColor: token.darkPreviewColor }}
/>
)}
<span>{token.darkValue}</span>
</span>
</TableCell>
<TableCell className="text-xs text-muted-foreground">
{token.description}
</TableCell>
<TableContainer>
<Table>
<TableHeader>
<TableRow>
<TableHead>Token Variable</TableHead>
<TableHead>Category</TableHead>
<TableHead>Light Value (`:root`)</TableHead>
<TableHead>Dark Value (`.dark`)</TableHead>
<TableHead>Role</TableHead>
</TableRow>
))}
</TableBody>
</Table>
</TableHeader>
<TableBody>
{activePreset.tokens.map(token => (
<TableRow key={token.variable}>
<TableCell className="font-mono text-xs font-semibold text-foreground">
{token.variable}
</TableCell>
<TableCell>
<Badge variant="soft" color="base" content={token.category} />
</TableCell>
<TableCell className="font-mono text-xs">
<span className="inline-flex items-center gap-2">
{token.lightPreviewColor && (
<span
className="size-3.5 ds-rounded-sm border border-border shrink-0"
style={{ backgroundColor: token.lightPreviewColor }}
/>
)}
<span>{token.lightValue}</span>
</span>
</TableCell>
<TableCell className="font-mono text-xs">
<span className="inline-flex items-center gap-2">
{token.darkPreviewColor && (
<span
className="size-3.5 ds-rounded-sm border border-border shrink-0"
style={{ backgroundColor: token.darkPreviewColor }}
/>
)}
<span>{token.darkValue}</span>
</span>
</TableCell>
<TableCell className="text-xs text-muted-foreground">
{token.description}
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</TableContainer>
</CardContent>
</Card>

Expand Down
46 changes: 26 additions & 20 deletions src/partials/PropertyDoc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,49 +19,55 @@ export function PropertyDoc({ title, properties, className }: PropertyDocProps)
const hasDefault = properties.some(p => p.defaultValue !== undefined);

return (
<div className={cn("not-prose my-6 w-full overflow-hidden", className)}>
<div className={cn("not-prose my-6 w-full", className)}>
{title && (
<h4 className="text-xs font-semibold text-foreground uppercase tracking-[0.08em] mb-3 ml-1">
{title}
</h4>
)}
<div className="overflow-x-auto custom-scrollbar border border-border bg-card ds-rounded">
<div className="overflow-x-auto custom-scrollbar border border-border/80 bg-card ds-rounded-lg">
<table className="w-full text-left border-collapse min-w-[600px]">
<thead>
<tr className="border-b border-border text-[11px] font-semibold text-muted-foreground uppercase tracking-[0.08em] bg-muted/40">
<th className="px-4 py-3 w-[22%] border-r border-border">Property</th>
{hasType && <th className="px-4 py-3 w-[28%] border-r border-border">Type</th>}
{hasDefault && <th className="px-4 py-3 w-[14%] border-r border-border">Default</th>}
<th className="px-4 py-3 flex-1">Description</th>
<tr className="border-b border-border/80 text-[11px] font-semibold text-muted-foreground uppercase tracking-wider bg-muted/30">
<th className="px-4 py-3 w-[18%] whitespace-nowrap">Property</th>
{hasType && <th className="px-4 py-3 w-[24%] whitespace-nowrap">Type</th>}
{hasDefault && <th className="px-4 py-3 w-[14%] whitespace-nowrap">Default</th>}
<th className="px-4 py-3">Description</th>
</tr>
</thead>
<tbody className="divide-y divide-border">
<tbody className="divide-y divide-border/60">
{properties.map((property, idx) => (
<tr
key={idx}
className="group hover:bg-muted/20 transition-colors duration-150"
className="group hover:bg-muted/25 transition-colors duration-150"
>
<td className="px-4 py-3.5 align-top whitespace-nowrap border-r border-border">
<span className="inline-flex items-center font-sans text-xs font-semibold text-foreground bg-muted px-2 py-0.5 rounded border border-border/60">
<td className="px-4 py-3.5 align-top whitespace-nowrap">
<code className="inline-flex items-center font-mono text-xs font-semibold text-foreground bg-muted/70 px-2 py-0.5 ds-rounded-sm border border-border/60">
{property.prop}
</span>
</code>
</td>
{hasType && (
<td className="px-4 py-3.5 align-top border-r border-border">
<span className="font-sans text-xs font-medium text-primary break-words">
<td className="px-4 py-3.5 align-top">
<code className="font-mono text-xs font-medium text-primary break-words leading-5">
{property.type}
</span>
</code>
</td>
)}
{hasDefault && (
<td className="px-4 py-3.5 align-top whitespace-nowrap font-sans text-xs border-r border-border">
<span className="text-muted-foreground">
{property.defaultValue || '—'}
</span>
<td className="px-4 py-3.5 align-top whitespace-nowrap">
{property.defaultValue ? (
<code className="font-mono text-xs text-foreground/80 leading-5">
{property.defaultValue}
</code>
) : (
<span className="font-mono text-xs text-muted-foreground/50 leading-5">
—
</span>
)}
</td>
)}
<td className="px-4 py-3.5 align-top">
<p className="text-sm text-muted-foreground leading-relaxed max-w-prose">
<p className="text-sm text-muted-foreground leading-5 max-w-prose">
{property.description}
</p>
</td>
Expand Down
Loading