@lanfermann/ui 0.5.0 → 0.7.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/accordion/accordion.d.ts +11 -3
- package/dist/components/accordion/accordion.js +15 -10
- package/dist/components/action-bar/action-bar.d.ts +60 -0
- package/dist/components/action-bar/action-bar.js +117 -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 +51 -0
- package/dist/components/attachment/attachment.js +255 -0
- package/dist/components/attachment/kinds.d.ts +7 -0
- package/dist/components/attachment/kinds.js +142 -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/button-group/button-group-variants.d.ts +4 -3
- package/dist/components/button-group/button-group-variants.js +13 -12
- package/dist/components/button-group/button-group.d.ts +3 -3
- package/dist/components/button-group/button-group.js +3 -3
- package/dist/components/card/card.d.ts +20 -4
- package/dist/components/card/card.js +32 -6
- package/dist/components/checkbox-card/checkbox-card.d.ts +21 -0
- package/dist/components/checkbox-card/checkbox-card.js +50 -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/collapsible/collapsible.js +7 -3
- package/dist/components/combobox/combobox.d.ts +53 -3
- package/dist/components/combobox/combobox.js +204 -20
- 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.d.ts +4 -4
- package/dist/components/copy-page/copy-page.js +16 -36
- 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/menu/menu.d.ts +20 -8
- package/dist/components/menu/menu.js +51 -29
- package/dist/components/message/message.d.ts +81 -0
- package/dist/components/message/message.js +208 -0
- package/dist/components/navigation-menu/navigation-menu.d.ts +7 -1
- package/dist/components/navigation-menu/navigation-menu.js +11 -4
- package/dist/components/otp-field/otp-field.d.ts +37 -0
- package/dist/components/otp-field/otp-field.js +161 -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 +49 -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/segmented-control/segmented-control.js +29 -16
- package/dist/components/select/select.d.ts +5 -4
- package/dist/components/select/select.js +16 -11
- 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 +59 -0
- package/dist/components/stat/stat.js +112 -0
- package/dist/components/steps/steps.d.ts +57 -0
- package/dist/components/steps/steps.js +134 -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 +7 -6
- 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 +27 -0
- package/dist/components/toggle/toggle.js +61 -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 +52 -0
- package/dist/components/toolbar/toolbar.js +105 -0
- package/dist/components/trace/trace.d.ts +2 -1
- package/dist/components/trace/trace.js +15 -27
- 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 +81 -0
- package/dist/internal/clipboard.js +37 -0
- package/dist/internal/copy.js +58 -0
- package/dist/internal/disclosure.js +15 -3
- package/dist/internal/field.js +24 -4
- package/dist/internal/glyphs.js +26 -1
- package/dist/internal/key-tip.js +18 -0
- package/dist/internal/list-mark.js +39 -0
- package/dist/internal/live-list.js +41 -0
- package/dist/internal/number-places.js +157 -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/rule.js +2 -1
- package/dist/internal/status-icon.js +22 -0
- package/dist/internal/tile.js +23 -0
- package/dist/internal/travelling-mark.js +204 -0
- package/dist/lib/cn.js +10 -0
- package/dist/lib/shortcut.d.ts +11 -0
- package/dist/lib/shortcut.js +165 -0
- package/package.json +1 -1
- package/src/styles/accordion.css +176 -0
- 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 +120 -4
- package/src/styles/marks.css +20 -2
- package/src/styles/motion.css +3 -0
- package/src/styles/rail.css +49 -0
- package/src/styles/rolling-number.css +94 -0
- package/src/styles/segmented.css +14 -7
- 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 +10 -0
|
@@ -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,8 +9,13 @@
|
|
|
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
|
|
13
|
-
*
|
|
12
|
+
* Card one object you act on depth-card (in an app's main area a block of
|
|
13
|
+
* the page, without the wide shadow); depth-bevel
|
|
14
|
+
* and depth-gloss, a card cut like a fitting for
|
|
15
|
+
* what is handled (-chosen: one of several, taken;
|
|
16
|
+
* shadow-bevel-pressed under a press)
|
|
17
|
+
* Sheet what floats temporarily depth-floating, depth-overlay; depth-dock, a
|
|
18
|
+
* fitting that floats (the action bar)
|
|
14
19
|
* Bar the site's bar over the page depth-bar
|
|
15
20
|
* Seam where two sections of a site meet depth-seam (components/seam)
|
|
16
21
|
*
|
|
@@ -62,6 +67,10 @@
|
|
|
62
67
|
syntax: "*";
|
|
63
68
|
inherits: false;
|
|
64
69
|
}
|
|
70
|
+
@property --d-card-edge {
|
|
71
|
+
syntax: "*";
|
|
72
|
+
inherits: false;
|
|
73
|
+
}
|
|
65
74
|
|
|
66
75
|
:root,
|
|
67
76
|
[data-theme="paper"],
|
|
@@ -130,6 +139,20 @@
|
|
|
130
139
|
--depth-card-near: rgb(19 18 28 / 0.05);
|
|
131
140
|
--depth-card-far: rgb(42 37 82 / 0.2);
|
|
132
141
|
|
|
142
|
+
/* the bevelled card: cut like a fitting, a crisp edge and a lip at its foot */
|
|
143
|
+
--depth-bevel-face: linear-gradient(rgb(42 37 82 / 0) 55%, rgb(42 37 82 / 0.035));
|
|
144
|
+
--depth-bevel-edge: rgb(19 18 28 / 0.11);
|
|
145
|
+
--depth-bevel-hi: rgb(255 255 255 / 0);
|
|
146
|
+
--depth-bevel-lo: rgb(19 18 28 / 0.06);
|
|
147
|
+
--depth-bevel-contact: rgb(19 18 28 / 0.07);
|
|
148
|
+
--depth-bevel-ambient: rgb(42 37 82 / 0.1);
|
|
149
|
+
/* Glanz: the same cut with a face that visibly shines and darkens toward its foot */
|
|
150
|
+
--depth-gloss-face: linear-gradient(rgb(255 255 255 / 0), rgb(42 37 82 / 0.075));
|
|
151
|
+
--depth-gloss-hi: rgb(255 255 255 / 0);
|
|
152
|
+
--depth-gloss-lo: rgb(19 18 28 / 0.08);
|
|
153
|
+
/* the light that follows the pointer over a choice card */
|
|
154
|
+
--depth-bevel-light: rgb(95 80 208 / 0.07);
|
|
155
|
+
|
|
133
156
|
--depth-sheet-edge: rgb(19 18 28 / 0.12);
|
|
134
157
|
--depth-sheet-hi: rgb(255 255 255 / 0);
|
|
135
158
|
--depth-sheet-near: rgb(19 18 28 / 0.08);
|
|
@@ -209,6 +232,17 @@
|
|
|
209
232
|
--depth-card-near: rgb(8 7 12 / 0.4);
|
|
210
233
|
--depth-card-far: rgb(8 7 12 / 0.3);
|
|
211
234
|
|
|
235
|
+
--depth-bevel-face: linear-gradient(rgb(255 255 255 / 0.045), rgb(255 255 255 / 0.01));
|
|
236
|
+
--depth-bevel-edge: rgb(255 255 255 / 0.08);
|
|
237
|
+
--depth-bevel-hi: rgb(255 255 255 / 0.09);
|
|
238
|
+
--depth-bevel-lo: rgb(0 0 0 / 0.3);
|
|
239
|
+
--depth-bevel-contact: rgb(8 7 12 / 0.55);
|
|
240
|
+
--depth-bevel-ambient: rgb(8 7 12 / 0.35);
|
|
241
|
+
--depth-gloss-face: linear-gradient(rgb(255 255 255 / 0.085), rgb(255 255 255 / 0.015));
|
|
242
|
+
--depth-gloss-hi: rgb(255 255 255 / 0.14);
|
|
243
|
+
--depth-gloss-lo: rgb(0 0 0 / 0.35);
|
|
244
|
+
--depth-bevel-light: rgb(255 255 255 / 0.06);
|
|
245
|
+
|
|
212
246
|
--depth-sheet-edge: rgb(8 7 12 / 0.8);
|
|
213
247
|
--depth-sheet-hi: rgb(255 255 255 / 0.08);
|
|
214
248
|
--depth-sheet-near: rgb(8 7 12 / 0.4);
|
|
@@ -289,6 +323,17 @@
|
|
|
289
323
|
--depth-card-near: rgb(19 18 28 / 0.14);
|
|
290
324
|
--depth-card-far: rgb(19 18 28 / 0.22);
|
|
291
325
|
|
|
326
|
+
--depth-bevel-face: linear-gradient(rgb(255 255 255 / 0.08), rgb(255 255 255 / 0));
|
|
327
|
+
--depth-bevel-edge: rgb(255 255 255 / 0.16);
|
|
328
|
+
--depth-bevel-hi: rgb(255 255 255 / 0.14);
|
|
329
|
+
--depth-bevel-lo: rgb(19 18 28 / 0.16);
|
|
330
|
+
--depth-bevel-contact: rgb(19 18 28 / 0.16);
|
|
331
|
+
--depth-bevel-ambient: rgb(19 18 28 / 0.2);
|
|
332
|
+
--depth-gloss-face: linear-gradient(rgb(255 255 255 / 0.14), rgb(255 255 255 / 0));
|
|
333
|
+
--depth-gloss-hi: rgb(255 255 255 / 0.2);
|
|
334
|
+
--depth-gloss-lo: rgb(19 18 28 / 0.2);
|
|
335
|
+
--depth-bevel-light: rgb(255 255 255 / 0.08);
|
|
336
|
+
|
|
292
337
|
--depth-sheet-edge: rgb(19 18 28 / 0.2);
|
|
293
338
|
--depth-sheet-hi: rgb(255 255 255 / 0);
|
|
294
339
|
--depth-sheet-near: rgb(19 18 28 / 0.14);
|
|
@@ -350,12 +395,40 @@
|
|
|
350
395
|
--shadow-field-invalid: 0 0 0 1px var(--lf-danger), 0 0 0 4px var(--depth-field-halo-danger);
|
|
351
396
|
--inset-shadow-field: inset 0 1px 2px 0 var(--depth-field-shade);
|
|
352
397
|
|
|
353
|
-
/* Cards: softly raised.
|
|
398
|
+
/* Cards: softly raised. The wide layer reaches 6px down with a 16px blur: at 12px and 28px it
|
|
399
|
+
spread too far (Justin, 2026-11-20, chosen over that and over 3px and 8px). */
|
|
354
400
|
--shadow-card:
|
|
355
401
|
0 0 0 1px var(--depth-card-edge), 0 2px 4px 0 var(--depth-card-near),
|
|
356
|
-
0
|
|
402
|
+
0 6px 16px -6px var(--depth-card-far);
|
|
357
403
|
--inset-shadow-card: inset 0 1px 0 0 var(--depth-card-hi);
|
|
358
404
|
|
|
405
|
+
/* The bevelled card (Fase): a card cut like a fitting. Its edge is crisp, light runs along its
|
|
406
|
+
top and a 1px lip along its foot, and its shadow is short: it stands on the page, it does
|
|
407
|
+
not hover over it. A choice card on it goes down to the page under a press; the layers
|
|
408
|
+
match, so it eases between the two. */
|
|
409
|
+
--shadow-bevel:
|
|
410
|
+
0 0 0 1px var(--d-card-edge, var(--depth-bevel-edge)), 0 1px 2px 0 var(--depth-bevel-contact),
|
|
411
|
+
0 4px 12px -4px var(--depth-bevel-ambient);
|
|
412
|
+
--shadow-bevel-pressed:
|
|
413
|
+
0 0 0 1px var(--d-card-edge, var(--depth-bevel-edge)), 0 0 0 0 transparent,
|
|
414
|
+
0 1px 3px -1px var(--depth-bevel-ambient);
|
|
415
|
+
--inset-shadow-bevel:
|
|
416
|
+
inset 0 1px 0 0 var(--depth-bevel-hi), inset 0 -1px 0 0 var(--depth-bevel-lo);
|
|
417
|
+
/* Chosen, the one of several wears the accent as its edge: a pixel outside (`--d-card-edge`,
|
|
418
|
+
in whatever state the card's shadow is) and a pixel inside, in place of the top light. */
|
|
419
|
+
--inset-shadow-bevel-chosen:
|
|
420
|
+
inset 0 0 0 1px var(--lf-accent), inset 0 -1px 0 0 var(--depth-bevel-lo);
|
|
421
|
+
/* Glanz: the bevelled card with a face that visibly shines, Clerk's prompt cards on dark. */
|
|
422
|
+
--inset-shadow-gloss:
|
|
423
|
+
inset 0 1px 0 0 var(--depth-gloss-hi), inset 0 -1px 0 0 var(--depth-gloss-lo);
|
|
424
|
+
|
|
425
|
+
/* The dock: a fitting's face that floats over the page for as long as a selection lasts (the
|
|
426
|
+
`ActionBar`). The edge, light and lip of a key, and a long, wide float under it (Justin,
|
|
427
|
+
2026-11-20, chosen over a shorter and a wider one). */
|
|
428
|
+
--shadow-dock:
|
|
429
|
+
0 0 0 1px var(--depth-surface-edge), 0 1px 2px 0 var(--depth-surface-contact),
|
|
430
|
+
0 12px 28px -10px var(--depth-sheet-mid), 0 28px 60px -20px var(--depth-sheet-far);
|
|
431
|
+
|
|
359
432
|
/* Sheets. */
|
|
360
433
|
--shadow-floating:
|
|
361
434
|
0 0 0 1px var(--depth-sheet-edge), 0 1px 2px 0 var(--depth-sheet-near),
|
|
@@ -451,11 +524,54 @@
|
|
|
451
524
|
}
|
|
452
525
|
@utility depth-card {
|
|
453
526
|
@apply shadow-card inset-shadow-card;
|
|
527
|
+
/* On an app's page a card is a block of the page, not an object lifted off it: its edge and
|
|
528
|
+
its close shade stay, the wide soft shadow goes (Justin, 2026-11-19: "super airy"). Set on
|
|
529
|
+
the card itself, so a ground nested in between cannot bring the shadow back. */
|
|
530
|
+
[data-slot="app-shell-main"] & {
|
|
531
|
+
--depth-card-far: transparent;
|
|
532
|
+
}
|
|
533
|
+
@media (forced-colors: active) {
|
|
534
|
+
outline: 1px solid ButtonBorder;
|
|
535
|
+
outline-offset: -1px;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
/* A card cut like a fitting (`Card variant="bevel"`, the choice cards). */
|
|
539
|
+
@utility depth-bevel {
|
|
540
|
+
@apply shadow-bevel inset-shadow-bevel;
|
|
541
|
+
background-image: var(--depth-bevel-face);
|
|
542
|
+
@media (forced-colors: active) {
|
|
543
|
+
outline: 1px solid ButtonBorder;
|
|
544
|
+
outline-offset: -1px;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
/* The same cut with a shining face (`Card variant="gloss"`). */
|
|
548
|
+
@utility depth-gloss {
|
|
549
|
+
@apply shadow-bevel inset-shadow-gloss;
|
|
550
|
+
background-image: var(--depth-gloss-face);
|
|
551
|
+
@media (forced-colors: active) {
|
|
552
|
+
outline: 1px solid ButtonBorder;
|
|
553
|
+
outline-offset: -1px;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
/* Worn over `depth-bevel`: the accent as its edge, outside and in; the shadow is the card's. */
|
|
557
|
+
@utility depth-bevel-chosen {
|
|
558
|
+
--d-card-edge: var(--lf-accent);
|
|
559
|
+
@apply inset-shadow-bevel-chosen;
|
|
560
|
+
@media (forced-colors: active) {
|
|
561
|
+
outline: 2px solid Highlight;
|
|
562
|
+
outline-offset: -2px;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
/* A fitting that floats: the `ActionBar`. Its face, light and lip are a key's. */
|
|
566
|
+
@utility depth-dock {
|
|
567
|
+
@apply shadow-dock inset-shadow-raised;
|
|
568
|
+
background-image: var(--d-face, var(--depth-surface-face));
|
|
454
569
|
@media (forced-colors: active) {
|
|
455
570
|
outline: 1px solid ButtonBorder;
|
|
456
571
|
outline-offset: -1px;
|
|
457
572
|
}
|
|
458
573
|
}
|
|
574
|
+
/* Worn over `depth-card`: it changes the edge and leaves the shadow to the card's state. */
|
|
459
575
|
@utility depth-floating {
|
|
460
576
|
@apply shadow-floating inset-shadow-sheet;
|
|
461
577
|
@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
|
}
|
package/src/styles/motion.css
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
--motion-enter-scale: 0.96;
|
|
14
14
|
--motion-enter-offset: 4px;
|
|
15
15
|
--motion-press-scale: 0.98;
|
|
16
|
+
/* How far a disclosure's chevron leans the way it points while its row is pointed at. */
|
|
17
|
+
--motion-lean: 1.5px;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -20,6 +22,7 @@
|
|
|
20
22
|
--motion-enter-scale: 1;
|
|
21
23
|
--motion-enter-offset: 0px;
|
|
22
24
|
--motion-press-scale: 1;
|
|
25
|
+
--motion-lean: 0px;
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
28
|
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The places of a `RollingNumber`. A digit is a column of the ten digits (and a second 0 under
|
|
3
|
+
* the 9) behind a window one line tall. Its position is `--roll`, a registered number that
|
|
4
|
+
* only grows while the number grows and only shrinks while it shrinks; the digit shown is the
|
|
5
|
+
* position modulo ten. So every column rolls the way the number moves, 9 goes forward into 0
|
|
6
|
+
* like an odometer, and a change that arrives mid-roll is a new target for the same transition.
|
|
7
|
+
*
|
|
8
|
+
* The window fades at its top and bottom edge, in the empty space above and below the digits, so
|
|
9
|
+
* a digit rolls out softly instead of being cut. At rest the fade touches nothing.
|
|
10
|
+
*
|
|
11
|
+
* A place that joins (999 becomes 1.000) opens from nothing as it fades in; one that leaves
|
|
12
|
+
* fades first, then closes, so what stands beside the number is pushed aside instead of jumping.
|
|
13
|
+
* This is the one width that moves in the kit besides a chip's place (`ChipGroup`): it moves
|
|
14
|
+
* the text after the number, which a transform could not.
|
|
15
|
+
*/
|
|
16
|
+
@property --roll {
|
|
17
|
+
syntax: "<number>";
|
|
18
|
+
inherits: false;
|
|
19
|
+
initial-value: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@layer components {
|
|
23
|
+
[data-slot="rolling-number-place"] {
|
|
24
|
+
display: inline-grid;
|
|
25
|
+
grid-template-columns: 1fr;
|
|
26
|
+
transition:
|
|
27
|
+
grid-template-columns var(--transition-duration-spring-settle) var(--ease-spring-settle),
|
|
28
|
+
opacity var(--transition-duration-spring-settle) var(--ease-spring-settle);
|
|
29
|
+
|
|
30
|
+
[data-live] & {
|
|
31
|
+
@starting-style {
|
|
32
|
+
grid-template-columns: 0fr;
|
|
33
|
+
opacity: 0;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* Faded before its place closes, so it is never seen under a neighbour. */
|
|
38
|
+
&[data-leaving] {
|
|
39
|
+
grid-template-columns: 0fr;
|
|
40
|
+
opacity: 0;
|
|
41
|
+
transition:
|
|
42
|
+
opacity var(--transition-duration-spring-leave) var(--ease-spring-leave),
|
|
43
|
+
grid-template-columns var(--transition-duration-spring-settle) var(--ease-spring-settle)
|
|
44
|
+
75ms;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* What stands in a place keeps its size; only the place changes, and clips it sideways. */
|
|
49
|
+
[data-slot="rolling-number-symbol"] {
|
|
50
|
+
min-width: 0;
|
|
51
|
+
overflow: clip;
|
|
52
|
+
white-space: pre;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
[data-slot="rolling-number-window"] {
|
|
56
|
+
min-width: 0;
|
|
57
|
+
height: 1lh;
|
|
58
|
+
/* `clip`, not `hidden`: a box that scrolls would sit on its bottom edge, not its baseline. */
|
|
59
|
+
overflow: clip;
|
|
60
|
+
/* A quarter of the room the line leaves around a digit: Sofia Sans sits its digits high in
|
|
61
|
+
the line, and a deeper fade touched their tops at rest (measured at 3x in three engines). */
|
|
62
|
+
mask-image: linear-gradient(
|
|
63
|
+
to bottom,
|
|
64
|
+
transparent,
|
|
65
|
+
#000 calc((1lh - 1cap) / 4),
|
|
66
|
+
#000 calc(100% - (1lh - 1cap) / 4),
|
|
67
|
+
transparent
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
[data-slot="rolling-number-column"] {
|
|
72
|
+
display: block;
|
|
73
|
+
white-space: pre;
|
|
74
|
+
translate: 0 calc(mod(var(--roll), 10) * -100% / 11);
|
|
75
|
+
/* Without bounce: a digit that overshot would show the next one for a moment (Justin,
|
|
76
|
+
2026-11-19, `settle` over `seat`). */
|
|
77
|
+
transition: --roll var(--transition-duration-spring-settle) var(--ease-spring-settle);
|
|
78
|
+
|
|
79
|
+
&::before {
|
|
80
|
+
content: var(--rolling-digits, "0\A 1\A 2\A 3\A 4\A 5\A 6\A 7\A 8\A 9\A 0");
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* Under reduced motion a digit changes at once and nothing beside it slides; places fade. */
|
|
85
|
+
@media (prefers-reduced-motion: reduce) {
|
|
86
|
+
[data-slot="rolling-number-column"] {
|
|
87
|
+
transition: none;
|
|
88
|
+
}
|
|
89
|
+
[data-slot="rolling-number-place"],
|
|
90
|
+
[data-slot="rolling-number-place"][data-leaving] {
|
|
91
|
+
transition: opacity var(--transition-duration-spring-leave) var(--ease-spring-leave);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
package/src/styles/segmented.css
CHANGED
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
* Everything that moves here is a transform, so nothing is laid out while it travels; only a
|
|
5
5
|
* change of width between two segments is, on the thumb alone.
|
|
6
6
|
*
|
|
7
|
+
* What is measured (`--thumb-left`, `--thumb-width`, `--thumb-lean`, `--track-width`,
|
|
8
|
+
* `--track-height`) is written as a plain number of layout pixels and made a length only where
|
|
9
|
+
* it is used (`* 1px`). Under CSS `zoom` every engine treated a length in a custom property in
|
|
10
|
+
* its own way: Firefox zoomed the registered width twice, so the thumb came out 1.4 times too
|
|
11
|
+
* wide past the trough's end, and WebKit placed the resting thumb off its segment. A number is
|
|
12
|
+
* not zoomed, and the `1px` it is multiplied by is zoomed once, where it is used.
|
|
13
|
+
*
|
|
7
14
|
* Three parts, the first two as in a slider (slider.css):
|
|
8
15
|
*
|
|
9
16
|
* rider `segment-thumb`: the place. It travels to the chosen segment on `--segment-pace`
|
|
@@ -51,9 +58,9 @@
|
|
|
51
58
|
initial-value: 1;
|
|
52
59
|
}
|
|
53
60
|
@property --thumb-width {
|
|
54
|
-
syntax: "<
|
|
61
|
+
syntax: "<number>";
|
|
55
62
|
inherits: true;
|
|
56
|
-
initial-value:
|
|
63
|
+
initial-value: 0;
|
|
57
64
|
}
|
|
58
65
|
|
|
59
66
|
@layer components {
|
|
@@ -103,8 +110,8 @@
|
|
|
103
110
|
}
|
|
104
111
|
|
|
105
112
|
[data-slot="segment-thumb"] {
|
|
106
|
-
width: var(--thumb-width);
|
|
107
|
-
translate: calc(var(--thumb-left,
|
|
113
|
+
width: calc(var(--thumb-width) * 1px);
|
|
114
|
+
translate: calc((var(--thumb-left, 0) + var(--thumb-lean, 0)) * 1px) 0;
|
|
108
115
|
}
|
|
109
116
|
/* Until it is placed, the chosen segment's own seat stands in for it (segmented-control.tsx):
|
|
110
117
|
the two change places in one frame, so a page that came from a server has a thumb at once. */
|
|
@@ -116,18 +123,18 @@
|
|
|
116
123
|
px, not in percent of the box. */
|
|
117
124
|
[data-slot="segment-thumb-face"] {
|
|
118
125
|
scale: var(--thumb-long) var(--thumb-tall);
|
|
119
|
-
translate: calc(var(--thumb-off) * var(--thumb-width)) 0;
|
|
126
|
+
translate: calc(var(--thumb-off) * var(--thumb-width) * 1px) 0;
|
|
120
127
|
}
|
|
121
128
|
|
|
122
129
|
/* The inverse: T(c) S(l) is undone by T(-c/l) S(1/l). The press is left in, so a held label
|
|
123
130
|
goes down with its thumb. */
|
|
124
131
|
[data-slot="segment-lens"] {
|
|
125
132
|
scale: calc(1 / var(--thumb-s)) calc(1 / (1 - (var(--thumb-s) - 1) * var(--thumb-thin)));
|
|
126
|
-
translate: calc(-1 * var(--thumb-off) * var(--thumb-width) / var(--thumb-long)) 0;
|
|
133
|
+
translate: calc(-1 * var(--thumb-off) * var(--thumb-width) * 1px / var(--thumb-long)) 0;
|
|
127
134
|
}
|
|
128
135
|
/* And the rider's way taken back: the labels stand where the track's labels stand. */
|
|
129
136
|
[data-slot="segment-lens-labels"] {
|
|
130
|
-
translate: calc(-1 * (var(--thumb-left,
|
|
137
|
+
translate: calc(-1 * (var(--thumb-left, 0) + var(--thumb-lean, 0)) * 1px) 0;
|
|
131
138
|
}
|
|
132
139
|
|
|
133
140
|
/* What eases. On the track, the numbers the face and the lens are worked out from; on the
|