File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class Wrapper extends ViewComponent
14
14
public function __construct (
15
15
string $ component ,
16
16
string $ tag = 'div ' ,
17
- string $ variant = 'normal ' ,
17
+ string | array $ variant = 'normal ' ,
18
18
bool $ tagSelfClose = false
19
19
) {
20
20
$ this ->blessUi = compact ('component ' , 'tag ' , 'variant ' , 'tagSelfClose ' );
@@ -33,7 +33,7 @@ public function render()
33
33
$ componentClass = Config::get ('bless-ui.prefix ' ) . $ this ->blessUi ['component ' ];
34
34
35
35
$ baseClasses = $ config ['base ' ] ?? null ;
36
- $ variantClasses = $ config [ ' variants ' ][ $ this -> blessUi [ ' variant ' ] ] ?? null ;
36
+ $ variantClasses = collect (( array ) $ this -> blessUi [ ' variant ' ])-> map ( fn ( $ key ) => $ config [ ' variants ' ][ $ key ] ?? null )-> flatten ()-> toArray () ;
37
37
38
38
$ attributes = $ data ['attributes ' ]
39
39
->class ($ baseClasses )
You can’t perform that action at this time.
0 commit comments