@aiquants/console-ui 0.8.2 → 0.9.1
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/README.md +15 -9
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +22 -6
- package/dist/index.d.ts +22 -6
- package/dist/index.js +1 -1
- package/dist/styles/console-ui.css +43 -9
- package/package.json +3 -2
|
@@ -102,6 +102,11 @@
|
|
|
102
102
|
--cui-border-control: light-dark(#384353, #c2ccd9);
|
|
103
103
|
--cui-border-subtle: light-dark(#6b6e73, #86909f);
|
|
104
104
|
}
|
|
105
|
+
[data-cui-root][data-cui-reduced-motion] {
|
|
106
|
+
--cui-motion-1: 0ms;
|
|
107
|
+
--cui-motion-2: 0ms;
|
|
108
|
+
--cui-motion-3: 0ms;
|
|
109
|
+
}
|
|
105
110
|
@media (prefers-reduced-motion: reduce) {
|
|
106
111
|
[data-cui-root] {
|
|
107
112
|
--cui-motion-1: 0ms;
|
|
@@ -126,7 +131,9 @@
|
|
|
126
131
|
* in a control. Borders are drawn with `border` only (a `box-shadow` rule disappears in forced colours), and their width is
|
|
127
132
|
* subtracted from the padding next to them. The one length off the lattice is the reading measure, 40ic (WCAG 1.4.8): every
|
|
128
133
|
* paragraph the package draws, and the dialog, is at most 40 ideographs wide plus its own padding. Durations are read only from
|
|
129
|
-
* the `--cui-motion-*` variables, which are `0ms` while the reader prefers reduced motion
|
|
134
|
+
* the `--cui-motion-*` variables, which are `0ms` while the reader prefers reduced motion and in a root the host asks to
|
|
135
|
+
* reduce motion (`data-cui-reduced-motion`), and the one animation runs only outside every root that has asked it, for a
|
|
136
|
+
* reader who allows motion.
|
|
130
137
|
* Text and surface colours are applied only through role attributes: `data-cui-fg` paints text,
|
|
131
138
|
* `data-cui-surface` paints the surface text sits on, `data-cui-accent` paints non-text graphics
|
|
132
139
|
* (the progress fill) and `data-cui-fill` paints the surface of a figure's shape; a figure's text takes its text role's colour
|
|
@@ -154,7 +161,8 @@
|
|
|
154
161
|
* 全ての長さは 4 px の格子に乗る (箱の枠・余白・行の和は格子の倍数で、全ての操作は 44 px の的以上で、操作の中で中央に置く行は 44 との差が
|
|
155
162
|
* 8 の倍数のもの (body と caption の 20、title の 28) だけ)。枠は `border` だけで描き (`box-shadow` の罫は強制配色で消える)、その幅は隣の
|
|
156
163
|
* 余白から引く。格子に乗らない唯一の長さは読む段落の幅 40ic (WCAG 1.4.8) で、パッケージが描く全ての段落と対話は全角 40 字と自分の余白の
|
|
157
|
-
* 和の幅まで。時間は `--cui-motion-*`
|
|
164
|
+
* 和の幅まで。時間は `--cui-motion-*` の変数だけから読み、読み手が動きを減らすことを好む間と、ホストが動きを減らす根 (`data-cui-reduced-motion`)
|
|
165
|
+
* の中ではそれが `0ms` で、唯一のアニメーションは、動きを許す読み手のそれを求めた根の外だけで走る。
|
|
158
166
|
* 文字と面の色は役割の属性でだけ当てる (`data-cui-fg` は文字、`data-cui-surface` は文字が載る面、
|
|
159
167
|
* `data-cui-accent` は文字以外の図形 (進行の塗り)、`data-cui-fill` は図の図形の面を塗る。図の文字は文字の役割の色を塗りに取り
|
|
160
168
|
* (`currentColor`。その 1 つの宣言だけ)、図の線は `data-cui-stroke` から塗る)。それ以外の色は固定の文字以外の線で、描く面と共に列挙し、
|
|
@@ -175,6 +183,7 @@
|
|
|
175
183
|
.cui-button,
|
|
176
184
|
.cui-link,
|
|
177
185
|
.cui-row-button,
|
|
186
|
+
.cui-row-link,
|
|
178
187
|
.cui-input,
|
|
179
188
|
.cui-radio input,
|
|
180
189
|
.cui-checkbox input,
|
|
@@ -934,8 +943,11 @@
|
|
|
934
943
|
同じ詳細度で名札の inline-block を上書きして行の全幅の帯にするので、行の分け方は親の flex で決める。
|
|
935
944
|
行の間の 4 は名札の張り出し (箱 28 は body の行 20 の上下へ 4 ずつ出る) で、名札の行の隣の行の文字に名札を
|
|
936
945
|
触れさせない。k 行の高さは 24 + 行の和 + 4(k − 1) で、どの段の行も 4 の倍数なので格子に乗る。
|
|
937
|
-
UA の button の font
|
|
938
|
-
|
|
946
|
+
UA の button の font の一括指定が戻す書体と数字の形は周りの文から継ぐ。リンクの行 (RowLink) も同じ形で、UA のリンクの下線を
|
|
947
|
+
持たない (行の全体が的で、行の字は文の中のリンクでない)。UA が button にだけ当てる字の戻し (太さ・斜体・字と語の間・大文字化・
|
|
948
|
+
字下げ・影) を 2 つの行に書く (リンクは周りの文から継ぐので、書かなければ同じ所の 2 つの行が違う字を描く) */
|
|
949
|
+
.cui-row-button,
|
|
950
|
+
.cui-row-link {
|
|
939
951
|
display: flex;
|
|
940
952
|
box-sizing: border-box;
|
|
941
953
|
flex-direction: column;
|
|
@@ -949,15 +961,27 @@
|
|
|
949
961
|
border-radius: var(--cui-radius-item);
|
|
950
962
|
font-family: inherit;
|
|
951
963
|
font-variant-numeric: inherit;
|
|
964
|
+
font-weight: var(--cui-font-weight-regular);
|
|
965
|
+
font-style: normal;
|
|
966
|
+
letter-spacing: normal;
|
|
967
|
+
word-spacing: normal;
|
|
968
|
+
text-transform: none;
|
|
969
|
+
text-indent: 0;
|
|
970
|
+
text-shadow: none;
|
|
952
971
|
text-align: start;
|
|
953
972
|
overflow-wrap: anywhere;
|
|
954
973
|
cursor: pointer;
|
|
955
974
|
}
|
|
956
975
|
|
|
976
|
+
.cui-row-link {
|
|
977
|
+
text-decoration: none;
|
|
978
|
+
}
|
|
979
|
+
|
|
957
980
|
/* 選んだ行は面の色に加えて始端の帯でも示す (色だけに頼らない)。帯は行自身の始端の枠で、その幅を始端の余白から
|
|
958
981
|
引くので箱の寸法も文字の位置も選んでいない行と同じ。影で描くと強制配色が消し、焦点の輪と同じ outline で描くと
|
|
959
982
|
焦点の規則 (詳細度が高い) が上書きして、選んだ直後の焦点の在る行で手掛かりが消える。枠なら右から左の根でも始端に在る */
|
|
960
|
-
.cui-row-button[data-selected="true"]
|
|
983
|
+
.cui-row-button[data-selected="true"],
|
|
984
|
+
.cui-row-link[aria-current="page"] {
|
|
961
985
|
padding-inline-start: calc(var(--cui-space-3) - var(--cui-space-1));
|
|
962
986
|
border-inline-start: var(--cui-space-1) solid var(--cui-info-accent);
|
|
963
987
|
}
|
|
@@ -1052,9 +1076,11 @@
|
|
|
1052
1076
|
margin-inline: auto;
|
|
1053
1077
|
}
|
|
1054
1078
|
|
|
1055
|
-
/* 動きを許す読み手には始端から終端 (100% − 25%) まで往復させる。区間はその長さを motion-3 ごとに 1 つ進む (75% は 3 つ)
|
|
1079
|
+
/* 動きを許す読み手には始端から終端 (100% − 25%) まで往復させる。区間はその長さを motion-3 ごとに 1 つ進む (75% は 3 つ)。
|
|
1080
|
+
ホストが動きを減らす根 (data-cui-reduced-motion) の中は、媒体の問いが reduce の時と同じに中央に留める (印を持つどの祖先の下でも
|
|
1081
|
+
往復させない。印の根の中の動きの時間は 0ms なので、往復させれば区間は中央でなく始端に留まる) */
|
|
1056
1082
|
@media (prefers-reduced-motion: no-preference) {
|
|
1057
|
-
.cui-progress-track[data-cui-indeterminate="true"] > .cui-progress-fill {
|
|
1083
|
+
.cui-progress-track[data-cui-indeterminate="true"]:not([data-cui-reduced-motion] *) > .cui-progress-fill {
|
|
1058
1084
|
margin-inline: 0;
|
|
1059
1085
|
animation-name: cui-progress-sweep;
|
|
1060
1086
|
animation-duration: calc(3 * var(--cui-motion-3));
|
|
@@ -1698,11 +1724,18 @@
|
|
|
1698
1724
|
|
|
1699
1725
|
/* 対話: 枠 1 と、枠の幅を引いた余白 23 (枠と余白の和 24 が格子に乗る) の容器。幅は 40 字の段落 (WCAG 1.4.8) と両側の 24 の和
|
|
1700
1726
|
(--cui-measure-dialog。ホストが同じ外の幅の箱を作る時も同じ変数を使う) 以下で、表示域から左右 24 ずつを除いた幅を超えない。見出しは
|
|
1701
|
-
カードの見出しの規則を共にする (題の行 28 に閉じるボタン 44 を中央で揃え、上下 −8 で重ねる)
|
|
1727
|
+
カードの見出しの規則を共にする (題の行 28 に閉じるボタン 44 を中央で揃え、上下 −8 で重ねる)。
|
|
1728
|
+
置き場所と高さの上限は UA の既定に任せない。中央に置く UA の margin: auto は、cui より下の層に置かれたホストのリセット (全ての要素の
|
|
1729
|
+
margin を 0 にするもの) が消すので宣言し直す。UA の高さの上限 calc(100% - 6px - 2em) は格子を外れるので、包含ブロックから上下 24 ずつを
|
|
1730
|
+
除いた高さを格子へ切り下げる (上下の余りは 24 以上 26 未満で、外向きの焦点の輪が表示域の縁で切れない)。モーダルの包含ブロックは
|
|
1731
|
+
表示域からスクロールバーを除いた箱で、百分率はそれを読むので、古典的な横のスクロールバーの出た頁でも余りは 24 を保つ (表示域の単位は
|
|
1732
|
+
スクロールバーを数えないので、帯の分だけ余りが減る)。百分率は長さへ解けるので、round() の引数の型は揃う */
|
|
1702
1733
|
.cui-dialog {
|
|
1703
1734
|
box-sizing: border-box;
|
|
1704
1735
|
inline-size: var(--cui-measure-dialog);
|
|
1705
1736
|
max-inline-size: calc(100% - 2 * var(--cui-space-6));
|
|
1737
|
+
max-block-size: round(down, 100% - 2 * var(--cui-space-6), var(--cui-space-1));
|
|
1738
|
+
margin: auto;
|
|
1706
1739
|
padding: calc(var(--cui-space-6) - var(--cui-border-width));
|
|
1707
1740
|
border: var(--cui-border-width) solid var(--cui-border-subtle);
|
|
1708
1741
|
border-radius: var(--cui-radius-container);
|
|
@@ -1902,7 +1935,8 @@
|
|
|
1902
1935
|
@media (forced-colors: active) {
|
|
1903
1936
|
/* 選んだ行の手掛かりは始端の枠の帯だけになるので Highlight で描く。焦点の規則は outline だけを持つので、焦点の
|
|
1904
1937
|
在る選んだ行でも帯は残る */
|
|
1905
|
-
.cui-row-button[data-selected="true"]
|
|
1938
|
+
.cui-row-button[data-selected="true"],
|
|
1939
|
+
.cui-row-link[aria-current="page"] {
|
|
1906
1940
|
border-inline-start-color: Highlight;
|
|
1907
1941
|
}
|
|
1908
1942
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiquants/console-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Host-agnostic UI foundation for React admin consoles, with a React entry, a React-free core entry, a DOM testing entry and a stylesheet.",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.css"
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"react-dom": ">=19"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@aiquants/auth-core": "0.9.
|
|
68
|
+
"@aiquants/auth-core": "0.9.3",
|
|
69
69
|
"@testing-library/jest-dom": "^6.9.1",
|
|
70
70
|
"@testing-library/react": "^16.3.2",
|
|
71
71
|
"@testing-library/user-event": "^14.6.1",
|
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
"@types/react-dom": "^19.2.3",
|
|
75
75
|
"@vitest/coverage-v8": "^4.1.8",
|
|
76
76
|
"jsdom": "^27.4.0",
|
|
77
|
+
"playwright": "^1.64.1",
|
|
77
78
|
"postcss": "^8.5.6",
|
|
78
79
|
"react": "^19.2.7",
|
|
79
80
|
"react-dom": "^19.2.7",
|