refactor(docs): remove card shells and format examples
This commit is contained in:
@@ -13,7 +13,13 @@ page Paginationcomponent {
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.2.65</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">Pagination</span></nav><section class="doc-intro"><span class="eyebrow">core component</span><h1>Pagination</h1><p>Reusable pagination component.</p><div class="doc-meta"><span>@wrnexus/ui 0.2.65</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><Pagination currentPage="1" totalPages="1" previousHref="previousHref" nextHref="nextHref" pages="[]" /></code></pre><p>Legacy mount name: <code>data-component="Pagination"</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>currentPage</code></td><td><code>number</code></td><td>Optional</td><td><code>1</code></td></tr><tr><td><code>totalPages</code></td><td><code>number</code></td><td>Optional</td><td><code>1</code></td></tr><tr><td><code>previousHref</code></td><td><code>string</code></td><td>Optional</td><td><code>""</code></td></tr><tr><td><code>nextHref</code></td><td><code>string</code></td><td>Optional</td><td><code>""</code></td></tr><tr><td><code>pages</code></td><td><code>string</code></td><td>Optional</td><td><code>[]</code></td></tr><tr><td><code>showNumbers</code></td><td><code>boolean</code></td><td>Optional</td><td><code>true</code></td></tr><tr><td><code>showSummary</code></td><td><code>boolean</code></td><td>Optional</td><td><code>true</code></td></tr><tr><td><code>totalItems</code></td><td><code>number</code></td><td>Optional</td><td><code>0</code></td></tr><tr><td><code>pageSize</code></td><td><code>number</code></td><td>Optional</td><td><code>10</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>false</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/Pagination.wrn</code></p><pre data-language="wrn"><code>component Pagination {
|
||||
<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">Pagination</span></nav><section class="doc-intro"><span class="eyebrow">core component</span><h1>Pagination</h1><p>Reusable pagination component.</p><div class="doc-meta"><span>@wrnexus/ui 0.2.65</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><Pagination
|
||||
currentPage="1"
|
||||
totalPages="1"
|
||||
previousHref="previousHref"
|
||||
nextHref="nextHref"
|
||||
pages="[]"
|
||||
/></code></pre><p>Legacy mount name: <code>data-component="Pagination"</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>currentPage</code></td><td><code>number</code></td><td>Optional</td><td><code>1</code></td></tr><tr><td><code>totalPages</code></td><td><code>number</code></td><td>Optional</td><td><code>1</code></td></tr><tr><td><code>previousHref</code></td><td><code>string</code></td><td>Optional</td><td><code>""</code></td></tr><tr><td><code>nextHref</code></td><td><code>string</code></td><td>Optional</td><td><code>""</code></td></tr><tr><td><code>pages</code></td><td><code>string</code></td><td>Optional</td><td><code>[]</code></td></tr><tr><td><code>showNumbers</code></td><td><code>boolean</code></td><td>Optional</td><td><code>true</code></td></tr><tr><td><code>showSummary</code></td><td><code>boolean</code></td><td>Optional</td><td><code>true</code></td></tr><tr><td><code>totalItems</code></td><td><code>number</code></td><td>Optional</td><td><code>0</code></td></tr><tr><td><code>pageSize</code></td><td><code>number</code></td><td>Optional</td><td><code>10</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>false</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/Pagination.wrn</code></p><pre data-language="wrn"><code>component Pagination {
|
||||
props {
|
||||
class: string = ""
|
||||
currentPage = 1
|
||||
@@ -40,8 +46,8 @@ page Paginationcomponent {
|
||||
class="w-full {class}"
|
||||
class:hidden="totalPages <= 1"
|
||||
>
|
||||
<!-- Result summary -->
|
||||
<div
|
||||
<!-- Result summary -->
|
||||
<div
|
||||
class="mb-4 text-sm text-slate-500 dark:text-slate-400"
|
||||
class:hidden="!showSummary || totalItems <= 0"
|
||||
class:text-center="centered"
|
||||
@@ -66,56 +72,52 @@ page Paginationcomponent {
|
||||
|
||||
results
|
||||
</div>
|
||||
|
||||
<div
|
||||
<div
|
||||
class="flex flex-col gap-4 sm:flex-row sm:items-center"
|
||||
class:sm:justify-center="centered"
|
||||
class:sm:justify-between="!centered"
|
||||
>
|
||||
<!-- Previous -->
|
||||
<a
|
||||
<!-- Previous -->
|
||||
<a
|
||||
href="{previousHref}"
|
||||
aria-label="Go to previous page"
|
||||
class="group h-11 items-center justify-center gap-2 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="previousHref === ''"
|
||||
class:inline-flex="previousHref !== ''"
|
||||
>
|
||||
<span class="icon-[lucide--arrow-left] h-4 w-4 transition-transform group-hover:-translate-x-0.5" aria-hidden="true" ></span>
|
||||
|
||||
<span class:hidden="compact">
|
||||
<span class="icon-[lucide--arrow-left] h-4 w-4 transition-transform group-hover:-translate-x-0.5" aria-hidden="true" >
|
||||
</span>
|
||||
<span class:hidden="compact">
|
||||
Previous
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<span
|
||||
</a>
|
||||
<span
|
||||
aria-disabled="true"
|
||||
class="h-11 cursor-not-allowed items-center justify-center gap-2 rounded-xl border border-slate-200 bg-slate-50 px-4 text-sm font-semibold text-slate-400 dark:border-white/10 dark:bg-white/[0.03] dark:text-slate-600"
|
||||
class:hidden="previousHref !== ''"
|
||||
class:inline-flex="previousHref === ''"
|
||||
>
|
||||
<span class="icon-[lucide--arrow-left] h-4 w-4" aria-hidden="true" ></span>
|
||||
|
||||
<span class:hidden="compact">
|
||||
<span class="icon-[lucide--arrow-left] h-4 w-4" aria-hidden="true" >
|
||||
</span>
|
||||
<span class:hidden="compact">
|
||||
Previous
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<!-- Numbered pages -->
|
||||
<div
|
||||
</span>
|
||||
<!-- Numbered pages -->
|
||||
<div
|
||||
class="flex flex-wrap items-center justify-center gap-1.5"
|
||||
class:hidden="!showNumbers"
|
||||
>
|
||||
{#each pages as page}
|
||||
<!-- Ellipsis -->
|
||||
<span
|
||||
<span
|
||||
class="grid h-10 w-10 place-items-center text-sm font-semibold text-slate-400"
|
||||
class:hidden="!page.ellipsis"
|
||||
>
|
||||
…
|
||||
</span>
|
||||
|
||||
<!-- Page link -->
|
||||
<a
|
||||
<!-- Page link -->
|
||||
<a
|
||||
href="{page.href}"
|
||||
aria-label="Go to page {page.number}"
|
||||
class="h-10 min-w-10 items-center justify-center rounded-xl px-3 text-sm font-semibold transition focus:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500"
|
||||
@@ -137,9 +139,8 @@ page Paginationcomponent {
|
||||
>
|
||||
{page.number}
|
||||
</a>
|
||||
|
||||
<!-- Current page -->
|
||||
<span
|
||||
<!-- Current page -->
|
||||
<span
|
||||
aria-current="page"
|
||||
aria-label="Current page, page {page.number}"
|
||||
class="h-10 min-w-10 items-center justify-center rounded-xl bg-indigo-600 px-3 text-sm font-bold text-white shadow-lg shadow-indigo-600/20"
|
||||
@@ -150,9 +151,8 @@ page Paginationcomponent {
|
||||
</span>
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
<!-- Mobile page counter -->
|
||||
<div
|
||||
<!-- Mobile page counter -->
|
||||
<div
|
||||
class="flex items-center justify-center rounded-xl border border-slate-200 bg-slate-50 px-4 py-2.5 text-sm font-medium text-slate-500 dark:border-white/10 dark:bg-white/5 dark:text-slate-400"
|
||||
class:hidden="showNumbers"
|
||||
>
|
||||
@@ -167,36 +167,34 @@ page Paginationcomponent {
|
||||
<span class="ml-1 font-bold text-slate-950 dark:text-white">
|
||||
{totalPages}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- Next -->
|
||||
<a
|
||||
</div>
|
||||
<!-- Next -->
|
||||
<a
|
||||
href="{nextHref}"
|
||||
aria-label="Go to next page"
|
||||
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-950"
|
||||
class:hidden="nextHref === ''"
|
||||
class:inline-flex="nextHref !== ''"
|
||||
>
|
||||
<span class:hidden="compact">
|
||||
<span class:hidden="compact">
|
||||
Next
|
||||
</span>
|
||||
|
||||
<span class="icon-[lucide--arrow-right] h-4 w-4 transition-transform group-hover:translate-x-0.5" aria-hidden="true" ></span>
|
||||
</a>
|
||||
|
||||
<span
|
||||
<span class="icon-[lucide--arrow-right] h-4 w-4 transition-transform group-hover:translate-x-0.5" aria-hidden="true" >
|
||||
</span>
|
||||
</a>
|
||||
<span
|
||||
aria-disabled="true"
|
||||
class="h-11 cursor-not-allowed items-center justify-center gap-2 rounded-xl border border-slate-200 bg-slate-50 px-4 text-sm font-semibold text-slate-400 dark:border-white/10 dark:bg-white/[0.03] dark:text-slate-600"
|
||||
class:hidden="nextHref !== ''"
|
||||
class:inline-flex="nextHref === ''"
|
||||
>
|
||||
<span class:hidden="compact">
|
||||
<span class:hidden="compact">
|
||||
Next
|
||||
</span>
|
||||
|
||||
<span class="icon-[lucide--arrow-right] h-4 w-4" aria-hidden="true" ></span>
|
||||
</span>
|
||||
</div>
|
||||
<span class="icon-[lucide--arrow-right] h-4 w-4" aria-hidden="true" >
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</nav>
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user