export function actionButton(label, { type = 'button' } = {}) { if (typeof label !== 'string' || !label.trim()) { throw new TypeError('An action button needs a visible label'); } if (!['button', 'submit'].includes(type)) { throw new TypeError('Choose button or submit explicitly'); } const button = document.createElement('button'); button.type = type; button.className = 'action-control'; button.textContent = label; return button; }