refactor(ui): replace inline INPUT_CLS/LABEL_CLS/BTN_DANGER constants and action link classes with CSS component classes
Remove duplicated Tailwind class string constants from 15 component files. Use app-input, app-select, app-label, app-action-danger-btn, and app-action-delete CSS component classes from globals.css instead. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,9 +4,6 @@ import { useState } from "react";
|
||||
import type { StaffingRequirement } from "@capakraken/shared";
|
||||
import { uuid } from "~/lib/uuid.js";
|
||||
|
||||
const INPUT_CLS = "app-input";
|
||||
const BTN_DANGER = "app-action-danger-btn";
|
||||
|
||||
function makeEmptyPreset(): StaffingRequirement {
|
||||
return {
|
||||
id: uuid(),
|
||||
@@ -38,7 +35,7 @@ function PresetRow({ preset, onChange, onDelete }: PresetRowProps) {
|
||||
value={preset.role}
|
||||
onChange={(e) => update("role", e.target.value)}
|
||||
placeholder="Role name"
|
||||
className={`${INPUT_CLS} flex-1 min-w-32`}
|
||||
className="app-input flex-1 min-w-32"
|
||||
aria-label="Role name"
|
||||
/>
|
||||
|
||||
@@ -58,7 +55,7 @@ function PresetRow({ preset, onChange, onDelete }: PresetRowProps) {
|
||||
)
|
||||
}
|
||||
placeholder="e.g. 3D Modeling, Lighting"
|
||||
className={INPUT_CLS}
|
||||
className="app-input"
|
||||
aria-label="Required skills"
|
||||
/>
|
||||
</div>
|
||||
@@ -73,7 +70,7 @@ function PresetRow({ preset, onChange, onDelete }: PresetRowProps) {
|
||||
max={24}
|
||||
step={0.5}
|
||||
onChange={(e) => update("hoursPerDay", parseFloat(e.target.value) || 0)}
|
||||
className={INPUT_CLS}
|
||||
className="app-input"
|
||||
aria-label="Hours per day"
|
||||
/>
|
||||
</div>
|
||||
@@ -87,7 +84,7 @@ function PresetRow({ preset, onChange, onDelete }: PresetRowProps) {
|
||||
min={1}
|
||||
max={20}
|
||||
onChange={(e) => update("headcount", parseInt(e.target.value, 10) || 1)}
|
||||
className={INPUT_CLS}
|
||||
className="app-input"
|
||||
aria-label="Headcount"
|
||||
/>
|
||||
</div>
|
||||
@@ -96,7 +93,7 @@ function PresetRow({ preset, onChange, onDelete }: PresetRowProps) {
|
||||
<button
|
||||
type="button"
|
||||
onClick={onDelete}
|
||||
className={`${BTN_DANGER} self-end mb-0.5`}
|
||||
className="app-action-danger-btn self-end mb-0.5"
|
||||
aria-label="Remove preset"
|
||||
>
|
||||
×
|
||||
@@ -119,7 +116,7 @@ function PresetRow({ preset, onChange, onDelete }: PresetRowProps) {
|
||||
)
|
||||
}
|
||||
placeholder="e.g. Compositing, Art Direction"
|
||||
className={`${INPUT_CLS} w-full mt-0.5`}
|
||||
className="app-input mt-0.5"
|
||||
aria-label="Preferred skills"
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user