primevue
Version:
PrimeVue is an open source UI library for Vue featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBloc
32 lines (29 loc) • 1.09 kB
JavaScript
import { style } from '@primeuix/styles/badge';
import { isEmpty, isNotEmpty } from '@primeuix/utils/object';
import BaseStyle from '@primevue/core/base/style';
var classes = {
root: function root(_ref) {
var props = _ref.props,
instance = _ref.instance;
return ['p-badge p-component', {
'p-badge-circle': isNotEmpty(props.value) && String(props.value).length === 1,
'p-badge-dot': isEmpty(props.value) && !instance.$slots["default"],
'p-badge-sm': props.size === 'small',
'p-badge-lg': props.size === 'large',
'p-badge-xl': props.size === 'xlarge',
'p-badge-info': props.severity === 'info',
'p-badge-success': props.severity === 'success',
'p-badge-warn': props.severity === 'warn',
'p-badge-danger': props.severity === 'danger',
'p-badge-secondary': props.severity === 'secondary',
'p-badge-contrast': props.severity === 'contrast'
}];
}
};
var BadgeStyle = BaseStyle.extend({
name: 'badge',
style: style,
classes: classes
});
export { BadgeStyle as default };
//# sourceMappingURL=index.mjs.map