|
196 | 196 | </p> |
197 | 197 |
|
198 | 198 | <div class="flex gap-2"> |
199 | | - <input |
200 | | - type="date" |
201 | | - value={formatDateForSlug(slugDate)} |
202 | | - oninput={handleDateChange} |
203 | | - class="w-32 shrink-0 rounded-lg border bg-white px-2 py-1.5 font-mono text-sm text-zinc-900 focus:ring-0 focus:outline-none" |
204 | | - class:border-zinc-200={!displayError && !isSlugValid} |
205 | | - class:border-emerald-500={isSlugValid && slug.length > 0} |
206 | | - class:border-red-300={displayError} |
207 | | - /> |
208 | | - <input |
209 | | - type="text" |
210 | | - value={slugTitle} |
211 | | - oninput={handleSlugTitleChange} |
212 | | - class="min-w-0 flex-1 rounded-lg border bg-white px-2 py-1.5 font-mono text-sm text-zinc-900 focus:ring-0 focus:outline-none" |
213 | | - class:border-zinc-200={!displayError && !isSlugValid} |
214 | | - class:border-emerald-500={isSlugValid && slug.length > 0} |
215 | | - class:border-red-300={displayError} |
216 | | - placeholder="title-slug" |
217 | | - /> |
| 199 | + <div class="flex w-32 shrink-0 flex-col gap-1"> |
| 200 | + <label for="slug-date" class="text-xs font-medium text-zinc-500">公開日</label> |
| 201 | + <input |
| 202 | + type="date" |
| 203 | + id="slug-date" |
| 204 | + value={formatDateForSlug(slugDate)} |
| 205 | + oninput={handleDateChange} |
| 206 | + class="w-full rounded-lg border bg-white px-2 py-1.5 font-mono text-sm text-zinc-900 focus:ring-0 focus:outline-none" |
| 207 | + class:border-zinc-200={!displayError && !isSlugValid} |
| 208 | + class:border-emerald-500={isSlugValid && slug.length > 0} |
| 209 | + class:border-red-300={displayError} |
| 210 | + /> |
| 211 | + </div> |
| 212 | + <div class="flex min-w-0 flex-1 flex-col gap-1"> |
| 213 | + <label for="slug-title" class="text-xs font-medium text-zinc-500">スラッグタイトル</label> |
| 214 | + <input |
| 215 | + type="text" |
| 216 | + id="slug-title" |
| 217 | + value={slugTitle} |
| 218 | + oninput={handleSlugTitleChange} |
| 219 | + class="w-full rounded-lg border bg-white px-2 py-1.5 font-mono text-sm text-zinc-900 focus:ring-0 focus:outline-none" |
| 220 | + class:border-zinc-200={!displayError && !isSlugValid} |
| 221 | + class:border-emerald-500={isSlugValid && slug.length > 0} |
| 222 | + class:border-red-300={displayError} |
| 223 | + placeholder="title-slug" |
| 224 | + /> |
| 225 | + </div> |
218 | 226 | </div> |
219 | 227 |
|
220 | | - {#if displayError} |
221 | | - <p class="text-xs text-red-500">{displayError}</p> |
222 | | - {/if} |
| 228 | + <div aria-live="polite"> |
| 229 | + {#if displayError} |
| 230 | + <p class="text-xs text-red-500">{displayError}</p> |
| 231 | + {/if} |
| 232 | + </div> |
223 | 233 |
|
224 | 234 | <!-- Redirect checkbox (only show when editing and slug has changed) --> |
225 | 235 | {#if initialSlug && slug !== initialSlug} |
|
0 commit comments