Skip to content
Snippets Groups Projects
Commit a1b4bc34 authored by Hermann's avatar Hermann
Browse files

add chip element

parent ddae9968
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@ import {
Toolbar,
ToolbarTitle,
Card,
Icon,
} from 'polythene-mithril';
export const icons = {
......@@ -270,6 +271,33 @@ export class selectGroup {
}
}
export class chip {
view({ attrs: { svg, color = '#000000', background = '#dddddd', ...styleAttrs }, children }) {
return m('div', {
style: {
height: '32px',
'background-color': '#ffffff',
'border-radius': '16px',
padding: '4px 8px',
display: 'inline-flex',
...styleAttrs,
},
}, [
svg && m('div', {
style: {
'background-color': background,
'border-radius': '12px',
margin: '0px 4px 0px -2px',
height: '24px',
width: '24px',
padding: '2px 2px 2px 4px',
},
}, m(Icon, { svg: { content: m.trust(svg) }, size: 'small', style: { color } })),
m('div', { style: { 'line-height': '24px' } }, children),
]);
}
}
export class submitButton {
view({ attrs: { args, active, text } }) {
const argsCopy = args;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment