d1cbc3f032
* ui: Adds a tab selection animation to our app tabs 1. Replace all mentions of `magenta` with a themeable CSS property. 2. Add an easy way to inline style DOM nodes 3. Use CSS properties to add tab animation * Fix up rendering test * Avoid DOM noodling as much as possible
22 lines
1,014 B
Handlebars
22 lines
1,014 B
Handlebars
<nav
|
|
style={{if selectedWidth (concat '--selected-width:' selectedWidth ';--selected-left:' selectedLeft ';--selected-height:' selectedHeight ';--selected-top:' selectedTop) undefined}}
|
|
role="tablist"
|
|
class={{concat 'tab-nav' (if isAnimatable ' animatable' '')}}
|
|
id={{guid}}>
|
|
<ul>
|
|
{{#each items as |item|}}
|
|
<li
|
|
data-test-tab={{concat name '_' (if item.label (slugify item.label) (slugify item))}}
|
|
class={{if (or item.selected (eq selected (if item.label (slugify item.label) (slugify item)))) 'selected'}}
|
|
>
|
|
{{#if item.href }}
|
|
<a href={{item.href}}>{{item.label}}</a>
|
|
{{else}}
|
|
<label role="tab" onkeydown={{action 'keydown'}} tabindex="0" aria-controls="radiogroup_{{name}}_{{if item.label (slugify item.label) (slugify item)}}_panel" for="radiogroup_{{name}}_{{if item.label (slugify item.label) (slugify item)}}" data-test-radiobutton="{{name}}_{{if item.label (slugify item.label) (slugify item)}}">
|
|
<a>{{item}}</a>
|
|
</label>
|
|
{{/if}}
|
|
</li>
|
|
{{/each}}
|
|
</ul>
|
|
</nav> |