@umkmall/proto 0.1.0-h726308542f5a

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