@dorsk/tsumikit 0.40.2 → 0.41.1
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/README.md
CHANGED
|
@@ -167,7 +167,8 @@ Dropzone, CodeBlock, Callout, EmptyState, ConfirmModal, Pagination, Toaster,
|
|
|
167
167
|
ThemePicker (popover grid of 2×2 palette swatches: bg · surface · text · accent per theme), FontScalePicker (popover with a stepped slider across the five text sizes), SectionHeader, KeyValue, LoadMore,
|
|
168
168
|
GitRef (branch chip + PR link tinted by state + `+N −N` diff; `collapse`
|
|
169
169
|
auto/never/glyph degrades to icons inside a narrow `.cq` container),
|
|
170
|
-
CapBar (consumption track with a draggable, keyboard-steppable cap handle
|
|
170
|
+
CapBar (consumption track with a draggable, keyboard-steppable cap handle that
|
|
171
|
+
shows a `N%` bubble while it is moved; `oninput` live, `onchange` on commit),
|
|
171
172
|
Drawer (side-panel `<dialog>`: `side`, `width` clamped to the viewport, full-screen
|
|
172
173
|
under 48rem; `nav` page column that turns into a horizontal strip on narrow
|
|
173
174
|
screens, or `navMobile`; sticky `footer`; Escape / scrim / close button all close),
|
|
@@ -148,6 +148,9 @@
|
|
|
148
148
|
appearance: none;
|
|
149
149
|
-webkit-appearance: none;
|
|
150
150
|
flex: 1;
|
|
151
|
+
/* Firefox sizes a range input's min-content at ~12em, so without this it
|
|
152
|
+
refuses to shrink and paints over whatever shares its row. */
|
|
153
|
+
min-width: 0;
|
|
151
154
|
position: relative;
|
|
152
155
|
z-index: 1;
|
|
153
156
|
height: 1.25rem;
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
|
|
64
64
|
let trackEl = $state<HTMLDivElement | null>(null);
|
|
65
65
|
let dragging = $state(false);
|
|
66
|
+
let keying = $state(false);
|
|
66
67
|
let committed = cap;
|
|
67
68
|
|
|
68
69
|
function setCap(next: number) {
|
|
@@ -98,6 +99,7 @@
|
|
|
98
99
|
const next = capKeyStep(e.key, e.shiftKey, snapCap(cap, step, min, max), step, min, max);
|
|
99
100
|
if (next === null) return;
|
|
100
101
|
e.preventDefault();
|
|
102
|
+
keying = true;
|
|
101
103
|
setCap(next);
|
|
102
104
|
}
|
|
103
105
|
function keyUp(e: KeyboardEvent) {
|
|
@@ -111,6 +113,7 @@
|
|
|
111
113
|
class="cap-bar size-{size} tone-{tone} {klass}"
|
|
112
114
|
class:readonly
|
|
113
115
|
class:dragging
|
|
116
|
+
class:keying
|
|
114
117
|
style="--label-w: {labelWidth}; --readout-w: {readoutWidth}; --pct: {pct}%; --cap: {capPct}%; {styleProp}"
|
|
115
118
|
>
|
|
116
119
|
{#if label}
|
|
@@ -141,7 +144,9 @@
|
|
|
141
144
|
aria-disabled={readonly ? 'true' : undefined}
|
|
142
145
|
onkeydown={keyDown}
|
|
143
146
|
onkeyup={keyUp}
|
|
147
|
+
onblur={() => (keying = false)}
|
|
144
148
|
></div>
|
|
149
|
+
<div class="bubble" aria-hidden="true">{cap}%</div>
|
|
145
150
|
</div>
|
|
146
151
|
<div class="readout" title={readoutTitle}>
|
|
147
152
|
{#if readout === undefined}{readoutText}{:else if typeof readout === 'string'}{readout}{:else}{@render readout()}{/if}
|
|
@@ -225,6 +230,34 @@
|
|
|
225
230
|
outline: 2px solid var(--accent);
|
|
226
231
|
outline-offset: 2px;
|
|
227
232
|
}
|
|
233
|
+
.bubble {
|
|
234
|
+
position: absolute;
|
|
235
|
+
bottom: calc(100% + 8px);
|
|
236
|
+
left: var(--cap);
|
|
237
|
+
transform: translateX(-50%);
|
|
238
|
+
padding: 1px var(--sp-1);
|
|
239
|
+
border: 1px solid var(--border-strong);
|
|
240
|
+
border-radius: var(--r-sm);
|
|
241
|
+
background: var(--bg-elevated-2);
|
|
242
|
+
box-shadow: var(--shadow-sm);
|
|
243
|
+
color: var(--text);
|
|
244
|
+
font-size: var(--fs-xs);
|
|
245
|
+
line-height: 1.4;
|
|
246
|
+
font-variant-numeric: tabular-nums;
|
|
247
|
+
white-space: nowrap;
|
|
248
|
+
pointer-events: none;
|
|
249
|
+
opacity: 0;
|
|
250
|
+
visibility: hidden;
|
|
251
|
+
transition:
|
|
252
|
+
opacity 0.12s var(--ease),
|
|
253
|
+
visibility 0.12s;
|
|
254
|
+
z-index: 3;
|
|
255
|
+
}
|
|
256
|
+
.dragging .bubble,
|
|
257
|
+
.keying .bubble {
|
|
258
|
+
opacity: 1;
|
|
259
|
+
visibility: visible;
|
|
260
|
+
}
|
|
228
261
|
.readonly .track,
|
|
229
262
|
.readonly .handle {
|
|
230
263
|
cursor: default;
|
|
@@ -251,7 +284,8 @@
|
|
|
251
284
|
grid-column: 1 / 3;
|
|
252
285
|
}
|
|
253
286
|
@media (prefers-reduced-motion: reduce) {
|
|
254
|
-
.fill
|
|
287
|
+
.fill,
|
|
288
|
+
.bubble {
|
|
255
289
|
transition: none;
|
|
256
290
|
}
|
|
257
291
|
}
|
package/package.json
CHANGED