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 configurator/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
const DOMAIN_LABELS: Record<string, string> = {
home: "Home", colors: "Colors", typography: "Typography", spacing: "Spacing",
layout: "Layout", borders: "Borders", shadows: "Shadows", motion: "Motion",
effects: "Effects", macros: "Macros", misc: "Misc", themes: "Themes",
wcag: "WCAG", setup: "Install", cheatsheet: "Classes",
effects: "Effects", macros: "Macros", misc: "Misc", components: "Components",
themes: "Themes", wcag: "WCAG", setup: "Install", cheatsheet: "Classes",
};

function overridesByDomain(ov: Record<string, string>): Record<string, number> {
Expand Down
2 changes: 1 addition & 1 deletion configurator/src/components/CommandPalette.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
const DOMAIN_LABELS: Record<string, string> = {
colors: "Colors", typography: "Typography", spacing: "Spacing", layout: "Layout",
borders: "Borders", shadows: "Shadows", motion: "Motion", effects: "Effects",
macros: "Macros", misc: "Misc",
macros: "Macros", misc: "Misc", components: "Components",
};

let results = $derived((() => {
Expand Down
3 changes: 3 additions & 0 deletions configurator/src/components/DomainPanel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import EffectsPanel from './panels/EffectsPanel.svelte';
import MacrosPanel from './panels/MacrosPanel.svelte';
import MiscPanel from './panels/MiscPanel.svelte';
import ComponentsPanel from './panels/ComponentsPanel.svelte';
import ThemesPanel from './panels/ThemesPanel.svelte';
import ExportPanel from './panels/ExportPanel.svelte';
import CheatsheetPanel from './panels/CheatsheetPanel.svelte';
Expand Down Expand Up @@ -93,6 +94,8 @@
<MacrosPanel {overrides} {onSet} {onReset} />
{:else if domain === "misc"}
<MiscPanel {overrides} {onSet} {onReset} {onBulkChange} />
{:else if domain === "components"}
<ComponentsPanel {overrides} {onSet} {onReset} />
{:else}
<GenericTokenPanel {domain} {tokens} {overrides} {onSet} {onReset} />
{/if}
Expand Down
19 changes: 7 additions & 12 deletions configurator/src/components/panels/BordersPanel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@
];

const COMPONENT_TOKENS = [
{ label: "Button radius", token: "--sf-btn-radius", unit: "rem", min: 0, max: 2, step: 0.05, default: 0.5, rawDefault: "var(--sf-radius-m)", help: "--sf-btn-radius" },
{ label: "Button padding block", token: "--sf-btn-padding-block", unit: "rem", min: 0, max: 1, step: 0.025, default: 0.375, rawDefault: "var(--sf-space-xs)", help: "--sf-btn-padding-block" },
{ label: "Button padding inline", token: "--sf-btn-padding-inline", unit: "rem", min: 0, max: 2, step: 0.025, default: 1, rawDefault: "var(--sf-space-m)", help: "--sf-btn-padding-inline" },
{ label: "Card radius (inner)", token: "--sf-card-radius", unit: "rem", min: 0, max: 2, step: 0.05, default: 0.5, rawDefault: "var(--sf-radius-m)", help: "--sf-card-radius" },
{ label: "Card padding", token: "--sf-card-padding", unit: "rem", min: 0, max: 3, step: 0.05, default: 1.5, rawDefault: "var(--sf-space-l)", help: "--sf-card-padding" },
{ label: "Field radius", token: "--sf-field-radius", unit: "rem", min: 0, max: 2, step: 0.05, default: 0.5, rawDefault: "var(--sf-radius-m)", help: "--sf-field-radius" },
{ label: "Field padding block", token: "--sf-field-padding-block", unit: "rem", min: 0, max: 1, step: 0.025, default: 0.375, rawDefault: "var(--sf-space-xs)", help: "--sf-field-padding-block" },
{ label: "Field padding inline", token: "--sf-field-padding-inline", unit: "rem", min: 0, max: 2, step: 0.025, default: 0.75, rawDefault: "var(--sf-space-s)", help: "--sf-field-padding-inline" },
Expand All @@ -44,7 +39,7 @@
let showRadiusScale = $state(false);
let showRadiusPreview = $state(false);
let showFineTune = $state(false);
let showComponents = $state(false);
let showFieldShape = $state(false);

function parseNum(val: string | undefined, fallback: number, strip?: string): number {
if (!val) return fallback;
Expand Down Expand Up @@ -382,17 +377,17 @@

<div class="h-px bg-black/6 dark:bg-white/6"></div>

<!-- COMPONENT SHAPE -->
<!-- FIELD SHAPE -->
<div>
<button
onclick={() => { showComponents = !showComponents; }}
aria-expanded={showComponents}
onclick={() => { showFieldShape = !showFieldShape; }}
aria-expanded={showFieldShape}
class="w-full flex items-center justify-between text-[10px] font-semibold text-slate-600 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-200 transition-colors cursor-pointer py-1"
>
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-widest">Component shape</span>
<span class="text-[10px] text-slate-500">{showComponents ? "▲" : "▼"}</span>
<span class="text-[10px] font-bold text-slate-500 uppercase tracking-widest">Field shape</span>
<span class="text-[10px] text-slate-500">{showFieldShape ? "▲" : "▼"}</span>
</button>
{#if showComponents}
{#if showFieldShape}
<div class="mt-2 space-y-2">
{#each COMPONENT_TOKENS as t (t.token)}
<SliderRow
Expand Down
Loading