@seanyeh77/ui 0.18.0 → 0.19.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
@@ -5223,8 +5223,16 @@ html.ui-theme-fade * {
5223
5223
  margin-bottom: var(--space-3);
5224
5224
  }
5225
5225
  .ui-lg-bar {
5226
+ align-items: center;
5227
+ flex-wrap: wrap;
5228
+ gap: var(--space-2);
5229
+ }
5230
+ /* The page's own controls at the left of the row, 「圖/清單」 at the right. */
5231
+ .ui-lg-toolbar {
5232
+ display: flex;
5226
5233
  align-items: center;
5227
5234
  gap: var(--space-2);
5235
+ margin-right: auto;
5228
5236
  }
5229
5237
  /* The line-label switch and its text, beside 「圖/清單」: the whole row is the 48 px target. */
5230
5238
  .ui-lg-labels-switch {
@@ -6102,10 +6110,39 @@ html.ui-theme-fade * {
6102
6110
  .ui-sec + .ui-sec {
6103
6111
  border-top: 1px solid var(--line);
6104
6112
  }
6113
+ .ui-sec {
6114
+ container-type: inline-size;
6115
+ }
6116
+ .ui-sec-row {
6117
+ display: flex;
6118
+ align-items: center;
6119
+ gap: var(--space-2);
6120
+ }
6105
6121
  .ui-sec-h {
6122
+ flex: 1 1 auto;
6123
+ min-width: 0;
6106
6124
  margin: 0;
6107
6125
  font: inherit;
6108
6126
  }
6127
+ /* Actions right of the summary, outside the button: a click there does not open or close the section. */
6128
+ .ui-sec-actions {
6129
+ flex: none;
6130
+ display: flex;
6131
+ align-items: center;
6132
+ gap: var(--space-1);
6133
+ }
6134
+ /* AY: under 480 px the summary goes under the title, whole, lined up with it. */
6135
+ @container (max-width: 479px) {
6136
+ .ui-sec-btn {
6137
+ flex-wrap: wrap;
6138
+ row-gap: 0;
6139
+ }
6140
+ .ui-sec-sum {
6141
+ flex-basis: 100%;
6142
+ padding-left: 26px;
6143
+ white-space: normal;
6144
+ }
6145
+ }
6109
6146
  .ui-sec-btn {
6110
6147
  display: flex;
6111
6148
  align-items: center;
@@ -6302,6 +6339,101 @@ html.ui-theme-fade * {
6302
6339
  white-space: nowrap;
6303
6340
  }
6304
6341
 
6342
+ /* DA: a <details> block in Markdown: the summary is a button with a caret; closed content stays findable. */
6343
+ .ui-md-details {
6344
+ margin: 0 0 var(--space-3);
6345
+ }
6346
+ .ui-md-summary {
6347
+ display: flex;
6348
+ align-items: center;
6349
+ gap: 6px;
6350
+ min-height: 40px;
6351
+ padding: 0;
6352
+ border: 0;
6353
+ border-radius: var(--radius-sm);
6354
+ background: none;
6355
+ color: var(--ink);
6356
+ font: inherit;
6357
+ font-weight: 600;
6358
+ text-align: left;
6359
+ cursor: pointer;
6360
+ }
6361
+ .ui-md-caret {
6362
+ flex: none;
6363
+ color: var(--ink-muted);
6364
+ transition: transform 260ms ease;
6365
+ }
6366
+ .ui-md-details.is-open .ui-md-caret {
6367
+ transform: rotate(90deg);
6368
+ }
6369
+ .ui-md-details-body > :last-child {
6370
+ margin-bottom: 0;
6371
+ }
6372
+ .ui-md .ui-md-alert {
6373
+ margin: 0 0 var(--space-3);
6374
+ }
6375
+ .ui-md-alert .ui-alert-body > :last-child {
6376
+ margin-bottom: 0;
6377
+ }
6378
+ /* Tables in a narrow panel: the table scrolls inside its frame; code in a cell wraps instead of widening it. */
6379
+ .ui-md-table-wrap {
6380
+ container-type: inline-size;
6381
+ }
6382
+ .ui-md-table .ui-code {
6383
+ white-space: normal;
6384
+ overflow-wrap: anywhere;
6385
+ }
6386
+ .ui-md-table td:has(.ui-code) {
6387
+ min-width: 14em;
6388
+ }
6389
+ /* TB: under 480 px each row is a card: the column name above each value, rows divided by a line. */
6390
+ @container (max-width: 479px) {
6391
+ .ui-md-table,
6392
+ .ui-md-table tbody,
6393
+ .ui-md-table tr,
6394
+ .ui-md-table td {
6395
+ display: block;
6396
+ min-width: 0;
6397
+ }
6398
+ .ui-md-table thead {
6399
+ position: absolute;
6400
+ width: 1px;
6401
+ height: 1px;
6402
+ overflow: hidden;
6403
+ clip-path: inset(50%);
6404
+ }
6405
+ .ui-md-table tr {
6406
+ padding: var(--space-2) var(--space-3);
6407
+ border-bottom: 1px solid var(--line);
6408
+ }
6409
+ .ui-md-table tbody tr:last-child {
6410
+ border-bottom: 0;
6411
+ }
6412
+ .ui-md-table tbody tr:nth-child(even) {
6413
+ background: none;
6414
+ }
6415
+ .ui-md-table td,
6416
+ .ui-md-table td:has(.ui-code) {
6417
+ min-width: 0;
6418
+ padding: var(--space-1) 0;
6419
+ border: 0;
6420
+ text-align: left !important;
6421
+ }
6422
+ .ui-md-table td::before {
6423
+ content: attr(data-label);
6424
+ display: block;
6425
+ color: var(--ink-muted);
6426
+ font-family: var(--font-sans);
6427
+ font-size: 13px;
6428
+ line-height: 20px;
6429
+ }
6430
+ }
6431
+ /* Headings of Markdown inside a Section stay under the section's 20 px title. */
6432
+ .ui-sec-content .ui-md h4.ui-md-h {
6433
+ font-size: 16px;
6434
+ line-height: 24px;
6435
+ }
6436
+
6305
6437
  /* DetailList labelWidth="auto": the label column as wide as the longest label (at most 40 %), on every row. */
6306
6438
  .ui-dl.is-auto {
6307
6439
  display: grid;
@@ -7,10 +7,10 @@
7
7
  - 值可以放任何元素:`UI.InlineCode` 連結、`UI.Tag`、`UI.Badge`。
8
8
  - 寬面板(例如 1300 px 的側邊面板):設 `labelWidth: 'auto'` 與 `labelSize: 'body'`。左欄寬度依最長的名稱(最多 40%),每列對齊,名稱和值隔 24 px;名稱改成和值同字級(16 px)、ink 色。600 px 以下仍是名稱在上、值在下,名稱 13 px。
9
9
 
10
- | Prop | 說明 |
11
- |---|---|
10
+ | Prop | 說明 |
11
+ | ------------ | ------------------------------------------------------------------------ |
12
12
  | `labelWidth` | 左欄寬度。預設 30%(至少 96 px);`'auto'` 依最長的名稱;數字是固定 px。 |
13
- | `labelSize` | `'small'`(預設)13 px 次要色;`'body'` 與值同字級、ink 色。 |
13
+ | `labelSize` | `'small'`(預設)13 px 次要色;`'body'` 與值同字級、ink 色。 |
14
14
 
15
15
  ```js
16
16
  h(UI.DetailList, {
@@ -20,6 +20,7 @@
20
20
  - 線上的文字預設全部顯示。「圖/清單」左邊有一個開關(Switch),旁邊寫「線上文字」(英文 Line labels):開著時全部顯示,關掉改成滑過才顯示。點旁邊的文字也會切換;整排至少 48 px 高。畫面上看開關就知道狀態,手機沒有提示框也不會把名稱讀成動作。需要更精簡的工具列時給 `labelToggle="icon"`,改用原本的標籤圖示按鈕(40 px,沒有外框):切換按鈕,名稱固定「顯示線上文字」,按下時(強調淺底、實心圖示,`aria-pressed="true"`)表示正在顯示。只有圖上有推測或宣告的線時才出現,切到清單時隱藏;`labelToggle={false}` 拿掉它。使用者的選擇記在 `localStorage`(鍵名 `ui-lg-labels:` 加 `scrollKey`,預設是方框的 id),下次開同一張圖時維持;讀寫失敗時照常切換,只是不記住。`edgeLabels` 是一開始的狀態:給 `edgeLabels="hover"` 時一開始隱藏,滑鼠移到線或標籤上、用鍵盤移到線上(需要 `onSelectEdge`)、選到這條線,或選到它兩端的方框時,才顯示那一條的標籤。標籤的位置照樣保留,顯示時不會推動版面。沒有 `onSelectEdge` 時,線只能滑過,不能點也不能用鍵盤移到;觸控螢幕沒有滑過,要看標籤就選方框,或給 `onSelectEdge` 讓線可以點。螢幕閱讀器照樣念出每條線的標籤。
21
21
  - 手機上圖比外框寬時(改成左右捲動),一開始捲到方框的最左邊(左側只有標籤的空白不算),最左邊的方框完整看得到;一開始就有選取的方框時捲到那個方框。之後選取的方框不在畫面內時,捲到剛好看得到它。回到同一張圖時維持上次捲動的位置。
22
22
  - 短標籤(`tag`,例如「可修改」「受保護」):在名稱右邊同一行,12 px、次要文字色的小標籤。方框變窄時名稱先用「…」截斷,標籤一定完整,所以只寫幾個字。窄到有名稱只剩不到 8 個字時(例如手機),整張圖的標籤都改到名稱下一行,方框從 60 px 加高到 76 px,名稱可以用整個寬度。`tagTone: 'warning'` 改用 warning 文字色與淺底,前面加鎖頭圖示,用在不能改的項目。清單也在名稱後面顯示標籤,螢幕閱讀器念「名稱 標籤 大小」。不要把標示接在 `name` 後面:方框變窄時會和名稱一起被截掉。
23
+ - `toolbar`:頁面自己的控制項(例如「依元件/依檔案」Tabs),放在「圖/清單」同一列的左邊,兩個開關不會分在兩列。窄寬度時這一列換行。
23
24
  - 「圖/清單」切換(右上角,`listView={false}` 關掉):清單列出每個方框(名稱,大小)和每條線(「A → B:標籤」),可以點,點了和點方框或線一樣選取。線的整行都是按鈕,畫面寫「A → B:說明」,念「A 到 B:說明」,同起訖的幾條線各有不同的名稱。每一條關係都能選,包括連到共用項目、圖上沒有畫成線的那些:有 `onSelectEdge` 時點一下、Enter 或空白鍵都會呼叫它,和點圖上的線一樣;選中的那一行 `aria-pressed="true"`、淺色底,再按一次取消。方框名稱有底線,說明是一般文字色。標題預設「項目」和「關係」(`listLabels`)。切回圖時保持選取。
24
25
  - 捲動位置會記住:同一張圖(`scrollKey`,預設是方框的 id)切到別的區塊或清單再回來,回到上次的位置。
25
26
  - 螢幕閱讀器:方框是按鈕,念名稱和大小;可以選的線也是按鈕,放在 `role="group"`(不是圖片)裡,念「起點 到 終點,標籤」(不用「→」:螢幕閱讀器會念成「右箭頭」或略過);畫面上的標籤不重複念。
package/docs/Markdown.md CHANGED
@@ -5,13 +5,15 @@
5
5
  - 支援:段落與換行、標題、粗體、斜體、行內程式碼(`UI.InlineCode`)、程式碼區塊(`UI.CodeView`,依語言上色;32 px 的矮標題列只有語言名稱和複製的小圖示,沒有分隔線也沒有行號,程式碼左右留 16 px)、連結、項目與編號清單(可巢狀)、引用、表格、水平線。圖片只顯示替代文字,不載入。
6
6
  - 標題降級:`#` 顯示成 h4(20 px),`##` 是 h5,`###` 以下是 h6(兩者都是 16 px 粗體)。用 `topLevel` 改 `#` 對應的層級。
7
7
  - 字級:正文和周圍文字同字級(16 px);`size="small"` 是 13 px,給註記用。
8
- - 表格:灰底粗體表頭、斑馬紋加格線;全是數字的欄自動靠右、等寬數字。比容器寬時左右捲動。
8
+ - 表格:灰底粗體表頭(不換行)、斑馬紋加格線;全是數字的欄自動靠右、等寬數字,或依 GFM 的 `---:` 對齊。比容器寬時在表格框裡左右捲動(可以 Tab 到表格再用方向鍵),不會撐開面板;格子裡的行內程式碼換行,不撐寬欄位。表格寬度不到 480 px 時每列變成一張卡片:欄名在上、值在下,列與列之間一條線。
9
+ - 可收合的區塊:`<details><summary>另有 49 處呼叫</summary> … </details>`,和 GitHub 的寫法相同,複製到 GitHub、Notion 也能收合。一開始收合;標題列是按鈕,有 `aria-expanded`,Enter 與空白鍵切換。收合的內容留在頁面上,頁內搜尋(Ctrl+F)找到時自動展開,和 Section 一樣。`<details>` 和 `<summary>` 的屬性一律去掉(`open` 也是)。
10
+ - 提示框:GitHub 的 `> [!NOTE]`、`[!TIP]`、`[!IMPORTANT]`、`[!WARNING]`、`[!CAUTION]` 用 `UI.Alert` 顯示(info、success、info、warning、danger)。一般的 `>` 仍是引用:左邊一條線、次要文字色。
9
11
  - 換行:同一段裡的換行接成空格,中文字或全形標點旁邊不加空格;行尾兩個空格或反斜線是強制換行。
10
12
 
11
13
  ## 安全
12
14
 
13
- - 不執行任何 HTML。原文裡的 HTML 標籤與註解直接去掉,只留標籤之間的文字(`<details>評分細節</details>` 顯示成「評分細節」)。
14
- - 連結只允許 http、https、mailto 與相對路徑;`javascript:`、`data:` 等其他網址只顯示文字。
15
+ - 不執行任何 HTML。原文裡的 HTML 標籤與註解直接去掉,只留標籤之間的文字(`<b>粗</b>` 顯示成「粗」)。唯一的例外是 `<details>` 與 `<summary>`,屬性一律去掉。
16
+ - 連結只允許 http、https、mailto 與相對路徑;其他網址只顯示文字。`schemes` 列出的自訂 scheme(例如 `fn:`)交給 `linkHref` 與 `onLink` 決定;`javascript:`、`data:`、`vbscript:` 列在裡面也一律擋掉。
15
17
 
16
18
  ## 連結與路徑
17
19
 
@@ -38,6 +40,7 @@ h(
38
40
 
39
41
  - 行內程式碼是路徑(有資料夾的檔名 `docs/a.md`,或檔名加行號 `routing.py:108`)時走 `refHref`、`onRef`,和 CodeView、CodeText 一致;`make` 這類一般程式碼不是連結。程式碼區塊裡註解與字串中的路徑也一樣。
40
42
  - 沒有給 `linkHref` 時連結照原網址;外部網址在新分頁開啟。
43
+ - 自訂 scheme:`schemes={['fn']}` 之後,`[_sync_as](fn:harness/controller.py:VirtualRouter._sync_as)` 原樣交給 `linkHref` 與 `onLink`;`linkHref` 沒有回傳網址、也沒有 `onLink` 時只顯示文字。
41
44
 
42
45
  ## inline
43
46
 
@@ -53,3 +56,66 @@ CodeView 不內建預覽:由使用的地方在面板上方放 `UI.Tabs`(「
53
56
 
54
57
  - 預覽沒有行號。連到某一行的位置(`README.md:12`、CodeView 的 `target`)時,切回「原始碼」分頁再捲到那一行。
55
58
  - 預覽裡的連結和路徑交給同一組 `onLink`、`onRef`,例如在側邊面板開啟另一個檔案。
59
+
60
+ ## 標題層級與 topLevel
61
+
62
+ `topLevel` 是 `#` 對應的 HTML 層級:`#` 是 h`topLevel`,`##` 再低一層,依此類推(最多 h6)。預設 4。
63
+
64
+ | 放在哪裡 | 原文的最高標題 | `topLevel` | 結果 |
65
+ |---|---|---|---|
66
+ | 頁面裡、h2 或 h3 底下 | `#` | 4(預設) | `#` 是 h4 |
67
+ | Section 裡(Section 標題是 h3) | `#` | 4 | `#` 是 h4 |
68
+ | Section 裡,原文從 `###` 開始寫 | `###` | 2 | `###` 是 h4 |
69
+
70
+ - 大小跟著層級:h4 20 px,h5、h6 16 px 粗體。在 Section 裡,h4 改成 16 px 粗體,不比 Section 的 20 px 標題大。
71
+
72
+ ## 範例:用 Markdown 顯示一份結構化報告
73
+
74
+ ```js
75
+ var report = [
76
+ '### harness/controller.py(可修改)',
77
+ '',
78
+ '| 指令 | 位置 | namespace | 逾時 |',
79
+ '|---|---|---|---|',
80
+ '| `ip netns exec l3-r1 ip -j route` | [`_sync_as`](fn:harness/controller.py:VirtualRouter._sync_as) `harness/controller.py:540` | l3-r1 | 5 秒 |',
81
+ '',
82
+ '<details><summary>另有 49 處呼叫</summary>',
83
+ '',
84
+ '| 指令 | 位置 |',
85
+ '|---|---|',
86
+ '| `ovs-vsctl show` | `harness/runtime.py:88` |',
87
+ '',
88
+ '</details>',
89
+ '',
90
+ '> [!WARNING]',
91
+ '> 3 個指令沒有設逾時。',
92
+ ].join('\n');
93
+
94
+ h(UI.Markdown, {
95
+ topLevel: 2,
96
+ schemes: ['fn'],
97
+ linkHref: function (href) { return href.startsWith('fn:') ? '#flow=' + encodeURIComponent(href.slice(3)) : href; },
98
+ refHref: function (ref) { return '#code=' + encodeURIComponent(ref); },
99
+ }, report);
100
+ ```
101
+
102
+ 畫面就是這份文字;「複製成 Markdown」直接複製 `report`,貼到 GitHub 或 Notion 時表格、收合區塊、提示框都還在。
103
+
104
+ ## 範例:Section 裡放 Markdown
105
+
106
+ ```js
107
+ h(UI.SectionGroup, null,
108
+ h(UI.Section, {
109
+ id: 'external',
110
+ title: '外部指令',
111
+ summary: '29 個指令、4 個 namespace、3 個沒有逾時',
112
+ defaultOpen: true,
113
+ actions: h(UI.IconButton, { icon: 'copy', label: '複製這一段', onClick: function () { navigator.clipboard.writeText(report); } }),
114
+ },
115
+ h(UI.Markdown, { topLevel: 2, schemes: ['fn'], linkHref: linkHref, refHref: refHref }, report),
116
+ ),
117
+ );
118
+ ```
119
+
120
+ - `report` 從 `###` 開始寫,所以 `topLevel: 2`,`###` 成為 h4,在 Section 的 h3 標題底下。
121
+ - 「複製這一段」放在 Section 的 `actions`,點它不會開合段落。
package/docs/Section.md CHANGED
@@ -8,30 +8,30 @@
8
8
  - 摘要是按鈕的一部分,會跟著標題念出來;不要放連結或按鈕。
9
9
 
10
10
  ```js
11
- h(UI.Section, { id: 'external', title: '外部指令', summary: '29 個指令、4 個 namespace、3 個沒有逾時', lazy: true },
12
- h(UI.DataTable, { /* … */ }),
13
- );
11
+ h(UI.Section, { id: 'external', title: '外部指令', summary: '29 個指令、4 個 namespace、3 個沒有逾時', lazy: true }, h(UI.DataTable, {/* … */}));
14
12
  ```
15
13
 
16
14
  ## Props
17
15
 
18
- | Prop | 說明 |
19
- |---|---|
20
- | `title` | 段落標題。 |
21
- | `summary` | 標題右邊的一行重點,收合時也顯示。可放 ReactNode,但不放互動元素。 |
22
- | `defaultOpen` | 不受控:一開始是否展開,預設 `false`。有記住的狀態(`storageKey`)時以記住的為準。 |
23
- | `open`、`onOpenChange` | 受控用法。點標題、網址跳到這段、「全部展開/全部收合」都會呼叫 `onOpenChange`。 |
24
- | `id` | 錨點。網址 hash 是這個 id(載入時,或點了頁內的 `#id` 連結)時自動展開,並捲到標題。 |
25
- | `lazy` | 收合時完全不渲染內容。預設 `false`:內容留在頁面上但隱藏(`hidden="until-found"`),瀏覽器的頁內搜尋(Ctrl+F)找到裡面的字時自動展開。很長的段落(例如上百筆的表格)再設 `lazy`。 |
26
- | `storageKey` | 用這個 key 把開合狀態存在 localStorage(`ui-section:<key>`)。讀寫失敗時照常運作,只是不記住。 |
27
- | `level` | 標題的 heading 層級,預設 3。 |
16
+ | Prop | 說明 |
17
+ | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
18
+ | `title` | 段落標題。 |
19
+ | `summary` | 標題右邊的一行重點,收合時也顯示。可放 ReactNode,但不放互動元素。 |
20
+ | `defaultOpen` | 不受控:一開始是否展開,預設 `false`。有記住的狀態(`storageKey`)時以記住的為準。 |
21
+ | `open`、`onOpenChange` | 受控用法。點標題、網址跳到這段、「全部展開/全部收合」都會呼叫 `onOpenChange`。 |
22
+ | `id` | 錨點。網址 hash 是這個 id(載入時,或點了頁內的 `#id` 連結)時自動展開,並捲到標題。 |
23
+ | `lazy` | 收合時完全不渲染內容。預設 `false`:內容留在頁面上但隱藏(`hidden="until-found"`),瀏覽器的頁內搜尋(Ctrl+F)找到裡面的字時自動展開。很長的段落(例如上百筆的表格)再設 `lazy`。 |
24
+ | `storageKey` | 用這個 key 把開合狀態存在 localStorage(`ui-section:<key>`)。讀寫失敗時照常運作,只是不記住。 |
25
+ | `level` | 標題的 heading 層級,預設 3。 |
28
26
 
29
27
  ## SectionGroup
30
28
 
31
29
  一組 Section,上方右側有「全部展開」與「全部收合」兩個按鈕,各帶圖示;全部已展開時「全部展開」停用,全部已收合時「全部收合」停用。
32
30
 
33
31
  ```js
34
- h(UI.SectionGroup, { actions: h(UI.Button, { icon: 'link' }, '複製連結') },
32
+ h(
33
+ UI.SectionGroup,
34
+ { actions: h(UI.Button, { icon: 'link' }, '複製連結') },
35
35
  h(UI.Section, { title: '元件', summary: '6 個元件、138 個函式', defaultOpen: true }, '…'),
36
36
  h(UI.Section, { title: '進入與結束', summary: '2 個進入點', defaultOpen: true }, '…'),
37
37
  h(UI.Section, { title: '外部指令', summary: '29 個指令', lazy: true }, '…'),
@@ -222,7 +222,7 @@
222
222
 
223
223
  - 一個項目的詳細欄位用 `DetailList`:寬度 600 px 以上時欄位名稱在左、值在右;比較窄時名稱在上、值在下,和手機表格卡片一致。寬面板(約 1300 px)用 `labelWidth: 'auto'`(左欄依最長的名稱)與 `labelSize: 'body'`(名稱和值同字級、ink 色)。
224
224
  - 可以收合的段落用 `Section`:標題 20 px 粗體,左邊箭頭,右邊同一行一行次要色的重點摘要(收合時也顯示);段落之間一條細線;展開與收合 260 ms。收合的內容留在頁面上,頁內搜尋找到時自動展開;很長的段落設 `lazy`。一組段落用 `SectionGroup`,上方右側有帶圖示的「全部展開」「全部收合」。
225
- - 專案文件與程式註解的 Markdown 用 `Markdown`:正文 16 px,`#` 顯示成 h4;不執行 HTML,標籤去掉只留文字;程式碼區塊是 CodeView,右上有複製的小圖示;.md 檔的「原始碼/預覽」由頁面放 Tabs 切換。
225
+ - 專案文件與程式註解的 Markdown 用 `Markdown`:正文 16 px,`#` 顯示成 h4;不執行 HTML,標籤去掉只留文字;程式碼區塊是 CodeView,右上有複製的小圖示;.md 檔的「原始碼/預覽」由頁面放 Tabs 切換。可收合的長清單用 `<details><summary>`;提示用 `> [!NOTE]` 這類 GitHub 提示框(Alert),一般 `>` 是引用。表格比面板寬時在表格內捲動,不到 480 px 時每列一張卡片。Section 的 `actions` 放「複製」這類按鈕;Section 不到 480 px 時摘要移到標題下一行。
226
226
  - 卡片上的多個操作用 `ActionBar`:寬度小於 600 px 時,最常用的一個是全寬的主要按鈕,其他收進右邊的「⋯」選單;比較寬時並排。
227
227
 
228
228
  ## 文字語氣
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seanyeh77/ui",
3
- "version": "0.18.0",
3
+ "version": "0.19.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.18.0"
52
+ "@seanyeh77/tokens": "^0.19.0"
53
53
  },
54
54
  "dependencies": {
55
55
  "@base-ui/react": "^1.9.0"