Skip to content

Commit 4af6caa

Browse files
committed
refactor: Update checkbox component to support full width option
1 parent 8e91d95 commit 4af6caa

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

resources/views/components/forms/checkbox.blade.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@
66
'instantSave' => false,
77
'value' => null,
88
'hideLabel' => false,
9+
'fullWidth' => false,
910
])
1011

11-
<div class="flex flex-row items-center py-1 form-control min-w-fit dark:hover:bg-coolgray-100">
12+
<div @class([
13+
'flex flex-row items-center gap-4 px-2 py-1 form-control min-w-fit dark:hover:bg-coolgray-100',
14+
'w-full' => $fullWidth,
15+
])>
1216
@if (!$hideLabel)
1317
<label class="flex gap-4 px-0 min-w-fit label">
1418
<span class="flex gap-2">

resources/views/components/modal-confirmation.blade.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,10 @@ class="flex absolute top-2 right-2 justify-center items-center w-8 h-8 rounded-f
181181
</div>
182182
@foreach ($checkboxes as $index => $checkbox)
183183
<div class="flex justify-between items-center mb-2">
184-
<label for="{{ $checkbox['id'] }}"
185-
class="flex-grow pr-4 text-sm leading-5 text-gray-700 dark:text-gray-300">
186-
{{ $checkbox['label'] }}
187-
</label>
188-
<x-forms.checkbox :id="$checkbox['id']" :wire:model="$checkbox['id']"
184+
<x-forms.checkbox fullWidth :label="$checkbox['label']" :id="$checkbox['id']"
185+
:wire:model="$checkbox['id']"
189186
x-on:change="toggleAction('{{ $checkbox['id'] }}')" :checked="$this->{$checkbox['id']}"
190-
x-bind:checked="selectedActions.includes('{{ $checkbox['id'] }}')"
191-
class="flex-shrink-0" :hideLabel="true" />
187+
x-bind:checked="selectedActions.includes('{{ $checkbox['id'] }}')" />
192188
</div>
193189
@endforeach
194190
</div>

0 commit comments

Comments
 (0)