@sybilion/uilib 1.3.104 → 1.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.
Files changed (198) 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/Chat/ChatMessage/AgentMessageContent.helpers.js +34 -0
  10. package/dist/esm/components/ui/InteractiveContent/InteractiveContent.styl.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/types/src/components/ui/Chart/Chart.example.d.ts +1 -0
  14. package/dist/esm/types/src/components/ui/Page/PageColumns/PageColumns.d.ts +10 -3
  15. package/dist/esm/types/src/docs/agent-guidance/agent-md-utils.d.ts +10 -0
  16. package/dist/esm/types/src/docs/components/DocsGuidance/DocsGuidance.d.ts +3 -12
  17. package/package.json +1 -1
  18. package/src/components/ui/AnalysesSelector/AGENT.md +16 -0
  19. package/src/components/ui/AnalysisLineIcon/AGENT.md +11 -0
  20. package/src/components/ui/AppHeader/AGENT.md +16 -0
  21. package/src/components/ui/Avatar/AGENT.md +15 -0
  22. package/src/components/ui/Badge/AGENT.md +16 -0
  23. package/src/components/ui/BarChart/AGENT.md +16 -0
  24. package/src/components/ui/Breadcrumb/AGENT.md +15 -0
  25. package/src/components/ui/Button/AGENT.md +17 -0
  26. package/src/components/ui/Card/AGENT.md +16 -0
  27. package/src/components/ui/Chart/AGENT.md +18 -0
  28. package/src/components/ui/Chart/Chart.example.tsx +37 -0
  29. package/src/components/ui/ChartAreaInteractive/AGENT.md +24 -8
  30. package/src/components/ui/Chat/AGENT.md +15 -0
  31. package/src/components/ui/Chat/ChatMessage/AgentMessageContent.helpers.test.tsx +22 -1
  32. package/src/components/ui/Chat/ChatMessage/AgentMessageContent.helpers.tsx +40 -0
  33. package/src/components/ui/Checkbox/AGENT.md +16 -0
  34. package/src/components/ui/Chip/AGENT.md +18 -0
  35. package/src/components/ui/Confirm/AGENT.md +15 -0
  36. package/src/components/ui/Dialog/AGENT.md +15 -0
  37. package/src/components/ui/DonutChart/AGENT.md +15 -0
  38. package/src/components/ui/Drawer/AGENT.md +17 -0
  39. package/src/components/ui/DropZone/AGENT.md +16 -0
  40. package/src/components/ui/DropdownMenu/AGENT.md +16 -0
  41. package/src/components/ui/FileChip/AGENT.md +17 -0
  42. package/src/components/ui/FlickeringGrid/AGENT.md +15 -0
  43. package/src/components/ui/Foldable/AGENT.md +16 -0
  44. package/src/components/ui/GridLayout/AGENT.md +17 -0
  45. package/src/components/ui/Image/AGENT.md +16 -0
  46. package/src/components/ui/ImageWithFallback/AGENT.md +15 -0
  47. package/src/components/ui/Input/AGENT.md +16 -0
  48. package/src/components/ui/InteractiveContent/AGENT.md +21 -0
  49. package/src/components/ui/InteractiveContent/InteractiveContent.styl +9 -0
  50. package/src/components/ui/Kicker/AGENT.md +16 -0
  51. package/src/components/ui/Label/AGENT.md +15 -0
  52. package/src/components/ui/LabelWithId/AGENT.md +10 -0
  53. package/src/components/ui/LabeledInput/AGENT.md +11 -0
  54. package/src/components/ui/LegacyPlatformLink/AGENT.md +15 -0
  55. package/src/components/ui/Logo/AGENT.md +15 -0
  56. package/src/components/ui/MobileAdaptiveSelector/AGENT.md +15 -0
  57. package/src/components/ui/NavUserHeader/AGENT.md +15 -0
  58. package/src/components/ui/NumberControl/AGENT.md +15 -0
  59. package/src/components/ui/Page/AGENT.md +20 -7
  60. package/src/components/ui/Page/PageColumns/PageColumns.styl +5 -5
  61. package/src/components/ui/Page/PageColumns/PageColumns.styl.d.ts +3 -3
  62. package/src/components/ui/Page/PageColumns/PageColumns.tsx +11 -16
  63. package/src/components/ui/Sheet/AGENT.md +15 -0
  64. package/src/components/ui/SignalCard/AGENT.md +16 -0
  65. package/src/components/ui/Switch/AGENT.md +15 -0
  66. package/src/components/ui/Tooltip/AGENT.md +17 -0
  67. package/src/components/widgets/DriverMap/AGENT.md +27 -8
  68. package/src/components/widgets/DriversComparisonChart/AGENT.md +27 -13
  69. package/src/components/widgets/PerformanceChart/AGENT.md +23 -8
  70. package/src/declarations.d.ts +5 -0
  71. package/src/docs/agent-guidance/agent-md-utils.ts +48 -0
  72. package/src/docs/agent-guidance/chat-attachments-dropzone.md +15 -0
  73. package/src/docs/agent-guidance/chat-composer-prefill.md +15 -0
  74. package/src/docs/agent-guidance/chat-sheet.md +14 -0
  75. package/src/docs/agent-guidance/chat-slash-commands.md +15 -0
  76. package/src/docs/agent-guidance/chat-user-csv-attachment.md +14 -0
  77. package/src/docs/agent-guidance/colors.md +10 -0
  78. package/src/docs/agent-guidance/icons.md +11 -0
  79. package/src/docs/agent-guidance/lightweight-forecast-chart.md +17 -0
  80. package/src/docs/agent-guidance/motion.md +10 -0
  81. package/src/docs/agent-guidance/page-columns.md +19 -0
  82. package/src/docs/agent-guidance/page-footer.md +15 -0
  83. package/src/docs/agent-guidance/page-tabs.md +19 -0
  84. package/src/docs/agent-guidance/page.md +15 -0
  85. package/src/docs/agent-guidance/progress.md +11 -0
  86. package/src/docs/agent-guidance/pull-quote.md +15 -0
  87. package/src/docs/agent-guidance/radii-shadows.md +10 -0
  88. package/src/docs/agent-guidance/region-coords.md +11 -0
  89. package/src/docs/agent-guidance/renamer.md +15 -0
  90. package/src/docs/agent-guidance/select.md +15 -0
  91. package/src/docs/agent-guidance/separator.md +11 -0
  92. package/src/docs/agent-guidance/sidebar-datasets-items-grouped.md +11 -0
  93. package/src/docs/agent-guidance/sidebar.md +15 -0
  94. package/src/docs/agent-guidance/skeleton.md +16 -0
  95. package/src/docs/agent-guidance/slider.md +16 -0
  96. package/src/docs/agent-guidance/smart-text-truncate.md +11 -0
  97. package/src/docs/agent-guidance/spacing.md +10 -0
  98. package/src/docs/agent-guidance/sparkline.md +15 -0
  99. package/src/docs/agent-guidance/standalone-app-layout.md +16 -0
  100. package/src/docs/agent-guidance/sybilion-auth-layout.md +15 -0
  101. package/src/docs/agent-guidance/table.md +17 -0
  102. package/src/docs/agent-guidance/tabs.md +21 -0
  103. package/src/docs/agent-guidance/text-shimmer.md +11 -0
  104. package/src/docs/agent-guidance/text-with-defer-tooltip.md +15 -0
  105. package/src/docs/agent-guidance/time-range-controls.md +15 -0
  106. package/src/docs/agent-guidance/toggle-group.md +15 -0
  107. package/src/docs/agent-guidance/toggle.md +15 -0
  108. package/src/docs/agent-guidance/typography.md +10 -0
  109. package/src/docs/agent-guidance/vimeo-embed.md +11 -0
  110. package/src/docs/agent-guidance/world-map.md +11 -0
  111. package/src/docs/components/DocsGuidance/DocsGuidance.styl +26 -25
  112. package/src/docs/components/DocsGuidance/DocsGuidance.styl.d.ts +1 -4
  113. package/src/docs/components/DocsGuidance/DocsGuidance.tsx +9 -44
  114. package/src/docs/config/webpack.config.js +6 -1
  115. package/src/docs/pages/AnalysesSelectorPage.tsx +6 -17
  116. package/src/docs/pages/AnalysisLineIconPage.tsx +2 -11
  117. package/src/docs/pages/AvatarPage.tsx +2 -14
  118. package/src/docs/pages/BadgePage.tsx +2 -15
  119. package/src/docs/pages/BarChartPage.tsx +2 -15
  120. package/src/docs/pages/BreadcrumbPage.tsx +2 -14
  121. package/src/docs/pages/ButtonPage.tsx +2 -16
  122. package/src/docs/pages/CardPage.tsx +5 -18
  123. package/src/docs/pages/ChartAreaInteractivePage.tsx +2 -15
  124. package/src/docs/pages/ChartPage.tsx +4 -47
  125. package/src/docs/pages/ChatAttachmentsDropzonePage.tsx +2 -14
  126. package/src/docs/pages/ChatComposerPrefillPage.tsx +2 -14
  127. package/src/docs/pages/ChatPage.tsx +2 -14
  128. package/src/docs/pages/ChatSheetPage.tsx +2 -13
  129. package/src/docs/pages/ChatSlashCommandsPage.tsx +2 -14
  130. package/src/docs/pages/ChatUserCsvAttachmentPage.tsx +2 -13
  131. package/src/docs/pages/CheckboxPage.tsx +2 -15
  132. package/src/docs/pages/ChipPage.tsx +2 -17
  133. package/src/docs/pages/ColorsPage.tsx +2 -10
  134. package/src/docs/pages/ConfirmPage.tsx +2 -14
  135. package/src/docs/pages/DialogPage.tsx +2 -14
  136. package/src/docs/pages/DonutChartPage.tsx +2 -14
  137. package/src/docs/pages/DrawerPage.tsx +2 -16
  138. package/src/docs/pages/DriverMapPage.tsx +2 -16
  139. package/src/docs/pages/DriversComparisonChartPage.tsx +2 -16
  140. package/src/docs/pages/DropZonePage.tsx +2 -15
  141. package/src/docs/pages/DropdownMenuPage.tsx +2 -15
  142. package/src/docs/pages/FileChipPage.tsx +2 -16
  143. package/src/docs/pages/FlickeringGridPage.tsx +2 -14
  144. package/src/docs/pages/FoldablePage.tsx +2 -15
  145. package/src/docs/pages/GridLayoutPage.tsx +2 -15
  146. package/src/docs/pages/IconsPage.tsx +2 -11
  147. package/src/docs/pages/ImagePage.tsx +2 -15
  148. package/src/docs/pages/ImageWithFallbackPage.tsx +2 -14
  149. package/src/docs/pages/IncludeHiddenInYScalePage.tsx +2 -13
  150. package/src/docs/pages/InputPage.tsx +2 -15
  151. package/src/docs/pages/InteractiveContentPage.tsx +91 -18
  152. package/src/docs/pages/KickerPage.tsx +2 -15
  153. package/src/docs/pages/LabelPage.tsx +2 -14
  154. package/src/docs/pages/LabelWithIdPage.tsx +2 -10
  155. package/src/docs/pages/LabeledInputPage.tsx +2 -11
  156. package/src/docs/pages/LegacyPlatformLinkPage.tsx +2 -14
  157. package/src/docs/pages/LightweightChartPage.tsx +2 -16
  158. package/src/docs/pages/LogoPage.tsx +2 -14
  159. package/src/docs/pages/MobileAdaptiveSelectorPage.tsx +2 -14
  160. package/src/docs/pages/MotionPage.tsx +2 -10
  161. package/src/docs/pages/NavUserHeaderPage.tsx +2 -14
  162. package/src/docs/pages/NumberControlPage.tsx +2 -14
  163. package/src/docs/pages/PageColumnsPage.tsx +40 -17
  164. package/src/docs/pages/PageFooterPage.tsx +2 -14
  165. package/src/docs/pages/PagePage.tsx +2 -14
  166. package/src/docs/pages/PageTabsPage.tsx +2 -17
  167. package/src/docs/pages/PerformanceChartPage.tsx +2 -14
  168. package/src/docs/pages/ProgressPage.tsx +2 -11
  169. package/src/docs/pages/PullQuotePage.tsx +2 -14
  170. package/src/docs/pages/RadiiShadowsPage.tsx +2 -10
  171. package/src/docs/pages/RegionCoordsPage.tsx +2 -11
  172. package/src/docs/pages/RenamerPage.tsx +2 -14
  173. package/src/docs/pages/SelectPage.tsx +2 -14
  174. package/src/docs/pages/SeparatorPage.tsx +2 -11
  175. package/src/docs/pages/SheetPage.tsx +2 -14
  176. package/src/docs/pages/SidebarDatasetsItemsGroupedPage.tsx +2 -11
  177. package/src/docs/pages/SidebarPage.tsx +2 -14
  178. package/src/docs/pages/SignalCardPage.tsx +2 -15
  179. package/src/docs/pages/SkeletonPage.tsx +2 -15
  180. package/src/docs/pages/SliderPage.tsx +2 -15
  181. package/src/docs/pages/SmartTextTruncatePage.tsx +2 -11
  182. package/src/docs/pages/SpacingPage.tsx +2 -10
  183. package/src/docs/pages/SparklinePage.tsx +2 -14
  184. package/src/docs/pages/StandaloneAppLayoutPage/StandaloneAppLayoutPage.tsx +2 -15
  185. package/src/docs/pages/SwitchPage.tsx +2 -14
  186. package/src/docs/pages/SybilionAuthLayoutPage.tsx +2 -14
  187. package/src/docs/pages/TablePage.tsx +2 -15
  188. package/src/docs/pages/TabsPage.tsx +2 -19
  189. package/src/docs/pages/TextShimmerPage.tsx +2 -11
  190. package/src/docs/pages/TextWithDeferTooltipPage.tsx +2 -14
  191. package/src/docs/pages/TimeRangeControlsPage.tsx +2 -14
  192. package/src/docs/pages/ToggleGroupPage.tsx +2 -14
  193. package/src/docs/pages/TogglePage.tsx +2 -12
  194. package/src/docs/pages/TooltipPage.tsx +2 -16
  195. package/src/docs/pages/TypographyPage.tsx +2 -10
  196. package/src/docs/pages/VimeoEmbedPage.tsx +2 -11
  197. package/src/docs/pages/WorldMapPage.tsx +2 -11
  198. package/src/components/widgets/AGENT.md +0 -21
@@ -2,6 +2,7 @@ import { useState } from 'react';
2
2
 
3
3
  import { Button } from '#uilib/components/ui/Button';
4
4
  import { Confirm } from '#uilib/components/ui/Confirm';
5
+ import ConfirmGuidance from '#uilib/components/ui/Confirm/AGENT.md';
5
6
  import { PageContentSection } from '#uilib/components/ui/Page';
6
7
 
7
8
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
@@ -20,20 +21,7 @@ export default function ConfirmPage() {
20
21
  subheader="Confirmation dialog built on Dialog with primary and cancel actions."
21
22
  actions={<DocsHeaderActions />}
22
23
  />
23
- <DocsGuidance
24
- overview="Confirm is a focused confirmation dialog built on Dialog, with a title, body, and paired confirm and cancel actions. Set confirmVariant to destructive for irreversible operations such as deletion."
25
- whenToUse={[
26
- 'Before destructive or irreversible actions, such as deleting an item.',
27
- 'When proceeding would discard unsaved work.',
28
- ]}
29
- whenNotToUse={[
30
- 'For routine, easily reversible actions; frequent confirmations train users to click through.',
31
- 'When the task needs input or several fields; use Dialog instead.',
32
- ]}
33
- doNotes={[
34
- 'Label the confirm button with the action it performs, such as “Delete”, rather than “OK”.',
35
- ]}
36
- />
24
+ <DocsGuidance source={ConfirmGuidance} />
37
25
  <PageContentSection>
38
26
  <div
39
27
  style={{
@@ -2,6 +2,7 @@ import { useState } from 'react';
2
2
 
3
3
  import { Button } from '#uilib/components/ui/Button';
4
4
  import { Dialog } from '#uilib/components/ui/Dialog';
5
+ import DialogGuidance from '#uilib/components/ui/Dialog/AGENT.md';
5
6
  import { PageContentSection } from '#uilib/components/ui/Page';
6
7
 
7
8
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
@@ -19,20 +20,7 @@ export default function DialogPage() {
19
20
  subheader="Modal dialog with trigger and footer."
20
21
  actions={<DocsHeaderActions />}
21
22
  />
22
- <DocsGuidance
23
- overview="Dialog presents content in a modal layer above the page, with a trigger, title, optional subtitle, body content, and a footer for actions. It blocks interaction with the page until dismissed."
24
- whenToUse={[
25
- 'For focused tasks that must be completed before returning to the page, such as editing details.',
26
- 'To present important information that must not be missed.',
27
- ]}
28
- whenNotToUse={[
29
- 'For simple yes or no confirmations; use Confirm instead.',
30
- 'For lengthy or complex flows; consider a dedicated page or drawer.',
31
- ]}
32
- doNotes={[
33
- 'Keep dialog content short and provide a clear primary action in the footer.',
34
- ]}
35
- />
23
+ <DocsGuidance source={DialogGuidance} />
36
24
  <PageContentSection>
37
25
  <Dialog
38
26
  open={open}
@@ -1,5 +1,6 @@
1
1
  import type { DonutChartDatum } from '#uilib/components/ui/DonutChart';
2
2
  import { DonutChart } from '#uilib/components/ui/DonutChart';
3
+ import DonutChartGuidance from '#uilib/components/ui/DonutChart/AGENT.md';
3
4
  import { PageContentSection, SectionHeader } from '#uilib/components/ui/Page';
4
5
 
5
6
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
@@ -41,20 +42,7 @@ export default function DonutChartPage() {
41
42
  subheader="Part-to-whole donut chart with an optional centre figure."
42
43
  actions={<DocsHeaderActions />}
43
44
  />
44
- <DocsGuidance
45
- overview="DonutChart shows how a small number of categories make up a whole. Each datum carries a key, value, and optional label and colour; the centre of the donut can display a headline figure with a caption. Tooltip and legend reuse the shared chart infrastructure."
46
- whenToUse={[
47
- 'To show composition of a total across roughly two to six categories, such as portfolio allocation or sentiment share.',
48
- 'When a single headline figure (the total) deserves prominence in the centre.',
49
- ]}
50
- whenNotToUse={[
51
- 'For more than about six categories; slices become unreadable — use BarChart instead.',
52
- 'For comparing values across groups or over time; a donut only conveys part-to-whole.',
53
- ]}
54
- doNotes={[
55
- 'Order slices from largest to smallest so the chart reads clockwise.',
56
- ]}
57
- />
45
+ <DocsGuidance source={DonutChartGuidance} />
58
46
  <PageContentSection>
59
47
  <SectionHeader
60
48
  title="With centre label"
@@ -9,6 +9,7 @@ import {
9
9
  DrawerTitle,
10
10
  DrawerTrigger,
11
11
  } from '#uilib/components/ui/Drawer';
12
+ import DrawerGuidance from '#uilib/components/ui/Drawer/AGENT.md';
12
13
  import { PageContentSection } from '#uilib/components/ui/Page';
13
14
 
14
15
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
@@ -24,22 +25,7 @@ export default function DrawerPage() {
24
25
  subheader="Mobile-friendly drawer (Vaul)."
25
26
  actions={<DocsHeaderActions />}
26
27
  />
27
- <DocsGuidance
28
- overview="Drawer is a panel that slides in from the edge of the screen, built on Vaul for touch-friendly drag-to-dismiss behaviour. Compose it from DrawerTrigger, DrawerContent, DrawerHeader, and DrawerFooter, and give every drawer a DrawerTitle and DrawerDescription."
29
- whenToUse={[
30
- 'For supplementary content or actions on mobile, where a bottom sheet feels more natural than a dialog.',
31
- 'For short, focused tasks that the user completes and dismisses, such as confirming a choice or adjusting a setting.',
32
- 'When the user should be able to swipe or drag the surface away to dismiss it.',
33
- ]}
34
- whenNotToUse={[
35
- 'For critical confirmations that must block interaction; use AlertDialog instead.',
36
- 'For long forms or dense content; use a dedicated page or a Dialog with more room.',
37
- ]}
38
- doNotes={[
39
- 'Always provide a DrawerTitle and DrawerDescription so screen readers can announce the surface.',
40
- 'Place dismiss actions in DrawerFooter using DrawerClose so they close the drawer consistently.',
41
- ]}
42
- />
28
+ <DocsGuidance source={DrawerGuidance} />
43
29
  <PageContentSection>
44
30
  <Drawer>
45
31
  <DrawerTrigger asChild>
@@ -8,6 +8,7 @@ import {
8
8
  DriverMap,
9
9
  getPreciseCoordinates,
10
10
  } from '#uilib/components/widgets/DriverMap';
11
+ import driverMapGuidance from '#uilib/components/widgets/DriverMap/AGENT.md';
11
12
  import { CaretLeft, CaretRight } from '@phosphor-icons/react';
12
13
 
13
14
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
@@ -202,22 +203,7 @@ export default function DriverMapPage() {
202
203
  subheader="World map with driver badges and the driver detail card — map clicks and the selector sync selection; arrow keys navigate the map."
203
204
  actions={<DocsHeaderActions />}
204
205
  />
205
- <DocsGuidance
206
- overview="DriverMap renders a world map with badges for each driver, and DriverCard shows the detail of the selected driver. The two share a selection: clicking a badge on the map, using arrow keys, or paging through an external selector all update the same selected driver."
207
- whenToUse={[
208
- 'To give a geographic overview of where drivers originate and let users explore them by region.',
209
- 'Alongside DriverCard, so selecting a driver on the map reveals its importance, lag, and summary.',
210
- 'When drivers carry coordinates or region metadata that benefits from a spatial presentation.',
211
- ]}
212
- whenNotToUse={[
213
- 'When drivers have no meaningful geography; a table or list ranks them more clearly.',
214
- 'For comparing driver series over time; use DriversComparisonChart instead.',
215
- ]}
216
- doNotes={[
217
- 'Pass isLoading to both the map and the card so their loading states stay in sync.',
218
- 'Provide a driverSelector in DriverCard so users can page through drivers without using the map.',
219
- ]}
220
- />
206
+ <DocsGuidance source={driverMapGuidance} />
221
207
  <PageContentSection>
222
208
  <div
223
209
  style={{
@@ -9,6 +9,7 @@ import {
9
9
  DriversComparisonChart,
10
10
  type DriversComparisonViewTab,
11
11
  } from '#uilib/components/widgets/DriversComparisonChart';
12
+ import DriversComparisonChartGuidance from '#uilib/components/widgets/DriversComparisonChart/AGENT.md';
12
13
  import { useTheme } from '#uilib/contexts/theme-context';
13
14
  import type { BacktestsComponentPayload } from '@sybilion/platform-sdk';
14
15
 
@@ -124,22 +125,7 @@ export default function DriversComparisonChartPage() {
124
125
  subheader="Normalized target line with driver series; Lagged/Overlapped tabs shift driver alignment; table rows toggle chart visibility."
125
126
  actions={<DocsHeaderActions />}
126
127
  />
127
- <DocsGuidance
128
- overview="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."
129
- whenToUse={[
130
- 'To show how individual drivers move relative to a backtested target over time.',
131
- 'When users need to compare lagged and contemporaneous alignment of driver series.',
132
- 'When the driver table and the chart should stay linked, so hiding a row hides its line.',
133
- ]}
134
- whenNotToUse={[
135
- 'For a single series with no target to compare against; use ChartAreaInteractive directly.',
136
- 'When drivers lack normalized series data; the chart needs a populated payload to be useful.',
137
- ]}
138
- doNotes={[
139
- 'Provide a statusHint when the payload is empty so users understand why the chart is blank.',
140
- 'Control viewTab from the page when an external Lagged/Overlapped switcher should stay in sync.',
141
- ]}
142
- />
128
+ <DocsGuidance source={DriversComparisonChartGuidance} />
143
129
  <PageContentSection>
144
130
  <div
145
131
  style={{
@@ -1,5 +1,6 @@
1
1
  import { useState } from 'react';
2
2
 
3
+ import DropZoneGuidance from '#uilib/components/ui/DropZone/AGENT.md';
3
4
  import { DropZone } from '#uilib/components/ui/DropZone/DropZone';
4
5
  import { PageContentSection } from '#uilib/components/ui/Page';
5
6
 
@@ -18,21 +19,7 @@ export default function DropZonePage() {
18
19
  subheader="Drag and drop or pick a file."
19
20
  actions={<DocsHeaderActions />}
20
21
  />
21
- <DocsGuidance
22
- overview="DropZone is a file upload target that accepts a dragged file or opens the system file picker on click. Restrict accepted types with the accept prop and receive the chosen file in the onFile callback."
23
- whenToUse={[
24
- 'When uploading a file is a primary step in a flow, such as importing a dataset.',
25
- 'When drag and drop is a natural interaction, for example on desktop-focused screens.',
26
- ]}
27
- whenNotToUse={[
28
- 'In compact layouts where a large drop target wastes space; use a simple file input or button instead.',
29
- 'When users need to manage multiple attachments inline; pair an upload control with FileChip rows.',
30
- ]}
31
- doNotes={[
32
- 'Set accept to the formats you can actually process, and repeat them in the label so expectations are clear.',
33
- 'Show the selected file name after a drop so users get immediate confirmation.',
34
- ]}
35
- />
22
+ <DocsGuidance source={DropZoneGuidance} />
36
23
  <PageContentSection>
37
24
  <DropZone
38
25
  accept=".csv,.txt"
@@ -7,6 +7,7 @@ import {
7
7
  DropdownMenuSeparator,
8
8
  DropdownMenuTrigger,
9
9
  } from '#uilib/components/ui/DropdownMenu';
10
+ import DropdownMenuGuidance from '#uilib/components/ui/DropdownMenu/AGENT.md';
10
11
  import { PageContentSection } from '#uilib/components/ui/Page';
11
12
 
12
13
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
@@ -22,21 +23,7 @@ export default function DropdownMenuPage() {
22
23
  subheader="Context menu with items."
23
24
  actions={<DocsHeaderActions />}
24
25
  />
25
- <DocsGuidance
26
- overview="DropdownMenu displays a list of actions or options in a floating panel opened from a trigger, typically a button. Group related items with DropdownMenuLabel and DropdownMenuSeparator, and handle each action in onSelect."
27
- whenToUse={[
28
- 'To collect secondary actions behind a single trigger, such as an overflow or kebab menu.',
29
- 'When a row, card, or toolbar offers several contextual actions that would crowd the layout as buttons.',
30
- ]}
31
- whenNotToUse={[
32
- 'To choose a value for a form field; use Select or Combobox instead.',
33
- 'When there are only one or two actions; show them as buttons directly.',
34
- ]}
35
- doNotes={[
36
- 'Order items by expected frequency of use and separate destructive actions from the rest.',
37
- 'Keep item labels short and verb-led, such as “Rename” or “Delete”.',
38
- ]}
39
- />
26
+ <DocsGuidance source={DropdownMenuGuidance} />
40
27
  <PageContentSection>
41
28
  <DropdownMenu>
42
29
  <DropdownMenuTrigger asChild>
@@ -1,4 +1,5 @@
1
1
  import { FileChip } from '#uilib/components/ui/FileChip';
2
+ import FileChipGuidance from '#uilib/components/ui/FileChip/AGENT.md';
2
3
  import { PageContentSection } from '#uilib/components/ui/Page';
3
4
 
4
5
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
@@ -17,22 +18,7 @@ export default function FileChipPage() {
17
18
  subheader="Compact file row for chat attachments and downloadable CSV presets."
18
19
  actions={<DocsHeaderActions />}
19
20
  />
20
- <DocsGuidance
21
- overview="FileChip is a compact row that represents a file with a format icon, name, and hint text. It supports an onClick handler for downloadable files and an onRemove handler for detachable attachments, and truncates long file names gracefully."
22
- whenToUse={[
23
- 'To show attachments in a chat composer or message, with a remove control.',
24
- 'To offer downloadable files, such as CSV presets, where clicking the chip starts the download.',
25
- 'Anywhere a full file card would be too heavy and only the name and format matter.',
26
- ]}
27
- whenNotToUse={[
28
- 'As the upload control itself; use DropZone or a file input to collect the file first.',
29
- 'For rich file previews with thumbnails or metadata; use a card layout instead.',
30
- ]}
31
- doNotes={[
32
- 'Set the hint to describe the action, such as “Download CSV file”, so the affordance is clear.',
33
- 'Pass the correct format so the chip shows the right icon for the file type.',
34
- ]}
35
- />
21
+ <DocsGuidance source={FileChipGuidance} />
36
22
  <PageContentSection
37
23
  style={{
38
24
  display: 'flex',
@@ -1,4 +1,5 @@
1
1
  import { FlickeringGrid } from '#uilib/components/ui/FlickeringGrid';
2
+ import FlickeringGridGuidance from '#uilib/components/ui/FlickeringGrid/AGENT.md';
2
3
  import { PageContentSection } from '#uilib/components/ui/Page';
3
4
 
4
5
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
@@ -14,20 +15,7 @@ export default function FlickeringGridPage() {
14
15
  subheader="Decorative animated grid background."
15
16
  actions={<DocsHeaderActions />}
16
17
  />
17
- <DocsGuidance
18
- overview="FlickeringGrid is a purely decorative animated grid of squares that flicker at random. Place it behind content in a positioned container to add subtle visual texture to hero areas or empty states."
19
- whenToUse={[
20
- 'As a background flourish on landing, sign-in, or marketing-style surfaces.',
21
- 'To add ambient motion to an otherwise static empty state.',
22
- ]}
23
- whenNotToUse={[
24
- 'Behind dense data displays such as charts or tables, where motion competes with the content.',
25
- 'When users may prefer reduced motion; avoid relying on it to convey any meaning.',
26
- ]}
27
- dontNotes={[
28
- 'Do not attach interactive behaviour to the grid; it is decoration only.',
29
- ]}
30
- />
18
+ <DocsGuidance source={FlickeringGridGuidance} />
31
19
  <PageContentSection
32
20
  style={{ height: 200, position: 'relative', overflow: 'hidden' }}
33
21
  >
@@ -1,4 +1,5 @@
1
1
  import { Foldable } from '#uilib/components/ui/Foldable';
2
+ import FoldableGuidance from '#uilib/components/ui/Foldable/AGENT.md';
2
3
  import { PageContentSection } from '#uilib/components/ui/Page';
3
4
 
4
5
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
@@ -14,21 +15,7 @@ export default function FoldablePage() {
14
15
  subheader="Expandable section with header."
15
16
  actions={<DocsHeaderActions />}
16
17
  />
17
- <DocsGuidance
18
- overview="Foldable is a collapsible section with a clickable header that shows or hides its content. Pass the header and content as props, and use defaultUnfolded to open the section initially."
19
- whenToUse={[
20
- 'To tuck away secondary or advanced detail that most users do not need immediately.',
21
- 'To shorten long pages by letting users expand only the sections they care about.',
22
- ]}
23
- whenNotToUse={[
24
- 'For content users must always see, such as warnings or required form fields.',
25
- 'For switching between parallel views of the same content; use Tabs instead.',
26
- ]}
27
- doNotes={[
28
- 'Write headers that describe the hidden content, so users can decide whether to expand.',
29
- 'Set defaultUnfolded when the content is important enough to show on first view.',
30
- ]}
31
- />
18
+ <DocsGuidance source={FoldableGuidance} />
32
19
  <PageContentSection>
33
20
  <Foldable
34
21
  header={<span>Click to expand</span>}
@@ -1,5 +1,6 @@
1
1
  import type { CSSProperties } from 'react';
2
2
 
3
+ import GridLayoutGuidance from '#uilib/components/ui/GridLayout/AGENT.md';
3
4
  import { GridLayout } from '#uilib/components/ui/GridLayout/GridLayout';
4
5
  import { PageContentSection } from '#uilib/components/ui/Page';
5
6
 
@@ -28,21 +29,7 @@ export default function GridLayoutPage() {
28
29
  subheader="Responsive CSS grid (`repeat(auto-fit, minmax(colWidth, 1fr))`), optional gap, polymorphic root via `as`."
29
30
  actions={<DocsHeaderActions />}
30
31
  />
31
- <DocsGuidance
32
- overview="GridLayout is a responsive CSS grid that fits as many columns as the container allows, with each cell keeping at least colWidth before wrapping to a new row. Adjust spacing with the gap prop and change the root element with the polymorphic as prop."
33
- whenToUse={[
34
- 'To lay out cards, tiles, or widgets in a dashboard-style grid inside a page section.',
35
- 'When the number of items varies and the grid should adapt to the viewport without media queries.',
36
- ]}
37
- whenNotToUse={[
38
- 'For two fixed page columns such as main content plus an aside; use PageColumns.',
39
- 'For items of very different sizes that need manual placement; use custom CSS grid instead.',
40
- ]}
41
- doNotes={[
42
- 'Tune colWidth to the smallest width at which a tile still reads comfortably.',
43
- 'Use spacing tokens such as var(--p-4) for the gap to stay consistent with the rest of the page.',
44
- ]}
45
- />
32
+ <DocsGuidance source={GridLayoutGuidance} />
46
33
  <PageContentSection
47
34
  style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}
48
35
  >
@@ -2,6 +2,7 @@ import { useMemo, useRef, useState } from 'react';
2
2
 
3
3
  import { Input } from '#uilib/components/ui/Input';
4
4
  import { PageContentSection } from '#uilib/components/ui/Page';
5
+ import iconsGuidance from '#uilib/docs/agent-guidance/icons.md';
5
6
  import { Activity, icons } from 'lucide-react';
6
7
 
7
8
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
@@ -49,17 +50,7 @@ export default function IconsPage() {
49
50
  subheader="The full Lucide icon set, rendered at the system stroke and sizes."
50
51
  actions={<DocsHeaderActions />}
51
52
  />
52
- <DocsGuidance
53
- overview="Icons come from the lucide-react package and are drawn at a 1.5px stroke (--icon-stroke). Use the --icon-size-* tokens to pick a size that matches the surrounding text, and keep one consistent size within a control or list."
54
- whenToUse={[
55
- 'To reinforce the meaning of an action, status, or category next to its label.',
56
- 'As the only content of a square icon button, paired with an aria-label.',
57
- ]}
58
- whenNotToUse={[
59
- 'To decorate text that is already clear on its own.',
60
- 'For brand or product marks; use the Logo component instead.',
61
- ]}
62
- />
53
+ <DocsGuidance source={iconsGuidance} />
63
54
  <PageContentSection>
64
55
  <h3>Sizes</h3>
65
56
  <p className={S.sectionNote}>
@@ -1,4 +1,5 @@
1
1
  import { Image } from '#uilib/components/ui/Image';
2
+ import ImageGuidance from '#uilib/components/ui/Image/AGENT.md';
2
3
  import { PageContentSection } from '#uilib/components/ui/Page';
3
4
 
4
5
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
@@ -14,21 +15,7 @@ export default function ImagePage() {
14
15
  subheader="Responsive image wrapper."
15
16
  actions={<DocsHeaderActions />}
16
17
  />
17
- <DocsGuidance
18
- overview="Image is a thin wrapper around the native img element that loads a remote URL and accepts a fallback for when the request fails. Use it as the standard way to render external images in the library."
19
- whenToUse={[
20
- 'To display remote images such as article thumbnails or user-provided media.',
21
- 'When you want a consistent image element with built-in fallback support.',
22
- ]}
23
- whenNotToUse={[
24
- 'When you need visible error handling with custom fallback content; use ImageWithFallback.',
25
- 'For purely decorative backgrounds; prefer CSS backgrounds so they stay out of the accessibility tree.',
26
- ]}
27
- doNotes={[
28
- 'Always provide meaningful alt text, or an empty alt for decorative images.',
29
- 'Constrain the image with max-width or explicit dimensions to avoid layout shift.',
30
- ]}
31
- />
18
+ <DocsGuidance source={ImageGuidance} />
32
19
  <PageContentSection>
33
20
  <Image
34
21
  url="https://picsum.photos/seed/uilib/400/240"
@@ -1,4 +1,5 @@
1
1
  import { ImageWithFallback } from '#uilib/components/ui/ImageWithFallback';
2
+ import ImageWithFallbackGuidance from '#uilib/components/ui/ImageWithFallback/AGENT.md';
2
3
  import { PageContentSection } from '#uilib/components/ui/Page';
3
4
 
4
5
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
@@ -14,20 +15,7 @@ export default function ImageWithFallbackPage() {
14
15
  subheader="Image with fallback on error."
15
16
  actions={<DocsHeaderActions />}
16
17
  />
17
- <DocsGuidance
18
- overview="ImageWithFallback renders an image from a URL and swaps in the provided fallback content when the image fails to load. The fallback can be any node, such as a placeholder icon or a short message."
19
- whenToUse={[
20
- 'When image URLs come from external or user-supplied sources and may be broken.',
21
- 'When the layout must stay intact even if an image never loads, such as in cards or lists.',
22
- ]}
23
- whenNotToUse={[
24
- 'When the image is bundled with the app and guaranteed to exist; plain Image is enough.',
25
- ]}
26
- doNotes={[
27
- 'Give the fallback the same footprint as the image so the layout does not jump on error.',
28
- 'Keep fallback content simple, such as an icon or short label, rather than a detailed error message.',
29
- ]}
30
- />
18
+ <DocsGuidance source={ImageWithFallbackGuidance} />
31
19
  <PageContentSection>
32
20
  <p style={{ marginBottom: 12 }}>Broken URL shows fallback:</p>
33
21
  <ImageWithFallback
@@ -1,6 +1,7 @@
1
1
  import { useCallback, useMemo, useState } from 'react';
2
2
 
3
3
  import { ChartAreaInteractive } from '#uilib/components/ui/ChartAreaInteractive';
4
+ import ChartAreaInteractiveGuidance from '#uilib/components/ui/ChartAreaInteractive/AGENT.md';
4
5
  import type { ChartDataPoint } from '#uilib/components/ui/ChartAreaInteractive/ChartAreaInteractive.types';
5
6
  import type { ForecastItemData } from '#uilib/components/ui/ChartAreaInteractive/ChartLines';
6
7
  import { calculateChartYRange } from '#uilib/components/ui/ChartAreaInteractive/overlays/useChartYRange';
@@ -102,19 +103,7 @@ export default function IncludeHiddenInYScalePage() {
102
103
  }
103
104
  actions={<DocsHeaderActions />}
104
105
  />
105
- <DocsGuidance
106
- overview="includeHiddenInYScale is a BaseChartWrapper and ChartAreaInteractive prop that controls whether series hidden via the legend still contribute to the Y-axis domain. With the default of false, hiding an outlier series lets the chart rescale to the remaining data; setting it to true preserves the legacy behaviour where hidden values keep expanding the scale."
107
- whenToUse={[
108
- 'Leave it false so hiding an extreme series rescales the chart and reveals detail in the rest.',
109
- 'Set it true when the axis must stay stable while users toggle series, for example in side-by-side comparisons.',
110
- ]}
111
- whenNotToUse={[
112
- 'Do not combine it with a manually fixed yMin and yMax computed without the same setting, or the domain and the data will disagree.',
113
- ]}
114
- doNotes={[
115
- 'Pass the same includeHiddenInYScale and hiddenSeries values to calculateChartYRange so the computed domain matches the chart.',
116
- ]}
117
- />
106
+ <DocsGuidance source={ChartAreaInteractiveGuidance} />
118
107
  <PageContentSection>
119
108
  <div
120
109
  style={{
@@ -1,4 +1,5 @@
1
1
  import { Input } from '#uilib/components/ui/Input';
2
+ import InputGuidance from '#uilib/components/ui/Input/AGENT.md';
2
3
  import { PageContentSection } from '#uilib/components/ui/Page';
3
4
 
4
5
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
@@ -17,21 +18,7 @@ export default function InputPage() {
17
18
  subheader="Variants, sizes, textarea, placeholder, and disabled state."
18
19
  actions={<DocsHeaderActions />}
19
20
  />
20
- <DocsGuidance
21
- overview="Input is the standard single-line text field. Pair it with a Label linked via htmlFor and id, and control the value through the onChange handler."
22
- whenToUse={[
23
- 'To collect short, free-form text such as names, titles, or search terms.',
24
- 'In forms alongside Label, or use LabeledInput for the common label-plus-input row.',
25
- ]}
26
- whenNotToUse={[
27
- 'For multi-line text; use Textarea instead.',
28
- 'When the value must come from a fixed set of options; use Select or Combobox.',
29
- ]}
30
- doNotes={[
31
- 'Always associate a visible Label so the field is announced correctly by assistive technology.',
32
- 'Use placeholder text as a hint, not as a substitute for the label.',
33
- ]}
34
- />
21
+ <DocsGuidance source={InputGuidance} />
35
22
  <PageContentSection
36
23
  style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}
37
24
  >
@@ -1,12 +1,64 @@
1
1
  import { InteractiveContent } from '#uilib/components/ui/InteractiveContent';
2
+ import InteractiveContentGuidance from '#uilib/components/ui/InteractiveContent/AGENT.md';
2
3
  import { PageContentSection } from '#uilib/components/ui/Page';
3
4
 
4
5
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
5
6
  import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
6
7
  import { DocsHeaderActions } from '../docsHeaderActions';
7
8
 
8
- const SAMPLE =
9
- 'Use **bold** and *italic* in formatted text. See https://www.theguardian.com/business/ng-interactive/2026/may/14/us-stock-market-war-inflation-tariffs-trump for context.';
9
+ type ShowcaseRow = {
10
+ label: string;
11
+ source: string;
12
+ variant?: 'full' | 'inline';
13
+ };
14
+
15
+ const SHOWCASE_ROWS: ShowcaseRow[] = [
16
+ {
17
+ label: 'Bold (markdown)',
18
+ source: 'Use **bold** for emphasis.',
19
+ },
20
+ {
21
+ label: 'Bold (HTML)',
22
+ source: 'Use <strong>bold</strong> for emphasis.',
23
+ },
24
+ {
25
+ label: 'Italic (markdown)',
26
+ source: 'Use *italic* or _italic_ for emphasis.',
27
+ },
28
+ {
29
+ label: 'Code (HTML)',
30
+ source: 'Restored <code>?prompt=</code> URLs for chat deep links.',
31
+ variant: 'inline',
32
+ },
33
+ {
34
+ label: 'Code (backticks)',
35
+ source: 'Pass `?prompt=` in the query string.',
36
+ variant: 'inline',
37
+ },
38
+ {
39
+ label: 'Markdown link',
40
+ source: 'Read the [release notes](/releases) for details.',
41
+ },
42
+ {
43
+ label: 'HTML link',
44
+ source: 'Read the <a href="/releases">release notes</a> for details.',
45
+ },
46
+ {
47
+ label: 'Autolink URL',
48
+ source: 'See https://example.com/docs for more context.',
49
+ },
50
+ {
51
+ label: 'Combined inline',
52
+ source:
53
+ '<strong>Chat deep links.</strong> Restored <code>?prompt=</code> URLs. See https://example.com/help.',
54
+ variant: 'inline',
55
+ },
56
+ ];
57
+
58
+ const FULL_VARIANT_SAMPLE = `# Section title
59
+
60
+ - **First item.** With *italic* detail.
61
+ - Second item with \`inline code\` and a [link](/settings).`;
10
62
 
11
63
  export default function InteractiveContentPage() {
12
64
  return (
@@ -17,22 +69,43 @@ export default function InteractiveContentPage() {
17
69
  subheader="Inline formatting from assistant-style text."
18
70
  actions={<DocsHeaderActions />}
19
71
  />
20
- <DocsGuidance
21
- overview="InteractiveContent renders assistant-style plain text with inline formatting applied: markdown emphasis such as bold and italic, and bare URLs converted into clickable links. The inline variant restricts formatting to what is safe within a single line."
22
- whenToUse={[
23
- 'To display assistant or model-generated text that may contain markdown emphasis and raw URLs.',
24
- 'When plain text needs lightweight formatting without a full markdown renderer.',
25
- ]}
26
- whenNotToUse={[
27
- 'For trusted, authored content with rich structure such as headings, lists, or code blocks; use a full markdown component.',
28
- 'For static UI copy that needs no formatting; render the text directly.',
29
- ]}
30
- doNotes={[
31
- 'Use the inline variant when the text sits inside a sentence or compact label.',
32
- ]}
33
- />
34
- <PageContentSection>
35
- <InteractiveContent text={SAMPLE} />
72
+ <DocsGuidance source={InteractiveContentGuidance} />
73
+ <PageContentSection
74
+ style={{ display: 'flex', flexDirection: 'column', gap: '1.5rem' }}
75
+ >
76
+ {SHOWCASE_ROWS.map(row => (
77
+ <section key={row.label}>
78
+ <h3 style={{ marginBottom: '0.5rem', fontSize: '0.875rem' }}>
79
+ {row.label}
80
+ </h3>
81
+ <p
82
+ style={{
83
+ margin: '0 0 0.5rem',
84
+ fontSize: '0.75rem',
85
+ color: 'var(--muted-foreground)',
86
+ }}
87
+ >
88
+ <code>{row.source}</code>
89
+ </p>
90
+ <InteractiveContent text={row.source} variant={row.variant} />
91
+ </section>
92
+ ))}
93
+ </PageContentSection>
94
+ <PageContentSection
95
+ style={{ display: 'flex', flexDirection: 'column', gap: '0.75rem' }}
96
+ >
97
+ <h3 style={{ fontSize: '0.875rem' }}>Full variant (default)</h3>
98
+ <p
99
+ style={{
100
+ margin: 0,
101
+ fontSize: '0.75rem',
102
+ color: 'var(--muted-foreground)',
103
+ }}
104
+ >
105
+ Supports headings, markdown bullets (<code>- item</code>), and the
106
+ same inline formats.
107
+ </p>
108
+ <InteractiveContent text={FULL_VARIANT_SAMPLE} />
36
109
  </PageContentSection>
37
110
  </>
38
111
  );