@seanyeh77/ui 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/styles.css CHANGED
@@ -209,8 +209,9 @@ body {
209
209
  .ui-badge-draft .ui-badge-mark {
210
210
  color: var(--neutral-500);
211
211
  }
212
+ /* A glyph beside text, on the same ground: the text color of the accent, which reads on any accent (4.5:1). */
212
213
  .ui-badge-doing .ui-badge-mark {
213
- color: var(--accent);
214
+ color: var(--accent-text);
214
215
  }
215
216
  .ui-badge-review .ui-badge-mark {
216
217
  color: var(--warning);
@@ -283,6 +284,10 @@ body {
283
284
  margin-top: 1px;
284
285
  color: var(--alert-color);
285
286
  }
287
+ /* The info icon sits by its text: accent-text, so a light accent still reads; the bar above keeps the accent. */
288
+ .ui-alert-info .ui-alert-icon {
289
+ color: var(--accent-text);
290
+ }
286
291
  .ui-alert-content {
287
292
  flex: 1 1 auto;
288
293
  min-width: 0;
@@ -5,3 +5,4 @@
5
5
  - 色票:藍、靛、紫、桃紅、紅、橘、綠、青;選中的色票外圍一圈同色外框並打勾。
6
6
  - 色碼欄位:輸入 # 加 6 碼就立即套用;格式不正確時框變紅並說明。
7
7
  - 不傳 `onChange` 時會直接呼叫 `UI.setAccent()`,依 README「自訂強調色的換算」重新算出 hover、按下、淺底、文字色與 focus 光暈,並存在 localStorage。
8
+ - 文字一定讀得清楚:選了很淺(淺色主題)或很深(深色主題)的強調色時,`accent-text` 會自動加深或調亮,直到對 `bg` 與 `surface` 都有 4.5:1,例如淺色主題選 `#ffe066` 時連結、選中的分頁文字變成 `#7a6c31`。按鈕、進度條、選取框這些填色仍是選的顏色;按鈕上的字由 `on-accent` 選白色或深色。
@@ -46,7 +46,8 @@
46
46
 
47
47
  - `accent-hover`、`accent-press`:強調色混入 12% 與 22% 黑色。
48
48
  - `accent-soft`:淺色主題為白色混入 12% 強調色;深色主題為 `bg` 混入 22% 強調色。
49
- - `accent-text`:深色主題混入白色,直到對 `surface` 達 4.5:1。
49
+ - `accent-text`:強調色的文字色,對 `bg` 與 `surface` 都要至少 4.5:1。強調色本身已經達標時就等於強調色(預設 `#2457d6` 在淺色主題不變);不夠時,淺色主題混入黑色、每步 4%,深色主題混入白色、每步 5%,直到兩者都達 4.5:1。例如淺色主題 `#ffe066` → `#7a6c31`、`#c4600f` → `#b4580e`、`#0f8a85` → `#0e7f7a`;深色主題 `#1a1a6e` → `#a3a3c5`。
50
+ - 只有文字跟著換:`accent` 本身(填色、進度條、選取框、色點、線)維持使用者選的顏色。用強調色寫的文字和緊貼文字的圖示一律讀 `accent-text`,不讀 `accent`。
50
51
  - `on-accent`:白色與 `ink` 中對比較高者。
51
52
  - 語意色:飽和度跟隨強調色。
52
53
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seanyeh77/ui",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "SeanYeh's design system: typed React components on Base UI, styled with design tokens.",
5
5
  "license": "MIT",
6
6
  "author": "Hsiu-An Yeh",
@@ -49,7 +49,7 @@
49
49
  "react-dom": "^19.3.1",
50
50
  "tsdown": "^0.23.7",
51
51
  "vitest": "^5.1.0",
52
- "@seanyeh77/tokens": "^0.14.0"
52
+ "@seanyeh77/tokens": "^0.15.0"
53
53
  },
54
54
  "dependencies": {
55
55
  "@base-ui/react": "^1.9.0"