generated from boboko/starter
temp emails, reviews theming and form, minor change in checkout module, validation translations seeder
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
@props(['tabs' => [], 'size' => 'md'])
|
||||
@props(['tabs' => [], 'size' => 'md', 'active' => null])
|
||||
@php
|
||||
$sizeClasses = match($size) {
|
||||
'lg' => 'text-[36px] font-extrabold [--slide-h:5px]',
|
||||
default => 'text-xl font-bold [--slide-h:3px]',
|
||||
};
|
||||
$activeId = $active ?? ($tabs[0]['id'] ?? null);
|
||||
@endphp
|
||||
|
||||
{{--
|
||||
@@ -21,22 +22,22 @@
|
||||
|
||||
<div data-controller="tabs" {{ $attributes }}>
|
||||
<div class="flex gap-10 mb-8" role="tablist">
|
||||
@foreach($tabs as $i => $tab)
|
||||
@foreach($tabs as $tab)
|
||||
<button
|
||||
type="button"
|
||||
role="tab"
|
||||
data-tabs-target="button"
|
||||
data-action="click->tabs#show"
|
||||
data-panel="{{ $tab['id'] }}"
|
||||
class="underline-slide font-display pb-1 {{ $sizeClasses }} {{ $i === 0 ? 'is-active' : '' }}"
|
||||
aria-selected="{{ $i === 0 ? 'true' : 'false' }}"
|
||||
class="underline-slide font-display pb-1 {{ $sizeClasses }} {{ $tab['id'] === $activeId ? 'is-active' : '' }}"
|
||||
aria-selected="{{ $tab['id'] === $activeId ? 'true' : 'false' }}"
|
||||
aria-controls="tab-panel-{{ $tab['id'] }}"
|
||||
id="tab-btn-{{ $tab['id'] }}"
|
||||
>{{ $tab['label'] }}</button>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
@foreach($tabs as $i => $tab)
|
||||
@foreach($tabs as $tab)
|
||||
@php $panelKey = $tab['id']; $panel = $$panelKey ?? null; @endphp
|
||||
<div
|
||||
role="tabpanel"
|
||||
@@ -44,7 +45,7 @@ class="underline-slide font-display pb-1 {{ $sizeClasses }} {{ $i === 0 ? 'is-ac
|
||||
id="tab-panel-{{ $tab['id'] }}"
|
||||
aria-labelledby="tab-btn-{{ $tab['id'] }}"
|
||||
tabindex="0"
|
||||
@if($i !== 0) hidden @endif
|
||||
@if($tab['id'] !== $activeId) hidden @endif
|
||||
>{{ $panel }}</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user