@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,783 @@
1
+ // behaviors/domain/dashboard.ts
2
+ var DASHBOARD_THEME = {
3
+ name: "dashboard-slate",
4
+ tokens: {
5
+ colors: {
6
+ primary: "#6366f1",
7
+ "primary-hover": "#4f46e5",
8
+ "primary-foreground": "#ffffff",
9
+ accent: "#8b5cf6",
10
+ "accent-foreground": "#ffffff",
11
+ success: "#22c55e",
12
+ warning: "#f59e0b",
13
+ error: "#ef4444"
14
+ }
15
+ }
16
+ };
17
+ var statsPanelDisplayEffects = [
18
+ ["fetch", "StatMetric"],
19
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
20
+ // Header: icon + title + refresh button
21
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
22
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
23
+ { type: "icon", name: "layout-dashboard", size: "lg" },
24
+ { type: "typography", variant: "h2", content: "Statistics" }
25
+ ] },
26
+ { type: "button", label: "Refresh", icon: "refresh-cw", variant: "secondary", action: "REFRESH" }
27
+ ] },
28
+ { type: "divider" },
29
+ // Stats row: key metrics
30
+ { type: "stack", direction: "horizontal", gap: "md", children: [
31
+ { type: "stats", label: "Total Metrics", icon: "hash", entity: "StatMetric" },
32
+ { type: "stats", label: "Active Trends", icon: "trending-up", entity: "StatMetric" },
33
+ { type: "stats", label: "Changes", icon: "activity", entity: "StatMetric" }
34
+ ] },
35
+ { type: "divider" },
36
+ // Data zone: metric cards via data-grid
37
+ {
38
+ type: "data-grid",
39
+ entity: "StatMetric",
40
+ cols: 2,
41
+ gap: "md",
42
+ fields: [
43
+ { name: "name", label: "Metric", icon: "tag", variant: "h4" },
44
+ { name: "value", label: "Value", icon: "hash", variant: "body", format: "number" },
45
+ { name: "change", label: "Change", icon: "trending-up", variant: "body", format: "number" },
46
+ { name: "trend", label: "Trend", icon: "activity", variant: "badge" }
47
+ ]
48
+ },
49
+ { type: "divider" },
50
+ // Overall performance meter
51
+ { type: "meter", value: 0, label: "Overall Performance", icon: "gauge", entity: "StatMetric" }
52
+ ] }]
53
+ ];
54
+ var STATS_PANEL_BEHAVIOR = {
55
+ name: "std-stats-panel",
56
+ version: "1.0.0",
57
+ description: "Statistics panel with loading, display, and refresh",
58
+ theme: DASHBOARD_THEME,
59
+ orbitals: [
60
+ {
61
+ name: "StatsPanelOrbital",
62
+ entity: {
63
+ name: "StatMetric",
64
+ persistence: "persistent",
65
+ collection: "stat_metrics",
66
+ fields: [
67
+ { name: "id", type: "string", required: true },
68
+ { name: "name", type: "string", default: "" },
69
+ { name: "value", type: "number", default: 0 },
70
+ { name: "change", type: "number", default: 0 },
71
+ { name: "trend", type: "string", default: "stable" }
72
+ ]
73
+ },
74
+ traits: [
75
+ {
76
+ name: "StatsPanelControl",
77
+ linkedEntity: "StatMetric",
78
+ category: "interaction",
79
+ stateMachine: {
80
+ states: [
81
+ { name: "loading", isInitial: true },
82
+ { name: "displaying" },
83
+ { name: "refreshing" }
84
+ ],
85
+ events: [
86
+ { key: "INIT", name: "Initialize" },
87
+ { key: "LOADED", name: "Data Loaded" },
88
+ { key: "REFRESH", name: "Refresh" },
89
+ { key: "REFRESHED", name: "Refresh Complete" }
90
+ ],
91
+ transitions: [
92
+ {
93
+ from: "loading",
94
+ to: "loading",
95
+ event: "INIT",
96
+ effects: [
97
+ ["fetch", "StatMetric"],
98
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
99
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
100
+ { type: "icon", name: "layout-dashboard", size: "lg" },
101
+ { type: "typography", variant: "h2", content: "Statistics" }
102
+ ] },
103
+ { type: "divider" },
104
+ { type: "progress-bar", value: 0, label: "Loading metrics...", icon: "loader" }
105
+ ] }]
106
+ ]
107
+ },
108
+ {
109
+ from: "loading",
110
+ to: "displaying",
111
+ event: "LOADED",
112
+ effects: [
113
+ ...statsPanelDisplayEffects
114
+ ]
115
+ },
116
+ {
117
+ from: "displaying",
118
+ to: "refreshing",
119
+ event: "REFRESH",
120
+ effects: [
121
+ ["fetch", "StatMetric"],
122
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
123
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
124
+ { type: "icon", name: "layout-dashboard", size: "lg" },
125
+ { type: "typography", variant: "h2", content: "Statistics" }
126
+ ] },
127
+ { type: "divider" },
128
+ { type: "progress-bar", value: 0, label: "Refreshing...", icon: "refresh-cw" },
129
+ { type: "stats", label: "Total Metrics", icon: "hash", entity: "StatMetric" },
130
+ { type: "meter", value: 0, label: "Overall Performance", icon: "gauge", entity: "StatMetric" }
131
+ ] }]
132
+ ]
133
+ },
134
+ {
135
+ from: "refreshing",
136
+ to: "displaying",
137
+ event: "REFRESHED",
138
+ effects: [
139
+ ...statsPanelDisplayEffects
140
+ ]
141
+ }
142
+ ]
143
+ }
144
+ }
145
+ ],
146
+ pages: [
147
+ {
148
+ name: "StatsPage",
149
+ path: "/stats",
150
+ isInitial: true,
151
+ traits: [{ ref: "StatsPanelControl" }]
152
+ }
153
+ ]
154
+ }
155
+ ]
156
+ };
157
+ var chartDisplayEffects = [
158
+ ["fetch", "ChartData"],
159
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
160
+ // Header: icon + title
161
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
162
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
163
+ { type: "icon", name: "bar-chart-2", size: "lg" },
164
+ { type: "typography", variant: "h2", content: "Charts" }
165
+ ] }
166
+ ] },
167
+ { type: "divider" },
168
+ // Period selector buttons
169
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
170
+ { type: "button", label: "Daily", icon: "calendar", variant: "secondary", action: "CHANGE_PERIOD" },
171
+ { type: "button", label: "Weekly", icon: "calendar", variant: "secondary", action: "CHANGE_PERIOD" },
172
+ { type: "button", label: "Monthly", icon: "calendar", variant: "primary", action: "CHANGE_PERIOD" }
173
+ ] },
174
+ { type: "divider" },
175
+ // Stats summary
176
+ { type: "stack", direction: "horizontal", gap: "md", children: [
177
+ { type: "stats", label: "Total Charts", icon: "pie-chart", entity: "ChartData" },
178
+ { type: "stats", label: "Data Points", icon: "database", entity: "ChartData" }
179
+ ] },
180
+ // Chart zone: line chart
181
+ { type: "line-chart", entity: "ChartData" },
182
+ { type: "divider" },
183
+ // Data zone: chart configs as list
184
+ {
185
+ type: "data-list",
186
+ entity: "ChartData",
187
+ variant: "card",
188
+ fields: [
189
+ { name: "title", label: "Chart", icon: "bar-chart-2", variant: "h4" },
190
+ { name: "type", label: "Type", icon: "layers", variant: "badge" },
191
+ { name: "dataPoints", label: "Data Points", icon: "database", variant: "body", format: "number" },
192
+ { name: "period", label: "Period", icon: "clock", variant: "badge" }
193
+ ],
194
+ itemActions: [
195
+ { label: "Drill Down", event: "DRILL_DOWN", icon: "zoom-in" }
196
+ ]
197
+ }
198
+ ] }]
199
+ ];
200
+ var CHART_VIEW_BEHAVIOR = {
201
+ name: "std-chart-view",
202
+ version: "1.0.0",
203
+ description: "Chart display with drill-down and period selection",
204
+ theme: DASHBOARD_THEME,
205
+ orbitals: [
206
+ {
207
+ name: "ChartViewOrbital",
208
+ entity: {
209
+ name: "ChartData",
210
+ persistence: "persistent",
211
+ collection: "chart_data",
212
+ fields: [
213
+ { name: "id", type: "string", required: true },
214
+ { name: "title", type: "string", default: "" },
215
+ { name: "type", type: "string", default: "bar" },
216
+ { name: "dataPoints", type: "number", default: 0 },
217
+ { name: "period", type: "string", default: "monthly" }
218
+ ]
219
+ },
220
+ traits: [
221
+ {
222
+ name: "ChartViewControl",
223
+ linkedEntity: "ChartData",
224
+ category: "interaction",
225
+ stateMachine: {
226
+ states: [
227
+ { name: "loading", isInitial: true },
228
+ { name: "displaying" },
229
+ { name: "drilling" }
230
+ ],
231
+ events: [
232
+ { key: "INIT", name: "Initialize" },
233
+ { key: "LOADED", name: "Data Loaded" },
234
+ { key: "DRILL_DOWN", name: "Drill Down", payloadSchema: [
235
+ { name: "id", type: "string", required: true }
236
+ ] },
237
+ { key: "CHANGE_PERIOD", name: "Change Period", payloadSchema: [
238
+ { name: "period", type: "string", required: true }
239
+ ] },
240
+ { key: "CLOSE", name: "Close" },
241
+ { key: "CANCEL", name: "Cancel" }
242
+ ],
243
+ transitions: [
244
+ {
245
+ from: "loading",
246
+ to: "displaying",
247
+ event: "INIT",
248
+ effects: [
249
+ ...chartDisplayEffects
250
+ ]
251
+ },
252
+ {
253
+ from: "loading",
254
+ to: "displaying",
255
+ event: "LOADED",
256
+ effects: [
257
+ ...chartDisplayEffects
258
+ ]
259
+ },
260
+ {
261
+ from: "displaying",
262
+ to: "displaying",
263
+ event: "CHANGE_PERIOD",
264
+ effects: [
265
+ ["set", "@entity.period", "@payload.period"],
266
+ ...chartDisplayEffects
267
+ ]
268
+ },
269
+ {
270
+ from: "displaying",
271
+ to: "drilling",
272
+ event: "DRILL_DOWN",
273
+ effects: [
274
+ ["fetch", "ChartData"],
275
+ ["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
276
+ // Modal header
277
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
278
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
279
+ { type: "icon", name: "zoom-in", size: "md" },
280
+ { type: "typography", variant: "h3", content: "Chart Detail" }
281
+ ] },
282
+ { type: "button", label: "Close", icon: "x", variant: "ghost", action: "CLOSE" }
283
+ ] },
284
+ { type: "divider" },
285
+ // Detail fields
286
+ { type: "stack", direction: "vertical", gap: "sm", children: [
287
+ { type: "typography", variant: "h4", content: "@entity.title" },
288
+ { type: "badge", content: "@entity.type" },
289
+ { type: "typography", variant: "body", content: "@entity.period" }
290
+ ] },
291
+ // Drill-down chart
292
+ { type: "line-chart", entity: "ChartData" },
293
+ // Stats
294
+ { type: "stats", label: "Data Points", icon: "database", entity: "ChartData" }
295
+ ] }]
296
+ ]
297
+ },
298
+ { from: "drilling", to: "displaying", event: "CLOSE", effects: [["render-ui", "modal", null]] },
299
+ { from: "drilling", to: "displaying", event: "CANCEL", effects: [["render-ui", "modal", null]] }
300
+ ]
301
+ }
302
+ }
303
+ ],
304
+ pages: [
305
+ {
306
+ name: "ChartsPage",
307
+ path: "/charts",
308
+ isInitial: true,
309
+ traits: [{ ref: "ChartViewControl" }]
310
+ }
311
+ ]
312
+ }
313
+ ]
314
+ };
315
+ var kpiBrowsingEffects = [
316
+ ["fetch", "KpiTarget"],
317
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
318
+ // Header: icon + title
319
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
320
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
321
+ { type: "icon", name: "target", size: "lg" },
322
+ { type: "typography", variant: "h2", content: "KPI Dashboard" }
323
+ ] }
324
+ ] },
325
+ { type: "divider" },
326
+ // Stats + overall KPI health meter
327
+ { type: "stack", direction: "horizontal", gap: "md", children: [
328
+ { type: "stats", label: "Total KPIs", icon: "target", entity: "KpiTarget" },
329
+ { type: "stats", label: "On Track", icon: "check-circle", entity: "KpiTarget" },
330
+ { type: "meter", value: 0, label: "Overall KPI Health", icon: "heart-pulse" }
331
+ ] },
332
+ { type: "divider" },
333
+ // Data zone: KPI cards via data-grid
334
+ {
335
+ type: "data-grid",
336
+ entity: "KpiTarget",
337
+ cols: 2,
338
+ gap: "md",
339
+ fields: [
340
+ { name: "name", label: "KPI", icon: "target", variant: "h4" },
341
+ { name: "current", label: "Current", icon: "trending-up", variant: "body", format: "number" },
342
+ { name: "target", label: "Target", icon: "flag", variant: "body", format: "number" },
343
+ { name: "unit", label: "Unit", variant: "caption" },
344
+ { name: "status", label: "Status", icon: "activity", variant: "badge" }
345
+ ],
346
+ itemActions: [
347
+ { label: "View", event: "VIEW_KPI", icon: "eye" }
348
+ ]
349
+ },
350
+ // Progress bar per KPI (aggregate)
351
+ { type: "progress-bar", value: 0, label: "Completion Rate", icon: "percent", entity: "KpiTarget" },
352
+ // Progress to target for selected KPI
353
+ { type: "progress-bar", value: "@entity.current", max: "@entity.target", label: "Progress to Target", icon: "target" }
354
+ ] }]
355
+ ];
356
+ var KPI_BEHAVIOR = {
357
+ name: "std-kpi",
358
+ version: "1.0.0",
359
+ description: "KPI tracker with target management and progress display",
360
+ theme: DASHBOARD_THEME,
361
+ orbitals: [
362
+ {
363
+ name: "KpiOrbital",
364
+ entity: {
365
+ name: "KpiTarget",
366
+ persistence: "persistent",
367
+ collection: "kpi_targets",
368
+ fields: [
369
+ { name: "id", type: "string", required: true },
370
+ { name: "name", type: "string", default: "" },
371
+ { name: "current", type: "number", default: 0 },
372
+ { name: "target", type: "number", default: 100 },
373
+ { name: "unit", type: "string", default: "" },
374
+ { name: "status", type: "string", default: "on_track" }
375
+ ]
376
+ },
377
+ traits: [
378
+ {
379
+ name: "KpiControl",
380
+ linkedEntity: "KpiTarget",
381
+ category: "interaction",
382
+ stateMachine: {
383
+ states: [
384
+ { name: "browsing", isInitial: true },
385
+ { name: "viewing" },
386
+ { name: "editing" }
387
+ ],
388
+ events: [
389
+ { key: "INIT", name: "Initialize" },
390
+ { key: "VIEW_KPI", name: "View KPI", payloadSchema: [
391
+ { name: "id", type: "string", required: true }
392
+ ] },
393
+ { key: "EDIT_KPI", name: "Edit KPI" },
394
+ { key: "SAVE_KPI", name: "Save KPI", payloadSchema: [
395
+ { name: "name", type: "string", required: true },
396
+ { name: "target", type: "number", required: true }
397
+ ] },
398
+ { key: "CLOSE", name: "Close" },
399
+ { key: "CANCEL", name: "Cancel" },
400
+ { key: "BACK_TO_LIST", name: "Back to List" }
401
+ ],
402
+ transitions: [
403
+ {
404
+ from: "browsing",
405
+ to: "browsing",
406
+ event: "INIT",
407
+ effects: [
408
+ ...kpiBrowsingEffects
409
+ ]
410
+ },
411
+ {
412
+ from: "browsing",
413
+ to: "viewing",
414
+ event: "VIEW_KPI",
415
+ effects: [
416
+ ["fetch", "KpiTarget"],
417
+ ["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
418
+ // Modal header
419
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
420
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
421
+ { type: "icon", name: "target", size: "md" },
422
+ { type: "typography", variant: "h3", content: "KPI Detail" }
423
+ ] },
424
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
425
+ { type: "button", label: "Edit", icon: "pencil", variant: "primary", action: "EDIT_KPI" },
426
+ { type: "button", label: "Close", icon: "x", variant: "ghost", action: "CLOSE" }
427
+ ] }
428
+ ] },
429
+ { type: "divider" },
430
+ // KPI detail fields
431
+ { type: "stack", direction: "vertical", gap: "sm", children: [
432
+ { type: "typography", variant: "h4", content: "@entity.name" },
433
+ { type: "stack", direction: "horizontal", gap: "md", children: [
434
+ { type: "typography", variant: "body", content: "@entity.current" },
435
+ { type: "typography", variant: "caption", content: "/" },
436
+ { type: "typography", variant: "body", content: "@entity.target" },
437
+ { type: "typography", variant: "caption", content: "@entity.unit" }
438
+ ] },
439
+ { type: "badge", content: "@entity.status" }
440
+ ] },
441
+ { type: "divider" },
442
+ // Progress meter for this KPI
443
+ { type: "meter", value: "@entity.current", label: "Progress", icon: "trending-up" },
444
+ { type: "progress-bar", value: 0, label: "Target Completion", icon: "flag", entity: "KpiTarget" }
445
+ ] }]
446
+ ]
447
+ },
448
+ { from: "viewing", to: "browsing", event: "CLOSE", effects: [["render-ui", "modal", null]] },
449
+ { from: "viewing", to: "browsing", event: "CANCEL", effects: [["render-ui", "modal", null]] },
450
+ {
451
+ from: "viewing",
452
+ to: "editing",
453
+ event: "EDIT_KPI",
454
+ effects: [
455
+ ["fetch", "KpiTarget"],
456
+ ["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
457
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
458
+ { type: "icon", name: "pencil", size: "md" },
459
+ { type: "typography", variant: "h3", content: "Edit KPI" }
460
+ ] },
461
+ { type: "divider" },
462
+ {
463
+ type: "form-section",
464
+ entity: "KpiTarget",
465
+ submitEvent: "SAVE_KPI",
466
+ cancelEvent: "CANCEL"
467
+ }
468
+ ] }]
469
+ ]
470
+ },
471
+ {
472
+ from: "editing",
473
+ to: "browsing",
474
+ event: "SAVE_KPI",
475
+ effects: [
476
+ ["set", "@entity.name", "@payload.name"],
477
+ ["set", "@entity.target", "@payload.target"],
478
+ ["render-ui", "modal", null],
479
+ ...kpiBrowsingEffects
480
+ ]
481
+ },
482
+ { from: "editing", to: "browsing", event: "CLOSE", effects: [["render-ui", "modal", null]] },
483
+ { from: "editing", to: "browsing", event: "CANCEL", effects: [["render-ui", "modal", null]] },
484
+ {
485
+ from: "editing",
486
+ to: "browsing",
487
+ event: "BACK_TO_LIST",
488
+ effects: [
489
+ ["render-ui", "modal", null],
490
+ ...kpiBrowsingEffects
491
+ ]
492
+ }
493
+ ]
494
+ }
495
+ }
496
+ ],
497
+ pages: [
498
+ {
499
+ name: "KpiPage",
500
+ path: "/kpi",
501
+ isInitial: true,
502
+ traits: [{ ref: "KpiControl" }]
503
+ }
504
+ ]
505
+ }
506
+ ]
507
+ };
508
+ var reportBrowsingEffects = [
509
+ ["fetch", "Report"],
510
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
511
+ // Header: icon + title + create button
512
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
513
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
514
+ { type: "icon", name: "file-text", size: "lg" },
515
+ { type: "typography", variant: "h2", content: "Reports" }
516
+ ] },
517
+ { type: "button", label: "Create Report", icon: "plus", variant: "primary", action: "CREATE_REPORT" }
518
+ ] },
519
+ { type: "divider" },
520
+ // Stats
521
+ { type: "stack", direction: "horizontal", gap: "md", children: [
522
+ { type: "stats", label: "Total Reports", icon: "file-text", entity: "Report" },
523
+ { type: "stats", label: "Completed", icon: "check-circle", entity: "Report" },
524
+ { type: "stats", label: "In Progress", icon: "clock", entity: "Report" }
525
+ ] },
526
+ { type: "divider" },
527
+ // Search
528
+ { type: "search-input", placeholder: "Search reports...", entity: "Report" },
529
+ // Report list
530
+ {
531
+ type: "data-list",
532
+ entity: "Report",
533
+ variant: "card",
534
+ fields: [
535
+ { name: "title", label: "Report", icon: "file-text", variant: "h4" },
536
+ { name: "type", label: "Type", icon: "tag", variant: "badge" },
537
+ { name: "dateRange", label: "Date Range", icon: "calendar", variant: "body" },
538
+ { name: "status", label: "Status", icon: "activity", variant: "badge" }
539
+ ],
540
+ itemActions: [
541
+ { label: "View", event: "VIEW_REPORT", icon: "eye" }
542
+ ]
543
+ }
544
+ ] }]
545
+ ];
546
+ var REPORT_BEHAVIOR = {
547
+ name: "std-report",
548
+ version: "1.0.0",
549
+ description: "Report generator with configure, generate, and view workflow",
550
+ theme: DASHBOARD_THEME,
551
+ orbitals: [
552
+ {
553
+ name: "ReportOrbital",
554
+ entity: {
555
+ name: "Report",
556
+ persistence: "persistent",
557
+ collection: "reports",
558
+ fields: [
559
+ { name: "id", type: "string", required: true },
560
+ { name: "title", type: "string", default: "" },
561
+ { name: "type", type: "string", default: "summary" },
562
+ { name: "dateRange", type: "string", default: "" },
563
+ { name: "status", type: "string", default: "draft" }
564
+ ]
565
+ },
566
+ traits: [
567
+ {
568
+ name: "ReportWorkflow",
569
+ linkedEntity: "Report",
570
+ category: "interaction",
571
+ stateMachine: {
572
+ states: [
573
+ { name: "browsing", isInitial: true },
574
+ { name: "configuring" },
575
+ { name: "generating" },
576
+ { name: "viewing" }
577
+ ],
578
+ events: [
579
+ { key: "INIT", name: "Initialize" },
580
+ { key: "CREATE_REPORT", name: "Create Report" },
581
+ { key: "CONFIGURE", name: "Configure", payloadSchema: [
582
+ { name: "title", type: "string", required: true },
583
+ { name: "type", type: "string", required: true },
584
+ { name: "dateRange", type: "string", required: true }
585
+ ] },
586
+ { key: "GENERATE", name: "Generate Report" },
587
+ { key: "GENERATED", name: "Report Generated" },
588
+ { key: "VIEW_REPORT", name: "View Report", payloadSchema: [
589
+ { name: "id", type: "string", required: true }
590
+ ] },
591
+ { key: "BACK_TO_LIST", name: "Back to List" }
592
+ ],
593
+ transitions: [
594
+ {
595
+ from: "browsing",
596
+ to: "browsing",
597
+ event: "INIT",
598
+ effects: [
599
+ ...reportBrowsingEffects
600
+ ]
601
+ },
602
+ {
603
+ from: "browsing",
604
+ to: "configuring",
605
+ event: "CREATE_REPORT",
606
+ effects: [
607
+ ["fetch", "Report"],
608
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
609
+ // Header
610
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
611
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
612
+ { type: "icon", name: "settings", size: "lg" },
613
+ { type: "typography", variant: "h2", content: "Configure Report" }
614
+ ] },
615
+ { type: "button", label: "Back", icon: "arrow-left", variant: "ghost", action: "BACK_TO_LIST" }
616
+ ] },
617
+ { type: "divider" },
618
+ // Form section for report configuration
619
+ {
620
+ type: "form-section",
621
+ entity: "Report",
622
+ submitEvent: "CONFIGURE",
623
+ cancelEvent: "BACK_TO_LIST"
624
+ }
625
+ ] }]
626
+ ]
627
+ },
628
+ {
629
+ from: "configuring",
630
+ to: "generating",
631
+ event: "CONFIGURE",
632
+ effects: [
633
+ ["set", "@entity.title", "@payload.title"],
634
+ ["set", "@entity.type", "@payload.type"],
635
+ ["set", "@entity.dateRange", "@payload.dateRange"],
636
+ ["set", "@entity.status", "generating"],
637
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
638
+ // Header
639
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
640
+ { type: "icon", name: "loader", size: "lg" },
641
+ { type: "typography", variant: "h2", content: "Generating Report" }
642
+ ] },
643
+ { type: "divider" },
644
+ // Progress animation
645
+ { type: "stack", direction: "vertical", gap: "md", children: [
646
+ { type: "typography", variant: "body", content: "@entity.title" },
647
+ { type: "badge", content: "@entity.type" },
648
+ { type: "progress-bar", value: 0, label: "Generating...", icon: "loader" },
649
+ { type: "typography", variant: "caption", content: "Please wait while the report is being generated." }
650
+ ] }
651
+ ] }]
652
+ ]
653
+ },
654
+ {
655
+ from: "configuring",
656
+ to: "browsing",
657
+ event: "BACK_TO_LIST",
658
+ effects: [
659
+ ...reportBrowsingEffects
660
+ ]
661
+ },
662
+ {
663
+ from: "generating",
664
+ to: "viewing",
665
+ event: "GENERATED",
666
+ effects: [
667
+ ["fetch", "Report"],
668
+ ["set", "@entity.status", "complete"],
669
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
670
+ // Header with back button
671
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
672
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
673
+ { type: "icon", name: "file-text", size: "lg" },
674
+ { type: "typography", variant: "h2", content: "Report" }
675
+ ] },
676
+ { type: "button", label: "Back to List", icon: "arrow-left", variant: "ghost", action: "BACK_TO_LIST" }
677
+ ] },
678
+ { type: "divider" },
679
+ // Report details
680
+ { type: "stack", direction: "vertical", gap: "sm", children: [
681
+ { type: "typography", variant: "h3", content: "@entity.title" },
682
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
683
+ { type: "badge", content: "@entity.type" },
684
+ { type: "badge", content: "@entity.status" }
685
+ ] },
686
+ { type: "typography", variant: "body", content: "@entity.dateRange" }
687
+ ] },
688
+ { type: "divider" },
689
+ // Report chart
690
+ { type: "line-chart", entity: "Report" },
691
+ // Report data
692
+ {
693
+ type: "data-grid",
694
+ entity: "Report",
695
+ cols: 2,
696
+ gap: "md",
697
+ fields: [
698
+ { name: "title", label: "Title", icon: "file-text", variant: "h4" },
699
+ { name: "type", label: "Type", icon: "tag", variant: "badge" },
700
+ { name: "dateRange", label: "Period", icon: "calendar", variant: "body" },
701
+ { name: "status", label: "Status", icon: "check-circle", variant: "badge" }
702
+ ]
703
+ }
704
+ ] }]
705
+ ]
706
+ },
707
+ {
708
+ from: "browsing",
709
+ to: "viewing",
710
+ event: "VIEW_REPORT",
711
+ effects: [
712
+ ["fetch", "Report"],
713
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
714
+ // Header with back button
715
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
716
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
717
+ { type: "icon", name: "file-text", size: "lg" },
718
+ { type: "typography", variant: "h2", content: "Report" }
719
+ ] },
720
+ { type: "button", label: "Back to List", icon: "arrow-left", variant: "ghost", action: "BACK_TO_LIST" }
721
+ ] },
722
+ { type: "divider" },
723
+ // Report details
724
+ { type: "stack", direction: "vertical", gap: "sm", children: [
725
+ { type: "typography", variant: "h3", content: "@entity.title" },
726
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
727
+ { type: "badge", content: "@entity.type" },
728
+ { type: "badge", content: "@entity.status" }
729
+ ] },
730
+ { type: "typography", variant: "body", content: "@entity.dateRange" }
731
+ ] },
732
+ { type: "divider" },
733
+ // Report chart
734
+ { type: "line-chart", entity: "Report" },
735
+ // Report data
736
+ {
737
+ type: "data-grid",
738
+ entity: "Report",
739
+ cols: 2,
740
+ gap: "md",
741
+ fields: [
742
+ { name: "title", label: "Title", icon: "file-text", variant: "h4" },
743
+ { name: "type", label: "Type", icon: "tag", variant: "badge" },
744
+ { name: "dateRange", label: "Period", icon: "calendar", variant: "body" },
745
+ { name: "status", label: "Status", icon: "check-circle", variant: "badge" }
746
+ ]
747
+ }
748
+ ] }]
749
+ ]
750
+ },
751
+ {
752
+ from: "viewing",
753
+ to: "browsing",
754
+ event: "BACK_TO_LIST",
755
+ effects: [
756
+ ...reportBrowsingEffects
757
+ ]
758
+ }
759
+ ]
760
+ }
761
+ }
762
+ ],
763
+ pages: [
764
+ {
765
+ name: "ReportsPage",
766
+ path: "/reports",
767
+ isInitial: true,
768
+ traits: [{ ref: "ReportWorkflow" }]
769
+ }
770
+ ]
771
+ }
772
+ ]
773
+ };
774
+ var DASHBOARD_BEHAVIORS = [
775
+ STATS_PANEL_BEHAVIOR,
776
+ CHART_VIEW_BEHAVIOR,
777
+ KPI_BEHAVIOR,
778
+ REPORT_BEHAVIOR
779
+ ];
780
+
781
+ export { CHART_VIEW_BEHAVIOR, DASHBOARD_BEHAVIORS, KPI_BEHAVIOR, REPORT_BEHAVIOR, STATS_PANEL_BEHAVIOR };
782
+ //# sourceMappingURL=dashboard.js.map
783
+ //# sourceMappingURL=dashboard.js.map