@celestia-island/hikari 0.40.23 → 0.40.24
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
|
@@ -109,6 +109,16 @@
|
|
|
109
109
|
* rule's max-content width would over-constrain it (left+right+width
|
|
110
110
|
* drops `right` in LTR) and dock it at content width instead. */
|
|
111
111
|
width: auto;
|
|
112
|
+
/* The base .hk-popover-panel max-width clamp (calc(100vw - 16px), the
|
|
113
|
+
* anchored panel's ratchet guard) must NOT leak into the sheet: with
|
|
114
|
+
* the inline left:0 + right:0 docking the clamp over-constrains the
|
|
115
|
+
* used width and LTR drops the `right` constraint — the sheet docks
|
|
116
|
+
* flush left but stops 16px short of the right viewport edge (2026-09-08
|
|
117
|
+
* user report: a mysterious right-hand gap on the secondary windows,
|
|
118
|
+
* present on every popover-family sheet and never on the HkModal /
|
|
119
|
+
* HkSelectPanel sheets, hence "some have it, some don't"). The inline
|
|
120
|
+
* left/right pair alone owns the sheet's horizontal geometry. */
|
|
121
|
+
max-width: none;
|
|
112
122
|
border-radius: var(--hk-modal-radius, var(--hi-radius-lg, 12px))
|
|
113
123
|
var(--hk-modal-radius, var(--hi-radius-lg, 12px))
|
|
114
124
|
0 0;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source contract for the popover sheet viewport width (2026-09-08 user
|
|
3
|
+
* report: the mobile bottom sheets showed a mysterious right-hand gap —
|
|
4
|
+
* the sheet docked flush left but stopped 16px short of the right
|
|
5
|
+
* viewport edge, on every popover-family sheet and never on the HkModal
|
|
6
|
+
* / HkSelectPanel sheets, hence "some have it, some don't").
|
|
7
|
+
*
|
|
8
|
+
* Root cause: the base `.hk-popover-panel` rule sets
|
|
9
|
+
* `max-width: calc(100vw - 2 * 8px)` (the anchored panel's
|
|
10
|
+
* anti-ratchet clamp, #421). The mobile sheet branch overrides
|
|
11
|
+
* `width: auto` but inherited the max-width, over-constraining the
|
|
12
|
+
* inline `left: 0; right: 0` docking — the used width resolved to
|
|
13
|
+
* 100vw - 16px and LTR dropped the `right` constraint. Pinned here so
|
|
14
|
+
* a refactor cannot silently reintroduce the leak.
|
|
15
|
+
*/
|
|
16
|
+
import { beforeAll, describe, expect, it } from "vitest";
|
|
17
|
+
import { readFileSync } from "node:fs";
|
|
18
|
+
import { dirname, join } from "node:path";
|
|
19
|
+
import { fileURLToPath } from "node:url";
|
|
20
|
+
|
|
21
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
22
|
+
const scss = readFileSync(join(here, "HkPopover.scss"), "utf-8");
|
|
23
|
+
|
|
24
|
+
describe("HkPopover sheet viewport width contract", () => {
|
|
25
|
+
let block = "";
|
|
26
|
+
beforeAll(() => {
|
|
27
|
+
block = scss.match(/\.hk-popover-panel\.hk-is-sheet\s*{[\s\S]*?^\}/m)?.[0] ?? "";
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("neutralizes the base max-width clamp inside the sheet block", () => {
|
|
31
|
+
expect(block).toContain("max-width: none;");
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("keeps the sheet width content-independent (width: auto)", () => {
|
|
35
|
+
expect(block).toContain("width: auto;");
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it("declares max-width: none after the width override (ordering sanity)", () => {
|
|
39
|
+
expect(block.indexOf("max-width: none")).toBeGreaterThan(block.indexOf("width: auto"));
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source contract for the theme-toggle trigger chrome (2026-09-08 user
|
|
3
|
+
* report: the bordered surface box read as a mystery outline in the
|
|
4
|
+
* header and fought the host themes — the faint border, the host
|
|
5
|
+
* override layer and the `--hk-theme-toggle-btn-border` var never
|
|
6
|
+
* agreed). The trigger is now the STANDARD ghost icon-button chrome
|
|
7
|
+
* (same as `.hk-btn-ghost` / the HkIconButton ghost variant beside it):
|
|
8
|
+
* transparent at rest, primary wash on hover, no border, no surface,
|
|
9
|
+
* no shadow. Pinned here so the bordered-box chrome cannot silently
|
|
10
|
+
* return.
|
|
11
|
+
*/
|
|
12
|
+
import { beforeAll, describe, expect, it } from "vitest";
|
|
13
|
+
import { readFileSync } from "node:fs";
|
|
14
|
+
import { dirname, join } from "node:path";
|
|
15
|
+
import { fileURLToPath } from "node:url";
|
|
16
|
+
|
|
17
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
18
|
+
const src = readFileSync(join(here, "HkThemeToggle.scss"), "utf-8");
|
|
19
|
+
|
|
20
|
+
describe("HkThemeToggle ghost trigger chrome contract", () => {
|
|
21
|
+
let block = "";
|
|
22
|
+
beforeAll(() => {
|
|
23
|
+
block = src.match(/\.s-theme-toggle-btn\s*{[^}]*}/)?.[0] ?? "";
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("paints no border on the trigger (border: none)", () => {
|
|
27
|
+
expect(block).toContain("border: none;");
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("keeps the rest state transparent (no surface box)", () => {
|
|
31
|
+
expect(block).toContain("background: transparent;");
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("removes the per-theme border var entirely", () => {
|
|
35
|
+
expect(src).not.toContain("--hk-theme-toggle-btn-border");
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it("retains a visible focus ring via :focus-visible", () => {
|
|
39
|
+
expect(src).toMatch(/\.s-theme-toggle-btn:focus-visible\s*{[^}]*}/);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -13,15 +13,26 @@
|
|
|
13
13
|
height: 1.75rem;
|
|
14
14
|
min-width: 1.75rem;
|
|
15
15
|
padding: 0 var(--space-6, 0.375rem);
|
|
16
|
-
/*
|
|
17
|
-
*
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
/* Standard ghost icon-button chrome (2026-09-08 user report: the
|
|
17
|
+
* bordered surface box read as a mystery outline in the header and
|
|
18
|
+
* fought the host themes — the faint border, the host override layer
|
|
19
|
+
* and the border-var never agreed). The trigger now matches the
|
|
20
|
+
* standard ghost buttons beside it (same chrome as .hk-btn-ghost and
|
|
21
|
+
* the HkIconButton ghost variant): transparent at rest, primary wash
|
|
22
|
+
* on hover, no border, no surface, no shadow, no per-theme border var. */
|
|
23
|
+
border: none;
|
|
24
|
+
border-radius: var(--radius-sm, 6px);
|
|
25
|
+
background: transparent;
|
|
26
|
+
color: rgb(var(--color-text, var(--color-text-secondary, var(--color-muted))));
|
|
21
27
|
cursor: pointer;
|
|
22
28
|
transition: background 0.15s ease, color 0.15s ease;
|
|
23
29
|
}
|
|
24
30
|
|
|
31
|
+
.s-theme-toggle-btn:focus-visible {
|
|
32
|
+
outline: 2px solid rgb(var(--color-primary));
|
|
33
|
+
outline-offset: 1px;
|
|
34
|
+
}
|
|
35
|
+
|
|
25
36
|
/* Host strip under the mode group (mode-extra slot). */
|
|
26
37
|
.s-theme-mode-extra {
|
|
27
38
|
margin-top: var(--space-8, 0.5rem);
|
|
@@ -33,15 +44,6 @@
|
|
|
33
44
|
color: rgb(var(--color-text));
|
|
34
45
|
}
|
|
35
46
|
|
|
36
|
-
.s-theme-toggle-btn[data-variant="main"] {
|
|
37
|
-
border-radius: var(--radius-sm, 6px) 0 0 var(--radius-sm, 6px);
|
|
38
|
-
border-right: none;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.s-theme-toggle-btn[data-variant="arrow"] {
|
|
42
|
-
border-radius: 0 var(--radius-sm, 6px) var(--radius-sm, 6px) 0;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
47
|
.s-theme-menu {
|
|
46
48
|
display: flex;
|
|
47
49
|
flex-direction: column;
|