エクスクルーシブ
Exposure <mv-exposure>
共有とプライバシーの設定(共有ダイアログ、投稿の公開範囲、プロフィールのプライバシー、プロジェクトの公開設定、カレンダーの共有、ファイルリンク)向けの公開度ゲージです。囲んだコントロールを読み取り、確定する前にどの程度公開されるかを伝えます。
文化的リファレンス
Thief: The Dark Project、Looking Glass Studios(1998年、ゲーム)。画面上のインジケーターが、プレイヤーがどれだけ見えているかを、隠れた状態から完全に露出した状態まで常に示すため、一歩踏み出す前に露出度がわかります。UI ではその仕組みだけを残し、中立的なアイコンタイルと段階的なゲージで描いています。共有やプライバシーのフォームのコントロールがひとつの読み取り値に反映され、公開範囲が広がるほど値が上がります。誰がその項目を見られるかを明示し、値を上げている要因をワンクリックで下げられる形で一覧表示し、最も広い範囲への変更は意図的な確認を伴う操作になります。
仕組み
共有とプライバシー設定(共有ダイアログ、投稿の公開範囲、プロフィールのプライバシー、プロジェクトの公開設定、カレンダーの共有、ファイルのリンク)のための公開度ゲージです。囲んだコントロールを読み取り、確定する前にどれだけ公開されるかを伝えます。ラジオ、オプション、スイッチ、テキストフィールド、ユーザーリストは宣言的なスコアマップを持ちます。data-exposure="3" は公開範囲のレベル(最も広いものが優先)、data-exposure="+0.4" は公開範囲を変えずにその帯の中で値を動かす修飾子です(期限のないリンク、ダウンロードの許可、外部のゲストなど)。score(state) 関数ですべてを置き換えることもできます。結果は「Only you」から「Public on the internet」までの落ち着いたひとつの読み取り値です。公開範囲に応じて色が濃くなるアイコンタイル、帯が上がるごとに高くなる段階的なトラック、帯の名前、そして公開範囲の明示(「Visible to: you, 4 people, and anyone at Acme with the link」)で構成されます。その下には、実際に値を上げている要因が影響の大きい順に並び、それぞれにワンクリックの軽減策(「The link never expires → Expire in 7 days」)が付きます。これは実際のコントロールを変更し、その input/change イベントを発火させます。上位の帯に上がると、キャンセル可能な mv-exposure-raise が発行されます(ワークスペースのポリシーで拒否でき、その場合コントロールは元に戻ります)。confirm 以上の帯は保留状態になり、ハッチングとリングで示され、インラインまたはフローティングの確認が表示されます。確認されるか取り消されるまで、ネイティブのフォーム送信はブロックされます。バリアントは 3 つです。bar(要因を含む完全な表示)、badge(ツールバーやコンポーザー向けのコンパクトなステータスチップ。for で別の領域を監視可能)、inline(小さな段階的ゲージ付きの一文)。
| カテゴリー | フォーム |
|---|---|
| タイプ | Web Component(<mv-exposure>) |
| ステータス | 安定版 |
| キット | 信頼とプライバシー |
| 同時にインストールされるもの | button |
| Keywords | exclusive, culture, privacy, sharing, share-dialog, visibility, audience, permissions, access, public, link-sharing, gauge, meter, risk, confirmation, policy, settings, form |
When to use
- A share dialog must make clear who can open a document or file before the user copies the link or clicks Done
- A post, profile or event audience selector should spell out the real reach, not just the option name
- Several small settings (link expiry, downloads, guests) add up to more exposure than any single control suggests
- Making something public must be deliberate and confirmed, or vetoed by an organization policy
Avoid when
- You just need to show a measured quantity in a range (storage used, a score, completion) → use Progress instead
- Access is temporary and elevated (admin mode, a time-boxed share) and must end on time → use Midnight instead
- There is a single public/private toggle with no nuance: a switch with a clear description says it all → use Switch instead
インストール
node scripts/add.mjs exposure --out ./src/marvelousMarvelous UI MCP サーバーを使う AI エージェント:install_components({ slugs: ["exposure"], target_dir: "<absolute path>/src/marvelous", framework: "react" })。
コピーされるファイル(依存関係を含む):tokens/tokens.css, core/base.css, components/button/button.css, core/dom.js, core/element.js, core/motion.js, core/position.js, components/exposure/exposure.js, components/exposure/exposure.css。
使い方
クイックスタート、動作する最小限のマークアップ:
<mv-exposure org="Acme">
<select aria-label="Share with">
<option data-exposure="0">Only me</option>
<option data-exposure="2" selected>Everyone at Acme</option>
<option data-exposure="4">Public on the internet</option>
</select>
</mv-exposure>基本となるマークアップです。ここから属性、data-*、CSS 変数でカスタマイズしてください:
<div id="ex-demo" style="width:min(100%,62rem);margin-inline:auto">
<style>
#ex-demo { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1fr); gap:1.25rem; align-items:start }
#ex-demo .ex-card { display:grid; gap:1rem; padding:1.25rem; border:1px solid var(--mv-border); border-radius:var(--mv-radius-xl); background:var(--mv-surface); box-shadow:var(--mv-shadow-sm) }
#ex-demo .ex-side { display:grid; gap:1.25rem; align-content:start }
#ex-demo .ex-head h3, #ex-demo .ex-head h4 { margin:0; font-size:1rem; font-weight:650; letter-spacing:-.01em }
#ex-demo .ex-head h4 { font-size:.9375rem }
#ex-demo .ex-head p { margin:.125rem 0 0; color:var(--mv-fg-muted); font-size:.8125rem }
#ex-demo .ex-form { display:grid; gap:1rem; margin:0 }
#ex-demo .ex-label { display:block; margin-bottom:.375rem; color:var(--mv-fg); font-size:.8125rem; font-weight:600 }
#ex-demo .ex-people { display:grid; gap:.125rem; margin:0; padding:0; list-style:none }
#ex-demo .ex-person { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:.625rem; padding:.3125rem 0; font-size:.8125rem }
#ex-demo .ex-person b { display:block; font-weight:550 }
#ex-demo .ex-person small { display:block; overflow:hidden; color:var(--mv-fg-muted); font-size:.75rem; text-overflow:ellipsis; white-space:nowrap }
#ex-demo .ex-role { display:flex; align-items:center; gap:.375rem; color:var(--mv-fg-muted); font-size:.75rem }
#ex-demo .ex-access .mv-choice-description { font-size:.75rem }
#ex-demo .ex-row { display:grid; grid-template-columns:minmax(0,11rem) minmax(0,1fr); gap:1rem; align-items:end }
#ex-demo .ex-row .mv-choice { padding-bottom:.125rem }
#ex-demo .ex-foot { display:flex; align-items:center; justify-content:space-between; gap:.75rem 1rem; flex-wrap:wrap; padding-top:1rem; border-top:1px solid var(--mv-border) }
#ex-demo .ex-foot .mv-choice { font-size:.8125rem }
#ex-demo .ex-actions { display:flex; gap:.5rem; margin-inline-start:auto }
#ex-demo .ex-log { margin:0; min-height:1.1rem; color:var(--mv-fg-subtle); font:.75rem/1.45 var(--mv-font-mono) }
#ex-demo .ex-post { display:grid; gap:.75rem }
#ex-demo .ex-post-tools { display:flex; align-items:center; gap:.75rem; flex-wrap:wrap }
#ex-demo .ex-post-tools .mv-select { width:auto; min-width:10.5rem }
#ex-demo .ex-post-tools .mv-choice { font-size:.8125rem }
#ex-demo .ex-post-foot { display:flex; align-items:center; justify-content:space-between; gap:.75rem; padding-top:.75rem; border-top:1px solid var(--mv-border) }
#ex-demo .ex-cal { display:grid; gap:.875rem }
#ex-demo .ex-cal-grid { display:grid; grid-template-columns:1fr 1fr; gap:.75rem }
#ex-demo .ex-cal-reading { padding:.625rem .75rem; border-radius:var(--mv-radius-md); background:var(--mv-bg-subtle); font-size:.8125rem; line-height:1.5 }
@media (max-width:52rem) { #ex-demo { grid-template-columns:minmax(0,1fr) } }
@media (max-width:30rem) { #ex-demo .ex-row, #ex-demo .ex-cal-grid { grid-template-columns:minmax(0,1fr) } }
</style>
<!-- 1 · Share dialog: bar variant, reading on top, factors with one-click reductions, public needs confirmation -->
<section class="ex-card" aria-labelledby="ex-share-title">
<div class="ex-head">
<h3 id="ex-share-title">Share “Q4 launch plan”</h3>
<p>Acme · Marketing › Launches · edited by Maya Chen 2 hours ago</p>
</div>
<mv-exposure id="ex-share" org="Acme" confirm="4" label="Who can see this document">
<form class="ex-form" id="ex-share-form">
<div data-exposure-reading></div>
<div>
<span class="ex-label" id="ex-people-label">People with access</span>
<ul class="ex-people" aria-labelledby="ex-people-label" data-exposure="1" data-exposure-count=".ex-person" data-exposure-audience="{count} people" data-exposure-audience-one="1 person">
<li class="ex-person">
<span class="mv-avatar" data-size="sm" data-variant="tinted" aria-hidden="true"><span class="mv-avatar-fallback">MC</span></span>
<span><b>Maya Chen (you)</b><small>[email protected]</small></span>
<span class="ex-role">Owner</span>
</li>
<li class="ex-person">
<span class="mv-avatar" data-size="sm" data-variant="tinted" aria-hidden="true"><span class="mv-avatar-fallback">DA</span></span>
<span><b>Diego Alvarez</b><small>[email protected]</small></span>
<span class="ex-role">Editor</span>
</li>
<li class="ex-person">
<span class="mv-avatar" data-size="sm" data-variant="tinted" aria-hidden="true"><span class="mv-avatar-fallback">PN</span></span>
<span><b>Priya Natarajan</b><small>[email protected]</small></span>
<span class="ex-role">Commenter</span>
</li>
<li class="ex-person" id="ex-guest" data-exposure="+0.2" data-exposure-factor="A guest outside Acme has access" data-exposure-reduce-label="Remove guest">
<span class="mv-avatar" data-size="sm" data-variant="tinted" aria-hidden="true"><span class="mv-avatar-fallback">JO</span></span>
<span><b>Jordan Okafor</b><small>[email protected]</small></span>
<span class="ex-role"><span class="mv-badge" data-variant="warning" data-size="sm">Guest</span>
<button type="button" class="mv-button" data-variant="ghost" data-size="icon" data-exposure-remove aria-label="Remove Jordan Okafor" style="width:1.75rem;height:1.75rem">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M6 6l12 12M18 6 6 18"/></svg>
</button>
</span>
</li>
</ul>
</div>
<fieldset class="mv-choice-group ex-access">
<legend>General access</legend>
<label class="mv-choice">
<input type="radio" class="mv-radio" name="access" value="restricted" data-exposure="0">
<span class="mv-choice-text"><span class="mv-choice-title">Restricted</span><span class="mv-choice-description">Only the people above can open it</span></span>
</label>
<label class="mv-choice">
<input type="radio" class="mv-radio" name="access" value="org" checked data-exposure="2" data-exposure-audience="anyone at Acme with the link" data-exposure-factor="Anyone at Acme with the link can open it" data-exposure-reduce="restricted" data-exposure-reduce-label="Restrict">
<span class="mv-choice-text"><span class="mv-choice-title">Acme</span><span class="mv-choice-description">Anyone at Acme with the link</span></span>
</label>
<label class="mv-choice">
<input type="radio" class="mv-radio" name="access" value="link" data-exposure="3" data-exposure-audience="anyone with the link" data-exposure-factor="Anyone with the link can open it, no sign-in" data-exposure-reduce="org" data-exposure-reduce-label="Limit to Acme">
<span class="mv-choice-text"><span class="mv-choice-title">Anyone with the link</span><span class="mv-choice-description">No sign-in required</span></span>
</label>
<label class="mv-choice">
<input type="radio" class="mv-radio" name="access" value="public" data-exposure="4" data-exposure-audience="anyone on the internet" data-exposure-factor="Listed publicly and indexed by search engines" data-exposure-reduce="link" data-exposure-reduce-label="Unlist" data-exposure-confirm="Anyone can find “Q4 launch plan” in search results and open it without signing in, including unreleased dates and pricing." data-exposure-confirm-label="Make public">
<span class="mv-choice-text"><span class="mv-choice-title">Public on the web</span><span class="mv-choice-description">Searchable, no sign-in required</span></span>
</label>
</fieldset>
<div class="ex-row">
<div>
<label class="ex-label" for="ex-expires">Link expires</label>
<select class="mv-select" id="ex-expires" name="expires" data-size="sm">
<option value="never" selected data-exposure="+0.4" data-exposure-factor="The link never expires" data-exposure-reduce="7d" data-exposure-reduce-label="Expire in 7 days">Never</option>
<option value="30d" data-exposure="+0.2" data-exposure-factor="The link stays valid for 30 days" data-exposure-reduce="7d" data-exposure-reduce-label="Shorten to 7 days">In 30 days</option>
<option value="7d">In 7 days</option>
<option value="1d">In 24 hours</option>
</select>
</div>
<label class="mv-choice" data-control="end">
<input type="checkbox" role="switch" class="mv-switch" name="download" checked data-exposure="+0.2" data-exposure-factor="Viewers can download, print and copy">
<span class="mv-choice-text"><span class="mv-choice-title">Allow downloads</span><span class="mv-choice-description">Viewers can download, print and copy</span></span>
</label>
</div>
<div class="ex-foot">
<label class="mv-choice"><input type="checkbox" role="switch" class="mv-switch" data-size="sm" id="ex-policy"> Workspace policy: no public documents</label>
<span class="ex-actions">
<button type="button" class="mv-button" data-variant="outline" data-size="sm" id="ex-reset">Reset</button>
<button type="submit" class="mv-button" data-size="sm">Done</button>
</span>
</div>
</form>
</mv-exposure>
<p class="ex-log" id="ex-log" aria-live="off">Pick “Public on the web”, or reduce a factor.</p>
</section>
<div class="ex-side">
<!-- 2 · Post composer: badge variant watching the composer with `for`, custom bands -->
<section class="ex-card" aria-labelledby="ex-post-title">
<div class="ex-head">
<h4 id="ex-post-title">New post</h4>
<p>Posting as Maya Chen</p>
</div>
<div class="ex-post" id="ex-post">
<textarea class="mv-textarea" rows="3" aria-label="Post text">Shipped the new onboarding flow today. Huge thanks to Diego and Priya for three weeks of late-night testing!</textarea>
<div class="ex-post-tools">
<select class="mv-select" data-size="sm" aria-label="Audience">
<option value="me" data-exposure="0">Only me</option>
<option value="close" data-exposure="1" data-exposure-audience="12 close friends">Close friends</option>
<option value="friends" selected data-exposure="2" data-exposure-audience="your 348 friends">Friends</option>
<option value="fof" data-exposure="3" data-exposure-audience="their friends, about 41,000 people">Friends of friends</option>
<option value="public" data-exposure="4" data-exposure-audience="anyone, on or off the app" data-exposure-confirm="Anyone can see, share and embed this post, even without an account." data-exposure-confirm-label="Post publicly">Public</option>
</select>
<label class="mv-choice"><input type="checkbox" class="mv-checkbox" data-exposure="+0.3" data-exposure-factor="Your location is attached"> Add location · San Francisco</label>
</div>
</div>
<div class="ex-post-foot">
<mv-exposure for="ex-post" id="ex-badge" variant="badge" confirm="4" label="Post audience" bands="Only you, Close friends, Friends, Friends of friends, Public"></mv-exposure>
<button type="button" class="mv-button" data-size="sm">Post</button>
</div>
</section>
<!-- 3 · Calendar sharing: inline variant, reading placed where the author wants it -->
<section class="ex-card" aria-labelledby="ex-cal-title">
<div class="ex-head">
<h4 id="ex-cal-title">Calendar sharing</h4>
<p>Work calendar · Maya Chen · Pacific Time</p>
</div>
<mv-exposure variant="inline" org="Acme" label="Calendar visibility" class="ex-cal">
<div class="ex-cal-grid">
<div>
<label class="ex-label" for="ex-cal-who">Share with</label>
<select class="mv-select" id="ex-cal-who" data-size="sm">
<option value="none" data-exposure="0">Nobody</option>
<option value="team" selected data-exposure="1" data-exposure-audience="your 8 teammates">My team</option>
<option value="org" data-exposure="2" data-exposure-audience="everyone at Acme">Everyone at Acme</option>
<option value="public" data-exposure="4" data-exposure-audience="anyone with the public URL">Public URL</option>
</select>
</div>
<div>
<label class="ex-label" for="ex-cal-detail">They see</label>
<select class="mv-select" id="ex-cal-detail" data-size="sm">
<option value="busy">Free/busy only</option>
<option value="titles" data-exposure="+0.4">Event titles</option>
<option value="all" selected data-exposure="+0.8">All details</option>
</select>
</div>
</div>
<div class="ex-cal-reading" data-exposure-reading></div>
</mv-exposure>
</section>
</div>
<script type="module">
const share = document.getElementById("ex-share");
const form = document.getElementById("ex-share-form");
const log = document.getElementById("ex-log");
const policy = document.getElementById("ex-policy");
const expires = document.getElementById("ex-expires");
const guest = document.getElementById("ex-guest");
const badge = document.getElementById("ex-badge");
const say = (t) => { log.textContent = t; };
// Icons that fit a social audience better than the default document scale.
badge.bands = [
{ label: "Only you", icon: "lock" },
{ label: "Close friends", icon: "people" },
{ label: "Friends", icon: "people" },
{ label: "Friends of friends", icon: "link" },
{ label: "Public", icon: "globe" },
];
// A restricted document has no link: its expiry no longer matters.
const syncExpiry = () => { expires.disabled = form.elements.access.value === "restricted"; };
form.addEventListener("change", syncExpiry);
syncExpiry();
// The guest chip's own remove button (the reduction runs it too).
const removeGuest = guest.querySelector("[data-exposure-remove]");
removeGuest.addEventListener("click", () => guest.remove());
share.addEventListener("mv-exposure-raise", (e) => {
if (policy.checked && e.detail.to === 4) {
e.preventDefault();
say("Blocked by workspace policy: public documents are turned off.");
return;
}
say(`Raise: ${e.detail.fromLabel} → ${e.detail.toLabel}${e.detail.needsAck ? " (needs confirmation)" : ""}`);
});
share.addEventListener("mv-exposure-change", (e) => {
say(`${e.detail.acknowledged ? "Confirmed" : "Now"}: ${e.detail.label} · ${e.detail.value.toFixed(1)} of 4`);
});
form.addEventListener("submit", (e) => {
e.preventDefault();
if (!share.pending) say(`Saved: ${share.bandLabel}. ${share.audience}.`);
});
// Reset the scenario (and put the guest back).
const initial = { access: "org", expires: "never", download: true };
document.getElementById("ex-reset").addEventListener("click", () => {
if (!guest.isConnected) share.querySelector(".ex-people").append(guest);
form.elements.access.value = initial.access;
form.elements.download.checked = initial.download;
syncExpiry();
expires.value = initial.expires;
share.refresh();
say("Scenario reset.");
});
</script>
</div>API
Attributes
| Name | タイプ | Default | Description |
|---|---|---|---|
variant | bar | badge | inline | bar | bar: the full reading (icon tile, band, audience, stepped track, scale, factors) in a subtle card. badge: a compact chip with the icon tile, the band and the audience, no card, factors hidden, acknowledgement floats. inline: one sentence led by a tiny stepped gauge, factors hidden, acknowledgement floats. |
org | string | Organization name used in the default band “Anyone at {org}” and in {org} placeholders of audience and factor texts. Without it the band reads “Anyone in your organization”. | |
confirm | band index | "top" | (empty) | Bands at or above this index need an explicit acknowledgement before they apply; empty or "top" means the last band only. Without the attribute nothing needs confirming (mv-exposure-raise still fires). | |
for | id | Watch another element (a form, a composer) instead of the component’s children; the component then only holds the reading. Resolved in the component’s root node when it connects or when the attribute changes. | |
bands | comma-separated labels | Only you, Specific people, Anyone at {org}, Anyone with the link, Public on the internet | Band labels from the narrowest to the widest audience (at least 2). Icons are picked along lock, people, building, link, globe; use the bands property to choose them. |
label | string | Visibility | Accessible name of the meter, also shown as the small caption above the band in the bar variant. |
show-factors | "true" | "false" | Show or hide the factor list. Default: shown in bar, hidden in badge and inline. | |
data-exposure | number | +number | -number | On any radio, checkbox, switch, option, text field or element in the watched region. A plain number is an audience level, active when the control is checked/selected/filled (or the element is present and not hidden); the highest active level sets the band. A signed number is a modifier: modifiers add up and move the reading inside the band (capped just below the next band), never across it. Disabled, hidden or inert contributors are ignored. | |
data-exposure-audience | string | Words added to the audience sentence while the contributor is active (“anyone at {org} with the link”). {count} and {org} are replaced; data-exposure-audience-one is used when the count is 1. | |
data-exposure-count | CSS selector | On a container (a people list): the number of matching descendants that are not hidden. The container is active when the count is above 0 and {count} is available to its audience text. | |
data-exposure-factor | string | Makes an active contributor a listed factor (“The link never expires”) whenever removing it would lower the reading. Factors are sorted by impact. | |
data-exposure-reduce | string | The one-click reduction of a factor. Radio: value of the radio to check instead. Option: value to select in its select. Checkbox or switch: unchecked (no value needed). Text field: the value to set (empty clears it). Other elements: the reduction clicks their [data-exposure-remove] button, so your own removal logic runs. | |
data-exposure-reduce-label | string | Label of the reduction button (“Expire in 7 days”). Defaults: “Switch to {option}”, “Turn off”, “Clear”, “Remove”. | |
data-exposure-confirm / data-exposure-confirm-label | string | On the contributor that opens a guarded band: the acknowledgement text (who can reach it and what that means) and the confirm button label (“Make public”). | |
data-exposure-reading | (marker) | On an empty child: the reading is rendered inside it instead of being appended at the end of the component. | |
data-band / data-pending | set by the component | Current band index and pending state, on the host (styleable). |
Properties
| Name | タイプ | Description |
|---|---|---|
value | number | Current reading, from 0 to bands.length - 1 (read-only). |
band / bandLabel | number / string | Index and label of the current band (read-only). |
audience | string | The audience sentence, e.g. “Visible to: you, 4 people, and anyone at Acme with the link” (read-only). |
factors | Array<{ label, impact, element, reduceLabel }> | Factors raising the reading, most impactful first (read-only). |
pending | boolean | True while a guarded band waits for acknowledge() or revert() (read-only). Check it in your own save handler if the save does not go through a native form submission. |
bands | Array<string | { label, icon? }> | Band list; icon is one of lock, people, building, link, globe. Reading it returns the resolved objects. Setting a string sets the attribute. |
score | (state) => number | { value?, audience?, factors? } | void | Custom scoring. state: { values (controls by name: radio value, checkbox boolean or array, select value), value, band, bands, audience (string[]), factors, contributors }. Return a number to replace the reading, or an object to replace the value, the audience parts and/or the factors ({ label, impact?, reduceLabel?, reduce?: () => void, confirm? }). |
strings | Partial<Record<string, string>> | Overrides for every visible text and announcement (keys: label, you, orgFallback, visibleTo ({list}), factorsTitle, pending, ackTitle ({band}), ackText, ackConfirm, ackCancel, reduceTo ({option}), reduceToggle, reduceRemove, reduceClear, valueText, valueTextPending, announceUp, announceDown, announceSame, announcePending, announceConfirmed, announceReverted, announceBlocked, announceSubmit). English defaults. |
Methods
| Name | Description |
|---|---|
refresh() | Re-reads the controls. Needed only after changing them from code without firing input/change events (frameworks setting .checked or .value); DOM changes (chips added or removed, hidden, disabled) are observed automatically. |
acknowledge() | Accepts the pending band (same as the confirm button). Returns false when nothing is pending. |
revert() | Restores every watched form control to the last accepted state and fires their input/change events; drops a pending band. Changes made outside form controls (a chip added by the app) cannot be undone by the component. |
reduce(indexOrElement) | Applies a factor’s reduction from code (index in factors, or its contributor element). Emits the cancelable mv-exposure-reduce; returns false if cancelled or impossible. |
Events
| Name | Description |
|---|---|
mv-exposure-raise | Cancelable, before a rise into a higher band is applied. detail: { from, to, fromLabel, toLabel, value, audience, needsAck, source (the control that changed, or null) }. preventDefault() vetoes it: the controls go back to the last accepted state and the refusal is announced. |
mv-exposure-change | The accepted reading changed (band, value, audience or factors). detail: { value, band, label, audience, factors: [{ label, impact }], acknowledged }. Not emitted for the initial reading. |
mv-exposure-reduce | Cancelable, before a factor’s reduction runs. detail: { label, impact, element }. |
Content structure
| Name | Description |
|---|---|
(content) | The sharing or privacy controls to read (unless for is set). The component never restyles them; it only reads them and, for reductions or reverts, sets their value and fires input/change. |
CSS classes
| Name | Description |
|---|---|
mv-exposure | The reading (data-variant, data-band, data-top, data-pending, data-flare during a rise). |
mv-exposure-gauge | role="meter" wrapper: -head (-mark with -mark-icon, -caption, -band, -tag, -audience), -track (-step, -step-fill; data-lit), -scale. |
mv-exposure-factors | Factor list: -factors-title, -list, -factor (-factor-icon, -factor-label, .mv-exposure-reduce button). |
mv-exposure-ack | Acknowledgement group: -ack-icon, -ack-title, -ack-text, -ack-actions (.mv-exposure-cancel, .mv-exposure-confirm). data-floating when shown as a popover (badge and inline). |
CSS variables
| Name | Default | Description |
|---|---|---|
--mv-exposure-low | var(--mv-fg-subtle) | Tone of the narrowest audience: the neutral end of the scale. |
--mv-exposure-high | var(--mv-warning) | Tone the reading warms up to as the audience widens (bands are mixed between low and high). |
--mv-exposure-peak | color-mix(warning, danger 55%) | Tone of the widest band, the pending tag and the acknowledgement. |
Accessibility
The reading is a role="meter" named by label (“Visibility”), with aria-valuenow/min/max and an aria-valuetext that is the whole reading in words: “Anyone at Acme. Visible to: you, 4 people, and anyone at Acme with the link.” (with “needs confirmation” while pending). Its visible children are presentational, so screen readers get one coherent sentence instead of fragments. Band changes are announced once in a polite live region, debounced so arrowing through a radio group does not chatter (“Visibility raised to Anyone with the link. …”); a guarded band, a veto and a blocked submission are announced assertively. Focus is never moved when a control changes (arrow keys change radios immediately, so stealing focus would break keyboard use): the acknowledgement appears right after the reading in the DOM, as a labelled and described group with “Keep previous setting” and the confirm button; Escape inside it keeps the previous setting, and after either choice focus returns to the control that raised the band. Submitting the surrounding form while pending is prevented and moves focus to the confirm button. Reduction buttons are real buttons whose accessible name includes the factor (“Expire in 7 days: The link never expires”); after a reduction focus moves to the next factor (or to the meter) and the new reading is announced. The level is never carried by color alone: each band has its own words and icon (lock, people, building, link, globe), the steps grow in height, and a pending band adds a dashed ring, a hatched step and a “Needs confirmation” tag. Forced colors: steps and the icon tile switch to Canvas/CanvasText outlines, steps with a Highlight fill. Reduced motion (OS or data-motion="reduce"): no pulse, the tile and steps change without animating. Known limit: the acknowledgement follows the reading in the tab order, so when the reading sits above the controls a keyboard user reaches it with Shift+Tab (the assertive announcement says confirmation is needed, and submitting moves focus to it); put the reading after the controls, or use data-exposure-reading, when they are far apart.