@aiquants/contact-map 0.20.0 → 0.21.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 +6 -4
- package/dist/client.js +2 -2
- package/dist/client.mjs +2 -2
- package/dist/styles/contact-map.standalone.css +1 -1
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -49,7 +49,7 @@ Peer dependencies:
|
|
|
49
49
|
```json
|
|
50
50
|
{
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@aiquants/directory-tree": "^
|
|
52
|
+
"@aiquants/directory-tree": "^6.0.0",
|
|
53
53
|
"@aiquants/fuzzy-search": "^3.2.1",
|
|
54
54
|
"@aiquants/resize-panels": "^2.2.0",
|
|
55
55
|
"@aiquants/select-box": "^0.22.0",
|
|
@@ -219,22 +219,24 @@ function PrebuildContactMapTree() {
|
|
|
219
219
|
|
|
220
220
|
The components are styled with Tailwind CSS v4 utility classes. Every colour they paint is a pair of the package's palette written as `light-dark(<light>, <dark>)` in an arbitrary value (`text-[color:light-dark(#0f172b,#f8fafc)]`), so the colours follow the `color-scheme` the components inherit: a host that sets `color-scheme: dark` on its root, or on an ancestor of the components, gets the dark scheme, and a host that sets nothing keeps the light one. The package declares no `color-scheme` of its own and reads neither `prefers-color-scheme` nor a `dark` class.
|
|
221
221
|
|
|
222
|
+
The palette's values are `@aiquants/console-ui`'s tokens and tone table, but for the muted surface, the focus colour and the tree's line colour, which are the map's own. The classes write the values whole and the package's tests check them against console-ui, so the package reads console-ui only for types and needs it only to type-check and test (a development dependency): a host does not install it.
|
|
223
|
+
|
|
222
224
|
- **Browsers:** `light-dark()` needs Chrome / Edge 123, Firefox 120 or Safari 17.5 or later.
|
|
223
225
|
- **Contrast (WCAG 2.2 AAA):** in both schemes every text keeps 7:1 against each surface it lies on and every non-text mark (a control's border, the focus ring, the progress bar, the tree lines) 3:1. Nothing is translucent but the modal backdrop.
|
|
224
226
|
- **Uncoloured text:** text the package paints no colour on inherits the host's text colour, so the host gives its page a text colour that follows its scheme.
|
|
225
|
-
- **The tree view:** `@aiquants/directory-tree`
|
|
227
|
+
- **The tree view:** `@aiquants/directory-tree` paints the colours the package leaves to it from its own `light-dark()` palette, so the whole tree follows the same `color-scheme` and needs no `dark` class. Its lines and expand glyphs are drawn on a canvas above the rows, which cannot resolve `light-dark()`, so they take one colour, `#71829b`, which keeps 3.5:1 on every surface of both schemes, the hovered and the selected rows' included. While a search is in progress the tree is not dimmed: it is marked busy (`aria-busy`) and shows the progress cursor.
|
|
226
228
|
|
|
227
229
|
- A host that builds with Tailwind CSS v4 generates the classes in its own build, with Tailwind CSS v4.1 or later (the package's classes use the `pointer-coarse:` variant of the 16 px text of the search field and the settings' selects on touch screens and the `wrap-break-word` utility, both added in v4.1): it adds an `@source` for the package's files (`@source "<path to node_modules>/@aiquants/contact-map/dist";` for the published package) and defines the `animate-progress-indeterminate` utility of the indeterminate progress bar (the definition below).
|
|
228
230
|
The palette's classes are arbitrary values, so they need no theme variables. It does not import the standalone CSS as well, whose copy of the utilities would compete with its own.
|
|
229
231
|
- A host without Tailwind CSS imports `@aiquants/contact-map/styles/contact-map.standalone.css`: the package's utilities, the palette's colours among them, and the progress animation, compiled. Its corner radii follow the host's `--radius` variable when the host sets one (0.5rem otherwise).
|
|
230
232
|
- Either way, the host imports the CSS of the embedded packages itself, which the standalone CSS leaves out so that an older copy baked into it never overrides the host's newer one: `@aiquants/virtualscroll/styles/virtualscroll.css`, `@aiquants/directory-tree/styles/directory-tree.css` and `@aiquants/resize-panels/styles/resize-panels.css`.
|
|
231
233
|
|
|
232
|
-
コンポーネントは Tailwind CSS v4 のユーティリティクラスで装飾する。塗る色はどれもパッケージの配色表の組で、任意の値の中に `light-dark(<明るい>, <暗い>)` と書く (`text-[color:light-dark(#0f172b,#f8fafc)]`)。そのため色はコンポーネントが受け継ぐ `color-scheme` に従う: 根かコンポーネントの祖先に `color-scheme: dark` を置いたホストは暗い配色になり、何も置かないホストは明るい配色のまま。パッケージは自分の `color-scheme` を宣言せず、`prefers-color-scheme` も `dark`
|
|
234
|
+
コンポーネントは Tailwind CSS v4 のユーティリティクラスで装飾する。塗る色はどれもパッケージの配色表の組で、任意の値の中に `light-dark(<明るい>, <暗い>)` と書く (`text-[color:light-dark(#0f172b,#f8fafc)]`)。そのため色はコンポーネントが受け継ぐ `color-scheme` に従う: 根かコンポーネントの祖先に `color-scheme: dark` を置いたホストは暗い配色になり、何も置かないホストは明るい配色のまま。パッケージは自分の `color-scheme` を宣言せず、`prefers-color-scheme` も `dark` クラスも読まない。配色表の値は `@aiquants/console-ui` のトークンと色調の表で、控えめな面・フォーカスの色・ツリーの線の色だけは地図のもの。クラスは値を丸ごと書き、パッケージの試験が console-ui と照らすので、パッケージが console-ui を読むのは型だけで、console-ui が要るのは型の検めと試験の時だけ (開発の依存)。ホストは console-ui を入れない。
|
|
233
235
|
|
|
234
236
|
- **ブラウザー**: `light-dark()` には Chrome・Edge 123、Firefox 120、Safari 17.5 以降が要る。
|
|
235
237
|
- **対比 (WCAG 2.2 AAA)**: どちらの配色でも、どの字も載るどの面の上でも 7:1 を、字でない印 (操作部品の枠・フォーカスの輪・進捗のバー・ツリーの線) は 3:1 を保つ。半透明のものはモーダルの背景だけ。
|
|
236
238
|
- **色を塗らない字**: パッケージが色を塗らない字はホストの字の色を受け継ぐので、ホストはページに配色に従う字の色を置く。
|
|
237
|
-
- **ツリービュー**: `@aiquants/directory-tree`
|
|
239
|
+
- **ツリービュー**: `@aiquants/directory-tree` は、パッケージが任せる色を自分の `light-dark()` の配色表で塗るので、ツリー全体が同じ `color-scheme` に従い、`dark` クラスは要らない。線と展開の印は行の上のキャンバスに描き、キャンバスは `light-dark()` を解けないので 1 つの色 `#71829b` を使う。どちらの配色のどの面の上でも (ホバーした行と選んだ行の面も) 3.5:1 を保つ。検索の途中のツリーは薄めず、処理中 (`aria-busy`) と示して処理中のカーソルを出す。
|
|
238
240
|
|
|
239
241
|
- Tailwind CSS v4 でビルドするホストは、自分のビルドでクラスを生成する。Tailwind CSS は v4.1 以降が要る (パッケージのクラスは、タッチの画面での検索欄と設定のセレクトの 16 px の文字の `pointer-coarse:` バリアントと `wrap-break-word` ユーティリティを使い、どちらも v4.1 で加わった): パッケージのファイルへの `@source` を足し (公開版なら `@source "<node_modules への道>/@aiquants/contact-map/dist";`)、不確定の進捗バーの `animate-progress-indeterminate` ユーティリティを定義する (定義は下)。配色表のクラスは任意の値なので、テーマの変数は要らない。スタンドアロンの CSS は併せて読み込まない (その写しのユーティリティが自分のものと競り合う)。
|
|
240
242
|
- Tailwind CSS を使わないホストは `@aiquants/contact-map/styles/contact-map.standalone.css` を読み込む: パッケージのユーティリティ (配色表の色を含む) と進捗のアニメーションをコンパイルしたもの。角の丸みは、ホストが `--radius` 変数を置けばそれに従う (無ければ 0.5rem)。
|