@sybilion/uilib 1.3.105 → 1.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 (200) hide show
  1. package/dist/agent-glossary/content-prompt.generated.ts +323 -0
  2. package/dist/agent-glossary/content.generated.ts +136 -63
  3. package/dist/agent-glossary/content.index.md +14 -0
  4. package/dist/agent-glossary/content.md +135 -63
  5. package/dist/agent-glossary/content.prompt.md +322 -0
  6. package/dist/agent-glossary/workspace.generated.ts +100 -269
  7. package/dist/agent-glossary/workspace.index.md +100 -0
  8. package/dist/agent-glossary/workspace.md +100 -269
  9. package/dist/esm/components/ui/Chart/Chart.styl.js +2 -2
  10. package/dist/esm/components/ui/Chart/components/ChartTooltipContent.js +1 -1
  11. package/dist/esm/components/ui/Page/PageColumns/PageColumns.js +2 -2
  12. package/dist/esm/components/ui/Page/PageColumns/PageColumns.styl.js +2 -2
  13. package/dist/esm/components/widgets/DriverCard/DriverCard.js +1 -1
  14. package/dist/esm/types/src/components/ui/Chart/Chart.example.d.ts +1 -0
  15. package/dist/esm/types/src/components/ui/Page/PageColumns/PageColumns.d.ts +10 -3
  16. package/dist/esm/types/src/docs/agent-guidance/agent-md-utils.d.ts +10 -0
  17. package/dist/esm/types/src/docs/components/DocsGuidance/DocsGuidance.d.ts +3 -12
  18. package/package.json +2 -2
  19. package/src/components/ui/AnalysesSelector/AGENT.md +16 -0
  20. package/src/components/ui/AnalysisLineIcon/AGENT.md +11 -0
  21. package/src/components/ui/AppHeader/AGENT.md +16 -0
  22. package/src/components/ui/Avatar/AGENT.md +15 -0
  23. package/src/components/ui/Badge/AGENT.md +16 -0
  24. package/src/components/ui/BarChart/AGENT.md +16 -0
  25. package/src/components/ui/Breadcrumb/AGENT.md +15 -0
  26. package/src/components/ui/Button/AGENT.md +17 -0
  27. package/src/components/ui/Card/AGENT.md +16 -0
  28. package/src/components/ui/Chart/AGENT.md +18 -0
  29. package/src/components/ui/Chart/Chart.example.tsx +37 -0
  30. package/src/components/ui/Chart/Chart.styl +5 -0
  31. package/src/components/ui/Chart/Chart.styl.d.ts +1 -0
  32. package/src/components/ui/Chart/components/ChartTooltipContent.tsx +1 -1
  33. package/src/components/ui/ChartAreaInteractive/AGENT.md +24 -8
  34. package/src/components/ui/Chat/AGENT.md +15 -0
  35. package/src/components/ui/Checkbox/AGENT.md +16 -0
  36. package/src/components/ui/Chip/AGENT.md +18 -0
  37. package/src/components/ui/Confirm/AGENT.md +15 -0
  38. package/src/components/ui/Dialog/AGENT.md +15 -0
  39. package/src/components/ui/DonutChart/AGENT.md +15 -0
  40. package/src/components/ui/Drawer/AGENT.md +17 -0
  41. package/src/components/ui/DropZone/AGENT.md +16 -0
  42. package/src/components/ui/DropdownMenu/AGENT.md +16 -0
  43. package/src/components/ui/FileChip/AGENT.md +17 -0
  44. package/src/components/ui/FlickeringGrid/AGENT.md +15 -0
  45. package/src/components/ui/Foldable/AGENT.md +16 -0
  46. package/src/components/ui/GridLayout/AGENT.md +17 -0
  47. package/src/components/ui/Image/AGENT.md +16 -0
  48. package/src/components/ui/ImageWithFallback/AGENT.md +15 -0
  49. package/src/components/ui/Input/AGENT.md +16 -0
  50. package/src/components/ui/InteractiveContent/AGENT.md +21 -0
  51. package/src/components/ui/Kicker/AGENT.md +16 -0
  52. package/src/components/ui/Label/AGENT.md +15 -0
  53. package/src/components/ui/LabelWithId/AGENT.md +10 -0
  54. package/src/components/ui/LabeledInput/AGENT.md +11 -0
  55. package/src/components/ui/LegacyPlatformLink/AGENT.md +15 -0
  56. package/src/components/ui/Logo/AGENT.md +15 -0
  57. package/src/components/ui/MobileAdaptiveSelector/AGENT.md +15 -0
  58. package/src/components/ui/NavUserHeader/AGENT.md +15 -0
  59. package/src/components/ui/NumberControl/AGENT.md +15 -0
  60. package/src/components/ui/Page/AGENT.md +20 -7
  61. package/src/components/ui/Page/PageColumns/PageColumns.styl +5 -5
  62. package/src/components/ui/Page/PageColumns/PageColumns.styl.d.ts +3 -3
  63. package/src/components/ui/Page/PageColumns/PageColumns.tsx +11 -16
  64. package/src/components/ui/Sheet/AGENT.md +15 -0
  65. package/src/components/ui/SignalCard/AGENT.md +16 -0
  66. package/src/components/ui/Switch/AGENT.md +15 -0
  67. package/src/components/ui/Tooltip/AGENT.md +17 -0
  68. package/src/components/widgets/DriverCard/DriverCard.tsx +1 -1
  69. package/src/components/widgets/DriverMap/AGENT.md +27 -8
  70. package/src/components/widgets/DriversComparisonChart/AGENT.md +27 -13
  71. package/src/components/widgets/PerformanceChart/AGENT.md +23 -8
  72. package/src/declarations.d.ts +5 -0
  73. package/src/docs/agent-guidance/agent-md-utils.ts +48 -0
  74. package/src/docs/agent-guidance/chat-attachments-dropzone.md +15 -0
  75. package/src/docs/agent-guidance/chat-composer-prefill.md +15 -0
  76. package/src/docs/agent-guidance/chat-sheet.md +14 -0
  77. package/src/docs/agent-guidance/chat-slash-commands.md +15 -0
  78. package/src/docs/agent-guidance/chat-user-csv-attachment.md +14 -0
  79. package/src/docs/agent-guidance/colors.md +10 -0
  80. package/src/docs/agent-guidance/icons.md +11 -0
  81. package/src/docs/agent-guidance/lightweight-forecast-chart.md +17 -0
  82. package/src/docs/agent-guidance/motion.md +10 -0
  83. package/src/docs/agent-guidance/page-columns.md +19 -0
  84. package/src/docs/agent-guidance/page-footer.md +15 -0
  85. package/src/docs/agent-guidance/page-tabs.md +19 -0
  86. package/src/docs/agent-guidance/page.md +15 -0
  87. package/src/docs/agent-guidance/progress.md +11 -0
  88. package/src/docs/agent-guidance/pull-quote.md +15 -0
  89. package/src/docs/agent-guidance/radii-shadows.md +10 -0
  90. package/src/docs/agent-guidance/region-coords.md +11 -0
  91. package/src/docs/agent-guidance/renamer.md +15 -0
  92. package/src/docs/agent-guidance/select.md +15 -0
  93. package/src/docs/agent-guidance/separator.md +11 -0
  94. package/src/docs/agent-guidance/sidebar-datasets-items-grouped.md +11 -0
  95. package/src/docs/agent-guidance/sidebar.md +15 -0
  96. package/src/docs/agent-guidance/skeleton.md +16 -0
  97. package/src/docs/agent-guidance/slider.md +16 -0
  98. package/src/docs/agent-guidance/smart-text-truncate.md +11 -0
  99. package/src/docs/agent-guidance/spacing.md +10 -0
  100. package/src/docs/agent-guidance/sparkline.md +15 -0
  101. package/src/docs/agent-guidance/standalone-app-layout.md +16 -0
  102. package/src/docs/agent-guidance/sybilion-auth-layout.md +15 -0
  103. package/src/docs/agent-guidance/table.md +17 -0
  104. package/src/docs/agent-guidance/tabs.md +21 -0
  105. package/src/docs/agent-guidance/text-shimmer.md +11 -0
  106. package/src/docs/agent-guidance/text-with-defer-tooltip.md +15 -0
  107. package/src/docs/agent-guidance/time-range-controls.md +15 -0
  108. package/src/docs/agent-guidance/toggle-group.md +15 -0
  109. package/src/docs/agent-guidance/toggle.md +15 -0
  110. package/src/docs/agent-guidance/typography.md +10 -0
  111. package/src/docs/agent-guidance/vimeo-embed.md +11 -0
  112. package/src/docs/agent-guidance/world-map.md +11 -0
  113. package/src/docs/components/DocsGuidance/DocsGuidance.styl +26 -25
  114. package/src/docs/components/DocsGuidance/DocsGuidance.styl.d.ts +1 -4
  115. package/src/docs/components/DocsGuidance/DocsGuidance.tsx +9 -44
  116. package/src/docs/config/webpack.config.js +6 -1
  117. package/src/docs/pages/AnalysesSelectorPage.tsx +6 -17
  118. package/src/docs/pages/AnalysisLineIconPage.tsx +2 -11
  119. package/src/docs/pages/AvatarPage.tsx +2 -14
  120. package/src/docs/pages/BadgePage.tsx +2 -15
  121. package/src/docs/pages/BarChartPage.tsx +2 -15
  122. package/src/docs/pages/BreadcrumbPage.tsx +2 -14
  123. package/src/docs/pages/ButtonPage.tsx +2 -16
  124. package/src/docs/pages/CardPage.tsx +5 -18
  125. package/src/docs/pages/ChartAreaInteractivePage.tsx +2 -15
  126. package/src/docs/pages/ChartPage.tsx +4 -47
  127. package/src/docs/pages/ChatAttachmentsDropzonePage.tsx +2 -14
  128. package/src/docs/pages/ChatComposerPrefillPage.tsx +2 -14
  129. package/src/docs/pages/ChatPage.tsx +2 -14
  130. package/src/docs/pages/ChatSheetPage.tsx +2 -13
  131. package/src/docs/pages/ChatSlashCommandsPage.tsx +2 -14
  132. package/src/docs/pages/ChatUserCsvAttachmentPage.tsx +2 -13
  133. package/src/docs/pages/CheckboxPage.tsx +2 -15
  134. package/src/docs/pages/ChipPage.tsx +2 -17
  135. package/src/docs/pages/ColorsPage.tsx +2 -10
  136. package/src/docs/pages/ConfirmPage.tsx +2 -14
  137. package/src/docs/pages/DialogPage.tsx +2 -14
  138. package/src/docs/pages/DonutChartPage.tsx +2 -14
  139. package/src/docs/pages/DrawerPage.tsx +2 -16
  140. package/src/docs/pages/DriverMapPage.tsx +2 -16
  141. package/src/docs/pages/DriversComparisonChartPage.tsx +2 -16
  142. package/src/docs/pages/DropZonePage.tsx +2 -15
  143. package/src/docs/pages/DropdownMenuPage.tsx +2 -15
  144. package/src/docs/pages/FileChipPage.tsx +2 -16
  145. package/src/docs/pages/FlickeringGridPage.tsx +2 -14
  146. package/src/docs/pages/FoldablePage.tsx +2 -15
  147. package/src/docs/pages/GridLayoutPage.tsx +2 -15
  148. package/src/docs/pages/IconsPage.tsx +2 -11
  149. package/src/docs/pages/ImagePage.tsx +2 -15
  150. package/src/docs/pages/ImageWithFallbackPage.tsx +2 -14
  151. package/src/docs/pages/IncludeHiddenInYScalePage.tsx +2 -13
  152. package/src/docs/pages/InputPage.tsx +2 -15
  153. package/src/docs/pages/InteractiveContentPage.tsx +2 -17
  154. package/src/docs/pages/KickerPage.tsx +2 -15
  155. package/src/docs/pages/LabelPage.tsx +2 -14
  156. package/src/docs/pages/LabelWithIdPage.tsx +2 -10
  157. package/src/docs/pages/LabeledInputPage.tsx +2 -11
  158. package/src/docs/pages/LegacyPlatformLinkPage.tsx +2 -14
  159. package/src/docs/pages/LightweightChartPage.tsx +2 -16
  160. package/src/docs/pages/LogoPage.tsx +2 -14
  161. package/src/docs/pages/MobileAdaptiveSelectorPage.tsx +2 -14
  162. package/src/docs/pages/MotionPage.tsx +2 -10
  163. package/src/docs/pages/NavUserHeaderPage.tsx +2 -14
  164. package/src/docs/pages/NumberControlPage.tsx +2 -14
  165. package/src/docs/pages/PageColumnsPage.tsx +40 -17
  166. package/src/docs/pages/PageFooterPage.tsx +2 -14
  167. package/src/docs/pages/PagePage.tsx +2 -14
  168. package/src/docs/pages/PageTabsPage.tsx +2 -17
  169. package/src/docs/pages/PerformanceChartPage.tsx +2 -14
  170. package/src/docs/pages/ProgressPage.tsx +2 -11
  171. package/src/docs/pages/PullQuotePage.tsx +2 -14
  172. package/src/docs/pages/RadiiShadowsPage.tsx +2 -10
  173. package/src/docs/pages/RegionCoordsPage.tsx +2 -11
  174. package/src/docs/pages/RenamerPage.tsx +2 -14
  175. package/src/docs/pages/SelectPage.tsx +2 -14
  176. package/src/docs/pages/SeparatorPage.tsx +2 -11
  177. package/src/docs/pages/SheetPage.tsx +2 -14
  178. package/src/docs/pages/SidebarDatasetsItemsGroupedPage.tsx +2 -11
  179. package/src/docs/pages/SidebarPage.tsx +2 -14
  180. package/src/docs/pages/SignalCardPage.tsx +2 -15
  181. package/src/docs/pages/SkeletonPage.tsx +2 -15
  182. package/src/docs/pages/SliderPage.tsx +2 -15
  183. package/src/docs/pages/SmartTextTruncatePage.tsx +2 -11
  184. package/src/docs/pages/SpacingPage.tsx +2 -10
  185. package/src/docs/pages/SparklinePage.tsx +2 -14
  186. package/src/docs/pages/StandaloneAppLayoutPage/StandaloneAppLayoutPage.tsx +2 -15
  187. package/src/docs/pages/SwitchPage.tsx +2 -14
  188. package/src/docs/pages/SybilionAuthLayoutPage.tsx +2 -14
  189. package/src/docs/pages/TablePage.tsx +2 -15
  190. package/src/docs/pages/TabsPage.tsx +2 -19
  191. package/src/docs/pages/TextShimmerPage.tsx +2 -11
  192. package/src/docs/pages/TextWithDeferTooltipPage.tsx +2 -14
  193. package/src/docs/pages/TimeRangeControlsPage.tsx +2 -14
  194. package/src/docs/pages/ToggleGroupPage.tsx +2 -14
  195. package/src/docs/pages/TogglePage.tsx +2 -12
  196. package/src/docs/pages/TooltipPage.tsx +2 -16
  197. package/src/docs/pages/TypographyPage.tsx +2 -10
  198. package/src/docs/pages/VimeoEmbedPage.tsx +2 -11
  199. package/src/docs/pages/WorldMapPage.tsx +2 -11
  200. package/src/components/widgets/AGENT.md +0 -21
@@ -1,5 +1,90 @@
1
- Sybilion page content glossary (content profile)
1
+ # Sybilion page content glossary (embedded)
2
2
 
3
+ Component usage for report/dashboard LLM prompts. Paths are relative to `@sybilion/uilib` package root.
4
+
5
+ ## DriverMap
6
+
7
+ DriverMap renders a world map with regional driver badges, a bottom strip for world-level drivers, and selection highlight. DriverCard shows the detail of the selected driver; both share selection state via controlled selectedDriver.
8
+
9
+ ## When to use
10
+
11
+ - To give a geographic overview of where drivers originate and let users explore them by region.
12
+ - Alongside DriverCard, so selecting a driver on the map reveals its importance, lag, and summary.
13
+ - When drivers carry coordinates or region metadata that benefits from a spatial presentation.
14
+ - Geographic driver exploration for one analysis.
15
+
16
+ ## When not to use
17
+
18
+ - When drivers have no meaningful geography; a table or list ranks them more clearly.
19
+ - For comparing driver series over time; use DriversComparisonChart instead.
20
+ - Driver detail metrics card alone (pair with DriverCard) or normalized series chart (use DriversComparisonChart).
21
+
22
+ ## Do
23
+
24
+ - Pass isLoading to both the map and the card so their loading states stay in sync.
25
+ - Provide a driverSelector in DriverCard so users can page through drivers without using the map.
26
+
27
+ ## Report tile
28
+
29
+ - `drivers_map` — tile resolves analysis id, fetches drivers, passes list + selection.
30
+
31
+ ## Host provides
32
+
33
+ - `drivers` as `DriverData[]` from analysis API
34
+ - Controlled `selectedDriver` + `setSelectedDriver`
35
+ - `isLoading` while fetching drivers
36
+
37
+ ## Requires
38
+
39
+ - `drivers`; `isLoading`; `selectedDriver`; `setSelectedDriver`.
40
+
41
+ ## Empty/loading
42
+
43
+ - `isLoading` shows overlay; empty `drivers` leaves map without badges.
44
+
45
+ ## DriversComparisonChart
46
+
47
+ DriversComparisonChart plots a normalized target line against the normalized series of its drivers, with a table of drivers underneath. The Lagged and Overlapped view tabs control whether driver series are shifted by their reported lag or aligned in time, and table rows toggle each series on the chart.
48
+
49
+ ## When to use
50
+
51
+ - To show how individual drivers move relative to a backtested target over time.
52
+ - When users need to compare lagged and contemporaneous alignment of driver series.
53
+ - When the driver table and the chart should stay linked, so hiding a row hides its line.
54
+
55
+ ## When not to use
56
+
57
+ - For a single series with no target to compare against; use ChartAreaInteractive directly.
58
+ - When drivers lack normalized series data; the chart needs a populated payload to be useful.
59
+
60
+ ## Do
61
+
62
+ - Provide a statusHint when the payload is empty so users understand why the chart is blank.
63
+ - Control viewTab from the page when an external Lagged/Overlapped switcher should stay in sync.
64
+
65
+ ## Report tile
66
+
67
+ - `drivers_comparison_chart` — host loads normalized backtests payload + dataset historical.
68
+
69
+ ## Host provides
70
+
71
+ - `payload`: BacktestsComponentPayload from platform SDK (host fetch per analysis)
72
+ - Optional `datasetHistorical` overlay
73
+ - `seriesInitKey` when selected analysis changes
74
+ - `viewTab` / `onViewTabChange`: `lagged` (calendar-aligned, raw dates) or `overlapped` (driver series shifted backward by parsed lag months)
75
+ - View tabs: host should render uilib `Tabs variant="button"` with **Lagged** / **Overlapped** in the toolbar. Chart applies `applyDriversComparisonViewToPayload` internally.
76
+
77
+ ## Requires
78
+
79
+ - `payload` — target + driver normalized_series; `loading` / `chartLoading` — spinners; `seriesInitKey` — reset visible series on analysis or view tab change; `runAnalysisHint` / `statusHint` — empty/error text.
80
+ - Lag column: **Lagged** shows API `lag` string (may be a range). **Overlapped** shows single `N month(s)` from `parseLagMonthsFromLabel` (range uses max month).
81
+ - Historical window: lead-in is anchored to the **lagged** (unshifted) view (`computeDriversComparisonHistoricalWindowFloor`); overlapped tab shifts driver lines backward only — switching tabs does not change historical extent when floor is pinned.
82
+
83
+ ## Empty/loading
84
+
85
+ - loading props shimmer chart; null `payload` with `runAnalysisHint` prompts to run analysis.
86
+
87
+ ## Page
3
88
 
4
89
  # Page layout system
5
90
 
@@ -96,17 +181,29 @@ Sticky-style page title row: breadcrumbs (optional sidebar trigger in full app),
96
181
  `PageContent`: column flex child, `max-width: var(--page-width)`.
97
182
  `PageContentSection`: `grow` (default `true`) lets the section absorb remaining height in flex layouts.
98
183
 
184
+ ## Column layout recipes
185
+
186
+ | Columns | When | Recipe |
187
+ | -------------- | ----------------------------- | ---------------------------------------------------------------------------------- |
188
+ | 1 | Single full-width body | `PageHeader` → `PageContent` → `PageContentSection` — **do not** use `PageColumns` |
189
+ | 2 equal | Two peers | `PageColumns columns={[a, b]}` inside one `PageContentSection` |
190
+ | 2 main + aside | Content + fixed sidebar | `PageColumns fill="left"` or `fill="right"` — **2 columns only** |
191
+ | 3 equal | Three peers (metrics, panels) | `PageColumns columns={[a, b, c]}` |
192
+ | 4 equal | Four peers | `PageColumns columns={[a, b, c, d]}` |
193
+
194
+ Use **PageColumns** for a fixed column count content row. Use **GridLayout** for auto-wrapping card/tile grids (variable tile count, `minmax` columns).
195
+
99
196
  ### PageColumns
100
197
 
101
- Side-by-side columns with gap. **`fill`** controls which column(s) grow:
198
+ Side-by-side columns with gap inside one `PageContentSection`. **`fill`** controls which column(s) grow:
102
199
 
103
- | `fill` | Behavior |
104
- | --------------- | ----------------------------------------------------------------------------------------------- |
105
- | `all` (default) | Every column `flex-grow: 1`, `max-width` unset — use for equal split or fluid grids of columns. |
106
- | `left` | First column grows; others stay at fixed min/max column width. |
107
- | `right` | Last column grows. |
200
+ | `fill` | Behavior |
201
+ | -------- | ---------------------------------------------------------------------------- |
202
+ | _(omit)_ | Equal flex columns (`flex: 1 1 0`) — default for **2, 3, or 4** equal peers. |
203
+ | `left` | **2-column only:** first column grows; second stays at fixed 360px width. |
204
+ | `right` | **2-column only:** last column grows; first stays at fixed 360px width. |
108
205
 
109
- Pass `columns={[node1, node2, …]}`. On mobile, stacks vertically. Typical pattern: main + aside inside one `PageContentSection`.
206
+ Pass `columns={[node1, node2, …]}`. For 3–4 equal columns, omit `fill`; do not use `left`/`right`. On mobile, stacks vertically.
110
207
 
111
208
  ### PageXScroll
112
209
 
@@ -138,6 +235,7 @@ When generating **report** / dashboard specs (not workspace routes), map UI bloc
138
235
  | `SectionHeader` `title` | `markdown` with `## …` |
139
236
  | `SectionHeader` `description` | markdown paragraph under that heading |
140
237
  | `PageContentSection` block | group of tiles or one markdown section |
238
+ | `PageColumns` (N equal columns) | group of N sibling tiles in one dashboard row |
141
239
  | `GridLayout` children | grid row of widget tiles |
142
240
  | `ChartAreaInteractive` / charts | `dataset_card`, `performance_chart`, etc. (see widget `AGENT.md`) |
143
241
  | `PageEmptyCanvas` copy | `markdown` explanatory tile |
@@ -167,84 +265,58 @@ Not part of the per-route skeleton but part of **workspace-page** host wiring:
167
265
 
168
266
  Do not add these locally; extend uilib when product needs them.
169
267
 
170
- # ChartAreaInteractive
171
-
172
- Renders: time-series chart with historical line, forecast lines, optional pin / quantile-band / threshold overlays.
173
-
174
- Use when: custom forecast UI with overlays or full chart control.
175
- Not when: packaged performance or drivers-comparison views (use PerformanceChart or DriversComparisonChart).
176
-
177
- Host provides:
178
-
179
- - `chartData`, `forecastData` built from API
180
- - `timeRange` / `onTimeRangeChange` or brush-only range
181
- - Optional `mode`: pin | intervals | thresholds + overlay state
182
-
183
- Report tile: `dataset_card` — host loads dataset + analysis; chart inside dashboard card.
268
+ ## PerformanceChart
184
269
 
185
- Requires: `chartData`; `forecastData`; `loading`; `toggleLegendSeries` / `ensureAnalysisSeriesVisible` when legend is external.
270
+ PerformanceChart is a widget for evaluating forecast accuracy. It plots per-horizon and spaghetti views of model and drift forecasts against historical data, linked to a metrics table with MAE and MAPE, and handles loading, empty, and run-analysis-hint states.
186
271
 
187
- Empty/loading: `loading`, `error`; empty data shows chart empty state via host message props.
272
+ ## When to use
188
273
 
189
- # DriverMap
274
+ - To present backtest or performance-analysis results for a dataset’s forecasting models.
275
+ - To compare forecast horizons against actuals, including optional custom series matrices.
190
276
 
191
- Renders: world map with regional driver badges, bottom strip for world-level drivers, selection highlight.
277
+ ## When not to use
192
278
 
193
- Use when: geographic driver exploration for one analysis.
194
- Not when: driver detail metrics card alone (pair with DriverCard) or normalized series chart (use DriversComparisonChart).
279
+ - For plain historical or forecast charts without performance metrics; use ChartAreaInteractive or LightweightForecastChart.
280
+ - When no performance analysis exists yet; show a call to action to run one instead.
195
281
 
196
- Host provides:
197
-
198
- - `drivers` as `DriverData[]` from analysis API
199
- - Controlled `selectedDriver` + `setSelectedDriver`
200
- - `isLoading` while fetching drivers
201
-
202
- Report tile: `drivers_map` — tile resolves analysis id, fetches drivers, passes list + selection.
203
-
204
- Requires: `drivers`; `isLoading`; `selectedDriver`; `setSelectedDriver`.
205
-
206
- Empty/loading: `isLoading` shows overlay; empty `drivers` leaves map without badges.
282
+ ## Do
207
283
 
208
- # PerformanceChart
284
+ - Wire the loading, empty, and hint props to your data-fetch state so the widget shows the right placeholder.
209
285
 
210
- Renders: forecast performance on ChartAreaInteractive — per-horizon tab (24m window, MAE/MAPE table) and spaghetti tab (all horizons overlaid).
286
+ ## Report tile
211
287
 
212
- Use when: dataset performance tab with horizon selector and error metrics.
213
- Not when: simple forecast card or driver backtests — use ChartAreaInteractive or DriversComparisonChart.
288
+ - `performance_chart` — host loads performance payload + dataset series.
214
289
 
215
- Host provides:
290
+ ## Host provides
216
291
 
217
292
  - `performanceData` (PerformanceChartPayload) and `historicalData` from performance API
218
293
  - Optional `forecastData`, `customPerformanceMatrix`, `userSeries` for spaghetti
219
294
 
220
- Report tile: `performance_chart` — host loads performance payload + dataset series.
221
-
222
- Requires: `performanceData` — model/drift forecasts and metrics; `historicalData` — baseline series; `loading` / `chartLoading` / `performanceDataLoading` — spinners; `runAnalysisHint` / `statusHint` — empty states.
295
+ ## Requires
223
296
 
224
- Empty/loading: loading props show shimmer/spinner; null `performanceData` with `runAnalysisHint` prompts to run analysis.
297
+ - `performanceData` — model/drift forecasts and metrics; `historicalData` — baseline series; `loading` / `chartLoading` / `performanceDataLoading` — spinners; `runAnalysisHint` / `statusHint` — empty states.
225
298
 
226
- # DriversComparisonChart
299
+ ## Empty/loading
227
300
 
228
- Renders: target vs drivers backtests chart with ChartAreaInteractive plus table; row click toggles series visibility.
301
+ - loading props show shimmer/spinner; null `performanceData` with `runAnalysisHint` prompts to run analysis.
229
302
 
230
- Use when: drivers comparison tab with normalized target and driver series from backtests payload.
231
- Not when: geographic map or performance horizons — use DriverMap or PerformanceChart.
303
+ ## SidebarDatasetsItemsGrouped
232
304
 
233
- Host provides:
305
+ # SidebarDatasetsItemsGrouped
234
306
 
235
- - `payload`: BacktestsComponentPayload from platform SDK (host fetch per analysis)
236
- - Optional `datasetHistorical` overlay
237
- - `seriesInitKey` when selected analysis changes
238
- - `viewTab` / `onViewTabChange`: `lagged` (calendar-aligned, raw dates) or `overlapped` (driver series shifted backward by parsed lag months)
307
+ Renders: expandable sidebar groups of datasets (by target type, regions, or categories).
239
308
 
240
- View tabs: host should render uilib `Tabs variant="button"` with **Lagged** / **Overlapped** in the toolbar. Chart applies `applyDriversComparisonViewToPayload` internally.
309
+ Use when: app shell needs grouped dataset navigation.
310
+ Not when: in-page or report content (no sidebar slot).
241
311
 
242
- Report tile: `drivers_comparison_chart` — host loads normalized backtests payload + dataset historical.
312
+ Host provides:
243
313
 
244
- Requires: `payload` — target + driver normalized_series; `loading` / `chartLoading` — spinners; `seriesInitKey` — reset visible series on analysis or view tab change; `runAnalysisHint` / `statusHint` — empty/error text.
314
+ - `datasets` list (`SidebarDatasetsItemsGroupedDataset`)
315
+ - `groupBy`, `selectedDatasetId`, `onDatasetClick`
316
+ - Optional `preItems` / `postItems`, `defaultExpandedGroupNames`
245
317
 
246
- Lag column: **Lagged** shows API `lag` string (may be a range). **Overlapped** shows single `N month(s)` from `parseLagMonthsFromLabel` (range uses max month).
318
+ Report tile: Not used in report tiles.
247
319
 
248
- Historical window: lead-in is anchored to the **lagged** (unshifted) view (`computeDriversComparisonHistoricalWindowFloor`); overlapped tab shifts driver lines backward only — switching tabs does not change historical extent when floor is pinned.
320
+ Requires: `datasets`; `groupBy`; `onDatasetClick` for navigation.
249
321
 
250
- Empty/loading: loading props shimmer chart; null `payload` with `runAnalysisHint` prompts to run analysis.
322
+ Empty/loading: empty `datasets` renders no groups; loading handled by host before pass-in.
@@ -0,0 +1,322 @@
1
+ # Sybilion page content glossary (embedded)
2
+
3
+ Component usage for report/dashboard LLM prompts. Paths are relative to `@sybilion/uilib` package root.
4
+
5
+ ## DriverMap
6
+
7
+ DriverMap renders a world map with regional driver badges, a bottom strip for world-level drivers, and selection highlight. DriverCard shows the detail of the selected driver; both share selection state via controlled selectedDriver.
8
+
9
+ ## When to use
10
+
11
+ - To give a geographic overview of where drivers originate and let users explore them by region.
12
+ - Alongside DriverCard, so selecting a driver on the map reveals its importance, lag, and summary.
13
+ - When drivers carry coordinates or region metadata that benefits from a spatial presentation.
14
+ - Geographic driver exploration for one analysis.
15
+
16
+ ## When not to use
17
+
18
+ - When drivers have no meaningful geography; a table or list ranks them more clearly.
19
+ - For comparing driver series over time; use DriversComparisonChart instead.
20
+ - Driver detail metrics card alone (pair with DriverCard) or normalized series chart (use DriversComparisonChart).
21
+
22
+ ## Do
23
+
24
+ - Pass isLoading to both the map and the card so their loading states stay in sync.
25
+ - Provide a driverSelector in DriverCard so users can page through drivers without using the map.
26
+
27
+ ## Report tile
28
+
29
+ - `drivers_map` — tile resolves analysis id, fetches drivers, passes list + selection.
30
+
31
+ ## Host provides
32
+
33
+ - `drivers` as `DriverData[]` from analysis API
34
+ - Controlled `selectedDriver` + `setSelectedDriver`
35
+ - `isLoading` while fetching drivers
36
+
37
+ ## Requires
38
+
39
+ - `drivers`; `isLoading`; `selectedDriver`; `setSelectedDriver`.
40
+
41
+ ## Empty/loading
42
+
43
+ - `isLoading` shows overlay; empty `drivers` leaves map without badges.
44
+
45
+ ## DriversComparisonChart
46
+
47
+ DriversComparisonChart plots a normalized target line against the normalized series of its drivers, with a table of drivers underneath. The Lagged and Overlapped view tabs control whether driver series are shifted by their reported lag or aligned in time, and table rows toggle each series on the chart.
48
+
49
+ ## When to use
50
+
51
+ - To show how individual drivers move relative to a backtested target over time.
52
+ - When users need to compare lagged and contemporaneous alignment of driver series.
53
+ - When the driver table and the chart should stay linked, so hiding a row hides its line.
54
+
55
+ ## When not to use
56
+
57
+ - For a single series with no target to compare against; use ChartAreaInteractive directly.
58
+ - When drivers lack normalized series data; the chart needs a populated payload to be useful.
59
+
60
+ ## Do
61
+
62
+ - Provide a statusHint when the payload is empty so users understand why the chart is blank.
63
+ - Control viewTab from the page when an external Lagged/Overlapped switcher should stay in sync.
64
+
65
+ ## Report tile
66
+
67
+ - `drivers_comparison_chart` — host loads normalized backtests payload + dataset historical.
68
+
69
+ ## Host provides
70
+
71
+ - `payload`: BacktestsComponentPayload from platform SDK (host fetch per analysis)
72
+ - Optional `datasetHistorical` overlay
73
+ - `seriesInitKey` when selected analysis changes
74
+ - `viewTab` / `onViewTabChange`: `lagged` (calendar-aligned, raw dates) or `overlapped` (driver series shifted backward by parsed lag months)
75
+ - View tabs: host should render uilib `Tabs variant="button"` with **Lagged** / **Overlapped** in the toolbar. Chart applies `applyDriversComparisonViewToPayload` internally.
76
+
77
+ ## Requires
78
+
79
+ - `payload` — target + driver normalized_series; `loading` / `chartLoading` — spinners; `seriesInitKey` — reset visible series on analysis or view tab change; `runAnalysisHint` / `statusHint` — empty/error text.
80
+ - Lag column: **Lagged** shows API `lag` string (may be a range). **Overlapped** shows single `N month(s)` from `parseLagMonthsFromLabel` (range uses max month).
81
+ - Historical window: lead-in is anchored to the **lagged** (unshifted) view (`computeDriversComparisonHistoricalWindowFloor`); overlapped tab shifts driver lines backward only — switching tabs does not change historical extent when floor is pinned.
82
+
83
+ ## Empty/loading
84
+
85
+ - loading props shimmer chart; null `payload` with `runAnalysisHint` prompts to run analysis.
86
+
87
+ ## Page
88
+
89
+ # Page layout system
90
+
91
+ Sybilion workspace and report surfaces use a small set of **Page** primitives from `@sybilion/uilib`. Agents must compose these instead of inventing layout with inline styles, Tailwind structure classes, or ad-hoc wrappers.
92
+
93
+ ## Two modes
94
+
95
+ | Mode | When | Shell |
96
+ | ------------------ | ------------------------------------------------ | ------------------------------------------------------------------------------------- |
97
+ | **workspace-page** | Route inside `AppShell` / scrolled main column | `PageHeader` → `PageContent` → `PageContentSection`(s). Optional `PageTabs`. |
98
+ | **content** | Report tiles, json-dashboard, embedded body only | No `PageHeader` / `AppShell` chrome. Map React blocks to dashboard tiles (see below). |
99
+
100
+ Do not nest workspace shell components inside **content** mode output.
101
+
102
+ ## Mandatory workspace-page skeleton
103
+
104
+ ```tsx
105
+ <PageHeader title="…" subheader="…" breadcrumbs={[…]} actions={…} />
106
+ <PageContent>
107
+ <PageContentSection>{/* section A */}</PageContentSection>
108
+ <PageContentSection grow={false}>{/* section B */}</PageContentSection>
109
+ </PageContent>
110
+ ```
111
+
112
+ - **PageHeader**: one per route view in the main column; title, optional subheader, breadcrumbs, actions.
113
+ - **PageContent**: vertical stack for the body below the header; `variant="clean"` when you need a flatter body (no extra chrome).
114
+ - **PageContentSection**: primary vertical band; applies horizontal **page-x-padding** via Stylus (`pageXPadding()`). Use multiple sections to separate logical blocks.
115
+
116
+ Global tokens (host app `:root`, e.g. `standalone-global.css`): `--page-width`, `--page-x-padding`, `--page-y-padding`. `PageContent` caps width at `--page-width`.
117
+
118
+ ## PageTabs — rules and patterns
119
+
120
+ **NEVER** place `PageTabs` inside `PageContentSection`. Tabs manage their own horizontal inset via `PageXScroll` / `tabsListProps.withPaddings`.
121
+
122
+ ### Unified (tabs + panels inside PageContent)
123
+
124
+ ```tsx
125
+ <PageHeader … />
126
+ <PageContent>
127
+ <PageTabs
128
+ items={[
129
+ { value: 'a', label: 'Tab A', content: <PageContentSection>…</PageContentSection> },
130
+ { value: 'b', label: 'Tab B', content: <PageContentSection>…</PageContentSection> },
131
+ ]}
132
+ />
133
+ </PageContent>
134
+ ```
135
+
136
+ Tab **panels** use `PageContentSection` so section padding stays correct.
137
+
138
+ ### Split (bar-only sibling)
139
+
140
+ Use when the tab bar must sit between header and a custom scroll region:
141
+
142
+ ```tsx
143
+ <PageHeader … />
144
+ <PageTabs
145
+ items={[
146
+ { value: 'a', label: 'Tab A', content: null },
147
+ { value: 'b', label: 'Tab B', content: null },
148
+ ]}
149
+ />
150
+ <PageContent>…</PageContent>
151
+ ```
152
+
153
+ Set `content: null` (or omit) for bar-only items; render panel bodies in `PageContent` yourself.
154
+
155
+ ## Spacing ownership
156
+
157
+ | Component | Owns horizontal page padding? |
158
+ | ---------------------- | --------------------------------------------------------- |
159
+ | **PageContentSection** | Yes (`pageXPadding`) |
160
+ | **PageTabs** | Via `tabsListProps.withPaddings` + internal `PageXScroll` |
161
+ | **PageXScroll** | Reads `--page-x-padding` for inset when used standalone |
162
+ | **PageHeader** | Own header inner layout (not `PageContentSection`) |
163
+
164
+ Do not duplicate `padding-left/right` on children that already sit in `PageContentSection`.
165
+
166
+ ## Styling rules
167
+
168
+ - **No** `style={{…}}` for layout or spacing (margins, padding, flex, width, gap).
169
+ - **No** Tailwind (or other) utility classes for **structural** layout on page primitives.
170
+ - Custom layout CSS only in co-located `ComponentName.styl`, using design tokens (`var(--p-*)`, `var(--page-x-padding)`, `pageXPadding()`, etc.).
171
+ - `className` on Page components is for Stylus module classes or state hooks, not one-off pixel tweaks.
172
+
173
+ ## Component reference
174
+
175
+ ### PageHeader
176
+
177
+ Sticky-style page title row: breadcrumbs (optional sidebar trigger in full app), `title`, `subheader`, `actions`. Lives **above** `PageContent`, never inside a section.
178
+
179
+ ### PageContent / PageContentSection
180
+
181
+ `PageContent`: column flex child, `max-width: var(--page-width)`.
182
+ `PageContentSection`: `grow` (default `true`) lets the section absorb remaining height in flex layouts.
183
+
184
+ ## Column layout recipes
185
+
186
+ | Columns | When | Recipe |
187
+ | -------------- | ----------------------------- | ---------------------------------------------------------------------------------- |
188
+ | 1 | Single full-width body | `PageHeader` → `PageContent` → `PageContentSection` — **do not** use `PageColumns` |
189
+ | 2 equal | Two peers | `PageColumns columns={[a, b]}` inside one `PageContentSection` |
190
+ | 2 main + aside | Content + fixed sidebar | `PageColumns fill="left"` or `fill="right"` — **2 columns only** |
191
+ | 3 equal | Three peers (metrics, panels) | `PageColumns columns={[a, b, c]}` |
192
+ | 4 equal | Four peers | `PageColumns columns={[a, b, c, d]}` |
193
+
194
+ Use **PageColumns** for a fixed column count content row. Use **GridLayout** for auto-wrapping card/tile grids (variable tile count, `minmax` columns).
195
+
196
+ ### PageColumns
197
+
198
+ Side-by-side columns with gap inside one `PageContentSection`. **`fill`** controls which column(s) grow:
199
+
200
+ | `fill` | Behavior |
201
+ | -------- | ---------------------------------------------------------------------------- |
202
+ | _(omit)_ | Equal flex columns (`flex: 1 1 0`) — default for **2, 3, or 4** equal peers. |
203
+ | `left` | **2-column only:** first column grows; second stays at fixed 360px width. |
204
+ | `right` | **2-column only:** last column grows; first stays at fixed 360px width. |
205
+
206
+ Pass `columns={[node1, node2, …]}`. For 3–4 equal columns, omit `fill`; do not use `left`/`right`. On mobile, stacks vertically.
207
+
208
+ ### PageXScroll
209
+
210
+ Horizontal scroll strip; used inside `PageTabs` and anywhere a overflowing row needs page-aligned padding. Props: `size`, `fullWidth`, `innerClassName`, `scrollbarClassName`.
211
+
212
+ ### SectionHeader
213
+
214
+ In-section title block (`title`, `description`, `actions`). Use **inside** `PageContentSection`, not as a replacement for `PageHeader`.
215
+
216
+ ### PageEmptyCanvas
217
+
218
+ Centered empty state: `title`, `hint`, optional `children` (e.g. CTA button). Use when a route has no data yet.
219
+
220
+ ### GridLayout
221
+
222
+ Responsive CSS grid (`repeat(auto-fit, minmax(colWidth, 1fr))`). Use for card/tile dashboards inside a section. Report mapping: dashboard **grid** rows / multi-column tile groups.
223
+
224
+ ### Card / Foldable
225
+
226
+ Use inside sections for grouped content; see package `AGENT.md` on those components when present. Do not wrap the whole page in Card.
227
+
228
+ ## Content mode — React → json-dashboard tiles
229
+
230
+ When generating **report** / dashboard specs (not workspace routes), map UI blocks to tiles:
231
+
232
+ | React / intent | Dashboard tile / markdown |
233
+ | ------------------------------- | ----------------------------------------------------------------- |
234
+ | `PageHeader` title text | First `markdown` tile `# Title` or report title field |
235
+ | `SectionHeader` `title` | `markdown` with `## …` |
236
+ | `SectionHeader` `description` | markdown paragraph under that heading |
237
+ | `PageContentSection` block | group of tiles or one markdown section |
238
+ | `PageColumns` (N equal columns) | group of N sibling tiles in one dashboard row |
239
+ | `GridLayout` children | grid row of widget tiles |
240
+ | `ChartAreaInteractive` / charts | `dataset_card`, `performance_chart`, etc. (see widget `AGENT.md`) |
241
+ | `PageEmptyCanvas` copy | `markdown` explanatory tile |
242
+
243
+ See `AGENT.report-only-tiles.md` in the app repo for tiles without a uilib widget.
244
+
245
+ ## Shell components (workspace only)
246
+
247
+ Not part of the per-route skeleton but part of **workspace-page** host wiring:
248
+
249
+ - **AppShell** / **AppShellMainContent** — sidebar + main column + header slot + footer.
250
+ - **PageScroll** — scroll root for the main column.
251
+ - **SybilionAppHeader** — workspace app switcher + user menu (lives in header slot, not inside `PageContent`).
252
+
253
+ ## Anti-patterns
254
+
255
+ - `PageTabs` inside `PageContentSection`.
256
+ - Inline styles or Tailwind for page structure.
257
+ - Second `PageHeader` nested in content.
258
+ - `PageContent` without sections for multi-block pages (prefer multiple `PageContentSection`).
259
+ - Wrapping data widgets in extra layout divs with hard-coded padding.
260
+
261
+ ## Future candidates (not implemented)
262
+
263
+ - **PageToolbar** — dedicated action row between header and tabs.
264
+ - **PageFullBleed** — edge-to-edge section escape hatch.
265
+
266
+ Do not add these locally; extend uilib when product needs them.
267
+
268
+ ## PerformanceChart
269
+
270
+ PerformanceChart is a widget for evaluating forecast accuracy. It plots per-horizon and spaghetti views of model and drift forecasts against historical data, linked to a metrics table with MAE and MAPE, and handles loading, empty, and run-analysis-hint states.
271
+
272
+ ## When to use
273
+
274
+ - To present backtest or performance-analysis results for a dataset’s forecasting models.
275
+ - To compare forecast horizons against actuals, including optional custom series matrices.
276
+
277
+ ## When not to use
278
+
279
+ - For plain historical or forecast charts without performance metrics; use ChartAreaInteractive or LightweightForecastChart.
280
+ - When no performance analysis exists yet; show a call to action to run one instead.
281
+
282
+ ## Do
283
+
284
+ - Wire the loading, empty, and hint props to your data-fetch state so the widget shows the right placeholder.
285
+
286
+ ## Report tile
287
+
288
+ - `performance_chart` — host loads performance payload + dataset series.
289
+
290
+ ## Host provides
291
+
292
+ - `performanceData` (PerformanceChartPayload) and `historicalData` from performance API
293
+ - Optional `forecastData`, `customPerformanceMatrix`, `userSeries` for spaghetti
294
+
295
+ ## Requires
296
+
297
+ - `performanceData` — model/drift forecasts and metrics; `historicalData` — baseline series; `loading` / `chartLoading` / `performanceDataLoading` — spinners; `runAnalysisHint` / `statusHint` — empty states.
298
+
299
+ ## Empty/loading
300
+
301
+ - loading props show shimmer/spinner; null `performanceData` with `runAnalysisHint` prompts to run analysis.
302
+
303
+ ## SidebarDatasetsItemsGrouped
304
+
305
+ # SidebarDatasetsItemsGrouped
306
+
307
+ Renders: expandable sidebar groups of datasets (by target type, regions, or categories).
308
+
309
+ Use when: app shell needs grouped dataset navigation.
310
+ Not when: in-page or report content (no sidebar slot).
311
+
312
+ Host provides:
313
+
314
+ - `datasets` list (`SidebarDatasetsItemsGroupedDataset`)
315
+ - `groupBy`, `selectedDatasetId`, `onDatasetClick`
316
+ - Optional `preItems` / `postItems`, `defaultExpandedGroupNames`
317
+
318
+ Report tile: Not used in report tiles.
319
+
320
+ Requires: `datasets`; `groupBy`; `onDatasetClick` for navigation.
321
+
322
+ Empty/loading: empty `datasets` renders no groups; loading handled by host before pass-in.