@monster-orange/den-ui 0.5.1 → 0.7.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.
Files changed (45) hide show
  1. package/README.md +515 -1
  2. package/bin/den-ui-parity.mjs +440 -0
  3. package/inventory/fonts-dir.cjs +8 -0
  4. package/inventory/fonts-dir.mjs +10 -0
  5. package/inventory/nav-inventory.d.ts +133 -0
  6. package/inventory/nav-inventory.js +839 -0
  7. package/inventory/reference/den-chromium-1280.json +5388 -0
  8. package/inventory/reference/den-chromium-390.json +3834 -0
  9. package/inventory/reference/den-webkit-1280.json +5388 -0
  10. package/inventory/reference/den-webkit-390.json +3834 -0
  11. package/package.json +40 -3
  12. package/src/busy-words.d.ts +2 -0
  13. package/src/busy-words.js +6 -0
  14. package/src/busy.css +155 -0
  15. package/src/busy.d.ts +80 -0
  16. package/src/busy.js +105 -35
  17. package/src/dialog.css +103 -0
  18. package/src/dialog.d.ts +44 -0
  19. package/src/dialog.js +95 -30
  20. package/src/icons.d.ts +4 -0
  21. package/src/icons.js +43 -0
  22. package/src/kit.d.ts +217 -0
  23. package/src/kit.js +299 -0
  24. package/src/marks/den.svg +6 -0
  25. package/src/report-shot.d.ts +47 -0
  26. package/src/report-shot.js +437 -0
  27. package/src/report.css +387 -0
  28. package/src/report.d.ts +61 -0
  29. package/src/report.js +909 -0
  30. package/src/shell-client.d.ts +149 -0
  31. package/src/shell-client.js +820 -0
  32. package/src/shell-html.d.ts +305 -0
  33. package/src/shell-html.js +903 -0
  34. package/src/shell.css +1010 -0
  35. package/src/strings.d.ts +18 -0
  36. package/src/strings.js +565 -0
  37. package/src/time.d.ts +18 -0
  38. package/src/time.js +14 -2
  39. package/src/tokens.css +81 -67
  40. package/src/update-pill.d.ts +17 -0
  41. package/src/version.d.ts +7 -0
  42. package/src/version.js +31 -0
  43. package/src/whatsnew.css +235 -0
  44. package/src/whatsnew.d.ts +36 -0
  45. package/src/whatsnew.js +411 -0
package/src/tokens.css CHANGED
@@ -1,5 +1,7 @@
1
1
  /*
2
- * den-ui tokens (UK-1). The kit's defaults: a theme laid on top overrides
2
+ * den-ui tokens (UK-1). The kit's defaults are Den's theme (themes/den,
3
+ * since 0.7.0: its type, shape and both modes), so a host on the kit's
4
+ * defaults looks like Den. A theme laid on top overrides
3
5
  * colours (both modes), shadow, bar, type, radius, radius-button, density
4
6
  * and fonts; never spacing, motion or layers. Every rule here has zero
5
7
  * specificity (:where), so any theme rule wins.
@@ -10,13 +12,13 @@
10
12
 
11
13
  /* Type, shape, space, depth, motion, layers, targets: one set, both modes. */
12
14
  :where(:root) {
13
- --sans:
14
- "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
15
- "Noto Sans JP", sans-serif;
16
- --mono: "Space Mono", ui-monospace, Menlo, Consolas, monospace;
17
- --display: var(--sans);
18
- --ja:
19
- "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
15
+ /* prettier-ignore */
16
+ --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
17
+ --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
18
+ /* prettier-ignore */
19
+ --display: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
20
+ /* prettier-ignore */
21
+ --ja: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
20
22
  --fs-xs: 12px;
21
23
  --fs-s: 13px;
22
24
  --fs-m: 14px;
@@ -25,8 +27,8 @@
25
27
  --fs-2xl: 22px;
26
28
  --lh: 1.45;
27
29
 
28
- --radius: 6px;
29
- --radius-button: 0.2rem;
30
+ --radius: 8px;
31
+ --radius-button: 6px;
30
32
  --r: var(--radius);
31
33
  --r-btn: var(--radius-button);
32
34
 
@@ -56,95 +58,107 @@
56
58
 
57
59
  --tap: 44px;
58
60
  --tap-min: 36px;
61
+
62
+ /* Veils behind a pop-up, the same in both modes: the ☰ drawer's and the
63
+ status drawer's scrim, What's new's overlay, the Report form's backdrop. */
64
+ --kit-scrim: rgb(0 0 0 / 0.35);
65
+ --kit-veil: rgba(0, 0, 0, 0.65);
66
+ --kit-backdrop: rgba(0, 0, 0, 0.3);
59
67
  }
60
68
 
61
69
  /* Light: the default. */
62
70
  :where(:root),
63
71
  :where(:root[data-mode="light"]) {
64
72
  color-scheme: light;
65
- --bg: #fffcfc;
66
- --surface: #ffffff;
73
+ --bg: #f2eee8;
74
+ --surface: #fbf9f6;
67
75
  --raised: #ffffff;
68
- --sunken: #f4efee;
69
- --text: hsl(220 6% 10%);
70
- --muted: hsl(220 5% 34%);
71
- --faint: #62656a;
72
- --border: hsl(20 12% 86%);
73
- --border-strong: #97867f;
74
- --accent: #e16500;
75
- --accent-text: #a34a00;
76
- --accent-fill: #c23f00;
76
+ --sunken: #e8e2d9;
77
+ --text: #241e18;
78
+ --muted: #5c5247;
79
+ --faint: #6d6358;
80
+ --border: #dcd3c7;
81
+ --border-strong: #8d7f6d;
82
+ --accent: #557a2a;
83
+ --accent-text: #415e1f;
84
+ --accent-fill: #4a6b23;
77
85
  --on-accent: #ffffff;
78
- --ok: #11692f;
79
- --warn: #865700;
80
- --bad: #af0900;
86
+ --ok: #27613b;
87
+ --warn: #774c0e;
88
+ --bad: #983124;
81
89
  --info: hsl(213 22% 36%);
82
- /* #0e7280 failed the pill rule over --sunken (4.20:1); 4.59:1 now. */
83
- --remote: #0d6b79;
90
+ /* #0e7280 failed the pill rule over --sunken (4.20:1). #0d6b79 failed
91
+ the disc rule (an agent's initial on its 16% tint) over --sunken
92
+ (4.33:1); 4.56:1 now, the pill 4.84:1. */
93
+ --remote: #205d6e;
84
94
  --violet: #6a4bc4;
85
- --shadow: 0 8px 28px rgb(0 0 0 / 0.14);
95
+ --shadow: 0 8px 24px rgb(48 36 24 / 0.14);
96
+ /* A pop-up's or picker dialog's shadow (0.7.0). */
97
+ --den-pop-shadow: 0 16px 40px rgb(0 0 0 / 0.25);
86
98
  /* The shared update pill's shadow (update-pill.css). */
87
99
  --upd-shadow:
88
- 0 2px 4px rgba(32,38,29,.07), 0 10px 28px rgba(32,38,29,.10),
100
+ 0 2px 4px rgba(32, 38, 29, 0.07), 0 10px 28px rgba(32, 38, 29, 0.1),
89
101
  inset 0 1px 0 color-mix(in srgb, var(--text) 14%, transparent);
90
- --bar: linear-gradient(90deg, #ff7300, #af0900);
102
+ --bar: linear-gradient(90deg, #557a2a 0%, #8a6a48 100%);
91
103
  }
92
104
 
93
105
  /* Dark: asked for, or the system's choice when no mode is set. */
94
106
  :where(:root[data-mode="dark"]) {
95
107
  color-scheme: dark;
96
- --bg: hsl(220 6% 10%);
97
- --surface: hsl(220 6% 8.5%);
98
- --raised: #1f2023;
99
- --sunken: hsl(220 6% 7%);
100
- --text: #fffcfc;
101
- --muted: #c4c4c4;
102
- --faint: #a3a3a3;
103
- --border: hsl(220 5% 20%);
104
- --border-strong: #676a71;
105
- --accent: #ff7300;
106
- --accent-text: #ff8f33;
107
- --accent-fill: #ff7300;
108
- --on-accent: hsl(220 6% 10%);
109
- --ok: #4cc777;
110
- --warn: #e3a72f;
111
- --bad: #ff5a4f;
108
+ --bg: #1a1612;
109
+ --surface: #221d18;
110
+ --raised: #2b251f;
111
+ --sunken: #14110e;
112
+ --text: #ede6dc;
113
+ --muted: #b5aa9b;
114
+ --faint: #978b7e;
115
+ --border: #3a322a;
116
+ --border-strong: #7a6d5d;
117
+ --accent: #9bbb63;
118
+ --accent-text: #a8c672;
119
+ --accent-fill: #9bbb63;
120
+ --on-accent: #1a1612;
121
+ --ok: #6fc28f;
122
+ --warn: #e0a84e;
123
+ --bad: #ef7f6a;
112
124
  --info: hsl(213 30% 74%);
113
- --remote: #4fd1db;
125
+ --remote: #74b8c8;
114
126
  --violet: #a993ff;
115
127
  --shadow: 0 12px 30px rgb(0 0 0 / 0.5);
128
+ --den-pop-shadow: 0 16px 40px rgb(0 0 0 / 0.6);
116
129
  --upd-shadow:
117
- 0 2px 4px rgba(0,0,0,.35), 0 10px 28px rgba(0,0,0,.4),
130
+ 0 2px 4px rgba(0, 0, 0, 0.35), 0 10px 28px rgba(0, 0, 0, 0.4),
118
131
  inset 0 1px 0 color-mix(in srgb, var(--text) 14%, transparent);
119
- --bar: linear-gradient(90deg, #ff7300, #af0900);
132
+ --bar: linear-gradient(90deg, #9bbb63 0%, #a07c55 100%);
120
133
  }
121
134
 
122
135
  @media (prefers-color-scheme: dark) {
123
136
  :where(:root:not([data-mode])) {
124
137
  color-scheme: dark;
125
- --bg: hsl(220 6% 10%);
126
- --surface: hsl(220 6% 8.5%);
127
- --raised: #1f2023;
128
- --sunken: hsl(220 6% 7%);
129
- --text: #fffcfc;
130
- --muted: #c4c4c4;
131
- --faint: #a3a3a3;
132
- --border: hsl(220 5% 20%);
133
- --border-strong: #676a71;
134
- --accent: #ff7300;
135
- --accent-text: #ff8f33;
136
- --accent-fill: #ff7300;
137
- --on-accent: hsl(220 6% 10%);
138
- --ok: #4cc777;
139
- --warn: #e3a72f;
140
- --bad: #ff5a4f;
138
+ --bg: #1a1612;
139
+ --surface: #221d18;
140
+ --raised: #2b251f;
141
+ --sunken: #14110e;
142
+ --text: #ede6dc;
143
+ --muted: #b5aa9b;
144
+ --faint: #978b7e;
145
+ --border: #3a322a;
146
+ --border-strong: #7a6d5d;
147
+ --accent: #9bbb63;
148
+ --accent-text: #a8c672;
149
+ --accent-fill: #9bbb63;
150
+ --on-accent: #1a1612;
151
+ --ok: #6fc28f;
152
+ --warn: #e0a84e;
153
+ --bad: #ef7f6a;
141
154
  --info: hsl(213 30% 74%);
142
- --remote: #4fd1db;
155
+ --remote: #74b8c8;
143
156
  --violet: #a993ff;
144
157
  --shadow: 0 12px 30px rgb(0 0 0 / 0.5);
158
+ --den-pop-shadow: 0 16px 40px rgb(0 0 0 / 0.6);
145
159
  --upd-shadow:
146
- 0 2px 4px rgba(0,0,0,.35), 0 10px 28px rgba(0,0,0,.4),
160
+ 0 2px 4px rgba(0, 0, 0, 0.35), 0 10px 28px rgba(0, 0, 0, 0.4),
147
161
  inset 0 1px 0 color-mix(in srgb, var(--text) 14%, transparent);
148
- --bar: linear-gradient(90deg, #ff7300, #af0900);
162
+ --bar: linear-gradient(90deg, #9bbb63 0%, #a07c55 100%);
149
163
  }
150
164
  }
@@ -0,0 +1,17 @@
1
+ export interface UpdatePillOptions {
2
+ message: string;
3
+ reloadLabel: string;
4
+ dismissLabel: string;
5
+ cancelLabel?: string;
6
+ /** The pill's region name. */
7
+ region?: string;
8
+ /** A message to ask first (unsaved text), or null to reload at once. */
9
+ askFirst?: () => { message: string } | null;
10
+ onReload: () => void;
11
+ onDismiss?: () => void;
12
+ }
13
+ export interface UpdatePill {
14
+ hide(): void;
15
+ }
16
+ /** The shared update pill over the top bar. */
17
+ export declare function showUpdate(o: UpdatePillOptions): UpdatePill;
@@ -0,0 +1,7 @@
1
+ /** "v<running>" with its prerelease suffix, else the changelog's newest, else null. */
2
+ export declare function versionLabel(
3
+ running: string | null | undefined,
4
+ changelog: { version: string }[],
5
+ ): string | null;
6
+ export declare function setVersion(label: string, root?: ParentNode): void;
7
+ export declare function setUnread(on: boolean, root?: ParentNode): void;
package/src/version.js ADDED
@@ -0,0 +1,31 @@
1
+ /**
2
+ * den-ui version chip: the running product's version in the top bar
3
+ * (shell-html.js draws it as #version-pill; a click opens What's new).
4
+ *
5
+ * versionLabel(running, changelog) "v0.4.61-dev.0": the running build's
6
+ * own version, prerelease and all; the changelog's newest
7
+ * heading only as the fallback (it names the release being
8
+ * built, not this build). null when neither is known.
9
+ * setVersion(label, root?) the chip's text
10
+ * setUnread(on, root?) the dot: the newest notes are unread
11
+ */
12
+ export function versionLabel(running, changelog) {
13
+ const v =
14
+ (typeof running === "string" && running.trim()) || changelog?.[0]?.version;
15
+ return v ? `v${v}` : null;
16
+ }
17
+
18
+ export function setVersion(label, root = document) {
19
+ const el = root.getElementById
20
+ ? root.getElementById("version-pill")
21
+ : root.querySelector("#version-pill");
22
+ const txt = el?.querySelector(".v-txt");
23
+ if (txt && label) txt.textContent = label;
24
+ }
25
+
26
+ export function setUnread(on, root = document) {
27
+ const pip = root.getElementById
28
+ ? root.getElementById("v-pip")
29
+ : root.querySelector("#v-pip");
30
+ if (pip) pip.style.display = on ? "block" : "none";
31
+ }
@@ -0,0 +1,235 @@
1
+ /*
2
+ * den-ui What's new: the release notes pop-up (whatsnew.js). Tokens only.
3
+ * <link rel="stylesheet" href="/kit/whatsnew.css">
4
+ */
5
+ .cl-overlay {
6
+ position: fixed;
7
+ inset: 0;
8
+ z-index: 1000;
9
+ background: var(--kit-veil);
10
+ display: none;
11
+ align-items: center;
12
+ justify-content: center;
13
+ }
14
+ .cl-overlay.open {
15
+ display: flex;
16
+ }
17
+ .cl-box {
18
+ background: var(--surface);
19
+ border: 1px solid var(--border);
20
+ border-radius: 10px;
21
+ width: min(580px, 92vw);
22
+ max-height: 78vh;
23
+ display: flex;
24
+ flex-direction: column;
25
+ overflow: hidden;
26
+ box-shadow: var(--shadow);
27
+ }
28
+ .cl-hdr {
29
+ display: flex;
30
+ align-items: center;
31
+ gap: 10px;
32
+ padding: 13px 18px;
33
+ border-bottom: 1px solid var(--border);
34
+ flex-shrink: 0;
35
+ }
36
+ .cl-hdr h3 {
37
+ font-family: var(--mono);
38
+ font-size: 13px;
39
+ font-weight: 600;
40
+ color: var(--text);
41
+ flex: 1;
42
+ margin: 0;
43
+ }
44
+ .cl-close {
45
+ background: none;
46
+ border: none;
47
+ color: var(--muted);
48
+ font-size: 18px;
49
+ cursor: pointer;
50
+ line-height: 1;
51
+ padding: 2px 5px;
52
+ border-radius: 3px;
53
+ transition:
54
+ color 0.1s,
55
+ background 0.1s;
56
+ }
57
+ .cl-close:hover {
58
+ color: var(--text);
59
+ background: var(--border);
60
+ }
61
+ .cl-body {
62
+ overflow-y: auto;
63
+ padding: 16px 18px;
64
+ flex: 1;
65
+ }
66
+ .cl-entry {
67
+ margin-bottom: 18px;
68
+ }
69
+ .cl-ver-row {
70
+ display: flex;
71
+ align-items: baseline;
72
+ gap: 8px;
73
+ margin-bottom: 8px;
74
+ }
75
+ .cl-ver {
76
+ margin: 0;
77
+ font-family: var(--mono);
78
+ font-size: 13px;
79
+ font-weight: 700;
80
+ color: var(--accent-text);
81
+ }
82
+ .cl-date {
83
+ font-size: 11px;
84
+ color: var(--muted);
85
+ }
86
+ .cl-note {
87
+ font-size: 12px;
88
+ color: var(--muted);
89
+ margin: 0 0 8px;
90
+ font-style: italic;
91
+ }
92
+ .cl-sec {
93
+ font-size: 10px;
94
+ font-weight: 600;
95
+ text-transform: uppercase;
96
+ letter-spacing: 0.07em;
97
+ color: var(--muted);
98
+ margin: 8px 0 4px;
99
+ }
100
+ .cl-items {
101
+ list-style: none;
102
+ padding: 0;
103
+ margin: 0;
104
+ }
105
+ .cl-items li {
106
+ font-size: 12px;
107
+ color: var(--text);
108
+ padding: 2px 0 2px 14px;
109
+ position: relative;
110
+ line-height: 1.5;
111
+ }
112
+ .cl-items li::before {
113
+ content: "·";
114
+ position: absolute;
115
+ left: 2px;
116
+ color: var(--muted);
117
+ }
118
+ .cl-subitems {
119
+ list-style: none;
120
+ padding: 0;
121
+ margin: 2px 0 0 0;
122
+ }
123
+ .cl-subitems li {
124
+ font-size: 11.5px;
125
+ padding: 1px 0 1px 14px;
126
+ color: var(--muted);
127
+ }
128
+ .cl-subitems li::before {
129
+ content: "–";
130
+ position: absolute;
131
+ left: 2px;
132
+ }
133
+ .cl-items code {
134
+ font-family: var(--mono);
135
+ font-size: 10.5px;
136
+ color: var(--accent-text);
137
+ background: color-mix(in srgb, var(--accent) 10%, transparent);
138
+ padding: 1px 4px;
139
+ border-radius: 3px;
140
+ }
141
+ .cl-divider {
142
+ border: none;
143
+ border-top: 1px solid var(--border);
144
+ margin: 14px 0;
145
+ }
146
+ .cl-copy-group {
147
+ display: flex;
148
+ gap: 4px;
149
+ margin-left: auto;
150
+ flex-shrink: 0;
151
+ }
152
+ .cl-copy-btn,
153
+ .cl-slack-btn {
154
+ background: none;
155
+ border: 1px solid var(--border);
156
+ color: var(--muted);
157
+ padding: 3px 6px;
158
+ border-radius: 4px;
159
+ line-height: 0;
160
+ cursor: pointer;
161
+ flex-shrink: 0;
162
+ display: inline-flex;
163
+ align-items: center;
164
+ justify-content: center;
165
+ transition:
166
+ color 0.1s,
167
+ border-color 0.1s;
168
+ }
169
+ .cl-more-btn {
170
+ padding: 4px 12px;
171
+ font: inherit;
172
+ font-size: 11px;
173
+ color: var(--muted);
174
+ background: none;
175
+ border: 1px solid var(--border);
176
+ border-radius: 6px;
177
+ cursor: pointer;
178
+ }
179
+ .cl-more-btn:hover {
180
+ color: var(--accent-text);
181
+ border-color: var(--accent);
182
+ }
183
+ .cl-copy-btn:hover {
184
+ color: var(--accent-text);
185
+ border-color: var(--accent);
186
+ }
187
+ .cl-copy-btn.copied {
188
+ color: var(--ok);
189
+ border-color: var(--ok);
190
+ }
191
+ .cl-slack-btn:hover {
192
+ color: var(--accent-text);
193
+ border-color: var(--accent);
194
+ }
195
+ .cl-slack-btn.copied {
196
+ color: var(--ok);
197
+ border-color: var(--ok);
198
+ }
199
+ .cl-footer .den-rb {
200
+ margin-right: auto;
201
+ }
202
+ .cl-footer {
203
+ padding: 10px 18px;
204
+ border-top: 1px solid var(--border);
205
+ display: flex;
206
+ justify-content: flex-end;
207
+ flex-shrink: 0;
208
+ gap: 8px;
209
+ background: var(--surface);
210
+ }
211
+ .cl-got-it {
212
+ background: var(--accent-fill);
213
+ border: none;
214
+ color: var(--on-accent);
215
+ padding: 5px 16px;
216
+ border-radius: 5px;
217
+ font-size: 12px;
218
+ font-weight: 600;
219
+ cursor: pointer;
220
+ }
221
+ .cl-got-it:hover {
222
+ filter: brightness(0.92);
223
+ }
224
+ .cl-none {
225
+ color: var(--muted);
226
+ font-size: 12px;
227
+ }
228
+ /* A copy's helper element: on the page for the copy, never seen. */
229
+ .kit-offscreen {
230
+ position: fixed;
231
+ opacity: 0;
232
+ top: 0;
233
+ left: 0;
234
+ pointer-events: none;
235
+ }
@@ -0,0 +1,36 @@
1
+ export interface ChangelogItem {
2
+ text: string;
3
+ items?: ChangelogItem[];
4
+ }
5
+ export interface ChangelogEntry {
6
+ version: string;
7
+ date?: string;
8
+ sections?: Record<string, ChangelogItem[]>;
9
+ }
10
+ export interface WhatsNewOptions {
11
+ lang?: string | (() => string);
12
+ /** The adapter's changelog(): newest first. */
13
+ changelog?: (() => Promise<ChangelogEntry[]>) | null;
14
+ /** The Report button's HTML for the footer ("" for none). */
15
+ reportButton?: () => string;
16
+ /** After a close, with the newest version shown. */
17
+ onClose?: (latest: string | null) => void;
18
+ }
19
+ export declare function configureWhatsNew(o?: WhatsNewOptions): void;
20
+ export declare function changelogView(
21
+ list: ChangelogEntry[],
22
+ all: boolean,
23
+ ): {
24
+ shown: ChangelogEntry[];
25
+ toggle: { label: string; expanded: boolean } | null;
26
+ };
27
+ export declare function setEntries(list: ChangelogEntry[]): void;
28
+ export declare function getEntries(): ChangelogEntry[];
29
+ export declare function loadWhatsNew(): Promise<ChangelogEntry[]>;
30
+ export declare function ensureWhatsNew(): void;
31
+ export declare function renderBody(): void;
32
+ export declare function copyText(text: string): Promise<void>;
33
+ export declare function buildRichHtml(entry: ChangelogEntry): string;
34
+ export declare function buildMarkdown(entry: ChangelogEntry): string;
35
+ export declare function openWhatsNew(): void;
36
+ export declare function closeWhatsNew(): void;