@aware([
'isGrouped' => false,
'hasAddons' => false,
])
@props([
'label' => '',
'icon' => '',
'iconRight' => '',
'isExpanded' => false,
'isSecondary' => false,
'is-Size' => 'medium',
])
@if ($isGrouped || $hasAddons)
<div @class([
'control',
'is-expanded' => $isExpanded,
])>
<button {{ $attributes->class([
'button',
"is-{$isSize}",
'is-dark' => ! $isSecondary,
'is-fullwidth' => $isExpanded,
])->merge([
'type' => 'submit',
]) }}>
@if ($slot->isEmpty())
@if ($icon)
<x-icon :$icon />
@endif
@if ($label)
<span>{{ $label }}</span>
@endif
@if ($iconRight)
<x-icon :$iconRight />
@endif
@else
{{ $slot }}
@endif
</button>
</div>
@else
<fieldset class="field">
<div @class([
'control',
'is-expanded' => $isExpanded,
])>
<button {{ $attributes->class([
'button',
"is-{$isSize}",
'is-dark' => ! $isSecondary,
'is-fullwidth' => $isExpanded,
])->merge([
'type' => 'submit',
]) }}>
@if ($slot->isEmpty())
@if ($icon)
<x-icon :$icon />
@endif
@if ($label)
<span>{{ $label }}</span>
@endif
@if ($iconRight)
<x-icon :$iconRight />
@endif
@else
{{ $slot }}
@endif
</button>
</div>
</fieldset>
@endif