@signal9/era-ui 32.0.0 → 33.0.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 (145) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/dev/audit-overlay.svelte +2 -2
  3. package/dist/era-ui.css +1 -1
  4. package/dist/generated-docs/utilities.json +99 -99
  5. package/dist/os/pane.svelte +3 -13
  6. package/dist/styles/index.css +2 -956
  7. package/dist/styles/typography.css +1 -1
  8. package/dist/styles/utilities/geometry.css +188 -0
  9. package/dist/styles/utilities/interaction.css +334 -0
  10. package/dist/styles/utilities/materials.css +39 -0
  11. package/dist/styles/utilities/public.css +391 -0
  12. package/dist/styles/utilities.css +5 -0
  13. package/dist/ui/card/card.svelte +2 -52
  14. package/dist/ui/card/card.svelte.d.ts +0 -43
  15. package/dist/ui/card/variants.d.ts +44 -0
  16. package/dist/ui/card/variants.js +20 -0
  17. package/dist/ui/context-menu/context-menu-checkbox-item.svelte +2 -4
  18. package/dist/ui/context-menu/context-menu-group-heading.svelte +2 -5
  19. package/dist/ui/context-menu/context-menu-item.svelte +2 -8
  20. package/dist/ui/context-menu/context-menu-radio-item.svelte +2 -8
  21. package/dist/ui/context-menu/context-menu-separator.svelte +2 -5
  22. package/dist/ui/context-menu/context-menu-sub-trigger.svelte +2 -8
  23. package/dist/ui/dialog/dialog-header.svelte +1 -1
  24. package/dist/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +2 -4
  25. package/dist/ui/dropdown-menu/dropdown-menu-group-heading.svelte +2 -5
  26. package/dist/ui/dropdown-menu/dropdown-menu-item.svelte +2 -8
  27. package/dist/ui/dropdown-menu/dropdown-menu-radio-item.svelte +2 -8
  28. package/dist/ui/dropdown-menu/dropdown-menu-separator.svelte +2 -5
  29. package/dist/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +2 -8
  30. package/dist/ui/menu-recipes.d.ts +6 -0
  31. package/dist/ui/menu-recipes.js +6 -0
  32. package/dist/ui/menubar/menubar-checkbox-item.svelte +2 -9
  33. package/dist/ui/menubar/menubar-group-heading.svelte +2 -5
  34. package/dist/ui/menubar/menubar-item.svelte +2 -8
  35. package/dist/ui/menubar/menubar-radio-item.svelte +2 -8
  36. package/dist/ui/menubar/menubar-separator.svelte +2 -5
  37. package/dist/ui/menubar/menubar-sub-trigger.svelte +2 -8
  38. package/dist/ui/pane/pane-close.svelte +7 -26
  39. package/dist/ui/video-player/video-player.svelte +8 -8
  40. package/package.json +48 -12
  41. package/dist/docs/badge.md +0 -18
  42. package/dist/docs/bits-ui-audit.md +0 -58
  43. package/dist/docs/button.md +0 -19
  44. package/dist/docs/chip.md +0 -20
  45. package/dist/docs/component-docs-core.d.ts +0 -8
  46. package/dist/docs/component-docs-core.js +0 -73
  47. package/dist/docs/component-docs.d.ts +0 -2
  48. package/dist/docs/component-docs.js +0 -25
  49. package/dist/docs/component-source-scanners.d.ts +0 -18
  50. package/dist/docs/component-source-scanners.js +0 -46
  51. package/dist/docs/consumer-import.d.ts +0 -65
  52. package/dist/docs/consumer-import.js +0 -70
  53. package/dist/docs/css-utilities.d.ts +0 -58
  54. package/dist/docs/css-utilities.js +0 -317
  55. package/dist/docs/extract-props.d.ts +0 -13
  56. package/dist/docs/extract-props.js +0 -324
  57. package/dist/docs/generated-docs.d.ts +0 -6
  58. package/dist/docs/generated-docs.js +0 -30
  59. package/dist/docs/index.d.ts +0 -5
  60. package/dist/docs/index.js +0 -66
  61. package/dist/docs/notes.md +0 -83
  62. package/dist/docs/scroll-area.md +0 -7
  63. package/dist/docs/separator.md +0 -20
  64. package/dist/docs/table.md +0 -35
  65. package/dist/docs/utilities.d.ts +0 -4
  66. package/dist/docs/utilities.js +0 -15
  67. package/dist/generated-docs/accordion.md +0 -57
  68. package/dist/generated-docs/alert-dialog.md +0 -91
  69. package/dist/generated-docs/aspect-ratio.md +0 -17
  70. package/dist/generated-docs/avatar.md +0 -39
  71. package/dist/generated-docs/badge.md +0 -41
  72. package/dist/generated-docs/bar.md +0 -41
  73. package/dist/generated-docs/button-group.md +0 -19
  74. package/dist/generated-docs/button.md +0 -117
  75. package/dist/generated-docs/calendar.md +0 -126
  76. package/dist/generated-docs/card.md +0 -58
  77. package/dist/generated-docs/checkbox.md +0 -42
  78. package/dist/generated-docs/chip.md +0 -61
  79. package/dist/generated-docs/code-block.md +0 -20
  80. package/dist/generated-docs/collapsible.md +0 -30
  81. package/dist/generated-docs/combobox.md +0 -74
  82. package/dist/generated-docs/command-bar.md +0 -3
  83. package/dist/generated-docs/command.md +0 -126
  84. package/dist/generated-docs/context-menu.md +0 -104
  85. package/dist/generated-docs/copy-button.md +0 -29
  86. package/dist/generated-docs/cycle.md +0 -29
  87. package/dist/generated-docs/date-field.md +0 -49
  88. package/dist/generated-docs/date-picker.md +0 -180
  89. package/dist/generated-docs/date-range-field.md +0 -50
  90. package/dist/generated-docs/date-range-picker.md +0 -180
  91. package/dist/generated-docs/dialog.md +0 -94
  92. package/dist/generated-docs/draggable.md +0 -3
  93. package/dist/generated-docs/dropdown-menu.md +0 -104
  94. package/dist/generated-docs/file-upload.md +0 -18
  95. package/dist/generated-docs/getting-started.md +0 -3
  96. package/dist/generated-docs/input.md +0 -23
  97. package/dist/generated-docs/kv.md +0 -20
  98. package/dist/generated-docs/label.md +0 -17
  99. package/dist/generated-docs/link-preview.md +0 -40
  100. package/dist/generated-docs/llm-shell.md +0 -3
  101. package/dist/generated-docs/llms-full.txt +0 -5201
  102. package/dist/generated-docs/llms.txt +0 -138
  103. package/dist/generated-docs/logo.md +0 -24
  104. package/dist/generated-docs/manifest.json +0 -1685
  105. package/dist/generated-docs/measurements.md +0 -3
  106. package/dist/generated-docs/menu.md +0 -11
  107. package/dist/generated-docs/menubar.md +0 -104
  108. package/dist/generated-docs/meter.md +0 -101
  109. package/dist/generated-docs/mode.md +0 -24
  110. package/dist/generated-docs/nav.md +0 -73
  111. package/dist/generated-docs/navigation-menu.md +0 -11
  112. package/dist/generated-docs/notes.md +0 -87
  113. package/dist/generated-docs/os.md +0 -3
  114. package/dist/generated-docs/pagination.md +0 -55
  115. package/dist/generated-docs/pane.md +0 -34
  116. package/dist/generated-docs/pin-input.md +0 -31
  117. package/dist/generated-docs/popover.md +0 -43
  118. package/dist/generated-docs/progress.md +0 -17
  119. package/dist/generated-docs/radio-group.md +0 -31
  120. package/dist/generated-docs/range-calendar.md +0 -11
  121. package/dist/generated-docs/rating-group.md +0 -31
  122. package/dist/generated-docs/scroll-area.md +0 -65
  123. package/dist/generated-docs/select.md +0 -67
  124. package/dist/generated-docs/separator.md +0 -57
  125. package/dist/generated-docs/sheet.md +0 -11
  126. package/dist/generated-docs/skeleton.md +0 -18
  127. package/dist/generated-docs/slider.md +0 -71
  128. package/dist/generated-docs/spacing.md +0 -3
  129. package/dist/generated-docs/step.md +0 -51
  130. package/dist/generated-docs/surfaces.md +0 -3
  131. package/dist/generated-docs/switch.md +0 -18
  132. package/dist/generated-docs/table.md +0 -113
  133. package/dist/generated-docs/tabs.md +0 -48
  134. package/dist/generated-docs/text.md +0 -3
  135. package/dist/generated-docs/time-field.md +0 -49
  136. package/dist/generated-docs/time-range-field.md +0 -50
  137. package/dist/generated-docs/timeline.md +0 -32
  138. package/dist/generated-docs/todo.md +0 -3
  139. package/dist/generated-docs/toggle-group.md +0 -31
  140. package/dist/generated-docs/toggle.md +0 -20
  141. package/dist/generated-docs/toolbar.md +0 -11
  142. package/dist/generated-docs/tooltip.md +0 -40
  143. package/dist/generated-docs/tree.md +0 -36
  144. package/dist/generated-docs/utilities.md +0 -1236
  145. package/dist/generated-docs/video-player.md +0 -73
@@ -71,7 +71,7 @@
71
71
  * is read where --era-font-stack is declared, which is the [data-font] element.
72
72
  * Re-point a stack AT or ABOVE the element that carries the axis. Setting
73
73
  * --era-font-mono on a descendant of it does nothing — the pointer was already
74
- * resolved higher up. (That is why /audit re-asserts the shipped stacks on
74
+ * resolved higher up. (That is why the private audit harness re-asserts the shipped stacks on
75
75
  * :root rather than on its own <main>.)
76
76
  */
77
77
  [data-font='mono'] {
@@ -0,0 +1,188 @@
1
+ /* BOUNDED GEOMETRY — height and radius are one decision.
2
+ *
3
+ * A tier is a geometric type, not two classes a caller must remember to keep in
4
+ * sync. `tier-control` establishes h-control AND rd-control; the radius ladder
5
+ * then guarantees rd_outer − rd_inner = (h_outer − h_inner)/2 for every pair.
6
+ * Width remains the component's decision: a row stretches, a button adds
7
+ * min-w-control, and a square control adds w-control. */
8
+ @utility tier-icon {
9
+ height: var(--era-h-icon);
10
+ border-radius: var(--era-rd-icon);
11
+ }
12
+
13
+ @utility tier-pill {
14
+ height: var(--era-h-pill);
15
+ border-radius: var(--era-rd-pill);
16
+ }
17
+
18
+ @utility tier-chip {
19
+ height: var(--era-h-chip);
20
+ border-radius: var(--era-rd-chip);
21
+ }
22
+
23
+ @utility tier-control {
24
+ height: var(--era-h-control);
25
+ border-radius: var(--era-rd-control);
26
+ }
27
+
28
+ @utility tier-bar {
29
+ height: var(--era-h-bar);
30
+ border-radius: var(--era-rd-bar);
31
+ }
32
+
33
+ /* One LINE BOX tall — the height of the text this stands in for.
34
+ *
35
+ * Skeleton's `line` used h-(--era-text), which is the body FONT SIZE: never the
36
+ * height of a rendered line (that is font-size x leading), and wrong again by
37
+ * the ladder's ratio for any rung other than body. `1lh` resolves against the
38
+ * element's OWN computed line-height, so putting a text-* class on the skeleton
39
+ * makes it match that tier exactly, at every density, and it follows a leading
40
+ * change for free.
41
+ *
42
+ * @use the height of one line of the element's own text — a skeleton standing in
43
+ * for a line, a spacer that must match a line box. */
44
+ @utility h-line {
45
+ height: 1lh;
46
+ }
47
+
48
+ /* A WELL THAT SURVIVES BEING FILLED.
49
+ *
50
+ * `shadow-well` is an INSET shadow, and an inset shadow belongs to the
51
+ * element's background layer — it paints under the element's own descendants.
52
+ * That is invisible on a well holding text (a checkbox, a code block: the
53
+ * chrome runs around the content) and wrong the moment something paints the
54
+ * whole box. Meter, Progress and the Slider track all do exactly that: an
55
+ * opaque child, `translateX`-ed to the value. So the well survived only where
56
+ * the track was EMPTY — a half-full meter on bevel had a chisel to the right
57
+ * of the value and none to the left, which reads as a hole with a sticker
58
+ * over it rather than a level inside a well.
59
+ *
60
+ * The fix is painting order, not geometry: the same `--era-shadow-well` on a
61
+ * pseudo-element that is the element's LAST child, so it lands above the fill.
62
+ * The fill still spans the full box — nothing is inset, no radius is
63
+ * re-derived, and 0% and 100% keep their exact ends. The `position: relative`
64
+ * is load-bearing (the overlay resolves against this box) and `inherit` on the
65
+ * radius keeps it honest under `data-corners="square"`.
66
+ *
67
+ * Surface-agnostic on purpose. It reads the same token every well reads, so
68
+ * glass's hairline rim is restored by the same line that restores bevel's
69
+ * chisel, and flat — where the token is `none` — renders exactly as before.
70
+ * Reported against bevel by a consumer; it was never a bevel bug.
71
+ *
72
+ * @use instead of `shadow-well` on a track whose value is painted by a child
73
+ * that covers the box — a progress/meter/slider track, a custom gauge. For a
74
+ * well holding ordinary content, `shadow-well` is still right. */
75
+ @utility era-track-well {
76
+ position: relative;
77
+ &::after {
78
+ content: '';
79
+ position: absolute;
80
+ inset: 0;
81
+ border-radius: inherit;
82
+ box-shadow: var(--era-shadow-well);
83
+ pointer-events: none;
84
+ }
85
+ }
86
+
87
+ /* Skeleton's pulse, on the MOTION AXIS.
88
+ *
89
+ * It used to be a literal `2s ease-in-out` on the component, so it neither died
90
+ * at data-motion="instant" nor honoured prefers-reduced-motion — on the one
91
+ * component most likely to be on screen in bulk, and animating. That is an
92
+ * accessibility defect rather than a preference: a page of pulsing blocks is
93
+ * exactly what someone with a vestibular disorder turns motion off to avoid.
94
+ *
95
+ * Same derivation as era-shimmer: 10x the axis duration, so it is a slow pulse
96
+ * at normal, slower at extra, and at instant the duration resolves to 0s and it
97
+ * freezes on its base frame — full opacity, a plain filled block. */
98
+ @utility era-skeleton-pulse {
99
+ animation: era-skeleton-pulse calc(var(--era-duration) * 10) var(--era-ease) infinite;
100
+ }
101
+
102
+ @keyframes era-skeleton-pulse {
103
+ 0%,
104
+ 100% {
105
+ opacity: 1;
106
+ }
107
+ 50% {
108
+ opacity: 0.4;
109
+ }
110
+ }
111
+
112
+ /* In-progress text shimmer — a bright sweep through muted text (the standard
113
+ * "working…" label treatment in streaming UIs). Timing derives from the motion
114
+ * axis (10× --era-duration ≈ 1.5s at normal, 2.6s at extra); at instant the
115
+ * duration is 0s and the sweep freezes on its base frame — plain muted text —
116
+ * so reduced-motion and data-motion="instant" both kill it for free.
117
+ *
118
+ * @use the in-progress text treatment — put it on a "working…" / "thinking…"
119
+ * label while a task streams, instead of a spinner beside the text. */
120
+ @utility era-shimmer {
121
+ background: linear-gradient(
122
+ 110deg,
123
+ var(--color-muted) 0% 43%,
124
+ var(--color-bright) 50%,
125
+ var(--color-muted) 57% 100%
126
+ );
127
+ background-size: 200% 100%;
128
+ background-clip: text;
129
+ -webkit-text-fill-color: transparent;
130
+ animation: era-shimmer calc(var(--era-duration) * 10) cubic-bezier(0.7, 0, 1, 0.4) infinite;
131
+ }
132
+ @keyframes era-shimmer {
133
+ 0% {
134
+ background-position: 100% 0;
135
+ }
136
+ 100% {
137
+ background-position: -100% 0;
138
+ }
139
+ }
140
+
141
+ /* The open/close animation for a bits-ui Collapsible.Content — the height
142
+ * sweep every disclosure in the library uses (a Step's body, an error panel's
143
+ * detail, a swarm node's children).
144
+ *
145
+ * It has to be a keyframe animation rather than a transition because the
146
+ * natural height is only knowable at open time: bits measures the content and
147
+ * publishes `--bits-collapsible-content-height`, which the `to` frame reads.
148
+ * The class also owns `overflow: hidden` — animating height without it just
149
+ * spills the content out of the shrinking box.
150
+ *
151
+ * Timing rides the motion axis, so `instant` collapses it to a cut (0s) and
152
+ * `extra` stretches it, for free. Two components carried a byte-identical copy of
153
+ * these keyframes under two different names before this existed (a Step's body
154
+ * and the error panel's detail), and the swarm tree would have made a third; the
155
+ * panel that needs different motion should override `animation`, not re-declare
156
+ * it.
157
+ *
158
+ * @use the height sweep for a bits-ui Collapsible.Content — put it on the
159
+ * Content element itself (it carries its own overflow: hidden). */
160
+ @utility era-collapse {
161
+ overflow: hidden;
162
+ &[data-state='open'] {
163
+ animation: era-collapse-open var(--era-duration) var(--era-ease);
164
+ }
165
+ &[data-state='closed'] {
166
+ animation: era-collapse-close var(--era-duration) var(--era-ease);
167
+ }
168
+ }
169
+ @keyframes era-collapse-open {
170
+ from {
171
+ height: 0;
172
+ opacity: 0;
173
+ }
174
+ to {
175
+ height: var(--bits-collapsible-content-height);
176
+ opacity: 1;
177
+ }
178
+ }
179
+ @keyframes era-collapse-close {
180
+ from {
181
+ height: var(--bits-collapsible-content-height);
182
+ opacity: 1;
183
+ }
184
+ to {
185
+ height: 0;
186
+ opacity: 0;
187
+ }
188
+ }
@@ -0,0 +1,334 @@
1
+ /* Shared interactive-state recipe: quiet focus, disabled affordance.
2
+ * Equivalent to `focus:outline-none disabled:cursor-not-allowed disabled:opacity-50`.
3
+ *
4
+ * @use the focus/disabled recipe every era control carries — put it on a custom
5
+ * interactive element instead of hand-writing focus/disabled variants. */
6
+ @utility era-interactive {
7
+ &:focus {
8
+ outline: none;
9
+ }
10
+ &:disabled {
11
+ cursor: not-allowed;
12
+ opacity: 0.5;
13
+ }
14
+ }
15
+
16
+ /* Inline text link. An understated, permanent underline that darkens from
17
+ * muted to the text colour on hover — no layout shift, no appearing/vanishing
18
+ * underline. The colour fade rides the MOTION axis (--era-duration/-ease), so
19
+ * it snaps at data-motion="instant", eases at "normal", and sweeps longer at
20
+ * "extra" — matching every other era transition. Font-agnostic: it styles
21
+ * decoration + colour only, so it reads correctly in mono, sans, or serif, and
22
+ * the 0.2em offset scales with the type size. Keyboard focus mirrors hover so
23
+ * the affordance is reachable without a pointer.
24
+ *
25
+ * @use understated, motion-aware inline text link — the canonical style for a
26
+ * link in body copy or prose; prefer it over a hand-rolled underline or
27
+ * `Button variant="link"` (which is a control, not running text). */
28
+ @utility era-link {
29
+ /* The text is bright at rest and never changes — the link reads as a link
30
+ * before you touch it. Only the UNDERLINE reacts: a faint hint at rest —
31
+ * the link's own ink knocked back to 30% so it barely whispers — that
32
+ * resolves to the full ink on hover.
33
+ *
34
+ * currentColor, not --color-muted/--color-fg: the underline belongs to the
35
+ * TEXT it underlines. On themes whose link ink is a colour (signalnine's
36
+ * navy, an accent-tinted bright), the neutral tokens drew a whitish line
37
+ * under coloured text — a second hue where there should be one. Derived
38
+ * from currentColor, the underline tracks whatever the link resolves to,
39
+ * in every theme, including a caller overriding `color` locally. */
40
+ color: var(--color-link);
41
+ text-decoration-line: underline;
42
+ text-decoration-color: color-mix(in oklch, currentColor 30%, transparent);
43
+ text-underline-offset: 0.2em;
44
+ transition: text-decoration-color var(--era-duration) var(--era-ease);
45
+ &:hover,
46
+ &:focus-visible {
47
+ text-decoration-color: currentColor;
48
+ }
49
+ }
50
+
51
+ /* Scrollable but chromeless — hides the scrollbar while keeping wheel / touch /
52
+ * drag scrolling (e.g. an overflowing tab strip in a small pane handle).
53
+ *
54
+ * @use hide the scrollbar on an overflowing strip or rail while keeping it
55
+ * scrollable — for a scroll region that should show its bar, use ScrollArea. */
56
+ @utility scrollbar-none {
57
+ scrollbar-width: none;
58
+ &::-webkit-scrollbar {
59
+ display: none;
60
+ }
61
+ }
62
+
63
+ /* Font-agnostic vertical ink-centering for single-line control text.
64
+ * Measured verdict (4 fonts x 2 dpr, ink from device-pixel screenshots):
65
+ * the offset has TWO causes — a fractional line box (14px x 1.5lh = 21px in
66
+ * a 24px row places ink on a half pixel, ~1px error) and font ascent/descent
67
+ * asymmetry (+-1px, sign flips per font). line-height: 1 fixes the first and
68
+ * is the Firefox fallback; text-box ex/alphabetic fixes the second by
69
+ * centering the x-height band — the visual mass of MIXED-CASE text (caps and
70
+ * descenders cancel above/below). cap alphabetic is the spec-example recipe
71
+ * but is descender-blind (reads high; CSSWG #9148) — measured 4x worse here.
72
+ * Where text-box is supported it fully determines the box, so the two
73
+ * declarations never fight. Worst-case residual: 0.44px (measured at 14px; the
74
+ * mechanism is font-relative, so dense's 12px inherits the same guarantee with
75
+ * a proportionally smaller residual).
76
+ *
77
+ * The hard rules concern overflow clipping, and there are TWO of them.
78
+ *
79
+ * 1. NEVER on a NATIVE EDITABLE — <input>, <textarea>, <select>. These clip to
80
+ * a UA-owned inner editor box that IS the trimmed line box, so a fixed
81
+ * height does NOT hold it open: whatever you type gets its ascenders and
82
+ * descenders sliced off (a "d" renders as an "o"). This rule used to read
83
+ * the other way round — it claimed a fixed-height <input> was the trim's
84
+ * intended home — and the Input component shipped chopped text as a result.
85
+ * A tier-height input centres its own text; it needs no trim.
86
+ *
87
+ * 2. NEVER on an AUTO-height element that clips — a `truncate` child, an
88
+ * auto-height box with overflow-hidden. With no height to hold it open the
89
+ * box collapses to the x-height band (~7.5px at 14px) and the clip chops the
90
+ * glyphs into a middle stripe. Put the trim on the fixed-height ROW instead
91
+ * and let the child centre via the row's items-center.
92
+ *
93
+ * A fixed-height NON-editable element is the safe home: the ink overflows the
94
+ * trimmed LINE box but stays inside the padding box, which is what actually
95
+ * clips. Both rules are enforced at runtime by typography/collapsed-text-trim.
96
+ *
97
+ * @use vertically center single-line control text (a label beside an icon, a
98
+ * button's own text) without a translateY nudge. Fixed-height, non-editable
99
+ * elements ONLY: never on an <input>/<textarea>, and never on the same element
100
+ * as `truncate` or any overflow clip — put it on the fixed-height ROW and let
101
+ * the truncating child centre inside it. See era-text-trim-caps for ALL-CAPS.
102
+ */
103
+ @utility era-text-trim {
104
+ line-height: 1;
105
+ text-box: trim-both ex alphabetic;
106
+ }
107
+
108
+ /* Tailwind's `truncate`, with the vertical clip fixed at the source.
109
+ *
110
+ * truncate is overflow:hidden, and overflow clips in BOTH axes — so whatever
111
+ * line box the element ends up with is also its ink clip. Era rows put
112
+ * era-text-trim on the fixed-height row (a Bar, a list row), and its
113
+ * `line-height: 1` INHERITS into the truncating child, which then has no fixed
114
+ * height of its own: the child's box collapses to 1em while the font's real ink
115
+ * extent is ~1.15-1.2em, and the descenders (the "g" hook, the "y" tail) get
116
+ * sliced off at the box edge. Same bug on any `leading-none` + `truncate` pair.
117
+ *
118
+ * The fix belongs here rather than at each call site: a horizontally-truncating
119
+ * element must never be the thing that clips vertically. `line-height: normal`
120
+ * restores the font's own ascent+descent box — exactly the ink extent — and
121
+ * `text-box: normal` cancels a trim if one is set alongside. Rows stay the same
122
+ * height (they are tier-fixed and centre the child), and the child now has room
123
+ * for its own glyphs.
124
+ *
125
+ * @use single-line horizontal truncation with an ellipsis — put it on the
126
+ * truncating CHILD inside a trimmed or leading-none row, never on the same
127
+ * element as era-text-trim; it will not clip ascenders or descenders. */
128
+ @utility truncate {
129
+ overflow: hidden;
130
+ text-overflow: ellipsis;
131
+ white-space: nowrap;
132
+ line-height: normal;
133
+ text-box: normal;
134
+ }
135
+
136
+ /* THE COLLISION GUARD — `truncate` and `era-text-trim` on the SAME element.
137
+ *
138
+ * Two utilities, same specificity, opposite intents: the trim collapses the box
139
+ * to the x-height band, and truncate clips to whatever box it lands on. Class
140
+ * ORDER in the attribute cannot break the tie — CSS resolves same-specificity
141
+ * conflicts by stylesheet order, and Tailwind emits era-text-trim last, so the
142
+ * trim silently won and the clip chopped the glyphs into a middle stripe
143
+ * (measured: an 8.58px box holding 16px of ink). Writing the classes the other
144
+ * way round changed nothing, which is what made it so hard to see.
145
+ *
146
+ * A real consumer hit exactly this. So the pairing is now DEFINED rather than
147
+ * accidental, with a compound selector that outranks both single-class
148
+ * utilities: truncate wins the vertical, the glyphs stay whole, and the
149
+ * element centres the way the docs say it should anyway — via its
150
+ * fixed-height parent's items-center.
151
+ *
152
+ * This is a safety net, not a blessing: the correct authoring is still trim on
153
+ * the ROW, truncate on the CHILD (typography/collapsed-text-trim still reports
154
+ * the pair so the runtime audit can point at it). It exists so the failure mode
155
+ * is a no-op instead of unreadable text. */
156
+ .era-text-trim.truncate,
157
+ .era-text-trim-caps.truncate,
158
+ .era-label-ink.truncate,
159
+ .era-token-ink.truncate {
160
+ line-height: normal;
161
+ text-box: normal;
162
+ }
163
+
164
+ /* ALL-CAPS single-line text (kbd hints, acronym badges): the x-height band
165
+ * misjudges caps-only strings — cap/alphabetic edges are the right box.
166
+ *
167
+ * @use the era-text-trim variant for ALL-CAPS single-line strings (kbd hints,
168
+ * acronym badges) — never for mixed-case text (a label like "System" reads
169
+ * high; use era-text-trim), and never on the same element as `truncate`. */
170
+ @utility era-text-trim-caps {
171
+ line-height: 1;
172
+ text-box: trim-both cap alphabetic;
173
+ }
174
+
175
+ /* The EDITABLE counterpart of era-text-trim — for native <input>s, which the
176
+ * trim is forbidden on (it collapses the UA's inner editor box and slices the
177
+ * glyphs; see typography/collapsed-text-trim).
178
+ *
179
+ * Without help, a tier-height input centres its text by FONT BOX, and the ui
180
+ * stacks' font box is deeply asymmetric: ascent ≈1.07em against descent
181
+ * ≈0.29em. Centring that box parks the visible band (caps, x-height) ~0.115em
182
+ * LOW — so a field's text sat visibly below the trimmed label beside it.
183
+ *
184
+ * The value is OPTICAL, not the derivation's: pure x-band centring computes
185
+ * to ~0.23em of padding, but pixel-measured against real Title-Case text it
186
+ * over-lifts — the eye weighs the cap-to-baseline mass, which x-band
187
+ * centring parks ~2px high (caps 2.75px off the top against 5.7px of air
188
+ * under the baseline, measured at dense; the general form of that offset,
189
+ * and why era-label-ink's note about "System" is not a contradiction of it,
190
+ * is derived at era-label-ink below). 0.08em splits the difference
191
+ * between the x-band ideal and the cap-band ideal, landing caps ~3.7px in an
192
+ * 18px field with ~4.7px under the baseline — the reading where neither
193
+ * band's partisans win and neither complains.
194
+ *
195
+ * The lift is padding, not a translateY: an icon-less Input paints the field
196
+ * chrome itself, and a transform would drag the field along with the ink.
197
+ * padding-bottom shrinks the content box from below, and a single-line input
198
+ * re-centres its line box in what remains — the ink rises by exactly half the
199
+ * padding, the chrome doesn't move, and the caret and selection follow the
200
+ * text. In em on purpose: the correction is a fraction of the type, so it
201
+ * holds across every density and text size with one value.
202
+ *
203
+ * WHEN SOMEONE REPORTS A CORRECTLY-CENTRED FIELD AS "TOO HIGH", check the
204
+ * STRING before the geometry. A placeholder like "Filter…" has no descender and
205
+ * no cap, so its ink occupies only the x-height band — and a box that centres
206
+ * that band exactly still reads high, because the eye centres on the mass it
207
+ * can see and expects the space a descender would have filled. Measured at the
208
+ * pill tier on the shipped mono stack, "Filter…" sits within half a pixel of
209
+ * centre while looking a little high; the pill suite documents the same effect
210
+ * from the other side (see OFF_BAND_LOW in ink-centering.spec.ts, where "soon"
211
+ * cannot be symmetric and is bounded by sign instead of magnitude).
212
+ *
213
+ * That is not a licence to ignore the report — era-ink-center IS wrong by
214
+ * 1.5–2px on the sans and serif stacks (pinned in FIELD_KNOWN_SKEW) — only a
215
+ * reason to measure the ink before touching the constant.
216
+ *
217
+ * @use on a native single-line <input> (or the text layer that must mirror
218
+ * one) inside a fixed-height field — never alongside era-text-trim. */
219
+ @utility era-ink-center {
220
+ padding-bottom: 0.08em;
221
+ }
222
+
223
+ /* TOKEN INK — the ink centring for a pill whose content is a TOKEN: an id, a
224
+ * count, a status, a tag. Font-independent, unlike everything it replaces.
225
+ *
226
+ * THE BUG IT FIXES, which had been shipping library-wide and invisibly:
227
+ * `text-box-trim` DOES NOTHING ON A FLEX CONTAINER. Era's controls are all
228
+ * flex, and a flex container's bare text becomes an ANONYMOUS flex item — a box
229
+ * no selector can reach and no non-inherited property can touch. So
230
+ * `era-text-trim` on a Badge, a Chip, a Button or a Bar contributed exactly one
231
+ * thing: `line-height: 1`. The ink was then centred by `align-items: center`
232
+ * on the LINE BOX, which is precisely the font-metric-dependent centring the
233
+ * trim exists to eliminate. Measured on the shipped mono stack: a badge reading
234
+ * "AC-2.1" sat 2px high in an 18px pill, and no amount of tuning the trim's
235
+ * BAND changed it, because the trim was never running.
236
+ *
237
+ * The mechanism here restores it: a BLOCK box (where text-box-trim does apply)
238
+ * whose trimmed line box is then centred by `align-content` — block-container
239
+ * alignment, so no flex formatting context and no anonymous item. The browser
240
+ * computes the band from the font's own metrics, which is what makes it hold
241
+ * across ui-monospace, system-ui and ui-serif instead of needing a constant
242
+ * per stack.
243
+ *
244
+ * CAP band, not the x-height band the general trim uses, because the content
245
+ * class is different: a token is caps and digits (both cap-height), and
246
+ * centring the x-band parks them high by (cap − x)/2. Measured on the shipped
247
+ * stacks, cap-band centring takes an id/count/status from −2.0px to 0.0.
248
+ * Prose and sentence-case labels keep era-text-trim; this is for tokens.
249
+ *
250
+ * @use the ink centring for a token pill — a badge, a KV value, any short
251
+ * caps-or-digits label in a fixed-height box, CENTRED horizontally and with no
252
+ * icon sibling. For a left-aligned sentence-case label use era-label-ink; when
253
+ * an icon really must sit beside the text, see the note there. */
254
+ @utility era-token-ink {
255
+ display: block;
256
+ align-content: center;
257
+ text-align: center;
258
+ line-height: 1;
259
+ text-box: trim-both cap alphabetic;
260
+ }
261
+
262
+ /* LABEL INK — era-token-ink's mixed-case sibling, and the general answer to
263
+ * "this fixed-height control holds one line of text".
264
+ *
265
+ * Same mechanism, same reason: `text-box-trim` needs a BLOCK box, so the row
266
+ * becomes one and `align-content` (block-container alignment) does the
267
+ * centring. What differs is the band and the alignment, because the content
268
+ * class differs — a label is sentence case, so the x-height band is the visual
269
+ * mass to centre (cap-band reads low on "System"), and it is laid out against
270
+ * the row's padding rather than centred in it.
271
+ *
272
+ * THAT PARENTHESIS AND era-ink-center's "x-band centring parks ~2px high" READ
273
+ * AS A CONTRADICTION AND ARE NOT. Both are true, of their own example string,
274
+ * and each was generalised one step too far. Under an ex band the ink offset is
275
+ *
276
+ * (xh − ascent + descent) / 2
277
+ *
278
+ * which predicts a controlled A/B — one real button, one class set, only the
279
+ * STRING changing — within 0.3px:
280
+ *
281
+ * Save asc 9 desc 0 1.28px high SAVE asc 9 desc 0 1.28px high
282
+ * Savg asc 9 desc 3 0.22px low savg asc 7 desc 3 1.22px low
283
+ *
284
+ * "System" has a descender and reads low under the cap band; "Save" has none
285
+ * and reads high under the ex band. Case is not the variable — "Save" and
286
+ * "SAVE" are identical to the hundredth of a pixel. No fixed band centres both
287
+ * a descender-less and a descender-bearing label, because they differ by ~1.5px
288
+ * in the same box.
289
+ *
290
+ * WHICH IS WHY THE BAND IS FIXED ANYWAY, and this is the part that decides it.
291
+ * A band gives every label the SAME baseline whatever it spells — measured
292
+ * spread across Save/Savg/save/savg/SAVE/PDF/Cancel/"Copy page" is 0.00px —
293
+ * while ink-extent centring would move each label independently and leave a bar
294
+ * of buttons visibly ragged. A uniform offset the eye cannot see beats a local
295
+ * misalignment it can. So the offset is accepted, not corrected, and the only
296
+ * escape is per-label and opt-in (Button's `caps`), which buys optical centring
297
+ * for a lone label at the cost of ~1.06px against its neighbours.
298
+ *
299
+ * AND THE GUARANTEE SPANS BOTH INK PATHS. This utility and era-text-trim are
300
+ * two mechanisms — block+align-content here, a blockified flex item there — and
301
+ * every measurement above was taken on the trim path. Measured since: the
302
+ * text-only path holds the same 0.00px spread AND lands on the same baseline,
303
+ * 15.22px from the button top at control tier. So an icon button and a text
304
+ * button put their labels on one line, and `not-has-[svg]` costs nothing but
305
+ * which element carries the trim.
306
+ *
307
+ * Measured by signalnine.org and reproduced here; see label-band.spec.ts, which
308
+ * pins the 0.00px spread, the cost of breaking it, and the agreement between
309
+ * the two paths.
310
+ *
311
+ * WHY IT EXISTS AT ALL: era's controls are flex, and a flex container's bare
312
+ * text is an ANONYMOUS flex item — a box no selector reaches and no
313
+ * non-inherited property touches. So `era-text-trim` on a flex row is inert,
314
+ * contributing only its `line-height: 1`, and the ink falls back to line-box
315
+ * centring by font metrics. era-token-ink already fixed that for centred
316
+ * tokens; this fixes it for everything else.
317
+ *
318
+ * THE ICON CASE IS NOT SOLVED, and cannot be from CSS: an icon beside the text
319
+ * needs the box to stay flex, which re-creates the anonymous item. A component
320
+ * whose children are an opaque slot therefore guards it —
321
+ * `not-has-[svg]:era-label-ink` — and ink-centres the text-only case while
322
+ * leaving the icon case on line-box centring. Splitting icon and label into
323
+ * separate slots is what would close it; typography/inert-trim reports every
324
+ * site still on the fallback.
325
+ *
326
+ * @use the ink centring for a fixed-height control holding ONE line of
327
+ * sentence-case text and no icon — a menu item, a nav trigger, a button label.
328
+ * Never alongside `truncate` (the trimmed box becomes the clip). */
329
+ @utility era-label-ink {
330
+ display: block;
331
+ align-content: center;
332
+ line-height: 1;
333
+ text-box: trim-both ex alphabetic;
334
+ }
@@ -0,0 +1,39 @@
1
+ /* MATERIAL ROLES — components choose meaning; surfaces choose appearance. */
2
+ /* @use the surface-aware backdrop treatment without choosing a fill or relief.
3
+ * Prefer material-popover/material-panel when the element is a complete surface. */
4
+ @utility surface-backdrop {
5
+ backdrop-filter: var(--era-backdrop-filter);
6
+ -webkit-backdrop-filter: var(--era-backdrop-filter);
7
+ }
8
+
9
+ /* @use a floating transient surface: menus, popovers, tooltips, pickers, toasts.
10
+ * Binds its raised fill, floating relief, and backdrop treatment atomically. */
11
+ @utility material-popover {
12
+ background-color: var(--era-surface-bg-elevated);
13
+ box-shadow: var(--era-shadow-lg);
14
+ backdrop-filter: var(--era-backdrop-filter);
15
+ -webkit-backdrop-filter: var(--era-backdrop-filter);
16
+ }
17
+
18
+ /* @use a floating persistent surface: dialogs, sheets, panes, inspectors.
19
+ * Binds its resting fill, floating relief, and backdrop treatment atomically. */
20
+ @utility material-panel {
21
+ background-color: var(--era-surface-bg);
22
+ box-shadow: var(--era-shadow-lg);
23
+ backdrop-filter: var(--era-backdrop-filter);
24
+ -webkit-backdrop-filter: var(--era-backdrop-filter);
25
+ }
26
+
27
+ /* @use the physical press contract on a control whose direct content plane is
28
+ * marked data-era-press-content. The surface owns relief/travel; compact
29
+ * components select the compact travel primitives as their effective values. */
30
+ @utility pressable {
31
+ &:active {
32
+ box-shadow: var(--era-shadow-pressed);
33
+ }
34
+
35
+ &:active > [data-era-press-content] {
36
+ translate: var(--era-press-effective-x, var(--era-press-sink-x))
37
+ var(--era-press-effective-y, var(--era-press-sink-y));
38
+ }
39
+ }