@zonsh/ui 0.4.1 → 0.5.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.
Files changed (67) hide show
  1. package/dist/components/accordion.js +1 -1
  2. package/dist/components/ascii-field.js +2 -1
  3. package/dist/components/bottom-nav.js +4 -4
  4. package/dist/components/button.js +1 -1
  5. package/dist/components/chart.d.ts +11 -0
  6. package/dist/components/chart.js +12 -0
  7. package/dist/components/collapsible.js +1 -1
  8. package/dist/components/command.js +3 -3
  9. package/dist/components/conversation.js +10 -3
  10. package/dist/components/copy-button.js +7 -5
  11. package/dist/components/graph.js +24 -7
  12. package/dist/components/illustration.js +50 -3
  13. package/dist/components/input-group.d.ts +2 -2
  14. package/dist/components/input-group.js +6 -4
  15. package/dist/components/input.d.ts +1 -1
  16. package/dist/components/input.js +1 -1
  17. package/dist/components/layout.d.ts +2 -1
  18. package/dist/components/layout.js +55 -11
  19. package/dist/components/lightbox.js +22 -4
  20. package/dist/components/menubar.js +60 -13
  21. package/dist/components/message.js +3 -2
  22. package/dist/components/navigation-menu.js +4 -2
  23. package/dist/components/number-field.js +26 -12
  24. package/dist/components/pagination.js +1 -1
  25. package/dist/components/prompt-input.js +14 -6
  26. package/dist/components/radio-group.js +7 -2
  27. package/dist/components/reasoning.js +1 -1
  28. package/dist/components/response.d.ts +3 -2
  29. package/dist/components/response.js +22 -10
  30. package/dist/components/sidebar.js +37 -18
  31. package/dist/components/site-header.js +6 -1
  32. package/dist/components/skeleton.d.ts +1 -1
  33. package/dist/components/skeleton.js +1 -1
  34. package/dist/components/sortable.js +61 -37
  35. package/dist/components/table.d.ts +1 -1
  36. package/dist/components/table.js +55 -2
  37. package/dist/components/tabs.js +8 -4
  38. package/dist/components/tags-input.js +1 -1
  39. package/dist/components/theme.d.ts +1 -1
  40. package/dist/components/theme.js +21 -3
  41. package/dist/components/time-field.d.ts +2 -1
  42. package/dist/components/time-field.js +13 -3
  43. package/dist/components/toggle-group.js +1 -0
  44. package/dist/components/tool-call.js +6 -1
  45. package/dist/components/toolbar.d.ts +1 -1
  46. package/dist/components/toolbar.js +5 -2
  47. package/dist/components/tooltip.d.ts +4 -2
  48. package/dist/components/tooltip.js +10 -4
  49. package/dist/components/tour.js +35 -10
  50. package/dist/components/tree.js +29 -6
  51. package/dist/components/video-player.js +61 -5
  52. package/dist/lib/glide.d.ts +5 -4
  53. package/dist/lib/glide.js +5 -4
  54. package/dist/lib/table-fit.d.ts +3 -2
  55. package/dist/lib/table-fit.js +29 -19
  56. package/dist/styles/expressive.css +40 -21
  57. package/dist/styles/index.css +8 -0
  58. package/dist/styles/material.css +40 -20
  59. package/dist/styles/parts/ai.css +2 -1
  60. package/dist/styles/parts/controls.css +24 -20
  61. package/dist/styles/parts/data.css +33 -5
  62. package/dist/styles/parts/feedback.css +43 -13
  63. package/dist/styles/parts/navigation.css +42 -9
  64. package/dist/styles/parts/overlays.css +93 -6
  65. package/dist/styles/parts/pdf.css +13 -7
  66. package/dist/styles/tokens.css +16 -1
  67. package/package.json +1 -1
@@ -40,9 +40,9 @@
40
40
  /* A press sinks in fast and rises back gently: the release eases over longer, on a softer curve
41
41
  than the brand ease, so even a quick click is seen to press and settle. Reduced motion: 0. */
42
42
  transition:
43
- background-color calc(var(--duration) * 1.7) cubic-bezier(0.33, 1, 0.68, 1),
44
- color var(--duration) var(--ease),
45
- box-shadow calc(var(--duration) * 1.7) cubic-bezier(0.33, 1, 0.68, 1),
43
+ background-color calc(var(--duration-fade) * 1.7) var(--ease-glide),
44
+ color var(--duration-fade) var(--ease),
45
+ box-shadow calc(var(--duration-fade) * 1.7) var(--ease-glide),
46
46
  var(--material-motion, padding 0s);
47
47
 
48
48
  @media (hover: hover) {
@@ -56,9 +56,9 @@
56
56
  background-color: var(--primary-fill-pressed);
57
57
  box-shadow: var(--primary-shadow-pressed);
58
58
  transition:
59
- background-color calc(var(--duration) * 0.6) cubic-bezier(0.33, 1, 0.68, 1),
60
- color var(--duration) var(--ease),
61
- box-shadow calc(var(--duration) * 0.6) cubic-bezier(0.33, 1, 0.68, 1),
59
+ background-color calc(var(--duration-fade) * 0.6) var(--ease-glide),
60
+ color var(--duration-fade) var(--ease),
61
+ box-shadow calc(var(--duration-fade) * 0.6) var(--ease-glide),
62
62
  var(--material-motion, padding 0s);
63
63
  }
64
64
  }
@@ -77,9 +77,9 @@
77
77
  /* A press sinks in fast and rises back gently: the release eases over longer, on a softer curve
78
78
  than the brand ease, so even a quick click is seen to press and settle. Reduced motion: 0. */
79
79
  transition:
80
- background-color calc(var(--duration) * 1.7) cubic-bezier(0.33, 1, 0.68, 1),
81
- color var(--duration) var(--ease),
82
- box-shadow calc(var(--duration) * 1.7) cubic-bezier(0.33, 1, 0.68, 1),
80
+ background-color calc(var(--duration-fade) * 1.7) var(--ease-glide),
81
+ color var(--duration-fade) var(--ease),
82
+ box-shadow calc(var(--duration-fade) * 1.7) var(--ease-glide),
83
83
  var(--material-motion, padding 0s);
84
84
 
85
85
  @media (hover: hover) {
@@ -95,9 +95,9 @@
95
95
  inset 0 2px 6px #00000047,
96
96
  inset 0 0 0 1px var(--control-inner-edge);
97
97
  transition:
98
- background-color calc(var(--duration) * 0.6) cubic-bezier(0.33, 1, 0.68, 1),
99
- color var(--duration) var(--ease),
100
- box-shadow calc(var(--duration) * 0.6) cubic-bezier(0.33, 1, 0.68, 1),
98
+ background-color calc(var(--duration-fade) * 0.6) var(--ease-glide),
99
+ color var(--duration-fade) var(--ease),
100
+ box-shadow calc(var(--duration-fade) * 0.6) var(--ease-glide),
101
101
  var(--material-motion, padding 0s);
102
102
  }
103
103
  &[data-popup-open] {
@@ -114,9 +114,9 @@
114
114
  border: 1px solid transparent;
115
115
  background-color: transparent;
116
116
  transition:
117
- background-color var(--duration) var(--ease),
118
- color var(--duration) var(--ease),
119
- box-shadow var(--duration) var(--ease),
117
+ background-color var(--duration-fade) var(--ease),
118
+ color var(--duration-fade) var(--ease),
119
+ box-shadow var(--duration-fade) var(--ease),
120
120
  var(--material-motion, padding 0s);
121
121
 
122
122
  @media (hover: hover) {
@@ -143,6 +143,17 @@
143
143
  inset 0 1px 0 var(--control-highlight),
144
144
  inset 0 0 0 1px var(--control-inner-edge);
145
145
  }
146
+ /* Pressed, a row answers on pointer-down, as a button does: the fill a step below hover, sinking
147
+ in fast. */
148
+ &:not(:disabled, [data-disabled]):active {
149
+ color: var(--foreground);
150
+ background-color: var(--control-pressed);
151
+ transition:
152
+ background-color calc(var(--duration-fade) * 0.6) var(--ease-glide),
153
+ color var(--duration-fade) var(--ease),
154
+ box-shadow calc(var(--duration-fade) * 0.6) var(--ease-glide),
155
+ var(--material-motion, padding 0s);
156
+ }
146
157
  }
147
158
 
148
159
  /* ── Field (recessed) ──────────────────────────────────────────────────────── */
@@ -156,9 +167,9 @@
156
167
  inset 0 1px 2px var(--field-inset),
157
168
  0 1px 0 var(--control-highlight);
158
169
  transition:
159
- border-color var(--duration) var(--ease),
160
- box-shadow var(--duration) var(--ease),
161
- background-color var(--duration) var(--ease);
170
+ border-color var(--duration-fade) var(--ease),
171
+ box-shadow var(--duration-fade) var(--ease),
172
+ background-color var(--duration-fade) var(--ease);
162
173
 
163
174
  /* Focus is a softer edge, not a ring: a focused text field — or a field holding one — and an
164
175
  open select take a border halfway to --control-focus. A field that is a button (a select's
@@ -246,9 +257,12 @@
246
257
  /* ── Popup motion (Base UI starting/ending styles) ─────────────────────────── */
247
258
 
248
259
  @utility popup-motion {
260
+ /* From the trigger (Base UI's --transform-origin; a dialog has none and stays centred), from 97%
261
+ and transparent, never from nothing. Leaving takes 0.7 of arriving. Under reduced motion the
262
+ scale has no time to move and only the fade (--duration-fade) is left. */
249
263
  transform-origin: var(--transform-origin);
250
264
  transition:
251
- opacity var(--duration) var(--ease),
265
+ opacity var(--duration-fade) var(--ease),
252
266
  scale var(--duration) var(--ease),
253
267
  translate var(--duration) var(--ease);
254
268
 
@@ -257,6 +271,12 @@
257
271
  opacity: 0;
258
272
  scale: 0.97;
259
273
  }
274
+ &[data-ending-style] {
275
+ transition:
276
+ opacity calc(var(--duration-fade) * 0.7) var(--ease),
277
+ scale var(--duration-exit) var(--ease),
278
+ translate var(--duration-exit) var(--ease);
279
+ }
260
280
  &[data-instant] {
261
281
  transition: none;
262
282
  }
@@ -287,7 +307,7 @@
287
307
  text-decoration-line: underline;
288
308
  text-decoration-color: color-mix(in oklab, var(--foreground) 35%, transparent);
289
309
  text-underline-offset: 4px;
290
- transition: text-decoration-color var(--duration) var(--ease);
310
+ transition: text-decoration-color var(--duration-fade) var(--ease);
291
311
 
292
312
  &:hover {
293
313
  text-decoration-color: var(--foreground);
@@ -213,7 +213,8 @@
213
213
 
214
214
  /* ── Reasoning: "Thinking…" shimmers ────────────────────────────────────────
215
215
  * A brighter band moves through the muted label, left to right, every 1.6s; under reduced
216
- * motion the label simply stays muted. */
216
+ * motion the label simply stays muted: it says it is thinking, and a pulse in its opacity would take
217
+ * the text below a readable contrast for part of each beat. */
217
218
  [data-slot="reasoning-label"][data-streaming] {
218
219
  background-image: linear-gradient(
219
220
  90deg,
@@ -90,14 +90,15 @@
90
90
  *
91
91
  * Two registered values move, not width and position: the stretch (--thumb-w) and how far on
92
92
  * the switch is (--thumb-on, 0 to 1), each in 2 × --duration. Width and offset are worked out
93
- * from them every frame, both in layout, so the far edge cannot drift — two separate
94
- * transitions fell out of step whenever one was reversed mid-way (hover out, release). */
93
+ * from them every frame, so the far edge cannot drift — two separate transitions fell out of
94
+ * step whenever one was reversed mid-way (hover out, release). Only the stretch is layout; the
95
+ * travel is a translate, mirrored on a right-to-left page, where the thumb starts at the right. */
95
96
  [data-slot="switch-thumb"] {
96
97
  --thumb-w: 18px;
97
98
  --thumb-on: 0;
98
99
  width: var(--thumb-w);
99
100
  height: 18px;
100
- margin-inline-start: calc((34px - var(--thumb-w)) * var(--thumb-on));
101
+ translate: calc((34px - var(--thumb-w)) * var(--thumb-on)) 0;
101
102
  transition:
102
103
  --thumb-w calc(var(--duration) * 2) var(--ease),
103
104
  --thumb-on calc(var(--duration) * 2) var(--ease),
@@ -107,6 +108,9 @@
107
108
  [data-slot="switch-thumb"][data-checked] {
108
109
  --thumb-on: 1;
109
110
  }
111
+ [data-slot="switch-thumb"]:dir(rtl) {
112
+ translate: calc((34px - var(--thumb-w)) * var(--thumb-on) * -1) 0;
113
+ }
110
114
  [data-slot="switch"]:not([data-disabled], [data-readonly]):active > [data-slot="switch-thumb"] {
111
115
  --thumb-w: 25px;
112
116
  }
@@ -489,7 +493,8 @@
489
493
 
490
494
  /* ── Button, collapsible: the label folds away to leave the icon ─────────────────────────
491
495
  * Like a revealing toggle-group segment: the label is a one-column grid that narrows to 0fr
492
- * with its text clipped, on 2 × --duration, and fades on --duration. The icon–label gap
496
+ * with its text clipped, on 2 × --duration (an expandable button: --expand-time), and fades on
497
+ * --duration. The icon–label gap
493
498
  * travels inside it (a pseudo-element on the icon's side), so nothing of it is left. The
494
499
  * first decision, before the first paint, is drawn without motion (data-collapse-instant; the
495
500
  * button's own transitions are switched off by a utility in Button, above the material). */
@@ -498,8 +503,8 @@
498
503
  grid-template-columns: 1fr;
499
504
  align-items: center;
500
505
  transition:
501
- grid-template-columns calc(var(--duration) * 2) var(--ease),
502
- opacity var(--duration) var(--ease);
506
+ grid-template-columns var(--expand-time, calc(var(--duration) * 2)) var(--ease),
507
+ opacity var(--expand-fade, var(--duration)) var(--ease);
503
508
  }
504
509
  [data-slot="button-label"] > span {
505
510
  display: flex;
@@ -519,7 +524,7 @@
519
524
  }
520
525
  /* An expandable button is the fold in reverse: folded at rest, open on hover or keyboard
521
526
  focus. Touch screens have no hover, so there it stays an icon. */
522
- @media (hover: hover) {
527
+ @media (hover: hover) and (pointer: fine) {
523
528
  [data-slot="button"][data-expandable="label"]:hover > [data-slot="button-label"] {
524
529
  grid-template-columns: 1fr;
525
530
  opacity: 1;
@@ -530,19 +535,18 @@
530
535
  opacity: 1;
531
536
  }
532
537
  /* Hover intent: an expandable button opens once the pointer rests on it (70ms), so passing over
533
- it on the way somewhere does nothing, and stays open a moment after it leaves (140ms), so
534
- the button the pointer is heading for does not move away under it. Keyboard focus and
535
- reduced motion are immediate. */
538
+ it on the way somewhere does nothing, and stays open a moment after it leaves (70ms), so the
539
+ button the pointer is heading for does not move away under it. It unfolds in 1.5 × --duration,
540
+ so the whole of it stays under 300ms. Keyboard focus unfolds it at once (a keyboard action
541
+ never animates), and reduced motion has no delay. */
536
542
  [data-slot="button"][data-expandable] {
537
- --expand-delay: 140ms;
538
- }
539
- @media (hover: hover) {
540
- [data-slot="button"][data-expandable]:hover {
541
- --expand-delay: 70ms;
542
- }
543
+ --expand-delay: 70ms;
544
+ --expand-time: calc(var(--duration) * 1.5);
543
545
  }
544
546
  [data-slot="button"][data-expandable]:focus-visible {
545
547
  --expand-delay: 0s;
548
+ --expand-time: 0s;
549
+ --expand-fade: 0s;
546
550
  }
547
551
  @media (prefers-reduced-motion: reduce) {
548
552
  [data-slot="button"][data-expandable] {
@@ -561,8 +565,8 @@
561
565
  grid-template-columns: 1fr;
562
566
  align-items: center;
563
567
  transition:
564
- grid-template-columns calc(var(--duration) * 2) var(--ease),
565
- opacity var(--duration) var(--ease);
568
+ grid-template-columns var(--expand-time, calc(var(--duration) * 2)) var(--ease),
569
+ opacity var(--expand-fade, var(--duration)) var(--ease);
566
570
  }
567
571
  [data-slot="button-icon"] > span {
568
572
  display: flex;
@@ -580,7 +584,7 @@
580
584
  grid-template-columns: 0fr;
581
585
  opacity: 0;
582
586
  }
583
- @media (hover: hover) {
587
+ @media (hover: hover) and (pointer: fine) {
584
588
  [data-slot="button"][data-expandable="icon"]:hover > [data-slot="button-icon"] {
585
589
  grid-template-columns: 1fr;
586
590
  opacity: 1;
@@ -723,7 +727,7 @@
723
727
  }
724
728
 
725
729
  /* An expandable Button opens to its size's padding and corners on hover or keyboard focus. */
726
- @media (hover: hover) {
730
+ @media (hover: hover) and (pointer: fine) {
727
731
  [data-slot="button"][data-expandable="label"][data-collapsed]:hover {
728
732
  padding-inline: var(--expanded-pad, 1rem);
729
733
  border-radius: var(--radius-button);
@@ -8,10 +8,11 @@
8
8
  */
9
9
  @layer components {
10
10
  [data-slot="chart"] {
11
- /* What follows the pointer — the cursor, the active dot, the tooltip — glides on a softer
12
- ease-out than --ease: that curve covers most of the way in the first frame, so a move
13
- across the chart read as a jump and then a slow settle. 0 under reduced motion. */
14
- --chart-glide: calc(var(--duration) * 1.2) cubic-bezier(0.33, 1, 0.68, 1);
11
+ /* What follows the pointer — the cursor, the active dot, the tooltip — glides on
12
+ --ease-glide, a softer ease-out than --ease: that curve covers most of the way in the first
13
+ frame, so a move across the chart read as a jump and then a slow settle. 0 under reduced
14
+ motion. */
15
+ --chart-glide: calc(var(--duration) * 1.2) var(--ease-glide);
15
16
 
16
17
  /* Axes and ticks */
17
18
  & .recharts-cartesian-axis-tick-value,
@@ -120,7 +121,7 @@
120
121
  /* Tooltip follows the pointer with the cursor (0 under reduced motion). */
121
122
  & .recharts-tooltip-wrapper {
122
123
  transition-duration: calc(var(--duration) * 1.2) !important;
123
- transition-timing-function: cubic-bezier(0.33, 1, 0.68, 1) !important;
124
+ transition-timing-function: var(--ease-glide) !important;
124
125
  z-index: 10;
125
126
  }
126
127
 
@@ -220,3 +221,30 @@ tbody[data-slot="table-sizer"] > tr {
220
221
  > [data-slot="data-table-search"] {
221
222
  min-width: 0;
222
223
  }
224
+
225
+ /*
226
+ * Sortable: the copy under the pointer is lifted as it is picked up — 2% larger, its shadows (a
227
+ * part's shadow-overlay, its material's own) coming in with it — and set down to its size as it
228
+ * lands. Unlayered, so it outranks the copy's own transition utilities: the copy does not slide
229
+ * or recolour, it only lifts. The overlay itself is moved by inline styles, so the lift is its
230
+ * child's. Under reduced motion it is simply lifted.
231
+ */
232
+ [data-slot="sortable-overlay"] * {
233
+ transition:
234
+ scale var(--duration) var(--ease),
235
+ box-shadow var(--duration) var(--ease);
236
+
237
+ @starting-style {
238
+ box-shadow: none;
239
+ }
240
+ }
241
+ [data-slot="sortable-overlay"] > * {
242
+ scale: 1.02;
243
+
244
+ @starting-style {
245
+ scale: 1;
246
+ }
247
+ }
248
+ [data-slot="sortable-overlay"][data-phase="settle"] > * {
249
+ scale: 1;
250
+ }
@@ -3,41 +3,67 @@
3
3
  @layer components {
4
4
  /* ── Skeleton ─────────────────────────────────────────────────────────────
5
5
  * A --control-surface block with one soft highlight sweeping across it every 1.6s.
6
- * The sweep is a 50%-wide gradient image moved from fully left to fully right; it runs
7
- * the other way in RTL. Static under prefers-reduced-motion. */
6
+ * The sweep is a half-wide gradient on ::after, translated from fully left to fully right
7
+ * (transform only: no repaint each frame) on --ease-move; it runs the other way in RTL.
8
+ * Under prefers-reduced-motion nothing travels: the block breathes in opacity instead. */
8
9
 
9
10
  [data-slot="skeleton"] {
11
+ position: relative;
12
+ overflow: hidden;
10
13
  background-color: var(--control-surface);
11
- background-image: linear-gradient(90deg, transparent, var(--control-highlight), transparent);
12
- background-repeat: no-repeat;
13
- background-size: 50% 100%;
14
- background-position: -100% 0;
15
14
  box-shadow: inset 0 0 0 1px var(--control-inner-edge);
16
- animation: ep-skeleton-sweep 1.6s var(--ease) infinite;
15
+
16
+ &::after {
17
+ content: "";
18
+ position: absolute;
19
+ inset-block: 0;
20
+ left: 0;
21
+ width: 50%;
22
+ background-image: linear-gradient(90deg, transparent, var(--control-highlight), transparent);
23
+ translate: -100% 0;
24
+ animation: ep-skeleton-sweep 1.6s var(--ease-move) infinite;
25
+ pointer-events: none;
26
+ }
17
27
 
18
28
  /* Not :dir(rtl), which the CSS build lowers to a list of languages (see the Badge). */
19
- &:where([dir="rtl"], [dir="rtl"] *) {
29
+ &:where([dir="rtl"], [dir="rtl"] *)::after {
20
30
  animation-direction: reverse;
21
31
  }
22
32
  @media (prefers-reduced-motion: reduce) {
23
- animation: none;
24
- background-image: none;
33
+ animation: ep-fade-pulse 1.6s var(--ease-move) infinite alternate;
34
+
35
+ &::after {
36
+ content: none;
37
+ }
25
38
  }
26
39
  }
27
40
 
41
+ /* From fully before the box (-100% of the half-wide highlight) to fully past it (200%), in
42
+ physical left-to-right terms (the highlight sits at the left edge); RTL plays it reversed. */
28
43
  @keyframes ep-skeleton-sweep {
29
44
  from {
30
- background-position: -100% 0;
45
+ translate: -100% 0;
46
+ }
47
+ to {
48
+ translate: 200% 0;
49
+ }
50
+ }
51
+
52
+ /* The reduced-motion stand-in for a sweep or a shimmer: a slow, gentle breath in opacity. */
53
+ @keyframes ep-fade-pulse {
54
+ from {
55
+ opacity: 1;
31
56
  }
32
57
  to {
33
- background-position: 200% 0;
58
+ opacity: 0.55;
34
59
  }
35
60
  }
36
61
 
37
62
  /* ── Spinner ──────────────────────────────────────────────────────────────
38
63
  * Every face is CSS-driven: no JavaScript, identical on the server. Parts animate transform
39
64
  * and opacity only (the arc also animates its dash, on a 24-unit SVG). Each part's resting
40
- * style is its reduced-motion pose, so `animation: none` leaves a meaningful still. */
65
+ * style is its reduced-motion pose, so `animation: none` leaves a meaningful still, which
66
+ * breathes in opacity so it still reads as busy. */
41
67
 
42
68
  [data-slot="spinner"] [data-part] {
43
69
  transform-box: fill-box;
@@ -270,6 +296,10 @@
270
296
  [data-slot="spinner"] [data-slot="spinner-art"] {
271
297
  animation: none;
272
298
  }
299
+ /* Still, but not frozen: a pause would read as a hang. Opacity is not movement. */
300
+ [data-slot="spinner"] {
301
+ animation: ep-fade-pulse 0.8s var(--ease-move) infinite alternate;
302
+ }
273
303
  }
274
304
 
275
305
  /* ── Stepper ──────────────────────────────────────────────────────────────
@@ -51,7 +51,10 @@
51
51
  mask-repeat: no-repeat;
52
52
  }
53
53
 
54
- /* ── Progress: indeterminate sweep (static under reduced motion) ─────────────── */
54
+ /* ── Progress: indeterminate sweep (a slow fade under reduced motion) ────────────
55
+ * The sweep is a move the interface makes on its own, over and over: ease in and out
56
+ * (--ease-move), so it never lands with a jolt at either end. Reduced motion keeps no movement,
57
+ * only the whole track breathing between two strengths, so it still reads as working. */
55
58
 
56
59
  @keyframes ep-progress-indeterminate {
57
60
  from {
@@ -64,14 +67,23 @@
64
67
 
65
68
  [data-slot="progress-indicator"][data-indeterminate] {
66
69
  width: 40%;
67
- animation: ep-progress-indeterminate 1.4s var(--ease) infinite;
70
+ animation: ep-progress-indeterminate 1.4s var(--ease-move) infinite;
71
+ }
72
+
73
+ @keyframes ep-progress-pulse {
74
+ from {
75
+ opacity: 0.2;
76
+ }
77
+ to {
78
+ opacity: 0.5;
79
+ }
68
80
  }
69
81
 
70
82
  @media (prefers-reduced-motion: reduce) {
71
83
  [data-slot="progress-indicator"][data-indeterminate] {
72
- animation: none;
73
84
  width: 100%;
74
85
  opacity: 0.35;
86
+ animation: ep-progress-pulse 1.4s ease-in-out infinite alternate;
75
87
  }
76
88
  }
77
89
 
@@ -262,7 +274,11 @@
262
274
  /* Under the status bar on a page that draws there (viewport-fit=cover, an iPhone home-screen
263
275
  app): the bar keeps its links clear of it, and its ground runs up behind it. */
264
276
  padding-top: env(safe-area-inset-top, 0px);
265
- border-bottom-color: color-mix(in oklab, var(--border) calc(60% * var(--site-header-ground)), transparent);
277
+ border-bottom-color: color-mix(
278
+ in oklab,
279
+ var(--border) calc(60% * var(--site-header-ground)),
280
+ transparent
281
+ );
266
282
  }
267
283
  /* The ground and its grain are one layer, isolated and opaque inside, that fades as a whole:
268
284
  partly in, the bar is a mix of the content behind it and the finished ground, never lighter
@@ -312,7 +328,8 @@
312
328
  animation-timing-function: linear;
313
329
  animation-fill-mode: both;
314
330
  animation-timeline: scroll(root block);
315
- animation-range: var(--site-header-from, 8px) calc(var(--site-header-from, 8px) + var(--site-header-span));
331
+ animation-range: var(--site-header-from, 8px)
332
+ calc(var(--site-header-from, 8px) + var(--site-header-span));
316
333
  }
317
334
  }
318
335
  }
@@ -346,7 +363,9 @@
346
363
  }
347
364
  }
348
365
  @media (width >= 48rem) {
349
- :root:has([data-slot="bottom-nav"][data-position="fixed"]:is([data-breakpoint="sm"], [data-breakpoint="md"])) {
366
+ :root:has(
367
+ [data-slot="bottom-nav"][data-position="fixed"]:is([data-breakpoint="sm"], [data-breakpoint="md"])
368
+ ) {
350
369
  --bottom-nav-h: 0px;
351
370
  }
352
371
  }
@@ -391,9 +410,23 @@
391
410
  [data-slot="bottom-nav-item-tile"] {
392
411
  color: var(--muted-foreground);
393
412
  transition:
394
- color var(--duration) var(--ease),
395
- background-color var(--duration) var(--ease),
396
- box-shadow var(--duration) var(--ease);
413
+ color var(--duration-fade) var(--ease),
414
+ background-color var(--duration-fade) var(--ease-glide),
415
+ box-shadow var(--duration-fade) var(--ease);
416
+ }
417
+ /* No tap delay: the bar is tapped all day. */
418
+ [data-slot="bottom-nav-item"] {
419
+ touch-action: manipulation;
420
+ }
421
+ /* A tap answers on touch-down, as a row does: the full ink on a soft fill, sinking in fast and
422
+ rising back gently. The tap highlight is off, so this is the only press feedback there is. */
423
+ [data-slot="bottom-nav-item"]:not([aria-disabled="true"]):active > [data-slot="bottom-nav-item-tile"] {
424
+ color: var(--foreground);
425
+ background-color: var(--ink-ghost);
426
+ transition:
427
+ color calc(var(--duration-fade) * 0.6) var(--ease),
428
+ background-color calc(var(--duration-fade) * 0.6) var(--ease-glide),
429
+ box-shadow calc(var(--duration-fade) * 0.6) var(--ease);
397
430
  }
398
431
  @media (hover: hover) {
399
432
  [data-slot="bottom-nav-item"]:not([aria-disabled="true"]):hover > [data-slot="bottom-nav-item-tile"] {
@@ -3,8 +3,10 @@
3
3
  /*
4
4
  * Drawer and toast motion. Both follow the pointer while swiping (Base UI writes the movement
5
5
  * into CSS variables), so their transforms compose several variables per side and state, which
6
- * is clearer here than as arbitrary Tailwind values. Larger travel uses 3 × --duration with the
7
- * brand ease; --duration is 0 under prefers-reduced-motion, so all of this collapses to instant.
6
+ * is clearer here than as arbitrary Tailwind values. Larger travel uses 2 × --duration with the
7
+ * brand ease, and closing takes 0.7 of opening (a swipe sets its own pace). --duration is 0 under
8
+ * prefers-reduced-motion, so nothing moves; the block at the end keeps a --duration-fade fade, so
9
+ * they do not pop in and out either.
8
10
  */
9
11
 
10
12
  @layer components {
@@ -18,7 +20,11 @@
18
20
  &[data-ending-style] {
19
21
  opacity: 0;
20
22
  }
23
+ /* A button or Escape closes in 0.7 of the opening; a swipe keeps the pace of the release. */
21
24
  &[data-ending-style] {
25
+ transition-duration: calc(0.7 * var(--duration) * 2);
26
+ }
27
+ &[data-ending-style][data-swipe-dismiss] {
22
28
  transition-duration: calc(var(--drawer-swipe-strength, 1) * var(--duration) * 2);
23
29
  }
24
30
  &[data-swiping] {
@@ -28,9 +34,11 @@
28
34
 
29
35
  [data-slot="drawer-content"] {
30
36
  --drawer-bleed: 3rem;
37
+ /* The padding follows the snap offset at once: animating it would re-lay out the body every
38
+ frame. Only the transform moves. */
31
39
  transition:
32
40
  transform calc(var(--duration) * 2) var(--ease),
33
- padding-bottom calc(var(--duration) * 2) var(--ease);
41
+ padding-bottom 0s;
34
42
 
35
43
  /* Fills the gap behind the panel when it is pulled past its resting edge. */
36
44
  &::after {
@@ -45,7 +53,10 @@
45
53
  user-select: none;
46
54
  }
47
55
  &[data-ending-style] {
48
- transition-duration: calc(var(--drawer-swipe-strength, 1) * var(--duration) * 2);
56
+ transition-duration: calc(0.7 * var(--duration) * 2), 0s;
57
+ }
58
+ &[data-ending-style][data-swipe-dismiss] {
59
+ transition-duration: calc(var(--drawer-swipe-strength, 1) * var(--duration) * 2), 0s;
49
60
  }
50
61
 
51
62
  /*
@@ -133,13 +144,15 @@
133
144
  height: var(--height);
134
145
  z-index: calc(1000 - var(--toast-index));
135
146
  transform-origin: bottom center;
136
- transform: translateX(var(--toast-swipe-movement-x))
147
+ /* Where the toast rests in the stack, named so reduced motion can keep it there. */
148
+ --toast-rest: translateX(var(--toast-swipe-movement-x))
137
149
  translateY(
138
150
  calc(
139
151
  var(--toast-swipe-movement-y) - (var(--toast-index) * var(--peek)) - (var(--shrink) * var(--height))
140
152
  )
141
153
  )
142
154
  scale(var(--scale));
155
+ transform: var(--toast-rest);
143
156
  user-select: none;
144
157
  transition:
145
158
  transform calc(var(--duration) * 2) var(--ease),
@@ -158,7 +171,7 @@
158
171
 
159
172
  &[data-expanded] {
160
173
  height: var(--toast-height);
161
- transform: translateX(var(--toast-swipe-movement-x)) translateY(var(--offset-y));
174
+ --toast-rest: translateX(var(--toast-swipe-movement-x)) translateY(var(--offset-y));
162
175
  }
163
176
  &[data-starting-style] {
164
177
  transform: translateY(150%);
@@ -195,6 +208,80 @@
195
208
  opacity: 1;
196
209
  }
197
210
  }
211
+
212
+ /*
213
+ * Reduced motion: --duration is 0, so nothing travels; drawers and toasts fade in and out where
214
+ * they rest instead of popping, with --duration-fade (kept under reduced motion), leaving in 0.7
215
+ * of it. The resting transform is restated for the starting and ending styles so they do not jump
216
+ * off screen before the fade.
217
+ */
218
+ @media (prefers-reduced-motion: reduce) {
219
+ [data-slot="drawer-backdrop"] {
220
+ transition: opacity var(--duration-fade) var(--ease);
221
+
222
+ &[data-ending-style],
223
+ &[data-ending-style][data-swipe-dismiss] {
224
+ transition-duration: calc(var(--duration-fade) * 0.7);
225
+ }
226
+ &[data-swiping] {
227
+ transition-duration: 0ms;
228
+ }
229
+ }
230
+
231
+ [data-slot="drawer-content"] {
232
+ transition:
233
+ opacity var(--duration-fade) var(--ease),
234
+ transform 0s,
235
+ padding-bottom 0s;
236
+
237
+ &[data-starting-style],
238
+ &[data-ending-style] {
239
+ opacity: 0;
240
+ }
241
+ &[data-ending-style],
242
+ &[data-ending-style][data-swipe-dismiss] {
243
+ transition-duration: calc(var(--duration-fade) * 0.7), 0s, 0s;
244
+ }
245
+ &[data-swiping] {
246
+ transition-duration: 0ms;
247
+ }
248
+ &[data-side="bottom"][data-starting-style],
249
+ &[data-side="bottom"][data-ending-style] {
250
+ transform: translateY(
251
+ calc(var(--drawer-snap-point-offset, 0px) + var(--drawer-swipe-movement-y, 0px))
252
+ );
253
+ }
254
+ &[data-side="right"][data-starting-style],
255
+ &[data-side="right"][data-ending-style],
256
+ &[data-side="left"][data-starting-style],
257
+ &[data-side="left"][data-ending-style] {
258
+ transform: translateX(var(--drawer-swipe-movement-x, 0px));
259
+ }
260
+ }
261
+
262
+ [data-slot="toast"] {
263
+ transition:
264
+ opacity var(--duration-fade) var(--ease),
265
+ transform 0s,
266
+ height 0s;
267
+
268
+ &[data-starting-style] {
269
+ opacity: 0;
270
+ }
271
+ /* !important: the swipe-direction exits above are more specific than any plain override. */
272
+ &[data-starting-style],
273
+ &[data-ending-style] {
274
+ transform: var(--toast-rest) !important;
275
+ }
276
+ &[data-ending-style] {
277
+ transition-duration: calc(var(--duration-fade) * 0.7), 0s, 0s;
278
+ }
279
+ }
280
+
281
+ [data-slot="toast-content"] {
282
+ transition-duration: var(--duration-fade);
283
+ }
284
+ }
198
285
  }
199
286
 
200
287
  /*