@almadar/std 13.2.6 → 13.3.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.
- package/behaviors/registry/core/atoms/std-display.orb +19 -1511
- package/behaviors/registry/core/atoms/std-graphs.orb +275 -0
- package/behaviors/registry/core/atoms/std-pagination.orb +23 -13
- package/behaviors/registry/core/atoms/std-stats.orb +329 -0
- package/behaviors/registry/core/molecules/std-dashboard.orb +354 -0
- package/dist/behaviors/behaviors-registry.json +201 -127
- package/dist/behaviors/registry/core/atoms/std-display.orb +19 -1511
- package/dist/behaviors/registry/core/atoms/std-graphs.orb +275 -0
- package/dist/behaviors/registry/core/atoms/std-pagination.orb +23 -13
- package/dist/behaviors/registry/core/atoms/std-stats.orb +329 -0
- package/dist/behaviors/registry/core/molecules/std-dashboard.orb +354 -0
- package/dist/behaviors-registry.json +201 -127
- package/package.json +1 -1
|
@@ -0,0 +1,354 @@
|
|
|
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
|
+
"title": "Summary",
|
|
68
|
+
"metrics": [
|
|
69
|
+
{
|
|
70
|
+
"variant": "primary",
|
|
71
|
+
"aggregation": "count",
|
|
72
|
+
"icon": "list",
|
|
73
|
+
"format": "number",
|
|
74
|
+
"label": "Total Items"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"variant": "success",
|
|
78
|
+
"icon": "check-circle",
|
|
79
|
+
"format": "number",
|
|
80
|
+
"aggregation": "count",
|
|
81
|
+
"label": "Active"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"format": "currency",
|
|
85
|
+
"variant": "info",
|
|
86
|
+
"aggregation": "sum",
|
|
87
|
+
"field": "amount",
|
|
88
|
+
"icon": "dollar-sign",
|
|
89
|
+
"label": "Total Revenue"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"variant": "default",
|
|
93
|
+
"icon": "trending-up",
|
|
94
|
+
"label": "Avg Units",
|
|
95
|
+
"field": "units",
|
|
96
|
+
"format": "number",
|
|
97
|
+
"aggregation": "avg"
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
"listens": [
|
|
102
|
+
{
|
|
103
|
+
"event": "BrowseItemLoaded",
|
|
104
|
+
"triggers": "ITEMS_LOADED",
|
|
105
|
+
"source": {
|
|
106
|
+
"kind": "trait",
|
|
107
|
+
"trait": "DashboardItemBrowse"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"ref": "Graphs.traits.GraphItemGraph",
|
|
114
|
+
"name": "DashboardCategoryChart",
|
|
115
|
+
"config": {
|
|
116
|
+
"subtitle": "Count across categories",
|
|
117
|
+
"chartType": "bar",
|
|
118
|
+
"height": 280.0,
|
|
119
|
+
"title": "Items by Category",
|
|
120
|
+
"categoryField": "category",
|
|
121
|
+
"aggregation": "count",
|
|
122
|
+
"showLegend": false
|
|
123
|
+
},
|
|
124
|
+
"listens": [
|
|
125
|
+
{
|
|
126
|
+
"event": "BrowseItemLoaded",
|
|
127
|
+
"triggers": "ITEMS_LOADED",
|
|
128
|
+
"source": {
|
|
129
|
+
"kind": "trait",
|
|
130
|
+
"trait": "DashboardItemBrowse"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"ref": "Graphs.traits.GraphItemGraph",
|
|
137
|
+
"name": "DashboardStatusChart",
|
|
138
|
+
"config": {
|
|
139
|
+
"showLegend": true,
|
|
140
|
+
"categoryField": "status",
|
|
141
|
+
"aggregation": "count",
|
|
142
|
+
"height": 280.0,
|
|
143
|
+
"title": "Status Mix",
|
|
144
|
+
"chartType": "donut"
|
|
145
|
+
},
|
|
146
|
+
"listens": [
|
|
147
|
+
{
|
|
148
|
+
"event": "BrowseItemLoaded",
|
|
149
|
+
"triggers": "ITEMS_LOADED",
|
|
150
|
+
"source": {
|
|
151
|
+
"kind": "trait",
|
|
152
|
+
"trait": "DashboardItemBrowse"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"ref": "Browse.traits.BrowseItemBrowse",
|
|
159
|
+
"name": "DashboardItemBrowse",
|
|
160
|
+
"linkedEntity": "DashboardItem",
|
|
161
|
+
"config": {
|
|
162
|
+
"fields": [
|
|
163
|
+
{
|
|
164
|
+
"name": "name",
|
|
165
|
+
"label": "Name",
|
|
166
|
+
"variant": "h4"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"label": "Category",
|
|
170
|
+
"name": "category",
|
|
171
|
+
"variant": "caption"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"name": "status",
|
|
175
|
+
"label": "Status",
|
|
176
|
+
"variant": "badge"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"name": "amount",
|
|
180
|
+
"variant": "caption",
|
|
181
|
+
"label": "Amount"
|
|
182
|
+
}
|
|
183
|
+
],
|
|
184
|
+
"pageSize": 100.0,
|
|
185
|
+
"displayPageSize": 5.0
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"name": "DashboardLayout",
|
|
190
|
+
"category": "interaction",
|
|
191
|
+
"linkedEntity": "DashboardItem",
|
|
192
|
+
"emits": [
|
|
193
|
+
{
|
|
194
|
+
"event": "DashboardItemLoaded",
|
|
195
|
+
"scope": "internal",
|
|
196
|
+
"payloadSchema": [
|
|
197
|
+
{
|
|
198
|
+
"name": "data",
|
|
199
|
+
"type": "[DashboardItem]"
|
|
200
|
+
}
|
|
201
|
+
]
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"event": "DashboardItemLoadFailed",
|
|
205
|
+
"scope": "internal",
|
|
206
|
+
"payloadSchema": [
|
|
207
|
+
{
|
|
208
|
+
"name": "error",
|
|
209
|
+
"type": "string"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"name": "code",
|
|
213
|
+
"type": "string"
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
],
|
|
218
|
+
"stateMachine": {
|
|
219
|
+
"states": [
|
|
220
|
+
{
|
|
221
|
+
"name": "composing",
|
|
222
|
+
"isInitial": true
|
|
223
|
+
}
|
|
224
|
+
],
|
|
225
|
+
"events": [
|
|
226
|
+
{
|
|
227
|
+
"key": "INIT",
|
|
228
|
+
"name": "Initialize"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"key": "DashboardItemLoaded",
|
|
232
|
+
"name": "DashboardItem loaded",
|
|
233
|
+
"payloadSchema": [
|
|
234
|
+
{
|
|
235
|
+
"name": "data",
|
|
236
|
+
"type": "[DashboardItem]"
|
|
237
|
+
}
|
|
238
|
+
]
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"key": "DashboardItemLoadFailed",
|
|
242
|
+
"name": "DashboardItem load failed",
|
|
243
|
+
"payloadSchema": [
|
|
244
|
+
{
|
|
245
|
+
"name": "error",
|
|
246
|
+
"type": "string"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"name": "code",
|
|
250
|
+
"type": "string"
|
|
251
|
+
}
|
|
252
|
+
]
|
|
253
|
+
}
|
|
254
|
+
],
|
|
255
|
+
"transitions": [
|
|
256
|
+
{
|
|
257
|
+
"from": "composing",
|
|
258
|
+
"to": "composing",
|
|
259
|
+
"event": "INIT",
|
|
260
|
+
"effects": [
|
|
261
|
+
[
|
|
262
|
+
"fetch",
|
|
263
|
+
"DashboardItem",
|
|
264
|
+
{
|
|
265
|
+
"emit": {
|
|
266
|
+
"success": "DashboardItemLoaded",
|
|
267
|
+
"failure": "DashboardItemLoadFailed"
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
],
|
|
271
|
+
[
|
|
272
|
+
"render-ui",
|
|
273
|
+
"main",
|
|
274
|
+
{
|
|
275
|
+
"type": "stack",
|
|
276
|
+
"gap": "lg",
|
|
277
|
+
"children": [
|
|
278
|
+
{
|
|
279
|
+
"type": "stack",
|
|
280
|
+
"children": [
|
|
281
|
+
{
|
|
282
|
+
"type": "icon",
|
|
283
|
+
"name": "bar-chart-2"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"type": "typography",
|
|
287
|
+
"variant": "h2",
|
|
288
|
+
"content": "Dashboard"
|
|
289
|
+
}
|
|
290
|
+
],
|
|
291
|
+
"align": "center",
|
|
292
|
+
"gap": "sm",
|
|
293
|
+
"direction": "horizontal"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"type": "divider"
|
|
297
|
+
},
|
|
298
|
+
"@trait.DashboardSummary",
|
|
299
|
+
{
|
|
300
|
+
"children": [
|
|
301
|
+
"@trait.DashboardCategoryChart",
|
|
302
|
+
"@trait.DashboardStatusChart"
|
|
303
|
+
],
|
|
304
|
+
"gap": "md",
|
|
305
|
+
"cols": 2.0,
|
|
306
|
+
"type": "simple-grid"
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"type": "divider"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"content": "Recent Items",
|
|
313
|
+
"type": "typography",
|
|
314
|
+
"variant": "h3"
|
|
315
|
+
},
|
|
316
|
+
"@trait.DashboardItemBrowse"
|
|
317
|
+
],
|
|
318
|
+
"className": "max-w-6xl mx-auto w-full p-4",
|
|
319
|
+
"direction": "vertical"
|
|
320
|
+
}
|
|
321
|
+
]
|
|
322
|
+
]
|
|
323
|
+
}
|
|
324
|
+
]
|
|
325
|
+
},
|
|
326
|
+
"scope": "collection"
|
|
327
|
+
}
|
|
328
|
+
],
|
|
329
|
+
"pages": [
|
|
330
|
+
{
|
|
331
|
+
"name": "Dashboard",
|
|
332
|
+
"path": "/dashboard",
|
|
333
|
+
"traits": [
|
|
334
|
+
{
|
|
335
|
+
"ref": "DashboardLayout"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"ref": "DashboardSummary"
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"ref": "DashboardCategoryChart"
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
"ref": "DashboardStatusChart"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"ref": "DashboardItemBrowse"
|
|
348
|
+
}
|
|
349
|
+
]
|
|
350
|
+
}
|
|
351
|
+
]
|
|
352
|
+
}
|
|
353
|
+
]
|
|
354
|
+
}
|