@seanyeh77/ui 0.52.1 → 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/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(--space-8);
9
+ gap: var(--block-gap);
8
10
  }
9
11
  .ui-grid {
10
12
  display: grid;
11
- gap: var(--space-6);
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, 24 px apart like the columns (16 px on phones). */
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
  }
@@ -65,7 +65,7 @@
65
65
  max-width: 760px;
66
66
  display: flex;
67
67
  flex-direction: column;
68
- gap: var(--space-8);
68
+ gap: var(--block-gap);
69
69
  }
70
70
  .ui-settings-section {
71
71
  padding: var(--space-4);
package/dist/styles.css CHANGED
@@ -5636,7 +5636,7 @@ div.ui-toast[role='status'] {
5636
5636
  max-width: 760px;
5637
5637
  display: flex;
5638
5638
  flex-direction: column;
5639
- gap: var(--space-8);
5639
+ gap: var(--block-gap);
5640
5640
  }
5641
5641
  .ui-settings-section {
5642
5642
  padding: var(--space-4);
@@ -8322,14 +8322,18 @@ div.ui-toast[role='status'] {
8322
8322
  transition: none;
8323
8323
  }
8324
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. */
8325
8327
  .ui-page {
8326
8328
  display: flex;
8327
8329
  flex-direction: column;
8328
- gap: var(--space-8);
8330
+ gap: var(--block-gap);
8329
8331
  }
8330
8332
  .ui-grid {
8331
8333
  display: grid;
8332
- gap: var(--space-6);
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);
8333
8337
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
8334
8338
  }
8335
8339
  .ui-grid.is-1 {
@@ -8359,9 +8363,8 @@ div.ui-toast[role='status'] {
8359
8363
  .ui-grid.is-start {
8360
8364
  align-items: start;
8361
8365
  }
8362
- /* A Page as one cell: several cards stacked in one column, 24 px apart like the columns (16 px on phones). */
8366
+ /* A Page as one cell: several cards stacked in one column, the block distance apart like every other stack. */
8363
8367
  .ui-grid > .ui-page {
8364
- gap: var(--space-6);
8365
8368
  min-width: 0;
8366
8369
  }
8367
8370
  @media (max-width: 1279px) {
@@ -8383,10 +8386,6 @@ div.ui-toast[role='status'] {
8383
8386
  @media (max-width: 599px) {
8384
8387
  .ui-grid {
8385
8388
  --cols: 1 !important;
8386
- gap: var(--space-4);
8387
- }
8388
- .ui-grid > .ui-page {
8389
- gap: var(--space-4);
8390
8389
  }
8391
8390
  }
8392
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/Grid.md CHANGED
@@ -23,12 +23,12 @@
23
23
  </Page>
24
24
  ```
25
25
 
26
- - `Page`:區塊之間 32 px(`space-8`)。
26
+ - `Page`:區塊之間 `block-gap`(32 px,手機 16 px)。
27
27
  - 主要內容加側欄(詳細頁的內容和摘要):`<Grid columns={[2, 1]}>`,第一張卡片是主要內容;寬度小於 960 px 時變成一欄,側欄排到下方。各欄靠上對齊,不拉成一樣高。
28
- - 一欄放好幾張卡片:把那一欄的卡片包在 `<Page>` 裡當成一格;在 Grid 裡的 Page 卡片間距自動是 24 px(手機 16 px),和欄距相同。不要用 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`:卡片之間 24 px(`space-6`),手機 16 px。`columns` 是 1280 px 以上的欄數(1、2、3、4、6),較窄時:
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.52.1/fonts.css">
69
- <link rel="stylesheet" href="https://seanyeh77.github.io/ui-design-system/dist/0.52.1/tokens.css">
70
- <link rel="stylesheet" href="https://seanyeh77.github.io/ui-design-system/dist/0.52.1/styles.css">
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.52.1/bundle.js"></script>
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.52.1/dist/bundle.js`, `…/dist/styles.css`; the fonts at `https://cdn.jsdelivr.net/npm/@seanyeh77/tokens@0.52.1/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.
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.
@@ -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
- - 密度緊密:區塊間距 `space-8` 32 px;圓角 `radius-xs` 4 px 到 `radius-lg` 14 px(數值見 [theme.md](theme.md))。
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
- 區塊間距 `space-8` 32 px;圓角 `radius-xs` 4 px(行內程式碼、鍵帽、分段控制)、`radius-sm` 6 px、`radius-md` 10 px、`radius-lg` 14 px;表面用柔和陰影 `shadow-card`。每個 token 的數值與用途在 `tokens.json`(`usage`)。
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.52.1",
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.52.1"
61
+ "@seanyeh77/tokens": "^0.53.0"
62
62
  },
63
63
  "scripts": {
64
64
  "build": "node scripts/theme-defaults.ts && tsdown && node scripts/postbuild.ts",