Files
WRNexusJSDoc/app/pages/components/cookie-preferences-dialog.wrn
T

78 lines
7.5 KiB
Plaintext

page CookiePreferencesDialogcomponent {
seo {
title = "CookiePreferencesDialog component"
description = "Reusable cookie preferences dialog 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.3.2</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">CookiePreferencesDialog</span></nav><section class="doc-intro"><span class="eyebrow">overlays component</span><h1>CookiePreferencesDialog</h1><p>Reusable cookie preferences dialog component.</p><div class="doc-meta"><span>@wrnexus/ui 0.3.2</span><span>7 props</span><span>0 slots</span><span>2 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>&lt;CookiePreferencesDialog
title=&quot;Cookie preferences&quot;
description=&quot;Choose which optional cookies you allow. Essential cookies are always enabled.&quot;
saveLabel=&quot;Save preferences&quot;
acceptLabel=&quot;Accept all&quot;
rejectLabel=&quot;Reject optional&quot;
/&gt;</code></pre><p>Legacy mount name: <code>data-component=&quot;CookiePreferencesDialog&quot;</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>title</code></td><td><code>string</code></td><td>Optional</td><td><code>&quot;Cookie preferences&quot;</code></td></tr><tr><td><code>description</code></td><td><code>string</code></td><td>Optional</td><td><code>&quot;Choose which optional cookies you allow. Essential cookies are always enabled.&quot;</code></td></tr><tr><td><code>saveLabel</code></td><td><code>string</code></td><td>Optional</td><td><code>&quot;Save preferences&quot;</code></td></tr><tr><td><code>acceptLabel</code></td><td><code>string</code></td><td>Optional</td><td><code>&quot;Accept all&quot;</code></td></tr><tr><td><code>rejectLabel</code></td><td><code>string</code></td><td>Optional</td><td><code>&quot;Reject optional&quot;</code></td></tr><tr><td><code>open</code></td><td><code>boolean</code></td><td>Optional</td><td><code>false</code></td></tr><tr><td><code>class</code></td><td><code>string</code></td><td>Optional</td><td><code>&quot;&quot;</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><ul><li><code>change</code></li><li><code>click</code></li></ul></section><section id="source"><h2>Source contract</h2><p>Installed source: <code>components/CookiePreferencesDialog.wrn</code></p><pre data-language="wrn"><code>component CookiePreferencesDialog &#123;
props &#123;
title = &quot;Cookie preferences&quot;
description = &quot;Choose which optional cookies you allow. Essential cookies are always enabled.&quot;
saveLabel = &quot;Save preferences&quot;
acceptLabel = &quot;Accept all&quot;
rejectLabel = &quot;Reject optional&quot;
open = false
class = &quot;&quot;
&#125;
state visible = open
state analytics = false
state marketing = false
view &#123;
&lt;div data-show=&quot;visible&quot; class=&quot;wire-overlay &#123;class&#125;&quot; role=&quot;presentation&quot;&gt;
&lt;section role=&quot;dialog&quot; aria-modal=&quot;true&quot; aria-labelledby=&quot;cookie-preferences-title&quot; class=&quot;wire-dialog wire-cookie-dialog&quot;&gt;
&lt;h2 id=&quot;cookie-preferences-title&quot; class=&quot;wire-dialog__title&quot;&gt;&#123;title&#125;&lt;/h2&gt;
&lt;p class=&quot;wire-dialog__description&quot;&gt;&#123;description&#125;&lt;/p&gt;
&lt;div class=&quot;wire-cookie-list&quot;&gt;
&lt;label class=&quot;wire-cookie-option&quot;&gt;
&lt;span&gt;
&lt;strong&gt;Essential&lt;/strong&gt;
&lt;small&gt;Required for security and core functionality.&lt;/small&gt;
&lt;/span&gt;
&lt;input type=&quot;checkbox&quot; checked disabled /&gt;
&lt;/label&gt;
&lt;label class=&quot;wire-cookie-option&quot;&gt;
&lt;span&gt;
&lt;strong&gt;Analytics&lt;/strong&gt;
&lt;small&gt;Helps improve product performance.&lt;/small&gt;
&lt;/span&gt;
&lt;input type=&quot;checkbox&quot; checked=&quot;&#123;analytics&#125;&quot; @change=&quot;analytics = event.target.checked&quot; /&gt;
&lt;/label&gt;
&lt;label class=&quot;wire-cookie-option&quot;&gt;
&lt;span&gt;
&lt;strong&gt;Marketing&lt;/strong&gt;
&lt;small&gt;Supports relevant campaigns and measurement.&lt;/small&gt;
&lt;/span&gt;
&lt;input type=&quot;checkbox&quot; checked=&quot;&#123;marketing&#125;&quot; @change=&quot;marketing = event.target.checked&quot; /&gt;
&lt;/label&gt;
&lt;/div&gt;
&lt;div class=&quot;wire-dialog__actions wire-dialog__actions--wrap&quot;&gt;
&lt;button type=&quot;button&quot; class=&quot;wire-btn wire-btn--ghost&quot; @click=&quot;analytics = false; marketing = false&quot;&gt;&#123;rejectLabel&#125;&lt;/button&gt;
&lt;button type=&quot;button&quot; class=&quot;wire-btn wire-btn--default&quot; @click=&quot;analytics = true; marketing = true&quot;&gt;&#123;acceptLabel&#125;&lt;/button&gt;
&lt;button type=&quot;button&quot; class=&quot;wire-btn wire-btn--primary&quot; @click=&quot;visible = false&quot;&gt;&#123;saveLabel&#125;&lt;/button&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;/div&gt;
&#125;
&#125;
</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.3.2</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>
}
}