File size: 6,410 Bytes
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
/* wave 56 -- the Formulas tab's catalogue picker (W56-T13).

   Imported by `sheet/ribbonFormulas.tsx` as a component-owned side effect. The picker is a
   body-level `AnchoredOverlay`, so every selector that paints its contents is portal-safe and
   does not depend on a ribbon ancestor. The shared `.sheet-ribbon-pop-portal` supplies the
   overlay surface; this file owns only the picker layout and states.

   Tokens only: no literal font size, no literal colour and no invented z-index. Sentence case,
   Inter by inheritance, restrained overlay depth, focus outlines that do not change border width,
   and reduced-motion handling follow DESIGN.md sections 2 through 5. */

/* The Formulas row is the same species as Home and Insert. Its body class needs the three layout
   rules those tabs own under their own scoped selectors. */
.sheet-ribbon-formulas {
  align-items: stretch;
  gap: 0;
  padding: 4px 8px;
}

.sheet-ribbon-formulas .sheet-ribbon-btn {
  gap: 4px;
}

.sheet-ribbon-formulas .sheet-ribbon-label {
  white-space: nowrap;
}

/* One native disabled boundary per document-writing trigger. It has no visible box and does not
   disturb the ribbon control's own dimensions or roving-focus key. */
.sheet-formula-trigger-fence {
  display: inline-flex;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.sheet-formula-picker {
  z-index: var(--cg-z-overlay);
  width: min(424px, calc(100vw - 16px));
  gap: 8px;
  padding: 10px;
  overflow: auto;
}

.sheet-formula-picker-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
}

.sheet-formula-title {
  margin: 0;
  font-size: var(--lp-fs-sm);
  line-height: 1.25;
  font-weight: 600;
  color: var(--lp-ink);
}

.sheet-formula-status,
.sheet-formula-fallback,
.sheet-formula-empty,
.sheet-formula-signature {
  margin: 0;
  font-size: var(--lp-fs-2xs);
  line-height: 1.4;
}

.sheet-formula-status,
.sheet-formula-empty,
.sheet-formula-signature {
  color: var(--lp-muted);
}

.sheet-formula-fallback {
  padding: 6px 8px;
  color: var(--lp-ink);
  background: var(--lp-surface-2);
  border-radius: var(--lp-r-sm);
}

/* Custom buttons reset native chrome before their own state rules. */
.sheet-formula-back,
.sheet-formula-category,
.sheet-formula-option,
.sheet-formula-submit {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.sheet-formula-back {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: var(--lp-r-sm);
  font-size: var(--lp-fs-2xs);
  color: var(--lp-blue-solid);
}

.sheet-formula-categories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.sheet-formula-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  text-align: left;
  font-size: var(--lp-fs-xs);
  color: var(--lp-ink);
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-r-md);
}

.sheet-formula-count {
  flex: 0 0 auto;
  min-width: 2ch;
  color: var(--lp-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.sheet-formula-search,
.sheet-formula-argument {
  appearance: none;
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  font: inherit;
  font-size: var(--lp-fs-xs);
  color: var(--lp-ink);
  background: var(--lp-surface);
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-r-sm);
}

.sheet-formula-search::placeholder,
.sheet-formula-argument::placeholder {
  color: var(--lp-muted);
}

.sheet-formula-search:focus-visible,
.sheet-formula-argument:focus-visible,
.sheet-formula-back:focus-visible,
.sheet-formula-category:focus-visible,
.sheet-formula-option:focus-visible {
  outline: 2px solid var(--lp-blue-deep);
  outline-offset: 1px;
}

.sheet-formula-list {
  display: flex;
  flex-direction: column;
  max-height: 272px;
  overflow-y: auto;
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-r-md);
}

.sheet-formula-option {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--lp-line);
  color: var(--lp-ink);
}

.sheet-formula-option:last-of-type {
  border-bottom: 0;
}

.sheet-formula-option-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  font-size: var(--lp-fs-xs);
}

.sheet-formula-option-line strong {
  flex: 0 0 auto;
  font-weight: 600;
  color: var(--lp-blue-solid);
}

.sheet-formula-option-line > span {
  min-width: 0;
  overflow: hidden;
  color: var(--lp-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-formula-description {
  font-size: var(--lp-fs-2xs);
  line-height: 1.35;
  color: var(--lp-muted);
}

.sheet-formula-empty {
  padding: 12px 10px;
}

.sheet-formula-arguments {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 336px;
  overflow-y: auto;
  padding-right: 2px;
}

.sheet-formula-arguments label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sheet-formula-argument-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: var(--lp-fs-2xs);
  color: var(--lp-ink);
}

.sheet-formula-argument-label > span:last-child {
  color: var(--lp-muted);
}

.sheet-formula-submit {
  align-self: flex-start;
  padding: 6px 12px;
  border: 1px solid var(--lp-primary);
  border-radius: var(--lp-r-md);
  background: var(--lp-primary);
  color: var(--lp-surface);
  font-size: var(--lp-fs-xs);
  font-weight: 600;
}

.sheet-formula-submit:focus-visible {
  outline: 2px solid var(--lp-primary);
  outline-offset: 2px;
}

.sheet-formula-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (hover: hover) and (pointer: fine) {
  .sheet-formula-back:hover,
  .sheet-formula-category:hover,
  .sheet-formula-option:hover {
    background: var(--lp-surface-2);
  }

  .sheet-formula-submit:hover:not(:disabled) {
    border-color: var(--lp-primary-hover);
    background: var(--lp-primary-hover);
  }
}

.sheet-formula-back:active,
.sheet-formula-category:active,
.sheet-formula-option:active,
.sheet-formula-submit:active:not(:disabled) {
  transform: scale(0.97);
}

@media (prefers-reduced-motion: reduce) {
  .sheet-formula-back:active,
  .sheet-formula-category:active,
  .sheet-formula-option:active,
  .sheet-formula-submit:active:not(:disabled) {
    transform: none;
  }
}