-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor code & modified tallcraftui config
- Loading branch information
1 parent
9651183
commit e69bc5f
Showing
15 changed files
with
370 additions
and
410 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Developermithu\Tallcraftui\Helpers; | ||
|
||
use Illuminate\View\ComponentAttributeBag; | ||
|
||
class BorderRadiusHelper | ||
{ | ||
public static function getRoundedClass(string $componentName, ComponentAttributeBag $attributes): string | ||
{ | ||
return match (true) { | ||
$attributes->get('rounded') => 'rounded', | ||
$attributes->get('rounded-sm') => 'rounded-sm', | ||
$attributes->get('rounded-md') => 'rounded-md', | ||
$attributes->get('rounded-lg') => 'rounded-lg', | ||
$attributes->get('rounded-xl') => 'rounded-xl', | ||
$attributes->get('rounded-2xl') => 'rounded-2xl', | ||
$attributes->get('rounded-3xl') => 'rounded-3xl', | ||
$attributes->get('rounded-full') => 'rounded-full', | ||
$attributes->get('rounded-none') => 'rounded-none', | ||
default => config("tallcraftui.{$componentName}.border-radius", 'rounded'), | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
|
||
namespace Developermithu\Tallcraftui\Traits; | ||
|
||
trait HasCheckboxColors | ||
{ | ||
public array $colorAttributes = [ | ||
'primary', | ||
'secondary', | ||
'black', | ||
'white', | ||
'slate', | ||
'gray', | ||
'zinc', | ||
'neutral', | ||
'stone', | ||
'red', | ||
'orange', | ||
'amber', | ||
'yellow', | ||
'lime', | ||
'green', | ||
'emerald', | ||
'teal', | ||
'cyan', | ||
'sky', | ||
'blue', | ||
'indigo', | ||
'violet', | ||
'purple', | ||
'fuchsia', | ||
'pink', | ||
'rose', | ||
]; | ||
|
||
public function colorClasses(): string | ||
{ | ||
return match (true) { | ||
$this->attributes->has('secondary') => 'text-secondary/90 focus:ring-secondary/90', | ||
$this->attributes->has('black') => 'text-black focus:ring-black', | ||
$this->attributes->has('white') => 'text-white focus:ring-white !border-gray-200', | ||
$this->attributes->has('slate') => 'text-slate-600 focus:ring-slate-600', | ||
$this->attributes->has('gray') => 'text-gray-600 focus:ring-gray-600', | ||
$this->attributes->has('zinc') => 'text-zinc-600 focus:ring-zinc-600', | ||
$this->attributes->has('neutral') => 'text-neutral-600 focus:ring-neutral-600', | ||
$this->attributes->has('stone') => 'text-stone-600 focus:ring-stone-600', | ||
$this->attributes->has('red') => 'text-red-600 focus:ring-red-600', | ||
$this->attributes->has('orange') => 'text-orange-600 focus:ring-orange-600', | ||
$this->attributes->has('amber') => 'text-amber-600 focus:ring-amber-600', | ||
$this->attributes->has('yellow') => 'text-yellow-600 focus:ring-yellow-600', | ||
$this->attributes->has('lime') => 'text-lime-600 focus:ring-lime-600', | ||
$this->attributes->has('green') => 'text-green-600 focus:ring-green-600', | ||
$this->attributes->has('emerald') => 'text-emerald-600 focus:ring-emerald-600', | ||
$this->attributes->has('teal') => 'text-teal-600 focus:ring-teal-600', | ||
$this->attributes->has('cyan') => 'text-cyan-600 focus:ring-cyan-600', | ||
$this->attributes->has('sky') => 'text-sky-600 focus:ring-sky-600', | ||
$this->attributes->has('blue') => 'text-blue-600 focus:ring-blue-600', | ||
$this->attributes->has('indigo') => 'text-indigo-600 focus:ring-indigo-600', | ||
$this->attributes->has('violet') => 'text-violet-600 focus:ring-violet-600', | ||
$this->attributes->has('purple') => 'text-purple-600 focus:ring-purple-600', | ||
$this->attributes->has('fuchsia') => 'text-fuchsia-600 focus:ring-fuchsia-600', | ||
$this->attributes->has('pink') => 'text-pink-600 focus:ring-pink-600', | ||
$this->attributes->has('rose') => 'text-rose-600 focus:ring-rose-600', | ||
default => 'text-primary/90 focus:ring-primary/90', // primary | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.