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
26 changes: 26 additions & 0 deletions apps/specimens/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import {
AttachmentChip,
BudgetPill,
Button,
buttonVariants,
Card,
cn,
ContextMeter,
MetricDisplay,
ModeSwitch,
Expand All @@ -26,6 +28,7 @@ import { ArrowUpRight, Link2, Moon, SearchX, Sun, X } from "lucide-react";
import { type ReactNode, useEffect, useMemo, useRef, useState } from "react";

import { ComposerDemo, RunRailDemo } from "./block-demos";
import { repository } from "./catalog";
import { CodeSnippet } from "./code-snippet";
import { ComponentPreview } from "./component-preview";
import { Lab } from "./lab";
Expand All @@ -37,6 +40,16 @@ import {
} from "./examples";

const density = "compact";

// lucide-react 1.x no longer ships brand marks, so the GitHub mark is inlined.
function GitHubMark() {
return (
<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
<path d="M12 .3a12 12 0 0 0-3.8 23.38c.6.12.83-.26.83-.57v-2.02c-3.34.73-4.04-1.61-4.04-1.61-.55-1.39-1.34-1.76-1.34-1.76-1.09-.74.08-.73.08-.73 1.2.09 1.84 1.24 1.84 1.24 1.07 1.83 2.8 1.3 3.49 1 .1-.78.42-1.3.76-1.6-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.14-.3-.54-1.52.1-3.18 0 0 1-.32 3.3 1.23a11.5 11.5 0 0 1 6 0c2.28-1.55 3.29-1.23 3.29-1.23.64 1.66.24 2.88.12 3.18a4.65 4.65 0 0 1 1.23 3.22c0 4.61-2.8 5.63-5.48 5.92.42.36.81 1.1.81 2.22v3.29c0 .32.21.7.82.58A12 12 0 0 0 12 .3" />
</svg>
);
}

type Scheme = "light" | "dark";
type SpecimenGroup = "Composer" | "Run rail" | "Blocks";

Expand Down Expand Up @@ -800,6 +813,19 @@ function App() {
</div>
) : null}
<div className="specimen-topbar__actions">
<a
href={repository}
target="_blank"
rel="noopener noreferrer"
className={cn(
buttonVariants({ variant: "ghost" }),
"repository-control",
)}
aria-label="OpenCoven UI on GitHub"
title="OpenCoven UI on GitHub"
>
<GitHubMark />
</a>
Comment on lines +816 to +828
<Button
variant="ghost"
className="scheme-control"
Expand Down
15 changes: 10 additions & 5 deletions apps/specimens/src/specimens.css
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ body {
-webkit-appearance: none;
}

.scheme-control {
.scheme-control,
.repository-control {
flex: none;
width: 2.25rem;
height: 2.25rem;
Expand All @@ -167,7 +168,8 @@ body {
white-space: nowrap;
}

.scheme-control svg {
.scheme-control svg,
.repository-control svg {
width: 0.875rem;
height: 0.875rem;
}
Expand Down Expand Up @@ -1091,7 +1093,8 @@ p > .hljs {
height: 2.75rem;
}

.scheme-control {
.scheme-control,
.repository-control {
width: 2.75rem;
height: 2.75rem;
min-height: 2.75rem;
Expand All @@ -1106,12 +1109,14 @@ p > .hljs {

@media (pointer: coarse) and (min-width: 68.01rem) {
.specimen-search input,
.scheme-control {
.scheme-control,
.repository-control {
height: 2.75rem;
min-height: 2.75rem;
}

.scheme-control {
.scheme-control,
.repository-control {
width: 2.75rem;
}

Expand Down
Loading