@celestia-island/hikari 0.55.107 → 0.55.108
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/package.json
CHANGED
|
@@ -44,7 +44,18 @@
|
|
|
44
44
|
text and toolbar rows. Font size does NOT scale with the size
|
|
45
45
|
(2026-08-30 user report, Material-Design convention): md and lg share
|
|
46
46
|
--text-base and lg only grows padding/min-height for a larger touch
|
|
47
|
-
target; sm keeps its compact --text-xs.
|
|
47
|
+
target; sm keeps its compact --text-xs. xs (2026-10-02, connection
|
|
48
|
+
popover action row) shrinks the footprint further for inline popover
|
|
49
|
+
footers: same --text-xs, tighter padding, 1.375rem min-height, and a
|
|
50
|
+
13px glyph (HkButton.tsx scales icon/suffix with the size) inside a
|
|
51
|
+
0.8125rem fixed box so the square-glyph contract keeps its rhythm at
|
|
52
|
+
the smaller scale. */
|
|
53
|
+
|
|
54
|
+
.hk-btn-xs {
|
|
55
|
+
padding: var(--space-4) var(--space-8);
|
|
56
|
+
font-size: var(--text-xs);
|
|
57
|
+
min-height: 1.375rem;
|
|
58
|
+
}
|
|
48
59
|
|
|
49
60
|
.hk-btn-sm {
|
|
50
61
|
padding: var(--space-6) var(--space-12);
|
|
@@ -73,6 +84,19 @@
|
|
|
73
84
|
consistent margin from the adjacent label via the button's own gap.
|
|
74
85
|
The 1rem box matches the 16px glyph HkButton renders for the
|
|
75
86
|
icon/suffix props. */
|
|
87
|
+
.hk-btn-xs .hk-btn-icon,
|
|
88
|
+
.hk-btn-xs .hk-btn-suffix {
|
|
89
|
+
inline-size: 0.8125rem;
|
|
90
|
+
block-size: 0.8125rem;
|
|
91
|
+
|
|
92
|
+
/* HIcon's smallest span is 1rem; the box scales the span (and the svg
|
|
93
|
+
fills the span), so the glyph lands at 13px inside the 22px button. */
|
|
94
|
+
.hk-icon {
|
|
95
|
+
inline-size: 100%;
|
|
96
|
+
block-size: 100%;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
76
100
|
.hk-btn-icon,
|
|
77
101
|
.hk-btn-suffix {
|
|
78
102
|
display: inline-flex;
|
|
@@ -121,6 +145,10 @@
|
|
|
121
145
|
box-sizing: border-box;
|
|
122
146
|
}
|
|
123
147
|
|
|
148
|
+
.hk-btn-xs.hk-btn-icon-only {
|
|
149
|
+
width: 1.375rem;
|
|
150
|
+
}
|
|
151
|
+
|
|
124
152
|
.hk-btn-sm.hk-btn-icon-only {
|
|
125
153
|
width: 1.75rem;
|
|
126
154
|
}
|
|
@@ -62,6 +62,15 @@ describe("HkButton class mapping", () => {
|
|
|
62
62
|
expect(cls).not.toContain("hk-btn-md");
|
|
63
63
|
});
|
|
64
64
|
|
|
65
|
+
it("maps the xs size with its leading icon box", () => {
|
|
66
|
+
const xs = mount(h(HkButton, { size: "xs", icon: "RotateCw" }, () => "Reconnect"));
|
|
67
|
+
const xsBtn = button(xs);
|
|
68
|
+
expect(xsBtn.className).toContain("hk-btn-xs");
|
|
69
|
+
const box = xsBtn.querySelector(".hk-btn-icon");
|
|
70
|
+
expect(box, "xs renders the leading icon box").toBeTruthy();
|
|
71
|
+
expect(box!.querySelector(".hk-icon"), "HIcon span renders").toBeTruthy();
|
|
72
|
+
});
|
|
73
|
+
|
|
65
74
|
it("adds the block modifier only when block is set", () => {
|
|
66
75
|
const blocked = mount(h(HkButton, { block: true }, () => "wide"));
|
|
67
76
|
expect(button(blocked).className).toContain("hk-btn-block");
|
|
@@ -207,8 +216,16 @@ describe("HkButton icon-only SCSS contract", () => {
|
|
|
207
216
|
expect(rule).toContain("width: 100%");
|
|
208
217
|
});
|
|
209
218
|
|
|
219
|
+
it("shrinks the xs glyph box and scales the HIcon span with it", () => {
|
|
220
|
+
const rule = scss.match(/\.hk-btn-xs \.hk-btn-icon,\n\.hk-btn-xs \.hk-btn-suffix\s*{[^}]*}/)?.[0] ?? "";
|
|
221
|
+
expect(rule, "xs glyph-box rule must exist").toBeTruthy();
|
|
222
|
+
expect(rule).toContain("inline-size: 0.8125rem");
|
|
223
|
+
expect(rule).toContain("inline-size: 100%");
|
|
224
|
+
});
|
|
225
|
+
|
|
210
226
|
it("locks each size variant width to its min-height", () => {
|
|
211
227
|
const cases: Array<[string, string]> = [
|
|
228
|
+
["xs", "1.375rem"],
|
|
212
229
|
["sm", "1.75rem"],
|
|
213
230
|
["md", "2.5rem"],
|
|
214
231
|
["lg", "2.75rem"],
|
|
@@ -345,6 +345,9 @@ describe("HkStatusBar", () => {
|
|
|
345
345
|
expect(row, "actions row renders").toBeTruthy();
|
|
346
346
|
const button = row.querySelector<HTMLButtonElement>("button")!;
|
|
347
347
|
expect(button.textContent).toContain("Reconnect now");
|
|
348
|
+
// 2026-10-02 user direction: small buttons with a leading glyph.
|
|
349
|
+
expect(button.className).toContain("hk-btn-xs");
|
|
350
|
+
expect(button.querySelector(".hk-btn-icon svg"), "leading glyph renders").toBeTruthy();
|
|
348
351
|
expect(panel.textContent).not.toContain("Click to retry");
|
|
349
352
|
button.click();
|
|
350
353
|
expect(onRetry, "popover button click retries").toHaveBeenCalledTimes(1);
|
|
@@ -458,7 +458,12 @@ export const HkStatusBar = defineComponent({
|
|
|
458
458
|
}}
|
|
459
459
|
>
|
|
460
460
|
{showRetryButton && (
|
|
461
|
-
<HkButton
|
|
461
|
+
<HkButton
|
|
462
|
+
size="xs"
|
|
463
|
+
variant="secondary"
|
|
464
|
+
icon="RotateCw"
|
|
465
|
+
onClick={onRetryButtonClick}
|
|
466
|
+
>
|
|
462
467
|
{t("hikari::statusBar.retryNow", "Reconnect now")}
|
|
463
468
|
</HkButton>
|
|
464
469
|
)}
|