@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
@@ -3,6 +3,7 @@ import {
3
3
  AvatarFallback,
4
4
  AvatarImage,
5
5
  } from '#uilib/components/ui/Avatar';
6
+ import AvatarGuidance from '#uilib/components/ui/Avatar/AGENT.md';
6
7
  import { PageContentSection } from '#uilib/components/ui/Page';
7
8
 
8
9
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
@@ -18,20 +19,7 @@ export default function AvatarPage() {
18
19
  subheader="Image with fallback initials."
19
20
  actions={<DocsHeaderActions />}
20
21
  />
21
- <DocsGuidance
22
- overview="Avatar displays a user or entity image with an automatic fallback to initials when the image is missing or fails to load. Compose it from AvatarImage and AvatarFallback."
23
- whenToUse={[
24
- 'To represent a person or account in headers, lists, comments, or menus.',
25
- 'When an image may be unavailable and a textual fallback is acceptable.',
26
- ]}
27
- whenNotToUse={[
28
- 'For arbitrary illustrative imagery; use a plain image instead.',
29
- 'To convey status on its own; pair it with a Badge or status indicator.',
30
- ]}
31
- doNotes={[
32
- 'Always provide an AvatarFallback with one or two initials so the component degrades gracefully.',
33
- ]}
34
- />
22
+ <DocsGuidance source={AvatarGuidance} />
35
23
  <PageContentSection
36
24
  style={{ display: 'flex', gap: '1rem', alignItems: 'center' }}
37
25
  >
@@ -1,4 +1,5 @@
1
1
  import { Badge } from '#uilib/components/ui/Badge';
2
+ import BadgeGuidance from '#uilib/components/ui/Badge/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 BadgePage() {
14
15
  subheader="Status and label badges."
15
16
  actions={<DocsHeaderActions />}
16
17
  />
17
- <DocsGuidance
18
- overview="Badges are compact labels that highlight a status, category, or count. Choose a variant that matches the meaning: default or outline for neutral labels, red and green for negative and positive states."
19
- whenToUse={[
20
- 'To show the status of an item, such as active, failed, or done.',
21
- 'To label or categorise content in lists, tables, and cards.',
22
- 'To surface short metadata next to a title.',
23
- ]}
24
- whenNotToUse={[
25
- 'For interactive actions; badges are not clickable, use Button instead.',
26
- 'For long descriptive text; keep badge labels to one or two words.',
27
- ]}
28
- doNotes={[
29
- 'Use colour variants consistently so a given colour always carries the same meaning across the product.',
30
- ]}
31
- />
18
+ <DocsGuidance source={BadgeGuidance} />
32
19
  <PageContentSection
33
20
  style={{ display: 'flex', flexWrap: 'wrap', gap: '0.5rem' }}
34
21
  >
@@ -3,6 +3,7 @@ import type {
3
3
  BarChartSeries,
4
4
  } from '#uilib/components/ui/BarChart';
5
5
  import { BarChart } from '#uilib/components/ui/BarChart';
6
+ import BarChartGuidance from '#uilib/components/ui/BarChart/AGENT.md';
6
7
  import { PageContentSection, SectionHeader } from '#uilib/components/ui/Page';
7
8
 
8
9
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
@@ -46,21 +47,7 @@ export default function BarChartPage() {
46
47
  subheader="Categorical bar chart with grouped and stacked modes."
47
48
  actions={<DocsHeaderActions />}
48
49
  />
49
- <DocsGuidance
50
- overview="BarChart compares values across categories. Provide rows of data, a category key, and a list of series; choose vertical or horizontal orientation and grouped or stacked mode. Grid, axes, tooltip, and legend follow the shared chart styling."
51
- whenToUse={[
52
- 'To compare discrete categories such as regions, models, or scenarios.',
53
- 'Stacked mode when the per-category total matters as much as the breakdown.',
54
- 'Horizontal orientation when category labels are long or there are many categories.',
55
- ]}
56
- whenNotToUse={[
57
- 'For continuous time series; use ChartAreaInteractive or a line chart instead.',
58
- 'For part-to-whole of a single total; use DonutChart.',
59
- ]}
60
- doNotes={[
61
- 'Start the value axis at zero so bar lengths stay proportional.',
62
- ]}
63
- />
50
+ <DocsGuidance source={BarChartGuidance} />
64
51
  <PageContentSection>
65
52
  <SectionHeader
66
53
  title="Grouped"
@@ -6,6 +6,7 @@ import {
6
6
  BreadcrumbPage as BreadcrumbPageCrumb,
7
7
  BreadcrumbSeparator,
8
8
  } from '#uilib/components/ui/Breadcrumb';
9
+ import BreadcrumbGuidance from '#uilib/components/ui/Breadcrumb/AGENT.md';
9
10
  import { PageContentSection } from '#uilib/components/ui/Page';
10
11
 
11
12
  import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
@@ -21,20 +22,7 @@ export default function BreadcrumbPage() {
21
22
  subheader="Inline navigation trail."
22
23
  actions={<DocsHeaderActions />}
23
24
  />
24
- <DocsGuidance
25
- overview="Breadcrumb shows the user’s location within the page hierarchy as an inline trail of links, with the current page rendered as plain text. Compose it from BreadcrumbList, BreadcrumbItem, BreadcrumbLink, and BreadcrumbSeparator."
26
- whenToUse={[
27
- 'On pages nested two or more levels deep, so users can move back up the hierarchy.',
28
- 'When users arrive deep in the product from search or a direct link and need orientation.',
29
- ]}
30
- whenNotToUse={[
31
- 'On top-level pages with no parent; a trail with one item adds noise.',
32
- 'As a substitute for primary navigation or a stepper in a multi-step flow.',
33
- ]}
34
- doNotes={[
35
- 'Render the current page with BreadcrumbPage rather than a link so it is not clickable.',
36
- ]}
37
- />
25
+ <DocsGuidance source={BreadcrumbGuidance} />
38
26
  <PageContentSection>
39
27
  <Breadcrumb>
40
28
  <BreadcrumbList>
@@ -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}