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