@blueshed/joined 0.2.2 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/joined/SKILL.md +9 -1
- package/.claude/skills/joined/reference.md +316 -63
- package/.claude/skills/joined-door/SKILL.md +57 -0
- package/README.md +19 -50
- package/docs/design.md +158 -37
- package/docs/introduction.md +27 -27
- package/docs/light-and-shadow.svg +2 -1
- package/docs/links-and-trust.svg +1 -0
- package/docs/stories-to-code.svg +2 -1
- package/docs/wire-op.svg +1 -0
- package/examples/README.md +20 -0
- package/examples/account/account.json +1 -0
- package/examples/account/derive.ts +41 -0
- package/examples/account/generated/elements.ts +52 -0
- package/examples/account/generated/rows.ts +22 -0
- package/examples/account/generated/rules.ts +32 -0
- package/examples/account/routes.ts +5 -0
- package/examples/app.css +11 -1
- package/examples/cafe/books.html +2 -2
- package/examples/cafe/cafe.css +96 -85
- package/examples/cafe/generated/books.rows.ts +22 -0
- package/examples/cafe/generated/books.rules.ts +3 -2
- package/examples/cafe/generated/kitchen.rows.ts +27 -0
- package/examples/cafe/generated/kitchen.rules.ts +11 -1
- package/examples/cafe/generated/menu.rows.ts +22 -0
- package/examples/cafe/generated/menu.rules.ts +3 -2
- package/examples/cafe/generated/order.rows.ts +27 -0
- package/examples/cafe/generated/order.rules.ts +11 -1
- package/examples/cafe/generated/staff.elements.ts +7 -2
- package/examples/cafe/generated/staff.rows.ts +22 -0
- package/examples/cafe/generated/staff.rules.ts +9 -1
- package/examples/cafe/generated/supplies.queries.ts +4 -2
- package/examples/cafe/generated/supplies.rows.ts +22 -0
- package/examples/cafe/generated/supplies.rules.ts +17 -1
- package/examples/cafe/generated/till.queries.ts +2 -0
- package/examples/cafe/generated/till.rows.ts +27 -0
- package/examples/cafe/generated/till.rules.ts +11 -1
- package/examples/cafe/index.html +14 -15
- package/examples/cafe/kitchen.css +11 -19
- package/examples/cafe/kitchen.ts +7 -3
- package/examples/cafe/look.ts +30 -0
- package/examples/cafe/menu.html +10 -26
- package/examples/cafe/menu.ts +8 -80
- package/examples/cafe/migrations/002-guard-supplies.ts +15 -0
- package/examples/cafe/order.html +8 -7
- package/examples/cafe/order.ts +6 -2
- package/examples/cafe/routes.ts +0 -1
- package/examples/cafe/staff.json +5 -0
- package/examples/cafe/stories.jsonl +6 -2
- package/examples/cafe/supplies.html +35 -34
- package/examples/cafe/supplies.ts +59 -39
- package/examples/cafe/till.ts +19 -11
- package/examples/cafe/views.ts +7 -5
- package/examples/chart/arches.ts +150 -0
- package/examples/chart/chart.css +11 -0
- package/examples/chart/chart.json +87 -0
- package/examples/chart/generated/elements.ts +105 -0
- package/examples/chart/generated/queries.ts +36 -0
- package/examples/chart/generated/rows.ts +27 -0
- package/examples/chart/generated/rules.ts +111 -0
- package/examples/chart/grid.ts +118 -0
- package/examples/chart/index.html +78 -0
- package/examples/chart/migrations/001-chart.ts +6 -0
- package/examples/chart/migrations/002-create-conditions.ts +6 -0
- package/examples/chart/page.ts +20 -0
- package/examples/chart/routes.ts +7 -0
- package/examples/chart/stories.jsonl +14 -0
- package/examples/chart/teeth.ts +57 -0
- package/examples/desk/desk.css +6 -10
- package/examples/desk/generated/elements.ts +1 -1
- package/examples/desk/generated/rows.ts +22 -0
- package/examples/desk/generated/rules.ts +34 -1
- package/examples/desk/index.html +10 -3
- package/examples/desk/lanes.css +21 -19
- package/examples/desk/routes.ts +0 -2
- package/examples/desk/stories.jsonl +4 -3
- package/examples/desk/tally.css +1 -1
- package/examples/desk/thumbs.ts +2 -2
- package/examples/docs.ts +7 -4
- package/examples/hello/generated/elements.ts +2 -2
- package/examples/hello/generated/rules.ts +3 -2
- package/examples/hello/hello.css +2 -4
- package/examples/hello/index.html +10 -3
- package/examples/hello/page.ts +4 -4
- package/examples/index.html +20 -12
- package/examples/notes/generated/elements.ts +112 -0
- package/examples/notes/generated/queries.ts +42 -0
- package/examples/notes/generated/rows.ts +27 -0
- package/examples/notes/generated/rules.ts +133 -0
- package/examples/notes/index.html +32 -0
- package/examples/notes/look.ts +41 -0
- package/examples/notes/migrations/001-notes.ts +7 -0
- package/examples/notes/notes.json +78 -0
- package/examples/notes/page.ts +21 -0
- package/examples/notes/routes.ts +6 -0
- package/examples/notes/stories.jsonl +24 -0
- package/examples/page.ts +9 -2
- package/examples/people/generated/rows.ts +22 -0
- package/examples/people/generated/rules.ts +11 -1
- package/examples/people/links.ts +8 -9
- package/examples/people/people.css +1 -1
- package/examples/people/routes.ts +1 -3
- package/examples/people/stories.jsonl +1 -0
- package/examples/people/view.ts +5 -2
- package/examples/trip/generated/elements.ts +5 -3
- package/examples/trip/generated/queries.ts +12 -1
- package/examples/trip/generated/rows.ts +27 -0
- package/examples/trip/generated/rules.ts +56 -2
- package/examples/trip/index.html +58 -12
- package/examples/trip/line.css +186 -0
- package/examples/trip/line.ts +51 -40
- package/examples/trip/page.ts +65 -71
- package/examples/trip/routes.ts +9 -5
- package/examples/trip/stays.css +13 -13
- package/examples/trip/stays.ts +15 -10
- package/examples/trip/stories.jsonl +2 -0
- package/examples/trip/told.ts +3 -26
- package/examples/trip/trip.css +16 -0
- package/examples/trips/generated/elements.ts +1 -1
- package/examples/trips/generated/rows.ts +22 -0
- package/examples/trips/generated/rules.ts +9 -1
- package/examples/trips/index.html +10 -10
- package/examples/trips/map.ts +3 -14
- package/examples/trips/new-trip.ts +14 -16
- package/examples/trips/trips.css +24 -23
- package/examples/weeks/generated/elements.ts +1 -1
- package/examples/weeks/generated/queries.ts +11 -0
- package/examples/weeks/generated/rows.ts +22 -0
- package/examples/weeks/generated/rules.ts +11 -5
- package/examples/weeks/routes.ts +3 -2
- package/examples/weeks/stories.jsonl +1 -0
- package/examples/welcome.css +43 -33
- package/package.json +8 -2
- package/src/attachment.ts +17 -2
- package/src/awesome.ts +103 -0
- package/src/board.css +76 -0
- package/src/board.ts +173 -0
- package/src/cli.ts +28 -3
- package/src/compile.ts +821 -109
- package/src/definitions.ts +113 -27
- package/src/demo.css +2 -5
- package/src/draft.ts +48 -27
- package/src/drawer.ts +248 -0
- package/src/engine.ts +253 -170
- package/src/fields.ts +341 -0
- package/src/file-value.ts +12 -2
- package/src/files.ts +113 -33
- package/src/ground.ts +110 -0
- package/src/icon-names.ts +19 -2
- package/src/keep.ts +16 -3
- package/src/kit.ts +51 -0
- package/src/link.ts +3 -3
- package/src/map.css +140 -0
- package/src/map.ts +200 -0
- package/src/mcp.ts +129 -24
- package/src/members/demo.ts +13 -12
- package/src/members/generated/rows.ts +22 -0
- package/src/members/generated/rules.ts +3 -2
- package/src/members/group.ts +105 -55
- package/src/members/keys.ts +95 -79
- package/src/members/panel.css +40 -35
- package/src/members/panel.ts +58 -37
- package/src/migrate.ts +178 -125
- package/src/migrations/005-change-kept.ts +7 -0
- package/src/month.css +129 -0
- package/src/month.ts +179 -0
- package/src/ops.ts +40 -1
- package/src/page.css +11 -2
- package/src/page.ts +68 -17
- package/src/parts.css +614 -230
- package/src/parts.ts +259 -36
- package/src/plane.css +61 -0
- package/src/plane.ts +153 -0
- package/src/postgres-server.ts +60 -0
- package/src/reading.css +73 -0
- package/src/reading.ts +238 -0
- package/src/rows.css +289 -0
- package/src/rows.ts +864 -0
- package/src/search.css +80 -0
- package/src/search.ts +130 -0
- package/src/server.ts +355 -137
- package/src/settings.ts +9 -4
- package/src/sheet.ts +116 -0
- package/src/skill.ts +40 -0
- package/src/slots.css +90 -0
- package/src/slots.ts +213 -0
- package/src/specs.ts +38 -0
- package/src/starter.ts +19 -2
- package/src/store.ts +224 -161
- package/src/stories.ts +43 -11
- package/src/surface.ts +164 -0
- package/src/time.ts +2 -0
- package/src/timeline.css +111 -0
- package/src/timeline.ts +235 -0
- package/src/toast.ts +21 -48
- package/src/together.ts +15 -24
- package/src/tokens.css +89 -3
- package/src/tokens.json +287 -7
- package/src/tool.ts +210 -0
- package/src/upkeep.ts +47 -22
- package/src/views.css +43 -0
- package/src/views.ts +111 -0
- package/src/week.css +150 -0
- package/src/week.ts +254 -0
- package/src/write.ts +326 -78
- package/starter/CHANGELOG.md +8 -0
- package/starter/CLAUDE.md +9 -3
- package/starter/bunfig +5 -0
- package/starter/githooks/pre-commit +13 -0
- package/starter/prettierignore +5 -0
- package/starter/tests/hello.test.ts +2 -0
- package/starter/tests/records.test.ts +40 -0
- package/starter/todo.jsonl +0 -0
- package/docs/learning.md +0 -76
- package/examples/cafe/trust.ts +0 -20
- package/examples/desk/trust.ts +0 -24
- package/examples/people/trust.ts +0 -14
- package/examples/trip/answer-rows.ts +0 -70
- package/examples/trip/bar.ts +0 -89
- package/examples/trip/calendar-map.css +0 -711
- package/examples/trip/calendar-map.ts +0 -249
- package/examples/trip/drags.ts +0 -143
- package/examples/trip/drawer.ts +0 -250
- package/examples/trip/event-form.ts +0 -200
- package/examples/trip/holding.ts +0 -61
- package/examples/trip/map.ts +0 -234
- package/examples/trip/month.ts +0 -87
- package/examples/trip/other-weeks.ts +0 -67
- package/examples/trip/peek.ts +0 -71
- package/examples/trip/people-chips.ts +0 -74
- package/examples/trip/shell.ts +0 -39
- package/examples/trip/trust.ts +0 -51
- package/examples/trip/week.ts +0 -237
- package/examples/trip/writes.ts +0 -91
- package/examples/trip/zones.ts +0 -16
- package/examples/weeks/derive.ts +0 -23
- package/src/scrim.ts +0 -81
package/src/toast.ts
CHANGED
|
@@ -1,52 +1,25 @@
|
|
|
1
|
-
// A toast: a page's own words, for a moment, with toast():
|
|
2
|
-
// toast rather than fading (a walk-through saying each step as it's made). A
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
// as its change), nor a refusal (whoever sent it says why, beside what sent it).
|
|
1
|
+
// A toast: a page's own words, for a moment, with toast(): Web Awesome's (wa-toast), at the foot of the page, an icon
|
|
2
|
+
// before them, and held until the next toast rather than fading (a walk-through saying each step as it's made). A
|
|
3
|
+
// page that wants it imports this. Words in quick succession replace it, never stack. A write that lands isn't
|
|
4
|
+
// toasted (what it did shows as its change), nor a refusal (whoever sent it says why, beside what sent it).
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
position: fixed;
|
|
12
|
-
left: 50%;
|
|
13
|
-
bottom: calc(var(--space-16) + env(safe-area-inset-bottom));
|
|
14
|
-
z-index: 20;
|
|
15
|
-
display: flex;
|
|
16
|
-
gap: var(--space-10);
|
|
17
|
-
align-items: center;
|
|
18
|
-
box-sizing: border-box;
|
|
19
|
-
/* as wide as its words, as the screen allows: fixed at the middle, it would fit only the half to its right */
|
|
20
|
-
width: max-content;
|
|
21
|
-
max-width: min(36rem, calc(100vw - 2rem));
|
|
22
|
-
margin: 0;
|
|
23
|
-
padding: var(--space-6) var(--space-16);
|
|
24
|
-
border-radius: 4px;
|
|
25
|
-
background: var(--ink);
|
|
26
|
-
color: var(--card);
|
|
27
|
-
font: var(--font-small);
|
|
28
|
-
translate: -50% 0;
|
|
29
|
-
opacity: 0;
|
|
30
|
-
transition: opacity 0.2s;
|
|
31
|
-
pointer-events: none;
|
|
32
|
-
}
|
|
33
|
-
p.shown { opacity: 1; }
|
|
34
|
-
svg { flex: none; }
|
|
35
|
-
@media (prefers-reduced-motion: reduce) { p { transition: none; } }
|
|
36
|
-
</style><p role="status" aria-live="polite"></p>`;
|
|
37
|
-
const said = root.querySelector("p")!;
|
|
38
|
-
let hide: ReturnType<typeof setTimeout> | undefined;
|
|
6
|
+
import "./awesome.ts";
|
|
7
|
+
|
|
8
|
+
const stack = Object.assign(document.createElement("wa-toast"), { placement: "bottom-center" });
|
|
9
|
+
document.body.append(stack);
|
|
39
10
|
|
|
40
|
-
/** Words in the toast, an icon before them if given: for 1.5s, or held until the next toast. The words
|
|
41
|
-
*
|
|
11
|
+
/** Words in the toast, an icon before them if given: for 1.5s, or held until the next toast. The words are text,
|
|
12
|
+
* or a node of the page's own (a name in bold); empty words take it away. */
|
|
42
13
|
export function toast(words: string | Node, { icon, hold = false }: { icon?: Element; hold?: boolean } = {}) {
|
|
43
|
-
|
|
44
|
-
if (!words) return
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
14
|
+
for (const old of stack.querySelectorAll("wa-toast-item")) old.remove();
|
|
15
|
+
if (!words) return;
|
|
16
|
+
const item = Object.assign(document.createElement("wa-toast-item"), { duration: hold ? 0 : 1500 });
|
|
17
|
+
item.setAttribute("variant", "neutral");
|
|
18
|
+
if (icon) {
|
|
19
|
+
const at = Object.assign(document.createElement("span"), { slot: "icon" });
|
|
20
|
+
at.append(icon);
|
|
21
|
+
item.append(at);
|
|
22
|
+
}
|
|
23
|
+
item.append(words);
|
|
24
|
+
stack.append(item);
|
|
50
25
|
}
|
|
51
|
-
|
|
52
|
-
document.body.append(host);
|
package/src/together.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
import type { Story } from "./compile.ts";
|
|
13
13
|
import { Refused } from "./engine.ts";
|
|
14
|
-
import { docParts, madeBy, NTH, parts, type Op } from "./ops.ts";
|
|
14
|
+
import { docParts, linksNamed, madeBy, NTH, parts, type Linked, type Op } from "./ops.ts";
|
|
15
15
|
|
|
16
16
|
/** One document's part of a write: its ops, and why, as a write of one document is. */
|
|
17
17
|
export type Part = { doc: string; ops: Op[]; why?: string };
|
|
@@ -31,20 +31,17 @@ export { madeBy };
|
|
|
31
31
|
const addsOf = (ops: Op[]) =>
|
|
32
32
|
ops.filter((o) => o.op === "add" && parts(o.path).key === "-" && parts(o.path).field === undefined);
|
|
33
33
|
|
|
34
|
-
/** A part as its write names it, after the adds before it (`adds`): "$n" naming one of those, its id
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* before it makes. */
|
|
38
|
-
export function named(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
? Object.fromEntries(Object.entries(v).map(([k, x]) => [k, value(x)]))
|
|
46
|
-
: v;
|
|
47
|
-
};
|
|
34
|
+
/** A part as its write names it, after the adds before it (`adds`): "$n" naming one of those, its id where a link is
|
|
35
|
+
* (`collectionsOf` a document's collections, by its name: src/ops.ts, linksNamed), and as its document the instance it
|
|
36
|
+
* made, where it's an add to its kind's root (`rootOf` a kind's root, by its name); naming one of the part's own,
|
|
37
|
+
* numbered from its first, as a write of one document numbers them. Refused: a document no add before it makes. */
|
|
38
|
+
export function named(
|
|
39
|
+
w: Part,
|
|
40
|
+
adds: Added[],
|
|
41
|
+
rootOf: (name: string) => string | undefined,
|
|
42
|
+
collectionsOf: (name: string) => Linked | undefined,
|
|
43
|
+
): Part {
|
|
44
|
+
const nth = (n: number) => (n <= adds.length ? adds[n - 1]!.id : `$${n - adds.length}`);
|
|
48
45
|
const { name, key = "" } = docParts(w.doc),
|
|
49
46
|
n = NTH.exec(key)?.[1];
|
|
50
47
|
const made = n === undefined ? undefined : adds[Number(n) - 1];
|
|
@@ -54,17 +51,10 @@ export function named(w: Part, adds: Added[], rootOf: (name: string) => string |
|
|
|
54
51
|
return {
|
|
55
52
|
...w,
|
|
56
53
|
doc: made ? w.doc.replace(`:${key}`, `:${made.id}`) : w.doc,
|
|
57
|
-
ops: w.ops.map((o) => (
|
|
54
|
+
ops: w.ops.map((o) => linksNamed(o, collectionsOf(name), nth)),
|
|
58
55
|
};
|
|
59
56
|
}
|
|
60
57
|
|
|
61
|
-
/** A write's parts, each named as the write names it (named) and landed in turn (`land`: its ops as they were made). */
|
|
62
|
-
export function inTurn(writes: Part[], rootOf: (name: string) => string | undefined, land: (part: Part) => Op[]) {
|
|
63
|
-
const adds: Added[] = [];
|
|
64
|
-
for (const w of writes)
|
|
65
|
-
adds.push(...addsOf(land(named(w, adds, rootOf))).map((o) => ({ coll: parts(o.path).coll, id: o.value.id })));
|
|
66
|
-
}
|
|
67
|
-
|
|
68
58
|
/** Why a list of writes, a story's does or cannot (or a write of one), isn't one, or null: each a write, and a part's
|
|
69
59
|
* document named by an add (`board:$1`) only by one a part before it makes. */
|
|
70
60
|
export function unwritten(writes: unknown[]): string | null {
|
|
@@ -134,11 +124,12 @@ export function writtenBefore(
|
|
|
134
124
|
state: State,
|
|
135
125
|
write: (state: State, w: Part) => State,
|
|
136
126
|
rootOf: (name: string) => string | undefined,
|
|
127
|
+
collectionsOf: (name: string) => Linked | undefined,
|
|
137
128
|
) {
|
|
138
129
|
const adds: Added[] = [];
|
|
139
130
|
const nameOf = (w: Part) => {
|
|
140
131
|
try {
|
|
141
|
-
return named(w, adds, rootOf);
|
|
132
|
+
return named(w, adds, rootOf, collectionsOf);
|
|
142
133
|
} catch (e) {
|
|
143
134
|
throw new Error(`"${s.story}": ${(e as Error).message}`);
|
|
144
135
|
}
|
package/src/tokens.css
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
/* joined's tokens, made from src/tokens.json by scripts/design.ts (bun run design): never edited by
|
|
2
2
|
hand. Linked by every page, before app.css. A display's shadow reads them as they are, since custom
|
|
3
3
|
properties pass into a shadow; never import this file as text into one (a page that links it makes
|
|
4
|
-
it {} in its bundle). What each is for: src/tokens.json, and docs/design.md.
|
|
4
|
+
it {} in its bundle). What each is for: src/tokens.json, and docs/design.md. Web Awesome's theme
|
|
5
|
+
comes first, its tokens (--wa-) then set to joined's (src/awesome.ts). */
|
|
6
|
+
|
|
7
|
+
@import "@awesome.me/webawesome/dist/styles/themes/default.css";
|
|
8
|
+
@import "@awesome.me/webawesome/dist/styles/utilities/scroll-lock.css";
|
|
5
9
|
|
|
6
10
|
:root {
|
|
7
11
|
color-scheme: light dark;
|
|
8
12
|
--paper: #f8f9fa;
|
|
9
13
|
--card: #ffffff;
|
|
10
14
|
--card-hover: #f0f0f0;
|
|
15
|
+
--pin-ring: #ffffff;
|
|
11
16
|
--well: #e9ecef;
|
|
12
17
|
--ink: #1a1a1a;
|
|
13
18
|
--muted: #555555;
|
|
@@ -33,7 +38,9 @@
|
|
|
33
38
|
--hue-9: #bab0ac;
|
|
34
39
|
--tint: 16%;
|
|
35
40
|
--tint-strong: 28%;
|
|
41
|
+
--choose: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23555555%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20aria-hidden%3D%22true%22%3E%3Cpath%20d%3D%22m6%209%206%206%206-6%22%2F%3E%3C%2Fsvg%3E");
|
|
36
42
|
--sans: system-ui, -apple-system, sans-serif;
|
|
43
|
+
--mono: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
37
44
|
--font-body: 400 15px/1.45 var(--sans);
|
|
38
45
|
--font-display: 650 clamp(34px, 5vw, 52px)/1.05 var(--sans);
|
|
39
46
|
--font-lead: 400 18px/1.55 var(--sans);
|
|
@@ -41,9 +48,9 @@
|
|
|
41
48
|
--font-name: 650 20px/1.25 var(--sans);
|
|
42
49
|
--font-heading: 600 20px/1.25 var(--sans);
|
|
43
50
|
--font-title: 600 17px/1.3 var(--sans);
|
|
44
|
-
--font-row: 400
|
|
51
|
+
--font-row: 400 16px/1.45 var(--sans);
|
|
45
52
|
--font-label: 600 13px/16px var(--sans);
|
|
46
|
-
--font-tool: 400
|
|
53
|
+
--font-tool: 400 16px/1.45 var(--sans);
|
|
47
54
|
--font-small: 400 13px/1.45 var(--sans);
|
|
48
55
|
--font-tiny: 400 12px/1.45 var(--sans);
|
|
49
56
|
--font-field: 400 16px/1.45 var(--sans);
|
|
@@ -60,11 +67,89 @@
|
|
|
60
67
|
--space-48: 48px;
|
|
61
68
|
--space-64: 64px;
|
|
62
69
|
--gutter: clamp(1rem, 4vw, 1.5rem);
|
|
70
|
+
--radius: 4px;
|
|
71
|
+
--radius-sheet: 14px;
|
|
72
|
+
--radius-inner: 3px;
|
|
73
|
+
--radius-pill: 999px;
|
|
74
|
+
--radius-dot: 50%;
|
|
75
|
+
--size-finger: 44px;
|
|
76
|
+
--size-touch: 32px;
|
|
77
|
+
--size-control: 32px;
|
|
78
|
+
--size-panel: 360px;
|
|
79
|
+
--size-modal: 25rem;
|
|
80
|
+
--size-sheet: 22rem;
|
|
81
|
+
--size-phone: 40rem;
|
|
82
|
+
--size-list: 40rem;
|
|
83
|
+
--size-said: 36rem;
|
|
84
|
+
--size-ring: 2px;
|
|
85
|
+
--size-pin: 16px;
|
|
86
|
+
--size-dot: 7px;
|
|
87
|
+
--size-grip: 7px;
|
|
88
|
+
--size-stripe: 3px;
|
|
63
89
|
--rise: 420ms cubic-bezier(0.32, 0.72, 0, 1);
|
|
64
90
|
--fall: 280ms cubic-bezier(0.4, 0, 1, 1);
|
|
65
91
|
--ask: 220ms cubic-bezier(0.32, 0.72, 0, 1);
|
|
66
92
|
--ask-out: 160ms ease-out;
|
|
67
93
|
--drop: 160ms ease-out;
|
|
94
|
+
--wa-font-family-body: var(--sans);
|
|
95
|
+
--wa-font-family-heading: var(--sans);
|
|
96
|
+
--wa-font-weight-action: 600;
|
|
97
|
+
--wa-color-surface-default: var(--card);
|
|
98
|
+
--wa-color-surface-raised: var(--card);
|
|
99
|
+
--wa-color-surface-lowered: var(--well);
|
|
100
|
+
--wa-color-surface-border: var(--edge);
|
|
101
|
+
--wa-color-text-normal: var(--ink);
|
|
102
|
+
--wa-color-text-quiet: var(--muted);
|
|
103
|
+
--wa-color-text-link: var(--ink);
|
|
104
|
+
--wa-color-overlay-modal: var(--scrim);
|
|
105
|
+
--wa-color-focus: var(--ink);
|
|
106
|
+
--wa-color-brand-fill-quiet: var(--card-hover);
|
|
107
|
+
--wa-color-brand-fill-normal: var(--well);
|
|
108
|
+
--wa-color-brand-fill-loud: var(--add);
|
|
109
|
+
--wa-color-brand-border-quiet: var(--line);
|
|
110
|
+
--wa-color-brand-border-normal: var(--edge);
|
|
111
|
+
--wa-color-brand-border-loud: var(--ink);
|
|
112
|
+
--wa-color-brand-on-quiet: var(--ink);
|
|
113
|
+
--wa-color-brand-on-normal: var(--ink);
|
|
114
|
+
--wa-color-brand-on-loud: var(--add-ink);
|
|
115
|
+
--wa-color-neutral-fill-quiet: var(--card-hover);
|
|
116
|
+
--wa-color-neutral-fill-normal: var(--well);
|
|
117
|
+
--wa-color-neutral-fill-loud: var(--ink);
|
|
118
|
+
--wa-color-neutral-border-quiet: var(--line);
|
|
119
|
+
--wa-color-neutral-border-normal: var(--edge);
|
|
120
|
+
--wa-color-neutral-border-loud: var(--control-edge);
|
|
121
|
+
--wa-color-neutral-on-quiet: var(--ink);
|
|
122
|
+
--wa-color-neutral-on-normal: var(--ink);
|
|
123
|
+
--wa-color-neutral-on-loud: var(--card);
|
|
124
|
+
--wa-color-danger-fill-quiet: color-mix(in srgb, var(--danger) 10%, var(--card));
|
|
125
|
+
--wa-color-danger-fill-normal: color-mix(in srgb, var(--danger) 20%, var(--card));
|
|
126
|
+
--wa-color-danger-fill-loud: var(--danger);
|
|
127
|
+
--wa-color-danger-border-quiet: color-mix(in srgb, var(--danger) 30%, var(--card));
|
|
128
|
+
--wa-color-danger-border-normal: var(--danger);
|
|
129
|
+
--wa-color-danger-border-loud: var(--danger);
|
|
130
|
+
--wa-color-danger-on-quiet: var(--danger);
|
|
131
|
+
--wa-color-danger-on-normal: var(--danger);
|
|
132
|
+
--wa-color-danger-on-loud: var(--danger-ink);
|
|
133
|
+
--wa-border-radius-s: var(--radius-inner);
|
|
134
|
+
--wa-border-radius-m: var(--radius);
|
|
135
|
+
--wa-border-radius-l: var(--radius-sheet);
|
|
136
|
+
--wa-panel-border-radius: var(--radius);
|
|
137
|
+
--wa-form-control-background-color: var(--card);
|
|
138
|
+
--wa-form-control-border-color: var(--control-edge);
|
|
139
|
+
--wa-form-control-border-radius: var(--radius);
|
|
140
|
+
--wa-form-control-activated-color: var(--ink);
|
|
141
|
+
--wa-form-control-label-color: var(--ink);
|
|
142
|
+
--wa-form-control-label-font-weight: 600;
|
|
143
|
+
--wa-form-control-value-color: var(--ink);
|
|
144
|
+
--wa-form-control-hint-color: var(--muted);
|
|
145
|
+
--wa-form-control-placeholder-color: var(--muted);
|
|
146
|
+
--wa-form-control-required-content: '';
|
|
147
|
+
--wa-tooltip-background-color: var(--ink);
|
|
148
|
+
--wa-tooltip-content-color: var(--card);
|
|
149
|
+
--wa-tooltip-border-radius: var(--radius);
|
|
150
|
+
--wa-shadow-s: none;
|
|
151
|
+
--wa-shadow-m: none;
|
|
152
|
+
--wa-shadow-l: none;
|
|
68
153
|
}
|
|
69
154
|
@media (prefers-color-scheme: dark) {
|
|
70
155
|
:root {
|
|
@@ -86,5 +171,6 @@
|
|
|
86
171
|
--scrim: rgba(0, 0, 0, 0.55);
|
|
87
172
|
--tint: 28%;
|
|
88
173
|
--tint-strong: 40%;
|
|
174
|
+
--choose: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23a8a8a8%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20aria-hidden%3D%22true%22%3E%3Cpath%20d%3D%22m6%209%206%206%206-6%22%2F%3E%3C%2Fsvg%3E");
|
|
89
175
|
}
|
|
90
176
|
}
|
package/src/tokens.json
CHANGED
|
@@ -37,6 +37,11 @@
|
|
|
37
37
|
},
|
|
38
38
|
"usage": "A card under the pointer: a place found, a person's link."
|
|
39
39
|
},
|
|
40
|
+
{
|
|
41
|
+
"name": "pin-ring",
|
|
42
|
+
"value": "#ffffff",
|
|
43
|
+
"usage": "A pin's ring, white in light and dark: the pin stands off the map's tiles, which are light in both."
|
|
44
|
+
},
|
|
40
45
|
{
|
|
41
46
|
"name": "well",
|
|
42
47
|
"value": {
|
|
@@ -196,7 +201,8 @@
|
|
|
196
201
|
"type": {
|
|
197
202
|
"fonts": [],
|
|
198
203
|
"families": {
|
|
199
|
-
"sans": "system-ui, -apple-system, sans-serif"
|
|
204
|
+
"sans": "system-ui, -apple-system, sans-serif",
|
|
205
|
+
"mono": "ui-monospace, SFMono-Regular, Menlo, monospace"
|
|
200
206
|
},
|
|
201
207
|
"groups": [
|
|
202
208
|
{
|
|
@@ -254,10 +260,10 @@
|
|
|
254
260
|
},
|
|
255
261
|
{
|
|
256
262
|
"name": "row",
|
|
257
|
-
"fontSize": "
|
|
263
|
+
"fontSize": "16px",
|
|
258
264
|
"lineHeight": 1.45,
|
|
259
265
|
"fontWeight": 400,
|
|
260
|
-
"usage": "A row's words: a greeting, a member; the words inside a drawer, a modal and a sheet."
|
|
266
|
+
"usage": "A row's words: a greeting, a member; the words inside a drawer, a modal and a sheet. A row is a control: its words are a field's size (Apple's HIG: a control's words are the size of the fields beside it)."
|
|
261
267
|
},
|
|
262
268
|
{
|
|
263
269
|
"name": "label",
|
|
@@ -268,10 +274,10 @@
|
|
|
268
274
|
},
|
|
269
275
|
{
|
|
270
276
|
"name": "tool",
|
|
271
|
-
"fontSize": "
|
|
277
|
+
"fontSize": "16px",
|
|
272
278
|
"lineHeight": 1.45,
|
|
273
279
|
"fontWeight": 400,
|
|
274
|
-
"usage": "A button's
|
|
280
|
+
"usage": "A control's words: a button's, a chip's, a tab's, a link drawn as a button: the size of a field's, never smaller or lighter than the boxes beside it (Apple's HIG). The button that makes or keeps (.act.ink) in 600."
|
|
275
281
|
},
|
|
276
282
|
{
|
|
277
283
|
"name": "small",
|
|
@@ -400,6 +406,11 @@
|
|
|
400
406
|
"size": {
|
|
401
407
|
"note": "One breakpoint, 40rem (640px): above it the drawer docks at the right and the week stands beside the map; below it the drawer and a sheet rise from the foot and the week is a strip of its days. Under a finger (pointer: coarse) or below 40rem, a button and a field are 44px.",
|
|
402
408
|
"tokens": [
|
|
409
|
+
{
|
|
410
|
+
"name": "finger",
|
|
411
|
+
"value": "44px",
|
|
412
|
+
"usage": "The least a finger needs: a row, a tick, and a button or a field under a finger (pointer: coarse) or below 40rem."
|
|
413
|
+
},
|
|
403
414
|
{
|
|
404
415
|
"name": "touch",
|
|
405
416
|
"value": "32px",
|
|
@@ -412,8 +423,8 @@
|
|
|
412
423
|
},
|
|
413
424
|
{
|
|
414
425
|
"name": "panel",
|
|
415
|
-
"value": "
|
|
416
|
-
"usage": "The drawer docked at the right."
|
|
426
|
+
"value": "360px",
|
|
427
|
+
"usage": "The drawer docked at the right: wide enough for its foot's three deeds (Remove, Never mind, Save) on one line, their words a field's size."
|
|
417
428
|
},
|
|
418
429
|
{
|
|
419
430
|
"name": "modal",
|
|
@@ -425,6 +436,26 @@
|
|
|
425
436
|
"value": "22rem",
|
|
426
437
|
"usage": "A sheet's width at most, within the screen less 1rem a side."
|
|
427
438
|
},
|
|
439
|
+
{
|
|
440
|
+
"name": "phone",
|
|
441
|
+
"value": "40rem",
|
|
442
|
+
"usage": "The one breakpoint: below it a phone (a drawer and a sheet rise from the foot, the week is a strip of its days). A stylesheet's @media says it as its value, since CSS reads no custom property there, and a page's matchMedia is joined/parts' phone; tests/sizes.test.ts holds every one to this."
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"name": "list",
|
|
446
|
+
"value": "40rem",
|
|
447
|
+
"usage": "A list's width at most (a collection's rows, and the search at its head), in the middle of a wide page."
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
"name": "said",
|
|
451
|
+
"value": "36rem",
|
|
452
|
+
"usage": "A toast's and the group's notice's width at most, as wide as their words, within the screen less 1rem a side."
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"name": "ring",
|
|
456
|
+
"value": "2px",
|
|
457
|
+
"usage": "Focus from the keyboard, an accent ring this wide, this far out."
|
|
458
|
+
},
|
|
428
459
|
{
|
|
429
460
|
"name": "pin",
|
|
430
461
|
"value": "16px",
|
|
@@ -439,6 +470,11 @@
|
|
|
439
470
|
"name": "grip",
|
|
440
471
|
"value": "7px",
|
|
441
472
|
"usage": "The foot of an event's block: dragged, it lasts longer or shorter, in 15-minute steps."
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
"name": "stripe",
|
|
476
|
+
"value": "3px",
|
|
477
|
+
"usage": "What's open, marked: a stripe of the accent at its row's start; a chip's or a block's stripe of its hue."
|
|
442
478
|
}
|
|
443
479
|
]
|
|
444
480
|
},
|
|
@@ -488,5 +524,249 @@
|
|
|
488
524
|
"usage": "A menu dropping a few pixels from its button as it fades in."
|
|
489
525
|
}
|
|
490
526
|
]
|
|
527
|
+
},
|
|
528
|
+
"wa": {
|
|
529
|
+
"note": "Web Awesome's tokens (--wa-), each set to joined's own, so its components (src/awesome.ts) draw in joined's colours, type and corners, light and dark as joined's tokens are. Its theme (themes/default.css) gives the rest: its scale of sizes and spaces.",
|
|
530
|
+
"tokens": [
|
|
531
|
+
{
|
|
532
|
+
"name": "font-family-body",
|
|
533
|
+
"value": "var(--sans)"
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
"name": "font-family-heading",
|
|
537
|
+
"value": "var(--sans)"
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
"name": "font-weight-action",
|
|
541
|
+
"value": "600"
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
"name": "color-surface-default",
|
|
545
|
+
"value": "var(--card)"
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
"name": "color-surface-raised",
|
|
549
|
+
"value": "var(--card)"
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
"name": "color-surface-lowered",
|
|
553
|
+
"value": "var(--well)"
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
"name": "color-surface-border",
|
|
557
|
+
"value": "var(--edge)"
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
"name": "color-text-normal",
|
|
561
|
+
"value": "var(--ink)"
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
"name": "color-text-quiet",
|
|
565
|
+
"value": "var(--muted)"
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
"name": "color-text-link",
|
|
569
|
+
"value": "var(--ink)"
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
"name": "color-overlay-modal",
|
|
573
|
+
"value": "var(--scrim)"
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
"name": "color-focus",
|
|
577
|
+
"value": "var(--ink)"
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
"name": "color-brand-fill-quiet",
|
|
581
|
+
"value": "var(--card-hover)"
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
"name": "color-brand-fill-normal",
|
|
585
|
+
"value": "var(--well)"
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
"name": "color-brand-fill-loud",
|
|
589
|
+
"value": "var(--add)"
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
"name": "color-brand-border-quiet",
|
|
593
|
+
"value": "var(--line)"
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
"name": "color-brand-border-normal",
|
|
597
|
+
"value": "var(--edge)"
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
"name": "color-brand-border-loud",
|
|
601
|
+
"value": "var(--ink)"
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
"name": "color-brand-on-quiet",
|
|
605
|
+
"value": "var(--ink)"
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
"name": "color-brand-on-normal",
|
|
609
|
+
"value": "var(--ink)"
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
"name": "color-brand-on-loud",
|
|
613
|
+
"value": "var(--add-ink)"
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
"name": "color-neutral-fill-quiet",
|
|
617
|
+
"value": "var(--card-hover)"
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
"name": "color-neutral-fill-normal",
|
|
621
|
+
"value": "var(--well)"
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
"name": "color-neutral-fill-loud",
|
|
625
|
+
"value": "var(--ink)"
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
"name": "color-neutral-border-quiet",
|
|
629
|
+
"value": "var(--line)"
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
"name": "color-neutral-border-normal",
|
|
633
|
+
"value": "var(--edge)"
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
"name": "color-neutral-border-loud",
|
|
637
|
+
"value": "var(--control-edge)"
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
"name": "color-neutral-on-quiet",
|
|
641
|
+
"value": "var(--ink)"
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
"name": "color-neutral-on-normal",
|
|
645
|
+
"value": "var(--ink)"
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
"name": "color-neutral-on-loud",
|
|
649
|
+
"value": "var(--card)"
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
"name": "color-danger-fill-quiet",
|
|
653
|
+
"value": "color-mix(in srgb, var(--danger) 10%, var(--card))"
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
"name": "color-danger-fill-normal",
|
|
657
|
+
"value": "color-mix(in srgb, var(--danger) 20%, var(--card))"
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
"name": "color-danger-fill-loud",
|
|
661
|
+
"value": "var(--danger)"
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
"name": "color-danger-border-quiet",
|
|
665
|
+
"value": "color-mix(in srgb, var(--danger) 30%, var(--card))"
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
"name": "color-danger-border-normal",
|
|
669
|
+
"value": "var(--danger)"
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
"name": "color-danger-border-loud",
|
|
673
|
+
"value": "var(--danger)"
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
"name": "color-danger-on-quiet",
|
|
677
|
+
"value": "var(--danger)"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
"name": "color-danger-on-normal",
|
|
681
|
+
"value": "var(--danger)"
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
"name": "color-danger-on-loud",
|
|
685
|
+
"value": "var(--danger-ink)"
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
"name": "border-radius-s",
|
|
689
|
+
"value": "var(--radius-inner)"
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
"name": "border-radius-m",
|
|
693
|
+
"value": "var(--radius)"
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
"name": "border-radius-l",
|
|
697
|
+
"value": "var(--radius-sheet)"
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
"name": "panel-border-radius",
|
|
701
|
+
"value": "var(--radius)"
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
"name": "form-control-background-color",
|
|
705
|
+
"value": "var(--card)"
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
"name": "form-control-border-color",
|
|
709
|
+
"value": "var(--control-edge)"
|
|
710
|
+
},
|
|
711
|
+
{
|
|
712
|
+
"name": "form-control-border-radius",
|
|
713
|
+
"value": "var(--radius)"
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
"name": "form-control-activated-color",
|
|
717
|
+
"value": "var(--ink)"
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
"name": "form-control-label-color",
|
|
721
|
+
"value": "var(--ink)"
|
|
722
|
+
},
|
|
723
|
+
{
|
|
724
|
+
"name": "form-control-label-font-weight",
|
|
725
|
+
"value": "600"
|
|
726
|
+
},
|
|
727
|
+
{
|
|
728
|
+
"name": "form-control-value-color",
|
|
729
|
+
"value": "var(--ink)"
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
"name": "form-control-hint-color",
|
|
733
|
+
"value": "var(--muted)"
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
"name": "form-control-placeholder-color",
|
|
737
|
+
"value": "var(--muted)"
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
"name": "form-control-required-content",
|
|
741
|
+
"value": "''"
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
"name": "tooltip-background-color",
|
|
745
|
+
"value": "var(--ink)"
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
"name": "tooltip-content-color",
|
|
749
|
+
"value": "var(--card)"
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
"name": "tooltip-border-radius",
|
|
753
|
+
"value": "var(--radius)"
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
"name": "shadow-s",
|
|
757
|
+
"value": "none",
|
|
758
|
+
"usage": "No shadows (design.md, Layout): a modal, a phone's sheet, a peek and the toast are set apart by their edge and the scrim."
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
"name": "shadow-m",
|
|
762
|
+
"value": "none",
|
|
763
|
+
"usage": "No shadows (design.md, Layout): a modal, a phone's sheet, a peek and the toast are set apart by their edge and the scrim."
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
"name": "shadow-l",
|
|
767
|
+
"value": "none",
|
|
768
|
+
"usage": "No shadows (design.md, Layout): a modal, a phone's sheet, a peek and the toast are set apart by their edge and the scrim."
|
|
769
|
+
}
|
|
770
|
+
]
|
|
491
771
|
}
|
|
492
772
|
}
|