@celestia-island/hikari 0.55.463 → 0.55.465
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/dist/types/components/HkMasterDetail.d.ts +64 -78
- package/dist/types/components/HkModal.d.ts +17 -0
- package/package.json +1 -1
- package/src/animation/registerAnimations.ts +0 -8
- package/src/components/HkHeaderPicker.scss +9 -1
- package/src/components/HkHeaderPicker.test.tsx +25 -0
- package/src/components/HkMasterDetail.scss +92 -166
- package/src/components/HkMasterDetail.ssr.test.tsx +36 -12
- package/src/components/HkMasterDetail.test.tsx +433 -221
- package/src/components/HkMasterDetail.tsx +171 -124
- package/src/components/HkModal.test.tsx +33 -0
- package/src/components/HkModal.tsx +8 -1
- package/src/styles/admin-tokens.scss +22 -0
|
@@ -6,56 +6,68 @@ import "./HkMasterDetail.scss";
|
|
|
6
6
|
* whatever row the roster drew), never this component's.
|
|
7
7
|
*/
|
|
8
8
|
export type HkMasterDetailSlots = SlotsType<{
|
|
9
|
-
/** The roster
|
|
10
|
-
*
|
|
11
|
-
* leaves the
|
|
9
|
+
/** The roster column's content — typically a flex-none head row (title,
|
|
10
|
+
* count, tools) over a scrolling list (HkScrollContainer / HkTable).
|
|
11
|
+
* Required in practice — an empty list slot leaves the column blank. */
|
|
12
12
|
list?: () => VNode[];
|
|
13
13
|
/** The selected item's body. Rendered only while `detailOpen`; closed,
|
|
14
|
-
* the pane shows the empty state instead.
|
|
14
|
+
* the pane shows the empty state instead. A canvas child (a 3D scene)
|
|
15
|
+
* fills the region with `flex: 1; min-height: 0` of its own. */
|
|
15
16
|
detail?: () => VNode[];
|
|
16
17
|
/** Trailing header actions inside the detail pane (refresh, copy, a
|
|
17
18
|
* "open full page" link…) — rendered BEFORE the close affordance. */
|
|
18
19
|
actions?: () => VNode[];
|
|
19
20
|
}>;
|
|
20
21
|
/**
|
|
21
|
-
*
|
|
22
|
-
* (
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
*
|
|
31
|
-
*
|
|
22
|
+
* The roster track takes a plain CSS WIDTH. The retired grammar was a grid
|
|
23
|
+
* track (`minmax(360px, 1fr)`), which is INVALID as a width: the browser
|
|
24
|
+
* drops the declaration, the column falls back to content width and the
|
|
25
|
+
* hairline stops lining up with the pane. A host still passing a track
|
|
26
|
+
* therefore gets the documented default plus one dev warning, instead of a
|
|
27
|
+
* silently collapsed column.
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveListWidth(width: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* HkMasterDetail — the family's standard two-pane roster+detail console
|
|
32
|
+
* (mail inbox, replay browser, mod roster, audit log: any host list that
|
|
33
|
+
* picks one row and shows it beside the list).
|
|
32
34
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
35
|
+
* Geometry — the WoWSP replay/resources contract (2026-11-23 user
|
|
36
|
+
* direction: the detail is a LAYOUT REGION, not a floating card): one
|
|
37
|
+
* full-height flex row the HOST bounds (`height: 100%` on the root; the
|
|
38
|
+
* host hands it a definite height — a stage-mode shell content box, or a
|
|
39
|
+
* page wrapper with a definite height). The roster column is a fixed
|
|
40
|
+
* flush sidebar (`listWidth`, 1px separator, the surface tint IS the
|
|
41
|
+
* page); the detail region takes the remaining width, scrolls
|
|
42
|
+
* internally, and carries NO card chrome — no radius, no shadow, no
|
|
43
|
+
* gutter. Each column owns its own scroll; the page never scrolls.
|
|
41
44
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
45
|
+
* Narrow viewports (`splitAt`, default 768 — the family phone
|
|
46
|
+
* breakpoint) have two forms, and which one applies is about DISMISSAL,
|
|
47
|
+
* not width:
|
|
48
|
+
* - a host that binds `close` can deselect, so the detail rides HkModal —
|
|
49
|
+
* the family window (bottom sheet on phones). The modal stays MOUNTED
|
|
50
|
+
* and is driven by `detailOpen`, so closing runs the window's own exit
|
|
51
|
+
* motion and focus restore; unmounting it mid-close would strand
|
|
52
|
+
* keyboard focus on `<body>` and skip the animation.
|
|
53
|
+
* - a host that binds no `close` cannot deselect, and a modal would trap
|
|
54
|
+
* the user behind its scrim, focus trap and body-scroll lock. It gets
|
|
55
|
+
* the detail as the whole column instead — host-owned navigation, no
|
|
56
|
+
* overlay at all (the same refusal the wide layout applies to the
|
|
57
|
+
* close affordance).
|
|
47
58
|
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
59
|
+
* The head band (`.hk-master-detail-detail-head`) carries the host's
|
|
60
|
+
* `actions` slot and the close affordance; it renders only when it has at
|
|
61
|
+
* least one of those — and the close affordance itself only while a detail
|
|
62
|
+
* is OPEN (a closed pane has nothing to dismiss). It also carries the
|
|
63
|
+
* overlay-scrollbar rail, which the
|
|
64
|
+
* component attaches to the pane over its own scroll region — native
|
|
65
|
+
* MECHANICS, the library's chrome).
|
|
55
66
|
*
|
|
56
67
|
* Emits `close` when the user dismisses the selection. The close
|
|
57
|
-
* affordance renders only when a listener is bound (`@close` /
|
|
58
|
-
*
|
|
68
|
+
* affordance renders only when a listener is bound (`@close` / `onClose`)
|
|
69
|
+
* AND a detail is open — a pane whose host cannot deselect has no button
|
|
70
|
+
* to press, and a closed pane has nothing to dismiss.
|
|
59
71
|
*
|
|
60
72
|
* ```tsx
|
|
61
73
|
* <HkMasterDetail
|
|
@@ -64,19 +76,19 @@ export type HkMasterDetailSlots = SlotsType<{
|
|
|
64
76
|
* emptyTitle={t("inbox.pickOne", "Pick a message")}
|
|
65
77
|
* onClose={() => (selected.value = null)}
|
|
66
78
|
* >
|
|
67
|
-
* {{ list: () => <
|
|
79
|
+
* {{ list: () => <InboxRoster … />, detail: () => <MessageBody … /> }}
|
|
68
80
|
* </HkMasterDetail>
|
|
69
81
|
* ```
|
|
70
82
|
*/
|
|
71
83
|
export declare const HkMasterDetail: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
72
84
|
/** Whether a detail is selected. Closed, the detail pane renders the
|
|
73
|
-
* empty state (two-pane) or nothing at all (
|
|
85
|
+
* empty state (two-pane) or nothing at all (narrow form). */
|
|
74
86
|
detailOpen: {
|
|
75
87
|
type: BooleanConstructor;
|
|
76
88
|
default: boolean;
|
|
77
89
|
};
|
|
78
|
-
/** Accessible name of the detail region — and, in the
|
|
79
|
-
* the visible
|
|
90
|
+
/** Accessible name of the detail region — and, in the narrow window
|
|
91
|
+
* form, the window's visible title. */
|
|
80
92
|
detailTitle: {
|
|
81
93
|
type: StringConstructor;
|
|
82
94
|
required: true;
|
|
@@ -97,31 +109,19 @@ export declare const HkMasterDetail: import("vue").DefineComponent<import("vue")
|
|
|
97
109
|
type: PropType<Component>;
|
|
98
110
|
default: undefined;
|
|
99
111
|
};
|
|
100
|
-
/** Roster column
|
|
112
|
+
/** Roster column width (a CSS width). The detail takes the rest. */
|
|
101
113
|
listWidth: {
|
|
102
114
|
type: StringConstructor;
|
|
103
115
|
default: string;
|
|
104
116
|
};
|
|
105
|
-
/**
|
|
106
|
-
detailWidth: {
|
|
107
|
-
type: StringConstructor;
|
|
108
|
-
default: string;
|
|
109
|
-
};
|
|
110
|
-
/** Stick the detail pane while the roster scrolls. Hosts embedding
|
|
111
|
-
* the pane in an already-bounded container pass false — a sticky
|
|
112
|
-
* child inside a short box just scrolls with it. */
|
|
113
|
-
sticky: {
|
|
114
|
-
type: BooleanConstructor;
|
|
115
|
-
default: boolean;
|
|
116
|
-
};
|
|
117
|
-
/** Viewport width (px) below which the two panes collapse into one
|
|
118
|
-
* column with the detail in the overlay drawer. */
|
|
117
|
+
/** Viewport width (px) below which the narrow forms apply. */
|
|
119
118
|
splitAt: {
|
|
120
119
|
type: NumberConstructor;
|
|
121
120
|
default: number;
|
|
122
121
|
};
|
|
123
122
|
/** Accessible label of the close affordance (defaults to the
|
|
124
|
-
* localized "Close").
|
|
123
|
+
* localized "Close"). Forwarded to the narrow window's own close
|
|
124
|
+
* button as well, so a host's label reads the same in both forms. */
|
|
125
125
|
closeLabel: {
|
|
126
126
|
type: StringConstructor;
|
|
127
127
|
default: undefined;
|
|
@@ -130,13 +130,13 @@ export declare const HkMasterDetail: import("vue").DefineComponent<import("vue")
|
|
|
130
130
|
close: () => true;
|
|
131
131
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
132
132
|
/** Whether a detail is selected. Closed, the detail pane renders the
|
|
133
|
-
* empty state (two-pane) or nothing at all (
|
|
133
|
+
* empty state (two-pane) or nothing at all (narrow form). */
|
|
134
134
|
detailOpen: {
|
|
135
135
|
type: BooleanConstructor;
|
|
136
136
|
default: boolean;
|
|
137
137
|
};
|
|
138
|
-
/** Accessible name of the detail region — and, in the
|
|
139
|
-
* the visible
|
|
138
|
+
/** Accessible name of the detail region — and, in the narrow window
|
|
139
|
+
* form, the window's visible title. */
|
|
140
140
|
detailTitle: {
|
|
141
141
|
type: StringConstructor;
|
|
142
142
|
required: true;
|
|
@@ -157,31 +157,19 @@ export declare const HkMasterDetail: import("vue").DefineComponent<import("vue")
|
|
|
157
157
|
type: PropType<Component>;
|
|
158
158
|
default: undefined;
|
|
159
159
|
};
|
|
160
|
-
/** Roster column
|
|
160
|
+
/** Roster column width (a CSS width). The detail takes the rest. */
|
|
161
161
|
listWidth: {
|
|
162
162
|
type: StringConstructor;
|
|
163
163
|
default: string;
|
|
164
164
|
};
|
|
165
|
-
/**
|
|
166
|
-
detailWidth: {
|
|
167
|
-
type: StringConstructor;
|
|
168
|
-
default: string;
|
|
169
|
-
};
|
|
170
|
-
/** Stick the detail pane while the roster scrolls. Hosts embedding
|
|
171
|
-
* the pane in an already-bounded container pass false — a sticky
|
|
172
|
-
* child inside a short box just scrolls with it. */
|
|
173
|
-
sticky: {
|
|
174
|
-
type: BooleanConstructor;
|
|
175
|
-
default: boolean;
|
|
176
|
-
};
|
|
177
|
-
/** Viewport width (px) below which the two panes collapse into one
|
|
178
|
-
* column with the detail in the overlay drawer. */
|
|
165
|
+
/** Viewport width (px) below which the narrow forms apply. */
|
|
179
166
|
splitAt: {
|
|
180
167
|
type: NumberConstructor;
|
|
181
168
|
default: number;
|
|
182
169
|
};
|
|
183
170
|
/** Accessible label of the close affordance (defaults to the
|
|
184
|
-
* localized "Close").
|
|
171
|
+
* localized "Close"). Forwarded to the narrow window's own close
|
|
172
|
+
* button as well, so a host's label reads the same in both forms. */
|
|
185
173
|
closeLabel: {
|
|
186
174
|
type: StringConstructor;
|
|
187
175
|
default: undefined;
|
|
@@ -189,13 +177,11 @@ export declare const HkMasterDetail: import("vue").DefineComponent<import("vue")
|
|
|
189
177
|
}>> & Readonly<{
|
|
190
178
|
onClose?: (() => any) | undefined;
|
|
191
179
|
}>, {
|
|
192
|
-
sticky: boolean;
|
|
193
180
|
closeLabel: string;
|
|
194
181
|
emptyTitle: string;
|
|
195
182
|
emptyDescription: string;
|
|
196
183
|
detailOpen: boolean;
|
|
197
184
|
emptyIcon: Component;
|
|
198
185
|
listWidth: string;
|
|
199
|
-
detailWidth: string;
|
|
200
186
|
splitAt: number;
|
|
201
187
|
}, HkMasterDetailSlots, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -97,6 +97,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
97
97
|
type: StringConstructor;
|
|
98
98
|
default: undefined;
|
|
99
99
|
};
|
|
100
|
+
/** Accessible label of the header close affordance. Unset keeps the
|
|
101
|
+
* localized default; a host whose own wording is more specific
|
|
102
|
+
* ("Dismiss message") passes it so the window's X reads the same as
|
|
103
|
+
* the rest of its surface. */
|
|
104
|
+
closeLabel: {
|
|
105
|
+
type: StringConstructor;
|
|
106
|
+
default: undefined;
|
|
107
|
+
};
|
|
100
108
|
footerActions: {
|
|
101
109
|
type: PropType<ModalAction[]>;
|
|
102
110
|
default: undefined;
|
|
@@ -185,6 +193,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
185
193
|
type: StringConstructor;
|
|
186
194
|
default: undefined;
|
|
187
195
|
};
|
|
196
|
+
/** Accessible label of the header close affordance. Unset keeps the
|
|
197
|
+
* localized default; a host whose own wording is more specific
|
|
198
|
+
* ("Dismiss message") passes it so the window's X reads the same as
|
|
199
|
+
* the rest of its surface. */
|
|
200
|
+
closeLabel: {
|
|
201
|
+
type: StringConstructor;
|
|
202
|
+
default: undefined;
|
|
203
|
+
};
|
|
188
204
|
footerActions: {
|
|
189
205
|
type: PropType<ModalAction[]>;
|
|
190
206
|
default: undefined;
|
|
@@ -235,6 +251,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
235
251
|
backGuard: boolean;
|
|
236
252
|
contentClass: string;
|
|
237
253
|
surfaceTitle: string;
|
|
254
|
+
closeLabel: string;
|
|
238
255
|
footerActions: ModalAction[];
|
|
239
256
|
windowed: boolean;
|
|
240
257
|
overscanScreens: number;
|
package/package.json
CHANGED
|
@@ -157,11 +157,3 @@ registerCssAnimation("hk-edge-glow-breathe", { infinite: true });
|
|
|
157
157
|
// band and drops the loops (house pattern, see HkSkeleton).
|
|
158
158
|
registerCssAnimation("hk-emergency-breathe", { infinite: true });
|
|
159
159
|
registerCssAnimation("hk-emergency-signal", { infinite: true });
|
|
160
|
-
|
|
161
|
-
// components/HkMasterDetail.scss — the drawer form's entry (two one-shots):
|
|
162
|
-
// the detail pane slides in from the right edge and its veil fades in. Both
|
|
163
|
-
// play once (the pane unmounts on close, so no leave keyframe); the host's
|
|
164
|
-
// global animation switch and reduced motion clamp them (the component's
|
|
165
|
-
// own sheet carries both opt-outs).
|
|
166
|
-
registerCssAnimation("hk-master-detail-drawer-in");
|
|
167
|
-
registerCssAnimation("hk-master-detail-scrim-in");
|
|
@@ -22,7 +22,15 @@
|
|
|
22
22
|
padding-inline: var(--space-12) var(--space-28);
|
|
23
23
|
font-size: var(--text-sm);
|
|
24
24
|
font-weight: 600;
|
|
25
|
-
|
|
25
|
+
/* The trigger hugs its label, capped so a long one cannot push the
|
|
26
|
+
* header's centre band around. The cap is a HOOK, not a constant: a
|
|
27
|
+
* host whose labels are legitimately long (a mailbox identity written
|
|
28
|
+
* "Name <address>", a document title) opts out with
|
|
29
|
+
* `--hk-header-picker-max-w: none` on the picker's own class instead of
|
|
30
|
+
* forking the component. That lifts the CAP only — a centre band with
|
|
31
|
+
* sibling groups can still squeeze (and ellipsise) the trigger, so `none`
|
|
32
|
+
* is not by itself a guarantee of full display. */
|
|
33
|
+
max-width: var(--hk-header-picker-max-w, 16rem);
|
|
26
34
|
/* Ghost chrome (2026-10-18 user direction: the top-centre dropdown
|
|
27
35
|
* must read like the bottom-centre platform pill — no field border,
|
|
28
36
|
* hover tint only). Mirrors HkButton's ghost variant. */
|
|
@@ -153,6 +153,31 @@ describe("HkHeaderPicker", () => {
|
|
|
153
153
|
expect(scss).toContain("background: var(--c-primary-light);");
|
|
154
154
|
});
|
|
155
155
|
|
|
156
|
+
it("lands a host class on the picker root, where the hook resolves", () => {
|
|
157
|
+
// The width hook is a custom property, so it must be settable on the
|
|
158
|
+
// element the host can reach: the picker's own ROOT. (A wrapper works
|
|
159
|
+
// too — custom properties inherit — but the root is the documented
|
|
160
|
+
// handle, and attrs fall through to it.)
|
|
161
|
+
const c = mountPicker(
|
|
162
|
+
{ modelValue: "a", options: [{ value: "a", label: "Ayane Test <someone@example.test>" }] },
|
|
163
|
+
{ class: "wide-picker" },
|
|
164
|
+
);
|
|
165
|
+
const root = c.querySelector(".hk-header-picker") as HTMLElement;
|
|
166
|
+
expect(root, "the picker root exists").toBeTruthy();
|
|
167
|
+
expect(root.classList.contains("wide-picker"), "the host class lands on it").toBe(true);
|
|
168
|
+
// …and the trigger the cap applies to lives inside it.
|
|
169
|
+
expect(root.querySelector(".hk-select-trigger.hk-header-picker-trigger")).toBeTruthy();
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
it("keeps the trigger cap a hook so a host with long labels can opt out", () => {
|
|
173
|
+
// A "Name <address>" identity (or a document title) legitimately
|
|
174
|
+
// exceeds the band-friendly cap. The cap stays a tunable so the host
|
|
175
|
+
// widens its own picker instead of forking the component — and the
|
|
176
|
+
// family default is unchanged for everyone else.
|
|
177
|
+
const scss = readFileSync(join(here, "HkHeaderPicker.scss"), "utf-8");
|
|
178
|
+
expect(scss).toContain("max-width: var(--hk-header-picker-max-w, 16rem);");
|
|
179
|
+
});
|
|
180
|
+
|
|
156
181
|
it("disables the trigger when disabled", () => {
|
|
157
182
|
const c = mountPicker({ disabled: true }, {});
|
|
158
183
|
expect(
|