fix(ui): comprehensive dark-theme hardcoded color pass
Phase 1 — globals.css: add ~45 new dark-mode override rules covering 250+ component instances at once: - bg-*-50 (red/green/blue/yellow/amber/purple/indigo/orange/brand/emerald) - border-*-200 (colored alert/badge borders) - hover:bg-*-50/100 (colored hover states) - text-amber-700/orange-600/green-600/emerald-700/brand-700 (missing overrides) - divide-gray-50 (ChargeabilityWidget sticky section dividers) Phase 2 — targeted component fixes: - Button.tsx: add dark variants to secondary (bg-gray-800) and ghost variants - DynamicFieldEditor.tsx: add dark variants to INPUT_NORMAL and INPUT_ERROR constants - WidgetContainer.tsx: replace slate-900 (blue-tinted) gradient with neutral surface-card values (rgb 22,23,26 / 16,17,19) - status-styles.ts: add explicit dark variants to PROJECT_STATUS_BADGE and ORDER_TYPE_BADGE (consistent with other badge maps in same file) Phase 3 — dashboard widget tables: - TopValueWidget: dark thead, tbody divider, row hover - DemandWidget: dark thead, tbody divider, row hover - ChargeabilityWidget: dark sticky h3 headers (bg-white→surface-card), border-gray-100 thead rows, divide-gray-50 tbodys Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -30,7 +30,7 @@ export function WidgetContainer({
|
||||
className={`flex flex-col h-full rounded-xl border overflow-hidden transition-all duration-200 ${
|
||||
isDragging
|
||||
? "shadow-xl border-brand-400 dark:border-brand-500 scale-[1.01] ring-2 ring-brand-400/30"
|
||||
: "border-gray-200/80 bg-[linear-gradient(180deg,rgba(248,250,252,0.95),rgba(255,255,255,0.98))] shadow-sm hover:shadow-md hover:border-gray-300 dark:border-gray-700/60 dark:bg-[linear-gradient(180deg,rgba(17,24,39,0.96),rgba(17,24,39,0.92))] dark:hover:border-gray-600"
|
||||
: "border-gray-200/80 bg-[linear-gradient(180deg,rgba(250,250,251,0.95),rgba(255,255,255,0.98))] shadow-sm hover:shadow-md hover:border-gray-300 dark:border-gray-700/60 dark:bg-[linear-gradient(180deg,rgba(22,23,26,0.97),rgba(16,17,19,0.95))] dark:hover:border-gray-600"
|
||||
}`}
|
||||
>
|
||||
<div className="flex items-start justify-between gap-3 px-4 pt-3.5 pb-3 shrink-0 widget-drag-handle group">
|
||||
|
||||
@@ -413,7 +413,7 @@ export function ChargeabilityWidget({ config: _config, onConfigChange }: WidgetP
|
||||
handleSectionScroll(event, topVisibleCount, top.length, setTopVisibleCount)
|
||||
}
|
||||
>
|
||||
<h3 className="text-xs font-semibold text-gray-500 uppercase tracking-wider px-1 mb-1 sticky top-0 bg-white flex items-center">
|
||||
<h3 className="text-xs font-semibold text-gray-500 uppercase tracking-wider px-1 mb-1 sticky top-0 bg-white dark:bg-[rgb(var(--surface-card))] flex items-center">
|
||||
Top Chargeability
|
||||
<InfoTooltip content="Resources ranked by highest actual chargeability this month. Chargeability = chargeable booked hours divided by holiday- and absence-adjusted available hours." />
|
||||
<span className="ml-1 font-normal normal-case text-gray-400">
|
||||
@@ -425,7 +425,7 @@ export function ChargeabilityWidget({ config: _config, onConfigChange }: WidgetP
|
||||
) : (
|
||||
<table className="w-full text-xs">
|
||||
<thead>
|
||||
<tr className="text-gray-400 border-b border-gray-100">
|
||||
<tr className="text-gray-400 border-b border-gray-100 dark:border-gray-800">
|
||||
<th className="px-2 py-1 text-left font-medium w-6">#</th>
|
||||
<th className="px-2 py-1 text-left font-medium">
|
||||
<button
|
||||
@@ -471,7 +471,7 @@ export function ChargeabilityWidget({ config: _config, onConfigChange }: WidgetP
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className="divide-y divide-gray-50">
|
||||
<tbody className="divide-y divide-gray-50 dark:divide-gray-800">
|
||||
{visibleTop.map((r, i) => (
|
||||
<tr key={r.id} className="hover:bg-gray-50 dark:hover:bg-gray-800/40">
|
||||
<td className="px-2 py-1 text-gray-400">{i + 1}</td>
|
||||
@@ -519,7 +519,7 @@ export function ChargeabilityWidget({ config: _config, onConfigChange }: WidgetP
|
||||
handleSectionScroll(event, watchVisibleCount, watchlist.length, setWatchVisibleCount)
|
||||
}
|
||||
>
|
||||
<h3 className="text-xs font-semibold text-gray-500 uppercase tracking-wider px-1 mb-1 sticky top-0 bg-white flex items-center">
|
||||
<h3 className="text-xs font-semibold text-gray-500 uppercase tracking-wider px-1 mb-1 sticky top-0 bg-white dark:bg-[rgb(var(--surface-card))] flex items-center">
|
||||
Watchlist <span className="font-normal text-gray-400">(below target)</span>
|
||||
<InfoTooltip content="Resources whose actual chargeability is more than 15 percentage points below their individual target. These may need more project assignments." />
|
||||
<span className="ml-1 font-normal normal-case text-gray-400">
|
||||
@@ -531,7 +531,7 @@ export function ChargeabilityWidget({ config: _config, onConfigChange }: WidgetP
|
||||
) : (
|
||||
<table className="w-full text-xs">
|
||||
<thead>
|
||||
<tr className="text-gray-400 border-b border-gray-100">
|
||||
<tr className="text-gray-400 border-b border-gray-100 dark:border-gray-800">
|
||||
<th className="px-2 py-1 text-left font-medium">
|
||||
<button
|
||||
type="button"
|
||||
@@ -570,7 +570,7 @@ export function ChargeabilityWidget({ config: _config, onConfigChange }: WidgetP
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className="divide-y divide-gray-50">
|
||||
<tbody className="divide-y divide-gray-50 dark:divide-gray-800">
|
||||
{visibleWatchlist.map((r) => (
|
||||
<tr key={r.id} className="hover:bg-gray-50 dark:hover:bg-gray-800/40">
|
||||
<td className="px-2 py-1 text-gray-800 dark:text-gray-200 max-w-[240px] align-top">
|
||||
|
||||
@@ -147,7 +147,7 @@ export function DemandWidget({ config, onConfigChange }: WidgetProps) {
|
||||
{/* Table */}
|
||||
<div className={`overflow-auto flex-1 transition-opacity duration-150 ${isFetching ? "opacity-60" : "opacity-100"}`}>
|
||||
<table className="w-full text-xs">
|
||||
<thead className="bg-gray-50 sticky top-0">
|
||||
<thead className="bg-gray-50 dark:bg-gray-800/50 sticky top-0">
|
||||
<tr>
|
||||
<th className="px-3 py-2 text-left font-medium text-gray-500">
|
||||
<span className="inline-flex items-center">
|
||||
@@ -198,9 +198,9 @@ export function DemandWidget({ config, onConfigChange }: WidgetProps) {
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className="divide-y divide-gray-100">
|
||||
<tbody className="divide-y divide-gray-100 dark:divide-gray-800">
|
||||
{sorted.map((row) => (
|
||||
<tr key={row.id} className="hover:bg-gray-50">
|
||||
<tr key={row.id} className="hover:bg-gray-50 dark:hover:bg-gray-800/30">
|
||||
<td className="px-3 py-2 text-gray-900 max-w-[280px] align-top">
|
||||
<div className="font-medium truncate">
|
||||
{groupBy === "project" ? (
|
||||
|
||||
@@ -167,7 +167,7 @@ export function TopValueWidget({ config, onConfigChange }: WidgetProps) {
|
||||
<WidgetFilterBar filters={filters} values={config} onChange={onConfigChange ?? (() => {})} />
|
||||
<div className="overflow-auto flex-1">
|
||||
<table className="w-full text-xs">
|
||||
<thead className="bg-gray-50 sticky top-0">
|
||||
<thead className="bg-gray-50 dark:bg-gray-800/50 sticky top-0">
|
||||
<tr>
|
||||
<th className="px-3 py-2 text-left font-medium text-gray-500 w-8">
|
||||
<span className="inline-flex items-center">
|
||||
@@ -226,9 +226,9 @@ export function TopValueWidget({ config, onConfigChange }: WidgetProps) {
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className="divide-y divide-gray-100">
|
||||
<tbody className="divide-y divide-gray-100 dark:divide-gray-800">
|
||||
{sorted.map((r, i) => (
|
||||
<tr key={r.id} className="hover:bg-gray-50">
|
||||
<tr key={r.id} className="hover:bg-gray-50 dark:hover:bg-gray-800/30">
|
||||
<td className="px-3 py-2 text-gray-400 font-medium">{i + 1}</td>
|
||||
<td className="px-3 py-2 font-mono text-gray-600">{r.eid}</td>
|
||||
<td className="px-3 py-2">
|
||||
|
||||
@@ -16,8 +16,8 @@ interface Props {
|
||||
const INPUT_BASE =
|
||||
"w-full px-3 py-2 border rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-brand-500 transition-colors";
|
||||
|
||||
const INPUT_NORMAL = "border-gray-300 bg-white text-gray-900";
|
||||
const INPUT_ERROR = "border-red-400 bg-red-50 text-gray-900";
|
||||
const INPUT_NORMAL = "border-gray-300 bg-white text-gray-900 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100";
|
||||
const INPUT_ERROR = "border-red-400 bg-red-50 text-gray-900 dark:border-red-500 dark:text-gray-100";
|
||||
|
||||
function inputClass(hasError: boolean) {
|
||||
return clsx(INPUT_BASE, hasError ? INPUT_ERROR : INPUT_NORMAL);
|
||||
|
||||
@@ -8,8 +8,8 @@ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
||||
|
||||
const variantClasses = {
|
||||
primary: "bg-brand-600 hover:bg-brand-700 text-white",
|
||||
secondary: "bg-white hover:bg-gray-50 text-gray-700 border border-gray-300",
|
||||
ghost: "text-gray-600 hover:bg-gray-100",
|
||||
secondary: "bg-white hover:bg-gray-50 text-gray-700 border border-gray-300 dark:bg-gray-800 dark:hover:bg-gray-700 dark:text-gray-200 dark:border-gray-600",
|
||||
ghost: "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-white/[0.06]",
|
||||
danger: "bg-red-600 hover:bg-red-700 text-white",
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user