@almadar/std 2.1.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/dist/behaviors/async.d.ts +12 -7
  2. package/dist/behaviors/async.js +1085 -312
  3. package/dist/behaviors/async.js.map +1 -1
  4. package/dist/behaviors/data-management.d.ts +27 -13
  5. package/dist/behaviors/data-management.js +600 -244
  6. package/dist/behaviors/data-management.js.map +1 -1
  7. package/dist/behaviors/domain/commerce.d.ts +51 -0
  8. package/dist/behaviors/domain/commerce.js +1093 -0
  9. package/dist/behaviors/domain/commerce.js.map +1 -0
  10. package/dist/behaviors/domain/content.d.ts +51 -0
  11. package/dist/behaviors/domain/content.js +1294 -0
  12. package/dist/behaviors/domain/content.js.map +1 -0
  13. package/dist/behaviors/domain/dashboard.d.ts +45 -0
  14. package/dist/behaviors/domain/dashboard.js +783 -0
  15. package/dist/behaviors/domain/dashboard.js.map +1 -0
  16. package/dist/behaviors/domain/education.d.ts +41 -0
  17. package/dist/behaviors/domain/education.js +738 -0
  18. package/dist/behaviors/domain/education.js.map +1 -0
  19. package/dist/behaviors/domain/finance.d.ts +49 -0
  20. package/dist/behaviors/domain/finance.js +660 -0
  21. package/dist/behaviors/domain/finance.js.map +1 -0
  22. package/dist/behaviors/domain/game-2d-platformer.d.ts +50 -0
  23. package/dist/behaviors/domain/game-2d-platformer.js +810 -0
  24. package/dist/behaviors/domain/game-2d-platformer.js.map +1 -0
  25. package/dist/behaviors/domain/game-2d-puzzle.d.ts +42 -0
  26. package/dist/behaviors/domain/game-2d-puzzle.js +622 -0
  27. package/dist/behaviors/domain/game-2d-puzzle.js.map +1 -0
  28. package/dist/behaviors/domain/game-2d-rpg.d.ts +48 -0
  29. package/dist/behaviors/domain/game-2d-rpg.js +860 -0
  30. package/dist/behaviors/domain/game-2d-rpg.js.map +1 -0
  31. package/dist/behaviors/domain/game-2d-strategy.d.ts +48 -0
  32. package/dist/behaviors/domain/game-2d-strategy.js +692 -0
  33. package/dist/behaviors/domain/game-2d-strategy.js.map +1 -0
  34. package/dist/behaviors/domain/geospatial.d.ts +35 -0
  35. package/dist/behaviors/domain/geospatial.js +634 -0
  36. package/dist/behaviors/domain/geospatial.js.map +1 -0
  37. package/dist/behaviors/domain/healthcare.d.ts +36 -0
  38. package/dist/behaviors/domain/healthcare.js +1068 -0
  39. package/dist/behaviors/domain/healthcare.js.map +1 -0
  40. package/dist/behaviors/domain/iot.d.ts +45 -0
  41. package/dist/behaviors/domain/iot.js +589 -0
  42. package/dist/behaviors/domain/iot.js.map +1 -0
  43. package/dist/behaviors/domain/media.d.ts +41 -0
  44. package/dist/behaviors/domain/media.js +771 -0
  45. package/dist/behaviors/domain/media.js.map +1 -0
  46. package/dist/behaviors/domain/scheduling.d.ts +41 -0
  47. package/dist/behaviors/domain/scheduling.js +930 -0
  48. package/dist/behaviors/domain/scheduling.js.map +1 -0
  49. package/dist/behaviors/domain/simulation.d.ts +36 -0
  50. package/dist/behaviors/domain/simulation.js +706 -0
  51. package/dist/behaviors/domain/simulation.js.map +1 -0
  52. package/dist/behaviors/domain/social.d.ts +41 -0
  53. package/dist/behaviors/domain/social.js +840 -0
  54. package/dist/behaviors/domain/social.js.map +1 -0
  55. package/dist/behaviors/domain/workflow.d.ts +41 -0
  56. package/dist/behaviors/domain/workflow.js +879 -0
  57. package/dist/behaviors/domain/workflow.js.map +1 -0
  58. package/dist/behaviors/feedback.d.ts +10 -5
  59. package/dist/behaviors/feedback.js +279 -194
  60. package/dist/behaviors/feedback.js.map +1 -1
  61. package/dist/behaviors/game-core.d.ts +15 -8
  62. package/dist/behaviors/game-core.js +412 -80
  63. package/dist/behaviors/game-core.js.map +1 -1
  64. package/dist/behaviors/game-entity.d.ts +17 -10
  65. package/dist/behaviors/game-entity.js +544 -237
  66. package/dist/behaviors/game-entity.js.map +1 -1
  67. package/dist/behaviors/game-ui.d.ts +16 -8
  68. package/dist/behaviors/game-ui.js +451 -316
  69. package/dist/behaviors/game-ui.js.map +1 -1
  70. package/dist/behaviors/index.d.ts +18 -1
  71. package/dist/behaviors/index.js +18905 -2140
  72. package/dist/behaviors/index.js.map +1 -1
  73. package/dist/behaviors/infrastructure.d.ts +9 -8
  74. package/dist/behaviors/infrastructure.js +597 -169
  75. package/dist/behaviors/infrastructure.js.map +1 -1
  76. package/dist/behaviors/registry.d.ts +11 -11
  77. package/dist/behaviors/registry.js +18904 -2139
  78. package/dist/behaviors/registry.js.map +1 -1
  79. package/dist/behaviors/types.d.ts +19 -2
  80. package/dist/behaviors/types.js.map +1 -1
  81. package/dist/behaviors/ui-interaction.d.ts +20 -14
  82. package/dist/behaviors/ui-interaction.js +928 -518
  83. package/dist/behaviors/ui-interaction.js.map +1 -1
  84. package/dist/index.js +18906 -2141
  85. package/dist/index.js.map +1 -1
  86. package/package.json +4 -1
@@ -0,0 +1,1068 @@
1
+ // behaviors/domain/healthcare.ts
2
+ var HEALTHCARE_THEME = {
3
+ name: "healthcare-rose",
4
+ tokens: {
5
+ colors: {
6
+ primary: "#e11d48",
7
+ "primary-hover": "#be123c",
8
+ "primary-foreground": "#ffffff",
9
+ accent: "#f43f5e",
10
+ "accent-foreground": "#ffffff",
11
+ success: "#22c55e",
12
+ warning: "#f59e0b",
13
+ error: "#ef4444"
14
+ }
15
+ }
16
+ };
17
+ var vitalsMainView = [["render-ui", "main", {
18
+ type: "stack",
19
+ direction: "vertical",
20
+ gap: "lg",
21
+ children: [
22
+ {
23
+ type: "stack",
24
+ direction: "horizontal",
25
+ gap: "md",
26
+ align: "center",
27
+ justify: "between",
28
+ children: [
29
+ {
30
+ type: "stack",
31
+ direction: "horizontal",
32
+ gap: "sm",
33
+ align: "center",
34
+ children: [
35
+ { type: "icon", name: "heart-pulse", size: "lg", color: "primary" },
36
+ { type: "typography", variant: "h2", text: "Vital Signs" }
37
+ ]
38
+ },
39
+ {
40
+ type: "button",
41
+ label: "Record",
42
+ event: "RECORD",
43
+ variant: "primary",
44
+ icon: "plus"
45
+ }
46
+ ]
47
+ },
48
+ {
49
+ type: "stack",
50
+ direction: "horizontal",
51
+ gap: "md",
52
+ children: [
53
+ { type: "stats", entity: "VitalReading" },
54
+ { type: "line-chart", height: 200, label: "Trend" }
55
+ ]
56
+ },
57
+ {
58
+ type: "data-list",
59
+ entity: "VitalReading",
60
+ itemLayout: {
61
+ type: "stack",
62
+ direction: "horizontal",
63
+ gap: "md",
64
+ align: "center",
65
+ justify: "between",
66
+ children: [
67
+ {
68
+ type: "stack",
69
+ direction: "horizontal",
70
+ gap: "sm",
71
+ align: "center",
72
+ children: [
73
+ { type: "icon", name: "stethoscope", size: "md", color: "primary" },
74
+ { type: "typography", variant: "h4", text: "@entity.vitalType" }
75
+ ]
76
+ },
77
+ {
78
+ type: "stack",
79
+ direction: "horizontal",
80
+ gap: "xs",
81
+ align: "baseline",
82
+ children: [
83
+ { type: "typography", variant: "body-lg", text: "@entity.value", weight: "bold" },
84
+ { type: "typography", variant: "body-sm", text: "@entity.unit", color: "muted" }
85
+ ]
86
+ },
87
+ {
88
+ type: "stack",
89
+ direction: "horizontal",
90
+ gap: "sm",
91
+ align: "center",
92
+ children: [
93
+ { type: "icon", name: "calendar", size: "sm", color: "muted" },
94
+ { type: "typography", variant: "body-sm", text: "@entity.recordedAt", color: "muted" }
95
+ ]
96
+ },
97
+ {
98
+ type: "stack",
99
+ direction: "horizontal",
100
+ gap: "sm",
101
+ align: "center",
102
+ children: [
103
+ { type: "icon", name: "user", size: "sm", color: "muted" },
104
+ { type: "typography", variant: "body-sm", text: "@entity.patientId", color: "muted" }
105
+ ]
106
+ },
107
+ {
108
+ type: "button",
109
+ label: "View",
110
+ event: "VIEW",
111
+ variant: "ghost",
112
+ icon: "eye"
113
+ }
114
+ ]
115
+ }
116
+ }
117
+ ]
118
+ }]];
119
+ var VITALS_BEHAVIOR = {
120
+ name: "std-vitals",
121
+ version: "1.0.0",
122
+ description: "Vital signs recording and monitoring dashboard",
123
+ theme: HEALTHCARE_THEME,
124
+ orbitals: [
125
+ {
126
+ name: "VitalsOrbital",
127
+ entity: {
128
+ name: "VitalReading",
129
+ persistence: "persistent",
130
+ collection: "vital_readings",
131
+ fields: [
132
+ { name: "id", type: "string", required: true },
133
+ { name: "vitalType", type: "string", default: "" },
134
+ { name: "value", type: "number", default: 0 },
135
+ { name: "unit", type: "string", default: "" },
136
+ { name: "recordedAt", type: "string", default: "" },
137
+ { name: "patientId", type: "string", default: "" }
138
+ ]
139
+ },
140
+ traits: [
141
+ {
142
+ name: "VitalsControl",
143
+ linkedEntity: "VitalReading",
144
+ category: "interaction",
145
+ stateMachine: {
146
+ states: [
147
+ { name: "browsing", isInitial: true },
148
+ { name: "recording" },
149
+ { name: "viewing" }
150
+ ],
151
+ events: [
152
+ { key: "INIT", name: "Initialize" },
153
+ { key: "RECORD", name: "Record Vitals" },
154
+ { key: "SAVE", name: "Save Reading", payloadSchema: [{ name: "vitalType", type: "string", required: true }, { name: "value", type: "number", required: true }, { name: "unit", type: "string", required: true }] },
155
+ { key: "VIEW", name: "View Reading", payloadSchema: [{ name: "id", type: "string", required: true }] },
156
+ { key: "CLOSE", name: "Close" },
157
+ { key: "CANCEL", name: "Cancel" }
158
+ ],
159
+ transitions: [
160
+ {
161
+ from: "browsing",
162
+ to: "browsing",
163
+ event: "INIT",
164
+ effects: [
165
+ ["fetch", "VitalReading"],
166
+ ...vitalsMainView
167
+ ]
168
+ },
169
+ {
170
+ from: "browsing",
171
+ to: "recording",
172
+ event: "RECORD",
173
+ effects: [
174
+ ["fetch", "VitalReading"],
175
+ ["render-ui", "modal", {
176
+ type: "stack",
177
+ direction: "vertical",
178
+ gap: "lg",
179
+ children: [
180
+ {
181
+ type: "stack",
182
+ direction: "horizontal",
183
+ gap: "sm",
184
+ align: "center",
185
+ children: [
186
+ { type: "icon", name: "thermometer", size: "md", color: "primary" },
187
+ { type: "typography", variant: "h3", text: "Record Vital Signs" }
188
+ ]
189
+ },
190
+ { type: "divider" },
191
+ {
192
+ type: "form-section",
193
+ entity: "VitalReading",
194
+ submitEvent: "SAVE",
195
+ cancelEvent: "CANCEL"
196
+ }
197
+ ]
198
+ }]
199
+ ]
200
+ },
201
+ {
202
+ from: "recording",
203
+ to: "browsing",
204
+ event: "SAVE",
205
+ effects: [
206
+ ["set", "@entity.vitalType", "@payload.vitalType"],
207
+ ["set", "@entity.value", "@payload.value"],
208
+ ["set", "@entity.unit", "@payload.unit"],
209
+ ["render-ui", "modal", null],
210
+ ["fetch", "VitalReading"],
211
+ ...vitalsMainView
212
+ ]
213
+ },
214
+ {
215
+ from: "recording",
216
+ to: "browsing",
217
+ event: "CLOSE",
218
+ effects: [
219
+ ["render-ui", "modal", null]
220
+ ]
221
+ },
222
+ {
223
+ from: "recording",
224
+ to: "browsing",
225
+ event: "CANCEL",
226
+ effects: [
227
+ ["render-ui", "modal", null]
228
+ ]
229
+ },
230
+ {
231
+ from: "browsing",
232
+ to: "viewing",
233
+ event: "VIEW",
234
+ effects: [
235
+ ["fetch", "VitalReading"],
236
+ ["render-ui", "modal", {
237
+ type: "stack",
238
+ direction: "vertical",
239
+ gap: "lg",
240
+ children: [
241
+ {
242
+ type: "stack",
243
+ direction: "horizontal",
244
+ gap: "sm",
245
+ align: "center",
246
+ justify: "between",
247
+ children: [
248
+ {
249
+ type: "stack",
250
+ direction: "horizontal",
251
+ gap: "sm",
252
+ align: "center",
253
+ children: [
254
+ { type: "icon", name: "activity", size: "md", color: "primary" },
255
+ { type: "typography", variant: "h3", text: "Vital Reading" }
256
+ ]
257
+ },
258
+ {
259
+ type: "button",
260
+ label: "Close",
261
+ event: "CLOSE",
262
+ variant: "ghost",
263
+ icon: "x"
264
+ }
265
+ ]
266
+ },
267
+ { type: "divider" },
268
+ {
269
+ type: "meter",
270
+ value: "@entity.value",
271
+ label: "Current Reading",
272
+ min: 0,
273
+ max: 200
274
+ },
275
+ {
276
+ type: "stack",
277
+ direction: "vertical",
278
+ gap: "md",
279
+ children: [
280
+ {
281
+ type: "stack",
282
+ direction: "horizontal",
283
+ gap: "sm",
284
+ align: "center",
285
+ children: [
286
+ { type: "icon", name: "stethoscope", size: "sm", color: "muted" },
287
+ { type: "typography", variant: "label", text: "Type" },
288
+ { type: "typography", variant: "body", text: "@entity.vitalType" }
289
+ ]
290
+ },
291
+ {
292
+ type: "stack",
293
+ direction: "horizontal",
294
+ gap: "sm",
295
+ align: "center",
296
+ children: [
297
+ { type: "icon", name: "hash", size: "sm", color: "muted" },
298
+ { type: "typography", variant: "label", text: "Value" },
299
+ { type: "typography", variant: "body", text: "@entity.value" },
300
+ { type: "typography", variant: "body-sm", text: "@entity.unit", color: "muted" }
301
+ ]
302
+ },
303
+ {
304
+ type: "stack",
305
+ direction: "horizontal",
306
+ gap: "sm",
307
+ align: "center",
308
+ children: [
309
+ { type: "icon", name: "calendar", size: "sm", color: "muted" },
310
+ { type: "typography", variant: "label", text: "Recorded" },
311
+ { type: "typography", variant: "body", text: "@entity.recordedAt" }
312
+ ]
313
+ },
314
+ {
315
+ type: "stack",
316
+ direction: "horizontal",
317
+ gap: "sm",
318
+ align: "center",
319
+ children: [
320
+ { type: "icon", name: "user", size: "sm", color: "muted" },
321
+ { type: "typography", variant: "label", text: "Patient" },
322
+ { type: "typography", variant: "body", text: "@entity.patientId" }
323
+ ]
324
+ }
325
+ ]
326
+ }
327
+ ]
328
+ }]
329
+ ]
330
+ },
331
+ {
332
+ from: "viewing",
333
+ to: "browsing",
334
+ event: "CLOSE",
335
+ effects: [
336
+ ["render-ui", "modal", null]
337
+ ]
338
+ },
339
+ {
340
+ from: "viewing",
341
+ to: "browsing",
342
+ event: "CANCEL",
343
+ effects: [
344
+ ["render-ui", "modal", null]
345
+ ]
346
+ }
347
+ ]
348
+ }
349
+ }
350
+ ],
351
+ pages: [
352
+ {
353
+ name: "VitalsPage",
354
+ path: "/vitals",
355
+ isInitial: true,
356
+ traits: [{ ref: "VitalsControl" }]
357
+ }
358
+ ]
359
+ }
360
+ ]
361
+ };
362
+ var intakeWizardSteps = [
363
+ { label: "Patient Info" },
364
+ { label: "Symptoms" },
365
+ { label: "Medications" }
366
+ ];
367
+ var intakeIdleView = [["render-ui", "main", {
368
+ type: "stack",
369
+ direction: "vertical",
370
+ gap: "lg",
371
+ children: [
372
+ {
373
+ type: "stack",
374
+ direction: "horizontal",
375
+ gap: "md",
376
+ align: "center",
377
+ justify: "between",
378
+ children: [
379
+ {
380
+ type: "stack",
381
+ direction: "horizontal",
382
+ gap: "sm",
383
+ align: "center",
384
+ children: [
385
+ { type: "icon", name: "clipboard-list", size: "lg", color: "primary" },
386
+ { type: "typography", variant: "h2", text: "Patient Intake" }
387
+ ]
388
+ },
389
+ {
390
+ type: "button",
391
+ label: "New Intake",
392
+ action: "START",
393
+ variant: "primary",
394
+ icon: "plus"
395
+ }
396
+ ]
397
+ },
398
+ { type: "divider" },
399
+ {
400
+ type: "wizard-progress",
401
+ currentStep: 0,
402
+ steps: intakeWizardSteps
403
+ },
404
+ { type: "divider" },
405
+ {
406
+ type: "data-list",
407
+ entity: "IntakeForm",
408
+ itemLayout: {
409
+ type: "stack",
410
+ direction: "horizontal",
411
+ gap: "md",
412
+ align: "center",
413
+ justify: "between",
414
+ children: [
415
+ {
416
+ type: "stack",
417
+ direction: "horizontal",
418
+ gap: "sm",
419
+ align: "center",
420
+ children: [
421
+ { type: "icon", name: "user", size: "md", color: "primary" },
422
+ { type: "typography", variant: "h4", text: "@entity.patientName" }
423
+ ]
424
+ },
425
+ {
426
+ type: "stack",
427
+ direction: "horizontal",
428
+ gap: "sm",
429
+ align: "center",
430
+ children: [
431
+ { type: "icon", name: "calendar", size: "sm", color: "muted" },
432
+ { type: "typography", variant: "body-sm", text: "@entity.dateOfBirth", color: "muted" }
433
+ ]
434
+ },
435
+ {
436
+ type: "badge",
437
+ text: "@entity.symptoms",
438
+ variant: "outline"
439
+ },
440
+ {
441
+ type: "button",
442
+ label: "Refresh",
443
+ action: "INIT",
444
+ variant: "ghost",
445
+ icon: "refresh-cw"
446
+ }
447
+ ]
448
+ }
449
+ }
450
+ ]
451
+ }]];
452
+ var intakeFillingView = (currentStep) => [["render-ui", "main", {
453
+ type: "stack",
454
+ direction: "vertical",
455
+ gap: "lg",
456
+ children: [
457
+ {
458
+ type: "stack",
459
+ direction: "horizontal",
460
+ gap: "sm",
461
+ align: "center",
462
+ children: [
463
+ { type: "icon", name: "clipboard-list", size: "lg", color: "primary" },
464
+ { type: "typography", variant: "h2", text: "Patient Intake" }
465
+ ]
466
+ },
467
+ {
468
+ type: "wizard-progress",
469
+ currentStep,
470
+ steps: intakeWizardSteps
471
+ },
472
+ { type: "divider" },
473
+ {
474
+ type: "form-section",
475
+ entity: "IntakeForm"
476
+ }
477
+ ]
478
+ }]];
479
+ var INTAKE_FORM_BEHAVIOR = {
480
+ name: "std-intake-form",
481
+ version: "1.0.0",
482
+ description: "Multi-step patient intake form with review",
483
+ theme: HEALTHCARE_THEME,
484
+ orbitals: [
485
+ {
486
+ name: "IntakeFormOrbital",
487
+ entity: {
488
+ name: "IntakeForm",
489
+ persistence: "persistent",
490
+ collection: "intake_forms",
491
+ fields: [
492
+ { name: "id", type: "string", required: true },
493
+ { name: "patientName", type: "string", default: "" },
494
+ { name: "dateOfBirth", type: "string", default: "" },
495
+ { name: "symptoms", type: "string", default: "" },
496
+ { name: "medications", type: "string", default: "" }
497
+ ]
498
+ },
499
+ traits: [
500
+ {
501
+ name: "IntakeFormControl",
502
+ linkedEntity: "IntakeForm",
503
+ category: "interaction",
504
+ stateMachine: {
505
+ states: [
506
+ { name: "idle", isInitial: true },
507
+ { name: "filling" },
508
+ { name: "reviewing" },
509
+ { name: "submitted" }
510
+ ],
511
+ events: [
512
+ { key: "INIT", name: "Initialize" },
513
+ { key: "START", name: "Start Form" },
514
+ { key: "UPDATE", name: "Update Fields", payloadSchema: [{ name: "patientName", type: "string", required: true }, { name: "symptoms", type: "string", required: true }] },
515
+ { key: "REVIEW", name: "Review Form" },
516
+ { key: "SUBMIT", name: "Submit Form" },
517
+ { key: "BACK", name: "Go Back" }
518
+ ],
519
+ transitions: [
520
+ {
521
+ from: "idle",
522
+ to: "idle",
523
+ event: "INIT",
524
+ effects: [
525
+ ["fetch", "IntakeForm"],
526
+ ...intakeIdleView
527
+ ]
528
+ },
529
+ {
530
+ from: "idle",
531
+ to: "filling",
532
+ event: "START",
533
+ effects: [
534
+ ["fetch", "IntakeForm"],
535
+ ...intakeFillingView(0)
536
+ ]
537
+ },
538
+ {
539
+ from: "filling",
540
+ to: "filling",
541
+ event: "UPDATE",
542
+ effects: [
543
+ ["fetch", "IntakeForm"],
544
+ ["set", "@entity.patientName", "@payload.patientName"],
545
+ ["set", "@entity.symptoms", "@payload.symptoms"],
546
+ ...intakeFillingView(1)
547
+ ]
548
+ },
549
+ {
550
+ from: "filling",
551
+ to: "reviewing",
552
+ event: "REVIEW",
553
+ effects: [
554
+ ["fetch", "IntakeForm"],
555
+ ["render-ui", "main", {
556
+ type: "stack",
557
+ direction: "vertical",
558
+ gap: "lg",
559
+ children: [
560
+ {
561
+ type: "stack",
562
+ direction: "horizontal",
563
+ gap: "sm",
564
+ align: "center",
565
+ children: [
566
+ { type: "icon", name: "clipboard-list", size: "lg", color: "primary" },
567
+ { type: "typography", variant: "h2", text: "Review Intake" }
568
+ ]
569
+ },
570
+ {
571
+ type: "wizard-progress",
572
+ currentStep: 2,
573
+ steps: intakeWizardSteps
574
+ },
575
+ { type: "divider" },
576
+ {
577
+ type: "stack",
578
+ direction: "vertical",
579
+ gap: "md",
580
+ children: [
581
+ {
582
+ type: "stack",
583
+ direction: "horizontal",
584
+ gap: "sm",
585
+ align: "center",
586
+ children: [
587
+ { type: "icon", name: "user", size: "sm", color: "primary" },
588
+ { type: "typography", variant: "label", text: "Patient Name" },
589
+ { type: "typography", variant: "body", text: "@entity.patientName" }
590
+ ]
591
+ },
592
+ {
593
+ type: "stack",
594
+ direction: "horizontal",
595
+ gap: "sm",
596
+ align: "center",
597
+ children: [
598
+ { type: "icon", name: "calendar", size: "sm", color: "primary" },
599
+ { type: "typography", variant: "label", text: "Date of Birth" },
600
+ { type: "typography", variant: "body", text: "@entity.dateOfBirth" }
601
+ ]
602
+ },
603
+ {
604
+ type: "stack",
605
+ direction: "horizontal",
606
+ gap: "sm",
607
+ align: "center",
608
+ children: [
609
+ { type: "icon", name: "thermometer", size: "sm", color: "warning" },
610
+ { type: "typography", variant: "label", text: "Symptoms" },
611
+ { type: "typography", variant: "body", text: "@entity.symptoms" }
612
+ ]
613
+ },
614
+ {
615
+ type: "stack",
616
+ direction: "horizontal",
617
+ gap: "sm",
618
+ align: "center",
619
+ children: [
620
+ { type: "icon", name: "pill", size: "sm", color: "accent" },
621
+ { type: "typography", variant: "label", text: "Medications" },
622
+ { type: "typography", variant: "body", text: "@entity.medications" }
623
+ ]
624
+ }
625
+ ]
626
+ },
627
+ { type: "divider" },
628
+ {
629
+ type: "stack",
630
+ direction: "horizontal",
631
+ gap: "md",
632
+ justify: "end",
633
+ children: [
634
+ {
635
+ type: "button",
636
+ label: "Back",
637
+ event: "BACK",
638
+ variant: "secondary",
639
+ icon: "arrow-left"
640
+ },
641
+ {
642
+ type: "button",
643
+ label: "Submit",
644
+ event: "SUBMIT",
645
+ variant: "primary",
646
+ icon: "check"
647
+ }
648
+ ]
649
+ }
650
+ ]
651
+ }]
652
+ ]
653
+ },
654
+ {
655
+ from: "reviewing",
656
+ to: "submitted",
657
+ event: "SUBMIT",
658
+ effects: [
659
+ ["render-ui", "main", {
660
+ type: "stack",
661
+ direction: "vertical",
662
+ gap: "lg",
663
+ align: "center",
664
+ children: [
665
+ { type: "icon", name: "check-circle", size: "xl", color: "success" },
666
+ { type: "typography", variant: "h2", text: "Form Submitted" },
667
+ { type: "typography", variant: "body", text: "The patient intake form has been submitted successfully.", color: "muted" },
668
+ { type: "divider" },
669
+ { type: "stats", entity: "IntakeForm" },
670
+ {
671
+ type: "button",
672
+ label: "Back to Intake",
673
+ event: "BACK",
674
+ variant: "secondary",
675
+ icon: "arrow-left"
676
+ }
677
+ ]
678
+ }]
679
+ ]
680
+ },
681
+ {
682
+ from: "reviewing",
683
+ to: "filling",
684
+ event: "BACK",
685
+ effects: [
686
+ ["fetch", "IntakeForm"],
687
+ ...intakeFillingView(0)
688
+ ]
689
+ },
690
+ {
691
+ from: "submitted",
692
+ to: "idle",
693
+ event: "BACK",
694
+ effects: [
695
+ ["fetch", "IntakeForm"],
696
+ ...intakeIdleView
697
+ ]
698
+ }
699
+ ]
700
+ }
701
+ }
702
+ ],
703
+ pages: [
704
+ {
705
+ name: "IntakePage",
706
+ path: "/intake",
707
+ isInitial: true,
708
+ traits: [{ ref: "IntakeFormControl" }]
709
+ }
710
+ ]
711
+ }
712
+ ]
713
+ };
714
+ var prescriptionMainView = [["render-ui", "main", {
715
+ type: "stack",
716
+ direction: "vertical",
717
+ gap: "lg",
718
+ children: [
719
+ {
720
+ type: "stack",
721
+ direction: "horizontal",
722
+ gap: "md",
723
+ align: "center",
724
+ justify: "between",
725
+ children: [
726
+ {
727
+ type: "stack",
728
+ direction: "horizontal",
729
+ gap: "sm",
730
+ align: "center",
731
+ children: [
732
+ { type: "icon", name: "pill", size: "lg", color: "primary" },
733
+ { type: "typography", variant: "h2", text: "Prescriptions" }
734
+ ]
735
+ },
736
+ {
737
+ type: "button",
738
+ label: "New",
739
+ event: "CREATE",
740
+ variant: "primary",
741
+ icon: "plus"
742
+ }
743
+ ]
744
+ },
745
+ {
746
+ type: "search-input",
747
+ placeholder: "Search prescriptions...",
748
+ event: "VIEW",
749
+ icon: "search"
750
+ },
751
+ { type: "divider" },
752
+ {
753
+ type: "data-list",
754
+ entity: "Prescription",
755
+ itemLayout: {
756
+ type: "stack",
757
+ direction: "horizontal",
758
+ gap: "md",
759
+ align: "center",
760
+ justify: "between",
761
+ children: [
762
+ {
763
+ type: "stack",
764
+ direction: "horizontal",
765
+ gap: "sm",
766
+ align: "center",
767
+ children: [
768
+ { type: "icon", name: "pill", size: "md", color: "primary" },
769
+ { type: "typography", variant: "h4", text: "@entity.medication" }
770
+ ]
771
+ },
772
+ {
773
+ type: "stack",
774
+ direction: "horizontal",
775
+ gap: "xs",
776
+ align: "center",
777
+ children: [
778
+ { type: "badge", label: "@entity.dosage", variant: "outline" },
779
+ { type: "badge", label: "@entity.frequency", variant: "subtle" }
780
+ ]
781
+ },
782
+ {
783
+ type: "stack",
784
+ direction: "horizontal",
785
+ gap: "sm",
786
+ align: "center",
787
+ children: [
788
+ { type: "icon", name: "calendar", size: "sm", color: "muted" },
789
+ { type: "typography", variant: "body-sm", text: "@entity.startDate", color: "muted" },
790
+ { type: "typography", variant: "body-sm", text: "-", color: "muted" },
791
+ { type: "typography", variant: "body-sm", text: "@entity.endDate", color: "muted" }
792
+ ]
793
+ },
794
+ {
795
+ type: "button",
796
+ label: "View",
797
+ event: "VIEW",
798
+ variant: "ghost",
799
+ icon: "eye"
800
+ }
801
+ ]
802
+ }
803
+ }
804
+ ]
805
+ }]];
806
+ var PRESCRIPTION_BEHAVIOR = {
807
+ name: "std-prescription",
808
+ version: "1.0.0",
809
+ description: "Prescription management with medication details",
810
+ theme: HEALTHCARE_THEME,
811
+ orbitals: [
812
+ {
813
+ name: "PrescriptionOrbital",
814
+ entity: {
815
+ name: "Prescription",
816
+ persistence: "persistent",
817
+ collection: "prescriptions",
818
+ fields: [
819
+ { name: "id", type: "string", required: true },
820
+ { name: "medication", type: "string", default: "" },
821
+ { name: "dosage", type: "string", default: "" },
822
+ { name: "frequency", type: "string", default: "" },
823
+ { name: "startDate", type: "string", default: "" },
824
+ { name: "endDate", type: "string", default: "" }
825
+ ]
826
+ },
827
+ traits: [
828
+ {
829
+ name: "PrescriptionControl",
830
+ linkedEntity: "Prescription",
831
+ category: "interaction",
832
+ stateMachine: {
833
+ states: [
834
+ { name: "browsing", isInitial: true },
835
+ { name: "creating" },
836
+ { name: "viewing" }
837
+ ],
838
+ events: [
839
+ { key: "INIT", name: "Initialize" },
840
+ { key: "CREATE", name: "New Prescription" },
841
+ { key: "SAVE", name: "Save Prescription", payloadSchema: [{ name: "medication", type: "string", required: true }, { name: "dosage", type: "string", required: true }, { name: "frequency", type: "string", required: true }] },
842
+ { key: "VIEW", name: "View Prescription", payloadSchema: [{ name: "id", type: "string", required: true }] },
843
+ { key: "CLOSE", name: "Close" },
844
+ { key: "CANCEL", name: "Cancel" }
845
+ ],
846
+ transitions: [
847
+ {
848
+ from: "browsing",
849
+ to: "browsing",
850
+ event: "INIT",
851
+ effects: [
852
+ ["fetch", "Prescription"],
853
+ ...prescriptionMainView
854
+ ]
855
+ },
856
+ {
857
+ from: "browsing",
858
+ to: "creating",
859
+ event: "CREATE",
860
+ effects: [
861
+ ["fetch", "Prescription"],
862
+ ["render-ui", "modal", {
863
+ type: "stack",
864
+ direction: "vertical",
865
+ gap: "lg",
866
+ children: [
867
+ {
868
+ type: "stack",
869
+ direction: "horizontal",
870
+ gap: "sm",
871
+ align: "center",
872
+ children: [
873
+ { type: "icon", name: "pill", size: "md", color: "primary" },
874
+ { type: "typography", variant: "h3", text: "New Prescription" }
875
+ ]
876
+ },
877
+ { type: "divider" },
878
+ {
879
+ type: "form-section",
880
+ entity: "Prescription",
881
+ submitEvent: "SAVE",
882
+ cancelEvent: "CANCEL"
883
+ }
884
+ ]
885
+ }]
886
+ ]
887
+ },
888
+ {
889
+ from: "creating",
890
+ to: "browsing",
891
+ event: "SAVE",
892
+ effects: [
893
+ ["set", "@entity.medication", "@payload.medication"],
894
+ ["set", "@entity.dosage", "@payload.dosage"],
895
+ ["set", "@entity.frequency", "@payload.frequency"],
896
+ ["render-ui", "modal", null],
897
+ ["fetch", "Prescription"],
898
+ ...prescriptionMainView
899
+ ]
900
+ },
901
+ {
902
+ from: "creating",
903
+ to: "browsing",
904
+ event: "CLOSE",
905
+ effects: [
906
+ ["render-ui", "modal", null]
907
+ ]
908
+ },
909
+ {
910
+ from: "creating",
911
+ to: "browsing",
912
+ event: "CANCEL",
913
+ effects: [
914
+ ["render-ui", "modal", null]
915
+ ]
916
+ },
917
+ {
918
+ from: "browsing",
919
+ to: "viewing",
920
+ event: "VIEW",
921
+ effects: [
922
+ ["fetch", "Prescription"],
923
+ ["render-ui", "modal", {
924
+ type: "stack",
925
+ direction: "vertical",
926
+ gap: "lg",
927
+ children: [
928
+ {
929
+ type: "stack",
930
+ direction: "horizontal",
931
+ gap: "sm",
932
+ align: "center",
933
+ justify: "between",
934
+ children: [
935
+ {
936
+ type: "stack",
937
+ direction: "horizontal",
938
+ gap: "sm",
939
+ align: "center",
940
+ children: [
941
+ { type: "icon", name: "pill", size: "md", color: "primary" },
942
+ { type: "typography", variant: "h3", text: "Prescription Detail" }
943
+ ]
944
+ },
945
+ {
946
+ type: "button",
947
+ label: "Close",
948
+ event: "CLOSE",
949
+ variant: "ghost",
950
+ icon: "x"
951
+ }
952
+ ]
953
+ },
954
+ { type: "divider" },
955
+ {
956
+ type: "stack",
957
+ direction: "vertical",
958
+ gap: "md",
959
+ children: [
960
+ {
961
+ type: "stack",
962
+ direction: "horizontal",
963
+ gap: "sm",
964
+ align: "center",
965
+ children: [
966
+ { type: "icon", name: "pill", size: "sm", color: "primary" },
967
+ { type: "typography", variant: "label", text: "Medication" },
968
+ { type: "typography", variant: "body", text: "@entity.medication" }
969
+ ]
970
+ },
971
+ {
972
+ type: "stack",
973
+ direction: "horizontal",
974
+ gap: "sm",
975
+ align: "center",
976
+ children: [
977
+ { type: "icon", name: "gauge", size: "sm", color: "accent" },
978
+ { type: "typography", variant: "label", text: "Dosage" },
979
+ { type: "badge", label: "@entity.dosage", variant: "outline" }
980
+ ]
981
+ },
982
+ {
983
+ type: "stack",
984
+ direction: "horizontal",
985
+ gap: "sm",
986
+ align: "center",
987
+ children: [
988
+ { type: "icon", name: "clock", size: "sm", color: "accent" },
989
+ { type: "typography", variant: "label", text: "Frequency" },
990
+ { type: "typography", variant: "body", text: "@entity.frequency" }
991
+ ]
992
+ },
993
+ {
994
+ type: "stack",
995
+ direction: "horizontal",
996
+ gap: "sm",
997
+ align: "center",
998
+ children: [
999
+ { type: "icon", name: "calendar", size: "sm", color: "muted" },
1000
+ { type: "typography", variant: "label", text: "Start" },
1001
+ { type: "typography", variant: "body", text: "@entity.startDate" }
1002
+ ]
1003
+ },
1004
+ {
1005
+ type: "stack",
1006
+ direction: "horizontal",
1007
+ gap: "sm",
1008
+ align: "center",
1009
+ children: [
1010
+ { type: "icon", name: "calendar-check", size: "sm", color: "muted" },
1011
+ { type: "typography", variant: "label", text: "End" },
1012
+ { type: "typography", variant: "body", text: "@entity.endDate" }
1013
+ ]
1014
+ }
1015
+ ]
1016
+ },
1017
+ { type: "divider" },
1018
+ {
1019
+ type: "meter",
1020
+ value: 0,
1021
+ label: "Dosage Progress",
1022
+ min: 0,
1023
+ max: 100
1024
+ }
1025
+ ]
1026
+ }]
1027
+ ]
1028
+ },
1029
+ {
1030
+ from: "viewing",
1031
+ to: "browsing",
1032
+ event: "CLOSE",
1033
+ effects: [
1034
+ ["render-ui", "modal", null]
1035
+ ]
1036
+ },
1037
+ {
1038
+ from: "viewing",
1039
+ to: "browsing",
1040
+ event: "CANCEL",
1041
+ effects: [
1042
+ ["render-ui", "modal", null]
1043
+ ]
1044
+ }
1045
+ ]
1046
+ }
1047
+ }
1048
+ ],
1049
+ pages: [
1050
+ {
1051
+ name: "PrescriptionsPage",
1052
+ path: "/prescriptions",
1053
+ isInitial: true,
1054
+ traits: [{ ref: "PrescriptionControl" }]
1055
+ }
1056
+ ]
1057
+ }
1058
+ ]
1059
+ };
1060
+ var HEALTHCARE_BEHAVIORS = [
1061
+ VITALS_BEHAVIOR,
1062
+ INTAKE_FORM_BEHAVIOR,
1063
+ PRESCRIPTION_BEHAVIOR
1064
+ ];
1065
+
1066
+ export { HEALTHCARE_BEHAVIORS, INTAKE_FORM_BEHAVIOR, PRESCRIPTION_BEHAVIOR, VITALS_BEHAVIOR };
1067
+ //# sourceMappingURL=healthcare.js.map
1068
+ //# sourceMappingURL=healthcare.js.map