@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,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,4 +1,5 @@
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';
@@ -68,23 +69,7 @@ export default function InteractiveContentPage() {
68
69
  subheader="Inline formatting from assistant-style text."
69
70
  actions={<DocsHeaderActions />}
70
71
  />
71
- <DocsGuidance
72
- overview="InteractiveContent renders assistant-style plain text with inline formatting: bold and italic emphasis, inline code via <code> tags or backticks, markdown and HTML links, and bare URLs converted into clickable links. The inline variant omits block-level features such as headings and markdown bullets."
73
- whenToUse={[
74
- 'To display assistant or model-generated text that may contain markdown emphasis and raw URLs.',
75
- 'For release note bullets and other compact labels that need lightweight inline formatting.',
76
- 'When plain text needs lightweight formatting without a full markdown renderer.',
77
- ]}
78
- whenNotToUse={[
79
- 'For trusted, authored content with rich structure such as headings, lists, or code blocks; use a full markdown component.',
80
- 'For static UI copy that needs no formatting; render the text directly.',
81
- ]}
82
- doNotes={[
83
- 'Use the inline variant when the text sits inside a sentence, list item, or compact label.',
84
- 'In release notes markdown, write list bullets as "- item text" in the source file; the parser strips the leading "- " and renders each item inside a list — do not repeat "- " inside the item string.',
85
- 'Wrap inline code with <code>…</code> or backticks (`…`); both render as monospace code.',
86
- ]}
87
- />
72
+ <DocsGuidance source={InteractiveContentGuidance} />
88
73
  <PageContentSection
89
74
  style={{ display: 'flex', flexDirection: 'column', gap: '1.5rem' }}
90
75
  >
@@ -1,4 +1,5 @@
1
1
  import { Kicker } from '#uilib/components/ui/Kicker';
2
+ import KickerGuidance from '#uilib/components/ui/Kicker/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 KickerPage() {
14
15
  subheader="Small eyebrow label that introduces a section or card."
15
16
  actions={<DocsHeaderActions />}
16
17
  />
17
- <DocsGuidance
18
- overview="Kicker is a small eyebrow label rendered above a heading, card, or section. It uses the 12px Manrope label style in sentence case with zero tracking; emphasis comes from weight, never from uppercase."
19
- whenToUse={[
20
- 'Above a heading or card to name the topic or category at a glance.',
21
- 'As the eyebrow line of a SignalCard or editorial block.',
22
- ]}
23
- whenNotToUse={[
24
- 'As a heading in its own right; pair it with a real heading element.',
25
- 'For interactive labels such as filters or status pills; use Chip instead.',
26
- ]}
27
- dontNotes={[
28
- 'Do not set kicker text in uppercase or small caps; keep sentence case.',
29
- 'Do not add letter-spacing; small text keeps zero tracking.',
30
- ]}
31
- />
18
+ <DocsGuidance source={KickerGuidance} />
32
19
  <PageContentSection
33
20
  style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}
34
21
  >
@@ -1,4 +1,5 @@
1
1
  import { Label } from '#uilib/components/ui/Label';
2
+ import LabelGuidance from '#uilib/components/ui/Label/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 LabelPage() {
14
15
  subheader="Form label."
15
16
  actions={<DocsHeaderActions />}
16
17
  />
17
- <DocsGuidance
18
- overview="Label is the styled form label used across the library. Link it to its control with htmlFor so clicking the label focuses the field and assistive technology announces it."
19
- whenToUse={[
20
- 'To caption any form control, including Input, Textarea, Select, Switch, and Checkbox.',
21
- 'Whenever a control needs an accessible name that is also visible on screen.',
22
- ]}
23
- whenNotToUse={[
24
- 'For section headings or general text; use heading elements or SectionHeader.',
25
- 'As inline helper or error text; labels name the field, they do not explain it.',
26
- ]}
27
- doNotes={[
28
- 'Keep labels short and descriptive, such as “Email address” rather than full sentences.',
29
- ]}
30
- />
18
+ <DocsGuidance source={LabelGuidance} />
31
19
  <PageContentSection>
32
20
  <Label htmlFor="x">Example label</Label>
33
21
  </PageContentSection>
@@ -1,4 +1,5 @@
1
1
  import { LabelWithId } from '#uilib/components/ui/LabelWithId';
2
+ import LabelWithIdGuidance from '#uilib/components/ui/LabelWithId/AGENT.md';
2
3
  import { PageContentSection } from '#uilib/components/ui/Page';
3
4
 
4
5
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
@@ -14,16 +15,7 @@ export default function LabelWithIdPage() {
14
15
  subheader="Label with stable id for anchors."
15
16
  actions={<DocsHeaderActions />}
16
17
  />
17
- <DocsGuidance
18
- overview="LabelWithId renders a text label preceded by a small numeric id badge, giving entities such as analyses a stable, scannable reference. Passing an id of -1 hides the badge and shows the label alone."
19
- whenToUse={[
20
- 'To display entities that users reference by number, such as analyses or saved items.',
21
- 'In lists, selectors, or breadcrumbs where the id helps users match items across views.',
22
- ]}
23
- whenNotToUse={[
24
- 'For plain text that has no meaningful numeric identifier; use ordinary text or Label.',
25
- ]}
26
- />
18
+ <DocsGuidance source={LabelWithIdGuidance} />
27
19
  <PageContentSection>
28
20
  <LabelWithId id={42} label="Analysis label" />
29
21
  </PageContentSection>
@@ -1,5 +1,6 @@
1
1
  import { useState } from 'react';
2
2
 
3
+ import LabeledInputGuidance from '#uilib/components/ui/LabeledInput/AGENT.md';
3
4
  import { LabeledInput } from '#uilib/components/ui/LabeledInput/LabeledInput';
4
5
  import { PageContentSection } from '#uilib/components/ui/Page';
5
6
 
@@ -18,17 +19,7 @@ export default function LabeledInputPage() {
18
19
  subheader="Label + input row."
19
20
  actions={<DocsHeaderActions />}
20
21
  />
21
- <DocsGuidance
22
- overview="LabeledInput combines a Label and an Input into a single row, wiring the label to the field automatically via the id you provide. It accepts the usual input props such as name, value, onChange, and placeholder."
23
- whenToUse={[
24
- 'For standard form fields where every input needs a visible, associated label.',
25
- 'To keep label and input markup consistent across forms without repeating the wiring.',
26
- ]}
27
- whenNotToUse={[
28
- 'When the field needs a custom layout, helper text, or validation message; compose Label and Input directly.',
29
- 'For non-text controls such as switches or selects, which have their own labelling patterns.',
30
- ]}
31
- />
22
+ <DocsGuidance source={LabeledInputGuidance} />
32
23
  <PageContentSection>
33
24
  <LabeledInput
34
25
  id="labeled-docs"
@@ -1,4 +1,5 @@
1
1
  import { LegacyPlatformLink } from '#uilib/components/ui/LegacyPlatformLink';
2
+ import LegacyPlatformLinkGuidance from '#uilib/components/ui/LegacyPlatformLink/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 LegacyPlatformLinkPage() {
14
15
  subheader="Link styled for legacy platform navigation."
15
16
  actions={<DocsHeaderActions />}
16
17
  />
17
- <DocsGuidance
18
- overview="LegacyPlatformLink is an anchor that points at the legacy platform, building the destination from the API domain plus the redirectPath you supply. It renders as a styled link and accepts standard anchor props."
19
- whenToUse={[
20
- 'To send users to a screen that still lives on the legacy platform, such as older dashboards.',
21
- 'During migration, where some destinations exist only in the legacy product.',
22
- ]}
23
- whenNotToUse={[
24
- 'For navigation within the current app; use the router link components instead.',
25
- 'Once the destination has been migrated; replace the legacy link with an in-app route.',
26
- ]}
27
- doNotes={[
28
- 'Pass only the path portion in redirectPath, such as /v1/dashboard; the domain is added for you.',
29
- ]}
30
- />
18
+ <DocsGuidance source={LegacyPlatformLinkGuidance} />
31
19
  <PageContentSection>
32
20
  <LegacyPlatformLink redirectPath="/v1/dashboard">
33
21
  Legacy platform link