diff --git a/.agents/skills/ui-consistency/SKILL.md b/.agents/skills/ui-consistency/SKILL.md index 1df0d23..cea8f8e 100644 --- a/.agents/skills/ui-consistency/SKILL.md +++ b/.agents/skills/ui-consistency/SKILL.md @@ -781,7 +781,38 @@ import { SearchableSelect } from "@/Components/ui/searchable-select"; - **Select / SearchableSelect**: 必須確保 Trigger 按鈕高度為 `h-9` - **禁止使用**: 除非有特殊設計需求,否則避免使用 `h-10` (40px) 或其他非標準高度。 -## 11.6 日期顯示規範 (Date Display) +## 11.6 數字輸入框規範 (Numeric Inputs) + +當需求為輸入**整數**數量(例如:實際產出數量、標準產出量)時,**嚴禁自行開發組合 `Plus` (+) 與 `Minus` (-) 按鈕的複合元件**。 + +**必須使用原生 HTML5 數字輸入與屬性**: +1. 使用 `` 確保預設渲染瀏覽器原生的上下調整小箭頭 (Spinner)。 +2. 針對整數需求,固定加上 `step="1"` 屬性。 +3. 視需求加上 `min` 與 `max` 控制上下限。 + +這樣既能保持與現有「新增配方」等模組的「標準產出量」欄位行為高度一致,亦能維持畫面的極簡風格。 + +```tsx +// ✅ 正確:依賴原生行為 + setActualOutputQuantity(e.target.value)} + className="h-9 w-24 text-center" +/> + +// ❌ 錯誤:過度設計、浪費空間與破壞一致性 +