@heroku/ember-malibu-icon
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -18,2 +18,4 @@ /** | ||
import { htmlSafe } from '@ember/string'; | ||
import { guidFor } from '@ember/object/internals'; | ||
import { warn } from '@ember/debug'; | ||
@@ -30,3 +32,10 @@ const { escapeExpression: escape } = Ember.Handlebars.Utils; | ||
const iconHeight = height || size; | ||
const labelID = guidFor(this); | ||
warn( | ||
`Please set a title for the ${name} icon ` + | ||
'or set title="" if you believe the icon does not need a title and is solely presentational. Learn more about accessible icons here: http://design.herokai.com/malibu', | ||
parameters.title !== undefined, {id:"ember-malibu-icon.missing-title"} | ||
); | ||
return htmlSafe(` | ||
@@ -37,5 +46,6 @@ <svg style="width: ${escape(iconWidth)}px; height: ${escape(iconHeight)}px;" | ||
role="${escape(role || 'img')}" | ||
aria-labelledby="${escape(title ? labelID : '')}" | ||
> | ||
<title id="${escape(title ? labelID : '')}">${escape(title)}</title> | ||
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#${escape(name)}"> | ||
<title>${escape(title)}</title> | ||
</use> | ||
@@ -42,0 +52,0 @@ </svg> |
{ | ||
"name": "@heroku/ember-malibu-icon", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Ember Malibu Icons", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6732
108
0