@almadar/std 13.2.7 → 13.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,365 @@
1
+ {
2
+ "name": "std-dashboard",
3
+ "version": "1.0.0",
4
+ "description": "std-dashboard — molecule composing std-stats + std-graphs + std-browse\ninto a typical dashboard view: stat cards across the top, two charts\nin the middle, data list at the bottom. Browse is the data hub — it\nfetches the rows, emits BrowseItemLoaded; Stats and Graphs both listen\nfor it via cross-trait `Browse.BrowseItemLoaded -> ITEMS_LOADED`. All\nthree atoms render into the layout's `main` slot via `@trait.X`\nplacement.",
5
+ "orbitals": [
6
+ {
7
+ "name": "DashboardItemOrbital",
8
+ "uses": [
9
+ {
10
+ "from": "std/behaviors/std-stats",
11
+ "as": "Stats"
12
+ },
13
+ {
14
+ "from": "std/behaviors/std-graphs",
15
+ "as": "Graphs"
16
+ },
17
+ {
18
+ "from": "std/behaviors/std-browse",
19
+ "as": "Browse"
20
+ }
21
+ ],
22
+ "entity": {
23
+ "name": "DashboardItem",
24
+ "collection": "dashboarditems",
25
+ "persistence": "persistent",
26
+ "fields": [
27
+ {
28
+ "name": "id",
29
+ "type": "string",
30
+ "required": true
31
+ },
32
+ {
33
+ "name": "name",
34
+ "type": "string"
35
+ },
36
+ {
37
+ "name": "category",
38
+ "type": "string"
39
+ },
40
+ {
41
+ "name": "status",
42
+ "type": "string",
43
+ "default": "active",
44
+ "values": [
45
+ "active",
46
+ "inactive",
47
+ "pending"
48
+ ]
49
+ },
50
+ {
51
+ "name": "amount",
52
+ "type": "number",
53
+ "default": 0.0
54
+ },
55
+ {
56
+ "name": "units",
57
+ "type": "number",
58
+ "default": 0.0
59
+ }
60
+ ]
61
+ },
62
+ "traits": [
63
+ {
64
+ "ref": "Stats.traits.StatsItemStats",
65
+ "name": "DashboardSummary",
66
+ "config": {
67
+ "metrics": [
68
+ {
69
+ "format": "number",
70
+ "aggregation": "count",
71
+ "label": "Total Items",
72
+ "icon": "list",
73
+ "variant": "primary"
74
+ },
75
+ {
76
+ "aggregation": "count",
77
+ "filter": [
78
+ "fn",
79
+ "row",
80
+ [
81
+ "=",
82
+ "@row.status",
83
+ "active"
84
+ ]
85
+ ],
86
+ "icon": "check-circle",
87
+ "variant": "success",
88
+ "format": "number",
89
+ "label": "Active"
90
+ },
91
+ {
92
+ "label": "Total Revenue",
93
+ "variant": "info",
94
+ "aggregation": "sum",
95
+ "format": "currency",
96
+ "field": "amount",
97
+ "target": 10000.0,
98
+ "icon": "dollar-sign"
99
+ },
100
+ {
101
+ "icon": "trending-up",
102
+ "aggregation": "avg",
103
+ "variant": "default",
104
+ "format": "number",
105
+ "field": "units",
106
+ "label": "Avg Units",
107
+ "suffix": " units"
108
+ }
109
+ ],
110
+ "title": "Summary"
111
+ },
112
+ "listens": [
113
+ {
114
+ "event": "BrowseItemLoaded",
115
+ "triggers": "ITEMS_LOADED",
116
+ "source": {
117
+ "kind": "trait",
118
+ "trait": "DashboardItemBrowse"
119
+ }
120
+ }
121
+ ]
122
+ },
123
+ {
124
+ "ref": "Graphs.traits.GraphItemGraph",
125
+ "name": "DashboardCategoryChart",
126
+ "config": {
127
+ "categoryField": "category",
128
+ "aggregation": "count",
129
+ "height": 280.0,
130
+ "showLegend": false,
131
+ "subtitle": "Count across categories",
132
+ "title": "Items by Category",
133
+ "chartType": "bar"
134
+ },
135
+ "listens": [
136
+ {
137
+ "event": "BrowseItemLoaded",
138
+ "triggers": "ITEMS_LOADED",
139
+ "source": {
140
+ "kind": "trait",
141
+ "trait": "DashboardItemBrowse"
142
+ }
143
+ }
144
+ ]
145
+ },
146
+ {
147
+ "ref": "Graphs.traits.GraphItemGraph",
148
+ "name": "DashboardStatusChart",
149
+ "config": {
150
+ "height": 280.0,
151
+ "categoryField": "status",
152
+ "title": "Status Mix",
153
+ "showLegend": true,
154
+ "chartType": "donut",
155
+ "aggregation": "count"
156
+ },
157
+ "listens": [
158
+ {
159
+ "event": "BrowseItemLoaded",
160
+ "triggers": "ITEMS_LOADED",
161
+ "source": {
162
+ "kind": "trait",
163
+ "trait": "DashboardItemBrowse"
164
+ }
165
+ }
166
+ ]
167
+ },
168
+ {
169
+ "ref": "Browse.traits.BrowseItemBrowse",
170
+ "name": "DashboardItemBrowse",
171
+ "linkedEntity": "DashboardItem",
172
+ "config": {
173
+ "displayPageSize": 5.0,
174
+ "pageSize": 100.0,
175
+ "fields": [
176
+ {
177
+ "name": "name",
178
+ "label": "Name",
179
+ "variant": "h4"
180
+ },
181
+ {
182
+ "name": "category",
183
+ "label": "Category",
184
+ "variant": "caption"
185
+ },
186
+ {
187
+ "variant": "badge",
188
+ "name": "status",
189
+ "label": "Status"
190
+ },
191
+ {
192
+ "variant": "caption",
193
+ "label": "Amount",
194
+ "name": "amount"
195
+ }
196
+ ]
197
+ }
198
+ },
199
+ {
200
+ "name": "DashboardLayout",
201
+ "category": "interaction",
202
+ "linkedEntity": "DashboardItem",
203
+ "emits": [
204
+ {
205
+ "event": "DashboardItemLoaded",
206
+ "scope": "internal",
207
+ "payloadSchema": [
208
+ {
209
+ "name": "data",
210
+ "type": "[DashboardItem]"
211
+ }
212
+ ]
213
+ },
214
+ {
215
+ "event": "DashboardItemLoadFailed",
216
+ "scope": "internal",
217
+ "payloadSchema": [
218
+ {
219
+ "name": "error",
220
+ "type": "string"
221
+ },
222
+ {
223
+ "name": "code",
224
+ "type": "string"
225
+ }
226
+ ]
227
+ }
228
+ ],
229
+ "stateMachine": {
230
+ "states": [
231
+ {
232
+ "name": "composing",
233
+ "isInitial": true
234
+ }
235
+ ],
236
+ "events": [
237
+ {
238
+ "key": "INIT",
239
+ "name": "Initialize"
240
+ },
241
+ {
242
+ "key": "DashboardItemLoaded",
243
+ "name": "DashboardItem loaded",
244
+ "payloadSchema": [
245
+ {
246
+ "name": "data",
247
+ "type": "[DashboardItem]"
248
+ }
249
+ ]
250
+ },
251
+ {
252
+ "key": "DashboardItemLoadFailed",
253
+ "name": "DashboardItem load failed",
254
+ "payloadSchema": [
255
+ {
256
+ "name": "error",
257
+ "type": "string"
258
+ },
259
+ {
260
+ "name": "code",
261
+ "type": "string"
262
+ }
263
+ ]
264
+ }
265
+ ],
266
+ "transitions": [
267
+ {
268
+ "from": "composing",
269
+ "to": "composing",
270
+ "event": "INIT",
271
+ "effects": [
272
+ [
273
+ "fetch",
274
+ "DashboardItem",
275
+ {
276
+ "emit": {
277
+ "failure": "DashboardItemLoadFailed",
278
+ "success": "DashboardItemLoaded"
279
+ }
280
+ }
281
+ ],
282
+ [
283
+ "render-ui",
284
+ "main",
285
+ {
286
+ "type": "stack",
287
+ "className": "max-w-6xl mx-auto w-full p-4",
288
+ "children": [
289
+ {
290
+ "children": [
291
+ {
292
+ "name": "bar-chart-2",
293
+ "type": "icon"
294
+ },
295
+ {
296
+ "type": "typography",
297
+ "variant": "h2",
298
+ "content": "Dashboard"
299
+ }
300
+ ],
301
+ "direction": "horizontal",
302
+ "type": "stack",
303
+ "gap": "sm",
304
+ "align": "center"
305
+ },
306
+ {
307
+ "type": "divider"
308
+ },
309
+ "@trait.DashboardSummary",
310
+ {
311
+ "type": "simple-grid",
312
+ "children": [
313
+ "@trait.DashboardCategoryChart",
314
+ "@trait.DashboardStatusChart"
315
+ ],
316
+ "cols": 2.0,
317
+ "gap": "md"
318
+ },
319
+ {
320
+ "type": "divider"
321
+ },
322
+ {
323
+ "variant": "h3",
324
+ "type": "typography",
325
+ "content": "Recent Items"
326
+ },
327
+ "@trait.DashboardItemBrowse"
328
+ ],
329
+ "gap": "lg",
330
+ "direction": "vertical"
331
+ }
332
+ ]
333
+ ]
334
+ }
335
+ ]
336
+ },
337
+ "scope": "collection"
338
+ }
339
+ ],
340
+ "pages": [
341
+ {
342
+ "name": "Dashboard",
343
+ "path": "/dashboard",
344
+ "traits": [
345
+ {
346
+ "ref": "DashboardLayout"
347
+ },
348
+ {
349
+ "ref": "DashboardSummary"
350
+ },
351
+ {
352
+ "ref": "DashboardCategoryChart"
353
+ },
354
+ {
355
+ "ref": "DashboardStatusChart"
356
+ },
357
+ {
358
+ "ref": "DashboardItemBrowse"
359
+ }
360
+ ]
361
+ }
362
+ ]
363
+ }
364
+ ]
365
+ }