@lanfermann/ui 0.5.0 → 0.6.0
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/dist/components/action-bar/action-bar.d.ts +59 -0
- package/dist/components/action-bar/action-bar.js +116 -0
- package/dist/components/alert/alert.d.ts +1 -1
- package/dist/components/alert/alert.js +3 -17
- package/dist/components/alert-dialog/alert-dialog.d.ts +1 -1
- package/dist/components/app-shell/app-shell.d.ts +33 -0
- package/dist/components/app-shell/app-shell.js +93 -0
- package/dist/components/attachment/attachment.d.ts +46 -0
- package/dist/components/attachment/attachment.js +222 -0
- package/dist/components/attachment/kinds.d.ts +7 -0
- package/dist/components/attachment/kinds.js +100 -0
- package/dist/components/avatar/avatar.d.ts +14 -4
- package/dist/components/avatar/avatar.js +57 -13
- package/dist/components/avatar-group/avatar-group.d.ts +33 -0
- package/dist/components/avatar-group/avatar-group.js +110 -0
- package/dist/components/avatar-group/people.d.ts +12 -0
- package/dist/components/avatar-group/people.js +24 -0
- package/dist/components/badge/badge.d.ts +9 -3
- package/dist/components/badge/badge.js +21 -6
- package/dist/components/banner/banner.d.ts +39 -0
- package/dist/components/banner/banner.js +149 -0
- package/dist/components/card/card.d.ts +11 -3
- package/dist/components/card/card.js +18 -4
- package/dist/components/checkbox-card/checkbox-card.d.ts +21 -0
- package/dist/components/checkbox-card/checkbox-card.js +49 -0
- package/dist/components/chip/chip-group.d.ts +15 -0
- package/dist/components/chip/chip-group.js +44 -0
- package/dist/components/chip/chip-variants.d.ts +6 -0
- package/dist/components/chip/chip-variants.js +28 -0
- package/dist/components/chip/chip.d.ts +39 -0
- package/dist/components/chip/chip.js +71 -0
- package/dist/components/code-block/code-copy.d.ts +3 -11
- package/dist/components/code-block/code-copy.js +15 -62
- package/dist/components/code-block/code-keys.js +10 -22
- package/dist/components/combobox/combobox.d.ts +50 -2
- package/dist/components/combobox/combobox.js +178 -9
- package/dist/components/command/command.d.ts +131 -0
- package/dist/components/command/command.js +335 -0
- package/dist/components/consent/consent-card.js +365 -0
- package/dist/components/consent/consent-embed.d.ts +21 -0
- package/dist/components/consent/consent-embed.js +111 -0
- package/dist/components/consent/consent-labels.d.ts +70 -0
- package/dist/components/consent/consent-labels.js +61 -0
- package/dist/components/consent/consent-record.d.ts +95 -0
- package/dist/components/consent/consent-record.js +112 -0
- package/dist/components/consent/consent-store.d.ts +26 -0
- package/dist/components/consent/consent-store.js +240 -0
- package/dist/components/consent/consent.d.ts +86 -0
- package/dist/components/consent/consent.js +306 -0
- package/dist/components/container/container.d.ts +1 -1
- package/dist/components/context-menu/context-menu.d.ts +23 -0
- package/dist/components/context-menu/context-menu.js +50 -0
- package/dist/components/conversation/conversation.d.ts +45 -0
- package/dist/components/conversation/conversation.js +295 -0
- package/dist/components/conversation/stick.js +23 -0
- package/dist/components/copy-button/copy-button.d.ts +50 -0
- package/dist/components/copy-button/copy-button.js +65 -0
- package/dist/components/copy-page/copy-page.js +7 -17
- package/dist/components/copy-pill/copy-pill.js +1 -1
- package/dist/components/description-list/description-list.d.ts +32 -0
- package/dist/components/description-list/description-list.js +51 -0
- package/dist/components/empty/empty.d.ts +38 -0
- package/dist/components/empty/empty.js +57 -0
- package/dist/components/field/field.js +1 -1
- package/dist/components/file-upload/file-upload.d.ts +96 -0
- package/dist/components/file-upload/file-upload.js +347 -0
- package/dist/components/file-upload/files.d.ts +39 -0
- package/dist/components/file-upload/files.js +74 -0
- package/dist/components/grow/grow.d.ts +15 -3
- package/dist/components/grow/grow.js +24 -9
- package/dist/components/heading/heading.d.ts +1 -1
- package/dist/components/icon/icon.d.ts +1 -1
- package/dist/components/input/input.js +1 -1
- package/dist/components/message/message.d.ts +73 -0
- package/dist/components/message/message.js +196 -0
- package/dist/components/otp-field/otp-field.d.ts +37 -0
- package/dist/components/otp-field/otp-field.js +126 -0
- package/dist/components/pagination/pagination.d.ts +50 -0
- package/dist/components/pagination/pagination.js +188 -0
- package/dist/components/prompt-input/keys.js +15 -0
- package/dist/components/prompt-input/prompt-input.d.ts +89 -0
- package/dist/components/prompt-input/prompt-input.js +331 -0
- package/dist/components/radio-card/radio-card.d.ts +23 -0
- package/dist/components/radio-card/radio-card.js +48 -0
- package/dist/components/rolling-number/rolling-number.d.ts +30 -0
- package/dist/components/rolling-number/rolling-number.js +149 -0
- package/dist/components/seam/seam.d.ts +1 -1
- package/dist/components/secret-field/secret-field.d.ts +53 -0
- package/dist/components/secret-field/secret-field.js +121 -0
- package/dist/components/section/section.d.ts +1 -1
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/select/select.js +1 -1
- package/dist/components/shortcut/shortcut.d.ts +46 -0
- package/dist/components/shortcut/shortcut.js +87 -0
- package/dist/components/sidebar/sidebar-context.js +16 -0
- package/dist/components/sidebar/sidebar.d.ts +161 -0
- package/dist/components/sidebar/sidebar.js +588 -0
- package/dist/components/site-header/site-header.js +1 -1
- package/dist/components/skeleton/loaded.d.ts +21 -0
- package/dist/components/skeleton/loaded.js +57 -0
- package/dist/components/skeleton/skeleton.d.ts +43 -0
- package/dist/components/skeleton/skeleton.js +48 -0
- package/dist/components/sources/source-list.d.ts +17 -0
- package/dist/components/sources/source-list.js +26 -0
- package/dist/components/sources/sources.d.ts +45 -0
- package/dist/components/sources/sources.js +167 -0
- package/dist/components/stat/stat.d.ts +57 -0
- package/dist/components/stat/stat.js +110 -0
- package/dist/components/steps/steps.d.ts +57 -0
- package/dist/components/steps/steps.js +131 -0
- package/dist/components/table/table.d.ts +18 -9
- package/dist/components/table/table.js +21 -13
- package/dist/components/text/text.d.ts +1 -1
- package/dist/components/theme-switch/theme-switch.js +1 -1
- package/dist/components/time-field/time-field.js +1 -1
- package/dist/components/timeline/timeline.d.ts +45 -0
- package/dist/components/timeline/timeline.js +86 -0
- package/dist/components/toast/toast.js +10 -26
- package/dist/components/toggle/toggle.d.ts +24 -0
- package/dist/components/toggle/toggle.js +53 -0
- package/dist/components/toggle-group/toggle-group.d.ts +27 -0
- package/dist/components/toggle-group/toggle-group.js +38 -0
- package/dist/components/toolbar/toolbar-context.js +12 -0
- package/dist/components/toolbar/toolbar.d.ts +45 -0
- package/dist/components/toolbar/toolbar.js +92 -0
- package/dist/components/trace/trace.d.ts +2 -1
- package/dist/components/trace/trace.js +14 -26
- package/dist/index.d.ts +46 -3
- package/dist/index.js +44 -3
- package/dist/internal/arriving-pieces.js +56 -0
- package/dist/internal/arriving.js +171 -0
- package/dist/internal/avatar-cut.d.ts +15 -0
- package/dist/internal/avatar-cut.js +83 -0
- package/dist/internal/choice-card.d.ts +15 -0
- package/dist/internal/choice-card.js +65 -0
- package/dist/internal/clipboard.js +37 -0
- package/dist/internal/copy.js +58 -0
- package/dist/internal/field.js +24 -4
- package/dist/internal/glyphs.js +26 -1
- package/dist/internal/live-list.js +41 -0
- package/dist/internal/number-places.js +156 -0
- package/dist/internal/picker-sheet.js +1 -1
- package/dist/internal/presence-dot.js +24 -0
- package/dist/internal/presence.js +104 -0
- package/dist/internal/rail-mark.d.ts +3 -0
- package/dist/internal/rail-mark.js +33 -0
- package/dist/internal/status-icon.js +22 -0
- package/dist/internal/travelling-mark.js +204 -0
- package/dist/lib/cn.js +4 -0
- package/dist/lib/shortcut.d.ts +11 -0
- package/dist/lib/shortcut.js +165 -0
- package/package.json +1 -1
- package/src/styles/action-bar.css +28 -0
- package/src/styles/assistant.css +83 -0
- package/src/styles/avatar.css +24 -0
- package/src/styles/consent.css +65 -0
- package/src/styles/copy.css +12 -11
- package/src/styles/depth.css +46 -2
- package/src/styles/marks.css +20 -2
- package/src/styles/rail.css +49 -0
- package/src/styles/rolling-number.css +94 -0
- package/src/styles/steps.css +98 -0
- package/src/styles/timeline.css +48 -0
- package/src/styles/travel.css +36 -0
- package/src/styles.css +9 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
// src/lib/shortcut.ts
|
|
2
|
+
const modifiers = /* @__PURE__ */ new Set([
|
|
3
|
+
"mod",
|
|
4
|
+
"ctrl",
|
|
5
|
+
"alt",
|
|
6
|
+
"shift"
|
|
7
|
+
]);
|
|
8
|
+
/** What stands on the cap, and its name, where the two kinds of keyboard agree. */
|
|
9
|
+
const shared = {
|
|
10
|
+
shift: {
|
|
11
|
+
label: "⇧",
|
|
12
|
+
name: "Umschalttaste"
|
|
13
|
+
},
|
|
14
|
+
enter: {
|
|
15
|
+
label: "↵",
|
|
16
|
+
name: "Eingabetaste"
|
|
17
|
+
},
|
|
18
|
+
esc: {
|
|
19
|
+
label: "Esc",
|
|
20
|
+
name: "Escape"
|
|
21
|
+
},
|
|
22
|
+
tab: {
|
|
23
|
+
label: "⇥",
|
|
24
|
+
name: "Tabulatortaste"
|
|
25
|
+
},
|
|
26
|
+
space: {
|
|
27
|
+
label: "Leertaste",
|
|
28
|
+
name: "Leertaste"
|
|
29
|
+
},
|
|
30
|
+
backspace: {
|
|
31
|
+
label: "⌫",
|
|
32
|
+
name: "Rücktaste"
|
|
33
|
+
},
|
|
34
|
+
up: {
|
|
35
|
+
label: "↑",
|
|
36
|
+
name: "Pfeil nach oben"
|
|
37
|
+
},
|
|
38
|
+
down: {
|
|
39
|
+
label: "↓",
|
|
40
|
+
name: "Pfeil nach unten"
|
|
41
|
+
},
|
|
42
|
+
left: {
|
|
43
|
+
label: "←",
|
|
44
|
+
name: "Pfeil nach links"
|
|
45
|
+
},
|
|
46
|
+
right: {
|
|
47
|
+
label: "→",
|
|
48
|
+
name: "Pfeil nach rechts"
|
|
49
|
+
},
|
|
50
|
+
plus: {
|
|
51
|
+
label: "+",
|
|
52
|
+
name: "Plus"
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
/** Where they differ: an Apple keyboard prints symbols, the others print German words. */
|
|
56
|
+
const perPlatform = {
|
|
57
|
+
apple: {
|
|
58
|
+
mod: {
|
|
59
|
+
label: "⌘",
|
|
60
|
+
name: "Befehlstaste"
|
|
61
|
+
},
|
|
62
|
+
ctrl: {
|
|
63
|
+
label: "⌃",
|
|
64
|
+
name: "Control"
|
|
65
|
+
},
|
|
66
|
+
alt: {
|
|
67
|
+
label: "⌥",
|
|
68
|
+
name: "Wahltaste"
|
|
69
|
+
},
|
|
70
|
+
delete: {
|
|
71
|
+
label: "⌦",
|
|
72
|
+
name: "Entfernen"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
other: {
|
|
76
|
+
mod: {
|
|
77
|
+
label: "Strg",
|
|
78
|
+
name: "Steuerung"
|
|
79
|
+
},
|
|
80
|
+
ctrl: {
|
|
81
|
+
label: "Strg",
|
|
82
|
+
name: "Steuerung"
|
|
83
|
+
},
|
|
84
|
+
alt: {
|
|
85
|
+
label: "Alt",
|
|
86
|
+
name: "Alt"
|
|
87
|
+
},
|
|
88
|
+
delete: {
|
|
89
|
+
label: "Entf",
|
|
90
|
+
name: "Entfernen"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
/** The value of `KeyboardEvent.key` for each named key. */
|
|
95
|
+
const eventKeys = {
|
|
96
|
+
enter: "Enter",
|
|
97
|
+
esc: "Escape",
|
|
98
|
+
tab: "Tab",
|
|
99
|
+
space: " ",
|
|
100
|
+
backspace: "Backspace",
|
|
101
|
+
delete: "Delete",
|
|
102
|
+
up: "ArrowUp",
|
|
103
|
+
down: "ArrowDown",
|
|
104
|
+
left: "ArrowLeft",
|
|
105
|
+
right: "ArrowRight",
|
|
106
|
+
plus: "+"
|
|
107
|
+
};
|
|
108
|
+
function tokens(keys) {
|
|
109
|
+
return keys.split("+").map((token) => token.trim().toLowerCase()).filter(Boolean);
|
|
110
|
+
}
|
|
111
|
+
/** The keys of a shortcut in the order they are written, as they stand on that keyboard. */
|
|
112
|
+
function shortcutKeys(keys, platform) {
|
|
113
|
+
return tokens(keys).map((token) => {
|
|
114
|
+
const named = perPlatform[platform][token] ?? shared[token];
|
|
115
|
+
if (named) return named;
|
|
116
|
+
const label = token.length === 1 ? token.toUpperCase() : token;
|
|
117
|
+
return {
|
|
118
|
+
label,
|
|
119
|
+
name: label
|
|
120
|
+
};
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
/** Whether a shortcut holds a key that turns a letter into a command: `mod`, `ctrl` or `alt`. */
|
|
124
|
+
function hasCommandKey(keys) {
|
|
125
|
+
return tokens(keys).some((token) => token === "mod" || token === "ctrl" || token === "alt");
|
|
126
|
+
}
|
|
127
|
+
/** Whether a shortcut is drawn differently on the two kinds of keyboard. */
|
|
128
|
+
function dependsOnPlatform(keys) {
|
|
129
|
+
return tokens(keys).some((token) => token in perPlatform.apple);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Whether a key press is the shortcut, on that kind of keyboard.
|
|
133
|
+
*
|
|
134
|
+
* A letter is compared by what the key types, not by where it sits, so the shortcut follows the
|
|
135
|
+
* layout: `mod+z` is the key marked Z on a German keyboard too. Two exceptions. With `alt` held
|
|
136
|
+
* a key types another character (⌥K gives ˚), so there the place of the key decides. And a sign
|
|
137
|
+
* such as `?` needs Shift on some layouts and not on others, so for a sign Shift is not compared.
|
|
138
|
+
*/
|
|
139
|
+
function matchesShortcut(press, keys, platform) {
|
|
140
|
+
const parts = tokens(keys);
|
|
141
|
+
const key = parts.find((part) => !modifiers.has(part));
|
|
142
|
+
if (!key) return false;
|
|
143
|
+
const wants = (modifier) => parts.includes(modifier);
|
|
144
|
+
const meta = platform === "apple" && wants("mod");
|
|
145
|
+
const ctrl = wants("ctrl") || platform === "other" && wants("mod");
|
|
146
|
+
if (press.metaKey !== meta || press.ctrlKey !== ctrl || press.altKey !== wants("alt")) return false;
|
|
147
|
+
const named = eventKeys[key];
|
|
148
|
+
const letter = /^[a-z0-9]$/.test(key);
|
|
149
|
+
if ((named !== void 0 || letter) && press.shiftKey !== wants("shift")) return false;
|
|
150
|
+
if (named !== void 0) return press.key === named;
|
|
151
|
+
if (letter && wants("alt")) return press.code === (/[0-9]/.test(key) ? `Digit${key}` : `Key${key.toUpperCase()}`);
|
|
152
|
+
return press.key.toLowerCase() === key;
|
|
153
|
+
}
|
|
154
|
+
/** Whether the keyboard in front of the reader is an Apple one. Only the browser can say. */
|
|
155
|
+
function detectPlatform() {
|
|
156
|
+
if (typeof navigator === "undefined") return "other";
|
|
157
|
+
const hinted = navigator.userAgentData?.platform;
|
|
158
|
+
return /mac|iphone|ipad|ipod/i.test(hinted || navigator.platform || navigator.userAgent) ? "apple" : "other";
|
|
159
|
+
}
|
|
160
|
+
/** Whether a key press lands in something that is typed into: a field, or editable text. */
|
|
161
|
+
function isTypingTarget(target) {
|
|
162
|
+
if (!(target instanceof HTMLElement)) return false;
|
|
163
|
+
return target.isContentEditable || /^(input|textarea|select)$/i.test(target.tagName);
|
|
164
|
+
}
|
|
165
|
+
export { dependsOnPlatform, detectPlatform, hasCommandKey, isTypingTarget, matchesShortcut, shortcutKeys };
|
package/package.json
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* How an `ActionBar` comes and goes. It is always in the page, unseen while nothing is
|
|
3
|
+
* selected, so both ways are plain transitions that can be turned around half-way: selecting
|
|
4
|
+
* and deselecting quickly never leaves it stuck.
|
|
5
|
+
*
|
|
6
|
+
* It rises into place on `sheet`, by twice what a popup travels, and it leaves by fading, as
|
|
7
|
+
* every exit does: it is set back down only once it is no longer seen. Under reduced motion it
|
|
8
|
+
* does not travel at all (`--motion-enter-offset` is 0).
|
|
9
|
+
*/
|
|
10
|
+
@utility action-bar-motion {
|
|
11
|
+
opacity: 0;
|
|
12
|
+
translate: 0 calc(var(--motion-enter-offset) * 2);
|
|
13
|
+
visibility: hidden;
|
|
14
|
+
transition:
|
|
15
|
+
opacity var(--transition-duration-spring-leave) var(--ease-spring-leave),
|
|
16
|
+
translate 0s var(--transition-duration-spring-leave),
|
|
17
|
+
visibility 0s var(--transition-duration-spring-leave);
|
|
18
|
+
|
|
19
|
+
&[data-open] {
|
|
20
|
+
opacity: 1;
|
|
21
|
+
translate: 0 0;
|
|
22
|
+
visibility: visible;
|
|
23
|
+
transition:
|
|
24
|
+
opacity var(--transition-duration-spring-sheet) var(--ease-spring-sheet),
|
|
25
|
+
translate var(--transition-duration-spring-sheet) var(--ease-spring-sheet),
|
|
26
|
+
visibility 0s;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The assistant's parts where CSS says more than a class list could: the key „Neueste“, the
|
|
3
|
+
* layout of a prompt, and its send key that becomes stop.
|
|
4
|
+
*/
|
|
5
|
+
@layer components {
|
|
6
|
+
/*
|
|
7
|
+
* A prompt is a grid inside its field: the files, the text, and a row of keys with send at
|
|
8
|
+
* its end. (Send at the right of the text's last line was dropped, Justin, 2026-11-19.)
|
|
9
|
+
*/
|
|
10
|
+
[data-slot="prompt-input-field"] > [data-slot="grow-content"] {
|
|
11
|
+
grid-template-columns: minmax(0, 1fr);
|
|
12
|
+
grid-template-areas: "files" "text" "actions";
|
|
13
|
+
align-items: end;
|
|
14
|
+
}
|
|
15
|
+
[data-slot="prompt-input-attachments"] {
|
|
16
|
+
grid-area: files;
|
|
17
|
+
}
|
|
18
|
+
[data-slot="prompt-input-actions"] {
|
|
19
|
+
grid-area: actions;
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: 0.125rem;
|
|
23
|
+
}
|
|
24
|
+
[data-slot="prompt-input-submit"] {
|
|
25
|
+
margin-inline-start: auto;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/*
|
|
29
|
+
* Send and stop share one cell of the key, so it never changes size. Turning into stop, the
|
|
30
|
+
* arrow shrinks away on `leave` and the square seats on `seat`; back, the other way round.
|
|
31
|
+
* Under reduced motion the two only cross-fade.
|
|
32
|
+
*/
|
|
33
|
+
:is([data-slot="prompt-input-send-symbol"], [data-slot="prompt-input-stop-symbol"]) {
|
|
34
|
+
transition-property: scale, opacity;
|
|
35
|
+
transition-duration: var(--transition-duration-spring-seat);
|
|
36
|
+
transition-timing-function: var(--ease-spring-seat);
|
|
37
|
+
}
|
|
38
|
+
[data-slot="prompt-input-stop-symbol"],
|
|
39
|
+
[data-running] [data-slot="prompt-input-send-symbol"] {
|
|
40
|
+
scale: 0.5;
|
|
41
|
+
opacity: 0;
|
|
42
|
+
transition-duration: var(--transition-duration-spring-leave);
|
|
43
|
+
transition-timing-function: var(--ease-spring-leave);
|
|
44
|
+
}
|
|
45
|
+
[data-running] [data-slot="prompt-input-stop-symbol"] {
|
|
46
|
+
scale: 1;
|
|
47
|
+
opacity: 1;
|
|
48
|
+
transition-duration: var(--transition-duration-spring-seat);
|
|
49
|
+
transition-timing-function: var(--ease-spring-seat);
|
|
50
|
+
}
|
|
51
|
+
@media (prefers-reduced-motion: reduce) {
|
|
52
|
+
[data-slot="prompt-input-stop-symbol"],
|
|
53
|
+
[data-running] [data-slot="prompt-input-send-symbol"] {
|
|
54
|
+
scale: 1;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/*
|
|
59
|
+
* „Neueste“ rises in from a little below and a little smaller on `settle`, and leaves by
|
|
60
|
+
* fading on `leave`: its transform is put back only once it can no longer be seen, so the
|
|
61
|
+
* exit does not travel. Under reduced motion the offset and the scale are nothing (motion.css).
|
|
62
|
+
*/
|
|
63
|
+
[data-slot="conversation-latest"] {
|
|
64
|
+
display: inline-flex;
|
|
65
|
+
opacity: 0;
|
|
66
|
+
translate: 0 var(--motion-enter-offset);
|
|
67
|
+
scale: var(--motion-enter-scale);
|
|
68
|
+
transform-origin: 50% 100%;
|
|
69
|
+
transition:
|
|
70
|
+
opacity var(--transition-duration-spring-leave) var(--ease-spring-leave),
|
|
71
|
+
translate 0s linear var(--transition-duration-spring-leave),
|
|
72
|
+
scale 0s linear var(--transition-duration-spring-leave);
|
|
73
|
+
}
|
|
74
|
+
[data-slot="conversation-latest"][data-shown] {
|
|
75
|
+
opacity: 1;
|
|
76
|
+
translate: 0 0;
|
|
77
|
+
scale: 1;
|
|
78
|
+
transition-property: opacity, translate, scale;
|
|
79
|
+
transition-duration: var(--transition-duration-spring-settle);
|
|
80
|
+
transition-timing-function: var(--ease-spring-settle);
|
|
81
|
+
transition-delay: 0s;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* An avatar with something cut out of it: the avatar in front of it in an `AvatarGroup`, or its
|
|
3
|
+
* presence dot. The cut is an SVG made for the avatar's own box (`internal/avatar-cut.ts`),
|
|
4
|
+
* passed as `--avatar-cut` (and mirrored as `--avatar-cut-rtl`), so it moves and scales with it.
|
|
5
|
+
*
|
|
6
|
+
* A mask cuts everything the box paints, its outline too: in forced colours the outline is
|
|
7
|
+
* drawn just inside the edge, where the cut does not reach.
|
|
8
|
+
*/
|
|
9
|
+
@layer components {
|
|
10
|
+
[data-slot="avatar"][data-cut],
|
|
11
|
+
[data-slot="avatar-group-more"][data-cut] {
|
|
12
|
+
mask-image: var(--avatar-cut);
|
|
13
|
+
mask-size: 100% 100%;
|
|
14
|
+
mask-repeat: no-repeat;
|
|
15
|
+
|
|
16
|
+
&:dir(rtl) {
|
|
17
|
+
mask-image: var(--avatar-cut-rtl, var(--avatar-cut));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@media (forced-colors: active) {
|
|
21
|
+
outline-offset: -1px;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The consent card (`ConsentCard`). Its two views stand in one place: the one shown is in the
|
|
3
|
+
* flow and gives the card its height (a `Grow` eases it there); the other is out of the flow,
|
|
4
|
+
* faded, and waits on the side it comes back from. A view leaves by fading where it is, as every
|
|
5
|
+
* exit does, and only then steps to its side; the one that arrives slides in from there on
|
|
6
|
+
* `settle`. Under reduced motion the offset is zero and only the fade is left.
|
|
7
|
+
*/
|
|
8
|
+
[data-slot="consent-view"] {
|
|
9
|
+
transition-property: opacity, translate, visibility;
|
|
10
|
+
transition-timing-function: var(--ease-spring-settle);
|
|
11
|
+
/* The arriving view is visible at once: focus is moved into it in the same moment, and a
|
|
12
|
+
hidden view cannot take it. */
|
|
13
|
+
transition-duration:
|
|
14
|
+
var(--transition-duration-spring-settle), var(--transition-duration-spring-settle), 0s;
|
|
15
|
+
/* Its fade and slide wait until the leaving one has mostly faded: two texts over each other
|
|
16
|
+
for a moment read as a smudge, not as a change. */
|
|
17
|
+
transition-delay: var(--consent-swap-delay), var(--consent-swap-delay), 0s;
|
|
18
|
+
}
|
|
19
|
+
[data-slot="consent-card"] {
|
|
20
|
+
--consent-swap-delay: 70ms;
|
|
21
|
+
}
|
|
22
|
+
[data-slot="consent-view"][data-active="false"] {
|
|
23
|
+
position: absolute;
|
|
24
|
+
inset-inline: 0;
|
|
25
|
+
top: 0;
|
|
26
|
+
opacity: 0;
|
|
27
|
+
visibility: hidden;
|
|
28
|
+
transition-timing-function: var(--ease-spring-leave);
|
|
29
|
+
transition-duration: var(--transition-duration-spring-leave), 0s, 0s;
|
|
30
|
+
transition-delay:
|
|
31
|
+
0s, var(--transition-duration-spring-leave), var(--transition-duration-spring-leave);
|
|
32
|
+
}
|
|
33
|
+
[data-slot="consent-view"][data-active="false"][data-side="start"] {
|
|
34
|
+
translate: calc(var(--motion-enter-offset) * -6) 0;
|
|
35
|
+
}
|
|
36
|
+
[data-slot="consent-view"][data-active="false"][data-side="end"] {
|
|
37
|
+
translate: calc(var(--motion-enter-offset) * 6) 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/*
|
|
41
|
+
* The third button's label: „Einstellungen“ turns into „Auswahl speichern“ in place. Both stand
|
|
42
|
+
* in one grid cell; the new one rises a little into place, the old one fades.
|
|
43
|
+
*/
|
|
44
|
+
[data-slot="consent-third-label"] {
|
|
45
|
+
grid-area: 1 / 1;
|
|
46
|
+
transition-property: opacity, translate;
|
|
47
|
+
transition-timing-function: var(--ease-spring-settle);
|
|
48
|
+
transition-duration: var(--transition-duration-spring-settle);
|
|
49
|
+
transition-delay: var(--consent-swap-delay);
|
|
50
|
+
}
|
|
51
|
+
[data-slot="consent-third-label"][data-active="false"] {
|
|
52
|
+
opacity: 0;
|
|
53
|
+
translate: 0 var(--motion-enter-offset);
|
|
54
|
+
transition-timing-function: var(--ease-spring-leave);
|
|
55
|
+
transition-duration: var(--transition-duration-spring-leave), 0s;
|
|
56
|
+
transition-delay: 0s, var(--transition-duration-spring-leave);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/*
|
|
60
|
+
* „Alle akzeptieren“ or „Alle ablehnen“ in the settings: the switches flip one after another
|
|
61
|
+
* before the card leaves, so the reader sees what was stored.
|
|
62
|
+
*/
|
|
63
|
+
[data-slot="consent-card"][data-flipping] :is([data-slot="switch"], [data-slot="switch-thumb"]) {
|
|
64
|
+
transition-delay: calc(var(--flip-index, 0) * 25ms);
|
|
65
|
+
}
|
package/src/styles/copy.css
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* The confirmation of a copy, the same in every control that copies (a
|
|
3
|
-
* page copy): the copy symbol shrinks away and a tick is drawn in its place,
|
|
4
|
-
* in a checkbox. When the moment has passed the tick fades where it is (it is
|
|
5
|
-
* the copy symbol seats back with a little bounce.
|
|
2
|
+
* The confirmation of a copy, the same in every control that copies (a `CopyButton`, the keys of
|
|
3
|
+
* a code block, the page copy): the copy symbol shrinks away and a tick is drawn in its place,
|
|
4
|
+
* short leg first, as in a checkbox. When the moment has passed the tick fades where it is (it is
|
|
5
|
+
* not undrawn) and the copy symbol seats back with a little bounce.
|
|
6
6
|
*
|
|
7
7
|
* The control sets `data-copied` while the moment lasts; the symbol and the tick are found inside
|
|
8
|
-
* it by their slots. Under reduced motion nothing
|
|
8
|
+
* it by their slots (`CopyMarks` in internal/copy.tsx draws both). Under reduced motion nothing
|
|
9
|
+
* scales or draws: the two only cross-fade.
|
|
9
10
|
*/
|
|
10
11
|
@layer components {
|
|
11
|
-
:is([data-slot="
|
|
12
|
+
:is([data-slot="copy-symbol"], [data-slot="copy-page-symbol"]) {
|
|
12
13
|
transition-property: scale, opacity;
|
|
13
14
|
transition-duration: var(--transition-duration-spring-seat);
|
|
14
15
|
transition-timing-function: var(--ease-spring-seat);
|
|
15
16
|
}
|
|
16
|
-
[data-copied] :is([data-slot="
|
|
17
|
+
[data-copied] :is([data-slot="copy-symbol"], [data-slot="copy-page-symbol"]) {
|
|
17
18
|
scale: 0.5;
|
|
18
19
|
opacity: 0;
|
|
19
20
|
transition-duration: var(--transition-duration-spring-leave);
|
|
20
21
|
transition-timing-function: var(--ease-spring-leave);
|
|
21
22
|
}
|
|
22
|
-
:is([data-slot="
|
|
23
|
+
:is([data-slot="copy-tick"], [data-slot="copy-page-tick"]) {
|
|
23
24
|
stroke-dasharray: 1;
|
|
24
25
|
stroke-dashoffset: 1;
|
|
25
26
|
opacity: 0;
|
|
@@ -27,7 +28,7 @@
|
|
|
27
28
|
opacity var(--transition-duration-spring-leave) var(--ease-spring-leave),
|
|
28
29
|
stroke-dashoffset 0s var(--transition-duration-spring-leave);
|
|
29
30
|
}
|
|
30
|
-
[data-copied] :is([data-slot="
|
|
31
|
+
[data-copied] :is([data-slot="copy-tick"], [data-slot="copy-page-tick"]) {
|
|
31
32
|
stroke-dashoffset: 0;
|
|
32
33
|
opacity: 1;
|
|
33
34
|
transition:
|
|
@@ -36,10 +37,10 @@
|
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
@media (prefers-reduced-motion: reduce) {
|
|
39
|
-
[data-copied] :is([data-slot="
|
|
40
|
+
[data-copied] :is([data-slot="copy-symbol"], [data-slot="copy-page-symbol"]) {
|
|
40
41
|
scale: 1;
|
|
41
42
|
}
|
|
42
|
-
:is([data-slot="
|
|
43
|
+
:is([data-slot="copy-tick"], [data-slot="copy-page-tick"]) {
|
|
43
44
|
stroke-dashoffset: 0;
|
|
44
45
|
}
|
|
45
46
|
}
|
package/src/styles/depth.css
CHANGED
|
@@ -9,7 +9,10 @@
|
|
|
9
9
|
* Fitting what a hand presses depth-raised (+ -hover, depth-pressed)
|
|
10
10
|
* Plug a fitting seated in a socket depth-plug (a checked box)
|
|
11
11
|
* Socket what receives a value or a part depth-socket, depth-trough, depth-field
|
|
12
|
-
* Card one object you act on depth-card
|
|
12
|
+
* Card one object you act on depth-card (-chosen: one of several, taken;
|
|
13
|
+
* shadow-card-hover / -pressed when it is a control;
|
|
14
|
+
* in an app's main area a block of the page,
|
|
15
|
+
* without the wide shadow)
|
|
13
16
|
* Sheet what floats temporarily depth-floating, depth-overlay
|
|
14
17
|
* Bar the site's bar over the page depth-bar
|
|
15
18
|
* Seam where two sections of a site meet depth-seam (components/seam)
|
|
@@ -62,6 +65,10 @@
|
|
|
62
65
|
syntax: "*";
|
|
63
66
|
inherits: false;
|
|
64
67
|
}
|
|
68
|
+
@property --d-card-edge {
|
|
69
|
+
syntax: "*";
|
|
70
|
+
inherits: false;
|
|
71
|
+
}
|
|
65
72
|
|
|
66
73
|
:root,
|
|
67
74
|
[data-theme="paper"],
|
|
@@ -352,9 +359,20 @@
|
|
|
352
359
|
|
|
353
360
|
/* Cards: softly raised. */
|
|
354
361
|
--shadow-card:
|
|
355
|
-
0 0 0 1px var(--depth-card-edge), 0 2px 4px 0 var(--depth-card-near),
|
|
362
|
+
0 0 0 1px var(--d-card-edge, var(--depth-card-edge)), 0 2px 4px 0 var(--depth-card-near),
|
|
356
363
|
0 12px 28px -8px var(--depth-card-far);
|
|
364
|
+
/* A card that is a control (a `RadioCard`) answers with its shadow and keeps its size: a
|
|
365
|
+
little higher under the pointer, down on the page under a press. The layers match. */
|
|
366
|
+
--shadow-card-hover:
|
|
367
|
+
0 0 0 1px var(--d-card-edge, var(--depth-card-edge)), 0 3px 6px 0 var(--depth-card-near),
|
|
368
|
+
0 16px 32px -8px var(--depth-card-far);
|
|
369
|
+
--shadow-card-pressed:
|
|
370
|
+
0 0 0 1px var(--d-card-edge, var(--depth-card-edge)), 0 1px 2px 0 var(--depth-card-near),
|
|
371
|
+
0 4px 12px -6px var(--depth-card-far);
|
|
357
372
|
--inset-shadow-card: inset 0 1px 0 0 var(--depth-card-hi);
|
|
373
|
+
/* The chosen one of several wears the accent as its edge, a pixel outside (`--d-card-edge`,
|
|
374
|
+
in whatever state the card's shadow is) and a pixel inside. One layer, like the card's. */
|
|
375
|
+
--inset-shadow-card-chosen: inset 0 0 0 1px var(--lf-accent);
|
|
358
376
|
|
|
359
377
|
/* Sheets. */
|
|
360
378
|
--shadow-floating:
|
|
@@ -451,11 +469,37 @@
|
|
|
451
469
|
}
|
|
452
470
|
@utility depth-card {
|
|
453
471
|
@apply shadow-card inset-shadow-card;
|
|
472
|
+
/* On an app's page a card is a block of the page, not an object lifted off it: its edge and
|
|
473
|
+
its close shade stay, the wide soft shadow goes (Justin, 2026-11-19: "super airy"). Set on
|
|
474
|
+
the card itself, so a ground nested in between cannot bring the shadow back. */
|
|
475
|
+
[data-slot="app-shell-main"] & {
|
|
476
|
+
--depth-card-far: transparent;
|
|
477
|
+
}
|
|
478
|
+
/* A choice card rests the same way, wherever it stands, and lifts only under the pointer,
|
|
479
|
+
where its hover and press move the wide shadow (Justin, 2026-11-19: "too shadowy").
|
|
480
|
+
`inherit` takes the ground's value back from the card's parent. */
|
|
481
|
+
&:is([data-slot="checkbox-card"], [data-slot="radio-card"]) {
|
|
482
|
+
--depth-card-far: transparent;
|
|
483
|
+
@media (hover: hover) {
|
|
484
|
+
&:hover:not(:has([data-slot="choice-control"][data-disabled])) {
|
|
485
|
+
--depth-card-far: inherit;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
454
489
|
@media (forced-colors: active) {
|
|
455
490
|
outline: 1px solid ButtonBorder;
|
|
456
491
|
outline-offset: -1px;
|
|
457
492
|
}
|
|
458
493
|
}
|
|
494
|
+
/* Worn over `depth-card`: it changes the edge and leaves the shadow to the card's state. */
|
|
495
|
+
@utility depth-card-chosen {
|
|
496
|
+
--d-card-edge: var(--lf-accent);
|
|
497
|
+
@apply inset-shadow-card-chosen;
|
|
498
|
+
@media (forced-colors: active) {
|
|
499
|
+
outline: 2px solid Highlight;
|
|
500
|
+
outline-offset: -2px;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
459
503
|
@utility depth-floating {
|
|
460
504
|
@apply shadow-floating inset-shadow-sheet;
|
|
461
505
|
@media (forced-colors: active) {
|
package/src/styles/marks.css
CHANGED
|
@@ -22,8 +22,20 @@
|
|
|
22
22
|
box-shadow: inset 0 0 0 1.5px transparent;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
/* `--mark-fill` lets a part take the colour out of the disc: a choice that cannot be changed. */
|
|
25
26
|
@utility mark-on {
|
|
26
|
-
box-shadow: inset 0 0 0 0.25rem var(--lf-accent);
|
|
27
|
+
box-shadow: inset 0 0 0 0.25rem var(--mark-fill, var(--lf-accent));
|
|
28
|
+
transition-duration: var(--transition-duration-spring-seat);
|
|
29
|
+
transition-timing-function: var(--ease-spring-seat);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/*
|
|
33
|
+
* Half closed: the ring in the accent and heavier, with its hole still open. It is where one
|
|
34
|
+
* stands in a row of steps: taken up, not yet done. The same shadow, so it grows out of the ring
|
|
35
|
+
* and closes into the disc.
|
|
36
|
+
*/
|
|
37
|
+
@utility mark-now {
|
|
38
|
+
box-shadow: inset 0 0 0 0.15625rem var(--mark-fill, var(--lf-accent));
|
|
27
39
|
transition-duration: var(--transition-duration-spring-seat);
|
|
28
40
|
transition-timing-function: var(--ease-spring-seat);
|
|
29
41
|
}
|
|
@@ -52,9 +64,15 @@
|
|
|
52
64
|
[data-active] > .mark,
|
|
53
65
|
[data-selected] > .mark,
|
|
54
66
|
[data-checked] .mark,
|
|
55
|
-
[data-pressed] .mark
|
|
67
|
+
[data-pressed] .mark,
|
|
68
|
+
[data-status="done"] .mark
|
|
56
69
|
) {
|
|
57
70
|
outline-color: CanvasText;
|
|
58
71
|
background-color: CanvasText;
|
|
59
72
|
}
|
|
73
|
+
.mark-now,
|
|
74
|
+
[class*=":mark-now"]:is([data-status="current"] .mark) {
|
|
75
|
+
outline-width: 2px;
|
|
76
|
+
outline-offset: -2px;
|
|
77
|
+
}
|
|
60
78
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The rail: the hairline that joins the marks of a list read from top to bottom, a `Trace` and a
|
|
3
|
+
* `Timeline`. Each entry draws the piece below its own mark, from just under the mark to just
|
|
4
|
+
* above the next one, so the line never touches a mark and an entry that joins brings its piece
|
|
5
|
+
* with it.
|
|
6
|
+
*
|
|
7
|
+
* The piece is placed from the geometry of the first line of an entry:
|
|
8
|
+
* --rail-line height of that line (default 28px, a `Trace` step)
|
|
9
|
+
* --rail-lead width of the box in front that holds the mark (16px)
|
|
10
|
+
* --rail-mark height of what is drawn in that box: the 8px disc, or an avatar (8px)
|
|
11
|
+
* --rail-clear room left between the line and the mark above and below it (5px)
|
|
12
|
+
* --rail-gap space between two entries (0)
|
|
13
|
+
* --rail-next height of the mark of the entry below, where it differs (an avatar after a
|
|
14
|
+
* disc); by default the entry's own
|
|
15
|
+
* Set them on the list or on an entry; the defaults are a `Trace`.
|
|
16
|
+
*
|
|
17
|
+
* The last entry keeps its piece, invisible: when an entry joins below it, the piece fades in
|
|
18
|
+
* with the newcomer instead of appearing in one frame.
|
|
19
|
+
*/
|
|
20
|
+
@utility rail-item {
|
|
21
|
+
position: relative;
|
|
22
|
+
|
|
23
|
+
&::before {
|
|
24
|
+
content: "";
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: calc(
|
|
27
|
+
(var(--rail-line, 1.75rem) + var(--rail-mark, 0.5rem)) / 2 + var(--rail-clear, 0.3125rem)
|
|
28
|
+
);
|
|
29
|
+
bottom: calc(
|
|
30
|
+
var(--rail-clear, 0.3125rem) - var(--rail-gap, 0px) -
|
|
31
|
+
(var(--rail-line, 1.75rem) - var(--rail-next, var(--rail-mark, 0.5rem))) / 2
|
|
32
|
+
);
|
|
33
|
+
left: calc((var(--rail-lead, 1rem) - 1px) / 2);
|
|
34
|
+
width: 1px;
|
|
35
|
+
background-color: var(--lf-hairline);
|
|
36
|
+
transition: opacity var(--transition-duration-spring-settle) var(--ease-spring-settle);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&:last-child::before {
|
|
40
|
+
opacity: 0;
|
|
41
|
+
transition-duration: 0s;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@media (forced-colors: active) {
|
|
45
|
+
&::before {
|
|
46
|
+
background-color: CanvasText;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|