Skip to content

Commit

Permalink
[Change] Move Card from layout directory and adjust namespaces,
Browse files Browse the repository at this point in the history
[Change] Adjust Workbench PageResource form layout for demo screenshot,
[Add] Default Tailwind CSS classes to the base components,
  • Loading branch information
bumbummen99 committed Nov 20, 2024
1 parent e8bd49c commit 8b7e61b
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 13 deletions.
5 changes: 5 additions & 0 deletions resources/views/card.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div class="mx-auto">
<div class="p-6">
@blocks($content)
<div>
</div>
3 changes: 0 additions & 3 deletions resources/views/layout/card.blade.php

This file was deleted.

10 changes: 9 additions & 1 deletion resources/views/typography/heading.blade.php
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
<{{ $level }}>{{ $content }}</{{ $level }}>
<{{ $level }} @class([
'font-bold leading-tight',
'font-3xl' => $level == 'h1',
'font-2xl' => $level == 'h2',
'font-xl' => $level == 'h3',
'font-lg' => $level == 'h4',
'font-base' => $level == 'h5',
'font-sm' => $level == 'h6',
])>{{ $content }}</{{ $level }}>
4 changes: 2 additions & 2 deletions src/Blocks/Layout/Card.php → src/Blocks/Card.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SkyRaptor\FilamentBlocksBuilder\Blocks\Layout;
namespace SkyRaptor\FilamentBlocksBuilder\Blocks;

use Filament\Forms\Components\Builder;
use Filament\Forms\Form;
Expand All @@ -24,6 +24,6 @@ public static function block(Form $form): Builder\Block

public static function view(): string
{
return 'filament-blocks-builder::layout.card';
return 'filament-blocks-builder::card';
}
}
2 changes: 1 addition & 1 deletion tests/Feature/BlocksInputTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function test_nested_builders_inherit_blocks()
]
]
],
'type' => Blocks\Layout\Card::class
'type' => Blocks\Card::class
]
]
]);
Expand Down
18 changes: 12 additions & 6 deletions workbench/app/Filament/Resources/PageResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,19 @@ public static function form(Form $form): Form
Forms\Components\TextInput::make('title')
->required()
->maxLength(255),
BlocksInput::make('content')
->blocks(fn () => [
Blocks\Layout\Card::block($form),
Blocks\Typography\Heading::block($form),
Blocks\Typography\Paragraph::block($form)
Forms\Components\Card::make()
->heading('Blocks Builder')
->schema([
BlocksInput::make('content')
->label('')
->blocks(fn () => [
Blocks\Card::block($form),
Blocks\Typography\Heading::block($form),
Blocks\Typography\Paragraph::block($form)
])
])
]);
])
->columns(1);
}

public static function table(Table $table): Table
Expand Down

0 comments on commit 8b7e61b

Please sign in to comment.