Skip to content
Open
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
Binary file added .github/assets/customization-sliders/after.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/customization-sliders/before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions ATTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ The extraction preserves the Plotter skill package originally located at `apps/u

The skill’s bundled reference manifest records the source revisions of its approved SVG snapshots. Dated feedback and audits from the coss period were removed from the tree after commit `37f3464` and remain in git history.

## Component attribution

The customization token controls adapt DialKit’s slider component (MIT, Copyright (c) 2026 Josh Puckett, [joshpuckett/dialkit](https://github.com/joshpuckett/dialkit)). `components/ui/slider.tsx` keeps DialKit’s label-and-value-in-track layout, hover-to-edit value, and decile snapping, adapted to Plotter’s theme tokens and Base UI version.

## License record

Plotter and its portable skill package use the [MIT license](LICENSE), selected by the maintainer on 2026-11-08. The notices retain the coss.com and Origin UI copyright and add Pasquale Vitiello’s copyright for Plotter. The current coss source also uses MIT.
Expand Down
51 changes: 24 additions & 27 deletions components/plotter/plotter-token-guide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
FieldLabel,
} from "@/components/ui/field";
import { Input } from "@/components/ui/input";
import { Slider, SliderValue } from "@/components/ui/slider";
import { Slider } from "@/components/ui/slider";
import {
highlightOpacity,
roleCss,
Expand Down Expand Up @@ -90,6 +90,20 @@ const groups = [
{ label: "Opacity", prefix: "--plotter-opacity-" },
];

function buildCss(values: Values, ink: string) {
const declarations = tokens
.map((token) => ` ${token}: ${values[token]};`)
.join("\n");
return `.illustration {\n --plotter-ink: ${ink};\n${declarations}\n}`;
}

function getSliderConfig(token: ControlToken) {
return {
max: token.startsWith("--plotter-opacity-") ? 1 : defaults[token] * 2,
step: token === "--plotter-opacity-highlight" ? 0.005 : 0.01,
};
}

export function PlotterTokenGuide({ children }: { children: ReactNode }) {
const id = useId();
const cssRef = useRef<HTMLTextAreaElement>(null);
Expand All @@ -100,9 +114,7 @@ export function PlotterTokenGuide({ children }: { children: ReactNode }) {
const [copyState, setCopyState] = useState<"idle" | "copied" | "manual">(
"idle",
);
const css = `.illustration {\n --plotter-ink: ${ink};\n${tokens
.map((token) => ` ${token}: ${values[token]};`)
.join("\n")}\n}`;
const css = buildCss(values, ink);
const previewStyle: CSSProperties & Values & { "--plotter-ink": string } = {
...values,
"--plotter-ink": ink,
Expand Down Expand Up @@ -148,8 +160,9 @@ export function PlotterTokenGuide({ children }: { children: ReactNode }) {
</h2>
<p className="text-sm text-pretty text-muted-foreground">
Adjust ink, stroke widths, and opacity without changing the drawing.
Try every token on MEC-05 and the samples below it, then copy the CSS
to a wrapper around your inline SVG.
Drag a slider, or hover a value and click to type an exact number. Try
every token on MEC-05 and the samples below it, then copy the CSS to a
wrapper around your inline SVG.
</p>
</div>

Expand Down Expand Up @@ -186,40 +199,24 @@ export function PlotterTokenGuide({ children }: { children: ReactNode }) {
.filter((token) => token.startsWith(prefix))
.map((token) => {
const { label, hint } = controls[token];
const max = token.startsWith("--plotter-opacity-")
? 1
: defaults[token] * 2;
const { max, step } = getSliderConfig(token);
return (
<Field className="min-w-0" key={token}>
<Slider
format={{
minimumFractionDigits: 2,
maximumFractionDigits:
token === "--plotter-opacity-highlight" ? 3 : 2,
}}
label={label}
largeStep={0.1}
max={max}
min={0}
onValueChange={(value) => {
setValues((current) => ({
...current,
[token]:
typeof value === "number" ? value : value[0],
[token]: value,
}));
setCopyState("idle");
}}
step={
token === "--plotter-opacity-highlight"
? 0.005
: 0.01
}
step={step}
value={values[token]}
>
<div className="mb-3 flex items-baseline justify-between gap-4">
<FieldLabel>{label}</FieldLabel>
<SliderValue className="font-mono text-xs text-muted-foreground tabular-nums" />
</div>
</Slider>
/>
<FieldDescription className="mt-1">
{hint}
</FieldDescription>
Expand Down
Loading