@hia-doc/theme-default 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 HIA
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,20 @@
1
+ # @hia-doc/theme-default
2
+
3
+ Default static theme assets for HIA HTML output.
4
+
5
+ This package owns the default CSS and minimal browser-side script. It does not parse HIA IR and does not depend on renderer or CLI packages.
6
+
7
+ ## Current Scope
8
+
9
+ - `assets/hia-default.css`
10
+ - `assets/hia-default.js`
11
+ - asset metadata for renderer output
12
+ - minimal runtime locale switching for `[data-hia-locale]` blocks
13
+ - project view segmented controls for unified project pages
14
+
15
+ ## Font Policy
16
+
17
+ The default theme does not bundle, download or redistribute font files. Its CSS only references local open-source font families and generic browser fallbacks.
18
+
19
+ - UI text prefers `Inter`, `Noto Sans SC`, `Source Han Sans SC` and `Sarasa Gothic SC`.
20
+ - Code and source locations prefer `Sarasa Mono SC`, `Sarasa Fixed SC`, `Noto Sans Mono CJK SC`, `Source Han Mono SC`, `Cascadia Code`, `JetBrains Mono` and `Fira Code`.
@@ -0,0 +1,11 @@
1
+ export declare const DEFAULT_THEME_CSS_PATH = "assets/hia-default.css";
2
+ export declare const DEFAULT_THEME_JS_PATH = "assets/hia-default.js";
3
+ export interface HiaThemeAsset {
4
+ path: string;
5
+ contents: string;
6
+ contentType: string;
7
+ }
8
+ export declare function getDefaultThemeAssets(): HiaThemeAsset[];
9
+ export declare const DEFAULT_THEME_CSS: string;
10
+ export declare const DEFAULT_THEME_JS: string;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAC/D,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAE7D,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,qBAAqB,IAAI,aAAa,EAAE,CAavD;AAED,eAAO,MAAM,iBAAiB,QA0TtB,CAAC;AAET,eAAO,MAAM,gBAAgB,QAoBrB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,353 @@
1
+ export const DEFAULT_THEME_CSS_PATH = "assets/hia-default.css";
2
+ export const DEFAULT_THEME_JS_PATH = "assets/hia-default.js";
3
+ export function getDefaultThemeAssets() {
4
+ return [
5
+ {
6
+ path: DEFAULT_THEME_CSS_PATH,
7
+ contents: DEFAULT_THEME_CSS,
8
+ contentType: "text/css; charset=utf-8"
9
+ },
10
+ {
11
+ path: DEFAULT_THEME_JS_PATH,
12
+ contents: DEFAULT_THEME_JS,
13
+ contentType: "text/javascript; charset=utf-8"
14
+ }
15
+ ];
16
+ }
17
+ export const DEFAULT_THEME_CSS = `
18
+ :root {
19
+ color-scheme: light;
20
+ --hia-bg: #f7f8fa;
21
+ --hia-surface: #ffffff;
22
+ --hia-border: #d7dde5;
23
+ --hia-text: #172033;
24
+ --hia-muted: #5d6b82;
25
+ --hia-accent: #087f7a;
26
+ --hia-accent-soft: #dff4ef;
27
+ --hia-code-bg: #101820;
28
+ --hia-code-text: #d7f4ff;
29
+ font-family: "Inter", "Noto Sans SC", "Source Han Sans SC", "Sarasa Gothic SC", sans-serif;
30
+ }
31
+
32
+ * {
33
+ box-sizing: border-box;
34
+ }
35
+
36
+ body {
37
+ margin: 0;
38
+ background: var(--hia-bg);
39
+ color: var(--hia-text);
40
+ line-height: 1.55;
41
+ }
42
+
43
+ a {
44
+ color: var(--hia-accent);
45
+ }
46
+
47
+ .hia-shell {
48
+ display: grid;
49
+ grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr);
50
+ min-height: 100vh;
51
+ }
52
+
53
+ .hia-sidebar {
54
+ border-right: 1px solid var(--hia-border);
55
+ padding: 1.5rem;
56
+ background: #eef2f6;
57
+ }
58
+
59
+ .hia-sidebar nav ul,
60
+ .hia-project-summary ul {
61
+ padding-left: 1.25rem;
62
+ }
63
+
64
+ .hia-sidebar nav li,
65
+ .hia-project-summary li {
66
+ margin: .25rem 0;
67
+ }
68
+
69
+ .hia-sidebar nav a {
70
+ display: grid;
71
+ gap: .1rem;
72
+ text-decoration: none;
73
+ }
74
+
75
+ .hia-sidebar nav small {
76
+ color: var(--hia-muted);
77
+ font-size: .72rem;
78
+ }
79
+
80
+ .hia-project-views {
81
+ align-items: center;
82
+ display: inline-flex;
83
+ flex-wrap: wrap;
84
+ gap: .25rem;
85
+ margin: 1rem 0;
86
+ }
87
+
88
+ .hia-project-view-button {
89
+ appearance: none;
90
+ background: var(--hia-surface);
91
+ border: 1px solid var(--hia-border);
92
+ border-radius: 6px;
93
+ color: var(--hia-text);
94
+ cursor: pointer;
95
+ font: inherit;
96
+ font-size: .86rem;
97
+ line-height: 1.2;
98
+ min-height: 2rem;
99
+ padding: .35rem .65rem;
100
+ }
101
+
102
+ .hia-project-view-button span {
103
+ display: inline-block;
104
+ font-size: .72rem;
105
+ margin-left: .35rem;
106
+ opacity: .8;
107
+ }
108
+
109
+ .hia-project-view-button:hover {
110
+ border-color: var(--hia-accent);
111
+ color: var(--hia-accent);
112
+ }
113
+
114
+ .hia-project-view-button[aria-pressed="true"] {
115
+ background: var(--hia-accent);
116
+ border-color: var(--hia-accent);
117
+ color: #ffffff;
118
+ }
119
+
120
+ .hia-project-search {
121
+ display: grid;
122
+ gap: .35rem;
123
+ margin: .75rem 0 1rem;
124
+ }
125
+
126
+ .hia-project-search span {
127
+ color: var(--hia-muted);
128
+ font-size: .82rem;
129
+ font-weight: 700;
130
+ }
131
+
132
+ .hia-project-search input {
133
+ background: var(--hia-surface);
134
+ border: 1px solid var(--hia-border);
135
+ border-radius: 6px;
136
+ color: var(--hia-text);
137
+ font: inherit;
138
+ min-height: 2.25rem;
139
+ padding: .45rem .6rem;
140
+ width: 100%;
141
+ }
142
+
143
+ .hia-project-search input:focus {
144
+ border-color: var(--hia-accent);
145
+ outline: 2px solid var(--hia-accent-soft);
146
+ }
147
+
148
+ .hia-language-switch {
149
+ display: grid;
150
+ gap: .35rem;
151
+ margin: 1rem 0;
152
+ }
153
+
154
+ .hia-language-switch label {
155
+ color: var(--hia-muted);
156
+ font-size: .82rem;
157
+ font-weight: 700;
158
+ }
159
+
160
+ .hia-language-switch select {
161
+ border: 1px solid var(--hia-border);
162
+ border-radius: 6px;
163
+ padding: .4rem .55rem;
164
+ width: 100%;
165
+ }
166
+
167
+ .hia-main {
168
+ max-width: 72rem;
169
+ width: 100%;
170
+ padding: 2rem;
171
+ }
172
+
173
+ .hia-symbol {
174
+ background: var(--hia-surface);
175
+ border: 1px solid var(--hia-border);
176
+ border-radius: 6px;
177
+ margin: 1rem 0;
178
+ padding: 1rem;
179
+ }
180
+
181
+ .hia-symbol h2 {
182
+ margin: 0 0 .5rem;
183
+ }
184
+
185
+ .hia-kind {
186
+ display: inline-block;
187
+ border: 1px solid var(--hia-border);
188
+ border-radius: 999px;
189
+ color: var(--hia-muted);
190
+ font-size: .78rem;
191
+ padding: .05rem .45rem;
192
+ }
193
+
194
+ .hia-signature,
195
+ .hia-source-code {
196
+ overflow-x: auto;
197
+ border-radius: 6px;
198
+ font-family: "Sarasa Mono SC", "Sarasa Fixed SC", "Noto Sans Mono CJK SC", "Source Han Mono SC", "Cascadia Code", "JetBrains Mono", "Fira Code", monospace;
199
+ }
200
+
201
+ .hia-signature {
202
+ border: 1px solid var(--hia-border);
203
+ padding: .5rem;
204
+ }
205
+
206
+ .hia-source-code {
207
+ background: var(--hia-code-bg);
208
+ color: var(--hia-code-text);
209
+ padding: 1rem;
210
+ }
211
+
212
+ .hia-source-line {
213
+ color: var(--hia-muted);
214
+ }
215
+
216
+ .hia-localized-text[hidden] {
217
+ display: none;
218
+ }
219
+
220
+ .hia-fallback-badge {
221
+ background: var(--hia-accent-soft);
222
+ border-radius: 999px;
223
+ color: var(--hia-accent);
224
+ display: inline-block;
225
+ font-size: .75rem;
226
+ margin-left: .5rem;
227
+ padding: .08rem .45rem;
228
+ }
229
+
230
+ .hia-i18n-fields,
231
+ .hia-source-section {
232
+ border-top: 1px solid var(--hia-border);
233
+ margin-top: 1rem;
234
+ padding-top: 1rem;
235
+ }
236
+
237
+ .hia-i18n-fields h3,
238
+ .hia-source-section h3,
239
+ .hia-source-references h4 {
240
+ margin: 0 0 .75rem;
241
+ }
242
+
243
+ .hia-i18n-field {
244
+ display: grid;
245
+ grid-template-columns: minmax(9rem, 14rem) minmax(0, 1fr);
246
+ gap: .75rem;
247
+ margin: .5rem 0;
248
+ }
249
+
250
+ .hia-i18n-field dt {
251
+ color: var(--hia-muted);
252
+ font-family: "Sarasa Mono SC", "Sarasa Fixed SC", "Noto Sans Mono CJK SC", "Source Han Mono SC", "Cascadia Code", "JetBrains Mono", "Fira Code", monospace;
253
+ font-size: .85rem;
254
+ }
255
+
256
+ .hia-i18n-field dd {
257
+ margin: 0;
258
+ }
259
+
260
+ .hia-source-preview,
261
+ .hia-source-fragment {
262
+ margin: .75rem 0;
263
+ }
264
+
265
+ .hia-source-preview summary,
266
+ .hia-source-fragment summary {
267
+ color: var(--hia-muted);
268
+ cursor: pointer;
269
+ font-family: "Sarasa Mono SC", "Sarasa Fixed SC", "Noto Sans Mono CJK SC", "Source Han Mono SC", "Cascadia Code", "JetBrains Mono", "Fira Code", monospace;
270
+ font-size: .86rem;
271
+ margin-bottom: .35rem;
272
+ }
273
+
274
+ .hia-source-unresolved {
275
+ color: #9b2c2c;
276
+ }
277
+
278
+ .hia-project-source-preview {
279
+ margin-top: .75rem;
280
+ }
281
+
282
+ .hia-source-actions {
283
+ display: flex;
284
+ flex-wrap: wrap;
285
+ gap: .5rem;
286
+ margin-top: .75rem;
287
+ }
288
+
289
+ .hia-source-actions button {
290
+ appearance: none;
291
+ background: var(--hia-accent);
292
+ border: 1px solid var(--hia-accent);
293
+ border-radius: 6px;
294
+ color: #ffffff;
295
+ cursor: pointer;
296
+ font: inherit;
297
+ font-size: .86rem;
298
+ min-height: 2rem;
299
+ padding: .35rem .65rem;
300
+ }
301
+
302
+ .hia-source-actions button:hover {
303
+ background: #065f5b;
304
+ border-color: #065f5b;
305
+ }
306
+
307
+ .hia-project-source-map-list {
308
+ margin: .35rem 0 0;
309
+ padding-left: 1rem;
310
+ }
311
+
312
+ .hia-project-empty {
313
+ color: var(--hia-muted);
314
+ padding: 1rem;
315
+ }
316
+
317
+ @media (max-width: 760px) {
318
+ .hia-shell {
319
+ display: block;
320
+ }
321
+
322
+ .hia-sidebar {
323
+ border-right: 0;
324
+ border-bottom: 1px solid var(--hia-border);
325
+ }
326
+
327
+ .hia-main {
328
+ padding: 1rem;
329
+ }
330
+ }
331
+ `.trim();
332
+ export const DEFAULT_THEME_JS = `
333
+ (() => {
334
+ document.documentElement.dataset.hiaTheme = "default";
335
+
336
+ const control = document.querySelector("[data-hia-locale-control]");
337
+ const localizedBlocks = Array.from(document.querySelectorAll("[data-hia-locale]"));
338
+
339
+ function applyLocale(locale) {
340
+ document.documentElement.lang = locale;
341
+
342
+ for (const block of localizedBlocks) {
343
+ block.hidden = block.getAttribute("data-hia-locale") !== locale;
344
+ }
345
+ }
346
+
347
+ if (control) {
348
+ applyLocale(control.value);
349
+ control.addEventListener("change", () => applyLocale(control.value));
350
+ }
351
+ })();
352
+ `.trim();
353
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAC/D,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AAQ7D,MAAM,UAAU,qBAAqB;IACnC,OAAO;QACL;YACE,IAAI,EAAE,sBAAsB;YAC5B,QAAQ,EAAE,iBAAiB;YAC3B,WAAW,EAAE,yBAAyB;SACvC;QACD;YACE,IAAI,EAAE,qBAAqB;YAC3B,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,gCAAgC;SAC9C;KACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0ThC,CAAC,IAAI,EAAE,CAAC;AAET,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;CAoB/B,CAAC,IAAI,EAAE,CAAC"}
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@hia-doc/theme-default",
3
+ "version": "0.1.0",
4
+ "description": "Default static theme assets for HIA HTML output.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/mandolin/HIA-Documentation.git",
9
+ "directory": "packages/theme-default"
10
+ },
11
+ "engines": {
12
+ "node": ">=20.19.0"
13
+ },
14
+ "type": "module",
15
+ "main": "./dist/index.js",
16
+ "types": "./dist/index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "import": "./dist/index.js"
21
+ }
22
+ },
23
+ "files": [
24
+ "dist",
25
+ "README.md",
26
+ "LICENSE"
27
+ ],
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
31
+ "sideEffects": false,
32
+ "scripts": {
33
+ "build": "tsc -p tsconfig.json",
34
+ "test": "vitest run src/**/*.test.ts"
35
+ }
36
+ }