Open sezaru opened 3 months ago
I have the following variant:
def button do [ slots: [ base: """ focus:ring-2 font-medium """, left_icon: "text-white me-2 block" ], variants: [ loading?: [ true: "SOME_CLASS" ] ], default_variants: [ loading?: false ] ] end
When I run:
Turboprop.Variants.variant(UI.Button.button(), slot: :base, loading?: true)
I correctly get:
"focus:ring-2 font-medium SOME_CLASS"
But, if i try to do the same with the :left_icon slot, the SOME_CLASS will not be present:
:left_icon
SOME_CLASS
Turboprop.Variants.variant(UI.Button.button(), slot: :left_icon, loading?: true) "text-white me-2 block"
Now, if I change the loading? variant to this:
loading?
loading?: [ true: [ base: "SOME_CLASS", left_icon: "SOME_OTHER_CLASS" ] ]
Now the :base slot will not contain the loading? variant:
:base
Turboprop.Variants.variant(UI.Button.button(), slot: :base, loading?: true) "focus:ring-2 font-medium"
And the :left_icon slot will contain it:
Turboprop.Variants.variant(UI.Button.button(), slot: :left_icon, loading?: true) "text-white me-2 block SOME_OTHER_CLASS"
I expect that in both cases, the loading? variant would be present in both slots.
I have the following variant:
When I run:
I correctly get:
But, if i try to do the same with the
:left_icon
slot, theSOME_CLASS
will not be present:Now, if I change the
loading?
variant to this:Now the
:base
slot will not contain theloading?
variant:And the
:left_icon
slot will contain it:I expect that in both cases, the
loading?
variant would be present in both slots.