ember-cli-lightning-design-system
Version:
Easy installation and reusable components for the salesforce lightning design system.
27 lines (21 loc) • 637 B
JavaScript
import { computed } from '@ember/object';
import Component from '@ember/component';
import layout from '../templates/components/slds-toast';
const themeMap = {
info: 'slds-theme_info',
success: 'slds-theme_success',
warning: 'slds-theme_warning',
error: 'slds-theme_error'
};
export default Component.extend({
layout,
classNames: ['slds-notify', 'slds-notify_toast'],
classNameBindings: ['themeClass'],
attributeBindings: ['role:role'],
role: 'alert',
theme: 'info',
themeClass: computed('theme', function() {
const theme = this.get('theme');
return themeMap[theme];
})
});