From 05aa864359acef0363aca8e055e5f1191b41ee95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hartmut=20N=C3=B6renberg?= Date: Fri, 10 Apr 2026 09:21:03 +0200 Subject: [PATCH] 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 --- .../blueprints/BlueprintFieldCatalog.tsx | 10 +-- .../blueprints/BlueprintFieldEditor.tsx | 24 +++--- .../blueprints/BlueprintsClient.tsx | 8 +- .../src/components/blueprints/FieldCard.tsx | 18 ++--- .../blueprints/RolePresetsEditor.tsx | 15 ++-- .../components/estimates/EstimateWizard.tsx | 75 +++++++++---------- .../EstimateWorkspaceDraftEditor.tsx | 23 +++--- .../estimates/editors/AssumptionEditor.tsx | 27 +++---- .../estimates/editors/DemandLineEditor.tsx | 39 +++++----- .../estimates/editors/ScopeItemEditor.tsx | 23 +++--- .../projects/ProjectAssignmentsTable.tsx | 4 +- .../src/components/projects/ProjectWizard.tsx | 62 +++++++-------- .../components/resources/BulkEditModal.tsx | 14 ++-- .../components/ui/CustomFieldFilterBar.tsx | 12 ++- .../vacations/HolidayCalendarEditor.tsx | 2 +- 15 files changed, 159 insertions(+), 197 deletions(-) diff --git a/apps/web/src/components/blueprints/BlueprintFieldCatalog.tsx b/apps/web/src/components/blueprints/BlueprintFieldCatalog.tsx index 192d8d5..f078800 100644 --- a/apps/web/src/components/blueprints/BlueprintFieldCatalog.tsx +++ b/apps/web/src/components/blueprints/BlueprintFieldCatalog.tsx @@ -18,8 +18,6 @@ import type { CatalogField } from "~/lib/blueprint-field-catalog.js"; // Styles // --------------------------------------------------------------------------- -const INPUT_CLS = "app-input"; - const BTN_PRIMARY = "px-4 py-2 bg-brand-600 text-white rounded-lg hover:bg-brand-700 text-sm font-medium disabled:opacity-50"; @@ -496,7 +494,7 @@ export function BlueprintFieldCatalog({ value={searchQuery} onChange={(e) => setSearchQuery(e.target.value)} placeholder="Search fields..." - className={`${INPUT_CLS} w-full`} + className="app-input" autoFocus /> @@ -636,7 +634,7 @@ export function BlueprintFieldCatalog({ ) } placeholder="field_key" - className={`${INPUT_CLS} font-mono`} + className="app-input font-mono" />
@@ -651,7 +649,7 @@ export function BlueprintFieldCatalog({ setCustomLabel(e.target.value) } placeholder="Display Label" - className={INPUT_CLS} + className="app-input" />
@@ -665,7 +663,7 @@ export function BlueprintFieldCatalog({ e.target.value as FieldType, ) } - className={INPUT_CLS} + className="app-input" > {FIELD_TYPES.map((ft) => (
@@ -232,7 +228,7 @@ function FieldRow({ field, onChange, onDelete }: FieldRowProps) { update("placeholder", e.target.value || undefined) } placeholder="Placeholder text" - className={INPUT_CLS} + className="app-input" />
@@ -246,7 +242,7 @@ function FieldRow({ field, onChange, onDelete }: FieldRowProps) { update("description", e.target.value || undefined) } placeholder="Helper text" - className={INPUT_CLS} + className="app-input" />
diff --git a/apps/web/src/components/blueprints/BlueprintsClient.tsx b/apps/web/src/components/blueprints/BlueprintsClient.tsx index a80e4db..5488b63 100644 --- a/apps/web/src/components/blueprints/BlueprintsClient.tsx +++ b/apps/web/src/components/blueprints/BlueprintsClient.tsx @@ -14,8 +14,6 @@ import { SortableColumnHeader } from "~/components/ui/SortableColumnHeader.js"; import { useTableSort } from "~/hooks/useTableSort.js"; import { useViewPrefs } from "~/hooks/useViewPrefs.js"; -const INPUT_CLS = "app-input"; - const BTN_PRIMARY = "px-4 py-2 bg-brand-600 text-white rounded-lg hover:bg-brand-700 text-sm font-medium disabled:opacity-50"; @@ -75,15 +73,15 @@ function NewBlueprintModal({ onClose, onCreated }: NewBlueprintModalProps) {
- setName(e.target.value)} placeholder="e.g. Resource Extended Fields" className={INPUT_CLS} autoFocus /> + setName(e.target.value)} placeholder="e.g. Resource Extended Fields" className="app-input" autoFocus />
-