fix(ui): render polished SSR-safe component variants
This commit is contained in:
@@ -21,7 +21,7 @@ function action(name) {
|
||||
disabled = false
|
||||
class = ""
|
||||
}
|
||||
view { <span class="wire-catalog-action {class}"><a data-show="href" href="{href}" class="wire-btn wire-btn--{variant}">{label}<slot /></a><button data-show="!href" type="{type}" disabled="{disabled}" class="wire-btn wire-btn--{variant}">{label}<slot /></button></span> }
|
||||
view { <span class="wire-catalog-action {class}">{#if href}<a href="{href}" class="wire-btn wire-btn--{variant}">{label}<slot /></a>{:else}<button type="{type}" disabled="{disabled}" class="wire-btn wire-btn--{variant}">{label}<slot /></button>{/if}</span> }
|
||||
}`;
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ function content(name) {
|
||||
alt = ""
|
||||
class = ""
|
||||
}
|
||||
view { <article class="wire-card wire-catalog-card {class}"><img data-show="image" src="{image}" alt="{alt}" class="wire-catalog-card__image" /><span data-show="eyebrow" class="wire-eyebrow">{eyebrow}</span><h3 data-show="title">{title}</h3><p data-show="description">{description}</p><slot /><a data-show="href" href="{href}" class="wire-btn wire-btn--ghost">{actionLabel}</a></article> }
|
||||
view { <article class="wire-card wire-catalog-card {class}">{#if image}<img src="{image}" alt="{alt}" class="wire-catalog-card__image" />{/if}{#if eyebrow}<span class="wire-eyebrow">{eyebrow}</span>{/if}{#if title}<h3>{title}</h3>{/if}{#if description}<p>{description}</p>{/if}<slot />{#if href}<a href="{href}" class="wire-btn wire-btn--ghost">{actionLabel}</a>{/if}</article> }
|
||||
}`;
|
||||
}
|
||||
|
||||
|
||||
@@ -107,4 +107,4 @@ for (const category of [...new Set(components.map((component) => component.categ
|
||||
);
|
||||
}
|
||||
}
|
||||
writeFileSync(join(uiRoot, "COMPONENTS.md"), `${lines.join("\n")}\n`);
|
||||
writeFileSync(join(uiRoot, "COMPONENTS.md"), `${lines.join("\n").trimEnd()}\n`);
|
||||
|
||||
Reference in New Issue
Block a user