@adia-ai/a2ui-corpus 0.0.1 → 0.0.2
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/CHANGELOG.md +101 -20
- package/catalog-a2ui_0_9.json +804 -41
- package/exemplars/_shell.css +88 -0
- package/exemplars/prose/auth-login/index.html +35 -26
- package/exemplars/prose/cta/a2ui.json +1 -1
- package/exemplars/prose/cta/chunks/prose-cta-card-1.json +1 -1
- package/exemplars/prose/cta/index.html +15 -33
- package/exemplars/prose/feature-grid/index.html +7 -17
- package/exemplars/prose/footer/index.html +8 -9
- package/exemplars/prose/hero/index.html +14 -24
- package/exemplars/prose/pricing/index.html +7 -17
- package/exemplars/prose/steps/index.html +8 -5
- package/exemplars/prose/testimonials/index.html +19 -16
- package/exemplars/ui/auth-login/index.html +27 -34
- package/package.json +1 -1
- package/patterns/_components.json +2 -2
- package/patterns/_index.json +131 -41
- package/patterns/data/chart-card-with-trend-footer.json +102 -0
- package/patterns/data/chart-card-with-trend-footer.yaml +56 -0
- package/patterns/data/chart-grid-with-kpis.json +314 -0
- package/patterns/data/chart-grid-with-kpis.yaml +63 -0
- package/patterns/data/chart-with-filter-pills.json +127 -0
- package/patterns/data/chart-with-filter-pills.yaml +76 -0
- package/patterns/data/stat-with-sparkline.json +67 -0
- package/patterns/data/stat-with-sparkline.yaml +51 -0
- package/fragments/content/chart-legend.json +0 -122
- package/fragments/form/rating-row.json +0 -31
- package/fragments/form/rating-row.yaml +0 -40
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../_schema.json",
|
|
3
|
+
"name": "chart-grid-with-kpis",
|
|
4
|
+
"version": 1,
|
|
5
|
+
"domain": "data",
|
|
6
|
+
"description": "Dashboard with a 4-column KPI stat-with-sparkline row on top and a 2-column grid of chart cards with trend footers below. Modernized version of chart-dashboard using the Phase 1+3 primitives.",
|
|
7
|
+
"tags": {
|
|
8
|
+
"purpose": [
|
|
9
|
+
"visualization",
|
|
10
|
+
"data-display",
|
|
11
|
+
"dashboard"
|
|
12
|
+
],
|
|
13
|
+
"complexity": "complex",
|
|
14
|
+
"layout": "grid",
|
|
15
|
+
"interaction": []
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"dashboard",
|
|
19
|
+
"chart",
|
|
20
|
+
"kpi",
|
|
21
|
+
"stats",
|
|
22
|
+
"sparkline",
|
|
23
|
+
"trend",
|
|
24
|
+
"analytics",
|
|
25
|
+
"reporting"
|
|
26
|
+
],
|
|
27
|
+
"related": [
|
|
28
|
+
"chart-dashboard",
|
|
29
|
+
"stat-with-sparkline",
|
|
30
|
+
"chart-card-with-trend-footer",
|
|
31
|
+
"chart-with-filter-pills",
|
|
32
|
+
"metrics"
|
|
33
|
+
],
|
|
34
|
+
"template": [
|
|
35
|
+
{
|
|
36
|
+
"id": "root",
|
|
37
|
+
"component": "Column",
|
|
38
|
+
"children": [
|
|
39
|
+
"dash-header",
|
|
40
|
+
"kpi-grid",
|
|
41
|
+
"chart-grid"
|
|
42
|
+
],
|
|
43
|
+
"gap": "4"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"id": "dash-header",
|
|
47
|
+
"component": "Row",
|
|
48
|
+
"children": [
|
|
49
|
+
"dash-title",
|
|
50
|
+
"dash-actions"
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"id": "dash-title",
|
|
55
|
+
"component": "Text",
|
|
56
|
+
"textContent": "Dashboard",
|
|
57
|
+
"variant": "title"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "dash-actions",
|
|
61
|
+
"component": "Row",
|
|
62
|
+
"children": [
|
|
63
|
+
"export-btn"
|
|
64
|
+
],
|
|
65
|
+
"gap": "2"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"id": "export-btn",
|
|
69
|
+
"component": "Button",
|
|
70
|
+
"text": "Export",
|
|
71
|
+
"variant": "outline",
|
|
72
|
+
"size": "sm",
|
|
73
|
+
"icon": "download"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"id": "kpi-grid",
|
|
77
|
+
"component": "Grid",
|
|
78
|
+
"children": [
|
|
79
|
+
"k1",
|
|
80
|
+
"k2",
|
|
81
|
+
"k3",
|
|
82
|
+
"k4"
|
|
83
|
+
],
|
|
84
|
+
"columns": "4"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"id": "k1",
|
|
88
|
+
"component": "Card",
|
|
89
|
+
"children": ["k1s"]
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"id": "k1s",
|
|
93
|
+
"component": "Section",
|
|
94
|
+
"children": ["k1stat"]
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"id": "k1stat",
|
|
98
|
+
"component": "Stat",
|
|
99
|
+
"label": "Revenue",
|
|
100
|
+
"value": "$48.2k",
|
|
101
|
+
"change": "+12.5%",
|
|
102
|
+
"trend": "up",
|
|
103
|
+
"children": ["k1spark"]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"id": "k1spark",
|
|
107
|
+
"component": "Chart",
|
|
108
|
+
"slot": "chart",
|
|
109
|
+
"type": "sparkline",
|
|
110
|
+
"x": "month",
|
|
111
|
+
"y": "revenue"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"id": "k2",
|
|
115
|
+
"component": "Card",
|
|
116
|
+
"children": ["k2s"]
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"id": "k2s",
|
|
120
|
+
"component": "Section",
|
|
121
|
+
"children": ["k2stat"]
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"id": "k2stat",
|
|
125
|
+
"component": "Stat",
|
|
126
|
+
"label": "Users",
|
|
127
|
+
"value": "2,340",
|
|
128
|
+
"change": "+8%",
|
|
129
|
+
"trend": "up",
|
|
130
|
+
"children": ["k2spark"]
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"id": "k2spark",
|
|
134
|
+
"component": "Chart",
|
|
135
|
+
"slot": "chart",
|
|
136
|
+
"type": "sparkline",
|
|
137
|
+
"x": "month",
|
|
138
|
+
"y": "users"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"id": "k3",
|
|
142
|
+
"component": "Card",
|
|
143
|
+
"children": ["k3s"]
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"id": "k3s",
|
|
147
|
+
"component": "Section",
|
|
148
|
+
"children": ["k3stat"]
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"id": "k3stat",
|
|
152
|
+
"component": "Stat",
|
|
153
|
+
"label": "Bounce",
|
|
154
|
+
"value": "24.3%",
|
|
155
|
+
"change": "-3.1%",
|
|
156
|
+
"trend": "down",
|
|
157
|
+
"children": ["k3spark"]
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"id": "k3spark",
|
|
161
|
+
"component": "Chart",
|
|
162
|
+
"slot": "chart",
|
|
163
|
+
"type": "sparkline",
|
|
164
|
+
"x": "month",
|
|
165
|
+
"y": "bounce"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"id": "k4",
|
|
169
|
+
"component": "Card",
|
|
170
|
+
"children": ["k4s"]
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"id": "k4s",
|
|
174
|
+
"component": "Section",
|
|
175
|
+
"children": ["k4stat"]
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"id": "k4stat",
|
|
179
|
+
"component": "Stat",
|
|
180
|
+
"label": "Session",
|
|
181
|
+
"value": "4m 23s",
|
|
182
|
+
"change": "+15s",
|
|
183
|
+
"trend": "up",
|
|
184
|
+
"children": ["k4spark"]
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"id": "k4spark",
|
|
188
|
+
"component": "Chart",
|
|
189
|
+
"slot": "chart",
|
|
190
|
+
"type": "sparkline",
|
|
191
|
+
"x": "month",
|
|
192
|
+
"y": "session"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"id": "chart-grid",
|
|
196
|
+
"component": "Grid",
|
|
197
|
+
"children": [
|
|
198
|
+
"ch1",
|
|
199
|
+
"ch2"
|
|
200
|
+
],
|
|
201
|
+
"columns": "2"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"id": "ch1",
|
|
205
|
+
"component": "Card",
|
|
206
|
+
"children": ["ch1h", "ch1s", "ch1f"]
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"id": "ch1h",
|
|
210
|
+
"component": "Header",
|
|
211
|
+
"children": ["ch1t", "ch1d"]
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"id": "ch1t",
|
|
215
|
+
"component": "Text",
|
|
216
|
+
"slot": "heading",
|
|
217
|
+
"textContent": "Revenue",
|
|
218
|
+
"variant": "section"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"id": "ch1d",
|
|
222
|
+
"component": "Text",
|
|
223
|
+
"slot": "description",
|
|
224
|
+
"textContent": "Last 3 months",
|
|
225
|
+
"variant": "caption"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"id": "ch1s",
|
|
229
|
+
"component": "Section",
|
|
230
|
+
"children": ["ch1-chart"]
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"id": "ch1-chart",
|
|
234
|
+
"component": "Chart",
|
|
235
|
+
"type": "area",
|
|
236
|
+
"x": "month",
|
|
237
|
+
"y": "revenue"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"id": "ch1f",
|
|
241
|
+
"component": "Footer",
|
|
242
|
+
"children": ["ch1ft", "ch1fd"]
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"id": "ch1ft",
|
|
246
|
+
"component": "Text",
|
|
247
|
+
"slot": "heading",
|
|
248
|
+
"textContent": "Trending up by 5.2% this month",
|
|
249
|
+
"variant": "body"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"id": "ch1fd",
|
|
253
|
+
"component": "Text",
|
|
254
|
+
"slot": "description",
|
|
255
|
+
"textContent": "January – March 2024",
|
|
256
|
+
"variant": "caption"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"id": "ch2",
|
|
260
|
+
"component": "Card",
|
|
261
|
+
"children": ["ch2h", "ch2s", "ch2f"]
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"id": "ch2h",
|
|
265
|
+
"component": "Header",
|
|
266
|
+
"children": ["ch2t", "ch2d"]
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"id": "ch2t",
|
|
270
|
+
"component": "Text",
|
|
271
|
+
"slot": "heading",
|
|
272
|
+
"textContent": "Users",
|
|
273
|
+
"variant": "section"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"id": "ch2d",
|
|
277
|
+
"component": "Text",
|
|
278
|
+
"slot": "description",
|
|
279
|
+
"textContent": "Daily active users",
|
|
280
|
+
"variant": "caption"
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"id": "ch2s",
|
|
284
|
+
"component": "Section",
|
|
285
|
+
"children": ["ch2-chart"]
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"id": "ch2-chart",
|
|
289
|
+
"component": "Chart",
|
|
290
|
+
"type": "line",
|
|
291
|
+
"x": "month",
|
|
292
|
+
"y": "users"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"id": "ch2f",
|
|
296
|
+
"component": "Footer",
|
|
297
|
+
"children": ["ch2ft", "ch2fd"]
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"id": "ch2ft",
|
|
301
|
+
"component": "Text",
|
|
302
|
+
"slot": "heading",
|
|
303
|
+
"textContent": "2,340 daily users",
|
|
304
|
+
"variant": "body"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"id": "ch2fd",
|
|
308
|
+
"component": "Text",
|
|
309
|
+
"slot": "description",
|
|
310
|
+
"textContent": "Up 8% vs last quarter",
|
|
311
|
+
"variant": "caption"
|
|
312
|
+
}
|
|
313
|
+
]
|
|
314
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
$schema: ../../../../../scripts/schemas/pattern.yaml.schema.json
|
|
2
|
+
name: chart-grid-with-kpis
|
|
3
|
+
domain: data
|
|
4
|
+
version: 1
|
|
5
|
+
description: >-
|
|
6
|
+
Dashboard with a 4-column KPI row (stat-with-sparkline each) on top and a
|
|
7
|
+
2-column grid of chart cards with trend footers below. Modernized version
|
|
8
|
+
of chart-dashboard that uses the Phase 1 (footer heading slot) and Phase 3
|
|
9
|
+
(stat chart slot) primitives.
|
|
10
|
+
tags:
|
|
11
|
+
purpose:
|
|
12
|
+
- visualization
|
|
13
|
+
- data-display
|
|
14
|
+
- dashboard
|
|
15
|
+
complexity: complex
|
|
16
|
+
layout: grid
|
|
17
|
+
interaction: []
|
|
18
|
+
keywords:
|
|
19
|
+
- dashboard
|
|
20
|
+
- chart
|
|
21
|
+
- kpi
|
|
22
|
+
- stats
|
|
23
|
+
- sparkline
|
|
24
|
+
- trend
|
|
25
|
+
- analytics
|
|
26
|
+
- reporting
|
|
27
|
+
related:
|
|
28
|
+
- chart-dashboard
|
|
29
|
+
- stat-with-sparkline
|
|
30
|
+
- chart-card-with-trend-footer
|
|
31
|
+
- chart-with-filter-pills
|
|
32
|
+
- metrics
|
|
33
|
+
use-cases:
|
|
34
|
+
- Admin/executive dashboards with KPIs + chart cards at a glance.
|
|
35
|
+
- SaaS analytics pages — revenue / users / bounce / session cards + trend charts.
|
|
36
|
+
- Marketing dashboards where each KPI card shows a sparkline and each chart card carries a trend caption.
|
|
37
|
+
variants:
|
|
38
|
+
- name: filter-pills
|
|
39
|
+
description: >-
|
|
40
|
+
Add `Segmented` pills to chart card headers (slot="action") per the
|
|
41
|
+
chart-with-filter-pills pattern for time-range selection.
|
|
42
|
+
- name: narrower-kpi-row
|
|
43
|
+
description: >-
|
|
44
|
+
Set `columns: "3"` or `"2"` on `kpi-grid` when only 2-3 KPIs matter.
|
|
45
|
+
wiring-intent:
|
|
46
|
+
summary: >-
|
|
47
|
+
Static pattern. Typical integration wires each Stat's value + its
|
|
48
|
+
sparkline's .data from the same controller; each chart card receives
|
|
49
|
+
its `.data` + trend narrative from the same source.
|
|
50
|
+
controllers: []
|
|
51
|
+
actions: []
|
|
52
|
+
components:
|
|
53
|
+
- Column
|
|
54
|
+
- Row
|
|
55
|
+
- Grid
|
|
56
|
+
- Card
|
|
57
|
+
- Header
|
|
58
|
+
- Section
|
|
59
|
+
- Footer
|
|
60
|
+
- Text
|
|
61
|
+
- Button
|
|
62
|
+
- Stat
|
|
63
|
+
- Chart
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../_schema.json",
|
|
3
|
+
"name": "chart-with-filter-pills",
|
|
4
|
+
"version": 1,
|
|
5
|
+
"domain": "data",
|
|
6
|
+
"description": "Chart in a card with a time-range pill selector in the header's action slot. The pills are a Segmented control (single-select) that drives the data window.",
|
|
7
|
+
"tags": {
|
|
8
|
+
"purpose": [
|
|
9
|
+
"visualization",
|
|
10
|
+
"data-display",
|
|
11
|
+
"filtering"
|
|
12
|
+
],
|
|
13
|
+
"complexity": "composed",
|
|
14
|
+
"layout": "single-column",
|
|
15
|
+
"interaction": [
|
|
16
|
+
"filter",
|
|
17
|
+
"time-range"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"chart",
|
|
22
|
+
"filter",
|
|
23
|
+
"pills",
|
|
24
|
+
"time-range",
|
|
25
|
+
"segmented",
|
|
26
|
+
"analytics",
|
|
27
|
+
"dashboard"
|
|
28
|
+
],
|
|
29
|
+
"related": [
|
|
30
|
+
"chart-card-with-trend-footer",
|
|
31
|
+
"chart-dashboard",
|
|
32
|
+
"metrics"
|
|
33
|
+
],
|
|
34
|
+
"template": [
|
|
35
|
+
{
|
|
36
|
+
"id": "root",
|
|
37
|
+
"component": "Card",
|
|
38
|
+
"children": [
|
|
39
|
+
"rc-header",
|
|
40
|
+
"rc-body"
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"id": "rc-header",
|
|
45
|
+
"component": "Header",
|
|
46
|
+
"children": [
|
|
47
|
+
"rc-title",
|
|
48
|
+
"rc-filter"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"id": "rc-title",
|
|
53
|
+
"component": "Text",
|
|
54
|
+
"slot": "heading",
|
|
55
|
+
"textContent": "Revenue",
|
|
56
|
+
"variant": "section"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"id": "rc-filter",
|
|
60
|
+
"component": "Segmented",
|
|
61
|
+
"slot": "action",
|
|
62
|
+
"value": "1m",
|
|
63
|
+
"children": [
|
|
64
|
+
"f-1w",
|
|
65
|
+
"f-2w",
|
|
66
|
+
"f-1m",
|
|
67
|
+
"f-3m"
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"id": "f-1w",
|
|
72
|
+
"component": "Segment",
|
|
73
|
+
"text": "1w",
|
|
74
|
+
"value": "1w"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"id": "f-2w",
|
|
78
|
+
"component": "Segment",
|
|
79
|
+
"text": "2w",
|
|
80
|
+
"value": "2w"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"id": "f-1m",
|
|
84
|
+
"component": "Segment",
|
|
85
|
+
"text": "1m",
|
|
86
|
+
"value": "1m"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"id": "f-3m",
|
|
90
|
+
"component": "Segment",
|
|
91
|
+
"text": "3m",
|
|
92
|
+
"value": "3m"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"id": "rc-body",
|
|
96
|
+
"component": "Section",
|
|
97
|
+
"children": [
|
|
98
|
+
"rc-chart"
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"id": "rc-chart",
|
|
103
|
+
"component": "Chart",
|
|
104
|
+
"type": "line",
|
|
105
|
+
"x": "date",
|
|
106
|
+
"y": "revenue"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"actions": [
|
|
110
|
+
{
|
|
111
|
+
"event": { "event": "change", "target": "rc-filter" },
|
|
112
|
+
"handler": "update-data-model",
|
|
113
|
+
"config": {
|
|
114
|
+
"path": "filters.range",
|
|
115
|
+
"value": "{{event.value}}"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"event": { "event": "change", "target": "rc-filter" },
|
|
120
|
+
"handler": "fetch-resource",
|
|
121
|
+
"config": {
|
|
122
|
+
"uri": "api://metrics/revenue?range={{event.value}}",
|
|
123
|
+
"target": "rc-chart.data"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
$schema: ../../../../../scripts/schemas/pattern.yaml.schema.json
|
|
2
|
+
name: chart-with-filter-pills
|
|
3
|
+
domain: data
|
|
4
|
+
version: 1
|
|
5
|
+
description: >-
|
|
6
|
+
Chart in a card with a time-range pill selector in the header's `action`
|
|
7
|
+
slot. The pills are a `Segmented` control (single-select of `Segment`
|
|
8
|
+
children) that drives the data window. Value changes are wired via A2UI
|
|
9
|
+
action binding to the chart's .data replacement.
|
|
10
|
+
tags:
|
|
11
|
+
purpose:
|
|
12
|
+
- visualization
|
|
13
|
+
- data-display
|
|
14
|
+
- filtering
|
|
15
|
+
complexity: composed
|
|
16
|
+
layout: single-column
|
|
17
|
+
interaction:
|
|
18
|
+
- filter
|
|
19
|
+
- time-range
|
|
20
|
+
keywords:
|
|
21
|
+
- chart
|
|
22
|
+
- filter
|
|
23
|
+
- pills
|
|
24
|
+
- time-range
|
|
25
|
+
- segmented
|
|
26
|
+
- analytics
|
|
27
|
+
- dashboard
|
|
28
|
+
related:
|
|
29
|
+
- chart-card-with-trend-footer
|
|
30
|
+
- chart-dashboard
|
|
31
|
+
- metrics
|
|
32
|
+
use-cases:
|
|
33
|
+
- Revenue / user / signup charts with 1w / 2w / 1m / 3m range pills.
|
|
34
|
+
- Analytics cards where the range toggle drives a server-side data refresh.
|
|
35
|
+
- Metric cards in a SaaS dashboard with standard Last 7d / 30d / 90d pills.
|
|
36
|
+
variants:
|
|
37
|
+
- name: toggle-group
|
|
38
|
+
description: >-
|
|
39
|
+
Swap `Segmented` for `ToggleGroup` when users need to multi-select
|
|
40
|
+
(e.g., comparing multiple ranges or series).
|
|
41
|
+
- name: dropdown
|
|
42
|
+
description: >-
|
|
43
|
+
Swap the pill row for a `Select` component when the range set grows
|
|
44
|
+
beyond ~5 options.
|
|
45
|
+
wiring-intent:
|
|
46
|
+
summary: >-
|
|
47
|
+
Segmented's change event drives two A2UI actions: (1) update the
|
|
48
|
+
data model's `filters.range` path so other surfaces can react to
|
|
49
|
+
the same selection, and (2) fetch the range-scoped metric series
|
|
50
|
+
and replace the chart's `.data`. Both actions target the same
|
|
51
|
+
event (`change` on `rc-filter`) so they fire in registration
|
|
52
|
+
order — model update first, then fetch. Canonical shapes are
|
|
53
|
+
carried in the JSON's top-level `actions` array (see the pattern
|
|
54
|
+
file) so the wiring is self-documenting for authors copying the
|
|
55
|
+
composition.
|
|
56
|
+
controllers:
|
|
57
|
+
- range-filter
|
|
58
|
+
actions:
|
|
59
|
+
- event: rc-filter.change
|
|
60
|
+
handler: update-data-model
|
|
61
|
+
config:
|
|
62
|
+
path: filters.range
|
|
63
|
+
value: event.value
|
|
64
|
+
- event: rc-filter.change
|
|
65
|
+
handler: fetch-resource
|
|
66
|
+
config:
|
|
67
|
+
uri: 'api://metrics/revenue?range={{event.value}}'
|
|
68
|
+
target: rc-chart.data
|
|
69
|
+
components:
|
|
70
|
+
- Card
|
|
71
|
+
- Header
|
|
72
|
+
- Section
|
|
73
|
+
- Chart
|
|
74
|
+
- Text
|
|
75
|
+
- Segmented
|
|
76
|
+
- Segment
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../_schema.json",
|
|
3
|
+
"name": "stat-with-sparkline",
|
|
4
|
+
"version": 1,
|
|
5
|
+
"domain": "data",
|
|
6
|
+
"description": "KPI stat card with an inline sparkline on the right side. Uses the Stat component's `chart` slot introduced in Phase 3.",
|
|
7
|
+
"tags": {
|
|
8
|
+
"purpose": [
|
|
9
|
+
"visualization",
|
|
10
|
+
"data-display",
|
|
11
|
+
"kpi"
|
|
12
|
+
],
|
|
13
|
+
"complexity": "simple",
|
|
14
|
+
"layout": "single-column",
|
|
15
|
+
"interaction": []
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"stat",
|
|
19
|
+
"kpi",
|
|
20
|
+
"sparkline",
|
|
21
|
+
"metric",
|
|
22
|
+
"chart",
|
|
23
|
+
"summary",
|
|
24
|
+
"overview"
|
|
25
|
+
],
|
|
26
|
+
"related": [
|
|
27
|
+
"chart-dashboard",
|
|
28
|
+
"chart-grid-with-kpis",
|
|
29
|
+
"chart-card-with-trend-footer",
|
|
30
|
+
"metrics"
|
|
31
|
+
],
|
|
32
|
+
"template": [
|
|
33
|
+
{
|
|
34
|
+
"id": "root",
|
|
35
|
+
"component": "Card",
|
|
36
|
+
"children": [
|
|
37
|
+
"sec"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": "sec",
|
|
42
|
+
"component": "Section",
|
|
43
|
+
"children": [
|
|
44
|
+
"kpi"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"id": "kpi",
|
|
49
|
+
"component": "Stat",
|
|
50
|
+
"label": "Revenue",
|
|
51
|
+
"value": "$48.2k",
|
|
52
|
+
"change": "+12.5%",
|
|
53
|
+
"trend": "up",
|
|
54
|
+
"children": [
|
|
55
|
+
"kpi-spark"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"id": "kpi-spark",
|
|
60
|
+
"component": "Chart",
|
|
61
|
+
"slot": "chart",
|
|
62
|
+
"type": "sparkline",
|
|
63
|
+
"x": "month",
|
|
64
|
+
"y": "revenue"
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
$schema: ../../../../../scripts/schemas/pattern.yaml.schema.json
|
|
2
|
+
name: stat-with-sparkline
|
|
3
|
+
domain: data
|
|
4
|
+
version: 1
|
|
5
|
+
description: >-
|
|
6
|
+
KPI stat card with an inline sparkline on the right side. The `Stat`
|
|
7
|
+
component's `chart` slot (Phase 3 addition) routes the sparkline into a
|
|
8
|
+
right-column region spanning rows 2-3 of the stat grid — hero number
|
|
9
|
+
and mini-chart read as a single visual unit.
|
|
10
|
+
tags:
|
|
11
|
+
purpose:
|
|
12
|
+
- visualization
|
|
13
|
+
- data-display
|
|
14
|
+
- kpi
|
|
15
|
+
complexity: simple
|
|
16
|
+
layout: single-column
|
|
17
|
+
interaction: []
|
|
18
|
+
keywords:
|
|
19
|
+
- stat
|
|
20
|
+
- kpi
|
|
21
|
+
- sparkline
|
|
22
|
+
- metric
|
|
23
|
+
- chart
|
|
24
|
+
- summary
|
|
25
|
+
- overview
|
|
26
|
+
related:
|
|
27
|
+
- chart-dashboard
|
|
28
|
+
- chart-grid-with-kpis
|
|
29
|
+
- chart-card-with-trend-footer
|
|
30
|
+
- metrics
|
|
31
|
+
use-cases:
|
|
32
|
+
- Dashboard KPI tiles with inline trend sparklines.
|
|
33
|
+
- Top-of-page metric cards that need a richer signal than a +/- badge.
|
|
34
|
+
- Executive summary views pairing a hero number with its 30-day trajectory.
|
|
35
|
+
variants:
|
|
36
|
+
- name: bar-sparkline
|
|
37
|
+
description: Swap `type: sparkline` for `type: bar` for a mini-bar version.
|
|
38
|
+
- name: no-trend-badge
|
|
39
|
+
description: Omit `change` + `trend` when only the number + sparkline are wanted.
|
|
40
|
+
wiring-intent:
|
|
41
|
+
summary: >-
|
|
42
|
+
Static pattern. Sparkline .data is typically wired alongside the stat
|
|
43
|
+
value from the same controller — a single data fetch populates both
|
|
44
|
+
the hero number and its trajectory.
|
|
45
|
+
controllers: []
|
|
46
|
+
actions: []
|
|
47
|
+
components:
|
|
48
|
+
- Card
|
|
49
|
+
- Section
|
|
50
|
+
- Stat
|
|
51
|
+
- Chart
|