clay-label
Advanced tools
Comparing version 1.0.0-alpha.2 to 1.0.0-alpha.3
{ | ||
"name": "clay-label", | ||
"version": "1.0.0-alpha.2", | ||
"version": "1.0.0-alpha.3", | ||
"description": "Metal Clay Label component", | ||
@@ -28,8 +28,9 @@ "license": "BSD", | ||
"dependencies": { | ||
"clay-button": "^1.0.0-alpha.2", | ||
"clay-link": "^1.0.0-alpha.2", | ||
"metal": "^2.13.2", | ||
"metal-component": "^2.13.2", | ||
"metal-soy": "^2.13.2", | ||
"metal-state": "^2.13.2" | ||
"clay-button": "^1.0.0-alpha.3", | ||
"clay-link": "^1.0.0-alpha.3", | ||
"metal": "^2.14.0", | ||
"metal-component": "^2.14.0", | ||
"metal-soy": "^2.14.0", | ||
"metal-state": "^2.14.0", | ||
"metal-web-component": "^2.14.0" | ||
}, | ||
@@ -36,0 +37,0 @@ "devDependencies": { |
@@ -8,96 +8,96 @@ 'use strict'; | ||
describe('ClayLabel', function() { | ||
afterEach(() => { | ||
if (label) { | ||
label.dispose(); | ||
} | ||
}); | ||
afterEach(() => { | ||
if (label) { | ||
label.dispose(); | ||
} | ||
}); | ||
it('shound generate the default markup', () => { | ||
label = new ClayLabel(); | ||
it('shound generate the default markup', () => { | ||
label = new ClayLabel(); | ||
expect(label).toMatchSnapshot(); | ||
}); | ||
expect(label).toMatchSnapshot(); | ||
}); | ||
it('shound render a label with label', () => { | ||
label = new ClayLabel({ | ||
label: 'Foo', | ||
}); | ||
it('shound render a label with label', () => { | ||
label = new ClayLabel({ | ||
label: 'Foo', | ||
}); | ||
expect(label).toMatchSnapshot(); | ||
}); | ||
expect(label).toMatchSnapshot(); | ||
}); | ||
it('shound render a label with id', () => { | ||
label = new ClayLabel({ | ||
id: 'Foo', | ||
}); | ||
it('shound render a label with id', () => { | ||
label = new ClayLabel({ | ||
id: 'Foo', | ||
}); | ||
expect(label).toMatchSnapshot(); | ||
}); | ||
expect(label).toMatchSnapshot(); | ||
}); | ||
it('shound render a large label', () => { | ||
label = new ClayLabel({ | ||
size: 'lg', | ||
}); | ||
it('shound render a large label', () => { | ||
label = new ClayLabel({ | ||
size: 'lg', | ||
}); | ||
expect(label).toMatchSnapshot(); | ||
}); | ||
expect(label).toMatchSnapshot(); | ||
}); | ||
it('shound render a label with removable', () => { | ||
label = new ClayLabel({ | ||
label: 'Foo', | ||
closeable: true, | ||
spritemap: 'icons.svg', | ||
}); | ||
it('shound render a label with removable', () => { | ||
label = new ClayLabel({ | ||
label: 'Foo', | ||
closeable: true, | ||
spritemap: 'icons.svg', | ||
}); | ||
expect(label).toMatchSnapshot(); | ||
}); | ||
expect(label).toMatchSnapshot(); | ||
}); | ||
it('shound render a label with link', () => { | ||
label = new ClayLabel({ | ||
label: 'Foo', | ||
href: '#1', | ||
}); | ||
it('shound render a label with link', () => { | ||
label = new ClayLabel({ | ||
label: 'Foo', | ||
href: '#1', | ||
}); | ||
expect(label).toMatchSnapshot(); | ||
}); | ||
expect(label).toMatchSnapshot(); | ||
}); | ||
it('shound render a `default color` label', () => { | ||
label = new ClayLabel({ | ||
style: 'secondary', | ||
}); | ||
it('shound render a `default color` label', () => { | ||
label = new ClayLabel({ | ||
style: 'secondary', | ||
}); | ||
expect(label).toMatchSnapshot(); | ||
}); | ||
expect(label).toMatchSnapshot(); | ||
}); | ||
it('shound render a `info color` label', () => { | ||
label = new ClayLabel({ | ||
style: 'info', | ||
}); | ||
it('shound render a `info color` label', () => { | ||
label = new ClayLabel({ | ||
style: 'info', | ||
}); | ||
expect(label).toMatchSnapshot(); | ||
}); | ||
expect(label).toMatchSnapshot(); | ||
}); | ||
it('shound render a `warning color` label', () => { | ||
label = new ClayLabel({ | ||
style: 'warning', | ||
}); | ||
it('shound render a `warning color` label', () => { | ||
label = new ClayLabel({ | ||
style: 'warning', | ||
}); | ||
expect(label).toMatchSnapshot(); | ||
}); | ||
expect(label).toMatchSnapshot(); | ||
}); | ||
it('shound render a `danger color` label', () => { | ||
label = new ClayLabel({ | ||
style: 'danger', | ||
}); | ||
it('shound render a `danger color` label', () => { | ||
label = new ClayLabel({ | ||
style: 'danger', | ||
}); | ||
expect(label).toMatchSnapshot(); | ||
}); | ||
expect(label).toMatchSnapshot(); | ||
}); | ||
it('shound render a `success color` label', () => { | ||
label = new ClayLabel({ | ||
style: 'success', | ||
}); | ||
it('shound render a `success color` label', () => { | ||
label = new ClayLabel({ | ||
style: 'success', | ||
}); | ||
expect(label).toMatchSnapshot(); | ||
}); | ||
expect(label).toMatchSnapshot(); | ||
}); | ||
}); |
import 'clay-button'; | ||
import 'clay-link'; | ||
import Component from 'metal-component'; | ||
import defineWebComponent from 'metal-web-component'; | ||
import Soy from 'metal-soy'; | ||
@@ -13,9 +14,9 @@ import {Config} from 'metal-state'; | ||
class ClayLabel extends Component { | ||
/** | ||
* Handle `click` button and emit event `close`. | ||
* @protected | ||
*/ | ||
_handleCloseButtonClick() { | ||
this.emit('close'); | ||
} | ||
/** | ||
* Handle `click` button and emit event `close`. | ||
* @protected | ||
*/ | ||
handleCloseButtonClick_() { | ||
this.emit('close'); | ||
} | ||
} | ||
@@ -29,72 +30,74 @@ | ||
ClayLabel.STATE = { | ||
/** | ||
* True or false to activate the close button. | ||
* @instance | ||
* @memberof ClayLabel | ||
* @type {?bool} | ||
* @default false | ||
*/ | ||
closeable: Config.bool().value(false), | ||
/** | ||
* True or false to activate the close button. | ||
* @instance | ||
* @memberof ClayLabel | ||
* @type {?bool} | ||
* @default false | ||
*/ | ||
closeable: Config.bool().value(false), | ||
/** | ||
* HREF in label. | ||
* @instance | ||
* @memberof ClayLabel | ||
* @type {?string|undefined} | ||
* default undefined | ||
*/ | ||
href: Config.string(), | ||
/** | ||
* HREF in label. | ||
* @instance | ||
* @memberof ClayLabel | ||
* @type {?string|undefined} | ||
* @default undefined | ||
*/ | ||
href: Config.string(), | ||
/** | ||
* Id to be applied to the element. | ||
* @instance | ||
* @memberof ClayLabel | ||
* @type {?string|undefined} | ||
* default undefined | ||
*/ | ||
id: Config.string(), | ||
/** | ||
* Id to be applied to the element. | ||
* @instance | ||
* @memberof ClayLabel | ||
* @type {?string|undefined} | ||
* @default undefined | ||
*/ | ||
id: Config.string(), | ||
/** | ||
* The label of the badge element. | ||
* @instance | ||
* @memberof ClayLabel | ||
* @type {?string|undefined} | ||
* default undefined | ||
*/ | ||
label: Config.string(), | ||
/** | ||
* The label of the badge element. | ||
* @instance | ||
* @memberof ClayLabel | ||
* @type {?string|undefined} | ||
* @default undefined | ||
*/ | ||
label: Config.string(), | ||
/** | ||
* The size of the label element. | ||
* @instance | ||
* @memberof ClayLabel | ||
* @type {?string|undefined} | ||
* @default undefined | ||
*/ | ||
size: Config.oneOf(['lg']), | ||
/** | ||
* The size of the label element. | ||
* @instance | ||
* @memberof ClayLabel | ||
* @type {?string|undefined} | ||
* @default undefined | ||
*/ | ||
size: Config.oneOf(['lg']), | ||
/** | ||
* The path to the SVG spritemap file containing the icons. | ||
* @instance | ||
* @memberof ClayLabel | ||
* @type {?string|undefined} | ||
* @default undefined | ||
*/ | ||
spritemap: Config.string(), | ||
/** | ||
* The path to the SVG spritemap file containing the icons. | ||
* @instance | ||
* @memberof ClayLabel | ||
* @type {?string|undefined} | ||
* @default undefined | ||
*/ | ||
spritemap: Config.string(), | ||
/** | ||
* Label style color. | ||
* @instance | ||
* @memberof ClayLabel | ||
* @type {?string} | ||
* default secondary | ||
*/ | ||
style: Config.oneOf([ | ||
'danger', | ||
'info', | ||
'secondary', | ||
'success', | ||
'warning', | ||
]).value('secondary'), | ||
/** | ||
* Label style color. | ||
* @instance | ||
* @memberof ClayLabel | ||
* @type {?string} | ||
* @default secondary | ||
*/ | ||
style: Config.oneOf([ | ||
'danger', | ||
'info', | ||
'secondary', | ||
'success', | ||
'warning', | ||
]).value('secondary'), | ||
}; | ||
defineWebComponent('clay-label', ClayLabel); | ||
Soy.register(ClayLabel, templates); | ||
@@ -101,0 +104,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20819
8
343
7
+ Addedmetal-web-component@^2.14.0
Updatedclay-button@^1.0.0-alpha.3
Updatedclay-link@^1.0.0-alpha.3
Updatedmetal@^2.14.0
Updatedmetal-component@^2.14.0
Updatedmetal-soy@^2.14.0
Updatedmetal-state@^2.14.0