[web] Domi UI: the web UI on @domi/ui v1.0.4, vendored (CPAL-1.0), with the Built on Domi credit (PR #14, squashed)

@domi/ui v1.0.4 vendored unchanged in packages/domi-ui by domi-design's tools/vendor.mjs and used as workspace:*, so
the Nix build fetches nothing from Gitea (web.nix sources the folder; fetchPnpmDeps hash from the NixOS runner).
Its fonts, roles (data-domi-room="ianitor", the same hex) and controls replace Ianitor's copies: Button through
Ianitor's adapter (desktop sizes kept), every text field a TextField with its seal, Checkbox, Select, Segmented.
Ianitor's 22 role names renamed to --domi-*. <DomiCredit /> on every screen and in About, with the CPAL section 15
note beside the source link; the README names the vendored package. Disabled buttons are natively disabled.
This commit was merged in pull request #14.
This commit is contained in:
2026-11-23 00:52:19 +01:00
parent 0934bb3419
commit c9aa55ec99
83 changed files with 8528 additions and 396 deletions
@@ -0,0 +1,151 @@
<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;
}
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,
...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
{...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) => e.key === 'Escape' && armed && disarm()}
onblur={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,21 @@
<!-- 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 {
class?: string;
}
let { 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>
<a href={A.url} target="_blank" rel="noopener noreferrer">{A.url}</a>
<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,324 @@
<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';
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. */
input?: HTMLInputElement | HTMLTextAreaElement | 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),
}: Props = $props();
const uid = $props.id();
const fieldId = $derived(id ?? `domi-field-${uid}`);
const hintId = `domi-hint-${uid}`;
const errorId = `domi-error-${uid}`;
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');
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('type') !== 'hidden',
);
const i = all.indexOf(from);
all[i + 1]?.focus();
}
async function submit() {
if (!sendable || !input) return;
const el = input;
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.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: HTMLInputElement | HTMLTextAreaElement) {
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();
}
}
function typed() {
if (shown === 'error' && status === undefined) {
auto = 'idle';
failure = '';
}
if (shown === 'sent' && status === undefined) auto = 'idle';
grow();
}
// 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) return;
input.style.height = 'auto';
input.style.height = `${input.scrollHeight}px`;
}
$effect(() => {
void value;
grow();
});
$effect(() => () => clearTimeout(timer));
$effect(() => {
if (autofocus) input?.focus();
});
function focusInput(e: MouseEvent) {
if (e.target === e.currentTarget) input?.focus();
}
</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}
>
<label class={['domi-field__label', hideLabel && 'domi-sr']} for={fieldId}>
{label}{#if optional}<span class="domi-field__optional">{" (optional)"}</span>{/if}
</label>
<!-- 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 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
+23
View File
@@ -0,0 +1,23 @@
// 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 { 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}`;
+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';