File size: 12,378 Bytes
82cdb59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c1fc133
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2eae9f0
82cdb59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89af3b2
82cdb59
 
 
 
 
 
 
 
367a695
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2eae9f0
 
367a695
 
 
 
 
 
 
 
 
89af3b2
 
 
 
 
367a695
 
 
 
 
 
 
 
2eae9f0
c1fc133
 
2eae9f0
c1fc133
 
2eae9f0
c1fc133
 
367a695
 
 
 
 
 
 
 
 
 
 
 
 
82cdb59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
/* wave 52 -- lane D (W52-T15/T16, owner instructions 14 + 18 + 26, ruling R4, contract C4).

   ⭐⭐ IMPORTED DIRECTLY BY `sheet/Ribbon.tsx` (`import "../styles/wave52/ribbon.css"`), NOT
   through `index.css`'s `@import` chain. `index.css` is shared across every wave-52 lane; adding
   a line there is exactly the trivial-but-collision-prone edit `wave51/sheet-engine.css`'s own
   header warns about ("Pre-created at the wave base... so no lane edits index.css"). No wave-52
   stub was pre-created for this file, so a component-owned side-effect import is this repo's
   existing way around the same problem -- `customer-grid/Toolbar.tsx` already imports its own
   `./filters.css` the same way, and it is a precedent, not an invention.

   Tokens only: var(--lp-*); no literal font-size, no hex, no text-transform: uppercase
   (DESIGN.md section 2). Every class this file declares is new; anything the tab strip, the
   groups or a control already had a rule for stays in `styles/wave51/sheet-engine.css` and
   `styles/wave50/sheet.css`, unedited, per this ticket's fence.

   ⭐⭐ WAVE 54 BASE KIT 2a -- THIS IS THE SHELL'S STYLESHEET NOW. `sheet/Ribbon.tsx` was split per
   tab, so the Home-only layouts this file used to carry (the Clipboard group's split layout and
   the Alignment group's two rows) moved to `styles/wave54/ribbon-home.css` beside the module that
   renders them. What is left here is what the SHELL paints -- the tab strip's actions wrapper and
   the key-tips overlay -- plus the two settings-pane blocks this file has carried since W52-T19,
   which are why `settings/ShortcutSettings.tsx` and `sheet/ShortcutsPanel.tsx` import it too. */


/* -- Import / Refresh / Full screen (instruction 14): the SAME horizontal strip as the Home tab,
   never a ribbon group. Sits between the tab list and the collapse chevron; the chevron keeps its
   own `margin-left: auto` (wave51/sheet-engine.css), which still pushes it to the far right of
   `.sheet-ribbon-tabs` no matter what renders before it, so nothing here needs to fight that. */
.sheet-ribbon-tabs-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 6px;
}

/* R19: one natural-width vocabulary on all five tabs. These selectors beat the frozen
   tab/button rules by specificity; a shrinking slot would under-report its overflow width. */
.sheet-ribbon .sheet-ribbon-group .sheet-ribbon-large,
.sheet-ribbon .sheet-ribbon-group .sheet-ribbon-stack {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 26px;
  height: var(--sheet-ribbon-band);
}

.sheet-ribbon .sheet-ribbon-group .sheet-ribbon-large .sheet-ribbon-btn {
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 46px;
  height: var(--sheet-ribbon-band);
  padding: 4px;
}

.sheet-ribbon .sheet-ribbon-group .sheet-ribbon-large .sheet-ribbon-icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.sheet-ribbon .sheet-ribbon-group .sheet-ribbon-large .sheet-ribbon-label {
  font-size: var(--lp-fs-2xs);
  line-height: var(--lp-lh-tight);
  white-space: nowrap;
}

.sheet-ribbon .sheet-ribbon-group .sheet-ribbon-stack {
  flex-direction: column;
  gap: 0;
}

.sheet-ribbon .sheet-ribbon-stack > .sheet-ribbon-stack-row {
  display: flex;
  align-items: stretch;
  flex: 1 1 0;
  min-height: 0;
  gap: 1px;
}

.sheet-ribbon .sheet-ribbon-stack-row > .sheet-ribbon-slot,
.sheet-ribbon .sheet-ribbon-stack-row .sheet-formula-trigger-fence {
  display: flex;
  align-items: stretch;
  height: 100%;
}

.sheet-ribbon .sheet-ribbon-group .sheet-ribbon-stack-row .sheet-ribbon-btn {
  flex: 0 0 auto;
  justify-content: center;
  min-width: 26px;
  height: 100%;
  gap: 2px;
  padding: 0 4px;
}

.sheet-ribbon .sheet-ribbon-stack-row .sheet-ribbon-icon {
  flex-shrink: 0;
}

/* Split remains natively disabled and named as unavailable in its tooltip. The visible
   status used to force a text-width row; an icon stack must keep the same footprint. */
.sheet-ribbon .sheet-ribbon-stack-row .sheet-ribbon-unavailable .sheet-ribbon-state,
.sheet-ribbon .sheet-ribbon-large .sheet-ribbon-unavailable .sheet-ribbon-state {
  display: none;
}

.sheet-ribbon .sheet-ribbon-group,
.sheet-ribbon .sheet-ribbon-group-controls {
  flex-shrink: 0;
}

/* RULE: show quiet chevrons only toward groups outside the visible ribbon strip. */
.sheet-ribbon-scroll-button {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  flex: 0 0 auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 4px;
  padding: 4px;
  border-radius: var(--lp-r-sm);
  cursor: pointer;
}

.sheet-ribbon .sheet-ribbon-scroll-button .sheet-ribbon-icon {
  width: 16px;
  height: 16px;
  color: var(--lp-muted);
}

@media (hover: hover) and (pointer: fine) {
  .sheet-ribbon-scroll-button:hover {
    background: var(--lp-line);
  }
}

.sheet-ribbon-scroll-button:focus-visible {
  outline: 2px solid var(--lp-blue-deep);
  outline-offset: 2px;
}

/* Trailing groups fold as a unit on every tab. The measurement copy contains only the
   folded groups, so controls, fieldsets and component state are never duplicated. */
.sheet-ribbon-shell > .sheet-ribbon > .sheet-ribbon-scroll {
  position: relative;
}

.sheet-ribbon-overflow-trigger {
  display: inline-flex;
  flex: 0 0 auto;
  align-self: flex-start;
  width: 80px;
  margin-left: 8px;
}

.sheet-ribbon-overflow-trigger .sheet-ribbon-btn {
  flex-direction: column;
  gap: 4px;
  width: 100%;
  height: var(--sheet-ribbon-band);
  padding: 4px;
}

.sheet-ribbon-overflow-trigger .sheet-ribbon-label {
  font-size: var(--lp-fs-2xs);
  white-space: nowrap;
}

.sheet-ribbon-overflow-trigger.is-measuring {
  position: absolute;
  left: 0;
  top: 0;
  visibility: hidden;
  pointer-events: none;
  margin: 0;
}

.sheet-ribbon.sheet-ribbon-overflow,
.sheet-ribbon.sheet-ribbon-overflow-measure {
  width: max-content;
  max-width: calc(100vw - 16px);
  padding: 8px;
}

.sheet-ribbon.sheet-ribbon-overflow {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-r-sm);
  background: var(--lp-surface);
  color: var(--lp-ink);
  box-shadow: var(--shell-shadow-overlay);
}

/* The gallery keeps its own white surface regardless of ribbon stylesheet order. */
.sheet-ribbon.sheet-ribbon-overflow:not(.sheet-tab-strip) {
  background: var(--lp-surface);
}

.sheet-ribbon-overflow-measure {
  position: fixed;
  left: 0;
  top: 0;
  visibility: hidden;
  pointer-events: none;
}

/* R11: inherit the collision cap, then shrink inside the panel's padding so only this host scrolls. */
.sheet-ribbon-overflow-scroll {
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: inherit;
  overflow-y: auto;
}

.sheet-ribbon-overflow-content,
.sheet-ribbon-overflow-content > fieldset {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  row-gap: 8px;
  max-width: 100%;
}

.sheet-ribbon-overflow-content .sheet-ribbon-group {
  flex: 0 0 auto;
}

/* W52-T19 (owner instruction 21, ruling R7) — a shortcut a person has disabled from the settings
   pane, drawn in `ShortcutsPanel.tsx` (the Ctrl+/ list, which is also this feature's audit trail).
   Muted rather than removed: the row still names the action, so the list keeps explaining what a
   disabled key used to do. Imported the same way this file's own header explains -- a component-
   owned side-effect import, because `index.css` and `styles/wave51/sheet-engine.css` are outside
   this ticket's fence and are not touched for one class. */
.sheet-shortcuts-keys--off {
  color: var(--lp-muted);
  text-decoration: line-through;
  border-style: dashed;
}

/* W52-T19 (owner instruction 21, ruling R7) — `settings/ShortcutSettings.tsx`'s row list. The
   `set-*` vocabulary (`set-pane`, `set-field`, `set-input`, `set-check`, `set-error`) already
   covers every INDIVIDUAL control; what it has no answer for is the FOUR-COLUMN row this pane
   needs (action + when, the effective key, the letter control, the enabled toggle), so that shape
   is declared here rather than forcing the shared vocabulary to grow a layout it does not
   otherwise use. Tokens only, no literal font-size, no hex, no text-transform: uppercase. */
.set-shortcut-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}
.set-shortcut-row {
  display: grid;
  grid-template-columns: 1fr 108px 88px 96px;
  align-items: center;
  gap: 6px 14px;
  padding: 10px 0;
  border-top: 1px solid var(--lp-line);
}
.set-shortcut-row:first-child { border-top: none; }
.set-shortcut-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.set-shortcut-action { font-size: var(--lp-fs-xs); color: var(--lp-ink); }
.set-shortcut-when { margin: 0; }
.set-shortcut-keys {
  font-family: inherit;
  font-size: var(--lp-fs-2xs);
  color: var(--lp-ink);
  background: var(--lp-surface-2);
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-r-sm);
  padding: 2px 6px;
  justify-self: start;
  white-space: nowrap;
}
.set-shortcut-keys--off {
  color: var(--lp-muted);
  text-decoration: line-through;
  border-style: dashed;
}
.set-shortcut-letter { margin: 0; }
.set-shortcut-letter-input { width: 100%; height: 28px; padding: 0; text-align: center; }
.set-shortcut-letter--fixed { display: block; }
.set-shortcut-toggle { justify-self: end; white-space: nowrap; }
.set-shortcut-error { grid-column: 1 / -1; margin: -2px 0 0; }

/* -- W52-T17 (instruction 20, ruling R7) -- the Alt key-tips overlay (`sheet/KeyTips.tsx`).
   `position: fixed` on the layer itself is what lets a badge be positioned in VIEWPORT
   coordinates straight off `getBoundingClientRect()`, with no dependency on `.sheet-ribbon-shell`
   gaining a positioning context of its own -- the design contract's "appear without layout shift"
   in the cheapest form available: this element contributes nothing to any parent's layout at all.
   `pointer-events: none` throughout -- a badge is informational only; the click that fires a
   control is always the real button underneath it (instruction 20: "user can click ... to get to
   the shortcut"), never the badge.
   ⭐ THE ONE PURPLE IN THE SHEET CHROME (instruction 20's own words, the design contract's carve-
   out over KT-5's generic "light neutral" default): `--lp-purple-tint` / `--lp-purple-deep` are
   the SAME pair `Ribbon.tsx`'s own `INKS`/`FILLS` swatch arrays already declare for the purple
   ink/fill choice -- reused here, not reinvented, so a palette change moves both at once.
   z-index sits at `--cg-z-mapchrome` (65): above `--cg-z-menu` (50, `.sheet-ribbon-pop`, so a
   badge can paint over an open gallery's own items) and below `--cg-z-drawer` (70, the Settings
   modal's backdrop) -- "above ribbon chrome, below any open modal". */
.sheet-kt-layer {
  position: fixed;
  inset: 0;
  z-index: var(--cg-z-mapchrome);
  pointer-events: none;
}

.sheet-kt-badge {
  position: fixed;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--lp-r-sm);
  border: 1px solid var(--lp-purple-deep);
  background: var(--lp-purple-tint);
  color: var(--lp-purple-deep);
  font-size: var(--lp-fs-2xs);
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
}

/* KT-18: a disabled control still paints its badge, dimmed, rather than hiding it -- hiding it
   would let a two-character prefix resolve to a different control than the one the user typed
   toward, and it would cost a person the muscle memory of a spot that is usually reachable. */
.sheet-kt-badge.is-dim {
  opacity: 0.45;
}

/* KT-17's soft signal for an unmatched keystroke. A short pulse on the badges already on screen,
   never a fade/slide on every valid keystroke as a sequence is typed -- the design contract's own
   distinction ("must NOT animate on every single keystroke", "badges may fade ... on the Alt-press
   transition itself"). Re-triggered by force-reflow in `KeyTips.tsx::flash`, not by a key prop, so
   two misses in a row both visibly pulse. */
@keyframes sheet-kt-flash-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.sheet-kt-layer.sheet-kt-flash .sheet-kt-badge {
  animation: sheet-kt-flash-pulse 150ms ease-out;
}