Skip to content
This repository was archived by the owner on Oct 20, 2025. It is now read-only.

Commit 8693afc

Browse files
committed
Prepare help texts
1 parent d4053ab commit 8693afc

File tree

17 files changed

+39
-26
lines changed

17 files changed

+39
-26
lines changed

resources/views/form/checkbox.blade.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<div {{ $attributes->only(['v-if', 'v-show', 'class']) }}>
22
<label class="flex items-center">
3-
<input {{ $attributes->except(['v-if', 'v-show', 'class'])->class([
3+
<input {{ $attributes->except(['v-if', 'v-show', 'class'])->class(
44
'rounded border-gray-300 text-indigo-600 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 disabled:opacity-50'
5-
])->merge([
5+
)->merge([
66
'name' => $name,
77
'value' => $value,
88
'type' => 'checkbox',
@@ -19,6 +19,7 @@
1919
</span>
2020
</label>
2121

22+
@includeWhen($help, 'splade::form.help', ['help' => $help])
2223
@includeWhen($showErrors, 'splade::form.error', ['name' => $validationKey()])
2324
</div>
2425

resources/views/form/file.blade.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
>
77
<template #default="{!! $scope !!}">
88
<label class="block">
9-
@include('splade::form.label', ['label' => $label])
9+
@includeWhen($label, 'splade::form.label', ['label' => $label])
1010

11-
<div class="@if($label) mt-1 @endif">
11+
<div>
1212
<a @submit.prevent
1313
class="inline-block px-3 py-1 rounded-md border border-gray-300 shadow-sm bg-gray-100 hover:bg-gray-300 relative cursor-pointer">
1414

@@ -28,6 +28,8 @@ class="inline-block px-3 py-1 rounded-md border border-gray-300 shadow-sm bg-gra
2828
/>
2929
</a>
3030

31+
@includeWhen($help, 'splade::form.help', ['help' => $help])
32+
3133
<div class="mt-2 text-sm italic">
3234
<p v-for="(filename, key) in file.filenames" v-bind:key="key" v-text="filename" />
3335
</div>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<div {{ $attributes->only(['v-if', 'v-show']) }}>
2-
@include('splade::form.label', ['label' => $label])
2+
@includeWhen($label, 'splade::form.label', ['label' => $label])
33

44
<div {{ $attributes->except(['v-if', 'v-show'])->class([
5-
'mt-2' => $label,
65
'flex flex-wrap space-x-6' => $inline,
76
'space-y-1' => !$inline,
87
]) }}
98
>
109
{{ $slot }}
1110
</div>
1211

12+
@includeWhen($help, 'splade::form.help', ['help' => $help])
1313
@includeWhen($showErrors, 'splade::form.error', ['name' => $validationKey()])
1414
</div>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<p class="text-gray-500 text-sm mt-2">{{ $help }}</p>

resources/views/form/input.blade.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
v-model="{{ $vueModel() }}"
66
>
77
<label class="block">
8-
@include('splade::form.label', ['label' => $label])
8+
@includeWhen($label, 'splade::form.label', ['label' => $label])
99

10-
<div class="@if($label) mt-1 @endif flex rounded-md shadow-sm">
10+
<div class="flex rounded-md shadow-sm">
1111
@if($prepend)
1212
<span class="inline-flex items-center px-3 rounded-l-md border border-r-0 border-gray-300 bg-gray-50 text-gray-500">
1313
{!! $prepend !!}
@@ -35,5 +35,6 @@
3535
</div>
3636
</label>
3737

38+
@include('splade::form.help', ['help' => $help])
3839
@includeWhen($showErrors, 'splade::form.error', ['name' => $validationKey()])
3940
</SpladeInput>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@if($label) <span class="text-gray-700">{{ $label }}</span> @endif
1+
<span class="block mb-1 text-gray-700">{{ $label }}</span>

resources/views/form/radio.blade.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<div {{ $attributes->only(['v-if', 'v-show', 'class']) }}>
22
<label class="flex items-center">
3-
<input {{ $attributes->except(['v-if', 'v-show', 'class'])->class([
3+
<input {{ $attributes->except(['v-if', 'v-show', 'class'])->class(
44
'rounded-full border-gray-300 text-indigo-600 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 disabled:opacity-50'
5-
])->merge([
5+
)->merge([
66
'name' => $name,
77
'value' => $value,
88
'type' => 'radio',
@@ -19,6 +19,7 @@
1919
</span>
2020
</label>
2121

22+
@includeWhen($help, 'splade::form.help', ['help' => $help])
2223
@includeWhen($showErrors, 'splade::form.error', ['name' => $validationKey()])
2324
</div>
2425

resources/views/form/select.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
v-model="{{ $vueModel() }}"
88
>
99
<label class="block">
10-
@include('splade::form.label', ['label' => $label])
10+
@includeWhen($label, 'splade::form.label', ['label' => $label])
1111

1212
<select {{ $attributes->except(['v-if', 'v-show', 'class'])->class([
1313
'block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 disabled:opacity-50',
14-
'mt-1' => $label,
1514
])->merge([
1615
'multiple' => $multiple,
1716
'name' => $name,
@@ -28,5 +27,6 @@
2827
</select>
2928
</label>
3029

30+
@includeWhen($help, 'splade::form.help', ['help' => $help])
3131
@includeWhen($showErrors, 'splade::form.error', ['name' => $validationKey()])
3232
</SpladeSelect>

resources/views/form/submit.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<button {{ $attributes->class([
1+
<button {{ $attributes->class(
22
'rounded-md shadow-sm bg-indigo-500 hover:bg-indigo-700 text-white font-bold py-2 px-4 focus:outline-none focus:shadow-outline'
3-
])->merge([
3+
)->merge([
44
'type' => $type
55
]) }}
66
>

resources/views/form/textarea.blade.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
v-model="{{ $vueModel() }}"
55
>
66
<label class="block">
7-
@include('splade::form.label', ['label' => $label])
7+
@includeWhen($label, 'splade::form.label', ['label' => $label])
88

9-
<textarea {{ $attributes->except(['v-if', 'v-show', 'class', 'autosize'])->class([
10-
'block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 disabled:opacity-50',
11-
'mt-1' => $label,
12-
])->merge([
9+
<textarea {{ $attributes->except(['v-if', 'v-show', 'class', 'autosize'])->class(
10+
'block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 disabled:opacity-50'
11+
)->merge([
1312
'name' => $name,
1413
'v-model' => $vueModel()
1514
]) }}
1615
/>
1716
</label>
1817

18+
@includeWhen($help, 'splade::form.help', ['help' => $help])
1919
@includeWhen($showErrors, 'splade::form.error', ['name' => $validationKey()])
2020
</SpladeTextarea>

0 commit comments

Comments
 (0)