@seanyeh77/ui 0.52.0 → 0.53.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/bundle.js +1 -1
- package/dist/components/DataTable/DataTable.d.ts +3 -2
- package/dist/components/DataTable/DataTable.js +1 -0
- package/dist/components/DataTable/DataTable.js.map +1 -1
- package/dist/css/DataTable.css +6 -0
- package/dist/css/Grid.css +7 -8
- package/dist/css/SettingsLayout.css +1 -1
- package/dist/styles.css +14 -9
- package/dist/tokens.css +6 -0
- package/docs/DataTable.md +1 -1
- package/docs/Grid.md +3 -3
- package/docs/agents.md +5 -5
- package/docs/guidelines.md +2 -2
- package/docs/theme.md +1 -1
- package/package.json +2 -2
package/dist/css/DataTable.css
CHANGED
|
@@ -989,6 +989,12 @@
|
|
|
989
989
|
.ui-dt-body .ui-dt-cell.is-num {
|
|
990
990
|
white-space: normal;
|
|
991
991
|
}
|
|
992
|
+
/* A number with a second line starts at the left like every value in the card, on its name's line: the table's
|
|
993
|
+
right alignment and the stack's 6 px padding are for rows, not cards. */
|
|
994
|
+
.ui-dt-body .ui-dt-cell.is-num .ui-dt-stack {
|
|
995
|
+
align-items: flex-start;
|
|
996
|
+
padding-block: 0;
|
|
997
|
+
}
|
|
992
998
|
.ui-dt-body .ui-dt-cell[data-label]:not(.is-m-title, .is-m-status)::before {
|
|
993
999
|
content: attr(data-label);
|
|
994
1000
|
position: absolute;
|
package/dist/css/Grid.css
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
@layer theme, base, ui, components, utilities;
|
|
2
2
|
@layer ui.tokens, ui.components;
|
|
3
3
|
@layer ui.components {
|
|
4
|
+
/* Blocks stacked on a page are block-gap apart (32 px, 16 px on phones), whether a Page, the rows of a Grid or a Page
|
|
5
|
+
inside a Grid stacks them: two neighbouring blocks are always the same distance apart. */
|
|
4
6
|
.ui-page {
|
|
5
7
|
display: flex;
|
|
6
8
|
flex-direction: column;
|
|
7
|
-
gap: var(--
|
|
9
|
+
gap: var(--block-gap);
|
|
8
10
|
}
|
|
9
11
|
.ui-grid {
|
|
10
12
|
display: grid;
|
|
11
|
-
|
|
13
|
+
/* Columns 24 px apart; rows (and a Grid folded into one column) the block distance. */
|
|
14
|
+
column-gap: var(--space-6);
|
|
15
|
+
row-gap: var(--block-gap);
|
|
12
16
|
grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
|
|
13
17
|
}
|
|
14
18
|
.ui-grid.is-1 {
|
|
@@ -38,9 +42,8 @@
|
|
|
38
42
|
.ui-grid.is-start {
|
|
39
43
|
align-items: start;
|
|
40
44
|
}
|
|
41
|
-
/* A Page as one cell: several cards stacked in one column,
|
|
45
|
+
/* A Page as one cell: several cards stacked in one column, the block distance apart like every other stack. */
|
|
42
46
|
.ui-grid > .ui-page {
|
|
43
|
-
gap: var(--space-6);
|
|
44
47
|
min-width: 0;
|
|
45
48
|
}
|
|
46
49
|
@media (max-width: 1279px) {
|
|
@@ -62,10 +65,6 @@
|
|
|
62
65
|
@media (max-width: 599px) {
|
|
63
66
|
.ui-grid {
|
|
64
67
|
--cols: 1 !important;
|
|
65
|
-
gap: var(--space-4);
|
|
66
|
-
}
|
|
67
|
-
.ui-grid > .ui-page {
|
|
68
|
-
gap: var(--space-4);
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
70
|
}
|
package/dist/styles.css
CHANGED
|
@@ -4590,6 +4590,12 @@ div.ui-toast[role='status'] {
|
|
|
4590
4590
|
.ui-dt-body .ui-dt-cell.is-num {
|
|
4591
4591
|
white-space: normal;
|
|
4592
4592
|
}
|
|
4593
|
+
/* A number with a second line starts at the left like every value in the card, on its name's line: the table's
|
|
4594
|
+
right alignment and the stack's 6 px padding are for rows, not cards. */
|
|
4595
|
+
.ui-dt-body .ui-dt-cell.is-num .ui-dt-stack {
|
|
4596
|
+
align-items: flex-start;
|
|
4597
|
+
padding-block: 0;
|
|
4598
|
+
}
|
|
4593
4599
|
.ui-dt-body .ui-dt-cell[data-label]:not(.is-m-title, .is-m-status)::before {
|
|
4594
4600
|
content: attr(data-label);
|
|
4595
4601
|
position: absolute;
|
|
@@ -5630,7 +5636,7 @@ div.ui-toast[role='status'] {
|
|
|
5630
5636
|
max-width: 760px;
|
|
5631
5637
|
display: flex;
|
|
5632
5638
|
flex-direction: column;
|
|
5633
|
-
gap: var(--
|
|
5639
|
+
gap: var(--block-gap);
|
|
5634
5640
|
}
|
|
5635
5641
|
.ui-settings-section {
|
|
5636
5642
|
padding: var(--space-4);
|
|
@@ -8316,14 +8322,18 @@ div.ui-toast[role='status'] {
|
|
|
8316
8322
|
transition: none;
|
|
8317
8323
|
}
|
|
8318
8324
|
}
|
|
8325
|
+
/* Blocks stacked on a page are block-gap apart (32 px, 16 px on phones), whether a Page, the rows of a Grid or a Page
|
|
8326
|
+
inside a Grid stacks them: two neighbouring blocks are always the same distance apart. */
|
|
8319
8327
|
.ui-page {
|
|
8320
8328
|
display: flex;
|
|
8321
8329
|
flex-direction: column;
|
|
8322
|
-
gap: var(--
|
|
8330
|
+
gap: var(--block-gap);
|
|
8323
8331
|
}
|
|
8324
8332
|
.ui-grid {
|
|
8325
8333
|
display: grid;
|
|
8326
|
-
|
|
8334
|
+
/* Columns 24 px apart; rows (and a Grid folded into one column) the block distance. */
|
|
8335
|
+
column-gap: var(--space-6);
|
|
8336
|
+
row-gap: var(--block-gap);
|
|
8327
8337
|
grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
|
|
8328
8338
|
}
|
|
8329
8339
|
.ui-grid.is-1 {
|
|
@@ -8353,9 +8363,8 @@ div.ui-toast[role='status'] {
|
|
|
8353
8363
|
.ui-grid.is-start {
|
|
8354
8364
|
align-items: start;
|
|
8355
8365
|
}
|
|
8356
|
-
/* A Page as one cell: several cards stacked in one column,
|
|
8366
|
+
/* A Page as one cell: several cards stacked in one column, the block distance apart like every other stack. */
|
|
8357
8367
|
.ui-grid > .ui-page {
|
|
8358
|
-
gap: var(--space-6);
|
|
8359
8368
|
min-width: 0;
|
|
8360
8369
|
}
|
|
8361
8370
|
@media (max-width: 1279px) {
|
|
@@ -8377,10 +8386,6 @@ div.ui-toast[role='status'] {
|
|
|
8377
8386
|
@media (max-width: 599px) {
|
|
8378
8387
|
.ui-grid {
|
|
8379
8388
|
--cols: 1 !important;
|
|
8380
|
-
gap: var(--space-4);
|
|
8381
|
-
}
|
|
8382
|
-
.ui-grid > .ui-page {
|
|
8383
|
-
gap: var(--space-4);
|
|
8384
8389
|
}
|
|
8385
8390
|
}
|
|
8386
8391
|
/* SplitPane: a main area and a side panel with a draggable divider. Under 960 px (its own width) they stack. */
|
package/dist/tokens.css
CHANGED
|
@@ -88,6 +88,7 @@
|
|
|
88
88
|
--space-5: 20px;
|
|
89
89
|
--space-6: 24px;
|
|
90
90
|
--space-8: 32px;
|
|
91
|
+
--block-gap: 32px;
|
|
91
92
|
--space-12: 48px;
|
|
92
93
|
--radius-xs: 4px;
|
|
93
94
|
--radius-sm: 6px;
|
|
@@ -234,4 +235,9 @@
|
|
|
234
235
|
--shadow-card: none;
|
|
235
236
|
--shadow-card-hover: none;
|
|
236
237
|
}
|
|
238
|
+
@media (max-width: 599px) {
|
|
239
|
+
:root {
|
|
240
|
+
--block-gap: 16px;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
237
243
|
}
|
package/docs/DataTable.md
CHANGED
|
@@ -36,7 +36,7 @@ const columns: DataTableColumn<Import>[] = [
|
|
|
36
36
|
|
|
37
37
|
預設就有:主要文字欄占剩下的寬度、其他欄貼合內容;一列工具列(摘要分段、搜尋、「篩選」「排序」「⋯」和 `action`,放不下時摘要自己一列);手機上變成卡片清單。
|
|
38
38
|
|
|
39
|
-
- 清單頁的「新增」(一個 `primary`)給 `action`,在工具列最右端;Card 的 `title`、`label` 怎麼給見 guidelines
|
|
39
|
+
- 清單頁的「新增」(一個 `primary`)給 `action`,在工具列最右端;Card 的 `title`、`label` 怎麼給見 guidelines 的「常見頁面」。`action` 的字用短的動詞(「新增」,不寫「新增手動帳戶」):表格寬度小於 480 px 時工具列只有一列、不換行,長字會把按鈕擠出畫面;要說是什麼,寫在頁面標題或 `label`。
|
|
40
40
|
- 主要的文字欄放第一欄:它占剩下的寬度,也是手機卡片的標題和列的名稱。每列給 `id`。
|
|
41
41
|
- 數字給 `numeric: true` 加 `unit`(傳數字 `1234`,不傳 `'1,234 筆'`);金額用 `format: 'money'`;長度(秒)用 `format: 'duration'`;日期用 `format: 'date' | 'dateTime' | 'relative'`。ID、代碼、雜湊和路徑的欄位給 `mono: true`。
|
|
42
42
|
- 失敗的列:原因寫在 `secondary`(第二行),「重試」放 `rowActions`,可勾選時 `bulkActions` 也放。進行中的列:`doing` 的 Badge,進度文字(「匯入中 42%」)寫在 `secondary`,格子裡不放 ProgressBar。
|
package/docs/Grid.md
CHANGED
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
</Page>
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
- `Page`:區塊之間 32 px
|
|
26
|
+
- `Page`:區塊之間 `block-gap`(32 px,手機 16 px)。
|
|
27
27
|
- 主要內容加側欄(詳細頁的內容和摘要):`<Grid columns={[2, 1]}>`,第一張卡片是主要內容;寬度小於 960 px 時變成一欄,側欄排到下方。各欄靠上對齊,不拉成一樣高。
|
|
28
|
-
- 一欄放好幾張卡片:把那一欄的卡片包在 `<Page>`
|
|
28
|
+
- 一欄放好幾張卡片:把那一欄的卡片包在 `<Page>` 裡當成一格,卡片間距和頁面上其他上下相鄰的區塊一樣(`block-gap`)。不要用 Page 以外的元素自己排間距:不包 `div` 加 `gap` 或 `margin`(lint 規則 `ui/no-custom-block-gap`、`ui check` 都會擋)。
|
|
29
29
|
- 同一排卡片的高度:等寬的 Grid 一排拉成一樣高(`height="fill"` 的圖表撐滿剩下的高度),比例 Grid 靠上;要反過來時給 `align="stretch"` 或 `align="start"`。
|
|
30
30
|
- 沒有 12 欄或跨欄:等寬用數字,不等寬用比例。
|
|
31
|
-
- `Grid
|
|
31
|
+
- `Grid`:左右 24 px(`space-6`),上下一列和下一列之間 `block-gap`(32 px,手機 16 px);收成一欄時也是 `block-gap`。`columns` 是 1280 px 以上的欄數(1、2、3、4、6),較窄時:
|
|
32
32
|
|
|
33
33
|
| 寬度 | `columns={1}` | `2` | `3`(預設) | `4` | `6` |
|
|
34
34
|
| --- | --- | --- | --- | --- | --- |
|
package/docs/agents.md
CHANGED
|
@@ -65,11 +65,11 @@ export default [ui.configs.recommended];
|
|
|
65
65
|
```html
|
|
66
66
|
<meta charset="utf-8">
|
|
67
67
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
68
|
-
<link rel="stylesheet" href="https://seanyeh77.github.io/ui-design-system/dist/0.
|
|
69
|
-
<link rel="stylesheet" href="https://seanyeh77.github.io/ui-design-system/dist/0.
|
|
70
|
-
<link rel="stylesheet" href="https://seanyeh77.github.io/ui-design-system/dist/0.
|
|
68
|
+
<link rel="stylesheet" href="https://seanyeh77.github.io/ui-design-system/dist/0.53.0/fonts.css">
|
|
69
|
+
<link rel="stylesheet" href="https://seanyeh77.github.io/ui-design-system/dist/0.53.0/tokens.css">
|
|
70
|
+
<link rel="stylesheet" href="https://seanyeh77.github.io/ui-design-system/dist/0.53.0/styles.css">
|
|
71
71
|
<div id="root"></div>
|
|
72
|
-
<script src="https://seanyeh77.github.io/ui-design-system/dist/0.
|
|
72
|
+
<script src="https://seanyeh77.github.io/ui-design-system/dist/0.53.0/bundle.js"></script>
|
|
73
73
|
<script>
|
|
74
74
|
const h = React.createElement;
|
|
75
75
|
UI.initTheme();
|
|
@@ -77,6 +77,6 @@ export default [ui.configs.recommended];
|
|
|
77
77
|
</script>
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
Pin a version as above: `/dist/<version>/` never changes; `/dist/` always serves the latest release. jsDelivr has the same files (`https://cdn.jsdelivr.net/npm/@seanyeh77/ui@0.
|
|
80
|
+
Pin a version as above: `/dist/<version>/` never changes; `/dist/` always serves the latest release. jsDelivr has the same files (`https://cdn.jsdelivr.net/npm/@seanyeh77/ui@0.53.0/dist/bundle.js`, `…/dist/styles.css`; the fonts at `https://cdn.jsdelivr.net/npm/@seanyeh77/tokens@0.53.0/fonts.css`). Without a bundler, `@seanyeh77/ui/dist/fonts.css` cannot resolve its import: load the tokens package's `fonts.css` or the pinned site URL.
|
|
81
81
|
|
|
82
82
|
Scope: web UI, and the tokens of SeanYeh's Slidev decks (`initTheme({ preset: 'teaching' })`, see `theme.md`). Slide layout, Notion documents and teaching diagrams follow the separate `teaching-materials-style` skill.
|
package/docs/guidelines.md
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
- 暖灰中性色;主題有自動(跟隨系統)、淺色、深色。強調色預設 `#2457d6`,使用者可以自訂;中量使用:主要按鈕、連結、圖示、標籤與選取狀態。
|
|
18
18
|
- 卡片用陰影分層。卡片裡不放卡片:區塊用 `Card`,卡片裡再分區用 `surface-sub` 底色或分隔線。
|
|
19
19
|
- 自己的 CSS 只用 token(`var(--surface)`、`var(--space-4)`;Tailwind 用 `bg-surface`、`text-ink-muted`),不用 Tailwind 內建的顏色、圓角和陰影。強調色的文字讀 `accent-text`,不讀 `accent`。
|
|
20
|
-
- 密度緊密:區塊間距 `
|
|
20
|
+
- 密度緊密:區塊間距 `block-gap` 32 px(手機 16 px);圓角 `radius-xs` 4 px 到 `radius-lg` 14 px(數值見 [theme.md](theme.md))。
|
|
21
21
|
|
|
22
22
|
## 字體與圖示
|
|
23
23
|
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
## 版面
|
|
39
39
|
|
|
40
40
|
- Dashboard 類用 `AppShell`;監控畫面用 `ConsoleLayout`;程式碼工具用 `Workbench`;展示類(產品介紹、說明網站)只用頂部導覽,見 [layout.md](layout.md)。
|
|
41
|
-
- 內容滿版,`Page` 上下排區塊,`Grid` 排卡片:等寬 `columns={3}`,不等寬給比例 `columns={[2, 1]}`(主要內容加側欄)。每個區塊一張 `Card`。
|
|
41
|
+
- 內容滿版,`Page` 上下排區塊,`Grid` 排卡片;多張卡片上下排一律用 Page(Grid 的一欄放一個 Page),不自己包 `div` 加 `gap` 或 `margin`,區塊之間才都是 `block-gap`。`Grid` 排卡片:等寬 `columns={3}`,不等寬給比例 `columns={[2, 1]}`(主要內容加側欄)。每個區塊一張 `Card`。
|
|
42
42
|
- 頁面標題只出現一次:清單頁、Dashboard、設定頁寫在頂部列(AppShell `title`);詳細頁是那筆資料的名稱,寫在 `PageHeader`,AppShell 不給 `title`。麵包屑放在內容最上方(`Breadcrumb`),不放頂部列。
|
|
43
43
|
- 斷點:手機小於 600 px、平板 600 到 959 px、桌面 960 px 以上(大螢幕 1280 px 以上)。AppShell 的導覽另以 1024 px 為界:600 到 1024 px(含 1024 px)改成導覽抽屜,大於 1024 px 有側邊欄,小於 600 px 改成底部分頁列。手機上長文字靠左。
|
|
44
44
|
|
package/docs/theme.md
CHANGED
|
@@ -103,7 +103,7 @@ import './ui.css';
|
|
|
103
103
|
|
|
104
104
|
## 間距、圓角與陰影
|
|
105
105
|
|
|
106
|
-
區塊間距 `
|
|
106
|
+
區塊間距 `block-gap` 32 px(手機 16 px,Page、Grid 的列、設定頁的區塊都用它);圓角 `radius-xs` 4 px(行內程式碼、鍵帽、分段控制)、`radius-sm` 6 px、`radius-md` 10 px、`radius-lg` 14 px;表面用柔和陰影 `shadow-card`。每個 token 的數值與用途在 `tokens.json`(`usage`)。
|
|
107
107
|
|
|
108
108
|
## 字型
|
|
109
109
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seanyeh77/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.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",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@base-ui/react": "^1.9.0",
|
|
61
|
-
"@seanyeh77/tokens": "^0.
|
|
61
|
+
"@seanyeh77/tokens": "^0.53.0"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"build": "node scripts/theme-defaults.ts && tsdown && node scripts/postbuild.ts",
|