Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions design/system/foundations.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<link rel="stylesheet" href="../../src/FluentCMS.Components/Styles/components/button.css">
<link rel="stylesheet" href="../../src/FluentCMS.Components/Styles/components/field.css">
<link rel="stylesheet" href="../../src/FluentCMS.Components/Styles/components/input.css">
<link rel="stylesheet" href="../../src/FluentCMS.Components/Styles/components/textarea.css">
<link rel="stylesheet" href="../../src/FluentCMS.Components/Styles/patterns/divider.css">
<link rel="stylesheet" href="../../src/FluentCMS.Components/Styles/patterns/link.css">
<link rel="stylesheet" href="../../src/FluentCMS.Components/Styles/patterns/kbd.css">
Expand Down Expand Up @@ -196,6 +197,14 @@ <h4>For a form of settings: the label and the help at the start, the control at
</div>
</div>
<h4>The same field in a narrow place</h4>
<div class="docs-demo docs-demo--column">
<div class="fl-field fl-field--horizontal">
<label class="fl-field__label" for="field-t">Description</label>
<textarea class="fl-textarea" id="field-t" rows="4" aria-describedby="field-t-help">Stories, guides and release notes from the team that builds Northwind.</textarea>
<p class="fl-field__help" id="field-t-help">Shown in search results and when the site is shared.</p>
</div>
</div>
<h4>Beside a control taller than a line, the help follows its label, not the foot of the control</h4>

<h3>A group of controls</h3>
<div class="docs-demo docs-demo--column docs-demo--narrow">
Expand Down Expand Up @@ -232,7 +241,7 @@ <h3>Dark, compact, right to left</h3>
<tr><th scope="row">ARIA and keys</th><td><ul><li>The label names the control through <code>for</code> and <code>id</code>.</li><li>The control lists the error, the help and the counter in <code>aria-describedby</code>, the error first.</li><li>Invalid: <code>aria-invalid="true"</code> on the control. Required: <code>required</code> on the control; the asterisk is <code>aria-hidden</code>.</li><li>Around a group: <code>role="group"</code> on the field, or <code>role="radiogroup"</code> when the group is one of radios, so that the group is announced once. <code>aria-labelledby</code> names it by its label, and <code>aria-describedby</code> lists its error and its help on the same element. A radio group also takes <code>aria-required</code> and <code>aria-invalid</code> there.</li><li>A field cannot disable its group: each control carries <code>disabled</code>.</li><li>No keys of its own.</li></ul></td></tr>
<tr><th scope="row">Level</th><td>Static</td></tr>
<tr><th scope="row">Parameters</th><td><ul><li><code>Label</code>; <code>Help</code>; <code>Error</code>: shown when set, or taken from the <code>EditForm</code></li><li><code>Required</code>: shows the mark</li><li><code>Hint</code>: short text at the end of the label row, such as Optional</li><li><code>MaxLength</code>: shows the counter</li><li><code>Horizontal</code>: the layout for settings</li><li><code>For</code>: the id of the control, generated when absent</li></ul></td></tr>
<tr><th scope="row">Classes</th><td><code>fl-field</code>; <code>--horizontal</code>; parts <code>fl-field__label</code>, <code>__required</code>, <code>__meta</code> (with <code>--over</code>), <code>__error</code>, <code>__help</code></td></tr>
<tr><th scope="row">Classes</th><td><code>fl-field</code>; <code>--horizontal</code>, whose control spans the rows of the label and the help; parts <code>fl-field__label</code>, <code>__required</code>, <code>__meta</code> (with <code>--over</code>), <code>__error</code>, <code>__help</code></td></tr>
<tr><th scope="row">Tokens</th><td><ul><li>Colour: <code>text</code>, <code>text-subtle</code>, <code>danger-text</code></li><li>Space: <code>--fl-space-1</code>, <code>-1-5</code>, <code>-3</code>, <code>--fl-gap-l</code>, <code>--fl-control-height-m</code></li><li>Type: <code>--fl-font-size-m</code>, <code>-s</code>, <code>-xs</code>, <code>--fl-font-weight-medium</code>, <code>--fl-line-height-normal</code></li></ul></td></tr>
</tbody>
</table>
Expand Down Expand Up @@ -278,6 +287,12 @@ <h3>States</h3>
</table>
</div>

<h3>A short value</h3>
<div class="docs-demo docs-demo--column">
<span class="fl-input fl-input--short"><input class="fl-input__control" type="number" value="25" aria-label="Items per page"><span class="fl-input__affix">items</span></span>
</div>
<h4><code>fl-input--short</code>: for a number of items or a time, the box keeps 12 rem and does not fill the row of its field.</h4>

<h3>Dark, compact, right to left</h3>
<div class="docs-modes docs-demo--column">
<span class="fl-input"><svg class="fl-icon fl-input__icon" aria-hidden="true"><use href="icons/lucide.svg#search"/></svg><input class="fl-input__control" type="search" placeholder="Search" aria-label="Search"></span>
Expand All @@ -294,7 +309,7 @@ <h3>Dark, compact, right to left</h3>
<tr><th scope="row">ARIA and keys</th><td><ul><li>A native text box, named by the label of its field, or by <code>aria-label</code> outside one.</li><li>Invalid: <code>aria-invalid="true"</code>. Read-only: <code>readonly</code>. Disabled: <code>disabled</code>.</li><li>An action is a <code>&lt;button&gt;</code> with its own name, after the input in the tab order; a toggle carries <code>aria-pressed</code>.</li><li>An affix is plain text; when it matters to the value it is part of the label or of the help.</li></ul></td></tr>
<tr><th scope="row">Level</th><td>Static. Posts as a form field in static rendering.</td></tr>
<tr><th scope="row">Parameters</th><td><ul><li><code>Value</code> with <code>@bind-Value</code>; <code>Type</code>; <code>Placeholder</code>; <code>Name</code></li><li><code>Size</code>: Small, Medium (default), Large</li><li><code>Icon</code>: at the start; <code>Prefix</code>, <code>Suffix</code>: fixed text</li><li><code>Clearable</code>: the clear action; a password gets its show action</li><li><code>Mono</code>: for code; <code>ReadOnly</code>; <code>Disabled</code>; <code>MaxLength</code>; <code>AutoComplete</code></li></ul></td></tr>
<tr><th scope="row">Classes</th><td><code>fl-input</code>; <code>--s</code>, <code>--l</code>, <code>--mono</code>; parts <code>fl-input__control</code>, <code>__icon</code>, <code>__affix</code>, <code>__action</code></td></tr>
<tr><th scope="row">Classes</th><td><code>fl-input</code>; <code>--s</code>, <code>--l</code>, <code>--mono</code>, <code>--short</code>; parts <code>fl-input__control</code>, <code>__icon</code>, <code>__affix</code>, <code>__action</code></td></tr>
<tr><th scope="row">Tokens</th><td><ul><li>Colour: <code>surface</code>, <code>surface-subtle</code>, <code>border-control</code>, <code>border-strong</code>, <code>text</code>, <code>text-subtle</code>, <code>hover</code>, <code>pressed</code>, <code>accent-text</code>, <code>danger-solid</code>, the disabled three</li><li>Size: <code>--fl-control-height-*</code>, <code>--fl-control-padding-*</code>, <code>--fl-control-radius</code>, <code>--fl-icon-size-m</code>, <code>--fl-space-2</code>, <code>--fl-border-width</code></li><li>Type: <code>--fl-control-font-size</code>, <code>--fl-font-size-s</code>, <code>--fl-font-family-mono</code>, <code>--fl-line-height-tight</code></li><li>Focus: <code>--fl-focus-ring</code>, drawn on the border of the box</li><li>Own: <code>--fl-input-height</code>, <code>-padding</code>, <code>-font-size</code>, <code>-inner-radius</code></li></ul></td></tr>
</tbody>
</table>
Expand Down
19 changes: 17 additions & 2 deletions design/system/layout-navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,21 @@ <h3>Tabs that are pages</h3>
</div>
<h4>When each tab has an address of its own, the tabs are links in a <code>&lt;nav&gt;</code> and the current one carries <code>aria-current="page"</code>. This form needs no script.</h4>

<h3>Actions at the end</h3>
<div class="docs-demo docs-demo--column">
<div class="fl-tabs">
<nav class="fl-tabs__list" aria-label="Views">
<a class="fl-tabs__tab" href="#tabs" aria-current="page">All<span class="fl-tabs__count">128</span></a>
<a class="fl-tabs__tab" href="#tabs">Drafts<span class="fl-tabs__count">7</span></a>
<a class="fl-tabs__tab" href="#tabs">Scheduled<span class="fl-tabs__count">3</span></a>
</nav>
<div class="fl-tabs__actions">
<button class="fl-button fl-button--subtle fl-button--s" type="button"><svg class="fl-icon" aria-hidden="true"><use href="icons/lucide.svg#plus"/></svg>Save view</button>
</div>
</div>
</div>
<h4>Actions that belong to the row, such as Save view, stand beside the list on its line, not in it: a list of tabs holds tabs alone. Where the list is too long it scrolls, and the actions stay.</h4>

<h3>In a card</h3>
<div class="docs-demo docs-demo--canvas docs-demo--column docs-demo--narrow">
<section class="fl-card" aria-label="Projects">
Expand Down Expand Up @@ -919,8 +934,8 @@ <h3>Dark, compact, right to left</h3>
<tr><th scope="row">Element</th><td><code>&lt;div class="fl-tabs"&gt;</code> around a <code>&lt;div role="tablist"&gt;</code> of <code>&lt;button role="tab"&gt;</code> and one <code>&lt;div role="tabpanel"&gt;</code> for each tab, as drawn here. <code>FlTabs</code> sends a <code>&lt;nav&gt;</code> of jump links (<code>&lt;a href="…#panel"&gt;</code>) and a <code>&lt;div&gt;</code> for each panel, all in the page, and the script of the library gives them the roles. As pages: <code>&lt;nav class="fl-tabs"&gt;</code> around the list of <code>&lt;a&gt;</code>, without the roles.</td></tr>
<tr><th scope="row">ARIA and keys</th><td><ul><li>The tabs pattern, with automatic activation. The list has a name; a tab has <code>aria-selected</code> and <code>aria-controls</code>; a panel has <code>aria-labelledby</code> and <code>tabindex="0"</code>.</li><li>Roving focus: only the selected tab is in the tab order. Left and Right move to the tab before and after, in the reading direction, and wrap around; Home and End go to the first and the last. The tab that takes focus is selected.</li><li>Tab leaves the list for the panel.</li><li>A disabled tab is passed over. Disabled: <code>disabled</code>; on a link <code>aria-disabled="true"</code> and no <code>href</code>.</li><li>A status dot has a text for a screen reader beside it.</li><li>As pages: native links, and <code>aria-current="page"</code> on the current one.</li></ul></td></tr>
<tr><th scope="row">Level</th><td>Native. The form with links works in static rendering. The form with panels gets its arrow keys and its change of panel from the script of the library, in static rendering as in the interactive modes (decision record 0003). With no script it stays a list of links to panels that are all in the page.</td></tr>
<tr><th scope="row">Parameters</th><td><ul><li>Tabs: <code>Label</code>; <code>Value</code> with <code>@bind-Value</code>: the selected tab; <code>Contained</code></li><li>Tab: <code>Value</code>; <code>Text</code>; <code>Icon</code>; <code>Count</code>; <code>Status</code>: None (default), Accent, Success, Warning, Danger, with <code>StatusText</code>; <code>Href</code>: the form with links, on every tab or on none; <code>Disabled</code>; <code>ChildContent</code>: the panel</li></ul></td></tr>
<tr><th scope="row">Classes</th><td><code>fl-tabs</code>; <code>--contained</code>; parts <code>fl-tabs__list</code>, <code>__tab</code> (with <code>__count</code>, <code>__dot</code> and its tones <code>--success</code>, <code>--warning</code>, <code>--danger</code>), <code>__panel</code>. The tab is a part of the tabs, not a block of its own.</td></tr>
<tr><th scope="row">Parameters</th><td><ul><li>Tabs: <code>Label</code>; <code>Actions</code>: buttons at the end of the row; <code>Value</code> with <code>@bind-Value</code>: the selected tab; <code>Contained</code></li><li>Tab: <code>Value</code>; <code>Text</code>; <code>Icon</code>; <code>Count</code>; <code>Status</code>: None (default), Accent, Success, Warning, Danger, with <code>StatusText</code>; <code>Href</code>: the form with links, on every tab or on none; <code>Disabled</code>; <code>ChildContent</code>: the panel</li></ul></td></tr>
<tr><th scope="row">Classes</th><td><code>fl-tabs</code> (with <code>__actions</code> after the list); <code>--contained</code>; parts <code>fl-tabs__list</code>, <code>__tab</code> (with <code>__count</code>, <code>__dot</code> and its tones <code>--success</code>, <code>--warning</code>, <code>--danger</code>), <code>__panel</code>. The tab is a part of the tabs, not a block of its own.</td></tr>
<tr><th scope="row">Tokens</th><td><ul><li>Colour: <code>text</code>, <code>text-muted</code>, <code>border</code>, <code>hover</code>, <code>pressed</code>, <code>accent</code>, <code>accent-soft</code>, <code>accent-text</code>, <code>neutral-soft</code>, <code>neutral-text</code>, the solid of success, warning and danger, <code>disabled-fill</code>, <code>disabled-text</code></li><li>Size: <code>--fl-row-height</code>, <code>--fl-inset-s</code>, <code>--fl-gap-m</code>, <code>--fl-space-1</code>, <code>-1-5</code>, <code>-2</code>, <code>-3</code>, <code>-5</code>, <code>-10</code>, <code>--fl-control-radius</code>, <code>--fl-radius-s</code>, <code>-full</code>, <code>--fl-border-width</code>, <code>-strong</code></li><li>Type: <code>--fl-font-size-s</code>, <code>-2xs</code>, <code>--fl-font-weight-medium</code>, <code>-semibold</code>, <code>--fl-line-height-tight</code></li><li>Focus: <code>--fl-focus-ring</code>, drawn inside the tab</li><li>Own: <code>--fl-tabs-height</code>, <code>-inset</code>, <code>-gap</code>, <code>-fg</code>, <code>-fg-hover</code>, <code>-wash</code>, <code>-wash-pressed</code>, <code>-indicator</code>, <code>-count-bg</code>, <code>-count-fg</code>, <code>-dot</code></li></ul></td></tr>
</tbody>
</table>
Expand Down
Loading