vault/ui/app/components/i-con.js
Matthew Irish c8b64523ee
UI - guard page redesign (#4779)
* add NavHeader component
* use NavHeader in SplashPage component and application.hbs
* let download button take a block
* add RadialProgress component
* use RadialProgress in ShamirFlow component
* style up the RadialProgress component
* update ember-basic-dropdown, ember-basic-dropdown-hover
* rework operation token generation workflow
* directly depend on ember-maybe-in-element
2018-06-26 16:35:47 -05:00

51 lines
1.1 KiB
JavaScript

import Ember from 'ember';
import hbs from 'htmlbars-inline-precompile';
const { computed } = Ember;
const GLYPHS_WITH_SVG_TAG = [
'download',
'folder',
'file',
'hidden',
'perf-replication',
'role',
'visible',
'information-reversed',
'true',
'false',
];
export default Ember.Component.extend({
layout: hbs`
{{#if excludeSVG}}
{{partial partialName}}
{{else}}
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="{{size}}" height="{{size}}" viewBox="0 0 512 512">
{{partial partialName}}
</svg>
{{/if}}
`,
tagName: 'span',
excludeIconClass: false,
classNameBindings: ['excludeIconClass::icon'],
classNames: ['has-current-color-fill'],
attributeBindings: ['aria-label', 'aria-hidden'],
glyph: null,
excludeSVG: computed('glyph', function() {
return GLYPHS_WITH_SVG_TAG.includes(this.get('glyph'));
}),
size: computed(function() {
return 12;
}),
partialName: computed('glyph', function() {
const glyph = this.get('glyph');
return `svg/icons/${Ember.String.camelize(glyph)}`;
}),
});