@umkmall/proto 0.1.0-h7e3b5ebd092b → 0.1.0-ha04bbbde2f13

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.
@@ -0,0 +1,1108 @@
1
+ <!doctype html>
2
+ <html lang="id">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Prototipe UMKMall</title>
7
+ <!--
8
+ UMKMall prototyping starter — generated, do not hand-edit the parts above the demo.
9
+
10
+ Built from commit the @umkmall/proto version named in the asset URLs below
11
+ Regenerate with: npm run proto:assets
12
+
13
+ HOW TO USE THIS FILE
14
+ 1. Open it by double-click. It runs with no build step and no npm install.
15
+ 2. Edit the <script type="text/babel"> block at the bottom. Start with <Konten />.
16
+ 3. Reload the browser. That is the whole loop.
17
+
18
+ WHAT THIS FILE NEEDS FROM THE NETWORK
19
+ Four hosts, every time it is opened — not just the first time:
20
+
21
+ https://cdn.jsdelivr.net/npm/@umkmall/proto@0.1.0-ha04bbbde2f13/umkmall-tailwind.js
22
+ https://cdn.jsdelivr.net/npm/@umkmall/proto@0.1.0-ha04bbbde2f13/umkmall-ui.js
23
+ https://cdn.jsdelivr.net/npm/@babel/standalone@7.26.4/babel.min.js
24
+ — all on jsDelivr: the design system's assets (pinned) and the JSX compiler.
25
+ The token CSS is NOT fetched: it is inlined in the <style> below, because a claude.ai
26
+ artifact loads stylesheets only from Google Fonts. Keep that <style> as it is.
27
+ the Tailwind Play CDN, for the styling engine
28
+ Google Fonts (fonts.googleapis.com and fonts.gstatic.com), for the typeface
29
+
30
+ If any of them is unreachable the page renders BLANK or unstyled with no error. That is
31
+ the first thing to check when it looks broken. They are public CDNs on purpose: Claude's and
32
+ Gemini's previews only load scripts from hosts on their allowlists, and these are on both.
33
+
34
+ YOU DO NOT HAVE TO START FROM THIS FILE
35
+ Four tags add UMKMall styling to a page you already have: the token CSS as a <link> to
36
+ https://cdn.jsdelivr.net/npm/@umkmall/proto@0.1.0-ha04bbbde2f13/umkmall-tokens.css
37
+ then the Play CDN, the config and the bundle below. Keep the order — the config must come after
38
+ the Play CDN script, or the theme arrives too late and every class resolves to nothing.
39
+
40
+ UMKMall UI — 57 components, and the values each axis accepts.
41
+ Generated from packages/ui/src/contract/variants.ts. Do not hand-edit.
42
+
43
+ Button (Foundations)
44
+ type: primary | ghost | text
45
+ color: primary | light | danger | dark
46
+ size: large | medium | small | micro
47
+ width: auto | full
48
+ booleans: disabled, isLoading
49
+
50
+ Alert (Feedback)
51
+ type: alert | toast
52
+ function: success | info | warning | danger
53
+ size: large | medium | small
54
+ treatment: full | accent | coach | banner
55
+ appearance: default | a2ui
56
+
57
+ Badge (Content)
58
+ color: primary | warning | success | danger | light | bestseller | gradient
59
+ size: xlarge | medium | small | micro
60
+ appearance: default | a2ui
61
+ booleans: showIconLeft, showIconRight
62
+
63
+ Chip (Content)
64
+ state: default | active
65
+ size: huge | xlarge | large | medium | small | micro
66
+ appearance: default | a2ui
67
+ booleans: showIconLeft, showIconRight
68
+
69
+ TextField (Form)
70
+ size: large | small | xsmall
71
+ appearance: default | a2ui | bare
72
+ counterPlacement: below | inside
73
+ prefixPlacement: inside | outside
74
+ booleans: error, disabled
75
+
76
+ CheckBox (Form)
77
+ size: xlarge | large | medium | small
78
+ appearance: default | native
79
+ booleans: error, disabled, indeterminate
80
+
81
+ Radio (Form)
82
+ size: large | medium | small
83
+ booleans: error, disabled
84
+ REQUIRED props (not axes): label
85
+
86
+ SegmentedControl (Form)
87
+ size: medium | small
88
+ booleans: disabled
89
+ REQUIRED props (not axes): options, value, onChange
90
+
91
+ Switch (Form)
92
+ size: large | medium | small
93
+ booleans: disabled, loading
94
+ REQUIRED props (not axes): label
95
+
96
+ Slider (Form)
97
+ size: large | small
98
+ booleans: disabled
99
+
100
+ DateTimeInput (Form)
101
+ size: large | small
102
+ selection: single | range
103
+ appearance: default | a2ui
104
+ booleans: error, disabled, withTime, portal
105
+
106
+ OtpInput (Form)
107
+ size: large | small
108
+ booleans: error, disabled
109
+ REQUIRED props (not axes): value, onChange
110
+
111
+ Tabs (Navigation)
112
+ size: large | small | xsmall
113
+ state: default | active
114
+ appearance: default | a2ui
115
+ booleans: showIconLeft, showNotif, showTitle
116
+
117
+ Tooltip (Feedback)
118
+ color: dark | white
119
+ size: large | small
120
+ booleans: showClose
121
+ REQUIRED props (not axes): content
122
+
123
+ Skeleton (Feedback)
124
+ shape: text | circle | rect
125
+
126
+ Text (Foundations)
127
+ role: display | h1 | h2 | h3 | h4 | h5 | h6 | paragraph | bodyLg | bodyMd | bodySm
128
+ weight: bold | semibold | medium | regular
129
+ color: primary | secondary | disable | invert | brand | success | error | warning
130
+
131
+ Icon (Foundations)
132
+ size: xs | sm | md | lg | xl
133
+ color: primary | secondary | disable | invert | brand | success | error | warning
134
+ REQUIRED props (not axes): name
135
+
136
+ Sidebar (Shell)
137
+ state: menu | submenu
138
+ booleans: collapsed, open, active, expanded, nested
139
+ REQUIRED props (not axes): label
140
+
141
+ Header (Shell)
142
+ type: nonLogin | nonLoginBlack | login | temanAiLearn | temanAiChat | dashboard | detailPage
143
+ booleans: showBack, showTab, showTextLeft, scrolled
144
+
145
+ AppShell (Shell)
146
+ booleans: scrolled
147
+
148
+ Lightbox (Overlays)
149
+ REQUIRED props (not axes): open, onOpenChange, src
150
+
151
+ ChatComposer (Chat)
152
+ tone: neutral | info | warning | danger
153
+ REQUIRED props (not axes): value, onValueChange, editorLabel
154
+
155
+ ChatComposerInput (Chat)
156
+ REQUIRED props (not axes): value, onValueChange, label
157
+
158
+ ChatDrawer (Chat)
159
+ variant: inherit | neutral | info | warning | danger
160
+ booleans: collapsed
161
+
162
+ ChatAttachment (Chat)
163
+ variant: image | file | tile
164
+ size: default | large
165
+ booleans: showSize
166
+ REQUIRED props (not axes): name
167
+
168
+ ChatToolsButton (Chat)
169
+ state: default | active
170
+ size: compact | landing
171
+ REQUIRED props (not axes): label
172
+
173
+ ChatAttachmentButton (Chat)
174
+ state: default | active
175
+ size: compact | landing
176
+ REQUIRED props (not axes): label
177
+
178
+ ChatVoiceButton (Chat)
179
+ state: default | active
180
+ size: compact | landing
181
+ REQUIRED props (not axes): label
182
+
183
+ ChatSendButton (Chat)
184
+ state: send | stop | waiting
185
+ size: compact | landing
186
+ REQUIRED props (not axes): label
187
+
188
+ ChatSoundWave (Chat)
189
+ state: idle | listening
190
+
191
+ ChatVoiceBar (Chat)
192
+ size: compact | landing
193
+ REQUIRED props (not axes): size, label, stopLabel, onStop
194
+
195
+ ChatMessage (Chat)
196
+ sender: assistant | user | system
197
+ density: compact | balanced | spacious
198
+
199
+ ChatMessageBubble (Chat)
200
+ group: none | first | middle | last
201
+ width: auto | full
202
+ booleans: ghost
203
+
204
+ ChatMessageMetadata (Chat)
205
+ status: sending | sent | delivered | read | error
206
+
207
+ ChatMessageList (Chat)
208
+ density: compact | balanced | spacious
209
+ align: top | bottom
210
+ gap: none | 2xs | xs | sm | md | lg
211
+ booleans: streaming
212
+
213
+ ChatThread (Chat)
214
+
215
+ ChatScrollButton (Chat)
216
+ shape: icon | labelled
217
+ booleans: hasNewMessages
218
+ REQUIRED props (not axes): label
219
+
220
+ ChatMessageTTSButton (Chat)
221
+ state: idle | loading | playing | paused | error
222
+ REQUIRED props (not axes): state, label, onToggle
223
+
224
+ Dialog (Overlays)
225
+ size: small | medium | large | xlarge
226
+ side: none | left | right
227
+ booleans: centered, showCloseButton, dismissible, closeDisabled
228
+ REQUIRED props (not axes): open, onOpenChange
229
+
230
+ Menu (Overlays)
231
+ variant: pill | boxed
232
+ REQUIRED props (not axes): trigger, items
233
+
234
+ Popover (Overlays)
235
+ align: start | center | end
236
+ booleans: portal
237
+
238
+ Card (Content)
239
+ variant: elevated | outlined | plain
240
+ padding: none | small | medium | large
241
+ appearance: default | a2ui | a2ui-hero
242
+
243
+ Divider (Content)
244
+ variant: default | dashed
245
+ orientation: horizontal | vertical
246
+ appearance: default | a2ui
247
+
248
+ List (Content)
249
+
250
+ Disclosure (Content)
251
+ appearance: default | a2ui
252
+ REQUIRED props (not axes): title
253
+
254
+ Image (Content)
255
+ type: thumbnail | banner | natural | avatar
256
+ size: regular | small | blog
257
+ appearance: default | a2ui
258
+ booleans: hover
259
+
260
+ SelectionCard (Form)
261
+ size: large | small
262
+ state: default | selected | disabled
263
+ layout: row | tile
264
+ appearance: default | choice
265
+ REQUIRED props (not axes): options
266
+
267
+ Upload (Form)
268
+ size: large | small
269
+ status: default | filled | error | disabled | busy
270
+ border: solid | dashed
271
+ appearance: default | a2ui
272
+
273
+ Select (Form)
274
+ size: large | small
275
+ status: default | filled | error | disabled
276
+ booleans: multiple, portal
277
+ REQUIRED props (not axes): options
278
+
279
+ CodeBlock (Content)
280
+ size: large | small
281
+ appearance: default | a2ui
282
+
283
+ Stepper (Navigation)
284
+ position: first | middle | last
285
+ state: default | current | done
286
+ orientation: horizontal | vertical
287
+ REQUIRED props (not axes): steps
288
+
289
+ Pagination (Navigation)
290
+ size: large | small
291
+ density: compact | comfortable
292
+ booleans: disabled
293
+ REQUIRED props (not axes): page, onPageChange
294
+
295
+ Table (Content)
296
+ density: compact | comfortable
297
+ booleans: loading, serverSide, hidePagination, fixedLayout, noBorder, slimScrollbar
298
+
299
+ Spinner (Feedback)
300
+ variant: primary | white | gray | gradient
301
+ size: sm | md | lg | xl
302
+
303
+ ProgressBar (Feedback)
304
+ variant: default | success | warning | error | gray | gradient
305
+ size: large | medium | small
306
+ shape: linear | radial
307
+
308
+ Toaster (Feedback)
309
+ position: top-left | top-center | top-right | bottom-left | bottom-center | bottom-right
310
+
311
+ Label (Form)
312
+ variant: default | error | success
313
+ size: sm | md | lg
314
+ look: default | field-large | field-small
315
+ booleans: required
316
+
317
+ TRAPS — each of these renders or ignores silently, with no error:
318
+
319
+ 1. `Text` roles are camelCase: `bodyLg`, `paragraphSm`, `labelMd`. A kebab-case or Title-Case role matches no variant and the text renders with no type styling at all.
320
+ 2. `Header`’s `title` is rendered ONLY when `showTextLeft` is also passed. `title` alone is silently dropped — the header renders, without its title.
321
+ 3. `Alert` has no `title` prop. Put the heading in `children`; a `title` passed to it lands on the underlying `div` as a DOM attribute and shows up as a tooltip.
322
+ 4. THE AXES ARE NOT THE PROP LIST. An axis is a STYLING choice; a component can also require DATA, and any entry above with a “REQUIRED props” line will not render without it. `Stepper` is the one that catches everyone: its axes are `position`, `state` and `orientation`, and all three belong to a STEP — the component itself takes `steps={[{ label, state, position }]}`. Writing `<Stepper position="first" state="done" />` throws inside the component, React unmounts the whole tree, and the page goes BLANK. Same shape for `SelectionCard` (`options`), `Select` (`options`), `Menu` (`trigger`, `items`) and `Dialog` (`open`, `onOpenChange`).
323
+ 5. AN AXIS NAME IS NOT ALWAYS THE PROP NAME. Every axis listed above is passed under its own name EXCEPT two: write `variant` (not `function`) for `Alert`, and `variant` (not `role`) for `Text` — taking the legal values from the `function` and `role` axes respectively. Those two keep Figma’s word in the contract because `function` is a reserved word and `role` is an ARIA attribute. Passing the axis name instead of the prop renders the component with no styling and no error.
324
+ 6. The `Table` entry exports the plain parts AND `DataTable`, and the REQUIRED props line above reads only the parts. `DataTable` needs `columns` (tanstack `ColumnDef`s, e.g. `[{ accessorKey: "name", header: "Nama" }]`) and `data`; without them it throws and the page goes blank. `Pagination` needs `page` (1-based) and `onPageChange`; pass `pageCount` for a numbered strip, or omit it and pass `hasNext` for a cursor source, or next stays disabled.
325
+
326
+ -->
327
+ <link rel="preconnect" href="https://fonts.googleapis.com">
328
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
329
+ <link href="https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700&display=swap" rel="stylesheet">
330
+ <style>
331
+ /* Generated from Ensyra — DS by `npm run tokens:build`. Do not edit by hand. */
332
+ :root {
333
+ --brand-b600: 0 61 121;
334
+ --brand-b500: 0 81 162;
335
+ --brand-b400: 0 116 231;
336
+ --brand-b300: 43 140 235;
337
+ --brand-b200: 107 174 241;
338
+ --brand-b100: 150 198 245;
339
+ --brand-b10: 240 247 255;
340
+ --brand-b10-pct: 0 116 231;
341
+ --neutral-n999: 0 0 0;
342
+ --neutral-n600: 2 22 41;
343
+ --neutral-n500: 3 32 61;
344
+ --neutral-n400: 4 38 72;
345
+ --neutral-n300: 49 77 105;
346
+ --neutral-n200: 97 118 140;
347
+ --neutral-n100: 147 162 176;
348
+ --neutral-n40: 195 203 211;
349
+ --neutral-n30: 240 240 240;
350
+ --neutral-n20: 246 246 246;
351
+ --neutral-n10: 251 251 251;
352
+ --neutral-n0: 255 255 255;
353
+ --red-r600: 124 0 0;
354
+ --red-r500: 162 0 0;
355
+ --red-r400: 231 0 0;
356
+ --red-r450: 219 0 0;
357
+ --red-r300: 235 43 43;
358
+ --red-r200: 241 107 107;
359
+ --red-r100: 245 150 150;
360
+ --red-r10: 255 243 243;
361
+ --red-r10-pct: 231 0 0;
362
+ --green-g600: 0 88 71;
363
+ --green-g500: 8 118 96;
364
+ --green-g400: 14 160 110;
365
+ --green-g300: 28 198 142;
366
+ --green-g200: 110 233 192;
367
+ --green-g100: 153 239 211;
368
+ --green-g10: 236 253 247;
369
+ --green-g10-pct: 14 160 110;
370
+ --yellow-y600: 149 96 7;
371
+ --yellow-y500: 172 111 8;
372
+ --yellow-y400: 245 158 11;
373
+ --yellow-y300: 251 188 4;
374
+ --yellow-y200: 253 216 109;
375
+ --yellow-y100: 253 228 152;
376
+ --yellow-y10: 255 248 230;
377
+ --yellow-y10-pct: 245 158 11;
378
+ --font-size-3xs: 8;
379
+ --font-size-2xs: 10;
380
+ --font-size-xs: 12;
381
+ --font-size-sm: 14;
382
+ --font-size-md: 16;
383
+ --font-size-lg: 18;
384
+ --font-size-xl: 20;
385
+ --font-size-2xl: 22;
386
+ --font-size-3xl: 24;
387
+ --font-size-4xl: 28;
388
+ --font-size-5xl: 32;
389
+ --font-size-6xl: 36;
390
+ --font-size-7xl: 40;
391
+ --font-size-8xl: 56;
392
+ --font-letter-spacing-none: 0;
393
+ --font-letter-spacing-sm: -0.10000000149011612;
394
+ --font-letter-spacing-md: -0.30000001192092896;
395
+ --font-letter-spacing-lg: -1;
396
+ --font-line-height-4xs: 14;
397
+ --font-line-height-3xs: 16;
398
+ --font-line-height-2xs: 18;
399
+ --font-line-height-xs: 20;
400
+ --font-line-height-sm: 22;
401
+ --font-line-height-md: 24;
402
+ --font-line-height-lg: 26;
403
+ --font-line-height-xl: 28;
404
+ --font-line-height-2xl: 32;
405
+ --font-line-height-3xl: 36;
406
+ --font-line-height-4xl: 40;
407
+ --font-line-height-5xl: 48;
408
+ --font-line-height-6xl: 64;
409
+ --font-familiy-brand: Be Vietnam Pro;
410
+ --font-weight-regular: Regular;
411
+ --font-weight-medium: Medium;
412
+ --font-weight-semibold: SemiBold;
413
+ --font-weight-bold: Bold;
414
+ --percentage-0-pct: 0;
415
+ --percentage-10-pct: 10;
416
+ --percentage-60-pct: 60;
417
+ --percentage-100-pct: 100;
418
+ --measurement-0: 0;
419
+ --measurement-1: 16;
420
+ --measurement-2: 32;
421
+ --measurement-3: 48;
422
+ --measurement-4: 64;
423
+ --measurement-5: 80;
424
+ --measurement-0-0625: 1;
425
+ --measurement-0-125: 2;
426
+ --measurement-0-25: 4;
427
+ --measurement-0-375: 6;
428
+ --measurement-0-5: 8;
429
+ --measurement-0-625: 10;
430
+ --measurement-0-75: 12;
431
+ --measurement-1-25: 20;
432
+ --measurement-1-375: 22;
433
+ --measurement-1-5: 24;
434
+ --measurement-1-625: 26;
435
+ --measurement-1-75: 28;
436
+ --measurement-2-25: 36;
437
+ --measurement-2-5: 40;
438
+ --measurement-2-75: 44;
439
+ --measurement-3-5: 56;
440
+ --measurement-4-5: 72;
441
+ --measurement-5-25: 84;
442
+ --measurement-7-5: 120;
443
+ --measurement-full: 360;
444
+ --text-default-primary: 4 38 72;
445
+ --text-default-secondary: 147 162 176;
446
+ --text-default-invert: 255 255 255;
447
+ --text-default-brand: 0 116 231;
448
+ --text-default-success: 14 160 110;
449
+ --text-default-error: 219 0 0;
450
+ --text-default-warning: 245 158 11;
451
+ --text-hover-primary: 3 32 61;
452
+ --text-hover-secondary: 97 118 140;
453
+ --text-hover-invert: 246 246 246;
454
+ --text-hover-brand: 0 81 162;
455
+ --text-hover-success: 8 118 96;
456
+ --text-hover-error: 162 0 0;
457
+ --text-hover-warning: 172 111 8;
458
+ --text-active-primary: 2 22 41;
459
+ --text-active-secondary: 49 77 105;
460
+ --text-active-invert: 240 240 240;
461
+ --text-active-brand: 0 61 121;
462
+ --text-active-success: 0 88 71;
463
+ --text-active-error: 124 0 0;
464
+ --text-active-warning: 149 96 7;
465
+ --text-focus-primary: 4 38 72;
466
+ --text-focus-invert: 255 255 255;
467
+ --text-focus-brand: 0 116 231;
468
+ --text-focus-success: 14 160 110;
469
+ --text-focus-error: 219 0 0;
470
+ --text-focus-warning: 245 158 11;
471
+ --text-disable-primary: 195 203 211;
472
+ --text-disable-brand: 150 198 245;
473
+ --text-disable-success: 153 239 211;
474
+ --text-disable-error: 245 150 150;
475
+ --text-disable-warning: 253 228 152;
476
+ --text-disable-invert: 49 77 105;
477
+ --icon-default-primary: 4 38 72;
478
+ --icon-default-secondary: 147 162 176;
479
+ --icon-default-invert: 255 255 255;
480
+ --icon-default-brand: 0 116 231;
481
+ --icon-default-success: 14 160 110;
482
+ --icon-default-error: 219 0 0;
483
+ --icon-default-warning: 245 158 11;
484
+ --icon-hover-primary: 3 32 61;
485
+ --icon-hover-secondary: 97 118 140;
486
+ --icon-hover-invert: 246 246 246;
487
+ --icon-hover-brand: 0 81 162;
488
+ --icon-hover-success: 8 118 96;
489
+ --icon-hover-error: 162 0 0;
490
+ --icon-hover-warning: 172 111 8;
491
+ --icon-active-primary: 2 22 41;
492
+ --icon-active-secondary: 49 77 105;
493
+ --icon-active-invert: 240 240 240;
494
+ --icon-active-brand: 0 61 121;
495
+ --icon-active-success: 0 88 71;
496
+ --icon-active-error: 124 0 0;
497
+ --icon-active-warning: 149 96 7;
498
+ --icon-focus-primary: 4 38 72;
499
+ --icon-focus-invert: 255 255 255;
500
+ --icon-focus-brand: 0 116 231;
501
+ --icon-focus-success: 14 160 110;
502
+ --icon-focus-error: 219 0 0;
503
+ --icon-focus-warning: 245 158 11;
504
+ --icon-disable-primary: 195 203 211;
505
+ --icon-disable-brand: 150 198 245;
506
+ --icon-disable-success: 153 239 211;
507
+ --icon-disable-error: 245 150 150;
508
+ --icon-disable-warning: 253 228 152;
509
+ --icon-disable-invert: 49 77 105;
510
+ --surface-default-primary: 255 255 255;
511
+ --surface-default-secondary: 246 246 246;
512
+ --surface-default-invert: 0 0 0;
513
+ --surface-default-brand: 0 116 231;
514
+ --surface-default-success: 14 160 110;
515
+ --surface-default-error: 231 0 0;
516
+ --surface-default-warning: 245 158 11;
517
+ --surface-default-overlay: 4 38 72;
518
+ --surface-hover-primary: 240 247 255;
519
+ --surface-hover-secondary: 240 240 240;
520
+ --surface-hover-invert: 2 22 41;
521
+ --surface-hover-brand: 0 81 162;
522
+ --surface-hover-success: 8 118 96;
523
+ --surface-hover-error: 162 0 0;
524
+ --surface-hover-warning: 172 111 8;
525
+ --surface-active-primary: 240 240 240;
526
+ --surface-active-brand: 0 61 121;
527
+ --surface-active-success: 0 88 71;
528
+ --surface-active-error: 124 0 0;
529
+ --surface-active-warning: 149 96 7;
530
+ --surface-focus-brand: 0 116 231;
531
+ --surface-focus-success: 14 160 110;
532
+ --surface-focus-error: 231 0 0;
533
+ --surface-focus-warning: 245 158 11;
534
+ --surface-disable-primary: 240 240 240;
535
+ --surface-disable-brand: 150 198 245;
536
+ --surface-disable-success: 153 239 211;
537
+ --surface-disable-error: 245 150 150;
538
+ --surface-disable-warning: 253 228 152;
539
+ --surface-disable-invert: 3 32 61;
540
+ --surface-weak-brand: 240 247 255;
541
+ --surface-weak-error: 255 243 243;
542
+ --surface-weak-success: 236 253 247;
543
+ --surface-weak-warning: 255 248 230;
544
+ --surface-weak-neutral: 246 246 246;
545
+ --surface-gradient-brand-start: 0 116 231;
546
+ --surface-gradient-brand-end: 0 81 162;
547
+ --surface-gradient-green-start: 14 160 110;
548
+ --surface-gradient-green-end: 8 118 96;
549
+ --surface-gradient-red-start: 231 0 0;
550
+ --surface-gradient-red-end: 162 0 0;
551
+ --surface-gradient-yellow-start: 245 158 11;
552
+ --surface-gradient-yellow-end: 172 111 8;
553
+ --surface-gradient-callout-start: 0 81 162;
554
+ --surface-gradient-callout-end: 8 118 96;
555
+ --surface-hover-neutral: 247 248 250;
556
+ --surface-selected-hover: 227 239 252;
557
+ --surface-default-subtle: 249 250 251;
558
+ --border-default-primary: 240 240 240;
559
+ --border-default-invert: 195 203 211;
560
+ --border-default-brand: 0 116 231;
561
+ --border-default-success: 14 160 110;
562
+ --border-default-error: 231 0 0;
563
+ --border-default-warning: 245 158 11;
564
+ --border-default-black: 4 38 72;
565
+ --border-default-light: 255 255 255;
566
+ --border-hover-primary: 195 203 211;
567
+ --border-hover-brand: 0 81 162;
568
+ --border-hover-success: 8 118 96;
569
+ --border-hover-error: 162 0 0;
570
+ --border-hover-warning: 172 111 8;
571
+ --border-hover-invert: 3 32 61;
572
+ --border-hover-light: 246 246 246;
573
+ --border-active-primary: 147 162 176;
574
+ --border-active-brand: 0 61 121;
575
+ --border-active-success: 0 88 71;
576
+ --border-active-error: 124 0 0;
577
+ --border-active-warning: 149 96 7;
578
+ --border-active-invert: 2 22 41;
579
+ --border-active-light: 240 240 240;
580
+ --border-focus-brand: 0 116 231;
581
+ --border-focus-success: 14 160 110;
582
+ --border-focus-error: 231 0 0;
583
+ --border-focus-warning: 245 158 11;
584
+ --border-disable-primary: 195 203 211;
585
+ --border-disable-brand: 150 198 245;
586
+ --border-disable-success: 153 239 211;
587
+ --border-disable-error: 245 150 150;
588
+ --border-disable-warning: 253 228 152;
589
+ --border-disable-invert: 49 77 105;
590
+ --radius-null: 0;
591
+ --radius-xs: 4;
592
+ --radius-sm: 6;
593
+ --radius-md: 8;
594
+ --radius-lg: 12;
595
+ --radius-xl: 16;
596
+ --radius-2xl: 24;
597
+ --radius-3xl: 32;
598
+ --radius-full: 360;
599
+ --spacing-null: 0;
600
+ --spacing-5xs: 2;
601
+ --spacing-4xs: 4;
602
+ --spacing-3xs: 6;
603
+ --spacing-2xs: 8;
604
+ --spacing-xs: 10;
605
+ --spacing-sm: 12;
606
+ --spacing-md: 16;
607
+ --spacing-lg: 20;
608
+ --spacing-xl: 24;
609
+ --spacing-2xl: 32;
610
+ --spacing-3xl-mobile: 48;
611
+ --spacing-4xl: 84;
612
+ --spacing-5xl-desktop: 120;
613
+ --margin-mobile: 16;
614
+ --margin-desktop: 84;
615
+ --shadow-blur-none: 0;
616
+ --shadow-blur-sm: 4;
617
+ --shadow-blur-md: 12;
618
+ --shadow-blur-lg: 16;
619
+ --shadow-blur-xl: 20;
620
+ --shadow-position-none: 0;
621
+ --shadow-position-sm: 2;
622
+ --shadow-position-md: 4;
623
+ --shadow-position-lg: 8;
624
+ --shadow-position-xl: 12;
625
+ --shadow-5-pct: 0 4px 12px 0 #0000000d;
626
+ --shadow-card: 0 2px 8px 0 #0000001a;
627
+ --shadow-10-pct: 0 4px 16px 0 #0000001a;
628
+ --opacity-10: 10;
629
+ --opacity-60: 60;
630
+ --opacity-null: 0;
631
+ --opacity-full: 100;
632
+ --border-width-none: 0;
633
+ --border-width-sm: 1;
634
+ --border-width-md: 2;
635
+ --border-width-l: 4;
636
+ --callout-default-surface: 240 247 255;
637
+ --callout-default-border: 0 116 231;
638
+ --callout-default-text: 0 81 162;
639
+ --callout-coach-surface: 236 253 247;
640
+ --callout-coach-border: 8 118 96;
641
+ --callout-coach-text: 8 118 96;
642
+ --callout-good-surface: 236 253 247;
643
+ --callout-good-border: 8 118 96;
644
+ --callout-good-text: 4 38 72;
645
+ --callout-warn-surface: 255 248 230;
646
+ --callout-warn-border: 172 111 8;
647
+ --callout-warn-text: 4 38 72;
648
+ --callout-neg-surface: 255 243 243;
649
+ --callout-neg-border: 231 0 0;
650
+ --callout-neg-text: 4 38 72;
651
+ --focus-halo: 150 198 245;
652
+ --typography-mobile-display-bold: 700 calc(2.25rem * var(--ds-text-scale, 1))/calc(2.5rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
653
+ --typography-mobile-display-semibold: 600 calc(2.25rem * var(--ds-text-scale, 1))/calc(2.5rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
654
+ --typography-mobile-h1-bold: 700 calc(1.75rem * var(--ds-text-scale, 1))/calc(2rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
655
+ --typography-mobile-h1-semibold: 600 calc(1.75rem * var(--ds-text-scale, 1))/calc(2rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
656
+ --typography-mobile-h2-bold: 700 calc(1.5rem * var(--ds-text-scale, 1))/calc(1.75rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
657
+ --typography-mobile-h2-semibold: 600 calc(1.5rem * var(--ds-text-scale, 1))/calc(1.75rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
658
+ --typography-mobile-h2-medium: 500 calc(1.5rem * var(--ds-text-scale, 1))/calc(1.75rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
659
+ --typography-mobile-h2-regular: 400 calc(1.5rem * var(--ds-text-scale, 1))/calc(1.75rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
660
+ --typography-mobile-h3-bold: 700 calc(1.25rem * var(--ds-text-scale, 1))/calc(1.625rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
661
+ --typography-mobile-h3-semibold: 600 calc(1.25rem * var(--ds-text-scale, 1))/calc(1.625rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
662
+ --typography-mobile-h3-medium: 500 calc(1.25rem * var(--ds-text-scale, 1))/calc(1.625rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
663
+ --typography-mobile-h3-regular: 400 calc(1.25rem * var(--ds-text-scale, 1))/calc(1.625rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
664
+ --typography-mobile-h4-bold: 700 calc(1.25rem * var(--ds-text-scale, 1))/calc(1.625rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
665
+ --typography-mobile-h4-semibold: 600 calc(1.25rem * var(--ds-text-scale, 1))/calc(1.625rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
666
+ --typography-mobile-h4-medium: 500 calc(1.25rem * var(--ds-text-scale, 1))/calc(1.625rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
667
+ --typography-mobile-h4-regular: 400 calc(1.25rem * var(--ds-text-scale, 1))/calc(1.625rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
668
+ --typography-mobile-h5-bold: 700 calc(1.125rem * var(--ds-text-scale, 1))/calc(1.5rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
669
+ --typography-mobile-h5-semibold: 600 calc(1.125rem * var(--ds-text-scale, 1))/calc(1.5rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
670
+ --typography-mobile-h5-medium: 500 calc(1.125rem * var(--ds-text-scale, 1))/calc(1.5rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
671
+ --typography-mobile-h5-regular: 400 calc(1.125rem * var(--ds-text-scale, 1))/calc(1.5rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
672
+ --typography-mobile-h6-bold: 700 calc(1rem * var(--ds-text-scale, 1))/calc(1.5rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
673
+ --typography-mobile-h6-semibold: 600 calc(1rem * var(--ds-text-scale, 1))/calc(1.5rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
674
+ --typography-mobile-h6-medium: 500 calc(1rem * var(--ds-text-scale, 1))/calc(1.5rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
675
+ --typography-mobile-h6-regular: 400 calc(1rem * var(--ds-text-scale, 1))/calc(1.5rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
676
+ --typography-mobile-paragraph-bold: 700 calc(0.875rem * var(--ds-text-scale, 1))/calc(1.25rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
677
+ --typography-mobile-paragraph-semibold: 600 calc(0.875rem * var(--ds-text-scale, 1))/calc(1.25rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
678
+ --typography-mobile-paragraph-medium: 500 calc(0.875rem * var(--ds-text-scale, 1))/calc(1.25rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
679
+ --typography-mobile-paragraph-regular: 400 calc(0.875rem * var(--ds-text-scale, 1))/calc(1.25rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
680
+ --typography-mobile-body-lg-bold: 700 calc(0.75rem * var(--ds-text-scale, 1))/calc(1.125rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
681
+ --typography-mobile-body-lg-semibold: 600 calc(0.75rem * var(--ds-text-scale, 1))/calc(1.125rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
682
+ --typography-mobile-body-lg-medium: 500 calc(0.75rem * var(--ds-text-scale, 1))/calc(1.125rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
683
+ --typography-mobile-body-lg-regular: 400 calc(0.75rem * var(--ds-text-scale, 1))/calc(1.125rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
684
+ --typography-mobile-body-md-bold: 700 calc(0.625rem * var(--ds-text-scale, 1))/calc(1rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
685
+ --typography-mobile-body-md-semibold: 600 calc(0.625rem * var(--ds-text-scale, 1))/calc(1rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
686
+ --typography-mobile-body-md-medium: 500 calc(0.625rem * var(--ds-text-scale, 1))/calc(1rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
687
+ --typography-mobile-body-md-regular: 400 calc(0.625rem * var(--ds-text-scale, 1))/calc(1rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
688
+ --typography-mobile-body-sm-bold: 700 calc(0.5rem * var(--ds-text-scale, 1))/calc(0.875rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
689
+ --typography-mobile-body-sm-semibold: 600 calc(0.5rem * var(--ds-text-scale, 1))/calc(0.875rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
690
+ --typography-mobile-body-sm-medium: 500 calc(0.5rem * var(--ds-text-scale, 1))/calc(0.875rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
691
+ --typography-mobile-body-sm-regular: 400 calc(0.5rem * var(--ds-text-scale, 1))/calc(0.875rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
692
+ --typography-desktop-display-bold: 700 calc(3.5rem * var(--ds-text-scale, 1))/calc(4rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
693
+ --typography-desktop-display-semibold: 600 calc(3.5rem * var(--ds-text-scale, 1))/calc(4rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
694
+ --typography-desktop-h1-bold: 700 calc(2.5rem * var(--ds-text-scale, 1))/calc(3rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
695
+ --typography-desktop-h1-semibold: 600 calc(2.5rem * var(--ds-text-scale, 1))/calc(3rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
696
+ --typography-desktop-h2-bold: 700 calc(2rem * var(--ds-text-scale, 1))/calc(2.5rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
697
+ --typography-desktop-h2-semibold: 600 calc(2rem * var(--ds-text-scale, 1))/calc(2.5rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
698
+ --typography-desktop-h2-medium: 500 calc(2rem * var(--ds-text-scale, 1))/calc(2.5rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
699
+ --typography-desktop-h2-regular: 400 calc(2rem * var(--ds-text-scale, 1))/calc(2.5rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
700
+ --typography-desktop-h3-bold: 700 calc(1.75rem * var(--ds-text-scale, 1))/calc(2.25rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
701
+ --typography-desktop-h3-semibold: 600 calc(1.75rem * var(--ds-text-scale, 1))/calc(2.25rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
702
+ --typography-desktop-h3-medium: 500 calc(1.75rem * var(--ds-text-scale, 1))/calc(2.25rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
703
+ --typography-desktop-h3-regular: 400 calc(1.75rem * var(--ds-text-scale, 1))/calc(2.25rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
704
+ --typography-desktop-h4-bold: 700 calc(1.5rem * var(--ds-text-scale, 1))/calc(2rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
705
+ --typography-desktop-h4-semibold: 600 calc(1.5rem * var(--ds-text-scale, 1))/calc(2rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
706
+ --typography-desktop-h4-medium: 500 calc(1.5rem * var(--ds-text-scale, 1))/calc(2rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
707
+ --typography-desktop-h4-regular: 400 calc(1.5rem * var(--ds-text-scale, 1))/calc(2rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
708
+ --typography-desktop-h5-bold: 700 calc(1.25rem * var(--ds-text-scale, 1))/calc(1.75rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
709
+ --typography-desktop-h5-semibold: 600 calc(1.25rem * var(--ds-text-scale, 1))/calc(1.75rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
710
+ --typography-desktop-h5-medium: 500 calc(1.25rem * var(--ds-text-scale, 1))/calc(1.75rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
711
+ --typography-desktop-h5-regular: 400 calc(1.25rem * var(--ds-text-scale, 1))/calc(1.75rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
712
+ --typography-desktop-h6-bold: 700 calc(1.125rem * var(--ds-text-scale, 1))/calc(1.75rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
713
+ --typography-desktop-h6-semibold: 600 calc(1.125rem * var(--ds-text-scale, 1))/calc(1.75rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
714
+ --typography-desktop-h6-medium: 500 calc(1.125rem * var(--ds-text-scale, 1))/calc(1.75rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
715
+ --typography-desktop-h6-regular: 400 calc(1.125rem * var(--ds-text-scale, 1))/calc(1.75rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
716
+ --typography-desktop-paragraph-bold: 700 calc(1rem * var(--ds-text-scale, 1))/calc(1.5rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
717
+ --typography-desktop-paragraph-semibold: 600 calc(1rem * var(--ds-text-scale, 1))/calc(1.5rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
718
+ --typography-desktop-paragraph-medium: 500 calc(1rem * var(--ds-text-scale, 1))/calc(1.5rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
719
+ --typography-desktop-paragraph-regular: 400 calc(1rem * var(--ds-text-scale, 1))/calc(1.5rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
720
+ --typography-desktop-body-lg-bold: 700 calc(0.875rem * var(--ds-text-scale, 1))/calc(1.25rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
721
+ --typography-desktop-body-lg-semibold: 600 calc(0.875rem * var(--ds-text-scale, 1))/calc(1.25rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
722
+ --typography-desktop-body-lg-medium: 500 calc(0.875rem * var(--ds-text-scale, 1))/calc(1.25rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
723
+ --typography-desktop-body-lg-regular: 400 calc(0.875rem * var(--ds-text-scale, 1))/calc(1.25rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
724
+ --typography-desktop-body-md-bold: 700 calc(0.75rem * var(--ds-text-scale, 1))/calc(1.125rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
725
+ --typography-desktop-body-md-semibold: 600 calc(0.75rem * var(--ds-text-scale, 1))/calc(1.125rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
726
+ --typography-desktop-body-md-medium: 500 calc(0.75rem * var(--ds-text-scale, 1))/calc(1.125rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
727
+ --typography-desktop-body-md-regular: 400 calc(0.75rem * var(--ds-text-scale, 1))/calc(1.125rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
728
+ --typography-desktop-body-sm-bold: 700 calc(0.625rem * var(--ds-text-scale, 1))/calc(1rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
729
+ --typography-desktop-body-sm-semibold: 600 calc(0.625rem * var(--ds-text-scale, 1))/calc(1rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
730
+ --typography-desktop-body-sm-medium: 500 calc(0.625rem * var(--ds-text-scale, 1))/calc(1rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
731
+ --typography-desktop-body-sm-regular: 400 calc(0.625rem * var(--ds-text-scale, 1))/calc(1rem * var(--ds-text-scale, 1)) 'Be Vietnam Pro';
732
+ --elevation-overlay: 99999;
733
+ }
734
+
735
+ /*
736
+ * Required by the preset's font stack — see the note in scripts/proto/build-assets.mjs.
737
+ * An undefined var() invalidates the declaration rather than falling through, so without
738
+ * this the page renders in the browser's default serif with no error anywhere.
739
+ */
740
+ :root { --font-be-vietnam-pro: 'Be Vietnam Pro'; }
741
+
742
+ :root { color-scheme: light; }
743
+ body { color: rgb(var(--text-default-primary)); }
744
+ </style>
745
+ <script src="https://cdn.tailwindcss.com"></script>
746
+ <script src="https://cdn.jsdelivr.net/npm/@umkmall/proto@0.1.0-ha04bbbde2f13/umkmall-tailwind.js"></script>
747
+ <script src="https://cdn.jsdelivr.net/npm/@umkmall/proto@0.1.0-ha04bbbde2f13/umkmall-ui.js"></script>
748
+ <script src="https://cdn.jsdelivr.net/npm/@babel/standalone@7.26.4/babel.min.js"></script>
749
+ </head>
750
+ <body class="bg-default-primary text-default-primary">
751
+ <div id="root"></div>
752
+ <script type="text/babel" data-presets="react">
753
+ /*
754
+ * The starter's demo: an MLJ journey as a CHAT ROOM. AUTHORED — this file is the content of the
755
+ * `text/babel` block in the generated starter, copied in verbatim.
756
+ *
757
+ * IT IS A CHAT APP, AND THAT IS THE WHOLE CORRECTION. The first version drew the journey as a
758
+ * document — a column of cards you scrolled. Every real MLJ prototype is a chat: a fixed header,
759
+ * the journey's chrome under it, a scrolling transcript filling the rest, a composer pinned at
760
+ * the bottom. Starting from a document layout means rebuilding the room before you can begin,
761
+ * which is exactly the hand-building this kit exists to remove.
762
+ *
763
+ * THE LIBRARY PUBLISHES FOURTEEN CHAT COMPONENTS and the document version used none of them.
764
+ * `ChatThread` owns the scroller and the "jump to latest" pill; `ChatMessageList` owns the
765
+ * measure and the bottom alignment; `ChatComposer` owns the editor, its tray and its button
766
+ * rows. Hand-rolling any of that is the drift this kit exists to stop.
767
+ *
768
+ * Mission 2 (Insight) runs end to end; the other three are named in the rail on the same shape.
769
+ * Building all four would make this file long enough that people edit it without reading it.
770
+ * The AI calls are STUBS — wiring a model is the author's job, and a key in a file that gets
771
+ * sent to other people is the thing to avoid.
772
+ *
773
+ * It is a `.jsx` file so an editor highlights it. It is never imported or bundled — it is read
774
+ * as text by `build-assets.mjs`, which is why it uses the globals below rather than imports.
775
+ */
776
+
777
+ const {
778
+ React,
779
+ ReactDOMClient,
780
+ AppShell,
781
+ Button,
782
+ ChatAttachmentButton,
783
+ ChatComposer,
784
+ ChatMessage,
785
+ ChatMessageBubble,
786
+ ChatMessageList,
787
+ ChatMessageMetadata,
788
+ ChatSendButton,
789
+ ChatThread,
790
+ ChatToolsButton,
791
+ ChatVoiceButton,
792
+ Chip,
793
+ Dialog,
794
+ Header,
795
+ Icon,
796
+ ProgressBar,
797
+ SelectionCard,
798
+ Stepper,
799
+ Text,
800
+ TextField,
801
+ } = window.UmkmallUI;
802
+
803
+ /* THE READING COLUMN, AND NO COMPONENT OWNS IT. `AppShell`'s content slot deliberately imposes
804
+ no measure — that would be wrong for every non-prose surface — so the width lives here, once,
805
+ shared by the three regions that have to line up: chrome, transcript and composer. */
806
+ const COLUMN = 'mx-auto w-full max-w-3xl px-ds-md';
807
+
808
+ /* ---------------------------------------------------------------- the journey's shape */
809
+
810
+ /** The four-mission arc. Mission 1 is the swappable tool that differs per journey. */
811
+ const MISSIONS = [
812
+ { id: 'foto', label: 'Foto Produk' },
813
+ { id: 'insight', label: 'Insight' },
814
+ { id: 'strategi', label: 'Strategi' },
815
+ { id: 'aksi', label: 'Rencana Aksi' },
816
+ ];
817
+
818
+ /* ---------------------------------------------------------------- chrome */
819
+
820
+ /**
821
+ * The journey chrome: progress rail + quota meters, in one `shrink-0` band under the header.
822
+ *
823
+ * IT SITS OUTSIDE THE SCROLLER ON PURPOSE. The rail says where you are and the meters say what
824
+ * you have left to spend — both are answers you want *while* reading the transcript, so
825
+ * scrolling them away would be wrong. Same reason the composer is pinned.
826
+ */
827
+ const JourneyChrome = ({ current }) => (
828
+ <div className="shrink-0 border-b border-default-primary py-ds-xs">
829
+ <div className={`${COLUMN} flex flex-col gap-ds-2xs`}>
830
+ <Stepper
831
+ orientation="horizontal"
832
+ steps={MISSIONS.map((mission, index) => ({
833
+ label: mission.label,
834
+ state: index < current ? 'done' : index === current ? 'current' : 'default',
835
+ position: index === 0 ? 'first' : index === MISSIONS.length - 1 ? 'last' : 'middle',
836
+ }))}
837
+ />
838
+ {/* `flex-1` ON EACH BAR, not just a gap on the row. `ProgressBar` justifies its label and
839
+ its percentage to opposite ends, so a bar sized to its content jams the two together —
840
+ "Kuota AI hari ini60%" — which reads as a rendering bug rather than a meter. */}
841
+ <div className="flex gap-ds-md">
842
+ <ProgressBar className="flex-1" label="Kuota AI hari ini" value={3} max={5} size="small" variant="default" />
843
+ <ProgressBar
844
+ className="flex-1"
845
+ label="Misi selesai"
846
+ value={current}
847
+ max={MISSIONS.length}
848
+ size="small"
849
+ variant="success"
850
+ />
851
+ </div>
852
+ </div>
853
+ </div>
854
+ );
855
+
856
+ /* ---------------------------------------------------------------- the turn parts */
857
+
858
+ /** The assistant's face. */
859
+ const Face = () => (
860
+ <span
861
+ aria-hidden
862
+ className="flex h-7 w-7 items-center justify-center rounded-full bg-default-secondary text-[10px] text-default-secondary"
863
+ >
864
+ AI
865
+ </span>
866
+ );
867
+
868
+ /* Named buttons — an icon-only control with no accessible name announces nothing at all. */
869
+ const ACTIONS = [
870
+ ['thumbs-up', 'Jawaban ini membantu'],
871
+ ['thumbs-down', 'Jawaban ini tidak membantu'],
872
+ ['rotate-cw', 'Buat ulang jawaban'],
873
+ ];
874
+
875
+ const Actions = () => (
876
+ <div className="flex items-center gap-ds-4xs">
877
+ {ACTIONS.map(([icon, label]) => (
878
+ <Button key={icon} type="text" color="light" size="micro" iconOnly aria-label={label}>
879
+ <Icon name={icon} aria-hidden className="h-4 w-4" />
880
+ </Button>
881
+ ))}
882
+ </div>
883
+ );
884
+
885
+ /** The follow-up chips offered under a settled reply. */
886
+ const Suggestions = ({ items, onPick }) => (
887
+ <div className="flex flex-wrap gap-ds-4xs">
888
+ {items.map((item) => (
889
+ <Chip key={item} size="small" onClick={() => onPick(item)}>
890
+ {item}
891
+ </Chip>
892
+ ))}
893
+ </div>
894
+ );
895
+
896
+ /* ---------------------------------------------------------------- the transcript */
897
+
898
+ /** The opening turns of Mission 2, as a conversation rather than a card list. */
899
+ const OPENING = [
900
+ { from: 'assistant', text: 'Halo! Saya sudah lihat data toko Anda minggu ini. Siap mulai Misi 2?' },
901
+ { from: 'user', text: 'Siap. Apa temuan terbesarnya?' },
902
+ {
903
+ from: 'assistant',
904
+ text: 'Empat temuan. Yang paling besar: harga Anda 18% di bawah rata-rata pasar, jadi margin tipis padahal permintaan sedang naik.',
905
+ suggestions: ['Jelaskan temuan lainnya', 'Kenapa itu penting?', 'Lanjut ke refleksi'],
906
+ },
907
+ ];
908
+
909
+ /** One reply, stubbed. Wiring a real model is the prototype author's job — see the header. */
910
+ const stubReply = (question) =>
911
+ `(Contoh jawaban) Anda bertanya "${question}". Ganti fungsi stubReply dengan panggilan model Anda.`;
912
+
913
+ /* =====================================================================
914
+ * REPLACE THIS. Everything above is the journey shell; this is your prototype.
915
+ *
916
+ * EVERY ASSISTANT BUBBLE IS A GHOST. The live surface fills and rounds the USER side only, so a
917
+ * reply draws as prose in the message column with no container around it. `ghost` is exactly
918
+ * that: the fill goes, the inline padding stays, so text still lines up with anything beneath it.
919
+ * ===================================================================== */
920
+ function Konten({ messages, onSuggestion }) {
921
+ return (
922
+ <ChatMessageList label="Percakapan Mini Learning Journey" align="bottom" className={COLUMN}>
923
+ {messages.map((message, index) =>
924
+ message.from === 'user' ? (
925
+ <ChatMessage key={index} sender="user">
926
+ <ChatMessageBubble metadata={<ChatMessageMetadata timestamp="09:41" status="read" />}>
927
+ {message.text}
928
+ </ChatMessageBubble>
929
+ </ChatMessage>
930
+ ) : (
931
+ <ChatMessage key={index} sender="assistant" avatar={<Face />} name="Teman AI">
932
+ <ChatMessageBubble
933
+ ghost
934
+ metadata={
935
+ <ChatMessageMetadata
936
+ footer={
937
+ <div className="flex flex-col gap-ds-4xs">
938
+ <Actions />
939
+ {message.suggestions ? (
940
+ <Suggestions items={message.suggestions} onPick={onSuggestion} />
941
+ ) : null}
942
+ </div>
943
+ }
944
+ />
945
+ }
946
+ >
947
+ {message.text}
948
+ </ChatMessageBubble>
949
+ </ChatMessage>
950
+ ),
951
+ )}
952
+ </ChatMessageList>
953
+ );
954
+ }
955
+ /* ===================== end of the part you replace ==================== */
956
+
957
+ /* ---------------------------------------------------------------- the composer */
958
+
959
+ /* STATEFUL, BECAUSE THE COMPOSER IS CONTROLLED. A fixed value and a no-op handler render an
960
+ editor nobody can type into — a defect this family's own stories shipped once. */
961
+ function Composer({ onSend }) {
962
+ const [value, setValue] = React.useState('');
963
+ const submit = () => {
964
+ const trimmed = value.trim();
965
+ if (!trimmed) return;
966
+ onSend(trimmed);
967
+ setValue('');
968
+ };
969
+ return (
970
+ <ChatComposer
971
+ value={value}
972
+ onValueChange={setValue}
973
+ editorLabel="Tulis pesan"
974
+ placeholder="Tanya apa saja tentang misi ini..."
975
+ toolActions={
976
+ <>
977
+ <ChatToolsButton label="Alat" />
978
+ <ChatAttachmentButton label="Lampirkan foto produk" />
979
+ </>
980
+ }
981
+ sendActions={
982
+ <>
983
+ <ChatVoiceButton label="Input suara" />
984
+ <ChatSendButton label="Kirim pesan" onClick={submit} />
985
+ </>
986
+ }
987
+ />
988
+ );
989
+ }
990
+
991
+ /* ---------------------------------------------------------------- the reflection overlay */
992
+
993
+ /* One open question and one feasibility choice, after each mission. A `Dialog` rather than a
994
+ route, because the journey is one continuous surface. */
995
+ function Reflection({ open, onOpenChange, mission }) {
996
+ const [answer, setAnswer] = React.useState('');
997
+ const [feasible, setFeasible] = React.useState('bisa');
998
+ return (
999
+ <Dialog
1000
+ open={open}
1001
+ onOpenChange={onOpenChange}
1002
+ showCloseButton
1003
+ title={`Refleksi — ${mission.label}`}
1004
+ /* `description` is VISUALLY HIDDEN — it wires `aria-describedby`, it does not draw
1005
+ subtext. Passing prose here and expecting to see it is how this dialog first shipped
1006
+ with an invisible subtitle. Visible subtext is a `Text` in the body, below. */
1007
+ description="Dua pertanyaan singkat sebelum melanjutkan ke misi berikutnya."
1008
+ >
1009
+ {/* THE PANEL PADS ITS TITLE AND NOT ITS CHILDREN. `Dialog` gives the heading `px-6 pt-4`
1010
+ and renders the body with none, so the caller owns it — without this the field, the
1011
+ cards and the button all run edge to edge against the panel border. */}
1012
+ <div className="flex flex-col gap-ds-md px-6 pb-6 pt-ds-sm">
1013
+ <Text variant="bodySm" color="secondary">
1014
+ Dua pertanyaan singkat sebelum lanjut.
1015
+ </Text>
1016
+ <TextField
1017
+ label="Apa satu hal yang akan Anda ubah minggu ini?"
1018
+ value={answer}
1019
+ onChange={(event) => setAnswer(event.target.value)}
1020
+ placeholder="Tulis jawaban Anda..."
1021
+ />
1022
+ <div className="flex flex-col gap-ds-2xs">
1023
+ <Text variant="bodySm" weight="semibold">
1024
+ Seberapa mungkin Anda melakukannya?
1025
+ </Text>
1026
+ {/* ONE GROUP, NOT ONE CARD PER OPTION. `SelectionCard` takes the whole `options` array
1027
+ and owns selection itself; a per-option `selected` prop does not exist, and an
1028
+ invented prop renders with no styling and no error. */}
1029
+ <SelectionCard
1030
+ options={[
1031
+ { value: 'bisa', label: 'Bisa saya lakukan minggu ini' },
1032
+ { value: 'usaha', label: 'Perlu usaha ekstra' },
1033
+ { value: 'belum', label: 'Belum bisa sekarang' },
1034
+ ]}
1035
+ value={[feasible]}
1036
+ onValueChange={(picked) => setFeasible(picked[0] ?? 'bisa')}
1037
+ />
1038
+ </div>
1039
+ <div className="flex">
1040
+ <Button type="primary" color="primary" size="medium" width="auto" onClick={() => onOpenChange(false)}>
1041
+ Simpan &amp; lanjut
1042
+ </Button>
1043
+ </div>
1044
+ </div>
1045
+ </Dialog>
1046
+ );
1047
+ }
1048
+
1049
+ /* ---------------------------------------------------------------- the room */
1050
+
1051
+ function App() {
1052
+ const [reflecting, setReflecting] = React.useState(false);
1053
+ const [current, setCurrent] = React.useState(1);
1054
+ const [messages, setMessages] = React.useState(OPENING);
1055
+
1056
+ /* One turn: the user's message, then a stubbed reply. Replace `stubReply` with your model. */
1057
+ const send = (text) => {
1058
+ if (text === 'Lanjut ke refleksi') {
1059
+ setMessages((previous) => [...previous, { from: 'user', text }]);
1060
+ setReflecting(true);
1061
+ setCurrent((step) => Math.min(step + 1, MISSIONS.length));
1062
+ return;
1063
+ }
1064
+ setMessages((previous) => [
1065
+ ...previous,
1066
+ { from: 'user', text },
1067
+ { from: 'assistant', text: stubReply(text) },
1068
+ ]);
1069
+ };
1070
+
1071
+ return (
1072
+ <React.Fragment>
1073
+ <AppShell
1074
+ header={({ scrolled }) => (
1075
+ <Header
1076
+ type="temanAiChat"
1077
+ title="Mini Learning Journey"
1078
+ showTextLeft
1079
+ scrolled={scrolled}
1080
+ />
1081
+ )}
1082
+ /* NO SIDEBAR. A prototype is one journey on one screen — an app-navigation rail is
1083
+ chrome it does not have, and a drawer needs a trigger and state before it can open. */
1084
+ >
1085
+ <JourneyChrome current={current} />
1086
+ <ChatThread scrollToBottomLabel="Ke pesan terbaru">
1087
+ <Konten messages={messages} onSuggestion={send} />
1088
+ </ChatThread>
1089
+ <div className="shrink-0 py-ds-md">
1090
+ <div className={COLUMN}>
1091
+ <Composer onSend={send} />
1092
+ </div>
1093
+ </div>
1094
+ </AppShell>
1095
+ <Reflection
1096
+ open={reflecting}
1097
+ onOpenChange={setReflecting}
1098
+ mission={MISSIONS[Math.min(current, MISSIONS.length - 1)]}
1099
+ />
1100
+ </React.Fragment>
1101
+ );
1102
+ }
1103
+
1104
+ ReactDOMClient.createRoot(document.getElementById('root')).render(<App />);
1105
+
1106
+ </script>
1107
+ </body>
1108
+ </html>