192 lines
14 KiB
Plaintext
192 lines
14 KiB
Plaintext
page EmptyStatecomponent {
|
|
seo {
|
|
title = "EmptyState component"
|
|
description = "Reusable empty state component."
|
|
}
|
|
|
|
view {
|
|
<div class="docs-shell">
|
|
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
|
<header class="topbar">
|
|
<a class="brand" href="/"><span>W</span> WRNexusJS</a>
|
|
<nav aria-label="Primary"><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="/components">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
|
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.2.77</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
|
</header>
|
|
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="/components">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
|
<main class="portal-main docs-layout component-detail-page"><article id="main" class="documentation prose standalone"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/components">Components</a><span>/</span><span aria-current="page">EmptyState</span></nav><section class="doc-intro"><span class="eyebrow">feedback component</span><h1>EmptyState</h1><p>Reusable empty state component.</p><div class="doc-meta"><span>@wrnexus/ui 0.2.77</span><span>12 props</span><span>0 slots</span><span>0 events</span></div></section><section id="usage"><h2>Usage</h2><p>Components are auto-discovered. Use the component directly in any <code>.wrn</code> view:</p><pre data-language="wrn"><code><EmptyState
|
|
eyebrow="eyebrow"
|
|
title="Nothing found"
|
|
description="description"
|
|
iconClass="icon-[lucide--inbox]"
|
|
primaryLabel="primaryLabel"
|
|
/></code></pre><p>Legacy mount name: <code>data-component="EmptyState"</code>.</p></section><section id="props"><h2>Props and attributes</h2><div class="table-wrap"><table><thead><tr><th>Prop</th><th>Type</th><th>Requirement</th><th>Default</th></tr></thead><tbody><tr><td><code>class</code></td><td><code>string</code></td><td>Optional</td><td><code>""</code></td></tr><tr><td><code>eyebrow</code></td><td><code>string</code></td><td>Optional</td><td><code>""</code></td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Optional</td><td><code>"Nothing found"</code></td></tr><tr><td><code>description</code></td><td><code>string</code></td><td>Optional</td><td><code>""</code></td></tr><tr><td><code>iconClass</code></td><td><code>string</code></td><td>Optional</td><td><code>"icon-[lucide--inbox]"</code></td></tr><tr><td><code>primaryLabel</code></td><td><code>string</code></td><td>Optional</td><td><code>""</code></td></tr><tr><td><code>primaryHref</code></td><td><code>string</code></td><td>Optional</td><td><code>""</code></td></tr><tr><td><code>secondaryLabel</code></td><td><code>string</code></td><td>Optional</td><td><code>""</code></td></tr><tr><td><code>secondaryHref</code></td><td><code>string</code></td><td>Optional</td><td><code>""</code></td></tr><tr><td><code>compact</code></td><td><code>boolean</code></td><td>Optional</td><td><code>false</code></td></tr><tr><td><code>centered</code></td><td><code>boolean</code></td><td>Optional</td><td><code>true</code></td></tr><tr><td><code>suggestions</code></td><td><code>string</code></td><td>Optional</td><td><code>[]</code></td></tr></tbody></table></div></section><section id="slots"><h2>Slots</h2><p>This component does not declare a slot.</p></section><section id="events"><h2>Events</h2><p>This component does not declare a custom event.</p></section><section id="source"><h2>Source contract</h2><p>Installed source: <code>components/EmptyState.wrn</code></p><pre data-language="wrn"><code>component EmptyState {
|
|
props {
|
|
class: string = ""
|
|
eyebrow = ""
|
|
title = "Nothing found"
|
|
description = ""
|
|
|
|
iconClass = "icon-[lucide--inbox]"
|
|
|
|
primaryLabel = ""
|
|
primaryHref = ""
|
|
|
|
secondaryLabel = ""
|
|
secondaryHref = ""
|
|
|
|
compact = false
|
|
centered = true
|
|
|
|
suggestions = []
|
|
}
|
|
|
|
view {
|
|
<section
|
|
aria-labelledby="empty-state-title"
|
|
class="w-full {class}"
|
|
class:py-6="compact"
|
|
class:sm:py-8="compact"
|
|
class:py-8="!compact"
|
|
class:sm:py-10="!compact"
|
|
>
|
|
<div
|
|
class=" relative mx-auto w-full overflow-hidden rounded-3xl border border-indigo-200/80 bg-linear-to-br from-indigo-50/90 via-white to-violet-50/80 shadow-xl shadow-indigo-950/5 dark:border-indigo-500/20 dark:from-indigo-500/10 dark:via-slate-900 dark:to-violet-500/10 dark:shadow-black/20 "
|
|
class:max-w-3xl="centered"
|
|
>
|
|
<!-- Background decoration -->
|
|
<div
|
|
aria-hidden="true"
|
|
class="pointer-events-none absolute inset-0 overflow-hidden"
|
|
>
|
|
<div class="absolute -right-20 -top-24 h-56 w-56 rounded-full bg-indigo-200/30 blur-3xl dark:bg-indigo-500/10">
|
|
</div>
|
|
<div class="absolute -bottom-24 -left-20 h-56 w-56 rounded-full bg-violet-200/20 blur-3xl dark:bg-violet-500/5">
|
|
</div>
|
|
<div class="absolute inset-x-0 top-0 h-px bg-linear-to-r from-transparent via-indigo-300/70 to-transparent dark:via-indigo-500/20">
|
|
</div>
|
|
</div>
|
|
<div
|
|
class="relative"
|
|
class:px-6="compact"
|
|
class:py-8="compact"
|
|
class:sm:px-8="compact"
|
|
class:sm:py-9="compact"
|
|
class:px-6="!compact"
|
|
class:py-10="!compact"
|
|
class:sm:px-10="!compact"
|
|
class:sm:py-12="!compact"
|
|
class:lg:px-12="!compact"
|
|
class:text-center="centered"
|
|
>
|
|
<div
|
|
class=" {compact ? 'max-w-xl' : 'max-w-2xl'} {centered ? 'mx-auto' : 'mr-auto'} "
|
|
class:max-w-xl="compact"
|
|
class:max-w-2xl="!compact"
|
|
>
|
|
<!-- Icon -->
|
|
<div
|
|
class="flex"
|
|
class:justify-center="centered"
|
|
>
|
|
<span
|
|
class="grid place-items-center rounded-2xl bg-indigo-50 text-indigo-600 ring-1 ring-inset ring-indigo-200 dark:bg-indigo-500/10 dark:text-indigo-300 dark:ring-indigo-500/20"
|
|
class:h-12="compact"
|
|
class:w-12="compact"
|
|
class:h-14="!compact"
|
|
class:w-14="!compact"
|
|
>
|
|
<span class="{iconClass}" class:h-5="compact" class:w-5="compact" class:h-6="!compact" class:w-6="!compact" aria-hidden="true" >
|
|
</span>
|
|
</span>
|
|
</div>
|
|
<!-- Eyebrow -->
|
|
<p
|
|
class="mt-5 text-xs font-bold uppercase tracking-[0.18em] text-indigo-600 dark:text-indigo-400"
|
|
class:hidden="eyebrow === ''"
|
|
>
|
|
{eyebrow}
|
|
</p>
|
|
<!-- Title -->
|
|
<h2
|
|
id="empty-state-title"
|
|
class="font-bold tracking-tight text-slate-950 dark:text-white"
|
|
class:mt-5="eyebrow === ''"
|
|
class:mt-3="eyebrow !== ''"
|
|
class:text-xl="compact"
|
|
class:leading-tight="compact"
|
|
class:sm:text-2xl="compact"
|
|
class:text-2xl="!compact"
|
|
class:leading-tight="!compact"
|
|
class:sm:text-3xl="!compact"
|
|
class:lg:text-[2rem]="!compact"
|
|
>
|
|
{title}
|
|
</h2>
|
|
<!-- Description -->
|
|
<p
|
|
class="mx-auto mt-3 max-w-xl text-sm leading-6 text-slate-600 dark:text-slate-400"
|
|
class:hidden="description === ''"
|
|
class:sm:text-base="!compact"
|
|
class:sm:leading-7="!compact"
|
|
>
|
|
{description}
|
|
</p>
|
|
<!-- Suggestions -->
|
|
<div
|
|
class="mt-6 flex flex-wrap gap-2"
|
|
class:hidden="suggestions.length === 0"
|
|
class:justify-center="centered"
|
|
>
|
|
{#each suggestions.slice(0, 4) as suggestion}
|
|
<a
|
|
href="{suggestion.href}"
|
|
class="inline-flex items-center gap-2 rounded-full border border-slate-200 bg-white px-3 py-2 text-xs font-semibold text-slate-600 shadow-sm transition hover:-translate-y-0.5 hover:border-indigo-300 hover:bg-indigo-50 hover:text-indigo-700 dark:border-white/10 dark:bg-white/5 dark:text-slate-300 dark:hover:border-indigo-500/30 dark:hover:bg-indigo-500/10 dark:hover:text-indigo-300"
|
|
>
|
|
<span class="{suggestion.iconClass} h-3.5 w-3.5" aria-hidden="true" >
|
|
</span>
|
|
|
|
{suggestion.label}
|
|
</a>
|
|
{/each}
|
|
</div>
|
|
<!-- Actions -->
|
|
<div
|
|
class="flex flex-col gap-3 sm:flex-row"
|
|
class:mt-7="suggestions.length === 0"
|
|
class:mt-6="suggestions.length > 0"
|
|
class:hidden="primaryLabel === '' && secondaryLabel === ''"
|
|
class:justify-center="centered"
|
|
>
|
|
<a
|
|
href="{secondaryHref}"
|
|
class="h-11 items-center justify-center rounded-xl border border-slate-200 bg-white px-4 text-sm font-semibold text-slate-700 shadow-sm transition hover:-translate-y-0.5 hover:border-indigo-300 hover:bg-slate-50 hover:text-indigo-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 dark:border-white/10 dark:bg-white/5 dark:text-slate-200 dark:hover:border-indigo-500/30 dark:hover:bg-white/10 dark:hover:text-indigo-300"
|
|
class:hidden="secondaryLabel === ''"
|
|
class:inline-flex="secondaryLabel !== ''"
|
|
>
|
|
{secondaryLabel}
|
|
</a>
|
|
<a
|
|
href="{primaryHref}"
|
|
class="group h-11 items-center justify-center gap-2 rounded-xl bg-indigo-600 px-4 text-sm font-bold text-white shadow-lg shadow-indigo-600/20 transition hover:-translate-y-0.5 hover:bg-indigo-500 hover:shadow-xl focus:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-slate-900"
|
|
class:hidden="primaryLabel === ''"
|
|
class:inline-flex="primaryLabel !== ''"
|
|
>
|
|
{primaryLabel}
|
|
|
|
<span class="icon-[lucide--arrow-right] h-4 w-4 transition-transform group-hover:translate-x-1" aria-hidden="true" >
|
|
</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
}
|
|
}
|
|
</code></pre></section></article><aside class="on-this-page"><h2>On this page</h2><nav><a href="#usage">Usage</a><a href="#props">Props and attributes</a><a href="#slots">Slots</a><a href="#events">Events</a><a href="#source">Source contract</a></nav></aside></main>
|
|
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.2.77</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
|
<BackToTop />
|
|
</div>
|
|
}
|
|
}
|