style updates

This commit is contained in:
Mark Gregory
2026-07-24 14:59:44 +01:00
parent 24ab771cd3
commit dd23205d0b
482 changed files with 7173 additions and 1435 deletions
@@ -1,12 +1,40 @@
<?php
namespace Modules\Builder\Components;
use Modules\Builder\Contracts\BuilderComponent;
final class HeadingComponent implements BuilderComponent
{
public function type(): string { return 'heading'; }
public function label(): string { return 'Heading'; }
public function category(): string { return 'Typography'; }
public function schema(): array { return ['text'=>['type'=>'text','required'=>true],'level'=>['type'=>'select','options'=>[1,2,3,4,5,6]]]; }
public function defaults(): array { return ['text'=>'Heading','level'=>2]; }
public function render(array $properties, array $context=[]): string { $level=max(1,min(6,(int)($properties['level']??2))); return '<h'.$level.'>'.e($properties['text']??'').'</h'.$level.'>'; }
public function type(): string
{
return 'heading';
}
public function label(): string
{
return 'Heading';
}
public function category(): string
{
return 'Typography';
}
public function schema(): array
{
return ['text' => ['type' => 'text', 'required' => true], 'level' => ['type' => 'select', 'options' => [1, 2, 3, 4, 5, 6]]];
}
public function defaults(): array
{
return ['text' => 'Heading', 'level' => 2];
}
public function render(array $properties, array $context = []): string
{
$level = max(1, min(6, (int) ($properties['level'] ?? 2)));
return '<h'.$level.'>'.e($properties['text'] ?? '').'</h'.$level.'>';
}
}