Compare commits

..

6 Commits

82 changed files with 9010 additions and 231 deletions
+1
View File
@@ -6,6 +6,7 @@ One row per feature, with its analysis document (CLAUDE.md §5.1). Gaps live in
| Feature | Phase | Status | Analysis | Review |
|:--|:--|:--|:--|:--|
| Released through Fabrica: `.fabrica/` (app, release and e2e pipelines, tests, Aula pictures), the Aula page's words, the version check, the APK signed in Custos, `domi-rosea://open` from the installer, the showcase pictures on demo data, the phone target | Platform track | Merged to `main` (9b8eb70). Not published: the first release waits for the author (G-F1, G6.1) | [fabrica-release.md](features/fabrica-release.md) | [feature-fabrica-release.md](reviews/feature-fabrica-release.md) |
| @domi/ui: the shared buttons and the town search field, vendored v1.5.0 (CPAL-1.0); the licence credit at the foot of every screen | Platform track | Built on `feature/domi-ui`; the look is Mark's to judge from the pictures | [domi-ui.md](features/domi-ui.md) | [feature-domi-ui.md](reviews/feature-domi-ui.md) |
| Atrium Domi adoption: the inventory (Tauri calls, data, network, accent, icon) and the plan for steps 1–8 of Atrium's Appendix A | Platform track | Plan merged (f4efc9e); step 1 = `domi-app.toml` alone (`feature/atrium-door`), the door skipped by Mark's ruling | [atrium-adoption.md](features/atrium-adoption.md) | [docs-atrium-adoption.md](reviews/docs-atrium-adoption.md), [feature-atrium-door.md](reviews/feature-atrium-door.md) |
| The APK for a release, tested on the Wave 10 through the phone queue: `reset: uninstall`, `maxMinutes`, the e2e pipeline's `phone` step, the release APK built and verified | Platform track | Merged (f5d8d2c); the phone test passed on the Wave 10 through the queue, 1 of 1 (2026-11-21). Blocked: `rosea-android` does not exist (G-F7); publication (G-F1) | [android-release-apk.md](features/android-release-apk.md) | [feature-android-release-apk.md](reviews/feature-android-release-apk.md) |
| Keep her safe in the apps: true words, Android's own save screen, the page kept between the system bars | Platform track | Merged to `main` 2026-11-17; built on this machine, not distributed. Closes G-T4 and, on Android, G-T5 | [keep-her-safe-apps.md](features/keep-her-safe-apps.md) | [feature-keep-her-safe-apps.md](reviews/feature-keep-her-safe-apps.md) |
+80
View File
@@ -0,0 +1,80 @@
# @domi/ui in Rosea: the shared buttons and the town search
Status: built on `feature/domi-ui`, 2026-11-23. The brief was Mark's, passed on by the Aula session: adopt `@domi/ui`,
the Domi design system (`mnovak/domi-design`), at **v1.5.0** (CPAL-1.0 from v1.0.3). He chose **(a)**: Rosea may
carry a public copy. Her buttons
and her town search take the new look, and the search field gets *search*, never *send*. Review:
[`feature-domi-ui.md`](../reviews/feature-domi-ui.md).
## 1. Why and what, in the player's terms
Every Domi app now shares one set of controls:
- a struck plate for an ordinary action, and a gilded leaf for the one main action of a screen;
- a glint when pressed;
- at least 48 px under a finger.
Rosea's buttons were her own: rounded outlines, plus underlined words for the quiet ones. They now wear the shared
plate in her own colours, and her town search becomes the shared field with a search seal. Nothing else changes:
- her colours, her system fonts, her art and her layout stay;
- what each button does stays;
- what she says stays.
## 2. Technical architecture
```mermaid
flowchart LR
subgraph vendored["packages/domi-ui = @domi/ui v1.5.0 (vendored, never edited)"]
btn["components/Button.svelte"]
tf["components/TextField.svelte"]
css["css/tokens + base + components"]
lib["lib/strike, keys, icons"]
end
script["domi-design tools/vendor.mjs"] -->|copies a CPAL tag| vendored
tokens["packages/ui/src/tokens.css"] -->|@import| css
rose["rose/*, scene/*, sunset/*, Shell"] --> btn & tf & lib
html["apps/rosea/index.html<br/>data-domi-room=rosea, theme auto"] --> css
```
### Decisions
| # | Decision | Why |
|:--|:--|:--|
| D1 | **A vendored copy as a workspace package**, `packages/domi-ui` (`"@domi/ui": "workspace:*"`). It is made only by the design system's own `node tools/vendor.mjs <rosea>/packages/domi-ui v1.5.0`, which writes `src/` (css, components, lib, index.ts, types.ts, tokens/generated.ts), a `package.json` with no scripts, `LICENSE` (CPAL-1.0), `NOTICE` (the credit), `CHANGELOG.md` and `VERSION`, and refuses a tag that is not CPAL-1.0 (INTEGRATE.md §6a). It is never edited here. ESLint skips the folder. The three `@fontsource-variable` fonts arrive as its npm dependencies (OFL); Rosea never imports them, so none is bundled. | Rosea's repository is public and the design system's is private, so a public build cannot fetch it. Mark allowed the copy, under CPAL-1.0 from v1.0.3 (v1.0.2 was MPL-2.0 and is never used). A bump reruns the tool with the next tag. |
| D2 | **Rosea's buttons never hand `Button` a Promise.** Async handlers are called as `() => void save()`. | A Promise would make the button announce "Working" and "Done", the design system's English, not Rosea's copy (CLAUDE.md §7). Rosea's own status lines already speak. Its hidden status regions stay empty. |
| D3 | **Every button is `Button`.** *Move the chair* binds its element (`bind:element`, 1.5.0), so focus comes back to it after the sunset. Only the *Bring her back* file picker wears the plate's classes on a `<label>` (D8). | Up to 1.3.x, `Button` set its own `onkeydown` and `onblur` after the ones passed to it. That dropped the pour by a held Space, its stop on blur, and *a held key is one touch* (thorns.md T2); the unit tests caught it. The fix went from here to domi-design (PR mnovak/domi-design#18, released in 1.4.0), and `bind:element` came in 1.5.0 at this request. Until then these buttons were markup. |
| D4 | **The town search is `TextField`, `action="search"`,** with Rosea's label, a new seal name *Search towns*, and `sentText=""`. The list follows the typing as before, so the seal and Enter only confirm it. | Nothing is sent anywhere, so the seal never says *send*. `sentText=""` keeps the design system's "Searched" unsaid; the line *One town* already speaks. |
| D5 | **On the dusk scene the plate is recoloured locally**: evening glass, with the sunset's gold edge that Rosea's button had. | That scene is dusk in either theme. The room's light plate would be parchment on a night sky. |
| D6 | **Her system faces stay**: `--domi-font-hand` and `--domi-font-book` point at Rosea's own stacks. No font files are copied. | INTEGRATE.md §0.4; the font is Mark's open question in PALETTE.md. |
| D7 | `<html data-domi-room="rosea" data-domi-theme="auto">` | Her room's ground equals her current colours in both themes, and she follows the device, as before. |
| D9 | **The licence's credit** (CPAL-1.0 Exhibit B, for Rosea and for the copy): `<DomiCredit link={false} />`, the exact words `Built on Domi · https://aula.marek-novak.cz · Copyright (c) 2026 Marek Novák`, with the address as plain text. One quiet line at the foot of every screen, from the first open on (the gardener, the garden, the Letter), never a splash. Mark approved it (via the Aula session). | INTEGRATE.md §6a asks for it in the interface. The garden is offline: a link opening a web page would carry the player out of her, and on Android, which has no internet, into a page that never loads. `link={false}` came into 1.4.0 from this request. CLAUDE.md says *Domi* never appears alone in public; this phrase is the licence's and Mark's own (review finding). |
| D10 | **On Android the town field is an editable box** (`TextField as="auto"`, v1.1.0): `contenteditable="plaintext-only"` with `role="textbox"`, the same look and keys. Elsewhere it stays the native search field. | Android's WebView asks Google's Autofill service, over the network, the moment a native text field gets focus. No attribute stops it, and Rosea's missing `INTERNET` permission does not either, because the system's Autofill service makes the request (found by Amicitia). A player typing their town would send a request they never asked for. A unit test holds it on an Android user agent, and the drill (`as="input"`) fails it. |
| D8 | **Not converted:** the gardener's choices stay her own picture-chips, not `Radio`. The *Bring her back* file picker stays a `<label>` around the browser's own input, wearing the plate's classes. | The brief was her buttons and the search. A file input cannot be a `Button`. |
## 3. Risk analysis
| Risk | Answer |
|:--|:--|
| A care gesture stops working (the pour by keyboard, blur, a held key) | D3, and the unit tests that caught it run on every commit |
| The design system's English reaches the player | D2, D4. `lint:copy` also reads the vendored folder now (46 files) |
| A carved, metallic look makes her garden feel colder | listed for Mark in the review with the pictures; her art rules are not changed |
| A copy of private code in a public repository | Mark's decision (a). The Aula session told the design system session so that it can add a licence. `VENDORED.md` says so |
| CSP | the vendored CSS is bundled into Rosea's own file. The one inline style (`style:` on a multi-line field) is set through the CSSOM and Rosea does not use it. Checked by the e2e suite, which fails on any CSP violation |
## 4. Gap analysis
- **Fixed by this:** Rosea's controls now meet the 48 px touch floor.
- **Still open:**
- the struck plate's look under docs/ART.md (review);
- `Button`'s handler order, reported to the design system (D3);
- a licence for the copy (the design system's).
## 5. Verification matrix
| Case | Kind | Where |
|:--|:--|:--|
| every button keeps its name, role and action | unit | `packages/ui/test/*` (88) |
| the pour by a held Space and the stop on blur | unit | `rose.test.ts`, `planet.test.ts` |
| a held key is one touch | unit | `touch.test.ts` |
| Rosea's status line is still the one that speaks | unit | `test/said.ts` |
| the built app: care, the town, the sunset, offline | e2e, offline | `pnpm test:e2e`, `pnpm test:offline` |
| how it looks, light and dark, phone and desktop | pictures | `pnpm look:shots` (`ROSEA_LOOK=before|after`), in the PR |
+112
View File
@@ -0,0 +1,112 @@
# Review: `feature/domi-ui` (2026-11-23)
Analysis: [`../features/domi-ui.md`](../features/domi-ui.md). Rosea's buttons and her town search take `@domi/ui`'s
look, from a vendored copy. The copy is **v1.5.0, CPAL-1.0**, made by the design system's `tools/vendor.mjs` into `packages/domi-ui`. Aula's
hold was lifted with that tag; v1.0.1, the copy first tried here, never left this machine.
## Before and after
`ROSEA_LOOK=before|after pnpm look:shots` made the pictures: 28 of each (light and dark × phone and desktop × seven
screens), from the BUILT app, `main` 60a9f14 against this branch. They are in the PR, not in git.
## What Mark should look at: where the carved look meets Rosea's art rules
Her art rules (docs/ART.md, art/STYLE.md) are not changed. These are the places where the new look and her old look
differ, for him to judge:
1. **The rose colour leaves the buttons.**
- Her ordinary buttons were outlined in `--rose`. They are now @domi/ui's neutral plate: warm grey on parchment,
dark stone at night.
- Her quiet buttons were underlined words in `--rose`. They are now plain words in `--domi-fg-2`, bold, with no
underline.
- Rose now shows only on focus, on the leaf (*Done* on the first screen), and on the search seal.
2. **A heavier, more formal type in the controls.** The labels are bold (600) in her system face, where her text
around them is regular. The field's label *Town or city* is bold too.
3. **Two control styles on the first screen.** The gardener's choices stay her soft rose chips (D8). The *Done*
below them is a gilded leaf.
4. **Taller rows on a phone.** Every control is at least 48 px under a finger, so *Change gardener* now wraps to a
line of its own under *Her numbers* and *Keep her safe*, with more air around it.
5. **Dusk.** On the sunset scene the plate is recoloured locally to evening glass with the sunset's gold edge (D5).
It is the one place with colours that are not @domi/ui's.
6. **The glint and the strike** (a light sweep and a press ring) animate on press. With reduced motion on, Rosea's
own rule turns every transition off, as before.
## Findings
1. **`Button` drops `onkeydown` and `onblur` passed to it.** Its own handlers come after `{...rest}`.
- In Rosea that broke three things: the pour by a held Space, the stop on blur, and *a held key is one touch*.
The unit tests caught all three.
- *Fixed upstream:* PR mnovak/domi-design#18 from here, reviewed and released in @domi/ui 1.4.0. Its two tests
fail on the old Button. Water and Touch her are `Button` again; until 1.4.0 they were markup (D3). *Move the
chair* became `Button` with 1.5.0's `bind:element`. Without the binding, the focus test fails (drill).
2. **Every `Button` carries its own `role="status"` region.** Rosea's tests that asked for "the" status found
several. *Fixed in the tests* (`test/said.ts`, and one e2e locator), not in the vendored code. Rosea never hands
a button a Promise (D2), so these regions stay empty and say nothing.
3. **The design system's English** ("Working", "Done", "Searched", "Could not search") would reach the player
through a Promise or a search.
- *Prevented* by D2 and `sentText=""`.
- The seal's name is Rosea's own copy: *Search towns*.
- `lint:copy` now reads 46 files, including the vendored folder: 0 problems.
4. **A row of shared buttons does not wrap.** Their words stay on one line, and Rosea's links row had no
`flex-wrap`, so on a 360 px phone it pushed the whole page sideways. The first after pictures showed it.
- *Fixed:* `.more`, `.actions` and `.choices` wrap.
5. **svelte-check could not type `Strike.svelte`** in v1.0.1, a component with no script. The first build here
added `allowJs`. v1.0.4 gives it a script upstream, so `allowJs` is gone again: no change to Rosea's tsconfigs.
6. **ESLint flagged three rules in the vendored `TextField.svelte`.** *Skipped:* `packages/domi-ui` is ignored,
linted upstream, and never edited here.
7. **The licence.**
- v1.0.1 was `UNLICENSED` and v1.0.2 MPL-2.0; neither left this machine.
- The copy now is **v1.5.0**, made by the design system's own `tools/vendor.mjs`. It refuses any tag before the
CPAL-1.0 v1.0.3, and writes `LICENSE`, `NOTICE`, `VERSION` and a `package.json` without scripts. It lives in
`packages/domi-ui` as `@domi/ui` (`workspace:*`).
- The three font packages arrive as its npm dependencies (OFL). Rosea imports none, and `dist/` has no font
file (counted: 0).
8. **The credit** (D9) is `<DomiCredit link={false} />`, added in 1.4.0 from this request. Without it, the web
address is a link that opens a new window. A tap must not carry the player out of an offline garden; on Android, with no internet,
it would lead into a page that never loads. Mark approved the line (via the Aula session): one quiet line on
every launch, never a splash.
- It stands at the foot of every screen: the first open, the garden and the Letter.
- A unit test holds the exact words and that no link to the address exists. The drill: without the line on
the garden, that test failed.
- The tension with CLAUDE.md's *Domi never appears alone* is Mark's to reconcile in his file. The phrase is the
licence's.
9. **The README** says what §6a asks: *Contains @domi/ui (CPAL-1.0, …), in `packages/domi-ui`*. It now names the
public-domain sources of the candidate sentences and the origin of the placeholder art, as the domi-licence
session asked. `tauri.conf.json` declares `"license": "CPAL-1.0"` for the bundles.
10. **Android's Autofill request.** v1.1.0's `TextField as="auto"` draws an editable box on Android, so focusing
the town field no longer makes the WebView ask Google's Autofill service. That request is made by the system's
service, not Rosea's process, so her missing `INTERNET` permission never stopped it. *Fixed (D10)*, with two
unit tests (Android: no native field; elsewhere: the native search field), and the drill fails without it.
The Aula pictures' phone uses an Android user agent, so they type into the editable box in a real browser.
*Not measured on the Wave 10:* the release APK's next phone run should watch for the Autofill request.
## Soul, privacy, reachability, offline
- **Soul:** no words changed except the seal's name, and no gesture changed. The look is Mark's call (above).
- **Privacy:** nothing new leaves the device. The vendored CSS is bundled, with no font files and no requests;
the e2e suite fails on any request outside the origin.
- **Reachability:** none.
- **Offline:** `pnpm test:offline` 1 passed.
## Gates (this branch, v1.5.0, 2026-11-23)
- `pnpm test`: **646 passed**. By package: cpu-guard 13, schema 19, identity 5, release 8, storage 70, content 88,
art-prep 80, tauri 92, ui 92 (88 before, plus 2 credit tests and 2 Android-field tests), engine 179.
- `pnpm lint`, `pnpm typecheck`: clean. `pnpm lint:copy`: 30 files, 0 problems. `pnpm validate:library`: 13 of 13
fixtures rejected.
- `pnpm test:e2e`: **26 passed** against the built app, axe included. `pnpm test:offline`: **1 passed**. The Aula
pictures: **2 passed**; their phone has an Android user agent and types into the editable box.
- No font file in `dist/`. `pnpm look:shots`: 28 pictures after, compared with the 28 before.
- v1.5.0 (*Move the chair* as `Button`): the same counts again: 646 tests, e2e 26, offline 1. The pictures were not
retaken: the button renders the same classes and label as the markup it replaces.
- Drills, each restored after:
- without the credit on the garden, the credit test fails;
- with `DomiCredit`'s link back on, it fails;
- with a native town field on Android, the Android test fails;
- domi-design's two Button tests fail on the old Button.
## Not verified
- The Android and Windows apps: same game, same CSS. Not rebuilt.
- A screen reader. The roles and names are checked by the tests and axe, not heard.
+2
View File
@@ -42,5 +42,7 @@ apps/rosea-tauri/src-tauri/atrium/
# The Aula pictures, taken by `pnpm aula:shots` (e2e/aula.spec.ts) and published by Fabrica, never committed
e2e/aula/
# Before-and-after pictures of a change of look (`pnpm look:shots`), never committed
e2e/look/
# Fabrica's records of `fabrica tests run` (run.json, traces): local evidence, quoted in the reviews, never committed
.fabrica/runs/
+15 -1
View File
@@ -2,7 +2,21 @@
Rewritten at the end of each session (CLAUDE.md §5.1).
## Latest — 2026-11-23: the licence
## Latest — 2026-11-23: @domi/ui, the shared look, and the credit
- **`feature/domi-ui`**: Rosea's buttons and her town search wear @domi/ui v1.5.0 (CPAL-1.0). On Android the town field is an editable box, so no Autofill request goes to Google.
- It is vendored unchanged into `packages/domi-ui` by the design system's `tools/vendor.mjs`.
- Her colours, system fonts, art and layout stay.
- The licence credit stands at the foot of every screen, in its exact words, as plain text.
- Analysis: [`.agents/features/domi-ui.md`](.agents/features/domi-ui.md). Review:
[`.agents/reviews/feature-domi-ui.md`](.agents/reviews/feature-domi-ui.md), which lists where the new look
meets her art rules, for Mark.
- Before and after pictures: `ROSEA_LOOK=before|after pnpm look:shots`.
- **To upgrade @domi/ui:** from a domi-design clone, `node tools/vendor.mjs <rosea>/packages/domi-ui <tag>`.
- **The Button fix** went from here to domi-design (PR mnovak/domi-design#18, released in 1.4.0): Water and Touch her
are `Button` again, and *Move the chair* too, with 1.5.0's `bind:element`.
## Earlier — 2026-11-23: the licence
- **`docs/licence`**: Rosea Domi is under **CPAL-1.0** from this commit; earlier commits carried no licence.
- `LICENSE` is the Domi template with the name filled in; `CPAL-1.0` is set in every `package.json` and in
+13 -3
View File
@@ -21,10 +21,20 @@ require:
> Built on Domi · https://aula.marek-novak.cz · Copyright (c) 2026 Marek Novák
Contains @domi/ui (CPAL-1.0, Copyright (c) 2026 Marek Novák), in `packages/domi-ui`; the rest of this repo is under
its own licence. The copy is unchanged, made by the design system's `tools/vendor.mjs` from its tag; its `NOTICE` and
`VERSION` say which. The game shows the credit above at the foot of every screen.
The licence does not cover what Marek Novák did not write. Those works keep their own terms:
- **The hope sentences** in `content/library/` quote public-domain works. Each entry names its source, translation
and who verified that it is in the public domain.
- **The hope sentences** quote public-domain works. They sit in `content/candidates/` until the author verifies each
one into `content/library/`, and every entry names its work, author, translation and public-domain status. The
sources include the King James Bible; Cicero (tr. Shuckburgh, 1900, and Peabody, 1887); Marcus Aurelius (tr. Long, 1862); Seneca (tr.
Stewart, 1889); Laozi (tr. Legge, 1891); the Dhammapada (tr. Müller, 1881); Sa'di (tr. Ross, 1823); Julian of
Norwich (ed. Warrack, 1901); Kahlil Gibran; Rabindranath Tagore (his own English, 1912); Thoreau, Muir, Emerson,
Dickinson, Whitman, Wordsworth, Rossetti and Stevenson.
- **The town list** (`packages/content/src/places/`) is made from Natural Earth and the IANA time zone database,
both in the public domain (`scripts/build-places.ts`).
- **The sun's reference tables** used by the tests name their source in the tests.
- **The sun's reference tables** used by the tests come from the U.S. Naval Observatory and name it in the fixture.
- **The pictures** in `art/placeholders/` are stand-ins drawn in code by this repository's `tools/art-prep`, under
its licence. There is no third-party art.
@@ -30,6 +30,7 @@
"active": true,
"icon": ["icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png", "icons/icon.icns", "icons/icon.ico"],
"category": "Game",
"license": "CPAL-1.0",
"shortDescription": "A rose to tend, a fox to befriend, and the time we give to people.",
"windows": { "nsis": { "installMode": "currentUser" } }
}
+1 -1
View File
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="en">
<html lang="en" data-domi-room="rosea" data-domi-theme="auto">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
+1 -1
View File
@@ -53,7 +53,7 @@ function watch(page: Page): string[] {
async function chooseGardenerAndTown(page: Page): Promise<void> {
await pastGardener(page);
await page.getByRole('searchbox', { name: en.sunset.searchLabel }).fill('prague');
await page.getByLabel(en.sunset.searchLabel).fill('prague');
await page.getByRole('button', { name: /^Prague/ }).first().click();
await storedTown(page, 'Prague');
}
+90
View File
@@ -0,0 +1,90 @@
import { mkdirSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
import { expect, test, type Browser, type Page } from '@playwright/test';
import { en } from '@rosea/ui/copy';
import { openRing, pastGardener } from './garden.js';
import { startStaticServer, type StaticServer } from './static-server.js';
/**
* Every screen with a control, photographed from the BUILT PWA in the light and the dark, on a phone and a desktop:
* the before-and-after pictures a change of look needs (domi-ui.md; @domi/ui docs/INTEGRATE.md §0). This makes
* pictures, not assertions, so it has its own config and `pnpm test:e2e` never runs it.
*
* ROSEA_LOOK=before pnpm look:shots writes e2e/look/before/<theme>-<device>-<screen>.png (git-ignored)
*
* Nothing is read from a player: a fresh garden, no town until the search is shown, a fixed day in March.
*/
const LABEL = process.env['ROSEA_LOOK'] ?? 'now';
const OUT = fileURLToPath(new URL(`./look/${LABEL}/`, import.meta.url));
const ZONE = 'Europe/Prague';
const DAY = Date.parse('2026-03-10T08:00:00+01:00');
let server: StaticServer;
test.beforeAll(async () => {
mkdirSync(OUT, { recursive: true });
server = await startStaticServer();
});
test.afterAll(async () => {
await server.close();
});
test.describe.configure({ mode: 'serial', timeout: 240_000 });
async function photograph(browser: Browser, theme: 'light' | 'dark', phone: boolean): Promise<void> {
const device = phone ? 'phone' : 'desktop';
const context = await browser.newContext({
timezoneId: ZONE,
locale: 'en-US',
colorScheme: theme,
reducedMotion: 'reduce',
...(phone
? { viewport: { width: 360, height: 800 }, deviceScaleFactor: 2, isMobile: true, hasTouch: true }
: { viewport: { width: 1280, height: 800 }, deviceScaleFactor: 1 })
});
const shot = (page: Page, screen: string): Promise<Buffer> =>
page.screenshot({ path: `${OUT}${theme}-${device}-${screen}.png`, animations: 'disabled', caret: 'hide' });
try {
const page = await context.newPage();
await page.clock.install({ time: DAY });
await page.goto(server.url);
await expect(page.getByRole('heading', { level: 2, name: en.gardener.question })).toBeVisible({ timeout: 20_000 });
await shot(page, '1-gardener');
await pastGardener(page);
const search = page.getByLabel(en.sunset.searchLabel);
await expect(search).toBeVisible();
await shot(page, '2-town-empty');
await search.fill('prague');
await expect(page.getByRole('button', { name: /^Prague/ }).first()).toBeVisible();
await shot(page, '3-town-results');
await page.getByRole('button', { name: /^Prague/ }).first().click();
await expect(page.getByRole('button', { name: en.rose.care })).toBeVisible();
await shot(page, '4-garden');
await openRing(page);
await shot(page, '5-ring');
await page.keyboard.press('Escape');
await page.getByRole('button', { name: en.rose.numbers }).click();
await page.getByRole('button', { name: en.rose.safe.title }).click();
await page.getByRole('button', { name: en.rose.safe.save }).scrollIntoViewIfNeeded();
await shot(page, '6-numbers-safe');
await page.reload();
await page.getByRole('button', { name: en.chair.move }).click();
const scene = page.getByRole('dialog', { name: en.chair.scene });
await expect(scene).toBeVisible();
await page.clock.runFor(30_000);
await shot(page, '7-sunset');
} finally {
await context.close();
}
}
for (const theme of ['light', 'dark'] as const) {
for (const phone of [true, false]) {
test(`${theme}, ${phone ? 'phone' : 'desktop'}`, async ({ browser }) => {
await photograph(browser, theme, phone);
});
}
}
+19
View File
@@ -0,0 +1,19 @@
import { defineConfig, devices } from '@playwright/test';
/**
* The before-and-after pictures of a change of look (`pnpm look:shots`, e2e/look.spec.ts): the BUILT PWA in the
* light and the dark, written to e2e/look/<ROSEA_LOOK>/ (git-ignored). Its own config, so `pnpm test:e2e` stays the
* suite of record and the pictures are taken only when asked for.
*/
export default defineConfig({
testDir: '.',
testMatch: /look\.spec\.ts/,
fullyParallel: false,
workers: 1,
retries: 0,
reporter: [['list']],
use: {
...devices['Desktop Chrome'],
trace: 'retain-on-failure'
}
});
+2 -1
View File
@@ -191,7 +191,8 @@ test.describe('the sunset place, in Prague\'s time zone at noon on 29 March 2026
await page.clock.setFixedTime(NOON);
await open(page);
await page.getByRole('searchbox').fill('pra');
await expect(page.getByRole('status')).not.toHaveText('');
// The question's own status line (every @domi/ui button also carries an empty one, .domi-sr).
await expect(page.getByRole('status').and(page.locator('.found'))).not.toHaveText('');
expect((await new AxeBuilder({ page }).analyze()).violations.map((v) => `${v.id}: ${v.help}`)).toEqual([]);
await page.getByRole('button', { name: /^Prague/ }).first().click();
await expect(page.locator('.sun')).toBeVisible();
+3 -1
View File
@@ -38,7 +38,9 @@ export default [
'.claude/**',
'**/target/**',
// Fabrica's records of `fabrica tests run` (git-ignored): its own reporter, not Rosea's code.
'.fabrica/runs/**'
'.fabrica/runs/**',
// @domi/ui, vendored as it was tagged (packages/domi-ui/NOTICE): never edited here, linted upstream.
'packages/domi-ui/**'
]
},
+1
View File
@@ -18,6 +18,7 @@
"test:offline": "pnpm guard:cpu && turbo run build --filter=@rosea/app && playwright test --config=e2e/playwright.offline.config.ts",
"test:android": "tsx scripts/android-smoke.ts",
"aula:shots": "pnpm guard:cpu && turbo run build --filter=@rosea/app && playwright test --config=e2e/playwright.aula.config.ts",
"look:shots": "pnpm guard:cpu && turbo run build --filter=@rosea/app && playwright test --config=e2e/playwright.look.config.ts",
"validate:library": "tsx scripts/validate-library.ts",
"library:verify": "tsx scripts/verify-sentences.ts",
"lint:copy": "tsx scripts/lint-copy.ts",
+101
View File
@@ -0,0 +1,101 @@
# Changelog
## 1.5.0 (2026-11-23)
- `Button bind:element`: the `<button>` itself, for focusing it from outside (return focus after a dialog or a scene
change). Asked by Rosea.
## 1.4.0 (2026-11-23)
- `DomiCredit link={false}`: the same credit with the URL as plain text, for an offline app (asked by Rosea). The licence
asks for the URL to be shown, not to be clickable.
- Visual tests: one retry, so an intermittent shot is reported as flaky by name.
- Fix: `Button` dropped an `onkeydown` or `onblur` passed to it, because its own handlers came after `{...rest}`. It
now runs the passed one first, then its own (Escape and blur still disarm a confirm). Found in Rosea, where a held
Space pours water and blur stops the pour.
## 1.3.1 (2026-11-23)
- **Praeco Domi's brass is now `#ab821e`** (Mark: "Move praeco apart"). A burnished, darker herald's brass: 0.101 from
Tabula's gold in OKLab distance (was 0.026), 0.136 from Ostende, at least 0.10 from every app. Text 5.0:1 or more on every dark
ground; leaf `#c89e41` → `#b88e2f` → `#ab821e` with a dark label, 5.5:1 or more. Tabula keeps its gold. Atrium's
catalogue.rs and Praeco take the new hex. A patch by Mark's request: a colour fix for a palette entry.
- Tests: screenshot comparison now uses a per-pixel colour tolerance of 0.02 (Playwright's default 0.2 let the old
Praeco brass pass against the new one). Under it, five earlier baselines turned out slightly off and were renewed:
the light-theme leaf on hover (the 1.0.1 hover fix) and switch and segmented focus. Contrast numbers were never affected.
## 1.3.0 (2026-11-23)
- **Praeco Domi** (`praeco`, label Marketing): brass `#c9a227` (Praeco-plan J1), Scaena's royal red `#9B1B30` as the
second light through its text tint `#d6565f`. All 66 of its contrast pairs pass. Its brass sits 0.026 from Tabula's gold in
OKLab distance: the two tiles read alike; Mark to decide (PALETTE.md).
## 1.2.0 (2026-11-23)
- **The seal without a script**: on a static page (Aula), `.domi-field:has(.domi-field__input:placeholder-shown)` lays
the seal flat from CSS alone, for `<input>` and `<textarea>`; give it a placeholder (`" "` if none). The seal stays an
enabled button there, so the server treats an empty submit as nothing. Fields with `data-state` (the Svelte component)
are skipped, so a cleared field keeps its lit "sent" seal. TextField.md, "Without a script". Asked by Aula.
- Docs: testing a field in both modes (TextField.md).
## 1.1.0 (2026-11-23)
- **TextField `as="editable" | "auto"`**: the field drawn with a contenteditable `role="textbox"` instead of a native
`<input>`/`<textarea>`, because on Android the WebView sends an Autofill request to Google whenever a native text
field gets focus (found by Amicitia). Same look, seal, keys and states; plain-text paste; label by
`aria-labelledby`; `inputmode` from the type; a hidden input for `name`. `auto` = editable on Android only.
Passwords always stay native. New `editor` binding; `input` keeps its type. `isAndroid()` exported.
- Docs: the credit goes by repo visibility (Mark): apps whose own repo is public, and public repos carrying a copy,
show it; apps built from a private repo show none, paid or free.
## 1.0.4 (2026-11-23)
- Fix: `Strike.svelte` had no `<script>` block, so a consumer whose tsconfig has `allowJs` off (Ludus) got "Could not
find a declaration file" from svelte-check for it and for Button, TextField and index.ts. It now has
`<script lang="ts">`. `pnpm check` also runs svelte-check the way a consumer does (`tsconfig.consumer.json`).
- Docs: the credit is for free and public apps and public repos carrying a copy; paid apps show none (Mark).
pnpm 9 and the `#` in a git dependency's store folder: `virtual-store-dir-max-length=60` (INTEGRATE.md §1).
## 1.0.3 (2026-11-23)
- **Licence: CPAL-1.0** (Common Public Attribution License), Mark's licence for @domi/ui and every public Domi repo.
`LICENSE` is the Domi template with only the Original Code named (@domi/ui). Redistribution, and any app built
with it, must show the Exhibit B credit: "Built on Domi · https://aula.marek-novak.cz · Copyright (c) 2026 Marek
Novák". v1.0.2 stays MPL-2.0 for those who received it. Fonts stay OFL.
- `DomiCredit` component and `DOMI_ATTRIBUTION` / `DOMI_ATTRIBUTION_TEXT`: the credit, exactly.
- `tools/vendor.mjs`: copies a tag into an app as a workspace package (INTEGRATE.md §6a), for Nix and offline builds;
refuses tags before 1.0.3 and writes the credit into the copy (`NOTICE`).
## 1.0.2 (2026-11-22)
- Licensed under the Mozilla Public License 2.0 (was unlicensed), so a public Domi app may carry a copy (Mark allowed
it for Rosea). `LICENSE` and `CHANGELOG.md` ship with the package; INTEGRATE.md gains "Vendoring". No code or
visual change.
## 1.0.1 (2026-11-22)
- Fix: the primary leaf's hover gradient lightened every stop by mixing in white, which dropped a white label below
4.5:1 on the top stop (Arena Domi 3.94:1; also Atrium Domi, Liber, Calenda and other white-label leaves). The hover
stops are now computed per app and theme in the token build (`--domi-leaf-hover-hi|mid|lo-<app>`), keep the
1.0.0 mix where the label still reads, and are checked to 4.5:1 like the resting stops. Leaves with a dark label
look exactly as before. Reported by the Arena Domi session.
## 1.0.0 (2026-11-22)
First release.
- Audit of every Domi app's styles (docs/AUDIT.md, audit/raw.json).
- Palette of 29 apps by role, from their code (Arena Domi: a proposed teal, it has no code yet); shared dark theme (ink) and a new light theme (parchment) with every
accent derived to WCAG AA; rooms keep each app's own dark ground. CSS, JSON, WPF XAML; PALETTE.md with contrast.
- Foundation tokens: type (Cinzel, Cormorant Garamond, Manrope from npm), space, radius, sizes with a 48 dp touch
floor, motion with reduced motion.
- Components (Svelte 5 and plain CSS): Button (plate, primary leaf, quiet, danger, armed confirm; loading, success,
error; glint, press sink, seal impression; keyboard press), TextField with the integrated send seal (send, search,
save, next; single and multi-line; sending, sent, error; Enter and Shift+Enter; soft keyboard rule), Checkbox,
Radio, Switch, Select, Segmented, Icon.
- Legacy aliases per app (`@domi/ui/legacy/<app>.css`) and MIGRATION.md.
- Showcase; unit tests; screenshot tests per component and state (baselines attached to the release).
Not in 1.0: the desktop window frame (`.win`, `WindowFrame.svelte`), dialogs, menus, non-text inputs (number
stepper, date, colour).
+168
View File
@@ -0,0 +1,168 @@
Common Public Attribution License Version 1.0 (CPAL)
1. “Definitions”
1.0.1 “Commercial Use” means distribution or otherwise making the Covered Code available to a third party.
1.1 “Contributor” means each entity that creates or contributes to the creation of Modifications.
1.2 “Contributor Version” means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor.
1.3 “Covered Code” means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof.
1.4 “Electronic Distribution Mechanism” means a mechanism generally accepted in the software development community for the electronic transfer of data.
1.5 “Executable” means Covered Code in any form other than Source Code.
1.6 “Initial Developer” means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A.
1.7 “Larger Work” means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
1.8 “License” means this document.
1.8.1 “Licensable” means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
1.9 “Modifications” means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is:
A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications.
B. Any new file that contains any part of the Original Code or previous Modifications.
1.10 “Original Code” means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License.
1.10.1 “Patent Claims” means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
1.11 “Source Code” means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor’s choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge.
1.12 “You” (or “Your”) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, “You” includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
2. Source Code License.
2.1 The Initial Developer Grant.
The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
(a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and
(b) under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof).
(c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License.
(d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code; or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices.
2.2 Contributor Grant.
Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license
(a) under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and
(b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
(c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code.
(d) Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2) separate from the Contributor Version; 3) for infringements caused by: i) third party modifications of Contributor Version or ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor.
3. Distribution Obligations.
3.1 Application of License.
The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients’ rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5.
3.2 Availability of Source Code.
Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party.
3.3 Description of Modifications.
You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code.
3.4 Intellectual Property Matters
(a) Third Party Claims. If Contributor has knowledge that a license under a third party’s intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled “LEGAL” which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained.
(b) Contributor APIs. If Contributor’s Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file.
(c) Representations. Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor’s Modifications are Contributor’s original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License.
3.5 Required Notices.
You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients’ rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
3.6 Distribution of Executable Versions.
You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients’ rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient’s rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer, Original Developer or any Contributor. You hereby agree to indemnify the Initial Developer, Original Developer and every Contributor for any liability incurred by the Initial Developer, Original Developer or such Contributor as a result of any such terms You offer.
3.7 Larger Works.
You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code.
4. Inability to Comply Due to Statute or Regulation.
If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
5. Application of this License.
This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code.
6. Versions of the License.
6.1 New Versions.
Socialtext, Inc. (“Socialtext”) may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.
6.2 Effect of New Versions.
Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Socialtext. No one other than Socialtext has the right to modify the terms applicable to Covered Code created under this License.
6.3 Derivative Works.
If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases “Socialtext”, “CPAL” or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the CPAL. (Filling in the name of the Initial Developer, Original Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.)
7. DISCLAIMER OF WARRANTY.
COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN “AS IS” BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER, ORIGINAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
8. TERMINATION.
8.1 This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
8.2 If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer, Original Developer or a Contributor (the Initial Developer, Original Developer or Contributor against whom You file such action is referred to as “Participant”) alleging that:
(a) such Participant’s Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above.
(b) any software, hardware, or device, other than such Participant’s Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant.
8.3 If You assert a patent infringement claim against Participant alleging that such Participant’s Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license.
8.4 In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination.
9. LIMITATION OF LIABILITY.
UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ORIGINAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY’S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
10. U.S. GOVERNMENT END USERS.
The Covered Code is a “commercial item,” as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of “commercial computer software” and “commercial computer software documentation,” as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
11. MISCELLANEOUS.
This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys’ fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License.
12. RESPONSIBILITY FOR CLAIMS.
As between Initial Developer, Original Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer, Original Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
13. MULTIPLE-LICENSED CODE.
Initial Developer may designate portions of the Covered Code as Multiple-Licensed. Multiple-Licensed means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the CPAL or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A.
14. ADDITIONAL TERM: ATTRIBUTION
(a) As a modest attribution to the organizer of the development of the Original Code (“Original Developer”), in the hope that its promotional value may help justify the time, money and effort invested in writing the Original Code, the Original Developer may include in Exhibit B (“Attribution Information”) a requirement that each time an Executable and Source Code or a Larger Work is launched or initially run (which includes initiating a session), a prominent display of the Original Developer’s Attribution Information (as defined below) must occur on the graphic user interface employed by the end user to access such Covered Code (which may include display on a splash screen), if any. The size of the graphic image should be consistent with the size of the other elements of the Attribution Information. If the access by the end user to the Executable and Source Code does not create a graphic user interface for access to the Covered Code, this obligation shall not apply. If the Original Code displays such Attribution Information in a particular form (such as in the form of a splash screen, notice at login, an “about” display, or dedicated attribution area on user interface screens), continued use of such form for that Attribution Information is one way of meeting this requirement for notice.
(b) Attribution information may only include a copyright notice, a brief phrase, graphic image and a URL (“Attribution Information”) and is subject to the Attribution Limits as defined below. For these purposes, prominent shall mean display for sufficient duration to give reasonable notice to the user of the identity of the Original Developer and that if You include Attribution Information or similar information for other parties, You must ensure that the Attribution Information for the Original Developer shall be no less prominent than such Attribution Information or similar information for the other party. For greater certainty, the Original Developer may choose to specify in Exhibit B below that the above attribution requirement only applies to an Executable and Source Code resulting from the Original Code or any Modification, but not a Larger Work. The intent is to provide for reasonably modest attribution, therefore the Original Developer cannot require that You display, at any time, more than the following information as Attribution Information: (a) a copyright notice including the name of the Original Developer; (b) a word or one phrase (not exceeding 10 words); (c) one graphic image provided by the Original Developer; and (d) a URL (collectively, the “Attribution Limits”).
(c) If Exhibit B does not include any Attribution Information, then there are no requirements for You to display any Attribution Information of the Original Developer.
(d) You acknowledge that all trademarks, service marks and/or trade names contained within the Attribution Information distributed with the Covered Code are the exclusive property of their owners and may only be used with the permission of their owners, or under circumstances otherwise permitted by law or as expressly set out in this License.
15. ADDITIONAL TERM: NETWORK USE.
The term “External Deployment” means the use, distribution, or communication of the Original Code or Modifications in any way such that the Original Code or Modifications may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Code or Modifications as a distribution under section 3.1 and make Source Code available under Section 3.2.
EXHIBIT A. Common Public Attribution License Version 1.0.
"The contents of this file are subject to the Common Public Attribution License Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://opensource.org/license/cpal_1-0. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
The Original Code is @domi/ui.
The Original Developer is the Initial Developer.
The Initial Developer of the Original Code is Marek Novák. All portions of the code written by Marek Novák are Copyright (c) 2026. All Rights Reserved.
Contributor: none."
EXHIBIT B. Attribution Information
Attribution Copyright Notice: Copyright (c) 2026 Marek Novák
Attribution Phrase (not exceeding 10 words): Built on Domi
Attribution URL: https://aula.marek-novak.cz
Graphic Image as provided in the Covered Code, if any: none.
Display of Attribution Information is required in Larger Works which are defined in the CPAL as a work which combines Covered Code or portions thereof with code not governed by the terms of the CPAL.
+11
View File
@@ -0,0 +1,11 @@
This folder is @domi/ui v1.5.0, copied unchanged from domi-design by tools/vendor.mjs.
Licence: Common Public Attribution License 1.0 (LICENSE). Original Code: @domi/ui. Initial Developer: Marek Novák.
Attribution Information (Exhibit B). Any app built with this code shows, prominently in its user interface when
it starts or a session begins, exactly:
Built on Domi · https://aula.marek-novak.cz · Copyright (c) 2026 Marek Novák
<DomiCredit /> renders it. Fonts are not covered: @fontsource-variable/* under the SIL OFL 1.1.
Do not edit these files here: change domi-design and vendor the next tag. A change made here must be described
in a file in this folder (CPAL §3.3).
+1
View File
@@ -0,0 +1 @@
v1.5.0
+37
View File
@@ -0,0 +1,37 @@
{
"name": "@domi/ui",
"version": "1.5.0",
"description": "The Domi design system: tokens for every Domi app, struck buttons and fields with an integrated send button, Svelte 5 components. Vendored copy of v1.5.0: do not edit here; change domi-design and vendor the next tag.",
"license": "CPAL-1.0",
"type": "module",
"svelte": "./src/index.ts",
"types": "./src/index.ts",
"exports": {
".": {
"types": "./src/index.ts",
"svelte": "./src/index.ts",
"default": "./src/index.ts"
},
"./tokens": {
"types": "./src/tokens/generated.ts",
"default": "./src/tokens/generated.ts"
},
"./domi.css": "./src/css/domi.css",
"./tokens.css": "./src/css/tokens.css",
"./base.css": "./src/css/base.css",
"./components.css": "./src/css/components.css",
"./fonts.css": "./src/css/fonts.css",
"./legacy/*": "./src/css/legacy/*"
},
"sideEffects": [
"**/*.css"
],
"peerDependencies": {
"svelte": "^5.20.0"
},
"dependencies": {
"@fontsource-variable/cinzel": "5.3.0",
"@fontsource-variable/cormorant-garamond": "5.3.0",
"@fontsource-variable/manrope": "5.3.0"
}
}
@@ -0,0 +1,164 @@
<script lang="ts">
import type { Snippet } from 'svelte';
import type { HTMLButtonAttributes } from 'svelte/elements';
import Icon from './Icon.svelte';
import Strike from './Strike.svelte';
import { strike } from '../lib/strike';
import { failureText, type ButtonState } from '../lib/keys';
import type { IconName } from '../lib/icons';
interface Props extends Omit<HTMLButtonAttributes, 'onclick' | 'class' | 'children'> {
/** plate: every ordinary action. primary: the one leaf per screen. quiet: toolbars and third actions. danger: deletes. */
variant?: 'plate' | 'primary' | 'quiet' | 'danger';
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
icon?: IconName;
/** Icon only: the label becomes the accessible name and the tooltip. */
iconOnly?: boolean;
/** The words on the button. Required for iconOnly (it is the accessible name), else use children. */
label?: string;
block?: boolean;
/** Set to drive the state yourself. Left unset, a Promise returned by onclick drives it. */
status?: ButtonState;
/** May return a Promise: the button shows loading, then success (briefly) or error. */
onclick?: (event: MouseEvent) => unknown;
/**
* Two-step confirmation for danger: the first press arms the button and shows this text ("Press again to
* delete"); a second press within confirmFor ms runs onclick. Escape, blur or the timeout disarms it.
*/
confirm?: string;
confirmFor?: number;
/** Announced while working, when done, and when it failed (unless the error is a DomiError with its own text). */
busyText?: string;
doneText?: string;
failText?: string;
/** Showcase and tests only: show hover, press or focus without the pointer. */
force?: string;
class?: string;
children?: Snippet;
/** The <button> element, for focusing it from outside (bind:element), e.g. to return focus after a dialog. */
element?: HTMLButtonElement | null;
}
let {
variant = 'plate',
size = 'md',
icon,
iconOnly = false,
label,
block = false,
status,
onclick,
confirm,
confirmFor = 4000,
busyText = 'Working',
doneText = 'Done',
failText = 'That did not work. Try again.',
force,
class: cls = '',
disabled = false,
type = 'button',
children,
// Taken out of rest, so the button can run them before its own (a spread before the attribute would lose them).
onkeydown: passedKeydown,
onblur: passedBlur,
element = $bindable(null),
...rest
}: Props = $props();
let auto = $state<ButtonState>('idle');
let armed = $state(false);
let said = $state('');
let timer: ReturnType<typeof setTimeout> | undefined;
let armTimer: ReturnType<typeof setTimeout> | undefined;
const shown = $derived<ButtonState>(status ?? auto);
const busy = $derived(shown === 'loading');
function hold(): number {
const v = getComputedStyle(document.documentElement).getPropertyValue('--domi-dur-hold');
return Math.max(900, parseFloat(v) || 1400);
}
function disarm() {
armed = false;
clearTimeout(armTimer);
}
async function press(event: MouseEvent) {
if (disabled || busy) {
event.preventDefault();
return;
}
if (confirm && !armed) {
armed = true;
said = confirm;
clearTimeout(armTimer);
armTimer = setTimeout(disarm, confirmFor);
return;
}
disarm();
const result = onclick?.(event);
const thenable = result != null && typeof (result as PromiseLike<unknown>).then === 'function';
if (!thenable || status !== undefined) return;
clearTimeout(timer);
auto = 'loading';
said = busyText;
try {
await result;
auto = 'success';
said = doneText;
timer = setTimeout(() => (auto = 'idle'), hold());
} catch (err) {
auto = 'error';
said = failureText(err, failText);
}
}
$effect(() => () => {
clearTimeout(timer);
clearTimeout(armTimer);
});
</script>
<button
bind:this={element}
{...rest}
{type}
{disabled}
class={[
'domi-btn',
variant !== 'plate' && `domi-btn--${variant}`,
size !== 'md' && `domi-btn--${size}`,
iconOnly && 'domi-btn--icon',
block && 'domi-btn--block',
cls,
]}
data-state={shown === 'idle' ? undefined : shown}
data-armed={armed ? '' : undefined}
data-force={force}
aria-busy={busy ? 'true' : undefined}
aria-disabled={busy ? 'true' : undefined}
aria-label={iconOnly ? (armed ? confirm : label) : undefined}
title={iconOnly ? (armed ? confirm : label) : undefined}
onclick={press}
onkeydown={(e) => {
passedKeydown?.(e);
if (e.key === 'Escape' && armed) disarm();
}}
onblur={(e) => {
passedBlur?.(e);
disarm();
}}
use:strike
>
<span class="domi-btn__label">
{#if shown === 'error'}<Icon name="alert" />{:else if icon}<Icon name={icon} />{/if}
{#if !iconOnly}
{#if armed}{confirm}{:else if children}{@render children()}{:else}{label}{/if}
{/if}
</span>
<span class="domi-btn__state domi-btn__state--loading"><Strike /></span>
<span class="domi-btn__state domi-btn__state--success">
{#if shown === 'success'}<Icon name="check" draw />{/if}
</span>
</button>
<span class="domi-sr" role="status">{said}</span>
@@ -0,0 +1,59 @@
<script lang="ts">
import type { Snippet } from 'svelte';
import { icons } from '../lib/icons';
interface Props {
checked?: boolean;
/** Part of a group is chosen: shows a bar and reads as "mixed". */
indeterminate?: boolean;
label?: string;
hint?: string;
name?: string;
value?: string;
disabled?: boolean;
required?: boolean;
onchange?: (checked: boolean) => void;
force?: string;
class?: string;
children?: Snippet;
}
let {
checked = $bindable(false),
indeterminate = $bindable(false),
label,
hint,
name,
value,
disabled = false,
required = false,
onchange,
force,
class: cls = '',
children,
}: Props = $props();
const uid = $props.id();
</script>
<label class={['domi-choice', cls]} data-force={force}>
<span class="domi-choice__control">
<input
class="domi-choice__input"
type="checkbox"
bind:checked
bind:indeterminate
{name}
{value}
{disabled}
{required}
aria-describedby={hint ? `domi-hint-${uid}` : undefined}
onchange={() => onchange?.(checked)}
/>
<svg class="domi-choice__mark" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d={indeterminate ? icons.minus : icons.check} />
</svg>
</span>
<span class="domi-choice__text">
<span>{#if children}{@render children()}{:else}{label}{/if}</span>
{#if hint}<span class="domi-choice__hint" id={`domi-hint-${uid}`}>{hint}</span>{/if}
</span>
</label>
@@ -0,0 +1,26 @@
<!-- SPDX-License-Identifier: CPAL-1.0 -->
<!--
The licence credit (CPAL-1.0 Exhibit B): "Built on Domi", the URL and the copyright notice, exactly. Place it where
it is seen when the app starts or a session begins (the first screen's foot, the sign-in screen, a splash), no less
prominent than any other credit there. The words are fixed by the licence: do not translate or shorten them.
-->
<script lang="ts">
import { DOMI_ATTRIBUTION as A } from '../lib/credit';
interface Props {
/**
* true (default): the URL is a link. false: the URL is plain text, for an offline app (Rosea's game, an app with
* no network): the licence asks for the URL to be shown, not to be clickable.
*/
link?: boolean;
class?: string;
}
let { link = true, class: cls = '' }: Props = $props();
</script>
<p class={['domi-credit', cls]}>
<!-- Real spaces around the dots, so copied text reads as the licence writes it; flex ignores them in layout. -->
<span>{A.phrase}</span> <span class="domi-credit__dot" aria-hidden="true">·</span>
{#if link}<a href={A.url} target="_blank" rel="noopener noreferrer">{A.url}</a>{:else}<span class="domi-credit__url">{A.url}</span>{/if}
<span class="domi-credit__dot" aria-hidden="true">·</span> <span>{A.copyright}</span>
</p>
@@ -0,0 +1,22 @@
<script lang="ts">
import { icons, type IconName } from '../lib/icons';
interface Props {
name: IconName;
/** Draws the path in one stroke when it appears (the check of a finished action). */
draw?: boolean;
class?: string;
}
let { name, draw = false, class: cls = '' }: Props = $props();
</script>
<svg
class={['domi-icon', draw && 'domi-check-draw', cls]}
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.8"
stroke-linecap="round"
stroke-linejoin="round"
aria-hidden="true"
focusable="false"><path d={icons[name]} /></svg>
@@ -0,0 +1,39 @@
<script lang="ts">
import type { Snippet } from 'svelte';
interface Props {
/** The group's chosen value. Bind the same variable on every radio of the group: bind:group. */
group?: string;
value: string;
name: string;
label?: string;
hint?: string;
disabled?: boolean;
onchange?: (value: string) => void;
force?: string;
class?: string;
children?: Snippet;
}
let { group = $bindable(''), value, name, label, hint, disabled = false, onchange, force, class: cls = '', children }: Props = $props();
const uid = $props.id();
</script>
<label class={['domi-choice', 'domi-choice--radio', cls]} data-force={force}>
<span class="domi-choice__control">
<input
class="domi-choice__input"
type="radio"
bind:group
{value}
{name}
{disabled}
aria-describedby={hint ? `domi-hint-${uid}` : undefined}
onchange={() => onchange?.(value)}
/>
<span class="domi-choice__mark" aria-hidden="true"></span>
</span>
<span class="domi-choice__text">
<span>{#if children}{@render children()}{:else}{label}{/if}</span>
{#if hint}<span class="domi-choice__hint" id={`domi-hint-${uid}`}>{hint}</span>{/if}
</span>
</label>
@@ -0,0 +1,62 @@
<script lang="ts">
import Icon from './Icon.svelte';
import { strike } from '../lib/strike';
import type { DomiOption } from '../types';
interface Props {
value?: string;
/** Names the group for a screen reader: "View". */
label: string;
options: DomiOption[];
disabled?: boolean;
onchange?: (value: string) => void;
/** Showcase only: value → forced state for that segment. */
force?: Record<string, string>;
class?: string;
}
let { value = $bindable(''), label, options, disabled = false, onchange, force = {}, class: cls = '' }: Props = $props();
let group: HTMLDivElement | undefined = $state();
const enabled = $derived(options.filter((o) => !o.disabled && !disabled));
function choose(v: string) {
if (v === value) return;
value = v;
onchange?.(v);
}
// A radio group: one tab stop; arrows move the choice and the focus, Home and End jump.
function keydown(e: KeyboardEvent) {
const i = enabled.findIndex((o) => o.value === value);
let j = i;
if (e.key === 'ArrowRight' || e.key === 'ArrowDown') j = (i + 1) % enabled.length;
else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') j = (i - 1 + enabled.length) % enabled.length;
else if (e.key === 'Home') j = 0;
else if (e.key === 'End') j = enabled.length - 1;
else return;
e.preventDefault();
const next = enabled[j];
if (!next) return;
choose(next.value);
group?.querySelector<HTMLButtonElement>(`[data-value="${CSS.escape(next.value)}"]`)?.focus();
}
</script>
<div bind:this={group} class={['domi-segmented', cls]} role="radiogroup" aria-label={label} tabindex="-1" onkeydown={keydown}>
{#each options as o (o.value)}
<button
type="button"
role="radio"
class="domi-segmented__item"
data-value={o.value}
data-force={force[o.value]}
aria-checked={o.value === value}
tabindex={o.value === value || (!value && o === enabled[0]) ? 0 : -1}
disabled={disabled || o.disabled}
onclick={() => choose(o.value)}
use:strike
>
{#if o.icon}<Icon name={o.icon} />{/if}{o.label}
</button>
{/each}
</div>
@@ -0,0 +1,44 @@
<script lang="ts">
import Icon from './Icon.svelte';
import type { DomiOption } from '../types';
interface Props {
/** Left unset, the first option is chosen. */
value?: string;
label: string;
hideLabel?: boolean;
options: DomiOption[];
hint?: string;
name?: string;
disabled?: boolean;
required?: boolean;
onchange?: (value: string) => void;
force?: string;
class?: string;
}
let { value = $bindable(), label, hideLabel = false, options, hint, name, disabled = false, required = false, onchange, force, class: cls = '' }: Props = $props();
const uid = $props.id();
</script>
<!-- A native select: on Android and iOS it opens the system picker, which is the right control for a thumb. -->
<div class={['domi-field', cls]}>
<label class={['domi-field__label', hideLabel && 'domi-sr']} for={`domi-select-${uid}`}>{label}</label>
<div class="domi-select" data-force={force}>
<select
class="domi-select__input"
id={`domi-select-${uid}`}
bind:value
{name}
{disabled}
{required}
aria-describedby={hint ? `domi-hint-${uid}` : undefined}
onchange={() => onchange?.(value ?? '')}
>
{#each options as o (o.value)}
<option value={o.value} disabled={o.disabled}>{o.label}</option>
{/each}
</select>
<Icon name="chevron-down" />
</div>
{#if hint}<p class="domi-field__hint" id={`domi-hint-${uid}`}>{hint}</p>{/if}
</div>
@@ -0,0 +1,6 @@
<script lang="ts">
// No props. The script block makes this a typed component for consumers whose tsconfig has allowJs off.
</script>
<!-- The loading mark: three Roman interpuncts struck in turn. Decorative; the state is announced in words. -->
<span class="domi-strike" aria-hidden="true"><i></i><i></i><i></i></span>
@@ -0,0 +1,23 @@
<script lang="ts">
interface Props {
checked?: boolean;
/** Says what is on: "Sync over mobile data". The switch reads as on or off after it. */
label: string;
disabled?: boolean;
onchange?: (checked: boolean) => void;
force?: string;
class?: string;
}
let { checked = $bindable(false), label, disabled = false, onchange, force, class: cls = '' }: Props = $props();
function toggle() {
if (disabled) return;
checked = !checked;
onchange?.(checked);
}
</script>
<button type="button" role="switch" class={['domi-switch', cls]} aria-checked={checked} {disabled} data-force={force} onclick={toggle}>
<span class="domi-switch__track" aria-hidden="true"><span class="domi-switch__knob"></span></span>
<span>{label}</span>
</button>
@@ -0,0 +1,429 @@
<script lang="ts">
import type { HTMLInputAttributes } from 'svelte/elements';
import Icon from './Icon.svelte';
import Strike from './Strike.svelte';
import { strike } from '../lib/strike';
import { canSend, enterAction, failureText, isSoftKeyboard, type FieldState } from '../lib/keys';
import type { IconName } from '../lib/icons';
import { caretToEnd, inputmodeFor, insertPlainText, isAndroid, readText, writeText } from '../lib/editable';
type Action = 'send' | 'search' | 'next' | 'save';
interface Props {
/** The text. Bind it: bind:value. */
value?: string;
/** The visible label. Every field has one; hideLabel keeps it for screen readers only (a chat composer). */
label: string;
hideLabel?: boolean;
hint?: string;
/** An error you show (validation). The field also shows its own when onsend fails. */
error?: string;
placeholder?: string;
type?: 'text' | 'email' | 'url' | 'password' | 'search' | 'tel' | 'number';
/** A multi-line field that grows with its text up to `rows` lines. */
multiline?: boolean;
rows?: number;
/**
* What the seal does. send (arrow): sends and clears. search (glass): searches. save (check): saves and keeps
* the text. next (chevron): in a form, goes to the next field; the last field of a form uses send or save.
*/
action?: Action;
/** The seal's accessible name, the words a screen reader says: "Send message", "Search books". */
actionLabel?: string;
/** Runs on Enter or the seal. Return a Promise to show sending, then sent or the error. */
onsend?: (value: string) => unknown;
/** Empty the field after a successful send. Default: true for send, false otherwise. */
clearOnSend?: boolean;
enterSends?: 'auto' | 'always' | 'never';
/** Set to drive the state yourself. */
status?: FieldState;
sendingText?: string;
sentText?: string;
failText?: string;
size?: 'md' | 'lg';
optional?: boolean;
disabled?: boolean;
readonly?: boolean;
required?: boolean;
name?: string;
id?: string;
autocomplete?: HTMLInputAttributes['autocomplete'];
inputmode?: HTMLInputAttributes['inputmode'];
maxlength?: number;
spellcheck?: boolean;
autofocus?: boolean;
/** Showcase and tests only: 'hover', 'focus' on the field, 'press'/'hover'/'focus' on the seal via sendForce. */
force?: string;
sendForce?: string;
class?: string;
/** The input element, for focusing it from outside (null in editable mode: see editor). */
input?: HTMLInputElement | HTMLTextAreaElement | null;
/**
* input (default): a native <input>/<textarea>. editable: a contenteditable box with role="textbox": on Android
* the WebView sends an Autofill request to Google whenever a native text field gets focus; an editable box does
* not. auto: editable on Android, native elsewhere. Passwords are always native (masking, password managers).
*/
as?: 'input' | 'editable' | 'auto';
/** The editable box in editable mode, for focusing it from outside. */
editor?: HTMLElement | null;
}
let {
value = $bindable(''),
label,
hideLabel = false,
hint,
error,
placeholder,
type = 'text',
multiline = false,
rows = 6,
action = 'send',
actionLabel,
onsend,
clearOnSend,
enterSends = 'auto',
status,
sendingText,
sentText,
failText,
size = 'md',
optional = false,
disabled = false,
readonly = false,
required = false,
name,
id,
autocomplete,
inputmode,
maxlength,
spellcheck,
autofocus = false,
force,
sendForce,
class: cls = '',
input = $bindable(null),
as = 'input',
editor = $bindable(null),
}: Props = $props();
const uid = $props.id();
const fieldId = $derived(id ?? `domi-field-${uid}`);
const hintId = `domi-hint-${uid}`;
const errorId = `domi-error-${uid}`;
const labelId = `domi-label-${uid}`;
const android = isAndroid();
const words: Record<Action, { label: string; icon: IconName; key: 'send' | 'search' | 'next' | 'done'; busy: string; done: string; fail: string }> = {
send: { label: 'Send', icon: 'send', key: 'send', busy: 'Sending', done: 'Sent', fail: 'Could not send. Try again.' },
search: { label: 'Search', icon: 'search', key: 'search', busy: 'Searching', done: 'Searched', fail: 'Could not search. Try again.' },
save: { label: 'Save', icon: 'save', key: 'done', busy: 'Saving', done: 'Saved', fail: 'Could not save. Try again.' },
next: { label: 'Next field', icon: 'next', key: 'next', busy: 'Checking', done: '', fail: 'Check this field.' },
};
const w = $derived(words[action]);
let auto = $state<FieldState>('idle');
let failure = $state('');
let said = $state('');
let revealed = $state(false);
let timer: ReturnType<typeof setTimeout> | undefined;
const shown = $derived<FieldState>(status ?? auto);
const empty = $derived(value.trim().length === 0);
const sendable = $derived(canSend(value, shown, disabled || readonly));
// While sending and just after, the seal stays lit (with the interpuncts, then the check) though it cannot be pressed.
const lit = $derived(sendable || shown === 'sending' || shown === 'sent');
const message = $derived(error ?? (shown === 'error' ? failure : ''));
const described = $derived([hint && hintId, message && errorId].filter(Boolean).join(' ') || undefined);
const inputType = $derived(type === 'password' && revealed ? 'text' : type);
const clears = $derived(clearOnSend ?? action === 'send');
const editable = $derived(type !== 'password' && (as === 'editable' || (as === 'auto' && android)));
/** The element that takes the text, whichever kind it is. */
const box = $derived<HTMLElement | null>(editable ? editor : input);
const locked = $derived(disabled || readonly || shown === 'sending');
function hold(): number {
const v = getComputedStyle(document.documentElement).getPropertyValue('--domi-dur-hold');
return Math.max(900, parseFloat(v) || 1400);
}
function nextField(from: HTMLElement) {
const scope = from.closest('form') ?? document;
const all = [...scope.querySelectorAll<HTMLElement>('.domi-field__input, input, textarea, select')].filter(
(el) => !el.hasAttribute('disabled') && el.getAttribute('aria-disabled') !== 'true' && el.getAttribute('type') !== 'hidden',
);
const i = all.indexOf(from);
all[i + 1]?.focus();
}
async function submit() {
if (!sendable || !box) return;
const el = box;
const text = value;
clearTimeout(timer);
failure = '';
if (!onsend) {
// No handler: behave like the form's own submit (or, for next, move on).
if (action === 'next') nextField(el);
else el.closest('form')?.requestSubmit();
return;
}
const result = onsend(text);
const thenable = result != null && typeof (result as PromiseLike<unknown>).then === 'function';
if (status !== undefined) return;
if (!thenable) return done(el);
auto = 'sending';
said = sendingText ?? w.busy;
try {
await result;
done(el);
} catch (err) {
auto = 'error';
failure = failureText(err, failText ?? w.fail);
said = failure;
el.focus();
}
}
function done(el: HTMLElement) {
if (clears) value = '';
if (action === 'next') {
auto = 'idle';
nextField(el);
return;
}
auto = 'sent';
said = sentText ?? w.done;
timer = setTimeout(() => (auto = 'idle'), hold());
if (document.activeElement !== el && el.isConnected) el.focus();
}
function keydown(e: KeyboardEvent) {
if (e.key === 'Escape' && shown === 'error' && status === undefined) {
auto = 'idle';
failure = '';
return;
}
const r = enterAction(e, { multiline, enterSends, softKeyboard: isSoftKeyboard() });
if (r === 'send') {
e.preventDefault();
if (shown !== 'sending') void submit();
} else if (r === 'ignore' && e.key === 'Enter' && e.altKey && !multiline) {
// Alt+Enter must not submit the form. An Enter that ends an input method's composition is left alone.
e.preventDefault();
} else if (editable && !multiline && e.key === 'Enter' && !e.isComposing && e.keyCode !== 229) {
// A single-line editable box never takes a line break.
e.preventDefault();
}
}
function typed() {
if (shown === 'error' && status === undefined) {
auto = 'idle';
failure = '';
}
if (shown === 'sent' && status === undefined) auto = 'idle';
grow();
}
// Editable mode: the box's text is the value. Typing, paste and drop bring plain text only.
function edited() {
if (!editor) return;
let t = readText(editor);
let rewrite = false;
if (!multiline && /\n/.test(t)) {
t = t.replace(/\r?\n/g, ' ');
rewrite = true;
}
if (maxlength !== undefined && t.length > maxlength) {
t = t.slice(0, maxlength);
rewrite = true;
}
if (t === '' && editor.childNodes.length > 0) rewrite = true; // a stray <br> would hide the placeholder
if (rewrite) {
writeText(editor, t);
if (t) caretToEnd(editor);
}
value = t;
typed();
}
function pasted(e: ClipboardEvent) {
if (!editor) return;
e.preventDefault();
if (locked) return;
let t = e.clipboardData?.getData('text/plain') ?? '';
if (!multiline) t = t.replace(/\r?\n/g, ' ');
insertPlainText(editor, t);
edited();
}
function dropped(e: DragEvent) {
if (!editor) return;
e.preventDefault();
const t = e.dataTransfer?.getData('text/plain') ?? '';
if (!t || locked) return;
editor.focus();
insertPlainText(editor, multiline ? t : t.replace(/\r?\n/g, ' '));
edited();
}
// A value set from outside (bind:value, a field cleared after sending) is written into the box.
$effect(() => {
const v = value;
if (editable && editor && readText(editor) !== v) writeText(editor, v);
});
// field-sizing: content grows the textarea in Chromium (WebView2, Android WebView); elsewhere, grow it here.
const sizesItself = typeof CSS !== 'undefined' && CSS.supports?.('field-sizing', 'content');
function grow() {
if (!multiline || sizesItself || !(input instanceof HTMLTextAreaElement)) return;
input.style.height = 'auto';
input.style.height = `${input.scrollHeight}px`;
}
$effect(() => {
void value;
grow();
});
$effect(() => () => clearTimeout(timer));
$effect(() => {
if (autofocus) box?.focus();
});
function focusBox() {
if (!box) return;
box.focus();
if (editable) caretToEnd(box);
}
function focusInput(e: MouseEvent) {
if (e.target === e.currentTarget) focusBox();
}
</script>
<div
class={['domi-field', multiline && 'domi-field--multiline', size === 'lg' && 'domi-field--lg', cls]}
data-state={shown === 'idle' ? undefined : shown}
data-empty={empty ? '' : undefined}
data-disabled={disabled ? '' : undefined}
>
{#if editable}
<!-- An editable box is not a labelable element: the label names it through aria-labelledby; a click focuses it. -->
<!-- svelte-ignore a11y_click_events_have_key_events a11y_no_static_element_interactions -->
<span class={['domi-field__label', hideLabel && 'domi-sr']} id={labelId} role="presentation" onclick={focusBox}>
{label}{#if optional}<span class="domi-field__optional">{" (optional)"}</span>{/if}
</span>
{:else}
<label class={['domi-field__label', hideLabel && 'domi-sr']} for={fieldId} id={labelId}>
{label}{#if optional}<span class="domi-field__optional">{" (optional)"}</span>{/if}
</label>
{/if}
<!-- svelte-ignore a11y_click_events_have_key_events a11y_no_static_element_interactions -->
<div class="domi-field__well" role="presentation" data-force={force} onclick={focusInput}>
{#if editable}
<div
bind:this={editor}
class={['domi-field__input', 'domi-field__input--editable', multiline && 'domi-field__input--lines']}
id={fieldId}
role="textbox"
tabindex={disabled ? -1 : 0}
contenteditable={locked ? 'false' : 'plaintext-only'}
aria-labelledby={labelId}
aria-multiline={multiline ? 'true' : 'false'}
aria-describedby={described}
aria-invalid={message ? 'true' : undefined}
aria-required={required ? 'true' : undefined}
aria-readonly={readonly || shown === 'sending' ? 'true' : undefined}
aria-disabled={disabled ? 'true' : undefined}
aria-placeholder={placeholder}
data-placeholder={placeholder}
inputmode={inputmode ?? inputmodeFor(type)}
enterkeyhint={multiline ? (w.key === 'done' ? 'done' : 'enter') : w.key === 'done' ? 'done' : w.key}
spellcheck={spellcheck ?? true}
style:--_rows-max={rows}
onkeydown={keydown}
oninput={edited}
onpaste={pasted}
ondrop={dropped}
></div>
{#if name}<input type="hidden" {name} {value} />{/if}
{:else if multiline}
<textarea
bind:this={input}
bind:value
class="domi-field__input"
id={fieldId}
{name}
{placeholder}
{disabled}
readonly={readonly || shown === 'sending'}
{required}
{maxlength}
{spellcheck}
rows="1"
style:--_rows-max={rows}
enterkeyhint={w.key === 'done' ? 'done' : 'enter'}
aria-invalid={message ? 'true' : undefined}
aria-describedby={described}
onkeydown={keydown}
oninput={typed}
></textarea>
{:else}
<input
bind:this={input}
bind:value
class="domi-field__input"
id={fieldId}
type={inputType}
{name}
{placeholder}
{disabled}
readonly={readonly || shown === 'sending'}
{required}
{maxlength}
{spellcheck}
{autocomplete}
{inputmode}
enterkeyhint={w.key === 'done' ? 'done' : w.key}
aria-invalid={message ? 'true' : undefined}
aria-describedby={described}
onkeydown={keydown}
oninput={typed}
/>
{/if}
{#if type === 'password'}
<button
type="button"
class="domi-field__tool"
aria-label={revealed ? 'Hide password' : 'Show password'}
aria-pressed={revealed}
aria-controls={fieldId}
{disabled}
onclick={() => (revealed = !revealed)}
>
<Icon name={revealed ? 'eye-off' : 'eye'} />
</button>
{/if}
<button
type="button"
class="domi-send"
aria-label={actionLabel ?? w.label}
aria-disabled={lit ? undefined : 'true'}
aria-busy={shown === 'sending' ? 'true' : undefined}
aria-controls={fieldId}
tabindex={lit ? undefined : -1}
title={actionLabel ?? w.label}
data-state={shown === 'sending' ? 'sending' : undefined}
data-force={sendForce}
onclick={() => void submit()}
use:strike
>
{#if shown === 'sending'}
<Strike />
{:else if shown === 'sent'}
<Icon name="check" draw />
{:else}
<Icon name={w.icon} />
{/if}
</button>
</div>
{#if hint}<p class="domi-field__hint" id={hintId}>{hint}</p>{/if}
{#if message}<p class="domi-field__error" id={errorId}><Icon name="alert" />{message}</p>{/if}
<span class="domi-sr" role="status">{said}</span>
</div>
+229
View File
@@ -0,0 +1,229 @@
/*
* @domi/ui base: the tokens derived from the roles, the touch floor, focus, and the motion every component shares.
* Load after tokens.css. Hand-written; the roles come from tokens.css.
*
* Derived tokens are declared on every element that can change roles (the root, data-domi-app, data-domi-room),
* because a custom property holding var() is resolved where it is declared: declared on :root only, a tile with
* data-domi-app="culina" would keep the root's tint.
*/
:root,
[data-domi-app],
[data-domi-room] {
--domi-tint: color-mix(in srgb, var(--domi-accent) 13%, transparent);
--domi-tint-strong: color-mix(in srgb, var(--domi-accent) 22%, transparent);
--domi-edge-accent: color-mix(in srgb, var(--domi-accent) 55%, transparent);
--domi-edge-danger: color-mix(in srgb, var(--domi-danger) 60%, transparent);
--domi-edge-ok: color-mix(in srgb, var(--domi-ok) 60%, transparent);
--domi-tint-danger: color-mix(in srgb, var(--domi-danger) 9%, transparent);
--domi-halo: 0 0 0 4px color-mix(in srgb, var(--domi-accent) 22%, transparent);
/* The leaf: the app's metal beaten thin over the one primary action of a screen. */
--domi-leaf: linear-gradient(180deg, var(--domi-leaf-hi) 0%, var(--domi-leaf-mid) 52%, var(--domi-leaf-lo) 100%);
/* Hover stops come from the token build, checked so the label keeps 4.5:1 (v1.0.1). */
--domi-leaf-hover: linear-gradient(180deg, var(--domi-leaf-hover-hi) 0%, var(--domi-leaf-hover-mid) 52%, var(--domi-leaf-hover-lo) 100%);
--domi-leaf-press: linear-gradient(180deg, var(--domi-leaf-lo) 0%, var(--domi-leaf-mid) 60%, var(--domi-leaf-hi) 100%);
--domi-leaf-bevel: 0 0 0 1px color-mix(in srgb, var(--domi-leaf-edge) 24%, transparent),
0 14px 34px -14px color-mix(in srgb, var(--domi-leaf-mid) 70%, transparent),
inset 0 1px 0 color-mix(in srgb, var(--domi-leaf-hi) 40%, white), inset 0 -2px 0 color-mix(in srgb, var(--domi-leaf-lo) 62%, black);
--domi-leaf-bevel-press: 0 0 0 1px color-mix(in srgb, var(--domi-leaf-edge) 24%, transparent),
0 6px 16px -10px color-mix(in srgb, var(--domi-leaf-mid) 55%, transparent),
inset 0 2px 4px color-mix(in srgb, var(--domi-leaf-lo) 50%, black);
/* The plate: every other button, struck from the ground's own stone. */
--domi-plate: linear-gradient(180deg, var(--domi-plate-top), var(--domi-plate-bottom));
--domi-plate-hover: linear-gradient(180deg, var(--domi-plate-top-hover), var(--domi-plate-bottom-hover));
--domi-plate-press: linear-gradient(180deg, var(--domi-plate-bottom), var(--domi-plate-top));
--domi-sheen: color-mix(in srgb, var(--domi-fg) 10%, transparent);
--domi-sheen-strong: color-mix(in srgb, var(--domi-fg) 18%, transparent);
--domi-glint: color-mix(in srgb, white 22%, transparent);
--domi-glint-leaf: color-mix(in srgb, white 42%, transparent);
--domi-impression: color-mix(in srgb, var(--domi-fg) 22%, transparent);
--domi-impression-leaf: color-mix(in srgb, var(--domi-leaf-lo) 55%, black);
--domi-plate-shadow: inset 0 1px 0 var(--domi-sheen), inset 0 -1px 0 rgb(0 0 0 / 0.45), 0 1px 0 rgb(0 0 0 / 0.55),
0 8px 18px -12px rgb(0 0 0 / 0.9);
--domi-plate-shadow-hover: inset 0 1px 0 var(--domi-sheen-strong), inset 0 -1px 0 rgb(0 0 0 / 0.45), 0 1px 0 rgb(0 0 0 / 0.55),
0 10px 22px -12px rgb(0 0 0 / 0.95);
--domi-plate-shadow-press: inset 0 2px 5px rgb(0 0 0 / 0.65), inset 0 -1px 0 var(--domi-sheen);
/* A field is cut into the stone. */
--domi-carved: inset 0 2px 6px rgb(0 0 0 / 0.55), inset 0 -1px 0 var(--domi-sheen);
--domi-dialog-shadow: 0 40px 100px -40px rgb(0 0 0 / 0.95);
}
/* On parchment the light falls the same way, but the shade is umber and softer. */
:root[data-domi-theme='light'],
:root[data-domi-theme='light'] [data-domi-app],
:root[data-domi-theme='light'] [data-domi-room] {
--domi-sheen: rgb(255 255 255 / 0.85);
--domi-sheen-strong: rgb(255 255 255 / 1);
--domi-glint: rgb(255 255 255 / 0.7);
--domi-impression: color-mix(in srgb, var(--domi-fg) 14%, transparent);
--domi-plate-shadow: inset 0 1px 0 var(--domi-sheen), inset 0 -1px 0 rgb(90 66 30 / 0.16), 0 1px 0 rgb(90 66 30 / 0.12),
0 8px 16px -12px rgb(90 66 30 / 0.45);
--domi-plate-shadow-hover: inset 0 1px 0 var(--domi-sheen-strong), inset 0 -1px 0 rgb(90 66 30 / 0.18), 0 1px 0 rgb(90 66 30 / 0.14),
0 10px 20px -12px rgb(90 66 30 / 0.5);
--domi-plate-shadow-press: inset 0 2px 5px rgb(90 66 30 / 0.28), inset 0 -1px 0 var(--domi-sheen);
--domi-carved: inset 0 2px 5px rgb(90 66 30 / 0.16), inset 0 -1px 0 var(--domi-sheen);
--domi-dialog-shadow: 0 30px 80px -36px rgb(90 66 30 / 0.55);
}
@media (prefers-color-scheme: light) {
:root[data-domi-theme='auto'],
:root[data-domi-theme='auto'] [data-domi-app],
:root[data-domi-theme='auto'] [data-domi-room] {
--domi-sheen: rgb(255 255 255 / 0.85);
--domi-sheen-strong: rgb(255 255 255 / 1);
--domi-glint: rgb(255 255 255 / 0.7);
--domi-impression: color-mix(in srgb, var(--domi-fg) 14%, transparent);
--domi-plate-shadow: inset 0 1px 0 var(--domi-sheen), inset 0 -1px 0 rgb(90 66 30 / 0.16), 0 1px 0 rgb(90 66 30 / 0.12),
0 8px 16px -12px rgb(90 66 30 / 0.45);
--domi-plate-shadow-hover: inset 0 1px 0 var(--domi-sheen-strong), inset 0 -1px 0 rgb(90 66 30 / 0.18),
0 1px 0 rgb(90 66 30 / 0.14), 0 10px 20px -12px rgb(90 66 30 / 0.5);
--domi-plate-shadow-press: inset 0 2px 5px rgb(90 66 30 / 0.28), inset 0 -1px 0 var(--domi-sheen);
--domi-carved: inset 0 2px 5px rgb(90 66 30 / 0.16), inset 0 -1px 0 var(--domi-sheen);
--domi-dialog-shadow: 0 30px 80px -36px rgb(90 66 30 / 0.55);
}
}
/*
* The touch floor. On a coarse pointer (Android, a touch screen) every control is at least 48 px and every field
* 56 px; on a mouse and keyboard the desktop sizes hold. data-domi-density forces one or the other.
*/
:root {
--domi-target: 0px;
--domi-field-target: 0px;
--domi-send-target: 0px;
}
@media (pointer: coarse) {
:root {
--domi-target: var(--domi-size-touch);
--domi-field-target: var(--domi-size-field-touch);
--domi-send-target: var(--domi-size-send-touch);
}
}
:root[data-domi-density='touch'] {
--domi-target: var(--domi-size-touch);
--domi-field-target: var(--domi-size-field-touch);
--domi-send-target: var(--domi-size-send-touch);
}
:root[data-domi-density='pointer'] {
--domi-target: 0px;
--domi-field-target: 0px;
--domi-send-target: 0px;
}
/* A page that opts in to the Domi ground. */
.domi-page {
min-height: 100%;
margin: 0;
background: var(--domi-bg);
color: var(--domi-fg);
font: 400 var(--domi-text-md) / var(--domi-leading-md) var(--domi-font-hand);
-webkit-font-smoothing: antialiased;
}
.domi-wordmark {
font-family: var(--domi-font-inscription);
font-weight: 500;
letter-spacing: var(--domi-tracking-inscription);
color: var(--domi-accent-strong);
}
/* Hidden from sight, read by a screen reader: state announcements. */
.domi-sr {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
border: 0;
}
/* Shared motion. Every keyframe moves something (transform, or the chisel line's position) or fades a decorative
layer; none animates a colour. */
@keyframes domi-glint {
from {
transform: translateX(-130%) skewX(-18deg);
}
to {
transform: translateX(130%) skewX(-18deg);
}
}
@keyframes domi-impress {
from {
transform: scale(0.2);
opacity: 0.9;
}
to {
transform: scale(1);
opacity: 0;
}
}
@keyframes domi-strike {
0%,
60%,
100% {
transform: translateY(0) scale(0.7);
}
25% {
transform: translateY(2px) scale(1.15);
}
}
@keyframes domi-shake {
0%,
100% {
transform: translateX(0);
}
20%,
60% {
transform: translateX(-4px);
}
40%,
80% {
transform: translateX(4px);
}
}
/* The chisel line runs inside the field (background-position, so nothing leaves the field). */
@keyframes domi-carve {
from {
background-position: -70% 0;
}
to {
background-position: 170% 0;
}
}
@keyframes domi-draw {
from {
stroke-dashoffset: 24;
}
to {
stroke-dashoffset: 0;
}
}
@keyframes domi-rise {
from {
transform: translateY(3px) scale(0.86);
}
to {
transform: none;
}
}
/* Reduced motion: nothing moves, nothing is hidden for it; every state is still shown, at once. */
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0ms !important;
}
}
:root[data-domi-motion='reduce'] *,
:root[data-domi-motion='reduce'] *::before,
:root[data-domi-motion='reduce'] *::after {
animation-duration: 0ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0ms !important;
}
File diff suppressed because it is too large Load Diff
+8
View File
@@ -0,0 +1,8 @@
/* @domi/ui, everything: fonts, tokens, base, components. Import once at the app root.
SPDX-License-Identifier: CPAL-1.0. The contents of this file are subject to the Common Public Attribution License
Version 1.0 (LICENSE). The Original Code is @domi/ui; the Initial Developer is Marek Novák, Copyright (c) 2026.
Redistribution requires the credit of Exhibit B: Built on Domi · https://aula.marek-novak.cz · Copyright (c) 2026 Marek Novák. */
@import './fonts.css';
@import './tokens.css';
@import './base.css';
@import './components.css';
+9
View File
@@ -0,0 +1,9 @@
/*
* The three Domi faces, bundled from npm (@fontsource-variable, SIL Open Font License 1.1). Nothing is fetched at
* run time. A bundler (Vite) resolves these imports; for a stack without one, copy the woff2 files named in
* docs/INTEGRATE.md and point @font-face at them. Families: 'Cinzel Variable', 'Cormorant Garamond Variable',
* 'Manrope Variable'; the token stacks fall back to the plain names the apps used before.
*/
@import '@fontsource-variable/cinzel/wght.css';
@import '@fontsource-variable/cormorant-garamond/wght.css';
@import '@fontsource-variable/manrope/wght.css';
@@ -0,0 +1,24 @@
/* amicitia's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--ground: var(--domi-bg);
--colonnade: var(--domi-chrome);
--surface: var(--domi-panel);
--surface-2: var(--domi-hover);
--hairline: var(--domi-line);
--control-edge: var(--domi-edge);
--text: var(--domi-fg);
--text-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--primary-high: var(--domi-leaf-hi);
--primary-mid: var(--domi-leaf-mid);
--primary-low: var(--domi-leaf-lo);
--primary-edge: var(--domi-leaf-edge);
--on-primary: var(--domi-leaf-fg);
--second: var(--domi-second);
--danger: var(--domi-danger);
--ok: var(--domi-ok);
}
+48
View File
@@ -0,0 +1,48 @@
/* arca's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--chrome: var(--domi-chrome);
--chrome-top: var(--domi-chrome-top);
--panel: var(--domi-panel);
--hover: var(--domi-hover);
--line: var(--domi-line);
--edge: var(--domi-edge);
--field: var(--domi-field);
--fg: var(--domi-fg);
--fg-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--plate-top: var(--domi-plate-top);
--plate-bottom: var(--domi-plate-bottom);
--plate-top-hover: var(--domi-plate-top-hover);
--plate-bottom-hover: var(--domi-plate-bottom-hover);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--accent-fg: var(--domi-leaf-fg);
--leaf: var(--domi-leaf);
--leaf-edge: var(--domi-leaf-edge);
--rim-top: var(--domi-rim);
--second: var(--domi-second);
--danger: var(--domi-danger);
--danger-fg: var(--domi-danger-fg);
--ok: var(--domi-ok);
--warning: var(--domi-warning);
--tint: var(--domi-tint);
--halo: var(--domi-halo);
--sheen: var(--domi-sheen);
--sheen-strong: var(--domi-sheen-strong);
--leaf-hover: var(--domi-leaf-hover);
--leaf-press: var(--domi-leaf-press);
--leaf-bevel: var(--domi-leaf-bevel);
--leaf-bevel-press: var(--domi-leaf-bevel-press);
--edge-accent: var(--domi-edge-accent);
--edge-danger: var(--domi-edge-danger);
--tint-danger: var(--domi-tint-danger);
--primary-fill: var(--domi-leaf);
--primary-edge: var(--domi-leaf-edge);
--inscription: var(--domi-font-inscription);
--book: var(--domi-font-book);
--hand: var(--domi-font-hand);
--code: var(--domi-font-code);
}
@@ -0,0 +1,48 @@
/* atrium's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--chrome: var(--domi-chrome);
--chrome-top: var(--domi-chrome-top);
--panel: var(--domi-panel);
--hover: var(--domi-hover);
--line: var(--domi-line);
--edge: var(--domi-edge);
--field: var(--domi-field);
--fg: var(--domi-fg);
--fg-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--plate-top: var(--domi-plate-top);
--plate-bottom: var(--domi-plate-bottom);
--plate-top-hover: var(--domi-plate-top-hover);
--plate-bottom-hover: var(--domi-plate-bottom-hover);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--accent-fg: var(--domi-leaf-fg);
--leaf: var(--domi-leaf);
--leaf-edge: var(--domi-leaf-edge);
--rim-top: var(--domi-rim);
--second: var(--domi-second);
--danger: var(--domi-danger);
--danger-fg: var(--domi-danger-fg);
--ok: var(--domi-ok);
--warning: var(--domi-warning);
--tint: var(--domi-tint);
--halo: var(--domi-halo);
--sheen: var(--domi-sheen);
--sheen-strong: var(--domi-sheen-strong);
--leaf-hover: var(--domi-leaf-hover);
--leaf-press: var(--domi-leaf-press);
--leaf-bevel: var(--domi-leaf-bevel);
--leaf-bevel-press: var(--domi-leaf-bevel-press);
--edge-accent: var(--domi-edge-accent);
--edge-danger: var(--domi-edge-danger);
--tint-danger: var(--domi-tint-danger);
--primary-fill: var(--domi-leaf);
--primary-edge: var(--domi-leaf-edge);
--inscription: var(--domi-font-inscription);
--book: var(--domi-font-book);
--hand: var(--domi-font-hand);
--code: var(--domi-font-code);
}
+21
View File
@@ -0,0 +1,21 @@
/* aula's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--chrome: var(--domi-chrome);
--panel: var(--domi-panel);
--line: var(--domi-line);
--edge: var(--domi-edge);
--field: var(--domi-field);
--fg: var(--domi-fg);
--fg-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--p-leaf1: var(--domi-leaf-hi);
--p-leaf2: var(--domi-leaf-mid);
--p-leaf3: var(--domi-leaf-lo);
--p-leaf-edge: var(--domi-leaf-edge);
--p-on-leaf: var(--domi-leaf-fg);
--second: var(--domi-second);
}
@@ -0,0 +1,22 @@
/* calenda's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--sidebar: var(--domi-chrome);
--surface: var(--domi-panel);
--surface-2: var(--domi-hover);
--line: var(--domi-line);
--line-control: var(--domi-edge);
--text: var(--domi-fg);
--muted: var(--domi-muted);
--accent-strong: var(--domi-accent);
--accent-edge: var(--domi-leaf-hi);
--accent: var(--domi-leaf-mid);
--lacquer-deep: var(--domi-leaf-lo);
--bronze: var(--domi-leaf-edge);
--on-accent: var(--domi-leaf-fg);
--person-text: var(--domi-second);
--danger: var(--domi-danger);
--on-danger: var(--domi-danger-fg);
--warning: var(--domi-warning);
}
@@ -0,0 +1,48 @@
/* culina's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--chrome: var(--domi-chrome);
--chrome-top: var(--domi-chrome-top);
--panel: var(--domi-panel);
--hover: var(--domi-hover);
--line: var(--domi-line);
--edge: var(--domi-edge);
--field: var(--domi-field);
--fg: var(--domi-fg);
--fg-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--plate-top: var(--domi-plate-top);
--plate-bottom: var(--domi-plate-bottom);
--plate-top-hover: var(--domi-plate-top-hover);
--plate-bottom-hover: var(--domi-plate-bottom-hover);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--accent-fg: var(--domi-leaf-fg);
--leaf: var(--domi-leaf);
--leaf-edge: var(--domi-leaf-edge);
--rim-top: var(--domi-rim);
--second: var(--domi-second);
--danger: var(--domi-danger);
--danger-fg: var(--domi-danger-fg);
--ok: var(--domi-ok);
--warning: var(--domi-warning);
--tint: var(--domi-tint);
--halo: var(--domi-halo);
--sheen: var(--domi-sheen);
--sheen-strong: var(--domi-sheen-strong);
--leaf-hover: var(--domi-leaf-hover);
--leaf-press: var(--domi-leaf-press);
--leaf-bevel: var(--domi-leaf-bevel);
--leaf-bevel-press: var(--domi-leaf-bevel-press);
--edge-accent: var(--domi-edge-accent);
--edge-danger: var(--domi-edge-danger);
--tint-danger: var(--domi-tint-danger);
--primary-fill: var(--domi-leaf);
--primary-edge: var(--domi-leaf-edge);
--inscription: var(--domi-font-inscription);
--book: var(--domi-font-book);
--hand: var(--domi-font-hand);
--code: var(--domi-font-code);
}
@@ -0,0 +1,48 @@
/* custos's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--chrome: var(--domi-chrome);
--chrome-top: var(--domi-chrome-top);
--panel: var(--domi-panel);
--hover: var(--domi-hover);
--line: var(--domi-line);
--edge: var(--domi-edge);
--field: var(--domi-field);
--fg: var(--domi-fg);
--fg-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--plate-top: var(--domi-plate-top);
--plate-bottom: var(--domi-plate-bottom);
--plate-top-hover: var(--domi-plate-top-hover);
--plate-bottom-hover: var(--domi-plate-bottom-hover);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--accent-fg: var(--domi-leaf-fg);
--leaf: var(--domi-leaf);
--leaf-edge: var(--domi-leaf-edge);
--rim-top: var(--domi-rim);
--second: var(--domi-second);
--danger: var(--domi-danger);
--danger-fg: var(--domi-danger-fg);
--ok: var(--domi-ok);
--warning: var(--domi-warning);
--tint: var(--domi-tint);
--halo: var(--domi-halo);
--sheen: var(--domi-sheen);
--sheen-strong: var(--domi-sheen-strong);
--leaf-hover: var(--domi-leaf-hover);
--leaf-press: var(--domi-leaf-press);
--leaf-bevel: var(--domi-leaf-bevel);
--leaf-bevel-press: var(--domi-leaf-bevel-press);
--edge-accent: var(--domi-edge-accent);
--edge-danger: var(--domi-edge-danger);
--tint-danger: var(--domi-tint-danger);
--primary-fill: var(--domi-leaf);
--primary-edge: var(--domi-leaf-edge);
--inscription: var(--domi-font-inscription);
--book: var(--domi-font-book);
--hand: var(--domi-font-hand);
--code: var(--domi-font-code);
}
@@ -0,0 +1,48 @@
/* domi-office's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--chrome: var(--domi-chrome);
--chrome-top: var(--domi-chrome-top);
--panel: var(--domi-panel);
--hover: var(--domi-hover);
--line: var(--domi-line);
--edge: var(--domi-edge);
--field: var(--domi-field);
--fg: var(--domi-fg);
--fg-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--plate-top: var(--domi-plate-top);
--plate-bottom: var(--domi-plate-bottom);
--plate-top-hover: var(--domi-plate-top-hover);
--plate-bottom-hover: var(--domi-plate-bottom-hover);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--accent-fg: var(--domi-leaf-fg);
--leaf: var(--domi-leaf);
--leaf-edge: var(--domi-leaf-edge);
--rim-top: var(--domi-rim);
--second: var(--domi-second);
--danger: var(--domi-danger);
--danger-fg: var(--domi-danger-fg);
--ok: var(--domi-ok);
--warning: var(--domi-warning);
--tint: var(--domi-tint);
--halo: var(--domi-halo);
--sheen: var(--domi-sheen);
--sheen-strong: var(--domi-sheen-strong);
--leaf-hover: var(--domi-leaf-hover);
--leaf-press: var(--domi-leaf-press);
--leaf-bevel: var(--domi-leaf-bevel);
--leaf-bevel-press: var(--domi-leaf-bevel-press);
--edge-accent: var(--domi-edge-accent);
--edge-danger: var(--domi-edge-danger);
--tint-danger: var(--domi-tint-danger);
--primary-fill: var(--domi-leaf);
--primary-edge: var(--domi-leaf-edge);
--inscription: var(--domi-font-inscription);
--book: var(--domi-font-book);
--hand: var(--domi-font-hand);
--code: var(--domi-font-code);
}
@@ -0,0 +1,48 @@
/* epistula's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--chrome: var(--domi-chrome);
--chrome-top: var(--domi-chrome-top);
--panel: var(--domi-panel);
--hover: var(--domi-hover);
--line: var(--domi-line);
--edge: var(--domi-edge);
--field: var(--domi-field);
--fg: var(--domi-fg);
--fg-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--plate-top: var(--domi-plate-top);
--plate-bottom: var(--domi-plate-bottom);
--plate-top-hover: var(--domi-plate-top-hover);
--plate-bottom-hover: var(--domi-plate-bottom-hover);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--accent-fg: var(--domi-leaf-fg);
--leaf: var(--domi-leaf);
--leaf-edge: var(--domi-leaf-edge);
--rim-top: var(--domi-rim);
--second: var(--domi-second);
--danger: var(--domi-danger);
--danger-fg: var(--domi-danger-fg);
--ok: var(--domi-ok);
--warning: var(--domi-warning);
--tint: var(--domi-tint);
--halo: var(--domi-halo);
--sheen: var(--domi-sheen);
--sheen-strong: var(--domi-sheen-strong);
--leaf-hover: var(--domi-leaf-hover);
--leaf-press: var(--domi-leaf-press);
--leaf-bevel: var(--domi-leaf-bevel);
--leaf-bevel-press: var(--domi-leaf-bevel-press);
--edge-accent: var(--domi-edge-accent);
--edge-danger: var(--domi-edge-danger);
--tint-danger: var(--domi-tint-danger);
--primary-fill: var(--domi-leaf);
--primary-edge: var(--domi-leaf-edge);
--inscription: var(--domi-font-inscription);
--book: var(--domi-font-book);
--hand: var(--domi-font-hand);
--code: var(--domi-font-code);
}
@@ -0,0 +1,48 @@
/* fabrica's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--chrome: var(--domi-chrome);
--chrome-top: var(--domi-chrome-top);
--panel: var(--domi-panel);
--hover: var(--domi-hover);
--line: var(--domi-line);
--edge: var(--domi-edge);
--field: var(--domi-field);
--fg: var(--domi-fg);
--fg-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--plate-top: var(--domi-plate-top);
--plate-bottom: var(--domi-plate-bottom);
--plate-top-hover: var(--domi-plate-top-hover);
--plate-bottom-hover: var(--domi-plate-bottom-hover);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--accent-fg: var(--domi-leaf-fg);
--leaf: var(--domi-leaf);
--leaf-edge: var(--domi-leaf-edge);
--rim-top: var(--domi-rim);
--second: var(--domi-second);
--danger: var(--domi-danger);
--danger-fg: var(--domi-danger-fg);
--ok: var(--domi-ok);
--warning: var(--domi-warning);
--tint: var(--domi-tint);
--halo: var(--domi-halo);
--sheen: var(--domi-sheen);
--sheen-strong: var(--domi-sheen-strong);
--leaf-hover: var(--domi-leaf-hover);
--leaf-press: var(--domi-leaf-press);
--leaf-bevel: var(--domi-leaf-bevel);
--leaf-bevel-press: var(--domi-leaf-bevel-press);
--edge-accent: var(--domi-edge-accent);
--edge-danger: var(--domi-edge-danger);
--tint-danger: var(--domi-tint-danger);
--primary-fill: var(--domi-leaf);
--primary-edge: var(--domi-leaf-edge);
--inscription: var(--domi-font-inscription);
--book: var(--domi-font-book);
--hand: var(--domi-font-hand);
--code: var(--domi-font-code);
}
@@ -0,0 +1,24 @@
/* famulus's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--famulus-ground: var(--domi-bg);
--famulus-night-high: var(--domi-chrome);
--famulus-surface: var(--domi-panel);
--famulus-row-hover: var(--domi-hover);
--famulus-line: var(--domi-line);
--famulus-field: var(--domi-field);
--famulus-text: var(--domi-fg);
--famulus-soft: var(--domi-fg-2);
--famulus-quiet: var(--domi-muted);
--famulus-quieter: var(--domi-disabled);
--famulus-gold: var(--domi-accent);
--famulus-gold-bright: var(--domi-accent-strong);
--famulus-leaf-light: var(--domi-leaf-hi);
--famulus-leaf-mid: var(--domi-leaf-mid);
--famulus-leaf-shadow: var(--domi-leaf-lo);
--famulus-glint: var(--domi-leaf-edge);
--famulus-on-gold: var(--domi-leaf-fg);
--famulus-gold-deep: var(--domi-rim);
--famulus-moonlight: var(--domi-second);
--famulus-sage: var(--domi-ok);
}
@@ -0,0 +1,48 @@
/* fiscus's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--chrome: var(--domi-chrome);
--chrome-top: var(--domi-chrome-top);
--panel: var(--domi-panel);
--hover: var(--domi-hover);
--line: var(--domi-line);
--edge: var(--domi-edge);
--field: var(--domi-field);
--fg: var(--domi-fg);
--fg-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--plate-top: var(--domi-plate-top);
--plate-bottom: var(--domi-plate-bottom);
--plate-top-hover: var(--domi-plate-top-hover);
--plate-bottom-hover: var(--domi-plate-bottom-hover);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--accent-fg: var(--domi-leaf-fg);
--leaf: var(--domi-leaf);
--leaf-edge: var(--domi-leaf-edge);
--rim-top: var(--domi-rim);
--second: var(--domi-second);
--danger: var(--domi-danger);
--danger-fg: var(--domi-danger-fg);
--ok: var(--domi-ok);
--warning: var(--domi-warning);
--tint: var(--domi-tint);
--halo: var(--domi-halo);
--sheen: var(--domi-sheen);
--sheen-strong: var(--domi-sheen-strong);
--leaf-hover: var(--domi-leaf-hover);
--leaf-press: var(--domi-leaf-press);
--leaf-bevel: var(--domi-leaf-bevel);
--leaf-bevel-press: var(--domi-leaf-bevel-press);
--edge-accent: var(--domi-edge-accent);
--edge-danger: var(--domi-edge-danger);
--tint-danger: var(--domi-tint-danger);
--primary-fill: var(--domi-leaf);
--primary-edge: var(--domi-leaf-edge);
--inscription: var(--domi-font-inscription);
--book: var(--domi-font-book);
--hand: var(--domi-font-hand);
--code: var(--domi-font-code);
}
@@ -0,0 +1,48 @@
/* fundamentum's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
.theme-fundamentum {
--bg: var(--domi-bg);
--chrome: var(--domi-chrome);
--chrome-top: var(--domi-chrome-top);
--panel: var(--domi-panel);
--hover: var(--domi-hover);
--line: var(--domi-line);
--edge: var(--domi-edge);
--field: var(--domi-field);
--fg: var(--domi-fg);
--fg-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--plate-top: var(--domi-plate-top);
--plate-bottom: var(--domi-plate-bottom);
--plate-top-hover: var(--domi-plate-top-hover);
--plate-bottom-hover: var(--domi-plate-bottom-hover);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--accent-fg: var(--domi-leaf-fg);
--leaf: var(--domi-leaf);
--leaf-edge: var(--domi-leaf-edge);
--rim-top: var(--domi-rim);
--second: var(--domi-second);
--danger: var(--domi-danger);
--danger-fg: var(--domi-danger-fg);
--ok: var(--domi-ok);
--warning: var(--domi-warning);
--tint: var(--domi-tint);
--halo: var(--domi-halo);
--sheen: var(--domi-sheen);
--sheen-strong: var(--domi-sheen-strong);
--leaf-hover: var(--domi-leaf-hover);
--leaf-press: var(--domi-leaf-press);
--leaf-bevel: var(--domi-leaf-bevel);
--leaf-bevel-press: var(--domi-leaf-bevel-press);
--edge-accent: var(--domi-edge-accent);
--edge-danger: var(--domi-edge-danger);
--tint-danger: var(--domi-tint-danger);
--primary-fill: var(--domi-leaf);
--primary-edge: var(--domi-leaf-edge);
--inscription: var(--domi-font-inscription);
--book: var(--domi-font-book);
--hand: var(--domi-font-hand);
--code: var(--domi-font-code);
}
@@ -0,0 +1,26 @@
/* ianitor's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
.ia {
--ground: var(--domi-bg);
--colonnade: var(--domi-chrome);
--surface: var(--domi-panel);
--surface-2: var(--domi-hover);
--hairline: var(--domi-line);
--control-edge: var(--domi-edge);
--text: var(--domi-fg);
--text-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--primary-high: var(--domi-leaf-hi);
--primary-mid: var(--domi-leaf-mid);
--primary-low: var(--domi-leaf-lo);
--primary-edge: var(--domi-leaf-edge);
--on-primary: var(--domi-leaf-fg);
--second: var(--domi-second);
--danger: var(--domi-danger);
--on-danger: var(--domi-danger-fg);
--healthy: var(--domi-ok);
--degraded: var(--domi-warning);
}
@@ -0,0 +1,48 @@
/* lapilli's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--chrome: var(--domi-chrome);
--chrome-top: var(--domi-chrome-top);
--panel: var(--domi-panel);
--hover: var(--domi-hover);
--line: var(--domi-line);
--edge: var(--domi-edge);
--field: var(--domi-field);
--fg: var(--domi-fg);
--fg-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--plate-top: var(--domi-plate-top);
--plate-bottom: var(--domi-plate-bottom);
--plate-top-hover: var(--domi-plate-top-hover);
--plate-bottom-hover: var(--domi-plate-bottom-hover);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--accent-fg: var(--domi-leaf-fg);
--leaf: var(--domi-leaf);
--leaf-edge: var(--domi-leaf-edge);
--rim-top: var(--domi-rim);
--second: var(--domi-second);
--danger: var(--domi-danger);
--danger-fg: var(--domi-danger-fg);
--ok: var(--domi-ok);
--warning: var(--domi-warning);
--tint: var(--domi-tint);
--halo: var(--domi-halo);
--sheen: var(--domi-sheen);
--sheen-strong: var(--domi-sheen-strong);
--leaf-hover: var(--domi-leaf-hover);
--leaf-press: var(--domi-leaf-press);
--leaf-bevel: var(--domi-leaf-bevel);
--leaf-bevel-press: var(--domi-leaf-bevel-press);
--edge-accent: var(--domi-edge-accent);
--edge-danger: var(--domi-edge-danger);
--tint-danger: var(--domi-tint-danger);
--primary-fill: var(--domi-leaf);
--primary-edge: var(--domi-leaf-edge);
--inscription: var(--domi-font-inscription);
--book: var(--domi-font-book);
--hand: var(--domi-font-hand);
--code: var(--domi-font-code);
}
+25
View File
@@ -0,0 +1,25 @@
/* liber's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--lb-ground: var(--domi-bg);
--lb-colonnade: var(--domi-chrome);
--lb-surface: var(--domi-panel);
--lb-surface-2: var(--domi-hover);
--lb-hairline: var(--domi-line);
--lb-control-edge: var(--domi-edge);
--lb-text: var(--domi-fg);
--lb-text-2: var(--domi-fg-2);
--lb-muted: var(--domi-muted);
--lb-disabled: var(--domi-disabled);
--lb-accent: var(--domi-accent);
--lb-accent-strong: var(--domi-accent-strong);
--lb-primary-high: var(--domi-leaf-hi);
--lb-primary-mid: var(--domi-leaf-mid);
--lb-primary-low: var(--domi-leaf-lo);
--lb-primary-edge: var(--domi-leaf-edge);
--lb-on-primary: var(--domi-leaf-fg);
--lb-copper: var(--domi-second);
--lb-danger: var(--domi-danger);
--lb-success: var(--domi-ok);
--lb-warning: var(--domi-warning);
}
+21
View File
@@ -0,0 +1,21 @@
/* ludus's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--lu-ground-app: var(--domi-bg);
--lu-ground-sunken: var(--domi-chrome);
--lu-ground-card: var(--domi-panel);
--lu-surface: var(--domi-hover);
--lu-hairline: var(--domi-line);
--lu-blue-border: var(--domi-edge);
--lu-ground-deepest: var(--domi-field);
--lu-text-primary: var(--domi-fg);
--lu-text-body: var(--domi-fg-2);
--lu-text-secondary: var(--domi-muted);
--lu-text-tertiary: var(--domi-disabled);
--lu-primary-accent: var(--domi-accent);
--lu-primary-bright: var(--domi-leaf-hi);
--lu-primary: var(--domi-leaf-mid);
--lu-primary-mid: var(--domi-leaf-lo);
--lu-gold: var(--domi-leaf-edge);
--lu-text-on-primary: var(--domi-leaf-fg);
}
@@ -0,0 +1,27 @@
/* medicus's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--md-bg: var(--domi-bg);
--md-sidebar: var(--domi-chrome);
--md-surface: var(--domi-panel);
--md-surface-2: var(--domi-hover);
--md-border: var(--domi-line);
--md-control-edge: var(--domi-edge);
--md-text: var(--domi-fg);
--md-text-2: var(--domi-fg-2);
--md-text-muted: var(--domi-muted);
--md-text-disabled: var(--domi-disabled);
--md-accent: var(--domi-accent);
--md-accent-strong: var(--domi-accent-strong);
--md-primary-high: var(--domi-leaf-hi);
--md-primary-mid: var(--domi-leaf-mid);
--md-primary-low: var(--domi-leaf-lo);
--md-primary-edge: var(--domi-leaf-edge);
--md-on-primary: var(--domi-leaf-fg);
--md-red-fill-edge: var(--domi-rim);
--md-secondary-text: var(--domi-second);
--md-danger: var(--domi-danger);
--md-on-danger: var(--domi-danger-fg);
--md-success: var(--domi-ok);
--md-warning: var(--domi-warning);
}
@@ -0,0 +1,20 @@
/* memoria's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--memoria-bg: var(--domi-bg);
--memoria-colonnade: var(--domi-chrome);
--memoria-surface: var(--domi-panel);
--memoria-raised: var(--domi-hover);
--memoria-line: var(--domi-line);
--memoria-edge: var(--domi-edge);
--memoria-ink: var(--domi-fg);
--memoria-ink-quiet: var(--domi-fg-2);
--memoria-muted: var(--domi-muted);
--memoria-accent: var(--domi-accent);
--memoria-aerugo-strong: var(--domi-accent-strong);
--memoria-leaf: var(--domi-leaf);
--memoria-aerugo-ink: var(--domi-leaf-fg);
--memoria-aerugo-deep: var(--domi-rim);
--memoria-purpura: var(--domi-second);
--memoria-danger: var(--domi-danger);
}
@@ -0,0 +1,48 @@
/* pictor's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--chrome: var(--domi-chrome);
--chrome-top: var(--domi-chrome-top);
--panel: var(--domi-panel);
--hover: var(--domi-hover);
--line: var(--domi-line);
--edge: var(--domi-edge);
--field: var(--domi-field);
--fg: var(--domi-fg);
--fg-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--plate-top: var(--domi-plate-top);
--plate-bottom: var(--domi-plate-bottom);
--plate-top-hover: var(--domi-plate-top-hover);
--plate-bottom-hover: var(--domi-plate-bottom-hover);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--accent-fg: var(--domi-leaf-fg);
--leaf: var(--domi-leaf);
--leaf-edge: var(--domi-leaf-edge);
--rim-top: var(--domi-rim);
--second: var(--domi-second);
--danger: var(--domi-danger);
--danger-fg: var(--domi-danger-fg);
--ok: var(--domi-ok);
--warning: var(--domi-warning);
--tint: var(--domi-tint);
--halo: var(--domi-halo);
--sheen: var(--domi-sheen);
--sheen-strong: var(--domi-sheen-strong);
--leaf-hover: var(--domi-leaf-hover);
--leaf-press: var(--domi-leaf-press);
--leaf-bevel: var(--domi-leaf-bevel);
--leaf-bevel-press: var(--domi-leaf-bevel-press);
--edge-accent: var(--domi-edge-accent);
--edge-danger: var(--domi-edge-danger);
--tint-danger: var(--domi-tint-danger);
--primary-fill: var(--domi-leaf);
--primary-edge: var(--domi-leaf-edge);
--inscription: var(--domi-font-inscription);
--book: var(--domi-font-book);
--hand: var(--domi-font-hand);
--code: var(--domi-font-code);
}
@@ -0,0 +1,20 @@
/* postea's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--postea-color-bg-app: var(--domi-bg);
--postea-color-bg-panel: var(--domi-chrome);
--postea-color-bg-surface: var(--domi-panel);
--postea-color-rule-base: var(--domi-line);
--postea-color-accent-dim: var(--domi-edge);
--postea-color-text-heading: var(--domi-fg);
--postea-color-text-soft: var(--domi-fg-2);
--postea-color-text-muted: var(--domi-muted);
--postea-color-text-faint: var(--domi-disabled);
--postea-color-accent-base: var(--domi-accent);
--postea-color-accent-bright: var(--domi-accent-strong);
--postea-color-primary-base: var(--domi-leaf-mid);
--postea-color-primary-deep: var(--domi-leaf-lo);
--postea-color-accent-mid: var(--domi-leaf-edge);
--postea-color-gold-base: var(--domi-second);
--postea-color-risk-onDark: var(--domi-danger);
}
@@ -0,0 +1,23 @@
/* respicio's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--bg: var(--domi-bg);
--colonnade: var(--domi-chrome);
--surface: var(--domi-panel);
--surface-2: var(--domi-hover);
--border: var(--domi-line);
--field-edge: var(--domi-edge);
--text: var(--domi-fg);
--text-2: var(--domi-fg-2);
--muted: var(--domi-muted);
--disabled: var(--domi-disabled);
--accent: var(--domi-accent);
--accent-strong: var(--domi-accent-strong);
--leaf-mid: var(--domi-leaf-mid);
--leaf-low: var(--domi-leaf-lo);
--leaf-edge: var(--domi-leaf-edge);
--ink: var(--domi-leaf-fg);
--info: var(--domi-second);
--danger: var(--domi-danger);
--ok: var(--domi-ok);
}
@@ -0,0 +1,18 @@
/* tabula's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--tbl-window: var(--domi-bg);
--tbl-panel: var(--domi-chrome);
--tbl-card: var(--domi-panel);
--tbl-rule: var(--domi-line);
--tbl-gold-dim: var(--domi-edge);
--tbl-field: var(--domi-field);
--tbl-ink: var(--domi-fg);
--tbl-ink-dim: var(--domi-fg-2);
--tbl-ink-muted: var(--domi-muted);
--tbl-ink-faint: var(--domi-disabled);
--tbl-gold: var(--domi-accent);
--tbl-gold-light: var(--domi-accent-strong);
--tbl-gold-deep: var(--domi-leaf-lo);
--tbl-gold-pale: var(--domi-leaf-edge);
}
@@ -0,0 +1,24 @@
/* tectum's token names before @domi/ui, as aliases. GENERATED by tools/build-legacy.mjs: do not edit. */
/* Load after @domi/ui/domi.css. Temporary: rename usages to --domi-* and drop this file. */
:root {
--td-bg: var(--domi-bg);
--td-sidebar: var(--domi-chrome);
--td-surface: var(--domi-panel);
--td-surface-2: var(--domi-hover);
--td-border: var(--domi-line);
--td-control-edge: var(--domi-edge);
--td-text: var(--domi-fg);
--td-text-2: var(--domi-fg-2);
--td-text-muted: var(--domi-muted);
--td-accent: var(--domi-accent);
--td-accent-hover: var(--domi-accent-strong);
--td-leaf-high: var(--domi-leaf-hi);
--td-leaf-mid: var(--domi-leaf-mid);
--td-leaf-low: var(--domi-leaf-lo);
--td-leaf-edge: var(--domi-leaf-edge);
--td-on-accent: var(--domi-leaf-fg);
--td-legal: var(--domi-second);
--td-danger: var(--domi-danger);
--td-success: var(--domi-ok);
--td-warning: var(--domi-warning);
}
File diff suppressed because it is too large Load Diff
+24
View File
@@ -0,0 +1,24 @@
// SPDX-License-Identifier: CPAL-1.0
// The Original Code is @domi/ui; Initial Developer Marek Novák, Copyright (c) 2026. See LICENSE (Exhibit B: the credit).
// @domi/ui: import the components here and the styles once, at the app root:
// import '@domi/ui/domi.css';
// import { Button, TextField } from '@domi/ui';
export { default as Button } from './components/Button.svelte';
export { default as TextField } from './components/TextField.svelte';
export { default as Checkbox } from './components/Checkbox.svelte';
export { default as Radio } from './components/Radio.svelte';
export { default as Switch } from './components/Switch.svelte';
export { default as Select } from './components/Select.svelte';
export { default as Segmented } from './components/Segmented.svelte';
export { default as Icon } from './components/Icon.svelte';
export { default as Strike } from './components/Strike.svelte';
export { default as DomiCredit } from './components/DomiCredit.svelte';
export { DOMI_ATTRIBUTION, DOMI_ATTRIBUTION_TEXT } from './lib/credit';
export { isAndroid } from './lib/editable';
export { strike } from './lib/strike';
export { icons, type IconName } from './lib/icons';
export { enterAction, canSend, isSoftKeyboard, failureText, DomiError } from './lib/keys';
export type { EnterKey, EnterContext, EnterResult, FieldState, ButtonState } from './lib/keys';
export type { DomiOption, ButtonVariant, ControlSize, FieldAction, DomiTheme, DomiDensity } from './types';
export { tokens, appIds, type DomiAppId } from './tokens/generated';
+14
View File
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: CPAL-1.0
/**
* The Attribution Information of Exhibit B of the licence (CPAL-1.0, LICENSE). Anyone who distributes @domi/ui or a
* Larger Work made with it shows this where CPAL §14 asks: prominently in the user interface when the work is
* launched or a session starts. `DomiCredit` renders it.
*/
export const DOMI_ATTRIBUTION = {
phrase: 'Built on Domi',
url: 'https://aula.marek-novak.cz',
copyright: 'Copyright (c) 2026 Marek Novák',
} as const;
/** The credit as one line of plain text, for a log, a terminal or a native About box. */
export const DOMI_ATTRIBUTION_TEXT = `${DOMI_ATTRIBUTION.phrase} · ${DOMI_ATTRIBUTION.url} · ${DOMI_ATTRIBUTION.copyright}`;
+71
View File
@@ -0,0 +1,71 @@
// SPDX-License-Identifier: CPAL-1.0
/**
* Helpers for TextField's editable mode: a contenteditable box with role="textbox" in place of <input>/<textarea>.
* Why: on Android the WebView asks Google's Autofill service (a network request) as soon as a text <input> or
* <textarea> gets focus, and no attribute stops it (found by Amicitia). A contenteditable box is not an autofill
* target. Plain text only: paste and drop never bring markup.
*/
/** True in an Android WebView or browser, where editable mode avoids the Autofill request. Safe during SSR. */
export function isAndroid(): boolean {
return typeof navigator !== 'undefined' && /Android/i.test(navigator.userAgent);
}
/** The box's text, with line breaks as \n. An emptied box that only holds a stray line break reads as ''. */
export function readText(el: HTMLElement): string {
const raw = typeof el.innerText === 'string' ? el.innerText : (el.textContent ?? '');
return raw === '\n' ? '' : raw;
}
/** Replaces the box's content with plain text (no markup can enter). */
export function writeText(el: HTMLElement, text: string): void {
el.textContent = text;
}
/** Puts the caret after the last character. */
export function caretToEnd(el: HTMLElement): void {
const sel = typeof getSelection === 'function' ? getSelection() : null;
if (!sel || typeof document.createRange !== 'function') return;
const range = document.createRange();
range.selectNodeContents(el);
range.collapse(false);
sel.removeAllRanges();
sel.addRange(range);
}
/**
* Inserts plain text at the caret. Uses the browser's own insertion where it exists, so undo keeps working;
* otherwise inserts a text node at the selection.
*/
export function insertPlainText(el: HTMLElement, text: string): void {
try {
if (typeof document.execCommand === 'function' && document.execCommand('insertText', false, text)) return;
} catch {
// Fall through to the Range insertion.
}
const sel = typeof getSelection === 'function' ? getSelection() : null;
const node = document.createTextNode(text);
if (!sel || sel.rangeCount === 0 || !el.contains(sel.getRangeAt(0).commonAncestorContainer)) {
el.append(node);
return;
}
const range = sel.getRangeAt(0);
range.deleteContents();
range.insertNode(node);
range.setStartAfter(node);
range.collapse(true);
sel.removeAllRanges();
sel.addRange(range);
}
/** The soft keyboard a type asks for, as inputmode (an editable box has no type attribute). */
export function inputmodeFor(type: string): 'text' | 'email' | 'url' | 'tel' | 'decimal' | 'search' {
const map: Record<string, 'email' | 'url' | 'tel' | 'decimal' | 'search'> = {
email: 'email',
url: 'url',
tel: 'tel',
number: 'decimal',
search: 'search',
};
return map[type] ?? 'text';
}
+28
View File
@@ -0,0 +1,28 @@
/**
* The Domi icon set: 24-unit stroke paths, drawn with stroke="currentColor", 1.8 wide, round caps and joins.
* Icons sit beside words; an icon alone always comes with an accessible name on its button.
*/
export const icons = {
send: 'M4.5 12h13M12.5 6.5 18 12l-5.5 5.5',
search: 'M10.5 17a6.5 6.5 0 1 0 0-13 6.5 6.5 0 0 0 0 13ZM15.5 15.5 20 20',
next: 'M6 9.5 12 15l6-5.5',
save: 'M5 12.5 10 17.5 19 7',
check: 'M5 12.5 10 17.5 19 7',
close: 'M6.5 6.5 17.5 17.5M17.5 6.5 6.5 17.5',
plus: 'M12 5v14M5 12h14',
minus: 'M5 12h14',
trash: 'M5 7h14M10 7V5h4v2M7 7l1 12h8l1-12M10.5 10.5v5.5M13.5 10.5v5.5',
alert: 'M12 4 21 19.5H3L12 4ZM12 10v4.5M12 17.2v.1',
info: 'M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM12 11v5.5M12 7.8v.1',
eye: 'M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12ZM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z',
'eye-off': 'M4 4l16 16M9.9 5.8A8.8 8.8 0 0 1 12 5.5c6 0 9.5 6.5 9.5 6.5a16 16 0 0 1-3 3.8M6.5 7.3A15.6 15.6 0 0 0 2.5 12S6 18.5 12 18.5c1.7 0 3.2-.5 4.4-1.2M10 10a3 3 0 0 0 4 4',
'chevron-down': 'M6 9.5 12 15l6-5.5',
'chevron-right': 'M9.5 6 15 12l-5.5 6',
'arrow-left': 'M19.5 12h-13M11.5 6.5 6 12l5.5 5.5',
retry: 'M4.5 12a7.5 7.5 0 1 0 2.2-5.3M4.5 4.5v4h4',
edit: 'M4.5 19.5 5.5 15 15.5 5a2.1 2.1 0 0 1 3 3l-10 10-4 1.5ZM13.5 7l3 3',
copy: 'M9 9h10.5v10.5H9zM15 9V4.5H4.5V15H9',
lock: 'M6 11h12v9H6zM8.5 11V8a3.5 3.5 0 1 1 7 0v3',
} as const;
export type IconName = keyof typeof icons;
+67
View File
@@ -0,0 +1,67 @@
/** What Enter does in a field with a send button. Pure, so the flow is tested without a browser. */
export type EnterResult = 'send' | 'newline' | 'ignore';
export interface EnterKey {
key: string;
shiftKey?: boolean;
ctrlKey?: boolean;
metaKey?: boolean;
altKey?: boolean;
/** True while an input method (Chinese, Japanese, a phone keyboard's suggestion) is composing. */
isComposing?: boolean;
keyCode?: number;
}
export interface EnterContext {
multiline: boolean;
/**
* 'auto' (default): Enter sends, except in a multi-line field on a touch-only device, where a soft keyboard has
* no Shift: there Enter makes a new line and the seal sends. 'always': Enter always sends (Shift+Enter is a new
* line). 'never': Enter never sends (a multi-line field for long writing; Ctrl/Cmd+Enter still sends).
*/
enterSends?: 'auto' | 'always' | 'never';
/** True on a device whose only pointer is coarse (a phone). */
softKeyboard?: boolean;
}
export function enterAction(e: EnterKey, ctx: EnterContext): EnterResult {
if (e.key !== 'Enter') return 'ignore';
// keyCode 229 is the IME's own Enter on some Android keyboards and Safari.
if (e.isComposing || e.keyCode === 229) return 'ignore';
if (e.ctrlKey || e.metaKey) return 'send';
if (!ctx.multiline) return e.altKey ? 'ignore' : 'send';
if (e.shiftKey || e.altKey) return 'newline';
const mode = ctx.enterSends ?? 'auto';
if (mode === 'never') return 'newline';
if (mode === 'auto' && ctx.softKeyboard) return 'newline';
return 'send';
}
/** A field can send when it holds more than white space and is not already busy. */
export function canSend(value: string, state: FieldState, disabled = false): boolean {
return !disabled && state !== 'sending' && value.trim().length > 0;
}
export type FieldState = 'idle' | 'sending' | 'sent' | 'error';
export type ButtonState = 'idle' | 'loading' | 'success' | 'error';
/** Only a phone-like device: no fine pointer anywhere. Safe to call during SSR. */
export function isSoftKeyboard(): boolean {
if (typeof matchMedia !== 'function') return false;
return matchMedia('(pointer: coarse)').matches && !matchMedia('(any-pointer: fine)').matches;
}
/** The plain message for a failed send: the error's own text when it is meant for people, else a default. */
export function failureText(err: unknown, fallback: string): string {
if (err instanceof DomiError) return err.message;
if (typeof err === 'string' && err.trim()) return err;
return fallback;
}
/** Throw this from onsend / onclick to show its message to the person. Any other error shows the default. */
export class DomiError extends Error {
constructor(message: string) {
super(message);
this.name = 'DomiError';
}
}
+50
View File
@@ -0,0 +1,50 @@
import type { Action } from 'svelte/action';
/**
* The press flow of every Domi button: on pointer down it places the seal impression where the press landed
* (--_px, --_py) and replays it (data-struck); Enter and Space show the sunk plate while held (data-pressed), so a
* keyboard press looks like a pointer press. Reduced motion is handled in CSS (no impression, no movement).
*/
export const strike: Action<HTMLElement> = (node) => {
const replay = (x: string, y: string) => {
node.style.setProperty('--_px', x);
node.style.setProperty('--_py', y);
node.removeAttribute('data-struck');
// Force a style flush so the animation restarts on a quick second press.
void node.offsetWidth;
node.setAttribute('data-struck', '');
};
const down = (e: PointerEvent) => {
if (e.button !== 0 || isInert(node)) return;
const r = node.getBoundingClientRect();
replay(`${e.clientX - r.left}px`, `${e.clientY - r.top}px`);
};
const keydown = (e: KeyboardEvent) => {
if ((e.key === 'Enter' || e.key === ' ') && !e.repeat && !isInert(node)) {
node.setAttribute('data-pressed', '');
replay('50%', '50%');
}
};
const release = () => node.removeAttribute('data-pressed');
const end = (e: AnimationEvent) => {
if (e.target === node && e.pseudoElement === '::after') node.removeAttribute('data-struck');
};
node.addEventListener('pointerdown', down);
node.addEventListener('keydown', keydown);
node.addEventListener('keyup', release);
node.addEventListener('blur', release);
node.addEventListener('animationend', end);
return {
destroy() {
node.removeEventListener('pointerdown', down);
node.removeEventListener('keydown', keydown);
node.removeEventListener('keyup', release);
node.removeEventListener('blur', release);
node.removeEventListener('animationend', end);
},
};
};
function isInert(node: HTMLElement): boolean {
return (node as HTMLButtonElement).disabled === true || node.getAttribute('aria-disabled') === 'true';
}
File diff suppressed because it is too large Load Diff
+15
View File
@@ -0,0 +1,15 @@
import type { IconName } from './lib/icons';
/** One choice of a Select or a Segmented control. */
export interface DomiOption {
value: string;
label: string;
icon?: IconName;
disabled?: boolean;
}
export type ButtonVariant = 'plate' | 'primary' | 'quiet' | 'danger';
export type ControlSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
export type FieldAction = 'send' | 'search' | 'next' | 'save';
export type DomiTheme = 'dark' | 'light' | 'auto';
export type DomiDensity = 'pointer' | 'touch';
+1
View File
@@ -24,6 +24,7 @@
"test": "vitest run --reporter=verbose"
},
"dependencies": {
"@domi/ui": "workspace:*",
"@rosea/engine": "workspace:*",
"@rosea/schema": "workspace:*"
},
+19 -28
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import { Button, DomiCredit } from '@domi/ui';
import { PRODUCT_NAME, type Gardener } from '@rosea/schema';
import { tick } from 'svelte';
import { en } from './copy/en.js';
@@ -79,7 +80,7 @@
let sunLine = $state<HTMLElement>();
/** The in-game sunset is showing (chair-sunset.md). */
let watching = $state(false);
let chairButton = $state<HTMLButtonElement>();
let chairButton = $state<HTMLButtonElement | null>(null);
async function stopWatching(): Promise<void> {
watching = false;
@@ -178,6 +179,7 @@
<h1 bind:this={heading} tabindex="-1">{en.letter.title}</h1>
<Letter {blocks} />
<a href={GARDEN_HASH}>{en.letter.back}</a>
{@render credit()}
</main>
{:else}
<main class="shell">
@@ -222,8 +224,9 @@
{#if !kept}
<p class="hint">{en.sunset.notKept}</p>
{/if}
<button type="button" class="quiet" onclick={() => (changing = true)}>{place ? en.sunset.change : en.sunset.choose}</button>
<button type="button" class="quiet" bind:this={chairButton} onclick={() => (watching = true)}>{en.chair.move}</button>
<Button variant="quiet" onclick={() => (changing = true)}>{place ? en.sunset.change : en.sunset.choose}</Button>
<!-- Focus comes back here after the sunset (bind:element, @domi/ui 1.5.0). -->
<Button variant="quiet" bind:element={chairButton} onclick={() => (watching = true)}>{en.chair.move}</Button>
</div>
{#if watching}
<ChairSunset {place} guessed={choice?.kind === 'device-zone'} now={sunset.now} onclose={stopWatching} />
@@ -233,13 +236,23 @@
{#if blocks.length > 0}
<a href={LETTER_HASH}>{en.letter.title}</a>
{/if}
{@render credit()}
</main>
{/if}
<!--
The licence's credit (CPAL-1.0 Exhibit B, for Rosea and for @domi/ui): its exact words, at the foot of every screen
from the first open on (domi-ui.md D9). link={false}: the address as plain text, because the garden is offline and
a tap must never carry the player out of it, least of all on Android, which has no internet at all.
-->
{#snippet credit()}
<DomiCredit link={false} class="credit" />
{/snippet}
{#if updateReady && onrefresh}
<aside class="update" aria-label={en.update.ready}>
<p role="status">{en.update.ready}</p>
<button type="button" onclick={onrefresh}>{en.update.refresh}</button>
<Button onclick={onrefresh}>{en.update.refresh}</Button>
</aside>
{/if}
@@ -296,14 +309,8 @@
font-size: 0.9rem;
}
.quiet {
font: inherit;
background: none;
border: none;
padding: var(--space-1) 0;
color: var(--rose);
text-decoration: underline;
cursor: pointer;
.shell :global(.credit) {
margin-top: var(--space-4);
}
.update {
@@ -323,20 +330,4 @@
margin: 0;
color: var(--ink-soft);
}
.update button {
font: inherit;
padding: var(--space-1) var(--space-3);
border-radius: 999px;
border: 1px solid var(--rose);
background: var(--paper);
color: var(--ink);
cursor: pointer;
}
.update button:focus-visible,
.quiet:focus-visible {
outline: 2px solid var(--rose);
outline-offset: 2px;
}
</style>
+2
View File
@@ -101,6 +101,8 @@ export const en = {
question: 'Where do you want your sunset?',
why: 'The garden follows the real sun. Choose a town near you. It is kept on this device only.',
searchLabel: 'Town or city',
/** The search field's seal, read aloud (@domi/ui TextField, action search). The list follows the typing. */
searchAction: 'Search towns',
/** Said aloud as the list changes. Never "not found": a small town is not a mistake. */
found: (n: number): string => (n === 0 ? 'No town by that name here. A larger one nearby will do.' : n === 1 ? 'One town' : `${n} towns`),
skip: (guess: string): string => `Not now. Use ${guess}`,
+10 -26
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import { Button } from '@domi/ui';
import { en } from '../copy/en.js';
import type { RoseWiring } from './types.js';
@@ -76,17 +77,18 @@
<p>{refused ? en.rose.safe.refused : persisted === true ? en.rose.safe.kept : persisted === false ? en.rose.safe.mayClear : en.rose.safe.unknown}</p>
{/if}
{#if !inApp && persisted === false && !refused}
<button type="button" class="quiet" onclick={ask}>{en.rose.safe.ask}</button>
<Button variant="quiet" onclick={() => void ask()}>{en.rose.safe.ask}</Button>
{/if}
{#if !inApp && wiring.installHint}
<p>{en.rose.safe.install}</p>
{/if}
<button type="button" onclick={save}>{en.rose.safe.save}</button>
<Button onclick={() => void save()}>{en.rose.safe.save}</Button>
<p class="note">{en.rose.safe.fileNote}</p>
<label class="file">
<span>{en.rose.safe.bringBack}</span>
<!-- A label, so the file picker stays the browser's own; it wears @domi/ui's plate. -->
<label class="file domi-btn">
<span class="domi-btn__label">{en.rose.safe.bringBack}</span>
<input type="file" accept="application/json,.json" onchange={bringBack} />
</label>
<p class="said" role="status">{said}</p>
@@ -122,24 +124,6 @@
display: none;
}
button,
.file {
font: inherit;
padding: var(--space-2) var(--space-3);
border-radius: 999px;
border: 1px solid var(--rose);
background: var(--paper);
color: var(--ink);
cursor: pointer;
}
.quiet {
border: none;
padding: var(--space-1) 0;
color: var(--rose);
text-decoration: underline;
}
.file {
position: relative;
}
@@ -152,9 +136,9 @@
cursor: pointer;
}
.file:focus-within,
button:focus-visible {
outline: 2px solid var(--rose);
outline-offset: 2px;
/* The plate's own focus ring, on the label that holds the real input. */
.file:focus-within {
outline: 2px solid var(--domi-accent);
outline-offset: 3px;
}
</style>
+3 -24
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import { Button } from '@domi/ui';
import type { PetalNow } from '@rosea/engine';
import type { HopeSentence } from '@rosea/schema';
import { tick } from 'svelte';
@@ -34,11 +35,11 @@
{#if petal.kind === 'folded'}
<div class="petal">
<img src={folded} alt={en.rose.petal.folded} width="56" height="56" />
<button type="button" onclick={open}>{en.rose.petal.open}</button>
<Button onclick={() => void open()}>{en.rose.petal.open}</Button>
</div>
{:else if petal.kind === 'open' && today}
<div class="petal">
<button type="button" class="quiet" aria-expanded={showing} aria-controls="{uid}-words" onclick={() => (showing = !showing)}>{en.rose.petal.today}</button>
<Button variant="quiet" aria-expanded={showing} aria-controls="{uid}-words" onclick={() => (showing = !showing)}>{en.rose.petal.today}</Button>
{#if showing}
<div id="{uid}-words" class="words" tabindex="-1" bind:this={words}>
<figure>
@@ -103,26 +104,4 @@
color: var(--ink-soft);
}
button {
font: inherit;
padding: var(--space-2) var(--space-3);
border-radius: 999px;
border: 1px solid var(--rose);
background: var(--paper);
color: var(--ink);
cursor: pointer;
}
.quiet {
border: none;
background: none;
padding: var(--space-1) 0;
color: var(--rose);
text-decoration: underline;
}
button:focus-visible {
outline: 2px solid var(--rose);
outline-offset: 2px;
}
</style>
+25 -40
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import { Button } from '@domi/ui';
import {
careEvent, goodMoment, lightAt, localDay, newCare, newOpened, petalAt, petalsToday, pour, roseAt, ROSE, sentenceOpened, touch, TOUCH,
UNTOUCHED, weedsToday, type Mood, type PetalNow, type Place, type RoseNow, type Stage, type TouchState
@@ -265,10 +266,10 @@
if (e.key === 'Escape') void closeRing();
}}
>
<button
type="button"
class="water"
class:pouring
<!-- Button runs a passed onkeydown and onblur before its own since @domi/ui 1.4.0 (the fix from here, domi-ui.md
D3): the pour needs both. -->
<Button
class={pouring ? 'water pouring' : 'water'}
aria-describedby="rose-water-hint"
onpointerdown={(e) => {
e.preventDefault();
@@ -286,18 +287,17 @@
if (isPourKey(e)) stopPour();
}}
onblur={stopPour}
>{en.rose.water}</button>
>{en.rose.water}</Button>
{#if rose.needs.wind}
<button type="button" onclick={() => careBy('shade')}>{en.rose.shade}</button>
<Button onclick={() => careBy('shade')}>{en.rose.shade}</Button>
{/if}
{#if rose.needs.weeds}
<button type="button" onclick={() => careBy('weed')}>{en.rose.weed}</button>
<Button onclick={() => careBy('weed')}>{en.rose.weed}</Button>
{/if}
{#if rose.needs.petals}
<button type="button" onclick={() => careBy('petals')}>{en.rose.petals}</button>
<Button onclick={() => careBy('petals')}>{en.rose.petals}</Button>
{/if}
<button
type="button"
<Button
onclick={() => {
planet?.act('touch');
touchHer();
@@ -306,8 +306,8 @@
// A held key is one touch, not a rush (thorns.md T2).
if (e.repeat) e.preventDefault();
}}
>{en.rose.touch.label}</button>
<button type="button" class="quiet" onclick={() => void closeRing()}>{en.scene.close}</button>
>{en.rose.touch.label}</Button>
<Button variant="quiet" onclick={() => void closeRing()}>{en.scene.close}</Button>
</div>
<p id="rose-water-hint" class="hint">{en.rose.waterHint}</p>
{/if}
@@ -326,10 +326,10 @@
{/if}
<div class="more">
<button type="button" class="quiet" aria-expanded={showNumbers} aria-controls="rose-numbers" onclick={() => (showNumbers = !showNumbers)}>{en.rose.numbers}</button>
<button type="button" class="quiet" aria-expanded={showSafe} onclick={() => (showSafe = !showSafe)}>{en.rose.safe.title}</button>
<Button variant="quiet" aria-expanded={showNumbers} aria-controls="rose-numbers" onclick={() => (showNumbers = !showNumbers)}>{en.rose.numbers}</Button>
<Button variant="quiet" aria-expanded={showSafe} onclick={() => (showSafe = !showSafe)}>{en.rose.safe.title}</Button>
{#if onchangegardener}
<button type="button" class="quiet" onclick={onchangegardener}>{en.gardener.change}</button>
<Button variant="quiet" onclick={onchangegardener}>{en.gardener.change}</Button>
{/if}
</div>
{#if showNumbers}
@@ -368,20 +368,16 @@
gap: var(--space-2);
}
.care button {
font: inherit;
padding: var(--space-2) var(--space-3);
border-radius: 999px;
border: 1px solid var(--rose);
background: var(--paper);
color: var(--ink);
cursor: pointer;
/* Water is held, not clicked: the page must not scroll or select under the finger (rose.md). */
.care :global(.water) {
touch-action: none;
user-select: none;
}
.care button.pouring {
background: color-mix(in srgb, var(--rose) 18%, var(--paper));
/* While she is being watered the plate stays pressed in (@domi/ui's own press, held). */
.care :global(.water.pouring) {
background: var(--domi-plate-press);
box-shadow: var(--domi-plate-shadow-press);
}
.hint,
@@ -399,18 +395,12 @@
width: 12rem;
}
.quiet {
font: inherit;
background: none;
border: none;
color: var(--rose);
text-decoration: underline;
cursor: pointer;
}
/* The shared buttons keep their words on one line, so the row wraps instead (a phone is 360 px wide). */
.more {
display: flex;
gap: var(--space-3);
flex-wrap: wrap;
justify-content: center;
gap: var(--space-1) var(--space-3);
}
.numbers {
@@ -427,9 +417,4 @@
dd {
margin: 0;
}
button:focus-visible {
outline: 2px solid var(--rose);
outline-offset: 2px;
}
</style>
+4 -27
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import { Button } from '@domi/ui';
import { GARDENER_FIELDS, GARDENER_OPTIONS, type Gardener as Look } from '@rosea/schema';
import { untrack } from 'svelte';
import { en } from '../copy/en.js';
@@ -53,8 +54,8 @@
</fieldset>
{/each}
<div class="actions">
<button type="submit" class="primary">{en.gardener.done}</button>
{#if oncancel}<button type="button" class="quiet" onclick={oncancel}>{en.scene.close}</button>{/if}
<Button type="submit" variant="primary">{en.gardener.done}</Button>
{#if oncancel}<Button variant="quiet" onclick={oncancel}>{en.scene.close}</Button>{/if}
</div>
</form>
</section>
@@ -145,33 +146,9 @@
.actions {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: var(--space-3);
}
button {
font: inherit;
padding: var(--space-2) var(--space-4);
border-radius: 999px;
border: 1px solid var(--rose);
background: var(--paper);
color: var(--ink);
cursor: pointer;
}
.primary {
background: var(--rose);
color: var(--paper);
}
.quiet {
border: none;
text-decoration: underline;
color: var(--rose);
}
button:focus-visible {
outline: 2px solid var(--rose);
outline-offset: 2px;
}
</style>
+19 -20
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import { Button } from '@domi/ui';
import type { NamedPlace } from '@rosea/engine';
import { en } from '../copy/en.js';
import SunsetLine from './SunsetLine.svelte';
@@ -87,8 +88,8 @@
<p>{en.sunset.noTown}</p>
{/if}
<div class="choices">
<button type="button" onclick={(e) => { e.stopPropagation(); showing += 1; }}>{en.chair.again}</button>
<button type="button" class="quiet" onclick={(e) => { e.stopPropagation(); leave(); }}>{en.chair.back}</button>
<Button onclick={(e) => { e.stopPropagation(); showing += 1; }}>{en.chair.again}</Button>
<Button variant="quiet" onclick={(e) => { e.stopPropagation(); leave(); }}>{en.chair.back}</Button>
</div>
</div>
{/if}
@@ -186,27 +187,25 @@
.choices {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: var(--space-3);
}
button {
font: inherit;
padding: var(--space-2) var(--space-3);
border-radius: 999px;
border: 1px solid #f4d58d;
background: transparent;
color: #fbf6f1;
cursor: pointer;
}
.quiet {
border: none;
text-decoration: underline;
}
button:focus-visible {
outline: 2px solid #f4d58d;
outline-offset: 2px;
/* @domi/ui's buttons on dusk, whatever the page's theme: the plate is the evening's own glass with the
sunset's gold edge, as Rosea's button was (domi-ui.md D5). */
.choices {
--domi-fg: var(--ink);
--domi-fg-2: var(--ink-soft);
--domi-edge: #f4d58d;
--domi-accent: #f4d58d;
--domi-plate: linear-gradient(180deg, #ffffff1f, #ffffff0a);
--domi-plate-hover: linear-gradient(180deg, #ffffff2e, #ffffff12);
--domi-plate-press: linear-gradient(180deg, #00000033, #ffffff0a);
--domi-plate-shadow: inset 0 1px 0 #ffffff33, 0 8px 18px -12px #000000cc;
--domi-plate-shadow-hover: inset 0 1px 0 #ffffff47, 0 10px 22px -12px #000000e6;
--domi-tint: #f4d58d24;
--domi-tint-strong: #f4d58d38;
}
.sr-only {
+26 -52
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import { Button, TextField } from '@domi/ui';
import type { NamedPlace } from '@rosea/engine';
import { en } from '../copy/en.js';
import type { SunsetChoice } from './types.js';
@@ -28,7 +29,9 @@
let query = $state('');
// Raw: the towns are handed on as they came, never wrapped in a state Proxy.
let results = $state.raw<readonly NamedPlace[]>([]);
let input = $state<HTMLInputElement>();
let input = $state<HTMLInputElement | HTMLTextAreaElement | null>(null);
// On Android the field is an editable box, not an <input> (as="auto" below): focus whichever there is.
let editor = $state<HTMLElement | null>(null);
// Only the latest query's answer is shown, however the searches finish.
let asked = 0;
@@ -51,7 +54,7 @@
});
$effect(() => {
if (focusOnOpen) input?.focus();
if (focusOnOpen) (input ?? editor)?.focus();
});
const where = (t: NamedPlace): string => [t.region, t.country].filter(Boolean).join(', ');
@@ -61,15 +64,24 @@
<h2 id="{uid}-q">{en.sunset.question}</h2>
<p class="why">{en.sunset.why}</p>
<label for="{uid}-search">{en.sunset.searchLabel}</label>
<input
<!-- The list already follows the typing; the seal and Enter only confirm it, so they say nothing of their own
(sentText) and the status line below speaks (domi-ui.md D4). Nothing is sent anywhere: "search", never "send".
as="auto": on Android an editable box, because a native field makes the WebView ask Google's Autofill service
the moment it gets focus, whatever the app's permissions (domi-ui.md D10). -->
<TextField
as="auto"
id="{uid}-search"
type="search"
label={en.sunset.searchLabel}
action="search"
actionLabel={en.sunset.searchAction}
sentText=""
autocomplete="off"
spellcheck="false"
enterkeyhint="search"
spellcheck={false}
onsend={() => {}}
bind:value={query}
bind:this={input}
bind:input
bind:editor
/>
<p class="found" role="status" aria-live="polite">{query.trim() === '' ? '' : en.sunset.found(results.length)}</p>
@@ -77,10 +89,10 @@
<ul>
{#each results as town (`${town.name}|${town.lat}|${town.lon}`)}
<li>
<button type="button" onclick={() => onchoose({ kind: 'town', town })}>
<Button block onclick={() => onchoose({ kind: 'town', town })}>
<span class="name">{town.name}</span>
<span class="where">{where(town)}</span>
</button>
</Button>
</li>
{/each}
</ul>
@@ -88,11 +100,11 @@
<div class="other">
{#if current && oncancel}
<button type="button" class="quiet" onclick={oncancel}>{en.sunset.keep(current.name)}</button>
<Button variant="quiet" onclick={oncancel}>{en.sunset.keep(current.name)}</Button>
{/if}
<button type="button" class="quiet" onclick={() => onchoose({ kind: 'device-zone' })}>
<Button variant="quiet" onclick={() => onchoose({ kind: 'device-zone' })}>
{guess ? en.sunset.skip(guess.name) : en.sunset.skipNoGuess}
</button>
</Button>
</div>
</section>
@@ -123,19 +135,6 @@
display: none;
}
label {
font-size: 0.95rem;
}
input {
font: inherit;
padding: var(--space-2);
border: 1px solid var(--ink-soft);
border-radius: 0.5rem;
background: var(--paper);
color: var(--ink);
}
ul {
list-style: none;
margin: 0;
@@ -144,22 +143,11 @@
gap: var(--space-1);
}
button {
font: inherit;
cursor: pointer;
border-radius: 0.5rem;
color: var(--ink);
}
li button {
/* A town row: its name at the start, its region at the end, on @domi/ui's plate. */
li :global(.domi-btn__label) {
width: 100%;
display: flex;
justify-content: space-between;
gap: var(--space-2);
padding: var(--space-2);
text-align: start;
background: var(--paper);
border: 1px solid color-mix(in srgb, var(--ink-soft) 40%, transparent);
}
.where {
@@ -172,18 +160,4 @@
flex-wrap: wrap;
gap: var(--space-2);
}
.quiet {
background: none;
border: none;
padding: var(--space-1) 0;
color: var(--rose);
text-decoration: underline;
}
button:focus-visible,
input:focus-visible {
outline: 2px solid var(--rose);
outline-offset: 2px;
}
</style>
+10
View File
@@ -1,3 +1,9 @@
/* @domi/ui, vendored in packages/domi-ui (CPAL-1.0, see its NOTICE): its tokens, base and components, before Rosea's
own. Not its fonts: Rosea keeps her system faces (below). */
@import '@domi/ui/tokens.css';
@import '@domi/ui/base.css';
@import '@domi/ui/components.css';
/*
* Design tokens. Placeholders until docs/ART.md sets the palette: they exist so
* components reference tokens from the first commit, never raw colours.
@@ -13,6 +19,10 @@
--font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
--font-display: Georgia, 'Times New Roman', serif;
/* Rosea keeps her system faces inside the shared controls too (@domi/ui INTEGRATE.md §0.4; the font is Mark's
open question in its PALETTE.md). */
--domi-font-hand: var(--font-body);
--domi-font-book: var(--font-display);
--space-1: 0.25rem;
--space-2: 0.5rem;
+23 -1
View File
@@ -3,6 +3,7 @@ import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/sv
import { afterEach, describe, expect, it } from 'vitest';
import Shell from '../src/Shell.svelte';
import { en } from '../src/copy/en.js';
import { said } from './said.js';
afterEach(() => {
cleanup();
@@ -19,6 +20,27 @@ const LETTER = [
const h1 = (): HTMLElement => screen.getByRole('heading', { level: 1 });
describe('the licence credit (CPAL-1.0 Exhibit B; domi-ui.md D9)', () => {
const credit = 'Built on Domi · https://aula.marek-novak.cz · Copyright (c) 2026 Marek Novák';
/** The credit line as a reader gets it: @domi/ui's DomiCredit sets its parts in spans. */
const creditLine = (): string => document.querySelector('.domi-credit')?.textContent?.replace(/\s+/g, ' ').trim() ?? '';
it('stands at the foot of the first screen in its exact words, as plain text that leads nowhere', () => {
render(Shell);
expect(creditLine()).toBe(credit);
expect(document.querySelector('.domi-credit a')).toBeNull();
expect(document.querySelectorAll('a[href^="https://aula"]')).toHaveLength(0);
});
it('stands at the foot of the Letter too', async () => {
window.location.hash = '#letter';
render(Shell, { letter: LETTER });
await waitFor(() => expect(h1().textContent).toBe(en.letter.title));
expect(creditLine()).toBe(credit);
});
});
describe('Shell', () => {
it('names the product in the page heading, from the schema constant', () => {
render(Shell);
@@ -94,7 +116,7 @@ describe('Shell and a new version waiting (calm-refresh.md)', () => {
it('when one waits: one quiet line and Refresh, which only the player\'s tap sends', async () => {
let refreshed = 0;
render(Shell, { updateReady: true, onrefresh: () => (refreshed += 1) });
expect(screen.getByRole('status').textContent).toBe(en.update.ready);
expect(said().textContent).toBe(en.update.ready);
expect(refreshed).toBe(0);
await fireEvent.click(screen.getByRole('button', { name: en.update.refresh }));
expect(refreshed).toBe(1);
+1 -1
View File
@@ -90,7 +90,7 @@ describe('her planet (planet-garden.md)', () => {
await tick();
const ring = screen.getByRole('group', { name: en.scene.ring });
expect(her.getAttribute('aria-expanded')).toBe('true');
expect(document.activeElement?.textContent).toBe(en.rose.water);
expect(document.activeElement?.textContent?.trim()).toBe(en.rose.water);
expect(screen.getByRole('button', { name: en.rose.touch.label })).toBeTruthy();
expect(screen.queryByRole('button', { name: en.rose.weed })).toBeNull();
await fireEvent.keyDown(ring, { key: 'Escape' });
+3 -2
View File
@@ -4,6 +4,7 @@ import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/sv
import { tick } from 'svelte';
import { afterEach, describe, expect, it, vi } from 'vitest';
import { en } from '../src/copy/en.js';
import { said } from './said.js';
import Rose from '../src/rose/Rose.svelte';
import type { RoseWiring } from '../src/rose/types.js';
@@ -89,7 +90,7 @@ describe('the rose', () => {
render(Rose, { wiring: w, timeZone: ZONE });
await screen.findByRole('img', { name: /^The rose/ });
await hold(1500); // half a can
expect(screen.getByRole('status').textContent).toBe(en.rose.leavesLift);
expect(said().textContent).toBe(en.rose.leavesLift);
await release();
expect(w.appended).toHaveLength(1);
expect(w.appended[0]).toMatchObject({ act: 'water', amount: 0.5, localDay: '2026-03-01', from: ME, to: ME });
@@ -105,7 +106,7 @@ describe('the rose', () => {
render(Rose, { wiring: wiring({ log: [water(MORNING - 60_000, 0.5)] }), timeZone: ZONE });
await screen.findByRole('img', { name: /^The rose/ });
await hold(3000);
expect(screen.getByRole('status').textContent).toBe(en.rose.plenty);
expect(said().textContent).toBe(en.rose.plenty);
});
it('pours with the keyboard too: hold Space, let go', async () => {
+12
View File
@@ -0,0 +1,12 @@
import { screen } from '@testing-library/svelte';
/**
* The one status line Rosea herself speaks through. Every @domi/ui button also carries a hidden status of its own
* (`.domi-sr`, empty until the button works on a Promise, which Rosea's never do: domi-ui.md D2), so "the" status
* is the one that is not a button's.
*/
export function said(): HTMLElement {
const own = screen.getAllByRole('status').filter((el) => !el.classList.contains('domi-sr'));
if (own.length !== 1) throw new Error(`expected one status line of Rosea's own, found ${own.length}`);
return own[0]!;
}
+17 -2
View File
@@ -3,6 +3,7 @@ import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/sv
import { afterEach, describe, expect, it, vi } from 'vitest';
import Shell from '../src/Shell.svelte';
import { en } from '../src/copy/en.js';
import { said } from './said.js';
import type { SunsetChoice, SunsetWiring } from '../src/sunset/types.js';
const brno: NamedPlace = { name: 'Brno', region: '', country: 'Czechia', lat: 49.2, lon: 16.61, timeZone: 'Europe/Prague' };
@@ -44,11 +45,25 @@ describe('the garden asks where the sunset is', () => {
expect(document.activeElement).toBe(document.body);
});
it('on Android the town field is no native text field, so the WebView asks no Autofill service (domi-ui.md D10)', async () => {
vi.spyOn(navigator, 'userAgent', 'get').mockReturnValue('Mozilla/5.0 (Linux; Android 16; WAVE 10C) AppleWebKit/537.36 Chrome/140.0 Mobile Safari/537.36');
render(Shell, { sunset: wiring() });
const field = await screen.findByRole('textbox', { name: en.sunset.searchLabel });
expect(field.getAttribute('contenteditable')).toBe('plaintext-only');
expect(document.querySelector('.ask input:not([type="hidden"]), .ask textarea')).toBeNull();
});
it('elsewhere it stays the native search field', async () => {
render(Shell, { sunset: wiring() });
expect(await screen.findByRole('searchbox', { name: en.sunset.searchLabel })).toBeTruthy();
expect(screen.queryByRole('textbox', { name: en.sunset.searchLabel })).toBeNull();
});
it('typing lists towns, choosing one shows its sunset, keeps it, and moves focus to the answer', async () => {
const w = wiring();
render(Shell, { sunset: w });
await fireEvent.input(await screen.findByRole('searchbox'), { target: { value: 'br' } });
expect(await screen.findByRole('status')).toHaveProperty('textContent', en.sunset.found(1));
await waitFor(() => expect(said().textContent).toBe(en.sunset.found(1)));
await fireEvent.click(screen.getByRole('button', { name: /Brno/ }));
const at = invitation(sunDay('2026-03-29', brno));
@@ -61,7 +76,7 @@ describe('the garden asks where the sunset is', () => {
it('nothing found says a larger town nearby will do, never an error', async () => {
render(Shell, { sunset: wiring() });
await fireEvent.input(await screen.findByRole('searchbox'), { target: { value: 'zz' } });
await waitFor(() => expect(screen.getByRole('status').textContent).toBe(en.sunset.found(0)));
await waitFor(() => expect(said().textContent).toBe(en.sunset.found(0)));
});
it('"not now" uses the guess, saves the device zone, and says it is a guess', async () => {
+33
View File
@@ -134,6 +134,21 @@ importers:
specifier: 3.2.7
version: 3.2.7(@types/node@22.20.1)(jsdom@25.0.1)(terser@5.51.2)(tsx@4.23.12)
packages/domi-ui:
dependencies:
'@fontsource-variable/cinzel':
specifier: 5.3.0
version: 5.3.0
'@fontsource-variable/cormorant-garamond':
specifier: 5.3.0
version: 5.3.0
'@fontsource-variable/manrope':
specifier: 5.3.0
version: 5.3.0
svelte:
specifier: ^5.20.0
version: 5.56.9(@typescript-eslint/types@8.69.0)
packages/engine:
dependencies:
'@rosea/schema':
@@ -205,6 +220,9 @@ importers:
packages/ui:
dependencies:
'@domi/ui':
specifier: workspace:*
version: link:../domi-ui
'@rosea/engine':
specifier: workspace:*
version: link:../engine
@@ -1185,6 +1203,15 @@ packages:
resolution: {integrity: sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@fontsource-variable/cinzel@5.3.0':
resolution: {integrity: sha512-eFcU0TwaAP5QESF2pV8VoOPJJXJ6sSGm/6mXMwqTdMBPAJMaLhfa6oISHuOtFeddsoHP9RYm4Io0j1j3mNEz2Q==}
'@fontsource-variable/cormorant-garamond@5.3.0':
resolution: {integrity: sha512-rgZJ/5w3hi60swAPnrOXpZf5wEH6NTrvm4H8D9Y4b1QIFUqlX14eM3QTMU/eAznjfh0eXpO1QUqsFhiy58aoMg==}
'@fontsource-variable/manrope@5.3.0':
resolution: {integrity: sha512-6D5dgokHsWDDMtmXHznKa0hK229NN+1a4BLPmUCLqcO1Pw5EEhWY5RFt0AcXnVRAljFFPfRtLkJePQj6LSsV6g==}
'@humanfs/core@0.19.2':
resolution: {integrity: sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==}
engines: {node: '>=18.18.0'}
@@ -4409,6 +4436,12 @@ snapshots:
'@eslint/core': 0.17.0
levn: 0.4.1
'@fontsource-variable/cinzel@5.3.0': {}
'@fontsource-variable/cormorant-garamond@5.3.0': {}
'@fontsource-variable/manrope@5.3.0': {}
'@humanfs/core@0.19.2':
dependencies:
'@humanfs/types': 0.15.0