@almadar/std 2.1.1 → 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 +1 -1
@@ -0,0 +1,930 @@
1
+ // behaviors/domain/scheduling.ts
2
+ var SCHEDULING_THEME = {
3
+ name: "scheduling-violet",
4
+ tokens: {
5
+ colors: {
6
+ primary: "#7c3aed",
7
+ "primary-hover": "#6d28d9",
8
+ "primary-foreground": "#ffffff",
9
+ accent: "#a78bfa",
10
+ "accent-foreground": "#000000",
11
+ success: "#22c55e",
12
+ warning: "#f59e0b",
13
+ error: "#ef4444"
14
+ }
15
+ }
16
+ };
17
+ var calendarBrowsingMainEffect = ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
18
+ // Header row: calendar icon + title + create button
19
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
20
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
21
+ { type: "icon", name: "calendar", size: "lg" },
22
+ { type: "typography", variant: "h2", content: "Calendar" }
23
+ ] },
24
+ { type: "button", label: "New Event", icon: "calendar-plus", variant: "primary", action: "CREATE" }
25
+ ] },
26
+ { type: "divider" },
27
+ // Stats row
28
+ { type: "stack", direction: "horizontal", gap: "md", children: [
29
+ { type: "stats", label: "Total Events", icon: "calendar", value: "@entity.id" },
30
+ { type: "stats", label: "All Day", icon: "clock", value: "@entity.isAllDay" }
31
+ ] },
32
+ { type: "divider" },
33
+ // Calendar grid view
34
+ {
35
+ type: "calendar-grid",
36
+ entity: "CalendarEvent",
37
+ dateField: "startDate",
38
+ titleField: "title",
39
+ itemActions: [
40
+ { label: "View", event: "VIEW", icon: "eye" }
41
+ ]
42
+ },
43
+ // Search bar
44
+ { type: "search-input", placeholder: "Search events...", icon: "search", entity: "CalendarEvent" },
45
+ // Data list below calendar
46
+ {
47
+ type: "data-list",
48
+ entity: "CalendarEvent",
49
+ variant: "card",
50
+ fields: [
51
+ { name: "title", label: "Event", icon: "calendar-check", variant: "h4" },
52
+ { name: "startDate", label: "Start", icon: "clock", variant: "body" },
53
+ { name: "endDate", label: "End", icon: "clock", variant: "caption" },
54
+ { name: "location", label: "Location", icon: "map-pin", variant: "badge" }
55
+ ],
56
+ itemActions: [
57
+ { label: "View", event: "VIEW", icon: "eye" }
58
+ ]
59
+ }
60
+ ] }];
61
+ var CALENDAR_BEHAVIOR = {
62
+ name: "std-calendar",
63
+ version: "1.0.0",
64
+ description: "Calendar event management with CRUD operations",
65
+ theme: SCHEDULING_THEME,
66
+ orbitals: [
67
+ {
68
+ name: "CalendarOrbital",
69
+ entity: {
70
+ name: "CalendarEvent",
71
+ persistence: "persistent",
72
+ collection: "calendar_events",
73
+ fields: [
74
+ { name: "id", type: "string", required: true },
75
+ { name: "title", type: "string", default: "" },
76
+ { name: "startDate", type: "string", default: "" },
77
+ { name: "endDate", type: "string", default: "" },
78
+ { name: "location", type: "string", default: "" },
79
+ { name: "isAllDay", type: "boolean", default: false }
80
+ ]
81
+ },
82
+ traits: [
83
+ {
84
+ name: "CalendarManager",
85
+ linkedEntity: "CalendarEvent",
86
+ category: "interaction",
87
+ stateMachine: {
88
+ states: [
89
+ { name: "browsing", isInitial: true },
90
+ { name: "creating" },
91
+ { name: "viewing" },
92
+ { name: "editing" }
93
+ ],
94
+ events: [
95
+ { key: "INIT", name: "Initialize" },
96
+ { key: "CREATE", name: "Create Event" },
97
+ { key: "SUBMIT", name: "Submit Event", payloadSchema: [
98
+ { name: "title", type: "string", required: true },
99
+ { name: "startDate", type: "string", required: true },
100
+ { name: "endDate", type: "string", required: true },
101
+ { name: "location", type: "string", required: true },
102
+ { name: "isAllDay", type: "boolean", required: true }
103
+ ] },
104
+ { key: "VIEW", name: "View Event", payloadSchema: [{ name: "id", type: "string", required: true }] },
105
+ { key: "EDIT", name: "Edit Event" },
106
+ { key: "UPDATE", name: "Update Event", payloadSchema: [
107
+ { name: "title", type: "string", required: true },
108
+ { name: "startDate", type: "string", required: true },
109
+ { name: "endDate", type: "string", required: true },
110
+ { name: "location", type: "string", required: true },
111
+ { name: "isAllDay", type: "boolean", required: true }
112
+ ] },
113
+ { key: "CANCEL", name: "Cancel" },
114
+ { key: "CLOSE", name: "Close" }
115
+ ],
116
+ transitions: [
117
+ {
118
+ from: "browsing",
119
+ to: "browsing",
120
+ event: "INIT",
121
+ effects: [
122
+ ["fetch", "CalendarEvent"],
123
+ calendarBrowsingMainEffect
124
+ ]
125
+ },
126
+ {
127
+ from: "browsing",
128
+ to: "creating",
129
+ event: "CREATE",
130
+ effects: [
131
+ ["fetch", "CalendarEvent"],
132
+ ["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
133
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
134
+ { type: "icon", name: "calendar-plus", size: "md" },
135
+ { type: "typography", variant: "h3", content: "New Event" }
136
+ ] },
137
+ { type: "divider" },
138
+ {
139
+ type: "form-section",
140
+ entity: "CalendarEvent",
141
+ title: "Event Details",
142
+ submitEvent: "SUBMIT",
143
+ cancelEvent: "CANCEL"
144
+ }
145
+ ] }]
146
+ ]
147
+ },
148
+ {
149
+ from: "creating",
150
+ to: "browsing",
151
+ event: "SUBMIT",
152
+ effects: [
153
+ ["set", "@entity.title", "@payload.title"],
154
+ ["set", "@entity.startDate", "@payload.startDate"],
155
+ ["set", "@entity.endDate", "@payload.endDate"],
156
+ ["set", "@entity.location", "@payload.location"],
157
+ ["set", "@entity.isAllDay", "@payload.isAllDay"],
158
+ ["render-ui", "modal", null],
159
+ ["fetch", "CalendarEvent"],
160
+ calendarBrowsingMainEffect
161
+ ]
162
+ },
163
+ {
164
+ from: "creating",
165
+ to: "browsing",
166
+ event: "CANCEL",
167
+ effects: [
168
+ ["render-ui", "modal", null]
169
+ ]
170
+ },
171
+ {
172
+ from: "browsing",
173
+ to: "viewing",
174
+ event: "VIEW",
175
+ effects: [
176
+ ["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
177
+ // Event title with icon
178
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
179
+ { type: "icon", name: "calendar-check", size: "md" },
180
+ { type: "typography", variant: "h3", content: "@entity.title" }
181
+ ] },
182
+ { type: "divider" },
183
+ // Detail fields
184
+ { type: "stack", direction: "vertical", gap: "sm", children: [
185
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
186
+ { type: "icon", name: "clock", size: "sm" },
187
+ { type: "typography", variant: "body", content: "@entity.startDate" },
188
+ { type: "typography", variant: "caption", content: "to" },
189
+ { type: "typography", variant: "body", content: "@entity.endDate" }
190
+ ] },
191
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
192
+ { type: "icon", name: "map-pin", size: "sm" },
193
+ { type: "typography", variant: "body", content: "@entity.location" }
194
+ ] }
195
+ ] },
196
+ { type: "divider" },
197
+ // Actions
198
+ { type: "stack", direction: "horizontal", gap: "sm", justify: "end", children: [
199
+ { type: "button", label: "Edit", icon: "edit", variant: "secondary", action: "EDIT" },
200
+ { type: "button", label: "Close", icon: "x", variant: "ghost", action: "CLOSE" }
201
+ ] }
202
+ ] }]
203
+ ]
204
+ },
205
+ {
206
+ from: "viewing",
207
+ to: "editing",
208
+ event: "EDIT",
209
+ effects: [
210
+ ["fetch", "CalendarEvent"],
211
+ ["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
212
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
213
+ { type: "icon", name: "edit", size: "md" },
214
+ { type: "typography", variant: "h3", content: "Edit Event" }
215
+ ] },
216
+ { type: "divider" },
217
+ {
218
+ type: "form-section",
219
+ entity: "CalendarEvent",
220
+ title: "Update Details",
221
+ submitEvent: "UPDATE",
222
+ cancelEvent: "CANCEL"
223
+ }
224
+ ] }]
225
+ ]
226
+ },
227
+ {
228
+ from: "editing",
229
+ to: "browsing",
230
+ event: "UPDATE",
231
+ effects: [
232
+ ["set", "@entity.title", "@payload.title"],
233
+ ["set", "@entity.startDate", "@payload.startDate"],
234
+ ["set", "@entity.endDate", "@payload.endDate"],
235
+ ["set", "@entity.location", "@payload.location"],
236
+ ["set", "@entity.isAllDay", "@payload.isAllDay"],
237
+ ["render-ui", "modal", null],
238
+ ["fetch", "CalendarEvent"],
239
+ calendarBrowsingMainEffect
240
+ ]
241
+ },
242
+ {
243
+ from: "editing",
244
+ to: "browsing",
245
+ event: "CANCEL",
246
+ effects: [
247
+ ["render-ui", "modal", null]
248
+ ]
249
+ },
250
+ {
251
+ from: "viewing",
252
+ to: "browsing",
253
+ event: "CLOSE",
254
+ effects: [
255
+ ["render-ui", "modal", null]
256
+ ]
257
+ },
258
+ {
259
+ from: "viewing",
260
+ to: "browsing",
261
+ event: "CANCEL",
262
+ effects: [
263
+ ["render-ui", "modal", null]
264
+ ]
265
+ }
266
+ ]
267
+ }
268
+ }
269
+ ],
270
+ pages: [
271
+ {
272
+ name: "CalendarPage",
273
+ path: "/calendar",
274
+ isInitial: true,
275
+ traits: [{ ref: "CalendarManager" }]
276
+ }
277
+ ]
278
+ }
279
+ ]
280
+ };
281
+ var bookingBrowsingMainEffect = ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
282
+ // Header: users icon + title + new booking button
283
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
284
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
285
+ { type: "icon", name: "users", size: "lg" },
286
+ { type: "typography", variant: "h2", content: "Bookings" }
287
+ ] },
288
+ { type: "button", label: "New Booking", icon: "calendar-plus", variant: "primary", action: "SELECT" }
289
+ ] },
290
+ { type: "divider" },
291
+ // Stats row: total bookings + status breakdown
292
+ { type: "stack", direction: "horizontal", gap: "md", children: [
293
+ { type: "stats", label: "Total Bookings", icon: "calendar", value: "@entity.id" },
294
+ { type: "stats", label: "Status", icon: "check-circle", value: "@entity.status" }
295
+ ] },
296
+ { type: "divider" },
297
+ // Search
298
+ { type: "search-input", placeholder: "Search bookings...", icon: "search", entity: "Booking" },
299
+ // Data grid with booking details
300
+ {
301
+ type: "data-grid",
302
+ entity: "Booking",
303
+ columns: [
304
+ { name: "service", label: "Service", icon: "briefcase" },
305
+ { name: "clientName", label: "Client", icon: "user" },
306
+ { name: "date", label: "Date", icon: "calendar" },
307
+ { name: "time", label: "Time", icon: "clock" },
308
+ { name: "status", label: "Status", icon: "activity", variant: "badge" }
309
+ ],
310
+ itemActions: [
311
+ { label: "Select", event: "SELECT", icon: "arrow-right" }
312
+ ]
313
+ },
314
+ // Timeline of upcoming bookings
315
+ {
316
+ type: "line-chart",
317
+ entity: "Booking",
318
+ label: "Booking Trend",
319
+ icon: "trending-up",
320
+ xField: "date",
321
+ yField: "id"
322
+ }
323
+ ] }];
324
+ var BOOKING_BEHAVIOR = {
325
+ name: "std-booking",
326
+ version: "1.0.0",
327
+ description: "Booking system with service selection and confirmation",
328
+ theme: SCHEDULING_THEME,
329
+ orbitals: [
330
+ {
331
+ name: "BookingOrbital",
332
+ entity: {
333
+ name: "Booking",
334
+ persistence: "persistent",
335
+ collection: "bookings",
336
+ fields: [
337
+ { name: "id", type: "string", required: true },
338
+ { name: "service", type: "string", default: "" },
339
+ { name: "date", type: "string", default: "" },
340
+ { name: "time", type: "string", default: "" },
341
+ { name: "clientName", type: "string", default: "" },
342
+ { name: "status", type: "string", default: "pending" }
343
+ ]
344
+ },
345
+ traits: [
346
+ {
347
+ name: "BookingFlow",
348
+ linkedEntity: "Booking",
349
+ category: "interaction",
350
+ stateMachine: {
351
+ states: [
352
+ { name: "browsing", isInitial: true },
353
+ { name: "selecting" },
354
+ { name: "confirming" },
355
+ { name: "confirmed" }
356
+ ],
357
+ events: [
358
+ { key: "INIT", name: "Initialize" },
359
+ { key: "SELECT", name: "Select Booking", payloadSchema: [{ name: "id", type: "string", required: true }] },
360
+ { key: "FILL_DETAILS", name: "Fill Details", payloadSchema: [
361
+ { name: "service", type: "string", required: true },
362
+ { name: "date", type: "string", required: true },
363
+ { name: "time", type: "string", required: true },
364
+ { name: "clientName", type: "string", required: true }
365
+ ] },
366
+ { key: "CONFIRM", name: "Confirm Booking" },
367
+ { key: "CANCEL", name: "Cancel" },
368
+ { key: "CLOSE", name: "Close" },
369
+ { key: "BACK", name: "Go Back" }
370
+ ],
371
+ transitions: [
372
+ {
373
+ from: "browsing",
374
+ to: "browsing",
375
+ event: "INIT",
376
+ effects: [
377
+ ["fetch", "Booking"],
378
+ bookingBrowsingMainEffect
379
+ ]
380
+ },
381
+ {
382
+ from: "browsing",
383
+ to: "selecting",
384
+ event: "SELECT",
385
+ effects: [
386
+ ["fetch", "Booking"],
387
+ ["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
388
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
389
+ { type: "icon", name: "calendar-plus", size: "md" },
390
+ { type: "typography", variant: "h3", content: "Book a Service" }
391
+ ] },
392
+ { type: "divider" },
393
+ {
394
+ type: "form-section",
395
+ entity: "Booking",
396
+ title: "Service Details",
397
+ submitEvent: "FILL_DETAILS",
398
+ cancelEvent: "CANCEL"
399
+ }
400
+ ] }]
401
+ ]
402
+ },
403
+ {
404
+ from: "selecting",
405
+ to: "confirming",
406
+ event: "FILL_DETAILS",
407
+ effects: [
408
+ ["set", "@entity.service", "@payload.service"],
409
+ ["set", "@entity.date", "@payload.date"],
410
+ ["set", "@entity.time", "@payload.time"],
411
+ ["set", "@entity.clientName", "@payload.clientName"],
412
+ ["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
413
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
414
+ { type: "icon", name: "check-circle", size: "md" },
415
+ { type: "typography", variant: "h3", content: "Confirm Booking" }
416
+ ] },
417
+ { type: "divider" },
418
+ // Booking summary
419
+ { type: "stack", direction: "vertical", gap: "sm", children: [
420
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
421
+ { type: "icon", name: "briefcase", size: "sm" },
422
+ { type: "typography", variant: "body", content: "@entity.service" }
423
+ ] },
424
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
425
+ { type: "icon", name: "user", size: "sm" },
426
+ { type: "typography", variant: "body", content: "@entity.clientName" }
427
+ ] },
428
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
429
+ { type: "icon", name: "calendar", size: "sm" },
430
+ { type: "typography", variant: "body", content: "@entity.date" },
431
+ { type: "icon", name: "clock", size: "sm" },
432
+ { type: "typography", variant: "body", content: "@entity.time" }
433
+ ] }
434
+ ] },
435
+ { type: "divider" },
436
+ { type: "stack", direction: "horizontal", gap: "sm", justify: "end", children: [
437
+ { type: "button", label: "Confirm", icon: "check", variant: "primary", action: "CONFIRM" },
438
+ { type: "button", label: "Back", icon: "arrow-left", variant: "ghost", action: "BACK" }
439
+ ] }
440
+ ] }]
441
+ ]
442
+ },
443
+ {
444
+ from: "confirming",
445
+ to: "confirmed",
446
+ event: "CONFIRM",
447
+ effects: [
448
+ ["set", "@entity.status", "confirmed"],
449
+ ["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", align: "center", children: [
450
+ { type: "icon", name: "check-circle", size: "xl" },
451
+ { type: "typography", variant: "h3", content: "Booking Confirmed" },
452
+ { type: "typography", variant: "body", content: "Your appointment has been scheduled." },
453
+ { type: "divider" },
454
+ { type: "stack", direction: "vertical", gap: "sm", children: [
455
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
456
+ { type: "icon", name: "briefcase", size: "sm" },
457
+ { type: "typography", variant: "body", content: "@entity.service" }
458
+ ] },
459
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
460
+ { type: "icon", name: "calendar", size: "sm" },
461
+ { type: "typography", variant: "body", content: "@entity.date" }
462
+ ] },
463
+ { type: "badge", label: "Confirmed", variant: "success", icon: "check" }
464
+ ] },
465
+ { type: "divider" },
466
+ { type: "button", label: "Close", icon: "x", variant: "secondary", action: "CLOSE" }
467
+ ] }]
468
+ ]
469
+ },
470
+ {
471
+ from: "confirming",
472
+ to: "selecting",
473
+ event: "BACK",
474
+ effects: [
475
+ ["fetch", "Booking"],
476
+ ["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
477
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
478
+ { type: "icon", name: "calendar-plus", size: "md" },
479
+ { type: "typography", variant: "h3", content: "Book a Service" }
480
+ ] },
481
+ { type: "divider" },
482
+ {
483
+ type: "form-section",
484
+ entity: "Booking",
485
+ title: "Service Details",
486
+ submitEvent: "FILL_DETAILS",
487
+ cancelEvent: "CANCEL"
488
+ }
489
+ ] }]
490
+ ]
491
+ },
492
+ {
493
+ from: "selecting",
494
+ to: "browsing",
495
+ event: "CANCEL",
496
+ effects: [
497
+ ["render-ui", "modal", null]
498
+ ]
499
+ },
500
+ {
501
+ from: "confirming",
502
+ to: "browsing",
503
+ event: "CANCEL",
504
+ effects: [
505
+ ["render-ui", "modal", null]
506
+ ]
507
+ },
508
+ {
509
+ from: "confirmed",
510
+ to: "browsing",
511
+ event: "CLOSE",
512
+ effects: [
513
+ ["render-ui", "modal", null],
514
+ ["fetch", "Booking"],
515
+ bookingBrowsingMainEffect
516
+ ]
517
+ },
518
+ {
519
+ from: "confirmed",
520
+ to: "browsing",
521
+ event: "CANCEL",
522
+ effects: [
523
+ ["render-ui", "modal", null],
524
+ ["fetch", "Booking"],
525
+ bookingBrowsingMainEffect
526
+ ]
527
+ }
528
+ ]
529
+ }
530
+ }
531
+ ],
532
+ pages: [
533
+ {
534
+ name: "BookingsPage",
535
+ path: "/bookings",
536
+ isInitial: true,
537
+ traits: [{ ref: "BookingFlow" }]
538
+ }
539
+ ]
540
+ }
541
+ ]
542
+ };
543
+ var availabilityBrowsingMainEffect = ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
544
+ // Header: clock icon + title
545
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
546
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
547
+ { type: "icon", name: "clock", size: "lg" },
548
+ { type: "typography", variant: "h2", content: "Availability" }
549
+ ] }
550
+ ] },
551
+ { type: "divider" },
552
+ // Stats: available vs total slots
553
+ { type: "stack", direction: "horizontal", gap: "md", children: [
554
+ { type: "stats", label: "Total Slots", icon: "timer", value: "@entity.id" },
555
+ { type: "stats", label: "Available", icon: "check-circle", value: "@entity.isAvailable" }
556
+ ] },
557
+ // Availability meter
558
+ { type: "meter", label: "Availability Rate", icon: "activity", value: "@entity.isAvailable", max: 100, variant: "success" },
559
+ { type: "divider" },
560
+ // Weekly grid of time slots
561
+ {
562
+ type: "data-grid",
563
+ entity: "TimeSlot",
564
+ columns: [
565
+ { name: "dayOfWeek", label: "Day", icon: "calendar" },
566
+ { name: "startTime", label: "Start", icon: "clock" },
567
+ { name: "endTime", label: "End", icon: "clock" },
568
+ { name: "isAvailable", label: "Available", icon: "check-circle", variant: "badge" }
569
+ ],
570
+ itemActions: [
571
+ { label: "Edit", event: "EDIT", icon: "edit" }
572
+ ]
573
+ }
574
+ ] }];
575
+ var AVAILABILITY_BEHAVIOR = {
576
+ name: "std-availability",
577
+ version: "1.0.0",
578
+ description: "Availability time slot management",
579
+ theme: SCHEDULING_THEME,
580
+ orbitals: [
581
+ {
582
+ name: "AvailabilityOrbital",
583
+ entity: {
584
+ name: "TimeSlot",
585
+ persistence: "persistent",
586
+ collection: "time_slots",
587
+ fields: [
588
+ { name: "id", type: "string", required: true },
589
+ { name: "dayOfWeek", type: "string", default: "" },
590
+ { name: "startTime", type: "string", default: "" },
591
+ { name: "endTime", type: "string", default: "" },
592
+ { name: "isAvailable", type: "boolean", default: true }
593
+ ]
594
+ },
595
+ traits: [
596
+ {
597
+ name: "AvailabilityManager",
598
+ linkedEntity: "TimeSlot",
599
+ category: "interaction",
600
+ stateMachine: {
601
+ states: [
602
+ { name: "browsing", isInitial: true },
603
+ { name: "editing" }
604
+ ],
605
+ events: [
606
+ { key: "INIT", name: "Initialize" },
607
+ { key: "EDIT", name: "Edit Slot", payloadSchema: [{ name: "id", type: "string", required: true }] },
608
+ { key: "UPDATE", name: "Update Slot", payloadSchema: [
609
+ { name: "dayOfWeek", type: "string", required: true },
610
+ { name: "startTime", type: "string", required: true },
611
+ { name: "endTime", type: "string", required: true },
612
+ { name: "isAvailable", type: "boolean", required: true }
613
+ ] },
614
+ { key: "CANCEL", name: "Cancel" },
615
+ { key: "CLOSE", name: "Close" }
616
+ ],
617
+ transitions: [
618
+ {
619
+ from: "browsing",
620
+ to: "browsing",
621
+ event: "INIT",
622
+ effects: [
623
+ ["fetch", "TimeSlot"],
624
+ availabilityBrowsingMainEffect
625
+ ]
626
+ },
627
+ {
628
+ from: "browsing",
629
+ to: "editing",
630
+ event: "EDIT",
631
+ effects: [
632
+ ["fetch", "TimeSlot"],
633
+ ["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
634
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
635
+ { type: "icon", name: "edit", size: "md" },
636
+ { type: "typography", variant: "h3", content: "Edit Time Slot" }
637
+ ] },
638
+ { type: "divider" },
639
+ // Current slot info
640
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
641
+ { type: "badge", label: "@entity.dayOfWeek", variant: "default", icon: "calendar" },
642
+ { type: "typography", variant: "caption", content: "@entity.startTime" },
643
+ { type: "typography", variant: "caption", content: "-" },
644
+ { type: "typography", variant: "caption", content: "@entity.endTime" }
645
+ ] },
646
+ { type: "divider" },
647
+ {
648
+ type: "form-section",
649
+ entity: "TimeSlot",
650
+ title: "Slot Details",
651
+ submitEvent: "UPDATE",
652
+ cancelEvent: "CANCEL"
653
+ }
654
+ ] }]
655
+ ]
656
+ },
657
+ {
658
+ from: "editing",
659
+ to: "browsing",
660
+ event: "UPDATE",
661
+ effects: [
662
+ ["set", "@entity.dayOfWeek", "@payload.dayOfWeek"],
663
+ ["set", "@entity.startTime", "@payload.startTime"],
664
+ ["set", "@entity.endTime", "@payload.endTime"],
665
+ ["set", "@entity.isAvailable", "@payload.isAvailable"],
666
+ ["render-ui", "modal", null],
667
+ ["fetch", "TimeSlot"],
668
+ availabilityBrowsingMainEffect
669
+ ]
670
+ },
671
+ {
672
+ from: "editing",
673
+ to: "browsing",
674
+ event: "CANCEL",
675
+ effects: [
676
+ ["render-ui", "modal", null]
677
+ ]
678
+ },
679
+ {
680
+ from: "editing",
681
+ to: "browsing",
682
+ event: "CLOSE",
683
+ effects: [
684
+ ["render-ui", "modal", null]
685
+ ]
686
+ }
687
+ ]
688
+ }
689
+ }
690
+ ],
691
+ pages: [
692
+ {
693
+ name: "AvailabilityPage",
694
+ path: "/availability",
695
+ isInitial: true,
696
+ traits: [{ ref: "AvailabilityManager" }]
697
+ }
698
+ ]
699
+ }
700
+ ]
701
+ };
702
+ var reminderBrowsingMainEffect = ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
703
+ // Header: bell icon + title + create button
704
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
705
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
706
+ { type: "icon", name: "repeat", size: "lg" },
707
+ { type: "typography", variant: "h2", content: "Reminders" }
708
+ ] },
709
+ { type: "button", label: "New Reminder", icon: "calendar-plus", variant: "primary", action: "CREATE" }
710
+ ] },
711
+ { type: "divider" },
712
+ // Stats: total + completed + by priority
713
+ { type: "stack", direction: "horizontal", gap: "md", children: [
714
+ { type: "stats", label: "Total", icon: "list", value: "@entity.id" },
715
+ { type: "stats", label: "Completed", icon: "check-circle", value: "@entity.isCompleted" },
716
+ { type: "stats", label: "Priority", icon: "alert-triangle", value: "@entity.priority" }
717
+ ] },
718
+ { type: "divider" },
719
+ // Search
720
+ { type: "search-input", placeholder: "Search reminders...", icon: "search", entity: "Reminder" },
721
+ // Reminder data list
722
+ {
723
+ type: "data-list",
724
+ entity: "Reminder",
725
+ variant: "card",
726
+ fields: [
727
+ { name: "title", label: "Reminder", icon: "repeat", variant: "h4" },
728
+ { name: "dueDate", label: "Due", icon: "calendar", variant: "body" },
729
+ { name: "priority", label: "Priority", icon: "alert-triangle", variant: "badge" },
730
+ { name: "isCompleted", label: "Done", icon: "check-circle", variant: "badge" }
731
+ ],
732
+ itemActions: [
733
+ { label: "View", event: "VIEW", icon: "eye" }
734
+ ]
735
+ },
736
+ // Timeline chart
737
+ {
738
+ type: "line-chart",
739
+ entity: "Reminder",
740
+ label: "Due Date Timeline",
741
+ icon: "trending-up",
742
+ xField: "dueDate",
743
+ yField: "id"
744
+ }
745
+ ] }];
746
+ var REMINDER_BEHAVIOR = {
747
+ name: "std-reminder",
748
+ version: "1.0.0",
749
+ description: "Reminder system with priority tracking",
750
+ theme: SCHEDULING_THEME,
751
+ orbitals: [
752
+ {
753
+ name: "ReminderOrbital",
754
+ entity: {
755
+ name: "Reminder",
756
+ persistence: "persistent",
757
+ collection: "reminders",
758
+ fields: [
759
+ { name: "id", type: "string", required: true },
760
+ { name: "title", type: "string", default: "" },
761
+ { name: "dueDate", type: "string", default: "" },
762
+ { name: "priority", type: "string", default: "medium" },
763
+ { name: "isCompleted", type: "boolean", default: false }
764
+ ]
765
+ },
766
+ traits: [
767
+ {
768
+ name: "ReminderManager",
769
+ linkedEntity: "Reminder",
770
+ category: "interaction",
771
+ stateMachine: {
772
+ states: [
773
+ { name: "browsing", isInitial: true },
774
+ { name: "creating" },
775
+ { name: "viewing" }
776
+ ],
777
+ events: [
778
+ { key: "INIT", name: "Initialize" },
779
+ { key: "CREATE", name: "Create Reminder" },
780
+ { key: "SUBMIT", name: "Submit Reminder", payloadSchema: [
781
+ { name: "title", type: "string", required: true },
782
+ { name: "dueDate", type: "string", required: true },
783
+ { name: "priority", type: "string", required: true }
784
+ ] },
785
+ { key: "VIEW", name: "View Reminder", payloadSchema: [{ name: "id", type: "string", required: true }] },
786
+ { key: "COMPLETE", name: "Complete Reminder" },
787
+ { key: "CANCEL", name: "Cancel" },
788
+ { key: "CLOSE", name: "Close" }
789
+ ],
790
+ transitions: [
791
+ {
792
+ from: "browsing",
793
+ to: "browsing",
794
+ event: "INIT",
795
+ effects: [
796
+ ["fetch", "Reminder"],
797
+ reminderBrowsingMainEffect
798
+ ]
799
+ },
800
+ {
801
+ from: "browsing",
802
+ to: "creating",
803
+ event: "CREATE",
804
+ effects: [
805
+ ["fetch", "Reminder"],
806
+ ["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
807
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
808
+ { type: "icon", name: "calendar-plus", size: "md" },
809
+ { type: "typography", variant: "h3", content: "New Reminder" }
810
+ ] },
811
+ { type: "divider" },
812
+ {
813
+ type: "form-section",
814
+ entity: "Reminder",
815
+ title: "Reminder Details",
816
+ submitEvent: "SUBMIT",
817
+ cancelEvent: "CANCEL"
818
+ }
819
+ ] }]
820
+ ]
821
+ },
822
+ {
823
+ from: "creating",
824
+ to: "browsing",
825
+ event: "SUBMIT",
826
+ effects: [
827
+ ["set", "@entity.title", "@payload.title"],
828
+ ["set", "@entity.dueDate", "@payload.dueDate"],
829
+ ["set", "@entity.priority", "@payload.priority"],
830
+ ["render-ui", "modal", null],
831
+ ["fetch", "Reminder"],
832
+ reminderBrowsingMainEffect
833
+ ]
834
+ },
835
+ {
836
+ from: "creating",
837
+ to: "browsing",
838
+ event: "CANCEL",
839
+ effects: [
840
+ ["render-ui", "modal", null]
841
+ ]
842
+ },
843
+ {
844
+ from: "browsing",
845
+ to: "viewing",
846
+ event: "VIEW",
847
+ effects: [
848
+ ["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
849
+ // Title with icon
850
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
851
+ { type: "icon", name: "repeat", size: "md" },
852
+ { type: "typography", variant: "h3", content: "@entity.title" }
853
+ ] },
854
+ { type: "divider" },
855
+ // Detail fields
856
+ { type: "stack", direction: "vertical", gap: "sm", children: [
857
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
858
+ { type: "icon", name: "calendar", size: "sm" },
859
+ { type: "typography", variant: "body", content: "@entity.dueDate" }
860
+ ] },
861
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
862
+ { type: "icon", name: "alert-triangle", size: "sm" },
863
+ { type: "badge", label: "@entity.priority", variant: "warning" }
864
+ ] },
865
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
866
+ { type: "icon", name: "check-circle", size: "sm" },
867
+ { type: "badge", label: "@entity.isCompleted", variant: "default" }
868
+ ] }
869
+ ] },
870
+ { type: "divider" },
871
+ // Actions
872
+ { type: "stack", direction: "horizontal", gap: "sm", justify: "end", children: [
873
+ { type: "button", label: "Complete", icon: "check", variant: "primary", action: "COMPLETE" },
874
+ { type: "button", label: "Close", icon: "x", variant: "ghost", action: "CLOSE" }
875
+ ] }
876
+ ] }]
877
+ ]
878
+ },
879
+ {
880
+ from: "viewing",
881
+ to: "browsing",
882
+ event: "COMPLETE",
883
+ effects: [
884
+ ["set", "@entity.isCompleted", true],
885
+ ["render-ui", "modal", null],
886
+ ["fetch", "Reminder"],
887
+ reminderBrowsingMainEffect
888
+ ]
889
+ },
890
+ {
891
+ from: "viewing",
892
+ to: "browsing",
893
+ event: "CLOSE",
894
+ effects: [
895
+ ["render-ui", "modal", null]
896
+ ]
897
+ },
898
+ {
899
+ from: "viewing",
900
+ to: "browsing",
901
+ event: "CANCEL",
902
+ effects: [
903
+ ["render-ui", "modal", null]
904
+ ]
905
+ }
906
+ ]
907
+ }
908
+ }
909
+ ],
910
+ pages: [
911
+ {
912
+ name: "RemindersPage",
913
+ path: "/reminders",
914
+ isInitial: true,
915
+ traits: [{ ref: "ReminderManager" }]
916
+ }
917
+ ]
918
+ }
919
+ ]
920
+ };
921
+ var SCHEDULING_BEHAVIORS = [
922
+ CALENDAR_BEHAVIOR,
923
+ BOOKING_BEHAVIOR,
924
+ AVAILABILITY_BEHAVIOR,
925
+ REMINDER_BEHAVIOR
926
+ ];
927
+
928
+ export { AVAILABILITY_BEHAVIOR, BOOKING_BEHAVIOR, CALENDAR_BEHAVIOR, REMINDER_BEHAVIOR, SCHEDULING_BEHAVIORS };
929
+ //# sourceMappingURL=scheduling.js.map
930
+ //# sourceMappingURL=scheduling.js.map