@sybilion/uilib 1.3.105 → 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 (193) 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/Page/PageColumns/PageColumns.js +2 -2
  10. package/dist/esm/components/ui/Page/PageColumns/PageColumns.styl.js +2 -2
  11. package/dist/esm/types/src/components/ui/Chart/Chart.example.d.ts +1 -0
  12. package/dist/esm/types/src/components/ui/Page/PageColumns/PageColumns.d.ts +10 -3
  13. package/dist/esm/types/src/docs/agent-guidance/agent-md-utils.d.ts +10 -0
  14. package/dist/esm/types/src/docs/components/DocsGuidance/DocsGuidance.d.ts +3 -12
  15. package/package.json +1 -1
  16. package/src/components/ui/AnalysesSelector/AGENT.md +16 -0
  17. package/src/components/ui/AnalysisLineIcon/AGENT.md +11 -0
  18. package/src/components/ui/AppHeader/AGENT.md +16 -0
  19. package/src/components/ui/Avatar/AGENT.md +15 -0
  20. package/src/components/ui/Badge/AGENT.md +16 -0
  21. package/src/components/ui/BarChart/AGENT.md +16 -0
  22. package/src/components/ui/Breadcrumb/AGENT.md +15 -0
  23. package/src/components/ui/Button/AGENT.md +17 -0
  24. package/src/components/ui/Card/AGENT.md +16 -0
  25. package/src/components/ui/Chart/AGENT.md +18 -0
  26. package/src/components/ui/Chart/Chart.example.tsx +37 -0
  27. package/src/components/ui/ChartAreaInteractive/AGENT.md +24 -8
  28. package/src/components/ui/Chat/AGENT.md +15 -0
  29. package/src/components/ui/Checkbox/AGENT.md +16 -0
  30. package/src/components/ui/Chip/AGENT.md +18 -0
  31. package/src/components/ui/Confirm/AGENT.md +15 -0
  32. package/src/components/ui/Dialog/AGENT.md +15 -0
  33. package/src/components/ui/DonutChart/AGENT.md +15 -0
  34. package/src/components/ui/Drawer/AGENT.md +17 -0
  35. package/src/components/ui/DropZone/AGENT.md +16 -0
  36. package/src/components/ui/DropdownMenu/AGENT.md +16 -0
  37. package/src/components/ui/FileChip/AGENT.md +17 -0
  38. package/src/components/ui/FlickeringGrid/AGENT.md +15 -0
  39. package/src/components/ui/Foldable/AGENT.md +16 -0
  40. package/src/components/ui/GridLayout/AGENT.md +17 -0
  41. package/src/components/ui/Image/AGENT.md +16 -0
  42. package/src/components/ui/ImageWithFallback/AGENT.md +15 -0
  43. package/src/components/ui/Input/AGENT.md +16 -0
  44. package/src/components/ui/InteractiveContent/AGENT.md +21 -0
  45. package/src/components/ui/Kicker/AGENT.md +16 -0
  46. package/src/components/ui/Label/AGENT.md +15 -0
  47. package/src/components/ui/LabelWithId/AGENT.md +10 -0
  48. package/src/components/ui/LabeledInput/AGENT.md +11 -0
  49. package/src/components/ui/LegacyPlatformLink/AGENT.md +15 -0
  50. package/src/components/ui/Logo/AGENT.md +15 -0
  51. package/src/components/ui/MobileAdaptiveSelector/AGENT.md +15 -0
  52. package/src/components/ui/NavUserHeader/AGENT.md +15 -0
  53. package/src/components/ui/NumberControl/AGENT.md +15 -0
  54. package/src/components/ui/Page/AGENT.md +20 -7
  55. package/src/components/ui/Page/PageColumns/PageColumns.styl +5 -5
  56. package/src/components/ui/Page/PageColumns/PageColumns.styl.d.ts +3 -3
  57. package/src/components/ui/Page/PageColumns/PageColumns.tsx +11 -16
  58. package/src/components/ui/Sheet/AGENT.md +15 -0
  59. package/src/components/ui/SignalCard/AGENT.md +16 -0
  60. package/src/components/ui/Switch/AGENT.md +15 -0
  61. package/src/components/ui/Tooltip/AGENT.md +17 -0
  62. package/src/components/widgets/DriverMap/AGENT.md +27 -8
  63. package/src/components/widgets/DriversComparisonChart/AGENT.md +27 -13
  64. package/src/components/widgets/PerformanceChart/AGENT.md +23 -8
  65. package/src/declarations.d.ts +5 -0
  66. package/src/docs/agent-guidance/agent-md-utils.ts +48 -0
  67. package/src/docs/agent-guidance/chat-attachments-dropzone.md +15 -0
  68. package/src/docs/agent-guidance/chat-composer-prefill.md +15 -0
  69. package/src/docs/agent-guidance/chat-sheet.md +14 -0
  70. package/src/docs/agent-guidance/chat-slash-commands.md +15 -0
  71. package/src/docs/agent-guidance/chat-user-csv-attachment.md +14 -0
  72. package/src/docs/agent-guidance/colors.md +10 -0
  73. package/src/docs/agent-guidance/icons.md +11 -0
  74. package/src/docs/agent-guidance/lightweight-forecast-chart.md +17 -0
  75. package/src/docs/agent-guidance/motion.md +10 -0
  76. package/src/docs/agent-guidance/page-columns.md +19 -0
  77. package/src/docs/agent-guidance/page-footer.md +15 -0
  78. package/src/docs/agent-guidance/page-tabs.md +19 -0
  79. package/src/docs/agent-guidance/page.md +15 -0
  80. package/src/docs/agent-guidance/progress.md +11 -0
  81. package/src/docs/agent-guidance/pull-quote.md +15 -0
  82. package/src/docs/agent-guidance/radii-shadows.md +10 -0
  83. package/src/docs/agent-guidance/region-coords.md +11 -0
  84. package/src/docs/agent-guidance/renamer.md +15 -0
  85. package/src/docs/agent-guidance/select.md +15 -0
  86. package/src/docs/agent-guidance/separator.md +11 -0
  87. package/src/docs/agent-guidance/sidebar-datasets-items-grouped.md +11 -0
  88. package/src/docs/agent-guidance/sidebar.md +15 -0
  89. package/src/docs/agent-guidance/skeleton.md +16 -0
  90. package/src/docs/agent-guidance/slider.md +16 -0
  91. package/src/docs/agent-guidance/smart-text-truncate.md +11 -0
  92. package/src/docs/agent-guidance/spacing.md +10 -0
  93. package/src/docs/agent-guidance/sparkline.md +15 -0
  94. package/src/docs/agent-guidance/standalone-app-layout.md +16 -0
  95. package/src/docs/agent-guidance/sybilion-auth-layout.md +15 -0
  96. package/src/docs/agent-guidance/table.md +17 -0
  97. package/src/docs/agent-guidance/tabs.md +21 -0
  98. package/src/docs/agent-guidance/text-shimmer.md +11 -0
  99. package/src/docs/agent-guidance/text-with-defer-tooltip.md +15 -0
  100. package/src/docs/agent-guidance/time-range-controls.md +15 -0
  101. package/src/docs/agent-guidance/toggle-group.md +15 -0
  102. package/src/docs/agent-guidance/toggle.md +15 -0
  103. package/src/docs/agent-guidance/typography.md +10 -0
  104. package/src/docs/agent-guidance/vimeo-embed.md +11 -0
  105. package/src/docs/agent-guidance/world-map.md +11 -0
  106. package/src/docs/components/DocsGuidance/DocsGuidance.styl +26 -25
  107. package/src/docs/components/DocsGuidance/DocsGuidance.styl.d.ts +1 -4
  108. package/src/docs/components/DocsGuidance/DocsGuidance.tsx +9 -44
  109. package/src/docs/config/webpack.config.js +6 -1
  110. package/src/docs/pages/AnalysesSelectorPage.tsx +6 -17
  111. package/src/docs/pages/AnalysisLineIconPage.tsx +2 -11
  112. package/src/docs/pages/AvatarPage.tsx +2 -14
  113. package/src/docs/pages/BadgePage.tsx +2 -15
  114. package/src/docs/pages/BarChartPage.tsx +2 -15
  115. package/src/docs/pages/BreadcrumbPage.tsx +2 -14
  116. package/src/docs/pages/ButtonPage.tsx +2 -16
  117. package/src/docs/pages/CardPage.tsx +5 -18
  118. package/src/docs/pages/ChartAreaInteractivePage.tsx +2 -15
  119. package/src/docs/pages/ChartPage.tsx +4 -47
  120. package/src/docs/pages/ChatAttachmentsDropzonePage.tsx +2 -14
  121. package/src/docs/pages/ChatComposerPrefillPage.tsx +2 -14
  122. package/src/docs/pages/ChatPage.tsx +2 -14
  123. package/src/docs/pages/ChatSheetPage.tsx +2 -13
  124. package/src/docs/pages/ChatSlashCommandsPage.tsx +2 -14
  125. package/src/docs/pages/ChatUserCsvAttachmentPage.tsx +2 -13
  126. package/src/docs/pages/CheckboxPage.tsx +2 -15
  127. package/src/docs/pages/ChipPage.tsx +2 -17
  128. package/src/docs/pages/ColorsPage.tsx +2 -10
  129. package/src/docs/pages/ConfirmPage.tsx +2 -14
  130. package/src/docs/pages/DialogPage.tsx +2 -14
  131. package/src/docs/pages/DonutChartPage.tsx +2 -14
  132. package/src/docs/pages/DrawerPage.tsx +2 -16
  133. package/src/docs/pages/DriverMapPage.tsx +2 -16
  134. package/src/docs/pages/DriversComparisonChartPage.tsx +2 -16
  135. package/src/docs/pages/DropZonePage.tsx +2 -15
  136. package/src/docs/pages/DropdownMenuPage.tsx +2 -15
  137. package/src/docs/pages/FileChipPage.tsx +2 -16
  138. package/src/docs/pages/FlickeringGridPage.tsx +2 -14
  139. package/src/docs/pages/FoldablePage.tsx +2 -15
  140. package/src/docs/pages/GridLayoutPage.tsx +2 -15
  141. package/src/docs/pages/IconsPage.tsx +2 -11
  142. package/src/docs/pages/ImagePage.tsx +2 -15
  143. package/src/docs/pages/ImageWithFallbackPage.tsx +2 -14
  144. package/src/docs/pages/IncludeHiddenInYScalePage.tsx +2 -13
  145. package/src/docs/pages/InputPage.tsx +2 -15
  146. package/src/docs/pages/InteractiveContentPage.tsx +2 -17
  147. package/src/docs/pages/KickerPage.tsx +2 -15
  148. package/src/docs/pages/LabelPage.tsx +2 -14
  149. package/src/docs/pages/LabelWithIdPage.tsx +2 -10
  150. package/src/docs/pages/LabeledInputPage.tsx +2 -11
  151. package/src/docs/pages/LegacyPlatformLinkPage.tsx +2 -14
  152. package/src/docs/pages/LightweightChartPage.tsx +2 -16
  153. package/src/docs/pages/LogoPage.tsx +2 -14
  154. package/src/docs/pages/MobileAdaptiveSelectorPage.tsx +2 -14
  155. package/src/docs/pages/MotionPage.tsx +2 -10
  156. package/src/docs/pages/NavUserHeaderPage.tsx +2 -14
  157. package/src/docs/pages/NumberControlPage.tsx +2 -14
  158. package/src/docs/pages/PageColumnsPage.tsx +40 -17
  159. package/src/docs/pages/PageFooterPage.tsx +2 -14
  160. package/src/docs/pages/PagePage.tsx +2 -14
  161. package/src/docs/pages/PageTabsPage.tsx +2 -17
  162. package/src/docs/pages/PerformanceChartPage.tsx +2 -14
  163. package/src/docs/pages/ProgressPage.tsx +2 -11
  164. package/src/docs/pages/PullQuotePage.tsx +2 -14
  165. package/src/docs/pages/RadiiShadowsPage.tsx +2 -10
  166. package/src/docs/pages/RegionCoordsPage.tsx +2 -11
  167. package/src/docs/pages/RenamerPage.tsx +2 -14
  168. package/src/docs/pages/SelectPage.tsx +2 -14
  169. package/src/docs/pages/SeparatorPage.tsx +2 -11
  170. package/src/docs/pages/SheetPage.tsx +2 -14
  171. package/src/docs/pages/SidebarDatasetsItemsGroupedPage.tsx +2 -11
  172. package/src/docs/pages/SidebarPage.tsx +2 -14
  173. package/src/docs/pages/SignalCardPage.tsx +2 -15
  174. package/src/docs/pages/SkeletonPage.tsx +2 -15
  175. package/src/docs/pages/SliderPage.tsx +2 -15
  176. package/src/docs/pages/SmartTextTruncatePage.tsx +2 -11
  177. package/src/docs/pages/SpacingPage.tsx +2 -10
  178. package/src/docs/pages/SparklinePage.tsx +2 -14
  179. package/src/docs/pages/StandaloneAppLayoutPage/StandaloneAppLayoutPage.tsx +2 -15
  180. package/src/docs/pages/SwitchPage.tsx +2 -14
  181. package/src/docs/pages/SybilionAuthLayoutPage.tsx +2 -14
  182. package/src/docs/pages/TablePage.tsx +2 -15
  183. package/src/docs/pages/TabsPage.tsx +2 -19
  184. package/src/docs/pages/TextShimmerPage.tsx +2 -11
  185. package/src/docs/pages/TextWithDeferTooltipPage.tsx +2 -14
  186. package/src/docs/pages/TimeRangeControlsPage.tsx +2 -14
  187. package/src/docs/pages/ToggleGroupPage.tsx +2 -14
  188. package/src/docs/pages/TogglePage.tsx +2 -12
  189. package/src/docs/pages/TooltipPage.tsx +2 -16
  190. package/src/docs/pages/TypographyPage.tsx +2 -10
  191. package/src/docs/pages/VimeoEmbedPage.tsx +2 -11
  192. package/src/docs/pages/WorldMapPage.tsx +2 -11
  193. package/src/components/widgets/AGENT.md +0 -21
@@ -1,4 +1,5 @@
1
1
  import { Button } from '#uilib/components/ui/Button';
2
+ import ButtonGuidance from '#uilib/components/ui/Button/AGENT.md';
2
3
  import type { ButtonVariant } from '#uilib/components/ui/Button/Button.types';
3
4
  import { PageContentSection } from '#uilib/components/ui/Page';
4
5
  import { Plus } from 'lucide-react';
@@ -27,22 +28,7 @@ export default function ButtonPage() {
27
28
  subheader="Variants, sizes, icon mode, and disabled state."
28
29
  actions={<DocsHeaderActions />}
29
30
  />
30
- <DocsGuidance
31
- overview="Buttons trigger an action or event, such as submitting a form or confirming a dialog. Choose a variant that matches the weight of the action: default for the primary action, secondary or outline for supporting actions, ghost for low-emphasis actions, and destructive for irreversible ones."
32
- whenToUse={[
33
- 'To trigger an immediate action, such as saving, submitting, or confirming.',
34
- 'To open a dialog, drawer, or other transient surface.',
35
- 'As the primary call to action in a form, card, or empty state.',
36
- ]}
37
- whenNotToUse={[
38
- 'To navigate to another page; use a link or the link variant instead.',
39
- 'To switch between mutually exclusive options; use Tabs, Toggle, or ToggleGroup.',
40
- ]}
41
- doNotes={[
42
- 'Use one default-variant button per view so the primary action stays clear.',
43
- 'Label buttons with a verb that describes the action, such as “Save changes”.',
44
- ]}
45
- />
31
+ <DocsGuidance source={ButtonGuidance} />
46
32
  <PageContentSection
47
33
  style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}
48
34
  >
@@ -1,3 +1,4 @@
1
+ import { Button } from '#uilib/components/ui/Button';
1
2
  import {
2
3
  Card,
3
4
  CardContent,
@@ -7,13 +8,13 @@ import {
7
8
  CardTitle,
8
9
  LinkCard,
9
10
  } from '#uilib/components/ui/Card';
11
+ import CardGuidance from '#uilib/components/ui/Card/AGENT.md';
12
+ import { PageContentSection } from '#uilib/components/ui/Page';
13
+ import { PackageIcon } from '@phosphor-icons/react';
10
14
 
11
15
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
12
- import { Button } from '#uilib/components/ui/Button';
13
16
  import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
14
17
  import { DocsHeaderActions } from '../docsHeaderActions';
15
- import { PackageIcon } from '@phosphor-icons/react';
16
- import { PageContentSection } from '#uilib/components/ui/Page';
17
18
 
18
19
  const PADDING_SIZES = ['s', 'm', 'l'] as const;
19
20
  const RADIUS_SIZES = ['s', 'm', 'l', 'xl'] as const;
@@ -29,21 +30,7 @@ export default function CardPage() {
29
30
  subheader="Padding and radius sizes, slot compositions, and link card."
30
31
  actions={<DocsHeaderActions />}
31
32
  />
32
- <DocsGuidance
33
- overview="Card groups related content and actions into a single bounded container with optional header, content, and footer slots. The header supports an icon, title, and description; the footer typically holds actions."
34
- whenToUse={[
35
- 'To group a self-contained piece of content, such as a summary, setting, or entity.',
36
- 'In grid dashboards where each tile presents one unit of information.',
37
- 'When content needs a clear visual boundary from its surroundings.',
38
- ]}
39
- whenNotToUse={[
40
- 'To wrap an entire page; use the page layout primitives instead.',
41
- 'For long, flowing text that does not need a boundary.',
42
- ]}
43
- doNotes={[
44
- 'Keep one primary action per card and place it in the footer.',
45
- ]}
46
- />
33
+ <DocsGuidance source={CardGuidance} />
47
34
  <PageContentSection
48
35
  style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}
49
36
  >
@@ -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 {
5
6
  ChartDataPoint,
6
7
  OverlayMode,
@@ -149,21 +150,7 @@ export default function ChartAreaInteractivePage() {
149
150
  subheader="Interactive area chart shell with time range controls."
150
151
  actions={<DocsHeaderActions />}
151
152
  />
152
- <DocsGuidance
153
- overview="ChartAreaInteractive is the full chart shell for time series data, combining an area chart with a time range selector, a legend with series toggles, and optional forecast overlays. Overlay modes add month pinning, quantile interval bands, or threshold controls on top of the base chart."
154
- whenToUse={[
155
- 'To present historical and forecast series together with built-in time range filtering.',
156
- 'When users need to toggle series visibility, pin a month, or inspect quantile intervals and thresholds.',
157
- 'As the main visualisation on an analysis or dataset page.',
158
- ]}
159
- whenNotToUse={[
160
- 'For a simple static chart without controls; compose ChartContainer with Recharts directly.',
161
- 'For non-temporal data such as categorical comparisons.',
162
- ]}
163
- doNotes={[
164
- 'Pass loading while data is being fetched so the chart shows its skeleton state.',
165
- ]}
166
- />
153
+ <DocsGuidance source={ChartAreaInteractiveGuidance} />
167
154
  <PageContentSection>
168
155
  <Tabs
169
156
  value={demoMode}
@@ -1,23 +1,10 @@
1
- import { ChartContainer } from '#uilib/components/ui/Chart';
2
- import type { ChartConfig } from '#uilib/components/ui/Chart';
3
- import { PageContentSection } from '#uilib/components/ui/Page';
4
- import { CartesianGrid, Line, LineChart, XAxis, YAxis } from 'recharts';
1
+ import ChartGuidance from '#uilib/components/ui/Chart/AGENT.md';
2
+ import { ChartExample } from '#uilib/components/ui/Chart/Chart.example';
5
3
 
6
4
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
7
5
  import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
8
6
  import { DocsHeaderActions } from '../docsHeaderActions';
9
7
 
10
- const DATA = [
11
- { month: 'Jan', v: 12 },
12
- { month: 'Feb', v: 18 },
13
- { month: 'Mar', v: 15 },
14
- { month: 'Apr', v: 22 },
15
- ];
16
-
17
- const config = {
18
- v: { label: 'Value', color: 'hsl(var(--chart-1))' },
19
- } satisfies ChartConfig;
20
-
21
8
  export default function ChartPage() {
22
9
  return (
23
10
  <>
@@ -27,38 +14,8 @@ export default function ChartPage() {
27
14
  subheader="ChartContainer + Recharts line chart."
28
15
  actions={<DocsHeaderActions />}
29
16
  />
30
- <DocsGuidance
31
- overview="ChartContainer wraps Recharts charts with the library’s theming, mapping a ChartConfig of labels and colours onto CSS variables. Compose any Recharts chart inside it and reference series colours via var(--color-<key>)."
32
- whenToUse={[
33
- 'To build bespoke line, bar, or area charts that follow the design system palette.',
34
- 'When you need full control over Recharts composition but consistent theming.',
35
- ]}
36
- whenNotToUse={[
37
- 'For the standard time series experience with range controls and overlays; use ChartAreaInteractive.',
38
- ]}
39
- doNotes={[
40
- 'Define every series in the ChartConfig so labels and colours stay consistent across tooltips and legends.',
41
- ]}
42
- />
43
- <PageContentSection>
44
- <ChartContainer
45
- config={config}
46
- style={{ minHeight: 240, width: '100%' }}
47
- >
48
- <LineChart data={DATA} accessibilityLayer>
49
- <CartesianGrid vertical={false} />
50
- <XAxis dataKey="month" tickLine={false} axisLine={false} />
51
- <YAxis tickLine={false} axisLine={false} width={32} />
52
- <Line
53
- dataKey="v"
54
- type="natural"
55
- stroke="var(--color-chart-1)"
56
- strokeWidth={2}
57
- dot={false}
58
- />
59
- </LineChart>
60
- </ChartContainer>
61
- </PageContentSection>
17
+ <DocsGuidance source={ChartGuidance} />
18
+ <ChartExample />
62
19
  </>
63
20
  );
64
21
  }
@@ -8,6 +8,7 @@ import {
8
8
  TEXT_ATTACHMENT_ACCEPT_PARTS,
9
9
  } from '#uilib/components/ui/Chat';
10
10
  import { PageContentSection } from '#uilib/components/ui/Page';
11
+ import chatAttachmentsDropzoneGuidance from '#uilib/docs/agent-guidance/chat-attachments-dropzone.md';
11
12
  import { ScrollRef } from '@homecode/ui';
12
13
 
13
14
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
@@ -101,20 +102,7 @@ export default function ChatAttachmentsDropzonePage() {
101
102
  subheader="Drop text, Office, or PDF files onto the chat shell; they appear on the prompt until you send."
102
103
  actions={<DocsHeaderActions />}
103
104
  />
104
- <DocsGuidance
105
- overview="ChatChrome supports a file dropzone: users drag text, Office, or PDF files onto the chat panel and the parsed content attaches to the prompt until they send. Configure accepted types via allowedAttachments and enable PDFs with allowPdfAttachments."
106
- whenToUse={[
107
- 'When users need to give the assistant file context, such as CSV data or documents.',
108
- 'When attached files should be reviewed alongside the typed prompt before sending.',
109
- ]}
110
- whenNotToUse={[
111
- 'For persistent file uploads to storage; use a dedicated upload flow.',
112
- 'When only plain text input is expected; omit the attachment props to disable the dropzone.',
113
- ]}
114
- doNotes={[
115
- 'Office and PDF parsers load on demand, so the first attachment of those types incurs a one-off load.',
116
- ]}
117
- />
105
+ <DocsGuidance source={chatAttachmentsDropzoneGuidance} />
118
106
  <PageContentSection>
119
107
  <p style={{ marginBottom: 16, fontSize: 14, lineHeight: 1.5 }}>
120
108
  Drop a <code>.txt</code>, <code>.csv</code>, <code>.md</code>,{' '}
@@ -8,6 +8,7 @@ import {
8
8
  MessageRole,
9
9
  } from '#uilib/components/ui/Chat';
10
10
  import { PageContentSection } from '#uilib/components/ui/Page';
11
+ import chatComposerPrefillGuidance from '#uilib/docs/agent-guidance/chat-composer-prefill.md';
11
12
  import { ScrollRef } from '@homecode/ui';
12
13
  import { MessageSquare } from 'lucide-react';
13
14
 
@@ -110,20 +111,7 @@ export default function ChatComposerPrefillPage() {
110
111
  />
111
112
  }
112
113
  />
113
- <DocsGuidance
114
- overview="The chat composer can be prefilled without auto-sending: pass promptPrefill to ChatChrome, call ChatSheetActions.openNewChatWithPrefill for the portal sheet, or use a ?prompt= deep link. Focus lands at the end of the text so users can edit before submitting."
115
- whenToUse={[
116
- 'To seed the composer from a call to action, such as a suggested question on a dataset page.',
117
- 'To deep link into the product with a prepared prompt via ?prompt=.',
118
- 'When opening a new chat session that should start from a template prompt.',
119
- ]}
120
- whenNotToUse={[
121
- 'To send a message automatically on behalf of the user; prefill never submits.',
122
- ]}
123
- doNotes={[
124
- 'Keep prefilled text short and editable; it is a starting point, not a command.',
125
- ]}
126
- />
114
+ <DocsGuidance source={chatComposerPrefillGuidance} />
127
115
  <PageContentSection>
128
116
  <p style={{ marginBottom: 12, fontSize: 14, lineHeight: 1.5 }}>
129
117
  After prefill, the composer receives focus at the end of the text so
@@ -1,4 +1,5 @@
1
1
  import { ChatChrome, useChatPanelChromeModel } from '#uilib/components/ui/Chat';
2
+ import ChatGuidance from '#uilib/components/ui/Chat/AGENT.md';
2
3
  import { PageContentSection } from '#uilib/components/ui/Page';
3
4
 
4
5
  import {
@@ -36,20 +37,7 @@ export default function ChatPage() {
36
37
  subheader={`Chat shell with message list, prompt, and dataset-scoped preset bubbles for "${DOCS_SAMPLE_DATASET_NAME}".`}
37
38
  actions={<DocsHeaderActions presets={DOCS_DATASET_PRESETS} />}
38
39
  />
39
- <DocsGuidance
40
- overview="ChatChrome is the complete chat shell: message list, prompt composer, empty state, and optional preset bubbles. Drive it with useChatPanelChromeModel for a self-contained session, or wire the props manually for full control."
41
- whenToUse={[
42
- 'To embed an assistant conversation inline on a page or in a side panel.',
43
- 'When you want preset prompt chips scoped to the current dataset or context.',
44
- ]}
45
- whenNotToUse={[
46
- 'For a single one-off prompt without conversation history; a simple form may suffice.',
47
- 'For notification or activity feeds; the shell is designed for two-way conversation.',
48
- ]}
49
- doNotes={[
50
- 'Provide a meaningful emptyState title and description so the first-run view explains what the assistant can do.',
51
- ]}
52
- />
40
+ <DocsGuidance source={ChatGuidance} />
53
41
  <PageContentSection>
54
42
  <p style={{ marginBottom: 16, fontSize: 14, lineHeight: 1.5 }}>
55
43
  Preset chips render above the prompt in the empty state (fixed layout)
@@ -1,5 +1,6 @@
1
1
  import type { SlashCommandItem } from '#uilib/components/ui/Chat';
2
2
  import { PageContentSection } from '#uilib/components/ui/Page';
3
+ import chatSheetGuidance from '#uilib/docs/agent-guidance/chat-sheet.md';
3
4
  import { MessageSquare } from 'lucide-react';
4
5
 
5
6
  import {
@@ -41,19 +42,7 @@ export default function ChatSheetPage() {
41
42
  />
42
43
  }
43
44
  />
44
- <DocsGuidance
45
- overview="ChatSheet places the chat panel behind a trigger in the page header and portals it into the shell chat slot, matching the app dataset page integration. Presets, slash commands, and the empty state are passed through to the underlying chat shell."
46
- whenToUse={[
47
- 'When chat is a secondary tool on the page and should open on demand from the header.',
48
- 'To reuse one assistant entry point across pages with page-scoped presets.',
49
- ]}
50
- whenNotToUse={[
51
- 'When the conversation is the primary content of the page; embed ChatChrome inline instead.',
52
- ]}
53
- doNotes={[
54
- 'Give each page its own scopeId so chat sessions do not leak between contexts.',
55
- ]}
56
- />
45
+ <DocsGuidance source={chatSheetGuidance} />
57
46
  <PageContentSection>
58
47
  <p style={{ marginBottom: 16, fontSize: 14, lineHeight: 1.5 }}>
59
48
  Open <strong>AI Assistant</strong> in the header. Presets render below
@@ -8,6 +8,7 @@ import {
8
8
  type SlashCommandItem,
9
9
  } from '#uilib/components/ui/Chat';
10
10
  import { PageContentSection } from '#uilib/components/ui/Page';
11
+ import chatSlashCommandsGuidance from '#uilib/docs/agent-guidance/chat-slash-commands.md';
11
12
  import { ScrollRef } from '@homecode/ui';
12
13
 
13
14
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
@@ -98,20 +99,7 @@ export default function ChatSlashCommandsPage() {
98
99
  subheader={`Slash palette uses TipTap Mention with "/" as the trigger. Pass slashCommandItems from the app — each item inserts an inline mention chip by default. Optional className and color on SlashCommandItem style the chip in the composer.`}
99
100
  actions={<DocsHeaderActions slashCommandItems={DOCS_SLASH_ITEMS} />}
100
101
  />
101
- <DocsGuidance
102
- overview="The chat composer supports a slash command palette built on TipTap mentions: typing / at the start of a line or after a space opens a picker, and choosing an item inserts an inline mention chip. Supply items through slashCommandItems; optional className and color style each chip."
103
- whenToUse={[
104
- 'To expose a small set of named commands users can invoke from the composer.',
105
- 'When commands should read as part of the message, such as /generate-report.',
106
- ]}
107
- whenNotToUse={[
108
- 'For long or hierarchical command sets; the palette works best with a handful of items.',
109
- 'For primary actions that deserve a visible button outside the composer.',
110
- ]}
111
- doNotes={[
112
- 'Keep command ids stable, since plain-text sends fall back to the item id.',
113
- ]}
114
- />
102
+ <DocsGuidance source={chatSlashCommandsGuidance} />
115
103
  <PageContentSection>
116
104
  <p style={{ marginBottom: 16, fontSize: 14, lineHeight: 1.5 }}>
117
105
  Same{' '}
@@ -7,6 +7,7 @@ import {
7
7
  MessageRole,
8
8
  } from '#uilib/components/ui/Chat';
9
9
  import { PageContentSection } from '#uilib/components/ui/Page';
10
+ import chatUserCsvAttachmentGuidance from '#uilib/docs/agent-guidance/chat-user-csv-attachment.md';
10
11
  import { ScrollRef } from '@homecode/ui';
11
12
 
12
13
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
@@ -126,19 +127,7 @@ export default function ChatUserCsvAttachmentPage() {
126
127
  subheader="USER bubble with separate downloadable CSV row (dashboard preset pattern)."
127
128
  actions={<DocsHeaderActions />}
128
129
  />
129
- <DocsGuidance
130
- overview="User messages can carry downloadable text file attachments via userTextFileAttachments: the bubble shows the message text with a separate file row beneath it, matching the dashboard preset pattern. Users can download the attached file from that row."
131
- whenToUse={[
132
- 'When a preset or automated flow sends data, such as a CSV extract, on the user’s behalf.',
133
- 'To keep generated file context visible and retrievable in the conversation history.',
134
- ]}
135
- whenNotToUse={[
136
- 'For user-initiated uploads; use the attachments dropzone instead.',
137
- ]}
138
- doNotes={[
139
- 'Give each attachment a readable displayName so the file row makes sense out of context.',
140
- ]}
141
- />
130
+ <DocsGuidance source={chatUserCsvAttachmentGuidance} />
142
131
  <PageContentSection>
143
132
  <p style={{ marginBottom: 16 }}>
144
133
  <Button
@@ -1,4 +1,5 @@
1
1
  import { Checkbox } from '#uilib/components/ui/Checkbox';
2
+ import CheckboxGuidance from '#uilib/components/ui/Checkbox/AGENT.md';
2
3
  import { Label } from '#uilib/components/ui/Label';
3
4
  import { PageContentSection } from '#uilib/components/ui/Page';
4
5
 
@@ -15,21 +16,7 @@ export default function CheckboxPage() {
15
16
  subheader="Binary control for selecting an option."
16
17
  actions={<DocsHeaderActions />}
17
18
  />
18
- <DocsGuidance
19
- overview="Checkbox is a binary control for selecting or deselecting an option. Pair it with a Label linked via htmlFor so the text is clickable and announced by assistive technology."
20
- whenToUse={[
21
- 'For independent on or off options in forms and settings.',
22
- 'To select multiple items from a list.',
23
- 'To record agreement, such as accepting terms.',
24
- ]}
25
- whenNotToUse={[
26
- 'For an action that takes effect immediately; use Switch instead.',
27
- 'For mutually exclusive choices; use RadioGroup.',
28
- ]}
29
- doNotes={[
30
- 'Write labels positively, such as “Send notifications” rather than “Do not send notifications”.',
31
- ]}
32
- />
19
+ <DocsGuidance source={CheckboxGuidance} />
33
20
  <PageContentSection
34
21
  style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}
35
22
  >
@@ -1,5 +1,6 @@
1
1
  import { Chip } from '#uilib/components/ui/Chip';
2
2
  import type { ChipVariant } from '#uilib/components/ui/Chip';
3
+ import ChipGuidance from '#uilib/components/ui/Chip/AGENT.md';
3
4
  import { PageContentSection } from '#uilib/components/ui/Page';
4
5
 
5
6
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
@@ -25,23 +26,7 @@ export default function ChipPage() {
25
26
  subheader="Status and delta capsule with filter, accent, and trend variants."
26
27
  actions={<DocsHeaderActions />}
27
28
  />
28
- <DocsGuidance
29
- overview="Chips are compact pill-shaped capsules for filters, status pills, version tags, and quantitative delta indicators. Unlike Badge, which stays general purpose, Chip carries status and delta semantics: the positive and negative variants sit outside the primary palette and are reserved for quantitative impact signals."
30
- whenToUse={[
31
- 'To present a row of filter options, with the active variant marking the current selection.',
32
- 'To flag live status, version tags, or deadlines with the neutral, accent, and filled variants.',
33
- 'To show a quantitative delta or impact direction with the positive or negative variant, optionally with a trend arrow.',
34
- ]}
35
- whenNotToUse={[
36
- 'For general-purpose labels without status or delta semantics; use Badge instead.',
37
- 'For file attachments; use FileChip.',
38
- 'As decoration; the status variants are reserved for quantitative signals only.',
39
- ]}
40
- doNotes={[
41
- 'Keep chip labels short and in sentence case.',
42
- 'Pair the positive and negative variants with a trend arrow or delta value so the direction reads at a glance.',
43
- ]}
44
- />
29
+ <DocsGuidance source={ChipGuidance} />
45
30
  <PageContentSection
46
31
  style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}
47
32
  >
@@ -1,4 +1,5 @@
1
1
  import { PageContentSection } from '#uilib/components/ui/Page';
2
+ import colorsGuidance from '#uilib/docs/agent-guidance/colors.md';
2
3
 
3
4
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
4
5
  import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
@@ -66,16 +67,7 @@ export default function ColorsPage() {
66
67
  subheader="Core --sb-* ramps and the semantic tokens built on top of them."
67
68
  actions={<DocsHeaderActions />}
68
69
  />
69
- <DocsGuidance
70
- overview="Colour is defined as a set of core ramps (--sb-cyan/purple/red/green/yellow/gray/slate) plus semantic tokens that map those ramps onto roles such as background, border, brand, and status. Components should reference semantic tokens first and reach for a raw ramp step only when no role fits."
71
- whenToUse={[
72
- 'Semantic tokens for surfaces, text, borders, and status colour in components.',
73
- 'Ramp steps for data visualisation or decorative accents where a specific hue is needed.',
74
- ]}
75
- whenNotToUse={[
76
- 'Hardcoded hex or oklch values in component styles; always go through a token.',
77
- ]}
78
- />
70
+ <DocsGuidance source={colorsGuidance} />
79
71
  <PageContentSection>
80
72
  <h3>Core ramps</h3>
81
73
  {RAMPS.map(({ family, tokens }) => (
@@ -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={{