Skip to content

Commit

Permalink
Merge pull request #2 from pemudakoding/main
Browse files Browse the repository at this point in the history
refactor: concern of class
  • Loading branch information
pemudakoding authored Jan 8, 2023
2 parents dc75199 + 1fe18ae commit 52c7e3d
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 53 deletions.
12 changes: 6 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,18 @@ This field has most of the same functionality of the Field class
### Widget
For implement alert box widget you can create a widget as usual then inheritance our package class
```php
use KoalaFacade\FilamentAlertBox\Widgets\AlertBoxWidget
use KoalaFacade\FilamentAlertBox\Widgets\AlertBoxWidget;

class YourWidgetTho extends AlertBoxWidget
{
public string | null $icon = 'heroicon-o-exclamation';

public string | Closure | null $icon = 'heroicon-o-exclamation';
/** success, warning, danger, primary */
public string $type = 'warning';
public string $type = 'success';

public string | null $label = 'Oops';
public string | Closure | null $label = 'Test';

public string | null $helperText = 'your ex blocked you';
public string | Closure | null | HtmlString $helperText = 'please shut u freakin mouth';
}
```
## License
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace KoalaFacade\FilamentAlertBox\Concerns\Forms;
namespace KoalaFacade\FilamentAlertBox\Concerns;

use Closure;
use KoalaFacade\FilamentAlertBox\Forms\Components\AlertBox;
Expand Down
13 changes: 0 additions & 13 deletions src/Concerns/Widget/HasHelperText.php

This file was deleted.

13 changes: 0 additions & 13 deletions src/Concerns/Widget/HasIcon.php

This file was deleted.

13 changes: 0 additions & 13 deletions src/Concerns/Widget/HasLabel.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/Forms/Components/AlertBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace KoalaFacade\FilamentAlertBox\Forms\Components;

use Filament\Forms\Components\Field;
use KoalaFacade\FilamentAlertBox\Concerns\Forms\HasIcon;
use KoalaFacade\FilamentAlertBox\Concerns\Forms\HasType;
use KoalaFacade\FilamentAlertBox\Concerns\HasIcon;

class AlertBox extends Field
{
Expand Down
6 changes: 3 additions & 3 deletions src/Widgets/AlertBoxWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace KoalaFacade\FilamentAlertBox\Widgets;

use Filament\Forms\Components\Concerns\HasHelperText;
use Filament\Support\Concerns\EvaluatesClosures;
use Filament\Support\Concerns\HasExtraAttributes;
use Filament\Tables\Columns\Concerns\HasLabel;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;
use KoalaFacade\FilamentAlertBox\Concerns\HasIcon;
use KoalaFacade\FilamentAlertBox\Concerns\HasType;
use KoalaFacade\FilamentAlertBox\Concerns\Widget\HasHelperText;
use KoalaFacade\FilamentAlertBox\Concerns\Widget\HasIcon;
use KoalaFacade\FilamentAlertBox\Concerns\Widget\HasLabel;
use Livewire\Component;

class AlertBoxWidget extends Component
Expand Down
8 changes: 5 additions & 3 deletions tests/Livewire/Widget/WidgetTestComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@

namespace KoalaFacade\FilamentAlertBox\Tests\Livewire\Widget;

use Closure;
use Illuminate\Support\HtmlString;
use KoalaFacade\FilamentAlertBox\Widgets\AlertBoxWidget;

class WidgetTestComponent extends AlertBoxWidget
{
public string | null $icon = 'heroicon-o-exclamation';
public string | Closure | null $icon = 'heroicon-o-exclamation';

public string $type = 'success';

public string | null $label = 'Test';
public string | Closure | null $label = 'Test';

public string | null $helperText = 'please shut u freakin mouth';
public string | Closure | null | HtmlString $helperText = 'please shut u freakin mouth';
}

0 comments on commit 52c7e3d

Please sign in to comment.