Skip to content

Commit e3fda8b

Browse files
committed
update styling
1 parent f710650 commit e3fda8b

2 files changed

Lines changed: 18 additions & 16 deletions

File tree

packages/slug/resources/views/forms/fields/slug-input.blade.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@
7878
<div style="display: flex; align-items: center; flex: 1 1 0; min-width: 0;">
7979
<span>{{ $getLabelPrefix() }}</span>
8080
<span style="color: #9ca3af; margin-left: 0.25rem;">{{ $getFullBaseUrl() }}</span>
81+
<span style="color: #9ca3af; font-weight: 600; margin-left: 0.25rem;">{{ $getState() }}</span>
8182
<x-filament::link tag="button" x-on:click.prevent="initModification()" x-show="!editing"
8283
x-bind:class="context !== 'create' && modified ? 'text-gray-600 bg-gray-100 dark:text-gray-400 dark:bg-gray-700 px-1 rounded-md' : ''"
8384
icon="heroicon-m-pencil-square" icon-size="sm" icon-position="after"
8485
style="margin-left: 0.25rem;">
85-
<span class="mr-1">{{ $getState() }}</span>
8686
</x-filament::link>
8787
@if($getSlugLabelPostfix())
8888
<span style="margin-left: 0.125rem; color: #9ca3af;">{{ $getSlugLabelPostfix() }}</span>
@@ -117,10 +117,12 @@
117117
{{ __('slug::fields.permalink_action_ok') }}
118118
</x-filament::button>
119119
<x-filament::link x-show="context === 'edit' && modified"
120-
x-on:click.prevent="resetModification()" tag="button" icon="heroicon-o-arrow-path"
120+
x-on:click.prevent="resetModification()" tag="button"
121+
tooltip="{{ __('slug::fields.permalink_action_reset') }}" icon="heroicon-o-arrow-path"
121122
color="gray" size="sm">
122123
</x-filament::link>
123-
<x-filament::link x-on:click.prevent="cancelModification()" tag="button"
124+
<x-filament::link x-on:click.prevent="cancelModification()"
125+
tooltip="{{ __('slug::fields.permalink_action_cancel') }}" tag="button"
124126
icon="heroicon-o-x-mark" color="gray" size="sm">
125127
</x-filament::link>
126128
</div>

packages/slug/src/Forms/Components/TitleWithSlugInput.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@ public static function make(
6464
->autocomplete(false)
6565
->rules($titleRules)
6666
->extraInputAttributes($titleExtraInputAttributes ?? ['class' => 'text-xl font-semibold'])
67-
->beforeStateDehydrated(fn (TextInput $component, $state) => $component->state(trim($state)))
67+
->beforeStateDehydrated(fn(TextInput $component, $state) => $component->state(trim($state)))
6868
->afterStateUpdated(
6969
function ($state, Set $set, Get $get, string $context, ?Model $record, TextInput $component) use ($slugSlugifier, $fieldSlug, $titleAfterStateUpdated) {
70-
$slugAutoUpdateDisabled = $get($fieldSlug.'_slug_auto_update_disabled');
70+
$slugAutoUpdateDisabled = $get($fieldSlug . '_slug_auto_update_disabled');
7171

7272
if ($context === 'edit' && filled($record)) {
7373
$slugAutoUpdateDisabled = true;
7474
}
7575

76-
if (! $slugAutoUpdateDisabled && filled($state)) {
76+
if (!$slugAutoUpdateDisabled && filled($state)) {
7777
$set($fieldSlug, self::slugify($slugSlugifier, $state));
7878
}
7979

@@ -88,10 +88,10 @@ function ($state, Set $set, Get $get, string $context, ?Model $record, TextInput
8888
}
8989

9090
if ($titlePlaceholder !== '') {
91-
$textInput->placeholder($titlePlaceholder ?: fn () => Str::of($fieldTitle)->headline());
91+
$textInput->placeholder($titlePlaceholder ?: fn() => Str::of($fieldTitle)->headline());
9292
}
9393

94-
if (! $titleLabel) {
94+
if (!$titleLabel) {
9595
$textInput->hiddenLabel();
9696
}
9797

@@ -105,15 +105,15 @@ function ($state, Set $set, Get $get, string $context, ?Model $record, TextInput
105105

106106
/** Input: "Slug" (+ view) */
107107
$slugInput = SlugInput::make($fieldSlug)
108-
108+
->extraAttributes(['style' => 'margin-top: -15px;'])
109109
// Custom SlugInput methods
110110
->slugInputVisitLinkRoute($urlVisitLinkRoute)
111111
->slugInputVisitLinkLabel($urlVisitLinkLabel)
112112
->slugInputUrlVisitLinkVisible($urlVisitLinkVisible)
113-
->slugInputContext(fn ($context) => $context === 'create' ? 'create' : 'edit')
114-
->slugInputRecordSlug(fn (?Model $record) => data_get($record?->attributesToArray(), $fieldSlug))
113+
->slugInputContext(fn($context) => $context === 'create' ? 'create' : 'edit')
114+
->slugInputRecordSlug(fn(?Model $record) => data_get($record?->attributesToArray(), $fieldSlug))
115115
->slugInputModelName(
116-
fn (?Model $record) => $record
116+
fn(?Model $record) => $record
117117
? Str::of(class_basename($record))->headline()
118118
: ''
119119
)
@@ -138,7 +138,7 @@ function ($state, Set $set, Get $get, TextInput $component) use ($slugSlugifier,
138138

139139
$set($fieldSlug, self::slugify($slugSlugifier, $text));
140140

141-
$set($fieldSlug.'_slug_auto_update_disabled', true);
141+
$set($fieldSlug . '_slug_auto_update_disabled', true);
142142

143143
if ($slugAfterStateUpdated) {
144144
$component->evaluate($slugAfterStateUpdated);
@@ -152,10 +152,10 @@ function ($state, Set $set, Get $get, TextInput $component) use ($slugSlugifier,
152152

153153
$slugRuleUniqueParameters
154154
? $slugInput->unique(...$slugRuleUniqueParameters)
155-
: $slugInput->unique(ignorable: fn (?Model $record) => $record);
155+
: $slugInput->unique(ignorable: fn(?Model $record) => $record);
156156

157157
/** Input: "Slug Auto Update Disabled" (Hidden) */
158-
$hiddenInputSlugAutoUpdateDisabled = Hidden::make($fieldSlug.'_slug_auto_update_disabled')
158+
$hiddenInputSlugAutoUpdateDisabled = Hidden::make($fieldSlug . '_slug_auto_update_disabled')
159159
->dehydrated(false);
160160

161161
/** Group */
@@ -171,7 +171,7 @@ function ($state, Set $set, Get $get, TextInput $component) use ($slugSlugifier,
171171
/** Fallback slugifier, over-writable with slugSlugifier parameter. */
172172
protected static function slugify(?Closure $slugifier, ?string $text): string
173173
{
174-
if (is_null($text) || ! trim($text)) {
174+
if (is_null($text) || !trim($text)) {
175175
return '';
176176
}
177177

0 commit comments

Comments
 (0)