Add diagram and pattern glyphs as currentColor SVG components so a parent text class can recolor them.

This commit is contained in:
adilallo committed 2026-11-12 17:50:45 -07:00
1 parent 9a9358ad46
commit bf9ee79c9f
44 files changed
+995

No files matched your search

+78
View File
@@ -0,0 +1,78 @@
import DiagramGlyph, {
DIAGRAM_GLYPH_OPTIONS,
DIAGRAM_GLYPH_SIZE_OPTIONS,
} from "../../app/components/asset/DiagramGlyph";
export default {
title: "Components/Asset/DiagramGlyph",
component: DiagramGlyph,
parameters: {
layout: "centered",
docs: {
description: {
component:
"Diagram glyphs from Asset / Diagram Glyph. Paths use currentColor so a parent text class recolors the mark.",
},
},
},
argTypes: {
glyph: {
control: { type: "select" },
options: [...DIAGRAM_GLYPH_OPTIONS],
},
size: {
control: { type: "select" },
options: [...DIAGRAM_GLYPH_SIZE_OPTIONS],
},
className: { control: "text" },
title: { control: "text" },
description: { control: "text" },
},
};
export const Default = {
args: {
glyph: "group",
size: 48,
className: "text-[var(--color-content-default-primary)]",
},
};
export const Size24 = {
args: {
glyph: "vote",
size: 24,
className: "text-[var(--color-content-default-primary)]",
},
};
export const Recolor = {
args: {
glyph: "consensus",
size: 48,
className: "text-[var(--color-content-default-brand-primary)]",
},
};
export const InDiagram = {
args: {
glyph: "rotation",
size: 48,
className: "text-[var(--color-content-default-primary)]",
title: "Rotation",
description: "Roles move on a set schedule so no one keeps the keys.",
},
};
export const AllGlyphs = {
render: () => (
<div className="grid grid-cols-6 gap-4 text-[var(--color-content-default-primary)]">
{DIAGRAM_GLYPH_OPTIONS.map((glyph) => (
<div key={glyph} className="flex flex-col items-center gap-2">
<DiagramGlyph glyph={glyph} size={48} />
<span className="text-xx-small-paragraph">{glyph}</span>
</div>
))}
</div>
),
};
+78
View File
@@ -0,0 +1,78 @@
import PatternGlyph, {
PATTERN_GLYPH_OPTIONS,
PATTERN_GLYPH_SIZE_OPTIONS,
} from "../../app/components/asset/PatternGlyph";
export default {
title: "Components/Asset/PatternGlyph",
component: PatternGlyph,
parameters: {
layout: "centered",
docs: {
description: {
component:
"Pattern glyphs from the Structure Before Crisis zine. Paths use currentColor so a parent text class recolors the mark.",
},
},
},
argTypes: {
glyph: {
control: { type: "select" },
options: [...PATTERN_GLYPH_OPTIONS],
},
size: {
control: { type: "select" },
options: [...PATTERN_GLYPH_SIZE_OPTIONS],
},
className: { control: "text" },
title: { control: "text" },
description: { control: "text" },
},
};
export const Default = {
args: {
glyph: "lazy-consensus",
size: 48,
className: "text-[var(--color-content-default-primary)]",
},
};
export const Size24 = {
args: {
glyph: "open-participation",
size: 24,
className: "text-[var(--color-content-default-primary)]",
},
};
export const Recolor = {
args: {
glyph: "full-consensus",
size: 48,
className: "text-[var(--color-content-default-brand-primary)]",
},
};
export const InDiagram = {
args: {
glyph: "conflict-council",
size: 48,
className: "text-[var(--color-content-default-primary)]",
title: "Conflict council",
description: "Named members hear what the first steps could not settle.",
},
};
export const AllGlyphs = {
render: () => (
<div className="grid grid-cols-6 gap-4 text-[var(--color-content-default-primary)]">
{PATTERN_GLYPH_OPTIONS.map((glyph) => (
<div key={glyph} className="flex flex-col items-center gap-2">
<PatternGlyph glyph={glyph} size={48} />
<span className="text-xx-small-paragraph text-center">{glyph}</span>
</div>
))}
</div>
),
};