@hraness/design-kit 0.36.5 → 0.39.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 (59) hide show
  1. package/MARKETING_COPY.md +2 -0
  2. package/README.md +77 -11
  3. package/dist/{chunk-xa28y4fg.js → chunk-1dgm85ta.js} +191 -55
  4. package/dist/chunk-6mx403v5.js +286 -0
  5. package/dist/{chunk-thv5t11w.js → chunk-dc8v05zh.js} +6 -137
  6. package/dist/{chunk-evb02bc1.js → chunk-fcs5qekr.js} +48 -1
  7. package/dist/chunk-fxwed3e5.js +775 -0
  8. package/dist/chunk-vy0pt84a.js +1807 -0
  9. package/dist/{chunk-sabcr66p.js → chunk-w1y1m3m7.js} +300 -1
  10. package/dist/index.js +24 -12
  11. package/dist/mockups/client.js +6 -654
  12. package/dist/mockups/index.js +29 -1797
  13. package/dist/provider-marks.js +1 -1
  14. package/dist/react/index.js +190 -5
  15. package/dist/react/server.js +5 -3
  16. package/dist/stylex-manifest.json +1 -1
  17. package/package.json +9 -5
  18. package/portfolio-inventory.json +1 -1
  19. package/src/compiler-foundation.css +2 -0
  20. package/src/design-gallery.css +12 -0
  21. package/src/index.ts +1 -0
  22. package/src/marketing-marquee.css +281 -0
  23. package/src/marketing-marquee.ts +206 -0
  24. package/src/mockups/client.tsx +157 -66
  25. package/src/mockups/core.tsx +30 -0
  26. package/src/mockups.css +158 -23
  27. package/src/provider-marks.generated.ts +92 -0
  28. package/src/provider-marks.ts +29 -4
  29. package/src/react/design-gallery.tsx +53 -0
  30. package/src/react/index.ts +1 -0
  31. package/src/react/marketing-marquee.tsx +71 -0
  32. package/src/react/server.ts +1 -0
  33. package/src/styles.css +2 -0
  34. package/vendor/provider-marks/BOOTSTRAP-ICONS-LICENSE +21 -0
  35. package/vendor/provider-marks/UPSTREAM.md +28 -0
  36. package/vendor/provider-marks/bootstrap-icons/calendar-event-fill.svg +3 -0
  37. package/vendor/provider-marks/bootstrap-icons/filetype-csv.svg +3 -0
  38. package/vendor/provider-marks/bootstrap-icons/globe2.svg +3 -0
  39. package/vendor/provider-marks/bootstrap-icons/linkedin.svg +3 -0
  40. package/vendor/provider-marks/bootstrap-icons/microsoft.svg +3 -0
  41. package/vendor/provider-marks/bootstrap-icons/person-vcard-fill.svg +3 -0
  42. package/vendor/provider-marks/bootstrap-icons/shop.svg +3 -0
  43. package/vendor/provider-marks/simple-icons/apple.svg +1 -0
  44. package/vendor/provider-marks/simple-icons/bluesky.svg +1 -0
  45. package/vendor/provider-marks/simple-icons/facebook.svg +1 -0
  46. package/vendor/provider-marks/simple-icons/github.svg +1 -0
  47. package/vendor/provider-marks/simple-icons/gmail.svg +1 -0
  48. package/vendor/provider-marks/simple-icons/google.svg +1 -0
  49. package/vendor/provider-marks/simple-icons/instagram.svg +1 -0
  50. package/vendor/provider-marks/simple-icons/reddit.svg +1 -0
  51. package/vendor/provider-marks/simple-icons/substack.svg +1 -0
  52. package/vendor/provider-marks/simple-icons/telegram.svg +1 -0
  53. package/vendor/provider-marks/simple-icons/threads.svg +1 -0
  54. package/vendor/provider-marks/simple-icons/tiktok.svg +1 -0
  55. package/vendor/provider-marks/simple-icons/twitch.svg +1 -0
  56. package/vendor/provider-marks/simple-icons/x.svg +1 -0
  57. package/vendor/provider-marks/simple-icons/ycombinator.svg +1 -0
  58. package/vendor/provider-marks/simple-icons/youtube.svg +1 -0
  59. package/dist/chunk-gmea6p0d.js +0 -13
@@ -1,6 +1,32 @@
1
+ import {
2
+ AgentSession,
3
+ ArticlePage,
4
+ BrowserFrame,
5
+ BrowserWindow,
6
+ ChatThread,
7
+ Inbox,
8
+ InboxMessage,
9
+ InboxRow,
10
+ MOCKUP_EXAMPLE_HOST,
11
+ MacWindow,
12
+ MenuBarPopover,
13
+ PhoneFrame,
14
+ PhoneShell,
15
+ SocialFeed,
16
+ SocialPost,
17
+ TerminalFrame,
18
+ TypingIndicator,
19
+ WorkFeed,
20
+ WorkPost,
21
+ chatSide,
22
+ isEmojiOnly,
23
+ mockupAddress,
24
+ phoneStyle
25
+ } from "../chunk-vy0pt84a.js";
1
26
  import {
2
27
  Avatar,
3
28
  Hotspot,
29
+ MockupBrandMark,
4
30
  MockupGlyph,
5
31
  MockupRoot,
6
32
  PlaceholderPhoto,
@@ -14,1804 +40,9 @@ import {
14
40
  mockupGlyphNames,
15
41
  mockupHash,
16
42
  mockupInitials
17
- } from "../chunk-evb02bc1.js";
43
+ } from "../chunk-fcs5qekr.js";
44
+ import"../chunk-w1y1m3m7.js";
18
45
  import"../chunk-5gtx3pza.js";
19
- // src/mockups/frames.tsx
20
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
21
- var MOCKUP_EXAMPLE_HOST = /(^|\.)(example(\.(com|net|org))?|test|invalid|localhost)$/u;
22
- function mockupAddress(url) {
23
- const trimmed = url.trim().replace(/^[a-z]+:\/\//iu, "");
24
- const slash = trimmed.indexOf("/");
25
- const host = (slash < 0 ? trimmed : trimmed.slice(0, slash)).toLowerCase();
26
- const path = slash < 0 ? "" : trimmed.slice(slash);
27
- if (!MOCKUP_EXAMPLE_HOST.test(host)) {
28
- throw new RangeError(`Mockup address ${JSON.stringify(url)} must use a reserved example host such as example.com or site.example.`);
29
- }
30
- return {
31
- host,
32
- path: path === "/" ? "" : path
33
- };
34
- }
35
- function pageStyle(height) {
36
- if (height === undefined)
37
- return;
38
- if (!(height > 0))
39
- throw new RangeError("A mockup page height must be positive.");
40
- return {
41
- "--hkm-page-height": `${height}px`
42
- };
43
- }
44
- function optOutProps(optOut) {
45
- return optOut === undefined ? {} : {
46
- optOut
47
- };
48
- }
49
- function BrowserFrame({
50
- children,
51
- fade,
52
- height,
53
- toolbar,
54
- url,
55
- ...root
56
- }) {
57
- return /* @__PURE__ */ jsx(MockupRoot, {
58
- ...root,
59
- kind: "browser",
60
- children: /* @__PURE__ */ jsx(BrowserWindow, {
61
- ...fade === undefined ? {} : {
62
- fade
63
- },
64
- ...height === undefined ? {} : {
65
- height
66
- },
67
- toolbar,
68
- url,
69
- children
70
- })
71
- });
72
- }
73
- function BrowserWindow({
74
- children,
75
- fade,
76
- height,
77
- toolbar,
78
- url
79
- }) {
80
- const {
81
- host,
82
- path
83
- } = mockupAddress(url);
84
- const fades = fade ?? height !== undefined;
85
- return /* @__PURE__ */ jsxs("div", {
86
- className: "hkm-window",
87
- children: [
88
- /* @__PURE__ */ jsxs("div", {
89
- "aria-hidden": "true",
90
- className: "hkm-browser-bar",
91
- children: [
92
- /* @__PURE__ */ jsx(WindowLights, {}),
93
- /* @__PURE__ */ jsxs("span", {
94
- className: "hkm-browser-nav",
95
- children: [
96
- /* @__PURE__ */ jsx(MockupGlyph, {
97
- name: "back",
98
- size: 16
99
- }),
100
- /* @__PURE__ */ jsx(MockupGlyph, {
101
- name: "forward",
102
- size: 16
103
- }),
104
- /* @__PURE__ */ jsx(MockupGlyph, {
105
- name: "reload",
106
- size: 15
107
- })
108
- ]
109
- }),
110
- /* @__PURE__ */ jsxs("span", {
111
- className: "hkm-address",
112
- children: [
113
- /* @__PURE__ */ jsx(MockupGlyph, {
114
- name: "lock",
115
- size: 12
116
- }),
117
- /* @__PURE__ */ jsx("span", {
118
- className: "hkm-address-host",
119
- children: host
120
- }),
121
- path === "" ? null : /* @__PURE__ */ jsx("span", {
122
- className: "hkm-address-path",
123
- children: path
124
- })
125
- ]
126
- }),
127
- /* @__PURE__ */ jsx("span", {
128
- className: "hkm-browser-tools",
129
- children: toolbar
130
- })
131
- ]
132
- }),
133
- /* @__PURE__ */ jsx("div", {
134
- className: "hkm-page",
135
- "data-hkm-fade": fades ? "" : undefined,
136
- style: pageStyle(height),
137
- children
138
- })
139
- ]
140
- });
141
- }
142
- var TERMINAL_KINDS = new Set(["input", "output", "comment"]);
143
- function TerminalFrame({
144
- density = "standard",
145
- fade,
146
- height,
147
- lines,
148
- prompt = "$",
149
- title = "Terminal",
150
- ...root
151
- }) {
152
- if (density !== "standard" && density !== "presentation")
153
- throw new RangeError("Terminal density must be standard or presentation.");
154
- for (const line of lines) {
155
- if (!TERMINAL_KINDS.has(line.kind))
156
- throw new TypeError(`Unknown terminal line kind ${JSON.stringify(line.kind)}.`);
157
- }
158
- const fades = fade ?? height !== undefined;
159
- return /* @__PURE__ */ jsx(MockupRoot, {
160
- ...root,
161
- kind: "terminal",
162
- children: /* @__PURE__ */ jsxs("div", {
163
- className: "hkm-window",
164
- children: [
165
- /* @__PURE__ */ jsxs("div", {
166
- "aria-hidden": "true",
167
- className: "hkm-title-bar",
168
- children: [
169
- /* @__PURE__ */ jsx(WindowLights, {}),
170
- /* @__PURE__ */ jsx("span", {
171
- className: "hkm-title",
172
- children: title
173
- }),
174
- /* @__PURE__ */ jsx("span", {})
175
- ]
176
- }),
177
- /* @__PURE__ */ jsx("div", {
178
- className: "hkm-page hkm-terminal-body",
179
- "data-hkm-density": density === "presentation" ? density : undefined,
180
- "data-hkm-fade": fades ? "" : undefined,
181
- style: pageStyle(height),
182
- children: /* @__PURE__ */ jsxs("div", {
183
- className: "hkm-terminal-lines",
184
- children: [
185
- lines.map((line, index) => /* @__PURE__ */ jsxs("div", {
186
- className: "hkm-terminal-line",
187
- "data-hkm-beat": line.beat,
188
- "data-hkm-line": line.kind,
189
- "data-hkm-tone": line.tone,
190
- children: [
191
- line.kind === "input" ? /* @__PURE__ */ jsx("span", {
192
- className: "hkm-terminal-prompt",
193
- children: prompt
194
- }) : null,
195
- line.kind === "comment" ? /* @__PURE__ */ jsx("span", {
196
- className: "hkm-terminal-prompt",
197
- children: "#"
198
- }) : null,
199
- /* @__PURE__ */ jsx(SampleText, {
200
- ...optOutProps(root.optOut),
201
- children: line.text
202
- })
203
- ]
204
- }, index)),
205
- /* @__PURE__ */ jsxs("div", {
206
- "aria-hidden": "true",
207
- className: "hkm-terminal-line",
208
- "data-hkm-line": "input",
209
- children: [
210
- /* @__PURE__ */ jsx("span", {
211
- className: "hkm-terminal-prompt",
212
- children: prompt
213
- }),
214
- /* @__PURE__ */ jsx("span", {
215
- className: "hkm-caret"
216
- })
217
- ]
218
- })
219
- ]
220
- })
221
- })
222
- ]
223
- })
224
- });
225
- }
226
- function MacWindow({
227
- children,
228
- sidebar,
229
- title,
230
- toolbar,
231
- ...root
232
- }) {
233
- return /* @__PURE__ */ jsx(MockupRoot, {
234
- ...root,
235
- kind: "app-window",
236
- children: /* @__PURE__ */ jsxs("div", {
237
- className: "hkm-window",
238
- "data-hkm-sidebar": sidebar === undefined ? undefined : "",
239
- children: [
240
- sidebar === undefined ? null : /* @__PURE__ */ jsxs("div", {
241
- className: "hkm-app-sidebar",
242
- children: [
243
- /* @__PURE__ */ jsx(WindowLights, {}),
244
- /* @__PURE__ */ jsx("div", {
245
- className: "hkm-app-sidebar-body",
246
- children: sidebar
247
- })
248
- ]
249
- }),
250
- /* @__PURE__ */ jsxs("div", {
251
- className: "hkm-app-main",
252
- children: [
253
- /* @__PURE__ */ jsxs("div", {
254
- className: "hkm-title-bar hkm-app-bar",
255
- children: [
256
- sidebar === undefined ? /* @__PURE__ */ jsx(WindowLights, {}) : /* @__PURE__ */ jsx("span", {}),
257
- /* @__PURE__ */ jsx("span", {
258
- className: "hkm-title",
259
- children: title
260
- }),
261
- /* @__PURE__ */ jsx("span", {
262
- className: "hkm-app-tools",
263
- children: toolbar
264
- })
265
- ]
266
- }),
267
- /* @__PURE__ */ jsx("div", {
268
- className: "hkm-app-content",
269
- children
270
- })
271
- ]
272
- })
273
- ]
274
- })
275
- });
276
- }
277
- function MenuBarPopover({
278
- footer,
279
- items,
280
- mark,
281
- title,
282
- ...root
283
- }) {
284
- const ids = new Set;
285
- for (const item of items) {
286
- if (ids.has(item.id))
287
- throw new RangeError(`MenuBarPopover item ids must be unique: ${item.id}`);
288
- ids.add(item.id);
289
- }
290
- return /* @__PURE__ */ jsxs(MockupRoot, {
291
- ...root,
292
- kind: "menubar",
293
- children: [
294
- /* @__PURE__ */ jsxs("div", {
295
- "aria-hidden": "true",
296
- className: "hkm-menubar",
297
- children: [
298
- /* @__PURE__ */ jsx("span", {
299
- className: "hkm-menubar-spacer"
300
- }),
301
- /* @__PURE__ */ jsx(MockupGlyph, {
302
- name: "search",
303
- size: 14
304
- }),
305
- /* @__PURE__ */ jsx("span", {
306
- className: "hkm-menubar-item",
307
- "data-hkm-open": "",
308
- children: mark ?? /* @__PURE__ */ jsx("span", {
309
- className: "hkm-menubar-dot"
310
- })
311
- }),
312
- /* @__PURE__ */ jsx("span", {
313
- className: "hkm-menubar-clock",
314
- children: "9:41"
315
- })
316
- ]
317
- }),
318
- /* @__PURE__ */ jsxs("div", {
319
- className: "hkm-popover",
320
- children: [
321
- title === undefined ? null : /* @__PURE__ */ jsx("div", {
322
- className: "hkm-popover-title",
323
- children: title
324
- }),
325
- /* @__PURE__ */ jsx("ul", {
326
- className: "hkm-popover-list",
327
- children: items.map((item) => /* @__PURE__ */ jsxs("li", {
328
- className: "hkm-popover-item",
329
- "data-hkm-selected": item.selected === true ? "" : undefined,
330
- "data-hkm-tone": item.tone,
331
- children: [
332
- /* @__PURE__ */ jsx("span", {
333
- className: "hkm-popover-dot"
334
- }),
335
- /* @__PURE__ */ jsxs("span", {
336
- className: "hkm-popover-text",
337
- children: [
338
- /* @__PURE__ */ jsx("span", {
339
- className: "hkm-popover-label",
340
- children: /* @__PURE__ */ jsx(SampleText, {
341
- ...optOutProps(root.optOut),
342
- children: item.label
343
- })
344
- }),
345
- item.detail === undefined ? null : /* @__PURE__ */ jsx("span", {
346
- className: "hkm-popover-detail",
347
- children: /* @__PURE__ */ jsx(SampleText, {
348
- ...optOutProps(root.optOut),
349
- children: item.detail
350
- })
351
- })
352
- ]
353
- })
354
- ]
355
- }, item.id))
356
- }),
357
- footer === undefined ? null : /* @__PURE__ */ jsx("div", {
358
- className: "hkm-popover-footer",
359
- children: footer
360
- })
361
- ]
362
- })
363
- ]
364
- });
365
- }
366
- function PhoneFrame({
367
- children,
368
- screenHeight,
369
- statusTime,
370
- width,
371
- ...root
372
- }) {
373
- return /* @__PURE__ */ jsx(MockupRoot, {
374
- ...root,
375
- kind: "phone",
376
- style: phoneStyle(width, screenHeight),
377
- children: /* @__PURE__ */ jsx(PhoneShell, {
378
- ...statusTime === undefined ? {} : {
379
- statusTime
380
- },
381
- children: /* @__PURE__ */ jsx("div", {
382
- className: "hkm-phone-body",
383
- children
384
- })
385
- })
386
- });
387
- }
388
- function phoneStyle(width, screenHeight) {
389
- const style = {};
390
- if (width !== undefined) {
391
- if (!(width > 0))
392
- throw new RangeError("A phone mockup width must be positive.");
393
- style["--hkm-phone-width"] = `${width}px`;
394
- }
395
- if (screenHeight !== undefined) {
396
- if (!(screenHeight >= 200 && screenHeight <= 844))
397
- throw new RangeError("A phone mockup screenHeight must be 200 to 844 points.");
398
- style["--hkm-phone-height"] = String(screenHeight + 22);
399
- }
400
- return Object.keys(style).length === 0 ? undefined : style;
401
- }
402
- function PhoneShell({
403
- children,
404
- statusTime = "9:41"
405
- }) {
406
- return /* @__PURE__ */ jsxs("div", {
407
- className: "hkm-device",
408
- children: [
409
- /* @__PURE__ */ jsx("span", {
410
- "aria-hidden": "true",
411
- className: "hkm-device-button",
412
- "data-hkm-button": "action"
413
- }),
414
- /* @__PURE__ */ jsx("span", {
415
- "aria-hidden": "true",
416
- className: "hkm-device-button",
417
- "data-hkm-button": "volume-up"
418
- }),
419
- /* @__PURE__ */ jsx("span", {
420
- "aria-hidden": "true",
421
- className: "hkm-device-button",
422
- "data-hkm-button": "volume-down"
423
- }),
424
- /* @__PURE__ */ jsx("span", {
425
- "aria-hidden": "true",
426
- className: "hkm-device-button",
427
- "data-hkm-button": "power"
428
- }),
429
- /* @__PURE__ */ jsx("div", {
430
- className: "hkm-bezel",
431
- children: /* @__PURE__ */ jsxs("div", {
432
- className: "hkm-screen",
433
- children: [
434
- /* @__PURE__ */ jsx("div", {
435
- className: "hkm-screen-content",
436
- children
437
- }),
438
- /* @__PURE__ */ jsxs("div", {
439
- "aria-hidden": "true",
440
- className: "hkm-status-bar",
441
- children: [
442
- /* @__PURE__ */ jsx("span", {
443
- className: "hkm-status-time",
444
- children: statusTime
445
- }),
446
- /* @__PURE__ */ jsxs("span", {
447
- className: "hkm-status-glyphs",
448
- children: [
449
- /* @__PURE__ */ jsxs("svg", {
450
- className: "hkm-status-cell",
451
- viewBox: "0 0 19 12",
452
- children: [
453
- /* @__PURE__ */ jsx("rect", {
454
- height: "4.5",
455
- rx: "0.9",
456
- width: "3.2",
457
- x: "0",
458
- y: "7.5"
459
- }),
460
- /* @__PURE__ */ jsx("rect", {
461
- height: "6.8",
462
- rx: "0.9",
463
- width: "3.2",
464
- x: "5.1",
465
- y: "5.2"
466
- }),
467
- /* @__PURE__ */ jsx("rect", {
468
- height: "9.3",
469
- rx: "0.9",
470
- width: "3.2",
471
- x: "10.2",
472
- y: "2.7"
473
- }),
474
- /* @__PURE__ */ jsx("rect", {
475
- height: "12",
476
- rx: "0.9",
477
- width: "3.2",
478
- x: "15.3",
479
- y: "0"
480
- })
481
- ]
482
- }),
483
- /* @__PURE__ */ jsxs("svg", {
484
- className: "hkm-status-wifi",
485
- viewBox: "0 0 17 12.3",
486
- children: [
487
- /* @__PURE__ */ jsx("path", {
488
- d: "M8.5 2.6c2.4 0 4.6.9 6.2 2.4.2.2.5.2.7 0l1.2-1.2c.2-.2.2-.5 0-.7C14.5 1.2 11.6 0 8.5 0S2.5 1.2.4 3.1c-.2.2-.2.5 0 .7L1.6 5c.2.2.5.2.7 0C3.9 3.5 6.1 2.6 8.5 2.6Z"
489
- }),
490
- /* @__PURE__ */ jsx("path", {
491
- d: "M8.5 6.4c1.3 0 2.5.5 3.5 1.3.2.2.5.2.7 0l1.2-1.2c.2-.2.2-.5 0-.7-1.4-1.3-3.3-2-5.4-2s-4 .7-5.4 2c-.2.2-.2.5 0 .7l1.2 1.2c.2.2.5.2.7 0 1-.8 2.2-1.3 3.5-1.3Z"
492
- }),
493
- /* @__PURE__ */ jsx("path", {
494
- d: "M11.1 9.4c.2-.2.2-.5 0-.7-.7-.6-1.6-1-2.6-1s-1.9.4-2.6 1c-.2.2-.2.5 0 .7l2.2 2.2c.2.2.5.2.7 0l2.3-2.2Z"
495
- })
496
- ]
497
- }),
498
- /* @__PURE__ */ jsxs("svg", {
499
- className: "hkm-status-battery",
500
- viewBox: "0 0 27.4 13",
501
- children: [
502
- /* @__PURE__ */ jsx("rect", {
503
- fill: "none",
504
- height: "12",
505
- rx: "3.8",
506
- stroke: "currentColor",
507
- strokeOpacity: "0.35",
508
- width: "24",
509
- x: "0.5",
510
- y: "0.5"
511
- }),
512
- /* @__PURE__ */ jsx("rect", {
513
- height: "9",
514
- rx: "2.5",
515
- width: "21",
516
- x: "2",
517
- y: "2"
518
- }),
519
- /* @__PURE__ */ jsx("path", {
520
- d: "M26 4.4v4.2c.8-.3 1.4-1.1 1.4-2.1S26.8 4.7 26 4.4Z",
521
- fillOpacity: "0.4"
522
- })
523
- ]
524
- })
525
- ]
526
- })
527
- ]
528
- }),
529
- /* @__PURE__ */ jsx("span", {
530
- "aria-hidden": "true",
531
- className: "hkm-island"
532
- }),
533
- /* @__PURE__ */ jsx("span", {
534
- "aria-hidden": "true",
535
- className: "hkm-home-indicator"
536
- })
537
- ]
538
- })
539
- })
540
- ]
541
- });
542
- }
543
- function AgentSession({
544
- agent,
545
- fade,
546
- height,
547
- title,
548
- turns,
549
- ...root
550
- }) {
551
- if (agent !== "generic-cli" && agent !== "generic-chat")
552
- throw new TypeError(`Unknown agent chrome ${JSON.stringify(agent)}.`);
553
- const fades = fade ?? height !== undefined;
554
- const sample = optOutProps(root.optOut);
555
- return /* @__PURE__ */ jsx(MockupRoot, {
556
- ...root,
557
- kind: "agent",
558
- children: /* @__PURE__ */ jsxs("div", {
559
- className: "hkm-window",
560
- "data-hkm-agent": agent,
561
- children: [
562
- /* @__PURE__ */ jsxs("div", {
563
- "aria-hidden": "true",
564
- className: "hkm-title-bar",
565
- children: [
566
- /* @__PURE__ */ jsx(WindowLights, {}),
567
- /* @__PURE__ */ jsx("span", {
568
- className: "hkm-title",
569
- children: title ?? (agent === "generic-cli" ? "Coding agent" : "Assistant")
570
- }),
571
- /* @__PURE__ */ jsx("span", {})
572
- ]
573
- }),
574
- /* @__PURE__ */ jsx("div", {
575
- className: "hkm-page hkm-agent-body",
576
- "data-hkm-fade": fades ? "" : undefined,
577
- style: pageStyle(height),
578
- children: /* @__PURE__ */ jsx("ol", {
579
- className: "hkm-agent-turns",
580
- children: turns.map((turn, index) => /* @__PURE__ */ jsx("li", {
581
- className: "hkm-agent-turn",
582
- "data-hkm-beat": turn.beat,
583
- "data-hkm-role": turn.role,
584
- "data-hkm-tone": turn.status,
585
- children: turn.role === "tool" ? /* @__PURE__ */ jsxs("span", {
586
- className: "hkm-agent-tool",
587
- children: [
588
- /* @__PURE__ */ jsxs("span", {
589
- className: "hkm-agent-tool-name",
590
- children: [
591
- /* @__PURE__ */ jsx("span", {
592
- className: "hkm-agent-status"
593
- }),
594
- turn.tool ?? "Tool"
595
- ]
596
- }),
597
- /* @__PURE__ */ jsx("span", {
598
- className: "hkm-agent-tool-output",
599
- children: /* @__PURE__ */ jsx(SampleText, {
600
- ...sample,
601
- children: turn.text
602
- })
603
- })
604
- ]
605
- }) : /* @__PURE__ */ jsxs(Fragment, {
606
- children: [
607
- /* @__PURE__ */ jsx("span", {
608
- "aria-hidden": "true",
609
- className: "hkm-agent-marker",
610
- children: turn.role === "user" ? "›" : /* @__PURE__ */ jsx(MockupGlyph, {
611
- name: "sparkle",
612
- size: 14
613
- })
614
- }),
615
- /* @__PURE__ */ jsx("span", {
616
- className: "hkm-agent-text",
617
- children: /* @__PURE__ */ jsx(SampleText, {
618
- ...sample,
619
- children: turn.text
620
- })
621
- })
622
- ]
623
- })
624
- }, index))
625
- })
626
- }),
627
- agent === "generic-chat" ? /* @__PURE__ */ jsxs("div", {
628
- "aria-hidden": "true",
629
- className: "hkm-agent-composer",
630
- children: [
631
- /* @__PURE__ */ jsx("span", {
632
- className: "hkm-agent-composer-field",
633
- children: "Ask for a change"
634
- }),
635
- /* @__PURE__ */ jsx("span", {
636
- className: "hkm-agent-composer-send",
637
- children: /* @__PURE__ */ jsx(MockupGlyph, {
638
- name: "send",
639
- size: 14
640
- })
641
- })
642
- ]
643
- }) : null
644
- ]
645
- })
646
- });
647
- }
648
- // src/mockups/surfaces.tsx
649
- import { Fragment as Fragment2 } from "react";
650
- import { jsx as jsx2, jsxs as jsxs2, Fragment as Fragment3 } from "react/jsx-runtime";
651
- function sample(optOut) {
652
- return optOut === undefined ? {} : {
653
- optOut
654
- };
655
- }
656
- function counted(value, noun) {
657
- return `${compact(value)} ${value === 1 ? noun : `${noun}s`}`;
658
- }
659
- function assertUniqueKeys(keys, component) {
660
- const seen = new Set;
661
- for (const key of keys) {
662
- if (seen.has(key))
663
- throw new RangeError(`${component} keys must be unique: ${key}`);
664
- seen.add(key);
665
- }
666
- }
667
- function chatSide(from) {
668
- return from === "me" ? "out" : "in";
669
- }
670
- var TAIL_PATH = "M-16 -17.5H0C0 -7.6 1.7 -2.4 6.4 -0.45 6.95 -0.2 6.85 0.45 6.2 0.5 2.6 0.7 -1.2 -0.6 -3.4 -2.5 -4.3 -3.3 -5.2 -4.1 -6 -4.9L-16 -17.5Z";
671
- function isEmojiOnly(text) {
672
- const trimmed = text.trim();
673
- if (trimmed === "")
674
- return false;
675
- if (!/^(?:[\u{1F000}-\u{1FAFF}\u{2600}-\u{27BF}\u{2B00}-\u{2BFF}\u{2300}-\u{23FF}\u{1F1E6}-\u{1F1FF}\u{E0020}-\u{E007F}©®‼⁉™ℹ]|‍|️|⃣|\s)+$/u.test(trimmed))
676
- return false;
677
- if (/[0-9#*]/u.test(trimmed))
678
- return false;
679
- const segmenter = new Intl.Segmenter(undefined, {
680
- granularity: "grapheme"
681
- });
682
- return [...segmenter.segment(trimmed.replace(/\s+/gu, ""))].length <= 3;
683
- }
684
- function ChatThread({
685
- contact,
686
- device = "phone",
687
- messages,
688
- screenHeight,
689
- statusTime,
690
- typing = false,
691
- variant = "bubbles",
692
- via,
693
- visibleCount,
694
- width,
695
- ...root
696
- }) {
697
- if (variant !== "bubbles" && variant !== "chat")
698
- throw new TypeError(`Unknown chat variant ${JSON.stringify(variant)}.`);
699
- const count = visibleCount ?? messages.length;
700
- if (!Number.isInteger(count) || count < 0 || count > messages.length)
701
- throw new RangeError("ChatThread visibleCount must be 0 to messages.length.");
702
- const shown = messages.slice(0, count);
703
- const sides = shown.map((message) => chatSide(message.from));
704
- const lastOut = sides.lastIndexOf("out") === sides.length - 1 && !typing ? sides.length - 1 : -1;
705
- const screen = /* @__PURE__ */ jsxs2("div", {
706
- className: "hkm-chat",
707
- "data-hkm-chat": variant,
708
- "data-hkm-via": via === undefined ? undefined : "",
709
- children: [
710
- /* @__PURE__ */ jsx2("div", {
711
- className: "hkm-chat-thread",
712
- children: /* @__PURE__ */ jsxs2("div", {
713
- className: "hkm-chat-inner",
714
- children: [
715
- shown.map((message, index) => {
716
- const side = sides[index] ?? "in";
717
- const first = index === 0 || sides[index - 1] !== side || message.time !== undefined;
718
- const next = shown[index + 1];
719
- const last = index === shown.length - 1 || sides[index + 1] !== side || next?.time !== undefined;
720
- const emoji = isEmojiOnly(message.text);
721
- const tail = variant === "chat" ? first ? "top" : undefined : last && !emoji ? "bottom" : undefined;
722
- return /* @__PURE__ */ jsxs2(Fragment2, {
723
- children: [
724
- message.time === undefined ? null : /* @__PURE__ */ jsx2("div", {
725
- className: "hkm-chat-divider",
726
- children: /* @__PURE__ */ jsx2(SampleText, {
727
- ...sample(root.optOut),
728
- children: message.time
729
- })
730
- }),
731
- /* @__PURE__ */ jsxs2("div", {
732
- className: "hkm-chat-row",
733
- "data-hkm-first": first ? "" : undefined,
734
- "data-hkm-from": message.from,
735
- "data-hkm-last": last ? "" : undefined,
736
- "data-hkm-side": side,
737
- children: [
738
- /* @__PURE__ */ jsxs2("div", {
739
- className: "hkm-bubble",
740
- "data-hkm-emoji": emoji ? "" : undefined,
741
- "data-hkm-tail": tail,
742
- children: [
743
- /* @__PURE__ */ jsx2(SampleText, {
744
- ...sample(root.optOut),
745
- children: message.text
746
- }),
747
- tail === "bottom" ? /* @__PURE__ */ jsx2("svg", {
748
- "aria-hidden": "true",
749
- className: "hkm-bubble-tail",
750
- focusable: "false",
751
- viewBox: "-16 -17.5 23 18",
752
- children: /* @__PURE__ */ jsx2("path", {
753
- d: TAIL_PATH
754
- })
755
- }) : null
756
- ]
757
- }),
758
- message.label === undefined ? null : /* @__PURE__ */ jsx2("span", {
759
- className: "hkm-chat-label",
760
- children: message.label
761
- })
762
- ]
763
- }),
764
- index === lastOut && variant === "bubbles" ? /* @__PURE__ */ jsx2("div", {
765
- className: "hkm-chat-receipt",
766
- children: "Delivered"
767
- }) : null
768
- ]
769
- }, message.id ?? index);
770
- }),
771
- typing ? /* @__PURE__ */ jsx2("div", {
772
- className: "hkm-chat-row",
773
- "data-hkm-first": "",
774
- "data-hkm-last": "",
775
- "data-hkm-side": "in",
776
- children: /* @__PURE__ */ jsx2(TypingIndicator, {})
777
- }) : null
778
- ]
779
- })
780
- }),
781
- /* @__PURE__ */ jsxs2("div", {
782
- "aria-hidden": "true",
783
- className: "hkm-chat-nav",
784
- children: [
785
- /* @__PURE__ */ jsx2("span", {
786
- className: "hkm-chat-back",
787
- children: /* @__PURE__ */ jsx2(MockupGlyph, {
788
- name: "back",
789
- size: 22
790
- })
791
- }),
792
- /* @__PURE__ */ jsxs2("span", {
793
- className: "hkm-chat-contact",
794
- children: [
795
- /* @__PURE__ */ jsx2(Avatar, {
796
- name: contact ?? "Contact",
797
- size: variant === "chat" ? 32 : 44
798
- }),
799
- /* @__PURE__ */ jsx2("span", {
800
- className: "hkm-chat-name",
801
- children: contact ?? "Contact"
802
- }),
803
- via === undefined ? null : /* @__PURE__ */ jsx2("span", {
804
- className: "hkm-chat-via",
805
- children: via
806
- })
807
- ]
808
- }),
809
- /* @__PURE__ */ jsx2("span", {
810
- className: "hkm-chat-call",
811
- children: /* @__PURE__ */ jsx2(MockupGlyph, {
812
- name: "comment",
813
- size: 18
814
- })
815
- })
816
- ]
817
- }),
818
- /* @__PURE__ */ jsxs2("div", {
819
- "aria-hidden": "true",
820
- className: "hkm-chat-composer",
821
- children: [
822
- /* @__PURE__ */ jsx2("span", {
823
- className: "hkm-chat-plus",
824
- children: /* @__PURE__ */ jsx2(MockupGlyph, {
825
- name: "plus",
826
- size: 16
827
- })
828
- }),
829
- /* @__PURE__ */ jsx2("span", {
830
- className: "hkm-chat-field",
831
- children: "Message"
832
- })
833
- ]
834
- })
835
- ]
836
- });
837
- return /* @__PURE__ */ jsx2(MockupRoot, {
838
- ...root,
839
- kind: "chat",
840
- style: device === "phone" ? phoneStyle(width, screenHeight) : undefined,
841
- children: device === "phone" ? /* @__PURE__ */ jsx2(PhoneShell, {
842
- ...statusTime === undefined ? {} : {
843
- statusTime
844
- },
845
- children: screen
846
- }) : /* @__PURE__ */ jsx2("div", {
847
- className: "hkm-chat-bare",
848
- children: screen
849
- })
850
- });
851
- }
852
- function TypingIndicator() {
853
- return /* @__PURE__ */ jsxs2("span", {
854
- "aria-hidden": "true",
855
- className: "hkm-typing",
856
- children: [
857
- /* @__PURE__ */ jsx2("i", {}),
858
- /* @__PURE__ */ jsx2("i", {}),
859
- /* @__PURE__ */ jsx2("i", {})
860
- ]
861
- });
862
- }
863
- function keyed(posts, postKey, component) {
864
- const keys = posts.map((post, index) => postKey === undefined ? String(index) : postKey(post, index));
865
- assertUniqueKeys(keys, component);
866
- return keys;
867
- }
868
- var SOCIAL_RAIL = [["home", "Home"], ["search", "Explore"], ["bell", "Notifications"], ["mail", "Messages"], ["bookmark", "Saved"], ["user", "Profile"]];
869
- function SocialFeed({
870
- aside,
871
- height,
872
- postKey,
873
- posts,
874
- renderPost,
875
- url = "social.example/home",
876
- viewer = "Alex Moreno",
877
- ...root
878
- }) {
879
- const keys = keyed(posts, postKey, "SocialFeed");
880
- return /* @__PURE__ */ jsx2(MockupRoot, {
881
- ...root,
882
- kind: "social",
883
- children: /* @__PURE__ */ jsx2(BrowserWindow, {
884
- ...height === undefined ? {} : {
885
- height
886
- },
887
- url,
888
- children: /* @__PURE__ */ jsxs2("div", {
889
- className: "hkm-social",
890
- children: [
891
- /* @__PURE__ */ jsxs2("div", {
892
- "aria-hidden": "true",
893
- className: "hkm-social-rail",
894
- children: [
895
- /* @__PURE__ */ jsx2("span", {
896
- className: "hkm-social-mark",
897
- children: /* @__PURE__ */ jsx2(MockupGlyph, {
898
- name: "sparkle",
899
- size: 22
900
- })
901
- }),
902
- SOCIAL_RAIL.map(([glyph, label], index) => /* @__PURE__ */ jsxs2("span", {
903
- className: "hkm-rail-item",
904
- "data-hkm-active": index === 0 ? "" : undefined,
905
- children: [
906
- /* @__PURE__ */ jsx2(MockupGlyph, {
907
- filled: index === 0,
908
- name: glyph,
909
- size: 22
910
- }),
911
- /* @__PURE__ */ jsx2("span", {
912
- className: "hkm-rail-label",
913
- children: label
914
- })
915
- ]
916
- }, label)),
917
- /* @__PURE__ */ jsxs2("span", {
918
- className: "hkm-rail-cta",
919
- children: [
920
- /* @__PURE__ */ jsx2("span", {
921
- className: "hkm-rail-label",
922
- children: "Post"
923
- }),
924
- /* @__PURE__ */ jsx2(MockupGlyph, {
925
- className: "hkm-rail-cta-glyph",
926
- name: "pencil",
927
- size: 18
928
- })
929
- ]
930
- }),
931
- /* @__PURE__ */ jsxs2("span", {
932
- className: "hkm-rail-me",
933
- children: [
934
- /* @__PURE__ */ jsx2(Avatar, {
935
- name: viewer,
936
- size: 32
937
- }),
938
- /* @__PURE__ */ jsx2("span", {
939
- className: "hkm-rail-label",
940
- children: viewer
941
- })
942
- ]
943
- })
944
- ]
945
- }),
946
- /* @__PURE__ */ jsxs2("div", {
947
- className: "hkm-social-main",
948
- children: [
949
- /* @__PURE__ */ jsxs2("div", {
950
- "aria-hidden": "true",
951
- className: "hkm-social-tabs",
952
- children: [
953
- /* @__PURE__ */ jsx2("span", {
954
- "data-hkm-active": "",
955
- children: "For you"
956
- }),
957
- /* @__PURE__ */ jsx2("span", {
958
- children: "Following"
959
- })
960
- ]
961
- }),
962
- /* @__PURE__ */ jsxs2("div", {
963
- "aria-hidden": "true",
964
- className: "hkm-social-compose",
965
- children: [
966
- /* @__PURE__ */ jsx2(Avatar, {
967
- name: viewer,
968
- size: 36
969
- }),
970
- /* @__PURE__ */ jsx2("span", {
971
- className: "hkm-social-compose-field",
972
- children: "Share something"
973
- }),
974
- /* @__PURE__ */ jsx2("span", {
975
- className: "hkm-social-compose-button",
976
- children: "Post"
977
- })
978
- ]
979
- }),
980
- /* @__PURE__ */ jsx2("div", {
981
- className: "hkm-feed",
982
- children: posts.map((post, index) => /* @__PURE__ */ jsx2(Fragment2, {
983
- children: renderPost(post, index)
984
- }, keys[index]))
985
- })
986
- ]
987
- }),
988
- /* @__PURE__ */ jsx2("div", {
989
- "aria-hidden": "true",
990
- className: "hkm-social-aside",
991
- children: aside ?? /* @__PURE__ */ jsxs2(Fragment3, {
992
- children: [
993
- /* @__PURE__ */ jsxs2("span", {
994
- className: "hkm-search-field",
995
- children: [
996
- /* @__PURE__ */ jsx2(MockupGlyph, {
997
- name: "search",
998
- size: 14
999
- }),
1000
- "Search"
1001
- ]
1002
- }),
1003
- /* @__PURE__ */ jsxs2("span", {
1004
- className: "hkm-card hkm-aside-card",
1005
- children: [
1006
- /* @__PURE__ */ jsx2("span", {
1007
- className: "hkm-aside-title",
1008
- children: "Trending"
1009
- }),
1010
- ["Night markets", "Rail timetables", "Sourdough"].map((topic) => /* @__PURE__ */ jsx2("span", {
1011
- className: "hkm-aside-line",
1012
- children: topic
1013
- }, topic))
1014
- ]
1015
- })
1016
- ]
1017
- })
1018
- })
1019
- ]
1020
- })
1021
- })
1022
- });
1023
- }
1024
- function SocialPost({
1025
- attributes,
1026
- counts,
1027
- handle,
1028
- name,
1029
- optOut,
1030
- overlay,
1031
- photo,
1032
- text,
1033
- time
1034
- }) {
1035
- return /* @__PURE__ */ jsxs2("div", {
1036
- ...attributes,
1037
- className: "hkm-unit hkm-post",
1038
- children: [
1039
- overlay,
1040
- /* @__PURE__ */ jsx2(Avatar, {
1041
- name,
1042
- size: 40
1043
- }),
1044
- /* @__PURE__ */ jsxs2("div", {
1045
- className: "hkm-post-body",
1046
- children: [
1047
- /* @__PURE__ */ jsxs2("div", {
1048
- className: "hkm-post-head",
1049
- children: [
1050
- /* @__PURE__ */ jsx2("b", {
1051
- children: /* @__PURE__ */ jsx2(SampleText, {
1052
- ...sample(optOut),
1053
- children: name
1054
- })
1055
- }),
1056
- /* @__PURE__ */ jsx2("span", {
1057
- className: "hkm-muted",
1058
- children: /* @__PURE__ */ jsxs2(SampleText, {
1059
- ...sample(optOut),
1060
- children: [
1061
- "@",
1062
- handle,
1063
- " · ",
1064
- time
1065
- ]
1066
- })
1067
- }),
1068
- /* @__PURE__ */ jsx2("span", {
1069
- "aria-hidden": "true",
1070
- className: "hkm-muted hkm-post-more",
1071
- children: /* @__PURE__ */ jsx2(MockupGlyph, {
1072
- name: "more",
1073
- size: 18
1074
- })
1075
- })
1076
- ]
1077
- }),
1078
- /* @__PURE__ */ jsx2("div", {
1079
- className: "hkm-post-text",
1080
- children: /* @__PURE__ */ jsx2(SampleParagraphs, {
1081
- ...sample(optOut),
1082
- text
1083
- })
1084
- }),
1085
- photo === undefined ? null : /* @__PURE__ */ jsx2(PlaceholderPhoto, {
1086
- className: "hkm-post-photo",
1087
- seed: photo
1088
- }),
1089
- counts === undefined ? null : /* @__PURE__ */ jsxs2("div", {
1090
- "aria-hidden": "true",
1091
- className: "hkm-post-actions hkm-muted",
1092
- children: [
1093
- /* @__PURE__ */ jsxs2("span", {
1094
- children: [
1095
- /* @__PURE__ */ jsx2(MockupGlyph, {
1096
- name: "reply",
1097
- size: 17
1098
- }),
1099
- compact(counts[0])
1100
- ]
1101
- }),
1102
- /* @__PURE__ */ jsxs2("span", {
1103
- children: [
1104
- /* @__PURE__ */ jsx2(MockupGlyph, {
1105
- name: "repost",
1106
- size: 17
1107
- }),
1108
- compact(counts[1])
1109
- ]
1110
- }),
1111
- /* @__PURE__ */ jsxs2("span", {
1112
- children: [
1113
- /* @__PURE__ */ jsx2(MockupGlyph, {
1114
- name: "heart",
1115
- size: 17
1116
- }),
1117
- compact(counts[2])
1118
- ]
1119
- }),
1120
- /* @__PURE__ */ jsxs2("span", {
1121
- children: [
1122
- /* @__PURE__ */ jsx2(MockupGlyph, {
1123
- name: "chart",
1124
- size: 17
1125
- }),
1126
- compact(counts[3])
1127
- ]
1128
- }),
1129
- /* @__PURE__ */ jsx2("span", {
1130
- className: "hkm-post-actions-end",
1131
- children: /* @__PURE__ */ jsx2(MockupGlyph, {
1132
- name: "share",
1133
- size: 17
1134
- })
1135
- })
1136
- ]
1137
- })
1138
- ]
1139
- })
1140
- ]
1141
- });
1142
- }
1143
- function WorkFeed({
1144
- aside,
1145
- height,
1146
- postKey,
1147
- posts,
1148
- renderPost,
1149
- url = "network.example/feed",
1150
- viewer = "Alex Moreno",
1151
- ...root
1152
- }) {
1153
- const keys = keyed(posts, postKey, "WorkFeed");
1154
- return /* @__PURE__ */ jsx2(MockupRoot, {
1155
- ...root,
1156
- kind: "work",
1157
- children: /* @__PURE__ */ jsxs2(BrowserWindow, {
1158
- ...height === undefined ? {} : {
1159
- height
1160
- },
1161
- url,
1162
- children: [
1163
- /* @__PURE__ */ jsxs2("div", {
1164
- "aria-hidden": "true",
1165
- className: "hkm-work-top",
1166
- children: [
1167
- /* @__PURE__ */ jsx2("span", {
1168
- className: "hkm-work-mark",
1169
- children: /* @__PURE__ */ jsx2(MockupGlyph, {
1170
- name: "grid",
1171
- size: 18
1172
- })
1173
- }),
1174
- /* @__PURE__ */ jsxs2("span", {
1175
- className: "hkm-search-field",
1176
- children: [
1177
- /* @__PURE__ */ jsx2(MockupGlyph, {
1178
- name: "search",
1179
- size: 14
1180
- }),
1181
- "Search"
1182
- ]
1183
- }),
1184
- /* @__PURE__ */ jsxs2("span", {
1185
- className: "hkm-work-nav",
1186
- children: [
1187
- ["home", "people", "comment", "bell"].map((glyph, index) => /* @__PURE__ */ jsx2("span", {
1188
- "data-hkm-active": index === 0 ? "" : undefined,
1189
- children: /* @__PURE__ */ jsx2(MockupGlyph, {
1190
- filled: index === 0,
1191
- name: glyph,
1192
- size: 20
1193
- })
1194
- }, glyph)),
1195
- /* @__PURE__ */ jsx2(Avatar, {
1196
- name: viewer,
1197
- size: 22
1198
- })
1199
- ]
1200
- })
1201
- ]
1202
- }),
1203
- /* @__PURE__ */ jsxs2("div", {
1204
- className: "hkm-work",
1205
- children: [
1206
- /* @__PURE__ */ jsx2("div", {
1207
- "aria-hidden": "true",
1208
- className: "hkm-work-left",
1209
- children: /* @__PURE__ */ jsxs2("span", {
1210
- className: "hkm-card hkm-work-profile",
1211
- children: [
1212
- /* @__PURE__ */ jsx2("span", {
1213
- className: "hkm-work-cover"
1214
- }),
1215
- /* @__PURE__ */ jsx2(Avatar, {
1216
- name: viewer,
1217
- size: 56
1218
- }),
1219
- /* @__PURE__ */ jsx2("b", {
1220
- children: viewer
1221
- }),
1222
- /* @__PURE__ */ jsx2("span", {
1223
- className: "hkm-muted",
1224
- children: "Product designer"
1225
- })
1226
- ]
1227
- })
1228
- }),
1229
- /* @__PURE__ */ jsxs2("div", {
1230
- className: "hkm-work-main",
1231
- children: [
1232
- /* @__PURE__ */ jsxs2("div", {
1233
- "aria-hidden": "true",
1234
- className: "hkm-card hkm-work-compose",
1235
- children: [
1236
- /* @__PURE__ */ jsx2(Avatar, {
1237
- name: viewer,
1238
- size: 40
1239
- }),
1240
- /* @__PURE__ */ jsx2("span", {
1241
- className: "hkm-social-compose-field",
1242
- children: "Start a post"
1243
- })
1244
- ]
1245
- }),
1246
- posts.map((post, index) => /* @__PURE__ */ jsx2(Fragment2, {
1247
- children: renderPost(post, index)
1248
- }, keys[index]))
1249
- ]
1250
- }),
1251
- /* @__PURE__ */ jsx2("div", {
1252
- "aria-hidden": "true",
1253
- className: "hkm-work-right",
1254
- children: aside ?? /* @__PURE__ */ jsxs2("span", {
1255
- className: "hkm-card hkm-aside-card",
1256
- children: [
1257
- /* @__PURE__ */ jsx2("span", {
1258
- className: "hkm-aside-title",
1259
- children: "Network news"
1260
- }),
1261
- ["Teams try shorter weeks", "Bakeries hire for nights", "Fewer meetings, same output"].map((topic) => /* @__PURE__ */ jsx2("span", {
1262
- className: "hkm-aside-line",
1263
- children: topic
1264
- }, topic))
1265
- ]
1266
- })
1267
- })
1268
- ]
1269
- })
1270
- ]
1271
- })
1272
- });
1273
- }
1274
- function WorkPost({
1275
- attributes,
1276
- comment,
1277
- headline,
1278
- name,
1279
- optOut,
1280
- overlay,
1281
- photo,
1282
- reactions,
1283
- text,
1284
- time
1285
- }) {
1286
- return /* @__PURE__ */ jsxs2("div", {
1287
- ...attributes,
1288
- className: "hkm-unit hkm-card hkm-work-post",
1289
- children: [
1290
- overlay,
1291
- /* @__PURE__ */ jsxs2("div", {
1292
- className: "hkm-work-post-head",
1293
- children: [
1294
- /* @__PURE__ */ jsx2(Avatar, {
1295
- name,
1296
- size: 44
1297
- }),
1298
- /* @__PURE__ */ jsxs2("span", {
1299
- className: "hkm-work-who",
1300
- children: [
1301
- /* @__PURE__ */ jsx2("b", {
1302
- children: /* @__PURE__ */ jsx2(SampleText, {
1303
- ...sample(optOut),
1304
- children: name
1305
- })
1306
- }),
1307
- /* @__PURE__ */ jsx2("span", {
1308
- className: "hkm-muted",
1309
- children: /* @__PURE__ */ jsx2(SampleText, {
1310
- ...sample(optOut),
1311
- children: headline
1312
- })
1313
- }),
1314
- /* @__PURE__ */ jsx2("span", {
1315
- className: "hkm-muted",
1316
- children: time
1317
- })
1318
- ]
1319
- }),
1320
- /* @__PURE__ */ jsx2("span", {
1321
- "aria-hidden": "true",
1322
- className: "hkm-work-follow",
1323
- children: "+ Follow"
1324
- })
1325
- ]
1326
- }),
1327
- /* @__PURE__ */ jsx2("div", {
1328
- className: "hkm-post-text",
1329
- children: /* @__PURE__ */ jsx2(SampleParagraphs, {
1330
- ...sample(optOut),
1331
- text
1332
- })
1333
- }),
1334
- photo === undefined ? null : /* @__PURE__ */ jsx2(PlaceholderPhoto, {
1335
- className: "hkm-work-photo",
1336
- ratio: "1.91 / 1",
1337
- seed: photo
1338
- }),
1339
- reactions === undefined ? null : /* @__PURE__ */ jsxs2("div", {
1340
- "aria-hidden": "true",
1341
- className: "hkm-work-counts hkm-muted",
1342
- children: [
1343
- /* @__PURE__ */ jsx2("span", {
1344
- children: counted(reactions[0], "reaction")
1345
- }),
1346
- /* @__PURE__ */ jsxs2("span", {
1347
- children: [
1348
- counted(reactions[1], "comment"),
1349
- " · ",
1350
- counted(reactions[2], "repost")
1351
- ]
1352
- })
1353
- ]
1354
- }),
1355
- /* @__PURE__ */ jsxs2("div", {
1356
- "aria-hidden": "true",
1357
- className: "hkm-work-actions hkm-muted",
1358
- children: [
1359
- /* @__PURE__ */ jsxs2("span", {
1360
- children: [
1361
- /* @__PURE__ */ jsx2(MockupGlyph, {
1362
- name: "thumb",
1363
- size: 18
1364
- }),
1365
- "Like"
1366
- ]
1367
- }),
1368
- /* @__PURE__ */ jsxs2("span", {
1369
- children: [
1370
- /* @__PURE__ */ jsx2(MockupGlyph, {
1371
- name: "comment",
1372
- size: 18
1373
- }),
1374
- "Comment"
1375
- ]
1376
- }),
1377
- /* @__PURE__ */ jsxs2("span", {
1378
- children: [
1379
- /* @__PURE__ */ jsx2(MockupGlyph, {
1380
- name: "repost",
1381
- size: 18
1382
- }),
1383
- "Repost"
1384
- ]
1385
- }),
1386
- /* @__PURE__ */ jsxs2("span", {
1387
- children: [
1388
- /* @__PURE__ */ jsx2(MockupGlyph, {
1389
- name: "send",
1390
- size: 18
1391
- }),
1392
- "Send"
1393
- ]
1394
- })
1395
- ]
1396
- }),
1397
- comment === undefined ? null : /* @__PURE__ */ jsxs2("div", {
1398
- className: "hkm-work-comment",
1399
- children: [
1400
- /* @__PURE__ */ jsx2(Avatar, {
1401
- name: comment.name,
1402
- size: 30
1403
- }),
1404
- /* @__PURE__ */ jsxs2("div", {
1405
- ...comment.attributes,
1406
- className: "hkm-unit hkm-work-comment-box",
1407
- children: [
1408
- comment.overlay,
1409
- /* @__PURE__ */ jsx2("b", {
1410
- children: /* @__PURE__ */ jsx2(SampleText, {
1411
- ...sample(optOut),
1412
- children: comment.name
1413
- })
1414
- }),
1415
- /* @__PURE__ */ jsx2("span", {
1416
- className: "hkm-muted",
1417
- children: /* @__PURE__ */ jsx2(SampleText, {
1418
- ...sample(optOut),
1419
- children: comment.headline
1420
- })
1421
- }),
1422
- /* @__PURE__ */ jsx2(SampleParagraphs, {
1423
- ...sample(optOut),
1424
- text: comment.text
1425
- })
1426
- ]
1427
- })
1428
- ]
1429
- })
1430
- ]
1431
- });
1432
- }
1433
- var FOLDERS = [["inbox", "Inbox"], ["star", "Starred"], ["clock", "Snoozed"], ["send", "Sent"], ["file", "Drafts"], ["archive", "Archive"]];
1434
- function Inbox({
1435
- height,
1436
- open,
1437
- renderMessage,
1438
- renderRow,
1439
- rowKey,
1440
- rows,
1441
- unread,
1442
- url = "mail.example/inbox",
1443
- ...root
1444
- }) {
1445
- const keys = keyed(rows, rowKey, "Inbox");
1446
- if (open !== undefined && renderMessage === undefined)
1447
- throw new TypeError("Inbox needs renderMessage when open is set.");
1448
- return /* @__PURE__ */ jsx2(MockupRoot, {
1449
- ...root,
1450
- kind: "inbox",
1451
- children: /* @__PURE__ */ jsx2(BrowserWindow, {
1452
- ...height === undefined ? {} : {
1453
- height
1454
- },
1455
- url,
1456
- children: /* @__PURE__ */ jsxs2("div", {
1457
- className: "hkm-inbox",
1458
- "data-hkm-open": open === undefined ? undefined : "",
1459
- children: [
1460
- /* @__PURE__ */ jsxs2("div", {
1461
- "aria-hidden": "true",
1462
- className: "hkm-inbox-folders",
1463
- children: [
1464
- /* @__PURE__ */ jsxs2("span", {
1465
- className: "hkm-inbox-compose",
1466
- children: [
1467
- /* @__PURE__ */ jsx2(MockupGlyph, {
1468
- name: "pencil",
1469
- size: 16
1470
- }),
1471
- "Compose"
1472
- ]
1473
- }),
1474
- FOLDERS.map(([glyph, label], index) => /* @__PURE__ */ jsxs2("span", {
1475
- className: "hkm-rail-item",
1476
- "data-hkm-active": index === 0 ? "" : undefined,
1477
- children: [
1478
- /* @__PURE__ */ jsx2(MockupGlyph, {
1479
- name: glyph,
1480
- size: 17
1481
- }),
1482
- /* @__PURE__ */ jsx2("span", {
1483
- className: "hkm-rail-label",
1484
- children: label
1485
- }),
1486
- index === 0 && unread !== undefined ? /* @__PURE__ */ jsx2("span", {
1487
- className: "hkm-inbox-count",
1488
- children: compact(unread)
1489
- }) : null
1490
- ]
1491
- }, label))
1492
- ]
1493
- }),
1494
- /* @__PURE__ */ jsxs2("div", {
1495
- className: "hkm-inbox-list",
1496
- children: [
1497
- /* @__PURE__ */ jsx2("div", {
1498
- "aria-hidden": "true",
1499
- className: "hkm-inbox-toolbar",
1500
- children: /* @__PURE__ */ jsxs2("span", {
1501
- className: "hkm-search-field",
1502
- children: [
1503
- /* @__PURE__ */ jsx2(MockupGlyph, {
1504
- name: "search",
1505
- size: 14
1506
- }),
1507
- "Search mail"
1508
- ]
1509
- })
1510
- }),
1511
- /* @__PURE__ */ jsx2("ul", {
1512
- className: "hkm-inbox-rows",
1513
- children: rows.map((row, index) => /* @__PURE__ */ jsx2("li", {
1514
- children: renderRow(row, index)
1515
- }, keys[index]))
1516
- })
1517
- ]
1518
- }),
1519
- open === undefined || renderMessage === undefined ? null : /* @__PURE__ */ jsx2("div", {
1520
- className: "hkm-inbox-reader",
1521
- children: renderMessage(open)
1522
- })
1523
- ]
1524
- })
1525
- })
1526
- });
1527
- }
1528
- function InboxRow({
1529
- attributes,
1530
- from,
1531
- optOut,
1532
- overlay,
1533
- preview,
1534
- selected = false,
1535
- starred = false,
1536
- subject,
1537
- time,
1538
- unread = false
1539
- }) {
1540
- return /* @__PURE__ */ jsxs2("div", {
1541
- ...attributes,
1542
- className: "hkm-unit hkm-inbox-row",
1543
- "data-hkm-selected": selected ? "" : undefined,
1544
- "data-hkm-unread": unread ? "" : undefined,
1545
- children: [
1546
- overlay,
1547
- /* @__PURE__ */ jsx2("span", {
1548
- "aria-hidden": "true",
1549
- className: "hkm-inbox-star",
1550
- "data-hkm-on": starred ? "" : undefined,
1551
- children: /* @__PURE__ */ jsx2(MockupGlyph, {
1552
- filled: starred,
1553
- name: "star",
1554
- size: 15
1555
- })
1556
- }),
1557
- /* @__PURE__ */ jsx2("span", {
1558
- className: "hkm-inbox-from",
1559
- children: /* @__PURE__ */ jsx2(SampleText, {
1560
- ...sample(optOut),
1561
- children: from
1562
- })
1563
- }),
1564
- /* @__PURE__ */ jsxs2("span", {
1565
- className: "hkm-inbox-line",
1566
- children: [
1567
- /* @__PURE__ */ jsx2("span", {
1568
- className: "hkm-inbox-subject",
1569
- children: /* @__PURE__ */ jsx2(SampleText, {
1570
- ...sample(optOut),
1571
- children: subject
1572
- })
1573
- }),
1574
- /* @__PURE__ */ jsxs2("span", {
1575
- className: "hkm-muted",
1576
- children: [
1577
- " · ",
1578
- /* @__PURE__ */ jsx2(SampleText, {
1579
- ...sample(optOut),
1580
- children: preview
1581
- })
1582
- ]
1583
- })
1584
- ]
1585
- }),
1586
- /* @__PURE__ */ jsx2("span", {
1587
- className: "hkm-inbox-time hkm-muted",
1588
- children: time
1589
- })
1590
- ]
1591
- });
1592
- }
1593
- function InboxMessage({
1594
- attributes,
1595
- body,
1596
- from,
1597
- optOut,
1598
- overlay,
1599
- subject,
1600
- time,
1601
- to = "me"
1602
- }) {
1603
- return /* @__PURE__ */ jsxs2("div", {
1604
- ...attributes,
1605
- className: "hkm-unit hkm-inbox-message",
1606
- children: [
1607
- overlay,
1608
- /* @__PURE__ */ jsx2("div", {
1609
- className: "hkm-inbox-message-subject",
1610
- children: /* @__PURE__ */ jsx2(SampleText, {
1611
- ...sample(optOut),
1612
- children: subject
1613
- })
1614
- }),
1615
- /* @__PURE__ */ jsxs2("div", {
1616
- className: "hkm-inbox-message-head",
1617
- children: [
1618
- /* @__PURE__ */ jsx2(Avatar, {
1619
- name: from,
1620
- size: 36
1621
- }),
1622
- /* @__PURE__ */ jsxs2("span", {
1623
- className: "hkm-inbox-message-who",
1624
- children: [
1625
- /* @__PURE__ */ jsx2("b", {
1626
- children: /* @__PURE__ */ jsx2(SampleText, {
1627
- ...sample(optOut),
1628
- children: from
1629
- })
1630
- }),
1631
- /* @__PURE__ */ jsxs2("span", {
1632
- className: "hkm-muted",
1633
- children: [
1634
- "to ",
1635
- to
1636
- ]
1637
- })
1638
- ]
1639
- }),
1640
- /* @__PURE__ */ jsx2("span", {
1641
- className: "hkm-muted",
1642
- children: time
1643
- })
1644
- ]
1645
- }),
1646
- /* @__PURE__ */ jsx2("div", {
1647
- className: "hkm-inbox-message-body",
1648
- children: /* @__PURE__ */ jsx2(SampleParagraphs, {
1649
- ...sample(optOut),
1650
- text: body
1651
- })
1652
- })
1653
- ]
1654
- });
1655
- }
1656
- function ArticlePage({
1657
- byline,
1658
- comments,
1659
- date,
1660
- decorate,
1661
- dek,
1662
- height,
1663
- kicker,
1664
- paragraphs,
1665
- photo,
1666
- site = "The Daily Example",
1667
- title,
1668
- url = "news.example/story",
1669
- ...root
1670
- }) {
1671
- if (/^by\s/iu.test(byline.trim()))
1672
- throw new RangeError(`ArticlePage byline is the author's name; the page adds "By".`);
1673
- const opt = sample(root.optOut);
1674
- return /* @__PURE__ */ jsx2(MockupRoot, {
1675
- ...root,
1676
- kind: "article",
1677
- children: /* @__PURE__ */ jsx2(BrowserWindow, {
1678
- ...height === undefined ? {} : {
1679
- height
1680
- },
1681
- url,
1682
- children: /* @__PURE__ */ jsxs2("div", {
1683
- className: "hkm-article",
1684
- children: [
1685
- /* @__PURE__ */ jsxs2("div", {
1686
- "aria-hidden": "true",
1687
- className: "hkm-article-masthead",
1688
- children: [
1689
- /* @__PURE__ */ jsx2(MockupGlyph, {
1690
- name: "menu",
1691
- size: 18
1692
- }),
1693
- /* @__PURE__ */ jsx2("span", {
1694
- className: "hkm-article-site",
1695
- children: site
1696
- }),
1697
- /* @__PURE__ */ jsx2(MockupGlyph, {
1698
- name: "search",
1699
- size: 18
1700
- })
1701
- ]
1702
- }),
1703
- /* @__PURE__ */ jsxs2("div", {
1704
- className: "hkm-article-body",
1705
- children: [
1706
- kicker === undefined ? null : /* @__PURE__ */ jsx2("div", {
1707
- className: "hkm-article-kicker",
1708
- children: kicker
1709
- }),
1710
- /* @__PURE__ */ jsx2("div", {
1711
- className: "hkm-article-title",
1712
- children: /* @__PURE__ */ jsx2(SampleText, {
1713
- ...opt,
1714
- children: title
1715
- })
1716
- }),
1717
- dek === undefined ? null : /* @__PURE__ */ jsx2("p", {
1718
- className: "hkm-article-dek",
1719
- children: /* @__PURE__ */ jsx2(SampleText, {
1720
- ...opt,
1721
- children: dek
1722
- })
1723
- }),
1724
- /* @__PURE__ */ jsxs2("div", {
1725
- className: "hkm-article-byline",
1726
- children: [
1727
- /* @__PURE__ */ jsx2(Avatar, {
1728
- name: byline,
1729
- size: 28
1730
- }),
1731
- /* @__PURE__ */ jsxs2("span", {
1732
- children: [
1733
- "By ",
1734
- /* @__PURE__ */ jsx2(SampleText, {
1735
- ...opt,
1736
- children: byline
1737
- })
1738
- ]
1739
- }),
1740
- date === undefined ? null : /* @__PURE__ */ jsx2("span", {
1741
- className: "hkm-muted",
1742
- children: date
1743
- })
1744
- ]
1745
- }),
1746
- photo === undefined ? null : /* @__PURE__ */ jsx2(PlaceholderPhoto, {
1747
- className: "hkm-article-photo",
1748
- ratio: "3 / 2",
1749
- seed: photo
1750
- }),
1751
- /* @__PURE__ */ jsx2("div", {
1752
- className: "hkm-article-text",
1753
- children: paragraphs.map((paragraph, index) => {
1754
- const node = /* @__PURE__ */ jsx2("p", {
1755
- className: "hkm-unit",
1756
- children: /* @__PURE__ */ jsx2(SampleText, {
1757
- ...opt,
1758
- children: paragraph
1759
- })
1760
- }, index);
1761
- return decorate === undefined ? node : /* @__PURE__ */ jsx2(Fragment2, {
1762
- children: decorate(node, index)
1763
- }, index);
1764
- })
1765
- }),
1766
- comments === undefined || comments.length === 0 ? null : /* @__PURE__ */ jsxs2("div", {
1767
- className: "hkm-article-comments",
1768
- children: [
1769
- /* @__PURE__ */ jsx2("div", {
1770
- className: "hkm-article-comments-title",
1771
- children: counted(comments.length, "comment")
1772
- }),
1773
- comments.map((comment, index) => /* @__PURE__ */ jsxs2("div", {
1774
- ...comment.attributes,
1775
- className: "hkm-unit hkm-article-comment",
1776
- children: [
1777
- comment.overlay,
1778
- /* @__PURE__ */ jsx2(Avatar, {
1779
- name: comment.name,
1780
- size: 30
1781
- }),
1782
- /* @__PURE__ */ jsxs2("span", {
1783
- className: "hkm-article-comment-body",
1784
- children: [
1785
- /* @__PURE__ */ jsx2("b", {
1786
- children: /* @__PURE__ */ jsx2(SampleText, {
1787
- ...opt,
1788
- children: comment.name
1789
- })
1790
- }),
1791
- /* @__PURE__ */ jsxs2("span", {
1792
- className: "hkm-muted",
1793
- children: [
1794
- " ",
1795
- comment.time
1796
- ]
1797
- }),
1798
- /* @__PURE__ */ jsx2(SampleParagraphs, {
1799
- ...opt,
1800
- text: comment.text
1801
- })
1802
- ]
1803
- })
1804
- ]
1805
- }, index))
1806
- ]
1807
- })
1808
- ]
1809
- })
1810
- ]
1811
- })
1812
- })
1813
- });
1814
- }
1815
46
  export {
1816
47
  phoneStyle,
1817
48
  mockupInitials,
@@ -1838,6 +69,7 @@ export {
1838
69
  PhoneFrame,
1839
70
  MockupRoot,
1840
71
  MockupGlyph,
72
+ MockupBrandMark,
1841
73
  MenuBarPopover,
1842
74
  MacWindow,
1843
75
  MOCKUP_EXAMPLE_HOST,