@almadar/std 13.12.0 → 13.13.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "std-tabs",
3
3
  "version": "2.0.0",
4
- "description": "std-tabs — embeddable tab-navigation atom. Drop into a layout\nmolecule to give the user a tabs strip that swaps which trait fills\nthe active tab's slot. Each tab points at a sibling trait via a\n@trait.X content reference; clicking a tab updates the atom's own\n@entity.activeTab and re-renders so only the matching trait's\noutput shows. Events remap at the call site (TAB_CHANGED -> Y) so\nthe host molecule can listen for routing, persistence, analytics.\n\nEach entry in `tabs` (all but `id` and `label` optional):\n- id string! stable tab id (used as activeTab key)\n- label string! visible tab text\n- icon string lucide icon name\n- badge string small badge in the tab strip (e.g. unread count)\n- content string @trait.X reference for the panel body. The host\n molecule binds a sibling trait there; only the\n active tab's content renders at any time. Omit\n to leave the panel empty.\n\nConfig:\n- tabs [TabSpec] = []\n- defaultTab string = '' id of the initial active tab.\n Falls back to tabs[0].id if blank.\n- variant default|pills|underline = default visual style\n- orientation horizontal|vertical = horizontal tab strip orientation\n\nCompiler statically unrolls array/map over @config.tabs so every\nTabSpec field is fully baked into the emitted props at codegen\ntime.",
4
+ "description": "std-tabs — embeddable tab-navigation atom. Renders a tabs strip from @config.tabs ([{id, label, icon?, badge?, content?}]); clicking a tab updates @entity.activeTab so only the matching @trait.X content shows. Events remap at the call site for routing, persistence, analytics.",
5
5
  "orbitals": [
6
6
  {
7
7
  "name": "TabsItemOrbital",
@@ -26,8 +26,8 @@
26
26
  "items": {
27
27
  "type": "object",
28
28
  "properties": {
29
- "label": {
30
- "name": "label",
29
+ "content": {
30
+ "name": "content",
31
31
  "type": "string"
32
32
  },
33
33
  "icon": {
@@ -38,13 +38,13 @@
38
38
  "name": "badge",
39
39
  "type": "string"
40
40
  },
41
- "content": {
42
- "name": "content",
43
- "type": "string"
44
- },
45
41
  "id": {
46
42
  "name": "id",
47
43
  "type": "string"
44
+ },
45
+ "label": {
46
+ "name": "label",
47
+ "type": "string"
48
48
  }
49
49
  }
50
50
  }
@@ -113,12 +113,12 @@
113
113
  "render-ui",
114
114
  "main",
115
115
  {
116
- "tabChangeEvent": "TAB_CHANGED",
117
116
  "orientation": "@config.orientation",
118
- "type": "tabs",
119
117
  "activeTab": "@entity.activeTab",
120
- "items": "@entity.items",
121
- "variant": "@config.variant"
118
+ "variant": "@config.variant",
119
+ "tabChangeEvent": "TAB_CHANGED",
120
+ "type": "tabs",
121
+ "items": "@entity.items"
122
122
  }
123
123
  ]
124
124
  ]
@@ -138,8 +138,8 @@
138
138
  "main",
139
139
  {
140
140
  "tabChangeEvent": "TAB_CHANGED",
141
- "orientation": "@config.orientation",
142
141
  "variant": "@config.variant",
142
+ "orientation": "@config.orientation",
143
143
  "items": "@entity.items",
144
144
  "activeTab": "@entity.activeTab",
145
145
  "type": "tabs"
@@ -150,14 +150,18 @@
150
150
  ]
151
151
  },
152
152
  "config": {
153
- "defaultTab": {
154
- "type": "string",
155
- "default": ""
156
- },
157
153
  "tabs": {
158
154
  "type": "[object]",
159
155
  "default": []
160
156
  },
157
+ "orientation": {
158
+ "type": "string",
159
+ "default": "horizontal",
160
+ "values": [
161
+ "horizontal",
162
+ "vertical"
163
+ ]
164
+ },
161
165
  "variant": {
162
166
  "type": "string",
163
167
  "default": "default",
@@ -167,13 +171,9 @@
167
171
  "underline"
168
172
  ]
169
173
  },
170
- "orientation": {
174
+ "defaultTab": {
171
175
  "type": "string",
172
- "default": "horizontal",
173
- "values": [
174
- "horizontal",
175
- "vertical"
176
- ]
176
+ "default": ""
177
177
  }
178
178
  },
179
179
  "scope": "instance"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "std-dashboard",
3
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.",
4
+ "description": "std-dashboard — molecule composing std-stats + std-graphs + std-browse (stat cards top, charts middle, data list bottom). Browse is the data hub; Stats and Graphs listen for `BrowseItemLoaded -> ITEMS_LOADED`.",
5
5
  "orbitals": [
6
6
  {
7
7
  "name": "DashboardItemOrbital",
@@ -64,20 +64,20 @@
64
64
  "ref": "Stats.traits.StatsItemStats",
65
65
  "name": "DashboardSummary",
66
66
  "config": {
67
- "title": "Summary",
68
67
  "metrics": [
69
68
  {
70
69
  "aggregation": "count",
71
- "label": "Total Items",
72
70
  "icon": "list",
71
+ "label": "Total Items",
73
72
  "variant": "primary",
74
73
  "format": "number"
75
74
  },
76
75
  {
77
- "aggregation": "count",
78
- "icon": "check-circle",
79
- "variant": "success",
80
76
  "label": "Active",
77
+ "variant": "success",
78
+ "icon": "check-circle",
79
+ "aggregation": "count",
80
+ "format": "number",
81
81
  "filter": [
82
82
  "fn",
83
83
  "row",
@@ -86,28 +86,28 @@
86
86
  "@row.status",
87
87
  "active"
88
88
  ]
89
- ],
90
- "format": "number"
89
+ ]
91
90
  },
92
91
  {
93
- "variant": "info",
94
- "field": "amount",
95
92
  "aggregation": "sum",
96
93
  "target": 10000.0,
94
+ "label": "Total Revenue",
95
+ "variant": "info",
97
96
  "icon": "dollar-sign",
98
97
  "format": "currency",
99
- "label": "Total Revenue"
98
+ "field": "amount"
100
99
  },
101
100
  {
102
- "variant": "default",
103
- "label": "Avg Units",
104
101
  "format": "number",
105
- "suffix": " units",
102
+ "label": "Avg Units",
106
103
  "icon": "trending-up",
104
+ "suffix": " units",
107
105
  "field": "units",
108
- "aggregation": "avg"
106
+ "aggregation": "avg",
107
+ "variant": "default"
109
108
  }
110
- ]
109
+ ],
110
+ "title": "Summary"
111
111
  },
112
112
  "listens": [
113
113
  {
@@ -124,13 +124,13 @@
124
124
  "ref": "Graphs.traits.GraphItemGraph",
125
125
  "name": "DashboardCategoryChart",
126
126
  "config": {
127
+ "subtitle": "Count across categories",
128
+ "aggregation": "count",
127
129
  "showLegend": false,
128
- "title": "Items by Category",
129
130
  "chartType": "bar",
130
- "aggregation": "count",
131
- "subtitle": "Count across categories",
132
131
  "categoryField": "category",
133
- "height": 280.0
132
+ "height": 280.0,
133
+ "title": "Items by Category"
134
134
  },
135
135
  "listens": [
136
136
  {
@@ -147,12 +147,12 @@
147
147
  "ref": "Graphs.traits.GraphItemGraph",
148
148
  "name": "DashboardStatusChart",
149
149
  "config": {
150
+ "aggregation": "count",
150
151
  "categoryField": "status",
151
- "showLegend": true,
152
- "chartType": "donut",
153
- "height": 280.0,
154
152
  "title": "Status Mix",
155
- "aggregation": "count"
153
+ "chartType": "donut",
154
+ "showLegend": true,
155
+ "height": 280.0
156
156
  },
157
157
  "listens": [
158
158
  {
@@ -172,28 +172,28 @@
172
172
  "config": {
173
173
  "fields": [
174
174
  {
175
- "label": "Name",
175
+ "name": "name",
176
176
  "variant": "h4",
177
- "name": "name"
177
+ "label": "Name"
178
178
  },
179
179
  {
180
+ "variant": "caption",
180
181
  "name": "category",
181
- "label": "Category",
182
- "variant": "caption"
182
+ "label": "Category"
183
183
  },
184
184
  {
185
- "name": "status",
186
185
  "variant": "badge",
187
- "label": "Status"
186
+ "label": "Status",
187
+ "name": "status"
188
188
  },
189
189
  {
190
- "label": "Amount",
190
+ "variant": "caption",
191
191
  "name": "amount",
192
- "variant": "caption"
192
+ "label": "Amount"
193
193
  }
194
194
  ],
195
- "pageSize": 100.0,
196
- "displayPageSize": 5.0
195
+ "displayPageSize": 5.0,
196
+ "pageSize": 100.0
197
197
  }
198
198
  },
199
199
  {
@@ -274,8 +274,8 @@
274
274
  "DashboardItem",
275
275
  {
276
276
  "emit": {
277
- "failure": "DashboardItemLoadFailed",
278
- "success": "DashboardItemLoaded"
277
+ "success": "DashboardItemLoaded",
278
+ "failure": "DashboardItemLoadFailed"
279
279
  }
280
280
  }
281
281
  ],
@@ -283,51 +283,51 @@
283
283
  "render-ui",
284
284
  "main",
285
285
  {
286
- "direction": "vertical",
287
- "gap": "lg",
288
286
  "children": [
289
287
  {
290
288
  "children": [
291
289
  {
292
- "name": "bar-chart-2",
293
- "type": "icon"
290
+ "type": "icon",
291
+ "name": "bar-chart-2"
294
292
  },
295
293
  {
296
- "type": "typography",
294
+ "content": "Dashboard",
297
295
  "variant": "h2",
298
- "content": "Dashboard"
296
+ "type": "typography"
299
297
  }
300
298
  ],
301
299
  "type": "stack",
300
+ "direction": "horizontal",
302
301
  "gap": "sm",
303
- "align": "center",
304
- "direction": "horizontal"
302
+ "align": "center"
305
303
  },
306
304
  {
307
305
  "type": "divider"
308
306
  },
309
307
  "@trait.DashboardSummary",
310
308
  {
309
+ "gap": "md",
310
+ "cols": 2.0,
311
+ "type": "simple-grid",
311
312
  "children": [
312
313
  "@trait.DashboardCategoryChart",
313
314
  "@trait.DashboardStatusChart"
314
- ],
315
- "type": "simple-grid",
316
- "gap": "md",
317
- "cols": 2.0
315
+ ]
318
316
  },
319
317
  {
320
318
  "type": "divider"
321
319
  },
322
320
  {
323
- "content": "Recent Items",
321
+ "variant": "h3",
324
322
  "type": "typography",
325
- "variant": "h3"
323
+ "content": "Recent Items"
326
324
  },
327
325
  "@trait.DashboardItemBrowse"
328
326
  ],
327
+ "className": "max-w-6xl mx-auto w-full p-4",
329
328
  "type": "stack",
330
- "className": "max-w-6xl mx-auto w-full p-4"
329
+ "direction": "vertical",
330
+ "gap": "lg"
331
331
  }
332
332
  ]
333
333
  ]
@@ -0,0 +1,230 @@
1
+ {
2
+ "name": "std-stack-layout",
3
+ "version": "1.0.0",
4
+ "description": "std-stack-layout — minimal vertical-stack shell (header + browse + pagination)",
5
+ "orbitals": [
6
+ {
7
+ "name": "StackLayoutItemOrbital",
8
+ "uses": [
9
+ {
10
+ "from": "std/behaviors/std-browse",
11
+ "as": "Browse"
12
+ },
13
+ {
14
+ "from": "std/behaviors/std-pagination",
15
+ "as": "Pagination"
16
+ }
17
+ ],
18
+ "entity": {
19
+ "name": "StackLayoutItem",
20
+ "collection": "stacklayoutitems",
21
+ "persistence": "persistent",
22
+ "fields": [
23
+ {
24
+ "name": "id",
25
+ "type": "string",
26
+ "required": true
27
+ },
28
+ {
29
+ "name": "name",
30
+ "type": "string"
31
+ },
32
+ {
33
+ "name": "description",
34
+ "type": "string"
35
+ }
36
+ ]
37
+ },
38
+ "traits": [
39
+ {
40
+ "ref": "Browse.traits.BrowseItemBrowse",
41
+ "name": "StackLayoutBrowse",
42
+ "linkedEntity": "StackLayoutItem",
43
+ "config": {
44
+ "pageSize": 10.0,
45
+ "fields": [
46
+ {
47
+ "variant": "h5",
48
+ "label": "Name",
49
+ "name": "name"
50
+ },
51
+ {
52
+ "label": "Description",
53
+ "name": "description",
54
+ "variant": "caption"
55
+ }
56
+ ]
57
+ },
58
+ "listens": [
59
+ {
60
+ "event": "PAGE",
61
+ "triggers": "REFETCH_PAGE",
62
+ "source": {
63
+ "kind": "trait",
64
+ "trait": "StackLayoutPagination"
65
+ }
66
+ }
67
+ ]
68
+ },
69
+ {
70
+ "ref": "Pagination.traits.PagedItemPagination",
71
+ "name": "StackLayoutPagination",
72
+ "config": {
73
+ "event": "PAGE",
74
+ "pageSize": 10.0
75
+ },
76
+ "listens": [
77
+ {
78
+ "event": "BrowseItemLoaded",
79
+ "triggers": "ITEMS_LOADED",
80
+ "source": {
81
+ "kind": "trait",
82
+ "trait": "StackLayoutBrowse"
83
+ }
84
+ }
85
+ ]
86
+ },
87
+ {
88
+ "name": "StackLayout",
89
+ "category": "interaction",
90
+ "linkedEntity": "StackLayoutItem",
91
+ "emits": [
92
+ {
93
+ "event": "StackLayoutItemLoadFailed",
94
+ "scope": "internal",
95
+ "payloadSchema": [
96
+ {
97
+ "name": "error",
98
+ "type": "string"
99
+ },
100
+ {
101
+ "name": "code",
102
+ "type": "string"
103
+ }
104
+ ]
105
+ },
106
+ {
107
+ "event": "StackLayoutItemLoaded",
108
+ "scope": "internal",
109
+ "payloadSchema": [
110
+ {
111
+ "name": "data",
112
+ "type": "[StackLayoutItem]"
113
+ }
114
+ ]
115
+ }
116
+ ],
117
+ "stateMachine": {
118
+ "states": [
119
+ {
120
+ "name": "composing",
121
+ "isInitial": true
122
+ }
123
+ ],
124
+ "events": [
125
+ {
126
+ "key": "INIT",
127
+ "name": "Initialize"
128
+ },
129
+ {
130
+ "key": "StackLayoutItemLoadFailed",
131
+ "name": "StackLayoutItem load failed",
132
+ "payloadSchema": [
133
+ {
134
+ "name": "error",
135
+ "type": "string"
136
+ },
137
+ {
138
+ "name": "code",
139
+ "type": "string"
140
+ }
141
+ ]
142
+ },
143
+ {
144
+ "key": "StackLayoutItemLoaded",
145
+ "name": "StackLayoutItem loaded",
146
+ "payloadSchema": [
147
+ {
148
+ "name": "data",
149
+ "type": "[StackLayoutItem]"
150
+ }
151
+ ]
152
+ }
153
+ ],
154
+ "transitions": [
155
+ {
156
+ "from": "composing",
157
+ "to": "composing",
158
+ "event": "INIT",
159
+ "effects": [
160
+ [
161
+ "fetch",
162
+ "StackLayoutItem",
163
+ {
164
+ "emit": {
165
+ "success": "StackLayoutItemLoaded",
166
+ "failure": "StackLayoutItemLoadFailed"
167
+ }
168
+ }
169
+ ],
170
+ [
171
+ "render-ui",
172
+ "main",
173
+ {
174
+ "type": "stack",
175
+ "children": [
176
+ {
177
+ "direction": "horizontal",
178
+ "align": "center",
179
+ "gap": "sm",
180
+ "type": "stack",
181
+ "children": [
182
+ {
183
+ "type": "icon",
184
+ "name": "list"
185
+ },
186
+ {
187
+ "content": "List",
188
+ "type": "typography",
189
+ "variant": "h2"
190
+ }
191
+ ]
192
+ },
193
+ {
194
+ "type": "divider"
195
+ },
196
+ "@trait.StackLayoutBrowse",
197
+ "@trait.StackLayoutPagination"
198
+ ],
199
+ "gap": "md",
200
+ "className": "max-w-5xl mx-auto w-full",
201
+ "direction": "vertical"
202
+ }
203
+ ]
204
+ ]
205
+ }
206
+ ]
207
+ },
208
+ "scope": "collection"
209
+ }
210
+ ],
211
+ "pages": [
212
+ {
213
+ "name": "StackLayoutPage",
214
+ "path": "/stack-layout",
215
+ "traits": [
216
+ {
217
+ "ref": "StackLayout"
218
+ },
219
+ {
220
+ "ref": "StackLayoutBrowse"
221
+ },
222
+ {
223
+ "ref": "StackLayoutPagination"
224
+ }
225
+ ]
226
+ }
227
+ ]
228
+ }
229
+ ]
230
+ }