|
|
|
@@ -1,11 +1,50 @@ |
|
|
|
import './infobox.scss'; |
|
|
|
import {createElement} from "../../_global/scripts/helpers"; |
|
|
|
import {createElement, createImage} from "../../_global/scripts/helpers"; |
|
|
|
import {createButton} from "../../atoms/button/ButtonComponent"; |
|
|
|
import {createBlockquote} from "../../atoms/blockquote/BlockquoteComponent"; |
|
|
|
|
|
|
|
export const createInfobox = |
|
|
|
({ |
|
|
|
type = 'regular', |
|
|
|
content = '<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>', |
|
|
|
}) => { |
|
|
|
const infobox = createElement('div', ['infobox', type], content); |
|
|
|
return infobox; |
|
|
|
} |
|
|
|
({ |
|
|
|
type = 'regular', |
|
|
|
full = false, |
|
|
|
kicker = 'Dachzeile', |
|
|
|
headline = 'Dies ist eine Zwischenheadline mit der Maximalbefüllung von 80 Zeichen.', |
|
|
|
image = './dummy/placeholder-1-1.svg', |
|
|
|
text = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.', |
|
|
|
ul = 'List Styles werden über externe Klasse Richtext geladen', |
|
|
|
ol = 'Lorem ipsum dolor sit', |
|
|
|
}) => { |
|
|
|
const infobox = createElement('div', ['infobox', type]); |
|
|
|
const content = createElement('div', ['infobox--content'], null, infobox); |
|
|
|
|
|
|
|
if (full === true) { |
|
|
|
createElement('p', ['kicker'], kicker, content); |
|
|
|
createElement('div', ['like-h2'], headline, content); |
|
|
|
} |
|
|
|
createElement('p', [], text, content); |
|
|
|
if (full === true) { |
|
|
|
const ulEl = createElement('ul', [], null, content); |
|
|
|
createElement('li', [], ul, ulEl); |
|
|
|
const olEl = createElement('ol', [], null, content); |
|
|
|
createElement('li', [], ol, olEl); |
|
|
|
|
|
|
|
content.appendChild(createBlockquote({})); |
|
|
|
|
|
|
|
let button; |
|
|
|
if (type === 'secondary') { |
|
|
|
button = createButton({ |
|
|
|
color: 'primary', label: 'Label' |
|
|
|
}); |
|
|
|
} else { |
|
|
|
button = createButton({ |
|
|
|
color: 'secondary', label: 'Label' |
|
|
|
}); |
|
|
|
} |
|
|
|
content.appendChild(button); |
|
|
|
|
|
|
|
createImage(image, 70, 70, '', [], infobox); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return infobox; |
|
|
|
} |